Esempio n. 1
0
 public void RemoveWeapon(Weapon weaponToRemove)
 {
     if (this.weapons.Contains(weaponToRemove))
     {
         this.weapons.Remove(weaponToRemove);
     }
 }
Esempio n. 2
0
        public Weapon AddWeapon(Weapon weaponToAdd)
        {
            if (!this.weapons.Contains(weaponToAdd))
            {
                //Debug.log("Adding a weapon with projectile " + weaponToAdd.GetProjectile().GetName() + " to entitiy " + this.GetName());
                weaponToAdd = Helpah.Clone(weaponToAdd).As<Weapon>();
                weaponToAdd.SetOwner(this);
                this.weapons.Add(weaponToAdd);
            }

            return weaponToAdd;
        }
Esempio n. 3
0
        public void prepTowers()
        {
            LivingGameEntity NyanTower = new LivingGameEntity("NyanTower");
            LivingGameEntity XTheYTower = new LivingGameEntity("XTheYTower");
            LivingGameEntity TableFlipperTower = new LivingGameEntity("TableFlipperTower");
            LivingGameEntity BarrelRollTower = new LivingGameEntity("BarrelRollTower");
            LivingGameEntity ArrowKneeTower = new LivingGameEntity("GuardTower");

            LivingGameEntity PepperCopTower = new LivingGameEntity("PepperCopTower");

            //NyanTower.SetResource("Currency", 15);
            //PepperCopTower.SetResource("Currency", 35);
            //XTheYTower.SetResource("Currency", 40);
            //TableFlipperTower.SetResource("Currency", 20);

            //this will automatically draw the sprite for the projectile from the (hopefully) pre-established table sprite
            Projectile TableProjectile = new Projectile("Table");
            TableProjectile.SetDamage(30);

            Weapon TableFlipperWeapon = new Weapon(10, 1, .5, 180, 40);
            TableFlipperWeapon.SetProjectile(TableProjectile);
            TableFlipperWeapon.SetRange(5);
            TableFlipperTower.AddWeapon(TableFlipperWeapon);

            Weapon dummyWeapon = new Weapon(10, 1, .5, 180, 40);
            dummyWeapon.SetRange(5);
            NyanTower.AddWeapon(dummyWeapon);

            Projectile barrel = new Projectile("Barrel");
            barrel.SetDamage(70);

            Weapon BarrelThrower = new Weapon(10, 1, .5, 180, 40);
            BarrelThrower.SetRange(5);
            BarrelThrower.SetProjectile(barrel);
            BarrelRollTower.AddWeapon(BarrelThrower);

            Projectile arrow = new Projectile("Arrow");
            arrow.SetDamage(70);

            Weapon Bow = new Weapon(10, 1, .5, 180, 40);
            Bow.SetRange(15);
            Bow.SetProjectile(arrow);
            ArrowKneeTower.AddWeapon(Bow);
        }