コード例 #1
0
        public override async Task MoveEffect(CombatInstance inst)
        {
            List <int> rolls = RandomGen.RollDice(4, 5);
            await MessageHandler.DiceThrow(inst.Location, "4d5", rolls);

            int healing = 0;

            foreach (int roll in rolls)
            {
                healing += roll;
            }

            healing = inst.GetCardTurn().ApplyHealingBuffs(healing, true);
            string str       = "";
            var    totalHeal = 0;

            List <BasicCard> allyTargets = inst.GetAOEAllyTargets();

            foreach (BasicCard card in allyTargets)
            {
                var tempHeal = card.Heal(healing, true);
                totalHeal += tempHeal;
                str       += $"\n{card.Signature} heals {tempHeal} HP!";

                card.AddBuff(new BuffDebuff()
                {
                    Name        = "Lighthearted",
                    Buff        = false,
                    Origin      = $"({inst.GetCardTurn().Signature})",
                    Description = "Light Shield.",
                    LightShield = 1,
                    ShieldOnly  = true
                });

                card.AddBuff(new BuffDebuff()
                {
                    Name              = "Lighthearted",
                    Buff              = false,
                    Origin            = $"({inst.GetCardTurn().Signature})",
                    Description       = "20% increased damage.",
                    DamagePercentBuff = 0.20,
                    Attacks           = 1
                });

                card.AddBuff(new BuffDebuff()
                {
                    Name               = "Lighthearted",
                    Buff               = false,
                    Origin             = $"({inst.GetCardTurn().Signature})",
                    Description        = "10% increased defense.",
                    DefensePercentBuff = 0.10,
                    Strikes            = 1
                });
            }

            await MessageHandler.SendMessage(inst.Location, $"{inst.GetCardTurn().Signature} plays a happy ditty!{str}\n{inst.GetCardTurn().Signature} healed a total of {totalHeal} health. All allies gained various buffs.");

            OnCooldown      = true;
            CurrentCooldown = Cooldown;
            inst.GetCardTurn().Actions--;
        }
コード例 #2
0
        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--;
        }
コード例 #3
0
        public override async Task UpdateAsync(CombatInstance inst, BasicCard owner)
        {
            if (inst.RoundNumber != 1)
            {
                Console.WriteLine("A");
                var cute   = 0;
                var fluffy = 0;
                var speedy = 0;
                foreach (UserAccount teammate in inst.GetTeam(owner).Members)
                {
                    foreach (BasicCard card in teammate.ActiveCards)
                    {
                        if (card.Name.Equals("Cute Bunny"))
                        {
                            cute++;
                        }
                        if (card.Name.Equals("Fluffy Angora"))
                        {
                            fluffy++;
                        }
                        if (card.Name.Equals("Speedy Hare"))
                        {
                            speedy++;
                        }
                    }
                }

                if (cute > 0)
                {
                    var success = RandomGen.PercentChance(15 * cute);
                    if (success && owner.CurrentHP < owner.TotalHP)
                    {
                        var heal = 5;
                        heal          = owner.ApplyHealingBuffs(heal, false);
                        heal          = owner.Heal(heal, false);
                        eff.Extra[0] += heal;
                        Status        = $"Healed a total of **{eff.Extra[0]}** HP.\nGained a total of **{eff.Extra[1]}** light shields.\nTotal of **{eff.Extra[2]}** bonus attack damage.";

                        await MessageHandler.SendMessage(inst.Location, $"**(Herd Leader)** {owner.Signature} gained **{heal}** health from **{cute}** Cute Bunnies");
                    }
                }

                if (fluffy > 0)
                {
                    var success = RandomGen.PercentChance(15 * fluffy);
                    if (success)
                    {
                        owner.AddBuff(new BuffDebuff()
                        {
                            Name        = "Herd Shielding",
                            Buff        = true,
                            Origin      = $"(Passive)",
                            Description = $"The herd shields you! You gain 1 light shield.",
                            ShieldOnly  = true,
                            LightShield = 1
                        });
                        eff.Extra[1]++;
                        Status = $"Healed a total of **{eff.Extra[0]}** HP.\nGained a total of **{eff.Extra[1]}** light shields.\nTotal of **{eff.Extra[2]}** bonus attack damage.";

                        await MessageHandler.SendMessage(inst.Location, $"**(Herd Leader)** {owner.Signature} gained **1 light shield** from **{fluffy}** Fluffy Angora");
                    }
                }

                if (speedy > 0)
                {
                    var success = RandomGen.PercentChance(15 * speedy);
                    if (success)
                    {
                        eff.DamageStaticBuff++;
                        eff.Extra[2] = eff.DamageStaticBuff;

                        Status = $"Healed a total of **{eff.Extra[0]}** HP.\nGained a total of **{eff.Extra[1]}** light shields.\nTotal of **{eff.Extra[2]}** bonus attack damage.";

                        await MessageHandler.SendMessage(inst.Location, $"**(Herd Leader)** {owner.Signature} gained **1 permanent bonus damage** from **{speedy}** Fluffy Angora");
                    }
                }

                Console.WriteLine("B");
            }
        }