Explorar el Código

Prevent vigors from going over their max values

master
Fen Dweller hace 5 años
padre
commit
f88a76113e
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. +7
    -0
      src/game/entity.ts

+ 7
- 0
src/game/entity.ts Ver fichero

@@ -111,6 +111,13 @@ export abstract class Mortal extends Entity {
}
})

Object.keys(Vigor).forEach(vigorStr => {
const vigor = vigorStr as Vigor
if (this.vigors[vigor] > this.maxVigors[vigor]) {
this.vigors[vigor] = this.maxVigors[vigor]
}
})

if (this.vigors.Health <= -this.maxVigors.Health) {
this.destroyed = true
}


Cargando…
Cancelar
Guardar