Beispiel #1
0
 public Elf(string name) : base(name)
 {
     Health = 4;
     Attacks.Add("Elven special", 2.5);
     Defends.Add("Potion", 2.5);
     Defends.Add("Confusion", 3);
 }
Beispiel #2
0
 /// <summary>
 /// For however many times
 /// Add a new Attack to the Attacks list
 /// </summary>
 /// <param name="addAttackWindow"></param>
 private void AddAttackToList(AddAttackWindow addAttackWindow)
 {
     for (int i = 0; i < addAttackWindow.MultiAttackAmount; i++)
     {
         Attacks.Add(addAttackWindow.NewAttack);
     }
 }
Beispiel #3
0
    // Use this for initializationl
    public override void Start()
    {
        base.Start();

        //set up basic stats
        MaxHitPoints = 120;
        HitPoints    = 120;

        //set up the list of attacks
        PlayerAttack attack1 = new PlayerAttack();

        attack1.Name        = "Gas Blast";
        attack1.Description = "Unleashes a blast of foul-smelling gas upon the target, dealing damage.";
        attack1.Power       = 240;
        attack1.Accuracy    = 100;
        attack1.Type        = AttackType.Damage;

        PlayerAttack attack2 = new PlayerAttack();

        attack2.Name        = "Can of Beans";
        attack2.Description = "A delicious can of baked beans, scientifically proven to promote good heart health.";
        attack2.Power       = MaxHitPoints;
        attack2.Accuracy    = 100;
        attack2.Type        = AttackType.Heal;

        Attacks.Add(attack1);
        Attacks.Add(attack2);
    }
Beispiel #4
0
    // Use this for initializationl
    public override void Start()
    {
        base.Start();

        //set up basic stats
        MaxHitPoints = 120;
        HitPoints    = 120;

        //set up the list of attacks
        PlayerAttack attack1 = new PlayerAttack();

        attack1.Name        = "Slam Dunk";
        attack1.Description = "Scores a totally radical slam dunk, damaging a single target.";
        attack1.Power       = 120;
        attack1.Accuracy    = 100;
        attack1.Type        = AttackType.Damage;

        PlayerAttack attack2 = new PlayerAttack();

        attack2.Name        = "Gatorade\u2122 Sports Drink";
        attack2.Description = "Real athletes literally sweat this substance.  Restores health.";
        attack2.Power       = MaxHitPoints;
        attack2.Accuracy    = 100;
        attack2.Type        = AttackType.Heal;

        Attacks.Add(attack1);
        Attacks.Add(attack2);

        originalBasketball         = transform.GetChild(0);
        originalBasketballLocalPos = originalBasketball.transform.localPosition;

        attacksketball = Instantiate(originalBasketball) as Transform;
        attacksketball.renderer.enabled   = false;
        attacksketball.transform.position = transform.position;
    }
Beispiel #5
0
 public Wizard(string name) : base(name)
 {
     Health = 3;
     Attacks.Add("Wizard special", 2.5);
     Defends.Add("Summon", 2);
     Defends.Add("wand wave", 1.5);
 }
Beispiel #6
0
        /// <summary>
        /// Display input in text boxes and lists
        /// </summary>
        /// <param name="monsterToDisplay"></param>
        private void DisplayMonsterStats(Monster monsterToDisplay)
        {
            txtAC.Text    = monsterToDisplay.ArmorClass.ToString();
            txtDEX.Text   = monsterToDisplay.DexterityModifier.ToString();
            txtHP.Text    = monsterToDisplay.TotalHealth.ToString();
            txtName.Text  = monsterToDisplay.Name;
            txtPP.Text    = monsterToDisplay.PassivePerception.ToString();
            txtSpeed.Text = monsterToDisplay.PassivePerception.ToString();
            cmbMonsterTypes.SelectedValue = monsterToDisplay.Type;
            chkMultiattack.IsChecked      = monsterToDisplay.Multiattack;

            foreach (DamageType resistance in monsterToDisplay.Resistances)
            {
                lstResistances.Items.Add(resistance);
                Resistances.Add(resistance);
            }

            foreach (DamageType immunity in monsterToDisplay.Immunities)
            {
                lstImmunities.Items.Add(immunity);
                Immunities.Add(immunity);
            }

            foreach (Attack attack in monsterToDisplay.Attacks)
            {
                lstAttacks.Items.Add(attack);
                Attacks.Add(attack);
            }

            foreach (MonsterSpecial monsterSpecial in monsterToDisplay.MonsterSpecials)
            {
                lstMonsterSpecials.Items.Add(monsterSpecial);
                MonsterSpecials.Add(monsterSpecial);
            }
        }
Beispiel #7
0
    public override void Start()
    {
        base.Start();
        if (CanBecomeInvisible)
        {
            Features.Add(TypeOfAttack.Invisibility);
        }
        if (HasProtection)
        {
            Features.Add(TypeOfAttack.Protection);
        }

        if (HasObstructionAttack)
        {
            Attacks.Add(TypeOfAttack.Obstruction);
        }
        if (HasShootAttack)
        {
            Attacks.Add(TypeOfAttack.Shooting);
        }
        if (HasStaticAttack)
        {
            Attacks.Add(TypeOfAttack.Static);
        }
        if (HasCourseAttack)
        {
            Attacks.Add(TypeOfAttack.Course);
        }
        Generator    = GameObject.Find("Generator");
        Player       = Generator.GetComponent <Generator>().Player;
        CurrentLevel = Generator.GetComponent <Generator>().CurrentLevel;
        // Move();
    }
Beispiel #8
0
        public Class(string name)
        {
            Name = name;

            if (Name == "Warrior")
            {
                Attacks.Add(new Attack
                {
                    Name            = "Punch",
                    ActionPointCost = 2
                });
                Attacks.Add(new Attack
                {
                    Name            = "Kick",
                    ActionPointCost = 3
                });
                Attacks.Add(new Attack
                {
                    Name            = "Destroy",
                    ActionPointCost = 6
                });
            }
            else if (Name == "Archer")
            {
                Attacks.Add(new Attack
                {
                    Name            = "Shoot",
                    ActionPointCost = 4
                });
                Attacks.Add(new Attack
                {
                    Name            = "Snipe",
                    ActionPointCost = 8
                });
                Attacks.Add(new Attack
                {
                    Name            = "Obliterate",
                    ActionPointCost = 10
                });
            }
            else if (Name == "Mage")
            {
                Attacks.Add(new Attack
                {
                    Name            = "Fireball",
                    ActionPointCost = 3
                });
                Attacks.Add(new Attack
                {
                    Name            = "Iceshard",
                    ActionPointCost = 1
                });
                Attacks.Add(new Attack
                {
                    Name            = "Mind F**k",
                    ActionPointCost = 7
                });
            }
        }
Beispiel #9
0
        // adds possible attacks for man unit
        public void AddAttacksMan(Unit man)
        {
            int   yDir  = man.MoveDir;
            Coord manXY = new Coord(man.UnitCoords.X, man.UnitCoords.Y);

            BoardCell curr = Board.Cells[manXY.X, manXY.Y];

            // check if cell in -> dir is on board and contains unit
            // check if cell in -> 2*dir is on board and doesn't contain unit
            Coord dir = new Coord(1, yDir);

            if (IsCoordsOnBoard(manXY + dir))
            {
                Coord next = manXY + dir;
                if (Board.Cells[next.X, next.Y].Occupant != null && Board.Cells[next.X, next.Y].Occupant.Commander != CurrPlayer)
                {
                    BoardCell defender = Board.Cells[next.X, next.Y];

                    Coord final = next + dir;
                    if (IsCoordsOnBoard(final) && Board.Cells[final.X, final.Y].Occupant == null)
                    {
                        BoardCell finish = Board.Cells[final.X, final.Y];
                        Attacks.Add(new Attack(curr, finish, defender, CurrPlayer, defender.Occupant.Commander));

                        // Ensure cells that can move has no duplicates
                        if (!CellsAble.Contains(curr))
                        {
                            CellsAble.Add(curr);
                        }
                    }
                }
            }

            dir = new Coord(-1, yDir);
            if (IsCoordsOnBoard(manXY + dir))
            {
                Coord next = manXY + dir;
                if (Board.Cells[next.X, next.Y].Occupant != null && Board.Cells[next.X, next.Y].Occupant.Commander != CurrPlayer)
                {
                    BoardCell defender = Board.Cells[next.X, next.Y];

                    Coord final = next + dir;
                    if (IsCoordsOnBoard(final) && Board.Cells[final.X, final.Y].Occupant == null)
                    {
                        BoardCell finish = Board.Cells[final.X, final.Y];
                        Attacks.Add(new Attack(curr, finish, defender, CurrPlayer, defender.Occupant.Commander));

                        // Ensure cells that can move has no duplicates
                        if (!CellsAble.Contains(curr))
                        {
                            CellsAble.Add(curr);
                        }
                    }
                }
            }
        }
Beispiel #10
0
 protected override void Start()
 {
     base.Start();
     manager = BulletManager.instance;
     Attacks.Add(attack1);
     atkPatternLen = Attacks.Count;
     current       = 0;
     pattern       = new int[atkPatternLen];
     PatternShuffle();
 }
Beispiel #11
0
        public Charmeleon() : base("Charmeleon", 60)
        {
            Weakness   weakness   = new Weakness(EnergyType.energyTypeName.Water, 2);
            Resistance resistance = new Resistance(EnergyType.energyTypeName.Lighting, 10);

            Energytype = EnergyType.energyTypeName.Fire;
            Attacks.Add(WindowsFormsApp1.Attack.attackName.HeadButt);
            Attacks.Add(WindowsFormsApp1.Attack.attackName.Flare);
            Weakness   = weakness;
            Resistance = resistance;
        }
Beispiel #12
0
        public Pikachu() : base("Pikachu", 60)
        {
            Weakness   weakness   = new Weakness(EnergyType.energyTypeName.Fire, 1.5);
            Resistance resistance = new Resistance(EnergyType.energyTypeName.Fighting, 20);

            Energytype = EnergyType.energyTypeName.Lighting;
            Attacks.Add(WindowsFormsApp1.Attack.attackName.ElectricRing);
            Attacks.Add(WindowsFormsApp1.Attack.attackName.PikaPunch);
            Weakness   = weakness;
            Resistance = resistance;
        }
Beispiel #13
0
        // adds possible attacks for king unit
        public void AddAttacksKing(Unit king)
        {
            int yDir = king.MoveDir;

            Coord kCoord = new Coord(king.UnitCoords.X, king.UnitCoords.Y);

            BoardCell curr = Board.Cells[kCoord.X, kCoord.Y];

            Coord currCoords = kCoord;

            Coord[] dirs = new Coord[4];

            dirs[0] = new Coord(1, yDir);
            dirs[1] = new Coord(-1, yDir);
            dirs[2] = new Coord(1, -yDir);
            dirs[3] = new Coord(-1, -yDir);

            // for every dir, check if -> dir has enemy and is on board and check if -> 2*dir is empty and is on board
            for (int i = 0; i < dirs.Length; i++)
            {
                Coord cXY = currCoords + dirs[i];

                if (IsCoordsOnBoard(cXY))
                {
                    if (Board.Cells[cXY.X, cXY.Y].Occupant != null && Board.Cells[cXY.X, cXY.Y].Occupant.Commander != CurrPlayer)
                    {
                        BoardCell defender = Board.Cells[cXY.X, cXY.Y];

                        if (IsCoordsOnBoard(cXY + dirs[i]))
                        {
                            Coord final = cXY + dirs[i];
                            if (Board.Cells[final.X, final.Y].Occupant == null)
                            {
                                BoardCell finish = Board.Cells[final.X, final.Y];

                                Attacks.Add(new Attack(curr, finish, defender, CurrPlayer, defender.Occupant.Commander));

                                // Ensure cells that can move has no duplicates
                                if (!CellsAble.Contains(curr))
                                {
                                    CellsAble.Add(curr);
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #14
0
        public void AddAttack(CharacterEnums.TypeAttack attack, int damage)
        {
            if (damage <= 0)
            {
                throw new ArgumentOutOfRangeException("Damage must be bigger than zero.");
            }

            if (!Attacks.ContainsKey(attack))
            {
                Attacks.Add(attack, damage);
            }
            else
            {
                Attacks[attack] = damage;
            }
        }
Beispiel #15
0
        public Sharpmender()
        {
            InitializeProperties("Sharpmender", 10, 1, 1, 1, 2, 1);
            Attacks.Add(new Attack("Scratch", 3, Effect.PropertieIsActivated.YES,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL));

            Attacks.Add(new Attack("Grawl", 0, Effect.PropertieIsActivated.NO,
                                   1, Effect.PropertieIsActivated.YES, Effect.PropertieEvolution.UP, Effect.Target.SELF,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL));
        }
Beispiel #16
0
        public Sharpasaur()
        {
            InitializeProperties("Sharpasaur", 9, 1, 1, 3, 2, 2);
            Attacks.Add(new Attack("Pound", 2, Effect.PropertieIsActivated.YES,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL));

            Attacks.Add(new Attack("Foliage", 0, Effect.PropertieIsActivated.NO,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   1, Effect.PropertieIsActivated.YES, Effect.PropertieEvolution.UP, Effect.Target.SELF,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL));
        }
Beispiel #17
0
        public Sharpitle()
        {
            InitializeProperties("Sharpitle", 11, 1, 2, 2, 1, 2);
            Attacks.Add(new Attack("Pound", 2, Effect.PropertieIsActivated.YES,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL));

            Attacks.Add(new Attack("Shell", 0, Effect.PropertieIsActivated.NO,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   1, Effect.PropertieIsActivated.YES, Effect.PropertieEvolution.UP, Effect.Target.SELF,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL));
        }
Beispiel #18
0
        public void AddPlayer(Player player)
        {
            Players[connectedPlayers] = player;
            player.MyGameIndex        = connectedPlayers;
            connectedPlayers++;

            foreach (var card in player.Deck.Cards)
            {
                Cards.Add(card.Id, card);

                var pokemon = card as PokemonCard;

                if (pokemon != null)
                {
                    foreach (var attack in pokemon.Attacks)
                    {
                        Attacks.Add(attack.Id, attack);
                    }

                    if (pokemon.Ability != null)
                    {
                        Abilities.Add(pokemon.Ability.Id, pokemon.Ability);
                    }
                }
                else
                {
                    var trainer = card as TrainerCard;

                    if (trainer != null && trainer.Ability != null)
                    {
                        Abilities.Add(trainer.Ability.Id, trainer.Ability);
                    }
                }
            }

            foreach (var pokemon in player.GetAllPokemonCards())
            {
                Cards.Add(pokemon.Id, pokemon);

                foreach (var energy in pokemon.AttachedEnergy)
                {
                    Cards.Add(energy.Id, energy);
                }
            }
        }
Beispiel #19
0
    // Use this for initialization
    public override void Start()
    {
        base.Start();

        //set up basic stats
        MaxHitPoints = 100;
        HitPoints    = 100;
        anim.SetInteger("HP", HitPoints);

        //set up the list of attacks
        PlayerAttack attack1 = new PlayerAttack();

        attack1.Name        = "All-Purpose Slice";
        attack1.Description = "Stabs a single target with the Miracle Blade™ All-Purpose Slicer™.";
        attack1.Power       = 76;
        attack1.Accuracy    = 100;
        attack1.Type        = AttackType.Damage;
        Attacks.Add(attack1);

        if (EnableSleepAttack)
        {
            PlayerAttack attack2 = new PlayerAttack();
            attack2.Name        = "Sales Pitch";
            attack2.Description = "Puts target to sleep with a lecture on the " +
                                  "benefits of the Miracle Blade™ III Perfection Series™.";
            attack2.Power    = 4;
            attack2.Accuracy = 100;
            attack2.Type     = AttackType.Sleep;
            Attacks.Add(attack2);
        }

        PlayerAttack attack3 = new PlayerAttack();

        attack3.Name        = "Fried Chicken Smoothie";
        attack3.Description = "90% chicken and 10% lettuce, blended to perfection using the Ultimate Chopper™. Restores health.";
        attack3.Power       = 100;
        attack3.Accuracy    = 100;
        attack3.Type        = AttackType.Heal;


        Attacks.Add(attack3);

        salesPitchParticles = Instantiate(SalesPitchParticlePrefab) as ParticleSystem;
        salesPitchParticles.transform.position = transform.position;
    }
Beispiel #20
0
        public PaperClip()
        {
            Name = "Paper Clip";

            Attack attack = new Attack();

            attack.Name     = "Stab";
            attack.Costs    = 1;
            attack.MinRange = 1;
            attack.MaxRange = 1;
            attack.Buildup  = 1;
            attack.Cooldown = 1;
            attack.Style    = AttackStyle.Melee;
            attack.DamageTypes.Add(DamageType.Pierce, new Tuple <int, int, int>(1, 1, 1));
            Attacks.Add(attack);

            attack          = new Attack();
            attack.Name     = "Strike";
            attack.Costs    = 1;
            attack.MinRange = 1;
            attack.MaxRange = 1;
            attack.Buildup  = 1;
            attack.Cooldown = 2;
            attack.Style    = AttackStyle.Melee;
            attack.DamageTypes.Add(DamageType.Blunt, new Tuple <int, int, int>(2, 3, 1));
            Attacks.Add(attack);

            attack          = new Attack();
            attack.Name     = "Throw";
            attack.Costs    = 1;
            attack.MinRange = 2;
            attack.MaxRange = 5;
            attack.Buildup  = 1;
            attack.Cooldown = 3;
            attack.Style    = AttackStyle.Ranged;
            attack.DamageTypes.Add(DamageType.Pierce, new Tuple <int, int, int>(3, 4, 1));
            Attacks.Add(attack);

            InitCooldowns();
        }
Beispiel #21
0
        public Sharpidgey()
        {
            InitializeProperties("Sharpidgey", 11, 2, 2, 2, 1, 2);
            Attacks.Add(new Attack("Peeck", 1, Effect.PropertieIsActivated.YES,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL));

            Attacks.Add(new Attack("Gust", 2, Effect.PropertieIsActivated.YES,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL));

            Attacks.Add(new Attack("Sand-Attack", 3, Effect.PropertieIsActivated.NO,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   1, Effect.PropertieIsActivated.YES, Effect.PropertieEvolution.UP, Effect.Target.SELF,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL,
                                   0, Effect.PropertieIsActivated.NO, Effect.PropertieEvolution.NULL, Effect.Target.NULL));
        }
Beispiel #22
0
        private void FixMembers(ICollection <WarMember> members, ICollection <WarMember> opponentMembers, bool isOpponent)
        {
            if (Members == null)
            {
                Members = new List <WarMember>();
            }

            foreach (var member in members)
            {
                member.WarID      = ID;
                member.IsOpponent = isOpponent;
                Members.Add(member);
                if (member.Attacks != null)
                {
                    foreach (var attack in member.Attacks)
                    {
                        attack.WarID      = ID;
                        attack.IsOpponent = isOpponent;

                        var defender = opponentMembers.SingleOrDefault(m => m.Tag == attack.DefenderTag);
                        if (defender != null)
                        {
                            attack.DefenderMapPosition   = defender.MapPosition;
                            attack.DefenderTownHallLevel = defender.TownHallLevel;
                        }

                        if (Attacks == null)
                        {
                            Attacks = new List <WarAttack>();
                        }

                        Attacks.Add(attack);
                    }
                }
            }
        }
Beispiel #23
0
        // ASSIGN

        /// <summary>
        /// Assign the checked inputs to the properties
        /// </summary>
        private void AssignInputs()
        {
            Name = txtName.Text;

            if (monster)
            {
                ArmorClass        = ConvertToInt(txtAC.Text);
                HealthPoints      = ConvertToInt(txtHP.Text);
                DexterityModifier = ConvertToInt(txtDEX.Text);
                PassivePerception = ConvertToInt(txtPP.Text);
                Type        = (MonsterType)cmbMonsterTypes.SelectedItem;
                Resistances = lstResistances.Items.Cast <DamageType>().ToList();
                Immunities  = lstImmunities.Items.Cast <DamageType>().ToList();
                Speed       = ConvertToInt(txtSpeed.Text);

                foreach (Attack attack in lstAttacks.Items)
                {
                    if (!Attacks.Contains(attack))
                    {
                        Attacks.Add(attack);
                    }
                }
                foreach (MonsterSpecial monsterSpecial in lstMonsterSpecials.Items)
                {
                    if (!MonsterSpecials.Contains(monsterSpecial))
                    {
                        MonsterSpecials.Add(monsterSpecial);
                    }
                }

                if (!string.IsNullOrWhiteSpace(txtAmount.Text))
                {
                    Amount = ConvertToInt(txtAmount.Text);
                }
            }
        }
Beispiel #24
0
 public Worm(int[] stats) : base(1, stats)
 {
     Attacks.Add(() => AttackStorage.Bite(this, null));
 }
Beispiel #25
0
 /// <summary>
 /// This is the method that is called when it is time for a player to attack
 /// </summary>
 private void Attack()
 {
     Console.WriteLine("{0} is attacking {1}", AttackingPlayer.Name, DefendingPlayer.Name);
     Attacks.Add(new AttackPair(AttackingPlayer.Attack(trump, AttackRanks)));
 }
Beispiel #26
0
 public Bulbasaur() : base("Bulbasaur", "Grass", 130)
 {
     Attacks.Add(base.Name, new Attack("mow", base.Type, 20));
     Attacks.Add(base.Name + 1, new Attack("graze", base.Type, 5));
 }
Beispiel #27
0
 // Use this for initialization
 protected override void Start()
 {
     base.Start();
     Attacks.Add(new Attack("swipe", 2, 10f));
 }
Beispiel #28
0
 public Pikachu() : base("Pikachu", "Electric", 100)
 {
     Attacks.Add(base.Name, new Attack("shock", base.Type, 20));
     Attacks.Add(base.Name + 1, new Attack("stun", base.Type, 5));
 }
Beispiel #29
0
        public void Initialize()
        {
            Clans = Clans.OrderBy(x => x.ClanTag).ToList();

            WarId = $"{PreparationStartTimeUtc};{Clans[0].ClanTag}";

            //ClanTag1 = Clans.First().ClanTag;

            Flags.WarId = WarId;

            TimeSpan timeSpan = StartTimeUtc - PreparationStartTimeUtc;

            if (timeSpan.TotalHours == 24 ||
                timeSpan.TotalHours == 20 ||
                timeSpan.TotalHours == 16 ||
                timeSpan.TotalHours == 12 ||
                timeSpan.TotalHours == 8 ||
                timeSpan.TotalHours == 6 ||
                timeSpan.TotalHours == 4 ||
                timeSpan.TotalHours == 2 ||
                timeSpan.TotalHours == 1 ||
                timeSpan.TotalMinutes == 30 ||
                timeSpan.TotalMinutes == 15)
            {
                WarType = WarType.Friendly;
            }

            if (WarIsOverOrAllAttacksUsed())
            {
                if (Clans[0].Stars == Clans[1].Stars)
                {
                    if (Clans[0].DestructionPercentage == Clans[1].DestructionPercentage)
                    {
                        Clans[0].Result = Result.Draw;
                        Clans[1].Result = Result.Draw;
                    }
                    else if (Clans[0].DestructionPercentage > Clans[1].DestructionPercentage)
                    {
                        Clans[0].Result = Result.Win;
                        Clans[1].Result = Result.Lose;
                    }
                    else
                    {
                        Clans[0].Result = Result.Lose;
                        Clans[1].Result = Result.Win;
                    }
                }
                else if (Clans[0].Stars > Clans[1].Stars)
                {
                    Clans[0].Result = Result.Win;
                    Clans[1].Result = Result.Lose;
                }
                else
                {
                    Clans[0].Result = Result.Lose;
                    Clans[1].Result = Result.Win;
                }
            }

            foreach (WarClanApiModel clan in Clans)
            {
                foreach (WarVillageApiModel warVillage in clan.Villages.EmptyIfNull())
                {
                    foreach (AttackApiModel attack in warVillage.Attacks.EmptyIfNull())
                    {
                        if (!Attacks.Any(a => a.Order == attack.Order))
                        {
                            Attacks.Add(attack);
                        }
                    }
                }
            }

            Attacks = Attacks.OrderBy(a => a.Order).ToList();

            var attacksByDefenderTag = Attacks.GroupBy(a => a.DefenderTag);

            foreach (var defendingVillage in attacksByDefenderTag)
            {
                defendingVillage.OrderBy(d => d.Order).First().Fresh = true;
            }

            foreach (var attack in Attacks)
            {
                foreach (var clan in Clans)
                {
                    WarVillageApiModel?attacker = clan.Villages.FirstOrDefault(m => m.VillageTag == attack.AttackerTag);

                    if (attacker != null)
                    {
                        attack.AttackerClanTag = clan.ClanTag;
                    }

                    WarVillageApiModel?defender = clan.Villages.FirstOrDefault(m => m.VillageTag == attack.DefenderTag);

                    if (defender != null)
                    {
                        attack.DefenderClanTag = clan.ClanTag;
                    }
                }
            }

            foreach (WarClanApiModel clan in Clans)
            {
                clan.DefenseCount = Attacks.Count(a => a.DefenderClanTag == clan.ClanTag);
            }
        }