refactor: lock first
This commit is contained in:
parent
e814e80682
commit
21fb634e69
|
@ -283,6 +283,10 @@ export class Vulnerable extends Trait {
|
|||
const damageSpecs = entity.damageSpecs;
|
||||
for (let i = 0; i < damageSpecs.length; ++i) {
|
||||
const damageSpec = damageSpecs[i];
|
||||
if (this.locks.has(damageSpec)) {
|
||||
continue;
|
||||
}
|
||||
this.locks.set(damageSpec, damageSpec.lock);
|
||||
let power = damageSpec.power;
|
||||
// Check if vulnerable to this affinity.
|
||||
if (this.params.modifiers) {
|
||||
|
@ -290,10 +294,6 @@ export class Vulnerable extends Trait {
|
|||
power *= this.params.modifiers[damageSpec.affinity];
|
||||
}
|
||||
}
|
||||
if (this.locks.has(damageSpec)) {
|
||||
continue;
|
||||
}
|
||||
this.locks.set(damageSpec, damageSpec.lock);
|
||||
// Give any knockback.
|
||||
if (damageSpec.knockback) {
|
||||
if (
|
||||
|
|
Loading…
Reference in New Issue
Block a user