-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 (M == src)
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
G.assailant = M
G.affecting = src
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, M, src)
M.put_in_active_hand(G)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -242,8 +242,12 @@
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.icon_state = "reinforce"
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)
//CARN: admin-alert for chuckle-fuckery.
last_warning = world.time
var/count = 0
for(var/obj/machinery/containment_field/CF in world)
count = 1
break
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")
@@ -215,21 +212,25 @@ var/global/list/uneatable = list(
set background = 1
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 1
for(var/atom/movable/X in orange(consume_range,src))
consume(X)
for(var/turf/X in orange(consume_range,src))
consume(X)
for(var/atom/movable/X in orange(grav_pull,src))
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)
// Let's just make this one loop.
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)
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 0
return
@@ -242,9 +243,15 @@ var/global/list/uneatable = list(
if (istype(A,/mob/living))//Mobs get gibbed
gain = 20
if(istype(A,/mob/living/carbon/human))
if(A:mind)
if((A:mind:assigned_role == "Station Engineer") || (A:mind:assigned_role == "Chief Engineer") )
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)
@@ -269,7 +276,7 @@ var/global/list/uneatable = list(
O.y = 2
O.z = 2
else
A:ex_act(1.0)
A.ex_act(1.0)
if(A) del(A)
gain = 2
else if(isturf(A))
@@ -532,10 +539,9 @@ var/global/list/uneatable = list(
set background = 1
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 1
for(var/atom/movable/X in orange(consume_range,src))
consume(X)
for(var/turf/X in orange(consume_range,src))
consume(X)
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