diff --git a/code/game/objects/effects/alien_acid.dm b/code/game/objects/effects/alien_acid.dm new file mode 100644 index 00000000000..59ae654c85b --- /dev/null +++ b/code/game/objects/effects/alien_acid.dm @@ -0,0 +1,88 @@ +/* Alien shit! + * Contains: + * effect/acid + */ + + +/* + * Acid + */ +/obj/effect/acid + gender = PLURAL + name = "acid" + desc = "Burbling corrossive stuff." + icon = 'icons/effects/effects.dmi' + icon_state = "acid" + density = 0 + opacity = 0 + anchored = 1 + unacidable = 1 + var/atom/target + var/ticks = 0 + var/target_strength = 0 + + +/obj/effect/acid/New(loc, targ) + ..(loc) + target = targ + + //handle APCs and newscasters and stuff nicely + pixel_x = target.pixel_x + pixel_y = target.pixel_y + + if(isturf(target)) //Turfs take twice as long to take down. + target_strength = 640 + else + target_strength = 320 + tick() + + +/obj/effect/acid/proc/tick() + if(!target) + qdel(src) + + ticks++ + + if(ticks >= target_strength) + target.visible_message("[target] collapses under its own weight into a puddle of goop and undigested debris!") + + 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/airless/asteroid) + + if(istype(target, /turf/simulated/floor)) + var/turf/simulated/floor/F = target + F.ChangeTurf(/turf/space) + + if(istype(target, /turf/simulated/wall)) + var/turf/simulated/wall/W = target + W.dismantle_wall(1) + + else + qdel(target) + + qdel(src) + return + + x = target.x + y = target.y + z = target.z + + switch(target_strength - ticks) + if(480) + visible_message("[target] is holding up against the acid!") + if(320) + visible_message("[target] is being melted by the acid!") + if(160) + visible_message("[target] is struggling to withstand the acid!") + if(80) + visible_message("[target] begins to crumble under the acid!") + + spawn(1) + if(src) + tick() diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/structures/aliens.dm similarity index 81% rename from code/game/objects/effects/aliens.dm rename to code/game/objects/structures/aliens.dm index ebeda7a77c0..3960d4c8dcc 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/structures/aliens.dm @@ -4,7 +4,6 @@ * Resin * Weeds * Egg - * effect/acid */ #define WEED_NORTH_EDGING "north" @@ -317,6 +316,9 @@ spawn(rand(MIN_GROWTH_TIME, MAX_GROWTH_TIME)) Grow() +/obj/structure/alien/egg/attack_alien(mob/living/carbon/alien/user) + return attack_hand(user) + /obj/structure/alien/egg/attack_hand(mob/living/user) if(user.get_int_organ(/obj/item/organ/internal/xenos/plasmavessel)) switch(status) @@ -420,90 +422,6 @@ #undef MIN_GROWTH_TIME #undef MAX_GROWTH_TIME - -/* - * Acid - */ -/obj/effect/acid - gender = PLURAL - name = "acid" - desc = "Burbling corrossive stuff." - icon = 'icons/effects/effects.dmi' - icon_state = "acid" - density = 0 - opacity = 0 - anchored = 1 - unacidable = 1 - var/atom/target - var/ticks = 0 - var/target_strength = 0 - - -/obj/effect/acid/New(loc, targ) - ..(loc) - target = targ - - //handle APCs and newscasters and stuff nicely - pixel_x = target.pixel_x - pixel_y = target.pixel_y - - if(isturf(target)) //Turfs take twice as long to take down. - target_strength = 640 - else - target_strength = 320 - tick() - - -/obj/effect/acid/proc/tick() - if(!target) - qdel(src) - - ticks++ - - if(ticks >= target_strength) - target.visible_message("[target] collapses under its own weight into a puddle of goop and undigested debris!") - - 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/airless/asteroid) - - if(istype(target, /turf/simulated/floor)) - var/turf/simulated/floor/F = target - F.ChangeTurf(/turf/space) - - if(istype(target, /turf/simulated/wall)) - var/turf/simulated/wall/W = target - W.dismantle_wall(1) - - else - qdel(target) - - qdel(src) - return - - x = target.x - y = target.y - z = target.z - - switch(target_strength - ticks) - if(480) - visible_message("[target] is holding up against the acid!") - if(320) - visible_message("[target] is being melted by the acid!") - if(160) - visible_message("[target] is struggling to withstand the acid!") - if(80) - visible_message("[target] begins to crumble under the acid!") - - spawn(1) - if(src) - tick() - #undef WEED_NORTH_EDGING #undef WEED_SOUTH_EDGING #undef WEED_EAST_EDGING diff --git a/paradise.dme b/paradise.dme index 56dc61e5140..193807bc439 100644 --- a/paradise.dme +++ b/paradise.dme @@ -707,7 +707,7 @@ #include "code\game\objects\objs.dm" #include "code\game\objects\structures.dm" #include "code\game\objects\weapons.dm" -#include "code\game\objects\effects\aliens.dm" +#include "code\game\objects\effects\alien_acid.dm" #include "code\game\objects\effects\anomalies.dm" #include "code\game\objects\effects\bump_teleporter.dm" #include "code\game\objects\effects\effects.dm" @@ -944,6 +944,7 @@ #include "code\game\objects\items\weapons\tanks\tanks.dm" #include "code\game\objects\items\weapons\tanks\watertank.dm" #include "code\game\objects\random\random.dm" +#include "code\game\objects\structures\aliens.dm" #include "code\game\objects\structures\artstuff.dm" #include "code\game\objects\structures\barsign.dm" #include "code\game\objects\structures\bedsheet_bin.dm"