public void UpdateHostilePosition(IHostile hostile)
        {
            var newList = HostilePositions.Where(x => x.Id != hostile.Id).ToList();

            newList.Add(hostile);
            HostilePositions = newList;
        }
示例#2
0
 public bool SurvivalHostileAggro(double timeStamp)
 {
     if (Player.Local.Surroundings.HasHostiles)
     {
         Hostile hostile = worlditem.GetOrAdd <Hostile> ();
         if (!hostile.HasPrimaryTarget)
         {
             //we're not currently attacking anything
             //so attack the first thing that's attacking the player
             IHostile target = Player.Local.Surroundings.Hostiles [0];
             hostile.PrimaryTarget = target.hostile;
         }
     }
     return(true);
 }
示例#3
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.tag.Equals("hostile"))
        {
            IHostile sur = collision.gameObject.GetComponent <SurikenControl>();
            LifePoint -= sur.GetDemage();

            if (LifePoint > 0)
            {
                animator.SetTrigger("Damage");
            }
            else
            {
                animator.SetTrigger("Dead");
                Debug.Log("You'e dead!");
            }
        }
    }
 public void AddHostilePosition(IHostile hostile)
 {
     HostilePositions.Add(hostile);
 }