Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Treasure.js
Show All 15 Lines | "<element name='Resources' a:help='Amount of resources that are in this.'>" + | ||||
Resources.BuildSchema("positiveDecimal") + | Resources.BuildSchema("positiveDecimal") + | ||||
"</element>" + | "</element>" + | ||||
"</optional>"; | "</optional>"; | ||||
Treasure.prototype.Init = function() | Treasure.prototype.Init = function() | ||||
{ | { | ||||
}; | }; | ||||
Treasure.prototype.Update = function() { | |||||
warn("Treasure.Update is not implemented") | |||||
}; | |||||
Treasure.prototype.ComputeReward = function() | Treasure.prototype.ComputeReward = function() | ||||
{ | { | ||||
for (let resource in this.template.Resources) | for (let resource in this.template.Resources) | ||||
{ | { | ||||
let amount = ApplyValueModificationsToEntity("Treasure/Resources/" + resource, this.template.Resources[resource], this.entity); | let amount = ApplyValueModificationsToEntity("Treasure/Resources/" + resource, this.template.Resources[resource], this.entity); | ||||
if (!amount) | if (!amount) | ||||
continue; | continue; | ||||
if (!this.resources) | if (!this.resources) | ||||
▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator