Пример #1
0
    public void ChangeTurretType(TurretType newType)
    {
        type = newType;

        charName = newType.ToString().Replace('_', ' ') + " Turret";

        switch (newType)
        {
        case TurretType.Normal:
        {
            mRender.material = defaultMat;
        }
        break;

        case TurretType.Multi_Attack:
        {
            description      = "A powerful speaker that hits multiple targets";
            mRender.material = multiAttackMat;
        }
        break;

        case TurretType.Grenadier:
        {
            description      = "A pumping speakers that unleashes bombing beats";
            mRender.material = grenadierMat;
        }
        break;
        }

        if (Type == TurretType.Multi_Attack)
        {
        }
    }
Пример #2
0
 public FireTrapper(int x, int y, TurretType turretType, TurretPlacement placement,
                    ref SetUpVariables variables, bool isCopied) : base(x, y, turretType, placement, ref variables)
 {
     CurrentExtendTime         = DateTime.Now;
     m_CurrentExtensionCounter = 0;
     m_IsClone = isCopied;
 }
Пример #3
0
    public Tank CreateTank <T>(TurretType TurretType, Transform spawnPosition) where T : Tank, new()
    {
        Tank         tank    = new T();
        ITankBuilder builder = new TankOneBuilder(tank, typeof(T), TurretType, spawnPosition);

        return(TankBuilderDirector.Construct(builder));
    }
Пример #4
0
    public void SetTurretType(TurretType newType)
    {
        turretType = newType;
        foreach (TurretTypeLink link in typeLinks)
        {
            link.sprite.gameObject.SetActive(link.type == turretType);
            if (link.type == turretType)
            {
                if (link.behaviour == null)
                {
                    turretBehaviour = null;
                }
                else
                {
                    turretBehaviour.Shutdown();
                    turretBehaviour                  = Instantiate(link.behaviour);
                    turretBehaviour.turret           = this;
                    turretBehaviour.bulletSpawnPoint = bulletSpawnPoint;
                    turretBehaviour.Init();
                }
            }
        }

        if (turretType == TurretType.Boost)
        {
            boostSprite.gameObject.SetActive(true);
            if (turretBehaviour != null)
            {
                turretBehaviour.Shutdown();
                turretBehaviour = null;
            }
        }
    }
Пример #5
0
    public Turret CreateTurret(TurretType turretType)
    {
        Turret     Turret     = null;
        GameObject TurretGO   = FactoryManager.assetFactory.LoadTurret(turretType.ToString());
        TurretAttr TurretAttr = FactoryManager.attrFactory.GetTurretAttr(turretType);

        switch (turretType)
        {
        case TurretType.ShellTurret:
            Turret = new TurretShell(TurretGO, TurretAttr);
            break;

        case TurretType.MissileLauncher:
            Turret = new TurretMissile(TurretGO, TurretAttr);
            break;

        case TurretType.LaserBeamer:
            Turret = new TurretLaser(TurretGO, TurretAttr);
            break;

        case TurretType.CanonTurret:
            Turret = new TurretCanon(TurretGO, TurretAttr);
            break;
        }
        return(Turret);
    }
Пример #6
0
        public static Turret GetTurret(TurretType turretType, Vector2 position, float modifier, float modifier2)
        {
            switch (turretType)
            {
            case TurretType.MGun:
            {
                return(new Turret(MGunTurret.Texture, position, 100, MGunTurret.BulletTexture));
            }

            case TurretType.ShotGun:
            {
                return(new ShotgunTurret(ShotgunTurret.Texture, position, 100, ShotgunTurret.BulletTexture, (int)modifier, modifier2));        //mod - pellets , mod2- spread amount (1.0f-0.1)
            }

            case TurretType.Rocket:
            {
                return(new RocketTurret(rocketTurret.Texture, position, 200, rocketTurret.BulletTexture));
            }

            case TurretType.RocketHoming:
            {
                return(new RocketTurretHoming(rocketTurretHoming.Texture, position, 200, rocketTurretHoming.BulletTexture));
            }
            }
            return(null);
        }
Пример #7
0
 public void OnMissileSelected(bool isOn)
 {
     if (isOn)
     {
         selectedTurret = missileData;
     }
 }
Пример #8
0
        public Turret FindOrCreateTurret(TurretType turretType, string turretCode)
        {
            switch (turretType)
            {
            case TurretType.Weapon:
                return(FindOrCreateWeapon(turretCode));

            case TurretType.Construct:
                return(FindOrCreateConstruct(turretCode));

            case TurretType.Repair:
                return(FindOrCreateRepair(turretCode));

            case TurretType.Sensor:
                return(FindOrCreateSensor(turretCode));

            case TurretType.Brain:
                return(FindOrCreateBrain(turretCode));

            case TurretType.ECM:
                return(FindOrCreateECM(turretCode));

            default:
                return(null);
            }
        }
Пример #9
0
        public LaneTurret(
            Game game,
            string name,
            float x         = 0,
            float y         = 0,
            TeamId team     = TeamId.TEAM_BLUE,
            TurretType type = TurretType.OUTER_TURRET,
            int[] items     = null,
            uint netId      = 0
            ) : base(game, name, "", x, y, team, netId)
        {
            Type = type;
            if (items != null)
            {
                foreach (var item in items)
                {
                    var itemTemplate = _itemManager.SafeGetItemType(item);
                    if (itemTemplate == null)
                    {
                        continue;
                    }
                    Inventory.AddItem(itemTemplate);
                    Stats.AddModifier(itemTemplate);
                }
            }

            BuildTurret(type);
        }
Пример #10
0
 //通过事件来保存选择的炮台
 public void OnStandardSelected(bool isOn)
 {
     if (isOn)
     {
         selectedTurret = standardData;
     }
 }
Пример #11
0
    public void CreateTurret(TurretType _type)
    {
        go.GetComponent <Grid>().type = GridType.Turret;
        GameObject turret = Instantiate(gameController.turret);
        Turret     t      = turret.GetComponent <Turret>();

        //t.type = _type;
        t.turretInfo          = gameController.turretList[(int)_type];
        t.turretInfo.type     = _type;
        gameController.money -= t.turretInfo.money;
        turret.transform.SetParent(go.transform);
        turret.transform.localScale    = new Vector3(78, 79, 0);
        turret.transform.localPosition = Vector3.zero;

        switch (_type)
        {
        case TurretType.singleShot:
            turret.GetComponent <SpriteRenderer>().color = Color.yellow;
            break;

        case TurretType.doubleShot:
            turret.GetComponent <SpriteRenderer>().color = Color.white;
            break;
        }
    }
Пример #12
0
 protected void spawnProjectile(TurretType t)
 {
     bool hacked = controller.hacked;
     GameObject o;
     Projectile P;
     Vector2 velocity = new Vector2(targetDir.x * pSpeed, targetDir.y * pSpeed);
     switch (t)
     {
         case TurretType.Laser:
             o = TrashMan.spawn("laserProjectile", start.position, Quaternion.Euler(0,0,targetAngle));
             P = o.GetComponent<Projectile>();
             P.Spawn(Damage, Projectile.ProjectileType.laser, velocity, owner, modifier, hacked);
             break;
         case TurretType.Ion:
             o = TrashMan.spawn("ionProjectile", start.transform.position, Quaternion.Euler(0, 0, targetAngle));
             P = o.GetComponent<Projectile>();
             P.Spawn(Damage, Projectile.ProjectileType.ion, velocity, owner, modifier, hacked);
             break;
         case TurretType.Railgun:
             o = TrashMan.spawn("railProjectile", start.transform.position, Quaternion.Euler(0, 0, targetAngle));
             P = o.GetComponent<Projectile>();
             P.Spawn(Damage, Projectile.ProjectileType.rail, velocity, owner, modifier, hacked);
             break;
     }
     //AUDIO
     if (ToggleSound.audio.soundEnabled)
     {
         audio.pitch = Random.Range(.9f, 1.15f);
         audio.Play();
     }
 }
Пример #13
0
 public Hellion(int x, int y, TurretType turretType, TurretPlacement placement,
                ref SetUpVariables variables) : base(x, y, turretType, placement, ref variables)
 {
     m_timeDeparture  = DateTime.Now;
     m_MoveCommands   = new List <Position>();
     m_CurrentCommand = 0;
 }
Пример #14
0
        public void placeTurret(int rows, int cols, TurretType type)
        {
            switch (type)
            {
            case TurretType.Turret:
                if (bank.Purchase(100))
                {
                    structures[rows, cols] = new BasicTurret(new Vector2(
                                                                 (int)((screenWidth / 2) - (4.5 - cols) * sideLength),
                                                                 (int)((screenHeight / 2) - (4.5 - rows) * sideLength)),
                                                             turretTexture, bulletTexture, groundTexture, healthBar,
                                                             sideLength, rows, cols, this, bank);
                }
                break;

            case TurretType.Wall:
                if (bank.Purchase(50))
                {
                    structures[rows, cols] = new Wall(new Vector2(
                                                          (int)((screenWidth / 2) - (4.5 - cols) * sideLength),
                                                          (int)((screenHeight / 2) - (4.5 - rows) * sideLength)),
                                                      wallTexture, groundTexture, healthBar, bank, this,
                                                      sideLength, rows, cols);
                }
                break;
            }
        }
Пример #15
0
 public TankBuilder(Tank tank, System.Type t, TurretType turretType, Transform spawnPosition)
 {
     mTank          = tank;
     mT             = t;
     mTurretType    = turretType;
     mSpawnPosition = spawnPosition;
 }
    public void BuildTurret(Vector2 orientation, TurretType type)
    {
        switch (type)
        {
        case TurretType.BASIC:
            TurretBasic turretB = Instantiate(basicTurret, desiredPosition, Quaternion.Euler(orientation), transform);
            turretB.turretType = TurretType.BASIC;
            turrets.Add(turretB);
            monsterManager.setFriendlySouls(monsterManager.getFriendlySouls() - turretB.buildCost);
            break;

        case TurretType.SPECIAL:
            TurretSpecial turretS = Instantiate(specialTurret, desiredPosition, Quaternion.Euler(orientation), transform);
            turretS.turretType = TurretType.SPECIAL;
            turrets.Add(turretS);
            monsterManager.setFriendlySouls(monsterManager.getFriendlySouls() - turretS.buildCost);
            turretS.attackOrientation = orientation;
            break;

        default:
            break;
        }

        turretBuildingPanel.gameObject.SetActive(false);
        isMenuOn = false;
        cameraManager.shouldMove = true;
    }
Пример #17
0
        public LaneTurret(
            string name,
            float x         = 0,
            float y         = 0,
            TeamId team     = TeamId.TEAM_BLUE,
            TurretType type = TurretType.OuterTurret,
            int[] items     = null,
            uint netId      = 0
            ) : base(name, "", x, y, team, netId)
        {
            this.Type = type;
            if (items != null)
            {
                foreach (var item in items)
                {
                    var itemTemplate = _itemManager.SafeGetItemType(item);
                    if (itemTemplate == null)
                    {
                        continue;
                    }
                    var i = Inventory.AddItem(itemTemplate);
                    GetStats().AddBuff(itemTemplate);
                }
            }

            BuildTurret(type);
        }
Пример #18
0
        private void showStatus(TurretType t)
        {
            string s     = locale[t];
            int    lines = currentTurrets.Count;
            float  size  = 1;

            if (lines > 18)
            {
                size -= (lines - 18) * 0.04F;
            }
            size = Math.Min(size, 0.67F);
            int   maxSections = 40;           //assuming zero padding and zero name length
            float ds          = size - 0.5F;

            maxSections = (int)(maxSections - 16F * ds);
            int   maxw    = (maxSections / 2);
            int   pad     = maxw - s.Length;
            int   barSize = maxw;
            float f       = fractions[t];
            int   fill    = (int)(f * barSize + 0.5);
            int   red     = barSize / 4;
            int   yellow  = barSize / 2;

            foreach (Display scr in ammoDisplays)
            {
                scr.addLine(s, f, barSize, size, pad, red, yellow, fill);
            }
        }
Пример #19
0
    public FiredBullet OpenFire(TurretType turretType, Transform transform, Bullet bullet)
    {
        FiredBullet firedBullet = null;

        switch (turretType)
        {
        case TurretType.ShellTurret:
            firedBullet = new FireShell(transform, bullet);
            break;

        case TurretType.MissileLauncher:
            firedBullet = new FireMissile(transform, bullet);
            GameFacade.Instance.AddBullet(firedBullet);
            break;

        case TurretType.LaserBeamer:
            firedBullet = new FireLaser(transform, bullet);
            break;

        case TurretType.CanonTurret:
            firedBullet = new FireCanonBall(transform, bullet);
            break;
        }
        return(firedBullet);
    }
Пример #20
0
        public LaneTurret(
            Game game,
            string name,
            float x                  = 0,
            float y                  = 0,
            TeamId team              = TeamId.TEAM_BLUE,
            TurretType type          = TurretType.OUTER_TURRET,
            int[] items              = null,
            uint netId               = 0,
            List <string> conditions = null
            ) : base(game, name, "", x, y, team, netId)
        {
            Type = type;
            if (items != null)
            {
                foreach (var item in items)
                {
                    var itemTemplate = _itemManager.SafeGetItemType(item);
                    if (itemTemplate == null)
                    {
                        continue;
                    }
                    Inventory.AddItem(itemTemplate);
                    Stats.AddModifier(itemTemplate);
                }
            }
            conds = conditions;
            BuildTurret(type);

            if (conds != null)
            {
                Stats.IsTargetableToTeam = SpellFlags.NonTargetableAll;
            }
        }
Пример #21
0
        private string localize(TurretType key)
        {
            string ret = key.ToString();

            locale.TryGetValue(key, out ret);
            return(ret);
        }
    public void SetTurretType(TurretType turretType)
    {
        this.turretType = turretType;
        var pascalCaseName = turretType.ToString();

        turretTypeName = char.ToLower(pascalCaseName[0]) + pascalCaseName.Substring(1);
    }
 public override bool IsApplicable(TurretType turretType, MonsterType monsterType)
 {
     if (turretType == TurretType.Piercing) {
         return true;
     }
     return false;
 }
Пример #24
0
 public BulletFeature GetBulletFeature(TurretType TurretType)
 {
     if (mBulletDict.ContainsKey(TurretType) == false)
     {
         Debug.LogError("无法根据类型:" + TurretType + "得到子弹特性(GetBulletFeature)"); return(null);
     }
     return(mBulletDict[TurretType]);
 }
Пример #25
0
 public TurretAttr GetTurretAttr(TurretType TurretType)
 {
     if (mTurretDict.ContainsKey(TurretType) == false)
     {
         Debug.LogError("无法根据类型:" + TurretType + "得到炮塔属性(GetTurretAttr)"); return(null);
     }
     return(mTurretDict[TurretType]);
 }
Пример #26
0
 public BaseTurret(Texture2D texture, Vector2 position, Vector2 offset, float rotation, float energyCost, float turnRate, TurretType type, float cooldown) : base(texture, position, rotation)
 {
     Offset     = offset;
     EnergyCost = energyCost;
     TurnRate   = turnRate;
     Type       = type;
     Cooldown   = cooldown;
 }
Пример #27
0
    public Bullet CreateBullet <T>(TurretType turretType, float holdTime) where T : Bullet, new()
    {
        Bullet bullet = new T();

        IBulletBuilder builder = new BulletBuilder(bullet, turretType, holdTime);

        return(BuilderBuilderDirector.Construct(builder));
    }
 public void RPCCommandSpawnTurret(TurretType type, int turretSpot)
 {
     if (!base.isServer) {
         CmdInstantiateTurretToServer(type, turretSpot);
     } else {
         RpcInstantiateTurretToClient(type, turretSpot);
     }
 }
 void CmdInstantiateTurretToServer(TurretType turretType, int turretSpot)
 {
     if (!base.isServer) {
         return;
     }
     TurretSpawnCommand turretSpawnCommand = new TurretSpawnCommand(PlayerManager.Instance.NonActivePlayer.ID, turretType, turretSpot);
     PlayerManager.Instance.NonActivePlayer.AddCommand(turretSpawnCommand);
 }
Пример #30
0
    public void Build(TurretType turret)
    {
        this.type = turret;
        isUpgrade = false;
        turretGo  = Instantiate(turret.turretPrefab, transform.position, Quaternion.identity);
        GameObject effectGo = Instantiate(effectPrefab, transform.position, Quaternion.identity);

        Destroy(effectGo, 1.5f);
    }
Пример #31
0
        public int[] GetTurretItems(TurretType type)
        {
            if (!TurretItems.ContainsKey(type))
            {
                return(null);
            }

            return(TurretItems[type]);
        }
 public override float CalculateDamage(TurretType turretType, MonsterType monsterType, float currentValue)
 {
     if (monsterType == MonsterType.Fighter) {
         return currentValue * 0.6f;
     }
     if (monsterType == MonsterType.ADC) {
         return currentValue * 0.3f;
     }
     return currentValue;
 }
Пример #33
0
    //摧毁炮台
    public void DestoryTurret()
    {
        GameObject effectGo = Instantiate(effectPrefab, transform.position, Quaternion.identity);

        Destroy(turretGo);
        Destroy(effectGo, 1.5f);
        isUpgrade = false;
        turretGo  = null;
        type      = null;
    }
    public static float CalculateDamage(float damageValue, TurretType turretType, MonsterType monsterType)
    {
        foreach (DamageModifier modifier in Modifiers()) {
            if (modifier.IsApplicable(turretType, monsterType)) {
                damageValue = modifier.CalculateDamage(turretType, monsterType, damageValue);
            }
        }

        return damageValue;
    }
Пример #35
0
 //--------------------------------------
 // Private Methods
 //--------------------------------------
 private void selectTurretToPut(TurretType type)
 {
     foreach (Turret t in turrets)
     {
         if (t.Type == type)
         {
             turretToPut = t;
             break;
         }
     }
 }
Пример #36
0
        public Turret CreateTurret(TurretType turretType)
        {
            switch (turretType)
            {
            case TurretType.Test:
                return(new Turret(5f, 70, 40f, 2, 0.75f, BulletType.Test));

            default:
                throw new System.Exception("Turret type not supported");
            }
        }
Пример #37
0
        // Constructor adheres to RoboWar defaults
        public RobotFile()
        {
            name = "New Robot";

            password = null;
            locked = false;

            byte[] temp = BitConverter.GetBytes((Int16)Bytecodes.OP_END);
            if (BitConverter.IsLittleEndian)
                program = new byte[] { temp[1], temp[0] };
            else
                program = temp;
            hardware = new HardwareInfo();
            turretType = TurretType.Line;
            icons = new Image[10];
            sounds = new int[10];

            code = "";
        }
    void TurretAttackHandler(TurretType type)
    {
        AudioClip clip = null;
        switch (type) {
        case TurretType.Magic:
            clip = GetClip(SoundType.Magic);
            break;
        case TurretType.Piercing:
            clip = GetClip(SoundType.Piercing);
            break;
        case TurretType.Siege:
            clip = GetClip(SoundType.Siege);
            break;
        default:
            clip = null;
            break;
        }

        PlayClip(clip);
    }
Пример #39
0
 protected virtual void spawnMissile(TurretType t)
 {
     GameObject o;
     Missile M;
     Rigidbody2D rigid;
     Vector2 initialVelocity = new Vector2(targetDir.x * 5, targetDir.y * 5);
     bool hacked = controller.hacked;
     switch (t)
     {
         case TurretType.BallisticMissile:
             o = TrashMan.spawn("ballisticMissile", start.position, transform.rotation);
             M = o.GetComponent<Missile>();
             rigid = o.GetComponent<Rigidbody2D>();
             M.launchMissile(Missile.MissileType.Ballistic, Target, owner, effectiveDamage, modifier, hacked);
             o = TrashMan.spawn("MissileTrail", M.transform.position);
             o.GetComponent<MissileTrail>().setMissle(M);
             rigid.AddForce(initialVelocity);
             
             break;
         case TurretType.FireMissile:
             o = TrashMan.spawn("fireMissile", start.position, transform.rotation);
             M = o.GetComponent<Missile>();
             rigid = o.GetComponent<Rigidbody2D>();
             M.launchMissile(Missile.MissileType.DOT, Target, owner, effectiveDamage, modifier, hacked);
             o = TrashMan.spawn("MissileTrail", M.transform.position);
             o.GetComponent<MissileTrail>().setMissle(M);
             rigid.AddForce(initialVelocity);
             break;
         case TurretType.AOEMissile:
             o = TrashMan.spawn("aoeMissile", start.position, transform.rotation);
             M = o.GetComponent<Missile>();
             rigid = o.GetComponent<Rigidbody2D>();
             M.launchMissile(Missile.MissileType.AOE, Target, owner, effectiveDamage, modifier, hacked);
             o = TrashMan.spawn("MissileTrail", M.transform.position);
             o.GetComponent<MissileTrail>().setMissle(M);
             rigid.AddForce(initialVelocity);
             break;
     }
     if(ToggleSound.audio.soundEnabled)
         audio.Play();
 }
Пример #40
0
        public TurretBase(Vector3 pos, Vector3 dir, Game1 game)
        {
            this.pos = pos;
            this.dir = dir;
            this.game = game;
            baseModel = new TurretBaseModel(pos, game);
            game.modelManager.addObject(baseModel);
            nodePos = new Vector2((int)((pos.X / 30) + 0.5f), (int)((pos.Z / 30) + 0.5f));
            ship = game.ship;
            turretType = TurretType.none;

            gattPrice = 1250;
            pyroPrice = 2000;
            elecPrice = 3500;

            col = new CircleCollider(pos, 5);

            coolDown = 0;

            holo = new TurretHolo(pos, game);
            game.modelManager.addEffect(holo);
            triggeredHoloClose = false;
        }
Пример #41
0
 public void Sync(SimPlayerSelection other)
 {
     celestialBody = other.celestialBody;
     powerUpToBuy = other.powerUpToBuy;
     turret = other.turret;
     turretChoice = other.turretChoice;
     turretToBuy = other.turretToBuy;
     turretToPlace = other.turretToPlace;
     pausedGameChoice = other.pausedGameChoice;
     newGameChoice = other.newGameChoice;
     editingState = other.editingState;
 }
Пример #42
0
 public void init(TurretType type, Player team)
 {
     turretType = type;
     attributes = attributesList[type];
     this.Costume = getSpriteUrl(type);
     this.team = team;
     sprite.sortingLayerName = "Tower";
 }
Пример #43
0
        /// <summary>
        /// Creates the turret.
        /// </summary>
        /// <returns>
        /// The turret.
        /// </returns>
        /// <param name='type'>
        /// Turret Type.
        /// </param>
        public AbstractTurret CreateTurret(TurretType type)
        {
            //Switch statement returning turret depending on TurretType
            AbstractTurret temp = new BasicTurret();

            switch (type)
            {
                case TurretType.BasicTurret :
                    temp = new BasicTurret();
                    break;
            //				case TurretType.BoxingGlove :
            //					temp = new BoxingGlove();
            //					break;
                case TurretType.BurstTurret :
                    temp = new BurstTurret();
                    break;
            //				case TurretType.CopycatTurret :
            //					temp = new CopycatTurret();
            //					break;
                case TurretType.DepressionTurret :
                    temp = new DepressionTurret();
                    break;
            //				case TurretType.LaserTurret :
            //					temp = new LaserTurret();
            //					break;
            //				case TurretType.RandomTurret :
            //					temp = new RandomTurret();
            //					break;
            //				case TurretType.TurretTurret :
            //					temp = new TurretTurret();
            //					break;
            }
            return temp;
        }
 public override bool IsApplicable(TurretType turretType, MonsterType monsterType)
 {
     return turretType == TurretType.Siege;
 }
Пример #45
0
 public void AddTurret(TurretType type, int level, Vector3 position, bool visible, bool canSelect)
 {
     AddTurret(type, level, position, visible, true, true, canSelect);
 }
 public abstract float CalculateDamage(TurretType turretType, MonsterType monsterType, float currentValue);
 public TurretSpawnCommand(PlayerId player, TurretType type, int spot)
 {
     _type = type;
     _player = player;
     _spot = spot;
 }
Пример #48
0
 public void AddTurret(TurretType type, int level, Vector3 position, bool visible, bool canSell, bool canUpgrade, bool canSelect)
 {
     StartingTurrets.Add(CreateTurret(type, level, position, visible, canSell, canUpgrade, canSelect));
 }
Пример #49
0
        public Turret Create(TurretType type, int level, Vector3 relativePosition, bool visible, bool canSell, bool canUpgrade, bool canSelect)
        {
            var t = Create(type);

            t.Level = level;
            t.RelativePosition = relativePosition;
            t.Visible = visible;
            t.CanSell = canSell;
            t.CanUpdate = canUpgrade;
            t.CanSelect = canSelect;

            return t;
        }
Пример #50
0
        public Turret Create(TurretType type)
        {
            Turret t = null;

            switch (type)
            {
                case TurretType.Basic:              t = new BasicTurret(Simulator);            break;
                case TurretType.Gravitational:      t = new GravitationalTurret(Simulator);    break;
                case TurretType.MultipleLasers:     t = new MultipleLasersTurret(Simulator);   break;
                case TurretType.Laser:              t = new LaserTurret(Simulator);            break;
                case TurretType.Missile:            t = new MissileTurret(Simulator);          break;
                case TurretType.SlowMotion:         t = new SlowMotionTurret(Simulator);       break;
                case TurretType.Booster:            t = new BoosterTurret(Simulator);          break;
                case TurretType.Gunner:             t = new GunnerTurret(Simulator);           break;
                case TurretType.Nanobots:           t = new NanobotsTurret(Simulator);         break;
                case TurretType.RailGun:            t = new RailGunTurret(Simulator);          break;
                default:                            t = new BasicTurret(Simulator);            break;
            }

            return t;
        }
Пример #51
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;
        }
Пример #52
0
        public List<KeyValuePair<string, PanelWidget>> GetHelpBarMessage(TurretType turretToBuy)
        {
            TurretDescription.SetData(Simulator.TurretsFactory.All[turretToBuy].Description);

            return AvailableTurrets.Count > 1 ? HBMessageManyTurrets : HBMessageOneTurret;
        }
 public abstract bool IsApplicable(TurretType turretType, MonsterType monsterType);
Пример #54
0
 public TurretDescriptor()
 {
     Type = TurretType.Basic;
     Level = 1;
     Position = Vector3.Zero;
     Visible = true;
     CanSell = true;
     CanUpgrade = true;
     CanSelect = true;
 }
 public static int Price(TurretType type)
 {
     return 10;
 }
Пример #56
0
 public TurretDescriptor CreateTurret(TurretType type, int level, Vector3 position, bool visible, bool canSell, bool canUpgrade, bool canSelect)
 {
     return new TurretDescriptor()
     {
         Type = type,
         Level = level,
         Position = position,
         Visible = visible,
         CanSell = canSell,
         CanUpgrade = canUpgrade,
         CanSelect = canSelect
     };
 }
Пример #57
0
 public void AddTurret(TurretType type, int level, Vector3 position)
 {
     AddTurret(type, level, position, true, true, true, true);
 }
 public static void TurretAttack(TurretType type)
 {
     if (TurretAttackEvent != null) {
         TurretAttackEvent(type);
     }
 }
Пример #59
0
 public static string getSpriteUrl(TurretType tt)
 {
     return "Towers/" + sprites[tt];
 }
 public static int CoinsReceived(TurretType type)
 {
     return 10;
 }