Singularity Refactor

This commit is contained in:
Fox-McCloud
2015-06-10 20:04:28 -04:00
parent 276c218b8e
commit 2ad1c74457
49 changed files with 553 additions and 429 deletions
@@ -346,7 +346,7 @@ field_generator power level display
//I want to avoid using global variables.
spawn(1)
var/temp = 1 //stops spam
for(var/obj/machinery/singularity/O in machines)
for(var/obj/singularity/O in machines)
if(O.last_warning && temp)
if((world.time - O.last_warning) > 50) //to stop message-spam
temp = 0
+1 -1
View File
@@ -26,7 +26,7 @@
message_admins("[admin_message] at [x],[y],[z]",1)
investigate_log("[admin_message] at [x],[y],[z]","singulo")
new /obj/machinery/singularity/(T, 50)
new /obj/singularity/(T, 50)
if(src) del(src)
/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user, params)
+159
View File
@@ -0,0 +1,159 @@
/obj/singularity/narsie //Moving narsie to a child object of the singularity so it can be made to function differently. --NEO
name = "Nar-sie's Avatar"
desc = "Your mind begins to bubble and ooze as it tries to comprehend what it sees."
icon = 'icons/obj/magic_terror.dmi'
pixel_x = -89
pixel_y = -85
current_size = 9 //It moves/eats like a max-size singulo, aside from range. --NEO
contained = 0 //Are we going to move around?
dissipate = 0 //Do we lose energy over time?
move_self = 1 //Do we move on our own?
grav_pull = 5 //How many tiles out do we pull?
consume_range = 6 //How many tiles out do we eat
/obj/singularity/narsie/large
name = "Nar-Sie"
icon = 'icons/obj/narsie.dmi'
// Pixel stuff centers Narsie.
pixel_x = -236
pixel_y = -256
current_size = 12
move_self = 1 //Do we move on our own?
grav_pull = 10
consume_range = 12 //How many tiles out do we eat
/obj/singularity/narsie/large/New()
..()
world << "<font size='15' color='red'><b>NAR-SIE HAS RISEN</b></font>"
world << pick(sound('sound/hallucinations/im_here1.ogg'), sound('sound/hallucinations/im_here2.ogg'))
var/area/A = get_area(src)
if(A)
notify_ghosts("Nar-Sie has risen in \the [A.name]. Reach out to the Geometer to be given a new shell for your soul.")
narsie_spawn_animation()
sleep(70)
if(emergency_shuttle && emergency_shuttle.can_call())
emergency_shuttle.call_evac()
emergency_shuttle.launch_time = 0 // Cannot recall
/obj/singularity/narsie/large/attack_ghost(mob/dead/observer/user as mob)
if(!(src in view()))
user << "Your soul is too far away."
return
makeNewConstruct(/mob/living/simple_animal/construct/harvester, user, null, 1)
new /obj/effect/effect/sleep_smoke(user.loc)
/obj/singularity/narsie/process()
eat()
if(!target || prob(5))
pickcultist()
move()
if(prob(25))
mezzer()
/obj/singularity/narsie/Bump(atom/A)//you dare stand before a god?!
godsmack(A)
return
/obj/singularity/narsie/Bumped(atom/A)
godsmack(A)
return
/obj/singularity/narsie/proc/godsmack(var/atom/A)
if(istype(A,/obj/))
var/obj/O = A
O.ex_act(1.0)
if(O) qdel(O)
else if(isturf(A))
var/turf/T = A
T.ChangeTurf(/turf/simulated/floor/engine/cult)
/obj/singularity/narsie/mezzer()
for(var/mob/living/carbon/M in oviewers(8, src))
if(M.stat == CONSCIOUS)
if(!iscultist(M))
M << "<span class='warning'>You feel your sanity crumble away in an instant as you gaze upon [src.name]...</span>"
M.apply_effect(3, STUN)
/obj/singularity/narsie/consume(var/atom/A)
A.narsie_act()
/obj/singularity/narsie/ex_act() //No throwing bombs at it either. --NEO
return
/obj/singularity/narsie/proc/pickcultist() //Narsie rewards his cultists with being devoured first, then picks a ghost to follow. --NEO
var/list/cultists = list()
var/list/noncultists = list()
for(var/mob/living/carbon/food in living_mob_list) //we don't care about constructs or cult-Ians or whatever. cult-monkeys are fair game i guess
var/turf/pos = get_turf(food)
if(pos.z != src.z)
continue
if(iscultist(food))
cultists += food
else
noncultists += food
if(cultists.len) //cultists get higher priority
acquire(pick(cultists))
return
if(noncultists.len)
acquire(pick(noncultists))
return
//no living humans, follow a ghost instead.
for(var/mob/dead/observer/ghost in player_list)
if(!ghost.client)
continue
var/turf/pos = get_turf(ghost)
if(pos.z != src.z)
continue
cultists += ghost
if(cultists.len)
acquire(pick(cultists))
return
/obj/singularity/narsie/proc/acquire(var/mob/food)
target << "<span class='notice'>NAR-SIE HAS LOST INTEREST IN YOU</span>"
target = food
if(ishuman(target))
target << "<span class ='userdanger'>NAR-SIE HUNGERS FOR YOUR SOUL</span>"
else
target << "<span class ='userdanger'>NAR-SIE HAS CHOSEN YOU TO LEAD HIM TO HIS NEXT MEAL</span>"
//Wizard narsie
/obj/singularity/narsie/wizard
grav_pull = 0
/obj/singularity/narsie/wizard/eat()
set background = BACKGROUND_ENABLED
// if(defer_powernet_rebuild != 2)
// defer_powernet_rebuild = 1
for(var/atom/X in orange(consume_range,src))
if(isturf(X) || istype(X, /atom/movable))
consume(X)
// if(defer_powernet_rebuild != 2)
// defer_powernet_rebuild = 0
return
/obj/singularity/narsie/proc/narsie_spawn_animation()
icon = 'icons/obj/narsie_spawn_anim.dmi'
dir = SOUTH
move_self = 0
flick("narsie_spawn_anim",src)
sleep(11)
move_self = 1
icon = initial(icon)
@@ -41,7 +41,7 @@
if (A)
if(ismob(A))
toxmob(A)
if((istype(A,/obj/machinery/the_singularitygen))||(istype(A,/obj/machinery/singularity/)))
if((istype(A,/obj/machinery/the_singularitygen))||(istype(A,/obj/singularity/)))
A:energy += energy
/*
else if( istype(A,/obj/effect/rust_particle_catcher) )
+99 -372
View File
@@ -1,27 +1,15 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
// Added spess ghoasts/cameras to this so they don't add to the lag. - N3X
var/global/narsie_cometh = 0
var/global/list/uneatable = list(
/turf/space,
/obj/effect/overlay,
/atom/movable/lighting_overlay,
/mob/dead,
/mob/camera,
/mob/new_player
)
/obj/machinery/singularity/
name = "Gravitational Singularity"
desc = "A Gravitational Singularity."
/obj/singularity
name = "gravitational singularity"
desc = "A gravitational singularity."
icon = 'icons/obj/singularity.dmi'
icon_state = "singularity_s1"
anchored = 1
density = 1
layer = 6
light_range = 6
luminosity = 6
unacidable = 1 //Don't comment this out.
use_power = 0
var/current_size = 1
var/allowed_size = 1
var/contained = 1 //Are we going to move around?
@@ -36,86 +24,95 @@ var/global/list/uneatable = list(
var/event_chance = 15 //Prob for event each tick
var/target = null //its target. moves towards the target if it has one
var/last_failed_movement = 0//Will not move in the same dir if it couldnt before, will help with the getting stuck on fields thing
var/teleport_del = 0
var/last_warning
/obj/machinery/singularity/New(loc, var/starting_energy = 50, var/temp = 0)
/obj/singularity/New(loc, var/starting_energy = 50, var/temp = 0)
//CARN: admin-alert for chuckle-fuckery.
admin_investigate_setup()
src.energy = starting_energy
if(temp)
spawn(temp)
del(src)
..()
for(var/obj/machinery/singularity_beacon/singubeacon in machines)
processing_objects.Add(src)
for(var/obj/machinery/singularity_beacon/singubeacon in world)
if(singubeacon.active)
target = singubeacon
break
return
/obj/singularity/Destroy()
processing_objects.Remove(src)
..()
/obj/machinery/singularity/attack_hand(mob/user as mob)
/obj/singularity/Move(atom/newloc, direct)
if(current_size >= STAGE_FIVE || check_turfs_in(direct))
last_failed_movement = 0//Reset this because we moved
return ..()
else
last_failed_movement = direct
return 0
/obj/singularity/attack_hand(mob/user as mob)
consume(user)
return 1
/obj/machinery/singularity/blob_act(severity)
/obj/singularity/blob_act(severity)
return
/obj/machinery/singularity/ex_act(severity)
/obj/singularity/ex_act(severity)
switch(severity)
if(1.0)
if(prob(25))
investigate_log("has been destroyed by an explosion.","singulo")
del(src)
if(current_size <= STAGE_TWO)
investigate_log("has been destroyed by a heavy explosion.","singulo")
qdel(src)
return
else
energy += 50
if(2.0 to 3.0)
energy += round((rand(20,60)/2),1)
return
energy -= round(((energy+1)/2),1)
if(2.0)
energy -= round(((energy+1)/3),1)
if(3.0)
energy -= round(((energy+1)/4),1)
return
/obj/machinery/singularity/bullet_act(obj/item/projectile/P)
/obj/singularity/bullet_act(obj/item/projectile/P)
return 0 //Will there be an impact? Who knows. Will we see it? No.
/obj/machinery/singularity/Bump(atom/A)
/obj/singularity/Bump(atom/A)
consume(A)
return
/obj/machinery/singularity/Bumped(atom/A)
/obj/singularity/Bumped(atom/A)
consume(A)
return
/obj/machinery/singularity/process()
eat()
dissipate()
check_energy()
if(current_size >= 3)
/obj/singularity/process()
if(current_size >= STAGE_TWO)
move()
pulse()
if(prob(event_chance))//Chance for it to run a special event TODO:Come up with one or two more that fit
event()
eat()
dissipate()
check_energy()
return
/obj/machinery/singularity/attack_ai() //to prevent ais from gibbing themselves when they click on one.
/obj/singularity/attack_ai() //to prevent ais from gibbing themselves when they click on one.
return
/obj/machinery/singularity/proc/admin_investigate_setup()
/obj/singularity/proc/admin_investigate_setup()
last_warning = world.time
var/count = locate(/obj/machinery/containment_field) in orange(30, src)
if(!count) message_admins("A singulo has been created without containment fields active ([x],[y],[z])",1)
investigate_log("was created. [count?"":"<font color='red'>No containment fields were active</font>"]","singulo")
/obj/machinery/singularity/proc/dissipate()
/obj/singularity/proc/dissipate()
if(!dissipate)
return
if(dissipate_track >= dissipate_delay)
@@ -125,13 +122,13 @@ var/global/list/uneatable = list(
dissipate_track++
/obj/machinery/singularity/proc/expand(var/force_size = 0)
/obj/singularity/proc/expand(var/force_size = 0)
var/temp_allowed_size = src.allowed_size
if(force_size)
temp_allowed_size = force_size
switch(temp_allowed_size)
if(1)
current_size = 1
if(STAGE_ONE)
current_size = STAGE_ONE
icon = 'icons/obj/singularity.dmi'
icon_state = "singularity_s1"
pixel_x = 0
@@ -141,8 +138,8 @@ var/global/list/uneatable = list(
dissipate_delay = 10
dissipate_track = 0
dissipate_strength = 1
if(3)//1 to 3 does not check for the turfs if you put the gens right next to a 1x1 then its going to eat them
current_size = 3
if(STAGE_TWO)//1 to 3 does not check for the turfs if you put the gens right next to a 1x1 then its going to eat them
current_size = STAGE_TWO
icon = 'icons/effects/96x96.dmi'
icon_state = "singularity_s3"
pixel_x = -32
@@ -152,9 +149,9 @@ var/global/list/uneatable = list(
dissipate_delay = 5
dissipate_track = 0
dissipate_strength = 5
if(5)
if(STAGE_THREE)
if((check_turfs_in(1,2))&&(check_turfs_in(2,2))&&(check_turfs_in(4,2))&&(check_turfs_in(8,2)))
current_size = 5
current_size = STAGE_THREE
icon = 'icons/effects/160x160.dmi'
icon_state = "singularity_s5"
pixel_x = -64
@@ -164,9 +161,9 @@ var/global/list/uneatable = list(
dissipate_delay = 4
dissipate_track = 0
dissipate_strength = 20
if(7)
if(STAGE_FOUR)
if((check_turfs_in(1,3))&&(check_turfs_in(2,3))&&(check_turfs_in(4,3))&&(check_turfs_in(8,3)))
current_size = 7
current_size = STAGE_FOUR
icon = 'icons/effects/224x224.dmi'
icon_state = "singularity_s7"
pixel_x = -96
@@ -176,8 +173,8 @@ var/global/list/uneatable = list(
dissipate_delay = 10
dissipate_track = 0
dissipate_strength = 10
if(9)//this one also lacks a check for gens because it eats everything
current_size = 9
if(STAGE_FIVE)//this one also lacks a check for gens because it eats everything
current_size = STAGE_FIVE
icon = 'icons/effects/288x288.dmi'
icon_state = "singularity_s9"
pixel_x = -128
@@ -194,134 +191,46 @@ var/global/list/uneatable = list(
return 0
/obj/machinery/singularity/proc/check_energy()
/obj/singularity/proc/check_energy()
if(energy <= 0)
investigate_log("collapsed.","singulo")
del(src)
qdel(src)
return 0
switch(energy)//Some of these numbers might need to be changed up later -Mport
if(1 to 199)
allowed_size = 1
allowed_size = STAGE_ONE
if(200 to 499)
allowed_size = 3
allowed_size = STAGE_TWO
if(500 to 999)
allowed_size = 5
allowed_size = STAGE_THREE
if(1000 to 1999)
allowed_size = 7
allowed_size = STAGE_FOUR
if(2000 to INFINITY)
allowed_size = 9
allowed_size = STAGE_FIVE
if(current_size != allowed_size)
expand()
return 1
/obj/machinery/singularity/proc/eat()
//set background = 1
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 1
// Let's just make this one loop.
/obj/singularity/proc/eat()
set background = BACKGROUND_ENABLED
for(var/atom/X in orange(grav_pull,src))
// N3X: Move this up here since get_dist is slow.
if(is_type_in_list(X, uneatable)) continue
if(!X.simulated) continue
var/dist = get_dist(X, src)
// Movable atoms only
if(dist > consume_range && istype(X, /atom/movable))
if(canPull(X))
step_towards(X,src)
/*
if((X &&!X:anchored && !istype(X,/mob/living/carbon/human))|| (src.current_size >= 9))
step_towards(X,src)
else if(istype(X,/mob/living/carbon/human))
var/mob/living/carbon/human/H = X
if(istype(H.shoes,/obj/item/clothing/shoes/magboots))
var/obj/item/clothing/shoes/magboots/M = H.shoes
if(M.magpulse)
continue
step_towards(H,src)
*/
// Turf and movable atoms
else if(dist <= consume_range && (isturf(X) || istype(X, /atom/movable)))
var/obj/singularity/S = src
if(dist > consume_range)
X.singularity_pull(S, current_size)
else if(dist <= consume_range)
consume(X)
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 0
return
// Singulo optimization:
// Jump out whenever we've made a decision.
/obj/machinery/singularity/proc/canPull(var/atom/movable/A)
// If we're big enough, stop checking for this and that and JUST EAT.
if(current_size >= 9)
return 1
else
if(A && !A:anchored)
if(A.canSingulothPull(src))
return 1
return 0
/obj/machinery/singularity/proc/consume(var/atom/A)
var/gain = 0
if(is_type_in_list(A, uneatable))
return 0
if(!A.simulated)
return 0
if (istype(A,/mob/living))//Mobs get gibbed
var/mob/living/M = A
gain = 20
if(istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if(H.mind)
switch(H.mind.assigned_role)
if("Station Engineer","Chief Engineer")
gain = 100
if("Clown")
gain = rand(-300, 300) // HONK
M.gib()
// Why
sleep(1)
else if(istype(A,/obj/))
if (istype(A,/obj/item/weapon/storage/backpack/holding))
var/dist = max((current_size - 2),1)
explosion(src.loc,(dist),(dist*2),(dist*4))
return
if(istype(A, /obj/machinery/singularity))//Welp now you did it
var/obj/machinery/singularity/S = A
src.energy += (S.energy/2)//Absorb most of it
del(S)
var/dist = max((current_size - 2),1)
explosion(src.loc,(dist),(dist*2),(dist*4))
return//Quits here, the obj should be gone, hell we might be
if((teleport_del) && (!istype(A, /obj/machinery)))//Going to see if it does not lag less to tele items over to Z 2
qdel(A)
else
A.ex_act(1.0)
if(A)
qdel(A)
gain = 2
else if(isturf(A))
var/turf/T = A
if(istype(T,/turf/simulated/wall))
var/turf/simulated/wall/W = T
W.del_suppress_resmoothing=1 // Reduce lag from wallsmoothing.
if(T.intact)
for(var/obj/O in T.contents)
if(O.level != 1)
continue
if(O.invisibility == 101)
src.consume(O)
T.ChangeTurf(/turf/space)
gain = 2
/obj/singularity/proc/consume(var/atom/A)
var/gain = A.singularity_act(current_size)
src.energy += gain
return
/obj/machinery/singularity/proc/move(var/force_move = 0)
/obj/singularity/proc/move(var/force_move = 0)
if(!move_self)
return 0
@@ -333,37 +242,24 @@ var/global/list/uneatable = list(
if(target && prob(60))
movement_dir = get_dir(src,target) //moves to a singulo beacon, if there is one
if(current_size >= 9)//The superlarge one does not care about things in its way
spawn(0)
step(src, movement_dir)
spawn(1)
step(src, movement_dir)
return 1
else if(check_turfs_in(movement_dir))
last_failed_movement = 0//Reset this because we moved
spawn(0)
step(src, movement_dir)
return 1
else
last_failed_movement = movement_dir
return 0
step(src, movement_dir)
/obj/machinery/singularity/proc/check_turfs_in(var/direction = 0, var/step = 0)
/obj/singularity/proc/check_turfs_in(var/direction = 0, var/step = 0)
if(!direction)
return 0
var/steps = 0
if(!step)
switch(current_size)
if(1)
if(STAGE_ONE)
steps = 1
if(3)
if(STAGE_TWO)
steps = 3//Yes this is right
if(5)
if(STAGE_THREE)
steps = 3
if(7)
if(STAGE_FOUR)
steps = 4
if(9)
if(STAGE_FIVE)
steps = 5
else
steps = step
@@ -384,12 +280,12 @@ var/global/list/uneatable = list(
dir2 = 1
dir3 = 2
var/turf/T2 = T
for(var/j = 1 to steps)
for(var/j = 1 to steps-1)
T2 = get_step(T2,dir2)
if(!isturf(T2))
return 0
turfs.Add(T2)
for(var/k = 1 to steps)
for(var/k = 1 to steps-1)
T = get_step(T,dir3)
if(!isturf(T))
return 0
@@ -402,7 +298,7 @@ var/global/list/uneatable = list(
return 1
/obj/machinery/singularity/proc/can_move(var/turf/T)
/obj/singularity/proc/can_move(var/turf/T)
if(!T)
return 0
if((locate(/obj/machinery/containment_field) in T)||(locate(/obj/machinery/shieldwall) in T))
@@ -418,7 +314,7 @@ var/global/list/uneatable = list(
return 1
/obj/machinery/singularity/proc/event()
/obj/singularity/proc/event()
var/numb = pick(1,2,3,4,5,6)
switch(numb)
if(1)//EMP
@@ -432,7 +328,7 @@ var/global/list/uneatable = list(
return 1
/obj/machinery/singularity/proc/toxmob()
/obj/singularity/proc/toxmob()
var/toxrange = 10
var/toxdamage = 4
var/radiation = 15
@@ -448,7 +344,7 @@ var/global/list/uneatable = list(
return
/obj/machinery/singularity/proc/mezzer()
/obj/singularity/proc/mezzer()
for(var/mob/living/carbon/M in oviewers(8, src))
if(istype(M, /mob/living/carbon/brain)) //Ignore brains
continue
@@ -456,202 +352,33 @@ var/global/list/uneatable = list(
if(M.stat == CONSCIOUS)
if (istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if(istype(H.glasses,/obj/item/clothing/glasses/meson))
H << "\blue You look directly into The [src.name], good thing you had your protective eyewear on!"
return
M << "\red You look directly into The [src.name] and feel weak."
if(istype(H.glasses, /obj/item/clothing/glasses/meson))
var/obj/item/clothing/glasses/meson/MS = H.glasses
if(MS.vision_flags == SEE_TURFS)
H << "<span class='notice'>You look directly into the [src.name], good thing you had your protective eyewear on!</span>"
return
M.apply_effect(3, STUN)
for(var/mob/O in viewers(M, null))
O.show_message(text("\red <B>[] stares blankly at The []!</B>", M, src), 1)
M.visible_message("<span class='danger'>[M] stares blankly at the [src.name]!</span>", \
"<span class='userdanger'>You look directly into the [src.name] and feel weak.</span>")
return
/obj/machinery/singularity/proc/emp_area()
/obj/singularity/proc/emp_area()
empulse(src, 8, 10)
return
/obj/machinery/singularity/proc/pulse()
/obj/singularity/proc/pulse()
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
if(get_dist(R, src) <= 15) // Better than using orange() every process
R.receive_pulse(energy)
return
/obj/machinery/singularity/narsie //Moving narsie to a child object of the singularity so it can be made to function differently. --NEO
gender = NEUTER
name = "Nar-sie's Avatar"
desc = "Your mind begins to bubble and ooze as it tries to comprehend what it sees."
icon = 'icons/obj/magic_terror.dmi'
pixel_x = -89
pixel_y = -85
current_size = 9 //It moves/eats like a max-size singulo, aside from range. --NEO
contained = 0 //Are we going to move around?
dissipate = 0 //Do we lose energy over time?
move_self = 1 //Do we move on our own?
grav_pull = 10 //How many tiles out do we pull?
consume_range = 3 //How many tiles out do we eat
var/last_boom = 0
/obj/machinery/singularity/narsie/large
name = "Nar-Sie"
icon = 'icons/obj/narsie.dmi'
// Pixel stuff centers Narsie.
pixel_x = -236
pixel_y = -256
current_size = 12
grav_pull = 10
consume_range = 12
/obj/machinery/singularity/narsie/large/New()
..()
world << "<font size='28' color='red'><b>NAR-SIE HAS RISEN</b></font>"
spawn_animation()
if(emergency_shuttle && emergency_shuttle.can_call())
emergency_shuttle.call_evac()
emergency_shuttle.launch_time = 0 // Cannot recall
narsie_cometh = 1
/obj/machinery/singularity/narsie/proc/spawn_animation()
icon = 'icons/obj/narsie_spawn_anim.dmi'
src.dir = SOUTH
move_self = 0
flick("narsie_spawn_anim", src)
sleep(11) //0.5 longer than the animation.
move_self = 1
icon = initial(icon)
/obj/machinery/singularity/narsie/process()
eat()
if(!target || prob(5))
pickcultist()
move()
if(prob(25))
mezzer()
/obj/machinery/singularity/narsie/Bump(atom/A)//you dare stand before a god?!
godsmack(A)
return
/obj/machinery/singularity/narsie/Bumped(atom/A)
godsmack(A)
return
/obj/machinery/singularity/narsie/proc/godsmack(var/atom/A)
if(istype(A,/obj/))
var/obj/O = A
O.ex_act(1.0)
if(O) qdel(O)
else if(isturf(A))
var/turf/T = A
T.ChangeTurf(/turf/simulated/floor/engine/cult)
/obj/machinery/singularity/narsie/mezzer()
for(var/mob/living/carbon/M in oviewers(8, src))
if(M.stat == CONSCIOUS)
if(!iscultist(M))
M << "\red You feel your sanity crumble away in an instant as you gaze upon [src.name]..."
M.apply_effect(3, STUN)
/obj/machinery/singularity/narsie/consume(var/atom/A)
if(is_type_in_list(A, uneatable))
return 0
if(!A.simulated)
return 0
if (istype(A,/mob/living))//Mobs get gibbed
A:gib()
else if(istype(A,/obj))
var/obj/O = A
machines -= O
processing_objects -= O
qdel(O)
else if(isturf(A))
var/turf/T = A
if(istype(T,/turf/simulated/wall))
var/turf/simulated/wall/W = T
W.del_suppress_resmoothing=1 // Reduce lag from wallsmoothing.
if(T.intact)
for(var/obj/O in T.contents)
if(O.level != 1)
continue
if(O.invisibility == 101)
src.consume(O)
A:ChangeTurf(/turf/space)
if(last_boom + 100 < world.time && prob(5))
explosion(loc, -1, -1, -1, 1, 0) //Since we're not exploding everything in consume() toss out an explosion effect every now and again
last_boom = world.time
return
/obj/machinery/singularity/narsie/ex_act() //No throwing bombs at it either. --NEO
return
/obj/machinery/singularity/narsie/proc/pickcultist() //Narsie rewards it's cultists with being devoured first, then picks a ghost to follow. --NEO
var/list/cultists = list()
for(var/datum/mind/cult_nh_mind in ticker.mode.cult)
if(!cult_nh_mind.current)
continue
if(cult_nh_mind.current.stat)
continue
var/turf/pos = get_turf(cult_nh_mind.current)
if(pos.z != src.z)
continue
cultists += cult_nh_mind.current
if(cultists.len)
acquire(pick(cultists))
return
//If there was living cultists, it picks one to follow.
for(var/mob/living/carbon/human/food in living_mob_list)
if(food.stat)
continue
var/turf/pos = get_turf(food)
if(pos.z != src.z)
continue
cultists += food
if(cultists.len)
acquire(pick(cultists))
return
//no living cultists, pick a living human instead.
for(var/mob/dead/observer/ghost in player_list)
if(!ghost.client)
continue
var/turf/pos = get_turf(ghost)
if(pos.z != src.z)
continue
cultists += ghost
if(cultists.len)
acquire(pick(cultists))
return
//no living humans, follow a ghost instead.
/obj/machinery/singularity/narsie/proc/acquire(var/mob/food)
target << "\blue <b>NAR-SIE HAS LOST INTEREST IN YOU</b>"
target = food
if(ishuman(target))
target << "\red <b>NAR-SIE HUNGERS FOR YOUR SOUL</b>"
else
target << "\red <b>NAR-SIE HAS CHOSEN YOU TO LEAD THEM TO THEIR NEXT MEAL</b>"
//Wizard narsie
/obj/machinery/singularity/narsie/wizard
grav_pull = 0
/obj/machinery/singularity/narsie/wizard/eat()
//set background = 1
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 1
for(var/atom/X in orange(consume_range,src))
if(isturf(X) || istype(X, /atom/movable))
consume(X)
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 0
return
/obj/singularity/singularity_act()
var/gain = (energy/2)
var/dist = max((current_size - 2),1)
explosion(src.loc,(dist),(dist*2),(dist*4))
qdel(src)
return(gain)