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: SCS-3 Cage, alert qol #6350

Merged
merged 14 commits into from
Jan 20, 2025
6 changes: 6 additions & 0 deletions code/__DEFINES/alerts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@
/** Silicon related */
#define ALERT_LOCKED "locked"

/** Mech related */
// SCS-3 Cage
#define CAGE_STAGE_ZERO "stage_zero"
#define CAGE_STAGE_ONE "stage_one"
#define CAGE_STAGE_TWO "stage_two"
#define CAGE_STAGE_THREE "stage_three"
3 changes: 3 additions & 0 deletions code/__DEFINES/traits/sources.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@

#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
37 changes: 37 additions & 0 deletions code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,43 @@ 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 = "Ты не должен это видеть"
desc = "Ну и это тоже"
icon = 'icons/obj/mecha/mecha_cage.dmi'
var/stage_define

/atom/movable/screen/alert/mech_cage/zero
name = "Нулевой этап"
desc = "Модуль не работает."
icon_state = "stage_0"
stage_define = CAGE_STAGE_ZERO

/atom/movable/screen/alert/mech_cage/one
name = "Первый этап"
desc = "Модуль работает в режиме удержания."
icon_state = "stage_1"
stage_define = CAGE_STAGE_ONE

/atom/movable/screen/alert/mech_cage/two
name = "Второй этап"
desc = "Модуль работает в режиме удержания цели в наручниках."
icon_state = "stage_2"
stage_define = CAGE_STAGE_TWO

/atom/movable/screen/alert/mech_cage/three
name = "Третий этап"
desc = "Модуль работает в режиме заключения."
icon_state = "stage_3"
stage_define = CAGE_STAGE_THREE

//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 @@ -228,10 +232,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 = "Выбран модуль [src.name]"
return TRUE
return FALSE

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