Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Looting implementation #17
As described in this forum post. Looting gives and takes resources on death of a unit. This particular implementation allows units to specify what happens when they die: how many resources do they give and how many do they lose. These numbers can be specified as either absolute values or as percentages of their existing resources.
<parameters> <!-- ... --> <resources-death> <resource name="wood" amount-value="100" loss-value="100" allow-negative="true" /> <resource name="gold" amount-percentage="10" loss-percentage="10" /> <resource name="food" amount-value="1" /> </resources-death> <!-- ... --> </parameters>
As the example shows, we specify a list of resources in a manner akin to the resource cost. The attributes are:
All combinations of attributes are valid. All default to 0 (except