public virtual void InvokeAction(MingmingBattleLogic source, MingmingBattleLogic target, CardAlignment cardAlignment) { OnInvoked?.Invoke(); //PerformAnimation(source, target); source.OnTriggerAnimation(PerformAnimation, target); }
public override void ApplyStatus(MingmingBattleLogic mingming, int count) { int currentCount = mingming.GetStatusCount(this); int _count = Mathf.Clamp(count, count, maxCount - currentCount); base.ApplyStatus(mingming, _count); }
public override void DoEffect(MingmingBattleLogic mingming) { if (constraint.MingmingMeetsConstraint(mingming)) { action.InvokeAction(mingming, mingming, alignment); } }
public override void InvokeAction(MingmingBattleLogic source, MingmingBattleLogic target, CardAlignment cardAlignment) { int healAmount = Rules.GetHealAmount(source, target, HealPower); target.TakeDamage(-healAmount, source); base.InvokeAction(source, target, cardAlignment); }
public override void InvokeAction(MingmingBattleLogic source, MingmingBattleLogic target, CardAlignment cardAlignment) { float damage = Rules.Instance.GetAttackDamage(source, target, cardAlignment, AttackPower); target.TakeDamage(Mathf.FloorToInt(damage), source); base.InvokeAction(source, target, cardAlignment); }
public override void DoEffect(MingmingBattleLogic mingming) { int count = mingming.GetStatusCount(this); int dmg = GetDamage(mingming.TotalHealth, count); mingming.TakeDamage(dmg, null); UserMessage.Instance.SendMessageToUser($"{mingming.Name} took {dmg} {GetTooltipHeader(count)} damage"); }
public override void InvokeAction(CardAction cardAction, MingmingBattleLogic source, MingmingBattleLogic target, Card card) { var controller = FindObjectsOfType <PartyController>().First(m => m.HasMingming(target)); //should never be null foreach (var mingming in controller.Mingmings.Where(m => m.IsInPlay)) { cardAction.InvokeAction(source, mingming.Logic, card.CardAlignment); } }
public override void InvokeAction(MingmingBattleLogic source, MingmingBattleLogic target, CardAlignment cardAlignment) { OnInvoked?.Invoke(); if (Constraint.MingmingMeetsConstraint(source)) { Action.InvokeAction(source, target, cardAlignment); } }
public override void DoEffect(MingmingBattleLogic mingming) { int count = mingming.GetStatusCount(this); if (count > 1) { UserMessage.Instance.SendMessageToUser($"{mingming.Name} is {name} for {count} more turn(s)"); } mingming.ApplyStatus(this, -1); }
public virtual bool CanUseCard(MingmingBattleLogic source, Card card) { bool hasEnergy = source.EnergyAvailable >= card.EnergyCost; if (!hasEnergy) { UserMessage.Instance.SendMessageToUser($"{source.Name} does not have the required energy. Needs {card.EnergyCost}"); } return(hasEnergy && MingmingMeetsConstraint(source)); }
public override bool MingmingMeetsConstraint(MingmingBattleLogic source) { bool MeetsStatusConstraint = source.HasStatus(StatusConstraint.Status) == StatusConstraint.HasStatus; if (!MeetsStatusConstraint) { string canHave = StatusConstraint.HasStatus ? "MUST" : "CANNOT"; UserMessage.Instance.SendMessageToUser($"{source.Name} {canHave} have the status: {StatusConstraint.Status.name}"); } return(MeetsStatusConstraint); }
public override bool MingmingMeetsConstraint(MingmingBattleLogic source) { bool meetsStatusConstraint = StatusConstraints.All(sc => source.HasStatus(sc.Status) == sc.HasStatus); if (!meetsStatusConstraint) { var statusConstraint = StatusConstraints.FirstOrDefault(sc => source.HasStatus(sc.Status) != sc.HasStatus); string canHave = statusConstraint.HasStatus ? "MUST" : "CANNOT"; UserMessage.Instance.SendMessageToUser($"{source.Name} {canHave} have the status: {statusConstraint.Status.name}"); } return(meetsStatusConstraint); }
public int GetAttackDamage(MingmingBattleLogic source, MingmingBattleLogic target, CardAlignment cardAlignment, float power) { float _modifier = GetModifier(source.GetMingmingAlignment, target.GetMingmingAlignment, cardAlignment); float damage = GetLevelModifier(source.Level); damage *= (float)power * source.Attack / target.Defense; damage = (float)(damage / 40) + 2; //Debug.Log($"{source.name} {source.GetInstanceID()} attacks {target.name} {target.GetInstanceID()} for {damage} damage.\nModifier: {_modifier}"); damage *= _modifier; return(Mathf.FloorToInt(damage)); }
public override void ApplyStatus(MingmingBattleLogic mingming, int count) { var value = (float)ModifierProperty.GetValue(mingming); var changeValue = Modifier * Mathf.Abs(count); base.ApplyStatus(mingming, count); if (count > 0) { ModifierProperty.SetValue(mingming, value * changeValue); } else { ModifierProperty.SetValue(mingming, value / changeValue); } }
public virtual void RemoveStatus(MingmingBattleLogic mingming) { mingming.RemoveStatus(this); }
public bool CanUseCard(MingmingBattleLogic source) => !PlayedThisTurn && Data.CardConstraint.CanUseCard(source, this);
public virtual void ApplyStatus(MingmingBattleLogic mingming, int count) { mingming.ApplyStatus(this, count); }
public static int GetHealAmount(MingmingBattleLogic source, MingmingBattleLogic target, float power) { float healAmount = GetLevelModifier(source.Level) * power * source.Attack / 2; return(Mathf.FloorToInt(Mathf.Clamp(healAmount, 0, target.TotalHealth - target.CurrentHealth))); }
public IEnumerator InvokeActions(MingmingBattleLogic source, MingmingBattleLogic target) => Data.InvokeActionCoroutine(source, target, this);
public override void DoEffect(MingmingBattleLogic mingming) { base.DoEffect(mingming); mingming.ApplyStatus(this, -1); }
public virtual bool MingmingMeetsConstraint(MingmingBattleLogic source) => true;
public override void InvokeAction(MingmingBattleLogic source, MingmingBattleLogic target, CardAlignment cardAlignment) { FindObjectsOfType <PartyController>().First(m => m.HasMingming(source)).DrawCards(numberOfCards); base.InvokeAction(source, target, cardAlignment); }
public override void InvokeAction(MingmingBattleLogic source, MingmingBattleLogic target, CardAlignment cardAlignment) { //TODO add card alignment modifier? target.AddEnergy(EnergyAdded); base.InvokeAction(source, target, cardAlignment); }
public static int GetCurrentStateScore(this MingmingBattleLogic mingming) { int statusScore = mingming.GetStatuses().Aggregate(0, (score, pair) => score += pair.Key.GetScore(pair.Value)); return(mingming.CurrentHealth * 2 + statusScore); }
public override void InvokeAction(MingmingBattleLogic source, MingmingBattleLogic target, CardAlignment cardAlignment) { Status.RemoveStatus(target); base.InvokeAction(source, target, cardAlignment); }
public override void DoEffect(MingmingBattleLogic mingming) { }
public Mingming GetMingming(MingmingBattleLogic logic) { return(Mingmings[logic.Id]); }
public abstract void DoEffect(MingmingBattleLogic mingming);
public override void InvokeAction(CardAction cardAction, MingmingBattleLogic source, MingmingBattleLogic target, Card card) { cardAction.InvokeAction(source, target, card.CardAlignment); }
public override void RemoveStatus(MingmingBattleLogic mingming) { ModifierProperty.SetValue(mingming, 1); base.RemoveStatus(mingming); }