Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/globalscripts/DamageTypes.js
function DamageTypes() | function DamageTypes() | ||||
{ | { | ||||
// TODO: load these from files | // TODO: load these from files | ||||
this.names = { | this.types = { | ||||
"Hack": markForTranslationWithContext("damage type", "Hack"), | "Hack": { "name": markForTranslationWithContext("damage type", "Hack"), "receiveComponent": "health" }, | ||||
"Pierce": markForTranslationWithContext("damage type", "Pierce"), | "Pierce": { "name": markForTranslationWithContext("damage type", "Pierce"), "receiveComponent": "health" }, | ||||
"Crush": markForTranslationWithContext("damage type", "Crush"), | "Crush": { "name": markForTranslationWithContext("damage type", "Crush"), "receiveComponent": "health" }, | ||||
"Capture": { "name": markForTranslationWithContext("damage type", "Capture"),"receiveComponent": "capturable" } | |||||
}; | }; | ||||
deepfreeze(this.names); | this.names = {}; | ||||
for (let type in this.types) | |||||
this.names[type] = this.types[type].name; | |||||
deepfreeze(this.types); | |||||
deepfreeze(this.names) | |||||
} | } | ||||
DamageTypes.prototype.GetNames = function() | DamageTypes.prototype.GetNames = function() | ||||
{ | { | ||||
return this.names; | return this.names; | ||||
}; | }; | ||||
DamageTypes.prototype.GetTypes = function() | DamageTypes.prototype.GetTypes = function() | ||||
{ | { | ||||
return Object.keys(this.names); | return Object.keys(this.types); | ||||
}; | }; |
Wildfire Games · Phabricator