Files
Paradise/code/modules/events/immovable_rod.dm
T
Charlie NolanGitHubBurzahparadisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com>
e6f99049f6 MILLA phase 2 (#27659)
* MILLA phase 2

* Lint.

* Build Rust library

* Assorted bugfixes and tweaks

* Simplify fire mechanics and make hotspot sending to DM more reliable.

* Assorted tweaks, fixed an issue in the core engine and removed the softcap it made necesary.

* SM fixes, slower plasmafire, less overpowered pyro anomalies, and air alarm improvements.

* Review fixes.

* Build Rust library

* Unbalanced icon.

* Rebalance immovable rods.

* Unbalanced has alerts, can fight airflow (but get slowed)

* Build Rust library

* Stronger space cooling, slower temperature flow, faster burns, burnt floors, and a hotspot display fix.

* Build Rust library

* Tweaks to avoid merge conflict

* Oops.

* Build Rust library

* Rebalance wind.

* Rebalance temperature flow and space cooling.

* Fix gas flamethrower.

* Build Rust library

* Make air push slowdown directional, so you don't get slowed while moving with the air.

* Variable name cleanup.

* Reduce the speed of wind pushes.

* Prevent wind pushes from breaking your pull.

* Prevent swaps during wind push.

* Made supermatter crytals reliably run last in atmos machinery.

* Sped up plasmafire burning, but dropped the minimum burn amount.

* Rebalanced SM heat output.

* Rebalanced pyro anomaly.

* Build Rust library

* Lint

* Build Rust library

* Uncap fuel burnt readout.

* Added Custom air alarm mode, dropped Refill cap to ONE_ATMOSPHERE.

* Updated air alarm modes to use pressure settings instead of ONE_ATMOSPHERE

* Added a list of areas not in Filtering to atmos alert computer.

* Increase pressure gradient and vent output, especially at low distro pressure.

* Changed Immovable Rod from Moderate to Major.

* Lint

* Build Rust library

* More lint!

* Build Rust library

* Magboots, scaled slowdown, and nukie borg immunity

* Wind image

* Wind v2

* Wind v3

* pngcrush

* pngcrush again

* Moved hotspot removal into SSair, add wind effect.

* Lint

* Build Rust library

* Fix hotspots.

* Hotspot visual based on gas burnt

* Build Rust library

* Scaled wind to gas amount, stopped first wind push while moving.

* Made Rust panic logging safer.

* Made MILLA full tick and sleep timers more honest.

* Pressure overlay, ghost mode, atmos goggles.

* Build Rust library

* Lint

* Build Rust library

* More lint-y stuff.

* Build Rust library

* Repair pressure overlay if it loses its loc.

* Bind pressure overlays to their tile better.

* Build Rust library

* Make the pressure overlay work on z=1 and not proliferate effects.

* Don't block the supply shuttle.

* Don't fine for special effects.

* Maybe don't fine for ghosts, either.

* Build Rust library

* Make pressure overlay play nice with shuttles.

* Build Rust library

* Pressure scanning for borgs.

* Build Rust library

* Lint

* Build Rust library

* Made explosions not generate so much wind.

* Removed an old and non-functional proc.

* Clientless mobs can get pushed again.

* Build Rust library

* cargo fmt

* Build Rust library

* Don't divide by zero.

* Plasmafire generator for the Shadow

* Update shadow to use plasmafire generators

* Fix shadow's plasmafire generators going out on depart.

* Prevent heat2color from runtiming at absolute zero.

* Better nanofrost

* Build Rust library

* Singularity immunity

* Build Rust library

* Add back meson mode to atmospheric scanner goggles, so they don't stare deeply into the SM

* Build Rust library

* Dump panic outputs into data/ instead.

* Build Rust library

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Charlie Nolan <funnyman3595@gmail.com>

* Saner handling of MILLA crash.

* Build Rust library

---------

Signed-off-by: Charlie Nolan <funnyman3595@gmail.com>
Co-authored-by: paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
2025-01-01 20:12:05 +00:00

169 lines
4.6 KiB
Plaintext

/*
Immovable rod random event.
The rod will spawn at some location outside the station, and travel in a straight line to the opposite side of the station
Everything solid in the way will be ex_act()'d
In my current plan for it, 'solid' will be defined as anything with density == 1
--NEOFite
*/
/datum/event/immovable_rod
announceWhen = 5
/datum/event/immovable_rod/announce()
GLOB.minor_announcement.Announce("What the fuck was that?!", "General Alert")
/datum/event/immovable_rod/start()
var/startside = pick(GLOB.cardinal)
var/turf/startT = spaceDebrisStartLoc(startside, level_name_to_num(MAIN_STATION))
var/turf/endT = spaceDebrisFinishLoc(startside, level_name_to_num(MAIN_STATION))
new /obj/effect/immovablerod/event(startT, endT)
/obj/effect/immovablerod
name = "\improper Immovable Rod"
desc = "What the fuck is that?"
icon = 'icons/obj/objects.dmi'
icon_state = "immrod"
throwforce = 100
density = TRUE
anchored = TRUE
var/z_original = 0
var/notify = TRUE
var/move_delay = 1
var/atom/start
var/atom/end
/obj/effect/immovablerod/New(atom/_start, atom/_end, delay)
. = ..()
start = _start
end = _end
loc = start
z_original = z
move_delay = delay
if(notify)
notify_ghosts("\A [src] is inbound!",
enter_link="<a href=byond://?src=[UID()];follow=1>(Click to follow)</a>",
source = src, action = NOTIFY_FOLLOW)
GLOB.poi_list |= src
head_towards_dest()
/obj/effect/immovablerod/proc/head_towards_dest()
if(end?.z == z_original)
walk_towards(src, end, move_delay)
/obj/effect/immovablerod/Topic(href, href_list)
if(href_list["follow"])
var/mob/dead/observer/ghost = usr
if(istype(ghost))
ghost.ManualFollow(src)
/obj/effect/immovablerod/Destroy()
GLOB.poi_list.Remove(src)
return ..()
/obj/effect/immovablerod/ex_act(severity)
return 0
/obj/effect/immovablerod/singularity_act()
return
/obj/effect/immovablerod/singularity_pull()
return
/obj/effect/immovablerod/Move(turf/newloc, direction)
if(!istype(newloc))
return ..()
if(!direction)
direction = get_dir(src, newloc)
forceMove(newloc)
setDir(direction)
if(prob(10))
playsound(src, 'sound/effects/bang.ogg', 50, TRUE)
audible_message("CLANG")
clong_turf(newloc)
for(var/atom/victim as anything in newloc)
clong_thing(victim)
/obj/effect/immovablerod/proc/clong_turf(turf/victim)
if(!victim.density)
return
if(iswallturf(victim))
var/turf/simulated/wall/W = victim
W.take_damage(rand(W.damage_cap / 3, W.damage_cap * 4 / 3))
else
victim.ex_act(EXPLODE_LIGHT)
/obj/effect/immovablerod/proc/clong_thing(atom/victim)
if(isobj(victim) && victim.density)
victim.ex_act(EXPLODE_HEAVY)
else if(ismob(victim))
if(ishuman(victim))
var/mob/living/carbon/human/H = victim
H.visible_message("<span class='danger'>[H.name] is penetrated by an immovable rod!</span>",
"<span class='userdanger'>The rod penetrates you!</span>",
"<span class ='danger'>You hear a CLANG!</span>")
H.adjustBruteLoss(160)
if(victim.density || prob(10))
victim.ex_act(EXPLODE_HEAVY)
/obj/effect/immovablerod/event
// The base chance to "damage" the floor when passing. This is not guaranteed to cause a full on hull breach.
// Chance to expose the tile to space is like 15% of this value.
var/floor_rip_chance = 40
/obj/effect/immovablerod/event/Move()
. = ..()
if(loc == end)
qdel(src)
/obj/effect/immovablerod/event/clong_turf(turf/victim)
if(!isfloorturf(victim))
return ..()
if(!prob(floor_rip_chance))
return
var/turf/simulated/floor/T = victim
if(prob(25))
T.ex_act(EXPLODE_HEAVY)
else
T.ex_act(EXPLODE_LIGHT)
/obj/effect/immovablerod/deadchat_plays(mode = DEADCHAT_DEMOCRACY_MODE, cooldown = 6 SECONDS)
return AddComponent(/datum/component/deadchat_control/immovable_rod, mode, list(), cooldown)
/obj/effect/immovablerod/smite
/// The target that we're gonna aim for between start and end
var/obj/effect/portal/exit
/obj/effect/immovablerod/smite/New(atom/_start, atom/_end)
new /obj/effect/portal(start, lifespan = 2 SECONDS)
return ..()
/obj/effect/immovablerod/smite/Move()
. = ..()
if(get_turf(src) == get_turf(end))
// our exit condition: get outta there kowalski
var/target_turf = get_ranged_target_turf(src, dir, rand(1, 10))
start = loc
walk(src, 0)
exit = new /obj/effect/portal(target_turf, lifespan = 2 SECONDS)
walk_towards(src, exit, move_delay)
else if(locate(exit) in get_turf(src))
QDEL_NULL(exit)
qdel(src)
/**
* Rod will walk towards edge turf in the specified direction.
*
* Arguments:
* * direction - The direction to walk the rod towards: NORTH, SOUTH, EAST, WEST.
*/
/obj/effect/immovablerod/proc/walk_in_direction(direction)
end = get_edge_target_turf(src, direction)
walk_towards(src, end, move_delay)