Infiltration can no longer be done programmatically. HP is reset when prestiging

This commit is contained in:
danielyxie
2018-07-07 19:16:58 -05:00
parent f33bc59768
commit fde2b8cbc1
4 changed files with 89 additions and 35 deletions

View File

@@ -157,7 +157,8 @@ function nextInfiltrationLevel(inst) {
case 3:
scenario = InfiltrationScenarios.Bots;
killButton.style.display = "block";
killButton.addEventListener("click", function() {
killButton.addEventListener("click", function(e) {
if (!e.isTrusted) {return false;}
var res = attemptInfiltrationKill(inst);
if (res[0]) {
writeInfiltrationStatusText("You SUCCESSFULLY killed the security bots! Unfortunately you alerted the " +
@@ -180,7 +181,8 @@ function nextInfiltrationLevel(inst) {
updateInfiltrationLevelText(inst);
});
assassinateButton.style.display = "block";
assassinateButton.addEventListener("click", function() {
assassinateButton.addEventListener("click", function(e) {
if (!e.isTrusted) {return false;}
var res = attemptInfiltrationAssassinate(inst);
if (res[0]) {
writeInfiltrationStatusText("You SUCCESSFULLY assassinated the security bots without being detected!");
@@ -202,7 +204,8 @@ function nextInfiltrationLevel(inst) {
default: //0, 4-5
scenario = InfiltrationScenarios.Guards;
killButton.style.display = "block";
killButton.addEventListener("click", function() {
killButton.addEventListener("click", function(e) {
if (!e.isTrusted) {return false;}
var res = attemptInfiltrationKill(inst);
if (res[0]) {
writeInfiltrationStatusText("You SUCCESSFULLY killed the security guard! Unfortunately you alerted the " +
@@ -228,7 +231,8 @@ function nextInfiltrationLevel(inst) {
knockoutButton.style.display = "block";
stealthKnockoutButton.style.display = "block";
assassinateButton.style.display = "block";
assassinateButton.addEventListener("click", function() {
assassinateButton.addEventListener("click", function(e) {
if (!e.isTrusted) {return false;}
var res = attemptInfiltrationAssassinate(inst);
if (res[0]) {
writeInfiltrationStatusText("You SUCCESSFULLY assassinated the security guard without being detected!");
@@ -250,7 +254,8 @@ function nextInfiltrationLevel(inst) {
break;
}
knockoutButton.addEventListener("click", function() {
knockoutButton.addEventListener("click", function(e) {
if (!e.isTrusted) {return false;}
var res = attemptInfiltrationKnockout(inst);
if (res[0]) {
writeInfiltrationStatusText("You SUCCESSFULLY knocked out the security guard! " +
@@ -272,7 +277,8 @@ function nextInfiltrationLevel(inst) {
return false;
});
stealthKnockoutButton.addEventListener("click", function() {
stealthKnockoutButton.addEventListener("click", function(e) {
if (!e.isTrusted) {return false;}
var res = attemptInfiltrationStealthKnockout(inst);
if (res[0]) {
writeInfiltrationStatusText("You SUCCESSFULLY knocked out the security guard without making " +
@@ -293,7 +299,8 @@ function nextInfiltrationLevel(inst) {
return false;
});
hackSecurityButton.addEventListener("click", function() {
hackSecurityButton.addEventListener("click", function(e) {
if (!e.isTrusted) {return false;}
var res = attemptInfiltrationHack(inst);
if (res[0]) {
writeInfiltrationStatusText("You SUCCESSFULLY hacked and disabled the security system!");
@@ -309,7 +316,8 @@ function nextInfiltrationLevel(inst) {
return false;
});
destroySecurityButton.addEventListener("click", function() {
destroySecurityButton.addEventListener("click", function(e) {
if (!e.isTrusted) {return false;}
var res = attemptInfiltrationDestroySecurity(inst);
if (res[0]) {
writeInfiltrationStatusText("You SUCCESSFULLY and violently destroy the security system!");
@@ -325,7 +333,8 @@ function nextInfiltrationLevel(inst) {
return false;
});
sneakButton.addEventListener("click", function() {
sneakButton.addEventListener("click", function(e) {
if (!e.isTrusted) {return false;}
var res = attemptInfiltrationSneak(inst);
if (res[0]) {
writeInfiltrationStatusText("You SUCCESSFULLY sneak past the security undetected!");
@@ -340,7 +349,8 @@ function nextInfiltrationLevel(inst) {
return false;
});
pickdoorButton.addEventListener("click", function() {
pickdoorButton.addEventListener("click", function(e) {
if (!e.isTrusted) {return false;}
var res = attemptInfiltrationPickLockedDoor(inst);
if (res[0]) {
writeInfiltrationStatusText("You SUCCESSFULLY pick the locked door!");
@@ -356,7 +366,8 @@ function nextInfiltrationLevel(inst) {
return false;
});
bribeButton.addEventListener("click", function() {
bribeButton.addEventListener("click", function(e) {
if (!e.isTrusted) {return false;}
var bribeAmt = CONSTANTS.InfiltrationBribeBaseAmount * inst.clearanceLevel;
if (Player.money.lt(bribeAmt)) {
writeInfiltrationStatusText("You do not have enough money to bribe the guard. " +
@@ -380,7 +391,8 @@ function nextInfiltrationLevel(inst) {
return false;
});
escapeButton.addEventListener("click", function() {
escapeButton.addEventListener("click", function(e) {
if (!e.isTrusted) {return false;}
var res = attemptInfiltrationEscape(inst);
if (res[0]) {
writeInfiltrationStatusText("You SUCCESSFULLY escape from the facility with the stolen classified " +

View File

@@ -300,6 +300,10 @@ PlayerObject.prototype.prestigeAugmentation = function() {
this.hacknetNodes.length = 0;
this.totalHacknetNodeProduction = 0;
//Re-calculate skills and reset HP
this.updateSkillLevels();
this.hp = this.max_hp;
}
PlayerObject.prototype.prestigeSourceFile = function() {
@@ -393,6 +397,9 @@ PlayerObject.prototype.prestigeSourceFile = function() {
this.playtimeSinceLastAug = 0;
this.playtimeSinceLastBitnode = 0;
this.scriptProdSinceLastAug = 0;
this.updateSkillLevels();
this.hp = this.max_hp;
}
PlayerObject.prototype.getCurrentServer = function() {
@@ -2357,7 +2364,7 @@ PlayerObject.prototype.queueAugmentation = function(name) {
return;
}
}
this.firstAugPurchased = true;
this.queuedAugmentations.push(new PlayerOwnedAugmentation(name));
}