X-Git-Url: https://git.xangelo.ca/?p=sketchy-heroes.git;a=blobdiff_plain;f=src%2Fpublic%2Fapp%2Fsections%2Foverview.ts;fp=src%2Fpublic%2Fapp%2Fsections%2Foverview.ts;h=b9b69534e48eacbeae932090a75e066e763855fb;hp=b80ab9c53366199bff23c458c8dca8d7a1937328;hb=b5d3cc37fddebff8dcdf1ef0cdd3a626811f14d3;hpb=20dc560a75cfd6ddc8a66956315a30001779ec24 diff --git a/src/public/app/sections/overview.ts b/src/public/app/sections/overview.ts index b80ab9c..b9b6953 100644 --- a/src/public/app/sections/overview.ts +++ b/src/public/app/sections/overview.ts @@ -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()); @@ -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(); + } }