refactor: raw JS params
This commit is contained in:
parent
dd1000e485
commit
4b7bce35ab
|
@ -58,10 +58,10 @@ export class Alive extends decorate(Trait) {
|
|||
initialize() {
|
||||
this._context = createContext();
|
||||
this._context.add('entity', this.entity);
|
||||
const actionsJSON = this.params.get('deathActions').toJS();
|
||||
const actionsJSON = this.params.deathActions;
|
||||
this._deathActions = behaviorItemFromJSON(actionsJSON);
|
||||
this._deathSound = this.params.get('deathSound');
|
||||
const conditionJSON = this.params.get('deathCondition').toJS();
|
||||
this._deathSound = this.params.deathSound;
|
||||
const conditionJSON = this.params.deathCondition;
|
||||
this._deathCondition = behaviorItemFromJSON(conditionJSON);
|
||||
this._isDying = false;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ export class Damaging extends Trait {
|
|||
|
||||
initialize() {
|
||||
this._collidingWith = [];
|
||||
const damageSpecsJSON = this.params.get('damageSpecs').toJS();
|
||||
const damageSpecsJSON = this.params.damageSpecs;
|
||||
this._damageSpecs = damageSpecsJSON.map((damageSpec) => {
|
||||
return {
|
||||
affinity: AFFINITY_PHYSICAL,
|
||||
|
@ -25,7 +25,7 @@ export class Damaging extends Trait {
|
|||
...damageSpec,
|
||||
};
|
||||
});
|
||||
this._damagingSound = this.params.get('damagingSound');
|
||||
this._damagingSound = this.params.damagingSound;
|
||||
}
|
||||
|
||||
get damageSpecs() {
|
||||
|
|
|
@ -41,7 +41,7 @@ export class Vulnerable extends Trait {
|
|||
this._isHydrating = false;
|
||||
this._isInvulnerable = false;
|
||||
this.locks = new Map();
|
||||
const tookDamageActionsJSON = this.params.get('tookDamageActions').toJS();
|
||||
const tookDamageActionsJSON = this.params.tookDamageActions;
|
||||
this._tookDamageActions = behaviorItemFromJSON(tookDamageActionsJSON);
|
||||
this.tookDamageActionsList = [];
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ export class Darkened extends Trait {
|
|||
}
|
||||
|
||||
initialize() {
|
||||
this._isDarkened = this.params.get('isDarkened');
|
||||
this._isDarkened = this.params.isDarkened;
|
||||
}
|
||||
|
||||
get isDarkened() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user