private static void Attack(Hero hero, ICard <CardType> nextCard, ICard <CardType> heroCard, Slot <ICard <CardType> > newSlot) { if (hero.Weapon > 0) { int heroWeapon = hero.Weapon; int monsterHealth = nextCard.Value; int minValue = Math.Min(heroWeapon, monsterHealth); hero.UseWeapon(minValue); nextCard.Value -= minValue; } else { int heroHealth = heroCard.Value; int monsterHealth = nextCard.Value; int minValue = Math.Min(heroHealth, monsterHealth); heroCard.Value -= minValue; nextCard.Value -= minValue; } if (nextCard.Value <= 0) { newSlot.Card = GameBuilder.GetRandomRewardCard(); } }
private static void ChooseGear(int meters, Hero player) { if (METERS_REQUIRED_LEVEL_2 <= meters && meters < METERS_REQUIRED_LEVEL_3 && player.Level == 1) { player.LevelUp(new BigSword(), new Teleporting()); } else if (meters >= METERS_REQUIRED_LEVEL_3 && player.Level == 2) { player.LevelUp(new Bow(), new Flying()); } else if (meters >= FAR_FAR_AWAY && player.Level == 3) { player.UseWeapon(new Gun()); } }