public override void Perform(CombatMap map, Point trigger) { owner.Energy(-cost); //owner.Armor(value); UnitPiece target = map.unitManager.GetUnit(trigger); if (target != null) { target.Effect(attribute, Random.Range(value, maxValue + 1)); } }
public void EndTurn() { if (selectedUnit != null) { initiativeOrder.Remove(selectedUnit); initiativeOrder.Add(selectedUnit); selectedUnit.EndTurn(); if (!actionPerformed) { selectedUnit.Effect(Attribute.Energy, 1); } selectedUnit = null; } hasMoved = false; actionPerformed = false; }
public virtual void Tick(Trigger trigger) { foreach (PassiveEffect pe in effects) { if (trigger == pe.trigger) { if (ownerPiece != null) { Debug.Log(passiveName + " pieceTick " + trigger + " to " + owner.unitName); ownerPiece.Effect(pe.attribute, pe.value); } else { owner.ModifyAttribute(pe.attribute, pe.value); } } } }