public void Attack(IMonsterCard monster) { if (this.AttackPoints > monster.AttackPoints) { // EVENT HERE } }
public (MonsterAttribute Attr, int Score) DecideAttributeToPlay(IMonsterCard m) { Console.WriteLine($"You pulled card {m.Name} ({m.Description})"); var c = 1; Console.WriteLine("Choose your attribute to play..."); foreach (var stat in m.Stats) { Console.WriteLine($"{c} - {stat.Key} \t\t\t {stat.Value}"); c++; } var choice = Console.ReadKey().KeyChar.ToString(); if (int.TryParse(choice, out int i)) { return(m.Stats.ToList()[i - 1].Key, m.Stats.ToList()[i - 1].Value); } else { Console.WriteLine("Invalid Choice..."); DecideAttributeToPlay(m); } return(MonsterAttribute.Earth, 0); }
public ICombatResult Battle(string attackerId, string defenderId, int attackingSide = 1) { IMonsterCard attacker = GetAttacker(attackerId, attackingSide); IMonsterCard defender = GetDefender(defenderId, attackingSide); return(BattleCalculator.Attacks((MonsterCard)attacker, (MonsterCard)defender)); }
public (MonsterAttribute Attr, int Score) DecideAttributeToPlay(IMonsterCard m) { //we just play the highest attribute we have - simple //pretend to think Console.WriteLine("Thinking...."); Thread.Sleep(3000); var attr = m.Stats.Aggregate((l, r) => l.Value > r.Value ? l : r).Key; return(attr, m.Stats[attr]); }
public MonsterCardEntity(IMonsterCard card) { Name = card.Name; Atk = card.Atk; Def = card.Def; Hp = card.Hp; Description = card.Description; CardReference = card; MainCardType = card.Types.FirstOrDefault().Icon; SecondaryCardType = card.Types.Skip(1).FirstOrDefault()?.Icon; }
public static double GetMultiplier(IMonsterCard attacker, IMonsterCard defender) { var elements = attacker.Types; double multiplier = 0; foreach (var element in elements) { var tempMultiplier = GetBasicMultiplier(element, defender.Types); multiplier += tempMultiplier; } return((double)(multiplier / elements.Count())); }
public static void ChangeMonsterPoints_Params(IMonsterCard target, int attackBy, int defenseBy) { target.ChangeAttack(attackBy); target.ChangeDefense(defenseBy); }
public PolymorphSides(IMonsterCard leftCard, IMonsterCard rightCard) { LeftCard = leftCard; RightCard = rightCard; }
public void Player2PlayCard(string cardId) { IMonsterCard card = GetCardFromDeck(cardId, playerNum: 2) as IMonsterCard; Player2CardsOnBoard.PlayCardOnBoard(card); }