Пример #1
0
        public IceTower(float x, float y, bool buy = false) : base(x, y, new CircleShape(10f), _cost, "Ice Tower", "Slows down enemies in range by 50%", 150f, -40, 600f)
        {
            if (buy)
            {
                Program.Money -= Cost;
            }
            shape.Texture = new Texture("./Resources/IceTower.png");
            Upgrade rangeI = new Upgrade(new Modifier(ModifierType.Percentage, 30), 5, "Range I", "Area of effect increases by 30%", UpdateType.Range)
            {
                Unlocks =
                {
                    new Upgrade(new Modifier(ModifierType.Percentage, 30), 7, "Range II", "Area of effect increases by 30%", UpdateType.Range)
                }
            };
            Upgrade damageI = new CustomUpgrade(null, 3, "Ice snap", "Will attack enemies in its range", t => (t as IceTower).Damage += 1)
            {
                Unlocks =
                {
                    new CustomUpgrade(new Modifier(ModifierType.Percentage,   -10),              5, "Ice snap II",                "Deals additional 2 damage", t => (t as IceTower).Damage += 2)
                    {
                        Unlocks =
                        {
                            new CustomUpgrade(null,                                                       20, "Ice snap III", "Deals additional 10 damage", t => (t as IceTower).Damage += 10),
                            new Upgrade(new Modifier(ModifierType.Percentage,                           -66),             25, "Turbo Speed",                "Attacks very quick",        UpdateType.Speed)
                        }
                    }
                }
            };

            AvailableUpgrades.Add(damageI);
            AvailableUpgrades.Add(rangeI);
        }
Пример #2
0
        public Cannon(float x, float y, bool buy = false) : base(x, y, new RectangleShape(new Vector2f(20, 20)), _cost, "Cannon", "Shoot bullets which explode",
                                                                 200, 2, 500)
        {
            if (buy)
            {
                Program.Money -= _cost;
            }
            shape.Texture  = new Texture("./Resources/cannon.png");
            shape.Origin   = new Vector2f(10, 10);
            position       = new Vector2f(position.X + 10, position.Y + 10);
            shape.Position = position;
            CustomUpgrade pierce = new CustomUpgrade(null, 5, "Pierce I", "Each shell has 1 more pierce", (t) => (t as Cannon).ExtraPierce += 1)
            {
                Unlocks =
                {
                    new CustomUpgrade(null,         12, "Pierce II",  "Each shell has 2 more pierce", (t) => (t as Cannon).ExtraPierce += 2)
                    {
                        Unlocks =
                        {
                            new CustomUpgrade(null, 20, "Pierce III", "Each shell has 3 more pierce", (t) => (t as Cannon).ExtraPierce += 3)
                        }
                    }
                }
            };
            CustomUpgrade explosionSize = new CustomUpgrade(null, 4, "Explosions I", "Exposions are 50% stronger",
                                                            t => (t as Cannon).ExplosionSize.modifiers.Add(new Modifier(ModifierType.Percentage, 50)))
            {
                Unlocks =
                {
                    new CustomUpgrade(null, 4, "Explosions II", "Exposions deal 3 more damage",
                                      t => (t as Cannon).ExplosionDamage += 3)
                }
            };
            Upgrade rangeI = new Upgrade(new Modifier(ModifierType.Value, 50), 8, "Further I", "Increases range by 50", UpdateType.Range)
            {
                Unlocks =
                {
                    new Upgrade(new Modifier(ModifierType.Value,          50),  6, "Further II",  "Increases range by 50", UpdateType.Range)
                    {
                        Unlocks =
                        {
                            new Upgrade(new Modifier(ModifierType.Value, 100), 15, "Further III", "Increases range by 100", UpdateType.Range)
                        }
                    }
                }
            };

            AvailableUpgrades.Add(pierce);
            AvailableUpgrades.Add(explosionSize);
            AvailableUpgrades.Add(rangeI);
        }