ludumdare50/Assets/Scripts/Gladiator.cs
2022-04-02 14:41:47 -04:00

36 lines
1.0 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 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;
}
}