Skip to content

Commit

Permalink
Merge pull request #2806 from CombatExtended-Continued/CaliberStatFor…
Browse files Browse the repository at this point in the history
…AmmoSetDef

Add calibre info to ammosetdef
  • Loading branch information
N7Huntsman authored Oct 13, 2023
2 parents 31972f5 + 65fbe76 commit 1a4540f
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Patches/Vanilla Vehicles Expanded/VehicleDefs/Tier1/Bunsen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@
</li>

<!-- Vehicle -->
<li Class="PatchOperationAdd">
<xpath>Defs/Vehicles.VehicleDef[defName="VVE_Bunsen"]</xpath>
<value>
<descriptionHyperlinks>
<CombatExtended.AmmoSetDef>AmmoSet_Flamethrower</CombatExtended.AmmoSetDef>
</descriptionHyperlinks>
</value>
</li>

<li Class="PatchOperationReplace">
<xpath>Defs/Vehicles.VehicleDef[defName="VVE_Bunsen"]/comps/li[@Class="Vehicles.CompProperties_VehicleTurrets"]</xpath>
<value>
Expand Down Expand Up @@ -255,4 +264,4 @@
</match>
</Operation>

</Patch>
</Patch>
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@
</li>

<!-- Vehicle -->
<li Class="PatchOperationAdd">
<xpath>Defs/Vehicles.VehicleDef[defName="VVE_Highwayman"]</xpath>
<value>
<descriptionHyperlinks>
<CombatExtended.AmmoSetDef>AmmoSet_762x51mmNATO</CombatExtended.AmmoSetDef>
</descriptionHyperlinks>
</value>
</li>

<li Class="PatchOperationReplace">
<xpath>Defs/Vehicles.VehicleDef[defName="VVE_Highwayman"]/statBases/ArmorRating_Blunt</xpath>
<value>
Expand Down Expand Up @@ -215,4 +224,4 @@
</match>
</Operation>

</Patch>
</Patch>
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@
</li>

<!-- Vehicle -->
<li Class="PatchOperationAdd">
<xpath>Defs/Vehicles.VehicleDef[defName="VVE_Roadkill"]</xpath>
<value>
<descriptionHyperlinks>
<CombatExtended.AmmoSetDef>AmmoSet_57x307mmR</CombatExtended.AmmoSetDef>
</descriptionHyperlinks>
</value>
</li>

<li Class="PatchOperationReplace">
<xpath>Defs/Vehicles.VehicleDef[defName="VVE_Roadkill"]/statBases/ArmorRating_Blunt</xpath>
<value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@
</li>

<!-- Vehicle -->
<li Class="PatchOperationAdd">
<xpath>Defs/Vehicles.VehicleDef[defName="VVE_Bulldog"]</xpath>
<value>
<descriptionHyperlinks>
<CombatExtended.AmmoSetDef>AmmoSet_75x350mmR</CombatExtended.AmmoSetDef>
</descriptionHyperlinks>
</value>
</li>

<li Class="PatchOperationReplace">
<xpath>Defs/Vehicles.VehicleDef[defName="VVE_Bulldog"]/statBases/ArmorRating_Blunt</xpath>
<value>
Expand Down
9 changes: 9 additions & 0 deletions Patches/Vanilla Vehicles Expanded/VehicleDefs/Tier2/Tango.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@
</li>

<!-- Vehicle -->
<li Class="PatchOperationAdd">
<xpath>Defs/Vehicles.VehicleDef[defName="VVE_Tango"]</xpath>
<value>
<descriptionHyperlinks>
<CombatExtended.AmmoSetDef>AmmoSet_20x102mmNATO</CombatExtended.AmmoSetDef>
</descriptionHyperlinks>
</value>
</li>

<li Class="PatchOperationReplace">
<xpath>Defs/Vehicles.VehicleDef[defName="VVE_Tango"]/statBases/ArmorRating_Blunt</xpath>
<value>
Expand Down
11 changes: 11 additions & 0 deletions Source/CombatExtended/CombatExtended/Defs/AmmoSetDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,16 @@ public class AmmoSetDef : Def
public bool isMortarAmmoSet = false;

public AmmoSetDef similarTo;

public override IEnumerable<StatDrawEntry> SpecialDisplayStats(StatRequest req)
{
foreach (StatDrawEntry entry in base.SpecialDisplayStats(req)) { yield return entry; }

foreach (AmmoLink link in ammoTypes)
{

yield return new StatDrawEntry(StatCategoryDefOf.BasicsImportant, link.ammo.label, "", link.projectile.GetProjectileReadout(null), 1, hyperlinks: new List<Dialog_InfoCard.Hyperlink>() { new Dialog_InfoCard.Hyperlink(link.ammo) });
}
}
}
}

0 comments on commit 1a4540f

Please sign in to comment.