:: Summary Widgets [widget nobr]

/%
 Call as <<SlaveStatClamp $slave>>
%/
<<widget "SlaveStatClamp">>
<<set $args[0].energy = Math.clamp($args[0].energy, 0, 100)>>

<<if $args[0].devotion > 100>>
	<<if $args[0].trust < -95>>
		<<set $args[0].trust = -100>>
	<<elseif ($args[0].trust < 100) && ($args[0].trust >= -20)>>
		<<set $args[0].trust += Math.trunc($args[0].devotion-100)>>
	<<else>>
		<<set $rep += 10*($args[0].devotion-100)>>
	<</if>>
	<<set $args[0].devotion = 100>>
<<elseif $args[0].devotion < -95>>
	<<set $args[0].devotion = -100>>
<</if>>
<<if $args[0].trust > 100>>
	<<if $args[0].devotion < -95>>
		<<set $args[0].devotion = -100>>
	<<elseif $args[0].devotion < 100>>
		<<set $args[0].devotion += Math.trunc($args[0].trust-100)>>
	<<else>>
		<<set $rep += 10*($args[0].trust-100)>>
	<</if>>
	<<set $args[0].trust = 100>>
<<elseif $args[0].trust < -95>>
	<<set $args[0].trust = -100>>
<</if>>
<<if $args[0].trust < -100>><<set $args[0].trust = -100>><</if>>
<<if $args[0].devotion < -100>><<set $args[0].devotion = -100>><</if>>
<<if isNaN($args[0].oralCount)>><<set $args[0].oralCount = 0>>//Oral count has broken, report what you just did!<</if>>
<<if isNaN($args[0].analCount)>><<set $args[0].analCount = 0>>//Anal count has broken, report what you just did!<</if>>
<<if isNaN($args[0].vaginalCount)>><<set $args[0].vaginalCount = 0>>//Vaginal count has broken, report what you just did!<</if>>
<<if isNaN($args[0].mammaryCount)>><<set $args[0].mammaryCount = 0>>//Titfuck count has broken, report what you just did!<</if>>
<<if isNaN($args[0].penetrativeCount)>><<set $args[0].penetrativeCount = 0>>//Pentration count has broken, report what you just did!<</if>>
<<if ndef $args[0].foreskin>><<set $args[0].foreskin = 0>><</if>>
<<if $args[0].amp != 0 && $args[0].heels == 1>><<set $args[0].heels = 0>><</if>>
<<if $args[0].vagina < 0 && $args[0].mpreg == 0 && $args[0].preg == -1>><<set $args[0].preg = 0>><</if>>
<</widget>>
