mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-25 09:31:30 +00:00
Saving more work.
This commit is contained in:
@@ -23,7 +23,7 @@ var/list/overminds = list()
|
||||
var/ai_controlled = TRUE
|
||||
var/auto_pilot = FALSE // If true, and if a client is attached, the AI routine will continue running.
|
||||
|
||||
/mob/observer/blob/New(var/newloc, pre_placed = 0, starting_points = 60, desired_blob_type = null)
|
||||
/mob/observer/blob/Initialize(newloc, pre_placed = 0, starting_points = 60, desired_blob_type = null)
|
||||
blob_points = starting_points
|
||||
if(pre_placed) //we already have a core!
|
||||
placed = 1
|
||||
@@ -41,10 +41,10 @@ var/list/overminds = list()
|
||||
if(blob_core)
|
||||
blob_core.update_icon()
|
||||
|
||||
..(newloc)
|
||||
return ..(newloc)
|
||||
|
||||
/mob/observer/blob/Destroy()
|
||||
for(var/BL in blobs)
|
||||
for(var/BL in GLOB.all_blobs)
|
||||
var/obj/structure/blob/B = BL
|
||||
if(B && B.overmind == src)
|
||||
B.overmind = null
|
||||
@@ -65,7 +65,7 @@ var/list/overminds = list()
|
||||
if(blob_core)
|
||||
stat(null, "Core Health: [blob_core.integrity]")
|
||||
stat(null, "Power Stored: [blob_points]/[max_blob_points]")
|
||||
stat(null, "Total Blobs: [blobs.len]")
|
||||
stat(null, "Total Blobs: [GLOB.all_blobs.len]")
|
||||
|
||||
/mob/observer/blob/Move(NewLoc, Dir = 0)
|
||||
if(placed)
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
to_chat(src, "<span class='warning'>There is no blob here!</span>")
|
||||
return
|
||||
|
||||
if(B.overmind != src)
|
||||
to_chat(src, span("warning", "This blob isn't controlled by you."))
|
||||
|
||||
if(!istype(B, /obj/structure/blob/normal))
|
||||
to_chat(src, "<span class='warning'>Unable to use this blob, find a normal one.</span>")
|
||||
return
|
||||
@@ -66,7 +69,7 @@
|
||||
return FALSE
|
||||
|
||||
var/obj/structure/blob/B = null
|
||||
var/list/potential_blobs = blobs.Copy()
|
||||
var/list/potential_blobs = GLOB.all_blobs.Copy()
|
||||
while(potential_blobs.len)
|
||||
var/obj/structure/blob/temp = pick(potential_blobs)
|
||||
if(!(locate(/obj/structure/blob/node) in range(temp, BLOB_NODE_PULSE_RANGE) ) && !(locate(/obj/structure/blob/core) in range(temp, BLOB_CORE_PULSE_RANGE) ))
|
||||
@@ -77,6 +80,8 @@
|
||||
potential_blobs -= temp // Don't take up the core's shield spot.
|
||||
else if(!istype(temp, /obj/structure/blob/normal))
|
||||
potential_blobs -= temp // Not a normal blob.
|
||||
else if(temp.overmind != src)
|
||||
potential_blobs -= temp // Not our blob.
|
||||
else
|
||||
B = temp
|
||||
break
|
||||
@@ -107,7 +112,7 @@
|
||||
return FALSE
|
||||
|
||||
var/obj/structure/blob/B = null
|
||||
var/list/potential_blobs = blobs.Copy()
|
||||
var/list/potential_blobs = GLOB.all_blobs.Copy()
|
||||
while(potential_blobs.len)
|
||||
var/obj/structure/blob/temp = pick(potential_blobs)
|
||||
if(!(locate(/obj/structure/blob/node) in range(temp, BLOB_NODE_PULSE_RANGE) ) && !(locate(/obj/structure/blob/core) in range(temp, BLOB_CORE_PULSE_RANGE) ))
|
||||
@@ -118,6 +123,8 @@
|
||||
potential_blobs -= temp // Don't take up the core's shield spot.
|
||||
else if(!istype(temp, /obj/structure/blob/normal))
|
||||
potential_blobs -= temp // Not a normal blob.
|
||||
else if(temp.overmind != src)
|
||||
potential_blobs -= temp // Not our blob.
|
||||
else
|
||||
B = temp
|
||||
break
|
||||
@@ -149,7 +156,7 @@
|
||||
return FALSE
|
||||
|
||||
var/obj/structure/blob/B = null
|
||||
var/list/potential_blobs = blobs.Copy()
|
||||
var/list/potential_blobs = GLOB.all_blobs.Copy()
|
||||
while(potential_blobs.len)
|
||||
var/obj/structure/blob/temp = pick(potential_blobs)
|
||||
if(locate(/obj/structure/blob/node) in range(temp, 5) )
|
||||
@@ -158,6 +165,8 @@
|
||||
potential_blobs -= temp
|
||||
else if(!istype(temp, /obj/structure/blob/normal))
|
||||
potential_blobs -= temp
|
||||
else if(temp.overmind != src)
|
||||
potential_blobs -= temp // Not our blob.
|
||||
else
|
||||
B = temp
|
||||
break
|
||||
@@ -184,7 +193,7 @@
|
||||
other_T = get_step(T, direction)
|
||||
if(other_T)
|
||||
B = locate(/obj/structure/blob) in other_T
|
||||
if(B)
|
||||
if(B && B.overmind == src)
|
||||
break
|
||||
|
||||
if(!B)
|
||||
@@ -216,7 +225,7 @@
|
||||
for(var/direction in cardinal)
|
||||
var/turf/T = get_step(L, direction)
|
||||
B = locate(/obj/structure/blob) in T
|
||||
if(B)
|
||||
if(B && B.overmind == src)
|
||||
break
|
||||
if(!B)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user