// Token: 0x06000031 RID: 49 RVA: 0x00003520 File Offset: 0x00001720 internal bool FlightChecksOK(Pawn pilot, Thing JP, out string checksReason) { checksReason = ""; if ((pilot?.Map) == null) { checksReason = Translator.Translate("JetPack.ChecksLocation"); return(false); } if (GridsUtility.Roofed(pilot.Position, pilot.Map)) { if (!Settings.RoofPunch) { checksReason = Translator.Translate("JetPack.ChecksRoofed"); return(false); } ThingDef chkSKF = DefDatabase <ThingDef> .GetNamed(this.JPSkyFallType, false); if (chkSKF == null || !chkSKF.skyfaller.hitRoof) { checksReason = TranslatorFormattedStringExtensions.Translate("JetPack.ChecksSFNotRPunch", (chkSKF != null) ? GenText.CapitalizeFirst(chkSKF.label) : null); return(false); } } if (this.JPFuelAmount < this.JPFuelMin) { checksReason = Translator.Translate("JetPack.ChecksRefuel") + GenText.CapitalizeFirst(JP.Label); return(false); } return(true); }
public bool resolve() { FactionFC factionfc = Find.World.GetComponent <FactionFC>(); if (PaymentUtil.getSilver() >= -1 * this.taxes.silverAmount || this.taxes.silverAmount >= 0) { //if have enough silver on the current map to pay & map belongs to player FCEventMaker.createTaxEvent(this); if (this.taxes.researchCompleted != 0) { factionfc.researchPointPool += this.taxes.researchCompleted; Messages.Message(TranslatorFormattedStringExtensions.Translate("PointsAddedToResearchPool", this.taxes.researchCompleted), MessageTypeDefOf.PositiveEvent); } if (this.taxes.electricityAllotted != 0) { factionfc.powerPool += this.taxes.electricityAllotted; } return(true); } else { Messages.Message("NotEnoughSilverForBill".Translate() + " " + this.settlement.name + ". " + "ConfiscatedTithes".Translate() + "." + " " + "UnpaidTitheEffect".Translate(), MessageTypeDefOf.NegativeEvent); this.settlement.unrest += 10 * traitUtilsFC.cycleTraits(new double(), "unrestGainedMultiplier", this.settlement.traits, "multiply") * traitUtilsFC.cycleTraits(new double(), "unrestGainedMultiplier", factionfc.traits, "multiply"); this.settlement.happiness -= 10 * traitUtilsFC.cycleTraits(new double(), "happinessLostMultiplier", this.settlement.traits, "multiply") * traitUtilsFC.cycleTraits(new double(), "happinessLostMultiplier", factionfc.traits, "multiply"); factionfc.Bills.Remove(this); return(false); } }
// Token: 0x06000027 RID: 39 RVA: 0x00002B44 File Offset: 0x00000D44 public void UseJetPack(Pawn pilot, Thing JP, IntVec3 targCell) { if (!this.JPComposMentis(pilot, JP, out string Reason)) { Messages.Message(TranslatorFormattedStringExtensions.Translate("JetPack.CantDo", pilot, Reason), pilot, MessageTypeDefOf.NeutralEvent, false); SoundStarter.PlayOneShotOnCamera(SoundDefOf.ClickReject, null); return; } if (!this.FlightChecksOK(pilot, JP, out string ChecksReason)) { Messages.Message(TranslatorFormattedStringExtensions.Translate("JetPack.ChecksReason", GenText.CapitalizeFirst(pilot.LabelShort), ChecksReason), pilot, MessageTypeDefOf.NeutralEvent, false); SoundStarter.PlayOneShotOnCamera(SoundDefOf.ClickReject, null); return; } if (JPUtility.ChkForDissallowed(pilot, out string DAllowReason)) { Messages.Message(TranslatorFormattedStringExtensions.Translate("JetPack.DAllowReason", GenText.CapitalizeFirst(pilot.LabelShort), DAllowReason), pilot, MessageTypeDefOf.NeutralEvent, false); SoundStarter.PlayOneShotOnCamera(SoundDefOf.ClickReject, null); return; } if (!this.FlightCellCheck(pilot, targCell, this.JPFuelAmount, this.JPFuelRate, this.JPJumpRangeMin, this.JPJumpRangeMax, out string JumpReason)) { Messages.Message(TranslatorFormattedStringExtensions.Translate("JetPack.JumpReason", JumpReason), pilot, MessageTypeDefOf.NeutralEvent, false); SoundStarter.PlayOneShotOnCamera(SoundDefOf.ClickReject, null); return; } if (!JPInjury.CheckForExplosion(this)) { this.DoJumpJet(pilot, targCell); return; } JPInjury.DoJPExplosion(pilot, this.JPFuelAmount, this.JPFuelItem); this.JPFuelAmount = 0; }
public void DoNeoCough() { lastCoughSeverity = parent.Severity; lastCoughStage = parent.CurStageIndex; lastCoughTick = parent.ageTicks; // Find.TickManager.TicksGame; // parent.ageTicks; // nextCoughTick = lastCoughTick + Rand.RangeInclusiveSeeded(3000, 24000, AvPConstants.AvPSeed); float chance = ((0.25f + lastCoughSeverity)) + (((timesCoughedBlood * 2) + timesCoughed) / 10); if (Rand.ChanceSeeded(chance, AvPConstants.AvPSeed)) { if (this.parent.pawn.Faction == Faction.OfPlayer) { string text = TranslatorFormattedStringExtensions.Translate("Xeno_Neospores_Cough", base.parent.pawn.LabelShortCap, Coughlist[Rand.RangeInclusiveSeeded(timesCoughed, Coughlist.Count, AvPConstants.AvPSeed)]); // Log.Message(text); MoteMaker.ThrowText(base.parent.pawn.Position.ToVector3(), base.parent.pawn.Map, text, 3f); } if (Rand.ChanceSeeded(chance, AvPConstants.AvPSeed)) { if (this.parent.pawn.Faction == Faction.OfPlayer) { string text = TranslatorFormattedStringExtensions.Translate("Xeno_Neospores_Cough_Blood"); // Log.Message(text); MoteMaker.ThrowText(base.parent.pawn.Position.ToVector3(), base.parent.pawn.Map, text, 3f); } parent.pawn.health.DropBloodFilth(); timesCoughedBlood++; } else { timesCoughed++; } } }
// Token: 0x060039DF RID: 14815 RVA: 0x001B80A4 File Offset: 0x001B64A4 protected override DamageWorker.DamageResult ApplyMeleeDamageToTarget(LocalTargetInfo target) { Pawn hitPawn = (Pawn)target; DamageWorker.DamageResult result = new DamageWorker.DamageResult(); foreach (DamageInfo dinfo in this.DamageInfosToApply(target)) { if (target.ThingDestroyed) { break; } result = target.Thing.TakeDamage(dinfo); } if (infect) { foreach (var part in hitPawn.RaceProps.body.AllParts.Where(x => x.def.defName == "Head")) { Hediff hediff = HediffMaker.MakeHediff(XenomorphDefOf.RRY_FaceHuggerInfection, hitPawn, null); HediffComp_XenoFacehugger comp = hediff.TryGetComp <HediffComp_XenoFacehugger>(); comp.Props.Instigator = CasterPawn; hitPawn.health.AddHediff(hediff, part, null); string text = TranslatorFormattedStringExtensions.Translate("Xeno_Facehugger_Attach", hitPawn.LabelShort, part.LabelShortCap); MoteMaker.ThrowText(hitPawn.Position.ToVector3(), hitPawn.Map, text, 5f); caster.DeSpawn(); } } return(result); }
// Token: 0x06000040 RID: 64 RVA: 0x00004AC0 File Offset: 0x00002CC0 private static bool GenMSRecipe(Pawn pawn, HediffDef hdef, ThingDef drugdef, BodyPartRecord part = null) { bool result = false; if (MSDrugUtility.IsOKtoAdmin(pawn, hdef, drugdef)) { RecipeDef recipeDef = DefDatabase <RecipeDef> .GetNamed("Administer_" + drugdef.defName, true); if (recipeDef != null) { if (!MSAddDrugBill.IsViolation(pawn, recipeDef, out string reason)) { if (!MSAddDrugBill.ChkDuplication(pawn, recipeDef) && MSAddDrugBill.GenAdminOption(pawn, recipeDef, part)) { result = true; } } else { Messages.Message(TranslatorFormattedStringExtensions.Translate("MSPainless.ViolationMsg", GenText.CapitalizeFirst(pawn.LabelShort), GenText.CapitalizeFirst(drugdef.label), reason), pawn, MessageTypeDefOf.NeutralEvent, false); } } } return(result); }
public override void DoSettingsWindowContents(Rect inRect) { Listing_Standard listingStandard = new Listing_Standard(); listingStandard.Begin(inRect); listingStandard.Label(Translator.Translate("OptionSkills")); listingStandard.CheckboxLabeled(Translator.Translate("OptionSkillIntellectual"), ref Settings.intellectualAffectsMortarAccuracy); listingStandard.CheckboxLabeled(Translator.Translate("OptionSkillShooting"), ref Settings.shootingAffectsMortarAccuracy); listingStandard.Label(TranslatorFormattedStringExtensions.Translate("OptionBestAccuracy", (int)(Settings.maxSkillSpreadReduction * 100))); Settings.maxSkillSpreadReduction = listingStandard.Slider(Settings.maxSkillSpreadReduction, 0f, 1f); string modifierString = Settings.minSkillSpreadReduction < 0 ? Translator.Translate("Reduced") : Translator.Translate("Improved"); listingStandard.Label(TranslatorFormattedStringExtensions.Translate("OptionWorstAccuracy", modifierString, (int)(Settings.minSkillSpreadReduction * 100))); Settings.minSkillSpreadReduction = listingStandard.Slider(Settings.minSkillSpreadReduction, -1f, 1f); if (Settings.minSkillSpreadReduction > Settings.maxSkillSpreadReduction) { Settings.minSkillSpreadReduction = Settings.maxSkillSpreadReduction; } listingStandard.CheckboxLabeled(Translator.Translate("OptionWeather"), ref Settings.weatherAffectsMortarAccuracy); listingStandard.CheckboxLabeled(Translator.Translate("OptionShowExplosionRadius"), ref Settings.showExplosionRadius); listingStandard.CheckboxLabeled(Translator.Translate("OptionTargetLeading"), ref Settings.targetLeading); listingStandard.End(); base.DoSettingsWindowContents(inRect); }
public override void PostAdd(DamageInfo?dinfo) { string key = "FeltOrgasm"; string text = TranslatorFormattedStringExtensions.Translate(key, pawn.LabelIndefinite()).CapitalizeFirst(); Messages.Message(text, pawn, MessageTypeDefOf.NeutralEvent); }
public override void DoWindowContents(Rect inRect) { //grab before anchor/font GameFont fontBefore = Text.Font; TextAnchor anchorBefore = Text.Anchor; //Settlement Tax Collection Header Text.Anchor = TextAnchor.MiddleCenter; Text.Font = GameFont.Small; Widgets.Label(label_Title, "SendSilverToColony".Translate()); Widgets.Label(label_Upper, TranslatorFormattedStringExtensions.Translate("SendingXSilver", selectedSilver)); selectedSilver = (int)Widgets.HorizontalSlider(slider, selectedSilver, 0, silverCount, roundTo: 1); Widgets.Label(label_Lower, TranslatorFormattedStringExtensions.Translate(stringEffect, returnValue(selectedSilver))); if (Widgets.ButtonText(button_Confirm, "FCConfirm".Translate())) { PaymentUtil.paySilver(selectedSilver); this.useValue(selectedSilver); this.Close(); } //reset anchor/font Text.Font = fontBefore; Text.Anchor = anchorBefore; }
// Creates a menu option to use an item. "tar" is expected to be a pawn, corpse or null if it doesn't apply (in which // case the pawn will presumably use the item on themself). "required_work" can also be null. public static FloatMenuOption make_option(this CompUsable usa, string label, Pawn p, LocalTargetInfo tar, WorkTypeDef required_work) { if ((tar != null) && (!p.CanReserve(tar))) { string key = "Reserved"; string text = TranslatorFormattedStringExtensions.Translate(key); return(new FloatMenuOption(label + " (" + text + ")", null, MenuOptionPriority.DisabledOption)); } else if ((tar != null) && (!p.CanReach(tar, PathEndMode.Touch, Danger.Some))) { string key = "NoPath"; string text = TranslatorFormattedStringExtensions.Translate(key); return(new FloatMenuOption(label + " (" + text + ")", null, MenuOptionPriority.DisabledOption)); } else if ((required_work != null) && p.story.WorkTypeIsDisabled(required_work)) { string key = "CannotPrioritizeWorkTypeDisabled"; string text = TranslatorFormattedStringExtensions.Translate(key, required_work.gerundLabel); return(new FloatMenuOption(label + " (" + text + ")", null, MenuOptionPriority.DisabledOption)); } else { return(new FloatMenuOption( label, delegate { usa.start_job(p, tar); }, MenuOptionPriority.Default)); } }
// Token: 0x06000032 RID: 50 RVA: 0x00003134 File Offset: 0x00001334 public override void TickRare() { base.TickRare(); if (ticksSinceLastPerformance < VenueDef.ticksBetweenPerformances) { ticksSinceLastPerformance++; return; } if (CanDoPerformanceNow()) { if (rehearsing && rehearsedFraction < 1f) { if (Lead != null && (Lead.Dead || Lead.Faction != Faction.OfPlayer)) { Messages.Message(TranslatorFormattedStringExtensions.Translate("RAZ_MessageRehearsalsDelayed", Lead.Named("PAWN")), MessageTypeDefOf.NegativeEvent, true); lead = null; leadIndex = -1; rehearsedFraction /= 3f; } if (VenueDef.performersNeeded > 1 && Support != null && (Support.Dead || Support.Faction != Faction.OfPlayer)) { Messages.Message(TranslatorFormattedStringExtensions.Translate("RAZ_MessageRehearsalsDelayed", Support.Named("PAWN")), MessageTypeDefOf.NegativeEvent, true); support = null; supportIndex = -1; rehearsedFraction /= 3f; return; } } else if (Rand.Value <= 0.1f) { TryToStartPerformance(); } } }
// Token: 0x06000027 RID: 39 RVA: 0x00002CBC File Offset: 0x00000EBC public override string GetInspectString() { var stringBuilder = new StringBuilder(); if (rehearsing) { if (rehearsedFraction < 1f) { stringBuilder.AppendLine(TranslatorFormattedStringExtensions.Translate("RAZ_Rehearsal_Venue", artTitle)); if (Lead != null) { if (Support == null) { stringBuilder.AppendLine(TranslatorFormattedStringExtensions.Translate("RAZ_Rehearsal_Performer", Lead.Named("PAWN"))); } else { stringBuilder.AppendLine(TranslatorFormattedStringExtensions.Translate("RAZ_Rehearsal_Performers", Lead.Named("PAWN1"), Support.Named("PAWN2"))); } } stringBuilder.AppendLine(TranslatorFormattedStringExtensions.Translate("RAZ_Rehearsal_Progress", rehearsedFraction.ToStringPercent())); } else { stringBuilder.AppendLine(TranslatorFormattedStringExtensions.Translate("RAZ_PerformancePending", artTitle)); } } else { stringBuilder.AppendLine(BasicInspectString); } return(stringBuilder.ToString().TrimEndNewlines()); }
private void HostileDefeated() { // Killed all hostiles - Win outcome if (!GenHostility.AnyHostileActiveThreatTo(((MapParent)parent).Map, Faction.OfPlayer)) { active = false; DropPodUtility.DropThingsNear(DropCellFinder.TradeDropSpot(Find.AnyPlayerHomeMap), Find.AnyPlayerHomeMap, rewards, 110, false, true, true); parent.Faction.TryAffectGoodwillWith(Faction.OfPlayer, +15, false, true); if (!Find.WorldObjects.Settlements.Where(s => s.Faction == enemy && !s.Faction.def.hidden && Find.WorldReachability.CanReach(Find.AnyPlayerHomeMap.Tile, s.Tile)).TryRandomElement(out Settlement enemySet)) { Find.LetterStack.ReceiveLetter("LetterLabelOutpostdefensesuccess".Translate(), TranslatorFormattedStringExtensions.Translate("Outpostdefensesuccess", parent.Faction.leader, parent.Faction.def.leaderTitle, GenLabel.ThingsLabel(rewards, string.Empty)), EndGameDefOf.FE_JointRaid.letterDef, null, parent.Faction, null); active = false; return; } List <Thing> rewardsNew = ThingSetMakerDefOf.Reward_StandardByDropPod.root.Generate(new ThingSetMakerParams() { totalMarketValueRange = new FloatRange?(SiteTuning.BanditCampQuestRewardMarketValueRange * SiteTuning.QuestRewardMarketValueThreatPointsFactor.Evaluate(StorytellerUtility.DefaultSiteThreatPointsNow() + 500f)) }); Thing silver = ThingMaker.MakeThing(ThingDefOf.Silver); silver.stackCount = (int)FE_IncidentWorker_Jointraid.SilverBonusRewardCurve.Evaluate(parent.Faction.PlayerGoodwill); int random = new IntRange(Global.DayInTicks * 15, Global.DayInTicks * 25).RandomInRange; enemySet.GetComponent <WorldComp_JointRaid>().StartComp(random, parent.Faction, rewardsNew, silver); string text = TranslatorFormattedStringExtensions.Translate("OutpostdefensesuccessJointRaid", parent.Faction.leader, parent.Faction.def.leaderTitle, GenLabel.ThingsLabel(rewardsNew, string.Empty), random.ToStringTicksToPeriod(), GenThing.GetMarketValue(rewards).ToStringMoney(null), silver.stackCount.ToString(), GenLabel.ThingsLabel(rewards, string.Empty)).CapitalizeFirst(); GenThing.TryAppendSingleRewardInfo(ref text, rewards); Find.LetterStack.ReceiveLetter(EndGameDefOf.FE_JointRaid.letterLabel, text, EndGameDefOf.FE_JointRaid.letterDef, enemySet, parent.Faction, null); } }
// Token: 0x0600002C RID: 44 RVA: 0x000031D8 File Offset: 0x000013D8 public void RefuelJP(Pawn pilot, Thing JP, bool Using) { if (Using) { if (this.JPComposMentis(pilot, JP, out string Reason)) { if (this.JPFuelAmount >= this.JPFuelMax) { Messages.Message(TranslatorFormattedStringExtensions.Translate("JetPack.FullyFueled", GenText.CapitalizeFirst(JP.Label)), pilot, MessageTypeDefOf.NeutralEvent, false); SoundStarter.PlayOneShotOnCamera(SoundDefOf.ClickReject, null); return; } JobDef JPRefuel = DefDatabase <JobDef> .GetNamed("JPRefuel", true); this.FindBestJPFuel(pilot, out Thing targ); if (targ != null) { Job job = new Job(JPRefuel, targ); pilot.jobs.TryTakeOrderedJob(job, 0); return; } Messages.Message(TranslatorFormattedStringExtensions.Translate("JetPack.NoFuelFound", GenText.CapitalizeFirst(this.JPFuelItem.label)), pilot, MessageTypeDefOf.NeutralEvent, false); SoundStarter.PlayOneShotOnCamera(SoundDefOf.ClickReject, null); return; } else { Messages.Message(TranslatorFormattedStringExtensions.Translate("JetPack.CantDo", pilot, Reason), pilot, MessageTypeDefOf.NeutralEvent, false); SoundStarter.PlayOneShotOnCamera(SoundDefOf.ClickReject, null); } } }
public override void CompPostPostRemoved() { Thing hostThing = base.Pawn; Pawn hostPawn = base.Pawn; IntVec3 spawnLoc = !base.Pawn.Dead ? base.parent.pawn.Position : base.parent.pawn.PositionHeld; Map spawnMap = !base.Pawn.Dead ? base.parent.pawn.Map : base.parent.pawn.MapHeld; bool spawnLive = Props.spawnLive; if ((hostPawn.health.hediffSet.HasHediff(XenomorphDefOf.RRY_XenomorphImpregnation) && !hasImpregnated) || hostPawn.Dead) { spawnLive = true; } PawnGenerationRequest pawnGenerationRequest = new PawnGenerationRequest(pawnKindDef, null, PawnGenerationContext.NonPlayer, -1, true, false, true, false, true, true, 20f); Pawn pawn = PawnGenerator.GeneratePawn(pawnGenerationRequest); if (Instigator != null) { pawn = intigator; } if (spawnLive == true) { GenSpawn.Spawn(pawn, spawnLoc, spawnMap, 0); } else { GenSpawn.Spawn(pawn, spawnLoc, spawnMap, 0); pawn.Kill(null); } string text = TranslatorFormattedStringExtensions.Translate("Xeno_Facehugger_Detach", base.parent.pawn.LabelShort); MoteMaker.ThrowText(spawnLoc.ToVector3(), spawnMap, text, 5f); }
public bool attemptResolve() { FactionFC factionfc = Find.World.GetComponent <FactionFC>(); if (PaymentUtil.getSilver() >= -1 * this.taxes.silverAmount || this.taxes.silverAmount >= 0) { //if have enough silver on the current map to pay & map belongs to player FCEventMaker.createTaxEvent(this); if (this.taxes.researchCompleted != 0) { factionfc.researchPointPool += this.taxes.researchCompleted; Messages.Message(TranslatorFormattedStringExtensions.Translate("PointsAddedToResearchPool", this.taxes.researchCompleted), MessageTypeDefOf.PositiveEvent); } if (this.taxes.electricityAllotted != 0) { factionfc.powerPool += this.taxes.electricityAllotted; } return(true); } else { return(false); } }
public void ProcessInput() { var list = new List <FloatMenuOption>(); Map map = Map; if (innerContainer.Count != 0) { foreach (ThingBook current in innerContainer) { var text = current.Label; if (current.TryGetComp <CompArt>() is CompArt compArt) { text = TranslatorFormattedStringExtensions.Translate("RimWriter_BookTitle", compArt.Title, compArt.AuthorName); } List <FloatMenuOption> arg_121_0 = list; bool extraPartOnGUI(Rect rect) => Widgets.InfoCardButton(rect.x + 5f, rect.y + (rect.height - 24f) / 2f, current); arg_121_0.Add(new FloatMenuOption(text, delegate { TryDrop(current); }, MenuOptionPriority.Default, null, null, 29f, extraPartOnGUI, null)); } } Find.WindowStack.Add(new FloatMenu(list)); }
private void DrawCostCalculationLabel(Rect elemRect, Type invokeType) { var costs = new List <NamedArgument>(); var advCostFunc = default(Func <SacrificeCostGrowth, int, float, float, int, int>); var formatString = default(string); if (invokeType == typeof(InvokeGreaterBlessing)) { advCostFunc = InvokeGreaterBlessing.GetAdvanceCost; formatString = Strings.SettingsSacrificeCostGreater; } else if (invokeType == typeof(InvokeLesserBlessing)) { advCostFunc = InvokeLesserBlessing.GetAdvanceCost; formatString = Strings.SettingsSacrificeCostLesser; } for (int i = 0; i < 8; i++) { var cost = advCostFunc( Settings.CostGrowthMode, i + 1, Settings._costBase, Settings._costGrowthFactor, Settings._costGrowthStartTier); costs.Add(new NamedArgument(cost, i.ToString())); } Widgets.Label(elemRect, TranslatorFormattedStringExtensions.Translate(formatString, costs.ToArray())); }
// Token: 0x0600006C RID: 108 RVA: 0x0000696C File Offset: 0x00004B6C public static void DoDRResponseMsg(Pawn pawn, HediffDef hediffdef, ThingDef thingdef) { if (DRSettings.ShowResponseMsg) { Messages.Message(TranslatorFormattedStringExtensions.Translate("MSPainless.ResponseMsg", GenText.CapitalizeFirst(pawn.LabelShort), GenText.CapitalizeFirst(hediffdef.label), GenText.CapitalizeFirst(thingdef.label)), pawn, MessageTypeDefOf.NeutralEvent, true); } }
public void Notify_CaravanArrived(Caravan caravan) { Thing silver = ThingMaker.MakeThing(DefDatabase <ThingDef> .GetNamed("Silver")); silver.stackCount = (int)silverCurve.Evaluate(Math.Min(Find.AnyPlayerHomeMap.wealthWatcher.WealthTotal / 2, 10000) / Utilities.FactionsWar().GetByFaction(Faction).resources); DiaNode nodeRoot = new DiaNode("RoadsCampRequest".Translate(caravan.Name, Faction)); nodeRoot.options.Add(new DiaOption("RoadsCampRequest_Attack".Translate()) { action = () => { Faction.TrySetRelationKind(Faction.OfPlayer, FactionRelationKind.Hostile, true, "RoadsCampRequest_AttackReason".Translate(Faction)); Utilities.FactionsWar().GetByFaction(Faction).resources -= FE_WorldComp_FactionsWar.MEDIUM_EVENT_RESOURCE_VALUE; Find.WorldObjects.Remove(this); }, link = new DiaNode(TranslatorFormattedStringExtensions.Translate("RoadsCampRequestAttack", caravan, Faction.leader)) { options = { new DiaOption("OK".Translate()) { resolveTree = true } } } }); DiaOption bribe = new DiaOption("RoadsCampRequest_Bribe".Translate(silver.stackCount)) { action = () => { Faction.TryAffectGoodwillWith(Faction.OfPlayer, -20); caravan.GiveSoldThingToPlayer(silver, silver.stackCount, BestCaravanPawnUtility.FindBestNegotiator(caravan)); extorted = true; }, link = new DiaNode(TranslatorFormattedStringExtensions.Translate("RoadsCampRequestBribe", silver.stackCount, caravan)) { options = { new DiaOption("OK".Translate()) { resolveTree = true } } } }; if (extorted) { bribe.Disable("RoadsCampRequestBribe_Disabled".Translate()); } nodeRoot.options.Add(bribe); nodeRoot.options.Add(new DiaOption("RoadsCampRequest_Leave".Translate()) { resolveTree = true }); Find.WindowStack.Add(new Dialog_NodeTreeWithFactionInfo(nodeRoot, Faction, true, true, "RoadsCampRequestTitle".Translate(Faction))); Find.Archive.Add(new ArchivedDialog(nodeRoot.text, "RoadsCampRequestTitle".Translate(Faction), Faction)); }
public string DisabledReason(int minNeeded, int maxNeeded) { if (AmmoDef == null) { return("CommandReload_NoCharges".Translate(Props.ChargeNounArgument)); } return(TranslatorFormattedStringExtensions.Translate(arg3: ((Props.ammoCountToRefill == 0) ? ((minNeeded == maxNeeded) ? minNeeded.ToString() : $"{minNeeded}-{maxNeeded}") : Props.ammoCountToRefill.ToString()).Named("COUNT"), key: "CommandReload_NoAmmo", arg1: Props.ChargeNounArgument, arg2: NamedArgumentUtility.Named(AmmoDef, "AMMO"))); }
public override void CompPostTick(ref float severityAdjustment) { bool selected = Find.Selector.SingleSelectedThing == parent.pawn; if (parent.CurStageIndex >= parent.def.stages.Count - 3 && this.Pawn.Map == null) { return; } base.CompPostTick(ref severityAdjustment); if (parent.ageTicks > nextCoughTick && (this.Def == XenomorphDefOf.RRY_HiddenNeomorphImpregnation || this.Def == XenomorphDefOf.RRY_NeomorphImpregnation)) { DoNeoCough(); } if (parent.CurStageIndex == parent.def.stages.Count - 2) { if (parent.Part != parent.pawn.RaceProps.body.corePart) { parent.Part = parent.pawn.RaceProps.body.corePart; } if (!this.logonce && this.parent.pawn.Downed) { string text = TranslatorFormattedStringExtensions.Translate("Xeno_Chestburster_PreEmerge", this.Pawn.LabelShort); Log.Message(text); MoteMaker.ThrowText(base.parent.pawn.Position.ToVector3(), base.parent.pawn.Map, text, 5f); this.logonce = true; } #if DEBUG if (selected) { Log.Message(string.Format("Pre Death stage: {0}", parent.CurStage.label)); } #endif int num = Find.TickManager.TicksGame % 300 * 2; #if DEBUG if (selected) { Log.Message(string.Format("num: {0}", num)); } #endif if (num < 90) { Pawn.Drawer.renderer.wiggler.downedAngle += 0.35f; } else if (num < 390 && num >= 300) { Pawn.Drawer.renderer.wiggler.downedAngle -= 0.35f; } else if (num < 270 && num >= 180) { Pawn.Drawer.renderer.wiggler.downedAngle += 0.35f; } else if (num < 570 && num >= 510) { Pawn.Drawer.renderer.wiggler.downedAngle -= 0.35f; } } }
public override void CompPostTick(ref float severityAdjustment) { bool selected = Find.Selector.SingleSelectedThing == parent.pawn; if (parent.CurStageIndex >= parent.def.stages.Count - 3 && this.Pawn.Map == null) { return; } base.CompPostTick(ref severityAdjustment); if (base.Pawn.IsHashIntervalTick(200)) { float num = this.SeverityChangePerDay(); num *= 0.00333333341f; severityAdjustment += num; } if (parent.CurStageIndex == parent.def.stages.Count - 2) { if (parent.Part != parent.pawn.RaceProps.body.corePart) { parent.Part = parent.pawn.RaceProps.body.corePart; } if (!this.logonce && this.parent.pawn.Downed) { if (parent.pawn.InBed() && parent.pawn.CurrentBed() is Building_XenomorphCocoon) { Pawn.CurrentBed().Destroy(); } string text = TranslatorFormattedStringExtensions.Translate("Xeno_Chestburster_PreEmerge", this.Pawn.LabelShort); // Log.Message(text); MoteMaker.ThrowText(base.parent.pawn.Position.ToVector3(), base.parent.pawn.Map, text, 5f); this.logonce = true; } #if DEBUG // if (selected) Log.Message(string.Format("Pre Death stage: {0}", parent.CurStage.label)); #endif int num = Find.TickManager.TicksGame % 300 * 2; #if DEBUG // if (selected) Log.Message(string.Format("num: {0}", num)); #endif if (num < 90) { Pawn.Drawer.renderer.wiggler.downedAngle += 0.35f; } else if (num < 390 && num >= 300) { Pawn.Drawer.renderer.wiggler.downedAngle -= 0.35f; } else if (num < 270 && num >= 180) { Pawn.Drawer.renderer.wiggler.downedAngle += 0.35f; } else if (num < 570 && num >= 510) { Pawn.Drawer.renderer.wiggler.downedAngle -= 0.35f; } } }
protected override void ReceiveCompSignal(string signal) { if (signal == "RuinedByTemperature") { Messages.Message(TranslatorFormattedStringExtensions.Translate("AC.CompostRuined", this.Label) .CapitalizeFirst(), new TargetInfo(this.PositionHeld, this.MapHeld, false), MessageTypeDefOf.NegativeEvent, true); this.Reset(); } }
/// <summary> /// 选项菜单 /// </summary> /// <param name="pawn"></param> /// <returns></returns> public override IEnumerable <FloatMenuOption> CompFloatMenuOptions(Pawn pawn) { //地图不存在 if (pawn.Map == null || pawn.Map != Find.CurrentMap) { yield break; } //无法接触 if (!pawn.CanReach(this.parent, PathEndMode.Touch, Danger.Deadly, false, TraverseMode.ByPawn)) { yield return(new FloatMenuOption(this.FloatMenuOptionLabel(pawn) + " (" + "NoPath".Translate() + ")", null, MenuOptionPriority.DisabledOption, null, null, 0f, null, null)); } //锁链被使用中 else if (!pawn.CanReserve(this.parent, 1, -1, null, false)) { yield return(new FloatMenuOption(this.FloatMenuOptionLabel(pawn) + " (" + "Reserved".Translate() + ")", null, MenuOptionPriority.DisabledOption, null, null, 0f, null, null)); } //无法操作 else if (!pawn.health.capacities.CapableOf(PawnCapacityDefOf.Manipulation)) { yield return(new FloatMenuOption(this.FloatMenuOptionLabel(pawn) + " (" + "Incapable".Translate() + ")", null, MenuOptionPriority.DisabledOption, null, null, 0f, null, null)); } else { bool hasPrisoner = false; foreach (Pawn prisoner in pawn.Map.mapPawns.AllPawns) { if (prisoner != pawn && prisoner.Spawned && prisoner.IsPrisonerOfColony) { hasPrisoner = true; //囚犯被使用 if (!pawn.CanReserve(prisoner, 1, -1, null, false)) { yield return(new FloatMenuOption(this.FloatMenuOptionLabel(prisoner) + " (" + "SR_Reserved".Translate(prisoner.Label) + ")", null, MenuOptionPriority.DisabledOption, null, null, 0f, null, null)); } //如果已经存在锁链 else if (prisoner.HasChains()) { yield return(new FloatMenuOption(this.FloatMenuOptionLabel(prisoner) + " (" + "SR_HasChains".Translate(prisoner.Label) + ")", null, MenuOptionPriority.DisabledOption, null, null, 0f, null, null)); } else { Action action = delegate() { TryStartUseJob(pawn, prisoner); }; string str = TranslatorFormattedStringExtensions.Translate("SR_BondageChains", pawn.Named(pawn.Name.ToString()), prisoner.Named(prisoner.Name.ToString())); yield return(new FloatMenuOption(str, action, MenuOptionPriority.DisabledOption, null, null, 0f, null, null)); } } } if (!hasPrisoner) { yield return(new FloatMenuOption(this.FloatMenuOptionLabel(pawn) + " (" + "SR_NoPrisoner".Translate() + ")", null, MenuOptionPriority.DisabledOption, null, null, 0f, null, null)); } } }
public override void CompPostPostRemoved() { Thing hostThing = Pawn; Pawn hostPawn = Pawn; IntVec3 spawnLoc = !Pawn.Dead ? Pawn.Position.RandomAdjacentCell8Way() : Pawn.PositionHeld.RandomAdjacentCell8Way(); Map spawnMap = !Pawn.Dead ? Pawn.Map : Pawn.MapHeld; bool spawnLive = this.spawnLive; hostPawn.health.AddHediff(XenomorphDefOf.RRY_Hediff_Anesthetic); // if ((hostPawn.health.hediffSet.HasHediff(XenomorphDefOf.RRY_XenomorphImpregnation) && !hasImpregnated)) if (!hasImpregnated) { spawnLive = true; } PawnGenerationRequest pawnGenerationRequest = new PawnGenerationRequest(pawnKindDef, null, PawnGenerationContext.NonPlayer, -1, true, false, true, false, true, true, 0f); Pawn pawn = PawnGenerator.GeneratePawn(pawnGenerationRequest); if (Instigator != null) { pawn = instigator; } if (spawnLive == true) { Comp_Facehugger _Facehugger = pawn.TryGetComp <Comp_Facehugger>(); if (_Facehugger != null) { _Facehugger.Impregnations = previousImpregnations; } GenSpawn.Spawn(pawn, spawnLoc, spawnMap, 0); pawn.jobs.ClearQueuedJobs(); // pawn.jobs.curJob = new Verse.AI.Job(JobDefOf.FleeAndCower, hostPawn); if (killhugger) { pawn.Kill(null); } } else { GenSpawn.Spawn(pawn, spawnLoc, spawnMap, 0); Comp_Facehugger _Facehugger = pawn.TryGetComp <Comp_Facehugger>(); // pawn.jobs.ClearQueuedJobs(); // pawn.jobs.curJob = new Verse.AI.Job(JobDefOf.FleeAndCower, hostPawn); _Facehugger.Impregnations = previousImpregnations; if (killhugger) { pawn.Kill(null); } // pawn.Kill(null); } string text = TranslatorFormattedStringExtensions.Translate("Xeno_Facehugger_Detach", base.parent.pawn.LabelShort); if (!base.Pawn.Dead) { MoteMaker.ThrowText(spawnLoc.ToVector3(), spawnMap, text, 5f); } }
private void TryDrawMassInfo(ref float curY, float width) { if (!SelPawnForGear.Dead && ShouldShowInventory(SelPawnForGear)) { Rect rect = new Rect(0f, curY, width, 22f); float num = MassUtility.GearAndInventoryMass(SelPawnForGear); Widgets.Label(rect, TranslatorFormattedStringExtensions.Translate(arg2: MassUtility.Capacity(SelPawnForGear).ToString("0.##"), key: "MassCarried", arg1: num.ToString("0.##"))); curY += 22f; } }
public string ShowInLog() { if (deadPawn != null) { //return (date.day + " " + date.quadrum + " " + date.year + " " + "AMemorialDay".Translate(deadPawn.Name)); return(date.day + " " + date.quadrum + " " + date.year + " " + TranslatorFormattedStringExtensions.Translate("AMemorialDay", deadPawn.Name.ToString())); } return(date.day + " " + date.quadrum + " " + date.year + " colonist died"); //return (date.day + " " + date.quadrum + " " + date.year + " " + deadPawn.Name + " died."); }
public bool checkDead() { if (this.health <= 0) { this.settlement.prisonerList.Remove(this); Find.LetterStack.ReceiveLetter("PrisonerHasDiedLetter".Translate(), TranslatorFormattedStringExtensions.Translate("PrisonerHasDied", this.prisoner.Name.ToString(), this.settlement.name), LetterDefOf.NeutralEvent); return(true); } return(false); }
public string ShowInLog() { if (pawn != null && animal != null) { //return (date.day + " " + date.quadrum + " " + date.year + " " + "ABondedAnimal".Translate(new object[] { pawn.Name, animal.Name })); return(date.day + " " + date.quadrum + " " + date.year + " " + TranslatorFormattedStringExtensions.Translate("ABondedAnimal", pawn.Name.ToString(), animal.Name.ToString())); } return(date.day + " " + date.quadrum + " " + date.year + " bond with animal."); }