mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 15:14:27 +01:00
-Should fix machines not depowering correctly. Let me know if you find a machine which should be powered off but isn't.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5388 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -11,11 +11,13 @@
|
||||
var/move_to_delay = 2 //delay for the automated movement.
|
||||
var/list/friends = list()
|
||||
stop_automated_movement_when_pulled = 0
|
||||
var/destroy_surroundings = 1
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/FindTarget()
|
||||
|
||||
var/atom/T = null
|
||||
stop_automated_movement = 0
|
||||
var/list/non_threat_targets = list() // Targets which it will target if there are no other targets
|
||||
for(var/atom/A in ListTargets())
|
||||
|
||||
if(isliving(A))
|
||||
@@ -25,16 +27,25 @@
|
||||
else if(L in friends)
|
||||
continue
|
||||
else
|
||||
if(!L.stat)
|
||||
|
||||
if(L.stat == CONSCIOUS)
|
||||
stance = HOSTILE_STANCE_ATTACK
|
||||
T = L
|
||||
break
|
||||
else if(L.stat == UNCONSCIOUS)
|
||||
non_threat_targets += L
|
||||
continue
|
||||
|
||||
if(istype(A, /obj/mecha))
|
||||
var/obj/mecha/M = A
|
||||
if (M.occupant)
|
||||
stance = HOSTILE_STANCE_ATTACK
|
||||
T = M
|
||||
break
|
||||
|
||||
if(!T && non_threat_targets.len)
|
||||
T = pick(non_threat_targets)
|
||||
|
||||
return T
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/MoveToTarget()
|
||||
@@ -160,7 +171,8 @@
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/DestroySurroundings()
|
||||
for(var/dir in cardinal) // North, South, East, West
|
||||
var/obj/structure/obstacle = locate(/obj/structure, get_step(src, dir))
|
||||
if(istype(obstacle, /obj/structure/window) || istype(obstacle, /obj/structure/closet) || istype(obstacle, /obj/structure/table) || istype(obstacle, /obj/structure/grille))
|
||||
obstacle.attack_animal(src)
|
||||
if(destroy_surroundings)
|
||||
for(var/dir in cardinal) // North, South, East, West
|
||||
var/obj/structure/obstacle = locate(/obj/structure, get_step(src, dir))
|
||||
if(istype(obstacle, /obj/structure/window) || istype(obstacle, /obj/structure/closet) || istype(obstacle, /obj/structure/table) || istype(obstacle, /obj/structure/grille))
|
||||
obstacle.attack_animal(src)
|
||||
@@ -134,7 +134,7 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
|
||||
health = 100
|
||||
maxHealth = 100
|
||||
var/obj/item/staff = null // the staff that changed they, never attack the bearer of this staff
|
||||
var/destroy_objects = 0
|
||||
destroy_surroundings = 0
|
||||
var/knockdown_people = 0
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/New(loc, var/obj/copy, var/obj/item/staff)
|
||||
@@ -164,7 +164,7 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
|
||||
|
||||
if(istype(O, /obj/structure))
|
||||
health = (anchored * 50) + 50
|
||||
destroy_objects = 1
|
||||
destroy_surroundings = 1
|
||||
if(O.density && O.anchored)
|
||||
knockdown_people = 1
|
||||
melee_damage_lower *= 2
|
||||
@@ -183,10 +183,6 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
|
||||
return 1
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/DestroySurroundings()
|
||||
if(destroy_objects)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/AttackingTarget()
|
||||
. =..()
|
||||
if(knockdown_people)
|
||||
|
||||
@@ -422,10 +422,10 @@
|
||||
/mob/living/simple_animal/proc/SA_attackable(target_mob)
|
||||
if (isliving(target_mob))
|
||||
var/mob/living/L = target_mob
|
||||
if(!L.stat)
|
||||
return (0)
|
||||
if(L.stat != DEAD)
|
||||
return 0
|
||||
if (istype(target_mob,/obj/mecha))
|
||||
var/obj/mecha/M = target_mob
|
||||
if (M.occupant)
|
||||
return (0)
|
||||
return (1)
|
||||
return 0
|
||||
return 1
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
icon_state = "apc0"
|
||||
anchored = 1
|
||||
use_power = 0
|
||||
req_access = list(access_engine_equip)
|
||||
var/area/area
|
||||
var/areastring = null
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
icon_state = "teg"
|
||||
anchored = 1
|
||||
density = 1
|
||||
use_power = 0
|
||||
|
||||
var/obj/machinery/atmospherics/binary/circulator/circ1
|
||||
var/obj/machinery/atmospherics/binary/circulator/circ2
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
icon_state = "teg"
|
||||
anchored = 1
|
||||
density = 1
|
||||
use_power = 0
|
||||
|
||||
var/obj/machinery/atmospherics/unary/generator_input/input1
|
||||
var/obj/machinery/atmospherics/unary/generator_input/input2
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
anchored = 1
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "dispenser"
|
||||
use_power = 1
|
||||
use_power = 0
|
||||
idle_power_usage = 40
|
||||
var/energy = 100
|
||||
var/max_energy = 100
|
||||
|
||||
Reference in New Issue
Block a user