Files
Bubberstation/code/game/objects/effects/decals/decal.dm
SkyratBot f432051f79 [MIRROR] Adds a sleeve of tiling colors for several holidays. [MDB IGNORE] (#24831)
* Adds a sleeve of tiling colors for several holidays. (#79188)

## About The Pull Request
Inspired by #79108. This concerns Christmas, many national holidays and
a few gimmicky ones where it'd make sense.

Oh, yeah, I've also added "Sacrebleu" to the list of possible station
prefixes for the Bastille day, since "Merde" is already there.

<details>
<summary>some screenshots (got tired of restarting the server over and
over halfway through)</summary>

### St. Patrick (Ireland) :
![Booze Complex Fifty-Four 2023-03-17
090724](https://github.com/tgstation/tgstation/assets/42542238/c09e6c3d-8fab-45d6-802e-13687e83b9a7)

### Bastille Day (France) :
![Merde Tomb Seventeen 2023-07-14
084422](https://github.com/tgstation/tgstation/assets/42542238/045f7c32-9a17-4e24-9d33-c51596e348e6)

### Waitangi Day (Union Jack colors, New Zealand) :
**No, it isn't the french flag again, it's the tram tiles that always
display the pattern in vertical stripes...**
![Southern Cross Outpost 39 2023-02-06
012622](https://github.com/tgstation/tgstation/assets/42542238/f6e24875-35b0-4b03-a4f8-72f8d976005d)

### Christmas (Before I realized it looks like the italian flag so I've
removed the white) :
![Festive Space-hulk XLIII 2023-12-25
013720](https://github.com/tgstation/tgstation/assets/42542238/8328ff54-88d9-4be6-9d5e-773fbba7046c)
</details>

## Why It's Good For The Game
Implemeting a smidge of festivity and/or celebration to several
holidays. Open to suggestions and thoughts.

## Changelog

🆑
image: Several holidays now have themed floor and tram tiling.
/🆑

* Adds a sleeve of tiling colors for several holidays.

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2023-11-06 21:22:23 -05:00

93 lines
3.4 KiB
Plaintext

/obj/effect/decal
name = "decal"
plane = FLOOR_PLANE
anchored = TRUE
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
/obj/effect/decal/Initialize(mapload)
. = ..()
if(NeverShouldHaveComeHere(loc))
if(mapload)
stack_trace("[name] spawned in a bad turf ([loc]) at [AREACOORD(src)] in \the [get_area(src)]. \
Please remove it or allow it to pass NeverShouldHaveComeHere if it's intended.")
return INITIALIZE_HINT_QDEL
var/static/list/loc_connections = list(
COMSIG_TURF_CHANGE = PROC_REF(on_decal_move),
)
AddElement(/datum/element/connect_loc, loc_connections)
/obj/effect/decal/blob_act(obj/structure/blob/B)
if(B && B.loc == loc)
qdel(src)
///Checks if we are allowed to be in `here_turf`, and returns that result. Subtypes should override this when necessary.
/obj/effect/decal/proc/NeverShouldHaveComeHere(turf/here_turf)
return isclosedturf(here_turf) || (isgroundlessturf(here_turf) && !GET_TURF_BELOW(here_turf))
/obj/effect/decal/ex_act(severity, target)
qdel(src)
return TRUE
/obj/effect/decal/fire_act(exposed_temperature, exposed_volume)
if(!(resistance_flags & FIRE_PROOF)) //non fire proof decal or being burned by lava
qdel(src)
/obj/effect/decal/proc/on_decal_move(turf/changed, path, list/new_baseturfs, flags, list/post_change_callbacks)
SIGNAL_HANDLER
post_change_callbacks += CALLBACK(src, PROC_REF(sanity_check_self))
/obj/effect/decal/proc/sanity_check_self(turf/changed)
if(changed == loc && NeverShouldHaveComeHere(changed))
qdel(src)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/obj/effect/turf_decal
icon = 'icons/turf/decals.dmi'
icon_state = "warningline"
plane = FLOOR_PLANE
layer = TURF_DECAL_LAYER
anchored = TRUE
/// Does this decal change colors on holidays
var/use_holiday_colors = FALSE
/// The pattern used when recoloring the decal. If null, it'll use the def of the station or holiday.
var/pattern
// This is with the intent of optimizing mapload
// See spawners for more details since we use the same pattern
// Basically rather then creating and deleting ourselves, why not just do the bare minimum?
/obj/effect/turf_decal/Initialize(mapload)
SHOULD_CALL_PARENT(FALSE)
if(flags_1 & INITIALIZED_1)
stack_trace("Warning: [src]([type]) initialized multiple times!")
flags_1 |= INITIALIZED_1
// If the tile uses holiday colors, apply them here
if(use_holiday_colors)
var/custom_color = request_station_colors(src, pattern) || request_holiday_colors(src, pattern)
if(custom_color)
color = custom_color
alpha = DECAL_ALPHA
var/turf/T = loc
if(!istype(T)) //you know this will happen somehow
CRASH("Turf decal initialized in an object/nullspace")
T.AddElement(/datum/element/decal, icon, icon_state, dir, null, layer, alpha, color, null, FALSE, null)
return INITIALIZE_HINT_QDEL
/obj/effect/turf_decal/Destroy(force)
SHOULD_CALL_PARENT(FALSE)
#ifdef UNIT_TESTS
// If we don't do this, turf decals will end up stacking up on a tile, and break the overlay limit
// I hate it too bestie
if(GLOB.running_create_and_destroy)
var/turf/T = loc
T.RemoveElement(/datum/element/decal, icon, icon_state, dir, null, layer, alpha, color, null, FALSE, null)
#endif
// Intentionally used over moveToNullspace(), which calls doMove(), which fires
// off an enormous amount of procs, signals, etc, that this temporary effect object
// never needs or affects.
loc = null
return QDEL_HINT_QUEUE