From 6064f4057c2aaef7e3dc897562ec37cc57a98f86 Mon Sep 17 00:00:00 2001 From: Mechoid Date: Sat, 4 Mar 2023 13:44:46 -0800 Subject: [PATCH] [Requested] Serenity changed to proper medical exosuit. (#8951) * Serenity changed to proper medical exosuit. Serenity tweaked to be a medical subtype, weapons cannot fit in universal slots. Serenity weapon slot converted to a hull slot. Exosuit punching converted to general ability, if melee_can_hit is TRUE by default. * Cleanup. Move HuD management to /obj/mecha/medical * dedent?? * Fixfix * Jumpjet --- code/game/mecha/combat/combat.dm | 99 +-------------------- code/game/mecha/combat/gygax.dm | 56 ------------ code/game/mecha/equipment/tools/jumpjet.dm | 2 +- code/game/mecha/mecha.dm | 88 +++++++++++++++++- code/game/mecha/mecha_construction_paths.dm | 2 +- code/game/mecha/medical/medical.dm | 23 +++++ code/game/mecha/medical/odysseus.dm | 27 +----- code/game/mecha/medical/serenity.dm | 31 +++++++ code/game/objects/random/mechs.dm | 4 +- polaris.dme | 1 + 10 files changed, 150 insertions(+), 183 deletions(-) create mode 100644 code/game/mecha/medical/serenity.dm diff --git a/code/game/mecha/combat/combat.dm b/code/game/mecha/combat/combat.dm index 6d8c372c42..9ca6da67f0 100644 --- a/code/game/mecha/combat/combat.dm +++ b/code/game/mecha/combat/combat.dm @@ -1,7 +1,9 @@ /obj/mecha/combat force = 30 - var/melee_cooldown = 10 - var/melee_can_hit = 1 + melee_cooldown = 10 + melee_can_hit = 1 + melee_sound = 'sound/weapons/heavysmash.ogg' + //var/list/destroyable_obj = list(/obj/mecha, /obj/structure/window, /obj/structure/grille, /turf/simulated/wall, /obj/structure/girder) internal_damage_threshold = 50 maint_access = 0 @@ -35,99 +37,6 @@ return */ -/obj/mecha/combat/melee_action(atom/T) - if(internal_damage&MECHA_INT_CONTROL_LOST) - T = safepick(oview(1,src)) - if(!melee_can_hit) - return - if(istype(T, /mob/living)) - var/mob/living/M = T - if(src.occupant.a_intent == I_HURT || istype(src.occupant, /mob/living/carbon/brain)) //Brains cannot change intents; Exo-piloting brains lack any form of physical feedback for control, limiting the ability to 'play nice'. - playsound(src, 'sound/weapons/heavysmash.ogg', 50, 1) - if(damtype == "brute") - step_away(M,src,15) - /* - if(M.stat>1) - M.gib() - melee_can_hit = 0 - if(do_after(melee_cooldown)) - melee_can_hit = 1 - return - */ - if(ishuman(T)) - var/mob/living/carbon/human/H = T - // if (M.health <= 0) return - - var/obj/item/organ/external/temp = H.get_organ(pick(BP_TORSO, BP_TORSO, BP_TORSO, BP_HEAD)) - if(temp) - var/update = 0 - switch(damtype) - if("brute") - H.Paralyse(1) - update |= temp.take_damage(rand(force/2, force), 0) - if("fire") - update |= temp.take_damage(0, rand(force/2, force)) - if("tox") - if(H.reagents) - if(H.reagents.get_reagent_amount("carpotoxin") + force < force*2) - H.reagents.add_reagent("carpotoxin", force) - if(H.reagents.get_reagent_amount("cryptobiolin") + force < force*2) - H.reagents.add_reagent("cryptobiolin", force) - if("halloss") - H.stun_effect_act(1, force / 2, BP_TORSO, src) - else - return - if(update) H.UpdateDamageIcon() - H.updatehealth() - - else - switch(damtype) - if("brute") - M.Paralyse(1) - M.take_overall_damage(rand(force/2, force)) - if("fire") - M.take_overall_damage(0, rand(force/2, force)) - if("tox") - if(M.reagents) - if(M.reagents.get_reagent_amount("carpotoxin") + force < force*2) - M.reagents.add_reagent("carpotoxin", force) - if(M.reagents.get_reagent_amount("cryptobiolin") + force < force*2) - M.reagents.add_reagent("cryptobiolin", force) - else - return - M.updatehealth() - src.occupant_message("You hit [T].") - src.visible_message("[src.name] hits [T].") - else - step_away(M,src) - src.occupant_message("You push [T] out of the way.") - src.visible_message("[src] pushes [T] out of the way.") - - melee_can_hit = 0 - if(do_after(melee_cooldown)) - melee_can_hit = 1 - return - - else - if(istype(T, /obj/machinery/disposal)) // Stops mechs from climbing into disposals - return - if(src.occupant.a_intent == I_HURT || istype(src.occupant, /mob/living/carbon/brain)) // Don't smash unless we mean it - if(damtype == "brute") - src.occupant_message("You hit [T].") - src.visible_message("[src.name] hits [T]") - playsound(src, 'sound/weapons/heavysmash.ogg', 50, 1) - - if(istype(T, /obj/structure/girder)) - T:take_damage(force * 3) //Girders have 200 health by default. Steel, non-reinforced walls take four punches, girders take (with this value-mod) two, girders took five without. - else - T:take_damage(force) - - melee_can_hit = 0 - - if(do_after(melee_cooldown)) - melee_can_hit = 1 - return - /obj/mecha/combat/moved_inside(var/mob/living/carbon/human/H as mob) if(..()) if(H.client) diff --git a/code/game/mecha/combat/gygax.dm b/code/game/mecha/combat/gygax.dm index 3c89991af8..d0df0b1d80 100644 --- a/code/game/mecha/combat/gygax.dm +++ b/code/game/mecha/combat/gygax.dm @@ -81,62 +81,6 @@ return cell = new /obj/item/cell/hyper(src) -/obj/mecha/combat/gygax/serenity - desc = "A lightweight exosuit made from a modified Gygax chassis combined with proprietary VeyMed medical tech. It's faster and sturdier than most medical mechs, but much of the armor plating has been stripped out, leaving it more vulnerable than a regular Gygax." - name = "Serenity" - icon_state = "medgax" - initial_icon = "medgax" - health = 150 - maxhealth = 150 - deflect_chance = 20 - step_in = 2 - max_temperature = 20000 - overload_coeff = 1 - wreckage = /obj/effect/decal/mecha_wreckage/gygax/serenity - max_equip = 3 - step_energy_drain = 8 - cargo_capacity = 2 - max_hull_equip = 1 - max_weapon_equip = 1 - max_utility_equip = 2 - max_universal_equip = 1 - max_special_equip = 1 - - starting_components = list( - /obj/item/mecha_parts/component/hull, - /obj/item/mecha_parts/component/actuator, - /obj/item/mecha_parts/component/armor/lightweight, - /obj/item/mecha_parts/component/gas, - /obj/item/mecha_parts/component/electrical - ) - - var/obj/item/clothing/glasses/hud/health/mech/hud - -/obj/mecha/combat/gygax/serenity/Initialize() - . = ..() - hud = new /obj/item/clothing/glasses/hud/health/mech(src) - return - -/obj/mecha/combat/gygax/serenity/moved_inside(var/mob/living/carbon/human/H as mob) - if(..()) - if(H.glasses) - occupant_message("[H.glasses] prevent you from using [src] [hud]") - else - H.glasses = hud - H.recalculate_vis() - return 1 - else - return 0 - -/obj/mecha/combat/gygax/serenity/go_out() - if(ishuman(occupant)) - var/mob/living/carbon/human/H = occupant - if(H.glasses == hud) - H.glasses = null - H.recalculate_vis() - ..() - return - //Meant for random spawns. /obj/mecha/combat/gygax/old desc = "A lightweight, security exosuit. Popular among private and corporate security. This one is particularly worn looking and likely isn't as sturdy." diff --git a/code/game/mecha/equipment/tools/jumpjet.dm b/code/game/mecha/equipment/tools/jumpjet.dm index 8a77a45351..c6b248b0d1 100644 --- a/code/game/mecha/equipment/tools/jumpjet.dm +++ b/code/game/mecha/equipment/tools/jumpjet.dm @@ -9,7 +9,7 @@ range = RANGED step_delay = 0.2 SECONDS - required_type = list(/obj/mecha/working/hoverpod, /obj/mecha/combat/gygax/serenity, /obj/mecha/combat/marauder) + required_type = list(/obj/mecha/working/hoverpod, /obj/mecha/medical/serenity, /obj/mecha/combat/marauder) var/hover_sound = 'sound/machines/generator/generator_end.ogg' diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 99450b034b..f98588bc56 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -60,7 +60,11 @@ var/datum/effect_system/spark_spread/spark_system = new var/lights = 0 var/lights_power = 6 - var/force = 0 + + var/force = 15 // Damage value used for punching. + var/melee_cooldown = 10 // Cooldown for punching. + var/melee_can_hit = FALSE // If set to true, the exosuit will be able to punch. + var/melee_sound = 'sound/weapons/heavysmash.ogg' var/mech_faction = null var/firstactivation = 0 //It's simple. If it's 0, no one entered it yet. Otherwise someone entered it at least once. @@ -676,7 +680,87 @@ if(src_object in view(2, src)) return STATUS_UPDATE //if they're close enough, allow the occupant to see the screen through the viewport or whatever. -/obj/mecha/proc/melee_action(atom/target) +/obj/mecha/proc/melee_action(atom/T) + if(internal_damage & MECHA_INT_CONTROL_LOST) + T = safepick(oview(1,src)) + if(!melee_can_hit) + return + + if(istype(T, /obj/machinery/disposal)) // Stops mechs from climbing into disposals + return + + if(isliving(T)) + var/mob/living/M = T + if(src.occupant.a_intent == I_HURT || isbrain(src.occupant)) //Brains cannot change intents; Exo-piloting brains lack any form of physical feedback for control, limiting the ability to 'play nice'. + playsound(src, 'sound/weapons/heavysmash.ogg', 50, 1) + do_attack_animation(T) + if(damtype == "brute") + step_away(M,src,15) + + if(ishuman(T)) + var/mob/living/carbon/human/H = T + + var/obj/item/organ/external/temp = H.get_organ(pick(BP_TORSO, BP_TORSO, BP_TORSO, BP_HEAD)) + if(istype(temp)) + var/update = 0 + switch(damtype) + if("brute") + H.Paralyse(1) + update |= temp.take_damage(rand(force/2, force), 0) + if("fire") + update |= temp.take_damage(0, rand(force/2, force)) + if("tox") + if(H.reagents) + if(H.reagents.get_reagent_amount("carpotoxin") < force*2) + H.reagents.add_reagent("carpotoxin", force) + if(H.reagents.get_reagent_amount("cryptobiolin") < force*2) + H.reagents.add_reagent("cryptobiolin", force) + if("halloss") + H.stun_effect_act(1, force / 2, BP_TORSO, src) + else + return + if(update) H.UpdateDamageIcon() + H.updatehealth() + + else + switch(damtype) + if("brute") + M.Paralyse(1) + M.take_overall_damage(rand(force/2, force)) + if("fire") + M.take_overall_damage(0, rand(force/2, force)) + if("tox") + if(M.reagents) + if(M.reagents.get_reagent_amount("carpotoxin") + force < force*2) + M.reagents.add_reagent("carpotoxin", force) + if(M.reagents.get_reagent_amount("cryptobiolin") + force < force*2) + M.reagents.add_reagent("cryptobiolin", force) + else + return + M.updatehealth() + src.occupant_message("You hit [T].") + src.visible_message(SPAN_DANGER("[src.name] hits [T]")) + else + step_away(M,src) + src.occupant_message("You push [T] out of the way.") + src.visible_message("[src] pushes [T] out of the way.") + + else + if(src.occupant.a_intent == I_HURT || isbrain(src.occupant)) // Don't smash unless we mean it + if(damtype == "brute") + src.occupant_message("You hit [T].") + src.visible_message(SPAN_DANGER("[src.name] hits [T]")) + playsound(src, 'sound/weapons/heavysmash.ogg', 50, 1) + do_attack_animation(T) + + if(istype(T, /obj/structure/girder)) + T:take_damage(force * 3) //Girders have 200 health by default. Steel, non-reinforced walls take four combat exosuit punches, girders take (with this value-mod) two, girders took five without. + else + T:take_damage(force) + + melee_can_hit = 0 + if(do_after(melee_cooldown)) + melee_can_hit = 1 return /obj/mecha/proc/range_action(atom/target) diff --git a/code/game/mecha/mecha_construction_paths.dm b/code/game/mecha/mecha_construction_paths.dm index 529c6e5405..3bf42e2031 100644 --- a/code/game/mecha/mecha_construction_paths.dm +++ b/code/game/mecha/mecha_construction_paths.dm @@ -594,7 +594,7 @@ /datum/construction/reversible/mecha/serenity - result = "/obj/mecha/combat/gygax/serenity" + result = "/obj/mecha/medical/serenity" steps = list( //1 list("key"=/obj/item/weldingtool, diff --git a/code/game/mecha/medical/medical.dm b/code/game/mecha/medical/medical.dm index 973ddec3fc..2285ad9ccb 100644 --- a/code/game/mecha/medical/medical.dm +++ b/code/game/mecha/medical/medical.dm @@ -5,6 +5,7 @@ max_universal_equip = 1 max_special_equip = 1 + melee_sound = 'sound/weapons/resonator_blast.ogg' stomp_sound = 'sound/mecha/mechmove01.ogg' cargo_capacity = 1 @@ -17,12 +18,34 @@ /obj/item/mecha_parts/component/electrical ) + var/obj/item/clothing/glasses/hud/health/mech/hud + /obj/mecha/medical/Initialize() . = ..() var/turf/T = get_turf(src) if(isPlayerLevel(T.z)) new /obj/item/mecha_parts/mecha_tracking(src) + hud = new /obj/item/clothing/glasses/hud/health/mech(src) + return + +/obj/mecha/medical/moved_inside(var/mob/living/carbon/human/H as mob) + . = ..() + if(istype(H)) + if(H.glasses) + occupant_message("[H.glasses] prevent you from using [src] [hud]") + else + H.glasses = hud + H.recalculate_vis() + +/obj/mecha/medical/odysseus/go_out() + if(ishuman(occupant)) + var/mob/living/carbon/human/H = occupant + if(H.glasses == hud) + H.glasses = null + H.recalculate_vis() + return ..() + /* // One horrific bastardization of glorious inheritence dead. A billion to go. ~Mech /obj/mecha/medical/mechturn(direction) set_dir(direction) diff --git a/code/game/mecha/medical/odysseus.dm b/code/game/mecha/medical/odysseus.dm index 594e82c2f7..9e37f18649 100644 --- a/code/game/mecha/medical/odysseus.dm +++ b/code/game/mecha/medical/odysseus.dm @@ -15,35 +15,10 @@ internal_damage_threshold = 35 deflect_chance = 15 step_energy_drain = 6 - var/obj/item/clothing/glasses/hud/health/mech/hud icon_scale_x = 1.2 icon_scale_y = 1.2 -/obj/mecha/medical/odysseus/Initialize() - . = ..() - hud = new /obj/item/clothing/glasses/hud/health/mech(src) - return - -/obj/mecha/medical/odysseus/moved_inside(var/mob/living/carbon/human/H as mob) - if(..()) - if(H.glasses) - occupant_message("[H.glasses] prevent you from using [src] [hud]") - else - H.glasses = hud - H.recalculate_vis() - return 1 - else - return 0 - -/obj/mecha/medical/odysseus/go_out() - if(ishuman(occupant)) - var/mob/living/carbon/human/H = occupant - if(H.glasses == hud) - H.glasses = null - H.recalculate_vis() - ..() - return /* verb/set_perspective() set name = "Set client perspective." @@ -143,4 +118,4 @@ . = ..() health = 25 maxhealth = 50 //Just slightly worse. - cell.charge = rand(0, (cell.charge/2)) \ No newline at end of file + cell.charge = rand(0, (cell.charge/2)) diff --git a/code/game/mecha/medical/serenity.dm b/code/game/mecha/medical/serenity.dm new file mode 100644 index 0000000000..ae058b9dcd --- /dev/null +++ b/code/game/mecha/medical/serenity.dm @@ -0,0 +1,31 @@ + +/obj/mecha/medical/serenity + desc = "A lightweight exosuit made from a modified Gygax chassis combined with proprietary VeyMed medical tech. It's faster and sturdier than most medical mechs, but much of the armor plating has been stripped out, leaving it more vulnerable than a regular Gygax." + name = "Serenity" + icon_state = "medgax" + initial_icon = "medgax" + health = 150 + maxhealth = 150 + deflect_chance = 20 + step_in = 2 + max_temperature = 20000 + overload_coeff = 1 + wreckage = /obj/effect/decal/mecha_wreckage/gygax/serenity + max_equip = 3 + step_energy_drain = 8 + cargo_capacity = 2 + max_hull_equip = 2 + max_weapon_equip = 0 + max_utility_equip = 2 + max_universal_equip = 1 + max_special_equip = 1 + + overload_possible = 1 + + force = 20 // 10 less than normal combat exos. + melee_can_hit = TRUE + melee_sound = 'sound/weapons/heavysmash.ogg' + + catalogue_data = list( + /datum/category_item/catalogue/information/organization/vey_med + ) diff --git a/code/game/objects/random/mechs.dm b/code/game/objects/random/mechs.dm index 6129e177da..1a5b0f8d21 100644 --- a/code/game/objects/random/mechs.dm +++ b/code/game/objects/random/mechs.dm @@ -7,7 +7,7 @@ //This list includes the phazon, gorilla and mauler. You might want to use something else if balance is a concern. /obj/random/mech/item_to_spawn() return pick(/obj/mecha/combat/gygax, - /obj/mecha/combat/gygax/serenity, + /obj/mecha/medical/serenity, /obj/mecha/combat/gygax/dark, /obj/mecha/combat/marauder, /obj/mecha/combat/marauder/seraph, @@ -28,7 +28,7 @@ /obj/random/mech/weaker/item_to_spawn() return pick(/obj/mecha/combat/gygax, - /obj/mecha/combat/gygax/serenity, + /obj/mecha/medical/serenity, /obj/mecha/medical/odysseus, /obj/mecha/combat/durand, /obj/mecha/working/ripley, diff --git a/polaris.dme b/polaris.dme index f8f8c286c7..1f5e388806 100644 --- a/polaris.dme +++ b/polaris.dme @@ -883,6 +883,7 @@ #include "code\game\mecha\equipment\weapons\fire\incendiary.dm" #include "code\game\mecha\medical\medical.dm" #include "code\game\mecha\medical\odysseus.dm" +#include "code\game\mecha\medical\serenity.dm" #include "code\game\mecha\space\hoverpod.dm" #include "code\game\mecha\space\shuttle.dm" #include "code\game\mecha\working\ripley.dm"