Skip to content

Commit

Permalink
[MIRROR] Holiday Supermatter [MDB IGNORE] (#1096)
Browse files Browse the repository at this point in the history
* Holiday Supermatter (#80254)

* Update code/modules/power/supermatter/supermatter.dm



---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: lessthanthree <[email protected]>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>
Co-authored-by: GoldenAlpharex <[email protected]>
  • Loading branch information
6 people authored Dec 13, 2023
1 parent a1c06fd commit 2314062
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/game/objects/effects/countdown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@
/obj/effect/countdown/supermatter
name = "supermatter damage"
color = "#00ff80"
pixel_y = 8

/obj/effect/countdown/supermatter/attach(atom/A)
. = ..()
if(istype(A, /obj/machinery/power/supermatter_crystal/shard))
pixel_y = -12

/obj/effect/countdown/supermatter/get_value()
var/obj/machinery/power/supermatter_crystal/S = attached_to
Expand Down
40 changes: 40 additions & 0 deletions code/modules/power/supermatter/supermatter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)

/// If a sliver of the supermatter has been removed. Almost certainly by a traitor. Lowers the delamination countdown time.
var/supermatter_sliver_removed = FALSE

/// If the SM is decorated with holiday lights
var/holiday_lights = FALSE

/// Cooldown for sending emergency alerts to the common radio channel
COOLDOWN_DECLARE(common_radio_cooldown)

Expand Down Expand Up @@ -212,6 +216,9 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
AddComponent(/datum/component/supermatter_crystal, CALLBACK(src, PROC_REF(wrench_act_callback)), CALLBACK(src, PROC_REF(consume_callback)))
soundloop = new(src, TRUE)

if(!isnull(check_holidays(FESTIVE_SEASON)))
holiday_lights()

if (!moveable)
move_resist = MOVE_FORCE_OVERPOWERING // Avoid being moved by statues or other memes

Expand Down Expand Up @@ -252,6 +259,9 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
living_user.electrocute_act(shock_damage = 15, source = src, flags = SHOCK_KNOCKDOWN | SHOCK_NOGLOVES)
. += span_notice("It could use a little more Sodium Chloride...")

if(holiday_lights)
. += span_notice("Radiating both festive cheer and actual radiation, it has a dazzling spectacle lights wrapped lovingly around the base transforming it from a potential doomsday device into a cosmic yuletide centerpiece.")

. += delamination_strategy.examine(src)
return .

Expand Down Expand Up @@ -496,6 +506,13 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
. += mutable_appearance(icon = icon, icon_state = "[base_icon_state]-psy", layer = FLOAT_LAYER - 1, alpha = psy_coeff * 255)
if(delamination_strategy)
. += delamination_strategy.overlays(src)
if(holiday_lights)
if(istype(src, /obj/machinery/power/supermatter_crystal/shard))
. += mutable_appearance(icon, "holiday_lights_shard")
. += emissive_appearance(icon, "holiday_lights_shard_e", src, alpha = src.alpha)
else
. += mutable_appearance(icon, "holiday_lights")
. += emissive_appearance(icon, "holiday_lights_e", src, alpha = src.alpha)
return .

/obj/machinery/power/supermatter_crystal/update_icon(updates)
Expand Down Expand Up @@ -1026,6 +1043,29 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
COOLDOWN_START(src, common_radio_cooldown, SUPERMATTER_COMMON_RADIO_DELAY)
return TRUE

/obj/machinery/power/supermatter_crystal/proc/holiday_lights()
holiday_lights = TRUE
RegisterSignal(src, COMSIG_ATOM_ITEM_INTERACTION, PROC_REF(holiday_item_interaction))
update_appearance()

/// Consume the santa hat and add it as an overlay
/obj/machinery/power/supermatter_crystal/proc/holiday_item_interaction(source, mob/living/user, obj/item/item, list/modifiers)
SIGNAL_HANDLER
if(istype(item, /obj/item/clothing/head/costume/santa) || istype(item, /obj/item/clothing/head/costume/skyrat/christmas)) // SKYRAT EDIT CHANGE - Loadouts
QDEL_NULL(item)
RegisterSignal(src, COMSIG_ATOM_EXAMINE, PROC_REF(holiday_hat_examine))
if(istype(src, /obj/machinery/power/supermatter_crystal/shard))
add_overlay(mutable_appearance(icon, "santa_hat_shard"))
else
add_overlay(mutable_appearance(icon, "santa_hat"))
return COMPONENT_CANCEL_ATTACK_CHAIN
return NONE

/// Adds the hat flavor text when examined
/obj/machinery/power/supermatter_crystal/proc/holiday_hat_examine(atom/source, mob/user, list/examine_list)
SIGNAL_HANDLER
examine_list += span_info("There's a santa hat placed atop it. How it got there without being dusted is a mystery.")

#undef BIKE
#undef COIL
#undef ROD
Expand Down
Binary file modified icons/obj/machines/engine/supermatter.dmi
Binary file not shown.

0 comments on commit 2314062

Please sign in to comment.