Skip to content

Commit 53b02a5

Browse files
authored
FIX: Do not get Vivid Dream bonus when already rested, cook only once + add animation
1 parent 0ddb375 commit 53b02a5

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

js/game_loop.js

+19-13
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ var luckInterval = 30; //Lower to increase chances
5959
var playerInt;
6060
var playerAtk;
6161
var playerRested = false;
62+
var playerCooked = false;
6263
var seenLoot;
6364

6465
var playerKarma=1; //Does not reset during the session
@@ -1356,16 +1357,20 @@ function resolveAction(button){ //Yeah, this is bad, like really bad
13561357

13571358
case "Consumable":
13581359
case "Consumable-Container":
1359-
if (enemyHp<0){
1360-
logPlayerAction(actionString,"Cooked it with a spell -1 🔵");
1361-
enemyHp=0;
1362-
enemyMsg="Actually tasted good";
1363-
} else {
1364-
logPlayerAction(actionString,"Roasted a crunchy crust -1 🔵");
1365-
enemySta=parseInt(enemySta)+1;
1366-
enemyMsg="Tasted better than usual";
1360+
if (!playerCooked) {
1361+
if (enemyHp<0){
1362+
logPlayerAction(actionString,"Cooked it with a spell -1 🔵");
1363+
enemyHp=0;
1364+
enemyMsg="Actually tasted good";
1365+
} else {
1366+
logPlayerAction(actionString,"Roasted a crunchy crust -1 🔵");
1367+
enemySta=parseInt(enemySta)+1;
1368+
enemyMsg="Tasted better than usual";
1369+
}
1370+
playerCooked=true;
1371+
displayEnemyEffect("🔥");
1372+
animateUIElement(enemyInfoUIElement,"animate__pulse","0.4"); //Animate cooking
13671373
}
1368-
displayEnemyEffect("🔥");
13691374
break;
13701375

13711376
case "Dream":
@@ -2294,6 +2299,7 @@ function nextEncounter(animateArea=true){ //Note: Even generator encounters go t
22942299
encounterIndex = getNextEncounterIndex();
22952300

22962301
playerRested=false;
2302+
playerCooked=false;
22972303
enemyRenew();
22982304
loadEncounter(encounterIndex);
22992305

@@ -2338,14 +2344,14 @@ function playerRest(){
23382344
logPlayerAction(actionString,"Wasted a precious moment of life.");
23392345
displayPlayerEffect("💤");
23402346
}
2347+
if (procAbilityChance("🔮",33)){
2348+
logAction("🔮 ▸ <b>👁️ Vivid Dream</b> provided bonus +1 🔵")
2349+
playerMgk++;
2350+
}
23412351
} else {
23422352
logPlayerAction(actionString,"Already rested at this spot.");
23432353
displayPlayerCannotEffect();
23442354
}
2345-
if (procAbilityChance("🔮",33)){
2346-
logAction("🔮 ▸ <b>👁️ Vivid Dream</b> provided bonus +1 🔵")
2347-
playerMgk++;
2348-
}
23492355
}
23502356

23512357
function playerHeal(){

0 commit comments

Comments
 (0)