Decay/Regenerate option for resources.
Allows entities to change their resource amount over time, possibly with some constraint. This is a not-so-bare minimum, but can certainly be improved and/or extended later. Part of: #1973 Original patch by: @smiley Redone by: @Stan Standing on the shoulders of giants: @Freagarach (Revisions: 59; Inlines: 209) Differential revision: D1718 Comments by: @Angen, @elexis, @Imarok, @Langbart, @nani, @Nescio, @smiley, @Stan, @wraitii This was SVN commit r24963.
This commit is contained in:
parent
df18102e96
commit
c888844b3a
@ -82,7 +82,7 @@ class TemplateParser
|
||||
if (template.ResourceSupply)
|
||||
parsed.supply = {
|
||||
"type": template.ResourceSupply.Type.split("."),
|
||||
"amount": template.ResourceSupply.Amount,
|
||||
"amount": template.ResourceSupply.Max,
|
||||
};
|
||||
|
||||
if (parsed.upgrades)
|
||||
|
@ -392,7 +392,7 @@ m.Template = m.Class({
|
||||
|
||||
"getDiminishingReturns": function() { return +(this.get("ResourceSupply/DiminishingReturns") || 1); },
|
||||
|
||||
"resourceSupplyMax": function() { return +this.get("ResourceSupply/Amount"); },
|
||||
"resourceSupplyMax": function() { return +this.get("ResourceSupply/Max"); },
|
||||
|
||||
"maxGatherers": function() { return +(this.get("ResourceSupply/MaxGatherers") || 0); },
|
||||
|
||||
|
@ -3,18 +3,47 @@ function ResourceSupply() {}
|
||||
ResourceSupply.prototype.Schema =
|
||||
"<a:help>Provides a supply of one particular type of resource.</a:help>" +
|
||||
"<a:example>" +
|
||||
"<Amount>1000</Amount>" +
|
||||
"<Max>1000</Max>" +
|
||||
"<Initial>1000</Initial>" +
|
||||
"<Type>food.meat</Type>" +
|
||||
"<KillBeforeGather>false</KillBeforeGather>" +
|
||||
"<MaxGatherers>25</MaxGatherers>" +
|
||||
"<DiminishingReturns>0.8</DiminishingReturns>" +
|
||||
"<Change>" +
|
||||
"<AnyName>" +
|
||||
"<Value>2</Value>" +
|
||||
"<Interval>1000</Interval>" +
|
||||
"</AnyName>" +
|
||||
"<Growth>" +
|
||||
"<State>alive</State>" +
|
||||
"<Value>2</Value>" +
|
||||
"<Interval>1000</Interval>" +
|
||||
"<UpperLimit>500</UpperLimit>" +
|
||||
"</Growth>" +
|
||||
"<Rotting>" +
|
||||
"<State>dead notGathered</State>" +
|
||||
"<Value>-2</Value>" +
|
||||
"<Interval>1000</Interval>" +
|
||||
"</Rotting>" +
|
||||
"<Decay>" +
|
||||
"<State>dead</State>" +
|
||||
"<Value>-1</Value>" +
|
||||
"<Interval>1000</Interval>" +
|
||||
"<LowerLimit>500</LowerLimit>" +
|
||||
"</Decay>" +
|
||||
"</Change>" +
|
||||
"</a:example>" +
|
||||
"<element name='KillBeforeGather' a:help='Whether this entity must be killed (health reduced to 0) before its resources can be gathered'>" +
|
||||
"<data type='boolean'/>" +
|
||||
"</element>" +
|
||||
"<element name='Amount' a:help='Amount of resources available from this entity'>" +
|
||||
"<element name='Max' a:help='Max amount of resources available from this entity.'>" +
|
||||
"<choice><data type='nonNegativeInteger'/><value>Infinity</value></choice>" +
|
||||
"</element>" +
|
||||
"<optional>" +
|
||||
"<element name='Initial' a:help='Initial amount of resources available from this entity, if this is not specified, Max is used.'>" +
|
||||
"<choice><data type='nonNegativeInteger'/><value>Infinity</value></choice>" +
|
||||
"</element>" +
|
||||
"</optional>" +
|
||||
"<element name='Type' a:help='Type and Subtype of resource available from this entity'>" +
|
||||
Resources.BuildChoicesSchema(true, true) +
|
||||
"</element>" +
|
||||
@ -25,22 +54,70 @@ ResourceSupply.prototype.Schema =
|
||||
"<element name='DiminishingReturns' a:help='The relative rate of any new gatherer compared to the previous one (geometric sequence). Leave the element out for no diminishing returns.'>" +
|
||||
"<ref name='positiveDecimal'/>" +
|
||||
"</element>" +
|
||||
"</optional>" +
|
||||
"<optional>" +
|
||||
"<element name='Change' a:help='Optional element containing all the modifications that affects a resource supply'>" +
|
||||
"<oneOrMore>" +
|
||||
"<element a:help='Element defining whether and how a resource supply regenerates or decays'>" +
|
||||
"<anyName/>" +
|
||||
"<interleave>" +
|
||||
"<element name='Value' a:help='The amount of resource added per interval.'>" +
|
||||
"<data type='integer'/>" +
|
||||
"</element>" +
|
||||
"<element name='Interval' a:help='The interval in milliseconds.'>" +
|
||||
"<data type='positiveInteger'/>" +
|
||||
"</element>" +
|
||||
"<optional>" +
|
||||
"<element name='UpperLimit' a:help='The upper limit of the value after which the Change has no effect.'>" +
|
||||
"<data type='nonNegativeInteger'/>" +
|
||||
"</element>" +
|
||||
"</optional>" +
|
||||
"<optional>" +
|
||||
"<element name='LowerLimit' a:help='The bottom limit of the value after which the Change has no effect.'>" +
|
||||
"<data type='nonNegativeInteger'/>" +
|
||||
"</element>" +
|
||||
"</optional>" +
|
||||
"<optional>" +
|
||||
"<element name='State' a:help='What state the entity must be in for the effect to occur.'>" +
|
||||
"<list>" +
|
||||
"<oneOrMore>" +
|
||||
"<choice>" +
|
||||
"<value>alive</value>" +
|
||||
"<value>dead</value>" +
|
||||
"<value>gathered</value>" +
|
||||
"<value>notGathered</value>" +
|
||||
"</choice>" +
|
||||
"</oneOrMore>" +
|
||||
"</list>" +
|
||||
"</element>" +
|
||||
"</optional>" +
|
||||
"</interleave>" +
|
||||
"</element>" +
|
||||
"</oneOrMore>" +
|
||||
"</element>" +
|
||||
"</optional>";
|
||||
|
||||
ResourceSupply.prototype.Init = function()
|
||||
{
|
||||
// Current resource amount (non-negative)
|
||||
this.amount = this.GetMaxAmount();
|
||||
this.amount = +(this.template.Initial || this.template.Max);
|
||||
|
||||
// Includes the ones that are tasked but not here yet, i.e. approaching.
|
||||
this.gatherers = [];
|
||||
this.activeGatherers = [];
|
||||
|
||||
let [type, subtype] = this.template.Type.split('.');
|
||||
this.cachedType = { "generic": type, "specific": subtype };
|
||||
|
||||
if (this.template.Change)
|
||||
{
|
||||
this.timers = {};
|
||||
this.cachedChanges = {};
|
||||
}
|
||||
};
|
||||
|
||||
ResourceSupply.prototype.IsInfinite = function()
|
||||
{
|
||||
return !isFinite(+this.template.Amount);
|
||||
return !isFinite(+this.template.Max);
|
||||
};
|
||||
|
||||
ResourceSupply.prototype.GetKillBeforeGather = function()
|
||||
@ -50,7 +127,7 @@ ResourceSupply.prototype.GetKillBeforeGather = function()
|
||||
|
||||
ResourceSupply.prototype.GetMaxAmount = function()
|
||||
{
|
||||
return +this.template.Amount;
|
||||
return this.maxAmount;
|
||||
};
|
||||
|
||||
ResourceSupply.prototype.GetCurrentAmount = function()
|
||||
@ -68,6 +145,14 @@ ResourceSupply.prototype.GetNumGatherers = function()
|
||||
return this.gatherers.length;
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {number} - The number of currently active gatherers.
|
||||
*/
|
||||
ResourceSupply.prototype.GetNumActiveGatherers = function()
|
||||
{
|
||||
return this.activeGatherers.length;
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {{ "generic": string, "specific": string }} An object containing the subtype and the generic type. All resources must have both.
|
||||
*/
|
||||
@ -127,26 +212,52 @@ ResourceSupply.prototype.GetDiminishingReturns = function()
|
||||
* @return {{ "amount": number, "exhausted": boolean }} The current resource amount in the entity and whether it's exhausted or not.
|
||||
*/
|
||||
ResourceSupply.prototype.TakeResources = function(amount)
|
||||
{
|
||||
if (this.IsInfinite())
|
||||
return { "amount": amount, "exhausted": false };
|
||||
|
||||
return {
|
||||
"amount": Math.abs(this.Change(-amount)),
|
||||
"exhausted": this.amount == 0
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} change - The amount to change the resources with (can be negative).
|
||||
* @return {number} - The actual change in resourceSupply.
|
||||
*/
|
||||
ResourceSupply.prototype.Change = function(change)
|
||||
{
|
||||
// Before changing the amount, activate Fogging if necessary to hide changes
|
||||
let cmpFogging = Engine.QueryInterface(this.entity, IID_Fogging);
|
||||
if (cmpFogging)
|
||||
cmpFogging.Activate();
|
||||
|
||||
if (this.IsInfinite())
|
||||
return { "amount": amount, "exhausted": false };
|
||||
let oldAmount = this.amount;
|
||||
this.amount = Math.min(Math.max(oldAmount + change, 0), this.maxAmount);
|
||||
|
||||
let oldAmount = this.GetCurrentAmount();
|
||||
this.amount = Math.max(0, oldAmount - amount);
|
||||
|
||||
let isExhausted = this.GetCurrentAmount() == 0;
|
||||
// Remove entities that have been exhausted
|
||||
if (isExhausted)
|
||||
// Remove entities that have been exhausted.
|
||||
if (this.amount == 0)
|
||||
Engine.DestroyEntity(this.entity);
|
||||
|
||||
Engine.PostMessage(this.entity, MT_ResourceSupplyChanged, { "from": oldAmount, "to": this.GetCurrentAmount() });
|
||||
let actualChange = this.amount - oldAmount;
|
||||
if (actualChange != 0)
|
||||
{
|
||||
Engine.PostMessage(this.entity, MT_ResourceSupplyChanged, {
|
||||
"from": oldAmount,
|
||||
"to": this.amount
|
||||
});
|
||||
this.CheckTimers();
|
||||
}
|
||||
return actualChange;
|
||||
};
|
||||
|
||||
return { "amount": oldAmount - this.GetCurrentAmount(), "exhausted": isExhausted };
|
||||
/**
|
||||
* @param {number} newValue - The value to set the current amount to.
|
||||
*/
|
||||
ResourceSupply.prototype.SetAmount = function(newValue)
|
||||
{
|
||||
this.Change(newValue - this.amount);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -168,6 +279,26 @@ ResourceSupply.prototype.AddGatherer = function(gathererID)
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} player - The playerID owning the gatherer.
|
||||
* @param {number} entity - The entityID gathering.
|
||||
*
|
||||
* @return {boolean} - Whether the gatherer was successfully added to the active-gatherers list
|
||||
* or the entity was already in that list.
|
||||
*/
|
||||
ResourceSupply.prototype.AddActiveGatherer = function(entity)
|
||||
{
|
||||
if (!this.AddGatherer(entity))
|
||||
return false;
|
||||
|
||||
if (this.activeGatherers.indexOf(entity) == -1)
|
||||
{
|
||||
this.activeGatherers.push(entity);
|
||||
this.CheckTimers();
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} gathererID - The gatherer's entity id.
|
||||
* @todo: Should this return false if the gatherer didn't gather from said resource?
|
||||
@ -175,11 +306,166 @@ ResourceSupply.prototype.AddGatherer = function(gathererID)
|
||||
ResourceSupply.prototype.RemoveGatherer = function(gathererID)
|
||||
{
|
||||
let index = this.gatherers.indexOf(gathererID);
|
||||
if (index != -1)
|
||||
{
|
||||
this.gatherers.splice(index, 1);
|
||||
Engine.PostMessage(this.entity, MT_ResourceSupplyNumGatherersChanged, { "to": this.GetNumGatherers() });
|
||||
}
|
||||
|
||||
index = this.activeGatherers.indexOf(gathererID);
|
||||
if (index == -1)
|
||||
return;
|
||||
this.activeGatherers.splice(index, 1);
|
||||
this.CheckTimers();
|
||||
};
|
||||
|
||||
this.gatherers.splice(index, 1);
|
||||
Engine.PostMessage(this.entity, MT_ResourceSupplyNumGatherersChanged, { "to": this.GetNumGatherers() });
|
||||
/**
|
||||
* Checks whether a timer ought to be added or removed.
|
||||
*/
|
||||
ResourceSupply.prototype.CheckTimers = function()
|
||||
{
|
||||
if (!this.template.Change || this.IsInfinite())
|
||||
return;
|
||||
|
||||
for (let changeKey in this.template.Change)
|
||||
{
|
||||
if (!this.CheckState(changeKey))
|
||||
{
|
||||
this.StopTimer(changeKey);
|
||||
continue;
|
||||
}
|
||||
let template = this.template.Change[changeKey];
|
||||
if (this.amount < +(template.LowerLimit || -1) ||
|
||||
this.amount > +(template.UpperLimit || this.GetMaxAmount()))
|
||||
{
|
||||
this.StopTimer(changeKey);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (this.cachedChanges[changeKey] == 0)
|
||||
{
|
||||
this.StopTimer(changeKey);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!this.timers[changeKey])
|
||||
this.StartTimer(changeKey);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* This verifies whether the current state of the supply matches the ones needed
|
||||
* for the specific timer to run.
|
||||
*
|
||||
* @param {string} changeKey - The name of the Change to verify the state for.
|
||||
* @return {boolean} - Whether the timer may run.
|
||||
*/
|
||||
ResourceSupply.prototype.CheckState = function(changeKey)
|
||||
{
|
||||
let template = this.template.Change[changeKey];
|
||||
if (!template.State)
|
||||
return true;
|
||||
|
||||
let states = template.State;
|
||||
let cmpHealth = Engine.QueryInterface(this.entity, IID_Health);
|
||||
if (states.indexOf("alive") != -1 && !cmpHealth && states.indexOf("dead") == -1 ||
|
||||
states.indexOf("dead") != -1 && cmpHealth && states.indexOf("alive") == -1)
|
||||
return false;
|
||||
|
||||
let activeGatherers = this.GetNumActiveGatherers();
|
||||
if (states.indexOf("gathered") != -1 && activeGatherers == 0 && states.indexOf("notGathered") == -1 ||
|
||||
states.indexOf("notGathered") != -1 && activeGatherers > 0 && states.indexOf("gathered") == -1)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} changeKey - The name of the Change to apply to the entity.
|
||||
*/
|
||||
ResourceSupply.prototype.StartTimer = function(changeKey)
|
||||
{
|
||||
if (this.timers[changeKey])
|
||||
return;
|
||||
|
||||
let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
|
||||
let interval = ApplyValueModificationsToEntity("ResourceSupply/Change/" + changeKey + "/Interval", +(this.template.Change[changeKey].Interval || 1000), this.entity);
|
||||
this.timers[changeKey] = cmpTimer.SetInterval(this.entity, IID_ResourceSupply, "TimerTick", interval, interval, changeKey);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} changeKey - The name of the change to stop the timer for.
|
||||
*/
|
||||
ResourceSupply.prototype.StopTimer = function(changeKey)
|
||||
{
|
||||
if (!this.timers[changeKey])
|
||||
return;
|
||||
|
||||
let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
|
||||
cmpTimer.CancelTimer(this.timers[changeKey]);
|
||||
delete this.timers[changeKey];
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} changeKey - The name of the change to apply to the entity.
|
||||
*/
|
||||
ResourceSupply.prototype.TimerTick = function(changeKey)
|
||||
{
|
||||
let template = this.template.Change[changeKey];
|
||||
if (!template || !this.Change(this.cachedChanges[changeKey]))
|
||||
this.StopTimer(changeKey);
|
||||
};
|
||||
|
||||
/**
|
||||
* Since the supposed changes can be affected by modifications, and applying those
|
||||
* are slow, do not calculate them every timer tick.
|
||||
*/
|
||||
ResourceSupply.prototype.RecalculateValues = function()
|
||||
{
|
||||
this.maxAmount = ApplyValueModificationsToEntity("ResourceSupply/Max", +this.template.Max, this.entity);
|
||||
if (!this.template.Change || this.IsInfinite())
|
||||
return;
|
||||
|
||||
for (let changeKey in this.template.Change)
|
||||
this.cachedChanges[changeKey] = ApplyValueModificationsToEntity("ResourceSupply/Change/" + changeKey + "/Value", +this.template.Change[changeKey].Value, this.entity);
|
||||
|
||||
this.CheckTimers();
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {{ "component": string, "valueNames": string[] }} msg - Message containing a list of values that were changed.
|
||||
*/
|
||||
ResourceSupply.prototype.OnValueModification = function(msg)
|
||||
{
|
||||
if (msg.component != "ResourceSupply")
|
||||
return;
|
||||
|
||||
this.RecalculateValues();
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {{ "from": number, "to": number }} msg - Message containing the old new owner.
|
||||
*/
|
||||
ResourceSupply.prototype.OnOwnershipChanged = function(msg)
|
||||
{
|
||||
if (msg.to == INVALID_PLAYER)
|
||||
{
|
||||
let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
|
||||
for (let changeKey in this.timers)
|
||||
cmpTimer.CancelTimer(this.timers[changeKey]);
|
||||
}
|
||||
else
|
||||
this.RecalculateValues();
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {{ "entity": number, "newentity": number }} msg - Message to what the entity has been renamed.
|
||||
*/
|
||||
ResourceSupply.prototype.OnEntityRenamed = function(msg)
|
||||
{
|
||||
let cmpResourceSupplyNew = Engine.QueryInterface(msg.newentity, IID_ResourceSupply);
|
||||
if (cmpResourceSupplyNew)
|
||||
cmpResourceSupplyNew.SetAmount(this.GetCurrentAmount());
|
||||
};
|
||||
|
||||
Engine.RegisterComponentType(IID_ResourceSupply, "ResourceSupply", ResourceSupply);
|
||||
|
@ -2447,7 +2447,7 @@ UnitAI.prototype.UnitFsmSpec = {
|
||||
// Check if the resource is full.
|
||||
// Will only be added if we're not already in.
|
||||
let cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|
||||
if (!cmpSupply || !cmpSupply.AddGatherer(this.entity))
|
||||
if (!cmpSupply || !cmpSupply.AddActiveGatherer(this.entity))
|
||||
{
|
||||
this.SetNextState("FINDINGNEWTARGET");
|
||||
return true;
|
||||
|
@ -11,10 +11,15 @@ Resources = {
|
||||
}
|
||||
};
|
||||
|
||||
Engine.LoadHelperScript("ValueModification.js");
|
||||
Engine.LoadComponentScript("interfaces/Health.js");
|
||||
Engine.LoadComponentScript("interfaces/ModifiersManager.js");
|
||||
Engine.LoadComponentScript("interfaces/ResourceSupply.js");
|
||||
Engine.LoadComponentScript("interfaces/Timer.js");
|
||||
Engine.LoadComponentScript("ResourceSupply.js");
|
||||
Engine.LoadComponentScript("Timer.js");
|
||||
|
||||
const entity = 60;
|
||||
let entity = 60;
|
||||
|
||||
AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|
||||
"GetNumPlayers": () => 3
|
||||
@ -25,19 +30,21 @@ AddMock(entity, IID_Fogging, {
|
||||
});
|
||||
|
||||
let template = {
|
||||
"Amount": 1000,
|
||||
"Max": "1001",
|
||||
"Initial": "1000",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": false,
|
||||
"MaxGatherers": 2
|
||||
"KillBeforeGather": "false",
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
|
||||
let cmpResourceSupply = ConstructComponent(entity, "ResourceSupply", template);
|
||||
cmpResourceSupply.OnOwnershipChanged({ "to": 1 });
|
||||
|
||||
TS_ASSERT(!cmpResourceSupply.IsInfinite());
|
||||
|
||||
TS_ASSERT(!cmpResourceSupply.GetKillBeforeGather());
|
||||
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetMaxAmount(), 1000);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetMaxAmount(), 1001);
|
||||
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetMaxGatherers(), 2);
|
||||
|
||||
@ -63,6 +70,18 @@ TS_ASSERT_EQUALS(cmpResourceSupply.GetNumGatherers(), 2);
|
||||
cmpResourceSupply.RemoveGatherer(70);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetNumGatherers(), 1);
|
||||
|
||||
TS_ASSERT(cmpResourceSupply.AddActiveGatherer(70));
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetNumGatherers(), 2);
|
||||
|
||||
cmpResourceSupply.RemoveGatherer(70);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetNumGatherers(), 1);
|
||||
|
||||
TS_ASSERT(cmpResourceSupply.AddActiveGatherer(70));
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetNumGatherers(), 2);
|
||||
|
||||
cmpResourceSupply.RemoveGatherer(70);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetNumGatherers(), 1);
|
||||
|
||||
TS_ASSERT_UNEVAL_EQUALS(cmpResourceSupply.GetCurrentAmount(), 1000);
|
||||
TS_ASSERT_UNEVAL_EQUALS(cmpResourceSupply.TakeResources(300), { "amount": 300, "exhausted": false });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 700);
|
||||
@ -72,3 +91,658 @@ TS_ASSERT_UNEVAL_EQUALS(cmpResourceSupply.TakeResources(800), { "amount": 700, "
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 0);
|
||||
// The resource is not available when exhausted
|
||||
TS_ASSERT(!cmpResourceSupply.IsAvailableTo(70));
|
||||
|
||||
cmpResourceSupply.RemoveGatherer(71);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetNumGatherers(), 0);
|
||||
|
||||
|
||||
// Test Changes.
|
||||
|
||||
let cmpTimer;
|
||||
function reset(newTemplate)
|
||||
{
|
||||
cmpTimer = ConstructComponent(SYSTEM_ENTITY, "Timer");
|
||||
cmpResourceSupply = ConstructComponent(entity, "ResourceSupply", newTemplate);
|
||||
cmpResourceSupply.OnOwnershipChanged({ "to": 1 });
|
||||
}
|
||||
|
||||
// Decay.
|
||||
template = {
|
||||
"Max": "1000",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Rotting": {
|
||||
"Value": "-1",
|
||||
"Interval": "1000"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 1000);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 999);
|
||||
cmpTimer.OnUpdate({ "turnLength": 5 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 994);
|
||||
|
||||
// Decay with minimum.
|
||||
template = {
|
||||
"Max": "1000",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Rotting": {
|
||||
"Value": "-1",
|
||||
"Interval": "1000",
|
||||
"LowerLimit": "997"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 1000);
|
||||
cmpTimer.OnUpdate({ "turnLength": 3 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 997);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 996);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 996);
|
||||
|
||||
// Decay with maximum.
|
||||
template = {
|
||||
"Max": "1000",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Rotting": {
|
||||
"Value": "-1",
|
||||
"Interval": "1000",
|
||||
"UpperLimit": "995"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 1000);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 1000);
|
||||
|
||||
// Decay with minimum and maximum.
|
||||
template = {
|
||||
"Max": "1000",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Rotting": {
|
||||
"Value": "-1",
|
||||
"Interval": "1000",
|
||||
"UpperLimit": "995",
|
||||
"LowerLimit": "990"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 1000);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 1000);
|
||||
cmpResourceSupply.TakeResources(6);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 994);
|
||||
cmpTimer.OnUpdate({ "turnLength": 10 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 989);
|
||||
|
||||
// Growth.
|
||||
template = {
|
||||
"Initial": "995",
|
||||
"Max": "1000",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 995);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 996);
|
||||
cmpTimer.OnUpdate({ "turnLength": 5 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 1000);
|
||||
|
||||
// Growth with minimum.
|
||||
template = {
|
||||
"Initial": "995",
|
||||
"Max": "1000",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000",
|
||||
"LowerLimit": "997"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 995);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 995);
|
||||
|
||||
// Growth with maximum.
|
||||
template = {
|
||||
"Initial": "994",
|
||||
"Max": "1000",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000",
|
||||
"UpperLimit": 995
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 994);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 995);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 996);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 996);
|
||||
|
||||
// Growth with minimum and maximum.
|
||||
template = {
|
||||
"Initial": "990",
|
||||
"Max": "1000",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000",
|
||||
"UpperLimit": "995",
|
||||
"LowerLimit": "990"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 990);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 991);
|
||||
cmpTimer.OnUpdate({ "turnLength": 8 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 996);
|
||||
|
||||
// Growth when resources are taken again.
|
||||
template = {
|
||||
"Initial": "995",
|
||||
"Max": "1000",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 995);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 996);
|
||||
cmpResourceSupply.TakeResources(6);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 990);
|
||||
cmpTimer.OnUpdate({ "turnLength": 5 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 995);
|
||||
|
||||
// Decay when dead.
|
||||
template = {
|
||||
"Max": "10",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Rotting": {
|
||||
"Value": "-1",
|
||||
"Interval": "1000",
|
||||
"State": "dead"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 10);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 9);
|
||||
|
||||
// No growth when dead.
|
||||
template = {
|
||||
"Max": "10",
|
||||
"Initial": "5",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000",
|
||||
"State": "alive"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
|
||||
// Decay when dead or alive.
|
||||
template = {
|
||||
"Max": "10",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Rotting": {
|
||||
"Value": "-1",
|
||||
"Interval": "1000",
|
||||
"State": "dead alive"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 10);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 9);
|
||||
|
||||
AddMock(entity, IID_Health, {}); // Bring the entity to life.
|
||||
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 8);
|
||||
|
||||
// No decay when alive.
|
||||
template = {
|
||||
"Max": "10",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Rotting": {
|
||||
"Value": "-1",
|
||||
"Interval": "1000",
|
||||
"State": "dead"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 10);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 10);
|
||||
|
||||
// Growth when alive.
|
||||
template = {
|
||||
"Max": "10",
|
||||
"Initial": "5",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000",
|
||||
"State": "alive"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 6);
|
||||
|
||||
// Growth when dead or alive.
|
||||
template = {
|
||||
"Max": "10",
|
||||
"Initial": "5",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000",
|
||||
"State": "dead alive"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 6);
|
||||
|
||||
DeleteMock(entity, IID_Health); // "Kill" the entity.
|
||||
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 7);
|
||||
|
||||
// Decay *and* growth.
|
||||
template = {
|
||||
"Max": "10",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Rotting": {
|
||||
"Value": "-1",
|
||||
"Interval": "1000"
|
||||
},
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 10);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 10);
|
||||
|
||||
// Decay *and* growth with different health states.
|
||||
template = {
|
||||
"Max": "10",
|
||||
"Initial": "5",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Rotting": {
|
||||
"Value": "-1",
|
||||
"Interval": "1000",
|
||||
"State": "dead"
|
||||
},
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000",
|
||||
"State": "alive"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
AddMock(entity, IID_Health, { }); // Bring the entity to life.
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 6);
|
||||
DeleteMock(entity, IID_Health); // "Kill" the entity.
|
||||
// We overshoot one due to lateness.
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 7);
|
||||
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 6);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
|
||||
// Two effects with different limits.
|
||||
template = {
|
||||
"Max": "20",
|
||||
"Initial": "5",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"SuperGrowth": {
|
||||
"Value": "2",
|
||||
"Interval": "1000",
|
||||
"UpperLimit": "8"
|
||||
},
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000",
|
||||
"UpperLimit": "12"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 8);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 11);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 12);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 13);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 13);
|
||||
|
||||
// Two effects with different limits.
|
||||
// This in an interesting case, where the order of the changes matters.
|
||||
template = {
|
||||
"Max": "20",
|
||||
"Initial": "5",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000",
|
||||
"UpperLimit": "12"
|
||||
},
|
||||
"SuperGrowth": {
|
||||
"Value": "2",
|
||||
"Interval": "1000",
|
||||
"UpperLimit": "8"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 8);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 9);
|
||||
cmpTimer.OnUpdate({ "turnLength": 5 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 13);
|
||||
|
||||
// Infinity with growth.
|
||||
template = {
|
||||
"Max": "Infinity",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), Infinity);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), Infinity);
|
||||
|
||||
// Infinity with decay.
|
||||
template = {
|
||||
"Max": "Infinity",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Decay": {
|
||||
"Value": "-1",
|
||||
"Interval": "1000"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), Infinity);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), Infinity);
|
||||
|
||||
// Decay when not gathered.
|
||||
template = {
|
||||
"Max": "10",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Decay": {
|
||||
"Value": "-1",
|
||||
"Interval": "1000",
|
||||
"State": "notGathered"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 10);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 9);
|
||||
TS_ASSERT(cmpResourceSupply.AddActiveGatherer(70));
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 9);
|
||||
cmpResourceSupply.RemoveGatherer(70);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 8);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 7);
|
||||
|
||||
// Grow when gathered.
|
||||
template = {
|
||||
"Max": "10",
|
||||
"Initial": "5",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000",
|
||||
"State": "gathered"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
TS_ASSERT(cmpResourceSupply.AddActiveGatherer(70));
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 6);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 7);
|
||||
cmpResourceSupply.RemoveGatherer(70, 1);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 7);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 7);
|
||||
|
||||
// Grow when gathered or not.
|
||||
template = {
|
||||
"Max": "10",
|
||||
"Initial": "5",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000",
|
||||
"State": "notGathered gathered"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 6);
|
||||
TS_ASSERT(cmpResourceSupply.AddActiveGatherer(70));
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 7);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 8);
|
||||
cmpResourceSupply.RemoveGatherer(70);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 9);
|
||||
|
||||
// Grow when gathered and alive.
|
||||
template = {
|
||||
"Max": "10",
|
||||
"Initial": "5",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Growth": {
|
||||
"Value": "1",
|
||||
"Interval": "1000",
|
||||
"State": "alive gathered"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
TS_ASSERT(cmpResourceSupply.AddActiveGatherer(70));
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
AddMock(entity, IID_Health, { }); // Bring the entity to life.
|
||||
cmpResourceSupply.CheckTimers(); // No other way to tell we've come to life.
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 6);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 7);
|
||||
cmpResourceSupply.RemoveGatherer(70);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 7);
|
||||
DeleteMock(entity, IID_Health); // "Kill" the entity.
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 7);
|
||||
|
||||
// Decay when dead and not gathered.
|
||||
template = {
|
||||
"Max": "10",
|
||||
"Initial": "5",
|
||||
"Type": "food.meat",
|
||||
"KillBeforeGather": "false",
|
||||
"Change": {
|
||||
"Decay": {
|
||||
"Value": "-1",
|
||||
"Interval": "1000",
|
||||
"State": "dead notGathered"
|
||||
}
|
||||
},
|
||||
"MaxGatherers": "2"
|
||||
};
|
||||
reset(template);
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 5);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 4);
|
||||
TS_ASSERT(cmpResourceSupply.AddActiveGatherer(70));
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 4);
|
||||
AddMock(entity, IID_Health, {}); // Bring the entity to life.
|
||||
cmpResourceSupply.CheckTimers(); // No other way to tell we've come to life.
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 4);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 4);
|
||||
cmpResourceSupply.RemoveGatherer(70);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 4);
|
||||
DeleteMock(entity, IID_Health); // "Kill" the entity.
|
||||
cmpResourceSupply.CheckTimers(); // No other way to tell we've died.
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 3);
|
||||
cmpTimer.OnUpdate({ "turnLength": 1 });
|
||||
TS_ASSERT_EQUALS(cmpResourceSupply.GetCurrentAmount(), 2);
|
||||
|
@ -25,7 +25,7 @@
|
||||
<Icon>gaia/fauna_boar.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>150</Amount>
|
||||
<Max>150</Max>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
<HeightOffset>3.0</HeightOffset>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<Icon>gaia/fauna_camel.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
<SoundGroups>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<Icon>gaia/fauna_cow.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
<MaxGatherers>5</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<Icon>gaia/fauna_sanga.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
<MaxGatherers>5</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<Icon>gaia/fauna_zebu.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
<MaxGatherers>5</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<Anchor>upright</Anchor>
|
||||
</Position>
|
||||
<ResourceSupply>
|
||||
<Amount>40</Amount>
|
||||
<Max>40</Max>
|
||||
<MaxGatherers>5</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<Icon>gaia/fauna_donkey.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
<SoundGroups>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<xp>75</xp>
|
||||
</Loot>
|
||||
<ResourceSupply>
|
||||
<Amount>800</Amount>
|
||||
<Max>800</Max>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
<HeightOffset>10.0</HeightOffset>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<xp>60</xp>
|
||||
</Loot>
|
||||
<ResourceSupply>
|
||||
<Amount>650</Amount>
|
||||
<Max>650</Max>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
<HeightOffset>8.0</HeightOffset>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<xp>50</xp>
|
||||
</Loot>
|
||||
<ResourceSupply>
|
||||
<Amount>500</Amount>
|
||||
<Max>500</Max>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
<HeightOffset>7.5</HeightOffset>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<Icon>gaia/fauna_giraffe.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>350</Amount>
|
||||
<Max>350</Max>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
<HeightOffset>14.0</HeightOffset>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<Icon>gaia/fauna_giraffe.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>150</Amount>
|
||||
<Max>150</Max>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
<HeightOffset>8.5</HeightOffset>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<Icon>gaia/fauna_goat.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>70</Amount>
|
||||
<Max>70</Max>
|
||||
<MaxGatherers>2</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
|
@ -26,7 +26,7 @@
|
||||
<xp>50</xp>
|
||||
</Loot>
|
||||
<ResourceSupply>
|
||||
<Amount>400</Amount>
|
||||
<Max>400</Max>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
<SoundGroups>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<Icon>gaia/fauna_horse.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
<SoundGroups>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<Icon>gaia/fauna_muskox.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
<HeightOffset>4.5</HeightOffset>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<Anchor>upright</Anchor>
|
||||
</Position>
|
||||
<ResourceSupply>
|
||||
<Amount>50</Amount>
|
||||
<Max>50</Max>
|
||||
<MaxGatherers>5</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<Icon>gaia/fauna_pig.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>150</Amount>
|
||||
<Max>150</Max>
|
||||
<MaxGatherers>4</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<GenericName>Piglet</GenericName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>10</Amount>
|
||||
<Max>10</Max>
|
||||
<MaxGatherers>1</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<BlockMovement>false</BlockMovement>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>50</Amount>
|
||||
<Max>50</Max>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
<HeightOffset>2.0</HeightOffset>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<Icon>gaia/fauna_rhino.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
<SoundGroups>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<Icon>gaia/fauna_sheep.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>100</Amount>
|
||||
<Max>100</Max>
|
||||
<MaxGatherers>3</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
|
@ -27,7 +27,7 @@
|
||||
<Icon>gaia/fauna_walrus.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
</ResourceSupply>
|
||||
<Selectable>
|
||||
<Overlay>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<Icon>gaia/fauna_wildebeest.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>150</Amount>
|
||||
<Max>150</Max>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
<HeightOffset>4.0</HeightOffset>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<Icon>gaia/fauna_zebra.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>150</Amount>
|
||||
<Max>150</Max>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
<HeightOffset>3.5</HeightOffset>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Apple</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>400</Amount>
|
||||
<Max>400</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/apple_bloom.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Banana</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>400</Amount>
|
||||
<Max>400</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/banana.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Berries</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>props/flora/berry_bush.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Berries</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>props/flora/berry_bush_02.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Berries</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>props/flora/berry_bush_03.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Berries</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>props/flora/berry_bush_autumn_01.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Berries</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>props/flora/bush_berries_large.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Date Palm</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>400</Amount>
|
||||
<Max>400</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/palm_date_new_fruit.xml</Actor>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<Static width="5.0" depth="5.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>500</Amount>
|
||||
<Max>500</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/fig.xml</Actor>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<Icon>gaia/flora_bush_grapes.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>props/flora/forage_grapes.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Olive</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>400</Amount>
|
||||
<Max>400</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/olive.xml</Actor>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<Icon>gaia/special_fence.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>500</Amount>
|
||||
<Max>500</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>props/special/eyecandy/column_doric_fallen.xml</Actor>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<Altitude>-2.0</Altitude>
|
||||
</Position>
|
||||
<ResourceSupply>
|
||||
<Amount>10000</Amount>
|
||||
<Max>10000</Max>
|
||||
<MaxGatherers>120</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<Static width="34.0" depth="34.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>5000</Amount>
|
||||
<Max>5000</Max>
|
||||
<MaxGatherers>90</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<Static width="2.0" depth="2.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>props/special/eyecandy/standing_stones.xml</Actor>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<Static width="3.5" depth="3.5"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
<SoundGroups>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<Static width="3.5" depth="3.5"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
<SoundGroups>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<Static width="3.5" depth="3.5"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
<SoundGroups>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<Static width="17.5" depth="30.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>2000</Amount>
|
||||
<Max>2000</Max>
|
||||
<MaxGatherers>30</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<StatusBars>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<Icon>gaia/special_treasure_food.png</Icon>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>100</Amount>
|
||||
<Max>100</Max>
|
||||
<Type>treasure.food</Type>
|
||||
</ResourceSupply>
|
||||
<Selectable replace="">
|
||||
|
@ -16,7 +16,7 @@
|
||||
<FloatDepth>0.0</FloatDepth>
|
||||
</Position>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
<Type>treasure.food</Type>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<Static width="2.0" depth="3.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
<Type>treasure.food</Type>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<Static width="1.75" depth="1.75"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
<Type>treasure.food</Type>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<Static width="6.5" depth="6.5"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
<Type>treasure.food</Type>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<Static width="8.0" depth="8.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>600</Amount>
|
||||
<Max>600</Max>
|
||||
<Type>treasure.food</Type>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<Static width="5.0" depth="5.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>400</Amount>
|
||||
<Max>400</Max>
|
||||
<Type>treasure.food</Type>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<SpecificName>Golden Fleece</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>1000</Amount>
|
||||
<Max>1000</Max>
|
||||
<Type>treasure.metal</Type>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<SpecificName>Secret Box</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
<Type>treasure.metal</Type>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<Static width="7.0" depth="7.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>500</Amount>
|
||||
<Max>500</Max>
|
||||
<Type>treasure.metal</Type>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<Static width="5.0" depth="3.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
<Type>treasure.metal</Type>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<SpecificName>Pegasus</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>1000</Amount>
|
||||
<Max>1000</Max>
|
||||
<Type>treasure.metal</Type>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<FloatDepth>0.0</FloatDepth>
|
||||
</Position>
|
||||
<ResourceSupply>
|
||||
<Amount>500</Amount>
|
||||
<Max>500</Max>
|
||||
<Type>treasure.wood</Type>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -18,7 +18,7 @@
|
||||
<FloatDepth>0.0</FloatDepth>
|
||||
</Position>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
<Type>treasure.food</Type>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<FloatDepth>0.0</FloatDepth>
|
||||
</Position>
|
||||
<ResourceSupply>
|
||||
<Amount>550</Amount>
|
||||
<Max>550</Max>
|
||||
<Type>treasure.wood</Type>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<FloatDepth>0.0</FloatDepth>
|
||||
</Position>
|
||||
<ResourceSupply>
|
||||
<Amount>400</Amount>
|
||||
<Max>400</Max>
|
||||
<Type>treasure.wood</Type>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<FloatDepth>0.0</FloatDepth>
|
||||
</Position>
|
||||
<ResourceSupply>
|
||||
<Amount>450</Amount>
|
||||
<Max>450</Max>
|
||||
<Type>treasure.wood</Type>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<Static width="2.0" depth="2.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
<Type>treasure.stone</Type>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<Static width="6.5" depth="6.5"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
<Type>treasure.stone</Type>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<Static width="3.5" depth="6.5"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
<Type>treasure.wood</Type>
|
||||
</ResourceSupply>
|
||||
<Sound>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Acacia</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/acacia.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Aleppo Pine</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/aleppo_pine.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Bamboo</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/bamboo.xml</Actor>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<Static width="6.0" depth="6.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>1000</Amount>
|
||||
<Max>1000</Max>
|
||||
<MaxGatherers>12</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Bamboo</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>100</Amount>
|
||||
<Max>100</Max>
|
||||
<MaxGatherers>1</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<Static width="6.0" depth="6.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>600</Amount>
|
||||
<Max>600</Max>
|
||||
<MaxGatherers>12</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<Static width="3.0" depth="3.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>400</Amount>
|
||||
<Max>400</Max>
|
||||
<MaxGatherers>9</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Baobab Sapling</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>50</Amount>
|
||||
<Max>50</Max>
|
||||
<MaxGatherers>2</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Young Baobab</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/baobab_new_young.xml</Actor>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<Static width="6.0" depth="6.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>600</Amount>
|
||||
<Max>600</Max>
|
||||
<MaxGatherers>12</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<Static width="6.0" depth="6.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>550</Amount>
|
||||
<Max>550</Max>
|
||||
<MaxGatherers>12</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Hardy Bush</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>75</Amount>
|
||||
<Max>75</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>props/flora/bush_tempe_a.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Bush</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>50</Amount>
|
||||
<Max>50</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/temperate_bush_biome.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Bush</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>50</Amount>
|
||||
<Max>50</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/temperate_bush_biome_winter.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Bush</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>50</Amount>
|
||||
<Max>50</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/tropic_bush_biome.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Carob</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/carob.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Atlas Cedar Sapling</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>50</Amount>
|
||||
<Max>50</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/cedar_atlas_sapling.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Atlas Cedar</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/cedar_atlas_young.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Atlas Cedar</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>350</Amount>
|
||||
<Max>350</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/cedar_atlas.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Atlas Cedar</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/cedar_atlas_dead.xml</Actor>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<Static width="4.0" depth="4.0"/>
|
||||
</Obstruction>
|
||||
<ResourceSupply>
|
||||
<Amount>300</Amount>
|
||||
<Max>300</Max>
|
||||
<MaxGatherers>12</MaxGatherers>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Cretan Date Palm</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>100</Amount>
|
||||
<Max>100</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/palm_cretan_date_short.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Cretan Date Palm</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/palm_cretan_date_tall.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Cypress</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/mediterranean_cypress.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Cypress</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/cypress_mediterranean_wild.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Cypress</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/cypress_mediterranean_windswept.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Date Palm</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/palm_date_new.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Date Palm</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/palm_date_dead.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Deciduous Tree</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/temperate_dead_forest.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Elm</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/elm.xml</Actor>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<SpecificName>Elm</SpecificName>
|
||||
</Identity>
|
||||
<ResourceSupply>
|
||||
<Amount>200</Amount>
|
||||
<Max>200</Max>
|
||||
</ResourceSupply>
|
||||
<VisualActor>
|
||||
<Actor>flora/trees/elm_dead.xml</Actor>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user