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
        // ===================== Inspect panel =====================
        public override string GetInspectString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(base.GetInspectString());

            if (Find.TickManager.TicksGame >= this.takeOffTick)
            {
                stringBuilder.Append("Taking off ASAP");
            }
            else
            {
                stringBuilder.Append("Planned take-off: " + Util_Misc.GetTicksAsStringInDaysHours(this.takeOffTick - Find.TickManager.TicksGame));
            }

            return(stringBuilder.ToString());
        }
Пример #3
0
        // ===================== Inspect panel =====================
        public override string GetInspectString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(base.GetInspectString());

            if (this.powerComp.PowerOn == false)
            {
                stringBuilder.AppendLine();
                stringBuilder.Append("Orbital link down");
                return(stringBuilder.ToString());
            }

            // Goodwill.
            stringBuilder.AppendLine();
            stringBuilder.Append("MiningCo. goodwill: " + Util_Faction.MiningCoFaction.GoodwillWith(Faction.OfPlayer));
            if (Util_Faction.MiningCoFaction.GoodwillWith(Faction.OfPlayer) <= -80)
            {
                stringBuilder.Append(" (hostile)");
            }

            if ((Util_Misc.Partnership.feeInSilver[this.Map] > 0) ||
                (Util_Misc.Partnership.globalGoodwillFeeInSilver > 0))
            {
                stringBuilder.AppendLine();
                stringBuilder.Append("Partnership fee unpaid");
                return(stringBuilder.ToString());
            }

            // Cargo periodic/requested supply.
            stringBuilder.AppendLine();
            stringBuilder.Append("Periodic/requested supply: ");
            if ((this.lastPeriodicSupplyTick > 0) &&
                (Find.TickManager.TicksGame >= this.lastPeriodicSupplyTick) &&
                ((Find.TickManager.TicksGame - this.lastPeriodicSupplyTick) < (FlyingSpaceshipLanding.horizontalTrajectoryDurationInTicks + FlyingSpaceshipLanding.verticalTrajectoryDurationInTicks)))
            {
                stringBuilder.Append("in approach");
            }
            else if (this.landingPadIsAvailable == false)
            {
                stringBuilder.Append("no landing pad");
            }
            else
            {
                string remainingTimeAsString = Util_Misc.GetTicksAsStringInDaysHours(Util_Misc.Partnership.nextPeriodicSupplyTick[this.Map] - Find.TickManager.TicksGame);
                stringBuilder.Append("ETA " + remainingTimeAsString);
            }
            stringBuilder.Append("/");
            if ((this.lastRequestedSupplyTick > 0) &&
                (Find.TickManager.TicksGame >= this.lastRequestedSupplyTick) &&
                ((Find.TickManager.TicksGame - this.lastRequestedSupplyTick) < (FlyingSpaceshipLanding.horizontalTrajectoryDurationInTicks + FlyingSpaceshipLanding.verticalTrajectoryDurationInTicks)))
            {
                stringBuilder.Append("in approach");
            }
            else if (this.landingPadIsAvailable == false)
            {
                stringBuilder.Append("no landing pad");
            }
            else if (Find.TickManager.TicksGame >= Util_Misc.Partnership.nextRequestedSupplyMinTick[this.Map])
            {
                stringBuilder.Append("available");
            }
            else
            {
                string remainingTimeAsString = Util_Misc.GetTicksAsStringInDaysHours(Util_Misc.Partnership.nextRequestedSupplyMinTick[this.Map] - Find.TickManager.TicksGame);
                stringBuilder.Append("ETA " + remainingTimeAsString);
            }

            // Medical supply.
            stringBuilder.AppendLine();
            stringBuilder.Append("Medical supply: ");
            if ((this.lastMedicalSupplyTick > 0) &&
                (Find.TickManager.TicksGame >= this.lastMedicalSupplyTick) &&
                ((Find.TickManager.TicksGame - this.lastMedicalSupplyTick) < (FlyingSpaceshipLanding.horizontalTrajectoryDurationInTicks + FlyingSpaceshipLanding.verticalTrajectoryDurationInTicks)))
            {
                stringBuilder.Append("in approach");
            }
            else if (this.landingPadIsAvailable == false)
            {
                stringBuilder.Append("no landing pad");
            }
            else if (Find.TickManager.TicksGame >= Util_Misc.Partnership.nextMedicalSupplyMinTick[this.Map])
            {
                stringBuilder.Append("available");
            }
            else
            {
                string remainingTimeAsString = Util_Misc.GetTicksAsStringInDaysHours(Util_Misc.Partnership.nextMedicalSupplyMinTick[this.Map] - Find.TickManager.TicksGame);
                stringBuilder.Append("ETA " + remainingTimeAsString);
            }

            // Air strike
            stringBuilder.AppendLine();
            if (Find.TickManager.TicksGame >= Util_Misc.Partnership.nextAirstrikeMinTick[this.Map])
            {
                stringBuilder.Append("Air strike: available");
            }
            else
            {
                string remainingTimeAsString = Util_Misc.GetTicksAsStringInDaysHours(Util_Misc.Partnership.nextAirstrikeMinTick[this.Map] - Find.TickManager.TicksGame);
                stringBuilder.Append("Air strike: available in " + remainingTimeAsString);
            }
            return(stringBuilder.ToString());
        }
Пример #4
0
        public static void GeneratePawnApparelAndWeapon(ref Pawn pawn, PawnKindDef kindDef, float temperature)
        {
            if (kindDef == Util_PawnKindDefOf.Technician)
            {
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_Pants"), ThingDef.Named("Synthread"), colorCivilLightGrey);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_CollarShirt"), ThingDef.Named("Synthread"), colorCivilLightGrey);

                if (temperature < 20f)
                {
                    // Only give a tuque if temperature is low enough.
                    GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDefOf.Apparel_Tuque, ThingDef.Named("Synthread"), colorCivilLightGrey);
                }
                if (needParka)
                {
                    GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDefOf.Apparel_Parka, ThingDef.Named("Synthread"), armorColor);
                }
                GeneratePawnWeapon(ref pawn, kindDef.itemQuality, ThingDef.Named("Gun_Autopistol"));
            }
            else if (kindDef == Util_PawnKindDefOf.Miner)
            {
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_Pants"), ThingDef.Named("Synthread"), colorCivilLightGrey);
                if (Util_Misc.IsModActive("MiningCo. MiningHelmet"))
                {
                    GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("MiningHelmet"), null, Color.black, false);
                    GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("MiningVest"), null, Color.black, false);
                }
                else
                {
                    GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_BasicShirt"), ThingDef.Named("Synthread"), colorCivilLightGrey);
                    if (temperature < 20f)
                    {
                        // Only give a tuque if temperature is low enough.
                        GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDefOf.Apparel_Tuque, ThingDef.Named("Synthread"), colorCivilLightGrey);
                    }
                    if (needParka)
                    {
                        GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDefOf.Apparel_Parka, ThingDef.Named("Synthread"), armorColor);
                    }
                }
                GeneratePawnWeapon(ref pawn, kindDef.itemQuality, ThingDef.Named("Gun_HeavySMG"));
            }
            else if (kindDef == Util_PawnKindDefOf.Geologist)
            {
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_Pants"), ThingDef.Named("Synthread"), colorCivilLightGrey);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_CollarShirt"), ThingDef.Named("Synthread"), colorCivilLightGrey);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_Jacket"), ThingDef.Named("Synthread"), colorCivilGrey);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_CowboyHat"), ThingDef.Named("Synthread"), colorCivilGrey);
                if (needParka)
                {
                    GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDefOf.Apparel_Parka, ThingDef.Named("Synthread"), armorColor);
                }
                GeneratePawnWeapon(ref pawn, kindDef.itemQuality, ThingDef.Named("Gun_MachinePistol"));
            }
            else if (kindDef == Util_PawnKindDefOf.Medic)
            {
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_Pants"), ThingDef.Named("Synthread"), pantColor);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_CollarShirt"), ThingDef.Named("Synthread"), shirtColor);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_Duster"), ThingDef.Named("Synthread"), colorArmyWhite);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_SimpleHelmet"), ThingDefOf.Plasteel, colorArmyWhite);
                if (needParka)
                {
                    GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDefOf.Apparel_Parka, ThingDef.Named("Synthread"), colorArmyWhite);
                }
                GeneratePawnWeapon(ref pawn, kindDef.itemQuality, ThingDef.Named("Gun_MachinePistol"));
            }
            else if ((kindDef == Util_PawnKindDefOf.Pilot) ||
                     (kindDef == Util_PawnKindDefOf.Scout))
            {
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_Pants"), ThingDef.Named("Synthread"), pantColor);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_BasicShirt"), ThingDef.Named("Synthread"), shirtColor);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_VestPlate"), null, Color.black, false);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_SimpleHelmet"), ThingDefOf.Plasteel, helmetColor);
                if (needParka)
                {
                    GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDefOf.Apparel_Parka, ThingDef.Named("Synthread"), armorColor);
                }
                if (kindDef == Util_PawnKindDefOf.Pilot)
                {
                    GeneratePawnWeapon(ref pawn, kindDef.itemQuality, ThingDef.Named("Gun_Autopistol"));
                }
                else
                {
                    GeneratePawnWeapon(ref pawn, kindDef.itemQuality, ThingDef.Named("Gun_AssaultRifle"));
                }
            }
            else if (kindDef == Util_PawnKindDefOf.Guard)
            {
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_Pants"), ThingDef.Named("Synthread"), pantColor);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_BasicShirt"), ThingDef.Named("Synthread"), shirtColor);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_PowerArmor"), null, armorColor);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_AdvancedHelmet"), ThingDefOf.Plasteel, helmetColor);
                GeneratePawnWeapon(ref pawn, kindDef.itemQuality, ThingDef.Named("Gun_ChargeRifle"));
                if (Rand.Value < 0.5f)
                {
                    // Chance to add a smokepop belt.
                    GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDefOf.Apparel_SmokepopBelt, null, armorColor);
                }
            }
            else if ((kindDef == Util_PawnKindDefOf.ShockTrooper) ||
                     (kindDef == Util_PawnKindDefOf.HeavyGuard))
            {
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_Pants"), ThingDef.Named("Synthread"), pantColor);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_BasicShirt"), ThingDef.Named("Synthread"), shirtColor);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_PowerArmor"), null, armorColor);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_PowerArmorHelmet"), null, helmetColor);
                if (kindDef == Util_PawnKindDefOf.ShockTrooper)
                {
                    GeneratePawnWeapon(ref pawn, kindDef.itemQuality, ThingDef.Named("Gun_ChainShotgun"));
                }
                else
                {
                    GeneratePawnWeapon(ref pawn, kindDef.itemQuality, ThingDef.Named("Gun_Minigun"));
                }
            }
            else if (kindDef == Util_PawnKindDefOf.Officer)
            {
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_Pants"), ThingDefOf.Hyperweave, pantColor);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_CollarShirt"), ThingDefOf.Hyperweave, shirtColor);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_VestPlate"), null, Color.black, false);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_Duster"), ThingDefOf.Hyperweave, armorColor);
                GeneratePawnApparel(ref pawn, kindDef.itemQuality, ThingDef.Named("Apparel_CowboyHat"), ThingDefOf.Hyperweave, helmetColor);
                GeneratePawnWeapon(ref pawn, kindDef.itemQuality, ThingDef.Named("Gun_SniperRifle"));
            }
            else
            {
                Log.ErrorOnce("MiningCo. Spaceship: unhandled PawnKindDef (" + kindDef.ToString() + ").", 123456786);
            }
        }
 /// <summary>
 /// Select a new air strike target.
 /// </summary>
 public void SelectNewAirStrikeTarget()
 {
     Util_Misc.SelectAirStrikeTarget(this.Map, SetNewAirStrikeTarget);
 }