public DiaNode GetAirStrikeDetailsDiaNode(DiaNode parentNode, AirStrikeDef strikeDef)
        {
            DiaNode airStrikeDetailsDiaNode = new DiaNode(strikeDef.LabelCap + "\n\n"
                                                          + strikeDef.description + "\n\n"
                                                          + "Runs number: " + strikeDef.runsNumber + "\n\n"
                                                          + "Cost: " + strikeDef.costInSilver + " silvers");
            DiaOption airStrikeConfirmDiaOption = new DiaOption("Confirm");

            airStrikeConfirmDiaOption.action = delegate
            {
                this.previousTimeSpeed        = Find.TickManager.CurTimeSpeed;
                Find.TickManager.CurTimeSpeed = TimeSpeed.Paused;
                this.selectedStrikeDef        = strikeDef;
                Util_Misc.SelectAirStrikeTarget(this.Map, SpawnAirStrikeBeacon);
            };
            airStrikeConfirmDiaOption.resolveTree = true;
            if (TradeUtility.ColonyHasEnoughSilver(this.Map, strikeDef.costInSilver) == false)
            {
                airStrikeConfirmDiaOption.Disable("not enough silver");
            }
            airStrikeDetailsDiaNode.options.Add(airStrikeConfirmDiaOption);
            DiaOption airStrikeBackDiaOption = new DiaOption("Back");

            airStrikeBackDiaOption.link = parentNode;
            airStrikeDetailsDiaNode.options.Add(airStrikeBackDiaOption);
            return(airStrikeDetailsDiaNode);
        }
 // ===================== Setup work =====================
 public void InitializeAirStrike(IntVec3 targetPosition, AirStrikeDef airStrikeDef)
 {
     this.Position       = targetPosition;
     this.airStrikeDef   = airStrikeDef;
     this.remainingRuns  = this.airStrikeDef.runsNumber;
     this.nextStrikeTick = Find.TickManager.TicksGame + ticksBetweenRuns;
 }
Exemplo n.º 3
0
        public static void SpawnStrikeShip(Map map, IntVec3 targetPosition, AirStrikeDef airStrikeDef)
        {
            FlyingSpaceshipAirStrike strikeShip = ThingMaker.MakeThing(Util_Spaceship.SpaceshipAirStrike) as FlyingSpaceshipAirStrike;

            GenSpawn.Spawn(strikeShip, targetPosition, map);
            strikeShip.InitializeAirStrikeData(targetPosition, airStrikeDef);
        }
Exemplo n.º 4
0
        // ===================== Setup work =====================
        public void InitializeAirStrikeData(IntVec3 targetPosition, AirStrikeDef airStrikeDef)
        {
            this.targetPosition = targetPosition;
            this.airStrikeDef   = airStrikeDef;

            this.ticksBeforeOverflight = this.airStrikeDef.ticksBeforeOverflightInitialValue;
            this.ticksAfterOverflight  = 0;

            ComputeAirStrikeRotation(this.targetPosition);
            base.Tick();
        }
Exemplo n.º 5
0
        // ===================== Setup work =====================
        public void InitializeAirStrikeData(IntVec3 targetPosition, AirStrikeDef airStrikeDef)
        {
            this.targetPosition = targetPosition;
            this.airStrikeDef   = airStrikeDef;

            this.ticksBeforeOverflight = this.airStrikeDef.ticksBeforeOverflightInitialValue;
            this.ticksAfterOverflight  = 0;

            this.spaceshipKind = SpaceshipKind.Airstrike;
            ComputeAirStrikeRotation(this.targetPosition);
            ConfigureShipTexture(this.spaceshipKind);
            base.Tick();
        }