diff --git a/code/game/mecha/combat/combat.dm b/code/game/mecha/combat/combat.dm index ef0db8da73b..b5e5be91e6a 100644 --- a/code/game/mecha/combat/combat.dm +++ b/code/game/mecha/combat/combat.dm @@ -4,3 +4,5 @@ internal_damage_threshold = 50 armor = list("melee" = 30, "bullet" = 30, "laser" = 15, "energy" = 20, "bomb" = 20, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 100) mouse_pointer = 'icons/mecha/mecha_mouse.dmi' + destruction_sleep_duration = 40 + exit_delay = 40 \ No newline at end of file diff --git a/code/game/mecha/combat/gygax.dm b/code/game/mecha/combat/gygax.dm index 9c7ca2bae52..271eeb920f6 100644 --- a/code/game/mecha/combat/gygax.dm +++ b/code/game/mecha/combat/gygax.dm @@ -27,6 +27,7 @@ internals_req_access = list(ACCESS_SYNDICATE) wreckage = /obj/structure/mecha_wreckage/gygax/dark max_equip = 4 + destruction_sleep_duration = 20 /obj/mecha/combat/gygax/dark/loaded/Initialize() . = ..() diff --git a/code/game/mecha/combat/marauder.dm b/code/game/mecha/combat/marauder.dm index 1398dbb2452..bda464213e0 100644 --- a/code/game/mecha/combat/marauder.dm +++ b/code/game/mecha/combat/marauder.dm @@ -75,6 +75,7 @@ internals_req_access = list(ACCESS_SYNDICATE) wreckage = /obj/structure/mecha_wreckage/mauler max_equip = 5 + destruction_sleep_duration = 20 /obj/mecha/combat/marauder/mauler/loaded/Initialize() . = ..() diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm index 38058e30380..cce75b3b137 100644 --- a/code/game/mecha/equipment/mecha_equipment.dm +++ b/code/game/mecha/equipment/mecha_equipment.dm @@ -80,6 +80,8 @@ return 0 if(energy_drain && !chassis.has_charge(energy_drain)) return 0 + if(chassis.is_currently_ejecting) + return 0 return 1 /obj/item/mecha_parts/mecha_equipment/proc/action(atom/target) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index fb3db9129f3..3605dedfbbf 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -84,9 +84,12 @@ var/silicon_pilot = FALSE //set to true if an AI or MMI is piloting. var/enter_delay = 40 //Time taken to enter the mech + var/exit_delay = 20 //Time to exit mech + var/destruction_sleep_duration = 20 //Time that mech pilot is put to sleep for if mech is destroyed var/enclosed = TRUE //Set to false for open-cockpit mechs var/silicon_icon_state = null //if the mech has a different icon when piloted by an AI or MMI - + var/is_currently_ejecting = FALSE //Mech cannot use equiptment when true, set to true if pilot is trying to exit mech + //Action datums var/datum/action/innate/mecha/mech_eject/eject_action = new var/datum/action/innate/mecha/mech_toggle_internals/internals_action = new @@ -162,6 +165,8 @@ return cell /obj/mecha/Destroy() + if(occupant) + occupant.SetSleeping(destruction_sleep_duration) go_out() var/mob/living/silicon/ai/AI for(var/mob/M in src) //Let's just be ultra sure @@ -171,8 +176,6 @@ else M.forceMove(loc) if(wreckage) - if(prob(30)) - explosion(get_turf(src), 0, 0, 1, 3) var/obj/structure/mecha_wreckage/WR = new wreckage(loc, AI) for(var/obj/item/mecha_parts/mecha_equipment/E in equipment) if(E.salvageable && prob(30)) @@ -451,6 +454,8 @@ return if(completely_disabled) return + if(is_currently_ejecting) + return if(phasing) occupant_message("Unable to interact with objects while phasing") return diff --git a/code/game/mecha/mecha_actions.dm b/code/game/mecha/mecha_actions.dm index 2a2ef4a5fdd..a638f484932 100644 --- a/code/game/mecha/mecha_actions.dm +++ b/code/game/mecha/mecha_actions.dm @@ -44,7 +44,14 @@ return if(!chassis || chassis.occupant != owner) return - chassis.go_out() + chassis.is_currently_ejecting = TRUE + to_chat(owner, "You begin the ejection procedure. Equipment is disabled during this process. Hold still to finish ejecting.") + if(do_after(chassis.occupant,chassis.exit_delay, target = chassis)) + to_chat(owner, "You exit the mech.") + chassis.go_out() + else + to_chat(owner, "You stop exiting the mech. Weapons are enabled again.") + chassis.is_currently_ejecting = FALSE /datum/action/innate/mecha/mech_toggle_internals diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm index 3a831a9e63c..ff79b12b156 100644 --- a/code/game/mecha/working/ripley.dm +++ b/code/game/mecha/working/ripley.dm @@ -19,6 +19,7 @@ var/hides = 0 enclosed = FALSE //Normal ripley has an open cockpit design enter_delay = 10 //can enter in a quarter of the time of other mechs + exit_delay = 10 opacity = FALSE //Ripley has a window /obj/mecha/working/ripley/Move()