Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/Promotion.js
Show First 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | while (true) | ||||
// 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); | ||||
} | } | ||||
Engine.PostMessage(this.entity, MT_ExperienceChanged, {}); | |||||
}; | }; | ||||
Promotion.prototype.OnValueModification = function(msg) | Promotion.prototype.OnValueModification = function(msg) | ||||
{ | { | ||||
if (msg.component == "Promotion") | if (msg.component == "Promotion") | ||||
this.IncreaseXp(0); | this.IncreaseXp(0); | ||||
}; | }; | ||||
Engine.RegisterComponentType(IID_Promotion, "Promotion", Promotion); | Engine.RegisterComponentType(IID_Promotion, "Promotion", Promotion); |
Wildfire Games · Phabricator