public static GameCondition MakeConditionPermanent(GameConditionDef def) { GameCondition gameCondition = GameConditionMaker.MakeCondition(def, -1, -180000); gameCondition.Permanent = true; return(gameCondition); }
public override void GenerateIntoMap(Map map) { if (Find.GameInitData != null) { GameCondition cond = GameConditionMaker.MakeCondition(base.def.gameCondition, (int)(this.durationDays * 60000.0), 0); map.gameConditionManager.RegisterCondition(cond); } }
protected override bool TryExecuteWorker(IncidentParms parms) { GameConditionManager gameConditionManager = parms.target.GameConditionManager; GameCondition gameCondition = GameConditionMaker.MakeCondition(duration: Mathf.RoundToInt(def.durationDays.RandomInRange * 60000f), def: def.gameCondition); gameConditionManager.RegisterCondition(gameCondition); parms.letterHyperlinkThingDefs = gameCondition.def.letterHyperlinks; SendStandardLetter(def.letterLabel, gameCondition.LetterText, def.letterDef, parms, LookTargets.Invalid); return(true); }
public override void AssignDebugData() { base.AssignDebugData(); inSignal = "DebugSignal" + Rand.Int; if (Find.AnyPlayerHomeMap != null) { gameCondition = GameConditionMaker.MakeCondition(GameConditionDefOf.ColdSnap, Rand.RangeInclusive(2500, 7500)); mapParent = Find.RandomPlayerHomeMap.Parent; } }
protected override bool TryExecuteWorker(IncidentParms parms) { GameConditionManager gameConditionManager = parms.target.GameConditionManager; int duration = Mathf.RoundToInt(def.durationDays.RandomInRange * 60000f); GameCondition cond = GameConditionMaker.MakeCondition(def.gameCondition, duration); gameConditionManager.RegisterCondition(cond); SendStandardLetter(); return(true); }
protected virtual GameCondition CreateConditionOn(Map map) { GameCondition gameCondition = GameConditionMaker.MakeCondition(ConditionDef); gameCondition.Duration = gameCondition.TransitionTicks; gameCondition.conditionCauser = parent; map.gameConditionManager.RegisterCondition(gameCondition); causedConditions.Add(map, gameCondition); SetupCondition(gameCondition, map); return(gameCondition); }
public override void GenerateIntoMap(Map map) { GameCondition cond = GameConditionMaker.MakeConditionPermanent(this.gameCondition); map.gameConditionManager.RegisterCondition(cond); }
protected override void DoConditionAndLetter(Map map, int duration, Gender gender, float points) { if (points < 0f) { points = StorytellerUtility.DefaultThreatPointsNow(map); } PsychicDroneLevel level; if (points < 800f) { level = PsychicDroneLevel.BadLow; } else if (points < 2000f) { level = PsychicDroneLevel.BadMedium; } else { level = PsychicDroneLevel.BadHigh; } GameCondition_PsychicEmanation gameCondition_PsychicEmanation = (GameCondition_PsychicEmanation)GameConditionMaker.MakeCondition(GameConditionDefOf.PsychicDrone, duration, 0); gameCondition_PsychicEmanation.gender = gender; gameCondition_PsychicEmanation.level = level; map.gameConditionManager.RegisterCondition(gameCondition_PsychicEmanation); string label = string.Concat(new string[] { "LetterLabelPsychicDrone".Translate(), " (", level.GetLabel(), ", ", gender.GetLabel(false), ")" }); string text = "LetterIncidentPsychicDrone".Translate(gender.ToString().Translate().ToLower(), level.GetLabel()); Find.LetterStack.ReceiveLetter(label, text, LetterDefOf.NegativeEvent, null); }
public override void Apply(LocalTargetInfo target, LocalTargetInfo dest) { base.Apply(target, dest); Map map = parent.pawn.Map; Thing conditionCauser = GenSpawn.Spawn(ThingDefOf.Flashstorm, target.Cell, parent.pawn.Map); GameCondition_Flashstorm gameCondition_Flashstorm = (GameCondition_Flashstorm)GameConditionMaker.MakeCondition(GameConditionDefOf.Flashstorm); gameCondition_Flashstorm.centerLocation = target.Cell.ToIntVec2; gameCondition_Flashstorm.areaRadiusOverride = new IntRange(Mathf.RoundToInt(parent.def.EffectRadius), Mathf.RoundToInt(parent.def.EffectRadius)); gameCondition_Flashstorm.Duration = Mathf.RoundToInt(parent.def.EffectDuration.SecondsToTicks()); gameCondition_Flashstorm.suppressEndMessage = true; gameCondition_Flashstorm.initialStrikeDelay = new IntRange(60, 180); gameCondition_Flashstorm.conditionCauser = conditionCauser; gameCondition_Flashstorm.ambientSound = true; map.gameConditionManager.RegisterCondition(gameCondition_Flashstorm); ApplyGoodwillImpact(target, gameCondition_Flashstorm.AreaRadius); }
protected override bool TryExecuteWorker(IncidentParms parms) { Map map = (Map)parms.target; int duration = Mathf.RoundToInt(this.def.durationDays.RandomInRange * 60000f); GameCondition_Flashstorm gameCondition_Flashstorm = (GameCondition_Flashstorm)GameConditionMaker.MakeCondition(GameConditionDefOf.Flashstorm, duration, 0); map.gameConditionManager.RegisterCondition(gameCondition_Flashstorm); base.SendStandardLetter(new TargetInfo(gameCondition_Flashstorm.centerLocation.ToIntVec3, map, false), null, new string[0]); if (map.weatherManager.curWeather.rainRate > 0.1f) { map.weatherDecider.StartNextWeather(); } return(true); }
protected override void DoConditionAndLetter(Map map, int duration, Gender gender, float points) { GameCondition_PsychicEmanation gameCondition_PsychicEmanation = (GameCondition_PsychicEmanation)GameConditionMaker.MakeCondition(GameConditionDefOf.PsychicSoothe, duration); gameCondition_PsychicEmanation.gender = gender; map.gameConditionManager.RegisterCondition(gameCondition_PsychicEmanation); string text = "LetterIncidentPsychicSoothe".Translate(gender.ToString().Translate().ToLower()); Find.LetterStack.ReceiveLetter("LetterLabelPsychicSoothe".Translate(), text, LetterDefOf.PositiveEvent); }
protected override void DoConditionAndLetter(IncidentParms parms, Map map, int duration, Gender gender, float points) { if (points < 0f) { points = StorytellerUtility.DefaultThreatPointsNow(map); } PsychicDroneLevel level = (points < 800f) ? PsychicDroneLevel.BadLow : ((!(points < 2000f)) ? PsychicDroneLevel.BadHigh : PsychicDroneLevel.BadMedium); GameCondition_PsychicEmanation gameCondition_PsychicEmanation = (GameCondition_PsychicEmanation)GameConditionMaker.MakeCondition(GameConditionDefOf.PsychicDrone, duration); gameCondition_PsychicEmanation.gender = gender; gameCondition_PsychicEmanation.level = level; map.gameConditionManager.RegisterCondition(gameCondition_PsychicEmanation); SendStandardLetter(gameCondition_PsychicEmanation.LabelCap, gameCondition_PsychicEmanation.LetterText, gameCondition_PsychicEmanation.def.letterDef, parms, LookTargets.Invalid); }
// Token: 0x06000E55 RID: 3669 RVA: 0x0006B33C File Offset: 0x0006973C protected override bool TryExecuteWorker(IncidentParms parms) { Map map = (Map)parms.target; int duration = Mathf.RoundToInt(this.def.durationDays.RandomInRange * 60000f); GameCondition_Warpstorm gameCondition_Warpstorm = (GameCondition_Warpstorm)GameConditionMaker.MakeCondition(OGGameConditionDefOf.OG_Warpstorm, duration); map.gameConditionManager.RegisterCondition(gameCondition_Warpstorm); base.SendStandardLetter(this.def.letterLabel, GameConditionDefOf.Flashstorm.letterText, this.def.letterDef, parms, new TargetInfo()); if (map.weatherManager.curWeather.rainRate > 0.1f) { map.weatherDecider.StartNextWeather(); } return(true); }
private GameCondition MakeCondition() { return(GameConditionMaker.MakeCondition(def.gameCondition, (int)(durationDays * 60000f))); }
protected override void DoConditionAndLetter(IncidentParms parms, Map map, int duration, Gender gender, float points) { GameCondition_PsychicEmanation gameCondition_PsychicEmanation = (GameCondition_PsychicEmanation)GameConditionMaker.MakeCondition(GameConditionDefOf.PsychicSoothe, duration); gameCondition_PsychicEmanation.gender = gender; map.gameConditionManager.RegisterCondition(gameCondition_PsychicEmanation); SendStandardLetter(gameCondition_PsychicEmanation.LabelCap, gameCondition_PsychicEmanation.LetterText, gameCondition_PsychicEmanation.def.letterDef, parms, LookTargets.Invalid); }
protected override void DoConditionAndLetter(Map map, int duration, Gender gender, float points) { if (points < 0f) { points = StorytellerUtility.DefaultThreatPointsNow(map); } PsychicDroneLevel level = (points < 800f) ? PsychicDroneLevel.BadLow : ((!(points < 2000f)) ? PsychicDroneLevel.BadHigh : PsychicDroneLevel.BadMedium); GameCondition_PsychicEmanation gameCondition_PsychicEmanation = (GameCondition_PsychicEmanation)GameConditionMaker.MakeCondition(GameConditionDefOf.PsychicDrone, duration); gameCondition_PsychicEmanation.gender = gender; gameCondition_PsychicEmanation.level = level; map.gameConditionManager.RegisterCondition(gameCondition_PsychicEmanation); string label = "LetterLabelPsychicDrone".Translate() + " (" + level.GetLabel() + ", " + gender.GetLabel() + ")"; string text = "LetterIncidentPsychicDrone".Translate(gender.ToString().Translate().ToLower(), level.GetLabel()); Find.LetterStack.ReceiveLetter(label, text, LetterDefOf.NegativeEvent); }
protected override void DoConditionAndLetter(Map map, int duration, Gender gender) { GameCondition_PsychicEmanation gameCondition_PsychicEmanation = (GameCondition_PsychicEmanation)GameConditionMaker.MakeCondition(GameConditionDefOf.PsychicDrone, duration, 0); gameCondition_PsychicEmanation.gender = gender; map.gameConditionManager.RegisterCondition(gameCondition_PsychicEmanation); string text = "LetterIncidentPsychicDrone".Translate(new object[] { gender.ToString().Translate().ToLower() }); Find.LetterStack.ReceiveLetter("LetterLabelPsychicDrone".Translate(), text, LetterDefOf.NegativeEvent, null); }
private GameCondition MakeCondition() { return(GameConditionMaker.MakeCondition(this.def.gameCondition, (int)(this.durationDays * 60000f), 0)); }
// Token: 0x06000E1C RID: 3612 RVA: 0x00069B78 File Offset: 0x00067F78 protected override bool TryExecuteWorker(IncidentParms parms) { GameConditionManager gameConditionManager = parms.target.GameConditionManager; int duration = Mathf.RoundToInt(this.def.durationDays.RandomInRange * 60000f); GameCondition cond = GameConditionMaker.MakeCondition(this.def.gameCondition, duration, 0); gameConditionManager.RegisterCondition(cond); Map map = (Map)parms.target; IntVec3 spawnSpot; if (!this.TryFindSpawnSpot(map, out spawnSpot)) { return(false); } Faction faction = Find.FactionManager.FirstFactionOfDef(XenomorphDefOf.RRY_Xenomorph); if (faction == null) { return(false); } int @int = Rand.Int; IncidentParms raidParms = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.ThreatBig, map); raidParms.forced = true; raidParms.faction = faction; raidParms.raidStrategy = RaidStrategyDefOf.ImmediateAttack; raidParms.raidArrivalMode = PawnsArrivalModeDefOf.EdgeWalkIn; raidParms.spawnCenter = spawnSpot; raidParms.generateFightersOnly = true; raidParms.points = Mathf.Max(raidParms.points * IncidentWorker_PowerCut.RaidPointsFactorRange.RandomInRange, faction.def.MinPointsToGeneratePawnGroup(PawnGroupKindDefOf.Combat)); raidParms.pawnGroupMakerSeed = new int?(@int); PawnGroupMakerParms defaultPawnGroupMakerParms = IncidentParmsUtility.GetDefaultPawnGroupMakerParms(PawnGroupKindDefOf.Combat, raidParms, false); defaultPawnGroupMakerParms.points = IncidentWorker_Raid.AdjustedRaidPoints(defaultPawnGroupMakerParms.points, raidParms.raidArrivalMode, raidParms.raidStrategy, defaultPawnGroupMakerParms.faction, PawnGroupKindDefOf.Combat); IEnumerable <PawnKindDef> pawnKinds = PawnGroupMakerUtility.GeneratePawnKindsExample(defaultPawnGroupMakerParms); base.SendStandardLetter(); QueuedIncident qi = new QueuedIncident(new FiringIncident(IncidentDefOf.RaidEnemy, null, raidParms), Find.TickManager.TicksGame + IncidentWorker_PowerCut.RaidDelay.RandomInRange, 0); Find.Storyteller.incidentQueue.Add(qi); /* * DiaNode diaNode = new DiaNode(text); * DiaOption diaOption = new DiaOption("RefugeeChasedInitial_Accept".Translate()); * diaOption.action = delegate () * { * QueuedIncident qi = new QueuedIncident(new FiringIncident(IncidentDefOf.RaidEnemy, null, raidParms), Find.TickManager.TicksGame + IncidentWorker_PowerCut.RaidDelay.RandomInRange, 0); * Find.Storyteller.incidentQueue.Add(qi); * }; * diaOption.resolveTree = true; * diaNode.options.Add(diaOption); * string text2 = "RefugeeChasedRejected".Translate(refugee.LabelShort, refugee); * DiaNode diaNode2 = new DiaNode(text2); * DiaOption diaOption2 = new DiaOption("OK".Translate()); * diaOption2.resolveTree = true; * diaNode2.options.Add(diaOption2); * DiaOption diaOption3 = new DiaOption("RefugeeChasedInitial_Reject".Translate()); * diaOption3.action = delegate () * { * Find.WorldPawns.PassToWorld(refugee, PawnDiscardDecideMode.Decide); * }; * diaOption3.link = diaNode2; * diaNode.options.Add(diaOption3); * string title = "RefugeeChasedTitle".Translate(map.Parent.Label); * Find.WindowStack.Add(new Dialog_NodeTreeWithFactionInfo(diaNode, faction, true, true, title)); * Find.Archive.Add(new ArchivedDialog(diaNode.text, title, faction)); */ return(true); }