Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: mecha cage, mecha alerts #6205

Open
wants to merge 18 commits into
base: master220
Choose a base branch
from
Open
4 changes: 4 additions & 0 deletions code/__DEFINES/traits/sources.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@

#define STAMINA_TRAIT "stamina"

/// source trait for /obj/item/mecha_parts/mecha_equipment/cage
#define MECH_SUPRESSED_TRAIT "mech_supress"


/// trait associated to resting
#define RESTING_TRAIT "resting"
/// trait associated to a stat value or range of
Expand Down
32 changes: 32 additions & 0 deletions code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,38 @@ so as to remain in compliance with the most up-to-date laws."
desc = "Maintenance protocols are currently in effect, most actions disabled."
icon_state = "locked"

/atom/movable/screen/alert/empty_alert
name = ""
desc = ""

// MECH MODULES

// cage module
/atom/movable/screen/alert/mech_cage
name = "You shouldn't see this"
desc = "This as well"
icon = 'icons/obj/mecha/mecha_cage.dmi'

/atom/movable/screen/alert/mech_cage/zero
name = "Stage Zero"
desc = "You are currently not doing anything."
icon_state = "stage_0"

/atom/movable/screen/alert/mech_cage/one
name = "Stage One"
desc = "You are currently supressing someone."
icon_state = "stage_1"

/atom/movable/screen/alert/mech_cage/two
name = "Stage Two"
desc = "You are currently supressing someone handcuffed."
icon_state = "stage_2"

/atom/movable/screen/alert/mech_cage/three
name = "Stage Three"
desc = "You are currently having someone inside the containment chamber."
icon_state = "stage_3"

//GUARDIANS
/atom/movable/screen/alert/cancharge
name = "Charge Ready"
Expand Down
3 changes: 3 additions & 0 deletions code/datums/spells/ethereal_jaunt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

/obj/effect/proc_holder/spell/ethereal_jaunt/proc/do_jaunt(mob/living/target)
playsound(get_turf(target), sound_in, 50, TRUE, -1)
// mech supress escape
if(HAS_TRAIT_FROM(target, TRAIT_IMMOBILIZED, MECH_SUPRESSED_TRAIT))
target.remove_traits(list(TRAIT_IMMOBILIZED, TRAIT_FLOORED), MECH_SUPRESSED_TRAIT)
ADD_TRAIT(target, TRAIT_NO_TRANSFORM, UNIQUE_TRAIT_SOURCE(src))
var/turf/mobloc = get_turf(target)
var/obj/effect/dummy/spell_jaunt/holder = new jaunt_type_path(mobloc)
Expand Down
3 changes: 3 additions & 0 deletions code/game/gamemodes/shadowling/shadowling_abilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@
return

playsound(user.loc, 'sound/effects/bamf.ogg', 50, 1)
// mech supress escape
if(HAS_TRAIT_FROM(user, TRAIT_IMMOBILIZED, MECH_SUPRESSED_TRAIT))
user.remove_traits(list(TRAIT_IMMOBILIZED, TRAIT_FLOORED), MECH_SUPRESSED_TRAIT)
user.visible_message("<span class='warning'>[user] vanishes in a puff of black mist!</span>", "<span class='shadowling'>You enter the space between worlds as a passageway.</span>")
user.SetStunned(0)
user.SetWeakened(0)
Expand Down
2 changes: 2 additions & 0 deletions code/game/mecha/combat/sidewinder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/cage
ME.attach(src)
21 changes: 21 additions & 0 deletions code/game/mecha/equipment/mecha_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
var/selectable = MODULE_SELECTABLE_FULL
var/harmful = FALSE //Controls if equipment can be used to attack by a pacifist.
var/integrated = FALSE // Preventing modules from getting detached.
var/alert_category = "mecha_module" //change if you want custom alerts


/obj/item/mecha_parts/mecha_equipment/proc/update_chassis_page()
Expand Down Expand Up @@ -181,6 +182,9 @@
return
if(chassis.occupant)
remove_targeted_action()
if(chassis.selected == src)
if(selectable == MODULE_SELECTABLE_FULL)
chassis.occupant.clear_alert(alert_category)
detach_act()
moveto = moveto || get_turf(chassis)
if(Move(moveto))
Expand Down Expand Up @@ -224,10 +228,27 @@
return

/obj/item/mecha_parts/mecha_equipment/proc/select_module()
select_set_alert()
chassis.selected = src
chassis.occupant_message(span_notice("You switch to [src]."))
chassis.visible_message("[chassis] raises [src]")
send_byjax(chassis.occupant, "exosuit.browser", "eq_list", chassis.get_equipment_list())

/obj/item/mecha_parts/mecha_equipment/proc/select_set_alert()
if(selectable == MODULE_SELECTABLE_FULL)
var/mob/living/carbon/occupant = chassis.occupant
if(chassis.selected)
occupant.clear_alert(chassis.selected.alert_category)
return throw_default_alert(occupant)
return FALSE

/obj/item/mecha_parts/mecha_equipment/proc/throw_default_alert(var/mob/living/carbon/occupant)
if(alert_category == "mecha_module")
var/atom/movable/screen/alert/empty_alert/default_alert = occupant.throw_alert(alert_category, /atom/movable/screen/alert/empty_alert, new_master = src)
default_alert.name = name
default_alert.desc = "You currently have [src.name] module selected"
return TRUE
return FALSE

/obj/item/mecha_parts/mecha_equipment/proc/toggle_module()
return
Loading