Skip to content

Commit

Permalink
Remove redundant partial armor display stat
Browse files Browse the repository at this point in the history
  • Loading branch information
N7Huntsman committed Nov 12, 2024
1 parent 85e7359 commit 0b775ba
Show file tree
Hide file tree
Showing 22 changed files with 28 additions and 163 deletions.
6 changes: 0 additions & 6 deletions Defs/Stats/Stats_Pawns_Combat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,6 @@
</StatDef>

<!-- Only displays information -->
<StatDef ParentName="BodyPartDensity">
<defName>PartialArmorBody</defName>
<description>Special armor values for certain bodyparts</description>
<label>Natural armor</label>
<workerClass>CombatExtended.StatWorker_ArmorPartial</workerClass>
</StatDef>

<StatDef ParentName="BodyPartDensity">
<defName>BodyPartSharpArmor</defName>
Expand Down
1 change: 0 additions & 1 deletion Defs/ThingDefs_Races/Tytan.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<ArmorRating_Heat>1</ArmorRating_Heat>
<ArmorRating_Electric>0.85</ArmorRating_Electric>
<PsychicSensitivity>0.75</PsychicSensitivity>
<PartialArmorBody>0</PartialArmorBody>
<CarryWeight>600</CarryWeight>
<CarryBulk>600</CarryBulk>
<AimingAccuracy>1.0</AimingAccuracy>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
<!-- EN: Base chance to parry a melee attack. When a parry is performed the equipped weapon or shield will take damage instead of the wielder. If the parrying pawn passes a critical chance check they will automatically riposte their attacker.\nThe final chance depends on the opponent's parry skill and equal opponents will always have a 20% chance to parry. The internal formula is:\n\nFinalParryChance = ClampBetweenZeroAndOne(0.2 + DefenderParryChance - AttackerParryChance * (1 + AttackerWeaponMeleeCounterParryBonus)*100%\n\nA pawn that is better skilled in parrying takes less damage from parrying while unarmed and is better at reducing damage taken by their weapon on parry. -->
<MeleeParryChance.description>挡住近战攻击的几率。当格挡时,装备的武器或盾牌将受到伤害,而不是持用者。如果格挡着成功格挡,他们将自动回击攻击者。\n\n最终的几率取决于对手的招架技能,同等对手将始终有20%的几率格挡。</MeleeParryChance.description>

<!-- EN: Natural armor -->
<PartialArmorBody.label>天然护甲</PartialArmorBody.label>
<!-- EN: Special armor values for certain bodyparts -->
<PartialArmorBody.description>各种身体部件的特殊护甲值</PartialArmorBody.description>

<!-- EN: reload speed -->
<ReloadSpeed.label>换弹速度</ReloadSpeed.label>
<!-- EN: The speed at which firearms are reloaded. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,4 @@
</value>
</Operation>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[@Name="AA_AlphaBaseInsect" or @Name="BaseInsect2"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>
</Patch>
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,34 @@
</value>
</Operation>

<Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="AA_Slurrypede"]</xpath>
<value>
<li Class="CombatExtended.PartialArmorExt">
<stats>
<li>
<useStatic>false</useStatic>
<ArmorRating_Sharp>0.25</ArmorRating_Sharp>
<parts>
<li>SightSensor</li>
<li>HearingSensor</li>
<li>SmellSensor</li>
</parts>
</li>
<li>
<useStatic>false</useStatic>
<ArmorRating_Blunt>0.25</ArmorRating_Blunt>
<parts>
<li>SightSensor</li>
<li>HearingSensor</li>
<li>SmellSensor</li>
</parts>
</li>
</stats>
</li>
</value>
</Operation>

<Operation Class="PatchOperationConditional">
<xpath>Defs/ThingDef[defName="AA_Slurrypede"]/comps</xpath>
<nomatch Class="PatchOperationAdd">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@
</value>
</li>

<li Class="PatchOperationAdd">
<xpath>Defs/ThingDef[@Name="AG_BaseInsect"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</li>

<!-- ======= Eye Projectile ======= -->

<li Class="PatchOperationAdd">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Patch>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="RM_Mech_Matriarch"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>

<!--Consistency with vanilla mechs-->
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="RM_Mech_Matriarch"]/statBases</xpath>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Patch>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="MOW_Mech_Cicada"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>

<!--Consistency with vanilla mechs-->
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="MOW_Mech_Cicada"]/statBases</xpath>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Patch>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="MOW_Mech_Demolisher"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>

<!--Consistency with vanilla mechs-->
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="MOW_Mech_Demolisher"]/statBases</xpath>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Patch>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="MOW_Mech_Enforcer_Breacher"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>

<!--Consistency with vanilla mechs-->
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="MOW_Mech_Enforcer_Breacher"]/statBases</xpath>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Patch>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="MOW_Mech_Enforcer"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>

<!--Consistency with vanilla mechs-->
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="MOW_Mech_Enforcer"]/statBases</xpath>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Patch>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="MGR_Mech_Gekko"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>

<!--Consistency with vanilla mechs-->
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="MGR_Mech_Gekko"]/statBases</xpath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@
</value>
</Operation>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[@Name="WMH_InsectoidMonsterBase"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>

<Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="WMAux_KikimoreWorker"]</xpath>
<value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,6 @@
</value>
</Operation>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="Mutant_Ogron"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>

<Operation Class="PatchOperationReplace">
<xpath>Defs/ThingDef[defName="Mutant_Ogron"]/tools</xpath>
<value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,4 @@
</value>
</Operation>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[@Name="VAEWaste_BaseInsect"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>

</Patch>
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,4 @@
</value>
</Operation>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[@Name="VFEI2_BaseInsect"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>

</Patch>
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@
</value>
</Operation>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[@Name="BaseVFEMachine"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>

<Operation Class="PatchOperationReplace">
<xpath>Defs/ThingDef[
defName="VFE_Mechanoids_Autocleaner" or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@
</value>
</Operation>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[@Name="VFE_Mechanoid"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>

<!--Consistency with vanilla mechs-->

<Operation Class="PatchOperationReplace">
Expand Down
6 changes: 0 additions & 6 deletions Patches/Core/ThingDefs_Races/Races_Animal_Farm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,6 @@
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="Cow"]/statBases</xpath>
<value>
Value here does nothing, this whole thing is only used for display of info
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>-->

<!-- ========== Alpaca ========== -->
Expand Down
7 changes: 0 additions & 7 deletions Patches/Core/ThingDefs_Races/Races_Animal_Insect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@
</value>
</Operation>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[@Name="BaseInsect"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>

<!-- ========== Megascarab ========== -->

<Operation Class="PatchOperationReplace">
Expand Down
7 changes: 0 additions & 7 deletions Patches/Core/ThingDefs_Races/Races_Mechanoid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,6 @@
</value>
</Operation>

<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[@Name="BaseMechanoid"]/statBases</xpath>
<value>
<PartialArmorBody>0</PartialArmorBody>
</value>
</Operation>

<!-- ========== Centipede ========== -->

<Operation Class="PatchOperationAddModExtension">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,39 +227,5 @@ public override string GetStatDrawEntryLabel(StatDef stat, float value, ToString
return base.GetStatDrawEntryLabel(stat, value, numberSense, optionalReq, finalized);
}

public override string ValueToString(float val, bool finalized, ToStringNumberSense numberSense = ToStringNumberSense.Absolute)
{
if (this.stat.defName == "PartialArmorBody")
{
return "Hover over";
}
return base.ValueToString(val, finalized, numberSense);
}

public override bool ShouldShowFor(StatRequest req)
{
if (!(req.Def is ThingDef))
{
return false;
}

if (((ThingDef)req.Def)?.IsApparel ?? req.Thing?.def?.IsApparel ?? false)
{
return this.stat.defName != "PartialArmorBody";
}
else if (req.Thing is Pawn)
{
if (req.Thing.def.HasModExtension<PartialArmorExt>())
{
return true;
}
else
{
return this.stat.defName != "PartialArmorBody";
}
}
return false;

}
}
}

0 comments on commit 0b775ba

Please sign in to comment.