Files
Paradise/code/game/objects/items/robot/robot_upgrades.dm

224 lines
6.5 KiB
Plaintext

// robot_upgrades.dm
// Contains various borg upgrades.
/obj/item/borg/upgrade
name = "A borg upgrade module."
desc = "Protected by FRM."
icon = 'icons/obj/module.dmi'
icon_state = "cyborg_upgrade"
var/construction_time = 120
var/construction_cost = list("metal"=10000)
var/locked = 0
var/require_module = 0
var/installed = 0
/obj/item/borg/upgrade/proc/action(var/mob/living/silicon/robot/R)
if(R.stat == DEAD)
usr << "\red The [src] will not function on a deceased robot."
return 1
return 0
/obj/item/borg/upgrade/reset
name = "robotic module reset board"
desc = "Used to reset a cyborg's module. Destroys any other upgrades applied to the robot."
icon_state = "cyborg_upgrade1"
require_module = 1
/obj/item/borg/upgrade/reset/action(var/mob/living/silicon/robot/R)
if(..()) return 0
R.uneq_all()
R.hands.icon_state = "nomod"
R.icon_state = "robot"
qdel(R.module)
R.module = null
R.camera.network.Remove(list("Engineering","Medical","Mining Outpost"))
R.updatename("Default")
R.status_flags |= CANPUSH
R.languages = list()
R.speech_synthesizer_langs = list()
R.notify_ai(2)
R.jetpackoverlay = 0
R.update_icons()
R.update_headlamp()
R.add_language("Robot Talk", 1)
return 1
/obj/item/borg/upgrade/rename
name = "robot reclassification board"
desc = "Used to rename a cyborg."
icon_state = "cyborg_upgrade1"
construction_cost = list("metal"=35000)
var/heldname = "default name"
/obj/item/borg/upgrade/rename/attack_self(mob/user as mob)
heldname = stripped_input(user, "Enter new robot name", "Robot Reclassification", heldname, MAX_NAME_LEN)
/obj/item/borg/upgrade/rename/action(var/mob/living/silicon/robot/R)
if(..()) return 0
R.notify_ai(3, R.name, heldname)
R.name = heldname
R.custom_name = heldname
R.real_name = heldname
return 1
/obj/item/borg/upgrade/restart
name = "robot emergency restart module"
desc = "Used to force a restart of a disabled-but-repaired robot, bringing it back online."
construction_cost = list("metal"=60000 , "glass"=5000)
icon_state = "cyborg_upgrade1"
/obj/item/borg/upgrade/restart/action(var/mob/living/silicon/robot/R)
if(R.health < 0)
usr << "You have to repair the robot before using this module!"
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.stat = CONSCIOUS
dead_mob_list -= R //please never forget this ever kthx
living_mob_list += R
R.notify_ai(1)
return 1
/obj/item/borg/upgrade/vtec
name = "robotic VTEC Module"
desc = "Used to kick in a robot's VTEC systems, increasing their speed."
construction_cost = list("metal"=80000 , "glass"=6000 , "gold"= 5000)
icon_state = "cyborg_upgrade2"
require_module = 1
/obj/item/borg/upgrade/vtec/action(var/mob/living/silicon/robot/R)
if(..()) return 0
if(R.speed == -1)
return 0
R.speed--
return 1
/obj/item/borg/upgrade/disablercooler
name = "robotic Rapid Disabler Cooling Module"
desc = "Used to cool a mounted disabler, increasing the potential current in it and thus its recharge rate."
construction_cost = list("metal"=80000 , "glass"=6000 , "gold"= 2000, "diamond" = 500)
icon_state = "cyborg_upgrade3"
require_module = 1
/obj/item/borg/upgrade/disablercooler/action(var/mob/living/silicon/robot/R)
if(..()) return 0
if(!istype(R.module, /obj/item/weapon/robot_module/security))
R << "Upgrade mounting error! No suitable hardpoint detected!"
usr << "There's no mounting point for the module!"
return 0
var/obj/item/weapon/gun/energy/disabler/cyborg/T = locate() in R.module
if(!T)
T = locate() in R.module.contents
if(!T)
T = locate() in R.module.modules
if(!T)
usr << "This robot has had its disabler removed!"
return 0
if(T.recharge_time <= 2)
R << "Maximum cooling achieved for this hardpoint!"
usr << "There's no room for another cooling unit!"
return 0
else
T.recharge_time = max(2 , T.recharge_time - 4)
return 1
/obj/item/borg/upgrade/jetpack
name = "mining robot jetpack"
desc = "A carbon dioxide jetpack suitable for low-gravity mining operations."
construction_cost = list("metal"=10000,"plasma"=15000,"uranium" = 20000)
icon_state = "cyborg_upgrade3"
require_module = 1
/obj/item/borg/upgrade/jetpack/action(var/mob/living/silicon/robot/R)
if(..()) return 0
if(!istype(R.module, /obj/item/weapon/robot_module/miner))
R << "Upgrade mounting error! No suitable hardpoint detected!"
usr << "There's no mounting point for the module!"
return 0
else
R.module.modules += new/obj/item/weapon/tank/jetpack/carbondioxide
for(var/obj/item/weapon/tank/jetpack/carbondioxide in R.module.modules)
R.internals = src
R.jetpackoverlay = 1
R.update_icons()
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
/obj/item/borg/upgrade/ddrill/action(var/mob/living/silicon/robot/R)
if(..()) return 0
if(!istype(R.module, /obj/item/weapon/robot_module/miner))
R << "Upgrade mounting error! No suitable hardpoint detected!"
usr << "There's no mounting point for the module!"
return 0
else
for(var/obj/item/weapon/pickaxe/drill/cyborg/D in R.module.modules)
R.module.modules -= D
qdel(D)
for(var/obj/item/weapon/shovel/S in R.module.modules)
R.module.modules -= S
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
/obj/item/borg/upgrade/soh/action(var/mob/living/silicon/robot/R)
if(..()) return 0
if(!istype(R.module, /obj/item/weapon/robot_module/miner))
R << "Upgrade mounting error! No suitable hardpoint detected!"
usr << "There's no mounting point for the module!"
return 0
else
for(var/obj/item/weapon/storage/bag/ore/cyborg/S in R.module.modules)
R.module.modules -= S
qdel(S)
R.module.modules += new /obj/item/weapon/storage/bag/ore/holding/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 robot"
construction_cost = list("metal"=10000,"glass"=15000,"diamond" = 10000)
icon_state = "cyborg_upgrade3"
require_module = 1
/obj/item/borg/upgrade/syndicate/action(var/mob/living/silicon/robot/R)
if(..()) return 0
if(R.emagged == 1)
return 0
R.emagged = 1
return 1