diff --git a/src/js/utilJS.js b/src/js/utilJS.js index e1d6c6340dca3f102d6af808231a0f53bdc7d9bc..d1512eda8cef64a953cd31cac80f711bd01af5b6 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -1584,3 +1584,148 @@ App.UI.passageLink = function(linkText, passage, setter, elementType) { res += `>${linkText}</${elementType}>`; return res; }; + +window.SkillIncrease = (function() { + /** @param {App.Entity.SlaveState} slave */ + function OralSkillIncrease(slave, skillIncrease) { + const He = capFirstChar(slave.pronoun); + let r; + skillIncrease = skillIncrease || State.variables.skillIncrease || 1; + + if (slave.oralSkill <= 10) { + if (slave.oralSkill + skillIncrease > 10) { + r = `<span class="green">${He} now has basic knowledge about oral sex,</span> and can at least suck a dick without constant gagging.`; + } + } else if (slave.oralSkill <= 30) { + if (slave.oralSkill + skillIncrease > 30) { + r = `<span class="green">${He} now has some oral skills,</span> and can reliably bring dicks and pussies to climax with $his mouth.`; + } + } else if (slave.oralSkill <= 60) { + if (slave.oralSkill + skillIncrease > 60) { + r = `<span class="green">${He} is now an oral expert,</span> and has a delightfully experienced tongue.`; + } + } else if (slave.oralSkill < 100) { + if (slave.oralSkill + skillIncrease >= 100) { + r = `<span class="green">${He} has mastered oral sex,</span> and can learn nothing more about sucking dick or eating pussy.`; + } + } + slave.oralSkill += skillIncrease; + return r; + } + + /** @param {App.Entity.SlaveState} slave */ + function VaginalSkillIncrease(slave, skillIncrease) { + const He = capFirstChar(slave.pronoun); + let r; + skillIncrease = skillIncrease || State.variables.skillIncrease || 1; + + if (slave.vaginalSkill <= 10) { + if (slave.vaginalSkill + skillIncrease > 10) { + r = `<span class="green">${He} now has basic knowledge about vaginal sex,</span> and can avoid some of the common pitfalls and turnoffs.`; + } + } else if (slave.vaginalSkill <= 30) { + if (slave.vaginalSkill + skillIncrease > 30) { + r = `<span class="green">${He} now has some vaginal sex skills,</span> and can do more than just lie there and take it.`; + } + } else if (slave.vaginalSkill <= 60) { + if (slave.vaginalSkill + skillIncrease > 60) { + r = `<span class="green">${He} is now a vaginal sex expert,</span> and has the muscular control to massage anything that's inside $him.`; + } + } else if (slave.vaginalSkill < 100) { + if (slave.vaginalSkill + skillIncrease >= 100) { + r = `<span class="green">${He} has mastered vaginal sex,</span> and can learn nothing more about tribbing or taking dick.`; + } + } + slave.vaginalSkill += skillIncrease; + return r; + } + + /** @param {App.Entity.SlaveState} slave */ + function AnalSkillIncrease(slave, skillIncrease) { + const He = capFirstChar(slave.pronoun); + let r; + skillIncrease = skillIncrease || State.variables.skillIncrease || 1; + + if (slave.analSkill <= 10) { + if (slave.analSkill + skillIncrease > 10) { + r = `<span class="green">${He} now has basic knowledge about anal sex,</span> and can accept penetration of $his anus without danger.`; + } + } else if (slave.analSkill <= 30) { + if (slave.analSkill + skillIncrease > 30) { + r = `<span class="green">${He} now has some anal sex skills,</span> and needs less preparation before taking rough penetration.`; + } + } else if (slave.analSkill <= 60) { + if (slave.analSkill + skillIncrease > 60) { + r = `<span class="green">${He} is now an anal sex expert,</span> and knows how to use $his sphincter to please.`; + } + } else if (slave.analSkill < 100) { + if (slave.analSkill + skillIncrease >= 100) { + r = `<span class="green">${He} has mastered anal sex,</span> and can learn nothing more about taking it up the ass.`; + } + } + slave.analSkill += skillIncrease; + return r; + } + + /** @param {App.Entity.SlaveState} slave */ + function WhoreSkillIncrease(slave, skillIncrease) { + const He = capFirstChar(slave.pronoun); + let r; + skillIncrease = skillIncrease || State.variables.skillIncrease || 1; + + if (slave.whoreSkill <= 10) { + if (slave.whoreSkill + skillIncrease > 10) { + r = `<span class="green">${He} now has basic knowledge about how to whore,</span> and can avoid some potentially dangerous situations.`; + } + } else if (slave.whoreSkill <= 30) { + if (slave.whoreSkill + skillIncrease > 30) { + r = `<span class="green">${He} now has some skill as a whore,</span> and knows how to sell $his body at a good price.`; + } + } else if (slave.whoreSkill <= 60) { + if (slave.whoreSkill + skillIncrease > 60) { + r = `<span class="green">${He} is now an expert whore,</span> and can often make clients forget that $he's a prostitute they're paying for.`; + } + } else if (slave.whoreSkill < 100) { + if (slave.whoreSkill + skillIncrease >= 100) { + r = `<span class="green">${He} is now a masterful whore,</span> and can learn nothing more about prostitution.`; + } + } + slave.whoreSkill += skillIncrease; + return r; + } + + /** @param {App.Entity.SlaveState} slave */ + function EntertainSkillIncrease(slave, skillIncrease) { + const He = capFirstChar(slave.pronoun); + let r; + skillIncrease = skillIncrease || State.variables.skillIncrease || 1; + + if (slave.entertainSkill <= 10) { + if (slave.entertainSkill + skillIncrease > 10) { + r = `<span class="green">${He} now has basic knowledge about how to be entertaining,</span> and can usually avoid serious faux pas.`; + } + } else if (slave.entertainSkill <= 30) { + if (slave.entertainSkill + skillIncrease > 30) { + r = `<span class="green">${He} now has some skill as an entertainer,</span> and can flirt, dance, and strip acceptably.`; + } + } else if (slave.entertainSkill <= 60) { + if (slave.entertainSkill + skillIncrease > 60) { + r = `<span class="green">${He} is now an expert entertainer,</span> and can flirt engagingly, dance alluringly, and strip arousingly.`; + } + } else if (slave.entertainSkill < 100) { + if (slave.entertainSkill + skillIncrease >= 100) { + r = `<span class="green">${He} is now a masterful entertainer,</span> and can learn nothing more about flirting, dancing, or stripping.`; + } + } + slave.entertainSkill += skillIncrease; + return r; + } + + return { + Oral: OralSkillIncrease, + Vaginal: VaginalSkillIncrease, + Anal: AnalSkillIncrease, + Whore: WhoreSkillIncrease, + Entertain: EntertainSkillIncrease + }; +})(); diff --git a/src/utility/miscWidgets.tw b/src/utility/miscWidgets.tw index fb4a1602590f80199df1033ce0ca7cd51af6cca5..2722431f93d1523d961519c0dc01698ae5963213 100644 --- a/src/utility/miscWidgets.tw +++ b/src/utility/miscWidgets.tw @@ -494,25 +494,7 @@ %/ <<widget "OralSkillIncrease">> -<<setLocalPronouns $args[0]>> -<<if $args[0].oralSkill <= 10>> - <<if $args[0].oralSkill+$skillIncrease > 10>> - @@.green;$He now has basic knowledge about oral sex,@@ and can at least suck a dick without constant gagging. - <</if>> -<<elseif $args[0].oralSkill <= 30>> - <<if $args[0].oralSkill+$skillIncrease > 30>> - @@.green;$He now has some oral skills,@@ and can reliably bring dicks and pussies to climax with $his mouth. - <</if>> -<<elseif $args[0].oralSkill <= 60>> - <<if $args[0].oralSkill+$skillIncrease > 60>> - @@.green;$He is now an oral expert,@@ and has a delightfully experienced tongue. - <</if>> -<<elseif $args[0].oralSkill < 100>> - <<if $args[0].oralSkill+$skillIncrease >= 100>> - @@.green;$He has mastered oral sex,@@ and can learn nothing more about sucking dick or eating pussy. - <</if>> -<</if>> -<<set $args[0].oralSkill += $skillIncrease>> +<<= SkillIncrease.Oral($args[0], $skillIncrease)>> <</widget>> @@ -523,25 +505,7 @@ %/ <<widget "VaginalSkillIncrease">> -<<setLocalPronouns $args[0]>> -<<if $args[0].vaginalSkill <= 10>> - <<if $args[0].vaginalSkill+$skillIncrease > 10>> - @@.green;$He now has basic knowledge about vaginal sex,@@ and can avoid some of the common pitfalls and turnoffs. - <</if>> -<<elseif $args[0].vaginalSkill <= 30>> - <<if $args[0].vaginalSkill+$skillIncrease > 30>> - @@.green;$He now has some vaginal sex skills,@@ and can do more than just lie there and take it. - <</if>> -<<elseif $args[0].vaginalSkill <= 60>> - <<if $args[0].vaginalSkill+$skillIncrease > 60>> - @@.green;$He is now a vaginal sex expert,@@ and has the muscular control to massage anything that's inside $him. - <</if>> -<<elseif $args[0].vaginalSkill < 100>> - <<if $args[0].vaginalSkill+$skillIncrease >= 100>> - @@.green;$He has mastered vaginal sex,@@ and can learn nothing more about tribbing or taking dick. - <</if>> -<</if>> -<<set $args[0].vaginalSkill += $skillIncrease>> +<<= SkillIncrease.Vaginal($args[0], $skillIncrease)>> <</widget>> @@ -552,25 +516,7 @@ %/ <<widget "AnalSkillIncrease">> -<<setLocalPronouns $args[0]>> -<<if $args[0].analSkill <= 10>> - <<if $args[0].analSkill+$skillIncrease > 10>> - @@.green;$He now has basic knowledge about anal sex,@@ and can accept penetration of $his anus without danger. - <</if>> -<<elseif $args[0].analSkill <= 30>> - <<if $args[0].analSkill+$skillIncrease > 30>> - @@.green;$He now has some anal sex skills,@@ and needs less preparation before taking rough penetration. - <</if>> -<<elseif $args[0].analSkill <= 60>> - <<if $args[0].analSkill+$skillIncrease > 60>> - @@.green;$He is now an anal sex expert,@@ and knows how to use $his sphincter to please. - <</if>> -<<elseif $args[0].analSkill < 100>> - <<if $args[0].analSkill+$skillIncrease >= 100>> - @@.green;$He has mastered anal sex,@@ and can learn nothing more about taking it up the ass. - <</if>> -<</if>> -<<set $args[0].analSkill += $skillIncrease>> +<<= SkillIncrease.Anal($args[0], $skillIncrease)>> <</widget>> @@ -581,25 +527,7 @@ %/ <<widget "WhoreSkillIncrease">> -<<setLocalPronouns $args[0]>> -<<if $args[0].whoreSkill <= 10>> - <<if $args[0].whoreSkill+$skillIncrease > 10>> - @@.green;$He now has basic knowledge about how to whore,@@ and can avoid some potentially dangerous situations. - <</if>> -<<elseif $args[0].whoreSkill <= 30>> - <<if $args[0].whoreSkill+$skillIncrease > 30>> - @@.green;$He now has some skill as a whore,@@ and knows how to sell $his body at a good price. - <</if>> -<<elseif $args[0].whoreSkill <= 60>> - <<if $args[0].whoreSkill+$skillIncrease > 60>> - @@.green;$He is now an expert whore,@@ and can often make clients forget that $he's a prostitute they're paying for. - <</if>> -<<elseif $args[0].whoreSkill < 100>> - <<if $args[0].whoreSkill+$skillIncrease >= 100>> - @@.green;$He is now a masterful whore,@@ and can learn nothing more about prostitution. - <</if>> -<</if>> -<<set $args[0].whoreSkill += $skillIncrease>> +<<= SkillIncrease.Whore($args[0], $skillIncrease)>> <</widget>> @@ -610,25 +538,7 @@ %/ <<widget "EntertainSkillIncrease">> -<<setLocalPronouns $args[0]>> -<<if $args[0].entertainSkill <= 10>> - <<if $args[0].entertainSkill+$skillIncrease > 10>> - @@.green;$He now has basic knowledge about how to be entertaining,@@ and can usually avoid serious faux pas. - <</if>> -<<elseif $args[0].entertainSkill <= 30>> - <<if $args[0].entertainSkill+$skillIncrease > 30>> - @@.green;$He now has some skill as an entertainer,@@ and can flirt, dance, and strip acceptably. - <</if>> -<<elseif $args[0].entertainSkill <= 60>> - <<if $args[0].entertainSkill+$skillIncrease > 60>> - @@.green;$He is now an expert entertainer,@@ and can flirt engagingly, dance alluringly, and strip arousingly. - <</if>> -<<elseif $args[0].entertainSkill < 100>> - <<if $args[0].entertainSkill+$skillIncrease >= 100>> - @@.green;$He is now a masterful entertainer,@@ and can learn nothing more about flirting, dancing, or stripping. - <</if>> -<</if>> -<<set $args[0].entertainSkill += $skillIncrease>> +<<= SkillIncrease.Entertain($args[0], $skillIncrease)>> <</widget>>