proc-gen equipment drops from monsters can be picked up
[sketchy-heroes.git] / src / public / app / sections / overview.ts
index fcfe24075e92e091d5a93ca1da46843f43fd274e..b9b69534e48eacbeae932090a75e066e763855fb 100644 (file)
@@ -2,6 +2,7 @@ import {Player} from "@prisma/client";
 import $ from 'jquery';
 import {maxExp, maxHp, maxStamina} from "../../../formulas";
 import {progressBar} from "../components";
+import {hasStaminaAgain, outOfStamina} from "../dom";
 
 function renderStatText(id: string, value: number, incrementable: boolean) {
   $(`#${id} .text`).html(value.toString());
@@ -9,7 +10,7 @@ function renderStatText(id: string, value: number, incrementable: boolean) {
     $(`#${id} .stat-increase`).removeClass('hidden');
   }
   else {
-    //$(`#${id} .stat-increase`).addClass('hidden');
+    $(`#${id} .stat-increase`).addClass('hidden');
   }
 }
 
@@ -38,4 +39,11 @@ export function playerOverview(player: Player) {
   $('#exp .progress-bar-wrapper').html(progressBar(player.exp, maxExp(player.level), {
     color: 'info'
   }));
+
+  if(player.stamina <= 0) {
+    outOfStamina();
+  }
+  else {
+    hasStaminaAgain();
+  }
 }