next-we-melt-the-memories-that-are

This commit is contained in:
Fox McCloud
2019-09-09 16:20:04 -04:00
parent d19961378d
commit 177ac43f23
26 changed files with 482 additions and 165 deletions
+71 -67
View File
@@ -1,88 +1,92 @@
/* Alien shit!
* Contains:
* effect/acid
*/
/*
* Acid
*/
/obj/effect/acid
gender = PLURAL
name = "acid"
desc = "Burbling corrossive stuff."
icon = 'icons/effects/effects.dmi'
desc = "Burbling corrosive stuff."
icon_state = "acid"
density = 0
density = FALSE
opacity = 0
anchored = 1
unacidable = 1
var/atom/target
var/ticks = 0
var/target_strength = 0
anchored = TRUE
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
layer = ABOVE_NORMAL_TURF_LAYER
var/turf/target
/obj/effect/acid/New(loc, targ)
..(loc)
target = targ
/obj/effect/acid/Initialize(mapload, acid_pwr, acid_amt)
. = ..()
target = get_turf(src)
if(acid_amt)
acid_level = min(acid_amt * acid_pwr, 12000) //capped so the acid effect doesn't last a half hour on the floor.
//handle APCs and newscasters and stuff nicely
pixel_x = target.pixel_x
pixel_y = target.pixel_y
pixel_x = target.pixel_x + rand(-4,4)
pixel_y = target.pixel_y + rand(-4,4)
if(isturf(target)) //Turfs take twice as long to take down.
target_strength = 640
else
target_strength = 320
tick()
START_PROCESSING(SSobj, src)
/obj/effect/acid/proc/tick()
/obj/effect/acid/Destroy()
STOP_PROCESSING(SSobj, src)
target = null
return ..()
/obj/effect/acid/process()
. = 1
if(!target)
qdel(src)
return 0
ticks++
if(prob(5))
playsound(loc, 'sound/items/welder.ogg', 100, TRUE)
if(ticks >= target_strength)
target.visible_message("<span class='warning'>[target] collapses under its own weight into a puddle of goop and undigested debris!</span>")
if(istype(target, /obj/structure/closet))
var/obj/structure/closet/T = target
T.dump_contents()
qdel(target)
if(istype(target, /turf/simulated/mineral))
var/turf/simulated/mineral/M = target
M.ChangeTurf(/turf/simulated/floor/plating/asteroid/airless)
if(istype(target, /turf/simulated/floor))
var/turf/simulated/floor/F = target
F.ChangeTurf(F.baseturf)
if(istype(target, /turf/simulated/wall))
var/turf/simulated/wall/W = target
W.dismantle_wall(1)
else
qdel(target)
for(var/obj/O in target)
if(prob(20) && !(resistance_flags & UNACIDABLE))
if(O.acid_level < acid_level * 0.3)
var/acid_used = min(acid_level * 0.05, 20)
O.acid_act(10, acid_used)
acid_level = max(0, acid_level - acid_used * 10)
acid_level = max(acid_level - (5 + 2 * round(sqrt(acid_level))), 0)
if(acid_level <= 0)
qdel(src)
return
return 0
x = target.x
y = target.y
z = target.z
/obj/effect/acid/Crossed(AM as mob|obj)
if(isliving(AM))
var/mob/living/L = AM
if(L.flying)
return
if(L.m_intent != MOVE_INTENT_WALK && prob(40))
var/acid_used = min(acid_level * 0.05, 20)
if(L.acid_act(10, acid_used, "feet"))
acid_level = max(0, acid_level - acid_used * 10)
playsound(L, 'sound/weapons/sear.ogg', 50, TRUE)
to_chat(L, "<span class='userdanger'>[src] burns you!</span>")
switch(target_strength - ticks)
if(480)
visible_message("<span class='warning'>[target] is holding up against the acid!</span>")
if(320)
visible_message("<span class='warning'>[target] is being melted by the acid!</span>")
if(160)
visible_message("<span class='warning'>[target] is struggling to withstand the acid!</span>")
if(80)
visible_message("<span class='warning'>[target] begins to crumble under the acid!</span>")
//xenomorph corrosive acid
/obj/effect/acid/alien
var/target_strength = 30
spawn(1)
if(src)
tick()
/obj/effect/acid/alien/process()
. = ..()
if(.)
if(prob(45))
playsound(loc, 'sound/items/welder.ogg', 100, TRUE)
target_strength--
if(target_strength <= 0)
target.visible_message("<span class='warning'>[target] collapses under its own weight into a puddle of goop and undigested debris!</span>")
target.acid_melt()
qdel(src)
else
switch(target_strength)
if(24)
visible_message("<span class='warning'>[target] is holding up against the acid!</span>")
if(16)
visible_message("<span class='warning'>[target] is being melted by the acid!</span>")
if(8)
visible_message("<span class='warning'>[target] is struggling to withstand the acid!</span>")
if(4)
visible_message("<span class='warning'>[target] begins to crumble under the acid!</span>")
@@ -1,6 +1,12 @@
/obj/effect/decal/remains
gender = PLURAL
/obj/effect/decal/remains/acid_act()
visible_message("<span class='warning'>[src] dissolve[gender==PLURAL?"":"s"] into a puddle of sizzling goop!</span>")
playsound(src, 'sound/items/welder.ogg', 150, TRUE)
new /obj/effect/decal/cleanable/greenglow(drop_location())
qdel(src)
/obj/effect/decal/remains/human
name = "remains"
desc = "They look like human remains. They have a strange aura about them."
+6
View File
@@ -15,6 +15,12 @@
/obj/effect/attack_hulk(mob/living/carbon/human/user, does_attack_animation = FALSE)
return FALSE
/obj/effect/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
return
/obj/effect/acid_act()
return
/obj/effect/decal
plane = FLOOR_PLANE
var/no_scoop = FALSE //if it has this, don't let it be scooped up
+7
View File
@@ -188,3 +188,10 @@
/obj/structure/glowshroom/proc/CheckEndurance()
if(endurance <= 0)
qdel(src)
/obj/structure/glowshroom/acid_act(acidpwr, acid_volume)
. = 1
visible_message("<span class='danger'>[src] melts away!</span>")
var/obj/effect/decal/cleanable/molten_object/I = new (get_turf(src))
I.desc = "Looks like this was \an [src] some time ago."
qdel(src)
+19
View File
@@ -218,6 +218,15 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
A.desc += "\nLooks like this used to be \an [name] some time ago."
..()
/obj/item/acid_melt()
if(!QDELETED(src))
var/turf/T = get_turf(src)
var/obj/effect/decal/cleanable/molten_object/MO = new(T)
MO.pixel_x = rand(-16,16)
MO.pixel_y = rand(-16,16)
MO.desc = "Looks like this was \an [src] some time ago."
..()
/obj/item/afterattack(atom/target, mob/user, proximity, params)
SEND_SIGNAL(src, COMSIG_ITEM_AFTERATTACK, target, user, proximity, params)
..()
@@ -251,6 +260,15 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
else
extinguish()
if(acid_level > 20 && !ismob(loc))// so we can still remove the clothes on us that have acid.
var/mob/living/carbon/human/H = user
if(istype(H))
if(!H.gloves || (!(H.gloves.resistance_flags & (UNACIDABLE|ACID_PROOF))))
to_chat(user, "<span class='warning'>The acid on [src] burns your hand!</span>")
var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_arm")
if(affecting && affecting.receive_damage( 0, 5 )) // 5 burn damage
H.UpdateDamageIcon()
if(istype(src.loc, /obj/item/storage))
//If the item is in a storage item, take it out
var/obj/item/storage/S = src.loc
@@ -578,6 +596,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
if(!do_after(user, 40, target = source))
return
clean_blood()
acid_level = 0
user.visible_message("<span class='notice'>[user] washes [src] using [source].</span>", \
"<span class='notice'>You wash [src] using [source].</span>")
return 1
+40 -2
View File
@@ -158,6 +158,42 @@
qdel(src)
return 2
///// ACID
GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/effects/effects.dmi', "acid"))
///the obj's reaction when touched by acid
/obj/acid_act(acidpwr, acid_volume)
if(!(resistance_flags & UNACIDABLE) && acid_volume)
if(!acid_level)
SSacid.processing[src] = src
add_overlay(GLOB.acid_overlay, TRUE)
var/acid_cap = acidpwr * 300 //so we cannot use huge amounts of weak acids to do as well as strong acids.
if(acid_level < acid_cap)
acid_level = min(acid_level + acidpwr * acid_volume, acid_cap)
return 1
///the proc called by the acid subsystem to process the acid that's on the obj
/obj/proc/acid_processing()
. = 1
if(!(resistance_flags & ACID_PROOF))
for(var/armour_value in armor)
if(armour_value != "acid" && armour_value != "fire")
armor[armour_value] = max(armor[armour_value] - round(sqrt(acid_level) * 0.1), 0)
if(prob(33))
playsound(loc, 'sound/items/welder.ogg', 150, TRUE)
take_damage(min(1 + round(sqrt(acid_level) * 0.3), 300), BURN, "acid", 0)
acid_level = max(acid_level - (5 + 3 * round(sqrt(acid_level))), 0)
if(!acid_level)
return 0
///called when the obj is destroyed by acid.
/obj/proc/acid_melt()
SSacid.processing -= src
deconstruct(FALSE)
//// FIRE
/obj/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
@@ -202,9 +238,11 @@
/obj/proc/obj_break(damage_flag)
return
//what happens when the obj's integrity reaches zero.
///what happens when the obj's integrity reaches zero.
/obj/proc/obj_destruction(damage_flag)
if(damage_flag == BURN)
if(damage_flag == "acid")
acid_melt()
else if(damage_flag == "fire")
burn()
else
deconstruct(FALSE)
+1 -1
View File
@@ -2,7 +2,6 @@
//var/datum/module/mod //not used
var/origin_tech = null //Used by R&D to determine what research bonuses it grants.
var/crit_fail = 0
var/unacidable = 0 //universal "unacidabliness" var, here so you can use it in any obj.
animate_movement = 2
var/throwforce = 1
var/list/attack_verb = list() //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]"
@@ -15,6 +14,7 @@
var/obj_integrity //defaults to max_integrity
var/max_integrity = INFINITY
var/integrity_failure = 0 //0 if we have no special broken behavior
var/acid_level = 0 //how much acid is on that obj
var/resistance_flags = NONE // INDESTRUCTIBLE
var/can_be_hit = TRUE //can this be bludgeoned by items?