mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
Some cleanup of code.
This commit is contained in:
@@ -1373,3 +1373,8 @@ var/list/WALLITEMS = list(
|
|||||||
temp_col = "0[temp_col]"
|
temp_col = "0[temp_col]"
|
||||||
colour += temp_col
|
colour += temp_col
|
||||||
return colour
|
return colour
|
||||||
|
|
||||||
|
/atom/proc/get_light_and_color(var/atom/origin)
|
||||||
|
if(origin)
|
||||||
|
color = origin.color
|
||||||
|
set_light(origin.light_range, origin.light_power, origin.light_color)
|
||||||
|
|||||||
@@ -80,6 +80,10 @@
|
|||||||
pixel_y = rand(3,-3)
|
pixel_y = rand(3,-3)
|
||||||
processing_objects |= src
|
processing_objects |= src
|
||||||
|
|
||||||
|
/obj/effect/spider/eggcluster/New(var/location, var/atom/parent)
|
||||||
|
get_light_and_color(parent)
|
||||||
|
..()
|
||||||
|
|
||||||
/obj/effect/spider/eggcluster/Destroy()
|
/obj/effect/spider/eggcluster/Destroy()
|
||||||
processing_objects -= src
|
processing_objects -= src
|
||||||
if(istype(loc, /obj/item/organ/external))
|
if(istype(loc, /obj/item/organ/external))
|
||||||
@@ -97,11 +101,9 @@
|
|||||||
O = loc
|
O = loc
|
||||||
|
|
||||||
for(var/i=0, i<num, i++)
|
for(var/i=0, i<num, i++)
|
||||||
var/obj/effect/spider/spiderling/spiderling = new(src.loc)
|
var/spiderling = PoolOrNew(/obj/effect/spider/spiderling, list(src.loc, src))
|
||||||
if(O)
|
if(O)
|
||||||
O.implants += spiderling
|
O.implants += spiderling
|
||||||
spiderling.color = color
|
|
||||||
spiderling.set_light(light_range, light_power, light_color)
|
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
/obj/effect/spider/spiderling
|
/obj/effect/spider/spiderling
|
||||||
@@ -115,13 +117,20 @@
|
|||||||
var/amount_grown = -1
|
var/amount_grown = -1
|
||||||
var/obj/machinery/atmospherics/unary/vent_pump/entry_vent
|
var/obj/machinery/atmospherics/unary/vent_pump/entry_vent
|
||||||
var/travelling_in_vent = 0
|
var/travelling_in_vent = 0
|
||||||
New()
|
|
||||||
pixel_x = rand(6,-6)
|
/obj/effect/spider/spiderling/New(var/location, var/atom/parent)
|
||||||
pixel_y = rand(6,-6)
|
pixel_x = rand(6,-6)
|
||||||
processing_objects.Add(src)
|
pixel_y = rand(6,-6)
|
||||||
//50% chance to grow up
|
processing_objects |= src
|
||||||
if(prob(50))
|
//50% chance to grow up
|
||||||
amount_grown = 1
|
if(prob(50))
|
||||||
|
amount_grown = 1
|
||||||
|
get_light_and_color(parent)
|
||||||
|
..()
|
||||||
|
|
||||||
|
/obj/effect/spider/spiderling/Destroy()
|
||||||
|
processing_objects -= src
|
||||||
|
..()
|
||||||
|
|
||||||
/obj/effect/spider/spiderling/Bump(atom/user)
|
/obj/effect/spider/spiderling/Bump(atom/user)
|
||||||
if(istype(user, /obj/structure/table))
|
if(istype(user, /obj/structure/table))
|
||||||
@@ -182,7 +191,8 @@
|
|||||||
else
|
else
|
||||||
entry_vent = null
|
entry_vent = null
|
||||||
//=================
|
//=================
|
||||||
else if(isturf(loc))
|
|
||||||
|
if(isturf(loc))
|
||||||
if(prob(25))
|
if(prob(25))
|
||||||
var/list/nearby = trange(5, src) - loc
|
var/list/nearby = trange(5, src) - loc
|
||||||
if(nearby.len)
|
if(nearby.len)
|
||||||
@@ -200,9 +210,7 @@
|
|||||||
|
|
||||||
if(amount_grown >= 100)
|
if(amount_grown >= 100)
|
||||||
var/spawn_type = pick(typesof(/mob/living/simple_animal/hostile/giant_spider))
|
var/spawn_type = pick(typesof(/mob/living/simple_animal/hostile/giant_spider))
|
||||||
var/mob/spiderspawn = new spawn_type(src.loc)
|
new spawn_type(src.loc, src)
|
||||||
spiderspawn.color = color
|
|
||||||
spiderspawn.set_light(light_range, light_power, light_color)
|
|
||||||
qdel(src)
|
qdel(src)
|
||||||
else if(isorgan(loc))
|
else if(isorgan(loc))
|
||||||
if(!amount_grown) amount_grown = 1
|
if(!amount_grown) amount_grown = 1
|
||||||
|
|||||||
@@ -63,6 +63,10 @@
|
|||||||
poison_per_bite = 5
|
poison_per_bite = 5
|
||||||
move_to_delay = 4
|
move_to_delay = 4
|
||||||
|
|
||||||
|
/mob/living/simple_animal/hostile/giant_spider/New(var/location, var/atom/parent)
|
||||||
|
get_light_and_color(parent)
|
||||||
|
..()
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/giant_spider/AttackingTarget()
|
/mob/living/simple_animal/hostile/giant_spider/AttackingTarget()
|
||||||
var/target = ..()
|
var/target = ..()
|
||||||
if(isliving(target))
|
if(isliving(target))
|
||||||
@@ -80,9 +84,7 @@
|
|||||||
if(prob(poison_per_bite))
|
if(prob(poison_per_bite))
|
||||||
var/obj/item/organ/external/O = pick(H.organs)
|
var/obj/item/organ/external/O = pick(H.organs)
|
||||||
if(!(O.status & ORGAN_ROBOT))
|
if(!(O.status & ORGAN_ROBOT))
|
||||||
var/obj/effect/spider/eggcluster/eggs = new(O)
|
var/eggs = PoolOrNew(/obj/effect/spider/eggcluster/, list(O, src))
|
||||||
eggs.color = color
|
|
||||||
eggs.set_light(light_range, light_power, light_color)
|
|
||||||
O.implants += eggs
|
O.implants += eggs
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/giant_spider/Life()
|
/mob/living/simple_animal/hostile/giant_spider/Life()
|
||||||
@@ -129,7 +131,7 @@
|
|||||||
var/obj/effect/spider/stickyweb/W = locate() in get_turf(src)
|
var/obj/effect/spider/stickyweb/W = locate() in get_turf(src)
|
||||||
if(!W)
|
if(!W)
|
||||||
busy = SPINNING_WEB
|
busy = SPINNING_WEB
|
||||||
src.visible_message("\blue \the [src] begins to secrete a sticky substance.")
|
src.visible_message("<span class='notice'>\The [src] begins to secrete a sticky substance.</span>")
|
||||||
stop_automated_movement = 1
|
stop_automated_movement = 1
|
||||||
spawn(40)
|
spawn(40)
|
||||||
if(busy == SPINNING_WEB)
|
if(busy == SPINNING_WEB)
|
||||||
@@ -141,15 +143,13 @@
|
|||||||
var/obj/effect/spider/eggcluster/E = locate() in get_turf(src)
|
var/obj/effect/spider/eggcluster/E = locate() in get_turf(src)
|
||||||
if(!E && fed > 0)
|
if(!E && fed > 0)
|
||||||
busy = LAYING_EGGS
|
busy = LAYING_EGGS
|
||||||
src.visible_message("\blue \the [src] begins to lay a cluster of eggs.")
|
src.visible_message("<span class='notice'>\The [src] begins to lay a cluster of eggs.</span>")
|
||||||
stop_automated_movement = 1
|
stop_automated_movement = 1
|
||||||
spawn(50)
|
spawn(50)
|
||||||
if(busy == LAYING_EGGS)
|
if(busy == LAYING_EGGS)
|
||||||
E = locate() in get_turf(src)
|
E = locate() in get_turf(src)
|
||||||
if(!E)
|
if(!E)
|
||||||
var/obj/effect/spider/eggcluster/eggs = new(src.loc)
|
PoolOrNew(/obj/effect/spider/eggcluster, list(loc, src))
|
||||||
eggs.color = color
|
|
||||||
eggs.set_light(light_range, light_power, light_color)
|
|
||||||
fed--
|
fed--
|
||||||
busy = 0
|
busy = 0
|
||||||
stop_automated_movement = 0
|
stop_automated_movement = 0
|
||||||
@@ -171,7 +171,7 @@
|
|||||||
else if(busy == MOVING_TO_TARGET && cocoon_target)
|
else if(busy == MOVING_TO_TARGET && cocoon_target)
|
||||||
if(get_dist(src, cocoon_target) <= 1)
|
if(get_dist(src, cocoon_target) <= 1)
|
||||||
busy = SPINNING_COCOON
|
busy = SPINNING_COCOON
|
||||||
src.visible_message("\blue \the [src] begins to secrete a sticky substance around \the [cocoon_target].")
|
src.visible_message("<span class='notice'>\The [src] begins to secrete a sticky substance around \the [cocoon_target].</span>")
|
||||||
stop_automated_movement = 1
|
stop_automated_movement = 1
|
||||||
walk(src,0)
|
walk(src,0)
|
||||||
spawn(50)
|
spawn(50)
|
||||||
@@ -186,7 +186,7 @@
|
|||||||
continue
|
continue
|
||||||
large_cocoon = 1
|
large_cocoon = 1
|
||||||
fed++
|
fed++
|
||||||
src.visible_message("\red \the [src] sticks a proboscis into \the [cocoon_target] and sucks a viscous substance out.")
|
src.visible_message("<span class='warning'>\The [src] sticks a proboscis into \the [cocoon_target] and sucks a viscous substance out.</span>")
|
||||||
M.loc = C
|
M.loc = C
|
||||||
C.pixel_x = M.pixel_x
|
C.pixel_x = M.pixel_x
|
||||||
C.pixel_y = M.pixel_y
|
C.pixel_y = M.pixel_y
|
||||||
|
|||||||
Reference in New Issue
Block a user