public bool Update() { // Remove buffs that are past their expiration date. Buffs.RemoveAll(x => x.Expired); Console.WriteLine($"Health on tick:{Health}"); return(false); }
/// <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)); }
//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)); }
/// <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)); }
private void BuffExpirationCheck() { for (int i = Buffs.Count - 1; i >= 0; i--) { Buffs[i].BuffLifetime -= Time.deltaTime; } Buffs.RemoveAll(x => x.BuffLifetime < 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)); }
/// <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(); }
public void RemoveBuff(string name) { Buffs.RemoveAll(buff => buff.Name == name); }
private bool DoneAttackingFunc() { Buffs.RemoveAll(b => b is InvulnerableBuff); return(_ai.FinishedAttacking()); }