Skip to content

Commit

Permalink
Acid balance and fixes, Xeno's no longer instakill with their acid (t…
Browse files Browse the repository at this point in the history
…gstation#76227)

## About The Pull Request

Acid, when applied to a turf, does not immediately apply acid to the
turfs contents, instead just doing that in the acid component.
The acid component now does not destroy things under a turf, like pipes.
Alien acid no longer instakills mobs, Fixes tgstation#69577 (Acid component now
has an option not to apply acid to mobs on a turf).
Aliens can now touch acid.

## Why It's Good For The Game

Fixes some bugs with aliens and acid.
I don't really like how the acid now does not damage mobs at all, but
that seems to be what is intended.
I don't think that acid should be going through a turfs contents in
different places, plus I like the look of it not immediately applying
the acid to them better.

## Changelog

:cl: Seven
balance: Acid on a turf no longer immediately applies acid to its
contents
fix: Acid applied on a tile will no longer damage pipes below that tile
fix: Xeno's corrosive acid no longer instakills mobs
fix: Xenos can now touch acid
/:cl:
  • Loading branch information
Lufferly authored Jun 24, 2023
1 parent 36d8ec4 commit 28e0a7e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
14 changes: 13 additions & 1 deletion code/datums/components/acid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
var/stage = 0
/// Acid overlay appearance we apply
var/acid_overlay
/// Boolean for if we ignore mobs when applying acid to turf contents
var/turf_acid_ignores_mobs = FALSE
/// The ambient sound of acid eating away at the parent [/atom].
var/datum/looping_sound/acid/sizzle
/// Particle holder for acid particles (sick)
var/obj/effect/abstract/particle_holder/particle_effect
/// The proc used to handle the parent [/atom] when processing. TODO: Unify damage and resistance flags so that this doesn't need to exist!
var/datum/callback/process_effect

/datum/component/acid/Initialize(acid_power = ACID_POWER_MELT_TURF, acid_volume = 50, acid_overlay = GLOB.acid_overlay, acid_particles = /particles/acid)
/datum/component/acid/Initialize(acid_power = ACID_POWER_MELT_TURF, acid_volume = 50, acid_overlay = GLOB.acid_overlay, acid_particles = /particles/acid, turf_acid_ignores_mobs = FALSE)
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE

Expand All @@ -48,6 +50,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
src.max_volume = MOB_ACID_VOLUME_MAX
src.process_effect = CALLBACK(src, PROC_REF(process_mob), parent)
else if(isturf(parent))
src.turf_acid_ignores_mobs = turf_acid_ignores_mobs
src.max_volume = TURF_ACID_VOLUME_MAX
src.process_effect = CALLBACK(src, PROC_REF(process_turf), parent)
//if we failed all other checks, we must be an /atom/movable that uses integrity
Expand Down Expand Up @@ -146,6 +149,13 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
var/acid_used = min(acid_volume * 0.05, 20) * seconds_per_tick
var/applied_targets = 0
for(var/atom/movable/target_movable as anything in target_turf)
// Dont apply acid to things under the turf
if(target_turf.underfloor_accessibility < UNDERFLOOR_INTERACTABLE && HAS_TRAIT(target_movable, TRAIT_T_RAY_VISIBLE))
continue
// Ignore mobs if turf_acid_ignores_mobs is TRUE
if(turf_acid_ignores_mobs && ismob(target_movable))
continue
// Apply the acid
if(target_movable.acid_act(acid_power, acid_used))
applied_targets++

Expand Down Expand Up @@ -233,6 +243,8 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
/datum/component/acid/proc/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs)
SIGNAL_HANDLER

if(turf_acid_ignores_mobs)
return
if(!isliving(arrived))
return
var/mob/living/crosser = arrived
Expand Down
5 changes: 0 additions & 5 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -602,11 +602,6 @@ GLOBAL_LIST_EMPTY(station_turfs)
return FALSE

AddComponent(/datum/component/acid, acidpwr, acid_volume, GLOB.acid_overlay)
for(var/atom/movable/movable_atom as anything in src)
if(underfloor_accessibility < UNDERFLOOR_INTERACTABLE && HAS_TRAIT(movable_atom, TRAIT_T_RAY_VISIBLE))
continue

movable_atom.acid_act(acidpwr, acid_volume)

return . || TRUE

Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/alien/adult/adult.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,7 @@ GLOBAL_LIST_INIT(strippable_alien_humanoid_items, create_strippable_list(list(
log_combat(src, lucky_winner, "devoured")
melting_pot.consume_thing(lucky_winner)
return TRUE

// Aliens can touch acid
/mob/living/carbon/alien/can_touch_acid(atom/acided_atom, acid_power, acid_volume)
return TRUE
8 changes: 7 additions & 1 deletion code/modules/mob/living/carbon/alien/adult/alien_powers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ Doesn't work on other aliens/AI.*/
desc = "Drench an object in acid, destroying it over time."
button_icon_state = "alien_acid"
plasma_cost = 200
/// The acid power for the aliens acid corrosion, will ignore mobs
var/corrosion_acid_power = 200
/// The acid volume for the aliens acid corrosion, will ignore mobs
var/corrosion_acid_volume = 1000

/datum/action/cooldown/alien/acid/corrosion/set_click_ability(mob/on_who)
. = ..()
Expand Down Expand Up @@ -228,7 +232,9 @@ Doesn't work on other aliens/AI.*/
return ..()

/datum/action/cooldown/alien/acid/corrosion/Activate(atom/target)
if(!target.acid_act(200, 1000))
if(isturf(target))
target.AddComponent(/datum/component/acid, corrosion_acid_power, corrosion_acid_volume, GLOB.acid_overlay, /particles/acid, turf_acid_ignores_mobs = TRUE)
else if(!target.acid_act(corrosion_acid_power, corrosion_acid_volume))
to_chat(owner, span_noticealien("You cannot dissolve this object."))
return FALSE

Expand Down

0 comments on commit 28e0a7e

Please sign in to comment.