mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
-Small cleanup for hostile mobs.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5179 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -8,8 +8,6 @@
|
|||||||
var/projectiletype
|
var/projectiletype
|
||||||
var/projectilesound
|
var/projectilesound
|
||||||
var/casingtype
|
var/casingtype
|
||||||
var/target //used for shooting
|
|
||||||
var/incombat = 0 //if they're attacking stuff
|
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/proc/FindTarget()
|
/mob/living/simple_animal/hostile/proc/FindTarget()
|
||||||
|
|
||||||
@@ -19,7 +17,7 @@
|
|||||||
|
|
||||||
if(isliving(A))
|
if(isliving(A))
|
||||||
var/mob/living/L = A
|
var/mob/living/L = A
|
||||||
if(L.faction == src.faction)
|
if(L.faction == src.faction && !attack_same)
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
if(!L.stat)
|
if(!L.stat)
|
||||||
@@ -42,11 +40,9 @@
|
|||||||
if(ranged)
|
if(ranged)
|
||||||
if(get_dist(src, target_mob) <= 6)
|
if(get_dist(src, target_mob) <= 6)
|
||||||
OpenFire(target_mob)
|
OpenFire(target_mob)
|
||||||
else
|
|
||||||
walk_to(src, target_mob, 1, 2)
|
|
||||||
else
|
else
|
||||||
walk_to(src, target_mob, 1, 2)
|
|
||||||
stance = HOSTILE_STANCE_ATTACKING
|
stance = HOSTILE_STANCE_ATTACKING
|
||||||
|
walk_to(src, target_mob, 1, 2)
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/proc/AttackTarget()
|
/mob/living/simple_animal/hostile/proc/AttackTarget()
|
||||||
|
|
||||||
@@ -96,30 +92,24 @@
|
|||||||
if(client)
|
if(client)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if(incombat)
|
|
||||||
for(dir in list(NORTH,EAST,SOUTH,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(!stat)
|
if(!stat)
|
||||||
switch(stance)
|
switch(stance)
|
||||||
if(HOSTILE_STANCE_IDLE)
|
if(HOSTILE_STANCE_IDLE)
|
||||||
incombat = 0
|
|
||||||
target_mob = FindTarget()
|
target_mob = FindTarget()
|
||||||
|
|
||||||
if(HOSTILE_STANCE_ATTACK)
|
if(HOSTILE_STANCE_ATTACK)
|
||||||
incombat = 1
|
DestroySurroundings()
|
||||||
MoveToTarget()
|
MoveToTarget()
|
||||||
|
|
||||||
if(HOSTILE_STANCE_ATTACKING)
|
if(HOSTILE_STANCE_ATTACKING)
|
||||||
incombat = 1
|
DestroySurroundings()
|
||||||
AttackTarget()
|
AttackTarget()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/proc/OpenFire(target_mob)
|
/mob/living/simple_animal/hostile/proc/OpenFire(target_mob)
|
||||||
src.target = target_mob
|
var/target = target_mob
|
||||||
visible_message("\red <b>[src]</b> fires at [src.target]!", 1)
|
visible_message("\red <b>[src]</b> fires at [target]!", 1)
|
||||||
|
|
||||||
var/tturf = get_turf(target)
|
var/tturf = get_turf(target)
|
||||||
if(rapid)
|
if(rapid)
|
||||||
@@ -161,4 +151,10 @@
|
|||||||
A.xo = target:x - start:x
|
A.xo = target:x - start:x
|
||||||
spawn( 0 )
|
spawn( 0 )
|
||||||
A.process()
|
A.process()
|
||||||
return
|
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)
|
||||||
@@ -47,11 +47,11 @@
|
|||||||
weapon1 = /obj/item/weapon/gun/energy/laser
|
weapon1 = /obj/item/weapon/gun/energy/laser
|
||||||
|
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/pirate/Life()
|
/mob/living/simple_animal/hostile/pirate/Die()
|
||||||
..()
|
..()
|
||||||
if(stat == 2)
|
if(corpse)
|
||||||
new corpse (src.loc)
|
new corpse (src.loc)
|
||||||
if(weapon1)
|
if(weapon1)
|
||||||
new weapon1 (src.loc)
|
new weapon1 (src.loc)
|
||||||
del src
|
del src
|
||||||
return
|
return
|
||||||
@@ -34,6 +34,18 @@
|
|||||||
wall_smash = 1
|
wall_smash = 1
|
||||||
faction = "syndicate"
|
faction = "syndicate"
|
||||||
|
|
||||||
|
|
||||||
|
/mob/living/simple_animal/hostile/syndicate/Die()
|
||||||
|
..()
|
||||||
|
if(corpse)
|
||||||
|
new corpse (src.loc)
|
||||||
|
if(weapon1)
|
||||||
|
new weapon1 (src.loc)
|
||||||
|
if(weapon2)
|
||||||
|
new weapon2 (src.loc)
|
||||||
|
del src
|
||||||
|
return
|
||||||
|
|
||||||
///////////////Sword and shield////////////
|
///////////////Sword and shield////////////
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/syndicate/melee
|
/mob/living/simple_animal/hostile/syndicate/melee
|
||||||
@@ -117,16 +129,4 @@
|
|||||||
speed = 0
|
speed = 0
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/syndicate/ranged/space/Process_Spacemove(var/check_drift = 0)
|
/mob/living/simple_animal/hostile/syndicate/ranged/space/Process_Spacemove(var/check_drift = 0)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/syndicate/Life()
|
|
||||||
..()
|
|
||||||
if(stat == 2)
|
|
||||||
new corpse (src.loc)
|
|
||||||
if(weapon1)
|
|
||||||
new weapon1 (src.loc)
|
|
||||||
if(weapon2)
|
|
||||||
new weapon2 (src.loc)
|
|
||||||
del src
|
|
||||||
return
|
|
||||||
Reference in New Issue
Block a user