Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/Promotion.js
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | while (true) | ||||
requiredXp = ApplyValueModificationsToTemplate("Promotion/RequiredXp", +template.Promotion.RequiredXp, playerID, template); | requiredXp = ApplyValueModificationsToTemplate("Promotion/RequiredXp", +template.Promotion.RequiredXp, playerID, template); | ||||
// compare the current xp to the required xp of the promoted entity | // compare the current xp to the required xp of the promoted entity | ||||
if (this.currentXp < requiredXp) | if (this.currentXp < requiredXp) | ||||
break; | break; | ||||
this.currentXp -= requiredXp; | this.currentXp -= requiredXp; | ||||
promotedTemplateName = template.Promotion.Entity; | promotedTemplateName = template.Promotion.Entity; | ||||
} | } | ||||
this.Promote(promotedTemplateName); | this.Promote(promotedTemplateName); | ||||
let cmpPromotion = Engine.QueryInterface(this.promotedUnitEntity, IID_Promotion); | |||||
if (cmpPromotion) | |||||
cmpPromotion.IncreaseXp(this.currentXp); | |||||
} | } | ||||
Engine.PostMessage(this.entity, MT_ExperienceChanged, {}); | Engine.PostMessage(this.entity, MT_ExperienceChanged, {}); | ||||
}; | }; | ||||
Promotion.prototype.ComputeTrickleRate = function() | Promotion.prototype.ComputeTrickleRate = function() | ||||
{ | { | ||||
this.trickleRate = ApplyValueModificationsToEntity("Promotion/TrickleRate", +(this.template.TrickleRate || 0), this.entity); | this.trickleRate = ApplyValueModificationsToEntity("Promotion/TrickleRate", +(this.template.TrickleRate || 0), this.entity); | ||||
Show All 38 Lines |
Wildfire Games · Phabricator