43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Gladiator : AIEntity
|
|
{
|
|
// Start is called before the first frame update
|
|
override protected void Start()
|
|
{
|
|
base.Start();
|
|
base.entityName = "Gladiator";
|
|
base.enemies = new string[]{"Monster", "Vampire"};
|
|
}
|
|
|
|
override protected void Update(){
|
|
base.Update();
|
|
if(bloodTokens <= 0){
|
|
OnEmpty();
|
|
}
|
|
}
|
|
|
|
override protected bool IsTargetable(Entity other){
|
|
foreach (string name in enemies){
|
|
if(other.entityName == name && other.IsAlive()){
|
|
//If it is the vampire: check if it is in safezone
|
|
if(other.entityName == "Vampire"){
|
|
VampireEntity vampireEntity = other.GetComponent<VampireEntity>();
|
|
if(vampireEntity is null){
|
|
return false;
|
|
}
|
|
if(vampireEntity.IsInSafeZone()){
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
}
|