Skip to content
Open
Show file tree
Hide file tree
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
49 changes: 25 additions & 24 deletions code/datums/effects/acid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,36 @@
/// The maximum allowed duration per acid_level
var/static/list/tier_max_duarions = list(20, 40, 80)

/datum/effects/acid/New(atom/atom, mob/from = null, last_dmg_source = null, zone = "chest")
..(atom, from, last_dmg_source, zone)
if(ishuman(atom))
var/mob/living/carbon/human/human = atom
human.update_effects()

if(isobj(atom))
var/obj/obj_target = atom
if(istype(obj_target, /obj/structure/barricade))
var/obj/structure/barricade/barricade_targer = obj_target
obj_dmg_multiplier = barricade_targer.burn_multiplier
obj_target.update_icon()
/datum/effects/acid/New(atom/target_atom, mob/from = null, last_dmg_source = null, zone = "chest")
..(target_atom, from, last_dmg_source, zone)
if(ishuman(target_atom))
var/mob/living/carbon/human/target_human = target_atom
target_human.update_effects()

if(isobj(target_atom))
var/obj/target_object = target_atom
if(istype(target_object, /obj/structure/barricade))
var/obj/structure/barricade/target_barricade = target_object
obj_dmg_multiplier = target_barricade.burn_multiplier
if(istype(target_object, /obj/structure/barricade/handrail))
var/obj/structure/barricade/handrail/target_handrail = target_object
target_handrail.on_acid = TRUE
target_object.update_icon()

handle_weather()

RegisterSignal(SSdcs, COMSIG_GLOB_WEATHER_CHANGE, PROC_REF(handle_weather))

/datum/effects/acid/validate_atom(atom/atom)
if(istype(atom, /obj/structure/barricade))
/datum/effects/acid/validate_atom(atom/target_atom)
if(istype(target_atom, /obj/structure/barricade))
return TRUE

if(isobj(atom))
if(isobj(target_atom))
return FALSE

if(ishuman(atom))
var/mob/living/carbon/human/human = atom
if(human.status_flags & XENO_HOST && HAS_TRAIT(human, TRAIT_NESTED) || human.stat == DEAD || HAS_TRAIT(human, TRAIT_HAULED))
if(ishuman(target_atom))
var/mob/living/carbon/human/target_human = target_atom
if(target_human.status_flags & XENO_HOST && HAS_TRAIT(target_human, TRAIT_NESTED) || target_human.stat == DEAD || HAS_TRAIT(target_human, TRAIT_HAULED))
return FALSE

return ..()
Expand Down Expand Up @@ -82,14 +85,12 @@
LAZYREMOVE(affected_atom.effects_list, src)

if(ishuman(affected_atom))
var/mob/living/carbon/human/human = affected_atom
human.update_effects()
if(acid_level >= 3)
to_chat(human, SPAN_WARNING("Your armor returns to normal."))
var/mob/living/carbon/human/target_human = affected_atom
target_human.update_effects()

if(isobj(affected_atom))
var/obj/obj_target = affected_atom
obj_target.update_icon()
var/obj/target_object = affected_atom
target_object.update_icon()
return ..()

/**
Expand Down
10 changes: 6 additions & 4 deletions code/game/objects/structures/barricade/barricade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
var/metallic = TRUE
/// Lower limit of damage beyond which the barricade cannot be fixed by welder. Compared to damage_state. If null it can be repaired at any damage_state.
var/welder_lower_damage_limit = null
/// Check if cade is on acid, if yes, do not leave debris after melting.
var/on_acid = FALSE

/obj/structure/barricade/Initialize(mapload, mob/user)
. = ..()
Expand Down Expand Up @@ -327,7 +329,7 @@
if(stack_amt)
new stack_type(loc, stack_amt)
else
if(destroyed_stack_amount)
if(!on_acid && destroyed_stack_amount)
new stack_type(loc, destroyed_stack_amount)
return ..()

Expand Down Expand Up @@ -371,7 +373,7 @@
update_icon()

/obj/structure/barricade/acid_spray_act()
take_damage(25 * burn_multiplier)
take_damage((25 * burn_multiplier), TRUE)
visible_message(SPAN_WARNING("[src] is hit by the acid spray!"))
new /datum/effects/acid(src, null, null)

Expand All @@ -381,15 +383,15 @@
/obj/structure/barricade/proc/hit_barricade(obj/item/item)
take_damage(item.force * item.demolition_mod * 0.5 * brute_multiplier)

/obj/structure/barricade/proc/take_damage(damage)
/obj/structure/barricade/proc/take_damage(damage, acided = FALSE)
for(var/obj/structure/barricade/barricade in get_step(src,dir)) //discourage double-stacking barricades by removing health from opposing barricade
if(barricade.dir == reverse_direction(dir))
barricade.update_health(damage)

update_health(damage)

/obj/structure/barricade/proc/take_acid_damage(damage)
take_damage(damage * burn_multiplier)
take_damage((damage * burn_multiplier), TRUE)

/obj/structure/barricade/update_health(damage, nomessage)
health -= damage
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/structures/barricade/handrail.dm
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@
return
. = ..()

/obj/structure/barricade/handrail/take_damage(acided = FALSE)
if(acided)
on_acid = TRUE
return ..()

/obj/structure/barricade/handrail/no_vault
autoclimb = FALSE

Expand Down
Loading