game folder

This commit is contained in:
Poojawa
2018-04-23 00:17:28 -05:00
parent e5f9765d2a
commit cc6b320f83
64 changed files with 1188 additions and 3020 deletions
+265 -186
View File
@@ -14,14 +14,20 @@
// if module is reset
var/one_use = FALSE
/obj/item/borg/upgrade/proc/action(mob/living/silicon/robot/R)
/obj/item/borg/upgrade/proc/action(mob/living/silicon/robot/R, user = usr)
if(R.stat == DEAD)
to_chat(usr, "<span class='notice'>[src] will not function on a deceased cyborg.</span>")
return 1
to_chat(user, "<span class='notice'>[src] will not function on a deceased cyborg.</span>")
return FALSE
if(module_type && !istype(R.module, module_type))
to_chat(R, "Upgrade mounting error! No suitable hardpoint detected!")
to_chat(usr, "There's no mounting point for the module!")
return 1
to_chat(user, "There's no mounting point for the module!")
return FALSE
return TRUE
/obj/item/borg/upgrade/proc/deactivate(mob/living/silicon/robot/R, user = usr)
if (!(src in R.upgrades))
return FALSE
return TRUE
/obj/item/borg/upgrade/rename
name = "cyborg reclassification board"
@@ -34,18 +40,13 @@
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
var/oldname = R.real_name
R.custom_name = heldname
R.updatename()
if(oldname == R.real_name)
R.notify_ai(RENAME, oldname, R.real_name)
return 1
. = ..()
if(.)
var/oldname = R.real_name
R.custom_name = heldname
R.updatename()
if(oldname == R.real_name)
R.notify_ai(RENAME, oldname, R.real_name)
/obj/item/borg/upgrade/restart
name = "cyborg emergency reboot module"
@@ -53,10 +54,10 @@
icon_state = "cyborg_upgrade1"
one_use = TRUE
/obj/item/borg/upgrade/restart/action(mob/living/silicon/robot/R)
/obj/item/borg/upgrade/restart/action(mob/living/silicon/robot/R, user = usr)
if(R.health < 0)
to_chat(usr, "<span class='warning'>You have to repair the cyborg before using this module!</span>")
return 0
to_chat(user, "<span class='warning'>You have to repair the cyborg before using this module!</span>")
return FALSE
if(R.mind)
R.mind.grab_ghost()
@@ -64,25 +65,26 @@
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
/obj/item/borg/upgrade/vtec/action(mob/living/silicon/robot/R)
if(..())
return
if(R.speed < 0)
to_chat(R, "<span class='notice'>A VTEC unit is already installed!</span>")
to_chat(usr, "<span class='notice'>There's no room for another VTEC unit!</span>")
return
/obj/item/borg/upgrade/vtec/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
if(R.speed < 0)
to_chat(R, "<span class='notice'>A VTEC unit is already installed!</span>")
to_chat(user, "<span class='notice'>There's no room for another VTEC unit!</span>")
return FALSE
R.speed = -2 // Gotta go fast.
R.speed = -2 // Gotta go fast.
return 1
/obj/item/borg/upgrade/vtec/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
R.speed = initial(R.speed)
/obj/item/borg/upgrade/disablercooler
name = "cyborg rapid disabler cooling module"
@@ -91,38 +93,46 @@
require_module = 1
module_type = /obj/item/robot_module/security
/obj/item/borg/upgrade/disablercooler/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/disablercooler/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
var/obj/item/gun/energy/disabler/cyborg/T = locate() in R.module.modules
if(!T)
to_chat(user, "<span class='notice'>There's no disabler in this unit!</span>")
return FALSE
if(T.charge_delay <= 2)
to_chat(R, "<span class='notice'>A cooling unit is already installed!</span>")
to_chat(user, "<span class='notice'>There's no room for another cooling unit!</span>")
return FALSE
var/obj/item/gun/energy/disabler/cyborg/T = locate() in R.module.modules
if(!T)
to_chat(usr, "<span class='notice'>There's no disabler in this unit!</span>")
return
if(T.charge_delay <= 2)
to_chat(R, "<span class='notice'>A cooling unit is already installed!</span>")
to_chat(usr, "<span class='notice'>There's no room for another cooling unit!</span>")
return
T.charge_delay = max(2 , T.charge_delay - 4)
T.charge_delay = max(2 , T.charge_delay - 4)
return 1
/obj/item/borg/upgrade/disablercooler/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
var/obj/item/gun/energy/disabler/cyborg/T = locate() in R.module.modules
if(!T)
return FALSE
T.charge_delay = initial(T.charge_delay)
/obj/item/borg/upgrade/thrusters
name = "ion thruster upgrade"
desc = "An energy-operated thruster system for cyborgs."
icon_state = "cyborg_upgrade3"
/obj/item/borg/upgrade/thrusters/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/thrusters/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
if(R.ionpulse)
to_chat(user, "<span class='notice'>This unit already has ion thrusters installed!</span>")
return FALSE
if(R.ionpulse)
to_chat(usr, "<span class='notice'>This unit already has ion thrusters installed!</span>")
return
R.ionpulse = TRUE
R.ionpulse = TRUE
return 1
/obj/item/borg/upgrade/thrusters/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
R.ionpulse = FALSE
/obj/item/borg/upgrade/ddrill
name = "mining cyborg diamond drill"
@@ -131,19 +141,30 @@
require_module = 1
module_type = /obj/item/robot_module/miner
/obj/item/borg/upgrade/ddrill/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/ddrill/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
for(var/obj/item/pickaxe/drill/cyborg/D in R.module)
R.module.remove_module(D, TRUE)
for(var/obj/item/shovel/S in R.module)
R.module.remove_module(S, TRUE)
for(var/obj/item/pickaxe/drill/cyborg/D in R.module)
R.module.remove_module(D, TRUE)
for(var/obj/item/shovel/S in R.module)
R.module.remove_module(S, TRUE)
var/obj/item/pickaxe/drill/cyborg/diamond/DD = new /obj/item/pickaxe/drill/cyborg/diamond(R.module)
R.module.basic_modules += DD
R.module.add_module(DD, FALSE, TRUE)
var/obj/item/pickaxe/drill/cyborg/diamond/DD = new /obj/item/pickaxe/drill/cyborg/diamond(R.module)
R.module.basic_modules += DD
R.module.add_module(DD, FALSE, TRUE)
return 1
/obj/item/borg/upgrade/ddrill/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
for(var/obj/item/pickaxe/drill/cyborg/diamond/DD in R.module)
R.module.remove_module(DD, TRUE)
var/obj/item/pickaxe/drill/cyborg/D = new (R.module)
R.module.basic_modules += D
R.module.add_module(D, FALSE, TRUE)
var/obj/item/shovel/S = new (R.module)
R.module.basic_modules += S
R.module.add_module(S, FALSE, TRUE)
/obj/item/borg/upgrade/soh
name = "mining cyborg satchel of holding"
@@ -153,16 +174,24 @@
module_type = /obj/item/robot_module/miner
/obj/item/borg/upgrade/soh/action(mob/living/silicon/robot/R)
if(..())
return
. = ..()
if(.)
for(var/obj/item/storage/bag/ore/cyborg/S in R.module)
R.module.remove_module(S, TRUE)
for(var/obj/item/storage/bag/ore/cyborg/S in R.module)
R.module.remove_module(S, TRUE)
var/obj/item/storage/bag/ore/holding/H = new /obj/item/storage/bag/ore/holding(R.module)
R.module.basic_modules += H
R.module.add_module(H, FALSE, TRUE)
var/obj/item/storage/bag/ore/holding/H = new /obj/item/storage/bag/ore/holding(R.module)
R.module.basic_modules += H
R.module.add_module(H, FALSE, TRUE)
return 1
/obj/item/borg/upgrade/soh/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
for(var/obj/item/storage/bag/ore/holding/H in R.module)
R.module.remove_module(H, TRUE)
var/obj/item/storage/bag/ore/cyborg/S = new (R.module)
R.module.basic_modules += S
R.module.add_module(S, FALSE, TRUE)
/obj/item/borg/upgrade/syndicate
name = "illegal equipment module"
@@ -170,16 +199,20 @@
icon_state = "cyborg_upgrade3"
require_module = 1
/obj/item/borg/upgrade/syndicate/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/syndicate/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
if(R.emagged)
return FALSE
if(R.emagged)
return
R.SetEmagged(1)
R.SetEmagged(1)
return TRUE
return 1
/obj/item/borg/upgrade/syndicate/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
R.SetEmagged(FALSE)
/obj/item/borg/upgrade/lavaproof
name = "mining cyborg lavaproof tracks"
@@ -189,11 +222,15 @@
require_module = 1
module_type = /obj/item/robot_module/miner
/obj/item/borg/upgrade/lavaproof/action(mob/living/silicon/robot/R)
if(..())
return
R.weather_immunities += "lava"
return 1
/obj/item/borg/upgrade/lavaproof/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
R.weather_immunities += "lava"
/obj/item/borg/upgrade/lavaproof/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
R.weather_immunities -= "lava"
/obj/item/borg/upgrade/selfrepair
name = "self-repair module"
@@ -208,20 +245,26 @@
var/mob/living/silicon/robot/cyborg
var/datum/action/toggle_action
/obj/item/borg/upgrade/selfrepair/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/selfrepair/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
var/obj/item/borg/upgrade/selfrepair/U = locate() in R
if(U)
to_chat(user, "<span class='warning'>This unit is already equipped with a self-repair module.</span>")
return FALSE
var/obj/item/borg/upgrade/selfrepair/U = locate() in R
if(U)
to_chat(usr, "<span class='warning'>This unit is already equipped with a self-repair module.</span>")
return 0
cyborg = R
icon_state = "selfrepair_off"
toggle_action = new /datum/action/item_action/toggle(src)
toggle_action.Grant(R)
cyborg = R
icon_state = "selfrepair_off"
toggle_action = new /datum/action/item_action/toggle(src)
toggle_action.Grant(R)
return 1
/obj/item/borg/upgrade/selfrepair/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
toggle_action.Remove(cyborg)
QDEL_NULL(toggle_action)
cyborg = null
deactivate_sr()
/obj/item/borg/upgrade/selfrepair/dropped()
addtimer(CALLBACK(src, .proc/check_dropped), 1)
@@ -231,7 +274,7 @@
toggle_action.Remove(cyborg)
QDEL_NULL(toggle_action)
cyborg = null
deactivate()
deactivate_sr()
/obj/item/borg/upgrade/selfrepair/ui_action_click()
on = !on
@@ -252,7 +295,7 @@
else
icon_state = "cyborg_upgrade5"
/obj/item/borg/upgrade/selfrepair/proc/deactivate()
/obj/item/borg/upgrade/selfrepair/proc/deactivate_sr()
STOP_PROCESSING(SSobj, src)
on = FALSE
update_icon()
@@ -265,12 +308,12 @@
if(cyborg && (cyborg.stat != DEAD) && on)
if(!cyborg.cell)
to_chat(cyborg, "<span class='warning'>Self-repair module deactivated. Please, insert the power cell.</span>")
deactivate()
deactivate_sr()
return
if(cyborg.cell.charge < powercost * 2)
to_chat(cyborg, "<span class='warning'>Self-repair module deactivated. Please recharge.</span>")
deactivate()
deactivate_sr()
return
if(cyborg.health < cyborg.maxHealth)
@@ -297,7 +340,7 @@
to_chat(cyborg, "<span class='notice'>Self-repair is active in <span class='boldnotice'>[msgmode]</span> mode.</span>")
msg_cooldown = world.time
else
deactivate()
deactivate_sr()
/obj/item/borg/upgrade/hypospray
name = "medical cyborg hypospray advanced synthesiser"
@@ -308,15 +351,21 @@
module_type = /obj/item/robot_module/medical
var/list/additional_reagents = list()
/obj/item/borg/upgrade/hypospray/action(mob/living/silicon/robot/R)
if(..())
return
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
if(H.accepts_reagent_upgrades)
for(var/re in additional_reagents)
H.add_reagent(re)
/obj/item/borg/upgrade/hypospray/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
if(H.accepts_reagent_upgrades)
for(var/re in additional_reagents)
H.add_reagent(re)
return 1
/obj/item/borg/upgrade/hypospray/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
if(H.accepts_reagent_upgrades)
for(var/re in additional_reagents)
H.del_reagent(re)
/obj/item/borg/upgrade/hypospray/expanded
name = "medical cyborg expanded hypospray"
@@ -338,19 +387,22 @@
pierce armor and thick material."
icon_state = "cyborg_upgrade3"
/obj/item/borg/upgrade/piercing_hypospray/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/piercing_hypospray/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
var/found_hypo = FALSE
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
H.bypass_protection = TRUE
found_hypo = TRUE
var/found_hypo = FALSE
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
H.bypass_protection = TRUE
found_hypo = TRUE
if(!found_hypo)
return FALSE
if(!found_hypo)
return
return 1
/obj/item/borg/upgrade/piercing_hypospray/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
H.bypass_protection = initial(H.bypass_protection)
/obj/item/borg/upgrade/defib
name = "medical cyborg defibrillator"
@@ -360,66 +412,81 @@
require_module = 1
module_type = /obj/item/robot_module/medical
/obj/item/borg/upgrade/defib/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/defib/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
var/obj/item/twohanded/shockpaddles/cyborg/S = new(R.module)
R.module.basic_modules += S
R.module.add_module(S, FALSE, TRUE)
var/obj/item/twohanded/shockpaddles/cyborg/S = new(R.module)
R.module.basic_modules += S
R.module.add_module(S, FALSE, TRUE)
return 1
/obj/item/borg/upgrade/defib/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
var/obj/item/twohanded/shockpaddles/cyborg/S = locate() in R.module
R.module.remove_module(S, TRUE)
/obj/item/borg/upgrade/ai
name = "B.O.R.I.S. module"
desc = "Bluespace Optimized Remote Intelligence Synchronization. An uplink device which takes the place of an MMI in cyborg endoskeletons, creating a robotic shell controlled by an AI."
icon_state = "boris"
/obj/item/borg/upgrade/ai/action(mob/living/silicon/robot/R)
if(..())
return
if(R.shell)
to_chat(usr, "<span class='warning'>This unit is already an AI shell!</span>")
return
if(R.key) //You cannot replace a player unless the key is completely removed.
to_chat(usr, "<span class='warning'>Intelligence patterns detected in this [R.braintype]. Aborting.</span>")
return
/obj/item/borg/upgrade/ai/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
if(R.shell)
to_chat(user, "<span class='warning'>This unit is already an AI shell!</span>")
return FALSE
if(R.key) //You cannot replace a player unless the key is completely removed.
to_chat(user, "<span class='warning'>Intelligence patterns detected in this [R.braintype]. Aborting.</span>")
return FALSE
R.make_shell(src)
return TRUE
R.make_shell(src)
/obj/item/borg/upgrade/ai/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
if(R.shell)
R.undeploy()
R.notify_ai(AI_SHELL)
/obj/item/borg/upgrade/expand
name = "borg expander"
desc = "A cyborg resizer, it makes a cyborg huge."
icon_state = "cyborg_upgrade3"
/obj/item/borg/upgrade/expand/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/expand/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
if(R.hasExpanded)
to_chat(usr, "<span class='notice'>This unit already has an expand module installed!</span>")
return
if(R.hasExpanded)
to_chat(usr, "<span class='notice'>This unit already has an expand module installed!</span>")
return FALSE
R.notransform = TRUE
var/prev_lockcharge = R.lockcharge
R.SetLockdown(1)
R.anchored = TRUE
var/datum/effect_system/smoke_spread/smoke = new
smoke.set_up(1, R.loc)
smoke.start()
sleep(2)
for(var/i in 1 to 4)
playsound(R, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/welder.ogg', 'sound/items/ratchet.ogg'), 80, 1, -1)
sleep(12)
if(!prev_lockcharge)
R.SetLockdown(0)
R.anchored = FALSE
R.notransform = FALSE
R.resize = 2
R.hasExpanded = TRUE
R.update_transform()
return TRUE
R.notransform = TRUE
var/prev_lockcharge = R.lockcharge
R.SetLockdown(1)
R.anchored = TRUE
var/datum/effect_system/smoke_spread/smoke = new
smoke.set_up(1, R.loc)
smoke.start()
sleep(2)
for(var/i in 1 to 4)
playsound(R, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/welder.ogg', 'sound/items/ratchet.ogg'), 80, 1, -1)
sleep(12)
if(!prev_lockcharge)
R.SetLockdown(0)
R.anchored = FALSE
R.notransform = FALSE
R.resize = 2
R.hasExpanded = TRUE
R.update_transform()
/obj/item/borg/upgrade/expand/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
R.resize = 0.5
R.hasExpanded = FALSE
R.update_transform()
/obj/item/borg/upgrade/rped
name = "engineering cyborg RPED"
@@ -429,19 +496,25 @@
require_module = TRUE
module_type = /obj/item/robot_module/engineering
/obj/item/borg/upgrade/rped/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/rped/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
var/obj/item/storage/part_replacer/cyborg/RPED = locate() in R
if(RPED)
to_chat(usr, "<span class='warning'>This unit is already equipped with a RPED module.</span>")
return FALSE
var/obj/item/storage/part_replacer/cyborg/RPED = locate() in R
if(RPED)
to_chat(user, "<span class='warning'>This unit is already equipped with a RPED module.</span>")
return FALSE
RPED = new(R.module)
R.module.basic_modules += RPED
R.module.add_module(RPED, FALSE, TRUE)
return TRUE
RPED = new(R.module)
R.module.basic_modules += RPED
R.module.add_module(RPED, FALSE, TRUE)
/obj/item/borg/upgrade/rped/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
var/obj/item/storage/part_replacer/cyborg/RPED = locate() in R.module
if (RPED)
R.module.remove_module(RPED, TRUE)
/obj/item/borg/upgrade/pinpointer
name = "medical cyborg crew pinpointer"
@@ -451,16 +524,22 @@
require_module = TRUE
module_type = /obj/item/robot_module/medical
/obj/item/borg/upgrade/pinpointer/action(mob/living/silicon/robot/R)
if(..())
return
/obj/item/borg/upgrade/pinpointer/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
var/obj/item/pinpointer/crew/PP = locate() in R
if(PP)
to_chat(usr, "<span class='warning'>This unit is already equipped with a pinpointer module.</span>")
return FALSE
var/obj/item/pinpointer/crew/PP = locate() in R
if(PP)
to_chat(user, "<span class='warning'>This unit is already equipped with a pinpointer module.</span>")
return FALSE
PP = new(R.module)
R.module.basic_modules += PP
R.module.add_module(PP, FALSE, TRUE)
return TRUE
PP = new(R.module)
R.module.basic_modules += PP
R.module.add_module(PP, FALSE, TRUE)
/obj/item/borg/upgrade/pinpointer/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
var/obj/item/pinpointer/crew/PP = locate() in R.module
if (PP)
R.module.remove_module(PP, TRUE)