From 2ece68a5ca70e575ce10c2e4d6cb1ec663bd175a Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Sun, 21 Jul 2024 04:41:54 -0500 Subject: [PATCH 01/18] basic stuff --- .../BeachRuins/beach_crashed_engineer.dmm | 10 +- .../JungleRuins/jungle_paradise.dmm | 6 +- .../WasteRuins/wasteplanet_unhonorable.dmm | 22 +- code/_globalvars/lists/objects.dm | 2 + .../mapgen/single_biome/WasteplanetCaves.dm | 6 +- .../effects/effect_system/effects_smoke.dm | 16 ++ .../game/objects/effects/spawners/lootdrop.dm | 12 +- code/game/objects/structures/radioactive.dm | 82 -------- .../generic_hazards/hazard_code/_hazard.dm | 159 +++++++++++++++ .../generic_hazards/hazard_code/_shutoff.dm | 39 ++++ .../generic_hazards/hazard_code/electrical.dm | 83 ++++++++ .../generic_hazards/hazard_code/floor.dm | 76 +++++++ .../hazard_code/radioactive.dm | 38 ++++ .../generic_hazards/hazard_code/slowdown.dm | 75 +++++++ .../generic_hazards/hazard_code/steam.dm | 43 ++++ .../generic_hazards/hazard_info.dm | 74 +++++++ .../generic_hazards/hazards/_examples.dm | 192 ++++++++++++++++++ .../hazards/electrical_conduit.dm | 52 +++++ .../hazards/generic_electrical.dm | 30 +++ .../hazards/radioactive_barrels.dm | 25 +++ .../generic_hazards/hazards/water_hazard.dm | 15 ++ icons/obj/hazard.dmi | Bin 4005 -> 0 bytes icons/obj/hazard/conduit.dmi | Bin 0 -> 2325 bytes icons/obj/hazard/generic.dmi | Bin 0 -> 8455 bytes icons/obj/hazard/shutoff.dmi | Bin 0 -> 836 bytes shiptest.dme | 15 +- 26 files changed, 960 insertions(+), 112 deletions(-) delete mode 100644 code/game/objects/structures/radioactive.dm create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_shutoff.dm create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/radioactive.dm create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/steam.dm create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazards/electrical_conduit.dm create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazards/generic_electrical.dm create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazards/radioactive_barrels.dm create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazards/water_hazard.dm delete mode 100644 icons/obj/hazard.dmi create mode 100644 icons/obj/hazard/conduit.dmi create mode 100644 icons/obj/hazard/generic.dmi create mode 100644 icons/obj/hazard/shutoff.dmi diff --git a/_maps/RandomRuins/BeachRuins/beach_crashed_engineer.dmm b/_maps/RandomRuins/BeachRuins/beach_crashed_engineer.dmm index 998e43b9085a..1d001d2382e6 100644 --- a/_maps/RandomRuins/BeachRuins/beach_crashed_engineer.dmm +++ b/_maps/RandomRuins/BeachRuins/beach_crashed_engineer.dmm @@ -93,7 +93,7 @@ }, /area/ruin/unpowered) "cW" = ( -/obj/structure/radioactive, +/obj/structure/hazard/radioactive, /turf/open/water/beach, /area/overmap_encounter/planetoid/beachplanet/explored) "dG" = ( @@ -242,7 +242,7 @@ /obj/effect/turf_decal/weather/sand{ dir = 1 }, -/obj/structure/radioactive, +/obj/structure/hazard/radioactive, /turf/open/floor/plating/rust, /area/ruin/unpowered) "kP" = ( @@ -1056,7 +1056,7 @@ /turf/open/floor/plasteel/tech, /area/ruin/unpowered) "Sl" = ( -/obj/structure/radioactive/stack, +/obj/structure/hazard/radioactive/stack, /turf/open/floor/plating/beach/sand{ light_range = 2 }, @@ -1133,7 +1133,7 @@ /turf/open/floor/plating, /area/ruin/unpowered) "TI" = ( -/obj/structure/radioactive/waste, +/obj/structure/hazard/radioactive/waste, /obj/effect/decal/cleanable/greenglow, /turf/open/floor/plating/beach/sand{ light_range = 2 @@ -1224,7 +1224,7 @@ /turf/open/floor/plating/rust, /area/overmap_encounter/planetoid/beachplanet/explored) "Xc" = ( -/obj/structure/radioactive, +/obj/structure/hazard/radioactive, /obj/effect/decal/cleanable/greenglow, /turf/open/water/beach, /area/overmap_encounter/planetoid/beachplanet/explored) diff --git a/_maps/RandomRuins/JungleRuins/jungle_paradise.dmm b/_maps/RandomRuins/JungleRuins/jungle_paradise.dmm index 9457e639c5ce..0a5085c850ac 100644 --- a/_maps/RandomRuins/JungleRuins/jungle_paradise.dmm +++ b/_maps/RandomRuins/JungleRuins/jungle_paradise.dmm @@ -2070,7 +2070,7 @@ /area/overmap_encounter/planetoid/cave/explored) "mr" = ( /obj/machinery/light/directional/north, -/obj/structure/radioactive/stack, +/obj/structure/hazard/radioactive/stack, /turf/open/floor/plating/dirt/jungle, /area/overmap_encounter/planetoid/cave/explored) "mt" = ( @@ -2550,7 +2550,7 @@ /obj/effect/turf_decal/box/corners{ dir = 4 }, -/obj/structure/radioactive/stack, +/obj/structure/hazard/radioactive/stack, /obj/effect/turf_decal/techfloor/corner{ dir = 4 }, @@ -3390,7 +3390,7 @@ }, /area/overmap_encounter/planetoid/cave/explored) "uB" = ( -/obj/structure/radioactive{ +/obj/structure/hazard/radioactive{ pixel_x = 7; pixel_y = 9 }, diff --git a/_maps/RandomRuins/WasteRuins/wasteplanet_unhonorable.dmm b/_maps/RandomRuins/WasteRuins/wasteplanet_unhonorable.dmm index b97069f886ba..73cccdb528fa 100644 --- a/_maps/RandomRuins/WasteRuins/wasteplanet_unhonorable.dmm +++ b/_maps/RandomRuins/WasteRuins/wasteplanet_unhonorable.dmm @@ -221,7 +221,7 @@ /turf/open/floor/plastic, /area/ruin/wasteplanet/wasteplanet_radiation/main) "nN" = ( -/obj/structure/radioactive{ +/obj/structure/hazard/radioactive{ pixel_x = 7 }, /turf/open/floor/plating, @@ -305,10 +305,10 @@ /turf/open/floor/plating/asteroid/wasteplanet, /area/ruin/wasteplanet/wasteplanet_radiation) "sh" = ( -/obj/structure/radioactive/stack{ +/obj/structure/hazard/radioactive/stack{ pixel_y = -12 }, -/obj/structure/radioactive{ +/obj/structure/hazard/radioactive{ pixel_y = 6 }, /turf/open/floor/plating/rust, @@ -807,7 +807,7 @@ /turf/open/floor/plating, /area/ruin/wasteplanet/wasteplanet_radiation/main) "Rz" = ( -/obj/structure/radioactive/waste, +/obj/structure/hazard/radioactive/waste, /obj/effect/decal/cleanable/greenglow/filled, /obj/effect/dummy/lighting_obj{ light_color = "#80B425"; @@ -835,14 +835,14 @@ /turf/open/floor/plating, /area/ruin/wasteplanet/wasteplanet_radiation/main) "Tf" = ( -/obj/structure/radioactive{ +/obj/structure/hazard/radioactive{ pixel_x = -1; pixel_y = 7 }, -/obj/structure/radioactive{ +/obj/structure/hazard/radioactive{ pixel_x = 8 }, -/obj/structure/radioactive{ +/obj/structure/hazard/radioactive{ pixel_x = 8; pixel_y = 19 }, @@ -878,7 +878,7 @@ /turf/open/floor/plating/asteroid/wasteplanet, /area/ruin/wasteplanet/wasteplanet_radiation) "Va" = ( -/obj/structure/radioactive/stack, +/obj/structure/hazard/radioactive/stack, /turf/open/floor/plating/rust, /area/ruin/wasteplanet/wasteplanet_radiation/containment) "Vg" = ( @@ -895,11 +895,11 @@ /turf/open/floor/plasteel/dark, /area/ruin/wasteplanet/wasteplanet_radiation/containment) "VA" = ( -/obj/structure/radioactive{ +/obj/structure/hazard/radioactive{ pixel_x = -6; pixel_y = 9 }, -/obj/structure/radioactive{ +/obj/structure/hazard/radioactive{ pixel_x = 3; pixel_y = 4 }, @@ -926,7 +926,7 @@ /turf/open/floor/plastic, /area/ruin/wasteplanet/wasteplanet_radiation/main) "WB" = ( -/obj/structure/radioactive{ +/obj/structure/hazard/radioactive{ pixel_x = 8 }, /obj/effect/decal/cleanable/dirt/dust, diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index 7ee53ec1f37b..6317aeba8d34 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -73,3 +73,5 @@ GLOBAL_LIST_EMPTY(ai_status_displays) GLOBAL_LIST_EMPTY(mob_spawners) /// List of Station alert consoles, /obj/machinery/computer/station_alert GLOBAL_LIST_EMPTY(alert_consoles) +// List of all ruin_hazards, used for ID toggles. +GLOBAL_LIST_EMPTY(ruin_hazards) diff --git a/code/datums/mapgen/single_biome/WasteplanetCaves.dm b/code/datums/mapgen/single_biome/WasteplanetCaves.dm index 08f63ba3149a..c3ab72fc6592 100644 --- a/code/datums/mapgen/single_biome/WasteplanetCaves.dm +++ b/code/datums/mapgen/single_biome/WasteplanetCaves.dm @@ -26,9 +26,9 @@ /obj/structure/closet/crate/secure/loot = 3, /obj/machinery/portable_atmospherics/canister/toxins = 3, /obj/machinery/portable_atmospherics/canister/carbon_dioxide = 3, - /obj/structure/radioactive = 6, - /obj/structure/radioactive/stack = 6, - /obj/structure/radioactive/waste = 6, + /obj/structure/hazard/radioactive = 6, + /obj/structure/hazard/radioactive/stack = 6, + /obj/structure/hazard/radioactive/waste = 6, /obj/structure/flora/ash/garden/waste = 15, /obj/structure/flora/ash/glowshroom = 90, diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm index 7fc59d075356..8a75713aa1f4 100644 --- a/code/game/objects/effects/effect_system/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/effects_smoke.dm @@ -135,6 +135,22 @@ /datum/effect_system/smoke_spread/bad effect_type = /obj/effect/particle_effect/smoke/bad +///////////////////////////////////////////// +// Hazard smoke +///////////////////////////////////////////// + +/obj/effect/particle_effect/smoke/hazard + lifetime = 8 + +/obj/effect/particle_effect/smoke/hazard/smoke_mob(mob/living/carbon/M) + if(..()) + M.adjustOxyLoss(4) + M.emote(pick("cough","gasp")) + return 1 + +/datum/effect_system/smoke_spread/hazard + effect_type = /obj/effect/particle_effect/smoke/hazard + ///////////////////////////////////////////// // Nanofrost smoke ///////////////////////////////////////////// diff --git a/code/game/objects/effects/spawners/lootdrop.dm b/code/game/objects/effects/spawners/lootdrop.dm index db99d0c4e4d8..cce24a00bd12 100644 --- a/code/game/objects/effects/spawners/lootdrop.dm +++ b/code/game/objects/effects/spawners/lootdrop.dm @@ -1065,16 +1065,16 @@ /obj/effect/spawner/lootdrop/waste/radiation loot = list( - /obj/structure/radioactive = 6, - /obj/structure/radioactive/stack = 6, - /obj/structure/radioactive/waste = 6 + /obj/structure/hazard/radioactive = 6, + /obj/structure/hazard/radioactive/stack = 6, + /obj/structure/hazard/radioactive/waste = 6 ) /obj/effect/spawner/lootdrop/waste/radiation/more_rads loot = list( - /obj/structure/radioactive = 3, - /obj/structure/radioactive/stack = 12, - /obj/structure/radioactive/waste = 12 + /obj/structure/hazard/radioactive = 3, + /obj/structure/hazard/radioactive/stack = 12, + /obj/structure/hazard/radioactive/waste = 12 ) /obj/effect/spawner/lootdrop/waste/atmos_can diff --git a/code/game/objects/structures/radioactive.dm b/code/game/objects/structures/radioactive.dm deleted file mode 100644 index 87de907b1813..000000000000 --- a/code/game/objects/structures/radioactive.dm +++ /dev/null @@ -1,82 +0,0 @@ -/* Radioactive hazards for ruins */ - -/obj/structure/radioactive - name = "nuclear waste barrel" - desc = "An old container of radioactive biproducts." - icon = 'icons/obj/hazard.dmi' - icon_state = "barrel" - density = TRUE - var/rad_power = 100 - var/rad_range = 1 // !Range mod = rad dropoff speed - COOLDOWN_DECLARE(pulse_cooldown) - var/rad_delay = 2 SECONDS - -/obj/structure/radioactive/Initialize() - START_PROCESSING(SSobj, src) - . = ..() - -/obj/structure/radioactive/process() - for(var/mob/living/L in range(5, src)) - if(L.client) - Nuke() - break - ..() - -/obj/structure/radioactive/bullet_act(obj/projectile/P) - Nuke() - . = ..() - -/obj/structure/radioactive/attack_tk(mob/user) - Nuke() - -/obj/structure/radioactive/attack_paw(mob/user) - Nuke() - -/obj/structure/radioactive/attack_alien(mob/living/carbon/alien/humanoid/user) - Nuke() - -/obj/structure/radioactive/attack_animal(mob/living/simple_animal/M) - Nuke() - -/obj/structure/radioactive/attack_hand(mob/user) - . = ..() - if(.) - return - Nuke() - -/obj/structure/radioactive/Bumped(atom/movable/AM) - if(!iseffect(AM)) - Nuke() - -/obj/structure/radioactive/proc/Nuke(atom/movable/AM) - if(!COOLDOWN_FINISHED(src, pulse_cooldown)) - return - - COOLDOWN_START(src, pulse_cooldown, rad_delay) - radiation_pulse(src, rad_power, rad_range) - -/obj/structure/radioactive/waste - name = "leaking waste barrel" - desc = "It wasn't uncommon for early vessels to simply dump their waste like this out the airlock. However this proved to be a terrible long-term solution." - icon_state = "barrel_tipped" - anchored = TRUE - rad_power = 150 - rad_range = 0.8 - rad_delay = 1 SECONDS - -/obj/structure/radioactive/stack - name = "stack of nuclear waste" - desc = "Discarded nuclar waste. If enough of this builds up around a planet, radioactive toxins can poison the whole atmosphere." - icon_state = "barrel_3" - anchored = TRUE - rad_power = 300 - rad_delay = 1 SECONDS - -/obj/structure/radioactive/supermatter - name = "decayed supermatter crystal" - desc = "An abandoned supermatter crystal undergoing extreme nuclear decay as a result of poor maintenence and disposal." - icon_state = "smdecay" - anchored = TRUE - rad_power = 1200 - rad_range = 0.2 - rad_delay = 0.5 SECONDS diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm new file mode 100644 index 000000000000..9cbaccf5be71 --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm @@ -0,0 +1,159 @@ +/obj/structure/hazard + name = "ruin hazard" + desc = "tell a maptainer if you see this. you shouldnt!" + icon = 'icons/obj/hazard/generic.dmi' + icon_state = "hazard" + anchored = TRUE + density = TRUE + resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF //add clever ways to disable these hazards! even just tools is better than smashing it to bits + COOLDOWN_DECLARE(cooldown) + var/cooldown_time = 2 SECONDS //stops people from spamming effects + var/enter_activated = FALSE + + var/random_effect = FALSE //repeats an effect after a random amount of time + var/random_min = 10 SECONDS + var/random_max = 30 SECONDS + + var/can_be_disabled = FALSE //can we disable this? Used by most subtypes. + var/time_to_disable = 5 SECONDS //how long does the toolcheck take? + var/disabled = FALSE //if disabled, stops doing effects. Used by subtypes + + var/id = null //used to turn off hazards with mapped in cutoffs (fuseboxes, valves, etc) + var/on = TRUE //used when turned off. + + var/slowdown = 0 //all hazards can use slowdown! but if you make a generic slowdown hazard, its good practice to make it hazard/slowdown + var/disable_text = "a way you don't know! (this needs to be set)" + + FASTDMM_PROP(\ + pinned_vars = list("name", "dir", "id")\ + ) + +/* +procs used to set off effects +*/ + +/obj/structure/hazard/proc/do_random_effect() //if random_effect is TRUE, repeats an effect after a randomly selected period of time between two values. + return + +/obj/structure/hazard/proc/contact(mob/target) //goes off if bumped or entered + return + +/obj/structure/hazard/proc/attacked() //goes off if attacked or shot by most things. + return + +/* +evil 'code' that sets off the above procs. mappers beware! +*/ + +/obj/structure/hazard/proc/turn_on() + if(QDELETED(src) || disabled) + return + on = TRUE + update_appearance() + +/obj/structure/hazard/proc/turn_off() + if(QDELETED(src) || disabled) + return + on = FALSE + update_appearance() + +/obj/structure/hazard/proc/toggle() + if(QDELETED(src) || disabled) + return + on = !on + update_appearance() + +/obj/structure/hazard/proc/disable() + disabled = TRUE + update_appearance() + +/obj/structure/hazard/Initialize() + . = ..() + GLOB.ruin_hazards += src + if(random_effect) + random_effect(TRUE) + if(slowdown) + update_turf_slowdown() + if(enter_activated) + var/static/list/loc_connections = list( + COMSIG_ATOM_ENTERED = PROC_REF(on_entered), + ) + AddElement(/datum/element/connect_loc, loc_connections) + +/obj/structure/hazard/update_icon_state() + if(disabled) + icon_state = initial(icon_state) + "-disabled" + else if(!on) + icon_state = initial(icon_state) + "-off" + else + icon_state = initial(icon_state) + return ..() + +/obj/structure/hazard/examine(mob/user) + . = ..() + if(disabled) + . += span_notice("[src] has been disabled.") + else if(can_be_disabled) + . += span_notice("[src] could be disabled by [disable_text].") + +/obj/structure/hazard/proc/random_effect(start = FALSE) + if(QDELETED(src) || disabled) + return + if(!start && on) + do_random_effect() + var/delay = rand(random_min, random_max) + addtimer(CALLBACK(src, PROC_REF(random_effect)), delay, TIMER_UNIQUE | TIMER_NO_HASH_WAIT) + + +/obj/structure/hazard/proc/on_entered(datum/source, atom/movable/AM) + SIGNAL_HANDLER + + var/target = AM + if(on && !disabled) + contact(target) + +/obj/structure/hazard/Bumped(atom/movable/AM) + if(!iseffect(AM) && on && !disabled) + var/target = AM + contact(target) + +/obj/structure/hazard/bullet_act(obj/projectile/P) + if(on && !disabled) + attacked() + . = ..() + +/obj/structure/hazard/attack_tk(mob/user) + if(on && !disabled) + attacked() + +/obj/structure/hazard/attack_paw(mob/user) + if(on && !disabled) + attacked() + +/obj/structure/hazard/attack_alien(mob/living/carbon/alien/humanoid/user) + if(on && !disabled) + attacked() + +/obj/structure/hazard/attack_animal(mob/living/simple_animal/M) + if(on && !disabled) + attacked() + +/obj/structure/hazard/attack_hand(mob/user) + . = ..() + if(.) + return + if(on && !disabled) + attacked() + +/obj/structure/hazard/proc/update_turf_slowdown(reset = FALSE) + var/turf/open/OT = get_turf(src) + if(!isopenturf(OT)) + return + if(reset) + OT.slowdown = initial(OT.slowdown) + else + OT.slowdown = initial(OT.slowdown) + slowdown + +/obj/structure/hazard/slowdown/Destroy() + update_turf_slowdown(TRUE) + . = ..() diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_shutoff.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_shutoff.dm new file mode 100644 index 000000000000..02315aadc312 --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_shutoff.dm @@ -0,0 +1,39 @@ +/obj/structure/hazard_shutoff + name = "shutoff" + desc = "you shouldn't be seeing this. Tell a maptainer!" + icon = 'icons/obj/hazard/shutoff.dmi' + icon_state = "standing_toggle" + anchored = TRUE + resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF + COOLDOWN_DECLARE(cooldown) + var/cooldown_time = 1 SECONDS + var/resets = null //if set to a time, will turn back on after that time. + var/id = 0 + var/shutoff_message = "you toggle the shutoff" + + FASTDMM_PROP(\ + pinned_vars = list("name", "dir", "id")\ + ) + +/obj/structure/hazard_shutoff/proc/activate(mob/user) + if(!COOLDOWN_FINISHED(src, cooldown)) + return FALSE + COOLDOWN_START(src, cooldown, cooldown_time) + if(!id) //makes null shutoffs not turn off all null hazards. would be bad! + say("no id set! fix that") + return FALSE + to_chat(user, span_notice("[shutoff_message]")) + for(var/obj/structure/hazard/hazard in GLOB.ruin_hazards) + if(hazard.id != src.id) + continue + if(resets) //if resets is a time, turns off the hazard until the reset time has passed. Can continuosly pull switch if cooldown_time is shorter than resets + hazard.turn_off() + addtimer(CALLBACK(hazard, TYPE_PROC_REF(/obj/structure/hazard, turn_on)), resets) + else + hazard.toggle() //allows for switching hazards. IE one section turns on, one turns off. + return TRUE + +/obj/structure/hazard_shutoff/interact(mob/user) + . = ..() + activate(user) + diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm new file mode 100644 index 000000000000..9e31e20fae90 --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm @@ -0,0 +1,83 @@ +// Electrical hazards for ruins. Sparks, Teslas, and Stuns! + +/obj/structure/hazard/electrical + name = "electrical hazard" + desc = "tell a maptainer if you see this. BZZT!" + icon_state = "hazardb" + + random_effect = FALSE + var/random_sparks = FALSE //randomly emit sparks. mostly for show + + var/random_zap = FALSE //randomly zaps mobs on turf. deadly! + + var/random_tesla = FALSE // randomly emit tesla arcs. use sparingly! + var/zap_range = 4 //how far this reaches + var/zap_power = 2000 //has to be more than 1000. this Will be exploited by players so be smart about it. used for damage & power generation + var/zap_flags = ZAP_MOB_DAMAGE | ZAP_MOB_STUN + + enter_activated = FALSE //make sure to set this to TRUE if using contact stuff. + var/contact_sparks = FALSE //spark on contact. for show and rarely to light gases + cooldown_time = 3 SECONDS //stops people from spamming sparks + + var/contact_stun = FALSE //stun on contact. dangerous and potentially deadly + var/stun_time = 50 + var/contact_damage = 30 + var/shock_flags = SHOCK_NOGLOVES | SHOCK_NOSTUN //SHOCK_ILLUSION does stamina damage instead, may be useful. + disable_text = "cutting the wires." + +/obj/structure/hazard/electrical/Initialize() + if(contact_sparks || contact_stun) + enter_activated = TRUE + if(random_sparks || random_tesla || random_zap) + random_effect = TRUE + . = ..() + +/obj/structure/hazard/electrical/do_random_effect() + if(random_sparks) + do_sparks(2, TRUE, src) + if(random_tesla) + zap() + if(random_zap) + zap_on_turf() + +/obj/structure/hazard/electrical/proc/zap() + playsound(src.loc, 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5) + tesla_zap(src, zap_range, zap_power, zap_flags) + +/obj/structure/hazard/electrical/proc/zap_on_turf() + for(var/mob/living/target in src.loc) + do_sparks(2, TRUE, src) + target.electrocute_act(contact_damage, src, flags = shock_flags) + +/obj/structure/hazard/electrical/contact(target) + if(contact_sparks) + contact_sparks() + if(contact_stun && istype(target, /mob/living)) + contact_stun(target) + +/obj/structure/hazard/electrical/proc/contact_sparks() + if(!COOLDOWN_FINISHED(src, cooldown)) + return + COOLDOWN_START(src, cooldown, cooldown_time) + do_sparks(3, TRUE, src) + +/obj/structure/hazard/electrical/proc/contact_stun(mob/living/target) + target.electrocute_act(contact_damage, src, flags = shock_flags) // electrocute act does a message. + if(shock_flags & SHOCK_NOGLOVES) + target.Paralyze(stun_time) + +/obj/structure/hazard/electrical/wirecutter_act(mob/living/user, obj/item/I) + ..() + if(!can_be_disabled) + return + user.visible_message("[user] cuts power to [src].", + "You start to cut power to [src].", "You hear cutting.") + if(!disabled) + if(I.use_tool(src, user, time_to_disable, volume=100)) + to_chat(user, "You disable [src].") + disable() + else + if(I.use_tool(src, user, time_to_disable * 2, volume=100)) + to_chat(user, "You destroy [src].") + qdel(src) + return TRUE diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm new file mode 100644 index 000000000000..daa00794754b --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm @@ -0,0 +1,76 @@ +/* +sharp floor hazards! +pretty much just the caltrop component, but still useful to have as a standard hazard here, to make mapping easier. +CALTROP_BYPASS_SHOES //bypasses shoe check +CALTROP_IGNORE_WALKERS //makes people who walk not take damage. + +ids don't work for these! use something else. +also, caltrops and slippery can't mix, sadly. either it does one or the other. +*/ + +/obj/structure/hazard/floor + name = "floor hazard" + desc = "tell a maptainer if you see this. YOWCH!" + icon_state = "spikepit" + density = FALSE + var/caltrop = FALSE + var/low_damage = 10 + var/high_damage = 20 + var/probability = 100 + var/caltrop_flags = CALTROP_BYPASS_SHOES | CALTROP_IGNORE_WALKERS //feel free to change these on subtypes! + + var/slippery = FALSE + var/knockdown_time = 3 SECONDS + var/slip_flags = NO_SLIP_WHEN_WALKING | SLIDE + var/paralyze_time = 0 + var/forcedrop = FALSE + + var/launcher = FALSE + var/launcher_damage = 90 + var/launch_warning = "The floor glows and begins to float!" + +/obj/structure/hazard/floor/Initialize() + if(launcher) + random_effect = TRUE + . = ..() + +/obj/structure/hazard/floor/do_random_effect() + if(launcher) + launch_sequence() + +/obj/structure/hazard/floor/Initialize() + . = ..() + if(slippery) + AddComponent(/datum/component/slippery, knockdown_time, slip_flags, _paralyze = paralyze_time, _force_drop = forcedrop) + if(caltrop) + AddComponent(/datum/component/caltrop, low_damage, high_damage, probability, caltrop_flags) + +/obj/structure/hazard/floor/examine(mob/user) + . = ..() + if((caltrop_flags & CALTROP_IGNORE_WALKERS) && caltrop) + . += span_notice("you could safely get through [src] if you walk.") + +/obj/structure/hazard/floor/proc/launch_sequence() + visible_message(span_warning(launch_warning)) + icon_state = initial(icon_state) + "-launch" + sleep(10) + visible_message(span_danger("[src] flies upwards!")) + animate(src, pixel_z = 32, time = 1) + for(var/mob/living/target in src.loc) + target.Paralyze(20) + animate(target, pixel_z = 32, time = 1) + target.apply_damage(launcher_damage, BRUTE, pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG), spread_damage = TRUE) + SEND_SIGNAL(target, COMSIG_ON_VENDOR_CRUSH) + target.AddElement(/datum/element/squish, 5 SECONDS) + sleep(1) + animate(src, pixel_z = 0, time = 4) + for(var/mob/living/target in src.loc) + animate(target, pixel_z = 0, time = 4) + target.visible_message("[target] falls to the floor with a sickening crunch!", \ + "You fall to the floor with a sickening crunch!") + playsound(target, 'sound/effects/blobattack.ogg', 40, TRUE) + if(rand(1, 10000) == 10000) + playsound(src, 'sound/effects/gong.ogg', 50, TRUE) + else + playsound(src, 'sound/effects/bang.ogg', 50, TRUE) + icon_state = initial(icon_state) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/radioactive.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/radioactive.dm new file mode 100644 index 000000000000..587e394ebe3c --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/radioactive.dm @@ -0,0 +1,38 @@ +/* +Radioactive hazards for ruins +Was grandfathered and reworked into /hazard types, so they're a little different. +*/ +/obj/structure/hazard/radioactive + name = "nuclear waste barrel" + desc = "An old container of radioactive biproducts." + icon_state = "barrel" + anchored = FALSE + cooldown = 2 SECONDS + resistance_flags = null + var/rad_power = 100 + var/rad_range = 1 // !Range mod = rad dropoff speed + +/obj/structure/hazard/radioactive/Initialize() + START_PROCESSING(SSobj, src) + . = ..() + +/obj/structure/hazard/radioactive/process() + for(var/mob/living/L in range(5, src)) + if(L.client) + Nuke() + break + ..() + +/obj/structure/hazard/radioactive/attacked() + Nuke() + +/obj/structure/hazard/radioactive/contact() + Nuke() + +/obj/structure/hazard/radioactive/proc/Nuke(atom/movable/AM) + if(!COOLDOWN_FINISHED(src, cooldown)) + return + + COOLDOWN_START(src, cooldown, cooldown_time) + radiation_pulse(src, rad_power, rad_range) +//other barrels moved to radioactive_barrels.dm in hazards folder diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm new file mode 100644 index 000000000000..ed4d249a5cac --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm @@ -0,0 +1,75 @@ +/* +slowing hazards! either requires laying down, has a chance to stick, or requires climbing on. +*/ + +/obj/structure/hazard/slowdown + name = "slowing hazard" + desc = "if you see this, tell a maptainer! Waaaait fooorrr meeee guyyyys.." + icon_state = "hazard" + var/overhead = FALSE //requires laying down to get through + + climbable = FALSE + climb_time = 2 SECONDS + + var/sticky = FALSE + var/stick_chance = 50 + var/projectile_stick_chance = 30 + + slowdown = 0 //all hazards can use slowdown! but if you make a generic slowdown hazard, its good practice to make it hazard/slowdown + +/obj/structure/hazard/slowdown/Initialize() + . = ..() + if(slowdown) + update_turf_slowdown() + +/obj/structure/hazard/slowdown/CanAllowThrough(atom/movable/mover, border_dir) + . = ..() + if(density) + return FALSE + if(!on || disabled) + return TRUE + var/failed_check = FALSE + if(sticky) + failed_check += !sticky_checks(mover) + if(overhead) + failed_check += !overhead_checks(mover) + if(failed_check) + return FALSE + else + return TRUE + +//pretty much stolen from plastic flaps. +/obj/structure/hazard/slowdown/proc/overhead_checks(atom/movable/mover) + if(istype(mover) && (mover.pass_flags & PASSGLASS) && !opacity) + return TRUE + + if(istype(mover, /obj/structure/bed)) + var/obj/structure/bed/bed_mover = mover + if(bed_mover.density || bed_mover.has_buckled_mobs())//if it's a bed/chair and is dense or someone is buckled, it will not pass + return FALSE + + else if(istype(mover, /obj/structure/closet/cardboard)) + var/obj/structure/closet/cardboard/cardboard_mover = mover + if(cardboard_mover.move_delay) + return FALSE + + else if(ismecha(mover)) + return FALSE + + else if(isliving(mover)) // You Shall Not Pass! + var/mob/living/living_mover = mover + if(isbot(mover)) //Bots understand the secrets + return TRUE + if(living_mover.body_position == STANDING_UP && !living_mover.ventcrawler && living_mover.mob_size != MOB_SIZE_TINY) //If you're not laying down, or a ventcrawler or a small creature, no pass. + return FALSE + return TRUE + +//based on spider webs. very annoying! +/obj/structure/hazard/slowdown/proc/sticky_checks(atom/movable/mover) + if(isliving(mover)) + if(prob(stick_chance)) + to_chat(mover, "You get stuck in \the [src] for a moment.") + return FALSE + return TRUE + else if(istype(mover, /obj/projectile)) + return prob(projectile_stick_chance) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/steam.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/steam.dm new file mode 100644 index 000000000000..3cf3ff22bea3 --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/steam.dm @@ -0,0 +1,43 @@ +/* +steam and smoke effects! mostly for show + +types +/obj/effect/particle_effect/smoke //safe smoke, blocks view +/obj/effect/particle_effect/smoke/bad_smoke //forcedrops items, blocks view. use sparingly +/obj/effect/particle_effect/smoke/hazard_smoke //oxyloss, blocks view, feels most like deadly smoke +/obj/effect/particle_effect/smoke/transparent //doesn't block view, feels most like steam + */ + + +/obj/structure/hazard/steam + name = "steam hazard" + desc = "tell a maptainer if you see this. FWSSSH!" + icon_state = "hazardg" + var/range = 2 + var/smoke_type = /obj/effect/particle_effect/smoke/transparent + + var/random_steam = FALSE + var/contact_steam = FALSE + +/obj/structure/hazard/steam/Initialize() + if(contact_steam) + enter_activated = TRUE + if(random_steam) + random_effect = TRUE + . = ..() + +/obj/structure/hazard/steam/proc/steam() + do_smoke(range, src, smoke_type) + +/obj/structure/hazard/steam/do_random_effect() + steam() + +/obj/structure/hazard/steam/contact(target) + if(contact_steam) + contact_steam() + +/obj/structure/hazard/steam/proc/contact_steam() + if(!COOLDOWN_FINISHED(src, cooldown)) + return + COOLDOWN_START(src, cooldown, cooldown_time) + steam() diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm new file mode 100644 index 000000000000..e37d14634951 --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm @@ -0,0 +1,74 @@ +///////////// +//MAP GUIDE// +///////////// +/* +Hi there, mapper. this isn't as hard as it looks! follow these steps, and feel free to ask for help! + +1. Go to _examples.dm in the hazards folder +2. Look through the examples, and find one that fits what you want, or could be tweaked into what you need. +3. spawn the example in ingame using the admin tab, going to Game, then selecting Game Panel > create object and search "structure/hazard" +4. make a new [thing].dm file in the hazards folder +5. subtype the hazard you want based on an example! IE: + +thing.dm + +/obj/structure/hazard/electrical/thing + name = "new thing for my cool map" + desc = "cool description" + icon_state = "hazard" //get a sprite! + + random_sparks = TRUE + random_min = 20 SECONDS + random_max = 30 SECONDS + +6. Save and spawn it ingame! +7. Add cool new thing to your map and watch as people get very frustrated about it. + +again, feel free to ask for help! this is made to be (hopefully) easy enough for adventurous mappers to use. + +/////////////////////////////// +//NEW HAZARD/THING TYPE GUIDE// +/////////////////////////////// +look at hazard/electrical for starters, its got a wide array of examples +make a new file for this new thing + +do_random_effect() occurs randomly, with random_min to random_max between + +TODO Finish later! + +TODO (GET RID OF THIS BEFORE THE PR GETS MERGED OR SO HELP ME -helmcrab 21 july 2024) +X-Spike pits! :) +X-low hanging debris? have to crawl or walk through +X-icon stuff +X-electrified area, used to make water scary +X-fusebox for turning off hazards. Also could be a hazard :) +~-chem smoke types //needs testing. +~-make floor hazards rely less on components. Not customizable enough +~-grav tiles! needs to move objects as well because itll look good and tell players 'hey this is fucked up' even more +-burst pipes that emit gas? could just be More Smoke +-MORE SMOKE TYPES!!! YEAH!!! (smoke really needs to be uh, differentiable I think(not my problem for now) (could wait for cl hcl to do goggles check) +-falling debris? not sure how to represent this ingame. +-acid pits +-biological hazards +-electrical makes light + +" BC +My idea would be to rapidly animate people's sprites to show them getting flung into the cieling +Like the fulton but sped up by 3-4 times +And just do a shitton of brute damage +" + +" HC +maybe something roughly like the medipen ruin vault +where if you supply (or fail to supply) something with power, for enough time, it toggles the state +" + + IDEAS - GOING TO NEED A SPRITER OR MAKE BAD SPRITES MYSELF +sparking wallmount (fusebox, old APC, conduit) +power conduits, broken/frayed/decorative (stun version, spark on step, random spark) +wire tangle w/ stun +broken machines +tesla something or other +broken SMES/generator tesla + +*/ diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm new file mode 100644 index 000000000000..268f64485a17 --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm @@ -0,0 +1,192 @@ +//EXAMPLE HAZARDS. DON'T USE THESE! + +/* +SLOWDOWN HAZARDS +*/ + +//a climbing hazard, similar to tables. Must be dense! +/obj/structure/hazard/slowdown/example/climb + name = "climb" + icon_state = "hazard" + density = TRUE //needed + climbable = TRUE //needed + climb_time = 2 SECONDS + +//an overhead hazard, requires laying down to get under. +/obj/structure/hazard/slowdown/example/overhead + name = "overhead" + icon_state = "hazard" + layer = ABOVE_MOB_LAYER //needed + overhead = TRUE //needed + +//a sticky hazard, has a chance to not let you through +/obj/structure/hazard/slowdown/example/sticky + name = "sticky" + icon_state = "hazard" + sticky = TRUE //needed + stick_chance = 50 + projectile_stick_chance = 30 + +//a slowing hazard, slows down movement within. (all hazards can have slowdown set, not just hazard/slowdown) +/obj/structure/hazard/slowdown/example/slow + name = "slow" + icon_state = "hazard" + slowdown = 1 //needed + +/* +ELECTRICAL HAZARDS +*/ + +//emits a spark shower every 10-20 seconds +/obj/structure/hazard/electrical/example/random_sparks + name = "random sparks" + icon_state = "hazardb" + random_sparks = TRUE //needed + random_min = 10 SECONDS + random_max = 20 SECONDS + +//emits a tesla arc every 5-10 seconds, within the set range and at the set power. +/obj/structure/hazard/electrical/example/random_tesla + name = "random tesla" + icon_state = "hazardb" + random_tesla = TRUE //needed + random_min = 5 SECONDS + random_max = 10 SECONDS + zap_range = 3 + zap_power = 1500 + zap_flags = ZAP_MOB_DAMAGE | ZAP_MOB_STUN + +//emits sparks when walked over. If density = TRUE, emits sparks when bumped! Cooldown stops spark spam +/obj/structure/hazard/electrical/example/contact_sparks + name = "contact sparks" + icon_state = "hazardb" + density = FALSE + contact_sparks = TRUE //needed + cooldown_time = 3 SECONDS + +//stuns when walked over. If density = TRUE, stuns when bumped into! +/obj/structure/hazard/electrical/example/contact_stun + name = "contact stun" + icon_state = "hazardb" + density = FALSE + contact_stun = TRUE //needed + stun_time = 50 + contact_damage = 30 + shock_flags = SHOCK_NOGLOVES | SHOCK_NOSTUN + +/obj/structure/hazard/electrical/example/stun_and_spark + name = "random sparks and contact stun" + icon_state = "hazardb" + density = TRUE + + random_sparks = TRUE + random_min = 10 SECONDS + random_max = 20 SECONDS + + contact_stun = TRUE + stun_time = 0 //don't do stun_time if not using SHOCK_NOGLOVES + contact_damage = 30 + shock_flags = 0 //doesn't shock if not wearing gloves, but stuns if you get shocked. + +/* +STEAM HAZARDS +*/ + +//emits steam every 10-20 seconds +/obj/structure/hazard/steam/example/random_steam + name = "random steam" + icon_state = "hazardg" + random_steam = TRUE //needed + random_min = 10 SECONDS + random_max = 20 SECONDS + range = 2 + +//emits steam when walked over. if density = TRUE, emits steam when bumped +/obj/structure/hazard/steam/example/contact_steam + name = "contact steam" + icon_state = "hazardg" + contact_steam = TRUE //needed + range = 2 +// different smoke examples + +//transparent smoke that players can see through (otherwise blocks view) +/obj/structure/hazard/steam/example/contact_steam/steam + name = "steam" + smoke_type = /obj/effect/particle_effect/smoke/transparent + +//opaque smoke that does no damage +/obj/structure/hazard/steam/example/contact_steam/safe + name = "safe" + smoke_type = /obj/effect/particle_effect/smoke + +//smoke that makes you drop items and cough +/obj/structure/hazard/steam/example/contact_steam/bad + name = "bad" + smoke_type = /obj/effect/particle_effect/smoke/bad + +//smoke that makes you take oxyloss and cough +/obj/structure/hazard/steam/example/contact_steam/hazard + name = "hazard" + smoke_type = /obj/effect/particle_effect/smoke/hazard + +/* +FLOOR EXAMPLES +*/ + +//classic spike pit, can be avoided by laying down. +/obj/structure/hazard/floor/example/sharp + name = "example sharp" + icon_state = "spikepit" + caltrop = TRUE //needed + low_damage = 20 + high_damage = 30 + probability = 80 + caltrop_flags = CALTROP_BYPASS_SHOES | CALTROP_IGNORE_WALKERS + +//simple slipping hazard, similar to oil spills. +/obj/structure/hazard/floor/example/slip + name = "example slip" + icon_state = "hazardb" + slippery = TRUE //needed + knockdown_time = 3 SECONDS + slip_flags = NO_SLIP_WHEN_WALKING | SLIDE + paralyze_time = 1 SECONDS + forcedrop = TRUE + +/obj/structure/hazard/floor/example/launch + name = "example launch" + icon_state = "gravplate" //needs state-launch version + layer = ABOVE_OPEN_TURF_LAYER //needed + launcher = TRUE //needed + random_min = 5 SECONDS + random_max = 5 SECONDS + +/* +shutoff example +*/ + +//Toggles the state of hazards with the same ID. SET ID ON MAP USING VAREDIT AND BE UNIQUE (ie id = crashed_starwalker_water_hazard) +/obj/structure/hazard_shutoff/example + name = "example shutoff" + desc = "id = 1" + id = 1 + +//ingame working example +/obj/structure/hazard/electrical/example/random_tesla/shutoffexample + name = "shutoff tesla" + id = 1 + random_min = 1 SECONDS + random_max = 2 SECONDS + +//another ingame working example +/obj/structure/hazard/electrical/electrified_water/example + id = 1 + +//turns off hazards with the same ID until the resets time has passed! +/obj/structure/hazard_shutoff/example/timed + name = "timed example shutoff" + desc = "id = 1" + id = 1 + resets = 3 SECONDS + +//good luck with radioactive hazards for now. you'll likely need to write code (dear god) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/electrical_conduit.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/electrical_conduit.dm new file mode 100644 index 000000000000..e094de70faeb --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/electrical_conduit.dm @@ -0,0 +1,52 @@ + +/obj/structure/hazard/electrical/conduit + name = "old power conduit" + desc = "cheap industrial cable used to transfer large volumes of power." + icon = 'icons/obj/hazard/conduit.dmi' + icon_state = "conduit" + density = FALSE + time_to_disable = 10 SECONDS //only some subtypes can actually be disabled. + slowdown = 0.5 + +/obj/structure/hazard/electrical/conduit/corner + icon_state = "conduitcorner" + +/obj/structure/hazard/electrical/conduit/manifold + icon_state = "conduitmanifold" + +/obj/structure/hazard/electrical/conduit/manifold4w + icon_state = "conduitmanifold4w" + +/obj/structure/hazard/electrical/conduit/frayed_sparks + name = "frayed power conduit" + desc = "cheap industrial cable used to transfer large volumes of power, which appears to be frayed." + icon_state = "conduitfrayed" + contact_sparks = TRUE + random_sparks = TRUE + cooldown_time = 10 SECONDS + random_min = 30 SECONDS + random_max = 90 SECONDS + can_be_disabled = TRUE + +/obj/structure/hazard/electrical/conduit/exposed_wires_stun + name = "exposed power conduit" + desc = "cheap industrial cable used to transfer large volumes of power, with the internal cable exposed." + icon_state = "conduitexposed" + contact_sparks = TRUE + contact_stun = TRUE + stun_time = 60 + contact_damage = 35 + shock_flags = SHOCK_NOGLOVES | SHOCK_NOSTUN + can_be_disabled = TRUE + +/obj/structure/hazard/electrical/conduit/tesla_arc_node + name = "power conduit node" + desc = "An exposed contact point for an old charging system, now highly dangerous due to its age." + icon_state = "conduitnode" + random_tesla = TRUE + random_min = 5 SECONDS + random_max = 10 SECONDS + zap_range = 2 + zap_power = 1500 + zap_flags = ZAP_MOB_DAMAGE | ZAP_MOB_STUN + can_be_disabled = TRUE //a fools errand, but we can let them try. diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/generic_electrical.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/generic_electrical.dm new file mode 100644 index 000000000000..084aa2c4fc3e --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/generic_electrical.dm @@ -0,0 +1,30 @@ +/obj/structure/hazard/electrical/wire_mess + name = "wire tangle" + desc = "a dense tangle of wires, likely electrified." + icon_state = "wiremess" + density = FALSE + contact_sparks = TRUE + contact_stun = TRUE + stun_time = 30 + contact_damage = 15 + shock_flags = SHOCK_NOGLOVES | SHOCK_NOSTUN + slowdown = 1 + +/obj/structure/hazard_shutoff/electrical_shutoff + name = "rusting power switch" + desc = "An old emergency shutoff switch for industrial power sources." + icon_state = "electric_toggle" + shutoff_message = "The lever creaks as you force it, toggling the old power system." + cooldown_time = 5 SECONDS + +/obj/structure/hazard_shutoff/electrical_shutoff/resets + name = "power cycle button" + desc = "a cracked button that's used to initiate a power cycle. You get the feeling this won't last very long." + icon_state = "electric_reset" + shutoff_message = "The button emits a mechanical clicking, starting a power reset cycle..." + resets = 15 SECONDS + +/obj/structure/hazard_shutoff/electrical_shutoff/activate(mob/user) + . = ..() + if(. == TRUE) + do_sparks(1, TRUE, src) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/radioactive_barrels.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/radioactive_barrels.dm new file mode 100644 index 000000000000..bf6744df4542 --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/radioactive_barrels.dm @@ -0,0 +1,25 @@ +/obj/structure/hazard/radioactive/waste + name = "leaking waste barrel" + desc = "It wasn't uncommon for early vessels to simply dump their waste like this out the airlock. However this proved to be a terrible long-term solution." + icon_state = "barrel_tipped" + anchored = TRUE + rad_power = 150 + rad_range = 0.8 + cooldown_time = 1 SECONDS + +/obj/structure/hazard/radioactive/stack + name = "stack of nuclear waste" + desc = "Discarded nuclar waste. If enough of this builds up around a planet, radioactive toxins can poison the whole atmosphere." + icon_state = "barrel_3" + anchored = TRUE + rad_power = 300 + cooldown_time = 1 SECONDS + +/obj/structure/hazard/radioactive/supermatter + name = "decayed supermatter crystal" + desc = "An abandoned supermatter crystal undergoing extreme nuclear decay as a result of poor maintenence and disposal." + icon_state = "smdecay" + anchored = TRUE + rad_power = 1200 + rad_range = 0.2 + cooldown_time = 0.5 SECONDS diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/water_hazard.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/water_hazard.dm new file mode 100644 index 000000000000..77e93e810246 --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/water_hazard.dm @@ -0,0 +1,15 @@ +/obj/structure/hazard/electrical/electrified_water + name = "electrified water" + desc = "hazardous water!" + icon_state = "electrified" + //mouse_opacity = MOUSE_OPACITY_TRANSPARENT //commented out so I can get to the vars easily. + resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF | HYPERSPACE_PROOF + move_resist = INFINITY + obj_flags = 0 + density = FALSE + contact_sparks = TRUE + random_zap = TRUE + contact_damage = 10 + random_min = 2 SECONDS + random_max = 5 SECONDS + slowdown = 0.5 diff --git a/icons/obj/hazard.dmi b/icons/obj/hazard.dmi deleted file mode 100644 index 5c350c5afb9b189a968d8642f18305443570bff0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4005 zcmV;W4_fevP)V=-0C=2@%CQQspR_6`L%A=^3d zwb=IuKf(>3UMwX)?y%Uc)@0r}YJx?#C6hQ`lP*&RM`V@8Q!QW+62q9`*d!4@4e_iE^jqIX5cjg+*Q77 z@QMM_(saVIkhq3=OwizVzs3 z0bu6SyF6luye*l+V?Xw?My=vns1JYl;YO$BkA3L6d>aFll$5BnTCGrAT&(E1gN2n+ z?{984lCH}{tJMmAerk>%FXHWY-lMei3H9K~^CM$oSTXF}1q2UCEhSS*agTpd~ zN2<8e6UwHQ5d?*3=(yEFezBh1r-vfZ0%MDbsF+xyaIE-&@?&RA2Oz)r^q}%p){AkH zo0$+5#lC%eNK8rrAbIW_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G_>y=GcW>29W&zWVMQm@17^>KJi52);$}%W&~#hEhWc}cA|9#mkqFMXO{4b ziT9GBi{tBi{g|v)Dcpgz5e6D!Fe5n2zXbPE{p^+ZR^F&5;1&n0nJ*?)MMeZO+0q1@PiG_XD;>JrLGW(7LTR@E>n6g1ZMKtclh-Z!`C$h@WQ^v}|x2$cn)lz#8-t&Sg|3~X<29fU&88V=W$^BBywMhV9CVjl>g&d|-`|M92jY!e&)@eM#s_4CR%`I%zS5%7F> zJ24GCOjfJN-fdL)eW~{y*glB`QyZweEMBjQ`JVFq5Ax#CV2a-QPCl~ZNcp*Y53AlN zsI_~j&eI1ZBstznUvw9Ccf|6Zc}l2?n9bsj^GsHY@A;OmID8*2>EUE`8xuBKawH`s z9D4r@^X5jg=7))_x^R*VT^twRJx|rNST?`B*QGCPFaJ|oa(-^ze6n{N@xLQ_f3~gi zb6<+!y#wC>;zrLv3{?C`?}*tLKvKT{xLPLkHxbe7&z}xO6B`w9=g*%yLk};0bH7Zy z65883DLhieTlXci>Vo+5G_L$$g)?MltrVnL_nEU6Lj7HOzhWsuy1!s*1M}vJ|GU!D zN7?`i4*24?83MrKj`P%a3)Do7CxSK-vugP=B@@<*o8Ylg{=7N=D*oddSpOfQ+mKSn zmn@CvqnHb1OpKFV$``-Q5bC=HUikRfu!g-i4oHkNWCN`K{T3mbw1^ zikR&&LyRT(z#Ziqzf&l^K}g0J*#kgNpXdS_gk+*sWkjpWhz8*%;^-x*) z4MH-1Ij5%1&@H>Ls)*S{tIDYF7Tx>$-*0hwS;84XJHluqT4zv|l$6K{@gG-9Pv4Yb ze_qy3By!mWVxt1+SP|^7-2S&;cS}LuIG{1o955>Kf<_V}ZGis+cn{<91oF|&00000 LNkvXXu0mjfx^UAt diff --git a/icons/obj/hazard/conduit.dmi b/icons/obj/hazard/conduit.dmi new file mode 100644 index 0000000000000000000000000000000000000000..d2fcd6f85f2199f943108fd6feb7cb83da4dda7d GIT binary patch literal 2325 zcmV+w3F`KVP)WC!D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 zfc{Nz*eG_*UthRG3#FeU7GsHWC6r!X)la0}Sc#E>=;E}BD0ifFDZ*Bkpc$`yKaB_9`^iy#0_2eo`Eh^5;&r`5fFwryM;w;ZhDainGjE%TB zGg33tGfE(w;*!LYR3K9c$jD2{%uA0i$xlzuNmb(FOvx-N2Fe(6ai$d|=B7f}nCgpC zi&IMoDo@QxO)e?QOvW(Ygn)W9<586>E4cc(fV~R7a%n{0006zNkl-+#zHi8j`GBZ#fph7Y$2#Gv4PAHHVpE>(LV(4wI(@&SX zKX-ps{Tws#5rl`MfYwK&v{I#jr4X_K1Lc6WT{hZU9ss};18#g=b80XE7+t7(z*Xs= ziE+5u+>Xx&)}HYI0C|A(&E{@=HqPlRz-qNvjL#R&J>&t5W&(tm04|+-$pTm*?D%ZD zF0Te*+p@dx4UnsY3Lt&{eL(nqoaI50IfBa0Sy2auK@{=r~xs9L>EW^R0q^9c%81JE|RK)8sPpmdPP)XT_YJ(5>m5y z3_voF(nw|oHkyH$e4VKbj4?4l|7ueJmVq|W45ZXj^qXx5K)Zm|K>GPw`#IU}0GJNY zE=Ubf`#HOP2jovAX|4GJ6omBay?%A>xg20X9Cuyus*?+ltX(7Qbz`aj>@<_@6^9Pk58c!U5Kn0-wfC@;|fS3W=1tI{~0kI2xx8qkt9f;R$6Tc!V z@z`7W_!ZF~BmgvjkjfzL59k2IAJ74aKL`ML7l<{$bwKO_cOvcMAH*9sVwg1>9LTc( O0000 Date: Sun, 21 Jul 2024 17:39:23 -0500 Subject: [PATCH 02/18] autodoc and much better comments --- code/_globalvars/lists/objects.dm | 2 +- .../generic_hazards/hazard_code/_hazard.dm | 40 +++++++++++++----- .../generic_hazards/hazard_code/_shutoff.dm | 8 +++- .../generic_hazards/hazard_code/electrical.dm | 42 +++++++++++++------ .../generic_hazards/hazard_code/floor.dm | 13 +++++- .../generic_hazards/hazard_code/slowdown.dm | 17 ++++---- .../generic_hazards/hazard_code/steam.dm | 6 ++- 7 files changed, 91 insertions(+), 37 deletions(-) diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index 6317aeba8d34..e3f0b27e135e 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -73,5 +73,5 @@ GLOBAL_LIST_EMPTY(ai_status_displays) GLOBAL_LIST_EMPTY(mob_spawners) /// List of Station alert consoles, /obj/machinery/computer/station_alert GLOBAL_LIST_EMPTY(alert_consoles) -// List of all ruin_hazards, used for ID toggles. +/// List of all ruin_hazards (obj/structure/hazard), used for ID toggles. GLOBAL_LIST_EMPTY(ruin_hazards) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm index 9cbaccf5be71..afefbbf047ef 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm @@ -5,24 +5,35 @@ icon_state = "hazard" anchored = TRUE density = TRUE - resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF //add clever ways to disable these hazards! even just tools is better than smashing it to bits + //add clever ways to disable these hazards! even just tools is better than smashing it to bits. Make sure to overwrite if you want people to be able to destroy this. + resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF COOLDOWN_DECLARE(cooldown) - var/cooldown_time = 2 SECONDS //stops people from spamming effects + //cooldown on contact effects + var/cooldown_time = 2 SECONDS + //needs to be enabled for contact effects to work, please automatically set this on subtype inits (see electrical for example) var/enter_activated = FALSE - var/random_effect = FALSE //repeats an effect after a random amount of time + //calls do_random_effect() with a delay between the random_min and random_max. if min and max are equal, the delay will be constant. + var/random_effect = FALSE var/random_min = 10 SECONDS var/random_max = 30 SECONDS - var/can_be_disabled = FALSE //can we disable this? Used by most subtypes. - var/time_to_disable = 5 SECONDS //how long does the toolcheck take? - var/disabled = FALSE //if disabled, stops doing effects. Used by subtypes + //Whether this hazard can be disabled. Does nothing without implementing a way to disable the hazard. + var/can_be_disabled = FALSE + //Can be used for do_afters on disable checks, also toolchecks. + var/time_to_disable = 5 SECONDS + //whether this hazard has been disabled, which no longer functions and doesn't listen to hazard shutoffs. + var/disabled = FALSE + //examine text shown if can_be_disabled is true. Make sure to set this if you add a way to disable your hazard. + var/disable_text = "a way you don't know! (this needs to be set)" - var/id = null //used to turn off hazards with mapped in cutoffs (fuseboxes, valves, etc) - var/on = TRUE //used when turned off. + //ID for use with hazard shutoffs, should be set per map and not in code. + var/id = null + //whether this hazard is on or off. Offline hazards don't get contact() or do_random_effect() procs sent. + var/on = TRUE - var/slowdown = 0 //all hazards can use slowdown! but if you make a generic slowdown hazard, its good practice to make it hazard/slowdown - var/disable_text = "a way you don't know! (this needs to be set)" + //slowdown, which increases the slowdown of the turf the hazard is on. All hazards can use this. + var/slowdown = 0 FASTDMM_PROP(\ pinned_vars = list("name", "dir", "id")\ @@ -45,6 +56,8 @@ procs used to set off effects evil 'code' that sets off the above procs. mappers beware! */ +//on off procs + /obj/structure/hazard/proc/turn_on() if(QDELETED(src) || disabled) return @@ -67,6 +80,8 @@ evil 'code' that sets off the above procs. mappers beware! disabled = TRUE update_appearance() +//real code + /obj/structure/hazard/Initialize() . = ..() GLOB.ruin_hazards += src @@ -104,6 +119,7 @@ evil 'code' that sets off the above procs. mappers beware! var/delay = rand(random_min, random_max) addtimer(CALLBACK(src, PROC_REF(random_effect)), delay, TIMER_UNIQUE | TIMER_NO_HASH_WAIT) +//contact checks, based on density. /obj/structure/hazard/proc/on_entered(datum/source, atom/movable/AM) SIGNAL_HANDLER @@ -117,6 +133,8 @@ evil 'code' that sets off the above procs. mappers beware! var/target = AM contact(target) +//attacked checks + /obj/structure/hazard/bullet_act(obj/projectile/P) if(on && !disabled) attacked() @@ -145,6 +163,8 @@ evil 'code' that sets off the above procs. mappers beware! if(on && !disabled) attacked() +//slowdown code, sets the loc turf slowness. Make sure your hazard can't be moved if you do this, or it will cause issues. + /obj/structure/hazard/proc/update_turf_slowdown(reset = FALSE) var/turf/open/OT = get_turf(src) if(!isopenturf(OT)) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_shutoff.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_shutoff.dm index 02315aadc312..9a47c229ede2 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_shutoff.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_shutoff.dm @@ -6,9 +6,13 @@ anchored = TRUE resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF COOLDOWN_DECLARE(cooldown) + //cooldown on activating the shutoff var/cooldown_time = 1 SECONDS - var/resets = null //if set to a time, will turn back on after that time. + //if set to a time, resets will turn the hazards back on after that time. + var/resets = null + //ID used to toggle hazards, should only be set in maps. var/id = 0 + //to_chat message when using the shutoff var/shutoff_message = "you toggle the shutoff" FASTDMM_PROP(\ @@ -20,7 +24,7 @@ return FALSE COOLDOWN_START(src, cooldown, cooldown_time) if(!id) //makes null shutoffs not turn off all null hazards. would be bad! - say("no id set! fix that") + say("no id set! fix that") //shutoffs without IDs shouldn't exist, so this lets mappers know, hopefully. return FALSE to_chat(user, span_notice("[shutoff_message]")) for(var/obj/structure/hazard/hazard in GLOB.ruin_hazards) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm index 9e31e20fae90..bf8cb42c17b9 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm @@ -5,29 +5,40 @@ desc = "tell a maptainer if you see this. BZZT!" icon_state = "hazardb" - random_effect = FALSE - var/random_sparks = FALSE //randomly emit sparks. mostly for show - - var/random_zap = FALSE //randomly zaps mobs on turf. deadly! - - var/random_tesla = FALSE // randomly emit tesla arcs. use sparingly! - var/zap_range = 4 //how far this reaches - var/zap_power = 2000 //has to be more than 1000. this Will be exploited by players so be smart about it. used for damage & power generation + //randomly emit sparks. mostly for show + var/random_sparks = FALSE + //randomly zaps mobs on turf. deadly! + var/random_zap = FALSE + // randomly emit tesla arcs. use sparingly! + var/random_tesla = FALSE + //how far the tesla arc reaches, still can chain off other objects. + var/zap_range = 4 + //has to be more than 1000. this Will be exploited by players so be smart about it. used for damage & power generation + var/zap_power = 2000 + //flags for the arc, these are generally good, but ZAP_OBJ_DAMAGE may be useful in rare cases. var/zap_flags = ZAP_MOB_DAMAGE | ZAP_MOB_STUN - enter_activated = FALSE //make sure to set this to TRUE if using contact stuff. - var/contact_sparks = FALSE //spark on contact. for show and rarely to light gases - cooldown_time = 3 SECONDS //stops people from spamming sparks + //sparks on contact, mostly for show or to light fires. + var/contact_sparks = FALSE + //stops people from spamming sparks, also sparks can set off sparks. + cooldown_time = 3 SECONDS - var/contact_stun = FALSE //stun on contact. dangerous and potentially deadly + //stun on contact. dangerous and potentially deadly + var/contact_stun = FALSE + //how long, in decaseconds, the target is stunned. If 0, doesn't stun. var/stun_time = 50 + //how much burn damage the stun does. var/contact_damage = 30 - var/shock_flags = SHOCK_NOGLOVES | SHOCK_NOSTUN //SHOCK_ILLUSION does stamina damage instead, may be useful. + //flags for the stun, SHOCK_NOGLOVES ignores gloves, SHOCK_NOSTUN doesn't stun (built in stun_time is seperate), SHOCK_ILLUSION does stamina damage instead. + var/shock_flags = SHOCK_NOGLOVES | SHOCK_NOSTUN + //examine text shown in can_be_disabled is TRUE disable_text = "cutting the wires." /obj/structure/hazard/electrical/Initialize() + //if contact, need to set enter_activated if(contact_sparks || contact_stun) enter_activated = TRUE + //if random, need to set random_effect if(random_sparks || random_tesla || random_zap) random_effect = TRUE . = ..() @@ -40,10 +51,12 @@ if(random_zap) zap_on_turf() +//shoots off a tesla arc /obj/structure/hazard/electrical/proc/zap() playsound(src.loc, 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5) tesla_zap(src, zap_range, zap_power, zap_flags) +//zaps players on the same turf /obj/structure/hazard/electrical/proc/zap_on_turf() for(var/mob/living/target in src.loc) do_sparks(2, TRUE, src) @@ -55,17 +68,20 @@ if(contact_stun && istype(target, /mob/living)) contact_stun(target) +//sparks when bumped or walked over /obj/structure/hazard/electrical/proc/contact_sparks() if(!COOLDOWN_FINISHED(src, cooldown)) return COOLDOWN_START(src, cooldown, cooldown_time) do_sparks(3, TRUE, src) +//stuns when bumped or walked over /obj/structure/hazard/electrical/proc/contact_stun(mob/living/target) target.electrocute_act(contact_damage, src, flags = shock_flags) // electrocute act does a message. if(shock_flags & SHOCK_NOGLOVES) target.Paralyze(stun_time) +//generic disabling for electrical hazards, only works if can_be_disabled is TRUE /obj/structure/hazard/electrical/wirecutter_act(mob/living/user, obj/item/I) ..() if(!can_be_disabled) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm index daa00794754b..5c0c73a212a5 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm @@ -12,21 +12,30 @@ also, caltrops and slippery can't mix, sadly. either it does one or the other. name = "floor hazard" desc = "tell a maptainer if you see this. YOWCH!" icon_state = "spikepit" + //these all need to be not dense density = FALSE + //does damage to legs when walked over var/caltrop = FALSE var/low_damage = 10 var/high_damage = 20 var/probability = 100 - var/caltrop_flags = CALTROP_BYPASS_SHOES | CALTROP_IGNORE_WALKERS //feel free to change these on subtypes! + //bypass shoes ignores shoes, ignore walkers lets players ignore damage by walking through + var/caltrop_flags = CALTROP_BYPASS_SHOES | CALTROP_IGNORE_WALKERS + //slips! var/slippery = FALSE var/knockdown_time = 3 SECONDS + //no slip when walking makes walking not slip, slide makes players fly in the direction they were going. var/slip_flags = NO_SLIP_WHEN_WALKING | SLIDE var/paralyze_time = 0 + //player drops their items var/forcedrop = FALSE + //launches upwards using do_random_effect between random_min and random_max. also flattens players a little. Needs a icon_state-launch state to look right. var/launcher = FALSE + //damage done by launcher, these are very crunchy and have a windup var/launcher_damage = 90 + //warning sent 1 second before the launcher does animation & damage var/launch_warning = "The floor glows and begins to float!" /obj/structure/hazard/floor/Initialize() @@ -69,7 +78,7 @@ also, caltrops and slippery can't mix, sadly. either it does one or the other. target.visible_message("[target] falls to the floor with a sickening crunch!", \ "You fall to the floor with a sickening crunch!") playsound(target, 'sound/effects/blobattack.ogg', 40, TRUE) - if(rand(1, 10000) == 10000) + if(rand(1, 10000) == 10000) // 0.01% chance. playsound(src, 'sound/effects/gong.ogg', 50, TRUE) else playsound(src, 'sound/effects/bang.ogg', 50, TRUE) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm index ed4d249a5cac..705e4a6cebe6 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm @@ -6,21 +6,22 @@ slowing hazards! either requires laying down, has a chance to stick, or requires name = "slowing hazard" desc = "if you see this, tell a maptainer! Waaaait fooorrr meeee guyyyys.." icon_state = "hazard" - var/overhead = FALSE //requires laying down to get through - + //requires laying down to get through, like plastic flaps. + var/overhead = FALSE + //requires climbing over like tables climbable = FALSE + //time to climb climb_time = 2 SECONDS + //sticky like spiderwebs, very annoying. var/sticky = FALSE + //chance you get stuck instead of walking into var/stick_chance = 50 + //chance it eats a projectile var/projectile_stick_chance = 30 - slowdown = 0 //all hazards can use slowdown! but if you make a generic slowdown hazard, its good practice to make it hazard/slowdown - -/obj/structure/hazard/slowdown/Initialize() - . = ..() - if(slowdown) - update_turf_slowdown() + //all hazards can use slowdown! but if you make a generic slowdown hazard, its good practice to make it hazard/slowdown + slowdown = 0 /obj/structure/hazard/slowdown/CanAllowThrough(atom/movable/mover, border_dir) . = ..() diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/steam.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/steam.dm index 3cf3ff22bea3..095bdd7fe66d 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/steam.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/steam.dm @@ -13,10 +13,14 @@ types name = "steam hazard" desc = "tell a maptainer if you see this. FWSSSH!" icon_state = "hazardg" + //how far the smoke spreads, effectively the radius. var/range = 2 + //type of smoke emited, check effects_smoke.dm for all of them, or the short list at the top of this file. var/smoke_type = /obj/effect/particle_effect/smoke/transparent + //randomly emits smoke between random_min and random_max time var/random_steam = FALSE + //emits smoke when bumped or walked over, can have cooldown_time set. var/contact_steam = FALSE /obj/structure/hazard/steam/Initialize() @@ -30,7 +34,7 @@ types do_smoke(range, src, smoke_type) /obj/structure/hazard/steam/do_random_effect() - steam() + steam() /obj/structure/hazard/steam/contact(target) if(contact_steam) From 85deaa2905cccc8a6afddf7f326221d37c095ea1 Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Sun, 21 Jul 2024 17:43:51 -0500 Subject: [PATCH 03/18] living/carbon to appease apply_damage --- .../objects_and_mobs/generic_hazards/hazard_code/floor.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm index 5c0c73a212a5..156254cca44d 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm @@ -65,7 +65,7 @@ also, caltrops and slippery can't mix, sadly. either it does one or the other. sleep(10) visible_message(span_danger("[src] flies upwards!")) animate(src, pixel_z = 32, time = 1) - for(var/mob/living/target in src.loc) + for(var/mob/living/carbon/target in src.loc) target.Paralyze(20) animate(target, pixel_z = 32, time = 1) target.apply_damage(launcher_damage, BRUTE, pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG), spread_damage = TRUE) @@ -73,7 +73,7 @@ also, caltrops and slippery can't mix, sadly. either it does one or the other. target.AddElement(/datum/element/squish, 5 SECONDS) sleep(1) animate(src, pixel_z = 0, time = 4) - for(var/mob/living/target in src.loc) + for(var/mob/living/carbon/target in src.loc) animate(target, pixel_z = 0, time = 4) target.visible_message("[target] falls to the floor with a sickening crunch!", \ "You fall to the floor with a sickening crunch!") From e2606f31be3f45d7475a9788a78351eb696da2ce Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Sun, 21 Jul 2024 17:47:09 -0500 Subject: [PATCH 04/18] temp notes file is failing linters, wee --- .../ruins/objects_and_mobs/generic_hazards/hazard_info.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm index e37d14634951..d6704defd3b6 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm @@ -63,7 +63,7 @@ maybe something roughly like the medipen ruin vault where if you supply (or fail to supply) something with power, for enough time, it toggles the state " - IDEAS - GOING TO NEED A SPRITER OR MAKE BAD SPRITES MYSELF +IDEAS - GOING TO NEED A SPRITER OR MAKE BAD SPRITES MYSELF sparking wallmount (fusebox, old APC, conduit) power conduits, broken/frayed/decorative (stun version, spark on step, random spark) wire tangle w/ stun From 3d0bfc21b55e0460b5f959e52069da60d5c74ccf Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Mon, 22 Jul 2024 00:23:14 -0500 Subject: [PATCH 05/18] atmos, foam, chem smoke, spray, floor rework. --- .../effects/effect_system/effects_water.dm | 5 + .../generic_hazards/hazard_code/_hazard.dm | 6 +- .../hazard_code/atmospheric.dm | 35 +++++ .../generic_hazards/hazard_code/electrical.dm | 2 +- .../generic_hazards/hazard_code/floor.dm | 122 ++++++++++++------ .../generic_hazards/hazard_code/slowdown.dm | 5 +- .../generic_hazards/hazard_code/spray.dm | 105 +++++++++++++++ .../generic_hazards/hazard_code/steam.dm | 47 ------- .../generic_hazards/hazard_info.dm | 42 +++--- .../generic_hazards/hazards/_examples.dm | 100 +++++++++++--- .../generic_hazards/hazards/water_hazard.dm | 8 +- shiptest.dme | 3 +- 12 files changed, 345 insertions(+), 135 deletions(-) create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/atmospheric.dm create mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/spray.dm delete mode 100644 code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/steam.dm diff --git a/code/game/objects/effects/effect_system/effects_water.dm b/code/game/objects/effects/effect_system/effects_water.dm index 6e00b336d240..6c74a7dea1ca 100644 --- a/code/game/objects/effects/effect_system/effects_water.dm +++ b/code/game/objects/effects/effect_system/effects_water.dm @@ -51,3 +51,8 @@ /datum/effect_system/steam_spread effect_type = /obj/effect/particle_effect/steam + +/proc/do_steam(amount=0, location = null, direction = null) + var/datum/effect_system/steam_spread/steam = new /datum/effect_system/steam_spread() + steam.set_up(amount, direction, location) + steam.start() diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm index afefbbf047ef..7f9946baf013 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm @@ -124,8 +124,8 @@ evil 'code' that sets off the above procs. mappers beware! /obj/structure/hazard/proc/on_entered(datum/source, atom/movable/AM) SIGNAL_HANDLER - var/target = AM - if(on && !disabled) + if(!iseffect(AM) && on && !disabled) + var/target = AM contact(target) /obj/structure/hazard/Bumped(atom/movable/AM) @@ -176,4 +176,4 @@ evil 'code' that sets off the above procs. mappers beware! /obj/structure/hazard/slowdown/Destroy() update_turf_slowdown(TRUE) - . = ..() + return ..() diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/atmospheric.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/atmospheric.dm new file mode 100644 index 000000000000..e00df7da2633 --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/atmospheric.dm @@ -0,0 +1,35 @@ +/obj/structure/hazard/atmospheric + name = "atmospheric hazard" + desc = "if you're seeing this, tell a maptainer! FWOOSH!" + icon_state = "hazard" + + var/random_gas = FALSE + var/contact_gas = FALSE + var/created_gas = GAS_H2O + var/mols_created_gas = 20 + var/max_pressure = 303 + var/temperature = T20C + +/obj/structure/hazard/atmospheric/Initialize() + //if contact, need to set enter_activated + if(contact_gas) + enter_activated = TRUE + //if random, need to set random_effect + if(random_gas) + random_effect = TRUE + . = ..() + +/obj/structure/hazard/atmospheric/do_random_effect() + if(random_gas) + emit_gas() + +/obj/structure/hazard/atmospheric/contact(target) + if(contact_gas) + emit_gas() + +/obj/structure/hazard/atmospheric/proc/emit_gas() + var/datum/gas_mixture/air = loc.return_air() + if(air.return_pressure() >= max_pressure) + return + playsound(src, pick('sound/effects/smoke.ogg','sound/effects/space_wind.ogg'), 15, TRUE, -1) + atmos_spawn_air("[created_gas]=[mols_created_gas];TEMP=[temperature]") diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm index bf8cb42c17b9..4dfe2d9cb944 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm @@ -20,7 +20,7 @@ //sparks on contact, mostly for show or to light fires. var/contact_sparks = FALSE - //stops people from spamming sparks, also sparks can set off sparks. + //stops people from spamming sparks cooldown_time = 3 SECONDS //stun on contact. dangerous and potentially deadly diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm index 156254cca44d..782aa22a332e 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm @@ -1,26 +1,21 @@ /* -sharp floor hazards! -pretty much just the caltrop component, but still useful to have as a standard hazard here, to make mapping easier. -CALTROP_BYPASS_SHOES //bypasses shoe check -CALTROP_IGNORE_WALKERS //makes people who walk not take damage. +floor hazards! -ids don't work for these! use something else. -also, caltrops and slippery can't mix, sadly. either it does one or the other. +ids don't work for slipping */ /obj/structure/hazard/floor name = "floor hazard" desc = "tell a maptainer if you see this. YOWCH!" icon_state = "spikepit" - //these all need to be not dense + //these all(most) need to be not dense density = FALSE - //does damage to legs when walked over - var/caltrop = FALSE - var/low_damage = 10 - var/high_damage = 20 - var/probability = 100 - //bypass shoes ignores shoes, ignore walkers lets players ignore damage by walking through - var/caltrop_flags = CALTROP_BYPASS_SHOES | CALTROP_IGNORE_WALKERS + var/dealt_damage = 20 + var/damage_type = BRUTE + //does damage to legs when walked over, or arms when bumped + var/contact_damage = FALSE + //does chunks of damage while stood on. + var/random_damage = FALSE //slips! var/slippery = FALSE @@ -38,26 +33,20 @@ also, caltrops and slippery can't mix, sadly. either it does one or the other. //warning sent 1 second before the launcher does animation & damage var/launch_warning = "The floor glows and begins to float!" -/obj/structure/hazard/floor/Initialize() - if(launcher) - random_effect = TRUE - . = ..() - /obj/structure/hazard/floor/do_random_effect() if(launcher) launch_sequence() + if(random_damage) + random_damage() /obj/structure/hazard/floor/Initialize() + if(contact_damage) + enter_activated = TRUE + if(launcher || random_damage) + random_effect = TRUE . = ..() if(slippery) AddComponent(/datum/component/slippery, knockdown_time, slip_flags, _paralyze = paralyze_time, _force_drop = forcedrop) - if(caltrop) - AddComponent(/datum/component/caltrop, low_damage, high_damage, probability, caltrop_flags) - -/obj/structure/hazard/floor/examine(mob/user) - . = ..() - if((caltrop_flags & CALTROP_IGNORE_WALKERS) && caltrop) - . += span_notice("you could safely get through [src] if you walk.") /obj/structure/hazard/floor/proc/launch_sequence() visible_message(span_warning(launch_warning)) @@ -65,21 +54,76 @@ also, caltrops and slippery can't mix, sadly. either it does one or the other. sleep(10) visible_message(span_danger("[src] flies upwards!")) animate(src, pixel_z = 32, time = 1) - for(var/mob/living/carbon/target in src.loc) - target.Paralyze(20) + var/list/targets = list() //so we don't lose moving targets and leave them upwards. + for(var/obj/target in src.loc) + if(target == src) + continue + targets += target + for(var/mob/living/target in src.loc) + targets += target + for(var/target in targets) animate(target, pixel_z = 32, time = 1) - target.apply_damage(launcher_damage, BRUTE, pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG), spread_damage = TRUE) - SEND_SIGNAL(target, COMSIG_ON_VENDOR_CRUSH) - target.AddElement(/datum/element/squish, 5 SECONDS) + if(istype(target, /mob/living/carbon)) + var/mob/living/carbon/victim = target + victim.Paralyze(20) + victim.apply_damage(launcher_damage, BRUTE, pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG), spread_damage = TRUE) + victim.AddElement(/datum/element/squish, 5 SECONDS) sleep(1) animate(src, pixel_z = 0, time = 4) - for(var/mob/living/carbon/target in src.loc) + var/gong = FALSE + for(var/target in targets) animate(target, pixel_z = 0, time = 4) - target.visible_message("[target] falls to the floor with a sickening crunch!", \ - "You fall to the floor with a sickening crunch!") - playsound(target, 'sound/effects/blobattack.ogg', 40, TRUE) - if(rand(1, 10000) == 10000) // 0.01% chance. - playsound(src, 'sound/effects/gong.ogg', 50, TRUE) - else - playsound(src, 'sound/effects/bang.ogg', 50, TRUE) + if(istype(target, /mob/living/carbon)) + var/mob/living/carbon/victim = target + victim.visible_message(span_danger("[target] falls to the floor with a sickening crunch!"), \ + span_userdanger("You fall to the floor with a sickening crunch!)")) + playsound(target, 'sound/effects/blobattack.ogg', 40, TRUE) + if(rand(1, 1000) == 1000) // 0.1% chance gong. + playsound(src, 'sound/effects/gong.ogg', 60, TRUE) + gong = TRUE + if(!gong) + playsound(src, 'sound/effects/bang.ogg', 30, TRUE) icon_state = initial(icon_state) + +/obj/structure/hazard/floor/contact(target) + if(contact_damage) + contact_damage(target) + +/obj/structure/hazard/floor/proc/floor_checks(var/mob/living/carbon/target) + if(!ishuman(target)) + return TRUE + if(target.is_flying() || target.is_floating()) + return TRUE + if(target.buckled) //if you're in an office chair with an extinguisher, that's funny. you go girl. + return TRUE + return FALSE + +/obj/structure/hazard/floor/proc/contact_damage(mob) + var/mob/living/carbon/target = mob + if(floor_checks(target)) + return + if(!density) + target.apply_damage(dealt_damage/2, damage_type, BODY_ZONE_L_LEG) + target.apply_damage(dealt_damage/2, damage_type, BODY_ZONE_R_LEG) + to_chat(target, span_userdanger("You step on [src]!")) + else + target.apply_damage(dealt_damage/2, damage_type, BODY_ZONE_L_ARM) + target.apply_damage(dealt_damage/2, damage_type, BODY_ZONE_R_ARM) + to_chat(target, span_userdanger("You accidentally bump [src]!")) + target.Paralyze(30) + +/obj/structure/hazard/floor/proc/random_damage() + for(var/mob/living/carbon/target in src.loc) + if(floor_checks(target)) + continue + if(target.body_position == LYING_DOWN) + target.apply_damage(dealt_damage, damage_type, spread_damage = TRUE) + else + target.apply_damage(dealt_damage/2, damage_type, BODY_ZONE_L_LEG) + target.apply_damage(dealt_damage/2, damage_type, BODY_ZONE_R_LEG) + if(damage_type == BRUTE) + playsound(target, 'sound/misc/splort.ogg', 20, TRUE) + to_chat(target, span_userdanger("[src] mangles you!")) + else //burn, tox, or oxyloss work better with acid burn feedback. + playsound(target, 'sound/items/welder.ogg', 20, TRUE) + to_chat(target, span_userdanger("[src] burns you!")) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm index 705e4a6cebe6..fb78d421ea98 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm @@ -6,6 +6,7 @@ slowing hazards! either requires laying down, has a chance to stick, or requires name = "slowing hazard" desc = "if you see this, tell a maptainer! Waaaait fooorrr meeee guyyyys.." icon_state = "hazard" + density = FALSE //requires laying down to get through, like plastic flaps. var/overhead = FALSE //requires climbing over like tables @@ -15,9 +16,9 @@ slowing hazards! either requires laying down, has a chance to stick, or requires //sticky like spiderwebs, very annoying. var/sticky = FALSE - //chance you get stuck instead of walking into + //chance you get stuck instead of walking into the hazard var/stick_chance = 50 - //chance it eats a projectile + //chance the hazard eats a projectile var/projectile_stick_chance = 30 //all hazards can use slowdown! but if you make a generic slowdown hazard, its good practice to make it hazard/slowdown diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/spray.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/spray.dm new file mode 100644 index 000000000000..2f246fa866a0 --- /dev/null +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/spray.dm @@ -0,0 +1,105 @@ +/* +steam/smoke, foam, and water spray effects + +the steam particle effect is different than 'steam' referenced in the smoke section. steam particles are refered to as water spray here. + +types +/obj/effect/particle_effect/smoke //safe smoke, blocks view +/obj/effect/particle_effect/smoke/bad_smoke //forcedrops items, blocks view. use sparingly +/obj/effect/particle_effect/smoke/hazard_smoke //oxyloss, blocks view, feels most like deadly smoke +/obj/effect/particle_effect/smoke/transparent //doesn't block view, feels most like steam + */ + + +/obj/structure/hazard/spray + name = "steam hazard" + desc = "tell a maptainer if you see this. FWSSSH!" + icon_state = "hazardg" + + //how far smoke and foam spreads, smoke spreads further with same number. + var/range = 2 + //the datum path of the foam/smoke reagent, needs chem_foam = TRUE or chem_smoke = TRUE + var/reagent_type = /datum/reagent/space_cleaner + + //randomly emits smoke between random_min and random_max time + var/random_steam = FALSE + //emits smoke when bumped or walked over, can have cooldown_time set. + var/contact_steam = FALSE + //type of smoke emited, check effects_smoke.dm for all of them, or the short list at the top of this file. + var/smoke_type = /obj/effect/particle_effect/smoke/transparent + //chem smoke overrides smoke_type + var/chem_smoke = FALSE + + + //randomly emits water spray, entirely for show + var/random_water = FALSE + //emits water on contact, entirely for show + var/contact_water = FALSE + //how many water spray effects the hazard makes + var/water_amount = 5 + //if the water only goes cardinal directions. + var/water_cardinals_only = FALSE + + //randomly emits foam, can be chem foam + var/random_foam = FALSE + //emits foam on contact, can be chem foam + var/contact_foam = FALSE + //only used if chem_foam is false + var/foam_type = /datum/effect_system/foam_spread + //nullifies foam_type + var/chem_foam = FALSE + //the amount of reagent, needs reagen_foam = TRUE + var/reagent_amount = 20 + +/obj/structure/hazard/spray/Initialize() + if(contact_steam || contact_water || contact_foam) + enter_activated = TRUE + if(random_steam || random_water || random_foam) + random_effect = TRUE + . = ..() + +/obj/structure/hazard/spray/proc/steam() + if(chem_smoke) + var/datum/reagents/reagents = new/datum/reagents(50) + reagents.my_atom = src + reagents.add_reagent(reagent_type , 50) + var/datum/effect_system/smoke_spread/chem/smoke = new + smoke.set_up(reagents, range, src) + smoke.start() + qdel(reagents) + else + do_smoke(range, src, smoke_type) + +/obj/structure/hazard/spray/proc/water_spray() + do_steam(water_amount, src, water_cardinals_only) + +/obj/structure/hazard/spray/proc/foam() + if(chem_foam) + var/datum/reagents/reagents = new/datum/reagents(1000) + reagents.my_atom = src + reagents.add_reagent(reagent_type, reagent_amount) + reagents.create_foam(/datum/effect_system/foam_spread, range) + else + var/datum/effect_system/foam_spread/foam = new foam_type() + var/datum/reagents/dud = new //foam set_up gets mad if we don't pass a reagent, but this works. + foam.set_up(range, loc, dud) + foam.start() + +/obj/structure/hazard/spray/do_random_effect() + if(random_steam) + steam() + if(random_water) + water_spray() + if(random_foam) + foam() + +/obj/structure/hazard/spray/contact(target) + if(!COOLDOWN_FINISHED(src, cooldown)) + return + COOLDOWN_START(src, cooldown, cooldown_time) + if(contact_steam) + steam() + if(contact_water) + water_spray() + if(contact_foam) + foam() diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/steam.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/steam.dm deleted file mode 100644 index 095bdd7fe66d..000000000000 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/steam.dm +++ /dev/null @@ -1,47 +0,0 @@ -/* -steam and smoke effects! mostly for show - -types -/obj/effect/particle_effect/smoke //safe smoke, blocks view -/obj/effect/particle_effect/smoke/bad_smoke //forcedrops items, blocks view. use sparingly -/obj/effect/particle_effect/smoke/hazard_smoke //oxyloss, blocks view, feels most like deadly smoke -/obj/effect/particle_effect/smoke/transparent //doesn't block view, feels most like steam - */ - - -/obj/structure/hazard/steam - name = "steam hazard" - desc = "tell a maptainer if you see this. FWSSSH!" - icon_state = "hazardg" - //how far the smoke spreads, effectively the radius. - var/range = 2 - //type of smoke emited, check effects_smoke.dm for all of them, or the short list at the top of this file. - var/smoke_type = /obj/effect/particle_effect/smoke/transparent - - //randomly emits smoke between random_min and random_max time - var/random_steam = FALSE - //emits smoke when bumped or walked over, can have cooldown_time set. - var/contact_steam = FALSE - -/obj/structure/hazard/steam/Initialize() - if(contact_steam) - enter_activated = TRUE - if(random_steam) - random_effect = TRUE - . = ..() - -/obj/structure/hazard/steam/proc/steam() - do_smoke(range, src, smoke_type) - -/obj/structure/hazard/steam/do_random_effect() - steam() - -/obj/structure/hazard/steam/contact(target) - if(contact_steam) - contact_steam() - -/obj/structure/hazard/steam/proc/contact_steam() - if(!COOLDOWN_FINISHED(src, cooldown)) - return - COOLDOWN_START(src, cooldown, cooldown_time) - steam() diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm index d6704defd3b6..5c64049c8bd5 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm @@ -8,7 +8,9 @@ Hi there, mapper. this isn't as hard as it looks! follow these steps, and feel f 2. Look through the examples, and find one that fits what you want, or could be tweaked into what you need. 3. spawn the example in ingame using the admin tab, going to Game, then selecting Game Panel > create object and search "structure/hazard" 4. make a new [thing].dm file in the hazards folder -5. subtype the hazard you want based on an example! IE: +5. subtype the hazard you want based on an example! + +example: thing.dm @@ -37,26 +39,22 @@ do_random_effect() occurs randomly, with random_min to random_max between TODO Finish later! TODO (GET RID OF THIS BEFORE THE PR GETS MERGED OR SO HELP ME -helmcrab 21 july 2024) -X-Spike pits! :) -X-low hanging debris? have to crawl or walk through -X-icon stuff -X-electrified area, used to make water scary -X-fusebox for turning off hazards. Also could be a hazard :) -~-chem smoke types //needs testing. -~-make floor hazards rely less on components. Not customizable enough -~-grav tiles! needs to move objects as well because itll look good and tell players 'hey this is fucked up' even more --burst pipes that emit gas? could just be More Smoke --MORE SMOKE TYPES!!! YEAH!!! (smoke really needs to be uh, differentiable I think(not my problem for now) (could wait for cl hcl to do goggles check) +X-Spike pits! :) done +X-low hanging debris? have to crawl or walk through done +X-icon stuff done +X-electrified area, used to make water scary done +X-fusebox for turning off hazards. Also could be a hazard :) done +X-chem smoke types //needs testing. done +X-make floor hazards rely less on components. Not customizable enough. Floor hazards are just going to be like that I think. done +X-grav tiles! needs to move objects as well because itll look good and tell players 'hey this is fucked up' even more done +X-burst pipes that emit gas? could just be More Smoke (smoke sucks ass) atmos easy peasy. done. +x-MORE SMOKE TYPES!!! YEAH!!! (smoke really needs to be uh, differentiable I think(not my problem for now) (could wait for cl hcl to do goggles check) chem smoke good enough. done -falling debris? not sure how to represent this ingame. --acid pits --biological hazards --electrical makes light - -" BC -My idea would be to rapidly animate people's sprites to show them getting flung into the cieling -Like the fulton but sped up by 3-4 times -And just do a shitton of brute damage -" +X-acid pits +-biological hazards (foam is a good start) +-electrical makes light (probably pretty easy. I dont feel like it.) +X-remove caltrop component and write something based on it. caltrop is janky for this use. done +-let floor hazards have seperate warnings and damage texts " HC maybe something roughly like the medipen ruin vault @@ -65,8 +63,8 @@ where if you supply (or fail to supply) something with power, for enough time, i IDEAS - GOING TO NEED A SPRITER OR MAKE BAD SPRITES MYSELF sparking wallmount (fusebox, old APC, conduit) -power conduits, broken/frayed/decorative (stun version, spark on step, random spark) -wire tangle w/ stun +X power conduits, broken/frayed/decorative (stun version, spark on step, random spark) +X wire tangle w/ stun broken machines tesla something or other broken SMES/generator tesla diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm index 268f64485a17..7db099cccef0 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm @@ -1,4 +1,4 @@ -//EXAMPLE HAZARDS. DON'T USE THESE! +//EXAMPLE HAZARDS. DON'T USE THESE ON FINSIHED MAPS!! /* SLOWDOWN HAZARDS @@ -93,7 +93,7 @@ STEAM HAZARDS */ //emits steam every 10-20 seconds -/obj/structure/hazard/steam/example/random_steam +/obj/structure/hazard/spray/example/random_steam name = "random steam" icon_state = "hazardg" random_steam = TRUE //needed @@ -102,51 +102,94 @@ STEAM HAZARDS range = 2 //emits steam when walked over. if density = TRUE, emits steam when bumped -/obj/structure/hazard/steam/example/contact_steam +/obj/structure/hazard/spray/example/contact_steam name = "contact steam" icon_state = "hazardg" contact_steam = TRUE //needed range = 2 -// different smoke examples //transparent smoke that players can see through (otherwise blocks view) -/obj/structure/hazard/steam/example/contact_steam/steam +/obj/structure/hazard/spray/example/contact_steam/steam name = "steam" smoke_type = /obj/effect/particle_effect/smoke/transparent //opaque smoke that does no damage -/obj/structure/hazard/steam/example/contact_steam/safe +/obj/structure/hazard/spray/example/contact_steam/safe name = "safe" smoke_type = /obj/effect/particle_effect/smoke //smoke that makes you drop items and cough -/obj/structure/hazard/steam/example/contact_steam/bad +/obj/structure/hazard/spray/example/contact_steam/bad name = "bad" smoke_type = /obj/effect/particle_effect/smoke/bad //smoke that makes you take oxyloss and cough -/obj/structure/hazard/steam/example/contact_steam/hazard +/obj/structure/hazard/spray/example/contact_steam/hazard name = "hazard" smoke_type = /obj/effect/particle_effect/smoke/hazard +//chem smoke, takes on the color of the chem +/obj/structure/hazard/spray/example/contact_steam/chem + name = "chem smoke" + chem_smoke = TRUE + reagent_type = /datum/reagent/toxin/acid + +//foam hazard +/obj/structure/hazard/spray/example/foam + name = "contact foam" + icon_state = "hazardg" + contact_foam = TRUE + chem_foam = FALSE + range = 2 + +//chem foam +/obj/structure/hazard/spray/example/foam/reagent + chem_foam = TRUE + reagent_type = /datum/reagent/consumable/ethanol/beer + reagent_amount = 50 + +//water spray hazard, mostly for show. looks like a fire extinguisher blast +/obj/structure/hazard/spray/example/water_spray + name = "contact spray" + contact_water = TRUE + water_amount = 10 + /* FLOOR EXAMPLES */ -//classic spike pit, can be avoided by laying down. +//classic spike pit /obj/structure/hazard/floor/example/sharp name = "example sharp" icon_state = "spikepit" - caltrop = TRUE //needed - low_damage = 20 - high_damage = 30 - probability = 80 - caltrop_flags = CALTROP_BYPASS_SHOES | CALTROP_IGNORE_WALKERS + density = FALSE //recommended. otherwise deals arm damage if bumped. + contact_damage = TRUE //needed + dealt_damage = 30 //split across legs or arms. + damage_type = BRUTE + +/obj/structure/hazard/floor/example/burn + name = "example burn" + icon_state = "hazard" + density = TRUE //deals arms damage + contact_damage = TRUE //needed + dealt_damage = 40 //split across legs or arms. + damage_type = BURN + +/obj/structure/hazard/floor/example/toxicpit + name = "example toxic pit" + icon_state = "hazardg" + density = FALSE //needed + random_damage = TRUE //needed + dealt_damage = 20 //split across legs + damage_type = BURN + random_min = 2 SECONDS + random_max = 3 SECONDS //simple slipping hazard, similar to oil spills. /obj/structure/hazard/floor/example/slip name = "example slip" icon_state = "hazardb" + density = FALSE //needed slippery = TRUE //needed knockdown_time = 3 SECONDS slip_flags = NO_SLIP_WHEN_WALKING | SLIDE @@ -156,11 +199,36 @@ FLOOR EXAMPLES /obj/structure/hazard/floor/example/launch name = "example launch" icon_state = "gravplate" //needs state-launch version - layer = ABOVE_OPEN_TURF_LAYER //needed + density = FALSE //needed + layer = ABOVE_NORMAL_TURF_LAYER //needed to render it on the floor launcher = TRUE //needed - random_min = 5 SECONDS + random_min = 5 SECONDS //grav plates maploaded at similar times leads to them being in sync. random_max = 5 SECONDS +/* +atmos examples +*/ + +/obj/structure/hazard/atmospheric/example + name = "example atmos" + +/obj/structure/hazard/atmospheric/example/random_gas + name = "random gas" + random_gas = TRUE + created_gas = GAS_HYDROGEN + mols_created_gas = 100 + max_pressure = 202 + temperature = T0C + +/obj/structure/hazard/atmospheric/example/contact_gas + name = "contact gas" + contact_gas = TRUE + created_gas = GAS_NITROUS + mols_created_gas = 50 + max_pressure = 121 + temperature = T20C + + /* shutoff example */ diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/water_hazard.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/water_hazard.dm index 77e93e810246..8641cd934328 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/water_hazard.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/water_hazard.dm @@ -2,14 +2,14 @@ name = "electrified water" desc = "hazardous water!" icon_state = "electrified" - //mouse_opacity = MOUSE_OPACITY_TRANSPARENT //commented out so I can get to the vars easily. + mouse_opacity = MOUSE_OPACITY_TRANSPARENT resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF | HYPERSPACE_PROOF move_resist = INFINITY obj_flags = 0 density = FALSE - contact_sparks = TRUE + random_sparks = TRUE random_zap = TRUE contact_damage = 10 - random_min = 2 SECONDS - random_max = 5 SECONDS + random_min = 3 SECONDS //should result in the whole pool pulsing at almost the same time. + random_max = 3 SECONDS slowdown = 0.5 diff --git a/shiptest.dme b/shiptest.dme index 8c7b3a5c8dec..074be57d5503 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -3278,11 +3278,12 @@ #include "code\modules\ruins\objects_and_mobs\generic_hazards\hazard_info.dm" #include "code\modules\ruins\objects_and_mobs\generic_hazards\hazard_code\_hazard.dm" #include "code\modules\ruins\objects_and_mobs\generic_hazards\hazard_code\_shutoff.dm" +#include "code\modules\ruins\objects_and_mobs\generic_hazards\hazard_code\atmospheric.dm" #include "code\modules\ruins\objects_and_mobs\generic_hazards\hazard_code\electrical.dm" #include "code\modules\ruins\objects_and_mobs\generic_hazards\hazard_code\floor.dm" #include "code\modules\ruins\objects_and_mobs\generic_hazards\hazard_code\radioactive.dm" #include "code\modules\ruins\objects_and_mobs\generic_hazards\hazard_code\slowdown.dm" -#include "code\modules\ruins\objects_and_mobs\generic_hazards\hazard_code\steam.dm" +#include "code\modules\ruins\objects_and_mobs\generic_hazards\hazard_code\spray.dm" #include "code\modules\ruins\objects_and_mobs\generic_hazards\hazards\_examples.dm" #include "code\modules\ruins\objects_and_mobs\generic_hazards\hazards\generic_electrical.dm" #include "code\modules\ruins\objects_and_mobs\generic_hazards\hazards\radioactive_barrels.dm" From 46afeb38d72230db7bae30b5d71f34cfe212cf2e Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Mon, 22 Jul 2024 00:36:41 -0500 Subject: [PATCH 06/18] linter dumb --- .../ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm index 782aa22a332e..a6b823c57d39 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/floor.dm @@ -89,7 +89,7 @@ ids don't work for slipping if(contact_damage) contact_damage(target) -/obj/structure/hazard/floor/proc/floor_checks(var/mob/living/carbon/target) +/obj/structure/hazard/floor/proc/floor_checks(mob/living/carbon/target) if(!ishuman(target)) return TRUE if(target.is_flying() || target.is_floating()) From baccf7a771b5ac4d6ee3db377c7ae214d707172d Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Mon, 22 Jul 2024 01:28:12 -0500 Subject: [PATCH 07/18] linter again --- .../objects_and_mobs/generic_hazards/hazard_code/_hazard.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm index 7f9946baf013..2f0251e76675 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm @@ -176,4 +176,5 @@ evil 'code' that sets off the above procs. mappers beware! /obj/structure/hazard/slowdown/Destroy() update_turf_slowdown(TRUE) + GLOB.ruin_hazards -= src return ..() From 39f1a299836ad437d60da5aa196625f2dd7bdd72 Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Mon, 22 Jul 2024 02:29:31 -0500 Subject: [PATCH 08/18] is this linters bad ? help --- .../generic_hazards/hazard_code/_hazard.dm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm index 2f0251e76675..cd3b5a49ae97 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm @@ -35,10 +35,6 @@ //slowdown, which increases the slowdown of the turf the hazard is on. All hazards can use this. var/slowdown = 0 - FASTDMM_PROP(\ - pinned_vars = list("name", "dir", "id")\ - ) - /* procs used to set off effects */ @@ -112,7 +108,9 @@ evil 'code' that sets off the above procs. mappers beware! . += span_notice("[src] could be disabled by [disable_text].") /obj/structure/hazard/proc/random_effect(start = FALSE) - if(QDELETED(src) || disabled) + if(QDELETED(src)) + return + if(disabled) return if(!start && on) do_random_effect() @@ -175,6 +173,6 @@ evil 'code' that sets off the above procs. mappers beware! OT.slowdown = initial(OT.slowdown) + slowdown /obj/structure/hazard/slowdown/Destroy() - update_turf_slowdown(TRUE) GLOB.ruin_hazards -= src + //update_turf_slowdown(TRUE) return ..() From 8763adc057afc204c3971bd661219f9c02baae88 Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Mon, 22 Jul 2024 02:37:39 -0500 Subject: [PATCH 09/18] helmcrab moving code around fails again --- .../objects_and_mobs/generic_hazards/hazard_code/_hazard.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm index cd3b5a49ae97..b054285e1fa0 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm @@ -172,7 +172,7 @@ evil 'code' that sets off the above procs. mappers beware! else OT.slowdown = initial(OT.slowdown) + slowdown -/obj/structure/hazard/slowdown/Destroy() +/obj/structure/hazard/Destroy() GLOB.ruin_hazards -= src - //update_turf_slowdown(TRUE) + update_turf_slowdown(TRUE) return ..() From bd51c0a5f220471958dd8c26dc586bedc7876972 Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:51:44 -0500 Subject: [PATCH 10/18] moves nearby check from hazard/radioactive to base hazard this helps clean up making radioactive a hazard subtype, though it could be cleaner. Should tweak barrels to not be the base hazard, and add the radiation triggers to other hazards. --- .../generic_hazards/hazard_code/_hazard.dm | 21 +++++++++++++++++++ .../hazard_code/radioactive.dm | 16 +++++--------- .../generic_hazards/hazard_info.dm | 1 + 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm index b054285e1fa0..df17c5dde057 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm @@ -18,6 +18,10 @@ var/random_min = 10 SECONDS var/random_max = 30 SECONDS + //starts processing the hazard, currently only used by waste barrels. + var/needs_processing = FALSE + var/check_client_nearby = FALSE + //Whether this hazard can be disabled. Does nothing without implementing a way to disable the hazard. var/can_be_disabled = FALSE //Can be used for do_afters on disable checks, also toolchecks. @@ -48,6 +52,9 @@ procs used to set off effects /obj/structure/hazard/proc/attacked() //goes off if attacked or shot by most things. return +/obj/structure/hazard/proc/client_nearby() //goes off if a living creature with a client (player) is within 5 tiles. + return + /* evil 'code' that sets off the above procs. mappers beware! */ @@ -79,6 +86,8 @@ evil 'code' that sets off the above procs. mappers beware! //real code /obj/structure/hazard/Initialize() + if(needs_processing) + START_PROCESSING(SSobj, src) . = ..() GLOB.ruin_hazards += src if(random_effect) @@ -91,6 +100,17 @@ evil 'code' that sets off the above procs. mappers beware! ) AddElement(/datum/element/connect_loc, loc_connections) +/obj/structure/hazard/process() + if(!needs_processing) + . = ..() + return + if(check_client_nearby) + for(var/mob/living/target in range(5, src)) + if(target.client) + client_nearby() + break + ..() + /obj/structure/hazard/update_icon_state() if(disabled) icon_state = initial(icon_state) + "-disabled" @@ -176,3 +196,4 @@ evil 'code' that sets off the above procs. mappers beware! GLOB.ruin_hazards -= src update_turf_slowdown(TRUE) return ..() + diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/radioactive.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/radioactive.dm index 587e394ebe3c..767abfd9f7c3 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/radioactive.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/radioactive.dm @@ -9,26 +9,20 @@ Was grandfathered and reworked into /hazard types, so they're a little different anchored = FALSE cooldown = 2 SECONDS resistance_flags = null + needs_processing = TRUE + check_client_nearby = TRUE var/rad_power = 100 var/rad_range = 1 // !Range mod = rad dropoff speed -/obj/structure/hazard/radioactive/Initialize() - START_PROCESSING(SSobj, src) - . = ..() - -/obj/structure/hazard/radioactive/process() - for(var/mob/living/L in range(5, src)) - if(L.client) - Nuke() - break - ..() - /obj/structure/hazard/radioactive/attacked() Nuke() /obj/structure/hazard/radioactive/contact() Nuke() +/obj/structure/hazard/radioactive/client_nearby() + Nuke() + /obj/structure/hazard/radioactive/proc/Nuke(atom/movable/AM) if(!COOLDOWN_FINISHED(src, cooldown)) return diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm index 5c64049c8bd5..c12e52ea6906 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm @@ -55,6 +55,7 @@ X-acid pits -electrical makes light (probably pretty easy. I dont feel like it.) X-remove caltrop component and write something based on it. caltrop is janky for this use. done -let floor hazards have seperate warnings and damage texts +-better guide on how to make these hazards, maybe on the wiki? " HC maybe something roughly like the medipen ruin vault From 522c8b41f2faaf43829f6b7e078b807667a076d1 Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:54:23 -0500 Subject: [PATCH 11/18] adds client_range var because uh, choosing stuff is good? --- .../generic_hazards/hazard_code/_hazard.dm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm index df17c5dde057..d37902e5832e 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm @@ -18,9 +18,11 @@ var/random_min = 10 SECONDS var/random_max = 30 SECONDS - //starts processing the hazard, currently only used by waste barrels. + //starts processing the hazard, currently only used by radiation. var/needs_processing = FALSE + //checks if a living mob with a client is within client_range, sets off client_nearby(). only used by radiation var/check_client_nearby = FALSE + var/client_range = 5 //Whether this hazard can be disabled. Does nothing without implementing a way to disable the hazard. var/can_be_disabled = FALSE @@ -52,7 +54,7 @@ procs used to set off effects /obj/structure/hazard/proc/attacked() //goes off if attacked or shot by most things. return -/obj/structure/hazard/proc/client_nearby() //goes off if a living creature with a client (player) is within 5 tiles. +/obj/structure/hazard/proc/client_nearby() //goes off if a living creature with a client (effectively a player check) is within 5 tiles. return /* @@ -105,7 +107,7 @@ evil 'code' that sets off the above procs. mappers beware! . = ..() return if(check_client_nearby) - for(var/mob/living/target in range(5, src)) + for(var/mob/living/target in range(client_range, src)) if(target.client) client_nearby() break From 06483a898ef4f88baf90b9779590cda48f11895c Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:24:50 -0500 Subject: [PATCH 12/18] cleaner processing code --- .../objects_and_mobs/generic_hazards/hazard_code/_hazard.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm index d37902e5832e..4e80e9008565 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm @@ -103,14 +103,14 @@ evil 'code' that sets off the above procs. mappers beware! AddElement(/datum/element/connect_loc, loc_connections) /obj/structure/hazard/process() - if(!needs_processing) - . = ..() - return if(check_client_nearby) for(var/mob/living/target in range(client_range, src)) if(target.client) client_nearby() break + else + STOP_PROCESSING(SSobj, src) //if we're not doing any of the above checks, why are we processing? stop that + return ..() /obj/structure/hazard/update_icon_state() From 3dfc6693166fd4fd998c64c0c75cf6763e5934c3 Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:19:12 -0500 Subject: [PATCH 13/18] moves process logic to do_random_effect repeated hey wait a second, doing something once every cooldown? I already do that with random_effect. why also need this thing to process when I could just use the existing setup! yeah --- .../generic_hazards/hazard_code/_hazard.dm | 32 ++++++++----------- .../generic_hazards/hazard_code/electrical.dm | 6 ++++ .../hazard_code/radioactive.dm | 11 ++++--- .../generic_hazards/hazards/_examples.dm | 12 +++++++ .../hazards/radioactive_barrels.dm | 12 +++++-- 5 files changed, 47 insertions(+), 26 deletions(-) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm index 4e80e9008565..b5bdcd10ddd4 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm @@ -18,10 +18,9 @@ var/random_min = 10 SECONDS var/random_max = 30 SECONDS - //starts processing the hazard, currently only used by radiation. - var/needs_processing = FALSE - //checks if a living mob with a client is within client_range, sets off client_nearby(). only used by radiation - var/check_client_nearby = FALSE + //checks if a living mob with a client is within client_range, and doesn't send do_random_effect if nobody's nearby + var/requires_client_nearby = FALSE + //range checked if requires_client_nearby is TRUE var/client_range = 5 //Whether this hazard can be disabled. Does nothing without implementing a way to disable the hazard. @@ -88,8 +87,6 @@ evil 'code' that sets off the above procs. mappers beware! //real code /obj/structure/hazard/Initialize() - if(needs_processing) - START_PROCESSING(SSobj, src) . = ..() GLOB.ruin_hazards += src if(random_effect) @@ -102,17 +99,6 @@ evil 'code' that sets off the above procs. mappers beware! ) AddElement(/datum/element/connect_loc, loc_connections) -/obj/structure/hazard/process() - if(check_client_nearby) - for(var/mob/living/target in range(client_range, src)) - if(target.client) - client_nearby() - break - else - STOP_PROCESSING(SSobj, src) //if we're not doing any of the above checks, why are we processing? stop that - return - ..() - /obj/structure/hazard/update_icon_state() if(disabled) icon_state = initial(icon_state) + "-disabled" @@ -132,9 +118,17 @@ evil 'code' that sets off the above procs. mappers beware! /obj/structure/hazard/proc/random_effect(start = FALSE) if(QDELETED(src)) return + var/no_effect = FALSE if(disabled) - return - if(!start && on) + no_effect = TRUE + if(requires_client_nearby) + var/nearby_client = FALSE + for(var/mob/living/target in range(client_range, src)) + if(target.client) + nearby_client = TRUE + if(!nearby_client) + no_effect = TRUE + if(!start && on && !no_effect) do_random_effect() var/delay = rand(random_min, random_max) addtimer(CALLBACK(src, PROC_REF(random_effect)), delay, TIMER_UNIQUE | TIMER_NO_HASH_WAIT) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm index 4dfe2d9cb944..e65885c6642a 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm @@ -51,6 +51,12 @@ if(random_zap) zap_on_turf() +/obj/structure/hazard/electrical/client_nearby() + if(!COOLDOWN_FINISHED(src, cooldown)) + return + COOLDOWN_START(src, cooldown, cooldown_time) + zap() + //shoots off a tesla arc /obj/structure/hazard/electrical/proc/zap() playsound(src.loc, 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/radioactive.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/radioactive.dm index 767abfd9f7c3..098fac9060dc 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/radioactive.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/radioactive.dm @@ -7,10 +7,13 @@ Was grandfathered and reworked into /hazard types, so they're a little different desc = "An old container of radioactive biproducts." icon_state = "barrel" anchored = FALSE - cooldown = 2 SECONDS resistance_flags = null - needs_processing = TRUE - check_client_nearby = TRUE + max_integrity = 600 + requires_client_nearby = TRUE + client_range = 5 + random_min = 2 SECONDS + random_max = 2 SECONDS + var/rad_power = 100 var/rad_range = 1 // !Range mod = rad dropoff speed @@ -20,7 +23,7 @@ Was grandfathered and reworked into /hazard types, so they're a little different /obj/structure/hazard/radioactive/contact() Nuke() -/obj/structure/hazard/radioactive/client_nearby() +/obj/structure/hazard/radioactive/do_random_effect() Nuke() /obj/structure/hazard/radioactive/proc/Nuke(atom/movable/AM) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm index 7db099cccef0..507134c27466 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm @@ -74,6 +74,18 @@ ELECTRICAL HAZARDS contact_damage = 30 shock_flags = SHOCK_NOGLOVES | SHOCK_NOSTUN +//emits a tesla arc once every cooldown, if a player (living mob with client) is within client_range. +/obj/structure/hazard/electrical/example/nearby_tesla + name = "nearby tesla" + icon_state = "hazardb" + requires_client_nearby = TRUE //needed + random_min = 3 SECONDS + random_max = 6 SECONDS + zap_range = 3 + client_range = 7 + zap_power = 3000 //this can afford to be more powerful, since someone has to be nearby to abuse power generation. + zap_flags = ZAP_MOB_DAMAGE + /obj/structure/hazard/electrical/example/stun_and_spark name = "random sparks and contact stun" icon_state = "hazardb" diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/radioactive_barrels.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/radioactive_barrels.dm index bf6744df4542..283774c166d8 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/radioactive_barrels.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/radioactive_barrels.dm @@ -5,7 +5,8 @@ anchored = TRUE rad_power = 150 rad_range = 0.8 - cooldown_time = 1 SECONDS + random_min = 1 SECONDS + random_max = 2 SECONDS /obj/structure/hazard/radioactive/stack name = "stack of nuclear waste" @@ -13,13 +14,18 @@ icon_state = "barrel_3" anchored = TRUE rad_power = 300 - cooldown_time = 1 SECONDS + client_range = 6 + random_min = 1 SECONDS + random_max = 1 SECONDS /obj/structure/hazard/radioactive/supermatter name = "decayed supermatter crystal" desc = "An abandoned supermatter crystal undergoing extreme nuclear decay as a result of poor maintenence and disposal." icon_state = "smdecay" + resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF //its an old SM, you shouldn't be able to just shoot it to death to deactivate it. anchored = TRUE rad_power = 1200 rad_range = 0.2 - cooldown_time = 0.5 SECONDS + client_range = 7 + random_min = 0.5 SECONDS + random_max = 0.5 SECONDS From ec6408450227e759e888c64123584e746903a432 Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Sat, 3 Aug 2024 00:33:05 -0500 Subject: [PATCH 14/18] powered shutoff Powered shutoff based on the medipen vault console, which requires a cable connection to charge, and at max allows the shutoff to be used. Could be more tactile but this works for now. --- .../generic_hazards/hazard_code/_shutoff.dm | 50 ++++++++++++++++++- .../generic_hazards/hazards/_examples.dm | 5 ++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_shutoff.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_shutoff.dm index 9a47c229ede2..c7dc417d99d2 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_shutoff.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_shutoff.dm @@ -13,7 +13,7 @@ //ID used to toggle hazards, should only be set in maps. var/id = 0 //to_chat message when using the shutoff - var/shutoff_message = "you toggle the shutoff" + var/shutoff_message = "You toggle the shutoff." FASTDMM_PROP(\ pinned_vars = list("name", "dir", "id")\ @@ -27,6 +27,7 @@ say("no id set! fix that") //shutoffs without IDs shouldn't exist, so this lets mappers know, hopefully. return FALSE to_chat(user, span_notice("[shutoff_message]")) + playsound(src.loc, 'sound/machines/switch3.ogg', 35, TRUE) for(var/obj/structure/hazard/hazard in GLOB.ruin_hazards) if(hazard.id != src.id) continue @@ -41,3 +42,50 @@ . = ..() activate(user) +/obj/structure/hazard_shutoff/powered + name = "powered shutoff" + desc = "A shutoff that requires power." + icon_state = "standing_toggle" + shutoff_message = "The shutoff hums as you toggle it." + var/obj/structure/cable/attached_cable + var/siphoned_power = 0 + var/siphon_max = 1e7 + var/toggle_power = 5e6 + +/obj/structure/hazard_shutoff/powered/Initialize() + . = ..() + START_PROCESSING(SSobj, src) + +/obj/structure/hazard_shutoff/powered/process() + if(siphoned_power >= siphon_max) + return + update_cable() + if(attached_cable) + attempt_siphon() + +/obj/structure/hazard_shutoff/powered/proc/update_cable() + var/turf/T = get_turf(src) + attached_cable = locate(/obj/structure/cable) in T + +/obj/structure/hazard_shutoff/powered/proc/attempt_siphon() + var/surpluspower = clamp(attached_cable.surplus(), 0, (siphon_max - siphoned_power)) + if(surpluspower) + attached_cable.add_load(surpluspower) + siphoned_power += surpluspower + +/obj/structure/hazard_shutoff/powered/activate(mob/user) + if(siphoned_power < siphon_max) + to_chat(user, span_notice("[src] requires power!")) + return + if(toggle_power) + siphoned_power -= toggle_power + . = ..() + +/obj/structure/hazard_shutoff/powered/examine(mob/user) + . = ..() + if(!siphoned_power) + . += "[src] is disabled, and could be charged with a cable connection!" + else if(siphoned_power >= siphon_max) + . += "[src] is fully charged." + else + . += "[src] is [round((siphoned_power/siphon_max)*100, 0.1)]% charged." diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm index 507134c27466..059e245ece0c 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm @@ -269,4 +269,9 @@ shutoff example id = 1 resets = 3 SECONDS +//only works once charged with a cable up to siphon_max +/obj/structure/hazard_shutoff/powered/example + id = 1 + siphon_max = 1e6 + //good luck with radioactive hazards for now. you'll likely need to write code (dear god) From 5e20fb213bca18067722f882297ade068580135b Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Sat, 3 Aug 2024 01:07:17 -0500 Subject: [PATCH 15/18] example powered --- .../generic_hazards/hazards/_examples.dm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm index 059e245ece0c..989d90a7728a 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm @@ -245,7 +245,7 @@ atmos examples shutoff example */ -//Toggles the state of hazards with the same ID. SET ID ON MAP USING VAREDIT AND BE UNIQUE (ie id = crashed_starwalker_water_hazard) +//Toggles the state of hazards with the same ID. SET ID ON MAP USING VAREDIT AND BE UNIQUE (ie: id = crashed_starwalker_water_hazard) /obj/structure/hazard_shutoff/example name = "example shutoff" desc = "id = 1" @@ -264,14 +264,17 @@ shutoff example //turns off hazards with the same ID until the resets time has passed! /obj/structure/hazard_shutoff/example/timed - name = "timed example shutoff" + name = "example timed shutoff" desc = "id = 1" id = 1 resets = 3 SECONDS //only works once charged with a cable up to siphon_max /obj/structure/hazard_shutoff/powered/example + name = "example powered shutoff" + desc = "id = 1" id = 1 - siphon_max = 1e6 + siphon_max = 1e6 //required power, in watts, needed to use this toggle. + toggle_power = 5e5 //can be 0 //good luck with radioactive hazards for now. you'll likely need to write code (dear god) From 95ab4224812274cc41846c8911eca7d6674ed7bf Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:45:02 -0500 Subject: [PATCH 16/18] comment clarification Looking at the code again, hopefully these comments are more clear. --- .../generic_hazards/hazard_code/electrical.dm | 2 +- .../generic_hazards/hazard_code/slowdown.dm | 22 +++++-- .../generic_hazards/hazard_info.dm | 58 ++++++++----------- .../generic_hazards/hazards/_examples.dm | 28 ++++----- .../generic_hazards/hazards/water_hazard.dm | 2 +- 5 files changed, 56 insertions(+), 56 deletions(-) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm index e65885c6642a..9ecbc317723f 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm @@ -9,7 +9,7 @@ var/random_sparks = FALSE //randomly zaps mobs on turf. deadly! var/random_zap = FALSE - // randomly emit tesla arcs. use sparingly! + //randomly emit tesla arcs. use sparingly! var/random_tesla = FALSE //how far the tesla arc reaches, still can chain off other objects. var/zap_range = 4 diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm index fb78d421ea98..801dc3534655 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/slowdown.dm @@ -26,10 +26,13 @@ slowing hazards! either requires laying down, has a chance to stick, or requires /obj/structure/hazard/slowdown/CanAllowThrough(atom/movable/mover, border_dir) . = ..() + //if this hazard is dense, stop players if(density) return FALSE + //if this hazard is disabled or off, let players through if(!on || disabled) return TRUE + //stops players if sticky or overhead checks return TRUE var/failed_check = FALSE if(sticky) failed_check += !sticky_checks(mover) @@ -40,29 +43,38 @@ slowing hazards! either requires laying down, has a chance to stick, or requires else return TRUE -//pretty much stolen from plastic flaps. +//based on plastic flaps, requires crawling under /obj/structure/hazard/slowdown/proc/overhead_checks(atom/movable/mover) + //lets lasers through if not opaque if(istype(mover) && (mover.pass_flags & PASSGLASS) && !opacity) return TRUE + //people on beds and dense beds can't get through if(istype(mover, /obj/structure/bed)) var/obj/structure/bed/bed_mover = mover - if(bed_mover.density || bed_mover.has_buckled_mobs())//if it's a bed/chair and is dense or someone is buckled, it will not pass + if(bed_mover.density || bed_mover.has_buckled_mobs()) return FALSE + //people in cardboard boxes have to wait for their delay else if(istype(mover, /obj/structure/closet/cardboard)) var/obj/structure/closet/cardboard/cardboard_mover = mover if(cardboard_mover.move_delay) return FALSE + //no mechs! else if(ismecha(mover)) return FALSE - else if(isliving(mover)) // You Shall Not Pass! + //actual living checks + else if(isliving(mover)) var/mob/living/living_mover = mover - if(isbot(mover)) //Bots understand the secrets + + //bots (cleaning, medical, etc) can go under by default. + if(isbot(mover)) return TRUE - if(living_mover.body_position == STANDING_UP && !living_mover.ventcrawler && living_mover.mob_size != MOB_SIZE_TINY) //If you're not laying down, or a ventcrawler or a small creature, no pass. + + //laying down, being a ventcrawler, or being tiny lets you through. + if(living_mover.body_position == STANDING_UP && !living_mover.ventcrawler && living_mover.mob_size != MOB_SIZE_TINY) return FALSE return TRUE diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm index c12e52ea6906..fdf83768ce8e 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_info.dm @@ -1,6 +1,8 @@ ///////////// //MAP GUIDE// ///////////// +// a guide of how to add subtypes of existing hazards, such as electrical/thing or atmospherics/plasma + /* Hi there, mapper. this isn't as hard as it looks! follow these steps, and feel free to ask for help! @@ -28,46 +30,32 @@ thing.dm again, feel free to ask for help! this is made to be (hopefully) easy enough for adventurous mappers to use. + /////////////////////////////// //NEW HAZARD/THING TYPE GUIDE// /////////////////////////////// +An explanation of the code needed to make new hazard types, such as the base type electrical and atmospheric. + look at hazard/electrical for starters, its got a wide array of examples make a new file for this new thing -do_random_effect() occurs randomly, with random_min to random_max between - -TODO Finish later! - -TODO (GET RID OF THIS BEFORE THE PR GETS MERGED OR SO HELP ME -helmcrab 21 july 2024) -X-Spike pits! :) done -X-low hanging debris? have to crawl or walk through done -X-icon stuff done -X-electrified area, used to make water scary done -X-fusebox for turning off hazards. Also could be a hazard :) done -X-chem smoke types //needs testing. done -X-make floor hazards rely less on components. Not customizable enough. Floor hazards are just going to be like that I think. done -X-grav tiles! needs to move objects as well because itll look good and tell players 'hey this is fucked up' even more done -X-burst pipes that emit gas? could just be More Smoke (smoke sucks ass) atmos easy peasy. done. -x-MORE SMOKE TYPES!!! YEAH!!! (smoke really needs to be uh, differentiable I think(not my problem for now) (could wait for cl hcl to do goggles check) chem smoke good enough. done --falling debris? not sure how to represent this ingame. -X-acid pits --biological hazards (foam is a good start) --electrical makes light (probably pretty easy. I dont feel like it.) -X-remove caltrop component and write something based on it. caltrop is janky for this use. done --let floor hazards have seperate warnings and damage texts --better guide on how to make these hazards, maybe on the wiki? - -" HC -maybe something roughly like the medipen ruin vault -where if you supply (or fail to supply) something with power, for enough time, it toggles the state -" - -IDEAS - GOING TO NEED A SPRITER OR MAKE BAD SPRITES MYSELF -sparking wallmount (fusebox, old APC, conduit) -X power conduits, broken/frayed/decorative (stun version, spark on step, random spark) -X wire tangle w/ stun -broken machines -tesla something or other -broken SMES/generator tesla +do_random_effect() repeats with a cooldown set randomly between random_min and random_max, if do_random_effect = TRUE + +contact() is sent when the hazard is entered or bumped, based on density. Ensure enter_activated is set if the hazard uses contact() + +requires_client_nearby and client_range are used for optimization purposes and for player reactive traps. +If set, only mobs with clients within client_range will enable the hazard. + +the disabled var is used to track if the hazard has been disabled. +disabled hazards cannot be renabled as the code intentionally stops calling itself. +can_be_disabled determines if the hazard can be disabled +time_to_disable only applies if the hazard can be disabled AND if the hazard uses this time for it's disable state. +generally, requiring another do_after with double the time of time_to_disable to remove (delete) the hazard is standard. +disable_text is added to the examine text if can_be_disabled is true. needs to be set! + +the on var and id var are used with hazard shutoffs +if a hazard is off, contact and random effects aren't sent. +ids should only be set on maps, and are used to link shutoffs and hazards. Yes this is global, no I don't know how to do it better while keeping it simple. +slowdown is used on all hazards to add slowdown to the turf the hazard is on. higher slowdown leads to slower players */ diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm index 989d90a7728a..470c2caeb25d 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/_examples.dm @@ -1,5 +1,5 @@ //EXAMPLE HAZARDS. DON'T USE THESE ON FINSIHED MAPS!! - +//see hazard_info.dm for an explaination /* SLOWDOWN HAZARDS */ @@ -96,9 +96,9 @@ ELECTRICAL HAZARDS random_max = 20 SECONDS contact_stun = TRUE - stun_time = 0 //don't do stun_time if not using SHOCK_NOGLOVES + stun_time = 0 //requires SHOCK_NOGLOVES contact_damage = 30 - shock_flags = 0 //doesn't shock if not wearing gloves, but stuns if you get shocked. + shock_flags = 0 //insulated gloves protect from this shock, and this shock will stun. /* STEAM HAZARDS @@ -184,7 +184,7 @@ FLOOR EXAMPLES icon_state = "hazard" density = TRUE //deals arms damage contact_damage = TRUE //needed - dealt_damage = 40 //split across legs or arms. + dealt_damage = 40 //split across both arms. damage_type = BURN /obj/structure/hazard/floor/example/toxicpit @@ -192,7 +192,7 @@ FLOOR EXAMPLES icon_state = "hazardg" density = FALSE //needed random_damage = TRUE //needed - dealt_damage = 20 //split across legs + dealt_damage = 20 //split across both legs damage_type = BURN random_min = 2 SECONDS random_max = 3 SECONDS @@ -210,7 +210,7 @@ FLOOR EXAMPLES /obj/structure/hazard/floor/example/launch name = "example launch" - icon_state = "gravplate" //needs state-launch version + icon_state = "gravplate" //needs state-launch version ie "gravplate" and "gravplate-launch" density = FALSE //needed layer = ABOVE_NORMAL_TURF_LAYER //needed to render it on the floor launcher = TRUE //needed @@ -248,32 +248,32 @@ shutoff example //Toggles the state of hazards with the same ID. SET ID ON MAP USING VAREDIT AND BE UNIQUE (ie: id = crashed_starwalker_water_hazard) /obj/structure/hazard_shutoff/example name = "example shutoff" - desc = "id = 1" - id = 1 + desc = "id = example" + id = "example" //ingame working example /obj/structure/hazard/electrical/example/random_tesla/shutoffexample name = "shutoff tesla" - id = 1 + id = "example" random_min = 1 SECONDS random_max = 2 SECONDS //another ingame working example /obj/structure/hazard/electrical/electrified_water/example - id = 1 + id = "example" //turns off hazards with the same ID until the resets time has passed! /obj/structure/hazard_shutoff/example/timed name = "example timed shutoff" - desc = "id = 1" - id = 1 + desc = "id = example" + id = "example" resets = 3 SECONDS //only works once charged with a cable up to siphon_max /obj/structure/hazard_shutoff/powered/example name = "example powered shutoff" - desc = "id = 1" - id = 1 + desc = "id = example" + id = "example" siphon_max = 1e6 //required power, in watts, needed to use this toggle. toggle_power = 5e5 //can be 0 diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/water_hazard.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/water_hazard.dm index 8641cd934328..8edafff180bf 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/water_hazard.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazards/water_hazard.dm @@ -10,6 +10,6 @@ random_sparks = TRUE random_zap = TRUE contact_damage = 10 - random_min = 3 SECONDS //should result in the whole pool pulsing at almost the same time. + random_min = 3 SECONDS //should result in the whole pool pulsing at the same time. random_max = 3 SECONDS slowdown = 0.5 From 44adc4f7d2635963650656e2a2c15d0cbf56979e Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:58:17 -0500 Subject: [PATCH 17/18] unused code --- .../objects_and_mobs/generic_hazards/hazard_code/_hazard.dm | 3 --- .../generic_hazards/hazard_code/electrical.dm | 6 ------ 2 files changed, 9 deletions(-) diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm index b5bdcd10ddd4..5724f847fc12 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/_hazard.dm @@ -53,9 +53,6 @@ procs used to set off effects /obj/structure/hazard/proc/attacked() //goes off if attacked or shot by most things. return -/obj/structure/hazard/proc/client_nearby() //goes off if a living creature with a client (effectively a player check) is within 5 tiles. - return - /* evil 'code' that sets off the above procs. mappers beware! */ diff --git a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm index 9ecbc317723f..350def62447d 100644 --- a/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm +++ b/code/modules/ruins/objects_and_mobs/generic_hazards/hazard_code/electrical.dm @@ -51,12 +51,6 @@ if(random_zap) zap_on_turf() -/obj/structure/hazard/electrical/client_nearby() - if(!COOLDOWN_FINISHED(src, cooldown)) - return - COOLDOWN_START(src, cooldown, cooldown_time) - zap() - //shoots off a tesla arc /obj/structure/hazard/electrical/proc/zap() playsound(src.loc, 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5) From 0dad9cb96b7215a656cd3bcaea01812aab464338 Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Wed, 30 Oct 2024 16:04:59 -0500 Subject: [PATCH 18/18] merge fixes --- .../effects/spawners/random.dm/waste_planet.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/game/objects/effects/spawners/random.dm/waste_planet.dm b/code/game/objects/effects/spawners/random.dm/waste_planet.dm index 22618dada63d..85e6f2dbeeb2 100644 --- a/code/game/objects/effects/spawners/random.dm/waste_planet.dm +++ b/code/game/objects/effects/spawners/random.dm/waste_planet.dm @@ -37,16 +37,16 @@ /obj/effect/spawner/random/waste/radiation loot = list( - /obj/structure/radioactive = 6, - /obj/structure/radioactive/stack = 6, - /obj/structure/radioactive/waste = 6 + /obj/structure/hazard/radioactive = 6, + /obj/structure/hazard/radioactive/stack = 6, + /obj/structure/hazard/radioactive/waste = 6 ) /obj/effect/spawner/random/waste/radiation/more_rads loot = list( - /obj/structure/radioactive = 3, - /obj/structure/radioactive/stack = 12, - /obj/structure/radioactive/waste = 12 + /obj/structure/hazard/radioactive = 3, + /obj/structure/hazard/radioactive/stack = 12, + /obj/structure/hazard/radioactive/waste = 12 ) /obj/effect/spawner/random/waste/atmos_can