Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Player.js
Show First 20 Lines • Show All 850 Lines • ▼ Show 20 Lines | |||||
Player.prototype.OnDiplomacyChanged = function() | Player.prototype.OnDiplomacyChanged = function() | ||||
{ | { | ||||
this.UpdateSharedLos(); | this.UpdateSharedLos(); | ||||
}; | }; | ||||
Player.prototype.OnValueModification = function(msg) | Player.prototype.OnValueModification = function(msg) | ||||
{ | { | ||||
if (msg.component != "Player") | |||||
return; | |||||
if (msg.valueNames.indexOf("Player/SpyCostMultiplier") != -1) | if (msg.valueNames.indexOf("Player/SpyCostMultiplier") != -1) | ||||
this.spyCostMultiplier = ApplyValueModificationsToEntity("Player/SpyCostMultiplier", +this.template.SpyCostMultiplier, this.entity); | this.spyCostMultiplier = ApplyValueModificationsToEntity("Player/SpyCostMultiplier", +this.template.SpyCostMultiplier, this.entity); | ||||
if (msg.valueNames.some(mod => mod.startsWith("Player/BarterMultiplier/"))) | if (msg.valueNames.some(mod => mod.startsWith("Player/BarterMultiplier/"))) | ||||
for (let res in this.template.BarterMultiplier.Buy) | for (let res in this.template.BarterMultiplier.Buy) | ||||
{ | { | ||||
this.barterMultiplier.buy[res] = ApplyValueModificationsToEntity("Player/BarterMultiplier/Buy/"+res, +this.template.BarterMultiplier.Buy[res], this.entity); | this.barterMultiplier.buy[res] = ApplyValueModificationsToEntity("Player/BarterMultiplier/Buy/"+res, +this.template.BarterMultiplier.Buy[res], this.entity); | ||||
this.barterMultiplier.sell[res] = ApplyValueModificationsToEntity("Player/BarterMultiplier/Sell/"+res, +this.template.BarterMultiplier.Sell[res], this.entity); | this.barterMultiplier.sell[res] = ApplyValueModificationsToEntity("Player/BarterMultiplier/Sell/"+res, +this.template.BarterMultiplier.Sell[res], this.entity); | ||||
▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator