コード例 #1
0
        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);
        }
コード例 #2
0
 // ===================== 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;
 }
コード例 #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);
        }
コード例 #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();
        }
コード例 #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();
        }