initial commit - cross reference with 5th port - obviously has compile errors

This commit is contained in:
LetterJay
2016-07-03 02:17:19 -05:00
commit 35a1723e98
4355 changed files with 2221257 additions and 0 deletions
@@ -0,0 +1,40 @@
///AI Upgrades
//Malf Picker
/obj/item/device/malf_upgrade
name = "combat software upgrade"
desc = "A highly illegal, highly dangerous upgrade for artificial intelligence units, granting them a variety of powers as well as the ability to hack APCs."
icon = 'icons/obj/module.dmi'
icon_state = "datadisk3"
/obj/item/device/malf_upgrade/afterattack(mob/living/silicon/ai/AI, mob/user)
if(!istype(AI))
return
if(AI.malf_picker)
AI.malf_picker.processing_time += 50
AI << "<span class='userdanger'>[user] has attempted to upgrade you with combat software that you already possess. You gain 50 points to spend on Malfunction Modules instead.</span>"
else
AI << "<span class='userdanger'>[user] has upgraded you with combat software!</span>"
AI.add_malf_picker()
user << "<span class='notice'>You upgrade [AI]. [src] is consumed in the process.</span>"
qdel(src)
//Lipreading
/obj/item/device/surveillance_upgrade
name = "surveillance software upgrade"
desc = "A software package that will allow an artificial intelligence to 'hear' from its cameras via lip reading."
icon = 'icons/obj/module.dmi'
icon_state = "datadisk3"
/obj/item/device/surveillance_upgrade/afterattack(mob/living/silicon/ai/AI, mob/user)
if(!istype(AI))
return
if(AI.eyeobj)
AI.eyeobj.relay_speech = TRUE
AI << "<span class='userdanger'>[user] has upgraded you with surveillance software!</span>"
AI << "Via a combination of hidden microphones and lip reading software, you are able to use your cameras to listen in on conversations."
user << "<span class='notice'>You upgrade [AI]. [src] is consumed in the process.</span>"
qdel(src)
@@ -0,0 +1,388 @@
/**********************************************************************
Cyborg Spec Items
***********************************************************************/
/obj/item/borg
icon = 'icons/mob/robot_items.dmi'
/obj/item/borg/stun
name = "electrically-charged arm"
icon_state = "elecarm"
/obj/item/borg/stun/attack(mob/living/M, mob/living/silicon/robot/user)
if(!user.cell.use(30)) return
M.Weaken(5)
M.apply_effect(STUTTER, 5)
M.Stun(5)
M.visible_message("<span class='danger'>[user] has prodded [M] with [src]!</span>", \
"<span class='userdanger'>[user] has prodded you with [src]!</span>")
add_logs(user, M, "stunned", src, "(INTENT: [uppertext(user.a_intent)])")
/obj/item/borg/cyborghug
name = "Hugging Module"
icon_state = "hugmodule"
desc = "For when a someone really needs a hug."
var/mode = 0 //0 = Hugs 1 = "Hug" 2 = Shock 3 = CRUSH
var/ccooldown = 0
var/scooldown = 0
var/shockallowed = 0//Can it be a stunarm when emagged. Only PK borgs get this by default.
/obj/item/borg/cyborghug/attack_self(mob/living/user)
if(isrobot(user))
var/mob/living/silicon/robot/P = user
if(P.emagged&&shockallowed == 1)
if(mode < 3)
mode++
else
mode = 0
else if(mode < 1)
mode++
else
mode = 0
switch(mode)
if(0)
user << "Power reset. Hugs!"
if(1)
user << "Power increased!"
if(2)
user << "BZZT. Electrifying arms..."
if(3)
user << "ERROR: ARM ACTUATORS OVERLOADED."
/obj/item/borg/cyborghug/attack(mob/living/M, mob/living/silicon/robot/user)
switch(mode)
if(0)
if(M.health >= 0)
if(ishuman(M))
if(M.lying)
user.visible_message("<span class='notice'>[user] shakes [M] trying to get \him up!</span>", \
"<span class='notice'>You shake [M] trying to get \him up!</span>")
else
user.visible_message("<span class='notice'>[user] hugs [M] to make \him feel better!</span>", \
"<span class='notice'>You hug [M] to make \him feel better!</span>")
if(M.resting)
M.resting = 0
M.update_canmove()
else
user.visible_message("<span class='notice'>[user] pets [M]!</span>", \
"<span class='notice'>You pet [M]!</span>")
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
if(1)
if(M.health >= 0)
if(ishuman(M))
if(M.lying)
user.visible_message("<span class='notice'>[user] shakes [M] trying to get \him up!</span>", \
"<span class='notice'>You shake [M] trying to get \him up!</span>")
else
user.visible_message("<span class='warning'>[user] hugs [M] in a firm bear-hug! [M] looks uncomfortable...</span>", \
"<span class='warning'>You hug [M] firmly to make \him feel better! [M] looks uncomfortable...</span>")
if(M.resting)
M.resting = 0
M.update_canmove()
else
user.visible_message("<span class='warning'>[user] bops [M] on the head!</span>", \
"<span class='warning'>You bop [M] on the head!</span>")
playsound(loc, 'sound/weapons/tap.ogg', 50, 1, -1)
if(2)
if(!scooldown)
if(M.health >= 0)
if(ishuman(M)||ismonkey(M))
M.electrocute_act(5, "[user]", safety = 1)
user.visible_message("<span class='userdanger'>[user] electrocutes [M] with their touch!</span>", \
"<span class='danger'>You electrocute [M] with your touch!</span>")
M.update_canmove()
else
if(!isrobot(M))
M.adjustFireLoss(10)
user.visible_message("<span class='userdanger'>[user] shocks [M]!</span>", \
"<span class='danger'>You shock [M]!</span>")
else
user.visible_message("<span class='userdanger'>[user] shocks [M]. It does not seem to have an effect</span>", \
"<span class='danger'>You shock [M] to no effect.</span>")
playsound(loc, 'sound/effects/sparks2.ogg', 50, 1, -1)
user.cell.charge -= 500
scooldown = 1
spawn(20)
scooldown = 0
if(3)
if(!ccooldown)
if(M.health >= 0)
if(ishuman(M))
user.visible_message("<span class='userdanger'>[user] crushes [M] in their grip!</span>", \
"<span class='danger'>You crush [M] in your grip!</span>")
else
user.visible_message("<span class='userdanger'>[user] crushes [M]!</span>", \
"<span class='danger'>You crush [M]!</span>")
playsound(loc, 'sound/weapons/smash.ogg', 50, 1, -1)
M.adjustBruteLoss(10)
user.cell.charge -= 300
ccooldown = 1
spawn(10)
ccooldown = 0
/obj/item/borg/cyborghug/peacekeeper
shockallowed = 1
/obj/item/borg/charger
name = "power connector"
icon_state = "charger_draw"
flags = NOBLUDGEON
var/mode = "draw"
var/list/charge_machines = list(/obj/machinery/cell_charger, /obj/machinery/recharger,
/obj/machinery/recharge_station, /obj/machinery/mech_bay_recharge_port)
var/list/charge_items = list(/obj/item/weapon/stock_parts/cell, /obj/item/weapon/gun/energy,
)
/obj/item/borg/charger/update_icon()
..()
icon_state = "charger_[mode]"
/obj/item/borg/charger/attack_self(mob/user)
if(mode == "draw")
mode = "charge"
else
mode = "draw"
user << "<span class='notice'>You toggle [src] to \"[mode]\" mode.</span>"
update_icon()
/obj/item/borg/charger/afterattack(obj/item/target, mob/living/silicon/robot/user, proximity_flag)
if(!proximity_flag || !isrobot(user))
return
if(mode == "draw")
if(is_type_in_list(target, charge_machines))
var/obj/machinery/M = target
if((M.stat & (NOPOWER|BROKEN)) || !M.anchored)
user << "<span class='warning'>[M] is unpowered!</span>"
return
user << "<span class='notice'>You connect to [M]'s power line...</span>"
while(do_after(user, 15, target = M, progress = 0))
if(!user || !user.cell || mode != "draw")
return
if((M.stat & (NOPOWER|BROKEN)) || !M.anchored)
break
if(!user.cell.give(150))
break
M.use_power(200)
user << "<span class='notice'>You stop charging youself.</span>"
else if(is_type_in_list(target, charge_items))
var/obj/item/weapon/stock_parts/cell/cell = target
if(!istype(cell))
cell = locate(/obj/item/weapon/stock_parts/cell) in target
if(!cell)
user << "<span class='warning'>[target] has no power cell!</span>"
return
if(istype(target, /obj/item/weapon/gun/energy))
var/obj/item/weapon/gun/energy/E = target
if(!E.can_charge)
user << "<span class='warning'>[target] has no power port!</span>"
return
if(!cell.charge)
user << "<span class='warning'>[target] has no power!</span>"
user << "<span class='notice'>You connect to [target]'s power port...</span>"
while(do_after(user, 15, target = target, progress = 0))
if(!user || !user.cell || mode != "draw")
return
if(!cell || !target)
return
if(cell != target && cell.loc != target)
return
var/draw = min(cell.charge, cell.chargerate*0.5, user.cell.maxcharge-user.cell.charge)
if(!cell.use(draw))
break
if(!user.cell.give(draw))
break
target.update_icon()
user << "<span class='notice'>You stop charging youself.</span>"
else if(is_type_in_list(target, charge_items))
var/obj/item/weapon/stock_parts/cell/cell = target
if(!istype(cell))
cell = locate(/obj/item/weapon/stock_parts/cell) in target
if(!cell)
user << "<span class='warning'>[target] has no power cell!</span>"
return
if(istype(target, /obj/item/weapon/gun/energy))
var/obj/item/weapon/gun/energy/E = target
if(!E.can_charge)
user << "<span class='warning'>[target] has no power port!</span>"
return
if(cell.charge >= cell.maxcharge)
user << "<span class='warning'>[target] is already charged!</span>"
user << "<span class='notice'>You connect to [target]'s power port...</span>"
while(do_after(user, 15, target = target, progress = 0))
if(!user || !user.cell || mode != "charge")
return
if(!cell || !target)
return
if(cell != target && cell.loc != target)
return
var/draw = min(user.cell.charge, cell.chargerate*0.5, cell.maxcharge-cell.charge)
if(!user.cell.use(draw))
break
if(!cell.give(draw))
break
target.update_icon()
user << "<span class='notice'>You stop charging [target].</span>"
/obj/item/device/harmalarm
name = "Sonic Harm Prevention Tool"
desc = "Releases a harmless blast that confuses most organics. For when the harm is JUST TOO MUCH"
icon_state = "megaphone"
var/cooldown = 0
var/emagged = 0
/obj/item/device/harmalarm/emag_act(mob/user)
emagged = !emagged
if(emagged)
user << "<font color='red'>You short out the safeties on the [src]!</font>"
else
user << "<font color='red'>You reset the safeties on the [src]!</font>"
/obj/item/device/harmalarm/attack_self(mob/user)
var/safety = !emagged
if(cooldown > world.time)
user << "<font color='red'>The device is still recharging!</font>"
return
if(isrobot(user))
var/mob/living/silicon/robot/R = user
if(R.cell.charge < 1200)
user << "<font color='red'>You don't have enough charge to do this!</font>"
return
R.cell.charge -= 1000
if(R.emagged)
safety = 0
if(safety == 1)
user.visible_message("<font color='red' size='2'>[user] blares out a near-deafening siren from its speakers!</font>", \
"<span class='userdanger'>The siren pierces your hearing and confuses you!</span>", \
"<span class='danger'>The siren pierces your hearing!</span>")
for(var/mob/living/M in get_hearers_in_view(9, user))
if(iscarbon(M))
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if(istype(H.ears, /obj/item/clothing/ears/earmuffs))
continue
M.confused += 6
M << "<font color='red' size='7'>HUMAN HARM</font>"
playsound(get_turf(src), 'sound/AI/harmalarm.ogg', 70, 3)
cooldown = world.time + 200
log_game("[user.ckey]([user]) used a Cyborg Harm Alarm in ([user.x],[user.y],[user.z])")
if(isrobot(user))
var/mob/living/silicon/robot/R = user
R.connected_ai << "<br><span class='notice'>NOTICE - Peacekeeping 'HARM ALARM' used by: [user]</span><br>"
return
if(safety == 0)
for(var/mob/living/M in get_hearers_in_view(9, user))
if(iscarbon(M))
var/earsafety = 0
if(istype(M, /mob/living/carbon/alien))
continue
if(ishuman(M))
var/mob/living/carbon/human/S = M
if(istype(S.ears, /obj/item/clothing/ears/earmuffs))
continue
if(S.check_ear_prot())
earsafety = 1
if(earsafety)
M.confused += 5
M.stuttering += 10
M.adjustEarDamage(0, 5)
M.Jitter(10)
user.visible_message("<font color='red' size='3'>[user] blares out a sonic screech from its speakers!</font>", \
"<span class='userdanger'>You hear a sharp screech, before your thoughts are interrupted and you find yourself extremely disorientated.</span>", \
"<span class='danger'>You hear a sonic screech and suddenly can't seem to walk straight!")
else
M.Weaken(2)
M.confused += 10
M.stuttering += 15
M.adjustEarDamage(0, 20)
M.Jitter(25)
user.visible_message("<font color='red' size='3'>[user] blares out a sonic screech from its speakers!</font>", \
"<span class='userdanger'>You hear a sharp screech before your thoughts are interrupted and you collapse, your ears ringing!</span>", \
"<span class='danger'>You hear a sonic screech and collapse, your ears riniging!")
M << "<font color='red' size='7'>BZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZT</font>"
playsound(get_turf(src), 'sound/machines/warning-buzzer.ogg', 130, 3)
cooldown = world.time + 600
log_game("[user.ckey]([user]) used an emagged Cyborg Harm Alarm in ([user.x],[user.y],[user.z])")
/**********************************************************************
HUD/SIGHT things
***********************************************************************/
/obj/item/borg/sight
var/sight_mode = null
/obj/item/borg/sight/xray
name = "\proper x-ray Vision"
icon = 'icons/obj/decals.dmi'
icon_state = "securearea"
sight_mode = BORGXRAY
/obj/item/borg/sight/thermal
name = "\proper thermal vision"
sight_mode = BORGTHERM
icon_state = "thermal"
/obj/item/borg/sight/meson
name = "\proper meson vision"
sight_mode = BORGMESON
icon_state = "meson"
/obj/item/borg/sight/material
name = "\proper material vision"
sight_mode = BORGMATERIAL
icon_state = "material"
/obj/item/borg/sight/hud
name = "hud"
var/obj/item/clothing/glasses/hud/hud = null
/obj/item/borg/sight/hud/med
name = "medical hud"
icon_state = "healthhud"
/obj/item/borg/sight/hud/med/New()
..()
hud = new /obj/item/clothing/glasses/hud/health(src)
return
/obj/item/borg/sight/hud/sec
name = "security hud"
icon_state = "securityhud"
/obj/item/borg/sight/hud/sec/New()
..()
hud = new /obj/item/clothing/glasses/hud/security(src)
return
@@ -0,0 +1,379 @@
/obj/item/robot_parts
name = "robot parts"
icon = 'icons/obj/robot_parts.dmi'
force = 4
throwforce = 4
item_state = "buildpipe"
icon_state = "blank"
flags = CONDUCT
slot_flags = SLOT_BELT
var/body_zone
/obj/item/robot_parts/l_arm
name = "cyborg left arm"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
attack_verb = list("slapped", "punched")
icon_state = "l_arm"
body_zone = "l_arm"
/obj/item/robot_parts/r_arm
name = "cyborg right arm"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
attack_verb = list("slapped", "punched")
icon_state = "r_arm"
body_zone = "r_arm"
/obj/item/robot_parts/l_leg
name = "cyborg left leg"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
attack_verb = list("kicked", "stomped")
icon_state = "l_leg"
body_zone = "l_leg"
/obj/item/robot_parts/r_leg
name = "cyborg right leg"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
attack_verb = list("kicked", "stomped")
icon_state = "r_leg"
body_zone = "r_leg"
/obj/item/robot_parts/chest
name = "cyborg torso"
desc = "A heavily reinforced case containing cyborg logic boards, with space for a standard power cell."
icon_state = "chest"
body_zone = "chest"
var/wired = 0
var/obj/item/weapon/stock_parts/cell/cell = null
/obj/item/robot_parts/head
name = "cyborg head"
desc = "A standard reinforced braincase, with spine-plugged neural socket and sensor gimbals."
icon_state = "head"
body_zone = "head"
var/obj/item/device/assembly/flash/handheld/flash1 = null
var/obj/item/device/assembly/flash/handheld/flash2 = null
/obj/item/robot_parts/robot_suit
name = "cyborg endoskeleton"
desc = "A complex metal backbone with standard limb sockets and pseudomuscle anchors."
icon_state = "robo_suit"
var/obj/item/robot_parts/l_arm/l_arm = null
var/obj/item/robot_parts/r_arm/r_arm = null
var/obj/item/robot_parts/l_leg/l_leg = null
var/obj/item/robot_parts/r_leg/r_leg = null
var/obj/item/robot_parts/chest/chest = null
var/obj/item/robot_parts/head/head = null
var/created_name = ""
var/mob/living/silicon/ai/forced_ai
var/locomotion = 1
var/lawsync = 1
var/aisync = 1
var/panel_locked = 1
/obj/item/robot_parts/robot_suit/New()
..()
src.updateicon()
/obj/item/robot_parts/robot_suit/proc/updateicon()
src.cut_overlays()
if(src.l_arm)
src.add_overlay("l_arm+o")
if(src.r_arm)
src.add_overlay("r_arm+o")
if(src.chest)
src.add_overlay("chest+o")
if(src.l_leg)
src.add_overlay("l_leg+o")
if(src.r_leg)
src.add_overlay("r_leg+o")
if(src.head)
src.add_overlay("head+o")
/obj/item/robot_parts/robot_suit/proc/check_completion()
if(src.l_arm && src.r_arm)
if(src.l_leg && src.r_leg)
if(src.chest && src.head)
feedback_inc("cyborg_frames_built",1)
return 1
return 0
/obj/item/robot_parts/robot_suit/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = W
if(!l_arm && !r_arm && !l_leg && !r_leg && !chest && !head)
if (M.use(1))
var/obj/item/weapon/ed209_assembly/B = new /obj/item/weapon/ed209_assembly
B.loc = get_turf(src)
user << "<span class='notice'>You arm the robot frame.</span>"
if (user.get_inactive_hand()==src)
user.unEquip(src)
user.put_in_inactive_hand(B)
qdel(src)
else
user << "<span class='warning'>You need one sheet of metal to start building ED-209!</span>"
return
else if(istype(W, /obj/item/robot_parts/l_leg))
if(src.l_leg)
return
if(!user.unEquip(W))
return
W.loc = src
src.l_leg = W
src.updateicon()
else if(istype(W, /obj/item/robot_parts/r_leg))
if(src.r_leg)
return
if(!user.unEquip(W))
return
W.loc = src
src.r_leg = W
src.updateicon()
else if(istype(W, /obj/item/robot_parts/l_arm))
if(src.l_arm)
return
if(!user.unEquip(W))
return
W.loc = src
src.l_arm = W
src.updateicon()
else if(istype(W, /obj/item/robot_parts/r_arm))
if(src.r_arm)
return
if(!user.unEquip(W))
return
W.loc = src
src.r_arm = W
src.updateicon()
else if(istype(W, /obj/item/robot_parts/chest))
if(src.chest)
return
if(W:wired && W:cell)
if(!user.unEquip(W))
return
W.loc = src
src.chest = W
src.updateicon()
else if(!W:wired)
user << "<span class='warning'>You need to attach wires to it first!</span>"
else
user << "<span class='warning'>You need to attach a cell to it first!</span>"
else if(istype(W, /obj/item/robot_parts/head))
if(src.head)
return
if(W:flash2 && W:flash1)
if(!user.unEquip(W))
return
W.loc = src
src.head = W
src.updateicon()
else
user << "<span class='warning'>You need to attach a flash to it first!</span>"
else if (istype(W, /obj/item/device/multitool))
if(check_completion())
Interact(user)
else
user << "<span class='warning'>The endoskeleton must be assembled before debugging can begin!</span>"
else if(istype(W, /obj/item/device/mmi))
var/obj/item/device/mmi/M = W
if(check_completion())
if(!istype(loc,/turf))
user << "<span class='warning'>You can't put the MMI in, the frame has to be standing on the ground to be perfectly precise!</span>"
return
if(!M.brainmob)
user << "<span class='warning'>Sticking an empty MMI into the frame would sort of defeat the purpose!</span>"
return
var/mob/living/carbon/brain/BM = M.brainmob
if(!BM.key || !BM.mind)
user << "<span class='warning'>The mmi indicates that their mind is completely unresponsive; there's no point!</span>"
return
if(!BM.client) //braindead
user << "<span class='warning'>The mmi indicates that their mind is currently inactive; it might change!</span>"
return
if(BM.stat == DEAD || (M.brain && M.brain.damaged_brain))
user << "<span class='warning'>Sticking a dead brain into the frame would sort of defeat the purpose!</span>"
return
if(jobban_isbanned(BM, "Cyborg"))
user << "<span class='warning'>This MMI does not seem to fit!</span>"
return
if(!user.unEquip(W))
return
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot(get_turf(loc))
if(!O)
return
if(M.hacked || M.clockwork)
aisync = 0
lawsync = 0
var/datum/ai_laws/L
if(M.clockwork)
L = new/datum/ai_laws/ratvar
else
L = new/datum/ai_laws/syndicate_override
O.laws = L
L.associate(O)
O.invisibility = 0
//Transfer debug settings to new mob
O.custom_name = created_name
O.locked = panel_locked
if(!aisync)
lawsync = 0
O.connected_ai = null
else
O.notify_ai(1)
if(forced_ai)
O.connected_ai = forced_ai
if(!lawsync)
O.lawupdate = 0
if(!M.hacked && !M.clockwork)
O.make_laws()
ticker.mode.remove_antag_for_borging(BM.mind)
BM.mind.transfer_to(O)
if(M.clockwork)
add_servant_of_ratvar(O)
if(O.mind && O.mind.special_role)
O.mind.store_memory("As a cyborg, you must obey your silicon laws and master AI above all else. Your objectives will consider you to be dead.")
O << "<span class='userdanger'>You have been robotized!</span>"
O << "<span class='danger'>You must obey your silicon laws and master AI above all else. Your objectives will consider you to be dead.</span>"
O.job = "Cyborg"
O.cell = chest.cell
chest.cell.loc = O
chest.cell = null
W.loc = O//Should fix cybros run time erroring when blown up. It got deleted before, along with the frame.
if(O.mmi) //we delete the mmi created by robot/New()
qdel(O.mmi)
O.mmi = W //and give the real mmi to the borg.
O.updatename()
feedback_inc("cyborg_birth",1)
src.loc = O
O.robot_suit = src
if(!locomotion)
O.lockcharge = 1
O.update_canmove()
O << "<span class='warning'>Error: Servo motors unresponsive.</span>"
else
user << "<span class='warning'>The MMI must go in after everything else!</span>"
else if(istype(W,/obj/item/weapon/pen))
user << "<span class='warning'>You need to use a multitool to name [src]!</span>"
else
return ..()
/obj/item/robot_parts/robot_suit/proc/Interact(mob/user)
var/t1 = text("Designation: <A href='?src=\ref[];Name=1'>[(created_name ? "[created_name]" : "Default Cyborg")]</a><br>\n",src)
t1 += text("Master AI: <A href='?src=\ref[];Master=1'>[(forced_ai ? "[forced_ai.name]" : "Automatic")]</a><br><br>\n",src)
t1 += text("LawSync Port: <A href='?src=\ref[];Law=1'>[(lawsync ? "Open" : "Closed")]</a><br>\n",src)
t1 += text("AI Connection Port: <A href='?src=\ref[];AI=1'>[(aisync ? "Open" : "Closed")]</a><br>\n",src)
t1 += text("Servo Motor Functions: <A href='?src=\ref[];Loco=1'>[(locomotion ? "Unlocked" : "Locked")]</a><br>\n",src)
t1 += text("Panel Lock: <A href='?src=\ref[];Panel=1'>[(panel_locked ? "Engaged" : "Disengaged")]</a><br>\n",src)
var/datum/browser/popup = new(user, "robotdebug", "Cyborg Boot Debug", 310, 220)
popup.set_content(t1)
popup.open()
/obj/item/robot_parts/robot_suit/Topic(href, href_list)
if(usr.lying || usr.stat || usr.stunned || !Adjacent(usr))
return
var/mob/living/living_user = usr
var/obj/item/item_in_hand = living_user.get_active_hand()
if(!istype(item_in_hand, /obj/item/device/multitool))
living_user << "<span class='warning'>You need a multitool!</span>"
return
if(href_list["Name"])
var/new_name = reject_bad_name(input(usr, "Enter new designation. Set to blank to reset to default.", "Cyborg Debug", src.created_name),1)
if(!in_range(src, usr) && src.loc != usr)
return
if(new_name)
created_name = new_name
else
created_name = ""
else if(href_list["Master"])
forced_ai = select_active_ai(usr)
if(!forced_ai)
usr << "<span class='error'>No active AIs detected.</span>"
else if(href_list["Law"])
lawsync = !lawsync
else if(href_list["AI"])
aisync = !aisync
else if(href_list["Loco"])
locomotion = !locomotion
else if(href_list["Panel"])
panel_locked = !panel_locked
add_fingerprint(usr)
Interact(usr)
return
/obj/item/robot_parts/chest/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weapon/stock_parts/cell))
if(src.cell)
user << "<span class='warning'>You have already inserted a cell!</span>"
return
else
if(!user.unEquip(W))
return
W.loc = src
src.cell = W
user << "<span class='notice'>You insert the cell.</span>"
else if(istype(W, /obj/item/stack/cable_coil))
if(src.wired)
user << "<span class='warning'>You have already inserted wire!</span>"
return
var/obj/item/stack/cable_coil/coil = W
if (coil.use(1))
src.wired = 1
user << "<span class='notice'>You insert the wire.</span>"
else
user << "<span class='warning'>You need one length of coil to wire it!</span>"
else
return ..()
/obj/item/robot_parts/head/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/device/assembly/flash/handheld))
var/obj/item/device/assembly/flash/handheld/F = W
if(src.flash1 && src.flash2)
user << "<span class='warning'>You have already inserted the eyes!</span>"
return
else if(F.crit_fail)
user << "<span class='warning'>You can't use a broken flash!</span>"
return
else
if(!user.unEquip(W))
return
F.loc = src
if(src.flash1)
src.flash2 = F
else
src.flash1 = F
user << "<span class='notice'>You insert the flash into the eye socket.</span>"
else
return ..()
@@ -0,0 +1,341 @@
// robot_upgrades.dm
// Contains various borg upgrades.
/obj/item/borg/upgrade
name = "borg upgrade module."
desc = "Protected by FRM."
icon = 'icons/obj/module.dmi'
icon_state = "cyborg_upgrade"
origin_tech = "programming=2"
var/locked = 0
var/installed = 0
var/require_module = 0
var/module_type = null
/obj/item/borg/upgrade/proc/action(mob/living/silicon/robot/R)
if(R.stat == DEAD)
usr << "<span class='notice'>[src] will not function on a deceased cyborg.</span>"
return 1
if(module_type && !istype(R.module, module_type))
R << "Upgrade mounting error! No suitable hardpoint detected!"
usr << "There's no mounting point for the module!"
return 1
/obj/item/borg/upgrade/reset
name = "cyborg module reset board"
desc = "Used to reset a cyborg's module. Destroys any other upgrades applied to the cyborg."
icon_state = "cyborg_upgrade1"
require_module = 1
/obj/item/borg/upgrade/reset/action(mob/living/silicon/robot/R)
if(..())
return
R.notify_ai(2)
R.uneq_all()
R.hands.icon_state = "nomod"
R.icon_state = "robot"
qdel(R.module)
R.module = null
R.modtype = "robot"
R.designation = "Default"
R.updatename("Default")
R.update_icons()
R.update_headlamp()
R.speed = 0 // Remove upgrades.
R.ionpulse = FALSE
R.magpulse = FALSE
R.weather_immunities = initial(R.weather_immunities)
R.status_flags |= CANPUSH
return 1
/obj/item/borg/upgrade/rename
name = "cyborg reclassification board"
desc = "Used to rename a cyborg."
icon_state = "cyborg_upgrade1"
var/heldname = "default name"
/obj/item/borg/upgrade/rename/attack_self(mob/user)
heldname = stripped_input(user, "Enter new robot name", "Cyborg Reclassification", heldname, MAX_NAME_LEN)
/obj/item/borg/upgrade/rename/action(mob/living/silicon/robot/R)
if(..())
return
R.fully_replace_character_name(R.name, heldname)
return 1
/obj/item/borg/upgrade/restart
name = "cyborg emergency reboot module"
desc = "Used to force a reboot of a disabled-but-repaired cyborg, bringing it back online."
icon_state = "cyborg_upgrade1"
/obj/item/borg/upgrade/restart/action(mob/living/silicon/robot/R)
if(R.health < 0)
usr << "<span class='warning'>You have to repair the cyborg before using this module!</span>"
return 0
if(!R.key)
for(var/mob/dead/observer/ghost in player_list)
if(ghost.mind && ghost.mind.current == R)
R.key = ghost.key
R.revive()
return 1
/obj/item/borg/upgrade/vtec
name = "cyborg VTEC module"
desc = "Used to kick in a cyborg's VTEC systems, increasing their speed."
icon_state = "cyborg_upgrade2"
require_module = 1
origin_tech = "engineering=4;materials=5;programming=4"
/obj/item/borg/upgrade/vtec/action(mob/living/silicon/robot/R)
if(..())
return
if(R.speed < 0)
R << "<span class='notice'>A VTEC unit is already installed!</span>"
usr << "<span class='notice'>There's no room for another VTEC unit!</span>"
return
R.speed = -2 // Gotta go fast.
return 1
/obj/item/borg/upgrade/disablercooler
name = "cyborg rapid disabler cooling module"
desc = "Used to cool a mounted disabler, increasing the potential current in it and thus its recharge rate."
icon_state = "cyborg_upgrade3"
require_module = 1
module_type = /obj/item/weapon/robot_module/security
origin_tech = "engineering=4;powerstorage=4;combat=4"
/obj/item/borg/upgrade/disablercooler/action(mob/living/silicon/robot/R)
if(..())
return
var/obj/item/weapon/gun/energy/disabler/cyborg/T = locate() in R.module.modules
if(!T)
usr << "<span class='notice'>There's no disabler in this unit!</span>"
return
if(T.charge_delay <= 2)
R << "<span class='notice'>A cooling unit is already installed!</span>"
usr << "<span class='notice'>There's no room for another cooling unit!</span>"
return
T.charge_delay = max(2 , T.charge_delay - 4)
return 1
/obj/item/borg/upgrade/thrusters
name = "ion thruster upgrade"
desc = "A energy-operated thruster system for cyborgs."
icon_state = "cyborg_upgrade3"
origin_tech = "engineering=4;powerstorage=4"
/obj/item/borg/upgrade/thrusters/action(mob/living/silicon/robot/R)
if(..())
return
if(R.ionpulse)
usr << "<span class='notice'>This unit already has ion thrusters installed!</span>"
return
R.ionpulse = TRUE
return 1
/obj/item/borg/upgrade/ddrill
name = "mining cyborg diamond drill"
desc = "A diamond drill replacement for the mining module's standard drill."
icon_state = "cyborg_upgrade3"
require_module = 1
module_type = /obj/item/weapon/robot_module/miner
origin_tech = "engineering=4;materials=5"
/obj/item/borg/upgrade/ddrill/action(mob/living/silicon/robot/R)
if(..())
return
for(var/obj/item/weapon/pickaxe/drill/cyborg/D in R.module.modules)
qdel(D)
for(var/obj/item/weapon/shovel/S in R.module.modules)
qdel(S)
R.module.modules += new /obj/item/weapon/pickaxe/drill/cyborg/diamond(R.module)
R.module.rebuild()
return 1
/obj/item/borg/upgrade/soh
name = "mining cyborg satchel of holding"
desc = "A satchel of holding replacement for mining cyborg's ore satchel module."
icon_state = "cyborg_upgrade3"
require_module = 1
module_type = /obj/item/weapon/robot_module/miner
origin_tech = "engineering=4;materials=4;bluespace=4"
/obj/item/borg/upgrade/soh/action(mob/living/silicon/robot/R)
if(..())
return
for(var/obj/item/weapon/storage/bag/ore/cyborg/S in R.module.modules)
qdel(S)
R.module.modules += new /obj/item/weapon/storage/bag/ore/holding(R.module)
R.module.rebuild()
return 1
/obj/item/borg/upgrade/hyperka
name = "mining cyborg hyper-kinetic accelerator"
desc = "A satchel of holding replacement for mining cyborg's ore satchel module."
icon_state = "cyborg_upgrade3"
require_module = 1
module_type = /obj/item/weapon/robot_module/miner
origin_tech = "materials=6;powerstorage=4;engineering=4;magnets=4;combat=4"
/obj/item/borg/upgrade/hyperka/action(mob/living/silicon/robot/R)
if(..())
return
for(var/obj/item/weapon/gun/energy/kinetic_accelerator/cyborg/H in R.module.modules)
qdel(H)
R.module.modules += new /obj/item/weapon/gun/energy/kinetic_accelerator/hyper/cyborg(R.module)
R.module.rebuild()
return 1
/obj/item/borg/upgrade/syndicate
name = "illegal equipment module"
desc = "Unlocks the hidden, deadlier functions of a cyborg"
icon_state = "cyborg_upgrade3"
require_module = 1
origin_tech = "combat=4;syndicate=1"
/obj/item/borg/upgrade/syndicate/action(mob/living/silicon/robot/R)
if(..())
return
if(R.emagged)
return
R.SetEmagged(1)
return 1
/obj/item/borg/upgrade/lavaproof
name = "mining cyborg lavaproof tracks"
desc = "An upgrade kit to apply specialized coolant systems and insulation layers to mining cyborg tracks, enabling them to withstand exposure to molten rock."
icon_state = "ash_plating"
require_module = 1
module_type = /obj/item/weapon/robot_module/miner
origin_tech = "engineering=4;materials=4;plasmatech=4"
/obj/item/borg/upgrade/lavaproof/action(mob/living/silicon/robot/R)
if(..())
return
R.weather_immunities += "lava"
return 1
/obj/item/borg/upgrade/selfrepair
name = "self-repair module"
desc = "This module will repair the cyborg over time."
icon_state = "cyborg_upgrade5"
require_module = 1
var/repair_amount = -1
var/repair_tick = 1
var/msg_cooldown = 0
var/on = 0
var/powercost = 10
var/mob/living/silicon/robot/cyborg
/obj/item/borg/upgrade/selfrepair/action(mob/living/silicon/robot/R)
if(..())
return
var/obj/item/borg/upgrade/selfrepair/U = locate() in R
if(U)
usr << "<span class='warning'>This unit is already equipped with a self-repair module.</span>"
return 0
cyborg = R
icon_state = "selfrepair_off"
var/datum/action/A = new /datum/action/item_action/toggle(src)
A.Grant(R)
return 1
/obj/item/borg/upgrade/selfrepair/ui_action_click()
on = !on
if(on)
cyborg << "<span class='notice'>You activate the self-repair module.</span>"
START_PROCESSING(SSobj, src)
else
cyborg << "<span class='notice'>You deactivate the self-repair module.</span>"
STOP_PROCESSING(SSobj, src)
update_icon()
/obj/item/borg/upgrade/selfrepair/update_icon()
if(cyborg)
icon_state = "selfrepair_[on ? "on" : "off"]"
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
else
icon_state = "cyborg_upgrade5"
/obj/item/borg/upgrade/selfrepair/proc/deactivate()
STOP_PROCESSING(SSobj, src)
on = FALSE
update_icon()
/obj/item/borg/upgrade/selfrepair/process()
if(!repair_tick)
repair_tick = 1
return
if(cyborg && (cyborg.stat != DEAD) && on)
if(!cyborg.cell)
cyborg << "<span class='warning'>Self-repair module deactivated. Please, insert the power cell.</span>"
deactivate()
return
if(cyborg.cell.charge < powercost * 2)
cyborg << "<span class='warning'>Self-repair module deactivated. Please recharge.</span>"
deactivate()
return
if(cyborg.health < cyborg.maxHealth)
if(cyborg.health < 0)
repair_amount = -2.5
powercost = 30
else
repair_amount = -1
powercost = 10
cyborg.adjustBruteLoss(repair_amount)
cyborg.adjustFireLoss(repair_amount)
cyborg.updatehealth()
cyborg.cell.use(powercost)
else
cyborg.cell.use(5)
repair_tick = 0
if((world.time - 2000) > msg_cooldown )
var/msgmode = "standby"
if(cyborg.health < 0)
msgmode = "critical"
else if(cyborg.health < cyborg.maxHealth)
msgmode = "normal"
cyborg << "<span class='notice'>Self-repair is active in <span class='boldnotice'>[msgmode]</span> mode.</span>"
msg_cooldown = world.time
else
deactivate()