mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-22 04:24:20 +01:00
Merge pull request #6962 from davipatury/effect-to-structure
Ports /tg/ obj damage system - Part 1
This commit is contained in:
@@ -229,7 +229,7 @@
|
||||
//Different classes of items give different commodities.
|
||||
if(istype(W,/obj/item/weapon/cigbutt))
|
||||
stored_comms["plastic"]++
|
||||
else if(istype(W,/obj/effect/spider/spiderling))
|
||||
else if(istype(W,/obj/structure/spider/spiderling))
|
||||
stored_comms["wood"]++
|
||||
stored_comms["wood"]++
|
||||
stored_comms["plastic"]++
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
if(prob(5)) //Spawns foam!
|
||||
visible_message("<span class='danger'>[src] whirs and bubbles violently, before releasing a plume of froth!</span>")
|
||||
new /obj/effect/effect/foam(loc)
|
||||
new /obj/structure/foam(loc)
|
||||
|
||||
else if(prob(5))
|
||||
audible_message("[src] makes an excited beeping booping sound!")
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
for(var/direction in shuffle(list(1,2,4,8,5,6,9,10)))
|
||||
var/step = get_step(src, direction)
|
||||
if(step)
|
||||
if(locate(/obj/effect/spacevine) in step)
|
||||
if(locate(/obj/structure/spacevine) in step)
|
||||
Move(step, get_dir(src, step))
|
||||
|
||||
/mob/living/simple_animal/hostile/retaliate/goat/handle_automated_action()
|
||||
@@ -47,7 +47,7 @@
|
||||
LoseTarget()
|
||||
src.visible_message("\blue [src] calms down.")
|
||||
|
||||
var/obj/effect/spacevine/SV = locate(/obj/effect/spacevine) in loc
|
||||
var/obj/structure/spacevine/SV = locate(/obj/structure/spacevine) in loc
|
||||
if(SV)
|
||||
SV.eat(src)
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
/mob/living/simple_animal/hostile/retaliate/goat/Move()
|
||||
..()
|
||||
if(!stat)
|
||||
var/obj/effect/spacevine/SV = locate(/obj/effect/spacevine) in loc
|
||||
var/obj/structure/spacevine/SV = locate(/obj/structure/spacevine) in loc
|
||||
if(SV)
|
||||
SV.eat(src)
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
GiveUp(C)
|
||||
return
|
||||
//second, spin a sticky spiderweb on this tile
|
||||
var/obj/effect/spider/stickyweb/W = locate() in get_turf(src)
|
||||
var/obj/structure/spider/stickyweb/W = locate() in get_turf(src)
|
||||
if(!W)
|
||||
Web()
|
||||
else
|
||||
@@ -157,7 +157,7 @@
|
||||
stop_automated_movement = 1
|
||||
spawn(40)
|
||||
if(busy == SPINNING_WEB && src.loc == T)
|
||||
new /obj/effect/spider/stickyweb(T)
|
||||
new /obj/structure/spider/stickyweb(T)
|
||||
busy = 0
|
||||
stop_automated_movement = 0
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
spawn(50)
|
||||
if(busy == SPINNING_COCOON)
|
||||
if(cocoon_target && istype(cocoon_target.loc, /turf) && get_dist(src,cocoon_target) <= 1)
|
||||
var/obj/effect/spider/cocoon/C = new(cocoon_target.loc)
|
||||
var/obj/structure/spider/cocoon/C = new(cocoon_target.loc)
|
||||
var/large_cocoon = 0
|
||||
C.pixel_x = cocoon_target.pixel_x
|
||||
C.pixel_y = cocoon_target.pixel_y
|
||||
@@ -223,7 +223,7 @@
|
||||
set category = "Spider"
|
||||
set desc = "Lay a clutch of eggs, but you must wrap a creature for feeding first."
|
||||
|
||||
var/obj/effect/spider/eggcluster/E = locate() in get_turf(src)
|
||||
var/obj/structure/spider/eggcluster/E = locate() in get_turf(src)
|
||||
if(E)
|
||||
to_chat(src, "<span class='notice'>There is already a cluster of eggs here!</span>")
|
||||
else if(!fed)
|
||||
@@ -236,7 +236,7 @@
|
||||
if(busy == LAYING_EGGS)
|
||||
E = locate() in get_turf(src)
|
||||
if(!E)
|
||||
var/obj/effect/spider/eggcluster/C = new /obj/effect/spider/eggcluster(src.loc)
|
||||
var/obj/structure/spider/eggcluster/C = new /obj/structure/spider/eggcluster(src.loc)
|
||||
C.faction = faction
|
||||
C.master_commander = master_commander
|
||||
if(ckey)
|
||||
|
||||
@@ -112,11 +112,11 @@
|
||||
else if(istype(loc, /turf/space))
|
||||
to_chat(src, "<span class='danger'>Webs cannot be spun in space.</span>")
|
||||
else
|
||||
var/obj/effect/spider/terrorweb/T = locate() in get_turf(src)
|
||||
var/obj/structure/spider/terrorweb/T = locate() in get_turf(src)
|
||||
if(T)
|
||||
to_chat(src, "<span class='danger'>There is already a web here.</span>")
|
||||
else
|
||||
var/obj/effect/spider/terrorweb/W = new /obj/effect/spider/terrorweb(loc)
|
||||
var/obj/structure/spider/terrorweb/W = new /obj/structure/spider/terrorweb(loc)
|
||||
W.creator_ckey = ckey
|
||||
if(thick)
|
||||
W.opacity = 1
|
||||
@@ -125,7 +125,7 @@
|
||||
W.infectious = 1
|
||||
W.name = "sharp terror web"
|
||||
|
||||
/obj/effect/spider/terrorweb
|
||||
/obj/structure/spider/terrorweb
|
||||
name = "terror web"
|
||||
desc = "it's stringy and sticky"
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
@@ -136,18 +136,18 @@
|
||||
var/creator_ckey = null
|
||||
var/infectious = 0
|
||||
|
||||
/obj/effect/spider/terrorweb/New()
|
||||
/obj/structure/spider/terrorweb/New()
|
||||
..()
|
||||
if(prob(50))
|
||||
icon_state = "stickyweb2"
|
||||
|
||||
/obj/effect/spider/terrorweb/proc/DeCloakNearby()
|
||||
/obj/structure/spider/terrorweb/proc/DeCloakNearby()
|
||||
for(var/mob/living/simple_animal/hostile/poison/terror_spider/gray/G in view(6,src))
|
||||
if(!G.ckey && G.stat != DEAD)
|
||||
G.GrayDeCloak()
|
||||
G.Aggro()
|
||||
|
||||
/obj/effect/spider/terrorweb/CanPass(atom/movable/mover, turf/target)
|
||||
/obj/structure/spider/terrorweb/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover, /mob/living/simple_animal/hostile/poison/terror_spider))
|
||||
return 1
|
||||
if(istype(mover, /obj/item/projectile/terrorqueenspit))
|
||||
@@ -178,7 +178,7 @@
|
||||
return prob(20)
|
||||
return ..()
|
||||
|
||||
/obj/effect/spider/terrorweb/bullet_act(obj/item/projectile/Proj)
|
||||
/obj/structure/spider/terrorweb/bullet_act(obj/item/projectile/Proj)
|
||||
if(Proj.damage_type != BRUTE && Proj.damage_type != BURN)
|
||||
visible_message("<span class='danger'>[src] is undamaged by [Proj]!</span>")
|
||||
// Webs don't care about disablers, tasers, etc. Or toxin damage. They're organic, but not alive.
|
||||
@@ -196,7 +196,7 @@
|
||||
choices += L
|
||||
for(var/obj/O in oview(1,src))
|
||||
if(Adjacent(O) && !O.anchored)
|
||||
if(!istype(O, /obj/effect/spider/terrorweb) && !istype(O, /obj/effect/spider/cocoon) && !istype(O, /obj/effect/spider/spiderling/terror_spiderling))
|
||||
if(!istype(O, /obj/structure/spider/terrorweb) && !istype(O, /obj/structure/spider/cocoon) && !istype(O, /obj/structure/spider/spiderling/terror_spiderling))
|
||||
choices += O
|
||||
if(choices.len)
|
||||
cocoon_target = input(src,"What do you wish to cocoon?") in null|choices
|
||||
@@ -215,7 +215,7 @@
|
||||
if(do_after(src, 40, target = cocoon_target.loc))
|
||||
if(busy == SPINNING_COCOON)
|
||||
if(cocoon_target && isturf(cocoon_target.loc) && get_dist(src,cocoon_target) <= 1)
|
||||
var/obj/effect/spider/cocoon/C = new(cocoon_target.loc)
|
||||
var/obj/structure/spider/cocoon/C = new(cocoon_target.loc)
|
||||
var/large_cocoon = 0
|
||||
C.pixel_x = cocoon_target.pixel_x
|
||||
C.pixel_y = cocoon_target.pixel_y
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
var/numlings = input("How many?") as null|anything in list(10, 20, 30, 40, 50)
|
||||
var/sbpc = input("%chance to be stillborn?") as null|anything in list(0, 25, 50, 75, 100)
|
||||
for(var/i=0, i<numlings, i++)
|
||||
var/obj/effect/spider/spiderling/terror_spiderling/S = new /obj/effect/spider/spiderling/terror_spiderling(get_turf(src))
|
||||
var/obj/structure/spider/spiderling/terror_spiderling/S = new /obj/structure/spider/spiderling/terror_spiderling(get_turf(src))
|
||||
S.grow_as = pick(/mob/living/simple_animal/hostile/poison/terror_spider/red, \
|
||||
/mob/living/simple_animal/hostile/poison/terror_spider/gray, \
|
||||
/mob/living/simple_animal/hostile/poison/terror_spider/green, \
|
||||
@@ -91,9 +91,9 @@
|
||||
if(T.spider_tier < spider_tier)
|
||||
T.degenerate = 1
|
||||
to_chat(T, "<span class='userdanger'>Through the hivemind, the raw power of [src] floods into your body, burning it from the inside out!</span>")
|
||||
for(var/obj/effect/spider/eggcluster/terror_eggcluster/T in ts_egg_list)
|
||||
for(var/obj/structure/spider/eggcluster/terror_eggcluster/T in ts_egg_list)
|
||||
qdel(T)
|
||||
for(var/obj/effect/spider/spiderling/terror_spiderling/T in ts_spiderling_list)
|
||||
for(var/obj/structure/spider/spiderling/terror_spiderling/T in ts_spiderling_list)
|
||||
T.stillborn = 1
|
||||
to_chat(src, "<span class='userdanger'>All Terror Spiders, except yourself, will die off shortly.</span>")
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
GrayCloak()
|
||||
else
|
||||
// otherwise, pick one of the valid turfs with no web to create a web there.
|
||||
new /obj/effect/spider/terrorweb(pick(g_turfs_valid))
|
||||
new /obj/structure/spider/terrorweb(pick(g_turfs_valid))
|
||||
visible_message("<span class='notice'>[src] spins a web.</span>")
|
||||
else
|
||||
if(invisibility == SEE_INVISIBLE_LEVEL_ONE)
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
greeneggs_action.Grant(src)
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/terror_spider/green/proc/DoLayGreenEggs()
|
||||
var/obj/effect/spider/eggcluster/E = locate() in get_turf(src)
|
||||
var/obj/structure/spider/eggcluster/E = locate() in get_turf(src)
|
||||
if(E)
|
||||
to_chat(src, "<span class='notice'>There is already a cluster of eggs here!</span>")
|
||||
else if(fed < feedings_to_lay)
|
||||
|
||||
@@ -46,10 +46,10 @@
|
||||
if(T.stat != DEAD && !T.spider_placed && spider_awaymission == T.spider_awaymission)
|
||||
if(T.type == specific_type)
|
||||
numspiders += 1
|
||||
for(var/obj/effect/spider/eggcluster/terror_eggcluster/E in ts_egg_list)
|
||||
for(var/obj/structure/spider/eggcluster/terror_eggcluster/E in ts_egg_list)
|
||||
if(E.spiderling_type == specific_type && E.z == z)
|
||||
numspiders += E.spiderling_number
|
||||
for(var/obj/effect/spider/spiderling/terror_spiderling/L in ts_spiderling_list)
|
||||
for(var/obj/structure/spider/spiderling/terror_spiderling/L in ts_spiderling_list)
|
||||
if(!L.stillborn && L.grow_as == specific_type && L.z == z)
|
||||
numspiders += 1
|
||||
return numspiders
|
||||
@@ -36,7 +36,7 @@
|
||||
if(canspawn)
|
||||
canspawn = 0
|
||||
for(var/i in 0 to 30)
|
||||
var/obj/effect/spider/spiderling/terror_spiderling/S = new /obj/effect/spider/spiderling/terror_spiderling(get_turf(src))
|
||||
var/obj/structure/spider/spiderling/terror_spiderling/S = new /obj/structure/spider/spiderling/terror_spiderling(get_turf(src))
|
||||
S.grow_as = pick(/mob/living/simple_animal/hostile/poison/terror_spider/red, /mob/living/simple_animal/hostile/poison/terror_spider/gray)
|
||||
if(prob(66))
|
||||
S.stillborn = 1
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
if(3)
|
||||
if(world.time > (spider_lastspawn + spider_spawnfrequency))
|
||||
if(prob(20))
|
||||
var/obj/effect/spider/eggcluster/terror_eggcluster/N = locate() in get_turf(src)
|
||||
var/obj/structure/spider/eggcluster/terror_eggcluster/N = locate() in get_turf(src)
|
||||
if(!N)
|
||||
spider_lastspawn = world.time
|
||||
DoLayTerrorEggs(/mob/living/simple_animal/hostile/poison/terror_spider/green, 2, 0)
|
||||
@@ -161,7 +161,7 @@
|
||||
if(4)
|
||||
if(world.time > (spider_lastspawn + spider_spawnfrequency))
|
||||
if(prob(20))
|
||||
var/obj/effect/spider/eggcluster/terror_eggcluster/N = locate() in get_turf(src)
|
||||
var/obj/structure/spider/eggcluster/terror_eggcluster/N = locate() in get_turf(src)
|
||||
if(!N)
|
||||
spider_lastspawn = world.time
|
||||
DoLayTerrorEggs(/mob/living/simple_animal/hostile/poison/terror_spider/red, 2, 1)
|
||||
@@ -169,7 +169,7 @@
|
||||
if(5)
|
||||
if(world.time > (spider_lastspawn + spider_spawnfrequency))
|
||||
if(prob(20))
|
||||
var/obj/effect/spider/eggcluster/terror_eggcluster/N = locate() in get_turf(src)
|
||||
var/obj/structure/spider/eggcluster/terror_eggcluster/N = locate() in get_turf(src)
|
||||
if(!N)
|
||||
if(!spider_awaymission)
|
||||
QueenFakeLings()
|
||||
@@ -331,7 +331,7 @@
|
||||
spider_can_fakelings--
|
||||
var/numlings = 15
|
||||
for(var/i in 1 to numlings)
|
||||
var/obj/effect/spider/spiderling/terror_spiderling/S = new /obj/effect/spider/spiderling/terror_spiderling(get_turf(src))
|
||||
var/obj/structure/spider/spiderling/terror_spiderling/S = new /obj/structure/spider/spiderling/terror_spiderling(get_turf(src))
|
||||
S.grow_as = /mob/living/simple_animal/hostile/poison/terror_spider/red
|
||||
S.stillborn = 1
|
||||
S.name = "Evil-Looking Spiderling"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// ----------------- TERROR SPIDERS: SPIDERLINGS (USED BY GREEN, WHITE, QUEEN AND MOTHER TYPES)
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
/obj/effect/spider/spiderling/terror_spiderling
|
||||
/obj/structure/spider/spiderling/terror_spiderling
|
||||
name = "spiderling"
|
||||
desc = "A fast-moving tiny spider, prone to making aggressive hissing sounds. Hope it doesn't grow up."
|
||||
icon_state = "spiderling"
|
||||
@@ -17,15 +17,15 @@
|
||||
var/list/enemies = list()
|
||||
var/immediate_ventcrawl = 0
|
||||
|
||||
/obj/effect/spider/spiderling/terror_spiderling/New()
|
||||
/obj/structure/spider/spiderling/terror_spiderling/New()
|
||||
..()
|
||||
ts_spiderling_list += src
|
||||
|
||||
/obj/effect/spider/spiderling/terror_spiderling/Destroy()
|
||||
/obj/structure/spider/spiderling/terror_spiderling/Destroy()
|
||||
ts_spiderling_list -= src
|
||||
return ..()
|
||||
|
||||
/obj/effect/spider/spiderling/terror_spiderling/Bump(atom/A)
|
||||
/obj/structure/spider/spiderling/terror_spiderling/Bump(atom/A)
|
||||
if(istype(A, /obj/structure/table))
|
||||
forceMove(A.loc)
|
||||
else if(istype(A, /obj/machinery/recharge_station))
|
||||
@@ -33,7 +33,7 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/effect/spider/spiderling/terror_spiderling/process()
|
||||
/obj/structure/spider/spiderling/terror_spiderling/process()
|
||||
if(travelling_in_vent)
|
||||
if(isturf(loc))
|
||||
travelling_in_vent = 0
|
||||
@@ -104,7 +104,7 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/terror_spider/proc/DoLayTerrorEggs(lay_type, lay_number, lay_crawl)
|
||||
stop_automated_movement = 1
|
||||
var/obj/effect/spider/eggcluster/terror_eggcluster/C = new /obj/effect/spider/eggcluster/terror_eggcluster(get_turf(src))
|
||||
var/obj/structure/spider/eggcluster/terror_eggcluster/C = new /obj/structure/spider/eggcluster/terror_eggcluster(get_turf(src))
|
||||
C.spiderling_type = lay_type
|
||||
C.spiderling_number = lay_number
|
||||
C.spiderling_ventcrawl = lay_crawl
|
||||
@@ -118,7 +118,7 @@
|
||||
spawn(10)
|
||||
stop_automated_movement = 0
|
||||
|
||||
/obj/effect/spider/eggcluster/terror_eggcluster
|
||||
/obj/structure/spider/eggcluster/terror_eggcluster
|
||||
name = "terror egg cluster"
|
||||
desc = "A cluster of tiny spider eggs. They pulse with a strong inner life, and appear to have sharp thorns on the sides."
|
||||
icon_state = "eggs"
|
||||
@@ -130,7 +130,7 @@
|
||||
var/spiderling_ventcrawl = 1
|
||||
var/list/enemies = list()
|
||||
|
||||
/obj/effect/spider/eggcluster/terror_eggcluster/New()
|
||||
/obj/structure/spider/eggcluster/terror_eggcluster/New()
|
||||
..()
|
||||
ts_egg_list += src
|
||||
spawn(50)
|
||||
@@ -153,16 +153,16 @@
|
||||
else if(spiderling_type == /mob/living/simple_animal/hostile/poison/terror_spider/queen)
|
||||
name = "queen of terror eggs"
|
||||
|
||||
/obj/effect/spider/eggcluster/terror_eggcluster/Destroy()
|
||||
/obj/structure/spider/eggcluster/terror_eggcluster/Destroy()
|
||||
ts_egg_list -= src
|
||||
return ..()
|
||||
|
||||
/obj/effect/spider/eggcluster/terror_eggcluster/process()
|
||||
/obj/structure/spider/eggcluster/terror_eggcluster/process()
|
||||
amount_grown += rand(0,2)
|
||||
if(amount_grown >= 100)
|
||||
var/num = spiderling_number
|
||||
for(var/i=0, i<num, i++)
|
||||
var/obj/effect/spider/spiderling/terror_spiderling/S = new /obj/effect/spider/spiderling/terror_spiderling(get_turf(src))
|
||||
var/obj/structure/spider/spiderling/terror_spiderling/S = new /obj/structure/spider/spiderling/terror_spiderling(get_turf(src))
|
||||
if(spiderling_type)
|
||||
S.grow_as = spiderling_type
|
||||
S.use_vents = spiderling_ventcrawl
|
||||
@@ -174,7 +174,7 @@
|
||||
S.amount_grown = 250
|
||||
var/rnum = 5 - spiderling_number
|
||||
for(var/i=0, i<rnum, i++)
|
||||
var/obj/effect/spider/spiderling/terror_spiderling/S = new /obj/effect/spider/spiderling/terror_spiderling(get_turf(src))
|
||||
var/obj/structure/spider/spiderling/terror_spiderling/S = new /obj/structure/spider/spiderling/terror_spiderling(get_turf(src))
|
||||
S.stillborn = 1
|
||||
// every set of eggs always spawn 5 spiderlings, but most are decoys
|
||||
qdel(src)
|
||||
@@ -136,9 +136,9 @@
|
||||
break
|
||||
else if(ai_spins_webs && world.time > (last_spins_webs + freq_spins_webs))
|
||||
last_spins_webs = world.time
|
||||
var/obj/effect/spider/terrorweb/T = locate() in get_turf(src)
|
||||
var/obj/structure/spider/terrorweb/T = locate() in get_turf(src)
|
||||
if(!T)
|
||||
var/obj/effect/spider/terrorweb/W = new /obj/effect/spider/terrorweb(loc)
|
||||
var/obj/structure/spider/terrorweb/W = new /obj/structure/spider/terrorweb(loc)
|
||||
if(web_infects)
|
||||
W.infectious = 1
|
||||
W.name = "sharp terror web"
|
||||
@@ -275,7 +275,7 @@
|
||||
var/list/potentials = list()
|
||||
for(var/turf/simulated/T in oview(3,get_turf(src)))
|
||||
if(T.density == 0 && get_dist(get_turf(src),T) == 3)
|
||||
var/obj/effect/spider/terrorweb/W = locate() in T
|
||||
var/obj/structure/spider/terrorweb/W = locate() in T
|
||||
if(!W)
|
||||
var/obj/structure/grille/G = locate() in T
|
||||
if(!G)
|
||||
@@ -288,7 +288,7 @@
|
||||
var/list/webbed = list()
|
||||
for(var/turf/simulated/T in oview(3,get_turf(src)))
|
||||
if(T.density == 0 && get_dist(get_turf(src),T) == 3)
|
||||
var/obj/effect/spider/terrorweb/W = locate() in T
|
||||
var/obj/structure/spider/terrorweb/W = locate() in T
|
||||
if(W)
|
||||
webbed += T
|
||||
return webbed
|
||||
|
||||
@@ -168,7 +168,7 @@ var/global/list/ts_spiderling_list = list()
|
||||
visible_message("<span class='notice'>[src] harmlessly nuzzles [target].</span>")
|
||||
T.CheckFaction()
|
||||
CheckFaction()
|
||||
else if(istype(target, /obj/effect/spider/cocoon))
|
||||
else if(istype(target, /obj/structure/spider/cocoon))
|
||||
to_chat(src, "Destroying our own cocoons would not help us.")
|
||||
else if(istype(target, /obj/machinery/door/firedoor))
|
||||
var/obj/machinery/door/firedoor/F = target
|
||||
|
||||
Reference in New Issue
Block a user