fixes runtime in ed209.dm access_card check, removes spawn()

This commit is contained in:
Kyep
2018-12-07 01:34:50 -08:00
parent 1358d4dac3
commit 0acc3b95a4
2 changed files with 25 additions and 20 deletions
@@ -23,12 +23,13 @@
path_image_color = "#FF0000"
data_hud_type = DATA_HUD_SECURITY_ADVANCED
allow_pai = 0
var/lastfired = 0
var/shot_delay = 3 //.3 seconds between shots
var/lasercolor = ""
var/disabled = 0//A holder for if it needs to be disabled, if true it will not seach for targets, shoot at targets, or move, currently only used for lasertag
var/mob/living/carbon/target
var/oldtarget_name
var/threatlevel = 0
@@ -41,10 +42,9 @@
var/arrest_type = 0 //If true, don't handcuff
var/projectile = /obj/item/projectile/energy/electrode //Holder for projectile type
var/shoot_sound = 'sound/weapons/Taser.ogg'
allow_pai = 0
/mob/living/simple_animal/bot/ed209/New(loc,created_name,created_lasercolor)
/mob/living/simple_animal/bot/ed209/New(loc, created_name, created_lasercolor)
..()
if(created_name)
name = created_name
@@ -52,29 +52,33 @@
lasercolor = created_lasercolor
icon_state = "[lasercolor]ed209[on]"
set_weapon() //giving it the right projectile and firing sound.
spawn(3)
var/datum/job/detective/J = new/datum/job/detective
access_card.access += J.get_access()
prev_access = access_card.access
setup_access()
if(lasercolor)
shot_delay = 6//Longer shot delay because JESUS CHRIST
check_records = 0//Don't actively target people set to arrest
arrest_type = 1//Don't even try to cuff
declare_arrests = 0 // Don't spam sec
bot_core.req_access = list(access_maint_tunnels, access_theatre, access_robotics)
if(lasercolor)
shot_delay = 6//Longer shot delay because JESUS CHRIST
check_records = 0//Don't actively target people set to arrest
arrest_type = 1//Don't even try to cuff
declare_arrests = 0 // Don't spam sec
bot_core.req_access = list(access_maint_tunnels, access_theatre, access_robotics)
if(created_name == initial(name) || !created_name)
if(lasercolor == "b")
name = pick("BLUE BALLER","SANIC","BLUE KILLDEATH MURDERBOT")
else if (lasercolor == "r")
name = pick("RED RAMPAGE","RED ROVER","RED KILLDEATH MURDERBOT")
if(created_name == initial(name) || !created_name)
if(lasercolor == "b")
name = pick("BLUE BALLER","SANIC","BLUE KILLDEATH MURDERBOT")
else if (lasercolor == "r")
name = pick("RED RAMPAGE","RED ROVER","RED KILLDEATH MURDERBOT")
//SECHUD
var/datum/atom_hud/secsensor = huds[DATA_HUD_SECURITY_ADVANCED]
secsensor.add_hud_to(src)
permanent_huds |= secsensor
/mob/living/simple_animal/bot/ed209/proc/setup_access()
if(access_card)
var/datum/job/detective/J = new/datum/job/detective
access_card.access += J.get_access()
prev_access = access_card.access
/mob/living/simple_animal/bot/ed209/turn_on()
. = ..()
icon_state = "[lasercolor]ed209[on]"
@@ -29,12 +29,13 @@
/mob/living/simple_animal/bot/ed209/syndicate/New()
..()
if(access_card)
access_card.access = list(access_syndicate, access_syndicate_leader)
set_weapon()
update_icon()
spawn_turf = get_turf(src)
/mob/living/simple_animal/bot/ed209/syndicate/setup_access()
if(access_card)
access_card.access = list(access_syndicate, access_syndicate_leader)
/mob/living/simple_animal/bot/ed209/syndicate/update_icon()
icon_state = initial(icon_state)