-Improved the singularity. It was using 3 for(in range) loops when it could be easily be brought down to a single loop.

-Changed grabbing's constructor to allow parameters for the grabber and the grabbee. (I made a simple little tweak and look at all the files I had to change :( )

-Easter Egg: Clowns have a chance of reducing or increasing the singularities energy. Upper and lower limit is 300 and -300.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4681 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-09-12 11:17:49 +00:00
parent 1d72e3c4e9
commit 2bc3ec67f1
10 changed files with 49 additions and 60 deletions

View File

@@ -407,9 +407,7 @@
if ("grab") if ("grab")
if (M == src) if (M == src)
return return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, M, src)
G.assailant = M
G.affecting = src
M.put_in_active_hand(G) M.put_in_active_hand(G)

View File

@@ -371,9 +371,7 @@
if ("grab") if ("grab")
if (M == src) if (M == src)
return return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
G.assailant = M
G.affecting = src
M.put_in_active_hand(G) M.put_in_active_hand(G)

View File

@@ -12,9 +12,7 @@
if(M == src) return if(M == src) return
if (w_uniform) if (w_uniform)
w_uniform.add_fingerprint(M) w_uniform.add_fingerprint(M)
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, M, src)
G.assailant = M
G.affecting = src
M.put_in_active_hand(G) M.put_in_active_hand(G)

View File

@@ -85,9 +85,7 @@
if("grab") if("grab")
if(M == src) return 0 if(M == src) return 0
if(w_uniform) w_uniform.add_fingerprint(M) if(w_uniform) w_uniform.add_fingerprint(M)
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M) var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, M, src)
G.assailant = M
G.affecting = src
M.put_in_active_hand(G) M.put_in_active_hand(G)

View File

@@ -503,9 +503,7 @@
if ("grab") if ("grab")
if (M == src) if (M == src)
return return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
G.assailant = M
G.affecting = src
M.put_in_active_hand(G) M.put_in_active_hand(G)
@@ -605,9 +603,7 @@
if ("grab") if ("grab")
if (M == src) if (M == src)
return return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
G.assailant = M
G.affecting = src
M.put_in_active_hand(G) M.put_in_active_hand(G)

View File

@@ -223,9 +223,7 @@
if (M == src) if (M == src)
return return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
G.assailant = M
G.affecting = src
M.put_in_active_hand(G) M.put_in_active_hand(G)
@@ -294,9 +292,7 @@
if ("grab") if ("grab")
if (M == src) if (M == src)
return return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
G.assailant = M
G.affecting = src
M.put_in_active_hand(G) M.put_in_active_hand(G)

View File

@@ -579,9 +579,7 @@
if ("grab") if ("grab")
if (M == src) if (M == src)
return return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
G.assailant = M
G.affecting = src
M.put_in_active_hand(G) M.put_in_active_hand(G)

View File

@@ -253,9 +253,8 @@
return return
if (nopush) if (nopush)
return return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
G.assailant = M
G.affecting = src
M.put_in_active_hand(G) M.put_in_active_hand(G)
grabbed_by += G grabbed_by += G
@@ -293,9 +292,7 @@
return return
if (nopush) if (nopush)
return return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
G.assailant = M
G.affecting = src
M.put_in_active_hand(G) M.put_in_active_hand(G)

View File

@@ -242,8 +242,12 @@
return return
/obj/item/weapon/grab/New() /obj/item/weapon/grab/New(var/location, mob/user as mob, mob/affected as mob)
..() ..()
src.loc = location
src.assailant = user
src.affecting = affected
// HUD
hud1 = new /obj/screen/grab( src ) hud1 = new /obj/screen/grab( src )
hud1.icon_state = "reinforce" hud1.icon_state = "reinforce"
hud1.name = "Reinforce Grab" hud1.name = "Reinforce Grab"

View File

@@ -36,10 +36,7 @@ var/global/list/uneatable = list(
/obj/machinery/singularity/New(loc, var/starting_energy = 50, var/temp = 0) /obj/machinery/singularity/New(loc, var/starting_energy = 50, var/temp = 0)
//CARN: admin-alert for chuckle-fuckery. //CARN: admin-alert for chuckle-fuckery.
last_warning = world.time last_warning = world.time
var/count = 0 var/count = locate(/obj/machinery/containment_field) in orange(30, src)
for(var/obj/machinery/containment_field/CF in world)
count = 1
break
if(!count) message_admins("A singulo has been created without containment fields active ([x],[y],[z])",1) 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") investigate_log("was created. [count?"":"<font color='red'>No containment fields were active</font>"]","singulo")
@@ -215,21 +212,25 @@ var/global/list/uneatable = list(
set background = 1 set background = 1
if(defer_powernet_rebuild != 2) if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 1 defer_powernet_rebuild = 1
for(var/atom/movable/X in orange(consume_range,src)) // Let's just make this one loop.
consume(X) for(var/atom/X in orange(grav_pull,src))
for(var/turf/X in orange(consume_range,src)) var/dist = get_dist(X, src)
consume(X) // Movable atoms only
for(var/atom/movable/X in orange(grav_pull,src)) if(dist > consume_range && istype(X, /atom/movable))
if(is_type_in_list(X, uneatable)) continue if(is_type_in_list(X, uneatable)) continue
if(((X) &&(!X:anchored) && (!istype(X,/mob/living/carbon/human)))|| (src.current_size >= 9)) if(((X) &&(!X:anchored) && (!istype(X,/mob/living/carbon/human)))|| (src.current_size >= 9))
step_towards(X,src) step_towards(X,src)
else if(istype(X,/mob/living/carbon/human)) else if(istype(X,/mob/living/carbon/human))
var/mob/living/carbon/human/H = X var/mob/living/carbon/human/H = X
if(istype(H.shoes,/obj/item/clothing/shoes/magboots)) if(istype(H.shoes,/obj/item/clothing/shoes/magboots))
var/obj/item/clothing/shoes/magboots/M = H.shoes var/obj/item/clothing/shoes/magboots/M = H.shoes
if(M.magpulse) if(M.magpulse)
continue continue
step_towards(H,src) step_towards(H,src)
// Turf and movable atoms
else if(dist <= consume_range && (isturf(X) || istype(X, /atom/movable)))
consume(X)
if(defer_powernet_rebuild != 2) if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 0 defer_powernet_rebuild = 0
return return
@@ -242,9 +243,15 @@ var/global/list/uneatable = list(
if (istype(A,/mob/living))//Mobs get gibbed if (istype(A,/mob/living))//Mobs get gibbed
gain = 20 gain = 20
if(istype(A,/mob/living/carbon/human)) if(istype(A,/mob/living/carbon/human))
if(A:mind) var/mob/living/carbon/human/H = A
if((A:mind:assigned_role == "Station Engineer") || (A:mind:assigned_role == "Chief Engineer") ) if(H.mind)
if((H.mind.assigned_role == "Station Engineer") || (H.mind.assigned_role == "Chief Engineer") )
gain = 100 gain = 100
if(H.mind.assigned_role == "Clown")
gain = rand(-300, 300) // HONK
spawn() spawn()
A:gib() A:gib()
sleep(1) sleep(1)
@@ -269,7 +276,7 @@ var/global/list/uneatable = list(
O.y = 2 O.y = 2
O.z = 2 O.z = 2
else else
A:ex_act(1.0) A.ex_act(1.0)
if(A) del(A) if(A) del(A)
gain = 2 gain = 2
else if(isturf(A)) else if(isturf(A))
@@ -532,10 +539,9 @@ var/global/list/uneatable = list(
set background = 1 set background = 1
if(defer_powernet_rebuild != 2) if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 1 defer_powernet_rebuild = 1
for(var/atom/movable/X in orange(consume_range,src)) for(var/atom/X in orange(consume_range,src))
consume(X) if(isturf(X) || istype(X, /atom/movable))
for(var/turf/X in orange(consume_range,src)) consume(X)
consume(X)
if(defer_powernet_rebuild != 2) if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 0 defer_powernet_rebuild = 0
return return