Skip to content

Commit

Permalink
Commit actual hunger messages...
Browse files Browse the repository at this point in the history
  • Loading branch information
caligari87 committed Jun 20, 2018
1 parent 761b28d commit a5b9330
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions zscript.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,21 @@ class HDScav_HungerTracker : CustomInventory {
statusMessage = "";
if(calories >= 500 && calories < 1000) { statusMessage = "Your stomach grumbles. "; }
else if(calories >= 0 && calories < 500) { statusMessage = "Your stomach aches. "; }
//Delta since last meal
//Fatigue status message
if(minfatigue >= 15 && minfatigue < 20) { statusMessage = statusMessage.."You feel weak. ";
if(minfatigue >= 20) { statusMessage = statusMessage.."You're getting shaky. ";
//Last meal messages
int mealdelta = (lastmeal - calories);
if(mealdelta >= 500 && mealdelta <1000) { statusMessage = statusMessage.."Time for another meal?"; }
else if(mealdelta >= 1000 && mealdelta <1500) { statusMessage = statusMessage.."It's been a while since you ate. "; }
else if(mealdelta >= 1500 && mealdelta <2000) { statusMessage = statusMessage.."When did you last eat? "; }
else if(mealdelta >= 2000 && mealdelta <2500) { statusMessage = statusMessage.."You can't remember your last meal... "; }
//Reset delta if meal eaten
if(calories > lastcalories) {
lastmeal = calories;
lastcalories = calories;
}
if(lastmeal - calories >= 500 && lastmeal - calories <1000) { statusMessage = statusMessage.."Time for another meal?"; }
else if(lastmeal - calories >= 1000 && lastmeal - calories <1500) { statusMessage = statusMessage.."It's been a while since you ate. "; }
else if(lastmeal - calories >= 1500 && lastmeal - calories <2000) { statusMessage = statusMessage.."When did you last eat? "; }
else if(lastmeal - calories >= 2000 && lastmeal - calories <2500) { statusMessage = statusMessage.."You can't remember your last meal... "; }
//Display if delta calories over threshold
//Display if delta over threshold, and reset
if(abs(lastcalories - calories) >= 500) {
A_Log(statusMessage);
lastcalories = calories;
Expand Down

0 comments on commit a5b9330

Please sign in to comment.