mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Kills /obj/item/melee/transforming, replaces it with a transforming weapon component (#60761)
This PR kills off the transforming subtype of /obj/item/melee and replaces it with a component to handle the transforming behavior, /datum/component/transforming.
The transforming component handles updating the variables of an item when it's transformed. Things like force, sharpness, whetstone force bonus, and attack verbs. Similar to the two-handed component, but instead of transforming into a two-hander it remains a one handed weapon.
The "nemesis" behavior (dealing addition damage to certain factions) of the transforming subtype was moved to the cleaving saw only, since it was the only transforming item that used it. In the future, this can be made into a bespoke element/component as well.
The following weapons and items have been updated to use this component:
Energy Swords / Sabers / Bananium Energy Sword
Energy Circular Saw
Energy Dagger
Energy Axe
Toy Energy Sword
Holographic Energy Sword
Switchblade
Advanced Medical Tools (Laser scalpel, Mechanical Pinches, Searing Tool)
Advanced Engineering Tools (Hand Drill, Jaws of Life / Syndicate Jaws of Life)
Combat Wrench
Cleaving Saw
Telescopic Batons / Contractor Batons
Roasting Stick
Telescopic Riot Shield
Energy Shield / Bananium Energy Shield
This PR also touches up the code around the various above items.
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
name = "perform lobotomy"
|
||||
implements = list(
|
||||
TOOL_SCALPEL = 85,
|
||||
/obj/item/melee/transforming/energy/sword = 55,
|
||||
/obj/item/melee/energy/sword = 55,
|
||||
/obj/item/kitchen/knife = 35,
|
||||
/obj/item/shard = 25,
|
||||
/obj/item = 20)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
name = "incise heart"
|
||||
implements = list(
|
||||
TOOL_SCALPEL = 90,
|
||||
/obj/item/melee/transforming/energy/sword = 45,
|
||||
/obj/item/melee/energy/sword = 45,
|
||||
/obj/item/kitchen/knife = 45,
|
||||
/obj/item/shard = 25)
|
||||
time = 16
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
name = "remove lower duodenum"
|
||||
implements = list(
|
||||
TOOL_SCALPEL = 95,
|
||||
/obj/item/melee/transforming/energy/sword = 65,
|
||||
/obj/item/melee/energy/sword = 65,
|
||||
/obj/item/kitchen/knife = 45,
|
||||
/obj/item/shard = 35)
|
||||
time = 52
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
name = "remove damaged liver section"
|
||||
implements = list(
|
||||
TOOL_SCALPEL = 95,
|
||||
/obj/item/melee/transforming/energy/sword = 65,
|
||||
/obj/item/melee/energy/sword = 65,
|
||||
/obj/item/kitchen/knife = 45,
|
||||
/obj/item/shard = 35)
|
||||
time = 52
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
name = "excise damaged lung node"
|
||||
implements = list(
|
||||
TOOL_SCALPEL = 95,
|
||||
/obj/item/melee/transforming/energy/sword = 65,
|
||||
/obj/item/melee/energy/sword = 65,
|
||||
/obj/item/kitchen/knife = 45,
|
||||
/obj/item/shard = 35)
|
||||
time = 42
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
name = "make incision"
|
||||
implements = list(
|
||||
TOOL_SCALPEL = 100,
|
||||
/obj/item/melee/transforming/energy/sword = 75,
|
||||
/obj/item/melee/energy/sword = 75,
|
||||
/obj/item/kitchen/knife = 65,
|
||||
/obj/item/shard = 45,
|
||||
/obj/item = 30) // 30% success with any sharp item.
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
/obj/item/organ/cyberimp/arm/esword
|
||||
name = "arm-mounted energy blade"
|
||||
desc = "An illegal and highly dangerous cybernetic implant that can project a deadly blade of concentrated energy."
|
||||
items_to_create = list(/obj/item/melee/transforming/energy/blade/hardlight)
|
||||
items_to_create = list(/obj/item/melee/energy/blade/hardlight)
|
||||
|
||||
/obj/item/organ/cyberimp/arm/medibeam
|
||||
name = "integrated medical beamgun"
|
||||
@@ -283,7 +283,7 @@
|
||||
/obj/item/organ/cyberimp/arm/combat
|
||||
name = "combat cybernetics implant"
|
||||
desc = "A powerful cybernetic implant that contains combat modules built into the user's arm."
|
||||
items_to_create = list(/obj/item/melee/transforming/energy/blade/hardlight, /obj/item/gun/medbeam, /obj/item/borg/stun, /obj/item/assembly/flash/armimplant)
|
||||
items_to_create = list(/obj/item/melee/energy/blade/hardlight, /obj/item/gun/medbeam, /obj/item/borg/stun, /obj/item/assembly/flash/armimplant)
|
||||
|
||||
/obj/item/organ/cyberimp/arm/combat/Initialize()
|
||||
. = ..()
|
||||
|
||||
@@ -68,28 +68,39 @@
|
||||
name = "searing tool"
|
||||
desc = "It projects a high power laser used for medical applications."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "cautery_a"
|
||||
icon_state = "e_cautery"
|
||||
hitsound = 'sound/items/welder.ogg'
|
||||
toolspeed = 0.7
|
||||
light_system = MOVABLE_LIGHT
|
||||
light_range = 1
|
||||
light_color = COLOR_SOFT_RED
|
||||
|
||||
/obj/item/cautery/advanced/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/transforming, \
|
||||
force_on = force, \
|
||||
throwforce_on = throwforce, \
|
||||
hitsound_on = hitsound, \
|
||||
w_class_on = w_class, \
|
||||
clumsy_check = FALSE)
|
||||
RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, .proc/on_transform)
|
||||
|
||||
/obj/item/cautery/advanced/attack_self(mob/user)
|
||||
playsound(get_turf(user), 'sound/weapons/tap.ogg', 50, TRUE)
|
||||
if(tool_behaviour == TOOL_CAUTERY)
|
||||
tool_behaviour = TOOL_DRILL
|
||||
balloon_alert(user, "lenses set to drill")
|
||||
icon_state = "surgicaldrill_a"
|
||||
else
|
||||
tool_behaviour = TOOL_CAUTERY
|
||||
balloon_alert(user, "lenses set to mend")
|
||||
icon_state = "cautery_a"
|
||||
/*
|
||||
* Signal proc for [COMSIG_TRANSFORMING_ON_TRANSFORM].
|
||||
*
|
||||
* Toggles between drill and cautery and gives feedback to the user.
|
||||
*/
|
||||
/obj/item/cautery/advanced/proc/on_transform(obj/item/source, mob/user, active)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
tool_behaviour = (active ? TOOL_DRILL : TOOL_CAUTERY)
|
||||
balloon_alert(user, "lenses set to [active ? "drill" : "mend"]")
|
||||
playsound(user ? user : src, 'sound/weapons/tap.ogg', 50, TRUE)
|
||||
return COMPONENT_NO_DEFAULT_MESSAGE
|
||||
|
||||
/obj/item/cautery/advanced/examine()
|
||||
. = ..()
|
||||
. += " It's set to [tool_behaviour == TOOL_CAUTERY ? "mending" : "drilling"] mode."
|
||||
. += span_notice("It's set to [tool_behaviour == TOOL_CAUTERY ? "mending" : "drilling"] mode.")
|
||||
|
||||
/obj/item/surgicaldrill
|
||||
name = "surgical drill"
|
||||
@@ -251,7 +262,7 @@
|
||||
name = "laser scalpel"
|
||||
desc = "An advanced scalpel which uses laser technology to cut."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "scalpel_a"
|
||||
icon_state = "e_scalpel"
|
||||
hitsound = 'sound/weapons/blade1.ogg'
|
||||
force = 16
|
||||
toolspeed = 0.7
|
||||
@@ -260,47 +271,74 @@
|
||||
light_color = LIGHT_COLOR_GREEN
|
||||
sharpness = SHARP_EDGED
|
||||
|
||||
/obj/item/scalpel/advanced/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/transforming, \
|
||||
force_on = force + 1, \
|
||||
throwforce_on = throwforce, \
|
||||
throw_speed_on = throw_speed, \
|
||||
sharpness_on = sharpness, \
|
||||
hitsound_on = hitsound, \
|
||||
w_class_on = w_class, \
|
||||
clumsy_check = FALSE)
|
||||
RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, .proc/on_transform)
|
||||
|
||||
/obj/item/scalpel/advanced/attack_self(mob/user)
|
||||
playsound(get_turf(user), 'sound/machines/click.ogg', 50, TRUE)
|
||||
if(tool_behaviour == TOOL_SCALPEL)
|
||||
/*
|
||||
* Signal proc for [COMSIG_TRANSFORMING_ON_TRANSFORM].
|
||||
*
|
||||
* Toggles between saw and scalpel and updates the light / gives feedback to the user.
|
||||
*/
|
||||
/obj/item/scalpel/advanced/proc/on_transform(obj/item/source, mob/user, active)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(active)
|
||||
tool_behaviour = TOOL_SAW
|
||||
balloon_alert(user, "enabled bone-cutting mode")
|
||||
set_light_range(2)
|
||||
force += 1 //we don't want to ruin sharpened stuff
|
||||
icon_state = "saw_a"
|
||||
else
|
||||
tool_behaviour = TOOL_SCALPEL
|
||||
balloon_alert(user, "disabled bone-cutting mode")
|
||||
set_light_range(1)
|
||||
force -= 1
|
||||
icon_state = "scalpel_a"
|
||||
|
||||
balloon_alert(user, "[active ? "enabled" : "disabled"] bone-cutting mode")
|
||||
playsound(user ? user : src, 'sound/machines/click.ogg', 50, TRUE)
|
||||
return COMPONENT_NO_DEFAULT_MESSAGE
|
||||
|
||||
/obj/item/scalpel/advanced/examine()
|
||||
. = ..()
|
||||
. += " It's set to [tool_behaviour == TOOL_SCALPEL ? "scalpel" : "saw"] mode."
|
||||
. += span_notice("It's set to [tool_behaviour == TOOL_SCALPEL ? "scalpel" : "saw"] mode.")
|
||||
|
||||
/obj/item/retractor/advanced
|
||||
name = "mechanical pinches"
|
||||
desc = "An agglomerate of rods and gears."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "retractor_a"
|
||||
icon_state = "adv_retractor"
|
||||
toolspeed = 0.7
|
||||
|
||||
/obj/item/retractor/advanced/attack_self(mob/user)
|
||||
playsound(get_turf(user), 'sound/items/change_drill.ogg', 50, TRUE)
|
||||
if(tool_behaviour == TOOL_RETRACTOR)
|
||||
tool_behaviour = TOOL_HEMOSTAT
|
||||
balloon_alert(user, "gears set to clamp")
|
||||
icon_state = "hemostat_a"
|
||||
else
|
||||
tool_behaviour = TOOL_RETRACTOR
|
||||
balloon_alert(user, "gears set to retract")
|
||||
icon_state = "retractor_a"
|
||||
/obj/item/retractor/advanced/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/transforming, \
|
||||
force_on = force, \
|
||||
throwforce_on = throwforce, \
|
||||
hitsound_on = hitsound, \
|
||||
w_class_on = w_class, \
|
||||
clumsy_check = FALSE)
|
||||
RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, .proc/on_transform)
|
||||
|
||||
/*
|
||||
* Signal proc for [COMSIG_TRANSFORMING_ON_TRANSFORM].
|
||||
*
|
||||
* Toggles between retractor and hemostat and gives feedback to the user.
|
||||
*/
|
||||
/obj/item/retractor/advanced/proc/on_transform(obj/item/source, mob/user, active)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
tool_behaviour = (active ? TOOL_HEMOSTAT : TOOL_RETRACTOR)
|
||||
balloon_alert(user, "gears set to [active ? "clamp" : "retract"]")
|
||||
playsound(user ? user : src, 'sound/items/change_drill.ogg', 50, TRUE)
|
||||
return COMPONENT_NO_DEFAULT_MESSAGE
|
||||
|
||||
/obj/item/retractor/advanced/examine()
|
||||
. = ..()
|
||||
. += " It resembles a [tool_behaviour == TOOL_RETRACTOR ? "retractor" : "hemostat"]."
|
||||
. += span_notice("It resembles a [tool_behaviour == TOOL_RETRACTOR ? "retractor" : "hemostat"].")
|
||||
|
||||
/obj/item/shears
|
||||
name = "amputation shears"
|
||||
|
||||
Reference in New Issue
Block a user