Skip to content
This repository has been archived by the owner on Apr 14, 2020. It is now read-only.

Commit

Permalink
Add ammo resources to traders
Browse files Browse the repository at this point in the history
  • Loading branch information
NoImageAvailable committed Oct 31, 2019
1 parent 4f0d66c commit 0c454e0
Show file tree
Hide file tree
Showing 3 changed files with 207 additions and 2 deletions.
Binary file modified Assemblies/CombatExtended.dll
Binary file not shown.
206 changes: 206 additions & 0 deletions Patches/Core/TraderKindDefs/TraderKinds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,61 @@
<xpath>Defs/TraderKindDef/stockGenerators/li[tradeTag="MortarShell"]</xpath>
</Operation>

<!-- ========== Neolithic bulk goods ========== -->

<Operation Class="PatchOperationAdd">
<xpath>Defs/TraderKindDef[defName="Caravan_Neolithic_BulkGoods"]/stockGenerators</xpath>
<value>
<li Class="StockGenerator_Category">
<categoryDef>Ammo</categoryDef>
<thingDefCountRange>
<min>0</min>
<max>0</max>
</thingDefCountRange>
</li>
<li Class="StockGenerator_Category">
<categoryDef>WeaponsTurrets</categoryDef>
<thingDefCountRange>
<min>0</min>
<max>0</max>
</thingDefCountRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>FSX</thingDef>
<countRange>
<min>15</min>
<max>40</max>
</countRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>Prometheum</thingDef>
<countRange>
<min>15</min>
<max>40</max>
</countRange>
</li>
</value>
</Operation>

<!-- ========== War merchant ========== -->

<Operation Class="PatchOperationAdd">
<xpath>Defs/TraderKindDef[defName="Caravan_Neolithic_WarMerchant"]/stockGenerators</xpath>
<value>
<li Class="StockGenerator_SingleDef">
<thingDef>FSX</thingDef>
<countRange>
<min>5</min>
<max>20</max>
</countRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>Prometheum</thingDef>
<countRange>
<min>5</min>
<max>20</max>
</countRange>
</li>
<li Class="StockGenerator_Category">
<categoryDef>Ammo</categoryDef>
<thingDefCountRange>
Expand Down Expand Up @@ -47,11 +97,99 @@
</value>
</Operation>

<!-- ========== Neolithic misc ========== -->

<Operation Class="PatchOperationAdd">
<xpath>Defs/TraderKindDef[defName="Caravan_Neolithic_Slaver" or defName="Caravan_Neolithic_ShamanMerchant"]/stockGenerators</xpath>
<value>
<li Class="StockGenerator_Category">
<categoryDef>Ammo</categoryDef>
<thingDefCountRange>
<min>0</min>
<max>0</max>
</thingDefCountRange>
</li>
<li Class="StockGenerator_Category">
<categoryDef>WeaponsTurrets</categoryDef>
<thingDefCountRange>
<min>0</min>
<max>0</max>
</thingDefCountRange>
</li>
</value>
</Operation>

<!-- ========== Neolithic Base ========== -->

<Operation Class="PatchOperationAdd">
<xpath>Defs/TraderKindDef[defName="Base_Neolithic_Standard"]/stockGenerators</xpath>
<value>
<li Class="StockGenerator_SingleDef">
<thingDef>FSX</thingDef>
<countRange>
<min>10</min>
<max>50</max>
</countRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>Prometheum</thingDef>
<countRange>
<min>10</min>
<max>50</max>
</countRange>
</li>
<li Class="StockGenerator_Category">
<categoryDef>Ammo</categoryDef>
<thingDefCountRange>
<min>0</min>
<max>0</max>
</thingDefCountRange>
</li>
<li Class="StockGenerator_Category">
<categoryDef>WeaponsTurrets</categoryDef>
<thingDefCountRange>
<min>0</min>
<max>0</max>
</thingDefCountRange>
</li>
<li Class="StockGenerator_Animals">
<tradeTagsSell>
<li>CE_AnimalBoom</li>
</tradeTagsSell>
<tradeTagsBuy>
<li>CE_AnimalBoom</li>
</tradeTagsBuy>
<kindCountRange>
<min>1</min>
<max>2</max>
</kindCountRange>
<countRange>
<min>-2</min>
<max>4</max>
</countRange>
</li>
</value>
</Operation>

<!-- ========== Outlander Base ========== -->

<Operation Class="PatchOperationAdd">
<xpath>Defs/TraderKindDef[defName="Base_Outlander_Standard"]/stockGenerators</xpath>
<value>
<li Class="StockGenerator_SingleDef">
<thingDef>FSX</thingDef>
<countRange>
<min>25</min>
<max>100</max>
</countRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>Prometheum</thingDef>
<countRange>
<min>25</min>
<max>100</max>
</countRange>
</li>
<li Class="StockGenerator_Tag">
<tradeTag>CE_Ammo</tradeTag>
<countRange>
Expand Down Expand Up @@ -135,11 +273,45 @@
</value>
</Operation>

<Operation Class="PatchOperationAdd">
<xpath>Defs/TraderKindDef[defName="Caravan_Outlander_BulkGoods"]/stockGenerators</xpath>
<value>
<li Class="StockGenerator_SingleDef">
<thingDef>FSX</thingDef>
<countRange>
<min>35</min>
<max>80</max>
</countRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>Prometheum</thingDef>
<countRange>
<min>35</min>
<max>80</max>
</countRange>
</li>
</value>
</Operation>

<!-- Combat Supplier -->

<Operation Class="PatchOperationAdd">
<xpath>Defs/TraderKindDef[defName="Caravan_Outlander_CombatSupplier"]/stockGenerators</xpath>
<value>
<li Class="StockGenerator_SingleDef">
<thingDef>FSX</thingDef>
<countRange>
<min>15</min>
<max>40</max>
</countRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>Prometheum</thingDef>
<countRange>
<min>15</min>
<max>40</max>
</countRange>
</li>
<li Class="StockGenerator_Tag">
<tradeTag>CE_Ammo</tradeTag>
<countRange>
Expand Down Expand Up @@ -224,11 +396,45 @@
</value>
</Operation>

<Operation Class="PatchOperationAdd">
<xpath>Defs/TraderKindDef[defName="Orbital_BulkGoods"]/stockGenerators</xpath>
<value>
<li Class="StockGenerator_SingleDef">
<thingDef>FSX</thingDef>
<countRange>
<min>50</min>
<max>100</max>
</countRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>Prometheum</thingDef>
<countRange>
<min>50</min>
<max>100</max>
</countRange>
</li>
</value>
</Operation>

<!-- Combat Supplier -->

<Operation Class="PatchOperationAdd">
<xpath>Defs/TraderKindDef[defName="Orbital_CombatSupplier"]/stockGenerators</xpath>
<value>
<li Class="StockGenerator_SingleDef">
<thingDef>FSX</thingDef>
<countRange>
<min>25</min>
<max>50</max>
</countRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>Prometheum</thingDef>
<countRange>
<min>25</min>
<max>50</max>
</countRange>
</li>
<li Class="StockGenerator_Tag">
<tradeTag>CE_Ammo</tradeTag>
<countRange>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ internal static void Postfix(DamageInfo dinfo, Pawn pawn)
{
if (pawn.Dead)
{
_applyingSecondary = false;
return;
break;
}
var secDinfo = sec.GetDinfo(dinfo);
pawn.TakeDamage(secDinfo);
Expand Down

0 comments on commit 0c454e0

Please sign in to comment.