public static IEnumerable <VerbPropertiesWithSource> GetAllVerbProperties(List <VerbProperties> verbProps, List <Tool> tools) { if (verbProps != null) { int k = 0; if (k < verbProps.Count) { yield return(new VerbPropertiesWithSource(verbProps[k])); /*Error: Unable to find new state assignment for yield return*/; } } if (tools != null) { for (int j = 0; j < tools.Count; j++) { using (IEnumerator <ManeuverDef> enumerator = tools[j].Maneuvers.GetEnumerator()) { if (enumerator.MoveNext()) { ManeuverDef i = enumerator.Current; yield return(new VerbPropertiesWithSource(i.verb, tools[j], i)); /*Error: Unable to find new state assignment for yield return*/; } } } } yield break; IL_018f: /*Error near IL_0190: Unexpected return in MoveNext()*/; }
private void InitVerb(Verb verb, VerbProperties properties, Tool tool, ManeuverDef maneuver, string id) { verb.loadID = id; verb.verbProps = properties; verb.verbTracker = this; verb.tool = tool; verb.maneuver = maneuver; verb.caster = this.directOwner.ConstantCaster; }
public static DamageDef PrimaryMeleeWeaponDamageType(List <Tool> tools) { if (tools.NullOrEmpty <Tool>()) { return(null); } Tool tool2 = tools.MaxBy((Tool tool) => tool.power); ManeuverDef maneuverDef = tool2.Maneuvers.FirstOrDefault <ManeuverDef>(); return((maneuverDef == null) ? null : maneuverDef.verb.meleeDamageDef); }
public static DamageDef PrimaryMeleeWeaponDamageType(ThingDef thing) { List <Tool> tools = thing.tools; Tool tool2 = tools.MaxBy((Tool tool) => tool.power); List <ManeuverDef> allDefsListForReading = DefDatabase <ManeuverDef> .AllDefsListForReading; for (int i = 0; i < allDefsListForReading.Count; i++) { ManeuverDef maneuverDef = allDefsListForReading[i]; if (tool2.capacities.Contains(maneuverDef.requiredCapacity)) { return(maneuverDef.verb.meleeDamageDef); } } return(null); }
public static DamageDef PrimaryMeleeWeaponDamageType(List <Tool> tools) { DamageDef result; if (tools.NullOrEmpty <Tool>()) { result = null; } else { Tool tool2 = tools.MaxBy((Tool tool) => tool.power); List <ManeuverDef> allDefsListForReading = DefDatabase <ManeuverDef> .AllDefsListForReading; for (int i = 0; i < allDefsListForReading.Count; i++) { ManeuverDef maneuverDef = allDefsListForReading[i]; if (tool2.capacities.Contains(maneuverDef.requiredCapacity)) { return(maneuverDef.verb.meleeDamageDef); } } result = null; } return(result); }
public static void FlavorfulCombatTest() { List <DebugMenuOption> list = new List <DebugMenuOption>(); IEnumerable <ManeuverDef> maneuvers = DefDatabase <ManeuverDef> .AllDefsListForReading; Func <ManeuverDef, RulePackDef>[] results = new Func <ManeuverDef, RulePackDef>[5] { (ManeuverDef m) => new RulePackDef[4] { m.combatLogRulesHit, m.combatLogRulesDeflect, m.combatLogRulesMiss, m.combatLogRulesDodge }.RandomElement(), (ManeuverDef m) => m.combatLogRulesHit, (ManeuverDef m) => m.combatLogRulesDeflect, (ManeuverDef m) => m.combatLogRulesMiss, (ManeuverDef m) => m.combatLogRulesDodge }; string[] array = new string[5] { "(random)", "Hit", "Deflect", "Miss", "Dodge" }; foreach (Pair <ManeuverDef, int> maneuverresult in maneuvers.Concat(null).Cross(Enumerable.Range(0, array.Length))) { DebugMenuOption item = new DebugMenuOption(string.Format("{0}/{1}", (maneuverresult.First == null) ? "(random)" : maneuverresult.First.defName, array[maneuverresult.Second]), DebugMenuOptionMode.Action, delegate { CreateDamagedDestroyedMenu(delegate(Action <List <BodyPartRecord>, List <bool> > bodyPartCreator) { StringBuilder stringBuilder7 = new StringBuilder(); ManeuverDef maneuver = default(ManeuverDef); for (int num2 = 0; num2 < 100; num2++) { maneuver = maneuverresult.First; if (maneuver == null) { maneuver = maneuvers.RandomElement(); } RulePackDef rulePackDef = results[maneuverresult.Second](maneuver); List <BodyPartRecord> list8 = null; List <bool> list9 = null; if (rulePackDef == maneuver.combatLogRulesHit) { list8 = new List <BodyPartRecord>(); list9 = new List <bool>(); bodyPartCreator(list8, list9); } ImplementOwnerTypeDef implementOwnerTypeDef; string toolLabel; if (!(from ttp in DefDatabase <ThingDef> .AllDefsListForReading.Where((ThingDef td) => td.IsMeleeWeapon && !td.tools.NullOrEmpty()).SelectMany((ThingDef td) => td.tools.Select((Tool tool) => new Pair <ThingDef, Tool>(td, tool))) where ttp.Second.capacities.Contains(maneuver.requiredCapacity) select ttp).TryRandomElement(out var result)) { Log.Warning(string.Concat("Melee weapon with tool with capacity ", maneuver.requiredCapacity, " not found.")); implementOwnerTypeDef = ImplementOwnerTypeDefOf.Bodypart; toolLabel = "(" + implementOwnerTypeDef.defName + ")"; } else { implementOwnerTypeDef = ((result.Second == null) ? ImplementOwnerTypeDefOf.Bodypart : ImplementOwnerTypeDefOf.Weapon); toolLabel = ((result.Second != null) ? result.Second.label : ("(" + implementOwnerTypeDef.defName + ")")); } BattleLogEntry_MeleeCombat battleLogEntry_MeleeCombat = new BattleLogEntry_MeleeCombat(rulePackDef, alwaysShowInCompact: false, RandomPawnForCombat(), RandomPawnForCombat(), implementOwnerTypeDef, toolLabel, result.First); battleLogEntry_MeleeCombat.FillTargets(list8, list9, battleLogEntry_MeleeCombat.RuleDef.defName.Contains("Deflect")); battleLogEntry_MeleeCombat.Debug_OverrideTicks(Rand.Int); stringBuilder7.AppendLine(battleLogEntry_MeleeCombat.ToGameStringFromPOV(null)); } Log.Message(stringBuilder7.ToString()); }); });
public static string CalculateUniqueLoadID(IVerbOwner owner, Tool tool, ManeuverDef maneuver) { return(string.Format("{0}_{1}_{2}", owner.UniqueVerbOwnerID(), (tool == null) ? "NT" : tool.id, (maneuver == null) ? "NM" : maneuver.defName)); }
private static VerbProperties <get_VerbsProperties> m__1(ManeuverDef x) { return(x.verb); }
private bool <get_Maneuvers> m__0(ManeuverDef x) { return(x.requiredCapacity == this); }
public static void FlavorfulCombatTest() { List <DebugMenuOption> list = new List <DebugMenuOption>(); IEnumerable <ManeuverDef> maneuvers = DefDatabase <ManeuverDef> .AllDefsListForReading; Func <ManeuverDef, RulePackDef>[] results = new Func <ManeuverDef, RulePackDef>[5] { (ManeuverDef m) => new RulePackDef[4] { m.combatLogRulesHit, m.combatLogRulesDeflect, m.combatLogRulesMiss, m.combatLogRulesDodge }.RandomElement(), (ManeuverDef m) => m.combatLogRulesHit, (ManeuverDef m) => m.combatLogRulesDeflect, (ManeuverDef m) => m.combatLogRulesMiss, (ManeuverDef m) => m.combatLogRulesDodge }; string[] array = new string[5] { "(random)", "Hit", "Deflect", "Miss", "Dodge" }; foreach (Pair <ManeuverDef, int> item2 in maneuvers.Concat(null).Cross(Enumerable.Range(0, array.Length))) { DebugMenuOption item = new DebugMenuOption(string.Format("{0}/{1}", (item2.First != null) ? item2.First.defName : "(random)", array[item2.Second]), DebugMenuOptionMode.Action, delegate { CreateDamagedDestroyedMenu(delegate(Action <List <BodyPartRecord>, List <bool> > bodyPartCreator) { StringBuilder stringBuilder7 = new StringBuilder(); for (int num2 = 0; num2 < 100; num2++) { ManeuverDef maneuver = item2.First; if (maneuver == null) { maneuver = maneuvers.RandomElement(); } RulePackDef rulePackDef = results[item2.Second](maneuver); List <BodyPartRecord> list8 = null; List <bool> list9 = null; if (rulePackDef == maneuver.combatLogRulesHit) { list8 = new List <BodyPartRecord>(); list9 = new List <bool>(); bodyPartCreator(list8, list9); } Pair <ThingDef, Tool> pair = (from ttp in (from td in DefDatabase <ThingDef> .AllDefsListForReading where td.IsMeleeWeapon && !td.tools.NullOrEmpty() select td).SelectMany((ThingDef td) => from tool in td.tools select new Pair <ThingDef, Tool>(td, tool)) where ttp.Second.capacities.Contains(maneuver.requiredCapacity) select ttp).RandomElement(); BattleLogEntry_MeleeCombat battleLogEntry_MeleeCombat = new BattleLogEntry_MeleeCombat(rulePackDef, alwaysShowInCompact: false, CombatLogTester.GenerateRandom(), CombatLogTester.GenerateRandom(), (pair.Second == null) ? ImplementOwnerTypeDefOf.Bodypart : ImplementOwnerTypeDefOf.Weapon, (pair.Second == null) ? "body part" : pair.Second.label, pair.First); battleLogEntry_MeleeCombat.FillTargets(list8, list9, battleLogEntry_MeleeCombat.RuleDef.defName.Contains("Deflect")); battleLogEntry_MeleeCombat.Debug_OverrideTicks(Rand.Int); stringBuilder7.AppendLine(battleLogEntry_MeleeCombat.ToGameStringFromPOV(null)); } Log.Message(stringBuilder7.ToString()); }); }); list.Add(item); } int rf; for (rf = 0; rf < 2; rf++) { list.Add(new DebugMenuOption((rf != 0) ? "Ranged fire burst" : "Ranged fire singleshot", DebugMenuOptionMode.Action, delegate { StringBuilder stringBuilder6 = new StringBuilder(); for (int num = 0; num < 100; num++) { ThingDef thingDef = (from td in DefDatabase <ThingDef> .AllDefsListForReading where td.IsRangedWeapon select td).RandomElement(); bool flag = Rand.Value < 0.2f; bool flag2 = !flag && Rand.Value < 0.95f; BattleLogEntry_RangedFire battleLogEntry_RangedFire = new BattleLogEntry_RangedFire(CombatLogTester.GenerateRandom(), (!flag) ? CombatLogTester.GenerateRandom() : null, (!flag2) ? thingDef : null, null, rf != 0); battleLogEntry_RangedFire.Debug_OverrideTicks(Rand.Int); stringBuilder6.AppendLine(battleLogEntry_RangedFire.ToGameStringFromPOV(null)); } Log.Message(stringBuilder6.ToString()); })); } list.Add(new DebugMenuOption("Ranged impact hit", DebugMenuOptionMode.Action, delegate { CreateDamagedDestroyedMenu(delegate(Action <List <BodyPartRecord>, List <bool> > bodyPartCreator) { StringBuilder stringBuilder5 = new StringBuilder(); for (int n = 0; n < 100; n++) { ThingDef weaponDef3 = (from td in DefDatabase <ThingDef> .AllDefsListForReading where td.IsRangedWeapon select td).RandomElement(); List <BodyPartRecord> list6 = new List <BodyPartRecord>(); List <bool> list7 = new List <bool>(); bodyPartCreator(list6, list7); Pawn pawn2 = CombatLogTester.GenerateRandom(); BattleLogEntry_RangedImpact battleLogEntry_RangedImpact3 = new BattleLogEntry_RangedImpact(CombatLogTester.GenerateRandom(), pawn2, pawn2, weaponDef3, null, ThingDefOf.Wall); battleLogEntry_RangedImpact3.FillTargets(list6, list7, Rand.Chance(0.5f)); battleLogEntry_RangedImpact3.Debug_OverrideTicks(Rand.Int); stringBuilder5.AppendLine(battleLogEntry_RangedImpact3.ToGameStringFromPOV(null)); } Log.Message(stringBuilder5.ToString()); }); })); list.Add(new DebugMenuOption("Ranged impact miss", DebugMenuOptionMode.Action, delegate { StringBuilder stringBuilder4 = new StringBuilder(); for (int l = 0; l < 100; l++) { ThingDef weaponDef2 = (from td in DefDatabase <ThingDef> .AllDefsListForReading where td.IsRangedWeapon select td).RandomElement(); BattleLogEntry_RangedImpact battleLogEntry_RangedImpact2 = new BattleLogEntry_RangedImpact(CombatLogTester.GenerateRandom(), null, CombatLogTester.GenerateRandom(), weaponDef2, null, ThingDefOf.Wall); battleLogEntry_RangedImpact2.Debug_OverrideTicks(Rand.Int); stringBuilder4.AppendLine(battleLogEntry_RangedImpact2.ToGameStringFromPOV(null)); } Log.Message(stringBuilder4.ToString()); })); list.Add(new DebugMenuOption("Ranged impact hit incorrect", DebugMenuOptionMode.Action, delegate { CreateDamagedDestroyedMenu(delegate(Action <List <BodyPartRecord>, List <bool> > bodyPartCreator) { StringBuilder stringBuilder3 = new StringBuilder(); for (int k = 0; k < 100; k++) { ThingDef weaponDef = (from td in DefDatabase <ThingDef> .AllDefsListForReading where td.IsRangedWeapon select td).RandomElement(); List <BodyPartRecord> list4 = new List <BodyPartRecord>(); List <bool> list5 = new List <bool>(); bodyPartCreator(list4, list5); BattleLogEntry_RangedImpact battleLogEntry_RangedImpact = new BattleLogEntry_RangedImpact(CombatLogTester.GenerateRandom(), CombatLogTester.GenerateRandom(), CombatLogTester.GenerateRandom(), weaponDef, null, ThingDefOf.Wall); battleLogEntry_RangedImpact.FillTargets(list4, list5, Rand.Chance(0.5f)); battleLogEntry_RangedImpact.Debug_OverrideTicks(Rand.Int); stringBuilder3.AppendLine(battleLogEntry_RangedImpact.ToGameStringFromPOV(null)); } Log.Message(stringBuilder3.ToString()); }); })); foreach (RulePackDef item3 in from def in DefDatabase <RulePackDef> .AllDefsListForReading where def.defName.Contains("Transition") && !def.defName.Contains("Include") select def) { list.Add(new DebugMenuOption(item3.defName, DebugMenuOptionMode.Action, delegate { StringBuilder stringBuilder2 = new StringBuilder(); for (int j = 0; j < 100; j++) { Pawn pawn = CombatLogTester.GenerateRandom(); Pawn initiator = CombatLogTester.GenerateRandom(); BodyPartRecord partRecord = pawn.health.hediffSet.GetNotMissingParts().RandomElement(); BattleLogEntry_StateTransition battleLogEntry_StateTransition = new BattleLogEntry_StateTransition(pawn, item3, initiator, HediffMaker.MakeHediff(DefDatabase <HediffDef> .AllDefsListForReading.RandomElement(), pawn, partRecord), pawn.RaceProps.body.AllParts.RandomElement()); battleLogEntry_StateTransition.Debug_OverrideTicks(Rand.Int); stringBuilder2.AppendLine(battleLogEntry_StateTransition.ToGameStringFromPOV(null)); } Log.Message(stringBuilder2.ToString()); })); } foreach (RulePackDef item4 in from def in DefDatabase <RulePackDef> .AllDefsListForReading where def.defName.Contains("DamageEvent") && !def.defName.Contains("Include") select def) { list.Add(new DebugMenuOption(item4.defName, DebugMenuOptionMode.Action, delegate { CreateDamagedDestroyedMenu(delegate(Action <List <BodyPartRecord>, List <bool> > bodyPartCreator) { StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < 100; i++) { List <BodyPartRecord> list2 = new List <BodyPartRecord>(); List <bool> list3 = new List <bool>(); bodyPartCreator(list2, list3); Pawn recipient = CombatLogTester.GenerateRandom(); BattleLogEntry_DamageTaken battleLogEntry_DamageTaken = new BattleLogEntry_DamageTaken(recipient, item4); battleLogEntry_DamageTaken.FillTargets(list2, list3, deflected: false); battleLogEntry_DamageTaken.Debug_OverrideTicks(Rand.Int); stringBuilder.AppendLine(battleLogEntry_DamageTaken.ToGameStringFromPOV(null)); } Log.Message(stringBuilder.ToString()); }); })); } Find.WindowStack.Add(new Dialog_DebugOptionListLister(list)); }
public VerbPropertiesWithSource(VerbProperties verbProps, Tool tool, ManeuverDef maneuver) { this.verbProps = verbProps; this.tool = tool; this.maneuver = maneuver; }
public VerbPropertiesWithSource(VerbProperties verbProps) { this.verbProps = verbProps; tool = null; maneuver = null; }
private bool <get_Maneuvers> m__0(ManeuverDef x) { return(this.capacities.Contains(x.requiredCapacity)); }
private void InitVerb(Verb verb, VerbProperties properties, IVerbOwner owner, Tool tool, ManeuverDef maneuver, string id) { verb.loadID = id; verb.verbProps = properties; verb.tool = tool; verb.maneuver = maneuver; CompEquippable compEquippable = this.directOwner as CompEquippable; Pawn pawn = this.directOwner as Pawn; HediffComp_VerbGiver hediffComp_VerbGiver = this.directOwner as HediffComp_VerbGiver; Pawn_MeleeVerbs_TerrainSource pawn_MeleeVerbs_TerrainSource = this.directOwner as Pawn_MeleeVerbs_TerrainSource; if (compEquippable != null) { verb.ownerEquipment = compEquippable.parent; } else if (pawn != null) { verb.caster = pawn; } else if (hediffComp_VerbGiver != null) { verb.ownerHediffComp = hediffComp_VerbGiver; verb.caster = hediffComp_VerbGiver.Pawn; } else if (pawn_MeleeVerbs_TerrainSource != null) { verb.terrainDef = pawn_MeleeVerbs_TerrainSource.def; verb.caster = pawn_MeleeVerbs_TerrainSource.parent.Pawn; } else { Log.ErrorOnce("Couldn't find verb source", 27797477, false); } if (verb.tool != null) { if (verb.ownerEquipment != null) { verb.implementOwnerType = ImplementOwnerTypeDefOf.Weapon; } else if (verb.ownerHediffComp != null) { verb.implementOwnerType = ImplementOwnerTypeDefOf.Hediff; } else if (verb.terrainDef != null) { verb.implementOwnerType = ImplementOwnerTypeDefOf.Terrain; } else { verb.implementOwnerType = ImplementOwnerTypeDefOf.Bodypart; } } }
private void InitVerb(Verb verb, VerbProperties properties, IVerbOwner owner, Tool tool, ManeuverDef maneuver, string id) { verb.loadID = id; verb.verbProps = properties; verb.tool = tool; verb.maneuver = maneuver; CompEquippable compEquippable = this.directOwner as CompEquippable; Pawn pawn = this.directOwner as Pawn; HediffComp_VerbGiver hediffComp_VerbGiver = this.directOwner as HediffComp_VerbGiver; if (compEquippable != null) { verb.ownerEquipment = compEquippable.parent; } else if (pawn != null) { verb.caster = pawn; } else if (hediffComp_VerbGiver != null) { verb.ownerHediffComp = hediffComp_VerbGiver; verb.caster = hediffComp_VerbGiver.Pawn; } if (verb.tool != null) { if (verb.ownerEquipment != null) { verb.implementOwnerType = ImplementOwnerTypeDefOf.Weapon; } else if (verb.ownerHediffComp != null) { verb.implementOwnerType = ImplementOwnerTypeDefOf.Hediff; } else { verb.implementOwnerType = ImplementOwnerTypeDefOf.Bodypart; } } }
public static void FlavorfulCombatTest() { List <DebugMenuOption> list = new List <DebugMenuOption>(); IEnumerable <ManeuverDef> maneuvers = DefDatabase <ManeuverDef> .AllDefsListForReading; Func <ManeuverDef, RulePackDef>[] results = new Func <ManeuverDef, RulePackDef>[5] { (ManeuverDef m) => new RulePackDef[4] { m.combatLogRulesHit, m.combatLogRulesDeflect, m.combatLogRulesMiss, m.combatLogRulesDodge }.RandomElement(), (ManeuverDef m) => m.combatLogRulesHit, (ManeuverDef m) => m.combatLogRulesDeflect, (ManeuverDef m) => m.combatLogRulesMiss, (ManeuverDef m) => m.combatLogRulesDodge }; string[] array = new string[5] { "(random)", "Hit", "Deflect", "Miss", "Dodge" }; foreach (Pair <ManeuverDef, int> maneuverresult in maneuvers.Concat(null).Cross(Enumerable.Range(0, array.Length))) { DebugMenuOption item = new DebugMenuOption(string.Format("{0}/{1}", (maneuverresult.First == null) ? "(random)" : maneuverresult.First.defName, array[maneuverresult.Second]), DebugMenuOptionMode.Action, delegate { CreateDamagedDestroyedMenu(delegate(Action <List <BodyPartRecord>, List <bool> > bodyPartCreator) { StringBuilder stringBuilder7 = new StringBuilder(); ManeuverDef maneuver = default(ManeuverDef); for (int num3 = 0; num3 < 100; num3++) { maneuver = maneuverresult.First; if (maneuver == null) { maneuver = maneuvers.RandomElement(); } RulePackDef rulePackDef = results[maneuverresult.Second](maneuver); List <BodyPartRecord> list8 = null; List <bool> list9 = null; if (rulePackDef == maneuver.combatLogRulesHit) { list8 = new List <BodyPartRecord>(); list9 = new List <bool>(); bodyPartCreator(list8, list9); } ImplementOwnerTypeDef implementOwnerTypeDef; string toolLabel; if (!(from ttp in DefDatabase <ThingDef> .AllDefsListForReading.Where((ThingDef td) => td.IsMeleeWeapon && !td.tools.NullOrEmpty()).SelectMany((ThingDef td) => td.tools.Select((Tool tool) => new Pair <ThingDef, Tool>(td, tool))) where ttp.Second.capacities.Contains(maneuver.requiredCapacity) select ttp).TryRandomElement(out Pair <ThingDef, Tool> result)) { Log.Warning("Melee weapon with tool with capacity " + maneuver.requiredCapacity + " not found."); implementOwnerTypeDef = ImplementOwnerTypeDefOf.Bodypart; toolLabel = "(" + implementOwnerTypeDef.defName + ")"; } else { implementOwnerTypeDef = ((result.Second == null) ? ImplementOwnerTypeDefOf.Bodypart : ImplementOwnerTypeDefOf.Weapon); toolLabel = ((result.Second != null) ? result.Second.label : ("(" + implementOwnerTypeDef.defName + ")")); } BattleLogEntry_MeleeCombat battleLogEntry_MeleeCombat = new BattleLogEntry_MeleeCombat(rulePackDef, alwaysShowInCompact: false, RandomPawnForCombat(), RandomPawnForCombat(), implementOwnerTypeDef, toolLabel, result.First); battleLogEntry_MeleeCombat.FillTargets(list8, list9, battleLogEntry_MeleeCombat.RuleDef.defName.Contains("Deflect")); battleLogEntry_MeleeCombat.Debug_OverrideTicks(Rand.Int); stringBuilder7.AppendLine(battleLogEntry_MeleeCombat.ToGameStringFromPOV(null)); } Log.Message(stringBuilder7.ToString()); }); }); list.Add(item); } int rf = 0; while (rf < 2) { list.Add(new DebugMenuOption((rf == 0) ? "Ranged fire singleshot" : "Ranged fire burst", DebugMenuOptionMode.Action, delegate { StringBuilder stringBuilder6 = new StringBuilder(); for (int num2 = 0; num2 < 100; num2++) { ThingDef thingDef = DefDatabase <ThingDef> .AllDefsListForReading.Where((ThingDef td) => td.IsRangedWeapon && td.IsWeaponUsingProjectiles && !td.menuHidden).RandomElement(); bool flag = Rand.Value < 0.2f; bool flag2 = !flag && Rand.Value < 0.95f; BattleLogEntry_RangedFire battleLogEntry_RangedFire = new BattleLogEntry_RangedFire(RandomPawnForCombat(), flag ? null : RandomPawnForCombat(), flag2 ? null : thingDef, null, rf != 0); battleLogEntry_RangedFire.Debug_OverrideTicks(Rand.Int); stringBuilder6.AppendLine(battleLogEntry_RangedFire.ToGameStringFromPOV(null)); } Log.Message(stringBuilder6.ToString()); })); int num = ++rf; } list.Add(new DebugMenuOption("Ranged impact hit", DebugMenuOptionMode.Action, delegate { CreateDamagedDestroyedMenu(delegate(Action <List <BodyPartRecord>, List <bool> > bodyPartCreator) { StringBuilder stringBuilder5 = new StringBuilder(); for (int n = 0; n < 100; n++) { ThingDef weaponDef3 = DefDatabase <ThingDef> .AllDefsListForReading.Where((ThingDef td) => td.IsRangedWeapon && td.IsWeaponUsingProjectiles && !td.menuHidden).RandomElement(); List <BodyPartRecord> list6 = new List <BodyPartRecord>(); List <bool> list7 = new List <bool>(); bodyPartCreator(list6, list7); Pawn pawn2 = RandomPawnForCombat(); BattleLogEntry_RangedImpact battleLogEntry_RangedImpact3 = new BattleLogEntry_RangedImpact(RandomPawnForCombat(), pawn2, pawn2, weaponDef3, null, ThingDefOf.Wall); battleLogEntry_RangedImpact3.FillTargets(list6, list7, Rand.Chance(0.5f)); battleLogEntry_RangedImpact3.Debug_OverrideTicks(Rand.Int); stringBuilder5.AppendLine(battleLogEntry_RangedImpact3.ToGameStringFromPOV(null)); } Log.Message(stringBuilder5.ToString()); }); })); list.Add(new DebugMenuOption("Ranged impact miss", DebugMenuOptionMode.Action, delegate { StringBuilder stringBuilder4 = new StringBuilder(); for (int l = 0; l < 100; l++) { ThingDef weaponDef2 = DefDatabase <ThingDef> .AllDefsListForReading.Where((ThingDef td) => td.IsRangedWeapon && td.IsWeaponUsingProjectiles && !td.menuHidden).RandomElement(); BattleLogEntry_RangedImpact battleLogEntry_RangedImpact2 = new BattleLogEntry_RangedImpact(RandomPawnForCombat(), null, RandomPawnForCombat(), weaponDef2, null, ThingDefOf.Wall); battleLogEntry_RangedImpact2.Debug_OverrideTicks(Rand.Int); stringBuilder4.AppendLine(battleLogEntry_RangedImpact2.ToGameStringFromPOV(null)); } Log.Message(stringBuilder4.ToString()); })); list.Add(new DebugMenuOption("Ranged impact hit incorrect", DebugMenuOptionMode.Action, delegate { CreateDamagedDestroyedMenu(delegate(Action <List <BodyPartRecord>, List <bool> > bodyPartCreator) { StringBuilder stringBuilder3 = new StringBuilder(); for (int k = 0; k < 100; k++) { ThingDef weaponDef = DefDatabase <ThingDef> .AllDefsListForReading.Where((ThingDef td) => td.IsRangedWeapon && td.IsWeaponUsingProjectiles && !td.menuHidden).RandomElement(); List <BodyPartRecord> list4 = new List <BodyPartRecord>(); List <bool> list5 = new List <bool>(); bodyPartCreator(list4, list5); BattleLogEntry_RangedImpact battleLogEntry_RangedImpact = new BattleLogEntry_RangedImpact(RandomPawnForCombat(), RandomPawnForCombat(), RandomPawnForCombat(), weaponDef, null, ThingDefOf.Wall); battleLogEntry_RangedImpact.FillTargets(list4, list5, Rand.Chance(0.5f)); battleLogEntry_RangedImpact.Debug_OverrideTicks(Rand.Int); stringBuilder3.AppendLine(battleLogEntry_RangedImpact.ToGameStringFromPOV(null)); } Log.Message(stringBuilder3.ToString()); }); })); foreach (RulePackDef transition in DefDatabase <RulePackDef> .AllDefsListForReading.Where((RulePackDef def) => def.defName.Contains("Transition") && !def.defName.Contains("Include"))) { list.Add(new DebugMenuOption(transition.defName, DebugMenuOptionMode.Action, delegate { StringBuilder stringBuilder2 = new StringBuilder(); for (int j = 0; j < 100; j++) { Pawn pawn = RandomPawnForCombat(); Pawn initiator = RandomPawnForCombat(); BodyPartRecord partRecord = pawn.health.hediffSet.GetNotMissingParts().RandomElement(); BattleLogEntry_StateTransition battleLogEntry_StateTransition = new BattleLogEntry_StateTransition(pawn, transition, initiator, HediffMaker.MakeHediff(DefDatabase <HediffDef> .AllDefsListForReading.RandomElement(), pawn, partRecord), pawn.RaceProps.body.AllParts.RandomElement()); battleLogEntry_StateTransition.Debug_OverrideTicks(Rand.Int); stringBuilder2.AppendLine(battleLogEntry_StateTransition.ToGameStringFromPOV(null)); } Log.Message(stringBuilder2.ToString()); })); } foreach (RulePackDef damageEvent in DefDatabase <RulePackDef> .AllDefsListForReading.Where((RulePackDef def) => def.defName.Contains("DamageEvent") && !def.defName.Contains("Include"))) { list.Add(new DebugMenuOption(damageEvent.defName, DebugMenuOptionMode.Action, delegate { CreateDamagedDestroyedMenu(delegate(Action <List <BodyPartRecord>, List <bool> > bodyPartCreator) { StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < 100; i++) { List <BodyPartRecord> list2 = new List <BodyPartRecord>(); List <bool> list3 = new List <bool>(); bodyPartCreator(list2, list3); BattleLogEntry_DamageTaken battleLogEntry_DamageTaken = new BattleLogEntry_DamageTaken(RandomPawnForCombat(), damageEvent); battleLogEntry_DamageTaken.FillTargets(list2, list3, deflected: false); battleLogEntry_DamageTaken.Debug_OverrideTicks(Rand.Int); stringBuilder.AppendLine(battleLogEntry_DamageTaken.ToGameStringFromPOV(null)); } Log.Message(stringBuilder.ToString()); }); })); } Find.WindowStack.Add(new Dialog_DebugOptionListLister(list)); }