Ports /vg/'s Nas-Sie remake.

Second phase:
New Nar-Sie itself.
Two endgame phase - Nar-Sie and Supermatter Cascade.
Culty mobs.
This commit is contained in:
PsiOmega
2015-04-11 23:24:00 +02:00
parent f3be9b41f0
commit 1511e2b3f4
69 changed files with 1881 additions and 369 deletions

View File

@@ -0,0 +1,138 @@
#define I_SINGULO "singulo"
/atom/proc/singularity_act()
return
/atom/proc/singularity_pull()
return
/mob/living/singularity_act()
investigate_log("has been consumed by a singularity", I_SINGULO)
gib()
return 20
/mob/living/singularity_pull(S)
step_towards(src, S)
/mob/living/carbon/human/singularity_act()
var/gain = 20
if(mind)
if((mind.assigned_role == "Station Engineer") || (mind.assigned_role == "Chief Engineer"))
gain = 100
if(mind.assigned_role == "Assistant")
gain = rand(0, 300)
investigate_log(I_SINGULO,"has been consumed by a singularity", I_SINGULO)
gib()
return gain
/mob/living/carbon/human/singularity_pull(S, current_size)
if(current_size >= STAGE_THREE)
var/list/handlist = list(l_hand, r_hand)
for(var/obj/item/hand in handlist)
if(prob(current_size*5) && hand.w_class >= ((11-current_size)/2) && u_equip(hand))
step_towards(hand, src)
src << "<span class = 'warning'>The [S] pulls \the [hand] from your grip!</span>"
apply_effect(current_size * 3, IRRADIATE)
if(shoes)
if(shoes.flags & NOSLIP) return 0
..()
/obj/singularity_act()
ex_act(1)
if(src)
spawn(0)
qdel(src)
return 2
/obj/singularity_pull(S, current_size)
if(anchored)
if(current_size >= STAGE_FIVE)
step_towards(src, S)
else
step_towards(src, S)
/obj/effect/beam/singularity_pull()
return
/obj/effect/overlay/singularity_pull()
return
/obj/item/singularity_pull(S, current_size)
spawn(0) //this is needed or multiple items will be thrown sequentially and not simultaneously
if(current_size >= STAGE_FOUR)
//throw_at(S, 14, 3)
step_towards(src,S)
sleep(1)
step_towards(src,S)
else if(current_size > STAGE_ONE)
step_towards(src,S)
else ..()
/obj/machinery/atmospherics/pipe/singularity_pull()
return
/obj/machinery/power/supermatter/shard/singularity_act()
qdel(src)
return 5000
/obj/machinery/power/supermatter/singularity_act()
var/prints = ""
if(src.fingerprintshidden)
prints = ", all touchers : " + src.fingerprintshidden
SetUniversalState(/datum/universal_state/supermatter_cascade)
log_admin("New super singularity made by eating a SM crystal [prints]. Last touched by [src.fingerprintslast].")
message_admins("New super singularity made by eating a SM crystal [prints]. Last touched by [src.fingerprintslast].")
spawn(0)
qdel(src)
return 50000
/obj/item/projectile/beam/emitter/singularity_pull()
return
/obj/item/weapon/storage/backpack/holding/singularity_act(S, current_size)
var/dist = max((current_size - 2), 1)
explosion(src.loc,(dist),(dist*2),(dist*4))
return 1000
/turf/singularity_act(S, current_size)
if(intact)
for(var/obj/O in contents)
if(O.level != 1)
continue
if(O.invisibility == 101)
O.singularity_act(src, current_size)
ChangeTurf(/turf/space)
return 2
/turf/simulated/wall/singularity_pull(S, current_size)
if(current_size >= STAGE_FIVE)
if(prob(75))
dismantle_wall()
return
if(current_size == STAGE_FOUR)
if(prob(30))
dismantle_wall()
/turf/simulated/wall/r_wall/singularity_pull(S, current_size)
if(current_size >= STAGE_FIVE)
if(prob(30))
dismantle_wall()
/turf/space/singularity_act()
return
/*******************
* Nar-Sie Act/Pull *
*******************/
/atom/proc/singuloCanEat()
return 1
/mob/dead/singuloCanEat()
return 0
/mob/eye/singuloCanEat()
return 0
/mob/new_player/singuloCanEat()
return 0

View File

@@ -1,4 +1,4 @@
/area/engineering/power_alert(var/alarming)
if (alarming)
investigate_log("has a power alarm!","singulo")
..()
..()

View File

@@ -1,90 +1,285 @@
var/global/narsie_behaviour = "CultStation13"
var/global/narsie_cometh = 0
var/global/list/narsie_list = list()
/obj/machinery/singularity/narsie //Moving narsie to a child object of the singularity so it can be made to function differently. --NEO
/obj/machinery/singularity/narsie //Moving narsie to its own file for the sake of being clearer
name = "Nar-Sie"
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?
icon = 'icons/obj/narsie.dmi'
icon_state = "narsie-small"
pixel_x = -236
pixel_y = -256
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?
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/New()
..()
narsie_list.Add(src)
/obj/machinery/singularity/narsie/Destroy()
narsie_list.Remove(src)
..()
/obj/machinery/singularity/narsie/large
name = "Nar-Sie"
icon = 'icons/obj/narsie.dmi'
icon_state = "narsie"//mobs perceive the geometer of blood through their see_narsie proc
// Pixel stuff centers Narsie.
pixel_x = -236
pixel_y = -256
luminosity = 1
l_color = "#3e0000"
current_size = 12
move_self = 1 //Do we move on our own?
consume_range = 12 //How many tiles out do we eat
consume_range = 12 // How many tiles out do we eat.
var/announce=1
var/narnar = 1
/obj/machinery/singularity/narsie/large/New()
..()
narsie_list.Add(src)
world << "<font size='28' color='red'><b>NAR-SIE HAS RISEN</b></font>"
if(announce)
world << "<font size='15' color='red'><b>[uppertext(name)] HAS RISEN</b></font>"
world << sound('sound/effects/wind/wind_5_1.ogg')
if(emergency_shuttle && emergency_shuttle.can_call())
emergency_shuttle.call_evac()
emergency_shuttle.launch_time = 0 // Cannot recall
/obj/machinery/singularity/narsie/large/Destroy()
narsie_list.Remove(src)
..()
if(narnar)
SetUniversalState(/datum/universal_state/hell)
narsie_cometh = 1
/obj/machinery/singularity/narsie/process()
eat()
if(!target || prob(5))
if (!target || prob(5))
pickcultist()
move()
if(prob(25))
if (prob(25))
mezzer()
/obj/machinery/singularity/narsie/consume(var/atom/A) //Has its own consume proc because it doesn't need energy and I don't want BoHs to explode it. --NEO
if(is_type_in_list(A, uneatable))
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
O.loc = null
else if(isturf(A))
var/turf/T = A
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/large/eat()
set background = BACKGROUND_ENABLED
/obj/machinery/singularity/narsie/ex_act() //No throwing bombs at it either. --NEO
for (var/turf/A in orange(consume_range, src))
consume(A)
/obj/machinery/singularity/narsie/mezzer()
for(var/mob/living/carbon/M in oviewers(8, src))
if(M.stat == CONSCIOUS)
if(M.status_flags & GODMODE)
continue
if(!iscultist(M))
M << "<span class='danger'> You feel your sanity crumble away in an instant as you gaze upon [src.name]...</span>"
M.apply_effect(3, STUN)
/obj/machinery/singularity/narsie/large/Bump(atom/A)
if(!narnar) return
if(isturf(A))
narsiewall(A)
else if(istype(A, /obj/structure/cult))
qdel(A)
/obj/machinery/singularity/narsie/large/Bumped(atom/A)
if(!narnar) return
if(isturf(A))
narsiewall(A)
else if(istype(A, /obj/structure/cult))
qdel(A)
/obj/machinery/singularity/narsie/move(var/force_move = 0)
if(!move_self)
return 0
var/movement_dir = pick(alldirs - last_failed_movement)
if(force_move)
movement_dir = force_move
if(target && prob(60))
movement_dir = get_dir(src,target)
spawn(0)
step(src, movement_dir)
spawn(1)
step(src, movement_dir)
return 1
/obj/machinery/singularity/narsie/large/move(var/force_move = 0)
if(!move_self)
return 0
var/movement_dir = pick(alldirs - last_failed_movement)
if(force_move)
movement_dir = force_move
if(target && prob(60))
movement_dir = get_dir(src,target)
spawn(0)
step(src, movement_dir)
narsiefloor(get_turf(loc))
for(var/mob/M in player_list)
if(M.client)
M.see_narsie(src,movement_dir)
spawn(10)
step(src, movement_dir)
narsiefloor(get_turf(loc))
for(var/mob/M in player_list)
if(M.client)
M.see_narsie(src,movement_dir)
return 1
/obj/machinery/singularity/narsie/proc/narsiefloor(var/turf/T)//leaving "footprints"
if(!(istype(T, /turf/simulated/wall/cult)||istype(T, /turf/space)))
if(T.icon_state != "cult-narsie")
T.desc = "something that goes beyond your understanding went this way"
T.icon_state = "cult-narsie"
T.luminosity = 1
/obj/machinery/singularity/narsie/proc/narsiewall(var/turf/T)
T.desc = "An opening has been made on that wall, but who can say if what you seek truly lies on the other side?"
T.icon = 'icons/turf/walls.dmi'
T.icon_state = "cult-narsie"
T.opacity = 0
T.density = 0
luminosity = 1
/obj/machinery/singularity/narsie/large/consume(const/atom/A) //Has its own consume proc because it doesn't need energy and I don't want BoHs to explode it. --NEO
//NEW BEHAVIOUR
if(narsie_behaviour == "CultStation13")
//MOB PROCESSING
new_narsie(A)
//OLD BEHAVIOUR
else if(narsie_behaviour == "Nar-Singulo")
old_narsie(A)
/obj/machinery/singularity/narsie/proc/new_narsie(const/atom/A)
if (istype(A, /mob/) && (get_dist(A, src) <= 7))
var/mob/M = A
if(M.status_flags & GODMODE)
return 0
M.cultify()
//ITEM PROCESSING
else if (istype(A, /obj/))
var/obj/O = A
O.cultify()
//TURF PROCESSING
else if (isturf(A))
var/dist = get_dist(A, src)
for (var/atom/movable/AM in A.contents)
if (dist <= consume_range)
consume(AM)
continue
if (dist <= consume_range && !istype(A, /turf/space))
var/turf/T = A
if(T.holy)
T.holy = 0 //Nar-Sie doesn't give a shit about sacred grounds.
T.cultify()
/obj/machinery/singularity/narsie/proc/old_narsie(const/atom/A)
if(!(A.singuloCanEat()))
return 0
if (istype(A, /mob/living/))
var/mob/living/C2 = A
if(C2.status_flags & GODMODE)
return 0
C2.dust() // Changed from gib(), just for less lag.
else if (istype(A, /obj/))
qdel(A)
if (A)
qdel(A)
else if (isturf(A))
var/dist = get_dist(A, src)
for (var/atom/movable/AM2 in A.contents)
if (AM2 == src) // This is the snowflake.
continue
if (dist <= consume_range)
consume(AM2)
continue
if (dist <= consume_range && !istype(A, /turf/space))
var/turf/T2 = A
T2.ChangeTurf(/turf/space)
/obj/machinery/singularity/narsie/consume(const/atom/A) //This one is for the small ones.
if(!(A.singuloCanEat()))
return 0
if (istype(A, /mob/living/))
var/mob/living/C2 = A
if(C2.status_flags & GODMODE)
return 0
C2.dust() // Changed from gib(), just for less lag.
else if (istype(A, /obj/))
qdel(A)
if (A)
qdel(A)
else if (isturf(A))
var/dist = get_dist(A, src)
for (var/atom/movable/AM2 in A.contents)
if (AM2 == src) // This is the snowflake.
continue
if (dist <= consume_range)
consume(AM2)
continue
if (dist > consume_range)
if(!(AM2.singuloCanEat()))
continue
if (101 == AM2.invisibility)
continue
spawn (0)
AM2.singularity_pull(src, src.current_size)
if (dist <= consume_range && !istype(A, /turf/space))
var/turf/T2 = A
T2.ChangeTurf(/turf/space)
/obj/machinery/singularity/narsie/ex_act(severity) //No throwing bombs at it either. --NEO
return
/obj/machinery/singularity/narsie/proc/pickcultist() //Narsie rewards his cultists with being devoured first, then picks a ghost to follow. --NEO
var/list/cultists = list()
if(cult && cult.current_antagonists.len)
for(var/datum/mind/cult_nh_mind in cult.current_antagonists)
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
for(var/datum/mind/cult_nh_mind in cult.current_antagonists)
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
@@ -112,22 +307,51 @@ var/global/list/narsie_list = list()
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>"
/obj/machinery/singularity/narsie/proc/acquire(const/mob/food)
var/capname = uppertext(name)
target << "<span class='notice'><b>[capname] HAS LOST INTEREST IN YOU.</b></span>"
target = food
if(ishuman(target))
target << "\red <b>NAR-SIE HUNGERS FOR YOUR SOUL</b>"
if (ishuman(target))
target << "<span class='danger'>[capname] HUNGERS FOR YOUR SOUL.</span>"
else
target << "\red <b>NAR-SIE HAS CHOSEN YOU TO LEAD HIM TO HIS NEXT MEAL</b>"
target << "<span class='danger'>[capname] HAS CHOSEN YOU TO LEAD HIM TO HIS NEXT MEAL.</span>"
//Wizard narsie
/obj/machinery/singularity/narsie/on_capture()
chained = 1
move_self = 0
icon_state ="narsie-small-chains"
/obj/machinery/singularity/narsie/on_release()
chained = 0
move_self = 1
icon_state ="narsie-small"
/obj/machinery/singularity/narsie/large/on_capture()
chained = 1
move_self = 0
icon_state ="narsie-chains"
for(var/mob/M in mob_list)//removing the client image of nar-sie while it is chained
if(M.client)
M.see_narsie(src)
/obj/machinery/singularity/narsie/large/on_release()
chained = 0
move_self = 1
icon_state ="narsie"
/obj/machinery/singularity/narsie/cultify()
return
/**
* Wizard narsie.
*/
/obj/machinery/singularity/narsie/wizard
grav_pull = 0
/obj/machinery/singularity/narsie/wizard/eat()
set background = 1
for(var/atom/X in orange(consume_range,src))
if(isturf(X) || istype(X, /atom/movable))
consume(X)
return
set background = BACKGROUND_ENABLED
for (var/turf/T in trange(consume_range, src))
consume(T)

View File

@@ -1,10 +1,5 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
var/global/list/uneatable = list(
/turf/space,
/obj/effect/overlay
)
/obj/machinery/singularity/
name = "gravitational singularity"
desc = "A gravitational singularity."
@@ -16,6 +11,7 @@ var/global/list/uneatable = list(
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?
@@ -26,102 +22,108 @@ var/global/list/uneatable = list(
var/dissipate_strength = 1 //How much energy do we lose?
var/move_self = 1 //Do we move on our own?
var/grav_pull = 4 //How many tiles out do we pull?
var/consume_range = 0 //How many tiles out do we eat
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/consume_range = 0 //How many tiles out do we eat.
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/last_warning
var/chained = 0//Adminbus chain-grab
/obj/machinery/singularity/New(loc, var/starting_energy = 50, var/temp = 0)
//CARN: admin-alert for chuckle-fuckery.
admin_investigate_setup()
energy = starting_energy
if (temp)
spawn (temp)
qdel(src)
src.energy = starting_energy
if(temp)
spawn(temp)
del(src)
..()
for(var/obj/machinery/power/singularity_beacon/singubeacon in machines)
if(singubeacon.active)
target = singubeacon
break
return
/obj/machinery/singularity/attack_hand(mob/user as mob)
consume(user)
return 1
/obj/machinery/singularity/blob_act(severity)
return
/obj/machinery/singularity/ex_act(severity)
if(current_size == STAGE_SUPER)//IT'S UNSTOPPABLE
return
switch(severity)
if(1.0)
if(prob(25))
del(src)
investigate_log("has been destroyed by an explosion.", I_SINGULO)
qdel(src)
return
else
energy += 50
if(2.0 to 3.0)
energy += round((rand(20,60)/2),1)
return
return
/obj/machinery/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)
consume(A)
return
/obj/machinery/singularity/Bumped(atom/A)
consume(A)
return
/obj/machinery/singularity/process()
eat()
dissipate()
check_energy()
if(current_size >= 3)
if (current_size >= STAGE_THREE)
move()
pulse()
if(prob(event_chance))//Chance for it to run a special event TODO:Come up with one or two more that fit
if (prob(event_chance)) //Chance for it to run a special event TODO: Come up with one or two more that fit.
event()
/obj/machinery/singularity/attack_ai() //To prevent ais from gibbing themselves when they click on one.
return
/obj/machinery/singularity/attack_ai() //to prevent ais from gibbing themselves when they click on one.
return
/obj/machinery/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")
if (!count)
message_admins("A singulo has been created without containment fields active ([x], [y], [z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>).")
investigate_log("was created. [count ? "" : "<font color='red'>No containment fields were active.</font>"]", I_SINGULO)
/obj/machinery/singularity/proc/dissipate()
if(!dissipate)
if (!dissipate)
return
if(dissipate_track >= dissipate_delay)
src.energy -= dissipate_strength
energy -= dissipate_strength
dissipate_track = 0
else
dissipate_track++
/obj/machinery/singularity/proc/expand(var/force_size = 0, var/growing = 1)
if(current_size == STAGE_SUPER)//if this is happening, this is an error
message_admins("expand() was called on a super singulo. This should not happen. Contact a coder immediately!")
return
var/temp_allowed_size = allowed_size
/obj/machinery/singularity/proc/expand(var/force_size = 0)
var/temp_allowed_size = src.allowed_size
if(force_size)
if (force_size)
temp_allowed_size = force_size
switch(temp_allowed_size)
if(1)
current_size = 1
switch (temp_allowed_size)
if (STAGE_ONE)
name = "gravitational singularity"
desc = "A gravitational singularity."
current_size = STAGE_ONE
icon = 'icons/obj/singularity.dmi'
icon_state = "singularity_s1"
pixel_x = 0
@@ -131,8 +133,14 @@ 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
overlays = 0
if(chained)
overlays = "chain_s1"
visible_message("<span class='notice'>The singularity has shrunk to a rather pitiful size.</span>")
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.
name = "gravitational singularity"
desc = "A gravitational singularity."
current_size = STAGE_TWO
icon = 'icons/effects/96x96.dmi'
icon_state = "singularity_s3"
pixel_x = -32
@@ -142,9 +150,18 @@ var/global/list/uneatable = list(
dissipate_delay = 5
dissipate_track = 0
dissipate_strength = 5
if(5)
if((check_turfs_in(1,2))&&(check_turfs_in(2,2))&&(check_turfs_in(4,2))&&(check_turfs_in(8,2)))
current_size = 5
overlays = 0
if(chained)
overlays = "chain_s3"
if(growing)
visible_message("<span class='notice'>The singularity noticeably grows in size.</span>")
else
visible_message("<span class='notice'>The singularity has shrunk to a less powerful size.</span>")
if (STAGE_THREE)
if ((check_turfs_in(1, 2)) && (check_turfs_in(2, 2)) && (check_turfs_in(4, 2)) && (check_turfs_in(8, 2)))
name = "gravitational singularity"
desc = "A gravitational singularity."
current_size = STAGE_THREE
icon = 'icons/effects/160x160.dmi'
icon_state = "singularity_s5"
pixel_x = -64
@@ -154,9 +171,18 @@ var/global/list/uneatable = list(
dissipate_delay = 4
dissipate_track = 0
dissipate_strength = 20
if(7)
if((check_turfs_in(1,3))&&(check_turfs_in(2,3))&&(check_turfs_in(4,3))&&(check_turfs_in(8,3)))
current_size = 7
overlays = 0
if(chained)
overlays = "chain_s5"
if(growing)
visible_message("<span class='notice'>The singularity expands to a reasonable size.</span>")
else
visible_message("<span class='notice'>The singularity has returned to a safe size.</span>")
if(STAGE_FOUR)
if ((check_turfs_in(1, 3)) && (check_turfs_in(2, 3)) && (check_turfs_in(4, 3)) && (check_turfs_in(8, 3)))
name = "gravitational singularity"
desc = "A gravitational singularity."
current_size = STAGE_FOUR
icon = 'icons/effects/224x224.dmi'
icon_state = "singularity_s7"
pixel_x = -96
@@ -166,123 +192,100 @@ 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
overlays = 0
if(chained)
overlays = "chain_s7"
if(growing)
visible_message("<span class='warning'>The singularity expands to a dangerous size.</span>")
else
visible_message("<span class='notice'>Miraculously, the singularity reduces in size, and can be contained.</span>")
if(STAGE_FIVE) //This one also lacks a check for gens because it eats everything.
name = "gravitational singularity"
desc = "A gravitational singularity."
current_size = STAGE_FIVE
icon = 'icons/effects/288x288.dmi'
icon_state = "singularity_s9"
pixel_x = -128
pixel_y = -128
grav_pull = 10
consume_range = 4
dissipate = 0 //It cant go smaller due to e loss.
overlays = 0
if(chained)
overlays = "chain_s9"
if(growing)
visible_message("<span class='danger'><font size='2'>The singularity has grown out of control!</font></span>")
else
visible_message("<span class='warning'>The singularity miraculously reduces in size and loses its supermatter properties.</span>")
if(STAGE_SUPER)//SUPERSINGULO
name = "super gravitational singularity"
desc = "A gravitational singularity with the properties of supermatter. <b>It has the power to destroy worlds.</b>"
current_size = STAGE_SUPER
icon = 'icons/effects/352x352.dmi'
icon_state = "singularity_s11"//uh, whoever drew that, you know that black holes are supposed to look dark right? What's this, the clown's singulo?
pixel_x = -160
pixel_y = -160
grav_pull = 16
consume_range = 5
dissipate = 0 //It cant go smaller due to e loss
if(current_size == allowed_size)
investigate_log("<font color='red'>grew to size [current_size]</font>","singulo")
event_chance = 25 //Events will fire off more often.
if(chained)
overlays = "chain_s9"
visible_message("<span class='sinister'><font size='3'>You witness the creation of a destructive force that cannot possibly be stopped by human hands.</font></span>")
if (current_size == allowed_size)
investigate_log("<font color='red'>grew to size [current_size].</font>", I_SINGULO)
return 1
else if(current_size < (--temp_allowed_size))
else if (current_size < (--temp_allowed_size) && current_size != STAGE_SUPER)
expand(temp_allowed_size)
else
return 0
/obj/machinery/singularity/proc/check_energy()
if(energy <= 0)
del(src)
if (energy <= 0)
investigate_log("collapsed.", I_SINGULO)
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
if(200 to 499)
allowed_size = 3
if(500 to 999)
allowed_size = 5
if(1000 to 1999)
allowed_size = 7
if(2000 to INFINITY)
allowed_size = 9
if(current_size != allowed_size)
expand()
switch (energy) //Some of these numbers might need to be changed up later -Mport.
if (1 to 199)
allowed_size = STAGE_ONE
if (200 to 499)
allowed_size = STAGE_TWO
if (500 to 999)
allowed_size = STAGE_THREE
if (1000 to 1999)
allowed_size = STAGE_FOUR
if(2000 to 49999)
allowed_size = STAGE_FIVE
if(50000 to INFINITY)
allowed_size = STAGE_SUPER
if (current_size != allowed_size && current_size != STAGE_SUPER)
expand(null, current_size > allowed_size)
return 1
/obj/machinery/singularity/proc/eat()
set background = 1
// Let's just make this one loop.
for(var/atom/X in orange(grav_pull,src))
set background = BACKGROUND_ENABLED
for(var/atom/X in orange(grav_pull, src))
var/dist = get_dist(X, src)
// Movable atoms only
if(dist > consume_range && istype(X, /atom/movable))
if(is_type_in_list(X, uneatable)) continue
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)))
consume(X)
return
/obj/machinery/singularity/proc/consume(var/atom/A)
var/gain = 0
if(is_type_in_list(A, uneatable))
return 0
if (istype(A,/mob/living))//Mobs get gibbed
gain = 20
if(istype(A,/mob/living/carbon/human))
var/mob/living/carbon/human/H = A
if(H.mind)
if((H.mind.assigned_role == "Station Engineer") || (H.mind.assigned_role == "Chief Engineer") )
gain = 100
if(H.mind.assigned_role == "Clown")
gain = rand(-300, 300) // HONK
spawn()
A:gib()
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))
var/obj/machinery/singularity/S = src
if(!istype(src))
return
if(dist > consume_range)
X.singularity_pull(S, current_size)
else if(dist <= consume_range)
consume(X)
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
//for (var/turf/T in trange(grav_pull, src)) //TODO: Create a similar trange for orange to prevent snowflake of self check.
// consume(T)
if((teleport_del) && (!istype(A, /obj/machinery)))//Going to see if it does not lag less to tele items over to Z 2
var/obj/O = A
O.x = 2
O.y = 2
O.z = 2
else
A.ex_act(1.0)
if(A) del(A)
gain = 2
else if(isturf(A))
var/turf/T = A
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
src.energy += gain
return
/obj/machinery/singularity/proc/consume(const/atom/A)
src.energy += A.singularity_act(src, current_size)
return
/obj/machinery/singularity/proc/move(var/force_move = 0)
if(!move_self)
@@ -311,7 +314,6 @@ var/global/list/uneatable = list(
last_failed_movement = movement_dir
return 0
/obj/machinery/singularity/proc/check_turfs_in(var/direction = 0, var/step = 0)
if(!direction)
return 0
@@ -328,6 +330,8 @@ var/global/list/uneatable = list(
steps = 4
if(9)
steps = 5
if(11)
steps = 6
else
steps = step
var/list/turfs = list()
@@ -364,34 +368,38 @@ var/global/list/uneatable = list(
return 0
return 1
/obj/machinery/singularity/proc/can_move(const/turf/T)
if (!isturf(T))
return 0
/obj/machinery/singularity/proc/can_move(var/turf/T)
if(!T)
if ((locate(/obj/machinery/containment_field) in T) || (locate(/obj/machinery/shieldwall) in T))
return 0
if((locate(/obj/machinery/containment_field) in T)||(locate(/obj/machinery/shieldwall) in T))
return 0
else if(locate(/obj/machinery/field_generator) in T)
else if (locate(/obj/machinery/field_generator) in T)
var/obj/machinery/field_generator/G = locate(/obj/machinery/field_generator) in T
if(G && G.active)
if (G && G.active)
return 0
else if(locate(/obj/machinery/shieldwallgen) in T)
else if (locate(/obj/machinery/shieldwallgen) in T)
var/obj/machinery/shieldwallgen/S = locate(/obj/machinery/shieldwallgen) in T
if(S && S.active)
if (S && S.active)
return 0
return 1
/obj/machinery/singularity/proc/event()
var/numb = pick(1,2,3,4,5,6)
switch(numb)
if(1)//EMP
var/numb = pick(1, 2, 3, 4, 5, 6)
switch (numb)
if (1) //EMP.
emp_area()
if(2,3)//tox damage all carbon mobs in area
if (2, 3) //Tox damage all carbon mobs in area.
toxmob()
if(4)//Stun mobs who lack optic scanners
if (4) //Stun mobs who lack optic scanners.
mezzer()
else
return 0
if(current_size == 11)
smwave()
return 1
@@ -405,6 +413,8 @@ var/global/list/uneatable = list(
radiation = round(((src.energy-150)/50)*5,1)
radiationmin = round((radiation/5),1)//
for(var/mob/living/M in view(toxrange, src.loc))
if(M.status_flags & GODMODE)
continue
M.apply_effect(rand(radiationmin,radiation), IRRADIATE)
toxdamage = (toxdamage - (toxdamage*M.getarmor(null, "rad")))
M.apply_effect(toxdamage, TOX)
@@ -415,28 +425,70 @@ var/global/list/uneatable = list(
for(var/mob/living/carbon/M in oviewers(8, src))
if(istype(M, /mob/living/carbon/brain)) //Ignore brains
continue
if(M.status_flags & GODMODE)
continue
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!"
if(istype(H.glasses,/obj/item/clothing/glasses/meson) && current_size != 11)
H << "<span class=\"notice\">You look directly into The [src.name], good thing you had your protective eyewear on!</span>"
return
M << "\red You look directly into The [src.name] and feel weak."
else
H << "<span class=\"warning\">You look directly into The [src.name], but your eyewear does absolutely nothing to protect you from it!</span>"
M << "<span class='danger'>You look directly into The [src.name] and feel [current_size == 11 ? "helpless" : "weak"].</span>"
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)
return
O.show_message(text("<span class='danger'>[] stares blankly at The []!</span>", M, src), 1)
/obj/machinery/singularity/proc/emp_area()
empulse(src, 8, 10)
return
if(current_size != 11)
empulse(src, 8, 10)
else
empulse(src, 12, 16)
/obj/machinery/singularity/proc/smwave()
for(var/mob/living/M in view(10, src.loc))
if(prob(67))
M.apply_effect(rand(energy), IRRADIATE)
M << "<span class=\"warning\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>"
M << "<span class=\"notice\">Miraculously, it fails to kill you.</span>"
else
M << "<span class=\"danger\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>"
M << "<span class=\"danger\">You don't even have a moment to react as you are reduced to ashes by the intense radiation.</span>"
M.dust()
return
/obj/machinery/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
if (get_dist(R, src) <= 15) //Better than using orange() every process.
R.receive_pulse(energy)
return
/obj/machinery/singularity/proc/on_capture()
chained = 1
overlays = 0
move_self = 0
switch (current_size)
if(1)
overlays += image('icons/obj/singularity.dmi',"chain_s1")
if(3)
overlays += image('icons/effects/96x96.dmi',"chain_s3")
if(5)
overlays += image('icons/effects/160x160.dmi',"chain_s5")
if(7)
overlays += image('icons/effects/224x224.dmi',"chain_s7")
if(9)
overlays += image('icons/effects/288x288.dmi',"chain_s9")
/obj/machinery/singularity/proc/on_release()
chained = 0
overlays = 0
move_self = 1
/obj/machinery/singularity/singularity_act(S, size)
if(current_size <= size)
var/gain = (energy/2)
var/dist = max((current_size - 2), 1)
explosion(src.loc,(dist),(dist*2),(dist*4))
spawn(0)
qdel(src)
return gain