Begins work on new AI.

This commit is contained in:
Neerti
2018-02-17 09:40:22 -05:00
parent fdc367a4b5
commit abb3a5f602
14 changed files with 760 additions and 7 deletions

View File

@@ -0,0 +1,32 @@
// 'Interfaces' are procs that the ai_holder datum uses to communicate its will to the mob its attached.
// The reason for using this proc in the middle is to ensure the AI has some form of compatibility with most mob types,
// since some actions work very differently between mob types (e.g. executing an attack as a simple animal compared to a human).
// The AI can just call holder.IAttack(target) and the mob is responsible for determining how to actually attack the target.
/mob/living/proc/IAttack(atom/movable/AM)
/mob/living/simple_animal/IAttack(atom/movable/AM)
target_mob = AM
return PunchTarget(AM) // TODO: Clean up on SA side.
/mob/living/proc/IRangedAttack(atom/movable/AM)
/mob/living/simple_animal/IRangedAttack(atom/movable/AM)
target_mob = AM
return ShootTarget(AM, src.loc, src)
/mob/living/proc/ISay(message)
/mob/living/proc/IIsAlly(mob/living/L)
return src.faction == L.faction
/mob/living/simple_animal/IIsAlly(mob/living/L)
. = ..()
if(!.) // Outside the faction, try to see if they're friends.
return L in friends
/mob/living/proc/IGetID()
/mob/living/simple_animal/IGetID()
if(myid)
return myid.GetID()