예제 #1
0
        public PyroTurretModel(Turret turret, Game1 game)
            : base(turret, game)
        {
            model = ModelLibrary.turretPyro;

            bodyMat = new Vector3(0, 1.45f, 0);

            barrelMat = new Vector3(1, 1.87f, 0);
        }
예제 #2
0
        public ElectroShot(Turret turret, Vector3 pos, Enemy enemy, Game1 game)
            : base()
        {
            this.turret = turret;
            this.game = game;
            this.pos = pos;
            target = enemy;
            targetDist = 0;
            time = 0;
            triggered = false;

            direction = Vector3.Up;

            model = new ElectroShotModel(this, game);

            game.modelManager.addEffect(model);
        }
예제 #3
0
        public GattleProjectile(Vector3 pos, Vector3 direction, Game1 game, Turret turret)
            : base()
        {
            this.direction = direction;
            this.game = game;
            this.pos = pos;
            this.rot.Y = (float)Math.Atan2(direction.X, direction.Z);
            this.turret = turret;

            speed = 50;
            life = 300;
            delete = false;
            damage = 4f;

            boundingBox = new OOBB(pos, direction, 0.3f, 1); // Need to be changed to be actual projectile dimensions

            model = new ProjectileModel(ModelLibrary.projectile, pos, this, Color.Orange, Color.Red, game);
            game.modelManager.addEffect(model);
        }
예제 #4
0
        public bool setTurret(int i)
        {
            bool returnVal = false;

            switch(i)
            {
                default:
                    turret.Dispose();
                    turret = null;

                    switch((int)turretType)
                    {
                        default:
                            break;
                        case 1:
                            game.ship.moneyManager.refund(gattPrice);
                            break;
                        case 2:
                            game.ship.moneyManager.refund(pyroPrice);
                            break;
                        case 3:
                            game.ship.moneyManager.refund(elecPrice);
                            break;
                    }

                    turretType = TurretType.none;
                    returnVal = true;
                    baseModel.changeColor(turretType, game);
                    break;
                case 1:
                    if (ship.moneyManager.canPurchase(gattPrice))
                    {
                        turret = new GattleTurret(pos, dir, game);
                        game.levelStats.gatlings++;
                        turretType = TurretType.gattle;
                        baseModel.changeColor(turretType, game);
                        game.map.map[(int)nodePos.X, (int)nodePos.Y].damage += 5;
                        game.enemyManager.turretPlaced();
                        spawnEffect();
                        returnVal = true;
                        game.printNewPath();
                    }
                    break;
                case 2:
                    if (ship.moneyManager.canPurchase(pyroPrice))
                    {
                        turret = new PyroTurret(pos, dir, game);
                        game.levelStats.flamers++;
                        turretType = TurretType.pyro;
                        baseModel.changeColor(turretType, game);
                        game.map.map[(int)nodePos.X, (int)nodePos.Y].damage += 5;
                        game.enemyManager.turretPlaced();
                        spawnEffect();
                        returnVal = true;
                        game.printNewPath();
                    }
                    break;
                case 3:
                    if (ship.moneyManager.canPurchase(elecPrice))
                    {
                        turret = new ElectroTurret(pos, dir, game);
                        game.levelStats.electrics++;
                        turretType = TurretType.electro;
                        baseModel.changeColor(turretType, game);
                        game.map.map[(int)nodePos.X, (int)nodePos.Y].damage += 5;
                        game.enemyManager.turretPlaced();
                        spawnEffect();
                        returnVal = true;
                        game.printNewPath();
                    }
                    break;
            }
            return returnVal;
        }