diff --git a/game/03-JavaScript/EventDebug.js b/game/03-JavaScript/EventDebug.js index 3c172095d2f93224bd698e62c764e07a113e521c..aae0d6c9d941b582a0f1e06362148712899e8d7a 100644 --- a/game/03-JavaScript/EventDebug.js +++ b/game/03-JavaScript/EventDebug.js @@ -48,23 +48,23 @@ class EventData { } get(index) { - return V.event?.buffer.find(e => e.slot === index); + return V.event ? V.event.buffer.find(e => e.slot === index) : -1; } has(index) { - return V.event?.buffer.some(e => e.slot === index); + return V.event ? V.event.buffer.some(e => e.slot === index) : false; } getEvery(index) { - return V.event?.buffer.filter(e => e.slot === index) ?? []; + return V.event ? V.event.buffer.filter(e => e.slot === index) : []; } count() { - return V.event?.buffer.length || 0; + return V.event ? V.event.buffer.length : 0; } any() { - return V.event?.buffer.length > 0; + return V.event ? V.event.buffer.length > 0 : false; } clear() { @@ -73,7 +73,7 @@ class EventData { } isSlotTaken(index) { - return V.event?.buffer.some(e => e.slot === index); + return V.event ? V.event.buffer.some(e => e.slot === index) : false; } get Disable() { @@ -124,11 +124,7 @@ class EventData { continue; } else if (V.debugdisable === "f" || V.debug) { // NPC position is being used more than once, although not a gap, flag. - console.warn( - "NPC slot", - element.slot, - "is being used more than once. Existing NPCs should be disposed before using their slot." - ); + console.warn("NPC slot", element.slot, "is being used more than once. Existing NPCs should be disposed before using their slot."); return false; } } diff --git a/game/base-system/mobileStats.twee b/game/base-system/mobileStats.twee index 035a5457f61c3c1abb960727e347a28aa0da6fff..bd00889728673e2c0a0536ca90b9906106fb12f0 100644 --- a/game/base-system/mobileStats.twee +++ b/game/base-system/mobileStats.twee @@ -1,67 +1,69 @@ :: mobileStats [widget] <<widget "mobileStats">> - <<if $options.sidebarStats is "all" or $pain gt 50>> + <<if Number.isFinite($pain) and ($options.sidebarStats is "all" or $pain gt 50)>> <<mobileStatsColor "pain">> <div @class="'stat ' + _mobileColor"> - <mouse class="tooltip-centertop">P<span>Pain: <<print $pain?.toFixed(2)>></span></mouse> + <mouse class="tooltip-centertop">P<span>Pain: <<print $pain.toFixed(2)>></span></mouse> </div> <</if>> - <<if $options.sidebarStats is "all" or $arousal gt $arousalmax / 2>> + <<if Number.isFinite($arousal) and ($options.sidebarStats is "all" or $arousal gt $arousalmax / 2)>> <<mobileStatsColor "arousal">> <div @class="'stat ' + _mobileColor"> - <mouse class="tooltip-centertop">Ar<span>Arousal: <<print $arousal?.toFixed(2)>></span></mouse> + <mouse class="tooltip-centertop">Ar<span>Arousal: <<print $arousal.toFixed(2)>></span></mouse> </div> <</if>> - <<if $options.sidebarStats is "all" or $tiredness gt C.tiredness.max / 2>> + <<if Number.isFinite($tiredness) and ($options.sidebarStats is "all" or $tiredness gt C.tiredness.max / 2)>> <<mobileStatsColor "fatigue">> <div @class="'stat ' + _mobileColor"> - <mouse class="tooltip-centertop">F<span>Fatigue: <<print $tiredness?.toFixed(2)>></span></mouse> + <mouse class="tooltip-centertop">F<span>Fatigue: <<print $tiredness.toFixed(2)>></span></mouse> </div> <</if>> - <<if $options.sidebarStats is "all" or $stress gt $stressmax / 2>> + <<if Number.isFinite($stress) and ($options.sidebarStats is "all" or $stress gt $stressmax / 2)>> <<mobileStatsColor "stress">> <div @class="'stat ' + _mobileColor"> - <mouse class="tooltip-centertop">S<span>Stress: <<print $stress?.toFixed(2)>></span></mouse> + <mouse class="tooltip-centertop">S<span>Stress: <<print $stress.toFixed(2)>></span></mouse> </div> <</if>> - <<if $innocencestate is 1 and ($options.sidebarStats is "all" or $awareness gt -100)>> + <<if Number.isFinite($innocencestate) or $innocencestate is 1 and ($options.sidebarStats is "all" or $awareness gt -100)>> <<mobileStatsColor "innocence">> <div @class="'stat ' + _mobileColor"> - <mouse class="tooltip-centertop">I<span>Innocence: <<print $innocencestate?.toFixed(2)>></span></mouse> + <mouse class="tooltip-centertop">I<span>Innocence: <<print $innocencestate.toFixed(2)>></span></mouse> </div> - <<elseif $options.sidebarStats is "all" or $trauma gt $traumamax / 2>> + <<elseif Number.isFinite(trauma) and ($options.sidebarStats is "all" or $trauma gt $traumamax / 2)>> <<mobileStatsColor "trauma">> <div @class="'stat ' + _mobileColor"> - <mouse class="tooltip-centertop">T<span>Trauma: <<print $trauma?.toFixed(2)>></span></mouse> + <mouse class="tooltip-centertop">T<span>Trauma: <<print $trauma.toFixed(2)>></span></mouse> </div> <</if>> - <<if $options.sidebarStats is "all" or $control gt $controlmax / 2>> + <<if Number.isFinite($control) and ($options.sidebarStats is "all" or $control gt $controlmax / 2)>> <<mobileStatsColor "control">> <div @class="'stat ' + _mobileColor"> - <mouse class="tooltip-centertop">C<span>Control: <<print $control?.toFixed(2)>></span></mouse> + <mouse class="tooltip-centertop">C<span>Control: <<print $control.toFixed(2)>></span></mouse> </div> <</if>> <<mobileStatsColor "allure">> - <div @class="'stat ' + _mobileColor"> - <mouse class="tooltip-centertop">AL<span>Allure: <<print $allure?.toFixed(2)>></span></mouse> - </div> - <<if $drunk gt 0>> + <<if Number.isFinite($allure)>> + <div @class="'stat ' + _mobileColor"> + <mouse class="tooltip-centertop">AL<span>Allure: <<print $allure.toFixed(2)>></span></mouse> + </div> + <</if>> + <<if Number.isFinite($drunk) and $drunk gt 0>> <<mobileStatsColor "drunk">> <div @class="'stat ' + _mobileColor"> - <mouse class="tooltip-centertop">DK<span>Drunk: <<print $drunk?.toFixed(2)>></span></mouse> + <mouse class="tooltip-centertop">DK<span>Drunk: <<print $drunk.toFixed(2)>></span></mouse> </div> <</if>> - <<if $drugged gt 0>> + <<if Number.isFinite($drugged) and $drugged gt 0>> <<mobileStatsColor "drugged">> <div @class="'stat ' + _mobileColor"> - <mouse class="tooltip-centertop">DG<span>Drugged: <<print $drugged?.toFixed(2)>></span></mouse> + <mouse class="tooltip-centertop">DG<span>Drugged: <<print $drugged.toFixed(2)>></span></mouse> </div> <</if>> - <<if $hallucinogen gt 0>> + <<if Number.isFinite($hallucinogen) and $hallucinogen gt 0>> <<mobileStatsColor "hallucinogen">> <div @class="'stat ' + _mobileColor"> - <mouse class="tooltip-centertop">H<span>Hallucinogen: $hallucinogen?.toFixed(2)</span></mouse> + <mouse class="tooltip-centertop">H<span>Hallucinogen: $hallucinogen.toFixed(2)</span></mouse> </div> <</if>> <</widget>> diff --git a/game/base-system/widgets.twee b/game/base-system/widgets.twee index 34ad5a95ced21723349570d5a2b248cc9153f2a4..c5acfdea4dc6a46659299a3cb68d470d08c6fdf7 100644 --- a/game/base-system/widgets.twee +++ b/game/base-system/widgets.twee @@ -1122,37 +1122,39 @@ <</widget>> <<widget "tirednesscaption">> - <div id="tirednesscaption" @title="'Fatigue: ' + $tiredness?.toFixed(2)"> - <div @class="($options.showCaptionText is true ? '' : 'rightMeterText')"> - Fatigue: - <<if $options.showCaptionText is true>> - <<if $tiredness gte C.tiredness.max>> - <span class="red">You are exhausted.</span> - <<elseif $tiredness gte (C.tiredness.max / 5) * 4>> - <span class="pink">You are fatigued.</span> - <<elseif $tiredness gte (C.tiredness.max / 5) * 3>> - <span class="purple">You are tired.</span> - <<elseif $tiredness gte (C.tiredness.max / 5) * 2>> - <span class="blue">You are wearied.</span> - <<elseif $tiredness gte C.tiredness.max / 5>> - <span class="lblue">You are alert.</span> - <<elseif $tiredness gte 1>> - <span class="teal">You are wide awake.</span> - <<else>> - <span class="green">You are refreshed.</span> + <<if Number.isFinite($tiredness)>> + <div id="tirednesscaption" @title="'Fatigue: ' + $tiredness.toFixed(2)"> + <div @class="($options.showCaptionText is true ? '' : 'rightMeterText')"> + Fatigue: + <<if $options.showCaptionText is true>> + <<if $tiredness gte C.tiredness.max>> + <span class="red">You are exhausted.</span> + <<elseif $tiredness gte (C.tiredness.max / 5) * 4>> + <span class="pink">You are fatigued.</span> + <<elseif $tiredness gte (C.tiredness.max / 5) * 3>> + <span class="purple">You are tired.</span> + <<elseif $tiredness gte (C.tiredness.max / 5) * 2>> + <span class="blue">You are wearied.</span> + <<elseif $tiredness gte C.tiredness.max / 5>> + <span class="lblue">You are alert.</span> + <<elseif $tiredness gte 1>> + <span class="teal">You are wide awake.</span> + <<else>> + <span class="green">You are refreshed.</span> + <</if>> <</if>> - <</if>> - </div> + </div> - <<if $tiredness gte C.tiredness.max>> - <<set $stress += (($tiredness - C.tiredness.max) * 16)>><<set $trauma += (($tiredness - C.tiredness.max) / 3)>> - <</if>> + <<if $tiredness gte C.tiredness.max>> + <<set $stress += (($tiredness - C.tiredness.max) * 16)>><<set $trauma += (($tiredness - C.tiredness.max) / 3)>> + <</if>> - <<set $tiredness = Math.clamp($tiredness, 0, C.tiredness.max)>> - <<set _showCaptionText to !$options.showCaptionText>> - <<statbar $tiredness `C.tiredness.max` _showCaptionText>> - <div style="clear:both;"></div> - </div> + <<set $tiredness = Math.clamp($tiredness, 0, C.tiredness.max)>> + <<set _showCaptionText to !$options.showCaptionText>> + <<statbar $tiredness `C.tiredness.max` _showCaptionText>> + <div style="clear:both;"></div> + </div> + <</if>> <</widget>> <<widget "hygiene">> @@ -1174,60 +1176,64 @@ <</widget>> <<widget "stresscaption">> - <div id="stresscaption" @title="'Stress: ' + $stress?.toFixed(2)"> - <div @class="($options.showCaptionText is true ? '' : 'rightMeterText')"> - Stress: - <<if $options.showCaptionText is true>> - <<if $stress gte $stressmax>> - <span class="red">You are overwhelmed!</span> - <<elseif $stress gte ($stressmax / 5) * 4>> - <span class="pink">You are distressed.</span> - <<elseif $stress gte ($stressmax / 5) * 3>> - <span class="purple">You are strained.</span> - <<elseif $stress gte ($stressmax / 5) * 2>> - <span class="blue">You are tense.</span> - <<elseif $stress gte $stressmax / 5>> - <span class="lblue">You are calm.</span> - <<elseif $stress gte 1>> - <span class="teal">You are placid.</span> - <<else>> - <span class="green">You are serene.</span> + <<if Number.isFinite($stress)>> + <div id="stresscaption" @title="'Stress: ' + $stress.toFixed(2)"> + <div @class="($options.showCaptionText is true ? '' : 'rightMeterText')"> + Stress: + <<if $options.showCaptionText is true>> + <<if $stress gte $stressmax>> + <span class="red">You are overwhelmed!</span> + <<elseif $stress gte ($stressmax / 5) * 4>> + <span class="pink">You are distressed.</span> + <<elseif $stress gte ($stressmax / 5) * 3>> + <span class="purple">You are strained.</span> + <<elseif $stress gte ($stressmax / 5) * 2>> + <span class="blue">You are tense.</span> + <<elseif $stress gte $stressmax / 5>> + <span class="lblue">You are calm.</span> + <<elseif $stress gte 1>> + <span class="teal">You are placid.</span> + <<else>> + <span class="green">You are serene.</span> + <</if>> <</if>> - <</if>> + </div> + <<set $stress = Math.clamp($stress, 0, $stressmax)>> + <<set _showCaptionText to !$options.showCaptionText>> + <<statbar $stress $stressmax _showCaptionText>> + <div style="clear:both;"></div> </div> - <<set $stress = Math.clamp($stress, 0, $stressmax)>> - <<set _showCaptionText to !$options.showCaptionText>> - <<statbar $stress $stressmax _showCaptionText>> - <div style="clear:both;"></div> - </div> + <</if>> <</widget>> <<widget "traumacaption">> - <div id="traumacaption" @title="'Trauma: ' + $trauma?.toFixed(2)"> - <div @class="($options.showCaptionText is true ? '' : 'rightMeterText')"> - Trauma: - <<if $options.showCaptionText is true>> - <<if $trauma gte $traumamax>> - <span class="red">You feel numb.</span> - <<elseif $trauma gte ($traumamax / 5) * 4>> - <span class="pink">You are tormented.</span> - <<elseif $trauma gte ($traumamax / 5) * 3>> - <span class="purple">You are disturbed.</span> - <<elseif $trauma gte ($traumamax / 5) * 2>> - <span class="blue">You are troubled.</span> - <<elseif $trauma gte ($traumamax / 5) * 1>> - <span class="lblue">You are nervous.</span> - <<elseif $trauma gte 1>> - <span class="teal">You are uneasy.</span> - <<else>> - <span class="green">You are healthy.</span> + <<if Number.isFinite($trauma)>> + <div id="traumacaption" @title="'Trauma: ' + $trauma.toFixed(2)"> + <div @class="($options.showCaptionText is true ? '' : 'rightMeterText')"> + Trauma: + <<if $options.showCaptionText is true>> + <<if $trauma gte $traumamax>> + <span class="red">You feel numb.</span> + <<elseif $trauma gte ($traumamax / 5) * 4>> + <span class="pink">You are tormented.</span> + <<elseif $trauma gte ($traumamax / 5) * 3>> + <span class="purple">You are disturbed.</span> + <<elseif $trauma gte ($traumamax / 5) * 2>> + <span class="blue">You are troubled.</span> + <<elseif $trauma gte ($traumamax / 5) * 1>> + <span class="lblue">You are nervous.</span> + <<elseif $trauma gte 1>> + <span class="teal">You are uneasy.</span> + <<else>> + <span class="green">You are healthy.</span> + <</if>> <</if>> - <</if>> + </div> + <<set _showCaptionText to !$options.showCaptionText>> + <<statbar $trauma $traumamax _showCaptionText>> + <div style="clear:both;"></div> </div> - <<set _showCaptionText to !$options.showCaptionText>> - <<statbar $trauma $traumamax _showCaptionText>> - <div style="clear:both;"></div> - </div> + <</if>> <</widget>> <<widget "innocencecaption">> @@ -1259,122 +1265,128 @@ <</widget>> <<widget "controlcaption">> - <div id="controlcaption" @title="'Control: ' + $control?.toFixed(2)"> - <div @class="($options.showCaptionText is true ? '' : 'rightMeterText')"> - Control: - <<if $options.showCaptionText is true>> - <<if $possessed>> - <<if $control gte $controlmax>> - <span class="green">You are in control.</span> - <<elseif $control gte ($controlmax / 5) * 4>> - <span class="teal">You are nearly in control.</span> - <<elseif $control gte ($controlmax / 5) * 3>> - <span class="lblue">You are struggling.</span> - <<elseif $control gte ($controlmax / 5) * 2>> - <span class="blue">Your body feels hollow.</span> - <<elseif $control gte ($controlmax / 5) * 1>> - <span class="purple">Your mind is numb.</span> - <<elseif $control gte 1>> - <span class="pink">You're being puppeteered.</span> - <<else>> - <span class="red">You're helpless.</span> - <</if>> - <<else>> - <<if $control gte $controlmax>> - <span class="green">You are confident.</span> - <<elseif $control gte ($controlmax / 5) * 4>> - <span class="teal">You are insecure.</span> - <<elseif $control gte ($controlmax / 5) * 3>> - <span class="lblue">You are worried.</span> - <<elseif $control gte ($controlmax / 5) * 2>> - <span class="blue">You are anxious.</span> - <<elseif $control gte ($controlmax / 5) * 1>> - <span class="purple">You are scared.</span> - <<elseif $control gte 1>> - <span class="pink">You are frightened.</span> + <<if Number.isFinite($control)>> + <div id="controlcaption" @title="'Control: ' + $control.toFixed(2)"> + <div @class="($options.showCaptionText is true ? '' : 'rightMeterText')"> + Control: + <<if $options.showCaptionText is true>> + <<if $possessed>> + <<if $control gte $controlmax>> + <span class="green">You are in control.</span> + <<elseif $control gte ($controlmax / 5) * 4>> + <span class="teal">You are nearly in control.</span> + <<elseif $control gte ($controlmax / 5) * 3>> + <span class="lblue">You are struggling.</span> + <<elseif $control gte ($controlmax / 5) * 2>> + <span class="blue">Your body feels hollow.</span> + <<elseif $control gte ($controlmax / 5) * 1>> + <span class="purple">Your mind is numb.</span> + <<elseif $control gte 1>> + <span class="pink">You're being puppeteered.</span> + <<else>> + <span class="red">You're helpless.</span> + <</if>> <<else>> - <span class="red">You are terrified.</span> + <<if $control gte $controlmax>> + <span class="green">You are confident.</span> + <<elseif $control gte ($controlmax / 5) * 4>> + <span class="teal">You are insecure.</span> + <<elseif $control gte ($controlmax / 5) * 3>> + <span class="lblue">You are worried.</span> + <<elseif $control gte ($controlmax / 5) * 2>> + <span class="blue">You are anxious.</span> + <<elseif $control gte ($controlmax / 5) * 1>> + <span class="purple">You are scared.</span> + <<elseif $control gte 1>> + <span class="pink">You are frightened.</span> + <<else>> + <span class="red">You are terrified.</span> + <</if>> <</if>> <</if>> - <</if>> + </div> + <<set _showCaptionText to !$options.showCaptionText>> + <<statbarinverted $control $controlmax _showCaptionText>> + <div style="clear:both;"></div> </div> - <<set _showCaptionText to !$options.showCaptionText>> - <<statbarinverted $control $controlmax _showCaptionText>> - <div style="clear:both;"></div> - </div> + <</if>> <</widget>> <<widget "arousalcaption">> - <div id="arousalcaption" @title="'Arousal: ' + $arousal?.toFixed(2)"> - <div @class="($options.showCaptionText is true ? '' : 'rightMeterText')"> - Arousal: - <<if $options.showCaptionText is true>> - <<if $arousal gte $arousalmax>> - <span class="red">You shake with arousal.</span> - <<elseif $arousal gte ($arousalmax / 5) * 4>> - <span class="pink">A heat rises within.</span> - <<elseif $arousal gte ($arousalmax / 5) * 3>> - <span class="purple">You feel horny.</span> - <<elseif $arousal gte ($arousalmax / 5) * 2>> - <span class="blue">You feel lustful.</span> - <<elseif $arousal gte $arousalmax / 5>> - <span class="lblue">You feel aroused.</span> - <<elseif $arousal gte 1>> - <span class="teal">You feel sensual.</span> - <<else>> - <span class="green">You feel cold.</span> + <<if Number.isFinite($arousal)>> + <div id="arousalcaption" @title="'Arousal: ' + $arousal.toFixed(2)"> + <div @class="($options.showCaptionText is true ? '' : 'rightMeterText')"> + Arousal: + <<if $options.showCaptionText is true>> + <<if $arousal gte $arousalmax>> + <span class="red">You shake with arousal.</span> + <<elseif $arousal gte ($arousalmax / 5) * 4>> + <span class="pink">A heat rises within.</span> + <<elseif $arousal gte ($arousalmax / 5) * 3>> + <span class="purple">You feel horny.</span> + <<elseif $arousal gte ($arousalmax / 5) * 2>> + <span class="blue">You feel lustful.</span> + <<elseif $arousal gte $arousalmax / 5>> + <span class="lblue">You feel aroused.</span> + <<elseif $arousal gte 1>> + <span class="teal">You feel sensual.</span> + <<else>> + <span class="green">You feel cold.</span> + <</if>> <</if>> - <</if>> + </div> + <<set _showCaptionText to !$options.showCaptionText>> + <<statbar $arousal $arousalmax _showCaptionText>> + <div style="clear:both;"></div> </div> - <<set _showCaptionText to !$options.showCaptionText>> - <<statbar $arousal $arousalmax _showCaptionText>> - <div style="clear:both;"></div> - </div> + <</if>> <</widget>> <<widget "allurecaption">> - <div id="allurecaption" @title="'Allure: ' + $allure?.toFixed(2)"> - <div @class="($options.showCaptionText is true ? '' : 'rightMeterText')"> - Allure: - <<if $options.showCaptionText is true>> - <<if $allure gte (6000 * $alluremod)>><span class="red">You look like you need to be ravaged.</span> - <<elseif $allure gte (4000 * $alluremod)>><span class="pink">You look perverted.</span> - <<elseif $allure gte (3000 * $alluremod)>><span class="purple">You look lewd.</span> - <<elseif $allure gte (2000 * $alluremod)>><span class="blue">You stand out.</span> - <<elseif $allure gte (1500 * $alluremod)>><span class="lblue">You attract attention.</span> - <<elseif $allure gte (1000 * $alluremod)>><span class="teal">You attract glances.</span> - <<else>><span class="green">You look unremarkable.</span> + <<if Number.isFinite($allure)>> + <div id="allurecaption" @title="'Allure: ' + $allure.toFixed(2)"> + <div @class="($options.showCaptionText is true ? '' : 'rightMeterText')"> + Allure: + <<if $options.showCaptionText is true>> + <<if $allure gte (6000 * $alluremod)>><span class="red">You look like you need to be ravaged.</span> + <<elseif $allure gte (4000 * $alluremod)>><span class="pink">You look perverted.</span> + <<elseif $allure gte (3000 * $alluremod)>><span class="purple">You look lewd.</span> + <<elseif $allure gte (2000 * $alluremod)>><span class="blue">You stand out.</span> + <<elseif $allure gte (1500 * $alluremod)>><span class="lblue">You attract attention.</span> + <<elseif $allure gte (1000 * $alluremod)>><span class="teal">You attract glances.</span> + <<else>><span class="green">You look unremarkable.</span> + <</if>> <</if>> - <</if>> - </div> - <div @class="($options.showCaptionText is true ? 'meter' : 'rightMeter')"> - <<set $percent=Math.floor(($allure/(8000 * $alluremod))*100)>> - <<if $allure gte (6000 * $alluremod)>> - <<print '<div class="redbar" style="width:' + $percent + '%"></div>'>> - <<elseif $allure gte (4000 * $alluremod)>> - <<print '<div class="pinkbar" style="width:' + $percent + '%"></div>'>> - <<elseif $allure gte (3000 * $alluremod)>> - <<print '<div class="purplebar" style="width:' + $percent + '%"></div>'>> - <<elseif $allure gte (2000 * $alluremod)>> - <<print '<div class="bluebar" style="width:' + $percent + '%"></div>'>> - <<elseif $allure gte (1500 * $alluremod)>> - <<print '<div class="lbluebar" style="width:' + $percent + '%"></div>'>> - <<elseif $allure gte (1000 * $alluremod)>> - <<print '<div class="tealbar" style="width:' + $percent + '%"></div>'>> - <<else>> - <<print '<div class="greenbar" style="width:' + $percent + '%"></div>'>> - <</if>> - </div> + </div> + <div @class="($options.showCaptionText is true ? 'meter' : 'rightMeter')"> + <<set $percent=Math.floor(($allure/(8000 * $alluremod))*100)>> + <<if $allure gte (6000 * $alluremod)>> + <<print '<div class="redbar" style="width:' + $percent + '%"></div>'>> + <<elseif $allure gte (4000 * $alluremod)>> + <<print '<div class="pinkbar" style="width:' + $percent + '%"></div>'>> + <<elseif $allure gte (3000 * $alluremod)>> + <<print '<div class="purplebar" style="width:' + $percent + '%"></div>'>> + <<elseif $allure gte (2000 * $alluremod)>> + <<print '<div class="bluebar" style="width:' + $percent + '%"></div>'>> + <<elseif $allure gte (1500 * $alluremod)>> + <<print '<div class="lbluebar" style="width:' + $percent + '%"></div>'>> + <<elseif $allure gte (1000 * $alluremod)>> + <<print '<div class="tealbar" style="width:' + $percent + '%"></div>'>> + <<else>> + <<print '<div class="greenbar" style="width:' + $percent + '%"></div>'>> + <</if>> + </div> - <<if $allure gte 8000>><<set $allure to 8000>><</if>> - <<if $alluretest is 1>> - <<set $allure += 100000>> - <<elseif $alluretest is 2>> - <<set $allure -= 100000>> - <</if>> + <<if $allure gte 8000>><<set $allure to 8000>><</if>> + <<if $alluretest is 1>> + <<set $allure += 100000>> + <<elseif $alluretest is 2>> + <<set $allure -= 100000>> + <</if>> - <div style="clear:both;"></div> - </div> + <div style="clear:both;"></div> + </div> + <</if>> <</widget>> <<widget "updateallure">> @@ -1504,40 +1516,42 @@ <</widget>> <<widget "paincaption">> - <div id="paincaption" @title="'Pain: ' + $pain?.toFixed(2)"> - <div @class="($options.showCaptionText is true ? '' : 'rightMeterText')"> - Pain: - <<if $options.showCaptionText is true>> - <<if $pain gte 100 and $willpowerpain is 0>><span class="red">You sob uncontrollably.</span> - <<elseif $pain gte 80>><span class="pink">You cry and whimper.</span> - <<elseif $pain gte 60>><span class="purple">You are crying.</span> - <<elseif $pain gte 40>><span class="blue">Tears run down your face.</span> - <<elseif $pain gte 20>><span class="lblue">Tears well in your eyes.</span> - <<elseif $pain gte 1>><span class="teal">You are upset.</span> - <<else>><span class="green">You feel okay.</span> + <<if Number.isFinite($pain)>> + <div id="paincaption" @title="'Pain: ' + $pain.toFixed(2)"> + <div @class="($options.showCaptionText is true ? '' : 'rightMeterText')"> + Pain: + <<if $options.showCaptionText is true>> + <<if $pain gte 100 and $willpowerpain is 0>><span class="red">You sob uncontrollably.</span> + <<elseif $pain gte 80>><span class="pink">You cry and whimper.</span> + <<elseif $pain gte 60>><span class="purple">You are crying.</span> + <<elseif $pain gte 40>><span class="blue">Tears run down your face.</span> + <<elseif $pain gte 20>><span class="lblue">Tears well in your eyes.</span> + <<elseif $pain gte 1>><span class="teal">You are upset.</span> + <<else>><span class="green">You feel okay.</span> + <</if>> <</if>> - <</if>> - </div> - <div @class="($options.showCaptionText is true ? 'meter' : 'rightMeter')"> - <<set $percent=Math.floor(($pain/100)*100)>> - <<if $pain gte 100 and $willpowerpain is 0>> - <<print '<div class="redbar" style="width:' + $percent + '%"></div>'>> - <<elseif $pain gte 80>> - <<print '<div class="pinkbar" style="width:' + $percent + '%"></div>'>> - <<elseif $pain gte 60>> - <<print '<div class="purplebar" style="width:' + $percent + '%"></div>'>> - <<elseif $pain gte 40>> - <<print '<div class="bluebar" style="width:' + $percent + '%"></div>'>> - <<elseif $pain gte 20>> - <<print '<div class="lbluebar" style="width:' + $percent + '%"></div>'>> - <<elseif $pain gte 1>> - <<print '<div class="tealbar" style="width:' + $percent + '%"></div>'>> - <<else>> - <<print '<div class="greenbar" style="width:' + $percent + '%"></div>'>> - <</if>> + </div> + <div @class="($options.showCaptionText is true ? 'meter' : 'rightMeter')"> + <<set $percent=Math.floor(($pain/100)*100)>> + <<if $pain gte 100 and $willpowerpain is 0>> + <<print '<div class="redbar" style="width:' + $percent + '%"></div>'>> + <<elseif $pain gte 80>> + <<print '<div class="pinkbar" style="width:' + $percent + '%"></div>'>> + <<elseif $pain gte 60>> + <<print '<div class="purplebar" style="width:' + $percent + '%"></div>'>> + <<elseif $pain gte 40>> + <<print '<div class="bluebar" style="width:' + $percent + '%"></div>'>> + <<elseif $pain gte 20>> + <<print '<div class="lbluebar" style="width:' + $percent + '%"></div>'>> + <<elseif $pain gte 1>> + <<print '<div class="tealbar" style="width:' + $percent + '%"></div>'>> + <<else>> + <<print '<div class="greenbar" style="width:' + $percent + '%"></div>'>> + <</if>> + </div> + <div style="clear:both;"></div> </div> - <div style="clear:both;"></div> - </div> + <</if>> <</widget>> <<widget "raped">>