Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions Patches/Core/Stats/Stats.xml
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,28 @@
</value>
</Operation>

<Operation Class="PatchOperationReplace">
<Operation Class="PatchOperationReplace">
<xpath>Defs/StatDef[defName="MeleeWeapon_AverageDPS"]/category</xpath>
<value>
<category>Weapon</category>
</value>
</Operation>


<Operation Class="PatchOperationReplace">
<xpath>Defs/StatDef[defName="MeleeWeapon_AverageDPS"]/displayPriorityInCategory</xpath>
<value>
<displayPriorityInCategory>6</displayPriorityInCategory>
<displayPriorityInCategory>7</displayPriorityInCategory>
</value>
</Operation>

<Operation Class="PatchOperationReplace">
<xpath>Defs/StatDef[defName="MeleeDPS"]/workerClass</xpath>
<value>
<workerClass>CombatExtended.StatWorker_MeleeDamageAverage</workerClass>
</value>
</Operation>

<!-- Melee AP -->

<Operation Class="PatchOperationReplace">
Expand All @@ -508,4 +523,19 @@
</value>
</Operation>

<Operation Class="PatchOperationReplace">
<xpath>Defs/StatDef[defName="MeleeWeapon_AverageArmorPenetration"]/category</xpath>
<value>
<category>Weapon</category>
</value>
</Operation>


<Operation Class="PatchOperationReplace">
<xpath>Defs/StatDef[defName="MeleeWeapon_AverageArmorPenetration"]/displayPriorityInCategory</xpath>
<value>
<displayPriorityInCategory>8</displayPriorityInCategory>
</value>
</Operation>

</Patch>
34 changes: 0 additions & 34 deletions Source/CombatExtended/CombatExtended/CE_Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1680,38 +1680,4 @@ internal static T ElementAtOrLast<T>(this IEnumerable<T> enumerable, int index)
}
return current;
}

internal static List<Tool> GetThingDefTools(ThingDef thingDef)
{
List<Tool> tools = new List<Tool>();
if (thingDef.isTechHediff)
{
tools = GetTechHediffTools(thingDef);
}
else if (thingDef.IsWeapon || thingDef.category == ThingCategory.Pawn)
{
tools = thingDef.tools?.ToList();
}

return tools;
}

internal static List<Tool> GetTechHediffTools(ThingDef thingDef)
{
List<Tool> techHediffTools = new List<Tool>();
List<RecipeDef> allDefsListForReading = DefDatabase<RecipeDef>.AllDefsListForReading;
for (int i = 0; i < allDefsListForReading.Count; i++)
{
if (allDefsListForReading[i].IsIngredient(thingDef))
{
HediffDef hediffDef = allDefsListForReading[i].addsHediff;
HediffCompProperties_VerbGiver hediffCompProperties_VerbGiver = hediffDef?.comps?.FirstOrDefault((HediffCompProperties x) => x is HediffCompProperties_VerbGiver) as HediffCompProperties_VerbGiver;
if (hediffCompProperties_VerbGiver != null && !hediffCompProperties_VerbGiver.tools.NullOrEmpty() && hediffCompProperties_VerbGiver.tools.All(t => t is ToolCE))
{
techHediffTools = hediffCompProperties_VerbGiver.tools.ToList();
}
}
}
return techHediffTools;
}
}
Loading