예제 #1
0
        public static async Task SkipTurn(CombatInstance inst, BasicCard player)
        {
            player.IsTurn = false;
            await player.TurnTick();

            await NextTurn(inst);
        }
예제 #2
0
        public override void Update(CombatInstance inst, BasicCard owner)
        {
            var playerCount = inst.CardList.Count;

            eff.DamageStaticBuff = 1 * playerCount;

            Status = $"Currently at **{eff.DamageStaticBuff}** bonus damage.";
        }
예제 #3
0
        public override void Update(CombatInstance inst, BasicCard owner)
        {
            var playerCount = inst.CardList.Count;

            eff.DamagePercentBuff = 0.01 * (double)playerCount;

            Status = $"Currently at **{eff.DamagePercentBuff*100.0}%** increased damage.";
        }
예제 #4
0
        public static async Task RemovePlayerFromCombat(CombatInstance inst, UserAccount player)
        {
            var team = inst.GetTeam(player);

            inst.Players.Remove(player);

            var       turnskip = false;
            BasicCard skipCard = null;

            foreach (BasicCard card in player.ActiveCards)
            {
                //Remove any markers corresponding to the cards to be removed from combat
                var turnnum = inst.CardList.IndexOf(card);
                foreach (BasicCard card2 in inst.CardList)
                {
                    for (int i = card2.Markers.Count - 1; i >= 0; i--)
                    {
                        if (card2.Markers[i].OriginTurnNum == turnnum)
                        {
                            card2.Markers.RemoveAt(i);
                        }
                    }
                }

                inst.CardList.Remove(card);

                if (turnnum <= inst.TurnNumber)
                {
                    inst.TurnNumber--;
                }
                if (card.IsTurn)
                {
                    turnskip = true;
                    skipCard = card;
                }
            }

            inst.GetTeam(player).Members.Remove(player);
            player.ResetCombatFields(inst.IsDuel);

            await inst.PassiveUpdatePlayerLeft();

            await MessageHandler.UserForfeitsCombat(inst.Location, player);

            if (inst.IsDuel)
            {
                await CheckTeamElimination(inst, team);
            }

            if (turnskip)
            {
                await SkipTurn(inst, skipCard);
            }

            SaveInstances();
        }
예제 #5
0
        public override void Update(CombatInstance inst, BasicCard owner)
        {
            var playerCount = -1;

            foreach (UserAccount user in inst.GetTeam(inst.GetCardTurn()).Members)
            {
                foreach (BasicCard allyCard in user.ActiveCards)
                {
                    playerCount++;
                }
            }

            eff.DamagePercentBuff = 0.05 * playerCount;

            Status = $"Currently at **{eff.DamagePercentBuff*100.0}%** bonus damage.";
        }
예제 #6
0
        public static async Task UseMove(CombatInstance inst, BasicCard owner, BasicMove move, List <BasicCard> targets)
        {
            await move.MoveEffect(inst, targets);

            if (owner.Actions <= 0)
            {
                await owner.TurnTick();

                owner.Actions = owner.TotalActions;
                owner.IsTurn  = false;
                await NextTurn(inst);
            }
            else
            {
                await MessageHandler.SendMessage(inst.Location, $"It is {owner.Signature}'s turn... Again!");
            }
        }
예제 #7
0
 //Copies all essential elements from one card to this one
 public void CopyCard(BasicCard card)
 {
     Name = card.Name;
     Moves.Clear();
     Moves.AddRange(card.Moves);
     Passive      = card.Passive;
     Picture      = card.Picture;
     HasUltimate  = card.HasUltimate;
     HasPassive   = card.HasPassive;
     Dead         = card.Dead;
     TotalHP      = card.TotalHP;
     CurrentHP    = card.CurrentHP;
     TotalActions = card.TotalActions;
     Actions      = card.Actions;
     IsPuppet     = card.IsPuppet;
     CanPassTurn  = card.CanPassTurn;
     DeathMessage = card.DeathMessage;
     Effects.Clear();
     Effects.AddRange(card.Effects);
     Markers.Clear();
     Markers.AddRange(card.Markers);
 }
예제 #8
0
        public override async Task UpdateAsync(CombatInstance inst, BasicCard owner)
        {
            if (inst.RoundNumber != 1)
            {
                BasicCard lowest   = null;
                var       lowestHP = 1.0;
                foreach (UserAccount teammate in inst.GetTeam(owner).Members)
                {
                    foreach (BasicCard card in teammate.ActiveCards)
                    {
                        if (card.HPPercentage() < lowestHP && !card.Dead && card.Owner != owner.Owner)
                        {
                            Console.WriteLine($"{card.HPPercentage()}% health detected");
                            lowestHP = card.HPPercentage();
                            lowest   = card;
                        }
                    }
                }

                if (lowestHP < 1.0 && lowest != null)
                {
                    var heal = 10;
                    heal          = owner.ApplyHealingBuffs(heal, false);
                    heal          = lowest.Heal(heal, false);
                    eff.Extra[0] += heal;
                    Status        = $"Healed a total of {eff.Extra[0]} HP.";

                    await MessageHandler.SendMessage(inst.Location, $"{owner.Signature} gives {lowest.Signature} a spare carrot! They restore {heal} HP.");
                }
                else
                {
                    //Nobody needed healing
                    await MessageHandler.SendMessage(inst.Location, $"{owner.Signature} has a spare carrot but nobody needed healing!");
                }
            }
        }
예제 #9
0
 public virtual async Task UpdateAsync(CombatInstance instance, BasicCard owner)
 {
     await Task.Run(null);
 }
예제 #10
0
 public virtual void Update(CombatInstance inst, BasicCard owner)
 {
 }
예제 #11
0
 public override void Update(CombatInstance inst, BasicCard owner)
 {
 }
예제 #12
0
 public override void Update(CombatInstance inst, BasicCard owner)
 {
     eff.DefenseSetBuff = 0;
 }
예제 #13
0
 public Team GetTeam(BasicCard player)
 {
     return(GetTeam(UserHandler.GetUser(player.Owner)));
 }
예제 #14
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");
            }
        }