//Returns a list of randomly chosen allies of a certain amount public List <BasicCard> GetAOERandomRangeAllyTargets(int num) { List <BasicCard> targets = GetAOEAllyTargets(); while (targets.Count > num) { targets.RemoveAt(RandomGen.RandomNum(0, targets.Count - 1)); } return(targets); }
public override async Task MoveEffect(CombatInstance inst, List <BasicCard> targets) { foreach (BasicCard card in targets) { string flavorText = $"{inst.GetCardTurn().Signature} buffs {card.Signature} increasing their next attack by 75%."; card.AddBuff(new BuffDebuff() { Name = "Whiskers", Buff = true, Origin = $"({inst.GetCardTurn().Signature})", Description = "Next attack's damage increased by 75%", Attacks = 1, DamagePercentBuff = 0.75 }); List <BasicMove> moves = new List <BasicMove>(); foreach (BasicMove move in card.Moves) { if (move.CurrentCooldown > 0 && move.OnCooldown) { moves.Add(move); } } if (moves.Count == 0) { await MessageHandler.SendMessage(inst.Location, $"{flavorText} They didn't have any moves on cooldown."); } else { var rand = RandomGen.RandomNum(0, moves.Count - 1); moves[rand].CurrentCooldown -= 2; if (moves[rand].CurrentCooldown <= 0) { moves[rand].OnCooldown = false; moves[rand].CurrentCooldown = 0; await MessageHandler.SendMessage(inst.Location, $"{flavorText} {moves[rand].Name}'s cooldown was reduced by 2. It is now off cooldown!"); } else { await MessageHandler.SendMessage(inst.Location, $"{flavorText} {moves[rand].Name}'s cooldown was reduced by 2."); } } } OnCooldown = true; CurrentCooldown = Cooldown; inst.GetCardTurn().Actions--; }
public override async Task MoveEffect(CombatInstance inst, List <BasicCard> targets) { foreach (BasicCard card in targets) { card.AddBuff(new BuffDebuff() { Name = "Hyped", Buff = true, Origin = $"({inst.GetCardTurn().Signature})", Description = "1 bonus action.", BonusActions = 1, Turns = 1 }); var str = ""; List <BuffDebuff> debuffs = new List <BuffDebuff>(); foreach (BuffDebuff buff in card.Effects) { if (!buff.Buff) { debuffs.Add(buff); } } if (debuffs.Count > 0) { BuffDebuff debuffToRemove = debuffs[RandomGen.RandomNum(0, debuffs.Count - 1)]; str += $" and had their {debuffToRemove.Name} debuff removed."; card.Effects.Remove(debuffToRemove); } else { str += $". They had no debuffs to remove."; } await MessageHandler.SendMessage(inst.Location, $"{inst.GetCardTurn().Signature} plays a tune for {card.Signature}. They gain 1 bonus action on their next turn{str}"); } OnCooldown = true; CurrentCooldown = Cooldown; inst.GetCardTurn().Actions--; }
public override async Task MoveEffect(CombatInstance inst, List <BasicCard> targets) { foreach (BasicCard card in targets) { List <int> roll1 = RandomGen.RollDice(1, 20); await MessageHandler.DiceThrow(inst.Location, "1d20", roll1); var flip1 = RandomGen.CoinFlip(); await MessageHandler.CoinFlip(inst.Location, flip1); var damage = roll1[0]; List <int> tempDams; var tempDam = 0; var totalDam = 0; var hits = 0; var shuffled = false; List <BasicCard> shuffledCards = new List <BasicCard>(); //If the first coin flip is heads... if (flip1) { //Roll another d20 and multiply the first d20 by the second List <int> roll2 = RandomGen.RollDice(1, 20); await MessageHandler.DiceThrow(inst.Location, "1d20", roll2); damage = roll1[0] * roll2[0]; await MessageHandler.SendMessage(inst.Location, $"{roll1[0]} * {roll2[0]} = {damage}"); tempDam = inst.GetCardTurn().ApplyDamageBuffs(damage); tempDams = card.TakeDamage(tempDam); totalDam += tempDams[0]; hits++; await MessageHandler.SendMessage(inst.Location, $"{card.Signature} gets stomped on by {inst.GetCardTurn().Signature}. {card.DamageTakenString(tempDams)}"); await Task.Delay(1500); //If the result is even... if (damage % 2 == 0) { card.AddBuff(new BuffDebuff() { Name = "Sticky", Buff = false, Origin = $"({inst.GetCardTurn().Signature})", Description = "Sticky syrup got on you! Your next attack is reduced by 50%", DamagePercentDebuff = 0.5, Attacks = 1 }); } //If the result is odd... else { var count = 0; foreach (BasicCard card2 in inst.CardList) { if (inst.GetCardTurn().Owner != card2.Owner && card.Owner != card2.Owner) { tempDam = inst.GetCardTurn().ApplyDamageBuffs(damage); tempDams = card2.TakeDamage(tempDam); totalDam += tempDams[0]; hits++; await MessageHandler.SendMessage(inst.Location, $"{card2.Signature} gets stomped on by {inst.GetCardTurn().Signature}. {card.DamageTakenString(tempDams)}"); await Task.Delay(1500); count++; } if (count == 2) { break; } } if (count == 0) { tempDam = inst.GetCardTurn().ApplyDamageBuffs(damage); tempDams = card.TakeDamage(tempDam); totalDam += tempDams[0]; hits++; await MessageHandler.SendMessage(inst.Location, $"{card.Signature} gets stomped on by {inst.GetCardTurn().Signature} a second time! {card.DamageTakenString(tempDams)}"); await Task.Delay(1500); tempDam = inst.GetCardTurn().ApplyDamageBuffs(damage); tempDams = card.TakeDamage(tempDam); totalDam += tempDams[0]; hits++; await MessageHandler.SendMessage(inst.Location, $"{card.Signature} gets stomped on by {inst.GetCardTurn().Signature} a third time! {card.DamageTakenString(tempDams)}"); await Task.Delay(1500); } if (count == 1) { tempDam = inst.GetCardTurn().ApplyDamageBuffs(damage); tempDams = card.TakeDamage(damage); totalDam += tempDams[0]; hits++; await MessageHandler.SendMessage(inst.Location, $"{card.Signature} gets stomped on by {inst.GetCardTurn().Signature} a second time! {card.DamageTakenString(tempDams)}"); await Task.Delay(1500); } } } //If the first coin flip is tails... else { //Flip another coin var flip2 = RandomGen.CoinFlip(); await MessageHandler.CoinFlip(inst.Location, flip2); //If the second coin flip is heads... if (flip2) { List <BasicCard> initialCards = new List <BasicCard>(); foreach (BasicCard c in inst.CardList) { initialCards.Add(c); } //Put the current player at the top of the new turn order for (int i = initialCards.Count - 1; i >= 0; i--) { if (initialCards[i].Owner == inst.GetCardTurn().Owner) { shuffledCards.Add(initialCards[i]); initialCards.RemoveAt(i); } } int rand = 0; while (initialCards.Count > 0) { rand = RandomGen.RandomNum(0, initialCards.Count - 1); shuffledCards.Add(initialCards[rand]); initialCards.RemoveAt(rand); } inst.FixTurnNumber(); shuffled = true; List <int> roll3 = RandomGen.RollDice(4, 4, true); await MessageHandler.DiceThrow(inst.Location, "4d4!", roll3); var temp = 0; foreach (int roll in roll3) { temp += roll; } damage *= temp; await MessageHandler.SendMessage(inst.Location, $"{roll1[0]} * {temp} = {damage}"); tempDam = inst.GetCardTurn().ApplyDamageBuffs(damage); tempDams = card.TakeDamage(tempDam); totalDam += tempDams[0]; hits++; await MessageHandler.SendMessage(inst.Location, $"{card.Signature} gets stomped on by {inst.GetCardTurn().Signature}. {card.DamageTakenString(tempDams)}"); await Task.Delay(1500); await MessageHandler.SendMessage(inst.Location, "The battlefield shakes, shuffling the turn order!"); await Task.Delay(1500); } else { List <int> roll4 = RandomGen.RollDice(1, 10); await MessageHandler.DiceThrow(inst.Location, "1d10", roll4); var x = roll4[0]; var result = Math.Pow((Math.Abs((Math.Pow(x, 0.5)) / (Math.Pow(x, 8)) - Math.Log10(x) * x)), 3.14159); damage += (int)result; await MessageHandler.SendMessage(inst.Location, $"{roll1[0]} + {(int)result} = {damage}"); tempDam = inst.GetCardTurn().ApplyDamageBuffs(damage); tempDams = card.TakeDamage(tempDam); totalDam += tempDams[0]; hits++; await MessageHandler.SendMessage(inst.Location, $"{card.Signature} gets super stomped by {inst.GetCardTurn().Signature}! {card.DamageTakenString(tempDams)}"); await Task.Delay(1500); } } if (hits > 1) { await MessageHandler.SendMessage(inst.Location, $"{inst.GetCardTurn().Signature} dealt a total of {totalDam} damage."); } if (shuffled) { inst.CardList = shuffledCards; } } OnCooldown = true; CurrentCooldown = Cooldown; inst.GetCardTurn().Actions--; }