Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-buff immovable rods #27985

Merged
merged 2 commits into from
Jan 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions code/modules/events/immovable_rod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
var/move_delay = 1
var/atom/start
var/atom/end
/// The minimum amount of damage dealt to walls, relative to their max HP.
var/wall_damage_min_fraction = 0.9
/// The maximum amount of damage dealt to walls, relative to their max HP. Values over 1 are useful for adjusting the probability of destroying the wall.
var/wall_damage_max_fraction = 1.4

/obj/effect/immovablerod/New(atom/_start, atom/_end, delay)
. = ..()
Expand Down Expand Up @@ -84,16 +88,28 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
audible_message("CLANG")

clong_turf(newloc)
for(var/atom/victim as anything in newloc)
clong_thing(victim)
if(isnull(newloc))
// The turf is dead, long live the turf!
newloc = loc

while(TRUE)
var/hit_something_dense = FALSE
for(var/atom/victim as anything in newloc)
clong_thing(victim)
if(victim.density)
hit_something_dense = TRUE

// Keep hitting stuff until there's nothing dense or we randomly go through it.
if(!hit_something_dense || prob(25))
break

/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))
W.take_damage(rand(W.damage_cap * wall_damage_min_fraction, W.damage_cap * wall_damage_max_fraction))
else
victim.ex_act(EXPLODE_LIGHT)

Expand All @@ -111,9 +127,13 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
victim.ex_act(EXPLODE_HEAVY)

/obj/effect/immovablerod/event
wall_damage_min_fraction = 0.33
wall_damage_max_fraction = 1.33
// 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.
// Chance to expose the tile to space is like 60% of this value.
Burzah marked this conversation as resolved.
Show resolved Hide resolved
var/floor_rip_chance = 40
// Chance to damage the floor if we didn't rip it.
var/floor_graze_chance = 50

/obj/effect/immovablerod/event/Move()
. = ..()
Expand All @@ -124,13 +144,10 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
if(!isfloorturf(victim))
return ..()

if(!prob(floor_rip_chance))
return

var/turf/simulated/floor/T = victim
if(prob(25))
if(prob(floor_rip_chance))
T.ex_act(EXPLODE_HEAVY)
else
else if(prob(floor_graze_chance))
T.ex_act(EXPLODE_LIGHT)

/obj/effect/immovablerod/deadchat_plays(mode = DEADCHAT_DEMOCRACY_MODE, cooldown = 6 SECONDS)
Expand Down
Loading