Example #1
0
 public bool Update()
 {
     // Remove buffs that are past their expiration date.
     Buffs.RemoveAll(x => x.Expired);
     Console.WriteLine($"Health on tick:{Health}");
     return(false);
 }
Example #2
0
    /// <summary>
    /// Method is called at the end of each turn.
    /// </summary>
    public virtual void OnTurnEnd()
    {
        Buffs.FindAll(b => b.Duration == 0).ForEach(b => { b.Undo(this); });
        Buffs.RemoveAll(b => b.Duration == 0);
        Buffs.ForEach(b => { b.Duration--; });

        SetState(new UnitStateNormal(this));
    }
Example #3
0
    //MoveShip ();


    //TODO 100
    //int number = cellgrid.GetComponents<RectangularHexGridGenerator>
    /// <summary>
    /// Method is called at the end of each turn.
    /// </summary>
    public override void OnTurnEnd()
    {
        Debug.Log("Space SpaceMover OnTurnEnd called");
        Buffs.FindAll(b => b.Duration == 0).ForEach(b => { b.Undo(this); });
        Buffs.RemoveAll(b => b.Duration == 0);
        Buffs.ForEach(b => { b.Duration--; });

        SetState(new UnitStateNormal(this));
    }
Example #4
0
    /// <summary>
    /// Method is called at the end of each turn.
    /// </summary>
    public virtual void OnTurnEnd()
    {
        Buffs.FindAll(b => b.Duration == 0).ForEach(b => { b.Undo(this); });
        Buffs.RemoveAll(b => b.Duration == 0);
        Buffs.ForEach(b => { b.Duration--; });
        Animator anim = GetComponentInChildren <Animator>();

        SetState(new UnitStateNormal(this));
    }
Example #5
0
    private void BuffExpirationCheck()
    {
        for (int i = Buffs.Count - 1; i >= 0; i--)
        {
            Buffs[i].BuffLifetime -= Time.deltaTime;
        }

        Buffs.RemoveAll(x => x.BuffLifetime < 0);
    }
Example #6
0
    /// <summary>
    /// Method is called at the end of each turn.
    /// </summary>
    public virtual void OnTurnEnd()
    {
        Buffs.FindAll(b => b.Duration == 0).ForEach(b => { b.Undo(this); });
        Buffs.RemoveAll(b => b.Duration == 0);
        Buffs.ForEach(b => { b.Duration--; });

        //handlecapture in this method
        if (canCapture && isAbleToCapture)
        {
        }

        ResetToNeutralState();
        prevPosition = this.transform.position;
        prevCell     = Cell;
        SetState(new UnitStateNormal(this));
    }
Example #7
0
    /// <summary>
    /// Method is called at the end of each turn.
    /// </summary>
    public virtual void OnTurnEnd()
    {
        Buffs.FindAll(b => b.Duration == 0).ForEach(b => { b.Undo(this); });
        Buffs.RemoveAll(b => b.Duration == 0);
        Buffs.ForEach(b => { b.Duration--; });

        SetState(new UnitStateNormal(this));
        isTurnEnd = true;

        if (this.tag == "Player")
        {
            int nextIndex = this.GetComponent <Avatar>().AvatarIndex + 1;
            if (nextIndex > 3)
            {
                nextIndex = 0;
            }
            moveToNextAvatar(nextIndex);
        }

        //Debug.Log("Player Number: "+PlayerNumber);
        //selectUnitBtn();
    }
Example #8
0
 public void RemoveBuff(string name)
 {
     Buffs.RemoveAll(buff => buff.Name == name);
 }
Example #9
0
 private bool DoneAttackingFunc()
 {
     Buffs.RemoveAll(b => b is InvulnerableBuff);
     return(_ai.FinishedAttacking());
 }