コード例 #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);
 }
コード例 #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));
    }
コード例 #3
0
ファイル: SpaceMover.cs プロジェクト: AndrewMiBoyd/Inertia
    //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));
    }
コード例 #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));
    }
コード例 #5
0
ファイル: Entity.cs プロジェクト: FeXyK/Authory
    private void BuffExpirationCheck()
    {
        for (int i = Buffs.Count - 1; i >= 0; i--)
        {
            Buffs[i].BuffLifetime -= Time.deltaTime;
        }

        Buffs.RemoveAll(x => x.BuffLifetime < 0);
    }
コード例 #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));
    }
コード例 #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();
    }
コード例 #8
0
ファイル: BaseCombatant.cs プロジェクト: w1r2p1/unitrpg
 public void RemoveBuff(string name)
 {
     Buffs.RemoveAll(buff => buff.Name == name);
 }
コード例 #9
0
ファイル: SkeletonKing.cs プロジェクト: zwand19/zerds
 private bool DoneAttackingFunc()
 {
     Buffs.RemoveAll(b => b is InvulnerableBuff);
     return(_ai.FinishedAttacking());
 }