mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 01:32:55 +02:00
Various bugfixes
This commit is contained in:
@@ -1690,6 +1690,11 @@ PlayerObject.prototype.singularityStopWork = function() {
|
||||
|
||||
//Returns true if hospitalized, false otherwise
|
||||
PlayerObject.prototype.takeDamage = function(amt) {
|
||||
if (typeof amt !== "number") {
|
||||
console.warn(`Player.takeDamage() called without a numeric argument: ${amt}`);
|
||||
return;
|
||||
}
|
||||
|
||||
this.hp -= amt;
|
||||
if (this.hp <= 0) {
|
||||
this.hospitalize();
|
||||
@@ -1699,6 +1704,15 @@ PlayerObject.prototype.takeDamage = function(amt) {
|
||||
}
|
||||
}
|
||||
|
||||
PlayerObject.prototype.regenerateHp = function(amt) {
|
||||
if (typeof amt !== "number") {
|
||||
console.warn(`Player.regenerateHp() called without a numeric argument: ${amt}`);
|
||||
return;
|
||||
}
|
||||
this.hp += amt;
|
||||
if (this.hp > this.max_hp) { this.hp = this.max_hp; }
|
||||
}
|
||||
|
||||
PlayerObject.prototype.hospitalize = function() {
|
||||
if (Settings.SuppressHospitalizationPopup === false) {
|
||||
dialogBoxCreate(
|
||||
|
||||
Reference in New Issue
Block a user