public string Describe(AvatarModel heroOwner, bool shortV = false) { string text = ""; foreach (KeyValuePair <ParamType, int> kvp in Params) { if ((shortV || (kvp.Key != ParamType.Attack && kvp.Key != ParamType.Health)) && (kvp.Key != ParamType.Speed || kvp.Value != 1)) { string value = "" + kvp.Value; if (kvp.Key == ParamType.DealDamageSpell && heroOwner.SpellDamageAdd() > 0) { value = "*" + (heroOwner.SpellDamageAdd() + kvp.Value) + "*"; } text += kvp.Key.Describe() + ": " + value + ", "; } } if (!shortV) { text += "\n"; } if (CardTarget != CardTarget.Self && CardTarget != CardTarget.Empty) { text += "Cast on: " + CardTarget + ",\n"; } if (IsCastOn != IsCastOn.Target && CardTarget != CardTarget.Empty) { text += "Affects " + IsCastOn.Describe() + ",\n"; } if (CardPersistency != CardPersistency.EveryActionRevalidate && CardPersistency != CardPersistency.WhileHolderAlive && CardPersistency != CardPersistency.Instant && CardPersistency != global::CardPersistency.Minion) { text += CardPersistency + " \n"; } foreach (KeyValuePair <Effect, Card[]> kvp in Effects) { if (kvp.Key != Effect.WhileAlive) { text += kvp.Key + ": "; } foreach (Card card in kvp.Value) { text += card.Describe(heroOwner, true) + ", "; } } if (!shortV) { text += "\n"; } return(text); }
public CastedCard(AvatarModel castingBy, AvatarModel castingOn, Card c) { Card = c; if (c.Params.ContainsKey(ParamType.DealDamage)) { Params.Add(CastedCardParamType.DealDamage, c.Params[ParamType.DealDamage]); } if (c.Params.ContainsKey(ParamType.Heal)) { Params.Add(CastedCardParamType.Heal, c.Params[ParamType.Heal]); } if (c.Params.ContainsKey(ParamType.HeroDrawsCard)) { Params.Add(CastedCardParamType.HeroDrawsCard, c.Params[ParamType.HeroDrawsCard]); } if (c.Params.ContainsKey(ParamType.AttackAdd)) { Params.Add(CastedCardParamType.AttackAdd, c.Params[ParamType.AttackAdd]); } if (c.Params.ContainsKey(ParamType.HealthAdd)) { Params.Add(CastedCardParamType.HealthAdd, c.Params[ParamType.HealthAdd]); } if (c.Params.ContainsKey(ParamType.HealthAddOfOtherFriendlyMinionNumber)) { Params.Add(CastedCardParamType.HealthAdd, AvatarModel.MyMinionsNumber(castingOn.GetMyHero()) - 1); //because itself doesn't count and its already casted } if (c.Params.ContainsKey(ParamType.AttackAddOfOtherFriendlyMinionNumber)) { Params.Add(CastedCardParamType.AttackAdd, AvatarModel.MyMinionsNumber(castingOn.GetMyHero()) - 1); //because itself doesn't count and its already casted } if (c.Params.ContainsKey(ParamType.Taunt)) { Params.Add(CastedCardParamType.Taunt, c.Params[ParamType.Taunt]); } if (c.Params.ContainsKey(ParamType.Sticky)) { Params.Add(CastedCardParamType.Sticky, 1); } if (c.Params.ContainsKey(ParamType.Destroy)) { Params.Add(CastedCardParamType.Destroy, 1); } if (c.Params.ContainsKey(ParamType.SpellDamageAdd)) { Params.Add(CastedCardParamType.SpellDamageAdd, c.Params[ParamType.SpellDamageAdd]); } if (c.Params.ContainsKey(ParamType.DealDamageSpell)) { Params.Add(CastedCardParamType.DealDamageSpell, c.Params[ParamType.DealDamageSpell] + castingBy.SpellDamageAdd()); } if (c.Params.ContainsKey(ParamType.HealFull)) { Params.Add(CastedCardParamType.HealFull, 1); } if (c.Params.ContainsKey(ParamType.ManaCrystalAdd)) { Params.Add(CastedCardParamType.ManaCrystalAdd, c.Params[ParamType.ManaCrystalAdd]); } if (c.Params.ContainsKey(ParamType.ManaCrystalEmptyAdd)) { Params.Add(CastedCardParamType.ManaCrystalEmptyAdd, c.Params[ParamType.ManaCrystalEmptyAdd]); } if (c.Params.ContainsKey(ParamType.ArmorAdd)) { Params.Add(CastedCardParamType.ArmorAdd, c.Params[ParamType.ArmorAdd]); } if (c.Params.ContainsKey(ParamType.TakeControl)) { castingOn.GetMyHero().Minions.Remove(castingOn); castingOn.Creator = castingBy.GetMyHero(); castingBy.Minions.Add(castingOn); castingOn.MovesLeft = castingOn.Card.Params.ContainsKey(ParamType.Charge)?castingOn.Card.Params[ParamType.Speed]:0; } if (c.Params.ContainsKey(ParamType.Charge)) { castingOn.RefillMovements(); } }