Merge pull request #1522 from CHOMPStationBot/upstream-merge-9876

[MIRROR] [MIRROR] Fixed/generalized loadout implants.
This commit is contained in:
Nadyr
2021-03-08 23:32:43 -05:00
committed by GitHub
8 changed files with 108 additions and 58 deletions

View File

@@ -1 +1,2 @@
var/datum/gear_tweak/color/gear_tweak_free_color_choice = new() var/datum/gear_tweak/color/gear_tweak_free_color_choice = new()
var/datum/gear_tweak/implant_location/gear_tweak_implant_location = new()

View File

@@ -414,7 +414,7 @@ var/global/datum/controller/occupations/job_master
// Implants get special treatment // Implants get special treatment
if(G.slot == "implant") if(G.slot == "implant")
var/obj/item/weapon/implant/I = G.spawn_item(H) var/obj/item/weapon/implant/I = G.spawn_item(H, H.client.prefs.gear[G.display_name])
I.invisibility = 100 I.invisibility = 100
I.implant_loadout(H) I.implant_loadout(H)
continue continue

View File

@@ -4,18 +4,6 @@
icon = 'icons/obj/device.dmi' icon = 'icons/obj/device.dmi'
icon_state = "implant" icon_state = "implant"
initialize_loc = BP_HEAD initialize_loc = BP_HEAD
var/roundstart = TRUE
/obj/item/weapon/implant/dud/torso /obj/item/weapon/implant/dud/torso
name = "unknown implant"
desc = "A small device with small connector wires."
icon = 'icons/obj/device.dmi'
icon_state = "implant"
initialize_loc = BP_TORSO initialize_loc = BP_TORSO
/obj/item/weapon/implant/dud/old
name = "old implant"
desc = "A small device with small connector wires."
icon = 'icons/obj/device.dmi'
icon_state = "implant"
roundstart = FALSE

View File

@@ -1,3 +1,5 @@
#define LOADOUT_BAN_STRING "Custom loadout"
/datum/gear_tweak/proc/get_contents(var/metadata) /datum/gear_tweak/proc/get_contents(var/metadata)
return return
@@ -165,7 +167,7 @@ var/datum/gear_tweak/custom_name/gear_tweak_free_name = new()
return "" return ""
/datum/gear_tweak/custom_name/get_metadata(var/user, var/metadata) /datum/gear_tweak/custom_name/get_metadata(var/user, var/metadata)
if(jobban_isbanned(user, "Custom loadout")) if(jobban_isbanned(user, LOADOUT_BAN_STRING))
to_chat(user, SPAN_WARNING("You are banned from using custom loadout names/descriptions.")) to_chat(user, SPAN_WARNING("You are banned from using custom loadout names/descriptions."))
return return
if(valid_custom_names) if(valid_custom_names)
@@ -196,7 +198,7 @@ var/datum/gear_tweak/custom_desc/gear_tweak_free_desc = new()
return "" return ""
/datum/gear_tweak/custom_desc/get_metadata(var/user, var/metadata) /datum/gear_tweak/custom_desc/get_metadata(var/user, var/metadata)
if(jobban_isbanned(user, "Custom loadout")) if(jobban_isbanned(user, LOADOUT_BAN_STRING))
to_chat(user, SPAN_WARNING("You are banned from using custom loadout names/descriptions.")) to_chat(user, SPAN_WARNING("You are banned from using custom loadout names/descriptions."))
return return
if(valid_custom_desc) if(valid_custom_desc)
@@ -507,3 +509,46 @@ var/datum/gear_tweak/custom_desc/gear_tweak_free_desc = new()
var/t = ValidTeslaLinks[metadata[7]] var/t = ValidTeslaLinks[metadata[7]]
I.tesla_link = new t(I) I.tesla_link = new t(I)
I.update_verbs() I.update_verbs()
/datum/gear_tweak/implant_location
var/static/list/bodypart_names_to_tokens = list(
"left hand" = BP_L_HAND,
"left arm" = BP_L_ARM,
"right hand" = BP_R_HAND,
"right arm" = BP_R_ARM,
"left foot" = BP_L_FOOT,
"left leg" = BP_L_LEG,
"right foot" = BP_R_FOOT,
"right leg" = BP_R_LEG,
"lower body" = BP_GROIN,
"upper body" = BP_TORSO,
"head" = BP_HEAD
)
var/static/list/bodypart_tokens_to_names = list(
BP_LEFT_HAND = "left hand",
BP_LEFT_ARM = "left arm",
BP_RIGHT_HAND = "right hand",
BP_RIGHT_ARM = "right arm",
BP_LEFT_FOOT = "left foot",
BP_LEFT_LEG = "left leg",
BP_RIGHT_FOOT = "right foot",
BP_RIGHT_LEG = "right leg",
BP_GROIN = "lower body",
BP_TORSO = "upper body",
BP_HEAD = "head"
)
/datum/gear_tweak/implant_location/get_default()
return BP_TORSO
/datum/gear_tweak/implant_location/tweak_item(var/obj/item/weapon/implant/I, var/metadata)
if(istype(I))
I.initialize_loc = bodypart_names_to_tokens[metadata] || BP_TORSO
/datum/gear_tweak/implant_location/get_contents(var/metadata)
return "Location: [metadata]"
/datum/gear_tweak/implant_location/get_metadata(var/user, var/metadata)
return (input(user, "Select a bodypart for the implant to be implanted inside.", "Implant Location", metadata || "upper body") as null|anything in bodypart_names_to_tokens) || bodypart_tokens_to_names[BP_TORSO]
#undef LOADOUT_BAN_STRING

View File

@@ -0,0 +1,56 @@
/datum/gear/utility/implant
display_name = "implant, neural assistance web"
description = "A complex web implanted into the subject, medically in order to compensate for neurological disease."
path = /obj/item/weapon/implant/neural
slot = "implant"
exploitable = 1
sort_category = "Cyberware"
cost = 6
/datum/gear/utility/implant/tracking
display_name = "implant, tracking"
path = /obj/item/weapon/implant/tracking/weak
cost = 10
// Remove these after generic implant has been in for awhile and everyone has had a reasonable period to copy their old descs.
/datum/gear/utility/implant/dud1
display_name = "implant, head"
description = "An implant with no obvious purpose (DEPRECATED, USE GENERIC IMPLANT)."
path = /obj/item/weapon/implant/dud
cost = 1
/datum/gear/utility/implant/dud2
display_name = "implant, torso"
description = "An implant with no obvious purpose (DEPRECATED, USE GENERIC IMPLANT)."
path = /obj/item/weapon/implant/dud/torso
cost = 1
// End removal marker.
/datum/gear/utility/implant/generic
display_name = "implant, generic, primary"
description = "An implant with no obvious purpose."
path = /obj/item/weapon/implant
cost = 1
/datum/gear/utility/implant/generic/second
display_name = "implant, generic, secondary"
/datum/gear/utility/implant/generic/third
display_name = "implant, generic, tertiary"
/datum/gear/utility/implant/generic/New()
..()
gear_tweaks += global.gear_tweak_implant_location
/datum/gear/utility/implant/language
cost = 2
exploitable = 0
/datum/gear/utility/implant/language/eal
display_name = "vocal synthesizer, EAL"
description = "A surgically implanted vocal synthesizer which allows the owner to speak EAL, if they know it."
path = /obj/item/weapon/implant/language/eal
/datum/gear/utility/implant/language/skrellian
display_name = "vocal synthesizer, Skrellian"
description = "A surgically implanted vocal synthesizer which allows the owner to speak Common Skrellian, if they know it."
path = /obj/item/weapon/implant/language/skrellian

View File

@@ -115,47 +115,6 @@
display_name = "cell, device" display_name = "cell, device"
path = /obj/item/weapon/cell/device path = /obj/item/weapon/cell/device
/datum/gear/utility/implant
slot = "implant"
exploitable = 1
/datum/gear/utility/implant/tracking
display_name = "implant, tracking"
path = /obj/item/weapon/implant/tracking/weak
cost = 0 //VOREStation Edit. Changed cost to 0
/datum/gear/utility/implant/neural
display_name = "implant, neural assistance web"
description = "A complex web implanted into the subject, medically in order to compensate for neurological disease."
path = /obj/item/weapon/implant/neural
cost = 6
/datum/gear/utility/implant/dud1
display_name = "implant, head"
description = "An implant with no obvious purpose."
path = /obj/item/weapon/implant/dud
cost = 1
/datum/gear/utility/implant/dud2
display_name = "implant, torso"
description = "An implant with no obvious purpose."
path = /obj/item/weapon/implant/dud/torso
cost = 1
/datum/gear/utility/implant/language
cost = 2
exploitable = 0
/datum/gear/utility/implant/language/eal
display_name = "vocal synthesizer, EAL"
description = "A surgically implanted vocal synthesizer which allows the owner to speak EAL, if they know it."
path = /obj/item/weapon/implant/language/eal
/datum/gear/utility/implant/language/skrellian
display_name = "vocal synthesizer, Skrellian"
description = "A surgically implanted vocal synthesizer which allows the owner to speak Common Skrellian, if they know it."
path = /obj/item/weapon/implant/language/skrellian
/datum/gear/utility/pen /datum/gear/utility/pen
display_name = "Fountain Pen" display_name = "Fountain Pen"
path = /obj/item/weapon/pen/fountain path = /obj/item/weapon/pen/fountain

View File

@@ -1382,7 +1382,7 @@
"nIu" = (/obj/machinery/door/airlock/maintenance{name = "Firefighting equipment"; req_access = null; req_one_access = null},/obj/machinery/door/firedoor/glass,/turf/simulated/floor/plating,/area/maintenance/thirddeck/dormsaft) "nIu" = (/obj/machinery/door/airlock/maintenance{name = "Firefighting equipment"; req_access = null; req_one_access = null},/obj/machinery/door/firedoor/glass,/turf/simulated/floor/plating,/area/maintenance/thirddeck/dormsaft)
"nKZ" = (/obj/effect/floor_decal/spline/plain,/obj/machinery/light_construct{dir = 8},/turf/simulated/floor/tiled/eris/steel/bar_dance,/area/maintenance/thirddeck/aftport) "nKZ" = (/obj/effect/floor_decal/spline/plain,/obj/machinery/light_construct{dir = 8},/turf/simulated/floor/tiled/eris/steel/bar_dance,/area/maintenance/thirddeck/aftport)
"nLX" = (/obj/machinery/atmospherics/pipe/simple/hidden,/obj/effect/floor_decal/industrial/warning{dir = 1},/turf/simulated/floor/plating,/area/maintenance/thirddeck/dormsport) "nLX" = (/obj/machinery/atmospherics/pipe/simple/hidden,/obj/effect/floor_decal/industrial/warning{dir = 1},/turf/simulated/floor/plating,/area/maintenance/thirddeck/dormsport)
"nMn" = (/obj/item/weapon/implant/dud,/obj/structure/table/steel,/obj/item/weapon/implant/sizecontrol,/obj/item/weapon/implant/dud/old,/turf/simulated/floor/plating,/area/maintenance/thirddeck/dormsstarboard) "nMn" = (/obj/item/weapon/implant/dud,/obj/structure/table/steel,/obj/item/weapon/implant/sizecontrol,/obj/item/weapon/implant/dud,/turf/simulated/floor/plating,/area/maintenance/thirddeck/dormsstarboard)
"nMy" = (/obj/machinery/atmospherics/pipe/manifold4w/hidden/supply,/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers{dir = 8},/obj/effect/floor_decal/industrial/warning{dir = 5},/turf/simulated/floor/tiled,/area/bridge) "nMy" = (/obj/machinery/atmospherics/pipe/manifold4w/hidden/supply,/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers{dir = 8},/obj/effect/floor_decal/industrial/warning{dir = 5},/turf/simulated/floor/tiled,/area/bridge)
"nMY" = (/obj/structure/table/wooden_reinforced,/obj/machinery/atmospherics/unary/vent_pump/on,/obj/machinery/computer/security/telescreen/entertainment{icon_state = "frame"; pixel_x = -32},/obj/item/device/flashlight/lamp/green,/turf/simulated/floor/carpet,/area/crew_quarters/heads/sc/sd) "nMY" = (/obj/structure/table/wooden_reinforced,/obj/machinery/atmospherics/unary/vent_pump/on,/obj/machinery/computer/security/telescreen/entertainment{icon_state = "frame"; pixel_x = -32},/obj/item/device/flashlight/lamp/green,/turf/simulated/floor/carpet,/area/crew_quarters/heads/sc/sd)
"nNp" = (/obj/machinery/light{dir = 1},/obj/machinery/ai_status_display{pixel_y = 32},/turf/simulated/floor/wood,/area/bridge/meeting_room) "nNp" = (/obj/machinery/light{dir = 1},/obj/machinery/ai_status_display{pixel_y = 32},/turf/simulated/floor/wood,/area/bridge/meeting_room)

View File

@@ -1924,6 +1924,7 @@
#include "code\modules\client\preference_setup\loadout\loadout_accessories_vr.dm" #include "code\modules\client\preference_setup\loadout\loadout_accessories_vr.dm"
#include "code\modules\client\preference_setup\loadout\loadout_accessories_yw.dm" #include "code\modules\client\preference_setup\loadout\loadout_accessories_yw.dm"
#include "code\modules\client\preference_setup\loadout\loadout_cosmetics.dm" #include "code\modules\client\preference_setup\loadout\loadout_cosmetics.dm"
#include "code\modules\client\preference_setup\loadout\loadout_cyberware.dm"
#include "code\modules\client\preference_setup\loadout\loadout_ears.dm" #include "code\modules\client\preference_setup\loadout\loadout_ears.dm"
#include "code\modules\client\preference_setup\loadout\loadout_eyes.dm" #include "code\modules\client\preference_setup\loadout\loadout_eyes.dm"
#include "code\modules\client\preference_setup\loadout\loadout_eyes_vr.dm" #include "code\modules\client\preference_setup\loadout\loadout_eyes_vr.dm"