@@ -919,4 +919,4 @@ Pass a positive integer as an argument to override a bot's default speed.
|
||||
if(!data_hud_type)
|
||||
return
|
||||
var/datum/atom_hud/datahud = GLOB.huds[data_hud_type]
|
||||
datahud.add_hud_to(src)
|
||||
datahud.add_hud_to(src)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
var/trash = 0
|
||||
var/pests = 0
|
||||
|
||||
var/list/target_types = list()
|
||||
var/list/target_types
|
||||
var/obj/effect/decal/cleanable/target
|
||||
var/max_targets = 50 //Maximum number of targets a cleanbot can ignore.
|
||||
var/oldloc = null
|
||||
@@ -32,7 +32,7 @@
|
||||
var/next_dest_loc
|
||||
|
||||
/mob/living/simple_animal/bot/cleanbot/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
get_targets()
|
||||
icon_state = "cleanbot[on]"
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
var/mob/living/carbon/C = A
|
||||
if(C.stat != DEAD && C.lying)
|
||||
return C
|
||||
else if(is_type_in_list(A, target_types))
|
||||
else if(is_type_in_typecache(A, target_types))
|
||||
return A
|
||||
|
||||
/mob/living/simple_animal/bot/cleanbot/handle_automated_action()
|
||||
@@ -193,6 +193,8 @@
|
||||
if(trash)
|
||||
target_types += /obj/item/trash
|
||||
|
||||
target_types = typecacheof(target_types)
|
||||
|
||||
/mob/living/simple_animal/bot/cleanbot/UnarmedAttack(atom/A)
|
||||
if(istype(A, /obj/effect/decal/cleanable))
|
||||
anchored = 1
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
var/check_records = 1 //Does it check security records?
|
||||
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'
|
||||
var/shoot_sound = 'sound/weapons/taser.ogg'
|
||||
|
||||
|
||||
/mob/living/simple_animal/bot/ed209/Initialize(mapload,created_name,created_lasercolor)
|
||||
@@ -152,8 +152,23 @@ Auto Patrol[]"},
|
||||
declare_arrests = !declare_arrests
|
||||
update_controls()
|
||||
|
||||
/mob/living/simple_animal/bot/ed209/proc/judgement_criteria()
|
||||
var/final = FALSE
|
||||
if(idcheck)
|
||||
final = final|JUDGE_IDCHECK
|
||||
if(check_records)
|
||||
final = final|JUDGE_RECORDCHECK
|
||||
if(weaponscheck)
|
||||
final = final|JUDGE_WEAPONCHECK
|
||||
if(emagged)
|
||||
final = final|JUDGE_EMAGGED
|
||||
//ED209's ignore monkeys
|
||||
final = final|JUDGE_IGNOREMONKEYS
|
||||
return final
|
||||
|
||||
/mob/living/simple_animal/bot/ed209/proc/retaliate(mob/living/carbon/human/H)
|
||||
threatlevel = H.assess_threat(src)
|
||||
var/judgement_criteria = judgement_criteria()
|
||||
threatlevel = H.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons))
|
||||
threatlevel += 6
|
||||
if(threatlevel >= 4)
|
||||
target = H
|
||||
@@ -199,12 +214,13 @@ Auto Patrol[]"},
|
||||
if(disabled)
|
||||
return
|
||||
|
||||
var/judgement_criteria = judgement_criteria()
|
||||
var/list/targets = list()
|
||||
for(var/mob/living/carbon/C in view(7,src)) //Let's find us a target
|
||||
var/threatlevel = 0
|
||||
if((C.stat) || (C.lying))
|
||||
continue
|
||||
threatlevel = C.assess_threat(src, lasercolor)
|
||||
threatlevel = C.assess_threat(judgement_criteria, lasercolor, weaponcheck=CALLBACK(src, .proc/check_for_weapons))
|
||||
//speak(C.real_name + text(": threat: []", threatlevel))
|
||||
if(threatlevel < 4 )
|
||||
continue
|
||||
@@ -255,7 +271,7 @@ Auto Patrol[]"},
|
||||
if(BOT_PREP_ARREST) // preparing to arrest target
|
||||
|
||||
// see if he got away. If he's no no longer adjacent or inside a closet or about to get up, we hunt again.
|
||||
if(!Adjacent(target) || !isturf(target.loc) || target.weakened < 2)
|
||||
if(!Adjacent(target) || !isturf(target.loc) || target.AmountKnockdown() < 40)
|
||||
back_to_hunt()
|
||||
return
|
||||
|
||||
@@ -282,7 +298,7 @@ Auto Patrol[]"},
|
||||
back_to_idle()
|
||||
return
|
||||
|
||||
if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && target.weakened < 2)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again.
|
||||
if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && target.AmountKnockdown() < 40)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again.
|
||||
back_to_hunt()
|
||||
return
|
||||
else
|
||||
@@ -321,6 +337,7 @@ Auto Patrol[]"},
|
||||
return
|
||||
anchored = 0
|
||||
threatlevel = 0
|
||||
var/judgement_criteria = judgement_criteria()
|
||||
for (var/mob/living/carbon/C in view(7,src)) //Let's find us a criminal
|
||||
if((C.stat) || (C.handcuffed))
|
||||
continue
|
||||
@@ -328,7 +345,7 @@ Auto Patrol[]"},
|
||||
if((C.name == oldtarget_name) && (world.time < last_found + 100))
|
||||
continue
|
||||
|
||||
threatlevel = C.assess_threat(src, lasercolor)
|
||||
threatlevel = C.assess_threat(judgement_criteria, lasercolor, weaponcheck=CALLBACK(src, .proc/check_for_weapons))
|
||||
|
||||
if(!threatlevel)
|
||||
continue
|
||||
@@ -337,7 +354,7 @@ Auto Patrol[]"},
|
||||
target = C
|
||||
oldtarget_name = C.name
|
||||
speak("Level [threatlevel] infraction alert!")
|
||||
playsound(loc, pick('sound/voice/ed209_20sec.ogg', 'sound/voice/EDPlaceholder.ogg'), 50, 0)
|
||||
playsound(loc, pick('sound/voice/ed209_20sec.ogg', 'sound/voice/edplaceholder.ogg'), 50, 0)
|
||||
visible_message("<b>[src]</b> points at [C.name]!")
|
||||
mode = BOT_HUNT
|
||||
spawn(0)
|
||||
@@ -404,7 +421,7 @@ Auto Patrol[]"},
|
||||
projectile = /obj/item/projectile/beam
|
||||
else
|
||||
if(!lasercolor)
|
||||
shoot_sound = 'sound/weapons/Taser.ogg'
|
||||
shoot_sound = 'sound/weapons/taser.ogg'
|
||||
projectile = /obj/item/projectile/energy/electrode
|
||||
else if(lasercolor == "b")
|
||||
projectile = /obj/item/projectile/beam/lasertag/bluetag
|
||||
@@ -504,7 +521,7 @@ Auto Patrol[]"},
|
||||
return
|
||||
if(iscarbon(A))
|
||||
var/mob/living/carbon/C = A
|
||||
if(!C.stunned || arrest_type)
|
||||
if(!C.IsStun() || arrest_type)
|
||||
stun_attack(A)
|
||||
else if(C.canBeHandcuffed() && !C.handcuffed)
|
||||
cuff(A)
|
||||
@@ -517,17 +534,17 @@ Auto Patrol[]"},
|
||||
shootAt(A)
|
||||
|
||||
/mob/living/simple_animal/bot/ed209/proc/stun_attack(mob/living/carbon/C)
|
||||
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
|
||||
playsound(loc, 'sound/weapons/egloves.ogg', 50, 1, -1)
|
||||
icon_state = "[lasercolor]ed209-c"
|
||||
spawn(2)
|
||||
icon_state = "[lasercolor]ed209[on]"
|
||||
var/threat = 5
|
||||
C.Weaken(5)
|
||||
C.Stun(5)
|
||||
C.Knockdown(100)
|
||||
C.stuttering = 5
|
||||
if(ishuman(C))
|
||||
var/mob/living/carbon/human/H = C
|
||||
threat = H.assess_threat(src)
|
||||
var/judgement_criteria = judgement_criteria()
|
||||
threat = H.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons))
|
||||
add_logs(src,C,"stunned")
|
||||
if(declare_arrests)
|
||||
var/area/location = get_area(src)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -634,17 +634,15 @@
|
||||
// called when bot bumps into anything
|
||||
/mob/living/simple_animal/bot/mulebot/Bump(atom/obs)
|
||||
if(wires.is_cut(WIRE_AVOIDANCE)) // usually just bumps, but if avoidance disabled knock over mobs
|
||||
var/mob/M = obs
|
||||
if(ismob(M))
|
||||
if(iscyborg(M))
|
||||
visible_message("<span class='danger'>[src] bumps into [M]!</span>")
|
||||
if(isliving(obs))
|
||||
var/mob/living/L = obs
|
||||
if(iscyborg(L))
|
||||
visible_message("<span class='danger'>[src] bumps into [L]!</span>")
|
||||
else
|
||||
if(!paicard)
|
||||
add_logs(src, M, "knocked down")
|
||||
visible_message("<span class='danger'>[src] knocks over [M]!</span>")
|
||||
M.stop_pulling()
|
||||
M.Stun(8)
|
||||
M.Weaken(5)
|
||||
add_logs(src, L, "knocked down")
|
||||
visible_message("<span class='danger'>[src] knocks over [L]!</span>")
|
||||
L.Knockdown(160)
|
||||
return ..()
|
||||
|
||||
// called from mob/living/carbon/human/Crossed()
|
||||
|
||||
@@ -148,12 +148,25 @@ Auto Patrol: []"},
|
||||
update_controls()
|
||||
|
||||
/mob/living/simple_animal/bot/secbot/proc/retaliate(mob/living/carbon/human/H)
|
||||
threatlevel = H.assess_threat(src)
|
||||
var/judgement_criteria = judgement_criteria()
|
||||
threatlevel = H.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons))
|
||||
threatlevel += 6
|
||||
if(threatlevel >= 4)
|
||||
target = H
|
||||
mode = BOT_HUNT
|
||||
|
||||
/mob/living/simple_animal/bot/secbot/proc/judgement_criteria()
|
||||
var/final = FALSE
|
||||
if(idcheck)
|
||||
final = final|JUDGE_IDCHECK
|
||||
if(check_records)
|
||||
final = final|JUDGE_RECORDCHECK
|
||||
if(weaponscheck)
|
||||
final = final|JUDGE_WEAPONCHECK
|
||||
if(emagged)
|
||||
final = final|JUDGE_EMAGGED
|
||||
return final
|
||||
|
||||
/mob/living/simple_animal/bot/secbot/attack_hand(mob/living/carbon/human/H)
|
||||
if((H.a_intent == INTENT_HARM) || (H.a_intent == INTENT_DISARM))
|
||||
retaliate(H)
|
||||
@@ -190,7 +203,7 @@ Auto Patrol: []"},
|
||||
return
|
||||
if(iscarbon(A))
|
||||
var/mob/living/carbon/C = A
|
||||
if(!C.stunned || arrest_type)
|
||||
if(!C.IsStun() || arrest_type)
|
||||
stun_attack(A)
|
||||
else if(C.canBeHandcuffed() && !C.handcuffed)
|
||||
cuff(A)
|
||||
@@ -222,22 +235,22 @@ Auto Patrol: []"},
|
||||
back_to_idle()
|
||||
|
||||
/mob/living/simple_animal/bot/secbot/proc/stun_attack(mob/living/carbon/C)
|
||||
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
|
||||
var/judgement_criteria = judgement_criteria()
|
||||
playsound(loc, 'sound/weapons/egloves.ogg', 50, 1, -1)
|
||||
icon_state = "secbot-c"
|
||||
spawn(2)
|
||||
icon_state = "secbot[on]"
|
||||
var/threat = 5
|
||||
if(ishuman(C))
|
||||
C.stuttering = 5
|
||||
C.Stun(5)
|
||||
C.Weaken(5)
|
||||
C.Knockdown(100)
|
||||
var/mob/living/carbon/human/H = C
|
||||
threat = H.assess_threat(src)
|
||||
threat = H.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons))
|
||||
else
|
||||
C.Weaken(5)
|
||||
C.Knockdown(100)
|
||||
C.stuttering = 5
|
||||
C.Stun(5)
|
||||
threat = C.assess_threat()
|
||||
threat = C.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons))
|
||||
|
||||
add_logs(src,C,"stunned")
|
||||
if(declare_arrests)
|
||||
var/area/location = get_area(src)
|
||||
@@ -288,7 +301,7 @@ Auto Patrol: []"},
|
||||
if(BOT_PREP_ARREST) // preparing to arrest target
|
||||
|
||||
// see if he got away. If he's no no longer adjacent or inside a closet or about to get up, we hunt again.
|
||||
if( !Adjacent(target) || !isturf(target.loc) || target.weakened < 2 )
|
||||
if( !Adjacent(target) || !isturf(target.loc) || target.AmountKnockdown() < 40)
|
||||
back_to_hunt()
|
||||
return
|
||||
|
||||
@@ -315,7 +328,7 @@ Auto Patrol: []"},
|
||||
back_to_idle()
|
||||
return
|
||||
|
||||
if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && target.weakened < 2)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again.
|
||||
if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && target.AmountKnockdown() < 40)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again.
|
||||
back_to_hunt()
|
||||
return
|
||||
else //Try arresting again if the target escapes.
|
||||
@@ -352,6 +365,7 @@ Auto Patrol: []"},
|
||||
|
||||
/mob/living/simple_animal/bot/secbot/proc/look_for_perp()
|
||||
anchored = 0
|
||||
var/judgement_criteria = judgement_criteria()
|
||||
for (var/mob/living/carbon/C in view(7,src)) //Let's find us a criminal
|
||||
if((C.stat) || (C.handcuffed))
|
||||
continue
|
||||
@@ -359,7 +373,7 @@ Auto Patrol: []"},
|
||||
if((C.name == oldtarget_name) && (world.time < last_found + 100))
|
||||
continue
|
||||
|
||||
threatlevel = C.assess_threat(src)
|
||||
threatlevel = C.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons))
|
||||
|
||||
if(!threatlevel)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user