Exemple #1
0
        public override void SpawnSetup(Map map)
        {
            base.SpawnSetup(map);
            this.powerComp    = base.GetComp <CompPowerTrader>();
            this.mannableComp = base.GetComp <CompMannable>();
            if (gun == null)
            {
                this.gun = ThingMaker.MakeThing(this.def.building.turretGunDef, null);
            }
            for (int i = 0; i < this.GunCompEq.AllVerbs.Count; i++)
            {
                Verb verb = this.GunCompEq.AllVerbs[i];
                verb.caster = this;
                verb.castCompleteCallback = new Action(this.BurstComplete);
            }
            this.top = new TurretTopCE(this);

            // Callback for ammo comp
            if (compAmmo != null)
            {
                compAmmo.turret = this;
                if (def.building.turretShellDef != null && def.building.turretShellDef is AmmoDef)
                {
                    compAmmo.selectedAmmo = (AmmoDef)def.building.turretShellDef;
                }
            }
        }
 // Uses new TurretTopCE class
 public Building_TurretGunCE()
 {
     this.top = new TurretTopCE(this);
 }