<<nobr>>
<div id="background" class="paper_border">
<div class="container threeCol" style="height: 100%; width: 100%;">
<div class="subbackground">
<center><h3>Music</h3></center>
<div class="textpassage" style="margin-left: 20px; margin-right: 20px">
Enderal Soundtrack - <br>
<div style="margin-left: 20px">
Marvin Kopp<br>
Andreas Makusev<br>
Simon W. Autenrieth<br>
Sabastian Loebbers<br>
Nicolas Samuel Lietzau
</div>
</div>
</div>
<div class="subbackground">
<center><h3>Inspiration</h3></center>
<div class="textpassage" style="margin-left: 20px; margin-right: 20px">
Free Cities - FC Author<br>
Masters of Raana - GrimDark
</div>
<br><hr><br>
<center><<button Return Start>><</button>></center>
<div class="license">
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
<img class="license" src="resources/images/license.png">
</a>
<p class="license title">Mimus Studios, 2022</p>
</div>
</div>
<div class="subbackground">
<center><h3>Top Supporters</h3></center>
<div class="textpassage" style="margin-left: 20px; margin-right: 20px">
Darkmaniac7<br>
Screening8<br>
FallenAngel_KShaj<br>
Gaetan
</div>
</div>
</div>
</div>
<</nobr>><<nobr>>
<div id="background" class="paper_border" style="position: relative">
<center><h1>Under Construction</h1></center>
<p class="textpassage">
This passage is still under construction. If you would like to keep up to date with
the latest updates you can join the <a href="https://discord.gg/xrynJUBksW">Discord</a>.
Or if you would like to alpha test the latest
versions you can subscribe to the SubscribeStar.
</p>
<div style="position: absolute; bottom: 100px; left: calc(50% - 82px);">
<<button Back>>
<<set $in_menu = false>>
<<goto $last_visited>>
<<set $last_visited = "">>
<</button>>
</div>
</div>
<</nobr>><<if !$locations["shintaniHome"].data.default_asked>>
<<set $locations["shintaniHome"].data.default_asked = true>>
<<popover>>
<<include defaultAskTutorial>>
<</popover>>
<</if>>
<<set _char = $characters[$selected]>>
<<set _to_append = "You greet " + setup.titleCase(_char.first_name) + ",<br>" +
$player.dialogue("Could I ask you a couple of things?") +
setup.titleCase(_char.first_name) + " eyes you up and down, wondering what you want.<br>\
What would you like to ask about?\
">>
<<set _options = "\
<ol>\
<li id=\"li1\">\"How are you feeling?\"</li>\
<li id=\"li2\">\"What do you like to do the most?\"</li>\
</ol>">>
<<set _to_append += _options>>
<<run setup.mainLog_append(_to_append)>>
<<set _options = $(_options)>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<set _disposition = _char.get_disposition()>>
<<set _fn = setup.titleCase(_char.first_name)>>
<<set _p = setup.PRONOUNS[_char.gender]>>
/* Psuedoevent listener for action */
/* TODO: Implement */
<<silently>><<repeat 10ms>>
<<if _action !== undefined>>
<<if _char.limits.ask gt 0>>
<<set _char.limits.ask -= 1>>
<<switch _action>>
<<case 1>>
<<switch _disposition>>
<<case "depressed">>
<<set _responses = [
_fn + "\'s eyes drop to the ground and " + _p["?he"] + " lets out a long sigh,",
_char.dialogue("Um... well, I\'m alive... does that answer your question? Perhaps \
not for too much longer though... Why do you even care anyways?")
]>>
<<case "sad">>
<<set _delt = {
"slave_traits": {
"obedience": 1
}
}>>
<<set _responses = [
_char.dialogue("Oh um, I am..."),
_fn + "\'s eyes glaze over and she gets choked up. You can tell " + _p["?he"] + "is \
holding back tears.",
_char.dialogue("I\'m okay, please just leave me alone..."),
"Despite " + _p["?his"] + " plea for solitude, you can tell that " + _p["?he"] + "\'s glad \
someone cared enough to ask " + _char.print_delta(_delt) + "."
]>>
<<run setup.apply_delta(_char, _delt)>>
<<case "submissive">>
<<if $player.slaves.contains(_char.key)>>
<<set _response = "Well " + _char.address + ", I am very happy to be able to serve such a great \
master. I know that life outside is nothing pretty, so I am content with you using me all you want \
if it means continuing to serve under you.">>
<<else>>
<<set _response = "I\'m doing pretty good. I\'m also very happy to be able to help you in any way I can.">>
<</if>>
<<set _responses = [
_char.dialogue(_response)
_fn + " runs " + _p["?his"] + " hands down " + _p["?his"] + " body seductively,",
_char.dialogue("All of this is yours " + _char.address + ". Use it however you\'d like.")
]>>
<<unset _response>>
<<case "devoted">>
<<if !$player.slaves.contains(_char.key)>>
<<set _char.address = setup.titleCase($player.first_name)>>
<</if>>
<<set _responses = [
_fn + " immediately drops to " + _p["?his"] + " knees and scoots over to you,",
_char.dialogue("As long as I have you I am okay. I... I..."),
setup.titleCase(_p["?he"]) + " nervousely looks away for a split second,",
_char.dialogue("I love you " + _char.address + ". Now please..."),
setup.titleCase(_p["?he"]) + " opens " + _p["?his"] + " mouth wide, sticking out " + _p["?his"] +
" tongue,",
_char.dialogue("Please use me in any way you like.")
]>>
<<case "scared">>
<<set _responses = [
_char.dialogue("Um... I uh, am good... Everything is good!"),
"From " + _fn + "\'s body language it\'s very obvious that she is very scared to answer in any way that \
may provoke you,",
_char.dialogue("Um... can I go now?"),
setup.titleCase(_p["?his"]) + " eyes are glued to your chin, unable to meet your gaze."
]>>
<<case "cold">>
<<set _responses = [
_fn + " quickly snaps back at your question,",
_char.dialogue("I\'m fine."),
"You can feel the distance and coldness in " + _fn + "\'s voice, as if " + _p["?he"] + " was lost in thought.",
_char.dialogue("Sorry, did you need something else, or can I go now?")
]>>
<<case "hateful">>
<<set _responses = [
_fn + " gives you a look of utter disgust,",
]>>
<<if $player.slaves.contains(_char.key)>>
<<set _responses.push("Keeping " + _p["?his"] + " arms folded, " + _p["?he"] + " turns " + _p["?his"] +
" head away in defiance and refuses to answer.")>>
<<else>>
<<set _responses.push(_char.dialogue("Why the fuck do you care? Go mind your own business."))>>
<</if>>
<<default>>
<<set _responses = [
_fn + " smiles and is happy that you\'d inquire about " + _p["?him"] + ",",
_char.dialogue("I\'m doing pretty well actually. Ever since you came into my life, things have been looking up.")
]>>
<</switch>>
<<run _button_fn()>>
<<case 2>>
/* No information shared if bad disposition */
<<if _disposition == "depressed" || _disposition == "sad">>
<<set _responses = [
_fn + " sighs,",
_char.dialogue("I don't like anything...")
]>>
<<elseif _disposition == "submissive" || _disposition == "devoted" || _disposition == "scared">>
/* Cum addiction trumps all */
<<if _char.mental_conditions.cum_addition gt 50>>
<<set _responses = [
"As soon as " + _fn + " starts to think about it, " + _p["?he"] + " begins to drool,",
_char.dialogue("I want cum... no I need cum in my mouth. I want to swirl it around my tongue. Please, make me \
lick it off the floor, or feed it too me on " + (($player.gender == 0) ? "your cock." : "a spoon.")),
"The hunger in " + _fn + "\'s eyes make it clear that " + _p["?he"] + " is psychologically addicted to cum."
]>>
<<else>>
/* Find largest fetish */
<<set _max = -100>>
<<set _max_fetish = setup.SEX_FETISHES[0]>>
<<for _idx, _fetish range setup.SEX_FETISHES>>
<<if _char.sex_fetishes[_fetish] gt _max>>
<<set _max = _char.sex_fetishes[_fetish]>>
<<set _max_fetish = _fetish>>
<</if>>
<</for>>
<<if _max gt 50>>
/* TODO: Implement other fetishes */
<<switch _max_fetish>>
<<case "cum">>
<<set _responses = [
"As soon as " + _fn + " starts to think about it, " + _p["?he"] + " begins to drool,",
_char.dialogue("I want cum... no I need cum in my mouth. I want to swirl it around my tongue. Please, make me \
lick it off the floor, or feed it too me on " + (($player.gender == 0) ? "your cock." : "a spoon."))
]>>
<<case "feet">>
<<set _responses = [
_fn + " bites " + _p["?his"] + " lips and looks downward,",
_char.dialogue("I like really beautiful feet. I want them all in my mouth and all over me."),
"You can tell that this conversation already has " + _fn + " aroused."
]>>
<<default>>
/* TODO: Finish flavor text */
<<set _responses = [
"fetish_" + _fetish + ". UNDER CONSTRUCTION."
]>>
<</switch>>
<</if>>
/* Find largest preference */
<<set _max = -100>>
<<set _max_pref = setup.SEX_PREFS[0]>>
<<for _idx, _pref range setup.SEX_PREFS>>
<<if _pref == "libido">>
<<continue>>
<</if>>
<<if _char.sex_prefs[_pref] gt _max>>
<<set _max = _char.sex_prefs[_pref]>>
<<set _max_pref = _pref>>
<</if>>
<</for>>
<<if ndef _responses>>
<<set _responses = []>>
<</if>>
<<if _char.sex_prefs.libido gt 70>>
<<set _responses.push(_char.dialogue("I love sex, my favorite is " + _max_pref + " sex."))>>
<<elseif _char.sex_prefs.libido gt 50>>
<<set _responses.push(_char.dialogue("I also enjoy, my favorite is " + _max_pref + " sex."))>>
<<else>>
<<set _responses.push(_char.dialogue("I enjoy free time and spending time on my own."))>>
<</if>>
<</if>>
<<if !_char.sex_prefs_known || !_char.fetishes_known>>
<<set _char.sex_prefs_known = true>>
<<set _char.fetishes_known = true>>
<<notify>>Learned _fn's sex preferences.<</notify>>
<</if>>
<<elseif _disposition == "warm" || _disposition == "normal" || _disposition == "cold">>
<<set _responses = [
_char.dialogue("Well I enjoy free time and work that isn\'t too tiring"),
"You can tell that there is more to " + _fn + ", but " + _p["?he"] + " is not keen to reveal it."
]>>
<<else>>
<<if $player.slaves.contains(_char.key)>>
<<set _responses = [
_fn + " rolls " + _p["?his"] + " eyes,",
_char.dialogue("Nothing. I don\'t like anything... can I go now?")
]>>
<<else>>
<<set _responses = [
_fn + " rolls " + _p["?his"] + " eyes,",
_char.dialogue("My favorite times are when you aren\'t present.")
]>>
<</if>>
<</if>>
<<run _button_fn()>>
<</switch>>
<<else>>
<<notify>>Already asked <<= setup.titleCase(_char.first_name)>>
too many things today!<</notify>>
<</if>>
<<unset _action>>
<<elseif def _stop_loop && _stop_loop>>
<<stop>>
<</if>>
<</repeat>><</silently>>
<<script>>
State.temporary.button_fn = () => {
let _t = State.temporary;
let _v = State.variables;
if (_t.responses != null) {
_t.disable_buttons = false;
_t.options.find("#li" + _t.action).css("text-decoration", "line-through");
$.wiki("<<disableactions _options>>");
_t.responses.push(_t.options.clone());
setup.mainLog_append_delayed(_t.responses, _v.buttons, _v.buttons_extra);
delete _t.responses;
let roll = dice(1, 5) + 3;
$.wiki("<<addmins " + roll + ">>");
}
delete _t.action;
}
<</script>><<nobr>>
<<set _cur_location = passage()>>
<<if setup.locations.has(_cur_location)>>
<<set _temp = setup.locations.get_recur_attrib(_cur_location, "music")>>
<<else>>
<<set _temp = null>>
<</if>>
<<if def _combat && _combat>>
<<set _temp = "bgm_conflict">>
<</if>>
<<if def _temp && _temp != null && $enable_music>>
<<if def $playing && $playing != "none" && _temp != $playing>>
<<playlist $playing fadeoverto 0.3 0>>
<<timed 300ms>>
<<playlist $playing stop>>
<<set $playing = _temp>>
<<playlist _temp volume 1 loop shuffle play>>
<</timed>>
<<else>>
/* In case load in save to resume */
<<playlist _temp volume 1 loop shuffle play>>
<<set $playing = _temp>>
<</if>>
<</if>>
<</nobr>><div class="main container fiveCol threeRow" style="height: 100%; width: 100%;">
<div id="combatLogContainer" class="subbackground combatLogContainer">
''Combat Log:''<br>
<div id="combatLog" class="combatLog">
<<if def _inital_log>>
_inital_log
<</if>>
</div>
</div>
<div class="subbackground combatCanvas">
<div class="subbackground combatEnemyInfo">
<div id="enemy4Info" style="width: 100%"></div>
<div id="enemy1Info" style="width: 100%"></div>
<div id="enemy2Info" style="width: 100%"></div>
<div id="enemy3Info" style="width: 100%"></div>
</div>
<div class="combatEnemyImages">
<div id="enemy4Image" style="width: 100%"></div>
<div id="enemy1Image" style="width: 100%"></div>
<div id="enemy2Image" style="width: 100%"></div>
<div id="enemy3Image" style="width: 100%"></div>
</div>
<div class="combatEnemyBars">
<div id="enemy4Bar" class="combatBar"></div>
<div id="enemy1Bar" class="combatBar"></div>
<div id="enemy2Bar" class="combatBar"></div>
<div id="enemy3Bar" class="combatBar"></div>
</div>
</div>
<div class="subbackground combatActionBar smalltext">
<<include combatEngineActions>>
</div>
<div class="subbackground combatInfo">
<div id="party1Info" class="combatPartyInfo"><hr></div>
<div id="party2Info" class="combatPartyInfo combatInactive"><hr></div>
<div id="party3Info" class="combatPartyInfo combatInactive"><hr></div>
<div id="party4Info" class="combatPartyInfo combatInactive"><hr></div>
</div>
</div>
<<run $("\
<div class=\"combatSide right hidden\">\
<center><b id=\"sideTitle\">Title</b></center>\
<div id=\"sideText\">Lorem Ipsum bro!</div>\
</div>\
").insertAfter("#background")>>@@#attack1;<<button "Weapon 1">>
<<run _selected_weapon = 1>>
<<run $(".combatSide").addClass("hidden")>>
<<if _combat_state.char.equipment.weapon1 == "none">>
<<set _action_queue.push({
"source": _combat_state.char.key,
"target": "self",
"AP": -2,
"damage": {
"blunt": 1
},
"item": "none",
"item_name": "fist",
"priority": 1,
"type": "attack",
"flavor_text": "punched"
})>>
<<run $("#party" + (_char_idx + 1) + "Info").find("#nextMove").html("Punch")>>
<<run $(".combatActionBar").empty()>>
<<run $(".combatActionBar").wiki("<<include combatEngineAttackTargetOptions>>")>>
<<else>>
<<set _temp_item = UInv.GetDefaultItemObject(_combat_state.char.equipment.weapon1)>>
<<if _combat_state.players[_combat_state.char.key].AP gte _temp_item.weapon_stats.weight>>
<<set _temp_damage = _temp_item.weapon_stats.damage>>
<<set _temp_resist = _temp_item.weapon_stats.resist>>
<<if _temp_item.skill != null && _combat_state.char.skills[_temp_item.skill] lt _temp_item.skillreq>>
<<set setup.mult_dict(_temp_damage, 0.5)>>
<<set setup.mult_dict(_temp_resist, 0.5)>>
<<elseif _temp_item.stat != null && _combat_state.char.stats[_temp_item.stat] lt _temp_item.statreq>>
<<set setup.mult_dict(_temp_damage, 0.5)>>
<<set setup.mult_dict(_temp_resist, 0.5)>>
<</if>>
<<set _action_queue.push({
"source": _combat_state.char.key,
"target": null,
"AP": -1 * _temp_item.weapon_stats.weight,
"damage": _temp_damage,
"resist": _temp_resist,
"item": _combat_state.char.equipment.weapon1,
"item_name": _temp_item.name,
"priority": 1,
"type": "attack",
"flavor_text": "used " + _temp_item.singular + " to attack"
})>>
<<run $("#party" + (_char_idx + 1) + "Info").find("#nextMove").html("Attack 1")>>
<<run $(".combatActionBar").empty()>>
<<run $(".combatActionBar").wiki("<<include combatEngineAttackTargetOptions>>")>>
<<else>>
<<notify>>Not enough AP.<</notify>>
<</if>>
<</if>>
<</button>>@@
@@#attack2;<<button "Weapon 2">>
<<run _selected_weapon = 2>>
<<run $(".combatSide").addClass("hidden")>>
<<if _combat_state.char.equipment.weapon2 == "none">>
<<set _action_queue.push({
"source": _combat_state.char.key,
"target": "self",
"AP": -2,
"damage": {
"blunt": 1
},
"item": "none",
"item_name": "fist",
"priority": 1,
"type": "attack",
"flavor_text": "punched"
})>>
<<run $("#party" + (_char_idx + 1) + "Info").find("#nextMove").html("Punch")>>
<<run $(".combatActionBar").empty()>>
<<run $(".combatActionBar").wiki("<<include combatEngineAttackTargetOptions>>")>>
<<else>>
<<set _temp_item = UInv.GetDefaultItemObject(_combat_state.char.equipment.weapon2)>>
<<if _combat_state.players[_combat_state.char.key].AP gte _temp_item.weapon_stats.weight>>
<<set _temp_damage = _temp_item.weapon_stats.damage>>
<<set _temp_resist = _temp_item.weapon_stats.resist>>
<<if _temp_item.skill != null && _combat_state.char.skills[_temp_item.skill] lt _temp_item.skillreq>>
<<set setup.mult_dict(_temp_damage, 0.5)>>
<<set setup.mult_dict(_temp_resist, 0.5)>>
<<elseif _temp_item.stat != null && _combat_state.char.stats[_temp_item.stat] lt _temp_item.statreq>>
<<set setup.mult_dict(_temp_damage, 0.5)>>
<<set setup.mult_dict(_temp_resist, 0.5)>>
<</if>>
<<set _action_queue.push({
"source": _combat_state.char.key,
"target": null,
"AP": -1 * _temp_item.weapon_stats.weight,
"damage": _temp_damage,
"resist": _temp_resist,
"item": _combat_state.char.equipment.weapon1,
"item_name": _temp_item.name,
"priority": 1,
"type": "attack",
"flavor_text": "used " + _temp_item.singular + " to attack"
})>>
<<run $("#party" + (_char_idx + 1) + "Info").find("#nextMove").html("Attack 2")>>
<<run $(".combatActionBar").empty()>>
<<run $(".combatActionBar").wiki("<<include combatEngineAttackTargetOptions>>")>>
<<else>>
<<notify>>Not enough AP.<</notify>>
<</if>>
<</if>>
<</button>>@@
@@#skills;<<button "Skills">>
<<script>>
$(".combatActionBar").empty();
$(".combatActionBar").wiki("<<include combatEngineSkillsOptions>>");
<</script>>
<</button>>@@
@@#skip;<<button "Skip">>
<<set _action_queue.push({
"source": _combat_state.char.key,
"target": "self",
"AP": 2,
"item": "none",
"item_name": null,
"flavor_text": "rested, restoring " + setup.show_change_html(0, 2) + " AP",
"priority": 4,
"type": "passive"
})>>
<<run $("#party" + (_char_idx + 1) + "Info").find("#nextMove").html("Skip")>>
<<run _change_selection_index(_char_idx + 1)>>
<</button>>@@
@@#stats;<<button "Stats">>
<<popover>>
<center><h2><<= _combat_state.char.name()>></h2></center>
<<set _char = _combat_state.char>>
The following are combat statistics accounting for weapons and equipment.
<<include characterMenuCombatStats>>
<</popover>>
<</button>>@@
<div style="grid-row: 4; grid-column: 1">
@@#auto;<<button "Auto">>
<<set _action_queue.push(_auto_action(_combat_state.char, _opponents))>>
<<run $("#party" + (_char_idx + 1) + "Info").find("#nextMove").html("Auto")>>
<<run _change_selection_index(_char_idx + 1)>>
<</button>>@@
</div>
<<if _char_idx == 0>>
<div id="actionBackContainer" style="grid-row: 4; grid-column: 3" class="hidden">
@@#actionBack;<<button "Back">>
/* Pop the last action pushed into the queue */
<<run $("#party" + (_char_idx) + "Info").find("#nextMove").empty()>>
<<set _action_queue.pop()>>
<<run _change_selection_index(_char_idx - 1)>>
<</button>>@@
</div>
<<else>>
<div id="actionBackContainer" style="grid-row: 4; grid-column: 3">
@@#actionBack;<<button "Back">>
/* Pop the last action pushed into the queue */
<<run $("#party" + (_char_idx) + "Info").find("#nextMove").empty()>>
<<set _action_queue.pop()>>
<<run _change_selection_index(_char_idx - 1)>>
<</button>>@@
</div>
<</if>>
<div style="grid-row: 4; grid-column: 4">
@@#retreat;<<button "Retreat">>
<<if def _retreat_blocked && _retreat_blocked>>
<<notify>>Cannot retreat!<</notify>>
<<else>>
<<set _combat_result = "retreat">>
<<include combatEngineAfter>>
<</if>>
<</button>>@@
</div>
<<silently>><<timed 5ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
$("#skip button").hover(() => {
$(".combatSide").removeClass("hidden");
$("#sideTitle").html("Skip Turn");
$("#sideText").html("Rest for a turn and regain some AP.<br>\
<b>Effects:</b><ul><li>AP: " + setup.show_change_html(0, 4) + "</li></ul>")
},
() => {
$(".combatSide").addClass("hidden");
});
if (_t.combat_state.char.equipment.weapon1 != "none" && !UInv.GetDefaultItemObject(_t.combat_state.char.equipment.weapon1).type.contains("shield")) {
let _temp_item = UInv.GetDefaultItemObject(_t.combat_state.char.equipment.weapon1);
$("#attack1 button").hover(() => {
$(".combatSide").removeClass("hidden");
$("#sideTitle").html(_temp_item.name);
$("#sideText").html("Perform a regular attack.<br>\
<b>Effects:</b>\
<ul id=\"effectsList\">\
<li>AP: " + setup.show_change_html(0, -1 * _temp_item.weapon_stats.weight) + "</li>\
</ul>");
if (_temp_item.weapon_stats.damage != null) {
if (_temp_item.weapon_stats.damage.blunt != null && _temp_item.weapon_stats.damage.blunt != 0) {
$("#sideText").find("#effectsList").wiki("<li>Blunt Damage: " + _temp_item.weapon_stats.damage.blunt + "</li>")
}
if (_temp_item.weapon_stats.damage.pierce != null && _temp_item.weapon_stats.damage.pierce != 0) {
$("#sideText").find("#effectsList").wiki("<li>Pierce Damage: " + _temp_item.weapon_stats.damage.pierce + "</li>")
}
if (_temp_item.weapon_stats.damage.slash != null && _temp_item.weapon_stats.damage.slash != 0) {
$("#sideText").find("#effectsList").wiki("<li>Slash Damage: " + _temp_item.weapon_stats.damage.slash + "</li>")
}
}
},
() => {
$(".combatSide").addClass("hidden");
});
} else if (_t.combat_state.char.equipment.weapon1 == "none") {
$("#attack1 button").hover(() => {
$(".combatSide").removeClass("hidden");
$("#sideTitle").html("Unarmed Attack");
$("#sideText").html("Perform a regular unarmed attack.<br>\
<b>Effects:</b>\
<ul id=\"effectsList\">\
<li>AP: " + setup.show_change_html(0, -2) + "</li>\
<li>Blunt Damage: 1</li>\
</ul>");
},
() => {
$(".combatSide").addClass("hidden");
});
} else {
$("#attack1 button").addClass("disabled");
$("#attack1 button").prop("disabled", true);
}
if (_t.combat_state.char.equipment.weapon2 != "none" && !UInv.GetDefaultItemObject(_t.combat_state.char.equipment.weapon2).type.contains("shield") &&
!UInv.GetDefaultItemObject(_t.combat_state.char.equipment.weapon2).type.contains("2-handed")) {
let _temp_item = UInv.GetDefaultItemObject(_t.combat_state.char.equipment.weapon2);
$("#attack2 button").hover(() => {
$(".combatSide").removeClass("hidden");
$("#sideTitle").html(_temp_item.name);
$("#sideText").html("Perform a regular attack.<br>\
<b>Effects:</b>\
<ul id=\"effectsList\">\
<li>AP: " + setup.show_change_html(0, -1 * _temp_item.weapon_stats.weight) + "</li>\
</ul>");
if (_temp_item.weapon_stats.damage != null) {
if (_temp_item.weapon_stats.damage.blunt != null && _temp_item.weapon_stats.damage.blunt != 0) {
$("#sideText").find("#effectsList").wiki("<li>Blunt Damage: " + _temp_item.weapon_stats.damage.blunt + "</li>")
}
if (_temp_item.weapon_stats.damage.pierce != null && _temp_item.weapon_stats.damage.pierce != 0) {
$("#sideText").find("#effectsList").wiki("<li>Pierce Damage: " + _temp_item.weapon_stats.damage.pierce + "</li>")
}
if (_temp_item.weapon_stats.damage.slash != null && _temp_item.weapon_stats.damage.slash != 0) {
$("#sideText").find("#effectsList").wiki("<li>Slash Damage: " + _temp_item.weapon_stats.damage.slash + "</li>")
}
}
},
() => {
$(".combatSide").addClass("hidden");
});
} else if (_t.combat_state.char.equipment.weapon2 == "none") {
$("#attack2 button").hover(() => {
$(".combatSide").removeClass("hidden");
$("#sideTitle").html("Unarmed Attack");
$("#sideText").html("Perform a regular unarmed attack.<br>\
<b>Effects:</b>\
<ul id=\"effectsList\">\
<li>AP: " + setup.show_change_html(0, -2) + "</li>\
<li>Blunt Damage: 1</li>\
</ul>");
},
() => {
$(".combatSide").addClass("hidden");
});
} else {
$("#attack2 button").addClass("disabled");
$("#attack2 button").prop("disabled", true);
}
<</script>><</timed>><</silently>>/* Hide all elements and include UI */
<<run $("#background").html("")>>
<<run $("#background").wiki("<<include combatEngineAfterUI>>")>>
<<run $(".combatSide").addClass("hidden")>>
/* Re-enable menus and exit combat */
<<set $enable_menu = false>>
<<set _combat = false>>
<<unset _retreat_blocked>>
<<include audioEngine>><<for _idx, _opponent range _opponents>>
<<capture _idx>>
<div @id="_opponent.key">
<<if !_combat_state.players[_opponent.key].defeated>>
<<button `setup.titleCase(_opponent.first_name)`>>
/* Modify the last queued action's target to opponent */
<<set _action_queue[_action_queue.length - 1].target = _opponents[_idx].key>>
/* Go to next player */
<<run _change_selection_index(_char_idx + 1)>>
/* Return to menu for next action */
<<run $(".combatActionBar").empty()>>
<<run $(".combatActionBar").wiki("<<include combatEngineActions>>")>>
/* Empty side */
<<run $(".combatSide").addClass("hidden")>>
<</button>>
<<else>>
<<disable>>
<<button "Defeated">><</button>>
<</disable>>
<</if>>
</div>
<</capture>>
<</for>>
<div style="grid-column: 3; grid-row: 4">
@@#attackTargetBack;<<button "Back">>
/* Reset the next planned action */
<<run $("#party" + (_char_idx + 1) + "Info").find("#nextMove").html("")>>
<<set _action_queue.pop()>>
/* Return to previous menu */
<<run $(".combatActionBar").empty()>>
<<run $(".combatActionBar").wiki("<<include combatEngineActions>>")>>
<</button>>@@
</div>
<<silently>><<timed 10ms>>
<<script>>
$(".combatActionBar button").hover((event) => {
let _t = State.temporary;
let self = $(event.currentTarget);
if (self.html() == "Back") {
return;
}
if (self.html() == "Defeated") {
return;
}
let opponent = _t.combat_state.players[self.parent().attr("id")];
$(".combatSide").removeClass("hidden");
$("#sideTitle").html(setup.titleCase(opponent.reference.first_name));
let html_str = "<b>Resist:</b><ul>";
for (let key in opponent.resist) {
if (opponent.resist[key] != 0) {
html_str += "<li>" + setup.titleCase(key) + ": " + opponent.resist[key] + "</li>";
}
}
html_str += "</ul>";
$("#sideText").html(html_str);
},
(event) => {
$(".combatSide").addClass("hidden");
});
<</script>>
<<if _opponents.length gte _selected_weapon>>
<<run $("#" + _opponents[_selected_weapon - 1].key + " button").mouseenter()>>
<</if>>
<</timed>><</silently>>/* Enable combat music */
<<set _combat = true>>
<<include audioEngine>>
/* Disable menu */
<<set $enable_menu = false>>
/* Main combat state */
<<set _combat_state = {
"turn": 0,
"char": $player,
"first_undefeated": 0,
"players": {}
}>>
/* Index of selected party member */
<<set _char_idx = 0>>
/* Opponents in _opponents should all be character objects */
<<if ndef _opponents>>
<<run alert("Error opponents not defined.")>>
<<elseif _opponents.length == 0 || _opponents.length gt 4>>
<<run alert("Invalid number of opponents: " + _opponents.length)>>
<</if>>
/* Hide all elements and include UI */
<<run $("#background").html("")>>
<<run $("#background").wiki("<<include combatEngineUI>>")>>
<<if def _combat_background>>
<<run $(".combatCanvas").css("background", "url(" + _combat_background + ")")>>
<</if>>
/* Include the tutorial */
<<if !$locations.world.data.combatted>>
<<set $locations.world.data.combatted = true>>
<<popover>>
<<include combatTutorial>>
<</popover>>
<</if>>
/* Character-Item-Skill pairs */
<<set _skills = {}>>
/* Setup opponent */
<<for _idx, _opponent range _opponents>>
/* effects.resist are resistance multipliers applied by skills */
/* resist is the total resistance provided by armors (and weapons for shields etc.) */
<<set _combat_state.players[_opponent.key] = {
"AP": 10 + Math.floor((_opponent.conditions.max_stamina - 100) / 10) + $difficulty,
"AP_regen": 2 + Math.floor(_opponent.stats.strength / 30),
"speed": (5 * _opponent.stats.dexterity).clamp(0, 100000),
"defeated": false,
"effects": {
"resist": {}
},
"resist": {
"blunt": 0,
"pierce": 0,
"slash": 0
},
"reference": _opponent,
"info": "#enemy" + (_idx + 1) + "Info",
"bar": "#enemy" + (_idx + 1) + "Bar",
"image": "#enemy" + (_idx + 1) + "Image"
}>>
<<set _skills[_opponent.key] = {}>>
/* Setup item-skill pairs */
<<for _place, _equipment range _opponent.equipment>>
<<if _equipment != "none">>
<<set _temp_item = UInv.GetDefaultItemObject(_equipment)>>
<<if _temp_item.skill != null && _temp_item.skillreq != null>>
<<if _opponent.skills[_temp_item.skill] gte _temp_item.skillreq>>
/* Clone in skills */
<<if _temp_item != null && _temp_item.skills != null>>
<<set _skills[_opponent.key][_equipment] = clone(_temp_item.skills)>>
<</if>>
/* Add in resistances */
<<if _temp_item.armor_stats != null && _temp_item.armor_stats.resist != null>>
<<run setup.apply_delta(_combat_state.players[_opponent.key].resist, _temp_item.armor_stats.resist)>>
<</if>>
<<if _temp_item.weapon_stats != null && _temp_item.weapon_stats.resist != null>>
<<run setup.apply_delta(_combat_state.players[_opponent.key].resist, _temp_item.weapon_stats.resist)>>
<</if>>
<<else>>
/* Add in half of the resistances */
<<set _temp_delta = {"blunt": 0, "pierce": 0, "slash": 0}>>
<<if _temp_item.armor_stats != null && _temp_item.armor_stats.resist != null>>
<<run setup.apply_delta(_temp_delta, _temp_item.armor_stats.resist)>>
<</if>>
<<if _temp_item.weapon_stats != null && _temp_item.weapon_stats.resist != null>>
<<run setup.apply_delta(_temp_delta, _temp_item.weapon_stats.resist)>>
<</if>>
<<run setup.mult_dict(_temp_delta, 0.5)>>
<<run setup.apply_delta(_combat_state.players[_opponent.key].resist, _temp_delta)>>
<</if>>
<<elseif _temp_item.stat != null && _temp_item.statreq != null>>
<<if _opponent.stats[_temp_item.stat] gte _temp_item.statreq>>
<<if _temp_item != null && _temp_item.skills != null>>
<<set _skills[_opponent.key][_equipment] = clone(_temp_item.skills)>>
<</if>>
<<if _temp_item.armor_stats != null && _temp_item.armor_stats.resist != null>>
<<run setup.apply_delta(_combat_state.players[_opponent.key].resist, _temp_item.armor_stats.resist)>>
<</if>>
<<if _temp_item.weapon_stats != null && _temp_item.weapon_stats.resist != null>>
<<run setup.apply_delta(_combat_state.players[_opponent.key].resist, _temp_item.weapon_stats.resist)>>
<</if>>
<<else>>
<<set _temp_delta = {"blunt": 0, "pierce": 0, "slash": 0}>>
<<if _temp_item.armor_stats != null && _temp_item.armor_stats.resist != null>>
<<run setup.apply_delta(_temp_delta, _temp_item.armor_stats.resist)>>
<</if>>
<<if _temp_item.weapon_stats != null && _temp_item.weapon_stats.resist != null>>
<<run setup.apply_delta(_temp_delta, _temp_item.weapon_stats.resist)>>
<</if>>
<<run setup.mult_dict(_temp_delta, 0.5)>>
<<run setup.apply_delta(_combat_state.players[_opponent.key].resist, _temp_delta)>>
<</if>>
<<else>>
<<if _temp_item != null && _temp_item.skills != null>>
<<set _skills[_opponent.key][_equipment] = clone(_temp_item.skills)>>
<</if>>
<<if _temp_item.armor_stats != null && _temp_item.armor_stats.resist != null>>
<<run setup.apply_delta(_combat_state.players[_opponent.key].resist, _temp_item.armor_stats.resist)>>
<</if>>
<<if _temp_item.weapon_stats != null && _temp_item.weapon_stats.resist != null>>
<<run setup.apply_delta(_combat_state.players[_opponent.key].resist, _temp_item.weapon_stats.resist)>>
<</if>>
<</if>>
/* Penalize speed */
<<if _temp_item.armor_stats != null && _temp_item.armor_stats.weight != null>>
<<set _combat_state.players[_opponent.key].speed -= _temp_item.armor_stats.weight>>
<</if>>
<</if>>
<</for>>
<<set _enemy_info = "#enemy" + (_idx + 1) + "Info">>
<<set _enemy_bar = "#enemy" + (_idx + 1) + "Bar">>
<<set _enemy_image = "#enemy" + (_idx + 1) + "Image">>
<<run $(_enemy_info).wiki("<center>\
<b id=\"enemy" + (_idx + 1) + "\" class=\"tool\">" + setup.titleCase(_opponent.first_name) + "</b><br>\
AP: <span id=\"AP\">" + _combat_state.players[_opponent.key].AP + "</span><br></center>")>>
<<if _opponent.images != null && _opponent.images.combat != null>>
<<run $(_enemy_image).css("background-image", "url(" + _opponent.images.combat + ")")>>
<<else>>
<<run $(_enemy_image).css("background-image", (_opponent.gender == 0) ? "url(resources/images/characters/player/0_combat.png)" : "url(resources/images/characters/player/1_combat.png)")>>
<</if>>
<<script>>
$("#enemy" + (State.temporary.idx + 1)).on("click", (event) => {
let self = $(event.currentTarget);
State.temporary.char = State.temporary.opponents[Number(setup.numerize(self.attr("id"))) - 1];
$.wiki("<<popover>>\
<center><h2>" + State.temporary.char.name() + "</h2></center>\
The following are combat statistics accounting for weapons and equipment.\
<<include characterMenuCombatStats>>\
<" + "</popover>>");
});
<</script>>
<<run $(_enemy_bar).wiki("<center style=\"position: absolute; bottom: 0; width: calc(100% - 20px);\">\
<<showmeter \"enemy" + (_idx + 1) + "Health\" `_opponent.conditions.health / _opponent.conditions.max_health`>>\
</center>")>>
<</for>>
/* Setup player party */
<<set _party = [$player]>>
<<for _idx, _member range $player.party>>
<<set _party.push($characters[_member])>>
<</for>>
<<for _idx, _member range _party>>
<<set _combat_state.players[_member.key] = {
"AP": 10 + Math.floor((_member.conditions.max_stamina - 100) / 10) + $difficulty,
"AP_regen": 2 + Math.floor(_member.stats.strength / 30),
"speed": (5 * _member.stats.dexterity).clamp(0, 100000),
"defeated": false,
"effects": {
"resist": {}
},
"resist": {
"blunt": 0,
"pierce": 0,
"slash": 0
},
"reference": _member,
"info": "#party" + (_idx + 1) + "Info",
"bar": null
}>>
<<set _skills[_member.key] = {}>>
/* Setup item-skill pairs */
<<for _place, _equipment range _member.equipment>>
<<if _equipment != "none">>
<<set _temp_item = UInv.GetDefaultItemObject(_equipment)>>
<<if _temp_item.skill != null && _temp_item.skillreq != null>>
<<if _member.skills[_temp_item.skill] gte _temp_item.skillreq>>
/* Clone in skills */
<<if _temp_item != null && _temp_item.skills != null>>
<<set _skills[_member.key][_equipment] = clone(_temp_item.skills)>>
<</if>>
/* Add in resistances */
<<if _temp_item.armor_stats != null && _temp_item.armor_stats.resist != null>>
<<run setup.apply_delta(_combat_state.players[_member.key].resist, _temp_item.armor_stats.resist)>>
<</if>>
<<if _temp_item.weapon_stats != null && _temp_item.weapon_stats.resist != null>>
<<run setup.apply_delta(_combat_state.players[_member.key].resist, _temp_item.weapon_stats.resist)>>
<</if>>
<<else>>
/* Add in half of the resistances */
<<set _temp_delta = {"blunt": 0, "pierce": 0, "slash": 0}>>
<<if _temp_item.armor_stats != null && _temp_item.armor_stats.resist != null>>
<<run setup.apply_delta(_temp_delta, _temp_item.armor_stats.resist)>>
<</if>>
<<if _temp_item.weapon_stats != null && _temp_item.weapon_stats.resist != null>>
<<run setup.apply_delta(_temp_delta, _temp_item.weapon_stats.resist)>>
<</if>>
<<run setup.mult_dict(_temp_delta, 0.5)>>
<<run setup.apply_delta(_combat_state.players[_member.key].resist, _temp_delta)>>
<</if>>
<<elseif _temp_item.stat != null && _temp_item.statreq != null>>
<<if _member.stats[_temp_item.stat] gte _temp_item.statreq>>
<<if _temp_item != null && _temp_item.skills != null>>
<<set _skills[_member.key][_equipment] = clone(_temp_item.skills)>>
<</if>>
<<if _temp_item.armor_stats != null && _temp_item.armor_stats.resist != null>>
<<run setup.apply_delta(_combat_state.players[_member.key].resist, _temp_item.armor_stats.resist)>>
<</if>>
<<if _temp_item.weapon_stats != null && _temp_item.weapon_stats.resist != null>>
<<run setup.apply_delta(_combat_state.players[_member.key].resist, _temp_item.weapon_stats.resist)>>
<</if>>
<<else>>
<<set _temp_delta = {"blunt": 0, "pierce": 0, "slash": 0}>>
<<if _temp_item.armor_stats != null && _temp_item.armor_stats.resist != null>>
<<run setup.apply_delta(_temp_delta, _temp_item.armor_stats.resist)>>
<</if>>
<<if _temp_item.weapon_stats != null && _temp_item.weapon_stats.resist != null>>
<<run setup.apply_delta(_temp_delta, _temp_item.weapon_stats.resist)>>
<</if>>
<<run setup.mult_dict(_temp_delta, 0.5)>>
<<run setup.apply_delta(_combat_state.players[_member.key].resist, _temp_delta)>>
<</if>>
<<else>>
<<if _temp_item != null && _temp_item.skills != null>>
<<set _skills[_member.key][_equipment] = clone(_temp_item.skills)>>
<</if>>
<<if _temp_item.armor_stats != null && _temp_item.armor_stats.resist != null>>
<<run setup.apply_delta(_combat_state.players[_member.key].resist, _temp_item.armor_stats.resist)>>
<</if>>
<<if _temp_item.weapon_stats != null && _temp_item.weapon_stats.resist != null>>
<<run setup.apply_delta(_combat_state.players[_member.key].resist, _temp_item.weapon_stats.resist)>>
<</if>>
<</if>>
/* Penalize speed */
<<if _temp_item.armor_stats != null && _temp_item.armor_stats.weight != null>>
<<set _combat_state.players[_member.key].speed -= _temp_item.armor_stats.weight>>
<</if>>
<</if>>
<</for>>
<<set _party_info = "#party" + (_idx + 1) + "Info">>
<<run $(_party_info).wiki("<center>\
<b id=\"party" + (_idx + 1) + "\" class=\"tool\">" + setup.titleCase(_member.first_name) + "</b><br>\
AP: <span id=\"AP\">" + _combat_state.players[_member.key].AP + "</span><br></center>")>>
<<script>>
$("#party" + (State.temporary.idx + 1)).on("click", (event) => {
let self = $(event.currentTarget);
State.temporary.char = State.temporary.party[Number(setup.numerize(self.attr("id"))) - 1];
$.wiki("<<popover>>\
<center><h2>" + State.temporary.char.name() + "</h2></center>\
The following are combat statistics accounting for weapons and equipment.\
<<include characterMenuCombatStats>>\
<" + "</popover>>");
});
<</script>>
<<run $(_party_info).wiki("<center class=\"combatBar\">\
<<showmeter \"party" + (_idx + 1) + "Health\" `_member.conditions.health / _member.conditions.max_health`>>\
</center>")>>
<<run $(_party_info).wiki("<center id=\"nextMove\"></center>")>>
<</for>>
/* Setup action queue */
<<set _action_queue = []>>
/* Functions */
<<silently>><<script>>
let _t = State.temporary;
let _v = State.variables;
_t.change_selection_index = function(idx) {
if (_t.party.length <= idx) {
_t.simulate_opponents();
_t.start_round();
if (_t.combat_result != null && _t.combat_result != "none") {
return;
}
_t.accumulate_AP();
_t.update_UI();
_t.change_selection_index(0);
/* Forward one turn */
_t.combat_state.turn += 1;
/* Reset queued actions */
for (let i = _t.combat_state.first_undefeated; i < _t.party.length; i++) {
if (!_t.combat_state.players[_t.party[i].key].defeated) {
$("#party" + (i + 1) + "Info").find("#nextMove").html("");
}
}
} else {
if (_t.combat_state.players[_t.party[idx].key].defeated && (_t.char_idx < idx || (_t.char_idx == _t.party.length - 1 && idx == 0))) {
/* Skip defeated members */
_t.char_idx = idx;
return _t.change_selection_index(idx + 1);
} else if (_t.combat_state.players[_t.party[idx].key].defeated && _t.char_idx > idx) {
/* Going backward */
_t.char_idx = idx;
return _t.change_selection_index(idx - 1);
}
_t.char_idx = idx;
_t.combat_state.char = _t.party[idx];
$(".combatPartyInfo").addClass("combatInactive");
$("#party" + (idx + 1) + "Info.combatPartyInfo").removeClass("combatInactive");
if (idx == _t.combat_state.first_undefeated) {
$("#actionBackContainer").addClass("hidden");
} else {
$("#actionBackContainer").removeClass("hidden");
}
}
};
_t.simulate_opponents = function() {
for (let opponent of _t.opponents) {
let action = _t.auto_action(opponent, _t.party);
_t.action_queue.push(action);
}
};
_t.auto_action = function(char, opponents) {
let avail_moves = [];
for (let equipment in _t.skills[char.key]) {
for (let skill of _t.skills[char.key][equipment]) {
if (-1 * setup.combat_skills[skill](null, char).AP <= _t.combat_state.players[char.key].AP) {
avail_moves.push(setup.combat_skills[skill](UInv.GetDefaultItemObject(equipment), char));
avail_moves[avail_moves.length - 1].flavor_text = "performed a <b>" + setup.titleCase(skill) + "</b>";
avail_moves[avail_moves.length - 1].item = equipment;
if (avail_moves[avail_moves.length - 1].type == "attack") {
avail_moves[avail_moves.length - 1].flavor_text += " on";
}
}
}
}
let punch = {
"source": char.key,
"target": "self",
"AP": -2,
"damage": {
"blunt": 1
},
"item": "none",
"item_name": "fist",
"priority": 1,
"type": "attack",
"flavor_text": "punched"
};
if (char.equipment.weapon1 == "none" && char.equipment.weapon2 == "none" && _t.combat_state.players[char.key].AP >= 2) {
avail_moves.push(punch);
} else if (char.equipment.weapon1 != "none") {
let temp_item = UInv.GetDefaultItemObject(char.equipment.weapon1);
if (!temp_item.type.includes("shield") && _t.combat_state.players[char.key].AP >= temp_item.weapon_stats.weight) {
let temp_damage = temp_item.weapon_stats.damage;
let temp_resist = temp_item.weapon_stats.resist;
if (temp_item.skill != null && char.skills[temp_item.skill] < temp_item.skillreq) {
setup.mult_dict(temp_damage, 0.5);
setup.mult_dict(temp_resist, 0.5);
} else if (temp_item.stat != null && char.stats[temp_item.stat] < temp_item.statreq) {
setup.mult_dict(temp_damage, 0.5);
setup.mult_dict(temp_resist, 0.5);
}
avail_moves.push({
"source": char.key,
"target": null,
"AP": -1 * temp_item.weapon_stats.weight,
"damage": temp_damage,
"resist": temp_resist,
"item": char.equipment.weapon1,
"item_name": temp_item.name,
"priority": 1,
"type": "attack",
"flavor_text": "used " + temp_item.singular + " to attack"
});
} else if (temp_item.type.includes("shield") && char.equipment.weapon2 == "none" && _t.combat_state.players[char.key].AP >= 2) {
avail_moves.push(punch);
}
} else if (char.equipment.weapon2 != "none") {
let temp_item = UInv.GetDefaultItemObject(char.equipment.weapon2);
if (!temp_item.type.includes("shield") && _t.combat_state.players[char.key].AP >= temp_item.weapon_stats.weight) {
let temp_damage = temp_item.weapon_stats.damage;
let temp_resist = temp_item.weapon_stats.resist;
if (temp_item.skill != null && char.skills[temp_item.skill] < temp_item.skillreq) {
setup.mult_dict(temp_damage, 0.5);
setup.mult_dict(temp_resist, 0.5);
} else if (temp_item.stat != null && char.stats[temp_item.stat] < temp_item.statreq) {
setup.mult_dict(temp_damage, 0.5);
setup.mult_dict(temp_resist, 0.5);
}
avail_moves.push({
"source": char.key,
"target": null,
"AP": -1 * temp_item.weapon_stats.weight,
"damage": temp_damage,
"resist": temp_resist,
"item": char.equipment.weapon2,
"item_name": temp_item.name,
"priority": 1,
"type": "attack",
"flavor_text": "used " + temp_item.singular + " to attack"
});
} else if (temp_item.type.includes("shield") && char.equipment.weapon1 == "none" && _t.combat_state.players[char.key].AP >= 2) {
avail_moves.push(punch);
}
}
/* Sort moves by most damage, most resist, least AP, most priority */
avail_moves.sort((a, b) => {
/* Check damage */
if (a.damage != null && b.damage != null) {
let a_damage = 0;
let b_damage = 0;
for (let damage_type in a.damage) {
a_damage += a.damage[damage_type];
}
for (let damage_type in b.damage) {
b_damage += b.damage[damage_type];
}
if (a_damage != b_damage) {
return b_damage - a_damage;
}
} else if (a.damage == null) {
return 1;
} else if (b.damage == null) {
return -1;
}
/* Check resist */
if (a.resist != null && b.resist != null) {
let a_resist = 0;
let b_resist = 0;
for (let damage_type in a.damage) {
a_resist += a.damage[damage_type];
}
for (let damage_type in b.damage) {
b_resist += b.damage[damage_type];
}
if (a_resist != b_resist) {
return b_resist - a_resist;
}
} else if (a.resist == null) {
return 1;
} else if (b.resist == null) {
return -1;
}
/* Check AP */
if (a.AP != b.AP) {
return b.AP - a.AP;
}
/* Check priority */
return b.priority - a.priority;
});
if (avail_moves.length != 0) {
let selected_move = (randomFloat(1.0) < 0.25) ? either(avail_moves) : avail_moves[0];
if (selected_move.type != null && selected_move.type == "attack") {
selected_move.target = null;
while (selected_move.target == null) {
let temp_selection = either(opponents);
if (!_t.combat_state.players[temp_selection.key].defeated) {
selected_move.target = temp_selection.key;
}
}
} else {
selected_move.target = "self";
}
return selected_move;
} else {
return {
"source": char.key,
"target": "self",
"AP": 2,
"item": "none",
"item_name": null,
"flavor_text": "rested, restoring " + setup.show_change_html(0, 2) + " AP.",
"priority": 4,
"type": "passive"
};
}
};
_t.start_round = function() {
$(".combatLog").append("<h3><center>Turn: " + (_t.combat_state.turn + 1) + "</center></h3>");
_t.action_queue.sort((a, b) => {
if (a.priority < b.priority) {
return -1;
} else if (a.priority > b.priority) {
return 1;
} else {
if (_t.combat_state.players[a.source].speed < _t.combat_state.players[a.source].speed) {
return 1;
} else if (_t.combat_state.players[a.source].speed > _t.combat_state.players[a.source].speed) {
return -1;
} else {
return (randomFloat(1.0) < 0.5) ? 1 : -1;
}
}
});
/* Set for all the weapons used in a turn */
_t.weapons_used = new Set();
while (_t.action_queue.length > 0) {
let action = _t.action_queue.pop();
_t.apply_action(action);
}
if (_t.combat_result == null || _t.combat_result == "none") {
let elem = document.getElementById("combatLogContainer");
elem.scrollTop = elem.scrollHeight;
/* Play sounds */
let temp_array = Array.from(_t.weapons_used);
let loop = (val) => {
setTimeout(() => {
if (setup.SOUNDS[val] != null) {
$.wiki("<<audio " + either(setup.SOUNDS[val]) + " play>>");
}
if (temp_array.length != 0) {
loop(temp_array.pop());
}
}, 100);
};
loop();
}
};
_t.apply_action = function(action) {
/* Add to weapons_used set */
if (action.item != "none") {
let temp_item = UInv.GetDefaultItemObject(action.item);
if (temp_item.type.contains("sword") && _t.weapons_used != null) {
_t.weapons_used.add("sword");
}
}
let subject = "<b>" + setup.titleCase(_t.combat_state.players[action.source].reference.first_name) + "</b>";
let subject_pos = subject + "\'s";
if (action.source == "player") {
subject = "<b>You</b>";
subject_pos = "<b>Your</b>";
}
let flavor_text = "";
if (!_t.combat_state.players[action.source].defeated) {
let target = action.target;
/* Change AP according to action */
_t.combat_state.players[action.source].AP += action.AP;
if (action.flavor_text != null) {
flavor_text += subject + " " + action.flavor_text + " ";
if (target != "self") {
flavor_text += setup.titleCase(_t.combat_state.players[target].reference.first_name);
}
}
/* Apply resistances to self */
if (action.resist != null) {
setup.apply_delta_merge(_t.combat_state.players[action.source].effects.resist, action.resist);
flavor_text += " readying for the next attack";
}
if (target == "self" || _t.combat_state.players[target].defeated) {
$(".combatLog").append("<hr>" + flavor_text + ".<br>");
return;
}
/* Simulate accuracy */
if (action.accuracy != null && randomFloat(1.0) > action.accuracy) {
flavor_text += " however missed!";
$(".combatLog").append("<hr>" + flavor_text + "<br>");
return;
}
/* Simulate damage */
let damage = action.damage;
let target_resist = _t.combat_state.players[target].resist;
let target_resist_effect = _t.combat_state.players[target].effects.resist;
for (let resist_key in damage) {
if (resist_key in target_resist) {
damage[resist_key] = (damage[resist_key] - target_resist[resist_key]).clamp(0, 1000000);
}
if (resist_key in target_resist_effect) {
damage[resist_key] *= target_resist_effect[resist_key];
}
}
let total_damage = 1;
for (let key in damage) {
total_damage += damage[key];
}
/* Reset targets resist effects */
_t.combat_state.players[target].effects.resist = {};
flavor_text += " dealing a total of " + setup.round2(total_damage) + " point(s) of damage!";
_t.combat_state.players[target].reference.conditions.health -= total_damage;
/* Remove defeated enemies from battle */
if (_t.combat_state.players[target].reference.conditions.health <= 0) {
_t.combat_state.players[target].reference.conditions.health = 0;
_t.combat_state.players[target].defeated = true;
if (_t.combat_state.players[target].info != null) {
$(_t.combat_state.players[target].info).addClass("combatDefeated");
}
if (_t.combat_state.players[target].bar != null) {
$(_t.combat_state.players[target].bar).addClass("combatDefeated");
}
/* Check if either side won */
let result = "party";
for (let i = 0; i < _t.opponents.length; i++) {
if (!_t.combat_state.players[_t.opponents[i].key].defeated) {
result = "enemy";
break;
}
}
if (result != "party") {
for (let i = 0; i < _t.party.length; i++) {
if (!_t.combat_state.players[_t.party[i].key].defeated) {
result = "none";
} else {
$(_t.combat_state.players[_t.party[i].key].info).find("#nextMove").html("Defeated");
if (i == _t.combat_state.first_undefeated) {
_t.combat_state.first_undefeated += 1;
}
}
}
}
if (result == "party") {
_t.combat_result = "win";
$.wiki("<<include combatEngineAfter>>");
return;
} else if (result == "enemy") {
_t.combat_result = "lose";
$.wiki("<<include combatEngineAfter>>");
return;
} else {
delete _t.combat_result;
}
}
/* Append flavor text to combat log */
$(".combatLog").append("<hr>" + flavor_text + "<br>");
}
};
/* Adds AP to every undefeated player */
_t.accumulate_AP = function() {
for (let player in _t.combat_state.players) {
if (!_t.combat_state.players[player].defeated) {
_t.combat_state.players[player].AP += _t.combat_state.players[player].AP_regen;
}
}
};
_t.update_UI = function() {
/* Update bars */
for (let i = 0; i < _t.party.length; i++) {
_t.member = _t.party[i];
$("#party" + (i + 1) + "Info").find("#AP").html(_t.combat_state.players[_t.member.key].AP);
$.wiki("<" + "<updatemeter \"party" + (i + 1) + "Health\" `_member.conditions.health / _member.conditions.max_health`>>");
}
for (let i = 0; i < _t.opponents.length; i++) {
_t.opponent = _t.opponents[i];
$("#enemy" + (i + 1) + "Info").find("#AP").html(_t.combat_state.players[_t.opponent.key].AP);
$.wiki("<" + "<updatemeter \"enemy" + (i + 1) + "Health\" `_opponent.conditions.health / _opponent.conditions.max_health`>>");
}
}
<</script>><</silently>><<set _num_skills = 0>>
<<set _third_skill = null>>
<<for _item, _skill_ar range _skills[_combat_state.char.key]>>
<<for _idx, _skill range _skill_ar>>
<<capture _item, _skill, _num_skills>>
<div @id="_skill" @title="_item">
<<button `setup.titleCase(_skill)`>>
<<if -1 * setup.combat_skills[_skill](null, _combat_state.char).AP lte _combat_state.players[_combat_state.char.key].AP>>
<<set _selected_skill = _num_skills + 1>>
<<set _temp_delta = clone(setup.combat_skills[_skill](UInv.GetDefaultItemObject(_item), _combat_state.char))>>
<<set _temp_delta.source = _combat_state.char.key>>
<<set _temp_delta.target = null>>
<<set _temp_delta.item = _item>>
<<set _temp_delta.flavor_text = "performed a <b>" + setup.titleCase(_skill) + "</b>">>
<<run $("#party" + (_char_idx + 1) + "Info").find("#nextMove").html(setup.titleCase(_skill))>>
<<if _temp_delta.type == "attack">>
<<run $(".combatActionBar").empty()>>
<<run $(".combatActionBar").wiki("<<include combatEngineSkillsTargetOptions>>")>>
<<set _temp_delta.flavor_text += " on">>
/* Push onto queue */
<<set _action_queue.push(_temp_delta)>>
<<elseif _temp_delta.type == "passive">>
<<set _temp_delta.target = "self">>
/* Push onto queue */
<<set _action_queue.push(_temp_delta)>>
/* Go to next player */
<<run _change_selection_index(_char_idx + 1)>>
/* Return to menu for next action */
<<run $(".combatActionBar").empty()>>
<<run $(".combatActionBar").wiki("<<include combatEngineActions>>")>>
<</if>>
<<run $(".combatSide").addClass("hidden")>>
<<else>>
<<notify>>Not enough AP.<</notify>>
<</if>>
<</button>>
</div>
<</capture>>
<<set _num_skills += 1>>
<<if _num_skills == 3>>
<<set _third_skill = _skill>>
<</if>>
<</for>>
<</for>>
<div style="grid-column: 3; grid-row: 4">
@@#skillsBack;<<button "Back">>
<<script>>
$(".combatActionBar").empty();
$(".combatActionBar").wiki("<<include combatEngineActions>>");
<</script>>
<</button>>@@
</div>
<<silently>><<timed 10ms>>
<<script>>
$(".combatActionBar").find("button").hover((event) => {
let _t = State.temporary;
let _v = State.variables;
let self = $(event.currentTarget);
if (self.html() == "Back") {
return;
}
let skill = self.parent().attr("id");
_t.temp_item = UInv.GetDefaultItemObject(self.parent().attr("title"));
$(".combatSide").removeClass("hidden");
$("#sideTitle").html(setup.titleCase(skill));
$("#sideText").empty();
$("#sideText").wiki("<<displaycombatskill " + skill + " _temp_item _combat_state.char>>");
},
() => {
$(".combatSide").addClass("hidden");
});
<</script>>
<<if _third_skill != null>>
<<run $("#" + _third_skill + " button").mouseenter()>>
<</if>>
<</timed>><</silently>><<for _idx, _opponent range _opponents>>
<<capture _idx>>
<div @id="_opponent.key">
<<if !_combat_state.players[_opponent.key].defeated>>
<<button `setup.titleCase(_opponent.first_name)`>>
/* Modify the last queued action's target to opponent */
<<set _action_queue[_action_queue.length - 1].target = _opponents[_idx].key>>
/* Go to next player */
<<run _change_selection_index(_char_idx + 1)>>
/* Return to menu for next action */
<<run $(".combatActionBar").empty()>>
<<run $(".combatActionBar").wiki("<<include combatEngineActions>>")>>
/* Empty side */
<<run $(".combatSide").addClass("hidden")>>
<</button>>
<<else>>
<<disable>>
<<button "Defeated">><</button>>
<</disable>>
<</if>>
</div>
<</capture>>
<</for>>
<div style="grid-column: 3; grid-row: 4">
@@#attackTargetBack;<<button "Back">>
/* Reset the next planned action */
<<run $("#party" + (_char_idx + 1) + "Info").find("#nextMove").html("")>>
<<set _action_queue.pop()>>
/* Return to previous menu */
<<run $(".combatActionBar").empty()>>
<<run $(".combatActionBar").wiki("<<include combatEngineSkillsOptions>>")>>
<</button>>@@
</div>
<<silently>><<timed 10ms>>
<<script>>
$(".combatActionBar button").hover((event) => {
let _t = State.temporary;
let self = $(event.currentTarget);
if (self.html() == "Back") {
return;
}
if (self.html() == "Defeated") {
return;
}
let opponent = _t.combat_state.players[self.parent().attr("id")];
$(".combatSide").removeClass("hidden");
$("#sideTitle").html(setup.titleCase(opponent.reference.first_name));
let html_str = "<b>Resist:</b><ul>";
for (let key in opponent.resist) {
if (opponent.resist[key] != 0) {
html_str += "<li>" + setup.titleCase(key) + ": " + opponent.resist[key] + "</li>";
}
}
html_str += "</ul>";
$("#sideText").html(html_str);
},
(event) => {
$(".combatSide").addClass("hidden");
});
<</script>>
<<if _opponents.length gte _selected_skill>>
<<run $("#" + _opponents[_selected_skill - 1].key + " button").mouseenter()>>
<</if>>
<</timed>><</silently>><<nobr>>
<<widget "disableactions">>
/* Hide back and leave buttons */
<<if ndef _disable_buttons || _disable_buttons>>
<<run $('[id="events_actions_back"]').addClass("hidden")>>
<<run $('[id="events_actions_leave"]').addClass("hidden")>>
<<else>>
<<run $('[id="events_actions_back"]').removeClass("hidden")>>
<<run $('[id="events_actions_leave"]').removeClass("hidden")>>
<</if>>
<<if def $args[0] && $args[0] instanceof jQuery>>
<<for _i = 1; _i lt 16; _i++>>
<<if $args[0].find("#li" + _i).length gt 0 && $("#events" + _i + " button").length gt 0>>
<<if $args[0].find("#li" + _i).css("text-decoration") == "line-through">>
<<run $('[id="events' + _i + '"]').find("button").prop("disabled", true)>>
<<run $('[id="events' + _i + '"]').find("button").addClass("disabled")>>
<<else>>
<<run $('[id="events' + _i + '"]').find("button").prop("disabled", false)>>
<<run $('[id="events' + _i + '"]').find("button").removeClass("disabled")>>
<</if>>
<<else>>
<<if $("#events" + _i + " button").length gt 0>>
<<run $('[id="events' + _i + '"]').find("button").prop("disabled", true)>>
<<run $('[id="events' + _i + '"]').find("button").addClass("disabled")>>
<</if>>
<</if>>
<</for>>
<<else>>
<<for _i = 1; _i lt _choices + 1; _i++>>
<<if $("#events" + _i + " button").length gt 0>>
<<run $('[id="events' + _i + '"]').find("button").prop("disabled", false)>>
<<run $('[id="events' + _i + '"]').find("button").removeClass("disabled")>>
<</if>>
<</for>>
<<for _i = _choices + 1; _i lt 13; _i++>>
<<if $("#events" + _i + " button").length gt 0>>
<<run $('[id="events' + _i + '"]').find("button").prop("disabled", true)>>
<<run $('[id="events' + _i + '"]').find("button").addClass("disabled")>>
<</if>>
<</for>>
<</if>>
<<unset _choices>>
<<unset _disable_buttons>>
<</widget>>
<</nobr>><div id="events_actions" class="action container row col" style="--rows: 4; --cols: 5">
@@#events1;<<button "1">>
<<set _action = 1>>
<</button>>@@
@@#events2;<<button "2">>
<<set _action = 2>>
<</button>>@@
@@#events3;<<button "3">>
<<set _action = 3>>
<</button>>@@
@@#events4;<<button "4">>
<<set _action = 4>>
<</button>>@@
@@#events5;<<button "5">>
<<set _action = 5>>
<</button>>@@
@@#events6;<<button "6">>
<<set _action = 6>>
<</button>>@@
@@#events7;<<button "7">>
<<set _action = 7>>
<</button>>@@
@@#events8;<<button "8">>
<<set _action = 8>>
<</button>>@@
@@#events9;<<button "9">>
<<set _action = 9>>
<</button>>@@
@@#events10;<<button "10">>
<<set _action = 10>>
<</button>>@@
@@#events11;<<button "11">>
<<set _action = 11>>
<</button>>@@
@@#events12;<<button "12">>
<<set _action = 12>>
<</button>>@@
@@#events13;<<button "13">>
<<set _action = 13>>
<</button>>@@
@@#events14;<<button "14">>
<<set _action = 14>>
<</button>>@@
@@#events15;<<button "15">>
<<set _action = 15>>
<</button>>@@
<<set $buttons = []>>
<<for _i = 1; _i lte 15; _i++>>
<<set $buttons.push("#events" + _i)>>
<</for>>
</div>/*
Assumes varible _t.event_tree is
[
[string1, string2, ..., stringn],
[f1() => {}, f2() => {}, ..., fn() => {}]
]
where every function will return a new event tree with null functions if end of event. It will also
return an end_hook function, which will be called when the text appending is over. This end_hook is also used at the end of the event
to return to the main passage. Finally, it will return a boolean indicating whether the event is over or not, as well as a do_nothing boolean
indicating whether to process the button click or not (ie for useless button clicks).
*/
<<script>>
let _t = State.temporary;
let _v = State.variables;
if (_t.event_path === "undefined") {
_t.event_path = [];
}
if (_t.event_tree === "undefined") {
alert("Error: event tree is undefined.");
}
$("#events_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
let choice_idx = Number(self.html()) - 1;
let [next_branch, end_hook, is_event_end, do_nothing, is_dialogue_option] = _t.event_tree[1][choice_idx]();
let responses = next_branch[0];
if (!do_nothing) {
if (is_event_end) {
_t.event_tree = next_branch;
_t.event_path.push(choice_idx + 1);
/* Return to main, send responses to append */
_v._temp_to_log = responses.join(" ");
end_hook();
} else if (is_dialogue_option) {
_t.options = _t.event_tree[0][_t.event_tree[0].length - 1].clone();
_t.options.find("#li" + (choice_idx + 1)).css("text-decoration", "line-through");
$.wiki("<<disableactions _options>>");
responses.push(_t.options);
/* Reinsert to disallow choice repetition later on */
_t.event_tree[0][_t.event_tree[0].length - 1] = _t.options;
setup.mainLog_append_delayed(responses, _v.buttons, _v.buttons_extra, 1000, true, null, end_hook);
} else {
_t.event_tree = next_branch;
_t.event_path.push(choice_idx + 1);
_t.options = responses[responses.length - 1];
$.wiki("<<disableactions _options>>");
setup.mainLog_append_delayed(responses, _v.buttons, _v.buttons_extra, 1000, true, null, end_hook);
}
}
});
<</script>><div id="gift_actions" class="action container row col"
style="--rows: 4; --cols: 5">
/* Fill up 5th column to prevent overflow */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<script>>
$(State.temporary.back_action).removeClass("hidden");
$("#gift_actions").remove();
<</script>>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = passage()>>
<<include locationButton>>
</div>
<<if UInv.BagHasItem("inventory", "candy") gt 0>>
@@#candy;<<button "Candy">>
<</button>>@@
<<else>>
<<disable>><<button "Candy">><</button>><</disable>>
<</if>>
<<if UInv.BagHasItem("inventory", "flowers") gt 0>>
@@#flowers;<<button "Flowers">>
<</button>>@@
<<else>>
<<disable>><<button "Flowers">><</button>><</disable>>
<</if>>
<<if UInv.BagHasItem("inventory", "perfume") gt 0>>
@@#perfume;<<button "Perfume">>
<</button>>@@
<<else>>
<<disable>><<button "Perfume">><</button>><</disable>>
<</if>>
<<if UInv.BagHasItem("inventory", "lingerie") gt 0>>
@@#lingerie;<<button "Lingerie">>
<</button>>@@
<<else>>
<<disable>><<button "Lingerie">><</button>><</disable>>
<</if>>
<<if UInv.BagHasItem("inventory", "dildo") gt 0>>
@@#dildo;<<button "Dildo">>
<</button>>@@
<<else>>
<<disable>><<button "Dildo">><</button>><</disable>>
<</if>>
</div>
<<timed 30ms>><<script>>
let _v = State.variables;
let _t = State.temporary;
let valid_gifts = [
"candy", "flowers", "perfume", "lingerie", "dildo"
];
let gift_buttons = [
"#candy", "#flowers", "#perfume", "#lingerie", "#dildo"
];
let has_valid_gift = false;
for (const gift of valid_gifts) {
if (UInv.BagHasItem("inventory", gift) > 0) {
has_valid_gift = true;
break;
}
}
if (!has_valid_gift) {
$.wiki("<<notify>>No valid gifts, consider buying some at the market stalls.<</notify>>");
}
$("#gift_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
/* Filter out non-action buttons */
if (self.html() == "Back" || self.html() == "Leave") {
return;
}
/* Make sure that player has item */
let item = self.html().toLowerCase();
if (UInv.BagHasItem("inventory", item) <= 0) {
alert(`Error: No item ${item}! Please report bug!`);
return;
}
let char = _v.characters[_v.selected];
let [responses, delta_dict, gift_given] = setup.gift(_v.player, item, char, null, "inventory", true);
setup.mainLog_append_delayed(responses, gift_buttons, null, 1000, true, null,
() => {
$(State.temporary.back_action).removeClass("hidden");
$("#gift_actions").remove();
if (gift_given) {
UInv.DeleteItem("inventory", item);
}
/* Update disposition */
$("#char_quick_info").empty();
$("#char_quick_info").html(`<b>${setup.titleCase(char.first_name)}'s Disposition: </b>` + setup.titleCase(char.get_disposition()));
$("#mainLogCharacterImage").css("background-image", "url(\"" + char.image_folder() + char.first_name.toLowerCase() + "_" + char.get_disposition() + ".png\")");
}
);
});
<</script>><</timed>><<nobr>>
/* Roll tact for success */
<<set _roll = $player.get_status_prop("tact") + 2 * (dice(1, 6 + $difficulty) - $difficulty)
- _char.mental_conditions.anger + _char.slave_traits.trust / 20
>>
<<set _max_roll = $player.get_status_prop("tact") + 2 * 6
- _char.mental_conditions.anger + _char.slave_traits.trust / 20>>
/* Silver tongue title */
<<if $player.titles.has("silver_tongued")>>
<<set _roll += 1>>
<<set _max_roll += 1>>
<</if>>
<<set _thresh = 25 + 5 * (-1/100 * _char.slave_traits.obedience)>>
<<if _roll gte _thresh>>
<<set _success = true>>
<<set _responses = [setup.pass("tact", false)]>>
<<set _responses = _responses.concat( setup.influence.compliment.success.random())>>
<<if _char.slave_traits.obedience gte 80>>
<<set _responses.push(setup.titleCase(_char.first_name) + " smiles warmly,")>>
<<set _response = _char.dialogue("Thanks!") +
"(" + setup.titleCase(_char.first_name) + "\'s " + "Affection " + setup.show_change_html(0, 0.25)
>>
<<set _char.slave_traits.obedience += 0.25>>
<<elseif _char.slave_traits.obedience gte 60>>
<<set _responses.push(setup.titleCase(_char.first_name) + " smiles warmly,")>>
<<set _response = _char.dialogue("Thanks!") +
"(" + setup.titleCase(_char.first_name) + "\'s " + "Affection " + setup.show_change_html(0, 0.5)
>>
<<set _char.slave_traits.obedience += 0.5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " is momentarily caught off guard,")>>
<<set _response = _char.dialogue("Th... thanks, I guess.") +
"(" + setup.titleCase(_char.first_name) + "\'s " + "Affection " + setup.show_change_html(0, 2)
>>
<<set _char.slave_traits.obedience += 2>>
<</if>>
<<if _char.mental_conditions.sadness gt 0>>
<<set _response += "Sadness " + setup.show_change_html(0, -5, false)>>
<<set _char.mental_conditions.sadness -= 5>>
<</if>>
<<set _response += ").">>
<<else>>
<<set _success = false>>
<<set _responses = [setup.fail("tact", false)]>>
<<set _responses = _responses.concat( setup.influence.compliment.fail.random())>>
<<set _response = setup.titleCase(_char.first_name) + " looks at you with an \
unimpressed stare, but luckily it looks like your failed attempt has not \
lowered " + setup.his(_char) + " opinion of you.">>
<</if>>
/* Check if was skillful roll */
<<if Math.abs(_max_roll - _thresh) lte 1 && (_max_roll - _roll) lte 1>>
<<set _probability = setup.sigmoid(-1 * $difficulty)>>
<<set _sub_roll = Math.random()>>
<<if _roll lt _probability>>
<<set _response += "<br><br>">>
<<if _success>>
<<set _response += "You can tell that compliment barely passed, but luckily your \
skill in speechcraft let you prevail. <span style=\'text: green\'>\
Your tact increased by 1!</span>">>
<<else>>
<<set _response += "You can tell that compliment almost landed, you\'ll have to \
work harder next time. <span style=\'text: green\'>\
Your tact increased by 1!</span>">>
<</if>>
<<set $player.stats.tact += 1>>
<</if>>
<<unset _probability>>
<<unset _sub_roll>>
<</if>>
<<set _responses.push(_response)>>
<<set _to_round = $selected>>
<<include round>>
<<if def _options>>
<<set _responses.push(_options.clone())>>
<</if>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<unset _response>>
<<unset _responses>>
<<unset _to_round>>
<</nobr>><<nobr>>
/* Roll tact for success */
<<set _roll = $player.get_status_prop("tact") + 2 * (dice(1, 6 + $difficulty) - $difficulty)
- _char.mental_conditions.anger + _char.slave_traits.trust / 20
>>
<<set _max_roll = $player.get_status_prop("tact") + 2 * 6
- _char.mental_conditions.anger + _char.slave_traits.trust / 20>>
<<set _thresh = 27 + 5 * (-1/100 * _char.slave_traits.obedience)>>
<<if _roll gte _thresh>>
/* For simulation afterwards */
<<set $to_simulate.add(_char.key)>>
<<set _success = true>>
<<set _responses = [setup.pass("tact", false)]>>
<<set _responses = _responses.concat(setup.influence.dirty_comment.success.random())>>
<<set _disposition = _char.get_disposition()>>
<<if _disposition == "submissive" || _disposition == "devoted">>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s develops a slight blush and \
tightens their legs. You can tell that " + setup.he(_char) +
" is already aroused just from your comment.")>>
<<if _char.sex_fetishes.cum gte 50>>
<<set _responses.push(_char.dialogue("Please let me have a taste of your cum, I\'ve been \
thinking about it all day!"))>>
<<else>>
<<set _responses.push(_char.dialogue("You... you can take me whenever you want."))>>
<</if>>
<<set _response = "(" + setup.titleCase(_char.first_name) + " Arousal " +
setup.show_change_html(0, 5) + ").">>
<<set _char.mental_conditions.arousal += 5>>
<<else>>
<<if _char.mental_conditions.arousal gte 10>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s already very aroused and \
your comment takes " + setup.him(_char) + " over the edge. You \
start to see droplets drip from " + setup.his(_char) + " crotch down " +
setup.his(_char) + " leg.")>>
<<set _responses.push(_char.dialogue("I don\'t know what has gotten into me, please excuse me."))>>
<<set _response = setup.titleCase(_char.first_name) + " hurries off " +
"(" + setup.titleCase(_char.first_name) + "\'s Arousal " + setup.show_change_html(0, 3) +
", Willpower " + setup.show_change_html(0, -1, false) + ")."
>>
<<set _char.mental_conditions.arousal += 3>>
<<set _char.slave_traits.willpower -= 1>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " looks very flustered,")>>
<<set _responses.push(_char.dialogue("Wh..what? I think I have to go."))>>
<<set _response = setup.titleCase(_char.first_name) + " hurries off but you know your comment \
has affected " + setup.him(_char) + " " +
"(" + setup.titleCase(_char.first_name) + "\'s Arousal " + setup.show_change_html(0, 2) +
").">>
<<set _char.mental_conditions.arousal += 2>>
<</if>>
<</if>>
<<else>>
<<set _success = false>>
<<set _responses = [setup.fail("tact", false)]>>
<<set _responses = _responses.concat( setup.influence.dirty_comment.fail.random())>>
<<set _response = setup.titleCase(_char.first_name) + " looks at you with an \
unimpressed stare, but luckily it looks like your failed attempt has not \
lowered " + setup.his(_char) + " opinion of you.">>
<</if>>
/* Check if was skillful roll */
<<if Math.abs(_max_roll - _thresh) lte 1 && (_max_roll - _roll) lte 1>>
<<set _probability = setup.sigmoid(-1 * $difficulty)>>
<<set _sub_roll = Math.random()>>
<<if _roll lt _probability>>
<<set _response += "<br><br>">>
<<if _success>>
<<set _response += "You can tell that comment barely passed, but luckily your \
skill in speechcraft let you prevail. <span style=\'text: green\'>\
Your tact increased by 1!</span>">>
<<else>>
<<set _response += "You can tell that comment almost landed, you\'ll have to \
work harder next time. <span style=\'text: green\'>\
Your tact increased by 1!</span>">>
<</if>>
<<set $player.stats.tact += 1>>
<</if>>
<<unset _probability>>
<<unset _sub_roll>>
<</if>>
<<set _responses.push(_response)>>
<<set _to_round = $selected>>
<<include round>>
<<if def _options>>
<<set _responses.push(_options.clone())>>
<</if>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<unset _response>>
<<unset _responses>>
<<unset _to_round>>
<</nobr>><<nobr>>
<<run setup.init_influence()>>
<<script>>
var player = State.variables.player;
var char = State.variables.characters[State.variables.selected];
var div = $("<div></div>");
var html = "
You approach " + setup.titleCase(char.first_name) + ",<br>" +
"<em><b>" + setup.titleCase(player.first_name) + "</b>: \"Hey I wanted to discuss some \
things with you.\"</em>\
<br>" + setup.titleCase(char.first_name) + " eyes you up and down, wondering what you want.\
<br>\
How would you like to influence " + setup.him(char) + "?";
State.temporary.options = "<ol>\
<li>Compliment " + setup.him(char) + ".</li>\
<li>Tell a joke.</li>\
<li>Make a dirty comment.</li>";
if (char.is_slave && char.owner == "shintani_hiroyuki") {
State.temporary.options += "<li>Tell " + setup.him(char) + " about your work with Shintani.</li>";
}
State.temporary.options += "</ol>";
if (char.mental_conditions.anger > 0) {
State.temporary.options = "<div style=\'color: red\'>\
(" + setup.titleCase(char.first_name) + " will be harder to influence since " +
setup.he(char) + " is upset)\
</div>" + State.temporary.options;
}
html += State.temporary.options;
State.temporary.options = $(State.temporary.options);
div.html(html);
setup.mainLog_append(div);
<</script>>
<<set _choices = 3>>
<<if $characters[$selected].owner == "shintani_hiroyuki">>
<<set _choices += 1>>
<</if>>
<<disableactions>>
/* Allow back and leave buttons */
<<removeclass "#events_actions_back" "hidden">>
<<removeclass "#events_actions_leave" "hidden">>
/* Psuedoevent listener for action */
<<silently>><<repeat 10ms>>
<<if _action !== undefined>>
<<set _char = $characters[$selected]>>
<<if _char.limits.influence gt 0>>
<<set _char.limits.influence -= 1>>
<<switch _action>>
<<case 1>>
<<include complimentEngine>>
<<case 2>>
<<include jokeEngine>>
<<case 3>>
<<include dirtyCommentEngine>>
<<case 4>>
<<set _to_round = $selected>>
<<set _responses = [
$player.dialogue("Have you heard about all the work Shintani has me doing?")
]>>
<<set _disposition = _char.get_disposition()>>
<<if _disposition == "submissive" || _disposition == "devoted">>
<<set _responses.push(_char.dialogue("Yes! Your work has been most impressive thus far!"))>>
<<else>>
<<if $player.get_status(passage()) == "low_slave">>
<<set _responses.push(_char.dialogue("You mean licking the shit off his boots? \
Know your place, you low slave."))>>
<<else>>
<<if _char.status == "high_slave" && $player.get_status(passage()) == "slave">>
<<if $quests.the_nipon_economy.added>>
<<set _responses.push(_char.dialogue("I honestly don\'t know why Shintani would \
assign you such an important task as testing the economy of Nipon. Don\'t get \
too comfortable and remember your place in front of a high slave."))>>
<<set _responses.push("(" + setup.titleCase(_char.first_name) + "\'s Willpower " +
setup.show_change_html(0, -2) + ").")>>
<<set _char.slave_traits.willpower -= 2>>
<<else>>
<<set _responses.push(_char.dialogue("You mean licking the shit off his boots? \
Know your place in front of a high slave, you slave."))>>
<</if>>
<<elseif _char.status == "slave" && $player.get_status(passage()) == "slave">>
<<if $quests.the_nipon_economy.added>>
<<set _responses.push(_char.dialogue("I honestly don\'t know why Shintani would \
assign you such an important task as testing the economy of Nipon..."))>>
<<set _responses.push("(" + setup.titleCase(_char.first_name) + "\'s Willpower " +
setup.show_change_html(0, -1) + ").")>>
<<set _char.slave_traits.willpower -= 1>>
<<else>>
<<set _responses.push(_char.dialogue("Just because you rose through the ranks quickly \
doesn\'t make you any special."))>>
<</if>>
<<elseif $player.get_status(passage()) == "high_slave">>
<<set _responses.push(_char.dialogue("Yes, I heard you were doing quite well, especially \
seeing as how you quickly rose the ranks here."))>>
<<set _responses.push("(" + setup.titleCase(_char.first_name) + "\'s Willpower " +
setup.show_change_html(0, -1) + ").")>>
<<set _char.slave_traits.willpower -= 1>>
<<elseif _char.status == "low_slave" && $player.get_status(passage()) == "slave">>
<<set _responses.push(_char.dialogue("Yes, I heard you were doing quite well, especially \
seeing as how you quickly rose the ranks here."))>>
<<set _responses.push("(" + setup.titleCase(_char.first_name) + "\'s Willpower " +
setup.show_change_html(0, -1) + ").")>>
<<set _char.slave_traits.willpower -= 1>>
<</if>>
<</if>>
<</if>>
<<set _responses.push(_options)>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<include round>>
<<unset _response>>
<<unset _responses>>
<<unset _to_round>>
<</switch>>
/* Advance time every time an ask is performed */
<<set _roll = dice(1, 5) + 5>>
<<addmins _roll>>
<<unset _roll>>
<<else>>
<<notify>>Already influenced <<= setup.titleCase(_char.first_name)>>
too many times today!<</notify>>
<</if>>
<<unset _action>>
<<unset _char>>
<<elseif def _stop_loop && _stop_loop>>
<<stop>>
<</if>>
<</repeat>><</silently>>
<</nobr>><<nobr>>
/* Roll tact for success */
<<set _roll = $player.get_status_prop("tact") + 2 * (dice(1, 6 + $difficulty) - $difficulty)
- _char.mental_conditions.anger + _char.slave_traits.trust / 20
>>
<<set _max_roll = $player.get_status_prop("tact") + 2 * 6
- _char.mental_conditions.anger + _char.slave_traits.trust / 20>>
<<set _thresh = 22 + 5 * (-1/100 * _char.slave_traits.obedience)>>
<<if _roll gte _thresh>>
<<set _success = true>>
<<set _responses = [setup.pass("tact", false)]>>
<<set _responses = _responses.concat( setup.influence.joke.success.random())>>
<<if _char.slave_traits.obedience gte 80>>
<<set _responses.push(setup.titleCase(_char.first_name) + " laughs warmly,")>>
<<set _response = _char.dialogue("You\'re always so funny!") +
"(" + setup.titleCase(_char.first_name) + "\'s " + "Affection " + setup.show_change_html(0, 0.1) +
", Trust " + setup.show_change_html(0, 0.25)
>>
<<set _char.slave_traits.obedience += 0.1>>
<<set _char.slave_traits.trust += 0.25>>
<<elseif _char.slave_traits.obedience gte 60>>
<<set _responses.push(setup.titleCase(_char.first_name) + " laughs warmly,")>>
<<set _response = _char.dialogue("You\'re always so funny!") +
"(" + setup.titleCase(_char.first_name) + "\'s " + "Affection " + setup.show_change_html(0, 0.25) +
", Trust " + setup.show_change_html(0, 0.5)
>>
<<set _char.slave_traits.obedience += 0.25>>
<<set _char.slave_traits.trust += 0.5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " lets out a slight chuckle, but \
you can\'t tell if it\'s out of pity.")>>
<<set _response = _char.dialogue("Good one.") +
"(" + setup.titleCase(_char.first_name) + "\'s " + "Affection " + setup.show_change_html(0, 1) +
", Trust " + setup.show_change_html(0, 1)
>>
<<set _char.slave_traits.obedience += 1>>
<<set _char.slave_traits.trust += 1>>
<</if>>
<<if _char.mental_conditions.sadness gt 0>>
<<set _response += "Sadness " + setup.show_change_html(0, -3, false)>>
<<set _char.mental_conditions.sadness -= 3>>
<</if>>
<<set _response += ").">>
<<else>>
<<set _success = false>>
<<set _responses = [setup.fail("tact", false)]>>
<<set _responses = _responses.concat( setup.influence.joke.fail.random())>>
<<set _response = setup.titleCase(_char.first_name) + " looks at you with an \
unimpressed stare, but luckily it looks like your failed attempt has not \
lowered " + setup.his(_char) + " opinion of you.">>
<</if>>
/* Check if was skillful roll */
<<if Math.abs(_max_roll - _thresh) lte 1 && (_max_roll - _roll) lte 1>>
<<set _probability = setup.sigmoid(-1 * $difficulty)>>
<<set _sub_roll = Math.random()>>
<<if _roll lt _probability>>
<<set _response += "<br><br>">>
<<if _success>>
<<set _response += "You can tell that joke barely passed, but luckily your \
skill in speechcraft let you prevail. <span style=\'text: green\'>\
Your tact increased by 1!</span>">>
<<else>>
<<set _response += "You can tell that joke almost landed, you\'ll have to \
work harder next time. <span style=\'text: green\'>\
Your tact increased by 1!</span>">>
<</if>>
<<set $player.stats.tact += 1>>
<</if>>
<<unset _probability>>
<<unset _sub_roll>>
<</if>>
<<set _responses.push(_response)>>
<<set _to_round = $selected>>
<<include round>>
<<if def _options>>
<<set _responses.push(_options.clone())>>
<</if>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<unset _response>>
<<unset _responses>>
<<unset _to_round>>
<</nobr>><<nobr>>
<div id="molest_actions" class="action container row col longbutton fiveQuarters smalltext hidden"
style="--rows: 4; --cols: 4">
@@#molest1;<<button "Remove blanket">>
<<if $player.conditions.stamina gt 10>>
<<set _molest_action = 1>>
<<if !_is_molesting>>
<<set _is_molesting = true>>
<<set _char.limits.molest -= 1>>
<</if>>
<<if _molest_state.blanket>>
<<set _molest_state.blanket = false>>
<<run $("#molest1 button").html("Put on blanket")>>
<<else>>
<<set _molest_state.blanket = true>>
<<run $("#molest1 button").html("Remove blanket")>>
<</if>>
<<set _molest_state_changed = true>>
<<else>>
<<notify>>Not enough stamina!<</notify>>
<</if>>
<</button>>@@
<<disable>>
@@#molest2;<<button "Remove top">>
<<if $player.conditions.stamina gt 10>>
<<set _molest_action = 2>>
<<if _molest_state.top>>
<<set _molest_state.top = false>>
<<run $("#molest2 button").html("Put on top")>>
<<else>>
<<set _molest_state.top = true>>
<<run $("#molest2 button").html("Remove top")>>
<</if>>
<<set _molest_state_changed = true>>
<<else>>
<<notify>>Not enough stamina!<</notify>>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#molest3;<<button "Remove bottom">>
<<if $player.conditions.stamina gt 10>>
<<set _molest_action = 3>>
<<if _molest_state.bottom>>
<<set _molest_state.bottom = false>>
<<run $("#molest3 button").html("Put on bottom")>>
<<else>>
<<set _molest_state.bottom = true>>
<<run $("#molest3 button").html("Remove bottom")>>
<</if>>
<<set _molest_state_changed = true>>
<<else>>
<<notify>>Not enough stamina!<</notify>>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#molest4;<<button "Fondle boobs">>
<<if $player.conditions.stamina gt 10>>
<<set _molest_action = 4>>
<<else>>
<<notify>>Not enough stamina!<</notify>>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#molest5;<<button "Finger pussy">>
<<if $player.conditions.stamina gt 10>>
<<set _molest_action = 5>>
<<else>>
<<notify>>Not enough stamina!<</notify>>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#molest6;<<button "Finger ass">>
<<if $player.conditions.stamina gt 10>>
<<set _molest_action = 6>>
<<else>>
<<notify>>Not enough stamina!<</notify>>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#molest7;<<button "Lick pussy">>
<<if $player.conditions.stamina gt 10>>
<<set _molest_action = 7>>
<<else>>
<<notify>>Not enough stamina!<</notify>>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#molest8;<<button "Jack off">>
<<if $player.conditions.stamina gt 10>>
<<set _molest_action = 8>>
<<else>>
<<notify>>Not enough stamina!<</notify>>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#molest9;<<button "Footjob">>
<<if $player.conditions.stamina gt 10>>
<<set _molest_action = 9>>
<<else>>
<<notify>>Not enough stamina!<</notify>>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#molest10;<<button "Blowjob">>
<<if $player.conditions.stamina gt 10>>
<<set _molest_action = 10>>
<<else>>
<<notify>>Not enough stamina!<</notify>>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#molest11;<<button "Fuck pussy">>
<<if $player.conditions.stamina gt 10>>
<<set _molest_action = 11>>
<<else>>
<<notify>>Not enough stamina!<</notify>>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#molest12;<<button "Fuck ass">>
<<if $player.conditions.stamina gt 10>>
<<set _molest_action = 12>>
<<else>>
<<notify>>You are too tired!<</notify>>
<</if>>
<</button>>@@
<</disable>>
<<set _molest_buttons = ["#molest_back", "#molest_leave"]>>
<<for _i = 1; _i lte 12; _i++>>
<<set _molest_buttons.push("#molest" + _i)>>
<</for>>
<div></div>
@@#molest_back;<<button "Back" `passage()`>>
<<set $enable_menu = true>>
<<unset _tutorial>>
<</button>>@@
<<disable>>
@@#molest_done;<<button "Done" `passage()`>>
/* Increase suspicion based on how you left them */
<<set $_temp_to_log = "You quietly slip out of " + setup.titleCase(_char.first_name) + "\'s room.<br>">>
<<if !_molest_state.aware>>
<<if !_molest_state.top || !_molest_state.bottom>>
<<set $_temp_to_log += "Because you left " + setup.titleCase(_char.first_name) + "\'s clothes \
off, " + setup.he(_char) + "\'ll be much more suspicious and concerned \
in the morning (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, 30, false) + ").<br>"
>>
<<set _char.mental_conditions.suspicion += 30>>
<</if>>
<</if>>
<<if _molest_state.cum != "none">>
<<if _molest_state.cum == "hair" ||
_molest_state.cum == "face" ||
_molest_state.cum == "lips" ||
_molest_state.cum == "in_mouth">>
<<set $_temp_to_log += "Despite leaving evidence behind, with your cum close to " +
setup.titleCase(_char.first_name) + "\'s nose, " + setup.he(_char) +
" unconsciously grows more fond of your cum (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, 1) + ", Cum Fetish " +
setup.show_change_html(0, 1)
>>
<<if !_molest_state.aware>>
<<set $_temp_to_log += ", Suspicion " + setup.show_change_html(0, 10, false)>>
<<set _char.mental_conditions.suspicion += 10>>
<</if>>
<<set $_temp_to_log += ").<br>">>
<<set _char.slave_traits.obedience += 1>>
<<set _char.sex_fetishes.cum += 1>>
<<elseif !_molest_state.aware>>
<<set $_temp_to_log += "While your cum shouldn\'t leave much of a trace by the morning " +
setup.titleCase(_char.first_name) + " will still notice something is off (" +
setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, 5, false) + ").<br>"
>>
<</if>>
<</if>>
/* Stop molesting */
<<set _is_molesting = false>>
/* Re-enable menu */
<<set $enable_menu = true>>
/* Last round for good measure */
<<set _to_round = _char.key>>
<<include round>>
<</button>>@@
<</disable>>
</div>
<</nobr>><<nobr>>
<div id="molest_cum_actions" class="action container row col longbutton fiveQuarters smalltext hidden"
style="--rows: 4; --cols: 4">
@@#molest_cum1;<<button "In own pants">>
<<set _responses = [
"You quickly tuck your cock back and cum into your pants."
]>>
<<run _button_func()>>
<</button>>@@
@@#molest_cum2;<<button "In own hand">>
<<set _responses = [
"You quickly put your hand in front of your cock and catch your cum."
]>>
<<run _button_func()>>
<</button>>@@
@@#molest_cum3;<<button "On ground">>
<<set _responses = [
"You make sure to aim away from " + setup.titleCase(_char.first_name) + " and \
cum directly onto the ground."
]>>
<<run _button_func()>>
<</button>>@@
@@#molest_cum4;<<button "On blanket">>
<<set _responses = [
"You make sure to aim away from " + setup.titleCase(_char.first_name) + " and \
cum directly onto the blanket on the ground."
]>>
<<set _molest_state.cum = "blanket">>
<<run _button_func()>>
<</button>>@@
@@#molest_cum5;<<button "On bottom">>
<<set _responses = [
"You aim your cum towards " + setup.titleCase(_char.first_name) + "\'s bottoms \
and cum directly onto them."
]>>
<<set _molest_state.cum = "bottom">>
<<run _button_func()>>
<</button>>@@
@@#molest_cum6;<<button "In hair">>
<<set _responses = [
"You wrap your cock around " + setup.titleCase(_char.first_name) + "\'s " +
_char.physical_traits.hair_color + " hair and cum into it."
]>>
<<set _molest_state.cum = "hair">>
<<run _button_func()>>
<</button>>@@
@@#molest_cum7;<<button "On face">>
<<set _responses = [
"You stroke your cock near " + setup.titleCase(_char.first_name) + "\'s face, \
unloading your cum onto " + setup.his(_char) + " " +
_char.physical_traits.skin_color + " " +
_char.physical_traits.ethnicity + " face."
]>>
<<set _molest_state.cum = "face">>
<<run _button_func()>>
<</button>>@@
<<disable>>
@@#molest_cum8;<<button "On chest">>
<<set _responses = [
"You aim your cock at " + setup.titleCase(_char.first_name) + "\'s chest, \
unloading your cum onto " + setup.his(_char) + " " +
_char.physical_traits.skin_color + " chest."
]>>
<<set _molest_state.cum = "boobs">>
<<run _button_func()>>
<</button>>@@
<</disable>><<disable>>
@@#molest_cum9;<<button "On pussy">>
<<set _responses = [
"You aim your cock at " + setup.titleCase(_char.first_name) + "\'s pussy, \
unloading your cum onto " + setup.him(_char) + "."
]>>
<<set _molest_state.cum = "pussy">>
<<run _button_func()>>
<</button>>@@
<</disable>><<disable>>
@@#molest_cum10;<<button "In mouth">>
<<set _responses = [
"You continue thrusting your cock deeper into " + setup.titleCase(_char.first_name) +
"\'s throat, eventually cumming into " + setup.his(_char) + " mouth."
]>>
<<set _molest_state.cum = "in_mouth">>
<<run _button_func()>>
<</button>>@@
<</disable>><<disable>>
@@#molest_cum11;<<button "In pussy">>
<<set _responses = [
"You continue fucking " + setup.titleCase(_char.first_name) +
"\'s vagina, eventually cumming into " + setup.his(_char) +
" pussy."
]>>
<<set _molest_state.cum = "in_pussy">>
<<run _button_func()>>
<</button>>@@
<</disable>><<disable>>
@@#molest_cum12;<<button "In ass">>
<<set _responses = [
"You continue fucking " + setup.titleCase(_char.first_name) +
"\'s ass, eventually cumming into " + setup.his(_char) +
" anus."
]>>
<<set _molest_state.cum = "in_ass">>
<<run _button_func()>>
<</button>>@@
<</disable>>
</div>
<<silently>><<script>>
State.temporary.button_func = () => {
let player = State.variables.player;
let _t = State.temporary;
player.mental_conditions.arousal = 0;
player.conditions.stamina = (player.conditions.stamina - 20).clamp(0, 100);
_t.molest_state.came = true;
_t.is_cumming = false;
_t.print_cum_prompt = false;
_t.molest_state_changed = true;
setup.mainLog_append_delayed(State.temporary.responses);
delete _t.responses;
$("#molest_actions").removeClass("hidden");
$("#molest_cum_actions").addClass("hidden");
};
<</script>><</silently>>
<</nobr>><<nobr>>
<div id="molest_info" class="subbackground hidden" style="grid-row: 1 / span 3; grid-column: 4 / span 1">
<div class="container threeRow" style="font-weight: normal; height: 100%; width: 100%">
<center>
<h3 style="margin-bottom:0"><<= setup.locations.get(passage()).name>></h3>
<p style="margin: 0">
<<= setup.locations.get_sub_address(passage())>>
</p>
<br>
<div id="molest_datetime">
<<time12hr>>
<br>
<<date>>
</div>
</center>
<center style="padding: 20px">
<strong id="molest_info_name"></strong>
<div id="molest_bars"></div>
<strong><<= setup.titleCase($player.first_name)>></strong>
<div id="molest_player_bars"></div>
</center>
<center>
''Time passed'': <span id="molest_time"></span> minutes
</center>
</div>
</div>
<</nobr>><<nobr>>
/* Cock for male, strap-on for female */
<<set _cock = "cock">>
<<if $player.gender == 1>>
<<set _cock = "strap-on">>
<</if>>
/* For ease of access */
<<set _char = $characters[$selected]>>
<<set _higher_status = ($player.get_status("nipon") == "slave" && _char.status == "low_slave") ||
($player.get_status("nipon") == "high_slave" && _char.status == "slave") ||
($player.get_status("nipon") == "high_slave" && _char.status == "low_slave")>>
/* Preround for bars */
<<set _to_round = _char.key>>
<<include round>>
<<set _molest_state = {
"blanket": true,
"top": true,
"bottom": true,
"cum": "none",
"came": false,
"aware": false,
"awake": false
}>>
/* Set tutorial to show the molest tutorial */
<<set _tutorial = "molestTutorial">>
<<if !$locations.shintaniHome.data.molested>>
<<set $locations.shintaniHome.data.molested = true>>
<<popover>>
<<include `_tutorial`>>
<</popover>>
<</if>>
/* Disable menu */
<<set $enable_menu = false>>
/* Time molesting */
<<set _molest_time = 0>>
/* Add target to simulation queue */
<<set $to_simulate.add(_char.key)>>
/* Molesting doesn't start till we act */
<<set _is_molesting = false>>
/* Pre-cache all images for fast rendering */
<<script>>
var char = State.temporary.char;
const preload = [
"",
"_noblanket",
"_noblanket_nobottom",
"_noblanket_nobottom_notop",
"_noblanket_notop"
];
window._ImageCache = preload.map(function (url) {
var image = document.createElement('img');
image.src = char.image_folder() + "sleeping/" +
char.first_name.toLowerCase() + "_sleeping" + url + ".png";
return image;
});
<</script>>
<<script>>
var player = State.variables.player;
var char = State.temporary.char;
$("#mainLogCharacterImage").css("background-image",
"url(\"" + char.image_folder() + "sleeping/" + char.first_name.toLowerCase()
+ "_sleeping.png\")"
);
var div = $("<div></div>");
var html = "You approach " + setup.titleCase(char.first_name) + "\'s bed, what do you do?";
div.html(html);
setup.mainLog_append(div);
<</script>>
/* Show molest ui and atune to character */
<<removeclass "#molest_actions" "hidden">>
<<run $("#molest_info_name").html(setup.titleCase(_char.first_name))>>
<<run $("#molest_bars").wiki("\
<<showmeter \"char_arousal_bar\" `_char.mental_conditions.arousal/_char.mental_conditions.max_arousal`>>\
<<showmeter \"char_suspicion_bar\" `_char.mental_conditions.suspicion/50`>>\
")>>
<<run $("#molest_player_bars").wiki("\
<<showmeter \"player_arousal_bar\" `$player.mental_conditions.arousal/$player.mental_conditions.max_arousal`>>\
<<showmeter \"player_dexterity_bar\" `$player.stats.dexterity/100`>>\
<<showmeter \"player_stamina_bar\" `$player.conditions.stamina/$player.conditions.max_stamina`>>\
")>>
<<run $("#molest_time").html(_molest_time)>>
<<removeclass "#molest_info" "hidden">>
/* Change button text depending on character of molest target */
<<script>>
let char = State.temporary.char;
if (char.gender == 0) {
$("#molest4 button").html("Caress chest");
$("#molest5 button").html("Stroke cock");
$("#molest7 button").html("Suck cock");
$("#molest11 button").html("Ride cock");
}
<</script>>
/* Allow back and leave buttons */
<<removeclass "#events_actions_back" "hidden">>
<<removeclass "#events_actions_leave" "hidden">>
/*
Psuedoevent listener for changing molest_state for button enabling / disabling as well
as changing the images based on the state
*/
<<silently>><<repeat 20ms>>
<<if _molest_state_changed !== undefined && _molest_state_changed>>
<<if _is_molesting>>
<<addclass "#molest_back button" "disabled">>
<<run $("#molest_back button").prop("disabled", true)>>
<<removeclass "#molest_done button" "disabled">>
<<run $("#molest_done button").prop("disabled", false)>>
<</if>>
<<if _molest_state.blanket>>
/* Not able to do anything with blanket on */
<<for _i = 2; _i lte 12; _i++>>
<<addclass `"#molest" + _i + " button"` "disabled">>
<<run $("#molest" + _i + " button").prop("disabled", true)>>
<</for>>
<<else>>
/* Enable top and bottom modification */
<<removeclass "#molest2 button" "disabled">>
<<run $("#molest2 button").prop("disabled", false)>>
<<removeclass "#molest3 button" "disabled">>
<<run $("#molest3 button").prop("disabled", false)>>
<<if (!_molest_state.came && $player.gender == 0) ||
(!_molest_state.came && $player.gender == 1 && $player.has_equipped("strap_on") != "none")>>
/* Enalble feet, mouth and self*/
<<removeclass "#molest8 button" "disabled">>
<<run $("#molest8 button").prop("disabled", false)>>
<<removeclass "#molest9 button" "disabled">>
<<run $("#molest9 button").prop("disabled", false)>>
<<removeclass "#molest10 button" "disabled">>
<<run $("#molest10 button").prop("disabled", false)>>
<<else>>
<<addclass "#molest8 button" "disabled">>
<<run $("#molest8 button").prop("disabled", true)>>
<<addclass "#molest9 button" "disabled">>
<<run $("#molest9 button").prop("disabled", true)>>
<<addclass "#molest10 button" "disabled">>
<<run $("#molest10 button").prop("disabled", true)>>
<</if>>
<<if _molest_state.top>>
/* Disable all upper actions */
<<addclass "#molest4 button" "disabled">>
<<run $("#molest4 button").prop("disabled", true)>>
<<else>>
<<removeclass "#molest4 button" "disabled">>
<<run $("#molest4 button").prop("disabled", false)>>
<</if>>
<<if _molest_state.bottom>>
/* Disable all lower actions */
<<addclass "#molest5 button" "disabled">>
<<run $("#molest5 button").prop("disabled", true)>>
<<addclass "#molest6 button" "disabled">>
<<run $("#molest6 button").prop("disabled", true)>>
<<addclass "#molest7 button" "disabled">>
<<run $("#molest7 button").prop("disabled", true)>>
<<addclass "#molest11 button" "disabled">>
<<run $("#molest11 button").prop("disabled", true)>>
<<addclass "#molest12 button" "disabled">>
<<run $("#molest12 button").prop("disabled", true)>>
<<else>>
<<removeclass "#molest5 button" "disabled">>
<<run $("#molest5 button").prop("disabled", false)>>
<<removeclass "#molest6 button" "disabled">>
<<run $("#molest6 button").prop("disabled", false)>>
<<removeclass "#molest7 button" "disabled">>
<<run $("#molest7 button").prop("disabled", false)>>
<<if !_molest_state.came && $player.gender == 0>>
<<removeclass "#molest11 button" "disabled">>
<<run $("#molest11 button").prop("disabled", false)>>
<<removeclass "#molest12 button" "disabled">>
<<run $("#molest12 button").prop("disabled", false)>>
<<elseif !_molest_state.came && $player.gender == 1>>
<<removeclass "#molest11 button" "disabled">>
<<run $("#molest11 button").prop("disabled", false)>>
<<if $player.has_equipped("strap_on") != "none">>
<<removeclass "#molest12 button" "disabled">>
<<run $("#molest12 button").prop("disabled", false)>>
<</if>>
<<else>>
<<addclass "#molest11 button" "disabled">>
<<run $("#molest11 button").prop("disabled", true)>>
<<addclass "#molest12 button" "disabled">>
<<run $("#molest12 button").prop("disabled", true)>>
<</if>>
<</if>>
<</if>>
<<run $("#mainLogCharacterImage").css("background-image",
"url(\"" + _char.image_folder() + "sleeping/" + _char.first_name.toLowerCase()
+ "_sleeping" + setup.molest_state_to_string(_molest_state) + ".png\")"
)>>
<<unset _molest_state_changed>>
<</if>>
<</repeat>><</silently>>
/* Global multiplier for suspicion */
<<set _sus_mult = 1>>
<<if $player.titles.has("night_fox")>>
<<set _sus_mult *= 0.8>>
<</if>>
/* Scale by difficulty */
<<set _sus_mult *= (1 + 0.1 * $difficulty)>>
<<set _sus_fail = setup.round2(10 * _sus_mult)>>
/* Multipliers for arousal increase of char based on player skills */
<<set _anal_mult_base = 1 + ($player.sex_skills.anal - 50) / 100>>
<<set _oral_mult_base = 1 + ($player.sex_skills.oral - 50) / 100>>
<<set _vaginal_mult_base = 1 + ($player.sex_skills.vaginal - 50) / 100>>
<<set _other_mult_base = 1 + ($player.sex_skills.other - 50) / 100>>
/* Multipliers for arousal increase of char based on preference */
<<set _anal_mult_base *= 1 + (_char.sex_prefs.anal) / 75>>
<<set _oral_mult_base *= 1 + (_char.sex_prefs.oral) / 75>>
<<set _vaginal_mult_base *= 1 + (_char.sex_prefs.vaginal) / 75>>
/* Psuedoevent listener for _molest_action to update suspicion and arousal */
<<silently>><<repeat 20ms>>
<<if _molest_action !== undefined>>
/* Record the last action for cumEngine */
<<set _last_molest_action = _molest_action>>
<<set _roll = $player.stats.dexterity + dice(1, 6 + $difficulty) - $difficulty>>
/* Bypass dislikes if aroused enough */
<<if _char.mental_conditions.arousal gte 20>>
<<set _anal_mult = Math.max(1, _anal_mult_base)>>
<<set _oral_mult = Math.max(1, _oral_mult_base)>>
<<set _vaginal_mult = Math.max(1, _vaginal_mult_base)>>
<<set _other_mult = Math.max(1, _other_mult_base)>>
<<else>>
<<set _anal_mult = _anal_mult_base>>
<<set _oral_mult = _oral_mult_base>>
<<set _vaginal_mult = _vaginal_mult_base>>
<<set _other_mult = _other_mult_base>>
<</if>>
<<switch _molest_action>>
<<case 1>>
<<if _roll gt 15 || _molest_state.aware>>
<<if !_molest_state.blanket>>
<<set _responses = [
"You carefully remove " + setup.titleCase(_char.first_name) + "\'s blanket."
]>>
<<else>>
<<set _responses = [
"You carefully put back " + setup.titleCase(_char.first_name) + "\'s blanket."
]>>
<</if>>
<<else>>
<<if !_molest_state.blanket>>
<<set _responses = [
"You carefully remove " + setup.titleCase(_char.first_name) + "\'s blanket, \
but fumble a bit in doing so (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(_sus_fail), false) + ")."
]>>
<<else>>
<<set _responses = [
"You carefully put back " + setup.titleCase(_char.first_name) + "\'s blanket, \
but fumble a bit in doing so (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(_sus_fail), false) + ")."
]>>
<</if>>
<<set _char.mental_conditions.suspicion += _sus_fail>>
<</if>>
<<case 2>>
<<if _roll gt 20 || _molest_state.aware>>
<<if !_molest_state.top>>
<<set _responses = [
"You carefully remove " + setup.titleCase(_char.first_name) + "\'s top revealing " +
setup.his(_char) + " bare chest."
]>>
<<else>>
<<set _responses = [
"You carefully put back " + setup.titleCase(_char.first_name) + "\'s top."
]>>
<</if>>
<<else>>
<<if !_molest_state.top>>
<<set _responses = [
"You carefully remove " + setup.titleCase(_char.first_name) + "\'s top, \
but fumble a bit in doing so (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(_sus_fail), false) + ")."
]>>
<<else>>
<<set _responses = [
"You carefully put " + setup.titleCase(_char.first_name) + "\'s top, \
but fumble a bit in doing so (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(_sus_fail), false) + ")."
]>>
<</if>>
<<set _char.mental_conditions.suspicion += _sus_fail>>
<</if>>
<<case 3>>
<<if _roll gt 20 || _molest_state.aware>>
<<if !_molest_state.bottom>>
<<set _response = "\
You carefully remove " + setup.titleCase(_char.first_name) + "\'s bottoms revealing " +
setup.his(_char) + " bare \
">>
<<if _char.gender == 0>>
<<set _response += "cock.">>
<<else>>
<<set _response += "pussy.">>
<</if>>
<<if _char.mental_conditions.arousal gte 10>>
<<set _response += " You can tell from " + setup.his(_char) +
" arousal that it\'s already glistening with wetness.">>
<</if>>
<<set _responses = [_response]>>
<<else>>
<<set _responses = [
"You carefully put back " + setup.titleCase(_char.first_name) + "\'s bottoms."
]>>
<</if>>
<<else>>
<<if !_molest_state.bottom>>
<<set _responses = [
"You carefully remove " + setup.titleCase(_char.first_name) + "\'s bottoms, \
but fumble a bit in doing so (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(_sus_fail), false) + ")."
]>>
<<else>>
<<set _responses = [
"You carefully put back " + setup.titleCase(_char.first_name) + "\'s bottoms, \
but fumble a bit in doing so (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(_sus_fail), false) + ")."
]>>
<</if>>
<<set _char.mental_conditions.suspicion += _sus_fail>>
<</if>>
<<case 4>>
<<set _response = "\
You gently caress " + setup.titleCase(_char.first_name) + "\'s chest and you feel " +
setup.his(_char) + " nipples harden between your fingers">>
<<if _roll gt 25 || _molest_state.aware>>
<<else>>
<<set _response += ", but you accidentally press a little too hard, stiring " +
setup.him(_char) +
" (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(_sus_fail), false) + ")."
>>
<<set _char.mental_conditions.suspicion += _sus_fail>>
<</if>>
<<set _char.mental_conditions.arousal += 4 * _other_mult>>
<<set _responses = [_response]>>
<<case 5>>
<<if _char.gender == 1>>
<<set _response = "\
You carefully insert your fingers into " + setup.titleCase(_char.first_name) +
"\'s pussy. Your fingers become slick with her juices">>
<<else>>
<<set _response = "\
You carefully start stroking " + setup.titleCase(_char.first_name) +
"\'s cock. Your hand become slick with his precum">>
<</if>>
<<if _roll gt 30 || _molest_state.aware>>
<<set _response += ".">>
<<else>>
<<set _response += ", but you accidentally thrust a bit too hard, making " +
setup.him(_char) + " moan" +
" (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(_sus_fail), false) + ").">>
<<set _char.mental_conditions.suspicion += _sus_fail>>
<</if>>
<<set _char.mental_conditions.arousal += 7 * _other_mult>>
<<set _responses = [_response]>>
<<case 6>>
<<set _response = "\
You ease your fingers into " + setup.titleCase(_char.first_name) +
"\'s ass. As you move them in and out, you smell a rich aroma of " +
setup.his(_char)+ " juices and anus">>
<<if _roll gt 40 || _molest_state.aware>>
<<set _response += ".">>
<<else>>
<<set _response += ", but you accidentally thrust a bit too hard, making " +
setup.him(_char) + " moan" +
" (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(_sus_fail), false) + ").">>
<<set _char.mental_conditions.suspicion += _sus_fail>>
<</if>>
<<set _char.mental_conditions.arousal += 7 * _other_mult>>
<<set _responses = [_response]>>
<<case 7>>
<<if _char.gender == 1>>
<<set _response = "\
You lower your head in between " + setup.titleCase(_char.first_name) +
"\'s legs and start licking her pussy. You can taste her juices as they slowly \
leak into your mouth">>
<<else>>
<<set _response = "\
You lower your head in between " + setup.titleCase(_char.first_name) +
"\'s legs and start sucking his cock. You can taste his precum as they slowly \
leak into your mouth">>
<</if>>
<<if _roll gt 40 || _molest_state.aware>>
<<set _response += ".">>
<<else>>
<<set _response += ", but while you were using your mouth to please " +
setup.him(_char) + ", your teeth scratched " +
setup.him(_char) + " causing " +
setup.him(_char) + " to moan" +
" (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(_sus_fail), false) + ").">>
<<set _char.mental_conditions.suspicion += _sus_fail>>
<</if>>
<<set _char.mental_conditions.arousal += 10 * _vaginal_mult>>
<<set _responses = [_response]>>
<<case 8>>
<<set _response = "\
You touch yourself while imagining all the things you could do to poor " +
setup.titleCase(_char.first_name) + " who\'s helplessly unaware of what\'s happening">>
<<if _roll gt 15 || _molest_state.aware>>
<<set _response += ".">>
<<else>>
<<set _response += ", but in your ferver you make too much noise " +
" (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(_sus_fail), false) + ").">>
<<set _char.mental_conditions.suspicion += _sus_fail>>
<</if>>
<<set $player.mental_conditions.arousal += 7>>
<<set _responses = [_response]>>
<<case 9>>
<<set _response = "\
You grab " + setup.titleCase(_char.first_name) + "\'s soft " + _char.physical_traits.skin_color +
" feet and start stroking your " + _cock + " with it. You push your head gently between " +
setup.his(_char) + " toes \
while licking " + setup.his(_char) + " other foot">>
<<if _roll gt 25 || _molest_state.aware>>
<<set _response += ".">>
<<else>>
<<set _response += ". You accidentally bite too hard on " +
setup.his(_char) + " foot " +
" (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(_sus_fail), false) + ").">>
<<set _char.mental_conditions.suspicion += _sus_fail>>
<</if>>
<<set _foot_mult = 1 + (_char.sex_fetishes.feet / 50)>>
<<set _char.mental_conditions.arousal += 3 * _foot_mult * _other_mult>>
<<set $player.mental_conditions.arousal += 10>>
<<set _responses = [_response]>>
<<case 10>>
<<set _response = "\
You grab " + setup.titleCase(_char.first_name) + "\'s head and slow insert your \
" + _cock + " into " + setup.his(_char) + " mouth. You can feel " +
setup.his(_char) + " warm touch wrap around your member. You \
carefully slide in and out of " + setup.his(_char) + " throat">>
<<if _roll gt 50 || _molest_state.aware>>
<<set _response += ".">>
<<else>>
<<set _response += ", but you accidentally thrust a bit too hard, making " +
setup.him(_char) + " choke a little" +
" (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(1.2 * _sus_fail), false) + ").">>
<<set _char.mental_conditions.suspicion += 1.2 * _sus_fail>>
<</if>>
<<set _char.mental_conditions.arousal += 5 * _oral_mult>>
<<set $player.mental_conditions.arousal += 13>>
<<set _responses = [_response]>>
<<case 11>>
<<if _char.gender == 1>>
<<set _response = "\
You spread " + setup.titleCase(_char.first_name) + "\'s legs and slowly insert your \
" + _cock + " into " + setup.his(_char) + " pussy. You can feel the warm \
insides of her vagina wrap around your penis, guiding it with its juices. The air is \
surrounded by a lewd smell of mixed bodily fluids">>
<<else>>
<<set _response = "\
You slowly get onto of" + setup.titleCase(_char.first_name) + " and slowly insert his \
cock into your ass. You can feel the inside of your anus wrapping around his penis, \
guiding it with its juices. The air is surrounded by a lewd smell of mixed bodily fluids">>
<</if>>
<<if _roll gt 60 || _molest_state.aware>>
<<set _response += ".">>
<<else>>
<<set _response += ", but you accidentally thrust a bit too hard, making " +
setup.him(_char) + " moan" +
" (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(1.5 * _sus_fail), false) + ").">>
<<set _char.mental_conditions.suspicion += 1.5 * _sus_fail>>
<</if>>
<<set _char.mental_conditions.arousal += 12 * _vaginal_mult>>
<<set $player.mental_conditions.arousal += 15>>
<<set _responses = [_response]>>
<<case 12>>
<<set _response = "\
You spread " + setup.titleCase(_char.first_name) + "\'s ass cheecks and slowly insert your \
" + _cock + " into " + setup.his(_char) + " tight ass. " +
setup.titleCase(setup.his(_char)) + " anus lets out some air, filling the \
room with a perverted aroma of bodily fluids and sweat">>
<<if _roll gt 70>>
<<set _response += ".">>
<<else>>
<<set _response += ". You accidentally thrust a bit too hard, making " +
setup.him(_char) + " moan" +
" (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, setup.round2(2 * _sus_fail), false) + ").">>
<<set _char.mental_conditions.suspicion += 2 * _sus_fail>>
<</if>>
<<set _char.mental_conditions.arousal += 12 * _anal_mult>>
<<set $player.mental_conditions.arousal += 20>>
<<set _responses = [_response]>>
<</switch>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses);
<</script>>
<<unset _molest_action>>
<<set _mins = 1 + dice(1, 4)>>
<<addmins _mins>>
<<set _molest_time += _mins>>
<<run $("#molest_time").html(_molest_time)>>
<<set _to_round = _char.key>>
<<include round>>
<</if>>
<</repeat>><</silently>>
<<set _is_cumming = false>>
<<set _print_cum_prompt = false>>
/* Psuedoevent listener for arousal and suspicion thresholds */
<<silently>><<repeat 20ms>>
<<if $player.mental_conditions.arousal gte $player.mental_conditions.max_arousal && !_is_cumming>>
<<set _is_cumming = true>>
<</if>>
<<if _char.mental_conditions.suspicion gte 50 && !_molest_state.aware && !_is_cumming>>
<<set _disposition = _char.get_disposition()>>
<<switch _disposition>>
<<case "submissive">>
<<set _responses = [
setup.titleCase(_char.first_name) + " notices that you are molesting " +
setup.him(_char) + " but is submissive enough to pretend " +
"they are still sleeping (" + setup.titleCase(_char.first_name) + "\'s Arousal " +
setup.show_change_html(0, 10) + ")."
]>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses);
<</script>>
<<set _char.mental_conditions.suspicion = 0>>
<<case "devoted">>
<<set _responses = [
setup.titleCase(_char.first_name) + " notices that you are molesting " +
setup.him(_char) + " but is devoted enough to pretend " +
"they are still sleeping (" + setup.titleCase(_char.first_name) + "\'s Arousal " +
setup.show_change_html(0, 10) + ")."
]>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses);
<</script>>
<<set _char.mental_conditions.suspicion = 0>>
<<case "scared">>
<<set _responses = [
setup.titleCase(_char.first_name) + " notices that you are molesting " +
setup.him(_char) + " but is scared enough to pretend " +
"they are still sleeping (" + setup.titleCase(_char.first_name) + "\'s Willpower " +
setup.show_change_html(0, -5, false) + ")."
]>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses);
<</script>>
<<set _char.mental_conditions.suspicion = 100>>
<<default>>
<<set _molest_state.awake = true>>
<<set _molest_state_changed = true>>
<<set _responses = [
setup.titleCase(_char.first_name) + " wakes up to you molesting " +
setup.him(_char) + ",",
_char.dialogue("What the FUCK are you doing?!!"),
"Caught red-handed, you are a deer in the headlights, what do you do?\
<ol>\
<li>Apologize.</li>\
<li>Quickly dash out of the room.</li>\
<li>Force " + setup.him(_char) + " down and rape " +
setup.him(_char) + ".</li>\
</ol>"
]>>
/* Trigger event engine */
<<removeclass "#events_actions" "hidden">>
<<addclass "#molest_actions" "hidden">>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 3>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons);
<</script>>
<<set _char.mental_conditions.suspicion = 100>>
/* Psuedoevent listener for _action */
<<silently>><<repeat 20ms>>
<<if def _action>>
<<switch _action>>
<<case 1>>
<<unset _action>>
/* Roll for tact */
<<set _roll = $player.get_status_prop("tact") + 2 * (dice(1, 6 + $difficulty) - $difficulty)>>
<<if _roll gte 50>>
<<set $_temp_to_log =
setup.pass("tact") +
$player.dialogue("I\'m so sorry, you are just so beautiful I couldn\'t help it. I \
promise this will never happen again!") +
"While " + setup.titleCase(_char.first_name) + " is still very upset, you can tell \
you\'ve smoothed things over somewhat. You quickly leave the room \
(" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, -5) +
", Anger " + setup.show_change_html(0, 10, false) +
", Trust " + setup.show_change_html(0, -5) + ")."
>>
<<set _char.slave_traits.obedience -= 5>>
/* Do not induce fear */
<<if _char.slave_traits.trust gt 0>>
<<set _char.slave_traits.trust = Math.clamp(_char.slave_traits.trust - 5, 0, 100)>>
<</if>>
<<set _char.mental_conditions.anger += 10>>
<<else>>
<<set $_temp_to_log =
setup.fail("tact") +
$player.dialogue("I\'m so sorry, you are just... so hot, I couldn\'t help it. I \
promise this will never happen again!") +
setup.titleCase(_char.first_name) + " is very upset and you can tell \
you\'ve only made things worse with your bad apology. You quickly leave the room \
(" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, -15) +
", Anger " + setup.show_change_html(0, 20, false) +
", Trust " + setup.show_change_html(0, -15) + ")."
>>
<<set _char.slave_traits.obedience -= 15>>
/* Do not induce fear */
<<if _char.slave_traits.trust gt 0>>
<<set _char.slave_traits.trust = Math.clamp(_char.slave_traits.trust - 15, 0, 100)>>
<</if>>
<<set _char.mental_conditions.anger += 20>>
<</if>>
/* Stop molesting */
<<set _is_molesting = false>>
/* Re-enable menu */
<<set $enable_menu = true>>
/* Last round for good measure */
<<set _to_round = _char.key>>
<<include round>>
<<goto `passage()`>>
<<case 2>>
<<unset _action>>
<<set $_temp_to_log =
"You quickly dash out of the room, leaving sleepy " +
setup.titleCase(_char.first_name) + " to question what really just happened \
(" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, -10) +
", Anger " + setup.show_change_html(0, 15, false) +
", Trust " + setup.show_change_html(0, -10) + ")."
>>
<<set _char.slave_traits.obedience -= 10>>
/* Do not induce fear */
<<if _char.slave_traits.trust gt 0>>
<<set _char.slave_traits.trust = Math.clamp(_char.slave_traits.trust - 10, 0, 100)>>
<</if>>
<<set _char.mental_conditions.anger += 25>>
/* Stop molesting */
<<set _is_molesting = false>>
/* Re-enable menu */
<<set $enable_menu = true>>
/* Last round for good measure */
<<set _to_round = _char.key>>
<<include round>>
<<goto `passage()`>>
<<case 3>>
<<unset _action>>
<<set _roll = $player.stats.strength + dice(1, 6 + $difficulty) - $difficulty>>
<<if _roll - _char.stats.strength gte 15>>
<<set _responses = [
setup.pass("strength"),
"You hold " + setup.titleCase(_char.first_name) + " down and overpower " +
setup.him(_char) + ",",
$player.dialogue("Shut the fuck up, and go back to bed. If I even doubt you\'re \
asleep for a single second, I\'ll crush your windpipe."),
setup.titleCase(_char.first_name) + " lays back down with absolute fear (" +
setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, -15) +
", Anger " + setup.show_change_html(0, 20, false) +
", Fear " + setup.show_change_html(0, 10) +
", Willpower " + setup.show_change_html(0, -10, false) + ")."
]>>
<<set _char.slave_traits.obedience -= 15>>
<<set _char.slave_traits.trust -= 10>>
<<set _char.slave_traits.willpower -= 10>>
<<set _char.mental_conditions.anger += 20>>
<<set _char.mental_conditions.suspicion = 100>>
<<set _to_round = _char.key>>
<<include round>>
<<removeclass "#molest_actions" "hidden">>
<<addclass "#events_actions" "hidden">>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.temporary.molest_buttons);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _molest_state.awake = false>>
<<set _molest_state_changed = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<<stop>>
<<elseif _higher_status>>
<<set _responses = [
setup.pass("status"),
"You hold " + setup.titleCase(_char.first_name) + " down and remind " +
setup.him(_char) + " of " + setup.him(_char) + " \
place in this household,",
$player.dialogue("Shut the fuck up, and go back to bed. If I even doubt you\'re \
asleep for a single second, I\'ll crush your windpipe."),
setup.titleCase(_char.first_name) + " lays back down with absolute fear (" +
setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, -15) +
", Anger " + setup.show_change_html(0, 20, false) +
", Fear " + setup.show_change_html(0, 10) +
", Willpower " + setup.show_change_html(0, -10, false) + ")."
]>>
<<set _char.slave_traits.obedience -= 15>>
<<set _char.slave_traits.trust -= 10>>
<<set _char.slave_traits.willpower -= 10>>
<<set _char.mental_conditions.anger += 20>>
<<set _char.mental_conditions.suspicion = 100>>
<<set _to_round = _char.key>>
<<include round>>
<<removeclass "#molest_actions" "hidden">>
<<addclass "#events_actions" "hidden">>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.temporary.molest_buttons);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _molest_state.awake = false>>
<<set _molest_state_changed = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<<stop>>
<<else>>
<<set $_temp_to_log =
setup.fail("strength") +
"You try to pin " + setup.titleCase(_char.first_name) + " down, but " +
setup.he(_char) + " overpowers you in an instant.<br>" +
_char.dialogue("You fucking piece of garbage, let me show you what happens \
when you try something on me.") +
setup.titleCase(_char.first_name) + " proceeds to crush you and kick you in the \
genitals. After what seems like forever " + setup.he(_char) + " \
shoves you out the door " +
"(Health " + setup.show_change_html(0, -20) +
", Willpower " + setup.show_change_html(0, -10) + ") " +
"(" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, -15) +
", Anger " + setup.show_change_html(0, 20, false) +
", Trust " + setup.show_change_html(0, -15) + ")."
>>
<<set $player.conditions.health -= 20>>
<<set $player.slave_traits.willpower -= 10>>
<<set _char.slave_traits.obedience -= 15>>
/* Do not induce fear */
<<if _char.slave_traits.trust gt 0>>
<<set _char.slave_traits.trust = Math.clamp(_char.slave_traits.trust - 15, 0, 100)>>
<</if>>
<<set _char.mental_conditions.anger += 20>>
/* Stop molesting */
<<set _is_molesting = false>>
/* Re-enable menu */
<<set $enable_menu = true>>
/* Last round for good measure */
<<set _to_round = _char.key>>
<<include round>>
<<goto `passage()`>>
<</if>>
<</switch>>
<</if>>
<</repeat>><</silently>>
<</switch>>
<<set _molest_state.aware = true>>
<<set _sus_mult = 0>>
<<else>>
<<if _char.mental_conditions.arousal gte _char.mental_conditions.max_arousal && !_molest_state.awake>>
<<set _response =
setup.titleCase(_char.first_name) + "\'s body jolts, letting out multiples \
moans. " + setup.titleCase(setup.he(_char)) + " orgasm \
squirting some liquid onto the bed. This fills the already lewd air with an \
even stronger aroma of bodily fluids."
>>
<<if _last_molest_action == 5 ||
_last_molest_action == 7 ||
_last_molest_action == 11>>
<<if _char.gender == 1>>
<<set _response += " Making " + setup.titleCase(_char.first_name) + " orgasm \
by direct contact with her pussy increased her preference for vaginal sex \
(" + setup.titleCase(_char.first_name) + "\'s Vaginal Preference " +
setup.show_change_html(0, 1) + ").">>
<<set _char.sex_prefs.vaginal += 1>>
<<else>>
<<set _response += " Making " + setup.titleCase(_char.first_name) + " orgasm \
by direct contact with his cock increased his preference for sex \
(" + setup.titleCase(_char.first_name) + "\'s Sex Drive " +
setup.show_change_html(0, 1) + ").">>
<<set _char.sex_prefs.libido += 1>>
<</if>>
<<elseif _last_molest_action == 6 ||
_last_molest_action == 12>>
<<set _response += " Making " + setup.titleCase(_char.first_name) + " orgasm \
through " + setup.his(_char) + " ass increased " +
setup.his(_char) + " preference for anal sex \
(" + setup.titleCase(_char.first_name) + "\'s Anal Preference " +
setup.show_change_html(0, 1) + ").">>
<<set _char.sex_prefs.anal += 1>>
<<elseif _last_molest_action == 9>>
<<set _response += " Making " + setup.titleCase(_char.first_name) + " orgasm \
through " + setup.his(_char) + " feet increased " +
setup.his(_char) + " fetish for feet \
(" + setup.titleCase(_char.first_name) + "\'s Foot Fetish " +
setup.show_change_html(0, 1) + ").">>
<<set _char.sex_fetishes.feet += 1>>
<<elseif _last_molest_action == 10>>
<<set _response += " Making " + setup.titleCase(_char.first_name) + " orgasm \
through " + setup.his(_char) + " mouth increased " +
setup.his(_char) + " preference for oral sex \
(" + setup.titleCase(_char.first_name) + "\'s Oral Preference " +
setup.show_change_html(0, 1) + ").">>
<<set _char.sex_prefs.oral += 1>>
<</if>>
<<set _char.mental_conditions.arousal = 0>>
<<set _responses = [_response]>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses);
<</script>>
<<unset _response>>
<<unset _responses>>
<<set _to_round = _char.key>>
<<include round>>
<</if>>
<<if $player.mental_conditions.arousal gte $player.mental_conditions.max_arousal && !_molest_state.awake && !_print_cum_prompt>>
<<set _print_cum_prompt = true>>
<<set _responses = ["Molesting " + setup.titleCase(_char.first_name) + " is too much for you \
and you have to cum immediately!"]>>
/* Toggle cum options based on last action and molest state */
<<if !_molest_state.top>>
<<removeclass "#molest_cum8 button" "disabled">>
<<run $("#molest_cum8 button").prop("disabled", false)>>
<</if>>
<<if _molest_state.bottom>>
<<removeclass "#molest_cum5 button" "disabled">>
<<run $("#molest_cum5 button").prop("disabled", false)>>
<<else>>
<<removeclass "#molest_cum9 button" "disabled">>
<<run $("#molest_cum9 button").prop("disabled", false)>>
<</if>>
<<if _last_molest_action == 10 || _last_molest_action == 11 || _last_molest_action == 12>>
<<removeclass `"#molest_cum" + _last_molest_action + " button"` "disabled">>
<<run $("#molest_cum" + _last_molest_action + " button").prop("disabled", false)>>
<</if>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses);
<</script>>
<<unset _responses>>
<<removeclass "#molest_cum_actions" "hidden">>
<<addclass "#molest_actions" "hidden">>
<</if>>
<</if>>
<</repeat>><</silently>>
<</nobr>><<nobr>>
<<script>>
var player = State.variables.player;
var char = State.variables.characters[State.variables.selected];
var div = $("<div></div>");
var html = "
You approach " + setup.titleCase(char.first_name) + ",<br>" +
"<em><b>" + setup.titleCase(player.first_name) + "</b>: \"Hey I wanted to discuss some \
things with you.\"</em>\
<br>" + setup.titleCase(char.first_name) + " eyes you up and down, wondering what you want.\
<br>\
What would you like to request from " + setup.him(char) + "?";
State.temporary.options = "<ol>\
<li id=\"li1\">A hug.</li>\
<li id=\"li2\">A strip tease.</li>\
<li id=\"li3\">A handjob.</li>\
<li id=\"li4\">A footjob.</li>\
<li id=\"li5\">A blowjob.</li>\
<li id=\"li6\">Vaginal sex.</li>\
<li id=\"li7\">Anal sex.</li>";
State.temporary.options += "</ol>";
if (char.mental_conditions.anger > 0) {
State.temporary.options = "<div style=\'color: red\'>\
(" + setup.titleCase(char.first_name) + " will be less prone to agree to requests since " +
setup.he(char) + " is upset)\
</div>" + State.temporary.options;
}
html += State.temporary.options;
State.temporary.options = $(State.temporary.options);
div.html(html);
setup.mainLog_append(div);
<</script>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<silently>><<repeat 10ms>>
<<if _action !== undefined>>
<<set _char = $characters[$selected]>>
<<notify>>UNDER CONSTRUCTION<</notify>>
<<unset _action>>
<<unset _char>>
<</if>>
<</repeat>><</silently>>
<<script>>
<</script>>
<</nobr>><<nobr>>
/* Decrease search limit */
<<set _char.limits.search -= 1>>
<<set _delta_trust = 0>>
/* Roll for dexterity */
<<set _roll = $player.stats.dexterity + dice(1, 6 + $difficulty) - $difficulty - _char.mental_conditions.suspicion>>
<<if _roll gte 80>>
/* Finds a modest amount of lari + a percentage of inventory lari */
<<set $_temp_to_log = setup.pass("dexterity")>>
<<set $_temp_to_log += "You search around " + setup.titleCase(_char.first_name) +
"\'s room finding a most of the lari before " + setup.he(_char) +
" notices something is wrong. You were luckily able to quickly exit the room in \
before they saw anyone in their room">>
<<set _delta_sus = 0>>
<<set _found_lari = dice(1, 50 - $difficulty)>>
<<set _found_lari += Math.clamp(0.05 * UInv.BagHasItem(_char.key, "lari"), 0, 50)>>
<<elseif _roll gte 50>>
/* Finds a modest amount of lari */
<<set $_temp_to_log = setup.partial("dexterity")>>
<<set $_temp_to_log += "You search around " + setup.titleCase(_char.first_name) +
"\'s room finding a modest amount of lari before " + setup.he(_char) +
" notices something is wrong. You were luckily able to quickly exit the room in \
before they saw anyone in their room">>
<<set _delta_sus = 1>>
<<set _found_lari = dice(1, 50 - $difficulty)>>
<<elseif _roll gte 20>>
/* Finds a couple of lari */
<<set $_temp_to_log = setup.partial("dexterity")>>
<<set $_temp_to_log += "You try searching around " + setup.titleCase(_char.first_name) +
"\'s room but only find a couple lari before " + setup.he(_char) +
" notices something is wrong. You were luckily able to quickly exit the room in \
before they saw anyone in their room">>
<<set _delta_sus = 5>>
<<set _found_lari = dice(1, 10 - $difficulty)>>
<<elseif _roll gte 15>>
/* Fail to find anything */
<<set $_temp_to_log = setup.fail("dexterity")>>
<<set $_temp_to_log += "You try searching around " + setup.titleCase(_char.first_name) +
"\'s room but can\'t find anything before " + setup.he(_char) +
" notices something is wrong. You were luckily able to quickly exit the room in \
before they saw anyone in their room">>
<<set _delta_sus = 10>>
<<else>>
/* Wakes up target */
<<set $_temp_to_log = setup.fail("dexterity")>>
<<if _char.mental_conditions.suspicion gt 50>>
<<set $_temp_to_log += "You try searching around " + setup.titleCase(_char.first_name) +
"\'s room but make too much noise. Already suspicios, " + setup.titleCase(_char.first_name) +
" catches you red handed, pushing you out the room">>
<<set _delta_trust = -5>>
<<else>>
<<set $_temp_to_log += "You try searching around " + setup.titleCase(_char.first_name) +
"\'s room but make too much noise, luckily you quickly sneak out before they see \
who you are">>
<<set _delta_sus = 20>>
<</if>>
<<set _found_lari = 0>>
<</if>>
<<if _delta_sus gt 0>>
<<set $_temp_to_log += " (" + setup.titleCase(_char.first_name) + "\'s Suspicion " +
setup.show_change_html(0, _delta_sus, false)>>
<<set _char.mental_conditions.suspicion += _delta_sus>>
<<set $to_simulate.add(_char.key)>>
<<if _delta_trust lt 0>>
<<set $_temp_to_log += ", ">>
<</if>>
<<elseif _delta_trust lt 0>>
<<set $_temp_to_log += "(" + setup.titleCase(_char.first_name) + "\'s ">>
<</if>>
<<if _delta_trust lt 0>>
<<set $_temp_to_log += "Trust " +
setup.show_change_html(0, _delta_trust)>>
<<set _char.slave_traits.trust -= 5>>
<</if>>
<<set $_temp_to_log += ")">>
<<if $player.titles.has("thief")>>
<<set _found_lari *= (1 + randomFloat(0.2))>>
<</if>>
<<set _found_lari = setup.round2(_found_lari)>>
<<if _found_lari gt 0>>
<<set $_temp_to_log += " (Lari " + setup.show_change_html(0, _found_lari) + ")">>
<<addmoney _found_lari>>
<<audio coins_sound play>>
<</if>>
<<set $_temp_to_log += ".">>
<<set _to_round = _char.key>>
<<include round>>
/* For quest "power struggles" */
<<if _char.key == "shintani_hiroyuki" && ($quests.power_struggles.stage == 3 || $quests.power_struggles.stage == 4) && _roll gte 20>>
<<if $quests.power_struggles.stage == 3>>
<<set $_temp_to_log += "<br>You search through Shintani\'s office and find a large stack of \
what seems to be transaction logs. Unfortunatly you have no idea which ones are the correct ones \
perhaps you should look for some clues in the library first.">>
<<elseif $quests.power_struggles.stage == 4>>
<<set $_temp_to_log += "<br>You search through Shintani\'s office and find a large stack of \
transaction logs. You quickly leaf through them to find one with a watermark matching the \
symbol on the inside of the registry from the library. You quickly grab this and slip out.<br>\
<span class=\"success\">(Acquired Nipon Transaction Logs)</span>">>
<<run UInv.AddItem("inventory", "nipon_transaction_log")>>
<<set $quests.power_struggles.stage = 5>>
<</if>>
<</if>>
/* Attaining strap-on from Himari */
<<if _char.key == "himari_hironaka" && _roll gte 25 && UInv.BagHasItem("inventory", "strap_on") == 0>>
<<set $_temp_to_log += "<br>You find in a tattered old box a large strap-on made of soft silicon.<br>\
<span class=\"success\">(Acquired Strap On)</span>">>
<<run UInv.AddItem("inventory", "strap_on")>>
<</if>>
<<goto `passage()`>>
<</nobr>><<nobr>>
<div id="sex_actions" class="action container row col longbutton fiveQuarters smalltext hidden"
style="--rows: 4; --cols: 4">
@@#sex1;<<button "Caress">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You try to hug " + setup.titleCase(_char.first_name) + " but " + setup.he(_char) +
" recoils, shaking " + setup.his(_char) + " head.">>
<<if _query_action("caress", 0, _query_str)>>
<<set _responses = [
"You wrap " + setup.titleCase(_char.first_name) + " in your arms and hold " + setup.him(_char) +
" tightly in your arms."
]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s eyes are fixed far away, apprehensive about what\'s to \
come next.")>>
<<set _char.mental_conditions.discomfort += 1>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s eyes are fixed onto yours, both excited and nervous about what\'s to \
come next.")>>
<<set _char.mental_conditions.discomfort -= 1>>
<</if>>
<<set _mins = 1 + dice(1, 1)>>
<<addmins _mins>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _responses = [
"You wrap " + setup.titleCase(_char.first_name) + " in your arms and hold " + setup.him(_char) +
" tightly in your arms."
]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s eyes are fixed far away, apprehensive about what\'s to \
come next.")>>
<<set _char.mental_conditions.discomfort += 1>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s eyes are fixed onto yours, both excited and nervous about what\'s to \
come next.")>>
<<set _char.mental_conditions.discomfort -= 1>>
<</if>>
<<set _mins = 1 + dice(1, 1)>>
<<addmins _mins>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
@@#sex2;<<button "Kiss">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You try to kiss " + setup.titleCase(_char.first_name) + " but " + setup.he(_char) +
" recoils, pulling back in shock.">>
<<if _query_action("kiss", 5, _query_str)>>
<<set _responses = [
"You kiss " + setup.titleCase(_char.first_name) + " sticking your tongue into " + setup.his(_char) +
" mouth."
]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s eyes are glaze over with tears as " + setup.his(_char) +
" mouth is continually assaulted and filled with your saliva.")>>
<<set _char.mental_conditions.discomfort += 2>>
<<set _char.slave_traits.willpower -= 0.5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " responds by also pushing " + setup.his(_char) + " tongue into your mouth \
creating a wet sensual dance of saliva.")>>
<<set _char.mental_conditions.discomfort -= 1>>
<<set _char.mental_conditions.arousal += 2>>
<<set $player.mental_conditions.arousal += 2>>
<</if>>
<<set _mins = 1 + dice(1, 2)>>
<<addmins _mins>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _responses = [
"You kiss " + setup.titleCase(_char.first_name) + " sticking your tongue into " + setup.his(_char) +
" mouth."
]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s eyes are glaze over with tears as " + setup.his(_char) +
" mouth is continually assaulted and filled with your saliva.")>>
<<set _char.mental_conditions.discomfort += 2>>
<<set _char.slave_traits.willpower -= 0.5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " responds by also pushing " + setup.his(_char) + " tongue into your mouth \
creating a wet sensual dance of saliva.")>>
<<set _char.mental_conditions.discomfort -= 1>>
<<set _char.mental_conditions.arousal += 2>>
<<set $player.mental_conditions.arousal += 2>>
<</if>>
<<set _mins = 1 + dice(1, 2)>>
<<addmins _mins>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
@@#sex3;<<button "Undress">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You start taking off " + setup.titleCase(_char.first_name) + "\'s clothes but " + setup.he(_char) +
" pulls away, clearly not comfortable being completely naked in front of you.">>
<<if _query_action("undress", 15, _query_str)>>
<<set _responses = [
"You ferociously undress " + setup.titleCase(_char.first_name) + " revealing " + setup.his(_char) +
" " + _char.physical_traits.skin_color + " skin."
]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s eyes jolt down and " + setup.he(_char) +
" uses " + setup.his(_char) + " arms and hands to try to cover as much skin as possible.")>>
<<set _char.mental_conditions.discomfort += 3>>
<<set _char.slave_traits.willpower -= 0.5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " helps you undress " + setup.him(_char) + "self. As " + setup.his(_char) +
" clothes come off you can already smell the lewd juices coalescing.")>>
<<set _char.mental_conditions.discomfort -= 1>>
<<set _char.mental_conditions.arousal += 2>>
<<set $player.mental_conditions.arousal += 2>>
<</if>>
<<set _sex_state.top = false>>
<<set _sex_state.bottom = false>>
<<set _mins = 2 + dice(1, 2)>>
<<addmins _mins>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _responses = [
"You ferociously undress " + setup.titleCase(_char.first_name) + " revealing " + setup.his(_char) +
" " + _char.physical_traits.skin_color + " skin."
]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s eyes jolt down and " + setup.he(_char) +
" uses " + setup.his(_char) + " arms and hands to try to cover as much skin as possible.")>>
<<set _char.mental_conditions.discomfort += 3>>
<<set _char.slave_traits.willpower -= 0.5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " helps you undress " + setup.him(_char) + "self. As " + setup.his(_char) +
" clothes come off you can already smell the lewd juices coalescing.")>>
<<set _char.mental_conditions.discomfort -= 1>>
<<set _char.mental_conditions.arousal += 2>>
<<set $player.mental_conditions.arousal += 2>>
<</if>>
<<set _sex_state.top = false>>
<<set _sex_state.bottom = false>>
<<set _mins = 2 + dice(1, 2)>>
<<addmins _mins>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
@@#sex4;<<button "Remove top">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You start slowly taking off " + setup.titleCase(_char.first_name) + "\'s top but " + setup.he(_char) +
" pulls away, clearly not comfortable bearing their chest in front of you.">>
<<if _query_action("top", 7, _query_str)>>
<<set _str = "You remove " + setup.titleCase(_char.first_name) + "\'s top revealing " + setup.his(_char) +
" " + _char.physical_traits.skin_color + " ">>
<<if _char.gender == 0>>
<<set _str += "chest.">>
<<else>>
<<set _str += "perky boobs.">>
<</if>>
<<set _responses = [_str]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s eyes jolt down and " + setup.he(_char) +
" uses " + setup.his(_char) + " arms and hands to try to cover as much skin as possible.")>>
<<set _char.mental_conditions.discomfort += 2>>
<<set _char.slave_traits.willpower -= 0.3>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " removes " + setup.his(_char) + " top with a lustful look in " +
setup.his(_char) + " eyes.")>>
<<set _char.mental_conditions.discomfort -= 1>>
<<set _char.mental_conditions.arousal += 1.5>>
<<set $player.mental_conditions.arousal += 1.5>>
<</if>>
<<set _sex_state.top = false>>
<<set _mins = 1 + dice(1, 2)>>
<<addmins _mins>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _str = "You remove " + setup.titleCase(_char.first_name) + "\'s top revealing " + setup.his(_char) +
" " + _char.physical_traits.skin_color + " ">>
<<if _char.gender == 0>>
<<set _str += "chest.">>
<<else>>
<<set _str += "perky boobs.">>
<</if>>
<<set _responses = [_str]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s eyes jolt down and " + setup.he(_char) +
" uses " + setup.his(_char) + " arms and hands to try to cover as much skin as possible.")>>
<<set _char.mental_conditions.discomfort += 2>>
<<set _char.slave_traits.willpower -= 0.3>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " removes " + setup.his(_char) + " top with a lustful look in " +
setup.his(_char) + "eyes.")>>
<<set _char.mental_conditions.discomfort -= 1>>
<<set _char.mental_conditions.arousal += 1.5>>
<<set $player.mental_conditions.arousal += 1.5>>
<</if>>
<<set _sex_state.top = false>>
<<set _mins = 1 + dice(1, 2)>>
<<addmins _mins>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
@@#sex5;<<button "Remove bottoms">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You start slowly taking off " + setup.titleCase(_char.first_name) + "\'s bottoms but " + setup.he(_char) +
" pulls away, clearly not comfortable bearing their genitals in front of you.">>
<<if _query_action("bottom", 12, _query_str)>>
<<set _str = "You remove " + setup.titleCase(_char.first_name) + "\'s bottom revealing " + setup.his(_char) +
" " + _char.physical_traits.skin_color + " ">>
<<if _char.gender == 1>>
<<set _str += "pussy.">>
<<else>>
<<set _str += "cock.">>
<</if>>
<<set _responses = [_str]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s eyes jolt down and " + setup.he(_char) +
" uses " + setup.his(_char) + " arms and hands to try to cover as much skin as possible.")>>
<<set _char.mental_conditions.discomfort += 2>>
<<set _char.slave_traits.willpower -= 0.3>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " removes " + setup.his(_char) + " bottoms revealing a \
precum dripping down " + setup.his(_char) + " legs. The air fills with a smell of sexual opulence.")>>
<<set _char.mental_conditions.discomfort -= 1>>
<<set _char.mental_conditions.arousal += 1.5>>
<<set $player.mental_conditions.arousal += 1.5>>
<</if>>
<<set _sex_state.bottom = false>>
<<set _mins = 1 + dice(1, 2)>>
<<addmins _mins>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _str = "You remove " + setup.titleCase(_char.first_name) + "\'s bottom revealing " + setup.his(_char) +
" " + _char.physical_traits.skin_color + " ">>
<<if _char.gender == 1>>
<<set _str += "pussy.">>
<<else>>
<<set _str += "cock.">>
<</if>>
<<set _responses = [_str]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s eyes jolt down and " + setup.he(_char) +
" uses " + setup.his(_char) + " arms and hands to try to cover as much skin as possible.")>>
<<set _char.mental_conditions.discomfort += 2>>
<<set _char.slave_traits.willpower -= 0.3>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " removes " + setup.his(_char) + " bottoms revealing a \
precum dripping down " + setup.his(_char) + " legs. The air fills with a smell of sexual opulence.")>>
<<set _char.mental_conditions.discomfort -= 1>>
<<set _char.mental_conditions.arousal += 1.5>>
<<set $player.mental_conditions.arousal += 1.5>>
<</if>>
<<set _sex_state.bottom = false>>
<<set _mins = 1 + dice(1, 2)>>
<<addmins _mins>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
<<disable>>
@@#sex6;<<button "Fondle Boobs">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You reach for " + setup.titleCase(_char.first_name) + "\'s " +
_char_chest + ", but " + setup.he(_char) + " pulls away in reflex, clearly uncomfortable with being groped.">>
<<if _query_action("fondle", 15, _query_str)>>
<<set _responses = ["You cup your hands on " + setup.titleCase(_char.first_name) + "\'s " + _char.physical_traits.skin_color +
" " + _char_chest + ", interlacing " + setup.his(_char) + " nipples in your fingers."]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s eyes glaze over with tears as " + setup.he(_char) +
" gets forcefully groped.")>>
<<set _char.mental_conditions.discomfort += 3>>
<<set _char.slave_traits.willpower -= 0.5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " lets out a moan of bliss as their nipples harden under your touch.")>>
<<set _char.mental_conditions.discomfort -= 2>>
<<set _char.mental_conditions.arousal += 2.5>>
<<set $player.mental_conditions.arousal += 1>>
<</if>>
<<set _mins = 1 + dice(1, 2)>>
<<addmins _mins>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _responses = ["You cup your hands on " + setup.titleCase(_char.first_name) + "\'s " + _char.physical_traits.skin_color +
" " + _char_chest + ", interlacing " + setup.his(_char) + " nipples in your fingers."]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s eyes glaze over with tears as " + setup.he(_char) +
" gets forcefully groped.")>>
<<set _char.mental_conditions.discomfort += 3>>
<<set _char.slave_traits.willpower -= 0.5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " lets out a moan of bliss as their nipples harden under your touch.")>>
<<set _char.mental_conditions.discomfort -= 2>>
<<set _char.mental_conditions.arousal += 2.5>>
<<set $player.mental_conditions.arousal += 1>>
<</if>>
<<set _mins = 1 + dice(1, 2)>>
<<addmins _mins>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#sex7;<<button "Finger pussy">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You slide your hand down " + setup.titleCase(_char.first_name) + " body then back up " +
setup.his(_char) + " leg, approaching " + setup.his(_char) + " ">>
<<if _char.gender == 0>>
<<set _query_str += "cock,">>
<<else>>
<<set _query_str += "pussy,">>
<</if>>
<<set _query_str += " but " + setup.he(_char) + " pushes your hand away, clearly uninterested in you \
groping " + setup.his(_char) + " ">>
<<if _char.gender == 0>>
<<set _query_str += "penis.">>
<<else>>
<<set _query_str += "vagina.">>
<</if>>
<<if _query_action("finger", 20, _query_str)>>
<<if _char.gender == 0>>
/* TODO: Implement for male */
<<set _responses = ["Under construction"]>>
<<else>>
<<set _responses = ["You insert your fingers one-by-one into " + setup.titleCase(_char.first_name) + "\'s wet \
pussy, sliding over her clitorus making her slightly squirm."]>>
<</if>>
<<if _sex_state.rape>>
<<if _char.gender == 0>>
<<set _responses.push("Under construction for males.")>>
<<else>>
<<set _responses.push("Tears drip down " + setup.titleCase(_char.first_name) + " face as she can\'t help but moan \
and feel pleasure from your touch.")>>
<<set _responses.push(_char.dialogue("Please stop it, I\'m begging you..."))>>
<<set _responses.push(setup.titleCase(setup.his(_char)) + " pleading gets interrupted by a moan.")>>
<</if>>
<<set _char.mental_conditions.discomfort += 3>>
<<set _char.mental_conditions.arousal += 2>>
<<set _char.slave_traits.willpower -= 1>>
<<else>>
<<if _char.gender == 0>>
<<set _responses.push("Under construction for males.")>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " lets out a moan of bliss as squelshing sounds of her pussy \
echo through the air.")>>
<</if>>
<<set _char.mental_conditions.discomfort -= 2>>
<<set _char.mental_conditions.arousal += 4>>
<<set $player.mental_conditions.arousal += 1>>
<</if>>
<<set _mins = 2 + dice(1, 3)>>
<<addmins _mins>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<if _char.gender == 0>>
/* TODO: Implement for male */
<<set _responses = []>>
<<else>>
<<set _responses = ["You insert your fingers one-by-one into " + setup.titleCase(_char.first_name) + "\'s wet \
pussy, sliding over her clitorus making her slightly squirm."]>>
<</if>>
<<if _sex_state.rape>>
<<if _char.gender == 0>>
<<set _responses.push("Under construction for males.")>>
<<else>>
<<set _responses.push("Tears drip down " + setup.titleCase(_char.first_name) + " face as she can\'t help but moan \
and feel pleasure from your touch.")>>
<<set _responses.push(_char.dialogue("Please stop it, I\'m begging you..."))>>
<<set _responses.push(setup.titleCase(setup.his(_char)) + " pleading gets interrupted by a moan.")>>
<</if>>
<<set _char.mental_conditions.discomfort += 3>>
<<set _char.mental_conditions.arousal += 2>>
<<set _char.slave_traits.willpower -= 1>>
<<else>>
<<if _char.gender == 0>>
<<set _responses.push("Under construction for males.")>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " lets out a moan of bliss as squelshing sounds of her pussy \
echo through the air.")>>
<</if>>
<<set _char.mental_conditions.discomfort -= 2>>
<<set _char.mental_conditions.arousal += 4>>
<<set $player.mental_conditions.arousal += 1>>
<</if>>
<<set _mins = 2 + dice(1, 3)>>
<<addmins _mins>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#sex8;<<button "Lick pussy">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You lower your head down inbetween " + setup.titleCase(_char.first_name) + "\'s legs but" +
setup.he(_char) + " quickly closes them, weary of your attempt at licking " + setup.his(_char)>>
<<if _char.gender == 0>>
<<set _query_str += " cock.">>
<<else>>
<<set _query_str += " pussy.">>
<</if>>
<<if _query_action("lick", 25, _query_str)>>
<<if _char.gender == 0>>
/* TODO: Implement for male */
<<set _responses = []>>
<<else>>
<<set _responses = ["You plunge your tongue into " + setup.titleCase(_char.first_name) + "\'s pussy, tasting \
her aroma and all of her juices."]>>
<</if>>
<<if _sex_state.rape>>
<<if _char.gender == 0>>
<<set _responses.push("Under construction for males.")>>
<<else>>
<<set _responses.push("Tears drip down " + setup.titleCase(_char.first_name) + " face as she can\'t help but moan \
and feel pleasure from your tongue swirling in her pussy.")>>
<<set _responses.push(_char.dialogue("Please stop it, I\'m begging you... not... there..."))>>
<<set _responses.push(setup.titleCase(setup.his(_char)) + " pleading gets interrupted by several moans as she bites \
her lips to stop from screaming.")>>
<</if>>
<<set _char.mental_conditions.discomfort += 2>>
<<set _char.mental_conditions.arousal += 6>>
<<set _char.slave_traits.willpower -= 2>>
<<else>>
<<if _char.gender == 0>>
<<set _responses.push("Under construction for males.")>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " bites her lip to stop herself from screaming out in pleasure,")>>
<<set _responses.push(_char.dialogue("Ohhh yess!! Just like that, don\'t stop!"))>>
<</if>>
<<set _char.mental_conditions.discomfort -= 6>>
<<set _char.mental_conditions.arousal += 10>>
<<set $player.mental_conditions.arousal += 3>>
<</if>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<if _char.gender == 0>>
/* TODO: Implement for male */
<<set _responses = []>>
<<else>>
<<set _responses = ["You plunge your tongue into " + setup.titleCase(_char.first_name) + "\'s pussy, tasting \
her aroma and all of her juices."]>>
<</if>>
<<if _sex_state.rape>>
<<if _char.gender == 0>>
<<set _responses.push("Under construction for males.")>>
<<else>>
<<set _responses.push("Tears drip down " + setup.titleCase(_char.first_name) + " face as she can\'t help but moan \
and feel pleasure from your tongue swirling in her pussy.")>>
<<set _responses.push(_char.dialogue("Please stop it, I\'m begging you... not... there..."))>>
<<set _responses.push(setup.titleCase(setup.his(_char)) + " pleading gets interrupted by several moans as she bites \
her lips to stop from screaming.")>>
<</if>>
<<set _char.mental_conditions.discomfort += 2>>
<<set _char.mental_conditions.arousal += 6>>
<<set _char.slave_traits.willpower -= 2>>
<<else>>
<<if _char.gender == 0>>
<<set _responses.push("Under construction for males.")>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " bites her lip to stop herself from screaming out in pleasure,")>>
<<set _responses.push(_char.dialogue("Ohhh yess!! Just like that, don\'t stop!"))>>
<</if>>
<<set _char.mental_conditions.discomfort -= 6>>
<<set _char.mental_conditions.arousal += 10>>
<<set $player.mental_conditions.arousal += 3>>
<</if>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
<</disable>>
@@#sex9;<<button "Footjob">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You grab " + setup.titleCase(_char.first_name) + "\'s " + _char.physical_traits.skin_color +
"feet and position your " + _cock + " between them, but " + setup.he(_char) + " pulls back, \
clearly uncomfortable.">>
<<if _query_action("footjob", 30, _query_str)>>
<<set _responses = ["You slide your wet " + _cock + " between " + setup.titleCase(_char.first_name) + "\'s feet and \
toes which have become wet with your spit and precum."]>>
<<if _sex_state.rape>>
<<if _char.sex_fetishes.feet gt 30>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s looks at you with dead eyes, but having a foot fetish, " + setup.he(_char) +
" is secretly getting very turned on.")>>
<<set _char.mental_conditions.arousal += 4>>
<<set _char.slave_traits.willpower -= 0.5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s looks at you with dead eyes, and hates that " + setup.he(_char) +
" is being humiliated like this.")>>
<<set _char.mental_conditions.discomfort += 4>>
<<set _char.slave_traits.willpower -= 0.5>>
<</if>>
<<else>>
<<if _char.sex_fetishes.feet gt 30>>
<<set _responses.push(setup.titleCase(_char.first_name) + " lets out a moan of bliss as their toes get fucked by you.")>>
<<set _char.mental_conditions.arousal += 5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " enjoys having their feet be used as sex objects.")>>
<<set _char.mental_conditions.arousal += 2>>
<<set _char.sex_fetishes.feet += 1>>
<</if>>
<<set _char.mental_conditions.discomfort -= 2>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _mins = 1 + dice(1, 2)>>
<<addmins _mins>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _responses = ["You slide your wet " + _cock + " between " + setup.titleCase(_char.first_name) + "\'s feet and \
toes which have become wet with your spit and precum."]>>
<<if _sex_state.rape>>
<<if _char.sex_fetishes.feet gt 30>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s looks at you with dead eyes, but having a foot fetish, " + setup.he(_char) +
" is secretly getting very turned on.")>>
<<set _char.mental_conditions.arousal += 4>>
<<set _char.slave_traits.willpower -= 0.5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s looks at you with dead eyes, and hates that " + setup.he(_char) +
" is being humiliated like this.")>>
<<set _char.mental_conditions.discomfort += 4>>
<<set _char.slave_traits.willpower -= 0.5>>
<</if>>
<<else>>
<<if _char.sex_fetishes.feet gt 30>>
<<set _responses.push(setup.titleCase(_char.first_name) + " lets out a moan of bliss as their toes get fucked by you.")>>
<<set _char.mental_conditions.arousal += 5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " enjoys having their feet be used as sex objects.")>>
<<set _char.mental_conditions.arousal += 2>>
<<set _char.sex_fetishes.feet += 1>>
<</if>>
<<set _char.mental_conditions.discomfort -= 2>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _mins = 1 + dice(1, 2)>>
<<addmins _mins>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
@@#sex10;<<button "Oral sex">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You grab your " + _cock + " out of your pants and pull " + setup.titleCase(_char.first_name) + "\'s " +
_char.physical_traits.hair_color + " hair to line up " + setup.his(_char) + " head, but " + setup.he(_char) +
" clearly tries to pull way, not fond of the idea of giving you a blowjob.">>
<<if _query_action("oral", 40, _query_str)>>
<<set _responses = ["You insert your " + _cock + " into " + setup.titleCase(_char.first_name) + "\'s mouth."]>>
<<if _sex_state.rape>>
<<if _char.sex_fetishes.cum gt 30>>
<<set _responses.push("Tears stream down " + setup.titleCase(_char.first_name) + "\'s face, but being a cumslut, " + setup.PRONOUNS[_char.gender]["?he"] + " looks \
forward to being filled with your cum.")>>
<<set _char.mental_conditions.arousal += 4>>
<<set _char.slave_traits.willpower -= 1>>
<<set _char.slave_traits.trust -= 2>>
<<else>>
<<set _responses.push("Tears stream down " + setup.titleCase(_char.first_name) + "\'s face as you start to orally rape " +
setup.him(_char) + ".")>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.willpower -= 2>>
<<set _char.slave_traits.obedience -= 10>>
<<set _char.slave_traits.trust -= 2>>
<<set _char.sex_prefs.oral -= 1>>
<</if>>
<<else>>
<<if _char.sex_fetishes.cum gt 30>>
<<set _responses.push(setup.titleCase(_char.first_name) + " lets out a moan of bliss as your precum touches their tongue. As \
a cumslut they are gushing wet just thinking about your cum.")>>
<<set _responses.push(_char.dialogue("Please give me your cum; I want to bath and be filled with it!"))>>
<<set _char.mental_conditions.arousal += 5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " takes in your " + _cock + " with hunger in " +
setup.his(_char) + " eyes.")>>
<<set _char.mental_conditions.arousal += 3>>
<</if>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_oral_actions" "hidden">>
<<addclass "#sex_actions" "hidden">>
<<set _open_menu = "#sex_oral_actions">>
<<set _sex_state.last_action = "oral">>
<<set _sex_state.bottom = false>>
<<set _sex_state.top = false>>
<<stop>>
<</if>><</repeat>><</silently>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _responses = ["You insert your " + _cock + " into " + setup.titleCase(_char.first_name) + "\'s mouth."]>>
<<if _sex_state.rape>>
<<if _char.sex_fetishes.cum gt 30>>
<<set _responses.push("Tears stream down " + setup.titleCase(_char.first_name) + "\'s face, but being a cumslut, " + setup.PRONOUNS[_char.gender]["?he"] + " looks \
forward to being filled with your cum.")>>
<<set _char.mental_conditions.arousal += 4>>
<<set _char.slave_traits.willpower -= 1>>
<<set _char.slave_traits.trust -= 2>>
<<else>>
<<set _responses.push("Tears stream down " + setup.titleCase(_char.first_name) + "\'s face as you start to orally rape " +
setup.him(_char) + ".")>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.willpower -= 2>>
<<set _char.slave_traits.obedience -= 10>>
<<set _char.slave_traits.trust -= 2>>
<<set _char.sex_prefs.oral -= 1>>
<</if>>
<<else>>
<<if _char.sex_fetishes.cum gt 30>>
<<set _responses.push(setup.titleCase(_char.first_name) + " lets out a moan of bliss as your precum touches their tongue. As \
a cumslut they are gushing wet just thinking about your cum.")>>
<<set _responses.push(_char.dialogue("Please give me your cum; I want to bath and be filled with it!"))>>
<<set _char.mental_conditions.arousal += 5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " takes in your " + _cock + " with hunger in " +
setup.his(_char) + " eyes.")>>
<<set _char.mental_conditions.arousal += 3>>
<</if>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_oral_actions" "hidden">>
<<addclass "#sex_actions" "hidden">>
<<set _open_menu = "#sex_oral_actions">>
<<set _sex_state.last_action = "oral">>
<<set _sex_state.bottom = false>>
<<set _sex_state.top = false>>
<<stop>>
<</if>><</repeat>><</silently>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
<<disable>>
@@#sex11;<<button "Vaginal sex">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You grab your " + _cock + " out of your pants and line it up with " + setup.titleCase(_char.first_name) +
"\'s vagina.">>
<<if _query_action("vaginal", 50, _query_str)>>
<<set _responses = ["You insert your " + _cock + " into " + setup.titleCase(_char.first_name) + "\'s wet pussy."]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + " screams and chokes on her tears.")>>
<<set _responses.push(_char.dialogue("Please! please! Anything but that! Please!..."))>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.willpower -= 3>>
<<set _char.slave_traits.obedience -= 15>>
<<set _char.slave_traits.trust -= 7>>
<<set _char.sex_prefs.vaginal -= 1>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " pulls you in and begs for more.")>>
<<set _responses.push(_char.dialogue("Yes yes! Please fuck me!"))>>
<<set _char.mental_conditions.arousal += 7>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_vaginal_actions" "hidden">>
<<addclass "#sex_actions" "hidden">>
<<set _open_menu = "#sex_vaginal_actions">>
<<set _sex_state.last_action = "vaginal">>
<<set _sex_state.bottom = false>>
<<set _sex_state.top = false>>
<<stop>>
<</if>><</repeat>><</silently>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _responses = ["You insert your " + _cock + " into " + setup.titleCase(_char.first_name) + "\'s wet pussy."]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + " screams and chokes on her tears.")>>
<<set _responses.push(_char.dialogue("Please! please! Anything but that! Please!..."))>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.willpower -= 3>>
<<set _char.slave_traits.obedience -= 15>>
<<set _char.slave_traits.trust -= 7>>
<<set _char.sex_prefs.vaginal -= 1>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " pulls you in and begs for more.")>>
<<set _responses.push(_char.dialogue("Yes yes! Please fuck me!"))>>
<<set _char.mental_conditions.arousal += 7>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_vaginal_actions" "hidden">>
<<addclass "#sex_actions" "hidden">>
<<set _open_menu = "#sex_vaginal_actions">>
<<set _sex_state.last_action = "vaginal">>
<<set _sex_state.bottom = false>>
<<set _sex_state.top = false>>
<<stop>>
<</if>><</repeat>><</silently>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#sex12;<<button "Anal sex">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You grab your " + _cock + " out of your pants and line it up with " + setup.titleCase(_char.first_name) +
"\'s asshole.">>
<<if _query_action("anal", 65, _query_str)>>
<<set _responses = ["You insert your " + _cock + " into " + setup.titleCase(_char.first_name) + "\'s tight asshole."]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + " screams and chokes on her tears.")>>
<<set _responses.push(_char.dialogue("Please! please! Not my ass, it hurts so much! Please!..."))>>
<<set _char.mental_conditions.anger += 20>>
<<set _char.mental_conditions.discomfort += 20>>
<<set _char.slave_traits.willpower -= 5>>
<<set _char.slave_traits.obedience -= 20>>
<<set _char.slave_traits.trust -= 10>>
<<set _char.sex_prefs.anal -= 2>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " pulls you in and begs for more.")>>
<<set _responses.push(_char.dialogue("Yes yes! Please fuck my ass!"))>>
<<set _char.mental_conditions.arousal += 8>>
<</if>>
<<set $player.mental_conditions.arousal += 15>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_anal_actions" "hidden">>
<<addclass "#sex_actions" "hidden">>
<<set _open_menu = "#sex_anal_actions">>
<<set _sex_state.last_action = "anal">>
<<set _sex_state.bottom = false>>
<<set _sex_state.top = false>>
<<stop>>
<</if>><</repeat>><</silently>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _responses = ["You insert your " + _cock + " into " + setup.titleCase(_char.first_name) + "\'s tight asshole."]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + " screams and chokes on her tears.")>>
<<set _responses.push(_char.dialogue("Please! please! Not my ass, it hurts so much! Please!..."))>>
<<set _char.mental_conditions.anger += 20>>
<<set _char.mental_conditions.discomfort += 20>>
<<set _char.slave_traits.willpower -= 5>>
<<set _char.slave_traits.obedience -= 20>>
<<set _char.slave_traits.trust -= 10>>
<<set _char.sex_prefs.anal -= 2>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " pulls you in and begs for more.")>>
<<set _responses.push(_char.dialogue("Yes yes! Please fuck my ass!"))>>
<<set _char.mental_conditions.arousal += 8>>
<</if>>
<<set $player.mental_conditions.arousal += 15>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_anal_actions" "hidden">>
<<addclass "#sex_actions" "hidden">>
<<set _open_menu = "#sex_anal_actions">>
<<set _sex_state.last_action = "anal">>
<<set _sex_state.bottom = false>>
<<set _sex_state.top = false>>
<<stop>>
<</if>><</repeat>><</silently>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
<</disable>>
<div></div>
@@#sex_back;<<button "Back">>
<<set $enable_menu = true>>
<<if def _back_action && (ndef _refresh || !_refresh)>>
<<addclass "#sex_actions" "hidden">>
<<removeclass `_back_action` "hidden">>
<<addclass "#sex_info" "hidden">>
<<removeclass "#info" "hidden">>
<<else>>
<<goto `passage()`>>
<</if>>
<</button>>@@
<<disable>>
@@#sex_done;<<button "Done" `passage()`>>
<<if _sex_state.orgasm>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.<br>" + _char.dialogue("That was great, let\'s do that again sometime...") +
"(" + setup.titleCase(_char.first_name) + "\'s Affection " + setup.show_change_html(0, 5) + ")">>
<<set _char.slave_traits.obedience += 5>>
<<elseif _char.mental_conditions.arousal gt 20 && _char.mental_conditions.discomfort lt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" found the experience quite pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10>>
<<elseif _char.mental_conditions.discomfort gt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" did not find the experience pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, _char.mental_conditions.arousal - _char.mental_conditions.discomfort) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort)>>
<<else>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.">>
<</if>>
/* Re-enable menu */
<<set $enable_menu = true>>
<<set $to_simulate.add(_char.key)>>
/* Last round for good measure */
<<set _to_round = _char.key>>
<<include round>>
<<run _get_changes()>>
<</button>>@@
<</disable>>
/* Specifications for logging */
<<set _sex_buttons = ["#sex_back", "#sex_done",
"#sex_oral_back", "#sex_oral_done",
"#sex_vaginal_back", "#sex_vaginal_done",
"#sex_anal_back", "#sex_anal_done",
"#sex_vaginal_oral", "#sex_vaginal_anal",
"#sex_anal_oral", "#sex_anal_vaginal",
"#sex_oral_vaginal", "#sex_oral_anal"]>>
<<for _i = 1; _i lte 12; _i++>>
<<set _sex_buttons.push("#sex" + _i)>>
<<set _sex_buttons.push("#sex_oral" + _i)>>
<<set _sex_buttons.push("#sex_vaginal" + _i)>>
<<set _sex_buttons.push("#sex_anal" + _i)>>
<</for>>
</div>
/* Include the other actions */
<<include sexOralActions>>
<<include sexVaginalActions>>
<<include sexAnalActions>>
<<include sexRejectionActions>>
<<timed 50ms>><<script>>
var _t = State.temporary;
_t.calc_thresh = (action) => {
let char = State.temporary.char;
let player = State.variables.player;
let thresh = (80 - char.slave_traits.willpower +
char.slave_traits.obedience - 60 +
char.slave_traits.trust -
char.mental_conditions.anger +
char.mental_conditions.arousal * (3 - State.variables.difficulty) -
char.mental_conditions.discomfort +
char.sex_prefs.libido - 40);
if (action == "oral" || action == "vaginal" || action == "anal") {
thresh += player.sex_skills[action] + char.sex_prefs[action];
} else {
}
if (_t.sex_state.orgasm) {
thresh += 1000;
}
return thresh;
};
_t.query_action = (action, modifier, text) => {
_t.check_fucking();
let sex_state = _t.sex_state;
_t.thresh = modifier - _t.calc_thresh(action);
if (sex_state.rape || (action in sex_state.boundaries && sex_state.boundaries[action]) || _t.thresh < 0) {
sex_state.boundaries[action] = true;
return true;
} else {
if (text !== "undefined") {
if (!_t.is_fucking) {
setup.mainLog_append_delayed([text + "<br>" + _t.char.dialogue("Uh, what the fuck are you doing?")]);
} else {
setup.mainLog_append_delayed([text + "<br>" + _t.char.dialogue("Um... no.")]);
}
}
_t.rejection_processed = false;
_t.action = action;
$.wiki("<<include sexRejectionEngine>>");
return false;
}
};
_t.update_state = () => {
let _t = State.temporary;
let char = _t.char;
let player = State.variables.player;
if (_t.is_fucking) {
$("#sex_back button").addClass("disabled");
$("#sex_back button").prop("disabled", true);
$("#sex_done button").removeClass("disabled");
$("#sex_done button").prop("disabled", false);
}
if (!_t.sex_state.top) {
$("#sex4 button").addClass("disabled");
$("#sex4 button").prop("disabled", true);
$("#sex6 button").removeClass("disabled");
$("#sex6 button").prop("disabled", false);
}
if (!_t.sex_state.bottom) {
$("#sex5 button").addClass("disabled");
$("#sex5 button").prop("disabled", true);
$("#sex7 button").removeClass("disabled");
$("#sex7 button").prop("disabled", false);
$("#sex8 button").removeClass("disabled");
$("#sex8 button").prop("disabled", false);
if (player.gender == 0) {
if (char.gender != 0) {
$("#sex11 button").removeClass("disabled");
$("#sex11 button").prop("disabled", false);
}
$("#sex12 button").removeClass("disabled");
$("#sex12 button").prop("disabled", false);
} else {
if (char.gender == 0 && (player.has_equipped("strap-on") != "none")) {
$("#sex12 button").removeClass("disabled");
$("#sex12 button").prop("disabled", false);
}
}
}
if (!_t.sex_state.top && !_t.sex_state.bottom) {
$("#sex3 button").addClass("disabled");
$("#sex3 button").prop("disabled", true);
}
};
$("#sex_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
if (self.html() != "Back" && self.html() != "Done") {
let _t = State.temporary;
let char = _t.char;
let player = State.variables.player;
_t.to_round = _t.char.key;
$.wiki("<<include round>>");
$.wiki("<<include updateBars>>");
}
});
_t.check_fucking = () => {
let _t = State.temporary;
let char = _t.char;
if (!_t.is_fucking) {
_t.is_fucking = true;
char.limits.fuck -= 1;
}
};
_t.check_arousal = () => {
let _t = State.temporary;
let char = _t.char;
let player = State.variables.player;
_t.update_state();
if (char.mental_conditions.arousal >= char.mental_conditions.max_arousal) {
if (_t.sex_state.last_action in char.sex_prefs) {
char.sex_prefs[_t.sex_state.last_action] += 1;
char.sex_prefs.libido = (char.sex_prefs.libido + 1).clamp(0, 100);
}
}
if (player.mental_conditions.arousal >= player.mental_conditions.max_arousal && char.mental_conditions.arousal >= char.mental_conditions.max_arousal) {
let str = "This pushes both you and " + setup.titleCase(char.first_name) + " off the edge, resulting \
in a simultaneous orgasm of euphoria.";
if (player.gender == 0) {
str += " You quickly grab your cock and need to cum.";
_t.is_cumming = true;
}
_t.responses.push(str);
str = "Fuck that was so good!";
if (player.gender == 0) {
str += " Give it to me!";
}
_t.responses.push(char.dialogue(str));
_t.responses.push("Where do you cum?");
_t.sex_state.orgasm = true;
char.mental_conditions.arousal = 0;
char.conditions.stamina -= 30;
let loop = () => {
setTimeout(() => {
if (_t.done_appending !== "undefined" && _t.done_appending) {
$(_t.open_menu).addClass("hidden");
$("#action_bar").wiki("<<include sexCumActions>>");
} else {
loop();
}
}, 20);
};
setTimeout(() => {
loop();
}, 50);
} else if (player.mental_conditions.arousal >= player.mental_conditions.max_arousal) {
let str = "This pushes you off the edge, making you move into orgasm.";
if (player.gender == 0) {
str += " You quickly grab your cock and need to cum.";
_t.is_cumming = true;
}
_t.responses.push(str);
_t.responses.push("Where do you cum?");
let loop = () => {
setTimeout(() => {
if (_t.done_appending !== "undefined" && _t.done_appending) {
$(_t.open_menu).addClass("hidden");
$("#action_bar").wiki("<<include sexCumActions>>");
} else {
loop();
}
}, 20);
};
setTimeout(() => {
loop();
}, 50);
} else if (char.mental_conditions.arousal >= char.mental_conditions.max_arousal) {
_t.responses.push("This pushes " + setup.titleCase(char.first_name) + " off the edge, making " +
setup.him(char) + " orgasm immediately.");
_t.responses.push(char.dialogue("Fuck that was so good!"));
_t.sex_state.orgasm = true;
char.mental_conditions.arousal = 0;
char.conditions.stamina -= 30;
}
char.conditions.stamina -= 5 * (1 + State.variables.difficulty / 10);
setup.mainLog_append_delayed(_t.responses, _t.sex_buttons);
delete _t.responses;
};
_t.get_changes = () => {
let _t = State.temporary;
let char = _t.char;
let prechar = _t.prechar;
$.wiki("<<showChanges \'Player Changes\'>>");
let ret = "<div><b>" + setup.titleCase(char.first_name) + " Changes</b>";
let change_str = "<ul class=\"mainLogChanges\">";
for (let condition of setup.CONDITIONS) {
if (char.conditions[condition] != prechar.conditions[condition]) {
if (condition in setup.POSITIVES.character) {
change_str += "<li>" + setup.titleCase(condition) + ": " +
setup.show_change_html(prechar.conditions[condition], char.conditions[condition],
setup.POSITIVES.character[condition]);
} else {
change_str += "<li>" + setup.titleCase(condition) + ": " +
setup.show_change(prechar.conditions[condition], char.conditions[condition]);
}
change_str += "</li>";
}
}
for (let slave_trait of setup.SLAVE_TRAITS) {
if (char.slave_traits[slave_trait] != prechar.slave_traits[slave_trait]) {
let tit = setup.titleCase(slave_trait);
if (slave_trait == "obedience") {
tit = "Affection";
}
if (slave_trait == "trust" && (char.slave_traits[slave_trait] > prechar.slave_traits[slave_trait])) {
change_str += "<li>" + tit + ": " + setup.show_change_html(prechar.slave_traits[slave_trait], char.slave_traits[slave_trait]);
} else {
if (slave_trait in setup.POSITIVES.character) {
change_str += "<li>" + tit + ": " + setup.show_change_html(prechar.slave_traits[slave_trait], char.slave_traits[slave_trait],
setup.POSITIVES.character[slave_trait]);
} else {
change_str += "<li>" + tit + ": " + setup.show_change(prechar.slave_traits[slave_trait], char.slave_traits[slave_trait]);
}
}
change_str += "</li>";
}
}
for (let condition of setup.MENTAL_CONDITIONS) {
if (condition == "arousal") {
continue;
}
if (char.mental_conditions[condition] != prechar.mental_conditions[condition]) {
if (condition in setup.POSITIVES.character) {
change_str += "<li>" + setup.titleCase(condition) + ": " +
setup.show_change_html(prechar.mental_conditions[condition], char.mental_conditions[condition],
setup.POSITIVES.character[condition]);
} else {
change_str += "<li>" + setup.titleCase(condition) + ": " +
setup.show_change(prechar.mental_conditions[condition], char.mental_conditions[condition]);
}
change_str += "</li>";
}
}
for (let sex_pref of setup.SEX_PREFS) {
if (char.sex_prefs[sex_pref] != prechar.sex_prefs[sex_pref]) {
if (sex_pref in setup.POSITIVES.character) {
change_str += "<li>" + setup.titleCase(sex_pref) + " Preference: " +
setup.show_change_html(prechar.sex_prefs[sex_pref], char.sex_prefs[sex_pref],
setup.POSITIVES.character[sex_pref]);
} else {
change_str += "<li>" + setup.titleCase(sex_pref) + " Preference: " +
setup.show_change(prechar.sex_prefs[sex_pref], char.sex_prefs[sex_pref]);
}
change_str += "</li>";
}
}
for (let sex_fetish of setup.SEX_FETISHES) {
if (char.sex_fetishes[sex_fetish] != prechar.sex_fetishes[sex_fetish]) {
if (sex_fetish in setup.POSITIVES.character) {
change_str += "<li>" + setup.titleCase(sex_fetish) + " Fetish: " +
setup.show_change_html(prechar.sex_fetishes[sex_fetish], char.sex_fetishes[sex_fetish],
setup.POSITIVES.character[sex_fetish]);
} else {
change_str += "<li>" + setup.titleCase(sex_fetish) + " Fetish: " +
setup.show_change(prechar.sex_fetishes[sex_fetish], char.sex_fetishes[sex_fetish]);
}
change_str += "</li>";
}
}
change_str += "</ul></div>";
ret += change_str;
State.variables._temp_to_log += ret;
};
<</script>><</timed>>
<</nobr>><<nobr>>
<div id="sex_anal_actions" class="action container row col longbutton fiveQuarters smalltext hidden"
style="--rows: 4; --cols: 4">
@@#sex_anal1;<<button "Continue">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _thresh = _calc_thresh("anal", 65)>>
<<set _responses = [
"You continue fucking " + setup.titleCase(_char.first_name) + "\'s ass. As you thrust in and out \
air is pumped into her anal cavity,"
]>>
<<if _sex_state.rape>>
<<set _responses.push(_char.dialogue(either([
"Please stop you\'re going to tear me apart!",
"It hurts! It hurts!!",
"Just fucking kill me already please just end it!"
])))>>
<<set _char.mental_conditions.anger += 5>>
<<set _char.mental_conditions.discomfort += 5>>
<<set _char.slave_traits.willpower -= 1>>
<<set _char.slave_traits.obedience -= 5>>
<<set _char.slave_traits.trust -= 2>>
<<set _char.sex_prefs.anal -= 0.5>>
<<else>>
<<set _responses.push(_char.dialogue(either([
"Yes! Please keep fucking me just like that!",
"Fuck me harder!",
"Please don\'t stop!",
"Ahhh fuck that\'s so good!"
])))>>
<<set _char.mental_conditions.arousal += 7>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</if>>
<</button>>@@
@@#sex_anal2;<<button "Choke">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _thresh = _calc_thresh("anal", 70)>>
<<set _responses = [
"As you continue fucking " + setup.titleCase(_char.first_name) + "\'s ass, you put your hands around " + setup.him(_char) +
" neck restricting her breath."
]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s face grows red and tears stream down " + setup.his(_char) +
" cheek,")>>
<<set _responses.push(_char.dialogue(either([
"What the fuck! Let go of me!",
"It hurts! It hurts!!",
"Just fucking kill me already please just end it, choke me to death right here."
])))>>
<<set _char.mental_conditions.anger += 5>>
<<set _char.mental_conditions.discomfort += 5>>
<<set _char.slave_traits.obedience -= 5>>
<<set _char.slave_traits.trust -= 2>>
<<set _char.sex_prefs.anal -= 0.5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s face grows red and " + setup.his(_char) +
" eyes roll back in bliss,")>>
<<set _responses.push(_char.dialogue(either([
"Yes! Choke me " + _char.address + ", harder!",
"Fuck me harder!",
"Ack... Fuck... Keep going.",
"Ahhh fuck that\'s so good!"
])))>>
<<set _char.mental_conditions.arousal += 7>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _char.slave_traits.willpower -= 1>>
<<run _check_arousal()>>
<</if>>
<</button>>@@
@@#sex_anal3;<<button "Insult">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _thresh = _calc_thresh("anal", 75)>>
<<set _responses = [
"You continue thrusting in " + setup.titleCase(_char.first_name) + "\'s ass."
]>>
<<set _responses.push($player.dialogue(either([
"You\'re such a fucking disgusting little whore.",
"You little bitch aren\'t worth anything except a little piece of shit for me to fuck.",
"Take it you fucking cunt.",
"I bet this is the only reason anyone keeps you around, you fucking shit.",
"You\'re nothing just a little fuck toy aren\'t you?"
])))>>
<<if _sex_state.rape>>
<<set _responses.push("You can tell from the tears forming in " + setup.titleCase(_char.first_name) + "\'s eyes that \
you went too far.")>>
<<set _responses.push(_char.dialogue("What the fu..."))>>
<<set _char.mental_conditions.anger += 5>>
<<set _char.mental_conditions.discomfort += 5>>
<<set _char.slave_traits.obedience -= 5>>
<<set _char.slave_traits.willpower -= 1>>
<<else>>
<<set _responses.push(_char.dialogue("Yeah, that\'s right, ahhhh!"))>>
<<set _char.mental_conditions.arousal += 7>>
<<set _char.slave_traits.willpower -= 2>>
<</if>>
<<set _responses.push(setup.titleCase(setup.he(_char)) + " gets cut off by your continual pounding of " +
setup.his(_char) + " ass.")>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</if>>
<</button>>@@
@@#sex_anal4;<<button "Spit in mouth">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _thresh = _calc_thresh("anal", 80)>>
<<set _responses = [
"As you continue thrusting in " + setup.titleCase(_char.first_name) + "\'s ass, you force open " +
setup.his(_char) + " mouth and spit into it."
]>>
<<set _responses.push($player.dialogue(either([
"Drink my fucking spit you ugly pig.",
"You like that you disgusting piece of shit?",
"You\'re nothing, just a piece of trash to spit and cum on."
])))>>
<<if _sex_state.rape>>
<<set _responses.push("You can tell from the tears forming in " + setup.titleCase(_char.first_name) + "\'s eyes that \
you went too far.")>>
<<set _responses.push(_char.dialogue("What the fu..."))>>
<<set _char.mental_conditions.anger += 5>>
<<set _char.mental_conditions.discomfort += 5>>
<<set _char.slave_traits.obedience -= 5>>
<<set _char.slave_traits.willpower -= 1>>
<<else>>
<<set _responses.push(_char.dialogue("Yeah, that\'s right, give me more I deser..."))>>
<<set _char.mental_conditions.arousal += 7>>
<<set _char.slave_traits.willpower -= 3>>
<</if>>
<<set _responses.push(setup.titleCase(setup.he(_char)) + " gets cut off by your continual pounding of " +
setup.his(_char) + " ass.")>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</if>>
<</button>>@@
@@#sex_anal5;<<button "Slap">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _thresh = _calc_thresh("anal", 85)>>
<<set _responses = [
"As you are drilling " + setup.titleCase(_char.first_name) + "\'s wet pussy you slap " + setup.him(_char) +
" across the face."
]>>
<<if _sex_state.rape>>
<<set _responses.push(_char.dialogue("Ow what the fuck! That fucking hurt!"))>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.obedience -= 10>>
<<set _char.slave_traits.willpower -= 2>>
<<else>>
<<set _responses.push(_char.dialogue("Oh my god yes! Punish me! Slap me more like a little whore!"))>>
<<set _char.mental_conditions.arousal += 7>>
<<set _char.slave_traits.willpower -= 5>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</if>>
<</button>>@@
@@#sex_anal6;<<button "Spank">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _thresh = _calc_thresh("anal", 70)>>
<<set _responses = [$player.dialogue(either([
"You\'re such a bad little whore.",
"You\'ve been naughty and need to be punished.",
]))]>>
<<set _responses.push(
"You start spanking " + setup.titleCase(_char.first_name) + " ass until it\'s red,"
)>>
<<if _sex_state.rape>>
<<set _responses.push(_char.dialogue("Ow! Stop that hurts!"))>>
<<set _char.mental_conditions.anger += 5>>
<<set _char.mental_conditions.discomfort += 5>>
<<set _char.slave_traits.obedience -= 5>>
<<set _char.slave_traits.willpower -= 1>>
<<else>>
<<set _responses.push(_char.dialogue("Oh my god yes! Punish me!"))>>
<<set _char.mental_conditions.arousal += 7>>
<<set _char.slave_traits.willpower -= 3>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</if>>
<</button>>@@
@@#sex_anal_vaginal;<<button "Oral sex">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You take your " + _cock + " out of " + setup.titleCase(_char.first_name) + "\'s asshole and pull " + setup.titleCase(_char.first_name) + "\'s " +
_char.physical_traits.hair_color + " hair to line up " + setup.his(_char) + " head, but " + setup.he(_char) +
" clearly tries to pull way, not fond of the idea of giving you a blowjob.">>
<<if _query_action("oral", 40, _query_str)>>
<<set _responses = ["You insert your " + _cock + " slick with " + setup.titleCase(_char.first_name) + "\'s juices into " + setup.his(_char) + " mouth."]>>
<<if _sex_state.rape>>
<<if _char.sex_fetishes.cum gt 30>>
<<set _responses.push("Tears stream down " + setup.titleCase(_char.first_name) + "\'s face, but being a cumslut, " + setup.PRONOUNS[_char.gender]["?he"] + " looks \
forward to being filled with your cum.")>>
<<set _char.mental_conditions.arousal += 4>>
<<set _char.slave_traits.willpower -= 1>>
<<set _char.slave_traits.trust -= 2>>
<<else>>
<<set _responses.push("Tears stream down " + setup.titleCase(_char.first_name) + "\'s face as you start to orally rape " +
setup.him(_char) + ".")>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.willpower -= 2>>
<<set _char.slave_traits.obedience -= 10>>
<<set _char.slave_traits.trust -= 2>>
<<set _char.sex_prefs.oral -= 1>>
<</if>>
<<else>>
<<if _char.sex_fetishes.cum gt 30>>
<<set _responses.push(setup.titleCase(_char.first_name) + " lets out a moan of bliss as your precum touches their tongue. As \
a cumslut they are gushing wet just thinking about your cum.")>>
<<set _responses.push(_char.dialogue("Please give me your cum; I want to bath and be filled with it!"))>>
<<set _char.mental_conditions.arousal += 5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " takes in your " + _cock + " with hunger in " +
setup.his(_char) + " eyes.")>>
<<set _char.mental_conditions.arousal += 3>>
<</if>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_oral_actions" "hidden">>
<<addclass "#sex_anal_actions" "hidden">>
<<set _open_menu = "#sex_oral_actions">>
<<stop>>
<</if>><</repeat>><</silently>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _responses = ["You insert your " + _cock + " slick with " + setup.titleCase(_char.first_name) + "\'s juices into " + setup.his(_char) + " mouth."]>>
<<if _sex_state.rape>>
<<if _char.sex_fetishes.cum gt 30>>
<<set _responses.push("Tears stream down " + setup.titleCase(_char.first_name) + "\'s face, but being a cumslut, " + setup.PRONOUNS[_char.gender]["?he"] + " looks \
forward to being filled with your cum.")>>
<<set _char.mental_conditions.arousal += 4>>
<<set _char.slave_traits.willpower -= 1>>
<<set _char.slave_traits.trust -= 2>>
<<else>>
<<set _responses.push("Tears stream down " + setup.titleCase(_char.first_name) + "\'s face as you start to orally rape " +
setup.him(_char) + ".")>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.willpower -= 2>>
<<set _char.slave_traits.obedience -= 10>>
<<set _char.slave_traits.trust -= 2>>
<<set _char.sex_prefs.oral -= 1>>
<</if>>
<<else>>
<<if _char.sex_fetishes.cum gt 30>>
<<set _responses.push(setup.titleCase(_char.first_name) + " lets out a moan of bliss as your precum touches their tongue. As \
a cumslut they are gushing wet just thinking about your cum.")>>
<<set _responses.push(_char.dialogue("Please give me your cum; I want to bath and be filled with it!"))>>
<<set _char.mental_conditions.arousal += 5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " takes in your " + _cock + " with hunger in " +
setup.his(_char) + " eyes.")>>
<<set _char.mental_conditions.arousal += 3>>
<</if>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_anal_actions" "hidden">>
<<addclass "#sex_oral_actions" "hidden">>
<<set _open_menu = "#sex_oral_actions">>
<<stop>>
<</if>><</silently>><</repeat>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
@@#sex_anal_anal;<<button "Vaginal sex">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You pull your " + _cock + " out of " + setup.titleCase(_char.first_name) + "\'s asshole and line it up with ">>
<<if _query_action("vaginal", 50, _query_str)>>
<<set _responses = ["You insert your " + _cock + " slick with " + setup.titleCase(_char.first_name) + "\'s anal juices into " +
setup.his(_char) + " wet pussy."]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + " screams and chokes on her tears.")>>
<<set _responses.push(_char.dialogue("Please! please! Anything but that! Please!..."))>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.willpower -= 3>>
<<set _char.slave_traits.obedience -= 15>>
<<set _char.slave_traits.trust -= 7>>
<<set _char.sex_prefs.vaginal -= 1>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " pulls you in and begs for more.")>>
<<set _responses.push(_char.dialogue("Yes yes! Please fuck me!"))>>
<<set _char.mental_conditions.arousal += 7>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_vaginal_actions" "hidden">>
<<addclass "#sex_anal_actions" "hidden">>
<<set _open_menu = "#sex_vaginal_actions">>
<<set _sex_state.last_action = "vaginal">>
<<stop>>
<</if>><</repeat>><</silently>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _responses = ["You insert your " + _cock + " slick with " + setup.titleCase(_char.first_name) + "\'s anal juices into " +
setup.his(_char) + " wet pussy."]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + " screams and chokes on her tears.")>>
<<set _responses.push(_char.dialogue("Please! please! Anything but that! Please!..."))>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.willpower -= 3>>
<<set _char.slave_traits.obedience -= 15>>
<<set _char.slave_traits.trust -= 7>>
<<set _char.sex_prefs.vaginal -= 1>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " pulls you in and begs for more.")>>
<<set _responses.push(_char.dialogue("Yes yes! Please fuck me!"))>>
<<set _char.mental_conditions.arousal += 7>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_vaginal_actions" "hidden">>
<<addclass "#sex_anal_actions" "hidden">>
<<set _open_menu = "#sex_vaginal_actions">>
<<set _sex_state.last_action = "vaginal">>
<<stop>>
<</if>><</repeat>><</silently>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
<div style="grid-row: 4; grid-column: 2">
@@#sex_anal_back;<<button "Back">>
<<run setup.mainLog_append_delayed(["You take your " + _cock + " out of " +
setup.titleCase(_char.first_name) + "\'s ass."])>>
<<removeclass "#sex_actions" "hidden">>
<<addclass "#sex_anal_actions" "hidden">>
<</button>>@@
</div>
<div style="grid-row: 4; grid-column: 3">
@@#sex_anal_done;<<button "Done" `passage()`>>
<<if _sex_state.orgasm>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.<br>" + _char.dialogue("That was great, let\'s do that again sometime...") +
"(" + setup.titleCase(_char.first_name) + "\'s Affection " + setup.show_change_html(0, 5) + ")">>
<<set _char.slave_traits.obedience += 5>>
<<elseif _char.mental_conditions.arousal gt 20 && _char.mental_conditions.discomfort lt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" found the experience quite pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10>>
<<elseif _char.mental_conditions.discomfort gt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" did not find the experience pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, _char.mental_conditions.arousal - _char.mental_conditions.discomfort) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort)>>
<<else>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.">>
<</if>>
/* Re-enable menu */
<<set $enable_menu = true>>
<<set $to_simulate.add(_char.key)>>
/* Last round for good measure */
<<set _to_round = _char.key>>
<<include round>>
<<run _get_changes()>>
<</button>>@@
</div>
<<timed 50ms>><<script>>
$("#sex_anal_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
if (self.html() != "Back" && self.html() != "Done") {
let _t = State.temporary;
let char = _t.char;
let player = State.variables.player;
_t.to_round = _t.char.key;
$.wiki("<<include round>>");
$.wiki("<<include updateBars>>");
if (self.html() != "Oral sex" && self.html() != "Vaginal sex" && self.html() != "Anal sex") {
let thresh = setup.progressive_gain_chance(player.sex_skills.anal, 100, "root_inverse");
let roll = randomFloat(1.0);
if (roll < thresh) {
player.sex_skills.anal += 1
}
}
}
});
<</script>><</timed>>
</div>
<</nobr>><<nobr>>
<div id="sex_cum_actions" class="action container row col longbutton fiveQuarters smalltext"
style="--rows: 4; --cols: 4">
@@#sex_cum1;<<button "On ground">>
<<set $_temp_to_log = "You pull back and cum all over the ground. ">>
<</button>>@@
@@#sex_cum2;<<button "On face">>
<<set _thresh = _calc_thresh("cum", 100)>>
<<set $_temp_to_log = "You cum all over " + setup.titleCase(_char.first_name) + "\'s face. ">>
<<if _thresh gt 0 && !_sex_state.rape>>
/* TODO, add different text for fails */
<<else>>
<<set _char.sex_fetishes.cum += 1>>
<</if>>
<</button>>@@
@@#sex_cum3;<<button "In mouth">>
<<set _thresh = _calc_thresh("cum", 100)>>
<<set $_temp_to_log = "You cum directly into " + setup.titleCase(_char.first_name) + "\'s mouth. ">>
<<if _thresh gt 0 && !_sex_state.rape>>
<<else>>
<<set _char.sex_fetishes.cum += 1>>
<<set _char.mental_conditions.cum_addition += 1>>
<</if>>
<</button>>@@
<<disable>>
@@#sex_cum4;<<button "In throat">>
<<set _thresh = _calc_thresh("cum", 100)>>
<<set $_temp_to_log = "You cum directly into " + setup.titleCase(_char.first_name) + "\'s throat. ">>
<<if _thresh gt 0 && !_sex_state.rape>>
<<else>>
<<set _char.sex_fetishes.cum += 1>>
<<set _char.mental_conditions.cum_addition += 1>>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#sex_cum5;<<button "In pussy">>
<<set $_temp_to_log = "You cum directly into " + setup.titleCase(_char.first_name) + "\'s pussy. ">>
<</button>>@@
<</disable>><<disable>>
@@#sex_cum6;<<button "In ass">>
<<set $_temp_to_log = "You cum directly into " + setup.titleCase(_char.first_name) + "\'s ass. ">>
<</button>>@@
<</disable>>
</div>
<<for _i = 1; _i lte 6; _i++>>
<<set _sex_buttons.push("#sex_cum" + _i)>>
<</for>>
<<timed 50ms>>
<<if _sex_state.last_action == "oral">>
<<removeclass "#sex_cum4 button" "disabled">>
<<run $("#sex_cum4 button").prop("disabled", false)>>
<<elseif _sex_state.last_action == "vaginal">>
<<removeclass "#sex_cum5 button" "disabled">>
<<run $("#sex_cum5 button").prop("disabled", false)>>
<<elseif _sex_state.last_action == "anal">>
<<removeclass "#sex_cum6 button" "disabled">>
<<run $("#sex_cum6 button").prop("disabled", false)>>
<</if>>
<<script>>
$("#sex_cum_actions").find("button").on("click", () => {
let _t = State.temporary;
let _v = State.variables;
let char = _t.char;
let sex_state = _t.sex_state;
let player = _v.player;
if (sex_state.orgasm) {
_v._temp_to_log += "You leave " + setup.titleCase(char.first_name) + " to " +
setup.his(char) + " duties.<br>" + char.dialogue("That was great, let\'s do that again sometime...") +
"(" + setup.titleCase(char.first_name) + "\'s Affection " + setup.show_change_html(0, 5) + ")";
char.slave_traits.obedience += 5;
} else if (char.mental_conditions.arousal > 20 && char.mental_conditions.discomfort < char.mental_conditions.arousal) {
_v._temp_to_log += "You leave " + setup.titleCase(char.first_name) + " to " +
setup.his(char) + " duties. You can tell that " + setup.he(char) +
" found the experience quite pleasurable (" + setup.titleCase(char.first_name) +
"\'s Affection " + setup.show_change_html(0, (char.mental_conditions.arousal - char.mental_conditions.discomfort) / 10) + ").";
char.slave_traits.obedience += (char.mental_conditions.arousal - char.mental_conditions.discomfort) / 10;
} else if (char.mental_conditions.discomfort > char.mental_conditions.arousal) {
_v._temp_to_log += "You leave " + setup.titleCase(char.first_name) + " to " +
setup.his(char) + " duties. You can tell that " + setup.he(char) +
" did not find the experience pleasurable (" + setup.titleCase(char.first_name) +
"\'s Affection " + setup.show_change_html(0, char.mental_conditions.arousal - char.mental_conditions.discomfort) + ").";
char.slave_traits.obedience += (char.mental_conditions.arousal - char.mental_conditions.discomfort);
} else {
_v._temp_to_log += "You leave " + setup.titleCase(char.first_name) + " to " +
setup.his(char) + " duties.";
}
player.mental_conditions.arousal = 0;
_v.enable_menu = true;
_v.to_simulate.add(char.key);
_t.to_round = char.key;
$.wiki("<<include round>>");
_t.get_changes();
$.wiki("<<goto `passage()`>>");
});
<</script>>
<</timed>>
<</nobr>><<nobr>>
<div id="sex_info" class="subbackground hidden" style="grid-row: 1 / span 3; grid-column: 4 / span 1">
<div class="container threeRow" style="font-weight: normal; height: 100%; width: 100%">
<center>
<h3 style="margin-bottom:0"><<= setup.locations.get(passage()).name>></h3>
<p style="margin: 0">
<<= setup.locations.get_sub_address(passage())>>
</p>
<br>
<div id="sex_datetime">
<<time12hr>>
<br>
<<date>>
</div>
</center>
<center style="padding: 20px">
<strong id="sex_info_name"></strong><br>
<strong id="sex_info_disposition"></strong>
<div id="sex_bars"></div>
<strong><<= setup.titleCase($player.first_name)>></strong>
<div id="sex_player_bars"></div>
</center>
</div>
</div>
<</nobr>><<nobr>>
<div id="sex_oral_actions" class="action container row col longbutton fiveQuarters smalltext hidden"
style="--rows: 4; --cols: 4">
@@#sex_oral1;<<button "Continue">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _thresh = _calc_thresh("oral", 40)>>
<<set _responses = [
"You continue fucking " + setup.titleCase(_char.first_name) + "\'s face. As you thrust in and out \
saliva drips from her mouth,"
]>>
<<if _sex_state.rape>>
<<set _responses.push(_char.dialogue(either([
"Hurk... ack... Please... ack... stop... please...",
"I can\'t... ack... breath... stop...",
])))>>
<<set _char.mental_conditions.anger += 2>>
<<set _char.mental_conditions.discomfort += 3>>
<<set _char.slave_traits.willpower -= 1>>
<<set _char.slave_traits.obedience -= 2>>
<<set _char.slave_traits.trust -= 0.5>>
<<set _char.sex_prefs.oral -= 0.5>>
<<else>>
<<set _responses.push(_char.dialogue(either([
"MMmmmm, you taste so good!",
"I love choking on your cock!",
"Mmmm... ack... don\'t... hurk... stop..."
])))>>
<<set _char.mental_conditions.arousal += 5>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</if>>
<</button>>@@
@@#sex_oral2;<<button "Deep throat">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _thresh = _calc_thresh("oral", 75)>>
<<set _responses = [
"You push " + setup.titleCase(_char.first_name) + "\'s head all the way to the base of your " + _cock + " and \
hold " + setup.him(_char) + " down."
]>>
<<if _sex_state.rape>>
<<set _responses.push(_char.dialogue(either([
"Hurk... ack... Please... ack... stop... please...",
"I can\'t... ack... breath... stop...",
])))>>
<<set _char.mental_conditions.anger += 7>>
<<set _char.mental_conditions.discomfort += 7>>
<<set _char.slave_traits.willpower -= 1>>
<<set _char.slave_traits.obedience -= 7>>
<<set _char.slave_traits.trust -= 2>>
<<set _char.sex_prefs.oral -= 2>>
<<else>>
<<set _responses.push(_char.dialogue(either([
"MMmmmm, you taste so good!",
"I love choking on your cock!",
"Mmmm... ack... don\'t... hurk... stop..."
])))>>
<<set _char.mental_conditions.arousal += 7>>
<<set _char.slave_traits.willpower -= 2>>
<</if>>
<<set $player.mental_conditions.arousal += 15>>
<<run _check_arousal()>>
<</if>>
<</button>>@@
@@#sex_oral3;<<button "Insult">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _thresh = _calc_thresh("oral", 45)>>
<<set _responses = [
"You continue thrusting into " + setup.titleCase(_char.first_name) + "\'s mouth."
]>>
<<set _responses.push($player.dialogue(either([
"You\'re such a fucking disgusting little whore.",
"You little bitch aren\'t worth anything except a little piece of shit for me to fuck.",
"Take it you fucking cunt.",
"I bet this is the only reason anyone keeps you around, you fucking shit.",
"You\'re nothing just a little fuck toy aren\'t you?"
])))>>
<<if _sex_state.rape>>
<<set _responses.push("You can tell from the tears forming in " + setup.titleCase(_char.first_name) + "\'s eyes that \
you went too far.")>>
<<set _responses.push(_char.dialogue("What the fu..."))>>
<<set _char.mental_conditions.anger += 5>>
<<set _char.mental_conditions.discomfort += 5>>
<<set _char.slave_traits.obedience -= 5>>
<<set _char.slave_traits.willpower -= 1>>
<<else>>
<<set _responses.push(_char.dialogue("Yeah, that\'s rig..."))>>
<<set _char.mental_conditions.arousal += 7>>
<<set _char.slave_traits.willpower -= 2>>
<</if>>
<<set _responses.push(setup.titleCase(setup.he(_char)) + " gets cut off by you shoving your " + _cock +
" back into " + setup.his(_char) + " mouth.")>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</if>>
<</button>>@@
@@#sex_oral4;<<button "Spit in mouth">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _thresh = _calc_thresh("oral", 50)>>
<<set _responses = [
"You momentarily take your " + _cock + " out of " + setup.titleCase(_char.first_name) + "\'s mouth and spit into it."
]>>
<<set _responses.push($player.dialogue(either([
"Drink my fucking spit you ugly pig.",
"You like that you disgusting piece of shit?",
"You\'re nothing, just a piece of trash to spit and cum on."
])))>>
<<if _sex_state.rape>>
<<set _responses.push("You can tell from the tears forming in " + setup.titleCase(_char.first_name) + "\'s eyes that \
you went too far.")>>
<<set _responses.push(_char.dialogue("What the fu..."))>>
<<set _char.mental_conditions.anger += 5>>
<<set _char.mental_conditions.discomfort += 5>>
<<set _char.slave_traits.obedience -= 5>>
<<set _char.slave_traits.willpower -= 1>>
<<else>>
<<set _responses.push(_char.dialogue("Yeah, that\'s right, give me more I deser..."))>>
<<set _char.mental_conditions.arousal += 7>>
<<set _char.slave_traits.willpower -= 3>>
<</if>>
<<set _responses.push(setup.titleCase(setup.he(_char)) + " gets cut off by you shoving your " + _cock +
" back into " + setup.his(_char) + " mouth.")>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</if>>
<</button>>@@
@@#sex_oral5;<<button "Slap">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _thresh = _calc_thresh("oral", 55)>>
<<set _responses = [
"As you are face fucking " + setup.titleCase(_char.first_name) + ", you slap " + setup.him(_char) +
" across the face."
]>>
<<if _sex_state.rape>>
<<set _responses.push(_char.dialogue("Ow what the fuck! That fucking hurt!"))>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.obedience -= 10>>
<<set _char.slave_traits.willpower -= 2>>
<<else>>
<<set _responses.push(_char.dialogue("Oh my god yes! Punish me! Slap me more like a little whore!"))>>
<<set _char.mental_conditions.arousal += 7>>
<<set _char.slave_traits.willpower -= 5>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</if>>
<</button>>@@
@@#sex_oral6;<<button "Spank">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<set _thresh = _calc_thresh("oral", 45)>>
<<set _responses = [$player.dialogue(either([
"You\'re such a bad little whore.",
"You\'ve been naughty and need to be punished.",
]))]>>
<<set _responses.push(
"You start spanking " + setup.titleCase(_char.first_name) + " ass until it\'s red,"
)>>
<<if _sex_state.rape>>
<<set _responses.push(_char.dialogue("Ow! Stop that hurts!"))>>
<<set _char.mental_conditions.anger += 5>>
<<set _char.mental_conditions.discomfort += 5>>
<<set _char.slave_traits.obedience -= 5>>
<<set _char.slave_traits.willpower -= 1>>
<<else>>
<<set _responses.push(_char.dialogue("Oh my god yes! Punish me!"))>>
<<set _char.mental_conditions.arousal += 7>>
<<set _char.slave_traits.willpower -= 3>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</if>>
<</button>>@@
@@#sex_oral_vaginal;<<button "Vaginal sex">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You pull your " + _cock + " out of " + setup.titleCase(_char.first_name) + "\'s mouth and line it up with ">>
<<if _query_action("vaginal", 50, _query_str)>>
<<set _responses = ["You insert your " + _cock + " slick with " + setup.titleCase(_char.first_name) + "\'s saliva into " +
setup.his(_char) + " wet pussy."]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + " screams and chokes on her tears.")>>
<<set _responses.push(_char.dialogue("Please! please! Anything but that! Please!..."))>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.willpower -= 3>>
<<set _char.slave_traits.obedience -= 15>>
<<set _char.slave_traits.trust -= 7>>
<<set _char.sex_prefs.vaginal -= 1>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " pulls you in and begs for more.")>>
<<set _responses.push(_char.dialogue("Yes yes! Please fuck me!"))>>
<<set _char.mental_conditions.arousal += 7>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_vaginal_actions" "hidden">>
<<addclass "#sex_oral_actions" "hidden">>
<<set _open_menu = "#sex_vaginal_actions">>
<<set _sex_state.last_action = "vaginal">>
<<stop>>
<</if>><</repeat>><</silently>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _responses = ["You insert your " + _cock + " slick with " + setup.titleCase(_char.first_name) + "\'s saliva into " +
setup.his(_char) + " wet pussy."]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + " screams and chokes on her tears.")>>
<<set _responses.push(_char.dialogue("Please! please! Anything but that! Please!..."))>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.willpower -= 3>>
<<set _char.slave_traits.obedience -= 15>>
<<set _char.slave_traits.trust -= 7>>
<<set _char.sex_prefs.vaginal -= 1>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " pulls you in and begs for more.")>>
<<set _responses.push(_char.dialogue("Yes yes! Please fuck me!"))>>
<<set _char.mental_conditions.arousal += 7>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_vaginal_actions" "hidden">>
<<addclass "#sex_oral_actions" "hidden">>
<<set _open_menu = "#sex_vaginal_actions">>
<<set _sex_state.last_action = "vaginal">>
<<stop>>
<</if>><</repeat>><</silently>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
@@#sex_oral_anal;<<button "Anal sex">>
<<if $player.conditions.stamina lt 5>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 5>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You grab your " + _cock + " out of " + setup.titleCase(_char.first_name) +
"\'s mouth and line it up with " + setup.his(_char) + " asshole.">>
<<if _query_action("anal", 65, _query_str)>>
<<set _responses = ["You insert your " + _cock + " slick with " + setup.titleCase(_char.first_name) + "\'s saliva into " +
setup.his(_char) + " tight asshole."]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + " screams and chokes on her tears.")>>
<<set _responses.push(_char.dialogue("Please! please! Not my ass, it hurts so much! Please!..."))>>
<<set _char.mental_conditions.anger += 20>>
<<set _char.mental_conditions.discomfort += 20>>
<<set _char.slave_traits.willpower -= 5>>
<<set _char.slave_traits.obedience -= 20>>
<<set _char.slave_traits.trust -= 10>>
<<set _char.sex_prefs.anal -= 2>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " pulls you in and begs for more.")>>
<<set _responses.push(_char.dialogue("Yes yes! Please fuck my ass!"))>>
<<set _char.mental_conditions.arousal += 8>>
<</if>>
<<set $player.mental_conditions.arousal += 15>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_anal_actions" "hidden">>
<<addclass "#sex_oral_actions" "hidden">>
<<set _open_menu = "#sex_anal_actions">>
<<set _sex_state.last_action = "anal">>
<<stop>>
<</if>><</repeat>><</silently>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _responses = ["You insert your " + _cock + " slick with " + setup.titleCase(_char.first_name) + "\'s saliva into " +
setup.his(_char) + " tight asshole."]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + " screams and chokes on her tears.")>>
<<set _responses.push(_char.dialogue("Please! please! Not my ass, it hurts so much! Please!..."))>>
<<set _char.mental_conditions.anger += 20>>
<<set _char.mental_conditions.discomfort += 20>>
<<set _char.slave_traits.willpower -= 5>>
<<set _char.slave_traits.obedience -= 20>>
<<set _char.slave_traits.trust -= 10>>
<<set _char.sex_prefs.anal -= 2>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " pulls you in and begs for more.")>>
<<set _responses.push(_char.dialogue("Yes yes! Please fuck my ass!"))>>
<<set _char.mental_conditions.arousal += 8>>
<</if>>
<<set $player.mental_conditions.arousal += 15>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_anal_actions" "hidden">>
<<addclass "#sex_oral_actions" "hidden">>
<<set _open_menu = "#sex_anal_actions">>
<<set _sex_state.last_action = "anal">>
<<stop>>
<</if>><</repeat>><</silently>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
<div style="grid-row: 4; grid-column: 2">
@@#sex_oral_back;<<button "Back">>
<<run setup.mainLog_append_delayed(["You take your " + _cock + " out of " +
setup.titleCase(_char.first_name) + "\'s mouth."])>>
<<removeclass "#sex_actions" "hidden">>
<<addclass "#sex_oral_actions" "hidden">>
<</button>>@@
</div>
<div style="grid-row: 4; grid-column: 3">
@@#sex_oral_done;<<button "Done" `passage()`>>
<<if _sex_state.orgasm>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.<br>" + _char.dialogue("That was great, let\'s do that again sometime...") +
"(" + setup.titleCase(_char.first_name) + "\'s Affection " + setup.show_change_html(0, 5) + ")">>
<<set _char.slave_traits.obedience += 5>>
<<elseif _char.mental_conditions.arousal gt 20 && _char.mental_conditions.discomfort lt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" found the experience quite pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10>>
<<elseif _char.mental_conditions.discomfort gt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" did not find the experience pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, _char.mental_conditions.arousal - _char.mental_conditions.discomfort) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort)>>
<<else>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.">>
<</if>>
/* Re-enable menu */
<<set $enable_menu = true>>
<<set $to_simulate.add(_char.key)>>
/* Last round for good measure */
<<set _to_round = _char.key>>
<<include round>>
<<run _get_changes()>>
<</button>>@@
</div>
</div>
<<timed 50ms>><<script>>
$("#sex_oral_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
if (self.html() != "Back" && self.html() != "Done") {
let _t = State.temporary;
let char = _t.char;
let player = State.variables.player;
_t.to_round = _t.char.key;
$.wiki("<<include round>>");
$.wiki("<<include updateBars>>");
if (self.html() != "Oral sex" && self.html() != "Vaginal sex" && self.html() != "Anal sex") {
let thresh = setup.progressive_gain_chance(player.sex_skills.oral, 100, "root_inverse");
let roll = randomFloat(1.0);
if (roll < thresh) {
player.sex_skills.oral += 1
}
}
}
});
<</script>><</timed>>
<</nobr>><<nobr>>
<div id="sex_rejection_actions" class="action container row col longbutton fiveQuarters smalltext hidden"
style="--rows: 4; --cols: 4">
@@#sexRejection1;<<button "Nevermind">>
<<set _rejection_response = false>>
<<set _responses = [
$player.dialogue("Nevermind.")
]>>
<</button>>@@
@@#sexRejection2;<<button "Convince">>
<<set _roll = dice(1, $player.get_status_prop("manipulation") + $difficulty) - $difficulty>>
<<if _roll gt _thresh>>
<<set _rejection_response = true>>
<<set _responses = [
setup.pass("manipulation"),
$player.dialogue("Come on... it\'s me..."),
_char.dialogue("Hm... okay... you\'ve convinced me.")
]>>
<<set _sex_state.boundaries[_action] = true>>
<<else>>
<<set _rejection_response = false>>
<<if _sex_state.convince_num == 0>>
<<set _responses = [
setup.fail("manipulation"),
$player.dialogue("Come on... it\'s me...")
]>>
<<if _is_fucking>>
<<set _responses.push(_char.dialogue("No... maybe next time, but not right now."))>>
<<else>>
<<set _responses.push(_char.dialogue("Are you joking?"))>>
<</if>>
<<elseif _sex_state.convince_num == 1>>
<<set _responses = [
setup.fail("manipulation"),
$player.dialogue("Come on... it\'s me..."),
_char.dialogue("Stop trying to push my boundaries."),
"(" + setup.titleCase(_char.first_name) + "\'s Anger " + setup.show_change_html(0, 3, false) +
", Willpower " + setup.show_change_html(0, 1, false) + ")."
]>>
<<set _char.mental_conditions.anger += 3>>
<<set _char.slave_traits.willpower += 1>>
<<elseif _sex_state.convince_num == 2>>
<<set _responses = [
setup.fail("manipulation"),
$player.dialogue("Come on... it\'s me..."),
_char.dialogue("I told you to quit pushing me, I\'m warning you."),
"(" + setup.titleCase(_char.first_name) + "\'s Anger " + setup.show_change_html(0, 5, false) +
", Willpower " + setup.show_change_html(0, 4, false) + ")."
]>>
<<set _char.mental_conditions.anger += 5>>
<<set _char.slave_traits.willpower += 4>>
<<elseif _sex_state.convince_num gt 2>>
<<set $_temp_to_log = _char.dialogue("Get the fuck away from me!") +
setup.titleCase(_char.first_name) + " pushes you and walks away (" + setup.titleCase(_char.first_name) +
"\'s Anger " + setup.show_change_html(0, 10, false) +
", Willpower " + setup.show_change_html(0, 6, false) + ").">>
<<set _char.mental_conditions.anger += 10>>
<<set _char.slave_traits.willpower += 6>>
/* Re-enable menu */
<<set $enable_menu = true>>
/* Last round for good measure */
<<set _to_round = _char.key>>
<<include round>>
<<goto `passage()`>>
<</if>>
<<set _sex_state.convince_num += 1>>
<</if>>
<</button>>@@
@@#sexRejection3;<<button "Use Force">>
<<if !_char.is_slave>>
<<notify>>Raping a citizen would probably get you executed.<</notify>>
<<unset _responses>>
<<else>>
<<if _higher_status>>
<<set _sex_state.rape = true>>
<<set _responses = [
"You look " + setup.him(_char) + " dead in the eyes, reminding " +
setup.him(_char) + " of your status. Tears weld up in " +
setup.his(_char) + " eyes as " + setup.he(_char) +
" sinks down and complies (" +
setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, -15) +
", Anger " + setup.show_change_html(0, 20, false) +
", Fear " + setup.show_change_html(0, 10) +
", Willpower " + setup.show_change_html(0, -10, false) + ")."
]>>
<<set _rejection_response = true>>
<<elseif $player.slaves.contains(_char.key)>>
<<set _sex_state.rape = true>>
<<set _responses = [
"You look " + setup.him(_char) + " dead in the eyes, reminding " +
setup.him(_char) + " that you own them. Tears weld up in " +
setup.his(_char) + " eyes as " + setup.he(_char) +
" sinks down and complies (" +
setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, -15) +
", Anger " + setup.show_change_html(0, 20, false) +
", Fear " + setup.show_change_html(0, 10) +
", Willpower " + setup.show_change_html(0, -10, false) + ")."
]>>
<<set _rejection_response = true>>
<<else>>
<<set _roll = $player.stats.strength + dice(1, 6 + $difficulty) - $difficulty>>
<<if _roll - _char.stats.strength gte 15>>
<<set _sex_state.rape = true>>
<<set _responses = [
"You quickly overpower " + setup.him(_char) + " making it obvious that if " +
setup.he(_char) + " resisted anymore it would put " +
setup.his(_char) + " life in danger (" +
setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, -15) +
", Anger " + setup.show_change_html(0, 20, false) +
", Fear " + setup.show_change_html(0, 10) +
", Willpower " + setup.show_change_html(0, -10, false) + ")."
]>>
<<set _rejection_response = true>>
<<else>>
<<set _responses = []>>
<<set $_temp_to_log =
setup.fail("strength") +
"You try to pin " + setup.titleCase(_char.first_name) + " down, but " +
setup.he(_char) + " overpowers you in an instant.<br>" +
_char.dialogue("You fucking piece of garbage, let me show you what happens \
when you try something on me.") +
setup.titleCase(_char.first_name) + " proceeds to crush you and kick you in the \
genitals. After what seems like forever " + setup.he(_char) + " \
shoves you away " +
"(Health " + setup.show_change_html(0, -20) +
", Willpower " + setup.show_change_html(0, -10) + ") " +
"(" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, -15) +
", Anger " + setup.show_change_html(0, 20, false) +
", Trust " + setup.show_change_html(0, -15) + ")."
>>
<<set _responses = []>>
<<set $player.conditions.health -= 20>>
<<set $player.slave_traits.willpower -= 10>>
<<set _char.slave_traits.obedience -= 15>>
/* Do not induce fear */
<<if _char.slave_traits.trust gt 0>>
<<set _char.slave_traits.trust = Math.clamp(_char.slave_traits.trust - 15, 0, 100)>>
<</if>>
<<set _char.mental_conditions.anger += 20>>
/* Re-enable menu */
<<set $enable_menu = true>>
/* Last round for good measure */
<<set _to_round = _char.key>>
<<include round>>
<<run _get_changes()>>
<<goto `passage()`>>
<</if>>
<</if>>
<<if _rape>>
<<set _char.slave_traits.obedience -= 15>>
<<set _char.slave_traits.trust -= 10>>
<<set _char.slave_traits.willpower -= 10>>
<<set _char.mental_conditions.anger += 20>>
<<set _char.mental_conditions.suspicion = 100>>
<<set _to_round = _char.key>>
<<include round>>
<</if>>
<</if>>
<</button>>@@
</div>
<<timed 50ms>><<silently>><<script>>
$("#sex_rejection_actions").find("button").on("click", (event) => {
let _t = State.temporary;
if (_t.responses != null) {
setup.mainLog_append_delayed(_t.responses, _t.sex_buttons);
let loop = () => {
setTimeout(() => {
if (_t.done_appending != "undefined" && _t.done_appending) {
_t.rejection_processed = true;
$(_t.open_menu).removeClass("hidden");
$("#sex_rejection_actions").addClass("hidden");
delete _t.action;
} else {
loop();
}
}, 20);
};
loop();
}
});
<</script>><</silently>><</timed>>
<</nobr>><<nobr>>
/* Hide sex actions and show UI */
<<removeclass "#sex_rejection_actions" "hidden">>
<<addclass _open_menu "hidden">>
<</nobr>><<nobr>>
<<set _char = $characters[$selected]>>
/* Preround for bars */
<<set _to_round = _char.key>>
<<include round>>
/* Presex copy of character for assessing changes */
<<set _prechar = clone(_char)>>
<<set _player = clone($player)>>
/* Disable menu */
<<set $enable_menu = false>>
/* Sounds */
<<set _moans = []>>
<<for _i = 0; _i lte 50; _i++>>
<<set _moans.push("moan" + _i)>>
<</for>>
/* Show sex ui and atune to character */
<<run $("#action_bar").wiki("<<include sexActions>>")>>
<<set _open_menu = "#sex_actions">>
<<removeclass "#sex_actions" "hidden">>
<<run $("#sex_info_name").html(setup.titleCase(_char.first_name))>>
<<run $("#sex_info_disposition").html("Disposition " + _char.get_disposition())>>
<<run $("#sex_bars").wiki("\
<<showmeter \"char_anger_bar\" `_char.mental_conditions.anger/100`>>\
<<showmeter \"char_arousal_bar\" `_char.mental_conditions.arousal/50`>>\
<<showmeter \"char_discomfort_bar\" `_char.mental_conditions.discomfort/50`>>\
<<showmeter \"char_stamina_bar\" `_char.conditions.stamina/_char.conditions.max_stamina`>>\
<<showmeter \"char_willpower_bar\" `_char.slave_traits.willpower/100`>>\
")>>
<<run $("#sex_player_bars").wiki("\
<<showmeter \"player_arousal_bar\" `$player.mental_conditions.arousal/50`>>\
<<showmeter \"player_stamina_bar\" `$player.conditions.stamina/$player.conditions.max_stamina`>>\
")>>
<<removeclass "#sex_info" "hidden">>
/* Whether player is higher status than player */
<<set _higher_status = ($player.get_status("nipon") == "slave" && _char.status == "low_slave") ||
($player.get_status("nipon") == "high_slave" && _char.status == "slave") ||
($player.get_status("nipon") == "high_slave" && _char.status == "low_slave")>>
/* Cock for male, strap-on for female */
<<set _cock = "cock">>
<<if $player.gender == 1>>
<<set _cock = "strap-on">>
<</if>>
<<set _char_cock = "cock">>
<<if _char.gender == 1>>
<<set _char_cock = "strap-on">>
<</if>>
<<set _chest = "chest">>
<<if $player.gender == 1>>
<<set _chest = "boobs">>
<</if>>
<<set _char_chest = "chest">>
<<if _char.gender == 1>>
<<set _char_chest = "boobs">>
<</if>>
/* Whether the sex as started */
<<set _is_fucking = false>>
<<set _sex_state = {
"rape": false,
"top": true,
"bottom": true,
"convince_num": 0,
"boundaries": {
"kiss": false,
"fondle": false,
"finger": false,
"lick": false,
"footjob": false,
"oral": false,
"vaginal": false,
"anal": false
},
"orgasm": false,
"last_action": "none"
}>>
/* TODO: Implement for males */
/* Initial prompt for user action */
<<set _responses = ["You approach " + setup.titleCase(_char.first_name) + " with a lustful look in your eye,"]>>
<<run setup.mainLog_append_delayed(_responses)>>
<</nobr>><<nobr>>
<div id="sex_vaginal_actions" class="action container row col longbutton fiveQuarters smalltext hidden"
style="--rows: 4; --cols: 4">
@@#sex_vaginal1;<<button "Continue">>
<<set _thresh = _calc_thresh("vaginal", 50)>>
<<set _responses = [
"You continue fucking " + setup.titleCase(_char.first_name) + "\'s wet pussy. As you thrust in and out \
the air fills with a scent of opulent lewdness."
]>>
<<if _sex_state.rape>>
<<set _responses.push(_char.dialogue(either([
"Please stop it! It hurts so mu...",
"I beg you to stop! I promise I\'ll be a better sla...",
])))>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s begging is interrupted by a moan.")>>
<<set _char.mental_conditions.anger += 2>>
<<set _char.mental_conditions.arousal += 2>>
<<set _char.slave_traits.willpower -= 1>>
<<set _char.slave_traits.obedience -= 2>>
<<set _char.slave_traits.trust -= 0.5>>
<<else>>
<<set _responses.push(_char.dialogue(either([
"Yes yes yes yes yes, don\'t stop!!",
"Fuck me harder!",
"Give it to me, please fill me up!"
])))>>
<<set _char.mental_conditions.arousal += 7>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</button>>@@
@@#sex_vaginal2;<<button "Choke">>
<<set _thresh = _calc_thresh("vaginal", 55)>>
<<set _responses = [
"As you continue fucking " + setup.titleCase(_char.first_name) + "\'s pussy, you put your hands around " + setup.him(_char) +
" neck restricting " + setup.his(_char) + " breath."
]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s face grows red and tears stream down " + setup.his(_char) +
" cheek,")>>
<<set _responses.push(_char.dialogue(either([
"What the fuck! Let go of me!",
"It hurts! It hurts!!",
"Just fucking kill me already please just end it, choke me to death right here."
])))>>
<<set _char.mental_conditions.anger += 5>>
<<set _char.mental_conditions.discomfort += 5>>
<<set _char.slave_traits.obedience -= 5>>
<<set _char.slave_traits.trust -= 2>>
<<set _char.sex_prefs.vaginal -= 0.5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + "\'s face grows red and " + setup.his(_char) +
" eyes roll back in bliss,")>>
<<set _responses.push(_char.dialogue(either([
"Yes! Choke me " + _char.address + ", harder!",
"Fuck me harder!",
"Ack... Fuck... Keep going.",
"Ahhh fuck that\'s so good!"
])))>>
<<set _char.mental_conditions.arousal += 7>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _char.slave_traits.willpower -= 1>>
<<run _check_arousal()>>
<</button>>@@
@@#sex_vaginal3;<<button "Insult">>
<<set _thresh = _calc_thresh("vaginal", 60)>>
<<set _responses = [
"You continue thrusting " + setup.titleCase(_char.first_name) + "\'s pussy."
]>>
<<set _responses.push($player.dialogue(either([
"You\'re such a fucking disgusting little whore.",
"You little bitch aren\'t worth anything except a little piece of shit for me to fuck.",
"Take it you fucking cunt.",
"I bet this is the only reason anyone keeps you around, you fucking shit.",
"You\'re nothing just a little fuck toy aren\'t you?"
])))>>
<<if _sex_state.rape>>
<<set _responses.push("You can tell from the tears forming in " + setup.titleCase(_char.first_name) + "\'s eyes that \
you went too far.")>>
<<set _responses.push(_char.dialogue("What the fu..."))>>
<<set _char.mental_conditions.anger += 5>>
<<set _char.mental_conditions.discomfort += 5>>
<<set _char.slave_traits.obedience -= 5>>
<<set _char.slave_traits.willpower -= 1>>
<<else>>
<<set _responses.push(_char.dialogue("Yeah, that\'s right, ahhhh!"))>>
<<set _char.mental_conditions.arousal += 7>>
<<set _char.slave_traits.willpower -= 2>>
<</if>>
<<set _responses.push(setup.titleCase(setup.he(_char)) + " gets cut off by your continual pounding of " +
setup.his(_char) + " wet pussy.")>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</button>>@@
@@#sex_vaginal4;<<button "Spit in mouth">>
<<set _thresh = _calc_thresh("anal", 65)>>
<<set _responses = [
"As you continue thrusting in " + setup.titleCase(_char.first_name) + "\'s wet pussy, you force open " +
setup.his(_char) + " mouth and spit into it."
]>>
<<set _responses.push($player.dialogue(either([
"Drink my fucking spit you ugly pig.",
"You like that you disgusting piece of shit?",
"You\'re nothing, just a piece of trash to spit and cum on."
])))>>
<<if _sex_state.rape>>
<<set _responses.push("You can tell from the tears forming in " + setup.titleCase(_char.first_name) + "\'s eyes that \
you went too far.")>>
<<set _responses.push(_char.dialogue("What the fu..."))>>
<<set _char.mental_conditions.anger += 5>>
<<set _char.mental_conditions.discomfort += 5>>
<<set _char.slave_traits.obedience -= 5>>
<<set _char.slave_traits.willpower -= 1>>
<<else>>
<<set _responses.push(_char.dialogue("Yeah, that\'s right, give me more I deser..."))>>
<<set _char.mental_conditions.arousal += 7>>
<<set _char.slave_traits.willpower -= 3>>
<</if>>
<<set _responses.push(setup.titleCase(setup.he(_char)) + " gets cut off by your continual pounding of " +
setup.his(_char) + " vagina.")>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</button>>@@
@@#sex_vaginal5;<<button "Slap">>
<<set _thresh = _calc_thresh("anal", 85)>>
<<set _responses = [
"As you are drilling " + setup.titleCase(_char.first_name) + "\'s wet pussy you slap " + setup.him(_char) +
" across the face."
]>>
<<if _sex_state.rape>>
<<set _responses.push(_char.dialogue("Ow what the fuck! That fucking hurt!"))>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.obedience -= 10>>
<<set _char.slave_traits.willpower -= 2>>
<<else>>
<<set _responses.push(_char.dialogue("Oh my god yes! Punish me! Slap me more like a little whore!"))>>
<<set _char.mental_conditions.arousal += 7>>
<<set _char.slave_traits.willpower -= 5>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</button>>@@
@@#sex_vaginal6;<<button "Spank">>
<<set _thresh = _calc_thresh("vaginal", 55)>>
<<set _responses = [$player.dialogue(either([
"You\'re such a bad little whore.",
"You\'ve been naughty and need to be punished.",
]))]>>
<<set _responses.push(
"You start spanking " + setup.titleCase(_char.first_name) + " ass until it\'s red,"
)>>
<<if _sex_state.rape>>
<<set _responses.push(_char.dialogue("Ow! Stop that hurts!"))>>
<<set _char.mental_conditions.anger += 5>>
<<set _char.mental_conditions.discomfort += 5>>
<<set _char.slave_traits.obedience -= 5>>
<<set _char.slave_traits.willpower -= 1>>
<<else>>
<<set _responses.push(_char.dialogue("Oh my god yes! Punish me!"))>>
<<set _char.mental_conditions.arousal += 7>>
<<set _char.slave_traits.willpower -= 3>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<run _check_arousal()>>
<</button>>@@
@@#sex_vaginal_oral;<<button "Oral sex">>
<<if $player.conditions.stamina lt 10>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 10>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You take your " + _cock + " out of " + setup.titleCase(_char.first_name) + "\'s wet pussy and pull " + setup.titleCase(_char.first_name) + "\'s " +
_char.physical_traits.hair_color + " hair to line up " + setup.his(_char) + " head, but " + setup.he(_char) +
" clearly tries to pull way, not fond of the idea of giving you a blowjob.">>
<<if _query_action("oral", 40, _query_str)>>
<<set _responses = ["You insert your " + _cock + " slick with " + setup.titleCase(_char.first_name) + "\'s juices into " + setup.his(_char) + " mouth."]>>
<<if _sex_state.rape>>
<<if _char.sex_fetishes.cum gt 30>>
<<set _responses.push("Tears stream down " + setup.titleCase(_char.first_name) + "\'s face, but being a cumslut, " + setup.PRONOUNS[_char.gender]["?he"] + " looks \
forward to being filled with your cum.")>>
<<set _char.mental_conditions.arousal += 4>>
<<set _char.slave_traits.willpower -= 1>>
<<set _char.slave_traits.trust -= 2>>
<<else>>
<<set _responses.push("Tears stream down " + setup.titleCase(_char.first_name) + "\'s face as you start to orally rape " +
setup.him(_char) + ".")>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.willpower -= 2>>
<<set _char.slave_traits.obedience -= 10>>
<<set _char.slave_traits.trust -= 2>>
<<set _char.sex_prefs.oral -= 1>>
<</if>>
<<else>>
<<if _char.sex_fetishes.cum gt 30>>
<<set _responses.push(setup.titleCase(_char.first_name) + " lets out a moan of bliss as your precum touches their tongue. As \
a cumslut they are gushing wet just thinking about your cum.")>>
<<set _responses.push(_char.dialogue("Please give me your cum; I want to bath and be filled with it!"))>>
<<set _char.mental_conditions.arousal += 5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " takes in your " + _cock + " with hunger in " +
setup.his(_char) + " eyes.")>>
<<set _char.mental_conditions.arousal += 3>>
<</if>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_oral_actions" "hidden">>
<<addclass "#sex_vaginal_actions" "hidden">>
<<set _open_menu = "#sex_oral_actions">>
<<set _sex_state.last_action = "oral">>
<<stop>>
<</if>><</repeat>><</silently>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _responses = ["You insert your " + _cock + " slick with " + setup.titleCase(_char.first_name) + "\'s juices into " + setup.his(_char) + " mouth."]>>
<<if _sex_state.rape>>
<<if _char.sex_fetishes.cum gt 30>>
<<set _responses.push("Tears stream down " + setup.titleCase(_char.first_name) + "\'s face, but being a cumslut, " + setup.PRONOUNS[_char.gender]["?he"] + " looks \
forward to being filled with your cum.")>>
<<set _char.mental_conditions.arousal += 4>>
<<set _char.slave_traits.willpower -= 1>>
<<set _char.slave_traits.trust -= 2>>
<<else>>
<<set _responses.push("Tears stream down " + setup.titleCase(_char.first_name) + "\'s face as you start to orally rape " +
setup.him(_char) + ".")>>
<<set _char.mental_conditions.anger += 10>>
<<set _char.mental_conditions.discomfort += 10>>
<<set _char.slave_traits.willpower -= 2>>
<<set _char.slave_traits.obedience -= 10>>
<<set _char.slave_traits.trust -= 2>>
<<set _char.sex_prefs.oral -= 1>>
<</if>>
<<else>>
<<if _char.sex_fetishes.cum gt 30>>
<<set _responses.push(setup.titleCase(_char.first_name) + " lets out a moan of bliss as your precum touches their tongue. As \
a cumslut they are gushing wet just thinking about your cum.")>>
<<set _responses.push(_char.dialogue("Please give me your cum; I want to bath and be filled with it!"))>>
<<set _char.mental_conditions.arousal += 5>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " takes in your " + _cock + " with hunger in " +
setup.his(_char) + " eyes.")>>
<<set _char.mental_conditions.arousal += 3>>
<</if>>
<</if>>
<<set $player.mental_conditions.arousal += 10>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_oral_actions" "hidden">>
<<addclass "#sex_vaginal_actions" "hidden">>
<<set _open_menu = "#sex_oral_actions">>
<<set _sex_state.last_action = "oral">>
<<stop>>
<</if>><</silently>><</repeat>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
@@#sex_vaginal_anal;<<button "Anal sex">>
<<if $player.conditions.stamina lt 10>>
<<notify>>You are too tired!<</notify>>
<<elseif _char.conditions.stamina lt 10>>
<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>
<<else>>
<<set _query_str = "You grab your " + _cock + " out of " + setup.titleCase(_char.first_name) +
"\'s wet pussy and line it up with " + setup.his(_char) + " asshole.">>
<<if _query_action("anal", 65, _query_str)>>
<<set _responses = ["You insert your " + _cock + " slick with " + setup.titleCase(_char.first_name) + "\'s pussy juices into " +
setup.his(_char) + " tight asshole."]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + " screams and chokes on her tears.")>>
<<set _responses.push(_char.dialogue("Please! please! Not my ass, it hurts so much! Please!..."))>>
<<set _char.mental_conditions.anger += 20>>
<<set _char.mental_conditions.discomfort += 20>>
<<set _char.slave_traits.willpower -= 5>>
<<set _char.slave_traits.obedience -= 20>>
<<set _char.slave_traits.trust -= 10>>
<<set _char.sex_prefs.anal -= 2>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " pulls you in and begs for more.")>>
<<set _responses.push(_char.dialogue("Yes yes! Please fuck my ass!"))>>
<<set _char.mental_conditions.arousal += 8>>
<</if>>
<<set $player.mental_conditions.arousal += 15>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_anal_actions" "hidden">>
<<addclass "#sex_vaginal_actions" "hidden">>
<<set _open_menu = "#sex_anal_actions">>
<<set _sex_state.last_action = "anal">>
<<stop>>
<</if>><</repeat>><</silently>>
<<run _check_arousal()>>
<<else>><<silently>><<repeat 20ms>><<if _rejection_processed>>
<<if _rejection_response>>
<<set _responses = ["You insert your " + _cock + " slick with " + setup.titleCase(_char.first_name) + "\'s pussy juices into " +
setup.his(_char) + " tight asshole."]>>
<<if _sex_state.rape>>
<<set _responses.push(setup.titleCase(_char.first_name) + " screams and chokes on her tears.")>>
<<set _responses.push(_char.dialogue("Please! please! Not my ass, it hurts so much! Please!..."))>>
<<set _char.mental_conditions.anger += 20>>
<<set _char.mental_conditions.discomfort += 20>>
<<set _char.slave_traits.willpower -= 5>>
<<set _char.slave_traits.obedience -= 20>>
<<set _char.slave_traits.trust -= 10>>
<<set _char.sex_prefs.anal -= 2>>
<<else>>
<<set _responses.push(setup.titleCase(_char.first_name) + " pulls you in and begs for more.")>>
<<set _responses.push(_char.dialogue("Yes yes! Please fuck my ass!"))>>
<<set _char.mental_conditions.arousal += 8>>
<</if>>
<<set $player.mental_conditions.arousal += 15>>
<<set _mins = 3 + dice(1, 4)>>
<<addmins _mins>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#sex_anal_actions" "hidden">>
<<addclass "#sex_vaginal_actions" "hidden">>
<<set _open_menu = "#sex_anal_actions">>
<<set _sex_state.last_action = "anal">>
<<stop>>
<</if>><</repeat>><</silently>>
<<else>>
<<set _responses = []>>
<</if>>
<<unset _rejection_processed>>
<<unset _rejection_response>>
<<run _check_arousal()>>
<<stop>>
<</if>><</repeat>><</silently>><</if>>
<</if>>
<</button>>@@
<div style="grid-row: 4; grid-column: 2">
@@#sex_vaginal_back;<<button "Back">>
<<run setup.mainLog_append_delayed(["You take your " + _cock + " out of " +
setup.titleCase(_char.first_name) + "\'s pussy."])>>
<<removeclass "#sex_actions" "hidden">>
<<addclass "#sex_vaginal_actions" "hidden">>
<</button>>@@
</div>
<div style="grid-row: 4; grid-column: 3">
@@#sex_vaginal_done;<<button "Done" `passage()`>>
<<if _sex_state.orgasm>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.<br>" + _char.dialogue("That was great, let\'s do that again sometime...") +
"(" + setup.titleCase(_char.first_name) + "\'s Affection " + setup.show_change_html(0, 5) + ")">>
<<set _char.slave_traits.obedience += 5>>
<<elseif _char.mental_conditions.arousal gt 20 && _char.mental_conditions.discomfort lt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" found the experience quite pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10>>
<<elseif _char.mental_conditions.discomfort gt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" did not find the experience pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, _char.mental_conditions.arousal - _char.mental_conditions.discomfort) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort)>>
<<else>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.">>
<</if>>
/* Re-enable menu */
<<set $enable_menu = true>>
<<set $to_simulate.add(_char.key)>>
/* Last round for good measure */
<<set _to_round = _char.key>>
<<include round>>
<<run _get_changes()>>
<</button>>@@
</div>
<<timed 50ms>><<script>>
$("#sex_vaginal_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
if (self.html() != "Back" && self.html() != "Done") {
let _t = State.temporary;
let char = _t.char;
let player = State.variables.player;
_t.to_round = _t.char.key;
$.wiki("<<include round>>");
$.wiki("<<include updateBars>>");
if (self.html() != "Oral sex" && self.html() != "Vaginal sex" && self.html() != "Anal sex") {
let thresh = setup.progressive_gain_chance(player.sex_skills.vaginal, 100, "root_inverse");
let roll = randomFloat(1.0);
if (roll < thresh) {
player.sex_skills.vaginal += 1
}
}
}
});
<</script>><</timed>>
</div>
<</nobr>><div id="sex_actions" class="action container row col longbutton fiveQuarters smalltext hidden"
style="--rows: 4; --cols: 4">
@@#sex1;<<button "Caress">><</button>>@@
@@#sex2;<<button "Kiss">><</button>>@@
@@#sex3;<<button "Undress">><</button>>@@
@@#sex4;<<button "Remove top">><</button>>@@
@@#sex5;<<button "Remove bottoms">><</button>>@@
<<disable>>
@@#sex6;<<button "Fondle boobs">><</button>>@@
<</disable>><<disable>>
@@#sex7;<<button "Finger pussy">><</button>>@@
<</disable>><<disable>>
@@#sex8;<<button "Lick pussy">><</button>>@@
<</disable>>
@@#sex9;<<button "Footjob">><</button>>@@
@@#sex10;<<button "Oral sex">><</button>>@@
<<disable>>
@@#sex11;<<button "Vaginal sex">><</button>>@@
<</disable>><<disable>>
@@#sex12;<<button "Anal sex">><</button>>@@
<</disable>>
<div></div>
@@#sex_back;<<button "Back">>
<<set $enable_menu = true>>
<<if def _back_action && (ndef _refresh || !_refresh)>>
/* Clean up */
<<set $("#sex_actions").remove()>>
<<set $("#sex_oral_actions").remove()>>
<<set $("#sex_anal_actions").remove()>>
<<set $("#sex_vaginal_actions").remove()>>
<<set $("#sex_rejection_actions").remove()>>
<<unset _sex_state>>
<<removeclass `_back_action` "hidden">>
<<addclass "#sex_info" "hidden">>
<<removeclass "#info" "hidden">>
<<else>>
<<goto `passage()`>>
<</if>>
<</button>>@@
<<disable>>
@@#sex_done;<<button "Done" `passage()`>>
<<if _sex_state.rape>>
<<if _sex_state.orgasm>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to anguish over their conflicting feelings. You can hear " + setup.his(_char) +
" muffled cries as you leave (" + setup.titleCase(_char.first_name) +"\'s Willpower " + setup.show_change_html(0, -3) + ")">>
<<set _char.slave_traits.willpower -= 3>>
<<else>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " in anguish. You can hear " + setup.his(_char) + " muffled cries as you" +
" leave.">>
<</if>>
<<elseif _sex_state.orgasm>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.<br>" + _char.dialogue("That was great, let\'s do that again sometime...") +
"(" + setup.titleCase(_char.first_name) + "\'s Affection " + setup.show_change_html(0, 5) + ")">>
<<set _char.slave_traits.obedience += 5>>
<<elseif _char.mental_conditions.arousal gt 20 && _char.mental_conditions.discomfort lt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" found the experience quite pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10>>
<<elseif _char.mental_conditions.discomfort gt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" did not find the experience pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, _char.mental_conditions.arousal - _char.mental_conditions.discomfort) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort)>>
<<else>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.">>
<</if>>
/* Re-enable menu */
<<set $enable_menu = true>>
<<set $to_simulate.add(_char.key)>>
/* Last round for good measure */
<<set _to_round = _char.key>>
<<include round>>
<<run _get_changes()>>
<</button>>@@
<</disable>>
/* Specifications for logging */
<<set _sex_buttons = ["#sex_back", "#sex_done",
"#sex_oral_back", "#sex_oral_done",
"#sex_vaginal_back", "#sex_vaginal_done",
"#sex_anal_back", "#sex_anal_done",
"#sex_vaginal_oral", "#sex_vaginal_anal",
"#sex_anal_oral", "#sex_anal_vaginal",
"#sex_oral_vaginal", "#sex_oral_anal",
"#sexRejection1", "#sexRejection2", "#sexRejection3"]>>
<<for _i = 1; _i lte 12; _i++>>
<<set _sex_buttons.push("#sex" + _i)>>
<<set _sex_buttons.push("#sex_oral" + _i)>>
<<set _sex_buttons.push("#sex_vaginal" + _i)>>
<<set _sex_buttons.push("#sex_anal" + _i)>>
<</for>>
</div>
<<include sexEngineOralActions>>
<<include sexEngineVaginalActions>>
<<include sexEngineAnalActions>>
<<silently>><<timed 10ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
_t.perform = (theme, action) => {
console.log(action);
console.log(setup.sex_actions[theme]);
console.log(setup.sex_actions[theme][action]);
console.log(setup.sex_actions[theme][action].response);
let [delta, responses] = setup.sex_actions[theme][action].response(_t.char, _t.sex_state);
if (action == "oralSex" || action == "vaginalSex" || action == "analSex") {
let true_delta = setup.apply_delta(_t.char, delta.self);
let true_player_delta = setup.apply_delta(_v.player, delta.player);
responses.push(_t.char.print_delta(true_delta));
setup.mainLog_append_delayed(responses, _t.sex_buttons, null, 1000, true, null,
() => {
_t.to_round = _t.char.key;
$.wiki("<<include round>>");
$.wiki("<<include updateBars>>");
$(_t.open_menu).addClass("hidden");
if (action == "oralSex") {
_t.open_menu = "#sex_oral_actions";
_t.sex_state.last_action = "oral";
} else if (action == "vaginalSex") {
_t.open_menu = "#sex_vaginal_actions";
_t.sex_state.last_action = "vaginal";
} else {
_t.open_menu = "#sex_anal_actions";
_t.sex_state.last_action = "anal";
}
$(_t.open_menu).removeClass("hidden");
}
);
} else {
let true_delta = setup.apply_delta(_t.char, delta.self);
let true_player_delta = setup.apply_delta(_v.player, delta.player);
responses.push(_t.char.print_delta(true_delta));
setup.mainLog_append_delayed(responses, _t.sex_buttons, null, 1000, true, null,
() => {
_t.to_round = _t.char.key;
$.wiki("<<include round>>");
$.wiki("<<include updateBars>>");
console.log(JSON.stringify(true_delta));
_t.check_arousal();
}
);
}
};
/* Foreplay specific */
_t.perform_foreplay = (action) => {
/* Check started state */
_t.check_fucking();
/* Update state */
if (action == "undress") {
_t.sex_state.top = false;
_t.sex_state.bottom = false;
_t.update_state();
} else if (action == "removeTop") {
_t.sex_state.top = false;
_t.update_state();
} else if (action == "removeBottoms") {
_t.sex_state.bottom = false;
_t.update_state();
}
_t.perform("foreplay", action);
};
$("#sex_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
/* Filter out non-action buttons */
if (self.html() == "Back" || self.html() == "Done") {
return;
}
if (_v.player.conditions.stamina < 5) {
$.wiki("<<notify>>You are too tired!<</notify>>");
return;
} else if (_t.char.conditions.stamina < 5) {
$.wiki("<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>");
return;
}
let action = setup.camelize(self.html());
if (action in setup.sex_actions.foreplay) {
let disposition = _t.char.get_disposition();
let reject = false;
if (disposition == "devoted" || disposition == "submissive" || (action in _t.sex_state.boundaries && _t.sex_state.boundaries[action])) {
/* Always open to anything if devoted or submissive */
/* Open if boundary is unlocked */
} else if ((disposition == "depressed") || (disposition == "angry") || (disposition == "fearful") || (disposition == "hateful") || (
_t.char.owner != "player" && (disposition == "cold" || disposition == "neutral")
)) {
/* Always reject if very negative emotion, or if not positive whilst not owned */
reject = true;
} else {
/* Calculate threshold */
if (_t.calc_thresh(action) < setup.sex_actions.foreplay[action].thresh) {
reject = true;
}
}
/* Only allow resisting if not in rape state */
if (reject && !_t.sex_state.rape) {
let rejected_thresh = _t.calc_thresh(action);
_t.process_rejection(action, _t.perform_foreplay, rejected_thresh, setup.sex_actions.foreplay[action].threshold);
} else {
_t.perform_foreplay(action);
}
}
})
<</script>><</timed>><</silently>><div id="sex_anal_actions" class="action container row col longbutton fiveQuarters smalltext hidden"
style="--rows: 4; --cols: 4">
@@#sex_anal1;<<button "Continue">><</button>>@@
@@#sex_anal2;<<button "Choke">><</button>>@@
@@#sex_anal3;<<button "Insult">><</button>>@@
@@#sex_anal4;<<button "Spit in mouth">><</button>>@@
@@#sex_anal5;<<button "Slap">><</button>>@@
@@#sex_anal6;<<button "Spank">><</button>>@@
@@#sex_anal_oral;<<button "Oral sex">><</button>>@@
<<disable>>
@@#sex_anal_vaginal;<<button "Vaginal sex">><</button>>@@
<</disable>>
<div style="grid-row: 4; grid-column: 2">
@@#sex_anal_back;<<button "Back">>
<<run setup.mainLog_append_delayed(["You take your " + _cock + " out of " +
setup.titleCase(_char.first_name) + "\'s ass."])>>
<<set _open_menu = "#sex_actions">>
<<removeclass "#sex_actions" "hidden">>
<<addclass "#sex_anal_actions" "hidden">>
<</button>>@@
</div>
<div style="grid-row: 4; grid-column: 3">
@@#sex_anal_done;<<button "Done" `passage()`>>
<<if _sex_state.rape>>
<<if _sex_state.orgasm>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to anguish over their conflicting feelings. You can hear " + setup.his(_char) +
" muffled cries as you leave (" + setup.titleCase(_char.first_name) +"\'s Willpower " + setup.show_change_html(0, -3) + ")">>
<<set _char.slave_traits.willpower -= 3>>
<<else>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " in anguish. You can hear " + setup.his(_char) + " muffled cries as you" +
" leave.">>
<</if>>
<<elseif _sex_state.orgasm>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.<br>" + _char.dialogue("That was great, let\'s do that again sometime...") +
"(" + setup.titleCase(_char.first_name) + "\'s Affection " + setup.show_change_html(0, 5) + ")">>
<<set _char.slave_traits.obedience += 5>>
<<elseif _char.mental_conditions.arousal gt 20 && _char.mental_conditions.discomfort lt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" found the experience quite pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10>>
<<elseif _char.mental_conditions.discomfort gt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" did not find the experience pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, _char.mental_conditions.arousal - _char.mental_conditions.discomfort) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort)>>
<<else>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.">>
<</if>>
/* Re-enable menu */
<<set $enable_menu = true>>
<<set $to_simulate.add(_char.key)>>
/* Last round for good measure */
<<set _to_round = _char.key>>
<<include round>>
<<run _get_changes()>>
<</button>>@@
</div>
</div>
<<silently>><<timed 10ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
$("#sex_anal_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
/* Filter out non-action buttons */
if (self.html() == "Back" || self.html() == "Done") {
return;
}
if (_v.player.conditions.stamina < 5) {
$.wiki("<<notify>>You are too tired!<</notify>>");
return;
} else if (_t.char.conditions.stamina < 5) {
$.wiki("<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>");
return;
}
let action = setup.camelize(self.html());
if (action in setup.sex_actions.anal) {
_t.perform("anal", action);
}
})
<</script>><</timed>><</silently>><<nobr>>
<div id="sex_cum_actions" class="action container row col longbutton fiveQuarters smalltext"
style="--rows: 4; --cols: 4">
@@#sex_cum1;<<button "On ground">>
<<set $_temp_to_log = "You pull back and cum all over the ground. ">>
<</button>>@@
@@#sex_cum2;<<button "On face">>
<<set _thresh = _calc_thresh("cum", 100)>>
<<set $_temp_to_log = "You cum all over " + setup.titleCase(_char.first_name) + "\'s face. ">>
<<if _thresh gt 0 && !_sex_state.rape>>
<<set _char.sex_fetishes.cum += 1>>
<<if _char.sex_fetishes.cum gte 30>>
<<set _char.mental_conditions.cum_addition += 1>>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " basks in it, taking it the smell before slowly scooping it up and liking it up finger by finger.">>
<<else>>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " enjoys the preverse activity of your seed covering their face.">>
<</if>>
<<else>>
<<set _char.sex_fetishes.cum -= 1>>
<</if>>
<</button>>@@
@@#sex_cum3;<<button "In mouth">>
<<set _thresh = _calc_thresh("cum", 100)>>
<<set $_temp_to_log = "You cum directly into " + setup.titleCase(_char.first_name) + "\'s mouth. ">>
<<if _thresh gt 0 && !_sex_state.rape>>
<<set _char.sex_fetishes.cum += 1>>
<<if _char.sex_fetishes.cum gte 30>>
<<set _char.mental_conditions.cum_addition += 1>>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " loves the taste of your cum. " +
setup.titleCase(setup.he(_char)) + " opens " + setup.his(_char) + " to show you " + setup.his(_char) + " prize, swirling it around with " +
setup.his(_char) + " tongue before swallowing it in one satisfying gulp.">>
<<else>>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " swallows your load, enjoying the preverse activity ingesting your seed.">>
<</if>>
<<else>>
<<set _char.sex_fetishes.cum -= 1>>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " get their mouth filled with your cum as tears stream down " +
setup.his(_char) + " face. You quickly grab " + setup.his(_char) + " face to prevent them from spitting it out,\n" +
$player.dialogue("Swallow it all. Now.") + "After taking a moment to regain " + setup.his(_char) + " composure, " + setup.he(_char) +
" reluctantly complies, gagging and dry-heaving afterwards.">>
<</if>>
<</button>>@@
<<disable>>
@@#sex_cum4;<<button "In throat">>
<<set _thresh = _calc_thresh("cum", 100)>>
<<set $_temp_to_log = "You cum directly into " + setup.titleCase(_char.first_name) + "\'s throat. ">>
<<if _thresh gt 0 && !_sex_state.rape>>
<<set _char.sex_fetishes.cum += 1>>
<<if _char.sex_fetishes.cum gte 30>>
<<set _char.mental_conditions.cum_addition += 1>>
<</if>>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " swallows your load, enjoying the preverse activity ingesting your seed.">>
<<else>>
<<set _char.sex_fetishes.cum -= 1>>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " is left with no choice but to swallow your load, gagging and heaving afterwards with tears streaming down " +
setup.his(_char) + " face.">>
<</if>>
<</button>>@@
<</disable>><<disable>>
@@#sex_cum5;<<button "In pussy">>
<<set $_temp_to_log = "You cum directly into " + setup.titleCase(_char.first_name) + "\'s pussy. ">>
<</button>>@@
<</disable>><<disable>>
@@#sex_cum6;<<button "In ass">>
<<set $_temp_to_log = "You cum directly into " + setup.titleCase(_char.first_name) + "\'s ass. ">>
<</button>>@@
<</disable>>
</div>
<<for _i = 1; _i lte 6; _i++>>
<<set _sex_buttons.push("#sex_cum" + _i)>>
<</for>>
<<timed 50ms>>
<<if _sex_state.last_action == "oral">>
<<removeclass "#sex_cum4 button" "disabled">>
<<run $("#sex_cum4 button").prop("disabled", false)>>
<<elseif _sex_state.last_action == "vaginal">>
<<removeclass "#sex_cum5 button" "disabled">>
<<run $("#sex_cum5 button").prop("disabled", false)>>
<<elseif _sex_state.last_action == "anal">>
<<removeclass "#sex_cum6 button" "disabled">>
<<run $("#sex_cum6 button").prop("disabled", false)>>
<</if>>
<<script>>
$("#sex_cum_actions").find("button").on("click", () => {
let _t = State.temporary;
let _v = State.variables;
let char = _t.char;
let sex_state = _t.sex_state;
let player = _v.player;
let fn = setup.titleCase(char.first_name);
if (sex_state.rape) {
if (sex_state.orgasm) {
_v._temp_to_log += "You leave " + fn + " to anguish over their conflicting feelings. You can hear " + setup.his(char) +
" muffled cries as you leave (" + fn +"\'s Willpower " + setup.show_change_html(0, -3) + ")";
char.slave_traits.willpower -= 3;
} else {
_v._temp_to_log += "You leave " + fn + " in anguish. You can hear " + setup.his(char) + " muffled cries as you leave.";
}
} else if (sex_state.orgasm) {
_v._temp_to_log += "You leave " + fn + " to " +
setup.his(char) + " duties.<br>" + char.dialogue("That was great, let\'s do that again sometime...") +
"(" + fn + "\'s Affection " + setup.show_change_html(0, 5) + ")";
char.slave_traits.obedience += 5;
} else if (char.mental_conditions.arousal > 20 && char.mental_conditions.discomfort < char.mental_conditions.arousal) {
_v._temp_to_log += "You leave " + fn + " to " +
setup.his(char) + " duties. You can tell that " + setup.he(char) +
" found the experience quite pleasurable (" + fn +
"\'s Affection " + setup.show_change_html(0, (char.mental_conditions.arousal - char.mental_conditions.discomfort) / 10) + ").";
char.slave_traits.obedience += (char.mental_conditions.arousal - char.mental_conditions.discomfort) / 10;
} else if (char.mental_conditions.discomfort > char.mental_conditions.arousal) {
_v._temp_to_log += "You leave " + fn + " to " +
setup.his(char) + " duties. You can tell that " + setup.he(char) +
" did not find the experience pleasurable (" + fn +
"\'s Affection " + setup.show_change_html(0, char.mental_conditions.arousal - char.mental_conditions.discomfort) + ").";
char.slave_traits.obedience += (char.mental_conditions.arousal - char.mental_conditions.discomfort);
} else {
_v._temp_to_log += "You leave " + fn + " to " +
setup.his(char) + " duties.";
}
player.mental_conditions.arousal = 0;
_v.enable_menu = true;
_v.to_simulate.add(char.key);
_t.to_round = char.key;
$.wiki("<<include round>>");
_t.get_changes();
$.wiki("<<goto `passage()`>>");
});
<</script>>
<</timed>>
<</nobr>><div id="sex_oral_actions" class="action container row col longbutton fiveQuarters smalltext hidden"
style="--rows: 4; --cols: 4">
@@#sex_oral1;<<button "Continue">><</button>>@@
@@#sex_oral2;<<button "Deep throat">><</button>>@@
@@#sex_oral3;<<button "Insult">><</button>>@@
@@#sex_oral4;<<button "Spit in mouth">><</button>>@@
@@#sex_oral5;<<button "Slap">><</button>>@@
@@#sex_oral6;<<button "Spank">><</button>>@@
<<disable>>
@@#sex_oral_vaginal;<<button "Vaginal sex">><</button>>@@
<</disable>><<disable>>
@@#sex_oral_anal;<<button "Anal sex">><</button>>@@
<</disable>>
<div style="grid-row: 4; grid-column: 2">
@@#sex_oral_back;<<button "Back">>
<<run setup.mainLog_append_delayed(["You take your " + _cock + " out of " +
setup.titleCase(_char.first_name) + "\'s mouth."])>>
<<set _open_menu = "#sex_actions">>
<<removeclass "#sex_actions" "hidden">>
<<addclass "#sex_oral_actions" "hidden">>
<</button>>@@
</div>
<div style="grid-row: 4; grid-column: 3">
@@#sex_oral_done;<<button "Done" `passage()`>>
<<if _sex_state.rape>>
<<if _sex_state.orgasm>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to anguish over their conflicting feelings. You can hear " + setup.his(_char) +
" muffled cries as you leave (" + setup.titleCase(_char.first_name) +"\'s Willpower " + setup.show_change_html(0, -3) + ")">>
<<set _char.slave_traits.willpower -= 3>>
<<else>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " in anguish. You can hear " + setup.his(_char) + " muffled cries as you" +
" leave.">>
<</if>>
<<elseif _sex_state.orgasm>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.<br>" + _char.dialogue("That was great, let\'s do that again sometime...") +
"(" + setup.titleCase(_char.first_name) + "\'s Affection " + setup.show_change_html(0, 5) + ")">>
<<set _char.slave_traits.obedience += 5>>
<<elseif _char.mental_conditions.arousal gt 20 && _char.mental_conditions.discomfort lt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" found the experience quite pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10>>
<<elseif _char.mental_conditions.discomfort gt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" did not find the experience pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, _char.mental_conditions.arousal - _char.mental_conditions.discomfort) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort)>>
<<else>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.">>
<</if>>
/* Re-enable menu */
<<set $enable_menu = true>>
<<set $to_simulate.add(_char.key)>>
/* Last round for good measure */
<<set _to_round = _char.key>>
<<include round>>
<<run _get_changes()>>
<</button>>@@
</div>
</div>
<<silently>><<timed 10ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
$("#sex_oral_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
/* Filter out non-action buttons */
if (self.html() == "Back" || self.html() == "Done") {
return;
}
if (_v.player.conditions.stamina < 5) {
$.wiki("<<notify>>You are too tired!<</notify>>");
return;
} else if (_t.char.conditions.stamina < 5) {
$.wiki("<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>");
return;
}
let action = setup.camelize(self.html());
if (action in setup.sex_actions.oral) {
_t.perform("oral", action);
}
})
<</script>><</timed>><</silently>><div id="sex_rejection_actions" class="action container row col longbutton fiveQuarters smalltext hidden"
style="--rows: 4; --cols: 4">
@@#sexRejection1;<<button "Nevermind">><</button>>@@
@@#sexRejection2;<<button "Convince">><</button>>@@
@@#sexRejection3;<<button "Use Force">><</button>>@@
</div>
<<timed 50ms>><<silently>><<script>>
let _t = State.temporary;
let _v = State.variables;
$("#sex_rejection_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
let responses = null;
let pass = false;
if (self.html() == "Nevermind") {
responses = [
_v.player.dialogue("Nevermind")
];
} else if (self.html() == "Convince") {
if (_t.force_reject) {
$.wiki(`<<notify>>${setup.titleCase(_t.char.first_name)}'s disposition is too bad to be convinced.<</notify>>`);
return;
}
responses = [
_v.player.dialogue("Come on... it\'s me..."),
];
let roll = dice(1, _v.player.get_status_prop("manipulation") + _v.difficulty) - _v.difficulty;
if (_t.rejected_thresh + roll > _t.rejected_thresh_modifier) {
pass = true;
responses = [
setup.pass("manipulation"),
either([
_v.player.dialogue("Come on... it\'s me..."),
_v.player.dialogue("It\'ll be fun I promise..."),
_v.player.dialogue("Trust me, you\'re in safe hands..."),
_v.player.dialogue("I know you, and you want this...")
]),
either([
_t.char.dialogue("... okay..."),
setup.titleCase(_t.char.first_name) + " looks away and doesn\'t respond, leaving " +
setup.PRONOUNS[_t.char.gender]["?him"] + " to be used as you please.",
"With a look of apprehension " + setup.titleCase(_t.char.first_name) + " gives in.",
_t.char.dialogue("Um... okay then...")
])
];
_t.sex_state.boundaries[_t.rejected_action] = true;
} else {
responses = [
setup.fail("manipulation"),
either([
_v.player.dialogue("Come on... it\'s me..."),
_v.player.dialogue("It\'ll be fun I promise..."),
_v.player.dialogue("Trust me, you\'re in safe hands..."),
_v.player.dialogue("I know you, and you want this...")
])
];
let delta = {
"mental_conditions": {},
"slave_traits": {
"min_obedience": 0
}
};
if (_t.sex_state.convince_num == 0) {
if (_t.sex_state.started) {
responses.push(_t.char.dialogue("No... maybe next time, but not right now."));
} else {
responses.push(_t.char.dialogue("Are you joking?"));
}
} else if (_t.sex_state.convince_num == 1) {
delta.mental_conditions.discomfort = 3;
delta.slave_traits.willpower = 1;
responses.push(_t.char.dialogue("Stop trying to push my boundaries..."));
responses.push(_t.char.print_delta(delta));
setup.apply_delta(_t.char, delta);
} else if (_t.sex_state.convince_num == 2) {
delta.mental_conditions.discomfort = 5;
delta.slave_traits.obedience = -1;
delta.slave_traits.willpower = 4;
responses.push(_t.char.dialogue("I told you to quit pushing me, I\'m warning you."));
responses.push(_t.char.print_delta(delta));
setup.apply_delta(_t.char, delta);
} else {
delta.mental_conditions.anger = 10;
delta.slave_traits.willpower = 6;
_v._temp_to_log = _t.char.dialogue("Get the fuck away from me!") +
setup.titleCase(_t.char.first_name) + " pushes you and walks away " + _t.char.print_delta(delta);
setup.apply_delta(_t.char, delta);
/* Leave sex engine */
_v.enable_menu = true;
_t.to_round = _t.char.key;
$.wiki("<<include round>>");
$.wiki("<<goto `passage()`>>");
_t.get_changes();
return;
}
_t.sex_state.convince_num += 1;
}
} else if (self.html() == "Use Force") {
if (!_t.char.is_slave) {
$.wiki("<<notify>>Raping a citizen would probably get you executed.<</notify>>");
return;
} else if (_t.char.owner == "player") {
pass = true;
let delta = {
"mental_conditions": {
"anger": 15,
"suspicion": 100,
},
"slave_traits": {
"obedience": -10,
"trust": -10,
"willpower": -5
}
};
responses = [
"You look " + setup.him(_t.char) + " dead in the eyes, reminding " +
setup.him(_t.char) + " that you own them. Tears weld up in " +
setup.his(_t.char) + " eyes as " + setup.he(_t.char) +
" sinks down and complies ",
_t.char.print_delta(delta)
];
setup.apply_delta(_t.char, delta);
} else if (_v.player.is_slave && _t.higher_status) {
pass = true;
let delta = {
"mental_conditions": {
"anger": 20,
"suspicion": 100,
},
"slave_traits": {
"obedience": -15,
"trust": -10,
"willpower": -10
}
};
responses = [
"You look " + setup.him(_t.char) + " dead in the eyes, reminding " +
setup.him(_t.char) + " of your status. Tears weld up in " +
setup.his(_t.char) + " eyes as " + setup.he(_t.char) +
" sinks down and complies ",
_t.char.print_delta(delta)
];
setup.apply_delta(_t.char, delta);
} else {
let roll = _v.player.stats.strength + dice(1, 6 + _v.difficulty) - _v.difficulty;
if (roll - _t.char.stats.strength >= 15) {
pass = true;
let delta = {
"mental_conditions": {
"anger": 25,
"suspicion": 100,
},
"slave_traits": {
"obedience": -20,
"trust": -15,
"willpower": -10
}
};
responses = [
"You quickly overpower " + setup.him(_t.char) + " making it obvious that if " +
setup.he(_t.char) + " resisted anymore it would put " +
setup.his(_t.char) + " life in danger ",
_t.char.print_delta(delta)
];
} else {
let delta = {
"mental_conditions": {
"anger": 15,
"suspicion": 100,
},
"slave_traits": {
"obedience": -20,
"trust": -15,
"min_trust": 0,
"willpower": 5
}
};
let player_delta = {
"conditions": {
"health": -10
},
"slave_traits": {
"willpower": -10
}
};
let true_delta = setup.apply_delta(_t.char, delta);
let true_player_delta = setup.apply_delta(_v.player, player_delta);
_v._temp_to_log = setup.fail("strength") +
"You try to pin " + setup.titleCase(_t.char.first_name) + " down, but " +
setup.he(_t.char) + " overpowers you in an instant.<br>" +
_t.char.dialogue("You fucking piece of garbage, let me show you what happens when you try something on me.") +
setup.titleCase(_t.char.first_name) + " proceeds to crush you and kick you in the \
genitals. After what seems like forever " + setup.he(_t.char) + " \
shoves you away " + _t.char.print_delta(true_delta) + " " + _v.player.print_delta(true_player_delta);
/* Exit sex engine */
_v.enable_menu = true;
_t.to_round = _t.char.key;
$.wiki("<<include round>>");
$.wiki("<<goto `passage()`>>");
_t.get_changes();
return;
}
}
if (pass) {
/* Now raping */
_t.sex_state.rape = true;
}
}
if (responses != null) {
setup.mainLog_append_delayed(responses, _t.sex_buttons, null, 1000, true, null,
() => {
if (pass) {
_t.rejected_action_fn(_t.rejected_action);
}
$(_t.open_menu).removeClass("hidden");
$("#sex_rejection_actions").addClass("hidden");
}
);
}
});
<</script>><</silently>><</timed>><<set _char = $characters[$selected]>>
/* Preround for bars */
<<set _to_round = _char.key>>
<<include round>>
/* Presex copy of character for assessing changes */
<<set _prechar = clone(_char)>>
<<set _player = clone($player)>>
/* Disable menu */
<<set $enable_menu = false>>
/* Show sex ui and atune to character */
<<run $("#action_bar").wiki("<<include sexEngineForeplayActions>>")>>
<<run $("#action_bar").wiki("<<include sexEngineRejectionActions>>")>>
<<removeclass "#sex_actions" "hidden">>
<<set _open_menu = "#sex_actions">>
<<run $("#sex_info_name").html(setup.titleCase(_char.first_name))>>
<<run $("#sex_info_disposition").html("Disposition: " + setup.titleCase(_char.get_disposition()))>>
<<run $("#sex_bars").wiki("\
<<showmeter \"char_anger_bar\" `_char.mental_conditions.anger/100`>>\
<<showmeter \"char_arousal_bar\" `_char.mental_conditions.arousal/50`>>\
<<showmeter \"char_discomfort_bar\" `_char.mental_conditions.discomfort/50`>>\
<<showmeter \"char_stamina_bar\" `_char.conditions.stamina/_char.conditions.max_stamina`>>\
<<showmeter \"char_willpower_bar\" `_char.slave_traits.willpower/100`>>\
")>>
<<run $("#sex_player_bars").wiki("\
<<showmeter \"player_arousal_bar\" `$player.mental_conditions.arousal/50`>>\
<<showmeter \"player_stamina_bar\" `$player.conditions.stamina/$player.conditions.max_stamina`>>\
")>>
<<removeclass "#sex_info" "hidden">>
/* Whether player is higher status than player */
<<set _higher_status = (_char.is_slave && _char.owner == "player") ||
($player.get_status("nipon") == "slave" && _char.status == "low_slave") ||
($player.get_status("nipon") == "high_slave" && _char.status == "slave") ||
($player.get_status("nipon") == "high_slave" && _char.status == "low_slave")>>
/* Cock for male, strap-on for female */
<<set _cock = "cock">>
<<if $player.gender == 1>>
<<set _cock = "strap-on">>
<</if>>
<<set _char_cock = "cock">>
<<if _char.gender == 1>>
<<set _char_cock = "strap-on">>
<</if>>
<<set _chest = "chest">>
<<if $player.gender == 1>>
<<set _chest = "boobs">>
<</if>>
<<set _char_chest = "chest">>
<<if _char.gender == 1>>
<<set _char_chest = "boobs">>
<</if>>
<<set _sex_state = {
"started": false,
"rape": false,
"top": true,
"bottom": true,
"convince_num": 0,
"boundaries": {
"caress": false,
"kiss": false,
"fondleBoobs": false,
"fingerPussy": false,
"lickPussy": false,
"footjob": false,
"oralSex": false,
"vaginalSex": false,
"analSex": false
},
"orgasm": false,
"last_action": "none"
}>>
/* If naked no need to undress character */
<<if _char.outfit == "naked">>
<<set _sex_state["top"] = false>>
<<set _sex_state["bottom"] = false>>
<<timed 50ms>>
<<run _update_state()>>
<</timed>>
<<set _responses = ["You approach " + setup.titleCase(_char.first_name) + " with a lustful look in your eye who is fully naked as per your instructions,"]>>
<<else>>
<<set _responses = ["You approach " + setup.titleCase(_char.first_name) + " with a lustful look in your eye,"]>>
<</if>>
<<run setup.mainLog_append_delayed(_responses)>>
/* Check if first time having sex */
<<if !$locations["world"].data.had_sex>>
<<set $locations["world"].data.had_sex = true>>
<<popover>>
<<include sexTutorial>>
<</popover>>
<</if>>
<<script>>
let _t = State.temporary;
let _v = State.variables;
/* Calculates current susceptability */
_t.calc_thresh = (action) => {
let char = State.temporary.char;
let player = State.variables.player;
let thresh = (80 - char.slave_traits.willpower +
char.slave_traits.obedience - 60 +
char.slave_traits.trust -
char.mental_conditions.anger +
char.mental_conditions.arousal * (3 - State.variables.difficulty) -
char.mental_conditions.discomfort +
char.sex_prefs.libido - 40);
if (action == "oralSex" || action == "vaginalSex" || action == "analSex") {
thresh += player.sex_skills[action.splice(0, -3)] + char.sex_prefs[action.splice(0, -3)];
} else {
}
if (_t.sex_state.orgasm) {
thresh += 1000;
}
return thresh;
};
/* Checks if player has started and decrements limit */
_t.check_fucking = () => {
if (!_t.sex_state.started) {
_t.sex_state.started = true;
_t.char.limits.fuck -= 1;
_t.update_state();
}
};
/* Processes rejection and prompts user */
_t.process_rejection = (action, action_fn, thresh, thresh_modifier) => {
/* Print prompt onto main log */
let disposition = _t.char.get_disposition();
if (!_t.sex_state.started || (disposition == "depressed") || (disposition == "angry") || (disposition == "fearful") ||
(disposition == "hateful")) {
setup.mainLog_append_delayed([setup.sex_actions.foreplay[action].query_str(_t.char) +
"<br>" + either([
_t.char.dialogue("What the fuck are you doing?"),
_t.char.dialogue("What the fuck? Get away from me."),
_t.char.dialogue("Ew, go away!")
])]);
} else {
setup.mainLog_append_delayed([setup.sex_actions.foreplay[action].query_str(_t.char) +
"<br>" + either([
_t.char.dialogue("Um... no."),
_t.char.dialogue("Please no... but we can keep doing other things..."),
_t.char.dialogue("Not today..."),
_t.char.dialogue("I'm not comfortable with that...")
])]);
}
/* Show UI */
$("#sex_rejection_actions").removeClass("hidden");
$(_t.open_menu).addClass("hidden");
/* Set variables */
_t.rejected_action = action;
_t.rejected_action_fn = action_fn;
_t.rejected_thresh = thresh;
_t.rejected_thresh_modifier = thresh_modifier;
if ((disposition == "depressed") || (disposition == "angry") || (disposition == "fearful") || (disposition == "hateful")) {
/* Auto reject from convincing */
_t.force_reject = true;
} else {
_t.force_reject = false;
}
};
/* Prints changes */
_t.get_changes = () => {
let _t = State.temporary;
let char = _t.char;
let prechar = _t.prechar;
$.wiki("<<showChanges \'Player Changes\'>>");
let ret = "<div><b>" + setup.titleCase(char.first_name) + " Changes</b>";
let change_str = "<ul class=\"mainLogChanges\">";
for (let condition of setup.CONDITIONS) {
if (char.conditions[condition] != prechar.conditions[condition]) {
if (condition in setup.POSITIVES.character) {
change_str += "<li>" + setup.titleCase(condition) + ": " +
setup.show_change_html(prechar.conditions[condition], char.conditions[condition],
setup.POSITIVES.character[condition]);
} else {
change_str += "<li>" + setup.titleCase(condition) + ": " +
setup.show_change(prechar.conditions[condition], char.conditions[condition]);
}
change_str += "</li>";
}
}
for (let slave_trait of setup.SLAVE_TRAITS) {
if (char.slave_traits[slave_trait] != prechar.slave_traits[slave_trait]) {
let tit = setup.titleCase(slave_trait);
if (slave_trait == "obedience") {
tit = "Affection";
}
if (slave_trait == "trust" && (char.slave_traits[slave_trait] > prechar.slave_traits[slave_trait])) {
change_str += "<li>" + tit + ": " + setup.show_change_html(prechar.slave_traits[slave_trait], char.slave_traits[slave_trait]);
} else {
if (slave_trait in setup.POSITIVES.character) {
change_str += "<li>" + tit + ": " + setup.show_change_html(prechar.slave_traits[slave_trait], char.slave_traits[slave_trait],
setup.POSITIVES.character[slave_trait]);
} else {
change_str += "<li>" + tit + ": " + setup.show_change(prechar.slave_traits[slave_trait], char.slave_traits[slave_trait]);
}
}
change_str += "</li>";
}
}
for (let condition of setup.MENTAL_CONDITIONS) {
if (condition == "arousal") {
continue;
}
if (char.mental_conditions[condition] != prechar.mental_conditions[condition]) {
if (condition in setup.POSITIVES.character) {
change_str += "<li>" + setup.titleCase(condition) + ": " +
setup.show_change_html(prechar.mental_conditions[condition], char.mental_conditions[condition],
setup.POSITIVES.character[condition]);
} else {
change_str += "<li>" + setup.titleCase(condition) + ": " +
setup.show_change(prechar.mental_conditions[condition], char.mental_conditions[condition]);
}
change_str += "</li>";
}
}
for (let sex_pref of setup.SEX_PREFS) {
if (char.sex_prefs[sex_pref] != prechar.sex_prefs[sex_pref]) {
if (sex_pref in setup.POSITIVES.character) {
change_str += "<li>" + setup.titleCase(sex_pref) + " Preference: " +
setup.show_change_html(prechar.sex_prefs[sex_pref], char.sex_prefs[sex_pref],
setup.POSITIVES.character[sex_pref]);
} else {
change_str += "<li>" + setup.titleCase(sex_pref) + " Preference: " +
setup.show_change(prechar.sex_prefs[sex_pref], char.sex_prefs[sex_pref]);
}
change_str += "</li>";
}
}
for (let sex_fetish of setup.SEX_FETISHES) {
if (char.sex_fetishes[sex_fetish] != prechar.sex_fetishes[sex_fetish]) {
if (sex_fetish in setup.POSITIVES.character) {
change_str += "<li>" + setup.titleCase(sex_fetish) + " Fetish: " +
setup.show_change_html(prechar.sex_fetishes[sex_fetish], char.sex_fetishes[sex_fetish],
setup.POSITIVES.character[sex_fetish]);
} else {
change_str += "<li>" + setup.titleCase(sex_fetish) + " Fetish: " +
setup.show_change(prechar.sex_fetishes[sex_fetish], char.sex_fetishes[sex_fetish]);
}
change_str += "</li>";
}
}
change_str += "</ul></div>";
ret += change_str;
State.variables._temp_to_log += ret;
};
_t.update_state = () => {
let _t = State.temporary;
let char = _t.char;
let player = State.variables.player;
if (_t.sex_state.started) {
$("#sex_back button").addClass("disabled");
$("#sex_back button").prop("disabled", true);
$("#sex_done button").removeClass("disabled");
$("#sex_done button").prop("disabled", false);
}
if (!_t.sex_state.top) {
$("#sex4 button").addClass("disabled");
$("#sex4 button").prop("disabled", true);
$("#sex6 button").removeClass("disabled");
$("#sex6 button").prop("disabled", false);
}
if (!_t.sex_state.bottom) {
$("#sex5 button").addClass("disabled");
$("#sex5 button").prop("disabled", true);
$("#sex7 button").removeClass("disabled");
$("#sex7 button").prop("disabled", false);
$("#sex8 button").removeClass("disabled");
$("#sex8 button").prop("disabled", false);
if (player.gender == 0 || player.has_equipped("strap-on") != "none") {
if (char.gender == 1) {
$("#sex11 button").removeClass("disabled");
$("#sex11 button").prop("disabled", false);
$("#sex_oral_vaginal button").removeClass("disabled");
$("#sex_oral_vaginal button").prop("disabled", false);
$("#sex_anal_vaginal button").removeClass("disabled");
$("#sex_anal_vaginal button").prop("disabled", false);
}
$("#sex12 button").removeClass("disabled");
$("#sex12 button").prop("disabled", false);
$("#sex_oral_anal button").removeClass("disabled");
$("#sex_oral_anal button").prop("disabled", false);
$("#sex_vaginal_anal button").removeClass("disabled");
$("#sex_vaginal_anal button").prop("disabled", false);
}
}
if (!_t.sex_state.top && !_t.sex_state.bottom) {
$("#sex3 button").addClass("disabled");
$("#sex3 button").prop("disabled", true);
}
};
_t.check_arousal = () => {
let _t = State.temporary;
let char = _t.char;
let player = State.variables.player;
let delta = {
"mental_conditions": {
"arousal": 0,
},
"conditions": {
"stamina": -30,
"min_stamina": 0
}
};
let player_cumming = false;
let player_orgasmed = false;
let char_orgasmed = false;
let fn = setup.titleCase(char.first_name);
_t.responses = [];
if (player.mental_conditions.arousal >= player.mental_conditions.max_arousal && char.mental_conditions.arousal >= char.mental_conditions.max_arousal) {
/* Orgasming at the same time */
let str = "This pushes both you and " + fn + " off the edge, resulting in a simultaneous orgasm of euphoria.";
if (player.gender == 0) {
str += " You quickly grab your cock and need to cum.";
}
_t.responses.push(str);
/* Character response */
if (!_t.sex_state.rape) {
str = "Fuck that was so good!";
if (player.gender == 0) {
str += " Give it to me!";
}
_t.responses.push(char.dialogue(str));
} else {
_t.responses.push(`${fn} does not dare to meet your gaze as they shake with mixed emotion.`);
}
_t.sex_state.orgasm = true;
if (player.gender == 0) {
_t.responses.push("Where do you cum?");
player_cumming = true;
} else {
player_orgasmed = true;
}
char_orgasmed = true;
} else if (player.mental_conditions.arousal >= player.mental_conditions.max_arousal) {
/* Orgasming at the same time */
let str = "This pushes you off the edge, making you move into orgasm.";
if (player.gender == 0) {
str += " You quickly grab your cock and need to cum.";
}
_t.responses.push(str);
if (player.gender == 0) {
_t.responses.push("Where do you cum?");
player_cumming = true;
} else {
player_orgasmed = true;
}
} else if (char.mental_conditions.arousal >= char.mental_conditions.max_arousal) {
_t.responses.push("This pushes " + fn + " off the edge, making " +
setup.him(char) + " orgasm immediately.");
if (!_t.sex_state.rape) {
let str = "Fuck that was so good!";
if (player.gender == 0) {
str += " Give it to me!";
}
_t.responses.push(char.dialogue(str));
} else {
_t.responses.push(`${fn} does not dare to meet your gaze as they shake with mixed emotion.`);
}
_t.sex_state.orgasm = true;
char_orgasmed = true;
}
if (player_cumming) {
if (char_orgasmed) {
/* This should get picked up once scene is exited */
char.mental_conditions.arousal = 0;
setup.apply_delta(char, delta);
}
setup.mainLog_append_delayed(_t.responses, _t.sex_buttons, null, 1000, true, null,
() => {
_t.to_round = _t.char.key;
$.wiki("<<include round>>");
$.wiki("<<include updateBars>>");
$(_t.open_menu).addClass("hidden");
$("#action_bar").wiki("<<include sexEngineCumActions>>");
}
);
} else if (_t.responses.length > 0) {
/* Apply changes */
let str = "";
if (char_orgasmed) {
delta.mental_conditions.arousal = char.mental_conditions.arousal * -1;
let true_delta = setup.apply_delta(char, delta);
str += char.print_delta(true_delta);
if (player_orgasmed) {
str += " ";
}
}
if (player_orgasmed) {
delta.mental_conditions.arousal = player.mental_conditions.arousal * -1;
let true_delta = setup.apply_delta(player, delta);
str += player.print_delta(true_delta);
}
_t.responses.push(str);
setup.mainLog_append_delayed(_t.responses, _t.sex_buttons, null, 1000, true, null,
() => {
_t.to_round = _t.char.key;
$.wiki("<<include round>>");
$.wiki("<<include updateBars>>");
}
);
}
/* Update disposition */
$("#sex_info_disposition").html("Disposition: " + setup.titleCase(char.get_disposition()));
$("#mainLogCharacterImage").css("background-image", "url(\"" + char.image_folder() + char.first_name.toLowerCase() + "_" + char.get_disposition() + ".png\")");
};
<</script>><div id="sex_vaginal_actions" class="action container row col longbutton fiveQuarters smalltext hidden"
style="--rows: 4; --cols: 4">
@@#sex_vaginal1;<<button "Continue">><</button>>@@
@@#sex_vaginal2;<<button "Choke">><</button>>@@
@@#sex_vaginal3;<<button "Insult">><</button>>@@
@@#sex_vaginal4;<<button "Spit in mouth">><</button>>@@
@@#sex_vaginal5;<<button "Slap">><</button>>@@
@@#sex_vaginal6;<<button "Spank">><</button>>@@
@@#sex_vaginal_oral;<<button "Oral sex">><</button>>@@
<<disable>>
@@#sex_vaginal_anal;<<button "Anal sex">><</button>>@@
<</disable>>
<div style="grid-row: 4; grid-column: 2">
@@#sex_vaginal_back;<<button "Back">>
<<run setup.mainLog_append_delayed(["You take your " + _cock + " out of " +
setup.titleCase(_char.first_name) + "\'s pussy."])>>
<<set _open_menu = "#sex_actions">>
<<removeclass "#sex_actions" "hidden">>
<<addclass "#sex_vaginal_actions" "hidden">>
<</button>>@@
</div>
<div style="grid-row: 4; grid-column: 3">
@@#sex_vaginal_done;<<button "Done" `passage()`>>
<<if _sex_state.rape>>
<<if _sex_state.orgasm>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to anguish over their conflicting feelings. You can hear " + setup.his(_char) +
" muffled cries as you leave (" + setup.titleCase(_char.first_name) +"\'s Willpower " + setup.show_change_html(0, -3) + ")">>
<<set _char.slave_traits.willpower -= 3>>
<<else>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " in anguish. You can hear " + setup.his(_char) + " muffled cries as you" +
" leave.">>
<</if>>
<<elseif _sex_state.orgasm>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.<br>" + _char.dialogue("That was great, let\'s do that again sometime...") +
"(" + setup.titleCase(_char.first_name) + "\'s Affection " + setup.show_change_html(0, 5) + ")">>
<<set _char.slave_traits.obedience += 5>>
<<elseif _char.mental_conditions.arousal gt 20 && _char.mental_conditions.discomfort lt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" found the experience quite pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort) / 10>>
<<elseif _char.mental_conditions.discomfort gt _char.mental_conditions.arousal>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties. You can tell that " + setup.he(_char) +
" did not find the experience pleasurable (" + setup.titleCase(_char.first_name) +
"\'s Affection " + setup.show_change_html(0, _char.mental_conditions.arousal - _char.mental_conditions.discomfort) + ").">>
<<set _char.slave_traits.obedience += (_char.mental_conditions.arousal - _char.mental_conditions.discomfort)>>
<<else>>
<<set $_temp_to_log = "You leave " + setup.titleCase(_char.first_name) + " to " +
setup.his(_char) + " duties.">>
<</if>>
/* Re-enable menu */
<<set $enable_menu = true>>
<<set $to_simulate.add(_char.key)>>
/* Last round for good measure */
<<set _to_round = _char.key>>
<<include round>>
<<run _get_changes()>>
<</button>>@@
</div>
</div>
<<silently>><<timed 10ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
$("#sex_vaginal_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
/* Filter out non-action buttons */
if (self.html() == "Back" || self.html() == "Done") {
return;
}
if (_v.player.conditions.stamina < 5) {
$.wiki("<<notify>>You are too tired!<</notify>>");
return;
} else if (_t.char.conditions.stamina < 5) {
$.wiki("<<notify>><<= setup.titleCase(_char.first_name)>> is too tired!<</notify>>");
return;
}
let action = setup.camelize(self.html());
if (action in setup.sex_actions.vaginal) {
_t.perform("vaginal", action);
}
})
<</script>><</timed>><</silently>><<script>>
let _t = State.temporary;
let _v = State.variables;
/* Unbind all listeners in case of duplication */
$(".category").unbind();
$(".listItem").unbind();
/* Add category toggles */
$(".category").on("click", (event) => {
let self = $(event.currentTarget);
/* Find category list */
self.parent().parent().find("#" + self.attr("id") + "_list").fadeToggle(0.1);
});
/* Add item description hovers */
$(".listItem").hover((event) => {
let self = $(event.currentTarget);
let temp_item = UInv.GetDefaultItemObject(self.attr("title"));
let target = null;
let value_str = setup.LARI;
if (self.attr("id").contains("Player")) {
target = "#left";
value_str += setup.round2(temp_item.value * (1 - _t.halfspread));
} else {
target = "#right";
value_str += setup.round2(temp_item.value * (1 + _t.halfspread));
}
$(target + "Title").html(temp_item.name + "<br>" + value_str);
$(target + "Text").empty();
let html_text = temp_item.description;
if (temp_item.type.includes("armor")) {
} else if (temp_item.type.includes("weapon")) {
}
$(target + "Text").html(html_text);
$(target + "Div").removeClass("hidden");
},
(event) => {
$(".mapside").addClass("hidden");
});
/* Click listener to add to transactions */
$(".listItem").on("click", (event) => {
let self = $(event.currentTarget);
let temp_item = UInv.GetDefaultItemObject(self.attr("title"));
if (self.attr("id").contains("Player")) {
if (temp_item.type.contains("quest_item")) {
$.wiki("<<notify>>Cannot sell quest items.<</notify>>")
} else {
_t.add_transaction(self.attr("title"), 1, false);
$(".mapside").addClass("hidden");
}
} else {
_t.add_transaction(self.attr("title"), 1, true);
$(".mapside").addClass("hidden");
}
_t.log_transaction();
_t.update_inventories();
$.wiki("<<include shopEngineEventListeners>>");
});
<</script>><<set _categories = {"armor": "armors", "weapon": "weapons", "accessory": "accessories", "gift": "gifts"}>>
<div class="main container threeCol" style="height: 100%; width: 100%;">
<div id="playerInventory" class="subbackground">
</div>
<div id="transactionLogContainer" class="subbackground">
<hr>
<center>
<<if def _shop_name>>
<h2 style="margin-bottom: 0">_shop_name</h2>
<<elseif setup.locations.get(passage()) == null>>
<h2 style="margin-bottom: 0">Transaction Log</h2>
<<else>>
<h2 style="margin-bottom: 0"><<= setup.locations.get(passage()).name>></h2>
<</if>>
<div id="transactionNet"></div>
</center>
<div id="transactionLog" style="overflow-y: auto; height: 490px; width: 100%; padding: 20px; padding-top: 0; box-sizing: border-box; font-weight: normal">
</div>
<center>
<div id="transactionLogButtons">
@@#back;<<button "Back" `passage()`>>
<<set _shopping = false>>
<<script>>
let _t = State.temporary;
for (const item in _t.shop_state["buy"]) {
/* Add back to shop */
UInv.AddItem(_t.shop_bag, item, _t.shop_state["buy"][item]);
}
for (const item in _t.shop_state["sell"]) {
/* Add back to inventory */
UInv.AddItem("inventory", item, _t.shop_state["sell"][item]);
}
<</script>>
<</button>>@@
<<disable>>
@@#confirm;<<button "Confirm">>
<<if _shop_state.net lt 0 && $player.get_money() lt Math.abs(_shop_state.net)>>
<<notify>>Insufficient funds.<</notify>>
<<else>>
<<run _confirm_transaction()>>
<</if>>
<</button>>@@
<</disable>>
</div>
</center>
</div>
<div id="shopInventory" class="subbackground">
</div>
</div>
<<run $("\
<div id=\"leftDiv\" class=\"mapside left hidden\" style=\"font-size: smaller\">\
<center><b id=\"leftTitle\">Title</b></center>\
<div id=\"leftText\">Lorem Ipsum bro!</div>\
</div>\
").insertBefore("#background")>>
<<run $("\
<div id=\"rightDiv\" class=\"mapside right hidden\" style=\"font-size: smaller\">\
<center><b id=\"rightTitle\">Title</b></center>\
<div id=\"rightText\">Lorem Ipsum bro!</div>\
</div>\
").insertAfter("#background")>>
<<timed 10ms>>
<<run _log_transaction()>>
<<run _update_inventories()>>
<</timed>><center>
<h2 style="margin-bottom: 0">Inventory</h2>
<div id="playerMoney"><<= setup.LARI>><<money>></div>
</center>
<<for _type, _category range _categories>>
<hr>
<center><h3 @id="_type" class="tool category"><<= setup.titleCase(_category)>></h3></center>
<<set _type_list = _type + "_list">>
<div @id="_type_list">
<<set _temp_items = UInv.GetItemsArrayByItemTag("inventory", "type", _type)>>
<<for _idx, _temp_item range _temp_items>>
<<set _temp_item_div = _temp_item + "Player">>
<<set _temp_item_num = _temp_item + "Num">>
<p @id="_temp_item_div" class="tool listItem" @title="_temp_item">
<<= UInv.GetDefaultItemObject(_temp_item).name>>
<span @id="_temp_item_num" style="float: right">
<<= UInv.BagHasItem("inventory", _temp_item)>>
</span>
</p>
<</for>>
</div>
<</for>><center>
<h2 style="margin-bottom: 0">Shop Inventory</h2>
<div id="shopMoney"><<= setup.LARI>><<money _shop_bag>></div>
</center>
<<for _type, _category range _categories>>
<hr>
<center><h3 @id="_type" class="tool category"><<= setup.titleCase(_category)>></h3></center>
<<set _type_list = _type + "_list">>
<div @id="_type_list">
<<set _temp_items = UInv.GetItemsArrayByItemTag(_shop_bag, "type", _type)>>
<<for _idx, _temp_item range _temp_items>>
<<set _temp_item_div = _temp_item + "Shop">>
<<set _temp_item_num = _temp_item + "Num">>
<p @id="_temp_item_div" class="tool listItem" @title="_temp_item">
<<= UInv.GetDefaultItemObject(_temp_item).name>>
<span @id="_temp_item_num" style="float: right">
<<= UInv.BagHasItem(_shop_bag, _temp_item)>>
</span>
</p>
<</for>>
</div>
<</for>>/* Inventory must be defined and exist */
<<if ndef _shop_bag || UInv.GetBagObject(_shop_bag) == null>>
<<run alert("Error shop inventory undefined.")>>
<</if>>
/* If halfspread is undefined then define it as 25% default - (20 * tact / 100)% */
<<if ndef _halfspread>>
<<if setup.locations.get(passage()) == null>>
<<set _halfspread = 0.25 - 0.2 * ($player.stats.tact / 100)>>
<<else>>
<<set _halfspread = 0.25 - 0.2 * ($player.get_status_prop("tact") / 100)>>
<</if>>
<</if>>
/* Enable shopping */
<<set _shopping = true>>
/* Temporary bag for storing items to sell */
<<if UInv.GetBagObject("to_sell") == null>>
<<run UInv.CreateBag("to_sell")>>
<<else>>
<<run UInv.EmptyBag("to_sell")>>
<</if>>
/* Temporary bag for storing items to buy */
<<if UInv.GetBagObject("to_buy") == null>>
<<run UInv.CreateBag("to_buy")>>
<<else>>
<<run UInv.EmptyBag("to_buy")>>
<</if>>
/* Hide all elements and include UI */
<<run $("#background").html("")>>
<<run $("#background").wiki("<<include shopEngineUI>>")>>
<<set _shop_state = {
"net": 0,
"buy": {},
"sell": {}
}>>
/* Functions */
<<script>>
let _t = State.temporary;
let _v = State.variables;
/* Removes an item from a bag and places it in the transaction queue */
_t.add_transaction = function(item, quantity, buy) {
let temp_item = UInv.GetDefaultItemObject(item);
let spread_mult = 1;
let dict = null;
let removal = null;
let direction = 0;
if (buy) {
direction = -1;
dict = "buy";
removal = _t.shop_bag;
spread_mult += _t.halfspread;
} else {
direction = 1;
dict = "sell";
removal = "inventory";
spread_mult -= _t.halfspread;
}
/* Cap by quantity */
if (UInv.BagHasItem(removal, item) < quantity) {
quantity = UInv.BagHasItem(removal, item);
}
/* Remove item from removal bag and insert into appropriate dict */
_t.shop_state.net += direction * quantity * temp_item.value * spread_mult;
UInv.DeleteItem(removal, item, quantity);
if (_t.shop_state[dict][item] == null) {
_t.shop_state[dict][item] = 0;
}
_t.shop_state[dict][item] += quantity;
_t.log_transaction();
_t.update_inventories();
};
_t.remove_transaction = function(item, quantity, buy) {
let temp_item = UInv.GetDefaultItemObject(item);
let spread_mult = 1;
let dict = null;
let removal = null;
let direction = 0;
if (buy) {
direction = -1;
dict = "buy";
removal = _t.shop_bag;
spread_mult += _t.halfspread;
} else {
direction = 1;
dict = "sell";
removal = "inventory";
spread_mult -= _t.halfspread;
}
/* Cap by quantity */
if (_t.shop_state[dict][item] < quantity) {
quantity = _t.shop_state[dict][item];
}
/* Remove item from shop_state and insert into bag */
_t.shop_state.net -= direction * quantity * temp_item.value * spread_mult;
UInv.AddItem(removal, item, quantity);
_t.shop_state[dict][item] -= quantity;
_t.log_transaction();
_t.update_inventories();
};
_t.log_transaction = function(append=false) {
if (!append) {
$("#transactionLog").empty();
}
$("#transactionNet").html(setup.show_money_change_html(0, setup.round2(_t.shop_state.net)));
$("#transactionLog").append("<hr><center><b>Buy</b></center>");
for (let item in _t.shop_state.buy) {
if (_t.shop_state.buy[item] > 0) {
$("#transactionLog").append("<div id=\"" + item + "\" class=\"tool buy success\" style=\"width: 100%\">" +
UInv.GetDefaultItemObject(item).name + "<span style=\"float: right\">+" + _t.shop_state.buy[item] + "</span></div>");
}
}
$("#transactionLog").append("<hr><center><b>Sell</b></center>");
for (let item in _t.shop_state.sell) {
if (_t.shop_state.sell[item] > 0) {
$("#transactionLog").append("<div id=\"" + item + "\" class=\"tool sell fail\" style=\"width: 100%\">" +
UInv.GetDefaultItemObject(item).name + "<span style=\"float: right\">-" + _t.shop_state.sell[item] + "</span></div>");
}
}
/* Add event listeners */
$("#transactionLog").find(".tool").on("click", (event) => {
let self = $(event.currentTarget);
let quantity = 10;
if (event.detail === 1) {
quantity = 1;
}
if (self.hasClass("buy")) {
_t.remove_transaction(self.attr("id"), quantity, true);
} else {
_t.remove_transaction(self.attr("id"), quantity, false);
}
_t.log_transaction();
});
};
_t.update_inventories = function() {
$("#playerInventory").empty();
$("#playerInventory").wiki("<<include shopEngineUIPlayerInventory>>");
$("#shopInventory").empty();
$("#shopInventory").wiki("<<include shopEngineUIShopInventory>>");
/* Add category toggles */
$(".category").on("click", (event) => {
let self = $(event.currentTarget);
/* Find category list */
self.parent().parent().find("#" + self.attr("id") + "_list").fadeToggle(0.1);
});
/* Add item description hovers */
$(".listItem").hover((event) => {
let self = $(event.currentTarget);
let temp_item = UInv.GetDefaultItemObject(self.attr("title"));
let target = null;
let value_str = setup.LARI;
if (self.attr("id").contains("Player")) {
target = "#left";
value_str += setup.round2(temp_item.value * (1 - _t.halfspread));
} else {
target = "#right";
value_str += setup.round2(temp_item.value * (1 + _t.halfspread));
}
$(target + "Title").html(temp_item.name + "<br>" + value_str);
$(target + "Text").empty();
let html_text = temp_item.description + "<br>";
if (temp_item.type.includes("armor") && temp_item.armor_stats != null) {
if (temp_item.armor_stats.resist != null) {
html_text += "Resist: <ul>";
let prot_types = ["blunt", "pierce", "slash"];
for (let prot_type of prot_types) {
if (temp_item.armor_stats.resist[prot_type] != null && temp_item.armor_stats.resist[prot_type] != 0) {
html_text += "<li>" + setup.titleCase(prot_type) + ": " + temp_item.armor_stats.resist[prot_type] + "</li>";
}
}
html_text += "</ul>";
}
if (temp_item.stat != null) {
html_text += "Requirement: " + setup.titleCase(temp_item.stat) + ": ";
if (_v.player.stats[temp_item.stat] >= temp_item.statreq) {
html_text += "<span class=\"success\">" + temp_item.statreq + "</span>";
} else {
html_text += "<span class=\"fail\">" + temp_item.statreq + "</span>";
}
} else if (temp_item.skill != null) {
html_text += "Requirement: " + setup.titleCase(temp_item.skill) + ": ";
if (_v.player.skills[temp_item.skill] >= temp_item.skillreq) {
html_text += "<span class=\"success\">" + temp_item.skillreq + "</span>";
} else {
html_text += "<span class=\"fail\">" + temp_item.skillreq + "</span>";
}
}
} else if (temp_item.type.includes("weapon") && temp_item.weapon_stats != null) {
html_text += "Slots: ";
if (temp_item.type.includes("2-handed")) {
html_text += "Two handed<br>";
} else {
html_text += "One handed<br>";
}
let prot_types = ["blunt", "pierce", "slash"];
if (temp_item.weapon_stats.damage != null) {
html_text += "Damage: <ul>";
for (let prot_type of prot_types) {
if (temp_item.weapon_stats.damage[prot_type] != null && temp_item.weapon_stats.damage[prot_type] != 0) {
html_text += "<li>" + setup.titleCase(prot_type) + ": " + temp_item.weapon_stats.damage[prot_type] + "</li>";
}
}
html_text += "</ul>";
}
if (temp_item.weapon_stats.resist != null) {
html_text += "Resist: <ul>";
for (let prot_type of prot_types) {
if (temp_item.weapon_stats.resist[prot_type] != null && temp_item.weapon_stats.resist[prot_type] != 0) {
html_text += "<li>" + setup.titleCase(prot_type) + ": " + temp_item.weapon_stats.resist[prot_type] + "</li>";
}
}
html_text += "</ul>";
}
if (temp_item.stat != null) {
html_text += "Requirement: " + setup.titleCase(temp_item.stat) + ": ";
if (_v.player.stats[temp_item.stat] >= temp_item.statreq) {
html_text += "<span class=\"success\">" + temp_item.statreq + "</span>";
} else {
html_text += "<span class=\"fail\">" + temp_item.statreq + "</span>";
}
} else if (temp_item.skill != null) {
html_text += "Requirement: " + setup.titleCase(temp_item.skill) + ": ";
if (_v.player.skills[temp_item.skill] >= temp_item.skillreq) {
html_text += "<span class=\"success\">" + temp_item.skillreq + "</span>";
} else {
html_text += "<span class=\"fail\">" + temp_item.skillreq + "</span>";
}
}
}
$(target + "Text").html(html_text);
$(target + "Div").removeClass("hidden");
},
(event) => {
$(".mapside").addClass("hidden");
});
/* Click listener to add to transactions */
$(".listItem").on("click", (event) => {
let self = $(event.currentTarget);
let temp_item = UInv.GetDefaultItemObject(self.attr("title"));
let quantity = 10;
if (event.detail === 1) {
quantity = 1;
}
if (self.attr("id").contains("Player")) {
if (temp_item.type.contains("quest_item")) {
$.wiki("<<notify>>Cannot sell quest items.<</notify>>");
} else if (_v.player.has_equipped(self.attr("title"), true).length > 0) {
let num_equipped = _v.player.has_equipped(self.attr("title"), true).length;
if (UInv.BagHasItem("inventory", self.attr("title")) - quantity < num_equipped) {
$.wiki("<<notify>>Cannot sell equipped items.<</notify>>");
} else {
_t.add_transaction(self.attr("title"), quantity.clamp(0, UInv.BagHasItem("inventory", self.attr("title")) - num_equipped), false);
$(".mapside").addClass("hidden");
$("#transactionLogButtons").find("#confirm button").removeClass("disabled");
$("#transactionLogButtons").find("#confirm button").prop("disabled", false);
}
} else {
_t.add_transaction(self.attr("title"), quantity, false);
$(".mapside").addClass("hidden");
$("#transactionLogButtons").find("#confirm button").removeClass("disabled");
$("#transactionLogButtons").find("#confirm button").prop("disabled", false);
}
} else {
_t.add_transaction(self.attr("title"), quantity, true);
$(".mapside").addClass("hidden");
$("#transactionLogButtons").find("#confirm button").removeClass("disabled");
$("#transactionLogButtons").find("#confirm button").prop("disabled", false);
}
});
};
/* Completes shopping instance, assumes both bags have enough money for transaction */
_t.confirm_transaction = function() {
/* Transfer items */
for (let item in _t.shop_state.buy) {
if (_t.shop_state.buy[item] > 0) {
UInv.AddItem("inventory", item, _t.shop_state.buy[item]);
}
}
for (let item in _t.shop_state.sell) {
if (_t.shop_state.sell[item] > 0) {
UInv.AddItem(_t.shop_bag, item, _t.shop_state.sell[item]);
}
}
_t.shop_state.buy = {};
_t.shop_state.sell = {};
/* Transfer money */
if (_t.shop_state.net < 0) {
$.wiki("<<removemoney " + setup.round2(Math.abs(_t.shop_state.net)) + ">>");
$.wiki("<<addmoney " + setup.round2(Math.abs(_t.shop_state.net)) + " " + _t.shop_bag + ">>");
} else {
$.wiki("<<expandmoney " + _t.shop_bag + ">>");
let avail_tetri = UInv.BagHasItem(_t.shop_bag, "tetri");
if (_t.shop_state.net > avail_tetri / 100) {
_t.shop_state.net = setup.round2(avail_tetri / 100);
}
$.wiki("<<addmoney " + setup.round2(Math.abs(_t.shop_state.net)) + ">>");
$.wiki("<<removemoney " + setup.round2(Math.abs(_t.shop_state.net)) + " " + _t.shop_bag + ">>");
}
_t.shop_state.net = 0;
$.wiki("<<audio coins_sound play>>");
/* Reset UI */
$("#transactionLogButtons").find("#confirm button").addClass("disabled");
$("#transactionLogButtons").find("#confirm button").prop("disabled", true);
_t.log_transaction();
_t.update_inventories();
$("#playerMoney").empty();
$("#playerMoney").wiki("<<= setup.LARI>><<money>>");
$("#shopMoney").empty();
$("#shopMoney").wiki("<<= setup.LARI>><<money _shop_bag>>");
}
<</script>><<nobr>>
/* Check if player can pay costs first */
<<for _idx, _to_simulate range _to_simulate_day>>
<<set _char = $characters[_to_simulate]>>
<<if _char.assignment != "none">>
<<if _char.assignment == "dayTrade">>
<<set _assignment_delta = setup.assignments[_char.assignment](_char, _char.finances.investment)>>
<<set _assignment_delta = setup.mult_dict(_assignment_delta, ($_to_advance + $time_awake) / (24 * 60))>>
<<else>>
/* Clear out investment data */
<<if _char.finances.investment != 0>>
<<set _char.finances.investment = 0>>
<</if>>
<<set _assignment_delta = setup.assignments[_char.assignment](_char)>>
<<set _assignment_delta = setup.mult_dict(_assignment_delta, ($_to_advance + $time_awake) / (24 * 60))>>
<</if>>
<<set _slave_changes[_to_simulate].flavor_text += "Today " + _char.name() + " " +
_assignment_delta.flavor_text + " ">>
<<if def $characters.shintani_hiroyuki && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _slave_changes[_to_simulate].cost += 25 * setup.HEIRARCHY[_char.status]>>
<</if>>
<<if ("cost" in _assignment_delta)>>
<<set _slave_changes[_to_simulate].cost += _assignment_delta.cost>>
<</if>>
<<set _total_profit -= _slave_changes[_to_simulate].cost>>
<</if>>
/* Push into to_simulate */
<<set $to_simulate.add(_to_simulate)>>
<</for>>
/* If not enough money, no changes occur and roles reset */
<<if _total_profit lt 0 && Math.abs(_total_profit) gt $player.get_money()>>
<<set _afford = false>>
<<for _idx, _to_simulate range _to_simulate_day>>
<<set _char = $characters[_to_simulate]>>
<<if _char.assignment == "dayTrade">>
<<set $player.finances.investment -= _char.finances.investment>>
<<set _char.finances.investment = 0>>
<</if>>
<<if _char.owner == "shintani_hiroyuki">>
<<set _char.assignment = "none">>
<<else>>
/* Owned by player */
<<set _char.assignment = "freeTime">>
<</if>>
<</for>>
<<else>>
/* Generic changes */
<<for _idx, _to_simulate range _to_simulate_day>>
<<set _char = $characters[_to_simulate]>>
<<if _char.assignment != "none">>
<<set _assignment_delta = setup.assignments[_char.assignment](_char)>>
<<set _assignment_delta = setup.mult_dict(_assignment_delta, ($_to_advance + $time_awake) / (24 * 60))>>
/* Begin by adding and performing all non-special rolls */
<<if ("self" in _assignment_delta)>>
<<for _key, _val range _assignment_delta.self>>
<<for _sub_key, _sub_val range _val>>
<<if _key == "understand">>
<<if _char[_sub_key + "_known"]>>
<<continue>>
<<else>>
<<set _roll = randomFloat(1.0)>>
<<if _roll lt _sub_val>>
<<set _char[_sub_key + "_known"] = true>>
<<if _sub_key == "sex_prefs">>
<<set _flavor_name = "sexual preferences">>
<<else>>
<<set _flavor_name = "sexual fetishes">>
<</if>>
<<set _slave_changes[_to_simulate].special.push(
"<span class=\"success\">You learned " + setup.titleCase(_char.first_name) +
"\'s " + _flavor_name + ".</span>"
)>>
<</if>>
<</if>>
<<else>>
<<if _sub_key.startsWith("min") || _sub_key.startsWith("max")>>
<<continue>>
<</if>>
<<if Math.abs(_sub_val) gte 1>>
<<set _delta = _sub_val>>
<<else>>
/* Simulate probability */
<<set _roll = randomFloat(1.0)>>
<<if _roll lt Math.abs(_sub_val)>>
<<set _delta = Math.sign(_sub_val)>>
<<else>>
<<set _delta = 0>>
<</if>>
<</if>>
/* Do straight addition with clamping */
<<set _prev = _char[_key][_sub_key]>>
<<if ("min_" + _sub_key) in _assignment_delta.self[_key] && _delta lt 0>>
<<if _prev gt _assignment_delta.self[_key]["min_" + _sub_key]>>
<<set _char[_key][_sub_key] += _delta>>
<<set _char[_key][_sub_key] = _char[_key][_sub_key].clamp(_assignment_delta.self[_key]["min_" + _sub_key], 100)>>
<</if>>
<<elseif _delta lt 0>>
/* No minimum */
<<set _char[_key][_sub_key] += _delta>>
<<elseif ("max_" + _sub_key) in _assignment_delta.self[_key]>>
/* _delta > 0 */
<<if _prev lt _assignment_delta.self[_key]["max_" + _sub_key]>>
<<set _char[_key][_sub_key] += _delta>>
<<set _char[_key][_sub_key] = _char[_key][_sub_key].clamp(-100, _assignment_delta.self[_key]["max_" + _sub_key])>>
<</if>>
<<else>>
/* No maximum */
<<set _char[_key][_sub_key] += _delta>>
<</if>>
/* Push in change */
<<if !(_sub_key in _slave_changes[_to_simulate].self[_key])>>
<<set _slave_changes[_to_simulate].self[_key][_sub_key] = 0>>
<</if>>
<<if _char[_key][_sub_key] - _prev != 0>>
<<set _slave_changes[_to_simulate].self[_key][_sub_key] += _char[_key][_sub_key] - _prev>>
<</if>>
<</if>>
<</for>>
<</for>>
<</if>>
<<if ("player" in _assignment_delta)>>
<<for _key, _val range _assignment_delta.player>>
<<for _sub_key, _sub_val range _val>>
<<if _sub_key.startsWith("min") || _sub_key.startsWith("max")>>
<<continue>>
<</if>>
<<if Math.abs(_sub_val) gte 1>>
<<set _delta = _sub_val>>
<<else>>
/* Simulate probability */
<<set _roll = randomFloat(1.0)>>
<<if _roll lt Math.abs(_sub_val)>>
<<set _delta = Math.sign(_sub_val)>>
<<else>>
<<set _delta = 0>>
<</if>>
<</if>>
/* Do straight addition with clamping */
<<set $player[_key][_sub_key] += _delta>>
<</for>>
<</for>>
<</if>>
<</if>>
<</for>>
<</if>>
<</nobr>><<nobr>>
<<for _idx, _to_simulate range _to_simulate_day>>
<<set _char = $characters[_to_simulate]>>
<<if _char.diet.amount != "regular">>
<<set _slave_changes[_to_simulate].flavor_text += "You make sure that " + setup.titleCase(_char.first_name) + " " +
setup.diets.amount[_char.diet.amount](_char).flavor_text + " ">>
<<set _diet_delta = setup.diets.amount[_char.diet.amount](_char)>>
<<set _diet_delta = setup.mult_dict(_diet_delta, ($_to_advance + $time_awake) / (24 * 60))>>
<<set _changes = setup.apply_delta(_slave_changes[_to_simulate].self, _diet_delta.self)>>
<<run setup.apply_delta(_char, _changes)>>
<</if>>
<<if _char.diet.additives != "none">>
<<set _delta = setup.diets.additives[_char.diet.additives](_char)>>
<<set _delta = setup.mult_dict(_delta, ($_to_advance + $time_awake) / (24 * 60))>>
<<set _slave_changes[_to_simulate].flavor_text += setup.titleCase(_char.first_name) + _delta.flavor_text + " ">>
<<if "player" in _delta && "flavor_text" in _delta.player>>
<<set _player_flavor_text += " " + _delta.player.flavor_text>>
<</if>>
/* Apply changes */
<<set _changes = setup.apply_delta(_slave_changes[_to_simulate].self, _delta.self)>>
<<run setup.apply_delta(_char, _changes)>>
<<set _delta = setup.diets.additives[_char.diet.additives](_char)>>
<<run setup.apply_delta($player, _delta.player)>>
/* TODO: Not great, there might be a way better way to do this (possibly somewhere else),
* but I don't know what that would be right now. */
<<if _char.diet.additives == "cumBased" || _char.diet.additives == "cumAdded">>
<<script>>
State.variables.player.slaves
.map(slaveKey => State.variables.characters[slaveKey])
.filter(c => c.gender === 0 && c.key != _to_simulate)
.forEach(c => setup.apply_delta(c, { conditions: { stamina: _delta.player.conditions.stamina }}));
<</script>>
<</if>>
<</if>>
<</for>>
<</nobr>><<for _idx, _to_simulate range _to_simulate_day>>
<<set _char = $characters[_to_simulate]>>
/* Degree */
<<set _degree_changes = setup.rules.degree[_char.rules.degree](_char)>>
<<set _slave_changes[_char.key].flavor_text += _degree_changes.flavor_text>>
/* Punishments */
<<set _punishment_changes = setup.rules.punishment[_char.rules.punishment](_char)>>
<<set _punishment_changes = setup.mult_dict(_punishment_changes, ($_to_advance + $time_awake) / (24 * 60))>>
<<set _slave_changes[_char.key].flavor_text += " " + _punishment_changes.flavor_text>>
<<set _changes = setup.apply_delta(_slave_changes[_char.key], _punishment_changes)>>
<<if "self" in _changes>>
<<run setup.apply_delta(_char, _changes.self)>>
<</if>>
/* Rewards */
<<set _reward_changes = setup.rules.reward[_char.rules.reward](_char)>>
<<set _reward_changes = setup.mult_dict(_reward_changes, ($_to_advance + $time_awake) / (24 * 60))>>
<<set _slave_changes[_char.key].flavor_text += " " + _reward_changes.flavor_text>>
<<set _changes = setup.apply_delta(_slave_changes[_char.key], _reward_changes)>>
<<if "self" in _changes>>
<<run setup.apply_delta(_char, _changes.self)>>
<</if>>
/* Masturbation */
<<set _masturbation_changes = setup.rules.masturbation[_char.rules.masturbation](_char)>>
<<set _masturbation_changes = setup.mult_dict(_masturbation_changes, ($_to_advance + $time_awake) / (24 * 60))>>
<<set _slave_changes[_char.key].flavor_text += " " + _masturbation_changes.flavor_text>>
<<set _changes = setup.apply_delta(_slave_changes[_char.key], _masturbation_changes)>>
<<if "self" in _changes>>
<<run setup.apply_delta(_char, _changes.self)>>
<</if>>
<</for>><<nobr>>
<<set _slave_changes = {}>>
<<set _total_profit = 0>>
<<set _afford = true>>
<<set _to_simulate_day = new Set()>>
/* Add shintani's slaves that are lower status, remove those of equal or higher status */
<<if $player.is_slave>>
<<if $player.get_status("nipon") == "slave">>
<<set _to_simulate_day.add("mei_hironaka")>>
<<elseif $player.get_status("nipon") == "high_slave">>
<<set _to_simulate_day.add("mei_hironaka")>>
<<set _to_simulate_day.add("jae_hironaka")>>
<</if>>
<</if>>
<<for _idx, _val range $player.slaves>>
<<set _to_simulate_day.add(_val)>>
<</for>>
<<for _idx, _to_simulate range _to_simulate_day>>
<<set _char = $characters[_to_simulate]>>
<<set _slave_changes[_to_simulate] = {
"self": {
"stats": {},
"physical_traits": {},
"slave_traits": {},
"conditions": {},
"mental_conditions": {},
"sex_skills": {},
"skills": {},
"sex_prefs": {},
"sex_fetishes": {},
},
"cost": 0,
"special": [],
"flavor_text": ""
}>>
<<for _idx2, _key range Object.keys(_slave_changes[_to_simulate].self)>>
<<for _idx3, _val2 range setup[_key.toUpperCase()]>>
<<if typeof _char[_key][_val2] === "number">>
<<set _slave_changes[_to_simulate].self[_key][_val2] = 0>>
<</if>>
<</for>>
<</for>>
<</for>>
/*
Restore slave energy to 100
TODO: Do this some nicer way.
*/
<<script>>
const _v = State.variables;
_v.player.slaves
.map(slaveKey => _v.characters[slaveKey])
.forEach(c => c.conditions.stamina = c.conditions.max_stamina);
<</script>>
/* Simulate */
<<include assignmentEngine>>
<<include dietEngine>>
<<include rulesEngine>>
<</nobr>><<nobr>>
<<set _temp = new Date($gameDate)>>
<<set _temp.setMinutes(_temp.getMinutes() - $_to_advance)>>
<<if (($gameDate - _temp) / (1000 * 60 * 60 * 24) gte 1) ||
(_temp.getDay() != $gameDate.getDay() && $gameDate.getHours() gte 7) ||
(_temp.getDay() == $gameDate.getDay() && $gameDate.getHours() gte 7 && _temp.getHours() lt 7)>>
<<set $player.mental_conditions.arousal = 0>>
<<for _key, _val range $characters>>
<<run _val.reset_limits()>>
<<set _val.conditions.stamina += 50 + _val.stats.strength>>
<<set _to_round = _key>>
<<include round>>
<</for>>
<</if>>
<<unset _temp>>
<<set _to_delete = []>>
<<for _idx, _to_simulate range $to_simulate>>
<<set $characters[_to_simulate].mental_conditions.anger += -10 / 1440 * $_to_advance>>
<<set $characters[_to_simulate].mental_conditions.sadness += -10 / 1440 * $_to_advance>>
<<set $characters[_to_simulate].mental_conditions.arousal += -30 / 1440 * $_to_advance>>
<<set $characters[_to_simulate].mental_conditions.discomfort += -30 / 1440 * $_to_advance>>
<<set $characters[_to_simulate].mental_conditions.illness += -10 / 1440 * $_to_advance>>
<<if _is_molesting>>
<<set _delta_suspicion = (100 - $player.stats.dexterity) / 120 * $_to_advance>>
<<if def _sus_mult>>
<<set _delta_suspicion *= _sus_mult>>
<</if>>
<<set $characters[_to_simulate].mental_conditions.suspicion += _delta_suspicion>>
<<else>>
<<set $characters[_to_simulate].mental_conditions.suspicion += -25 / 1440 * $_to_advance>>
<</if>>
<<set _to_round = _to_simulate>>
<<include round>>
<<if $characters[_to_simulate].mental_conditions.anger == 0 &&
$characters[_to_simulate].mental_conditions.sadness == 0 &&
$characters[_to_simulate].mental_conditions.arousal == 0 &&
$characters[_to_simulate].mental_conditions.discomfort == 0 &&
$characters[_to_simulate].mental_conditions.illness == 0 &&
$characters[_to_simulate].mental_conditions.suspicion == 0>>
<<set _to_delete.push(_to_simulate)>>
<</if>>
<</for>>
<<for _idx, _to_del range _to_delete>>
<<set $to_simulate.delete(_to_del)>>
<</for>>
<<unset _to_del>>
<<unset _to_delete>>
<</nobr>><<nobr>>
<<if $player.is_working || $player.is_slaving>>
<<set $_mult = 3>>
<<else>>
<<set $_mult = 1>>
<</if>>
<<if $player.is_outside>>
<<set $_mult *= 2>>
<</if>>
<<if (def _is_molesting && _is_molesting) ||
(def _is_fucking && _is_fucking)>>
<<set $_mult *= 5>>
<<if def _is_fucking && _is_fucking>>
<<if _sex_state.rape>>
/* Expend more energy when raping */
<<set $_mult *= 1.1>>
<</if>>
<</if>>
<</if>>
<<if $difficulty gt -1>>
<<set $_mult *= (1 + setup.randn_bm() / 10 * ($difficulty + 1))>>
<</if>>
<<if !$player.is_sleeping>>
/* Decay while not sleeping */
/* d Health = -100 / 1440 * 1[stamina == 0] dt (in minutes) */
<<if $player.conditions.stamina == 0>>
<<script>>
const mult = State.variables._mult;
var player = State.variables.player;
var _to_advance = State.variables._to_advance;
var delta_health = mult * -100 / 1440 * _to_advance;
player.conditions.health = player.conditions.health + delta_health;
<</script>>
<</if>>
/* d Stamina = (3 / 10 * strength - rest_momentum / 1440 * 300) / 1440 dt (in minutes) */
/* delta Stamina = delta_t * mult * ((3/10 * strength - C * rest_momentum) - C * delta_t / 2) / 1440 */
<<script>>
const mult = State.variables._mult;
var player = State.variables.player;
const rest_momentum = State.variables.rest_momentum;
let _to_advance = State.variables._to_advance;
const C = 200 / 1440;
var delta_stamina = mult * _to_advance * ((3/10 * player.stats.strength - C * rest_momentum) - C * _to_advance / 2) / 1440;
delta_stamina = delta_stamina.clamp(-1000, 0);
player.conditions.stamina = player.conditions.stamina + delta_stamina;
<</script>>
/* Accumulate time awake */
<<set $rest_momentum += $_to_advance>>
<<set $time_awake += $_to_advance>>
<<else>>
/* Recover while sleeping */
/* d Health = 3 * (3 / 10 * strength + 20) / 1440 dt */
<<script>>
const mult = State.variables._mult;
var player = State.variables.player;
var _to_advance = State.variables._to_advance;
var delta_health = mult * 3 * (3 / 10 * player.stats.strength + 20) / 1440 * _to_advance;
player.conditions.health = player.conditions.health + delta_health;
<</script>>
/* d Stamina = 3 * 50 / 1440 dt */
<<script>>
const mult = State.variables._mult;
var player = State.variables.player;
var _to_advance = State.variables._to_advance;
var delta_stamina = mult * 3 * 50 / 1440 * _to_advance;
player.conditions.stamina = player.conditions.stamina + delta_stamina;
<</script>>
<</if>>
/* Player death */
<<if $player.conditions.health lte 0>>
<<goto "deathMenu">>
<</if>>
<</nobr>>/*
Date & Time Widget Setup
*/
<<nobr>>
<<set
window.GameDays to [
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
];
window.GameMonths to [
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
];
/*
Below we have to use the multi-parameter version of the Date
constructor, rather than the date string version, because the
date string version treats a missing timezone offset as UTC.
While there are ways to determine players' timezone offsets,
so they could be added to a date string, it's more convenient
simply to use the multi-parameter constructor.
The point of this is so that you can simply initialize the game
world clock to whatever date and time you wish without having to
worry about the players' timezone offsets, while still ensuring
that they all see the same game world dates and times.
*/
/* params: year , month(0-based) , day , hour(24H) , minute [, second ] */
$gameDate to new Date(200, 1, 1, 12, 0); /* e.g. Mar 17, 2015 03:24 */
>>
/* Updates datetime element */
<<widget "updatetime">>
/* Update money as well (why not) */
<<script>>
var player = State.variables.player;
var gameDate = State.variables.gameDate;
var time_element;
if (State.temporary.is_molesting) {
time_element = $("#molest_datetime");
} else {
time_element = $("#datetime");
}
if (time_element.length) {
var temp = "<div id=\"datetime\">";
temp += setup.print_time12hr(gameDate);
temp += "<br>";
temp += setup.print_date(gameDate);
temp += "</div>";
time_element[0].innerHTML = temp;
}
var money_element = $("#money");
if (money_element.length) {
var temp = "<div id=\"money\">";
temp += "<b>Money</b>: ¤" + player.get_money() + "</div>";
money_element[0].innerHTML = temp;
}
<</script>>
<</widget>>
/*
Date & Time Advancement Widget Definitions
*/
/* Adds the specified number of minutes. */
<<widget "addmins">>
<<script>>
var to_add = State.variables.args[0];
State.variables.gameDate.setMinutes(State.variables.gameDate.getMinutes() + to_add);
State.variables._to_advance = to_add;
<</script>>
/* Simulate dynamics */
<<include slaveTraitDynamics>>
<<include conditionDynamics>>
<<include characterDynamics>>
<<include economyDynamics>>
/* Round values */
<<include round>>
/* Update time */
<<updatetime>>
<</widget>>
/* Adds the specified number of hours. */
<<widget "addhours">>
<<addmins `$args[0] * 60`>>
<</widget>>
/* Adds the specified number of days. */
<<widget "adddays">>
<<addhours `$args[0] * 24`>>
<</widget>>
/* Goes to next day. */
<<widget "advanceday">>
<<script>>
var cur_date = State.variables.gameDate;
var dest = new Date(cur_date.getTime());
if (cur_date.getHours() < 7) {
dest.setHours(7);
} else {
dest.setHours(dest.getHours() + 24);
dest.setHours(7);
}
dest.setMinutes(0);
var diff = (dest - cur_date) / (1000 * 60);
State.variables._to_advance = diff;
<</script>>
<<addmins $_to_advance>>
<</widget>>
/* Goes to the next week, Monday 7AM */
<<widget "advanceweek">>
<<script>>
let cur_date = State.variables.gameDate;
let dest = new Date(cur_date.getTime());
dest.setDate(dest.getDate() + 7 - cur_date.getDay());
dest.setHours(7);
dest.setMinutes(0);
let diff = (dest - cur_date) / (1000 * 60);
State.variables._to_advance = diff;
<</script>>
<<addmins $_to_advance>>
<</widget>>
/*
Date & Time Printing Widget Definitions
*/
/* Prints the current date ("{weekday} {month} {day}, {year}"). */
<<widget "date">>
<<print setup.print_date($gameDate)>>
<</widget>>
<<widget "year">>
<<print String.format("{3}",
GameDays[$gameDate.getDay()],
GameMonths[$gameDate.getMonth()],
$gameDate.getDate(),
$gameDate.getFullYear()
)>>
<</widget>>
/* Prints the current time (12H). */
<<widget "time12hr">>
<<print setup.print_time12hr($gameDate)>>
<</widget>>
/* Prints the current time (24H). */
<<widget "time24hr">>
<<if $gameDate.getHours() lt 10>>0<</if>><<print $gameDate.getHours()>>:
<<if $gameDate.getMinutes() lt 10>>0<</if>><<print $gameDate.getMinutes()>>
<</widget>>
<</nobr>><<set _year_start = new Date($gameDate.getFullYear(), 0, 0)>>
<<set _diff = $gameDate - _year_start>>
<<set _day = _diff / (1000 * 60 * 60 * 24)>>
<<for _key, _val range $commodities>>
<<if _val.type == "semi-stable">>
<<set _sigma = _val.stable_price * _val.sigma_ratio>>
<<set _mu = _sigma * Math.sin(2 * Math.PI / 356 * _day + _val.mu_phase) + _val.stable_price>>
<<set _theta = Math.exp(-1 * $difficulty)>>
<<set _days_left = $_to_advance / (60 * 24)>>
<<for _days_left gte 1 / 24>>
<<set $commodities[_key].price += setup.ou_step($commodities[_key].price, _theta, _mu, _sigma, 1/24)>>
<<set _days_left -= 1/24>>
<</for>>
<<set $commodities[_key].price += setup.ou_step($commodities[_key].price, _theta, _mu, _sigma, _days_left)>>
<<unset _theta>>
<<unset _mu>>
<<unset _sigma>>
<<unset _days_left>>
<</if>>
<</for>>
/* Simulate OU process of interest rate */
<<set _sigma = $economy.interest_rate.stable_rate * $economy.interest_rate.sigma_ratio>>
<<set _mu = _sigma * Math.sin(2 * Math.PI / 356 * _day + $economy.interest_rate.mu_phase) + $economy.interest_rate.stable_rate>>
<<set _theta = Math.exp(-1 * $difficulty)>>
<<set _days_left = $_to_advance / (60 * 24)>>
<<for _days_left gte 1 / 24>>
<<set $economy.interest_rate.rate += setup.ou_step($economy.interest_rate.rate, _theta, _mu, _sigma, 1/24)>>
<<set _days_left -= 1/24>>
<</for>>
<<set $economy.interest_rate.rate += setup.ou_step($economy.interest_rate.rate, _theta, _mu, _sigma, _days_left)>>
<<unset _theta>>
<<unset _mu>>
<<unset _sigma>>
<<unset _days_left>>
<<unset _year_start>>
<<unset _diff>>
<<unset _day>><<nobr>>
<<if $player.is_slave>>
<<if $player.is_slaving>>
<<set $_mult = 2>>
<<else>>
<<if !("hours_worked" in $player)>>
<<set $player.hours_worked = 0>>
<</if>>
<<if $player.is_sleeping>>
<<if ($difficulty == -2) ||
($difficulty == -1 && $player.hours_worked gte 1) ||
($player.hours_worked gte 4)>>
<<set $_mult = 0>>
<<set $_obedient_sleep = true>>
<<else>>
<<set $_mult = -1>>
<<set $_obedient_sleep = false>>
<</if>>
<<else>>
<<set $_mult = -1>>
<</if>>
<</if>>
<<if !$player.is_home>>
<<set $_mult = -1>>
<</if>>
<<if $difficulty gt -1>>
<<set $_mult *= (1 + setup.randn_bm() / 10 * ($difficulty + 1))>>
<</if>>
/* Apply sloth title */
<<if $player.titles.has("sloth")>>
<<set _obedience_mult = 0.5>>
<<else>>
<<set _obedience_mult = 1>>
<</if>>
<<if $player.is_home && $_mult != 0>>
/* mult = 2 if working else -1 */
/* d Obedience = mult * 10 + 1 / 10 * manipulation / 1440 dt (in minutes) */
<<script>>
const mult = State.variables._mult;
var player = State.variables.player;
var _to_advance = State.variables._to_advance;
var delta_obedience = (mult * 15 + 1 / 10 * player.get_status_prop("manipulation")) / 1440 * _to_advance;
delta_obedience *= State.temporary.obedience_mult;
player.slave_traits.obedience = Math.clamp(player.slave_traits.obedience + delta_obedience,
0, 100);
<</script>>
/* d Willpower = mult * - 15 + 1 / 5 * intelligence / 1440 dt (in minutes) */
<<script>>
const mult = State.variables._mult;
var player = State.variables.player;
var _to_advance = State.variables._to_advance;
var delta_willpower = (mult * -15 + 1/5 * player.stats.intelligence) / 1440 * _to_advance;
player.slave_traits.willpower = Math.clamp(player.slave_traits.willpower + delta_willpower,
0, 100);
<</script>>
<<elseif $_mult != 0>>
/* If player is outside Shintani cannot observe thus obedience does not drop */
<<script>>
const mult = State.variables._mult;
var player = State.variables.player;
var _to_advance = State.variables._to_advance;
var delta_willpower = (mult * -15 + 1/5 * player.stats.intelligence) / 1440 * _to_advance;
player.slave_traits.willpower = Math.clamp(player.slave_traits.willpower + delta_willpower,
0, 100);
<</script>>
<</if>>
<</if>>
<</nobr>><<set Config.saves.version = setup.VERSION>>
<<script>>
Config.saves.autosave = () => {
if (State.variables.lastSave == null) {
State.variables.lastSave = 0;
}
if (State.variables.lastSave >= State.variables.autoSaveFreq && setup.locations.has(passage())) {
State.variables.lastSave = 0;
return true
} else if (setup.locations.has(passage())) {
State.variables.lastSave += 1;
}
}
Config.history.maxStates = 1;
Save.onSave.add((save, details) => {
var gameDate = State.variables.gameDate;
var locations = setup.locations;
var player = State.variables.player;
var passage_name = "";
if (locations.has(passage())) {
passage_name = locations.get(passage()).name;
} else if (State.variables.in_menu) {
if (State.variables.last_visited != "undefined" && locations.has(State.variables.last_visited)) {
passage_name = locations.get(State.variables.last_visited).name;
}
}
save.title = setup.titleCase(player.first_name) + " | " +
passage_name + ": " +
setup.print_time12hr(gameDate) + ", " +
setup.print_date(gameDate) + " | Version " + setup.VERSION;
});
Save.onLoad.add((save) => {
if (setup.VERSION != save.version) {
let lock_id = LoadScreen.lock();
var str = "\
<<popover>><b>As the game is very new, using old saves is currently not officially \
supported (though it is technically built-in). Depending on the size of the last update, \
this may break your game.<br>\
<span class=\"fail\">MAKE SURE YOU ARE LOADING FROM A NEW WINDOW. DO NOT ATTEMPT TO LOAD FROM ANOTHER SAVE.</span><br>\
PLEASE BACK UP YOUR SAVE JUST IN CASE.</b>\
<br><br><b><h3>Mimus' auto-upgrade tool:</h3></b><br>\
";
try {
let save_data = save.state.history[save.state.index];
let added = [];
// Push in any game variables that don't exist
for (const [key, value] of Object.entries(State.variables)) {
if (!(key in save_data.variables)) {
save_data.variables[key] = clone(value);
added.push(key);
}
}
// Update status and location for pre 0.0.1.7
if ("has_access" in save_data.variables) {
str += "Updated access structure <br>";
let prev_access = save_data.variables.has_access;
prev_access.forEach(x => save_data.variables.locations[x].access = true);
delete save_data.variables.has_access;
}
if ("location_status" in save_data.variables && save_data.variables.locations.nipon.status == null) {
str += "Updated status structure <br>";
let prev_status = save_data.variables.location_status.nipon;
save_data.variables.locations.nipon.status = prev_status;
delete save_data.variables.location_status;
}
let updated = [];
// Recursive update function
let recursive_update = function(target, source, exclude=[], verbose=false) {
let updated = false;
if (!Array.isArray(target) && typeof target === 'object' && !UInv.isString(target) && !(target == null)) {
for (let key in source) {
if (exclude.includes(key)) {
continue;
}
if (verbose) {
alert(key);
}
if (!(key in target)) {
target[key] = clone(source[key]);
updated = true;
} else {
updated |= recursive_update(target[key], source[key], exclude);
}
}
}
return updated;
}
// Add in any characters except for those whom are removed
for (let char in State.variables.characters) {
if (!State.variables.characters[char].data.generated) {
if (!(char in save_data.variables.characters) && !(char in save_data.variables.removed_characters)) {
save_data.variables.characters[char] = clone(State.variables.characters[char]);
str += "Added in character " + char + "<br>";
}
if (char in save_data.variables.characters && recursive_update(save_data.variables.characters[char], State.variables.characters[char], ["data"])) {
updated.push(char);
}
}
}
// Update substructure recursively
for (const [key, value] of Object.entries(State.variables)) {
// Skip bag and characters
if (key == "UInvBags" || key == "characters") {
continue;
}
if (recursive_update(save_data.variables[key], value, ["data"])) {
updated.push(key)
}
}
// Specifically for 0.0.1.6
if (!("finances" in save_data.variables.player) ||
!("businesses" in save_data.variables.player.finances) ||
!("slaves" in save_data.variables.player.finances)) {
save_data.variables.player.finances = {
"total_earned": 0,
"slaves": {},
"businesses": {}
};
str += "Finances added to player. Assignments need to be reset for effect to take place.<br>"
}
// Delete any trash variables
let to_delete = [];
for (const [key, value] of Object.entries(save_data.variables)) {
if (!(key in State.variables)) {
to_delete.push(key);
}
}
to_delete.forEach(key => delete save_data.variables[key]);
// Specifically for bug in 0.0.1.7
save_data.variables.player.physical_traits.weight = 0;
// Specifically for 0.0.1.8, if loading then they've entered Shintani's
save_data.variables.locations.shintaniHome.data.entered = true;
// Specifically for 0.0.1.8.1, enable key binds
save_data.variables.enable_keybinds = true;
// Specificall for versions post 0.0.2
if (save_data.variables.locations.nipon.data == null) {
save_data.variables.locations.nipon.data = {"owner": "shintani_hiroyuki"};
} else if (save_data.variables.locations.nipon.data.owner == null) {
save_data.variables.locations.nipon.data.owner = "shintani_hiroyuki";
}
str += "Added in story variables: " + added.join(", ") + "<br>";
str += "Recursively updated story variables: " + updated.join(", ") + "<br>"
str += "Removed story variables: " + to_delete.join(", ") + "<br>";
// Update the version
str += "Version updated to " + setup.VERSION + " (not verified).<br>"
str += "This is not an error. Auto-migration suceeded. Please save to update changes."
} catch (ex) {
str += "FAILED. <br>Stack trace:<br>" + ex.stack;
}
str += "<</popover>>";
LoadScreen.unlock(lock_id);
$.wiki(str);
}
SimpleAudio.stop();
try {
if (SimpleAudio) {
if (typeof SimpleAudio.volume === 'function') {
SimpleAudio.volume(save.state.history[save.state.index].variables.volume);
} else {
SimpleAudio.volume = save.state.history[save.state.index].variables.volume;
}
} else {
throw new Error('Cannot access audio API.');
}
} catch (err) {
// fall back to the wikifier if we have to
console.error(err.message, err);
$.wiki('<<masteraudio volume ' + save.state.history[save.state.index].variables.volume + '>>');
}
});
<</script>>
<<preload "resources/images/backgrounds/cloth_border.png">>
<<preload "resources/images/backgrounds/cloth_rough.png">>
<<preload "resources/images/backgrounds/cloth.png">>
<<preload "resources/images/backgrounds/blackwood.jpg">>
/* Master volume */
<<set $volume = 100>>
/* Difficulty */
<<set $difficulty = 0>>
/* Text speed */
<<set $words_per_sec = 5.5>>
/* Whether or not the game as started */
<<set $enable_keybinds = false>>
/* Password */
<<set $testing_password = "password">>
/* How many passages until autosave */
<<set $autoSaveFreq = 10>>
/* Initliaze player */
<<include initPlayer>>
/* Health and stamina bars */
<<include initBars>>
/* Initialize keybinds */
<<include initKeybinds>>
/* Initialize locations */
<<include initLocations>>
/* Initialize audio sources */
<<include initAudio>>
/* Initialize Shintani's slaves */
<<include initCharacters>>
/* Initialize inventories */
<<include initInventories>>
/* Initialize quest object */
<<include initQuests>>
/* Initialize world prices for commodities */
<<include initEconomy>><<nobr>>
<<cacheaudio "bgm_intro_track" "resources/audio/music/Special - Intro.ogg">>
<<createplaylist "bgm_intro">>
<<track "bgm_intro_track">>
<</createplaylist>>
/* Shintani's home should be wistful */
<<cacheaudio "bgm_shintaniHome_track1" "resources/audio/music/World Explore - Deceptive Peace - Truegerischer Frieden.ogg">>
<<cacheaudio "bgm_shintaniHome_track2" "resources/audio/music/World Explore - In the Twilight - Im Zwielicht.ogg">>
<<cacheaudio "bgm_shintaniHome_track3" "resources/audio/music/World Explore - The Land Is Grey And Cold.ogg">>
<<createplaylist "bgm_shintaniHome">>
<<track "bgm_shintaniHome_track1">>
<<track "bgm_shintaniHome_track2">>
<<track "bgm_shintaniHome_track3">>
<</createplaylist>>
/* Nipon itself should be hopeful */
<<cacheaudio "bgm_nipon_track2" "resources/audio/music/City Explore - Home Of The Blessed.ogg">>
<<cacheaudio "bgm_nipon_track3" "resources/audio/music/City Explore - Homecoming.ogg">>
<<cacheaudio "bgm_nipon_track4" "resources/audio/music/City Explore - Lampman.ogg">>
<<cacheaudio "bgm_nipon_track5" "resources/audio/music/City Explore - Sunrise over the City.ogg">>
<<cacheaudio "bgm_nipon_track6" "resources/audio/music/City Explore - Trade Roads - Handelswege.ogg">>
<<createplaylist "bgm_nipon">>
<<track "bgm_nipon_track2">>
<<track "bgm_nipon_track3">>
<<track "bgm_nipon_track4">>
<<track "bgm_nipon_track5">>
<<track "bgm_nipon_track6">>
<</createplaylist>>
/* Fight and conflict playlist */
<<cacheaudio "bgm_conflict_track1" "resources/audio/music/Battle Theme - Bloodthirsty - Blutdurst.ogg">>
<<cacheaudio "bgm_conflict_track2" "resources/audio/music/Battle Theme - Bone Hunter - Knochenjaeger.ogg">>
<<cacheaudio "bgm_conflict_track3" "resources/audio/music/Battle Theme - Dust at the Horizon - Staub am Horizont.ogg">>
<<cacheaudio "bgm_conflict_track4" "resources/audio/music/Battle Theme - Prophet.ogg">>
<<createplaylist "bgm_conflict">>
<<track "bgm_conflict_track1">>
<<track "bgm_conflict_track2">>
<<track "bgm_conflict_track3">>
<<track "bgm_conflict_track4">>
<</createplaylist>>
/* Current playing main-track */
<<set $playing = "none">>
/* Whether or not to enable music */
<<set $enable_music = true>>
/* Sounds */
<<cacheaudio "wooden_door_sound" "resources/audio/sounds/wooden_door.wav">>
<<cacheaudio "wooden_container_sound" "resources/audio/sounds/wooden_container.wav">>
<<cacheaudio "coins_sound" "resources/audio/sounds/coins.wav">>
<<cacheaudio "quest_added_sound" "resources/audio/sounds/quest_add.mp3">>
<<cacheaudio "click_sound" "resources/audio/sounds/click.wav">>
<<cacheaudio "page_sound" "resources/audio/sounds/page_turn.wav">>
/* Sword sounds */
<<cacheaudio "sword_1_sound" "resources/audio/sounds/sword_1.wav">>
<<cacheaudio "sword_2_sound" "resources/audio/sounds/sword_2.wav">>
<<cacheaudio "sword_3_sound" "resources/audio/sounds/sword_3.wav">>
/* Sex sounds */
/* Moans */
<<for _i = 1; _i lte 50; _i++>>
<<cacheaudio `"moan" + _i` `"resources/audio/sounds/sex/moans/SWFMoan" + _i + ".wav"`>>
<</for>>
<</nobr>><<nobr>>
<<newmeter "player_health_bar" 1>>
<<label "Health (<<= setup.round2($player.conditions.health)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "player_stamina_bar" 1>>
<<label "Stamina (<<= setup.round2($player.conditions.stamina)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "player_reputation_bar" 0.5>>
<<label "Reputation (<<= Math.round($player.reputation)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "player_arousal_bar" 1>>
<<label "Arousal (<<= setup.round2($player.mental_conditions.arousal)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "player_dexterity_bar" 1>>
<<label "Dexterity (<<= setup.round2($player.stats.dexterity)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
/* Char bars */
/* Temporary object to remove error throwing */
<<set _char = {conditions: {health: 0, stamina: 0}}>>
<<newmeter "char_health_bar" 1>>
<<label "Health (<<= setup.round2(_char.conditions.health)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "char_stamina_bar" 1>>
<<label "Stamina (<<= setup.round2(_char.conditions.stamina)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "char_anger_bar" 1>>
<<label "Anger">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "char_arousal_bar" 1>>
<<label "Arousal">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "char_discomfort_bar" 1>>
<<label "Discomfort">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "char_suspicion_bar" 1>>
<<label "Suspicion">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "char_willpower_bar" 1>>
<<label "Willpower">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
/* Player slave bars */
<<newmeter "player_willpower_bar" 0>>
<<label "Willpower (<<= setup.round2($player.slave_traits.willpower)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "player_trust_bar" 0>>
<<label "Trust (<<= setup.round2($player.slave_traits.trust)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "player_obedience_bar" 0>>
<<label "Obedience (<<= setup.round2($player.slave_traits.obedience)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
/* Combat bars */
/* Temporary object to remove error throwing */
<<set _opponents = [
{conditions: {health: 0}}, {conditions: {health: 0}}, {conditions: {health: 0}}, {conditions: {health: 0}}
]>>
<<newmeter "enemy1Health" 1>>
<<label "Health (<<= setup.round2(_opponents[0].conditions.health)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "enemy2Health" 1>>
<<label "Health (<<= setup.round2(_opponents[1].conditions.health)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "enemy3Health" 1>>
<<label "Health (<<= setup.round2(_opponents[2].conditions.health)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "enemy4Health" 1>>
<<label "Health (<<= setup.round2(_opponents[3].conditions.health)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
/* Temporary object to remove error throwing */
<<set _party = [
{conditions: {health: 0}}, {conditions: {health: 0}}, {conditions: {health: 0}}, {conditions: {health: 0}}
]>>
<<newmeter "party1Health" 1>>
<<label "Health (<<= setup.round2(_party[0].conditions.health)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "party2Health" 1>>
<<label "Health (<<= setup.round2(_party[1].conditions.health)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "party3Health" 1>>
<<label "Health (<<= setup.round2(_party[2].conditions.health)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
<<newmeter "party4Health" 1>>
<<label "Health (<<= setup.round2(_party[3].conditions.health)>>)">>
<<colors "#e6dd9a" "#e6dd9a">>
<</newmeter>>
/* Generated rounded values for display */
<<include round>>
<</nobr>><<nobr>>
/* Dynamic list of characters that need to be simulated by gameclock engine */
<<set $to_simulate = new Set()>>
<<set $characters = {"shintani_hiroyuki": new setup.Character("shintani_hiroyuki", true, 80),
"himari_hironaka": new setup.Character("himari_hironaka", true, 60),
"mei_hironaka": new setup.Character("mei_hironaka", true, 20),
"jae_hironaka": new setup.Character("jae_hironaka", true, 40),
"lia_hiroyuki": new setup.Character("lia_hiroyuki", true, 80),
"emily_namm": new setup.Character("emily_namm", true, 50),
"yuki_seieki": new setup.Character("yuki_seieki", true, 55)}>>
<<set $removed_characters = []>>
/* Shintani */
<<set $characters.shintani_hiroyuki.set_properties(
new Date(200 - 35, 12, 9),
0,
"Shintani",
"Hiroyuki"
)>>
<<set $characters.shintani_hiroyuki.stats = {
'dexterity': 20,
'intelligence': 63,
'manipulation': 89,
'strength': 34,
'tact': 53
}>>
<<set $characters.shintani_hiroyuki.physical_traits = {
'beauty': 54,
'weight': 5,
'height': 175,
'eye_color': "brown",
'hair_color': "black",
'ethnicity': "japanese",
'skin_color': "light",
'hair_length': 15,
}>>
<<set $characters.shintani_hiroyuki.slave_traits.willpower = 100>>
<<set $characters.shintani_hiroyuki.status = "rich citizen">>
<<set $characters.shintani_hiroyuki.slaves = [
"himari_hironaka",
"mei_hironaka",
"jae_hironaka"
]>>
<<set $characters.shintani_hiroyuki.slave_traits.obedience = 30>>
<<set $characters.shintani_hiroyuki.skills.education = 70>>
/* Himari */
<<set $characters.himari_hironaka.set_properties(
new Date(200 - 23, 5, 3),
1,
"Himari",
"Hironaka",
true,
"shintani_hiroyuki"
)>>
<<set $characters.himari_hironaka.stats = {
'dexterity': 20,
'intelligence': 50,
'manipulation': 10,
'strength': 24,
'tact': 72
}>>
<<set $characters.himari_hironaka.physical_traits = {
'beauty': 80,
'weight': -8,
'height': 165,
'eye_color': "brown",
'hair_color': "black",
'ethnicity': "Japanese",
'skin_color': "very fair",
'hair_length': 40,
}>>
/* This is towards the player */
<<set $characters.himari_hironaka.slave_traits.trust = 0>>
<<set $characters.himari_hironaka.slave_traits.obedience = 30>>
<<set $characters.himari_hironaka.slave_traits.willpower = 100>>
<<set $characters.himari_hironaka.status = "high_slave">>
<<set $characters.himari_hironaka.skills.education = 70>>
/* Mei */
<<set $characters.mei_hironaka.set_properties(
new Date(200 - 21, 11, 23),
1,
"Mei",
"Hironaka",
true,
"shintani_hiroyuki"
)>>
<<set $characters.mei_hironaka.stats = {
'dexterity': 31,
'intelligence': 20,
'manipulation': 29,
'strength': 24,
'tact': 23
}>>
<<set $characters.mei_hironaka.physical_traits = {
'beauty': 60,
'weight': 2,
'height': 172,
'eye_color': "brown",
'hair_color': "black",
'ethnicity': "Chinese",
'skin_color': "fair",
'hair_length': 30,
}>>
<<set $characters.mei_hironaka.slave_traits.trust = 0>>
<<set $characters.mei_hironaka.slave_traits.obedience = 30>>
<<set $characters.mei_hironaka.slave_traits.willpower = 78>>
<<set $characters.mei_hironaka.status = "low_slave">>
<<set $characters.mei_hironaka.skills.education = 30>>
/* Jae */
<<set $characters.jae_hironaka.set_properties(
new Date(200 - 19, 10, 2),
1,
"Jae",
"Hironaka",
true,
"shintani_hiroyuki"
)>>
<<set $characters.jae_hironaka.stats = {
'dexterity': 5,
'intelligence': 10,
'manipulation': 78,
'strength': 15,
'tact': 12
}>>
<<set $characters.jae_hironaka.physical_traits = {
'beauty': 70,
'weight': -8,
'height': 151,
'eye_color': "green",
'hair_color': "blonde",
'skin_color': "light",
'ethnicity': "Korean",
'hair_length': 35,
}>>
<<set $characters.jae_hironaka.slave_traits.trust = 0>>
<<set $characters.jae_hironaka.slave_traits.obedience = 30>>
<<set $characters.jae_hironaka.slave_traits.willpower = 90>>
<<set $characters.jae_hironaka.status = "slave">>
<<set $characters.jae_hironaka.skills.education = 50>>
/* Lia */
<<set $characters.lia_hiroyuki.set_properties(
new Date(200 - 24, 11, 4),
1,
"Lia",
"Hiroyuki"
)>>
<<set $characters.lia_hiroyuki.stats = {
'dexterity': 20,
'intelligence': 76,
'manipulation': 32,
'strength': 22,
'tact': 76
}>>
<<set $characters.lia_hiroyuki.physical_traits = {
'beauty': 97,
'weight': -7,
'height': 160,
'eye_color': "blue",
'hair_color': "black",
'ethnicity': "japanese",
'skin_color': "pale",
'hair_length': 20,
}>>
<<set $characters.lia_hiroyuki.slave_traits.obedience = 50>>
<<set $characters.lia_hiroyuki.slave_traits.willpower = 100>>
<<set $characters.lia_hiroyuki.slave_traits.trust = 20>>
<<set $characters.lia_hiroyuki.status = "rich citizen">>
<<set $characters.lia_hiroyuki.skills.education = 90>>
/* Emily */
<<set $characters.emily_namm.set_properties(
new Date(200 - 26, 7, 22),
1,
"Emily",
"Namm"
)>>
<<set $characters.emily_namm.stats = {
'dexterity': 68,
'intelligence': 36,
'manipulation': 22,
'strength': 74,
'tact': 12
}>>
<<set $characters.emily_namm.physical_traits = {
'beauty': 58,
'weight': 7,
'height': 160,
'eye_color': "brown",
'hair_color': "light brown",
'ethnicity': "caucasian",
'skin_color': "olive"
}>>
<<set $characters.emily_namm.slave_traits.obedience = 30>>
<<set $characters.emily_namm.slave_traits.willpower = 100>>
<<set $characters.emily_namm.slave_traits.trust = 0>>
<<set $characters.emily_namm.status = "citizen">>
<<set $characters.emily_namm.skills.education = 70>>
/* Yuki */
<<set $characters.yuki_seieki.set_properties(
new Date(200 - 21, 1, 16),
1,
"Yuki",
"Seieki"
)>>
<<set $characters.yuki_seieki.stats = {
'dexterity': 41,
'intelligence': 62,
'manipulation': 68,
'strength': 26,
'tact': 67
}>>
<<set $characters.yuki_seieki.physical_traits = {
'beauty': 68,
'weight': 6,
'height': 154,
'eye_color': "brown",
'hair_color': "black",
'ethnicity': "japanese",
'skin_color': "pale"
}>>
<<set $characters.yuki_seieki.slave_traits.obedience = 30>>
<<set $characters.yuki_seieki.slave_traits.willpower = 100>>
<<set $characters.yuki_seieki.slave_traits.trust = 0>>
<<set $characters.yuki_seieki.status = "citizen">>
<<set $characters.yuki_seieki.skills.education = 80>>
<<set $characters.yuki_seieki.sex_fetishes.cum = 80>>
<<set $characters.yuki_seieki.sex_prefs.oral = 80>>
<<set $characters.yuki_seieki.sex_ranges.hate_love_men = 80>>
<</nobr>><<set $commodities = {
"gold": {
"name": "Gold Ingots",
"type": "semi-stable",
"stable_price": 500,
"price": 500,
"mu_phase": 0,
"sigma_ratio": 0.1
},
"silver": {
"name": "Silver Ingots",
"type": "semi-stable",
"stable_price": 200,
"price": 200,
"mu_phase": 0.01,
"sigma_ratio": 0.15
},
"iron": {
"name": "Iron Ingots",
"type": "semi-stable",
"stable_price": 20,
"price": 20,
"mu_phase": 1,
"sigma_ratio": 0.12
}
}>>
<<set $economy = {
"interest_rate": {
"rate": 0.03,
"stable_rate": 0.03,
"mu_phase": 0.01,
"sigma_ratio": 0.05,
}
}>><<nobr>>
<<set $equities = {
"SOS": {
"name": "Slave Owner Shares",
"type": "stochastic",
"price": 100,
"sigma": 12
}
"TUS": {
"name": "Trade Union Shares",
"type": "stochastic",
"price": 200,
"sigma": 10
},
}>>
<</nobr>><<nobr>>
/* Initialize player inventory */
<<set $player.inventory = "inventory">>
<<run UInv.CreateBag("inventory")>>
<<run UInv.SetBagPropertyValue("inventory", "maxCarryWeight", $player.stats.strength)>>
/* Initialize character inventories (no max carry weight) */
<<for _key, _val range $characters>>
<<set _val.inventory = _val.key>>
<<run UInv.CreateBag(_val.key)>>
<</for>>
<</nobr>><<nobr>>
<<set $last_visited = "">>
<<set $enable_menu = false>>
<<on "keydown">>
<<which 67>>
<<if $enable_keybinds>>
/* Key binding to see controls (C) */
<<script>>Dialog.close();<</script>>
<<popover>>
<<include controls>>
<</popover>>
<</if>>
<<which 69>>
/* Key binding to go to character menu (E) */
<<script>>Dialog.close();<</script>>
<<if $enable_menu && $enable_keybinds>>
<<if !$in_menu>>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto playerMenu>>
<<elseif passage() != "playerMenu">>
<<goto playerMenu>>
<<else>>
<<set $in_menu = false>>
<<goto $last_visited>>
<<set $last_visited = "">>
<</if>>
<</if>>
<<which 81>>
<<if $enable_keybinds>>
/* Key binding for quest journal (Q) */
<<script>>Dialog.close();<</script>>
<<popover>>
<<include questMenu>>
<</popover>>
<</if>>
<<which 83>>
<<if $enable_keybinds>>
/* Key binding for saves (S) */
<<if $enable_menu>>
<<ui "saves">>
<</if>>
<</if>>
<<which 84>>
<<if $enable_keybinds>>
/* Key binding to see tutorial for passage (T) */
<<script>>Dialog.close();<</script>>
<<if def _shopping && _shopping>>
<<popover>>
<<include shoppingTutorial>>
<</popover>>
<<elseif def _combat && _combat>>
<<popover>>
<<include combatTutorial>>
<</popover>>
<<elseif def _sex_state>>
<<popover>>
<<include sexTutorial>>
<</popover>>
<<elseif def _tutorial && tale.has(_tutorial)>>
<<popover>>
<<include `_tutorial`>>
<</popover>>
<<elseif tale.has(passage() + "Tutorial")>>
<<popover>>
<<include `passage() + "Tutorial"`>>
<</popover>>
<</if>>
<</if>>
<<which 27>>
/* Key binding to go to save and settings menu (ESC / X) */
<<script>>Dialog.close();<</script>>
<<if $enable_menu && $enable_keybinds>>
<<if !$in_menu>>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto settingsMenu>>
<<elseif passage() != "settingsMenu">>
<<goto settingsMenu>>
<<else>>
<<set $in_menu = false>>
<<goto $last_visited>>
<<set $last_visited = "">>
<</if>>
<</if>>
<<which 88>>
/* Key binding to go to save and settings menu (ESC / X) */
<<script>>Dialog.close();<</script>>
<<if $enable_menu && $enable_keybinds>>
<<if !$in_menu>>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto settingsMenu>>
<<elseif passage() != "settingsMenu">>
<<goto settingsMenu>>
<<else>>
<<set $in_menu = false>>
<<goto $last_visited>>
<<set $last_visited = "">>
<</if>>
<</if>>
<</on>>
/* Click listener for speeding up dialogue */
<<on "click">>
<<if def _in_dialogue && _in_dialogue && def _timeout_id>>
<<run triggerTimeout(_timeout_id)>>
<</if>>
<</on>>
<</nobr>><<nobr>>
/* Set of locations the player has access to */
<<set _has_access = [
"shintaniHome",
"niponAcademy",
"niponArena",
"niponBarracks",
"niponMedicBay",
"niponCentralDocks",
"solBrothel",
"niponTownHall",
"yukisGourmet",
"niponMarket",
"niponAuctionHouse",
"niponBlacksmith",
"niponFarms",
"niponMarketDocks",
"niponMines",
"niponStalls",
"niponTheater",
"niponTradeUnion",
"niponSlums",
"niponCampGrounds",
"divineTouchBrothel",
"sonderVille",
"valeCommunity"
]>>
/* Location data */
<<set $locations = {}>>
<<for _idx, _val range setup.locations.get_all()>>
<<set $locations[_val] = {
"access": _has_access.contains(_val),
"data": {}
}>>
<</for>>
<<set $locations["nipon"].status = "low_slave">>
<<set $locations["nipon"].data.owner = "shintani_hiroyuki">>
<</nobr>>/* Player dictionary to store information */
<<set $player = new setup.Character("player")>>
/* Player titles */
<<set $player['titles'] = new Set()>>
/* Player conditions */
<<set _base_cond = 100>>
<<for _i = 0; _i lt setup.CONDITIONS.length; _i++>>
<<set $player['conditions']["max_" + setup.CONDITIONS[_i]] = _base_cond>>
<<set $player['conditions'][setup.CONDITIONS[_i]] = _base_cond>>
<</for>>
/* Player stats */
<<set _base_stat = 10>>
<<for _i = 0; _i lt setup.STATS.length; _i++>>
<<set $player['stats'][setup.STATS[_i]] = _base_stat>>
<</for>>
/* Player skills */
<<set _base_skill = 5>>
<<for _i = 0; _i lt setup.SKILLS.length; _i++>>
<<set $player['skills'][setup.SKILLS[_i]] = _base_skill>>
<</for>>
<<for _i = 0; _i lt setup.SEX_SKILLS.length; _i++>>
<<set $player['sex_skills'][setup.SEX_SKILLS[_i]] = _base_skill>>
<</for>>
/* Whether or not we are a slave */
<<set $player.is_slave = true>>
/* Player slave dynamics */
<<for _i = 0; _i lt setup.SLAVE_TRAITS.length; _i++>>
<<set $player.slave_traits[setup.SLAVE_TRAITS[_i]] = 2 * _base_stat>>
<</for>>
/* Whether or not player is sleeping */
<<set $player.is_sleeping = false>>
/* Whether or not player is working */
<<set $player.is_working = false>>
/* Whether or not the player is slaving */
<<set $player.is_slaving = false>>
/* Whether or not the player is home */
<<set $player.is_home = false>>
/* Whether or not the player is outside */
<<set $player.is_outside = false>>
/* Time awake */
<<set $rest_momentum = 0>>
<<set $time_awake = 0>>
/* Hours worked per day */
<<set $player.hours_worked = 0>>
/* Player slaves */
<<set $player.slaves = []>>
/* Player finance tracking */
<<set $player.finances["businesses"] = {}>>
<<set $player.finances["slaves"] = {}>>
/* Player book reading progress */
<<set $player.books = {}>>
<<for _key, _val range setup.books>>
<<set $player.books[_key] = 0>>
<</for>>
<<set $player.physical_traits.weight = 0>>
<<set $player.physical_traits.beauty = 0>>
/* Player party */
<<set $player.party = []>>
/* Location of player's home */
<<set $player.home = "shintaniHome">>
/* Player Home Status */
<<set $player_home = {
"shintaniHome": null,
"liasTower": {}
}>>
<<for _key, _val range setup.playerHome>>
<<if _val == null>>
<<continue>>
<</if>>
<<set $player_home[_key] = {}>>
<<for _sub_key, _sub_val range setup.playerHome[_key]>>
<<set $player_home[_key][_sub_key] = 0>>
<</for>>
<</for>><<nobr>>
<<set $quest_journal = {"ongoing": [], "completed": [], "failed": []}>>
<<set $quests = {}>>
<<for _key, _val range setup.quests>>
<<set $quests[_key] = {
"stage": 0,
"added": false,
"data": {}
}>>
<</for>>
/* Phase of the game */
<<set $phase = 1>>
<</nobr>><<nobr>>
/* Add in stat and condition changes from titles */
<<for _i, _title range $player.titles>>
<<for _key, _val range setup.titles[_title]['stat_changes']>>
<<set $player.stats[_key] += _val>>
<</for>>
<<for _key, _val range setup.titles[_title]['condition_changes']>>
<<set $player.conditions[_key] += _val>>
<<set $player.conditions["max_" + _key] += _val>>
<</for>>
<<for _key, _val range setup.titles[_title]['skill_changes']>>
<<set $player.skills[_key] += _val>>
<</for>>
<</for>>
<div id="background" class="paper_border notext">
<div class="main container threeCol twoRow">
<div class="subbackground" style="grid-row: 1 / span 2; grid-column: 1">
<center>
<h3 style="margin-bottom: 0; padding-bottom: 0">$player['first_name'] Hironaka</h3>
<<if $player['last_name'] != "Hironaka">>
<span style="font-size: smaller">(<<= $player['last_name']>>)</span>
<</if>>
</center>
<hr>
<div class="container twoCol">
<div style="text-align: left; margin-left: 20px">
Sex <br>
Age <br>
<<for _i = 0; _i lt setup.CONDITIONS.length; _i++>>
<<= setup.titleCase(setup.CONDITIONS[_i])>>
<br>
<</for>>
<br>
<<for _i = 0; _i lt setup.STATS.length; _i++>>
<<= setup.titleCase(setup.STATS[_i])>>
<br>
<</for>>
</div>
<div style="text-align: right; margin-right: 20px">
<<if $player.gender == 0>>
Male
<<else>>
Female
<</if>> <br>
<<= $player.age()>> <br>
<<for _i = 0; _i lt setup.CONDITIONS.length; _i++>>
<<= $player.conditions[setup.CONDITIONS[_i]].toString().padStart(3, '\u2000')>>
<br>
<</for>>
<br>
<<for _i = 0; _i lt setup.STATS.length; _i++>>
(<<= setup.show_change(10, $player.stats[setup.STATS[_i]])>>)
<<= $player.stats[setup.STATS[_i]].toString().padStart(3, '\u2000')>>
<br>
<</for>>
</div>
</div>
<center>Titles
<hr>
<div id="titles"></div>
/* Prints all titles and assigns a unique div id to them */
<<set $done_setup = false>>
<<script>>
setTimeout(function(){
var html = "";
var titles = Array.from(State.variables.player.titles);
for (var i = 0; i < titles.length; i++) {
html += ("\
<div id=\"char_" + titles[i] + "\" class=\"tooltip\">" +
setup.titleCase(titles[i])
+ "</div><br>\
");
}
document.getElementById("titles").innerHTML = html;
State.variables.done_setup = true;
}, 1);
<</script>>
/* Creates artificial event-listener for setup of script above */
<<repeat 10ms>>
<<if $done_setup>>
<<for _idx, _title range $player.titles>>
<<capture _title>>
<<script>>
var title = State.temporary.title;
$("#char_" + title).click(
function(){
State.temporary.selected_title = title;
$.wiki("<<popover>><<include titleTutorial>><</popover>>")
}
);
<</script>>
<</capture>>
<</for>>
<<stop>>
<<unset $done_setup>>
<</if>>
<</repeat>>
</center>
</div>
<<set _difficulties = ["Very Easy", "Easy", "Normal", "Hard", "Very Hard"]>>
<<set _contents = ["Economic", "Domestic", "Sexual"]>>
<<set _selected_difficulty = _difficulties[$difficulty + 2]>>
<<set _selected_content = _contents[$tasks]>>
<div id="finalization_summary" class="subbackground" style="grid-row: 1 / span 1; grid-column: 2 / span 2">
<div class="textpassage" style="margin-top: 20px; margin-bottom: 20px">
You are a
<<if $player.gender == 0>>
man
<<else>>
woman
<</if>> of age <<= $player.age()>> who is <<= setup.get($player, "height")>>cm tall with
<<= setup.get($player, "hair_color")>> hair and <<= setup.get($player, "eye_color")>> eyes.
You are ethnically <<= setup.get($player, "ethnicity")>>. You are set to be a slave serving under
//Shintani Hiroyuki// in
<<if $difficulty == -1>>
an
<<else>>
a
<</if>>
''_selected_difficulty'' world in the settlement of //Nipon// where the focus is ''_selected_content''
slavery.
<<for _idx, _title range $player.titles>>
<br><br>
<<= setup.titles[_title].preposition>> <b><<= setup.titleCase(_title)>></b>,
<<= setup.titles[_title].flavor_text>>
<</for>>
</div>
</div>
<div class="subbackground" style="grid-row: 2 / span 1; grid-column: 2 / span 2">
<center><h3>Game Settings</h3>
Difficulty: _selected_difficulty
<br>
Starting Content: _selected_content
<br><br><br>
<center>
<<button "Confirm" shintaniHome>>
/* Stop playing intro music */
<<audio ":all" stop>>
<<set $enable_keybinds = true>>
/* Initialize things that depend on the player */
<<run setup.init_influence()>>
<<set $phase = 1>>
<</button>>
<<button "Reset" phase1Intro1>><</button>>
</center>
</center>
</div>
</div>
</div>
<</nobr>><<nobr>>
<center id="logo" style="display: none">
<img class="logo" src="resources/images/Mimus Studios-logos_white_presents.png">
</center>
<h1 id="title" class="logo">Free Cities: Origins</h1>
/* Reset player to base state */
<<include initPlayer>>
/* Reset locations and data to base state */
<<include initLocations>>
/* Reset characters to base state */
<<include initCharacters>>
/* Reset quests */
<<include initQuests>>
/* Reset commodities */
<<include initEconomy>>
<<playlist "bgm_intro" loop shuffle play>>
<div id="background" class="paper_border" style="display: none">
<center><h1>In the Beginning</h1></center>
<p class="textpassage">
With the crumbling of sea walls and destruction of major infrastructure, the growing fear of
annihilation strengthened between the major powers. All it took was one misjudged detonation
for the tenents of mutually assured destruction to get thrown out the window. Alliances that
were formed in the golden-age of humanity saw their last signs of life, as the black clouds
of soot clouded the atmosphere and chilled the earth, it was as if time itself was at a
standstill.
</p>
<p class="textpassage">
From these shattered nations arose settlements that were independantly managed by either luck,
fortune, or talent. These settlements were terrible excuses for societies, often more dangerous
than the shanky slums that dotted the world. This is the world you find yourself in; one of despair,
starvation, and fear.
</p>
<p class="textpassage"><div class="tooltip">How bad was it?
<span class="tooltiptext right" style="top: -170%">
Determines the difficulty of the game as well as the predictability. An easier game will have
less randomness as well as some bonuses while a harder game will have less predictability
and some penalities.
</span>
</div></p>
<br>
<center class="option">
<<button "It was barely noticable" phase1Intro2>><<set $difficulty = -2>><</button>>
<<button "It was not that bad" phase1Intro2>><<set $difficulty = -1>><</button>>
<<button "It was as bad as they say" phase1Intro2>><<set $difficulty = 0>><</button>>
<<button "It was a bit worse" phase1Intro2>><<set $difficulty = 1>><</button>>
<<button "It was way worse" phase1Intro2>><<set $difficulty = 2>><</button>>
</center>
</div>
<<script>>
setTimeout(function() {
$("#logo").fadeIn(2000);
$("#logo").fadeOut(1000);
setTimeout(function() {
$("#title").fadeIn(2000);
$("#title").fadeOut(1000);
setTimeout(function() {
$("#background").fadeIn(2000);
}, 3000);
}, 3000);
}, 10);
<</script>>
<</nobr>><<nobr>>
<div id="background" class="paper_border">
<center><h1>But then There Came</h1></center>
<p class="textpassage">
A crack in the cold ashen dirt allowing a sprout of hope to emerge. You are a
<<cycle "$player.gender">>
<<option "man" 0 selected>>
<<option "woman" 1>>
<</cycle>>
who found yourself amid this chaotic world as a
<<cycle "$player.birthdate">>
<<option "young" `new Date(200 - 18, 1, 1, 12, 0)` selected>>
<<option "mid" `new Date(200 - 30, 1, 1, 12, 0)`>>
<<option "old" `new Date(200 - 45, 1, 1, 12, 0)`>>
<</cycle>>
<span class="tooltip">aged
<span class="tooltiptext bottom">
Young age favors ability to learn while old age favors higher intellect and respect.
</span>
</span> person of interest. As you stumble across the land in search of yourself, you
think back and remember the teachings of your long deceased relatives. They not only
taught you about the world, but also set you up for your next journey in life.
</p>
<p class="textpassage">
<<link "They were scholars who studied the vast developing cultures of the world." phase1Intro3>>
<<set $player['titles'].add('past_scholar')>>
<</link>>
<br>
<<link "They were slavers who saved and reveled in the fates of the less fortunate." phase1Intro3>>
<<set $player['titles'].add('past_slaver')>>
<</link>>
<br>
<<link "They were mercenaries who only looked out for their pockets and family." phase1Intro3>>
<<set $player['titles'].add('past_mercenary')>>
<</link>>
<br>
<<link "They were slaves who did anything to avoid the wrath of their masters." phase1Intro3>>
<<set $player['titles'].add('past_slave')>>
<</link>>
<br>
<<link "They were fallen royalty from the bygones of past national states." phase1Intro3>>
<<set $player['titles'].add('past_royal')>>
<</link>>
</p>
</div>
<</nobr>><<nobr>>
<div id="background" class="paper_border">
<center><h1>You Reflect</h1></center>
<p class="textpassage">
And your mind fills with images of who you are. You recall that in this world every part of
who you are is not only tested, but constantly judged. The humans of the world, without any
larger meaning, cling onto anything that could differentiate them from others. This had led,
for example, to rampant racism, bandit gangs who only admit people with blonde hair, and
persecution against people with green eyes. Among this reality of indiscriminate discrimination,
who are you?
</p>
<br>
<div class="container twoCol" style="row-gap: 5%;">
<center>''Height (cm)''</center>
<center>''Hair Color''</center>
<<textbox "$player.physical_traits.height" "170">>
<<textbox "$player.physical_traits.hair_color" "Brown">>
<center>''Eye Color''</center>
<center>''Ethnicity''</center>
<<textbox "$player.physical_traits.eye_color" "Brown">>
<<textbox "$player.physical_traits.ethnicity" "Stateless">>
</div>
<br><br><br><br>
<center>
<<button "Next">>
<<set _success = true>>
<<if Number.isInteger(Number($player.physical_traits.height))>>
<<set $player.physical_traits.height = Number($player.physical_traits.height)>>
<<if $player.physical_traits.height lte 0>>
<<set _success = false>>
<</if>>
<<else>>
<<set _success = false>>
<</if>>
<<set $player.physical_traits.hair_color = $player.physical_traits.hair_color.trim().toLowerCase()>>
<<set $player.physical_traits.eye_color = $player.physical_traits.eye_color.trim().toLowerCase()>>
<<set $player.physical_traits.ethnicity = $player.physical_traits.ethnicity.trim().toLowerCase()>>
<<if $player.physical_traits.hair_color.length == 0 ||
$player.physical_traits.eye_color.length == 0 ||
$player.physical_traits.ethnicity.length == 0>>
<<set _success = false>>
<</if>>
<<if _success>>
<<run Engine.play("phase1Intro4")>>
<<else>>
<<notify>>
Invalid values!
<</notify>>
<</if>>
<</button>>
</center>
</div>
<</nobr>><<nobr>>
<div id="background" class="paper_border">
<center><h1>The Spark in You Shined</h1></center>
<p class="textpassage">
Brighter than the simplicity of your upbringing. While you know it is your actions that determines
who you are, unbeknownst to you, you carry with you the fate of humanity. What do you get in exchange
for carrying such a burden? (Choose up to two).
</p>
<<set _titles_to_add = []>>
<<set _num_selected = 0>>
<div id="attribute_selection">
<div class="subbackground">
''Hearty''<br>
+10 Health<br>
+5 Stamina<br>
@@#1;<<button "Select">>
<<addclass "#1 button" "selected">>
<<run $("#1 button").prop("disabled", true)>>
<<set _titles_to_add.push("hearty")>>
<<set _num_selected += 1>>
<<if _num_selected gte 2>>
/* Disables all buttons */
<<for _i = 1; _i lte 10; _i++>>
<<addclass `"#" + _i + " button"` "disabled">>
<<run $("#" + _i + " button").prop("disabled", true)>>
<</for>>
<</if>>
<<removeclass `"#reset button"` "disabled">>
<<run $("#reset button").prop("disabled", false)>>
<</button>>@@
</div>
<div class="subbackground">
''Nimble''<br>
+5 Dexterity<br>
-5 Stamina<br>
@@#2;<<button "Select">>
<<addclass "#2 button" "selected">>
<<run $("#2 button").prop("disabled", true)>>
<<set _titles_to_add.push("nimble")>>
<<set _num_selected += 1>>
<<if _num_selected gte 2>>
<<for _i = 1; _i lte 10; _i++>>
<<addclass `"#" + _i + " button"` "disabled">>
<<run $("#" + _i + " button").prop("disabled", true)>>
<</for>>
<</if>>
<<removeclass `"#reset button"` "disabled">>
<<run $("#reset button").prop("disabled", false)>>
<</button>>@@
</div>
<div class="subbackground">
''Silver Tongued''<br>
+2 Manipulation<br>
+2 Tact<br>
@@#3;<<button "Select">>
<<addclass "#3 button" "selected">>
<<run $("#3 button").prop("disabled", true)>>
<<set _titles_to_add.push("silver_tongued")>>
<<set _num_selected += 1>>
<<if _num_selected gte 2>>
<<for _i = 1; _i lte 10; _i++>>
<<addclass `"#" + _i + " button"` "disabled">>
<<run $("#" + _i + " button").prop("disabled", true)>>
<</for>>
<</if>>
<<removeclass `"#reset button"` "disabled">>
<<run $("#reset button").prop("disabled", false)>>
<</button>>@@
</div>
<div class="subbackground">
''Sharpshooter''<br>
+5 Ranged<br><br>
@@#4;<<button "Select">>
<<addclass "#4 button" "selected">>
<<run $("#4 button").prop("disabled", true)>>
<<set _titles_to_add.push("sharpshooter")>>
<<set _num_selected += 1>>
<<if _num_selected gte 2>>
<<for _i = 1; _i lte 10; _i++>>
<<addclass `"#" + _i + " button"` "disabled">>
<<run $("#" + _i + " button").prop("disabled", true)>>
<</for>>
<</if>>
<<removeclass `"#reset button"` "disabled">>
<<run $("#reset button").prop("disabled", false)>>
<</button>>@@
</div>
<div class="subbackground">
''Curious''<br>
+2 Intelligence<br>
+2 Tact<br>
@@#5;<<button "Select">>
<<addclass "#5 button" "selected">>
<<run $("#5 button").prop("disabled", true)>>
<<set _titles_to_add.push("curious")>>
<<set _num_selected += 1>>
<<if _num_selected gte 2>>
<<for _i = 1; _i lte 10; _i++>>
<<addclass `"#" + _i + " button"` "disabled">>
<<run $("#" + _i + " button").prop("disabled", true)>>
<</for>>
<</if>>
<<removeclass `"#reset button"` "disabled">>
<<run $("#reset button").prop("disabled", false)>>
<</button>>@@
</div>
<div class="subbackground">
''Lost Knowledge''<br>
Start with knowledge of the lost tongues<br>
@@#6;<<button "Select">>
<<addclass "#6 button" "selected">>
<<run $("#6 button").prop("disabled", true)>>
<<set _titles_to_add.push("lost_knowledge")>>
<<set _num_selected += 1>>
<<if _num_selected gte 2>>
<<for _i = 1; _i lte 10; _i++>>
<<addclass `"#" + _i + " button"` "disabled">>
<<run $("#" + _i + " button").prop("disabled", true)>>
<</for>>
<</if>>
<<removeclass `"#reset button"` "disabled">>
<<run $("#reset button").prop("disabled", false)>>
<</button>>@@
</div>
<div class="subbackground">
''Well Connected''<br>
-50% spread when trading commodities<br>
@@#7;<<button "Select">>
<<addclass "#7 button" "selected">>
<<run $("#7 button").prop("disabled", true)>>
<<set _titles_to_add.push("well_connected")>>
<<set _num_selected += 1>>
<<if _num_selected gte 2>>
<<for _i = 1; _i lte 10; _i++>>
<<addclass `"#" + _i + " button"` "disabled">>
<<run $("#" + _i + " button").prop("disabled", true)>>
<</for>>
<</if>>
<<removeclass `"#reset button"` "disabled">>
<<run $("#reset button").prop("disabled", false)>>
<</button>>@@
</div>
<div class="subbackground">
''Sloth''<br>
Lose and gain obedience twice as slow<br>
@@#8;<<button "Select">>
<<addclass "#8 button" "selected">>
<<run $("#8 button").prop("disabled", true)>>
<<set _titles_to_add.push("sloth")>>
<<set _num_selected += 1>>
<<if _num_selected gte 2>>
<<for _i = 1; _i lte 10; _i++>>
<<addclass `"#" + _i + " button"` "disabled">>
<<run $("#" + _i + " button").prop("disabled", true)>>
<</for>>
<</if>>
<<removeclass `"#reset button"` "disabled">>
<<run $("#reset button").prop("disabled", false)>>
<</button>>@@
</div>
<div class="subbackground">
''Thief''<br>
Find more loot when stealing<br>
@@#9;<<button "Select">>
<<addclass "#9 button" "selected">>
<<run $("#9 button").prop("disabled", true)>>
<<set _titles_to_add.push("thief")>>
<<set _num_selected += 1>>
<<if _num_selected gte 2>>
<<for _i = 1; _i lte 10; _i++>>
<<addclass `"#" + _i + " button"` "disabled">>
<<run $("#" + _i + " button").prop("disabled", true)>>
<</for>>
<</if>>
<<removeclass `"#reset button"` "disabled">>
<<run $("#reset button").prop("disabled", false)>>
<</button>>@@
</div>
<div class="subbackground">
''Night Fox''<br>
-20% likelyhood to get caught molesting<br>
@@#10;<<button "Select">>
<<addclass "#10 button" "selected">>
<<run $("#10 button").prop("disabled", true)>>
<<set _titles_to_add.push("night_fox")>>
<<set _num_selected += 1>>
<<if _num_selected gte 2>>
<<for _i = 1; _i lte 10; _i++>>
<<addclass `"#" + _i + " button"` "disabled">>
<<run $("#" + _i + " button").prop("disabled", true)>>
<</for>>
<</if>>
<<removeclass "#reset button" "disabled">>
<<run $("#reset button").prop("disabled", false)>>
<</button>>@@
</div>
</div>
<center class="fiveQuarters">
<br>
<<disable>>
@@#reset;<<button "Reset">>
/* Removes titles */
<<set _titles_to_add = []>>
<<set _num_selected = 0>>
<<for _i = 1; _i lte 10; _i++>>
/* Enables all buttons */
<<removeclass `"#" + _i + " button"` "disabled">>
<<run $("#" + _i + " button").prop("disabled", false)>>
/* Remove selection */
<<removeclass `"#" + _i + " button"` "selected">>
<</for>>
<<addclass "#reset button" "disabled">>
<<run $("#reset button").prop("disabled", true)>>
<</button>>@@
<</disable>>
@@#next;<<button "Next" phaseSelection>>
<<for _idx, _title range _titles_to_add>>
<<set $player.titles.add(_title)>>
<</for>>
<<unset _titles_to_add>>
<<unset _num_selected>>
<</button>>@@
</center>
</div>
<</nobr>><<nobr>>
<div id="background" class="paper_border">
<center><h1>And so You Pushed</h1></center>
<p class="textpassage">
Forwards into the vast world. Despite the notion that you are sailing the winds of
fate, no main character has ever been without adversity. This is the excuse you muster up
as you find yourself without shelter and parched in the Great Desert. As vultures begin
to circle overhead, you see a man approach whose porcelain white skin reflects a nobility
that should be long gone in this world.
</p>
<p class="textpassage">
Through your blurry vision you could barely make out
<<if $player['titles'].has('past_scholar')>>
his features. You thought it was impossible, as you've learned in your extensive
past studies that they had all been wiped out, but a man of japanese descent now stands
in front of you.
<<elseif $player['titles'].has('past slaver')>>
his whip slighting poking out of his holder on his right hip. Normally you would
be glad to see someone who hails from the same background as you, but you realize
that your current presentation might lead to unintended consequences. Apprehension
fills you as this man now stands next to you.
<<elseif $player['titles'].has('past merc')>>
the glimmer of some gold poking out from a pouch fastened to his belt. Normally
this would be prime clientele that would provide the coin to feed your family
for a whole fortnight, but you realize that you are in no position to make such
an offer. He now stands next to you.
<<elseif $player['titles'].has('past slave')>>
his whip slighting poking out of his holder on his right hip. Memories flood back as
you remember this sight before many tears, screams and beatings. Apprehension fills you
as this man now stands next to you.
<<elseif $player['titles'].has('past royal')>>
his seemingly polished nails and perfectly trimmed eyebrows. You are no stranger
to how the old world used to treat the upper class and royalty, but you had thought
this was a relic of the past. Regardless, he now stands next to you.
<</if>>
</p>
<p class="textpassage">
"There isn't food or water for miles," he says as he eyes the vultures above. As you lock
eyes with him, a sickly smirk suddenly emerges as he says "Come with me and be my slave. I
will save you." Not wanting your story to end here, you regrettably accept.
</p>
<p class="textpassage"><div class="tooltip">He starts leading you to a town focusing on
<span class="tooltiptext right" style="top: -250%">
Determines the content of the early game and what requests you will have to
fulfill as a slave. Not super important but prevents some content you might
not enjoy from appearing. Economics: you're basically any assistant. Sexual:
You will be forced to perform sexual acts on both men and women. Please pick
economic slavery if you would not like this.
</span>
</div></p>
<br>
<center class="option">
<<button "Mainly\neconomics" phase1Intro6>><<set $tasks = 0>><</button>>
<<button "Sexual\nslavery">>
<<if $player.gender == 0>>
<<popover>>
<b>Warning</b>: You have choosen to be a man, but have picked sexual slavery. Due to complaints, I must warn you that you will be forced to perform sexual acts on both men and women and be at the mercy of your master until
you gain your freedom. Please pick Economic slavery if you do not wish to see this content. You have been warned.
<<button "Back">><<run Dialog.close()>><</button>>
<<button "Confirm" phase1Intro6>>
<<run Dialog.close()>>
<<set $tasks = 2>>
<</button>>
<</popover>>
<<else>>
<<goto phase1Intro6>>
<<set $tasks = 2>>
<</if>>
<</button>>
</center>
</div>
<</nobr>><<nobr>>
<div id="background" class="paper_border">
<center><h1>He Speaks</h1></center>
<p class="textpassage">
Ideals that seem out of place both in the past and present. "Free Cities," he says as
he waves his hands in the air as if to allude to curtains openning on a stage. "That's my
dream. We at Nipon are the only ones I know of that have solved the food issue. The
questions humans must keep asking are those of meaning." He stops and looks at your
puzzled face.
<<if $player['titles'].has('past_scholar')>>
Despite your past studies you have never
<<else>>
Never have you
<</if>> thought past the next month. This world was too chaotic for that. He
goes on, "What keeps us different from those vultures is an ability to ask for meaning."
</p>
<p class="textpassage">
He stops his monologue realizing something important, "Oh right! My name is Shintani Hiroyuki,
but most people call me Shin. Of course, to you, I'll be master or sir." He looks you up
and down again, "what do I call you?"
</p>
<p id="name_output" class="fade-out" style="--time: 0.4s"></p>
<span id="name_confirm" class="fade-out" style="--time: 0.4s">
[["Continue forward."|finalization]]
</span>
<span id="name_input" class="container threeCol" style="--time: 0.4s">
<center>''FIRST NAME''</center>
<center>''LAST NAME''</center>
<span></span>
<<textbox "$player['first_name']" "">>
<<textbox "$player['last_name']" "">>
<center>
<<button "Submit">>
<<set $player['first_name'] = $player['first_name'].trim()>>
<<set $player['last_name'] = $player['last_name'].trim()>>
<<script>>
var name_input = document.getElementById("name_input");
name_input.classList.add("fade-out");
var name_output = document.getElementById("name_output");
setTimeout(function(){
var player = State.variables.player;
if (player['first_name'] == "") {
player['first_name'] = player['gender'] == 0 ? "Markus" : "Sierra";
name_output.innerHTML = "\
\"No name? Or maybe you just prefer not to tell me. Well \
you get the honor of bearing a name chosen by me. From here \
on out you will carry the name \'" + player['first_name'] + "\'.";
if (player['last_name'] == "") {
player['last_name'] = "hironaka";
name_output.innerHTML += " \
You shall also carry on my lineage with the honorable vassal surname \
of Hironaka.\"\
"
} else {
name_output.innerHTML += " \
Your past that got you here is now irrelevant. You shall carry on \
my lineage with the honorable vassal surname of Hironaka.\"\
"
}
} else {
player['first_name'] = setup.titleCase(player['first_name']);
if (player['last_name'] == "") {
player['last_name'] = "hironaka";
name_output.innerHTML+= "\
\"Very well " + player['first_name'] + ". You shall carry on \
my lineage with the honorable vassal surname of Hironaka.\"\
"
} else {
name_output.innerHTML+= "\
\"Very well " + player['first_name'] + ". However, your past that \
got you here is now irrelevant; you shall carry on \
my lineage with the honorable vassal surname of Hironaka.\"\
"
}
}
name_output.classList.add('fade-in');
name_output.classList.remove('fade-out');
name_confirm.classList.add('fade-in');
name_confirm.classList.remove('fade-out');
player['last_name'] = setup.titleCase(player['last_name']);
}, 500);
<</script>>
<</button>>
</center>
</span>
</div>
<</nobr>><div id="background" class="paper_border">
<center><h1>Into the Sea of Fate</h1></center>
<p class="textpassage">
You sailed past the various lifetimes that could await you. A miasma of of life and death surround your every
step. Where do you arise from the fertile womb of the world?
</p>
<p class="textpassage"><div class="tooltip">(Recommended to start as a Slave for the full depth of play).
<span class="tooltiptext right" style="top: -170%">
The three phases of the story are highly interconnected, and some actions will be locked if you choose
to skip ahead. Only do this if you are an experienced player and know what you are doing.
</span>
</div></p>
<center class="option">
<<button "A slave saved by a fate" phase1Intro5>><</button>>
<<button "A citizen of Nipon" phase2Intro5>>
<<set $skipped_phase = true>>
/* Give access to Nipon */
<<set $locations.niponCentral.access = true>>
<</button>>
<<disable>>
<<button "The founder of an arcology">><</button>>
<</disable>>
</center>
</div>/* Add in stat and condition changes from new titles */
<<if $locations.nipon.data.owner == "shintani_hiroyuki">>
<<set _title = "hironaka">>
<<else>>
<<set _title = "liberator">>
<</if>>
<<set $player.titles.add(_title)>>
<<if $skipped_phase>>
/* Add in stat and condition changes from all titles */
<<for _i, _title range $player.titles>>
<<for _key, _val range setup.titles[_title]['stat_changes']>>
<<set $player.stats[_key] += _val>>
<</for>>
<<for _key, _val range setup.titles[_title]['condition_changes']>>
<<set $player.conditions[_key] += _val>>
<<set $player.conditions["max_" + _key] += _val>>
<</for>>
<<for _key, _val range setup.titles[_title]['skill_changes']>>
<<set $player.skills[_key] += _val>>
<</for>>
<</for>>
<<else>>
/* Only add in stat change from phase2 title */
<<for _key, _val range setup.titles[_title]['stat_changes']>>
<<set $player.stats[_key] += _val>>
<</for>>
<<for _key, _val range setup.titles[_title]['condition_changes']>>
<<set $player.conditions[_key] += _val>>
<<set $player.conditions["max_" + _key] += _val>>
<</for>>
<<for _key, _val range setup.titles[_title]['skill_changes']>>
<<set $player.skills[_key] += _val>>
<</for>>
<</if>>
<div id="background" class="paper_border notext">
<div class="main container threeCol twoRow">
<div class="subbackground" style="grid-row: 1 / span 2; grid-column: 1">
<center>
<h3 style="margin-bottom: 0; padding-bottom: 0"><<= $player.name()>></h3>
</center>
<hr>
<div class="container twoCol">
<div style="text-align: left; margin-left: 20px">
Sex <br>
Age <br>
<<for _i = 0; _i lt setup.CONDITIONS.length; _i++>>
<<= setup.titleCase(setup.CONDITIONS[_i])>>
<br>
<</for>>
<br>
<<for _i = 0; _i lt setup.STATS.length; _i++>>
<<= setup.titleCase(setup.STATS[_i])>>
<br>
<</for>>
</div>
<div style="text-align: right; margin-right: 20px">
<<if $player.gender == 0>>
Male
<<else>>
Female
<</if>> <br>
<<= $player.age()>> <br>
<<for _i = 0; _i lt setup.CONDITIONS.length; _i++>>
<<= $player.conditions["max_" + setup.CONDITIONS[_i]].toString().padStart(3, '\u2000')>>
<br>
<</for>>
<br>
<<for _i = 0; _i lt setup.STATS.length; _i++>>
<<if def $skipped_phase && $skipped_phase>>
(<<= setup.show_change(10, $player.stats[setup.STATS[_i]])>>)
<</if>>
<<= $player.stats[setup.STATS[_i]].toString().padStart(3, '\u2000')>>
<br>
<</for>>
</div>
</div>
<center>Titles
<hr>
<div id="titles"></div>
/* Prints all titles and assigns a unique div id to them */
<<set $done_setup = false>>
<<script>>
setTimeout(function(){
var html = "";
var titles = Array.from(State.variables.player.titles);
for (var i = 0; i < titles.length; i++) {
html += ("\
<div id=\"char_" + titles[i] + "\" class=\"tooltip\">" +
setup.titleCase(titles[i])
+ "</div><br>\
");
}
document.getElementById("titles").innerHTML = html;
State.variables.done_setup = true;
}, 1);
<</script>>
/* Creates artificial event-listener for setup of script above */
<<repeat 10ms>>
<<if $done_setup>>
<<for _idx, _title range $player.titles>>
<<capture _title>>
<<script>>
var title = State.temporary.title;
$("#char_" + title).click(
function(){
State.temporary.selected_title = title;
$.wiki("<<popover>><<include titleTutorial>><</popover>>")
}
);
<</script>>
<</capture>>
<</for>>
<<stop>>
<<unset $done_setup>>
<</if>>
<</repeat>>
</center>
</div>
<<set _difficulties = ["Very Easy", "Easy", "Normal", "Hard", "Very Hard"]>>
<<set _selected_difficulty = _difficulties[$difficulty + 2]>>
<div id="finalization_summary" class="subbackground" style="grid-row: 1 / span 1; grid-column: 2 / span 2">
<div class="textpassage" style="margin-top: 20px; margin-bottom: 20px">
You are a
<<if $player.gender == 0>>
man
<<else>>
woman
<</if>> of age <<= $player.age()>> who is <<= Math.round(setup.get($player, "height"))>>cm tall with
<<= setup.get($player, "hair_color")>> hair and <<= setup.get($player, "eye_color")>> eyes.
You are ethnically <<= setup.get($player, "ethnicity")>>. You are set to be a citizen of //Nipon//
run by <<= setup.titleCase($characters[$locations.nipon.data.owner].first_name)>>
<<if $locations.nipon.data.owner == "lia_hiroyuki">>
after helping her rise to power through a coup that united all the major powers in Nipon. This solidified
the Trade Unions role as a centralized power, significantly boosting the power of the Lari, causing deflation
in prices. Other settlements are sure to take notice and subsequent rebellions may occur.
<<else>>
after helping him weaken the Trade Union and stop the coup planned by his sister. This solidified the power of
settlements, causing the power and trust in the Lari to significantly decrease. This caused high inflation
among both Nipon and neighboring settlements.
<</if>>
<<for _idx, _title range $player.titles>>
<br><br>
<<= setup.titles[_title].preposition>> <b><<= setup.titleCase(_title)>></b>,
<<= setup.titles[_title].flavor_text>>
<</for>>
<<if $player.slaves.length gt 0>>
<br>
As slavery is legal in //Nipon//, you happen to also own a few due to past events.
<</if>>
<<for _idx, _slave range $player.slaves>>
<br><br>
<<= $characters[_slave]>>
<</for>>
</div>
</div>
<div class="subbackground" style="grid-row: 2 / span 1; grid-column: 2 / span 2">
<center><h3>Game Settings</h3>
Difficulty: _selected_difficulty<br>
Side: <<= ($locations.nipon.data.owner == "lia_hiroyuki") ? "Lia Hiroyuki" : "Shintani Hiroyuki">><br>
<br>
<center>
<<button "Confirm" liasTower>>
/* Stop playing intro music */
<<if $skipped_phase>>
<<audio ":all" stop>>
<</if>>
<<set $enable_keybinds = true>>
<<set $phase = 2>>
<<set $player.home = "liasTower">>
<<set $player.is_slave = false>>
<<set $locations.nipon.status = "citizen">>
<<if "work_event_pool" in $locations.shintaniHome.data>>
<<run delete $locations.shintaniHome.data.work_event_pool>>
<</if>>
/* Logic based on choosen side */
<<if $locations.nipon.data.owner == "lia_hiroyuki">>
/* Finish phase 1 quest */
<<set $quest_journal.completed.push("path_to_freedom")>>
/* Remove cycle of abuse (need to pay back debt) */
<<if $quest_journal.ongoing.contains("cycle_of_abuse")>>
<<set $quest_journal.failed.push("cycle_of_abuse")>>
<<set setup.remove_val($quest_journal.ongoing, "cycle_of_abuse")>>
<</if>>
/* Shintani's slaves become residents */
<<set $locations.shintaniHome.data.residents = []>>
<<for _idx, _slave range $characters.shintani_hiroyuki.slaves>>
<<if $player.slaves.contains(_slave)>>
<<set $characters[_slave].status = "slave">>
<<set $characters[_slave].is_slave = true>>
<<set $characters[_slave].owner = "player">>
<<set $characters[_slave].background = "She chose to follow you after the fall of Shintani.">>
<<set $characters[_slave].stats_known = true>>
<<set $characters[_slave].skills_known = true>>
<<set $characters[_slave].data.generated = false>>
<<else>>
<<set $characters[_slave].status = "citizen">>
<<set $characters[_slave].is_slave = false>>
<<set $characters[_slave].owner = null>>
<<set $locations.shintaniHome.data.residents.push(_slave)>>
<<set $characters[_slave].background = "She was freed following the fall of Shintani.">>
<</if>>
<</for>>
/* Remove shintani */
<<set $removed_characters.push("shintani_hiroyuki")>>
<<run delete $characters.shintani_hiroyuki>>
/* Economy alterations */
<<for _commodity, _val range $commodities>>
<<set _val.stable_price *= 0.6>>
<</for>>
<<else>>
/* Finish phase 1 quests */
<<if !$quest_journal.completed.contains("duty_of_a_slave")>>
<<set $quest_journal.ongoing.delete("duty_of_a_slave")>>
<<set $quest_journal.completed.push("duty_of_a_slave")>>
<</if>>
<<if !$quest_journal.completed.contains("cycle_of_abuse")>>
<<set $quest_journal.ongoing.delete("cycle_of_abuse")>>
<<set $quest_journal.completed.push("cycle_of_abuse")>>
<</if>>
/* Enslave Emily */
<<set $characters.emily_namm.status = "low_slave">>
<<set $characters.emily_namm.owner = "shintani_hiroyuki">>
<<set $characters.shintani_hiroyuki.slaves.push("emily_namm")>>
<<set $characters.emily_namm.slave_traits.obedience = 0>>
<<set $characters.emily_namm.slave_traits.trust = 0>>
<<if $skipped_phase>>
/* Remove Lia */
<<set $removed_characters.push("lia_hiroyuki")>>
<<run delete $characters.lia_hiroyuki>>
<</if>>
/* Economy alterations */
<<for _commodity, _val range $commodities>>
<<set _val.stable_price *= 1.5>>
<</for>>
<</if>>
/* Finish phase 1 quests */
<<if !$quest_journal.completed.contains("path_to_greatness")>>
<<set $quest_journal.ongoing.delete("path_to_greatness")>>
<<set $quest_journal.completed.push("path_to_greatness")>>
<</if>>
<<if !$quest_journal.completed.contains("the_nipon_economy")>>
<<set $quest_journal.ongoing.delete("the_nipon_economy")>>
<<set $quest_journal.completed.push("the_nipon_economy")>>
<</if>>
<<if !$quest_journal.completed.contains("power_struggles")>>
<<set $quest_journal.ongoing.delete("power_struggles")>>
<<set $quest_journal.completed.push("power_struggles")>>
<</if>>
/* Remove subsidy information from slaves */
<<for _idx, _slave range $player.slaves>>
<<set delete $characters[_slave].data.subsidy>>
<</for>>
<<if $skipped_phase>>
/* Give player a random slave */
<<set _temp_slave = new setup.Character("temp", true, 40)>>
<<set _temp_slave.gender = 1>>
<<run _temp_slave.shuffle()>>
<<set _temp_slave.stats_known = true>>
<<set _temp_slave.skills_known = true>>
<<set _temp_slave.is_slave = true>>
<<set _temp_slave.data.generated = true>>
<<set _temp_slave.key = _temp_slave.first_name + "_" + _temp_slave.last_name + dice(1, 1000)>>
<<set _temp_slave.background = "You acquired her from the Nipon Auction House.">>
<<set _temp_slave.date_acquired = clone($gameDate)>>
<<set _temp_slave.owner = "player">>
<<set $characters[_temp_slave.key] = _temp_slave>>
<<set $player.slaves.push(_temp_slave.key)>>
<<run UInv.CreateBag(_temp_slave.key)>>
/* Give access to library */
<<set $quest_journal.ongoing.push("knowledge_is_power")>>
<<set $quests.knowledge_is_power.added = true>>
<<set $quests.knowledge_is_power.stage = 2>>
<<set $locations.shintaniHomeLibrary.access = true>>
/* Give access to Lias Tower */
<<set $locations.liasTower.access = true>>
<</if>>
<<unset $skipped_phase>>
<</button>>
<<if def $skipped_phase && $skipped_phase>>
<<button "Reset" phase1Intro1>><</button>>
<</if>>
</center>
</center>
</div>
</div>
</div><div id="background" class="paper_border">
<center><h1>A Path Charted</h1></center>
<p class="textpassage">
Across the lakebeds of adversity, you found yourself amid the principle conflict in Nipon. A symbol of the new world,
Nipon is a safehaven for humanity since the Great Dusting. This momentary peace comes at the price of a willing ignorance
that cannot be ignored. You alone were the main character of this turning point in history, who did you decide to side with?
</p>
<center class="option longer">
<<button "Your savior Shintani" phase2Intro6>>
<<set $locations.nipon.data.owner = "shintani_hiroyuki">>
<</button>>
<<button "Spearhead for the unfortunate Lia" phase2Intro6>>
<<set $locations.nipon.data.owner = "lia_hiroyuki">>
<</button>>
</center>
</div><div id="background" class="paper_border">
<center><h1>Rebirthed as a Citizen</h1></center>
<p class="textpassage">
You faced the greatest of hardships through your time in Nipon. Through the sway of the winds of fate, you have climbed
the untouchable bottom of society and emerged a chrysalis which will soon bloom into true majesty. What have you decided
to be the moniker of your reign?</p>
<p id="name_output" class="fade-out" style="--time: 0.4s"></p>
<span id="name_confirm" class="fade-out" style="--time: 0.4s">
[["Continue forward."|phase2Finalization]]
</span>
<span id="name_input" class="container threeCol" style="--time: 0.4s">
<center>''FIRST NAME''</center>
<center>''LAST NAME''</center>
<span></span>
<<textbox "$player['first_name']" `$player['first_name'].toLocaleUpperFirst()`>>
<<textbox "$player['last_name']" `$player['last_name'].toLocaleUpperFirst()`>>
<center>
<<button "Submit">>
<<if $player.first_name.length == 0 || $player.last_name.length == 0>>
<<notify>>Invalid name!<</notify>>
<<else>>
<<set $player['first_name'] = $player['first_name'].trim()>>
<<set $player['last_name'] = $player['last_name'].trim()>>
<<script>>
var name_input = document.getElementById("name_input");
name_input.classList.add("fade-out");
var name_output = document.getElementById("name_output");
setTimeout(function(){
var player = State.variables.player;
name_output.innerHTML+= "And so " + player.name() + " emerged into the world.";
name_output.classList.add('fade-in');
name_output.classList.remove('fade-out');
name_confirm.classList.add('fade-in');
name_confirm.classList.remove('fade-out');
}, 500);
<</script>>
<</if>>
<</button>>
</center>
</span>
</div><<nobr>>
<div id="assignment" class="subbackground" style="padding-bottom: 25px;">
<hr>
<center><h3>Assignment</h3></center>
<<if $player.slaves.contains(_char.key)>>
<center id="assignment_buttons" class="threeHalfs smalltext longbutton column">
<<if $player.is_slave>>
@@#serveShintani;<<button "Serve Shintani">><</button>>@@
<</if>>
@@#assistSoldiers;<<button "Assist Soldiers">><</button>>@@
@@#dayTrade;<<button "Day Trade">><</button>>@@
@@#maid;<<button "Maid">><</button>>@@
@@#mines;<<button "Mines">><</button>>@@
@@#partyMember;<<button "Party Member">><</button>>@@
@@#serveYou;<<button "Serve You">><</button>>@@
@@#solBrothel;<<button "Sol Brothel">><</button>>@@
@@#fuckToy;<<button "Fuck Toy">><</button>>@@
<hr>
<h3>Self Improvement</h3>
@@#freeTime;<<button "Free Time">><</button>>@@
@@#study;<<button "Study">><</button>>@@
@@#train;<<button "Train">><</button>>@@
<hr>
<h3>Punishment</h3>
@@#confinement;<<button "Confinement">><</button>>@@
@@#publicHumiliation;<<button "Public Humiliation">><</button>>@@
@@#humanToilet;<<button "Human Toilet">><</button>>@@
</center>
<center id="assignment_done_button" class="threeHalfs smalltext longbutton column">
<hr>
<<button "Done">><<script>>
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
<</script>><</button>>
</center>
<<elseif $player.is_slave && $characters.shintani_hiroyuki.slaves.contains(_char.key)>>
<<if _higher_status>>
<center id="assignment_buttons" class="threeHalfs smalltext longbutton column">
@@#shintanisOrders;<<button "Shintani\'s Orders">><</button>>@@
@@#serveShintani;<<button "Serve Shintani">><</button>>@@
@@#assistSoldiers;<<button "Assist Soldiers">><</button>>@@
@@#dayTrade;<<button "Day Trade">><</button>>@@
@@#maid;<<button "Maid">><</button>>@@
@@#mines;<<button "Mines">><</button>>@@
@@#serveYou;<<button "Serve You">><</button>>@@
@@#solBrothel;<<button "Sol Brothel">><</button>>@@
@@#fuckToy;<<button "Fuck Toy">><</button>>@@
<hr>
<h3>Self Improvement</h3>
@@#freeTime;<<button "Free Time">><</button>>@@
@@#study;<<button "Study">><</button>>@@
@@#train;<<button "Train">><</button>>@@
<hr>
<h3>Punishment</h3>
<span class="fail">(Shintani's paternalist views prevents extreme health-threatening punishments)</span>
@@#confinement;<<button "Confinement">><</button>>@@
@@#publicHumiliation;<<button "Public Humiliation">><</button>>@@
<<disable>>@@#humanToilet;<<button "Human Toilet">><</button>>@@<</disable>>
</center>
<center id="assignment_done_button" class="threeHalfs smalltext longbutton column">
<hr>
<<button "Done">><<script>>
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
<</script>><</button>>
</center>
<<else>>
<div class="textpassage">
You do not have a higher status than this person!
</div>
<</if>>
<<else>>
<div class="textpassage">
This person is not your slave!
</div>
<</if>>
</div>
<<silently>><<timed 50ms>>
<<if $player.slaves.includes(_char.key)>>
<<if _char.assignment == "none">>
<<set _char.assignment = "freeTime">>
<</if>>
<<run $("#assignment_buttons").find("#" + _char.assignment + " button").addClass("disabled")>>
<<run $("#assignment_buttons").find("#" + _char.assignment + " button").prop("disabled", true)>>
<<elseif $player.is_slave && $characters.shintani_hiroyuki.slaves.contains(_char.key) && _higher_status>>
<<if _char.assignment == "none">>
<<addclass "#shintanisOrders button" "disabled">>
<<run $("#shintanisOrders button").prop("disabled", true)>>
<<else>>
<<run $("#assignment_buttons").find("#" + _char.assignment + " button").addClass("disabled")>>
<<run $("#assignment_buttons").find("#" + _char.assignment + " button").prop("disabled", true)>>
<</if>>
<</if>>
<<script>>
let char = State.temporary.char;
let player = State.variables.player;
$("#assignment_buttons").find("button").on("click", (event) => {
let _t = State.temporary;
let _v = State.variables;
let self = $(event.currentTarget);
var assignment = setup.camelize(self.html());
/* Handle party member seperately */
if (assignment == "partyMember") {
if (player.party.length >= 3) {
$.wiki("<<notify>>Cannot have more than three slaves assigned to your party.<</notify>>");
return;
} else {
player.party.push(char.key);
}
}
$("#assignment_buttons").find("button").removeClass("disabled");
$("#assignment_buttons").find("button").prop("disabled", false);
if (_v.characters.shintani_hiroyuki != null && _v.characters.shintani_hiroyuki.slaves.contains(char.key)) {
$("#humanToilet button").addClass("disabled");
$("#humanToilet button").prop("disabled", true);
}
self.addClass("disabled");
self.prop("disabled", true);
const assignment_passage = "assignment" + assignment.toLocaleUpperFirst();
if (tale.has(assignment_passage)) {
if (_t.char.assignment == "dayTrade") {
_v.player.finances.investment -= _t.char.finances.investment;
$.wiki("<<addmoney " + _t.char.finances.investment + ">>");
_t.char.finances.investment = 0;
}
if (_t.char.assignment == "partyMember") {
setup.remove_val(_v.player.party, _t.char.key);
}
_t.char.assignment = assignment;
$("#assignment_done_button").removeClass("hidden");
$.wiki("<<include " + assignment_passage + ">>");
$("#characterMenuCenterDetails").removeClass("hidden");
$("#characterMenuCenter").addClass("hidden");
$("#characterMenuLeft").addClass("hidden");
if (!(char.key in player.finances.slaves)) {
player.finances.slaves[char.key] = {};
}
if (!player.slaves.contains(char.key)) {
player.finances.slaves[char.key].assignment = -25 * setup.HEIRARCHY[char.status];
} else {
player.finances.slaves[char.key].assignment = 0;
}
let temp_delta = setup.assignments[assignment](char);
if ("cost" in temp_delta && !Number.isNaN(temp_delta.cost)) {
player.finances.slaves[char.key].assignment -= temp_delta.cost;
}
} else {
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
if (_v.player.slaves.contains(_t.char.key)) {
char.assignment = "freeTime";
} else {
char.assignment = "none";
}
if (char.key in player.finances.slaves) {
player.finances.slaves[char.key].assignment = 0;
}
}
});
<</script>>
<</timed>><</silently>>
<</nobr>><<run $("#characterMenuCenterDetailsTitle").html("Assist Soldiers");>>
<<set _delta = setup.assignments["assistSoldiers"](_char)>>
<<set _flavor_text = "You assign " + setup.titleCase(_char.first_name) + " to assist the soldiers in both training and \
common duties until further notice. Depending on the ability of " + setup.titleCase(_char.first_name) + ", " +
setup.he(_char) + " will either be a punching bag or a useful training assistant. Either way \
it may increase " + setup.his(_char) + " skills in combat as well as " + setup.his(_char) +
" strength. The quality and ability to benefit from this assignment is dependent on " + setup.titleCase(_char.first_name) + "\'s " +
"main disposition which is currently <em>" + _char.get_disposition() + "</em>.">>
<<set _flavor_text += "<ul>">>
/* Slave traits, use char name */
<<if _delta.self != null && _delta.self.slave_traits != null>>
<<for _key, _val range _delta.self.slave_traits>>
<<if _key.startsWith("max_") || _key.startsWith("min_")>>
<<continue>>
<</if>>
<<set _tit = setup.titleCase(_key)>>
<<if _tit == "Obedience">>
<<set _tit = "Affection">>
<</if>>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s " + _tit + ": " +
setup.show_change_html(0, _val, setup.POSITIVES.character[_key]) + " per day">>
<<if "max_" + _key in _delta.self.slave_traits>>
<<set _flavor_text += " (capped at " + _delta.self.slave_traits["max_" + _key] + ").">>
<<elseif "min_" + _key in _delta.self.slave_traits>>
<<set _flavor_text += " (bound by " + _delta.self.slave_traits["min_" + _key] + ").">>
<<else>>
<<set _flavor_text += ".">>
<</if>>
<<set _flavor_text += "</li>">>
<</for>>
<</if>>
/* Stats & skills */
<<if _delta.self != null && _delta.self.stats != null>>
<<for _key, _val range _delta.self.stats>>
<<if _key.startsWith("max_") || _key.startsWith("min_")>>
<<continue>>
<</if>>
<<if Math.abs(_val) lt 1>>
<<set _flavor_text += "<li>">>
<<if Math.sign(_val) == -1>>
<<set _flavor_text += "Decrease " + _key + " chance: <span class=\"fail\">" + setup.round2(100 * Math.abs(_val)) + "%</span> per day">>
<<else>>
<<set _flavor_text += "Increase " + _key + " chance: <span class=\"success\">" + setup.round2(100 * Math.abs(_val)) + "%</span> per day">>
<</if>>
<<else>>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s " + setup.titleCase(_key) + ": " +
setup.show_change_html(0, _val, setup.POSITIVES.character[_key]) + " per day">>
<</if>>
<<if "max_" + _key in _delta.self.stats>>
<<set _flavor_text += " (capped at " + _delta.self.stats["max_" + _key] + ").">>
<<elseif "min_" + _key in _delta.self.stats>>
<<set _flavor_text += " (bound by " + _delta.self.stats["min_" + _key] + ").">>
<<else>>
<<set _flavor_text += ".">>
<</if>>
<<set _flavor_text += "</li>">>
<</for>>
<</if>>
<<if _delta.self != null && _delta.self.skills != null>>
<<for _key, _val range _delta.self.skills>>
<<if _key.startsWith("max_") || _key.startsWith("min_")>>
<<continue>>
<</if>>
<<if Math.abs(_val) lt 1>>
<<set _flavor_text += "<li>">>
<<if Math.sign(_val) == -1>>
<<set _flavor_text += "Decrease " + _key + " chance: <span class=\"fail\">" + setup.round2(100 * Math.abs(_val)) + "%</span> per day">>
<<else>>
<<set _flavor_text += "Increase " + _key + " chance: <span class=\"success\">" + setup.round2(100 * Math.abs(_val)) + "%</span> per day">>
<</if>>
<<else>>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s " + setup.titleCase(_key) + ": " +
setup.show_change_html(0, _val, setup.POSITIVES.character[_key]) + " per day">>
<</if>>
<<if "max_" + _key in _delta.self.skills>>
<<set _flavor_text += " (capped at " + _delta.self.skills["max_" + _key] + ").">>
<<elseif "min_" + _key in _delta.self.skills>>
<<set _flavor_text += " (bound by " + _delta.self.skills["min_" + _key] + ").">>
<<else>>
<<set _flavor_text += ".">>
<</if>>
<<set _flavor_text += "</li>">>
<</for>>
<</if>>
<<set _opportunity = 25 * setup.HEIRARCHY[_char.status]>>
<<if $player.slaves.contains(_char.key)>>
<<set _opportunity = 0>>
<</if>>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _flavor_text += "<li>Opportunity cost: <span class=\"fail\">" + setup.LARI + _opportunity + "</span> per day.</li>">>
<</if>>
<<set _flavor_text += "</ul>">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>><<nobr>>
/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Punish with Confinement");>>
<<set _flavor_text = "\
You lock " + setup.titleCase(_char.first_name) + " in a small room without any outside interaction \
until further notice. This will significantly decrease " + setup.his(_char) +
" affection and willpower whilst increasing " + setup.his(_char) + " fear. \
Keeping " + setup.him(_char) + " confined for too long might make " +
setup.him(_char) + " develop long-term mental ailments such as \
depression or becoming completely broken with a shattered ego. Finally, with a lack of movement in the \
confinement cell, " + setup.his(_char) + " muscles may deteriorate.">>
<<set _opportunity = 25 * setup.HEIRARCHY[_char.status]>>
<<if $player.slaves.contains(_char.key)>>
<<set _opportunity = 0>>
<</if>>
<<set _flavor_text += "\
<ul>\
<li>" + setup.titleCase(_char.first_name) + "\'s Affection: " +
setup.show_change_html(0, -3) + " per day.</li>\
<li>" + setup.titleCase(_char.first_name) + "\'s Fear: " +
setup.show_change_html(0, 1, false) + " per day.</li>\
<li>" + setup.titleCase(_char.first_name) + "\'s Willpower: " +
setup.show_change_html(0, -1, false) + " per day.</li>\
<li>Decrease strength chance: <span class=\"fail\">10%</span> per day.</li>\
">>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _flavor_text += "<li>Opportunity cost: <span class=\"fail\">" + setup.LARI + _opportunity + "</span> per day.</li>">>
<</if>>
<<set _flavor_text += "</ul>">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>>
<</nobr>><<run $("#assignment_done_button").addClass("hidden")>>
<<run $("#characterMenuCenterDetailsTitle").html("Day Trade in the Markets");>>
<<set _delta = setup.assignments["dayTrade"](_char)>>
<<set _flavor_text = "You assign " + setup.titleCase(_char.first_name) + " try to make a profit selling commodities at the Union and \
market stalls until further notice. For " + setup.titleCase(_char.first_name) + " to be profitable " + setup.he(_char) +
" needs to be well educated and intelligent as well as have good social skills through tact and manipulation. This assignment also \
carries with it a lot of risk, as it requires an initial liquid capital investment of at least 750 lari. You should only give this \
assignment to very obedient slaves, else they may purposefully lose all your lari. Finally, being able to have control over lari will boost " +
setup.titleCase(_char.first_name) + "\'s willpower. " + setup.titleCase(_char.first_name) + "\'s current disposition is " + _char.get_disposition() + ".">>
<<set _flavor_text += "<ul>">>
/* Slave traits, use char name */
<<if _delta.self != null && _delta.self.slave_traits != null>>
<<for _key, _val range _delta.self.slave_traits>>
<<if _key.startsWith("max_") || _key.startsWith("min_")>>
<<continue>>
<</if>>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s " + setup.titleCase(_key) + ": " +
setup.show_change_html(0, _val, setup.POSITIVES.character[_key]) + " per day">>
<<if "max_" + _key in _delta.self.slave_traits>>
<<set _flavor_text += " (capped at " + _delta.self.slave_traits["max_" + _key] + ").">>
<<elseif "min_" + _key in _delta.self.slave_traits>>
<<set _flavor_text += " (bound by " + _delta.self.slave_traits["min_" + _key] + ").">>
<<else>>
<<set _flavor_text += ".">>
<</if>>
<<set _flavor_text += "</li>">>
<</for>>
<</if>>
/* Expected profit and variance */
<<if _delta.expectation gt 0>>
<<set _flavor_text += "<li>Expected return: <span class=\"success\">" + setup.round2(100 * _delta.expectation) + "%<span></li>">>
<<else>>
<<set _flavor_text += "<li>Expected return: <span class=\"fail\">" + setup.round2(100 * _delta.expectation) + "%<span></li>">>
<</if>>
<<set _flavor_text += "<li>Return variance (risk): <span class=\"fail\">" + setup.round2(100 * _delta.variance) + "%</span></li>">>
<<set _opportunity = 25 * setup.HEIRARCHY[_char.status]>>
<<if $player.slaves.contains(_char.key)>>
<<set _opportunity = 0>>
<</if>>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _flavor_text += "<li>Opportunity cost: <span class=\"fail\">" + setup.LARI + _opportunity + "</span> per day.</li>">>
<</if>>
<<set _flavor_text += "</ul>">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>>
<<if _char.finances.investment == null>>
<<set _char.finances.investment = 0>>
<</if>>
<<set _temp_investment = _char.finances.investment>>
/* Temporarily reset their job to default for now */
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _char.assignment = "none">>
<<else>>
<<set _char.assignment = "freeTime">>
<</if>>
<<run $("#characterMenuCenterDetailsBody").wiki("<<include assignmentDayTradeHelperPassage>>")>><<if $player.finances.investment == null>>
<<set $player.finances.investment = 0>>
<</if>>
<center>
<h4>Investment Amount <br><span style="font-weight: normal">(Current Liquid Capital: <<money>>)</span></h4>
<<textbox "_temp_investment" _temp_investment>>
<br><br>
<<button "Confirm">>
<<if !Number.isNaN(Number(_temp_investment))>>
<<set _temp_investment = setup.round2(Number(_temp_investment))>>
<<if _temp_investment lt 750>>
<<notify>>You must invest at least 750 lari to have enough liquidity to day trade.<</notify>>
<<elseif $player.finances.investment + _temp_investment lt 0.75 * $player.get_money()>>
<<set $player.finances.investment += _temp_investment>>
<<set _char.finances.investment = _temp_investment>>
<<set _char.assignment = "dayTrade">>
<<script>>
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
$("#assignment_done_button").removeClass("hidden")
<</script>>
<<audio coins_sound play>>
<<else>>
<<notify>>You can only have at most 75% of your liquid capital invested at one time.<</notify>>
<</if>>
<<else>>
<<notify>>Invalid input.<</notify>>
<</if>>
<</button>>
<<button "Back">>
<<script>>
let char = State.temporary.char;
if (char.assignment == "none") {
$("#assignment_buttons").find("#shintanisOrders button").trigger("click");
} else {
$("#assignment_buttons").find("#" + char.assignment + " button").trigger("click");
}
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
$("#assignment_done_button").removeClass("hidden")
<</script>>
<</button>>
</center><<nobr>>
/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Free Time");>>
<<set _flavor_text = "\
You let " + setup.titleCase(_char.first_name) + " take some well deserved time off until \
further notice. This allows " + setup.titleCase(_char.first_name) + " to recover from illness, \
injury, as well as builds " + setup.his(_char) + " affection for you.">>
<<set _opportunity = 25 * setup.HEIRARCHY[_char.status]>>
<<if $player.slaves.contains(_char.key)>>
<<set _opportunity = 0>>
<</if>>
<<set _flavor_text += "\
<ul>\
<li>" + setup.titleCase(_char.first_name) + "\'s Affection: " +
setup.show_change_html(0, 2) + " per day.</li>\
<li>" + setup.titleCase(_char.first_name) + "\'s Willpower: " +
setup.show_change_html(0, 1, false) + " per day.</li>\
<li>Reduces negative mental effects such as anger, sadness, and suspicion.</li>\
">>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _flavor_text += "<li>Opportunity cost: <span class=\"fail\">" + setup.LARI + _opportunity + "</span> per day.</li>">>
<</if>>
<<set _flavor_text += "</ul>">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>>
<</nobr>><<nobr>>
/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Fuck Toy");>>
<<set _flavor_text = "\
You assigned " + setup.titleCase(_char.first_name) + " to be your personal fuck toy until \
further notice. Such an action has a chance to increase " + setup.his(_char) +
" sex skills as well as reveal her fetishes. However, if her affection is not high enough it \
may also lower " + setup.his(_char) + " sexual preferences.">>
<<set _opportunity = 25 * setup.HEIRARCHY[_char.status]>>
<<if $player.slaves.contains(_char.key)>>
<<set _opportunity = 0>>
<</if>>
<<set _flavor_text += "\
<ul>\
<li>Sex skills increase chance: <span class=\"success\">5%</span> per day.</li>">>
<<if !_char.sex_prefs_know>>
<<set _flavor_text += "<li>Understand preferences chance: <span class=\"success\">10%</span> per day.</li>">>
<</if>>
<<if !_char.fetishes_known>>
<<set _flavor_text += "<li>Understand fetishes chance: <span class=\"success\">5%</span> per day.</li>">>
<</if>>
<<if _char.slave_traits.obedience lt 60>>
<<set _flavor_text += "<li>Reduce sexual preferences chance: <span class=\"fail\">5%</span> per day.</li>">>
<<else>>
<<set _flavor_text += "<li>Increase sexual preferences chance: <span class=\"success\">5%</span> per day.</li>">>
<</if>>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s Willpower: " +
setup.show_change_html(0, -1, false) + " per day (bound by 40).</li>\
">>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _flavor_text += "<li>Opportunity cost: <span class=\"fail\">" + setup.LARI + _opportunity + "</span> per day.</li>">>
<</if>>
<<set _flavor_text += "</ul>">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>>
<</nobr>><<nobr>>
/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Punish with Confinement");>>
<<set _flavor_text = "\
You make " + setup.titleCase(_char.first_name) + " serve as a human toilet, bathing-in, drinking, and eating \
all your excrement until further notice. This will significantly decrease " + setup.his(_char) +
" affection and willpower whilst increasing " + setup.his(_char) + " fear. \
This significantly increases the chances of developing long-term mental ailments such as \
depression or becoming completely broken with a shattered ego. Finally, such an unsanitary assignment increases \
the chance for permanent injuries, disease, and death.">>
<<set _opportunity = 25 * setup.HEIRARCHY[_char.status]>>
<<if $player.slaves.contains(_char.key)>>
<<set _opportunity = 0>>
<</if>>
<<set _flavor_text += "\
<ul>\
<li>" + setup.titleCase(_char.first_name) + "\'s Affection: " +
setup.show_change_html(0, -7) + " per day.</li>\
<li>" + setup.titleCase(_char.first_name) + "\'s Fear: " +
setup.show_change_html(0, 2, false) + " per day.</li>\
<li>" + setup.titleCase(_char.first_name) + "\'s Willpower: " +
setup.show_change_html(0, -5, false) + " per day.</li>\
">>
<<set _flavor_text += "</ul>">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>>
<</nobr>><<nobr>>
/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Serve as a Maid");>>
<<set _flavor_text = "\
You assign " + setup.titleCase(_char.first_name) + " to serve as a regular maid until \
further notice. Of all the jobs you could assign " + setup.him(_char) +
" both of you know this is the least demanding.">>
<<set _opportunity = 25 * setup.HEIRARCHY[_char.status]>>
<<if $player.slaves.contains(_char.key)>>
<<set _opportunity = 0>>
<</if>>
<<set _flavor_text += "\
<ul>\
<li>" + setup.titleCase(_char.first_name) + "\'s Affection: " +
setup.show_change_html(0, 1) + " per day.</li>\
<li>" + setup.titleCase(_char.first_name) + "\'s Fear: " +
setup.show_change_html(0, -1, false) + " per day.</li>\
">>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _flavor_text += "<li>Opportunity cost: <span class=\"fail\">" + setup.LARI + _opportunity + "</span> per day.</li>">>
<</if>>
<<set _flavor_text += "</ul>">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>>
<</nobr>><<nobr>>
/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Labor in the Mines");>>
<<set _flavor_text = "\
You assign " + setup.titleCase(_char.first_name) + " to be a worker at the mines until \
further notice. This jobs requires hard labor and always has a chance of injury due to the unpredictability \
of the mines. The revenue is dependent on both their efficiency (which is a function of their intelligence, \
education, and disposition) and strength.">>
<<set _opportunity = 25 * setup.HEIRARCHY[_char.status]>>
<<if $player.slaves.contains(_char.key)>>
<<set _opportunity = 0>>
<</if>>
<<set _flavor_text += "\
<ul>\
<li>Raise strength chance: <span class=\"success\">3%</span> per day.</li>\
<li>Injury chance: <span class=\"fail\">2%</span> per day.</li>\
">>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _flavor_text += "<li>Opportunity cost: <span class=\"fail\">" + setup.LARI + "" + _opportunity + "</span> per day.</li>">>
<</if>>
<<set _rev = (2 * _char.stats.strength) * _char.efficiency()>>
<<set _flavor_text += "\
<li>Revenue: <span class=\"success\">" + setup.LARI +
"" + setup.round2(_rev) + "</span> per day.</li>\
">>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key) && _rev gt _opportunity>>
<<set _shintani_cut = 0.3 + 0.1 * $difficulty>>
<<set _flavor_text += "\
<li>Shintani\'s cut: <span class=\"fail\">" + setup.LARI +
"" + setup.round2(_shintani_cut * (_rev - _opportunity)) + "</span> per day.</li>\
">>
<<if (1 - _shintani_cut) * (_rev - _opportunity) gt 0>>
<<set _flavor_text += "<li>Total profit: <span class=\"success\">" + setup.LARI +
"" + setup.round2((1 - _shintani_cut) *(_rev - _opportunity)) + "</span> per day.</li>">>
<<else>>
<<set _flavor_text += "<li>Total profit: <span class=\"fail\">-" + setup.LARI +
"" + Math.abs(setup.round2((1 - _shintani_cut) * (_rev - _opportunity))) + "</span> per day.</li>">>
<</if>>
<<else>>
<<if _rev gt _opportunity>>
<<set _flavor_text += "<li>Total profit: <span class=\"success\">" + setup.LARI + setup.round2(_rev - _opportunity) + "</span> per day.</li>">>
<<else>>
<<set _flavor_text += "<li>Total profit: <span class=\"fail\">" + setup.LARI + setup.round2(_rev - _opportunity) + "</span> per day.</li>">>
<</if>>
<</if>>
<<set _flavor_text += "</ul>">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>>
<</nobr>>/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Combat Party Member");>>
<<set _flavor_text = "\
You make " + setup.titleCase(_char.first_name) + " follow you everywhere you go, making " +
setup.him(_char) + " join you in combat until notice. This puts " +
setup.titleCase(_char.first_name) + " of getting severely injured or even die if they are \
recklessly used as a meat shield in battle. To avoid this make sure to equip " + setup.him(_char) +
" with the proper gear. You can only have up to three slaves follow you at a time.">>
<<set _flavor_text += "\
<ul>\
<li>Raise affection chance: <span class=\"success\">5%</span> per day.</li>\
<li>Raise willpower chance: <span class=\"fail\">5%</span> per day.</li>\
</ul>">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>><<run $("#characterMenuCenterDetailsTitle").html("Public Humiliation");>>
<<set _flavor_text = "\
You force " + setup.titleCase(_char.first_name) + " to walk though town naked with your cum smeared all over " +
setup.his(_char) + " face. This will greatly decrease " + setup.his(_char) +
" affection and willpower whilst increasing " + setup.his(_char) + " fear. \
This increases the chances of developing long-term mental ailments such as depression or becoming \
completely broken with a shattered ego. There\'s a chance such an assignment may \
end up sparking " + setup.titleCase(_char.first_name) + "\'s interest in humiliation.">>
<<set _opportunity = 25 * setup.HEIRARCHY[_char.status]>>
<<if $player.slaves.contains(_char.key)>>
<<set _opportunity = 0>>
<</if>>
<<set _flavor_text += "<ul>">>
<<set _delta = setup.assignments["publicHumiliation"](_char)>>
/* Slave traits, use char name */
<<if _delta.self != null && _delta.self.slave_traits != null>>
<<for _key, _val range _delta.self.slave_traits>>
<<if _key.startsWith("max_") || _key.startsWith("min_")>>
<<continue>>
<</if>>
<<set _tit = setup.titleCase(_key)>>
<<if _tit == "Obedience">>
<<set _tit = "Affection">>
<<elseif _tit == "Trust">>
<<set _tit = "Fear">>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s " + _tit + ": " +
setup.show_change_html(0, -1 * _val, true) + " per day.</li>">>
<<continue>>
<</if>>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s " + _tit + ": " +
setup.show_change_html(0, _val, setup.POSITIVES.character[_key]) + " per day">>
<<if "max_" + _key in _delta.self.slave_traits>>
<<set _flavor_text += " (capped at " + _delta.self.slave_traits["max_" + _key] + ").">>
<<elseif "min_" + _key in _delta.self.slave_traits>>
<<set _flavor_text += " (bound by " + _delta.self.slave_traits["min_" + _key] + ").">>
<<else>>
<<set _flavor_text += ".">>
<</if>>
<<set _flavor_text += "</li>">>
<</for>>
<</if>>
/* Stats & skills */
<<if _delta.self != null && _delta.self.stats != null>>
<<for _key, _val range _delta.self.stats>>
<<if _key.startsWith("max_") || _key.startsWith("min_")>>
<<continue>>
<</if>>
<<if Math.abs(_val) lt 1>>
<<set _flavor_text += "<li>">>
<<if Math.sign(_val) == -1>>
<<set _flavor_text += "Decrease " + _key + " chance: <span class=\"fail\">" + setup.round2(100 * Math.abs(_val)) + "%</span> per day">>
<<else>>
<<set _flavor_text += "Increase " + _key + " chance: <span class=\"success\">" + setup.round2(100 * Math.abs(_val)) + "%</span> per day">>
<</if>>
<<else>>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s " + setup.titleCase(_key) + ": " +
setup.show_change_html(0, _val, setup.POSITIVES.character[_key]) + " per day">>
<</if>>
<<if "max_" + _key in _delta.self.stats>>
<<set _flavor_text += " (capped at " + _delta.self.stats["max_" + _key] + ").">>
<<elseif "min_" + _key in _delta.self.stats>>
<<set _flavor_text += " (bound by " + _delta.self.stats["min_" + _key] + ").">>
<<else>>
<<set _flavor_text += ".">>
<</if>>
<<set _flavor_text += "</li>">>
<</for>>
<</if>>
<<if _delta.self != null && _delta.self.skills != null>>
<<for _key, _val range _delta.self.skills>>
<<if _key.startsWith("max_") || _key.startsWith("min_")>>
<<continue>>
<</if>>
<<if Math.abs(_val) lt 1>>
<<set _flavor_text += "<li>">>
<<if Math.sign(_val) == -1>>
<<set _flavor_text += "Decrease " + _key + " chance: <span class=\"fail\">" + setup.round2(100 * Math.abs(_val)) + "%</span> per day">>
<<else>>
<<set _flavor_text += "Increase " + _key + " chance: <span class=\"success\">" + setup.round2(100 * Math.abs(_val)) + "%</span> per day">>
<</if>>
<<else>>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s " + setup.titleCase(_key) + ": " +
setup.show_change_html(0, _val, setup.POSITIVES.character[_key]) + " per day">>
<</if>>
<<if "max_" + _key in _delta.self.skills>>
<<set _flavor_text += " (capped at " + _delta.self.skills["max_" + _key] + ").">>
<<elseif "min_" + _key in _delta.self.skills>>
<<set _flavor_text += " (bound by " + _delta.self.skills["min_" + _key] + ").">>
<<else>>
<<set _flavor_text += ".">>
<</if>>
<<set _flavor_text += "</li>">>
<</for>>
<</if>>
<<set _flavor_text += "</ul>">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>><<nobr>>
/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Serve Shintani");>>
<<set _flavor_text = "\
You assigned " + setup.titleCase(_char.first_name) + " to serving Shintani until \
further notice. Such an action will help you build his trust in you, but will take "
+ setup.titleCase(_char.first_name) + " away from " +
setup.his(_char) + " other duties.">>
<<set _opportunity = 25 * setup.HEIRARCHY[_char.status]>>
<<if $player.slaves.contains(_char.key)>>
<<set _opportunity = 0>>
<</if>>
<<set _flavor_text += "\
<ul>\
<li>Trust : " + setup.show_change_html(0, 2) + " per day.</li>\
">>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _flavor_text += "<li>Opportunity cost: <span class=\"fail\">" + setup.LARI + _opportunity + "</span> per day.</li>">>
<</if>>
<<set _flavor_text += "</ul>">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>>
<</nobr>><<nobr>>
/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Serve You");>>
<<set _flavor_text = "\
You assigned " + setup.titleCase(_char.first_name) + " to serve you to your every whim and need until \
further notice. Such an action will lower " + setup.his(_char) +
" affection and willpower towards you, but of course this takes "
+ setup.titleCase(_char.first_name) + " away from " +
setup.his(_char) + " other duties.">>
<<set _opportunity = 25 * setup.HEIRARCHY[_char.status]>>
<<if $player.slaves.contains(_char.key)>>
<<set _opportunity = 0>>
<</if>>
<<set _flavor_text += "\
<ul>\
<li>" + setup.titleCase(_char.first_name) + "\'s Affection: " +
setup.show_change_html(0, -2) + " per day.</li>\
<li>" + setup.titleCase(_char.first_name) + "\'s Willpower: " +
setup.show_change_html(0, -2, false) + " per day (bound by 40).</li>\
">>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _flavor_text += "<li>Opportunity cost: <span class=\"fail\">" + setup.LARI + _opportunity + "</span> per day.</li>">>
<</if>>
<<set _flavor_text += "</ul>">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>>
<</nobr>><<nobr>>
/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Whore at Sol Brothel");>>
<<set _flavor_text = "\
You assigned " + setup.titleCase(_char.first_name) + " work at the Sol Brothel until \
further notice. " + setup.titleCase(setup.his(_char)) +
" profitability is determined by " + setup.his(_char) +
" beauty, sex preferences, skills, fetishes and disposition.">>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _shintani_cut = 0.3 + 0.1 * $difficulty>>
<<set _flavor_text += " Such an action will net you " + Math.floor(100 * (1 - _shintani_cut)) + "% of " + setup.his(_char) +
" profits (the other " + Math.floor(100 * _shintani_cut) + "% going to Shintani).">>
<</if>>
<<set _opportunity = 25 * setup.HEIRARCHY[_char.status]>>
<<if $player.slaves.contains(_char.key)>>
<<set _opportunity = 0>>
<</if>>
<<set _sex_value = setup.round2(_char.sex_value().clamp(0, 1000))>>
<<set _rev = _sex_value * _char.efficiency()>>
<<set _flavor_text += "<ul>">>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _flavor_text += "<li>Opportunity cost: <span class=\"fail\">" + setup.LARI + "" + _opportunity + "</span> per day.</li>">>
<</if>>
<<set _flavor_text += "\
<li>Revenue: <span class=\"success\">" + setup.LARI +
"" + setup.round2(_rev) + "</span> per day.</li>\
">>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key) && _rev gt _opportunity>>
<<set _flavor_text += "\
<li>Shintani\'s cut: <span class=\"fail\">" + setup.LARI +
"" + setup.round2(_shintani_cut * (_rev - _opportunity)) + "</span> per day.</li>\
">>
<<if (1 - _shintani_cut) * (_rev - _opportunity) gt 0>>
<<set _flavor_text += "<li>Total profit: <span class=\"success\">" + setup.LARI +
"" + setup.round2((1 - _shintani_cut) * (_rev - _opportunity)) + "</span> per day.</li>">>
<<else>>
<<set _flavor_text += "<li>Total profit: <span class=\"fail\">-" + setup.LARI +
"" + Math.abs(setup.round2((1 - _shintani_cut) * (_rev - _opportunity))) + "</span> per day.</li>">>
<</if>>
<<else>>
<<if _rev gt _opportunity>>
<<set _flavor_text += "<li>Total profit: <span class=\"success\">" + setup.LARI + setup.round2(_rev - _opportunity) + "</span> per day.</li>">>
<<else>>
<<set _flavor_text += "<li>Total profit: <span class=\"fail\">" + setup.LARI + setup.round2(_rev - _opportunity) + "</span> per day.</li>">>
<</if>>
<</if>>
<<set _flavor_text += "</ul>">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>>
<</nobr>><<nobr>>
/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Study in Library");>>
<<set _flavor_text = "\
You make " + setup.titleCase(_char.first_name) + " study in the library until \
further notice. This allows " + setup.titleCase(_char.first_name) + " to gradually increase \
" + setup.his(_char) + " intelligence which will allow her to push \
back the ideals of slavery and believe you are her savior.">>
<<set _opportunity = 25 * setup.HEIRARCHY[_char.status]>>
<<if $player.slaves.contains(_char.key)>>
<<set _opportunity = 0>>
<</if>>
<<set _flavor_text += "\
<ul>\
<li>" + setup.titleCase(_char.first_name) + "\'s Affection: " +
setup.show_change_html(0, 2) + " per day.</li>\
<li>" + setup.titleCase(_char.first_name) + "\'s Trust: " +
setup.show_change_html(0, 1) + " per day.</li>\
<li>" + setup.titleCase(_char.first_name) + "\'s Willpower: " +
setup.show_change_html(0, 1, false) + " per day.</li>\
<li>Raise intelligence chance: <span class=\"success\">5%</span> per day (capped at 35).</li>\
<li>Raise education chance: <span class=\"success\">10%</span> per day (capped at 60).</li>">>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _flavor_text += "<li>Opportunity cost: <span class=\"fail\">" + setup.LARI + _opportunity + "</span> per day.</li>">>
<</if>>
<<set _flavor_text += "\
<li>Learning materials: <span class=\"fail\">" + setup.LARI +
"25</span> per day.</li>\
<li>Total Profit: <span class=\"fail\">-" + setup.LARI +
(_opportunity + 25) + "</span> per day.</li>\
</ul>\
">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>>
<</nobr>><<nobr>>
/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Train at Nipon Barracks");>>
<<set _flavor_text = "\
You make " + setup.titleCase(_char.first_name) + " train at the Nipon barracks until \
further notice. This allows " + setup.titleCase(_char.first_name) + " to gradually increase \
" + setup.his(_char) + " strength, dexterity, and physical skills.">>
<<set _opportunity = 25 * setup.HEIRARCHY[_char.status]>>
<<if $player.slaves.contains(_char.key)>>
<<set _opportunity = 0>>
<</if>>
<<set _flavor_text += "\
<ul>\
<li>" + setup.titleCase(_char.first_name) + "\'s Affection: " +
setup.show_change_html(0, 2) + " per day.</li>\
<li>" + setup.titleCase(_char.first_name) + "\'s Trust: " +
setup.show_change_html(0, 1) + " per day.</li>\
<li>" + setup.titleCase(_char.first_name) + "\'s Willpower: " +
setup.show_change_html(0, 1, false) + " per day.</li>\
<li>Raise dexterity chance: <span class=\"success\">5%</span> per day.</li>\
<li>Raise strength chance: <span class=\"success\">5%</span> per day.</li>\
<li>Raise physical skills chance: <span class=\"success\">5%</span> per day.</li>">>
<<if $characters.shintani_hiroyuki != null && $characters.shintani_hiroyuki.slaves.includes(_char.key)>>
<<set _flavor_text += "<li>Opportunity cost: <span class=\"fail\">" + setup.LARI + _opportunity + "</span> per day.</li>">>
<</if>>
<<set _flavor_text += "\
<li>Training fee: <span class=\"fail\">" + setup.LARI +
"50</span> per day.</li>\
<li>Total Profit: <span class=\"fail\">-" + setup.LARI +
(_opportunity + 50) + "</span> per day.</li>\
</ul>\
">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>>
<</nobr>><<nobr>>
<<updatestatus>>
<<set _char = $characters[$selected]>>
<<set _higher_status = ($player.get_status("nipon") == "slave" && _char.status == "low_slave") ||
($player.get_status("nipon") == "high_slave" && _char.status == "slave") ||
($player.get_status("nipon") == "high_slave" && _char.status == "low_slave")>>
<<set _to_round = $selected>>
<<include round>>
<div class="charside left">
<div id="description_actions" class="mapaction fiveQuarters smalltext">
<hr>
<<disable>>
@@#summary_but;<<button "Summary">>
<</button>>@@
<</disable>>
@@#modifications_but;<<button "Modifications">>
<</button>>@@
@@#stats_but;<<button "Stats">>
<</button>>@@
@@#combat_stats_but;<<button "Combat Stats">>
<</button>>@@
@@#skills_but;<<button "Skills">>
<</button>>@@
@@#sex_skills_but;<<button "Sex Prefs">>
<</button>>@@
<<if def $selection_queue && $selection_queue != null && $selection_queue.length gt 1>>
<hr>
@@#other_slaves_but;<<button "Other Slaves">><</button>>@@
<</if>>
<<set _left_selection = "summary">>
</div>
</div>
<div id="background" class="paper_border notext">
<div class="main container threeCol" style="height: 100%; width: 100%;">
<div id="characterMenuLeft" style="height: 710px">
<<include characterMenuSummary>>
<div id="modifications" class="subbackground hidden">
<<include characterMenuModifications>>
</div>
<<include characterMenuStats>>
<div id="combatStats" class="subbackground hidden">
<<include characterMenuCombatStats>>
</div>
<<include characterMenuSkills>>
<<include characterMenuSexPrefs>>
<<if def $selection_queue && $selection_queue != null && $selection_queue.length gt 1>>
<<include characterMenuOtherSlaves>>
<</if>>
</div>
<div id="characterMenuCenter" class="subbackground">
<center>
<h3 id="characterMenuFullName" style="margin-top:20px; margin-bottom: 20px">
<<= setup.titleCase(_char.first_name)>> <<= setup.titleCase(_char.last_name)>>
</h3>
</center>
<<include characterMenuEquip>>
<center>
<div id="characterMenuImage"></div>
</center>
<<if $player.slaves.includes(_char.key) && (ndef _char.data || ndef _char.data.generated || _char.data.generated)>>
<<script>>
var char = State.temporary.char;
setTimeout(() => {
$("#characterMenuImage").css("background-image", "url(resources/images/characters/player/" + char.gender + ".png)");
}, 20);
<</script>>
<<else>>
<<script>>
var char = State.temporary.char;
setTimeout(() => {
$("#characterMenuImage").css("background-image",
"url(\"" + char.image_folder() + char.first_name.toLowerCase() + ".png\")")
}, 20);
<</script>>
<</if>>
<div style="margin: 15px; margin-left: 30px; margin-right: 30px">
<<showmeter "char_health_bar" `_char.conditions.health/_char.conditions.max_health`>>
<<showmeter "char_stamina_bar" `_char.conditions.stamina/_char.conditions.max_stamina`>>
</div>
<center class="twoThirds">
<<button "Back">>
<<set $enable_keybinds = true>>
<<set $in_menu = false>>
<<unset $selection_queue>>
<<goto $last_visited>>
<<set $last_visited = "">>
<</button>>
</center>
</div>
<div id="characterMenuCenterDetails" class="subbackground hidden centerDetails">
<hr>
<center><h3 id="characterMenuCenterDetailsTitle">Title</h3></center>
<div id="characterMenuCenterDetailsBody" class="textpassage" style="margin-bottom: 30px"></div>
</div>
<div id="playerInventory" class="subbackground hidden">
<<include characterMenuInventoryPlayer>>
</div>
<<include characterMenuAssignment>>
<<include characterMenuDiet>>
<<include characterMenuEquipment>>
<<include characterMenuFinances>>
<<include characterMenuInventoryScript>>
<<include characterMenuNaming>>
<<include characterMenuOutfit>>
<<include characterMenuRules>>
<<include characterMenuSalon>>
<<include characterMenuSurgery>>
</div>
</div>
<div class="charside right">
<div id="slave_actions" class="mapaction fiveQuarters smalltext">
<hr>
<<disable>>
@@#assignment_but;<<button "Assignment">><</button>>@@
<</disable>>
@@#diet_but;<<button "Diet">><</button>>@@
@@#equipment_but;<<button "Equipment">>
<<if $player.slaves.includes(_char.key)>><<timed 10ms>>
<<removeclass "#equipOverlay" "hidden">>
<</timed>><</if>>
<<script>>
$("#equipment").empty();
$("#equipment").wiki("<<include characterMenuEquipmentHelper>>");
<</script>>
<</button>>@@
@@#finances_but;<<button "Finances">><</button>>@@
@@#inventory_but;<<button "Inventory">>
<<if $player.slaves.includes(_char.key)>><<timed 10ms>>
<<addclass "#characterMenuCenter" "hidden">>
<<removeclass "#playerInventory" "hidden">>
<<run _update_inventories()>>
<</timed>><</if>>
<</button>>@@
@@#naming_but;<<button "Naming">><</button>>@@
@@#outfit_but;<<button "Outfit">><</button>>@@
@@#rules_but;<<button "Rules">><</button>>@@
/* TODO */
@@#salon_but;<<button "Salon">><</button>>@@
@@#surgery_but;<<button "Surgery">><</button>>@@
<<set _right_selection = "assignment">>
</div>
</div>
/* Disable all slave_actions if they are not your slave. */
<<if $player.slaves.contains($selected)>>
<<elseif $player.is_slave && $characters.shintani_hiroyuki.slaves.contains(_char.key)>>
<<if !_higher_status>>
<<script>>
setTimeout(() => {
var buttons = $("#slave_actions").find("button");
buttons.addClass("disabled");
buttons.prop("disabled", true);
}, 20);
<</script>>
<</if>>
<<else>>
<<script>>
setTimeout(() => {
var buttons = $("#slave_actions").find("button");
buttons.addClass("disabled");
buttons.prop("disabled", true);
}, 20);
<</script>>
<</if>>
<<timed 50ms>><<silently>><<script>>
$("#description_actions").find("button").on("click", (event) => {
$("#description_actions").find("button").removeClass("disabled");
$("#description_actions").find("button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
var desc = setup.camelize(self.html());
$("#" + desc).removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenter").removeClass("hidden");
$("#" + State.temporary.left_selection).addClass("hidden");
State.temporary.left_selection = desc;
$("#characterMenuCenterDetails").addClass("hidden");
});
$("#slave_actions").find("button").on("click", (event) => {
$("#slave_actions").find("button").removeClass("disabled");
$("#slave_actions").find("button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
var desc = setup.camelize(self.html());
$("#" + desc).removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenter").removeClass("hidden");
$("#" + State.temporary.right_selection).addClass("hidden");
State.temporary.right_selection = desc;
$("#characterMenuCenterDetails").addClass("hidden");
$("#equipOverlay").addClass("hidden");
$("#playerInventory").addClass("hidden");
$("#characterMenuCenter").removeClass("hidden");
});
/* Updates every time a button is clicked */
$("button").on("click", (event) => {
let self = $(event.currentTarget);
if (self.html() == "Back") {
return;
}
$("#modifications").empty();
$("#modifications").wiki("<<include characterMenuModifications>>");
});
<</script>><</silently>><</timed>>
<</nobr>><hr>
<center><h3>Combat Stats</h3></center>
<<if (_char.skills_known && _char.stats_known) || _char.key == "player">>
<center>
<<set _combat_stats = {
"damage": {
"blunt": 0,
"pierce": 0,
"slash": 0
},
"resist": {
"blunt": 0,
"pierce": 0,
"slash": 0
}
}>>
<div class="container twoCol" style="grid-template-columns: 40% 55%; column-gap: 5%">
<div style="text-align: left; margin-left: 20px">
Starting AP: <br>
AP Recovery: <br>
Speed:
</div>
<div style="text-align: right; margin-right: 20px">
<<if _char.key == "player">>
<<= 10 + Math.floor((_char.conditions.max_stamina - 100) / 10) - $difficulty>><br>
<<else>>
<<= 10 + Math.floor((_char.conditions.max_stamina - 100) / 10) + $difficulty>><br>
<</if>>
<<= 2 + Math.floor(_char.stats.strength / 30)>><br>
<span id="speed"></span>
<<set _speed = (5 * _char.stats.dexterity).clamp(0, 100000)>>
</div>
</div>
<div style="text-align: left; margin-left: 20px">
Weapon(s):
<span style="font-weight: normal">
<<if _char.equipment.weapon1 == "none" && _char.equipment.weapon2 == "none">>
Unarmed
<<set _combat_stats.damage.blunt = 1 + Math.floor(_char.stats.strength / 50)>>
<<else>>
<<if _char.equipment.weapon1 != "none">>
<<displayitemname _char.equipment.weapon1>>
<<set _temp_item = UInv.GetDefaultItemObject(_char.equipment.weapon1)>>
<<set _temp_item_delta = clone(_temp_item.weapon_stats)>>
<<if _temp_item.skill != null && _temp_item.skillreq != null && _char.skills[_temp_item.skill] lt _temp_item.skillreq>>
<<run setup.mult_dict(_temp_item_delta, 0.5)>>
<</if>>
<<if _temp_item != null && _temp_item.weapon_stats != null>>
/* Do not add in damage from shield, used for calculating bashes */
<<if _temp_item.type.includes("shield")>>
<<run setup.apply_delta(_combat_stats.resist, _temp_item_delta.resist, null, true, false)>>
<<else>>
<<run setup.apply_delta(_combat_stats, _temp_item_delta, null, true, false)>>
<</if>>
<</if>>
<</if>>
<<if _char.equipment.weapon2 != "none">>
<<displayitemname _char.equipment.weapon2>>
<<set _temp_item = UInv.GetDefaultItemObject(_char.equipment.weapon2)>>
<<set _temp_item_delta = clone(_temp_item.weapon_stats)>>
<<if _temp_item.skill != null && _temp_item.skillreq != null && _char.skills[_temp_item.skill] lt _temp_item.skillreq>>
<<run setup.mult_dict(_temp_item_delta, 0.5)>>
<</if>>
<<if _temp_item != null && _temp_item.weapon_stats != null>>
/* Do not add in damage from shield, used for calculating bashes */
<<if _temp_item.type.includes("shield")>>
<<run setup.apply_delta(_combat_stats.resist, _temp_item_delta.resist, null, true, false)>>
<<else>>
<<run setup.apply_delta(_combat_stats, _temp_item_delta, null, true, false)>>
<</if>>
<</if>>
<</if>>
<</if>>
</span><br>
Armor(s):
<span style="font-weight: normal">
<<set _armors = ["head", "chest", "legs", "feet"]>>
<<for _idx, _armor range _armors>>
/* Skip missing pieces */
<<if _char.equipment[_armor] == "none" || !UInv.GetDefaultItemObject(_char.equipment[_armor]).type.includes("armor")>>
<<continue>>
<</if>>
<<displayitemname _char.equipment[_armor]>>
<<set _temp_item = UInv.GetDefaultItemObject(_char.equipment[_armor])>>
<<set _temp_item_delta = clone(_temp_item.armor_stats)>>
<<if _temp_item.stat != null && _temp_item.statreq != null && _char.stats[_temp_item.stat] lt _temp_item.statreq>>
<<run setup.mult_dict(_temp_item_delta, 0.5)>>
<</if>>
<<if _temp_item != null && _temp_item.armor_stats != null>>
<<run setup.apply_delta(_combat_stats, _temp_item_delta, null, true, false)>>
<</if>>
/* Add in speed penalty */
<<if _temp_item_delta.weight != null>>
<<set _speed -= _temp_item_delta.weight>>
<</if>>
<</for>>
</span>
<<timed 20ms>>
<<run $("#speed").html("" + setup.round2(_speed))>>
<</timed>>
</div>
<hr>
<div class="container twoCol">
<div style="text-align: left; margin-left: 20px">
Blunt Damage:<br>
Pierce Damage:<br>
Slash Damage:<br><br>
Blunt Resist:<br>
Pierce Resist:<br>
Slash Resist:<br>
</div>
<div style="text-align: right; margin-right: 20px">
<<= setup.round2(_combat_stats.damage.blunt)>><br>
<<= setup.round2(_combat_stats.damage.pierce)>><br>
<<= setup.round2(_combat_stats.damage.slash)>><br><br>
<<= setup.round2(_combat_stats.resist.blunt)>><br>
<<= setup.round2(_combat_stats.resist.pierce)>><br>
<<= setup.round2(_combat_stats.resist.slash)>><br>
</div>
</div>
</center>
<<else>>
<div class="textpassage">
You do not know <<= setup.titleCase(_char.first_name)>>'s combat stats.
</div>
<</if>><<nobr>>
<<set _cum_producers = ($player.gender == 0) ? 1 : 0>>
<<for _idx, _slave range $player.slaves>>
<<if _slave.gender == 0 && _slave.key != _char.key>>
<<set _cum_producers += 1>>
<</if>>
<</for>>
<div id="diet" class="subbackground hidden" style="padding-bottom: 25px;">
<hr>
<center><h3>Diet</h3></center>
<<if $player.slaves.contains(_char.key) || ($player.is_slave && $characters.shintani_hiroyuki.slaves.contains(_char.key))>>
<<if $player.slaves.contains(_char.key) || _higher_status>>
<center id="diet_buttons" class="threeHalfs smalltext longbutton column">
<<if $player.slaves.contains(_char.key)>>
<div id="diet_amount_buttons">
@@#limited;<<button "Limited">><</button>>@@
@@#regular;<<button "Regular">><</button>>@@
@@#abundant;<<button "Abundant">><</button>>@@
</div>
<<else>>
<span class="fail">(Shintani's paternalist views prevents extreme starvation or gorging)</span>
<<disable>>@@#limited;<<button "Limited">><</button>>@@<</disable>>
<<disable>>@@#regular;<<button "Regular">><</button>>@@<</disable>>
<<disable>>@@#abundant;<<button "Abundant">><</button>>@@<</disable>>
<</if>>
<hr>
<h3>Additives</h3>
<div id="diet_additives_buttons">
@@#noAdditives;<<button "None">><</button>>@@
@@#cumAdded;<<button "Cum Added">><</button>>@@
@@#cumBased;<<button "Cum Based">><</button>>@@
@@#milkAdded;<<button "Milk Added">><</button>>@@
@@#milkBased;<<button "Milk Based">><</button>>@@
</div>
</center>
<center class="threeHalfs smalltext longbutton column">
<hr>
<<button "Done">><<script>>
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
<</script>><</button>>
</center>
<<else>>
<div class="textpassage">
You do not have a higher status than this person!
</div>
<</if>>
<<else>>
<div class="textpassage">
This person is not your slave!
</div>
<</if>>
</div>
<<if ($player.is_slave && $characters.shintani_hiroyuki.slaves.contains(_char.key) && _higher_status) || $player.slaves.contains(_char.key)>>
<<silently>><<timed 50ms>>
<<run $("#diet_amount_buttons").find("#" + _char.diet.amount + " button").addClass("disabled")>>
<<run $("#diet_amount_buttons").find("#" + _char.diet.amount + " button").prop("disabled", true)>>
<<if _char.diet.additives == "none">>
<<addclass "#noAdditives button" "disabled">>
<<run $("#noAdditives button").prop("disabled", true)>>
<<else>>
<<run $("#diet_additives_buttons").find("#" + _char.diet.additives + " button").addClass("disabled")>>
<<run $("#diet_additives_buttons").find("#" + _char.diet.additives + " button").prop("disabled", true)>>
<</if>>
<<script>>
let _t = State.temporary;
let _v = State.variables;
var player = State.variables.player;
var char = State.temporary.char;
$("#diet_amount_buttons").find("button").on("click", (event) => {
$("#diet_amount_buttons").find("button").removeClass("disabled");
$("#diet_amount_buttons").find("button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
var diet_amount = setup.camelize(self.html());
char.diet.amount = diet_amount;
const diet_passage = "diet" + diet_amount.toLocaleUpperFirst();
if (tale.has(diet_passage)) {
$.wiki("<<include " + diet_passage + ">>");
$("#characterMenuCenterDetails").removeClass("hidden");
$("#characterMenuCenter").addClass("hidden");
$("#characterMenuLeft").addClass("hidden");
} else {
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
}
});
$("#diet_additives_buttons").find("button").on("click", (event) => {
$("#diet_additives_buttons").find("button").removeClass("disabled");
$("#diet_additives_buttons").find("button").prop("disabled", false);
let self = $(event.currentTarget);
var diet_additives = setup.camelize(self.html());
char.diet.additives = diet_additives;
const diet_passage = "diet" + diet_additives.toLocaleUpperFirst();
var to_notify = "";
if (diet_additives.contains("cum") && _t.cum_producers == 0) {
to_notify = "No way to produce cum!";
/* TODO: Implement milk once pregnant */
} else if (diet_additives.contains("milk")) {
to_notify = "No way to produce milk!";
}
if (to_notify == "") {
self.addClass("disabled");
self.prop("disabled", true);
char.diet.additives = diet_additives;
if (tale.has(diet_passage)) {
$.wiki("<<include " + diet_passage + ">>");
$("#characterMenuCenterDetails").removeClass("hidden");
$("#characterMenuCenter").addClass("hidden");
$("#characterMenuLeft").addClass("hidden");
} else {
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
}
} else {
$.wiki("<<notify>>" + to_notify + "<</notify>>");
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
$("#noAdditives button").addClass("disabled");
$("#noAdditives button").prop("disabled", true);
State.temporary.char.diet.additives = "none";
}
});
<</script>>
<</timed>><</silently>>
<</if>>
<</nobr>>/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Limited Diet");>>
<<set _flavor_text = "\
You take conscious effort in filling " + setup.titleCase(_char.first_name) + "\'s meals with an over-abundance of \
calories in order to increase their weight. This effectively keeps them constantly gorged and uncomfortable, decreasing \
their affection and health over time. Supplementing this diet with additives weakens addiction, intertwining discomfort of \
gorging and said additive.">>
<<set _flavor_text += "\
<ul>\
<li>" + setup.titleCase(_char.first_name) + "\'s Affection: " +
setup.show_change_html(0, -2) + " per day.</li>\
<li>Decrease maximum health chance: <span class=\"fail\">1%</span> per day.</li>\
<li>Increase weight chance: <span>40%</span> per day.</li>\
</ul>\
">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>>/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Cum Added");>>
<<set _flavor_text = "\
You secretly cum into " + setup.titleCase(_char.first_name) + "\'s food before every meal until \
further notice. This allows " + setup.titleCase(_char.first_name) + " to associate your cum with \
sustenance and furthers " + setup.his(_char) + " cum fetish as well as addiction. \
Unfortunately this takes a toll on the stamina of those that produce this cum.">>
<<set _flavor_text += "\
<ul>\
<li>Stamina: " + setup.show_change_html(0, setup.round2(-20 / _cum_producers)) + " per day per <div class=\"tooltip\">cum producer.\
<span class=\"tooltiptext right\" style=\"top: -200%\">\
Cum producers are slaves or indentured servants you own as well as you yourself if you are male. \
As the number of cum producers you own increase, the smaller the stamina cost will be, as the work will \
be split among all of them.</span></div></li>\
<li>Increase cum fetish chance: <span>50%</span> per day.</li>\
<li>Increase cum addiction chance: <span>30%</span> per day.</li>\
</ul>\
">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>><<nobr>>
/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Cum Based");>>
<<set _flavor_text = "\
You now cum throughout the day to prepare " + setup.titleCase(_char.first_name) + "\'s meals. \
If " + setup.titleCase(_char.first_name) + " does not have a cum fetish this will severely decrease " +
setup.his(_char) + " affection for you as well as make them despise cum. \
However, for the cum loving this is a perfect way to build psychological addiction and happiness. \
Unfortunately this takes a toll on the stamina of those that produce this cum.">>
<<set _flavor_text += "\
<ul>\
<li>Stamina: " + setup.show_change_html(0, setup.round2(-90 / _cum_producers)) + " per day per \
<div class=\"tooltip\">cum producer.<span class=\"tooltiptext right\" style=\"top: -200%\">\
Cum producers are slaves or indentured servants you own as well as you yourself if you are male. \
As the number of cum producers you own increase, the smaller the stamina cost will be, as the work will \
be split among all of them.</span></div></li>">>
</div>
<<if _char.sex_fetishes.cum gt 50 || _char.mental_conditions.cum_addiction gt 50>>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s Affection: " +
setup.show_change_html(0, 1) + " per day.</li>">>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s Cum Addiction: " +
setup.show_change_html(0, 2) + " per day.</li>">>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s Cum Fetish: " +
setup.show_change_html(0, 2) + " per day.</li>">>
<<else>>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s Affection: " +
setup.show_change_html(0, -10) + " per day.</li>">>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s Cum Addiction: " +
setup.show_change_html(0, -3) + " per day.</li>">>
<<set _flavor_text += "<li>" + setup.titleCase(_char.first_name) + "\'s Cum Fetish: " +
setup.show_change_html(0, -3) + " per day.</li>">>
<</if>>
<<set _flavor_text += "</ul>">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>>
<</nobr>>/* Set title */
<<run $("#characterMenuCenterDetailsTitle").html("Limited Diet");>>
<<set _flavor_text = "\
You take conscious effort in restricting " + setup.titleCase(_char.first_name) + "\'s caloric and nutritional \
intake in order to reduce their weight. This effectively keeps them constantly hungry, decreasing their affection \
and strength over time. Supplementing this diet with additives boosts addiction, intertwining the dopamine hit of \
nutrition and said additive.">>
<<set _flavor_text += "\
<ul>\
<li>" + setup.titleCase(_char.first_name) + "\'s Affection: " +
setup.show_change_html(0, -2) + " per day.</li>\
<li>Decrease strength chance: <span class=\"fail\">10%</span> per day.</li>\
<li>Decrease weight chance: <span>40%</span> per day.</li>\
</ul>\
">>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>><<nobr>>
<div id="equipOverlay" class="hidden" style="position: relative; width: 0; height: 0; margin-left: -5px">
<div class="equipOverlay">
<div id="armor">
<div id="head" class="equipButton">
<<button "">><</button>>
</div>
<div id="chest" class="equipButton">
<<button "">><</button>>
</div>
<div id="legs" class="equipButton">
<<button "">><</button>>
</div>
<div id="feet" class="equipButton">
<<button "">><</button>>
</div>
</div>
<div id="accessories">
<div id="neck" class="equipButton">
<<button "">><</button>>
</div>
<div id="weapon1" class="equipButton">
<<button "">><</button>>
</div>
<div id="weapon2" class="equipButton">
<<button "">><</button>>
</div>
<div id="groin1" class="equipButton">
<<button "">><</button>>
</div>
<div id="groin2" class="equipButton">
<<button "">><</button>>
</div>
</div>
</div>
</div>
<<timed 50ms>><<silently>><<script>>
let char = State.temporary.char;
let equipButtons = $(".equipButton");
for (let _i = 0; _i < equipButtons.length; _i++) {
let id = equipButtons[_i].id;
if (char.equipment[id] != "none") {
let _temp_item = UInv.GetDefaultItemObject(char.equipment[id]);
if (_temp_item != null && _temp_item.skill != null && _temp_item.skillreq != null) {
if (char.skills[_temp_item.skill] >= _temp_item.skillreq) {
$(equipButtons[_i]).find("button").html("E");
} else {
$(equipButtons[_i]).find("button").html("<span class=\"fail\">E</span>");
}
} else if (_temp_item != null && _temp_item.stat != null && _temp_item.statreq != null) {
if (char.stats[_temp_item.stat] >= _temp_item.statreq) {
$(equipButtons[_i]).find("button").html("E");
} else {
$(equipButtons[_i]).find("button").html("<span class=\"fail\">E</span>");
}
} else {
$(equipButtons[_i]).find("button").html("E");
}
}
$(equipButtons[_i]).find("button").on("click", (event) => {
$(".equipButton button").removeClass("disabled");
$(".equipButton button").prop("disabled", false);
$("#equip_list").children().fadeOut(0.1);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
$("#default_list").fadeOut(0.1);
State.temporary.slot = id;
$("#" + State.temporary.slot.replace(/[0-9]/g, '') + "_list").fadeIn(0.1);
});
}
<</script>><</silently>><</timed>>
<</nobr>><div id="equipment" class="subbackground hidden">
<<include characterMenuEquipmentHelper>>
</div><<if $player.slaves.includes(_char.key)>>
<div id="default_list">
<hr>
<center><h3 id="armors_title" class="tool">Armor</h3>
<<set _armors = UInv.GetItemsArrayByItemTag(_char.key, "type", "armor")>>
<div id="armors_list" class="list container twoCol">
<div id="armors_list_names" style="text-align: left; margin-left: 20px">
</div>
<div style="text-align: right; margin-right: 20px; font-weight: normal">
<<for _i = 0; _i lt _armors.length; _i++>>
<<= UInv.BagHasItem(_char.key, _armors[_i])>>
<br>
<</for>>
</div>
</div>
</center>
<hr>
<center><h3 id="weapons_title" class="tool">Weapons</h3>
<<set _weapons = UInv.GetItemsArrayByItemTag(_char.key, "type", "weapon")>>
<div id="weapons_list" class="list container twoCol" style="font-weight: normal">
<div id="weapons_list_names" style="text-align: left; margin-left: 20px">
</div>
<div style="text-align: right; margin-right: 20px; font-weight: normal">
<<for _i = 0; _i lt _weapons.length; _i++>>
<<= UInv.BagHasItem(_char.key, _weapons[_i])>>
<br>
<</for>>
</div>
</div>
</center>
<hr>
<center><h3 id="accessories_title" class="tool">Accessories</h3>
<<set _accessories = UInv.GetItemsArrayByItemTag(_char.key, "type", "accessory")>>
<div id="accessories_list" class="list container twoCol" style="font-weight: normal">
<div id="accessories_list_names" style="text-align: left; margin-left: 20px">
</div>
<div style="text-align: right; margin-right: 20px; font-weight: normal">
<<for _i = 0; _i lt _accessories.length; _i++>>
<<= UInv.BagHasItem(_char.key, _accessories[_i])>>
<br>
<</for>>
</div>
</div>
</center>
</div>
<div id="equip_list">
<center id="head_list"><hr><h3>Head</h3>
<div id="head_list_items" style="text-align: left; margin-left: 20px; font-weight: normal;"></div>
</center>
<center id="chest_list"><hr><h3>Chest</h3>
<div id="chest_list_items" style="text-align: left; margin-left: 20px; font-weight: normal;"></div>
</center>
<center id="legs_list"><hr><h3>Legs</h3>
<div id="legs_list_items" style="text-align: left; margin-left: 20px; font-weight: normal;"></div>
</center>
<center id="feet_list"><hr><h3>Feet</h3>
<div id="feet_list_items" style="text-align: left; margin-left: 20px; font-weight: normal;"></div>
</center>
<center id="neck_list"><hr><h3>Neck</h3>
<div id="neck_list_items" style="text-align: left; margin-left: 20px; font-weight: normal;"></div>
</center>
<center id="weapon_list"><hr><h3>Weapons</h3>
<div id="weapon_list_items" style="text-align: left; margin-left: 20px; font-weight: normal;"></div>
</center>
<center id="groin_list"><hr><h3>Groin</h3>
<div id="groin_list_items" style="text-align: left; margin-left: 20px; font-weight: normal;"></div>
</center>
</div>
<<silently>><<timed 50ms>><<script>>
let char = State.temporary.char;
function refresh_list(place) {
let place_list = $("#" + place + "_list_items");
let item = $("<div class=\"tool\">None</div>");
item.on("click", (event) => {
let slot = State.temporary.slot;
char.equipment[slot] = "none";
$("#" + slot + " button").html("");
$("#equip_list").children().fadeOut(0.1);
$("#default_list").fadeIn(0.1);
$(".equipButton button").removeClass("disabled");
$(".equipButton button").prop("disabled", false);
$("#equip_list").children().fadeOut(0.1);
place_list.empty();
refresh_list(place);
$("#combatStats").html("");
$("#combatStats").wiki("<<include characterMenuCombatStats>>");
});
place_list.append(item);
place_list.append("<br>");
let items = UInv.GetItemsArrayByItemTag(char.key, "place", place);
for (let x of items) {
let item_str = setup.titleCase(UInv.GetItemPropertyValue(char.key, x, "name"));
let _temp_item = UInv.GetDefaultItemObject(x);
let equipped_slot = char.has_equipped(x);
if (equipped_slot != "none") {
item_str += " (E" + equipped_slot.replace(/\D/g,'') + ")";
}
let item = $("<div class=\"tool\" title=\"" + x + "\">" + item_str + "</div>");
item.on("click", (event) => {
let slot = State.temporary.slot;
let self = $(event.currentTarget);
let temp_item = UInv.GetDefaultItemObject(self.prop("title"));
if (temp_item != null) {
if ((slot == "weapon1" || slot == "weapon2") && temp_item.type.includes("2-handed")) {
char.equipment.weapon1 = "none";
char.equipment.weapon2 = "none";
$("#weapon1 button").html("");
$("#weapon2 button").html("");
} else if (slot == "weapon1" && char.equipment.weapon2 != "none") {
if (UInv.GetDefaultItemObject(char.equipment.weapon2).type.includes("2-handed")) {
char.equipment.weapon2 = "none";
$("#weapon2 button").html("");
}
} else if (slot == "weapon2" && char.equipment.weapon1 != "none") {
if (UInv.GetDefaultItemObject(char.equipment.weapon1).type.includes("2-handed")) {
char.equipment.weapon1 = "none";
$("#weapon1 button").html("");
}
}
}
char.equipment[slot] = self.prop("title");
$("#" + slot + " button").html("E");
if (_temp_item != null && _temp_item.skill != null && _temp_item.skillreq != null) {
if (char.skills[_temp_item.skill] >= _temp_item.skillreq) {
$("#" + slot + " button").html("E");
} else {
$("#" + slot + " button").html("<span class=\"fail\">E</span>");
}
} else if (_temp_item != null && _temp_item.stat != null && _temp_item.statreq != null) {
if (char.stats[_temp_item.stat] >= _temp_item.statreq) {
$("#" + slot + " button").html("E");
} else {
$("#" + slot + " button").html("<span class=\"fail\">E</span>");
}
} else {
$("#" + slot + " button").html("E");
}
if (equipped_slot != "none") {
$("#" + equipped_slot + " button").html("");
char.equipment[equipped_slot] = "none";
}
$("#equip_list").children().fadeOut(0.1);
$("#default_list").fadeIn(0.1);
$(".equipButton button").removeClass("disabled");
$(".equipButton button").prop("disabled", false);
place_list.empty();
refresh_list(place);
$("#combatStats").html("");
$("#combatStats").wiki("<<include characterMenuCombatStats>>");
});
place_list.append(item);
place_list.append("<br>");
}
let types = {"armor": "armors", "weapon": "weapons", "accessory": "accessories"};
for (let type in types) {
let item_list = $("#" + types[type] + "_list_names");
item_list.empty();
let items = UInv.GetItemsArrayByItemTag(char.key, "type", type);
for (let x of items) {
let item_str = setup.titleCase(UInv.GetItemPropertyValue(char.key, x, "name"));
let equipped_slot = char.has_equipped(x);
if (equipped_slot != "none") {
equipped_slot = equipped_slot.replace(/\D/g,'');
item_str += " (E" + equipped_slot + ")";
}
let item = $("<div class=\"tool\">" + item_str + "</div>");
item.on("click", (event) => {
if (type == "weapon") {
$.wiki("\
<<popover>>" +
"<<displayweapon " + x + " _char>>" +
"<</popover>>\
");
} else if (type == "armor") {
$.wiki("\
<<popover>>" +
"<<displayarmor " + x + " _char>>" +
"<</popover>>\
");
} else {
$.wiki("\
<<popover>>" +
"<h2>" + UInv.GetItemPropertyValue(char.key, x, "name") + "</h2>" +
UInv.GetItemPropertyValue(char.key, x, "description") +
"<</popover>>\
");
}
});
item_list.append(item);
item_list.append("<br>");
}
}
}
$("#armors_title").on("click", (event) => {
$("#armors_list").fadeToggle(0.1);
});
$("#weapons_title").on("click", (event) => {
$("#weapons_list").fadeToggle(0.1);
});
$("#accessories_title").on("click", (event) => {
$("#accessories_list").fadeToggle(0.1);
});
$("#equip_list").children().fadeOut(0.1);
let places = ["head", "chest", "legs", "feet", "neck", "weapon", "groin"];
for (let place of places) {
refresh_list(place);
}
<</script>><</timed>><</silently>>
<<else>>
<hr>
<center><h3>Equipment</h3>
<div class="textpassage">
You do not own <<= setup.titleCase(_char.first_name)>> and cannot change <<= setup.his(_char)>> equipment.
</div>
</center>
<</if>><<nobr>>
<div id="finances" class="subbackground hidden">
<hr>
<center><h3>Finances</h3>
<<if $player.slaves.contains(_char.key)>>
<div class="container twoCol" style="font-weight: normal; grid-template-columns: 60% 30%;">
<div style="text-align: left; margin-left: 20px">
Active investments:<br>
<br>
Date acquired:<br>
Total earned:<br>
Purchase cost:<br>
Total costs:<br>
<br>
Efficiency:<br>
Estimated sex value:<br>
Estimated value:<br>
<br>
Estimated net:
</div>
<div style="text-align: right; margin-right: 20px; font-weight: normal">
<<= setup.round2(_char.finances.investment)>><br>
<br>
<<= setup.print_date(_char.date_acquired)>><br>
<<= setup.LARI>><<= setup.round2(_char.finances.total_earned)>><br>
<<= setup.LARI>><<= setup.round2(_char.finances.purchase_cost)>><br>
<<= setup.LARI>><<= setup.round2(_char.finances.cost + _char.finances.purchase_cost)>><br>
<br>
<<= setup.round2(_char.efficiency() * 100)>>%<br>
<<= setup.LARI>><<= setup.round2(_char.sex_value())>><br>
<<= setup.LARI>><<= setup.round2(_char.value())>><br>
<br>
<<= setup.show_money_change_html(0, setup.round2(_char.finances.total_earned - (_char.finances.cost + _char.finances.purchase_cost) + _char.value()))>>
</div>
</div>
<<else>>
<div class="textpassage">
You do not own <<= setup.titleCase(_char.first_name)>> and cannot view their financial records.
</div>
<</if>>
</center>
</div>
<</nobr>><<set _categories = {"armor": "armors", "weapon": "weapons", "accessory": "accessories"}>>
<hr>
<center>
<h3 style="margin-bottom: 0">Inventory</h3>
</center>
<<for _type, _category range _categories>>
<hr>
<center><h3 @id="_type" class="tool category"><<= setup.titleCase(_category)>></h3></center>
<<set _type_list = "inv_" + _type + "_list">>
<div @id="_type_list">
<<set _temp_items = UInv.GetItemsArrayByItemTag(_char.key, "type", _type)>>
<<for _idx, _temp_item range _temp_items>>
<<set _temp_item_div = _temp_item + "Char">>
<<set _temp_item_num = _temp_item + "Num">>
<p @id="_temp_item_div" class="tool listItem" @title="_temp_item">
<<= UInv.GetDefaultItemObject(_temp_item).name>>
<span @id="_temp_item_num" style="float: right">
<<= UInv.BagHasItem(_char.key, _temp_item)>>
</span>
</p>
<</for>>
</div>
<</for>><<set _categories = {"armor": "armors", "weapon": "weapons", "accessory": "accessories"}>>
<hr>
<center>
<h3 style="margin-bottom: 0">Player Inventory</h3>
</center>
<<for _type, _category range _categories>>
<hr>
<center><h3 @id="_type" class="tool category"><<= setup.titleCase(_category)>></h3></center>
<<set _type_list = "inv_" + _type + "_list">>
<div @id="_type_list">
<<set _temp_items = UInv.GetItemsArrayByItemTag("inventory", "type", _type)>>
<<for _idx, _temp_item range _temp_items>>
<<set _temp_item_div = _temp_item + "Player">>
<<set _temp_item_num = _temp_item + "Num">>
<p @id="_temp_item_div" class="tool listItem" @title="_temp_item">
<<= UInv.GetDefaultItemObject(_temp_item).name>>
<span @id="_temp_item_num" style="float: right">
<<= UInv.BagHasItem("inventory", _temp_item)>>
</span>
</p>
<</for>>
</div>
<</for>><<if $player.slaves.contains(_char.key)>>
<div id="inventory" class="subbackground hidden">
<<include characterMenuInventory>>
</div>
<<silently>><<script>>
let _t = State.temporary;
let _v = State.variables;
_t.move_items = function(item, quantity, take) {
let temp_item = UInv.GetDefaultItemObject(item);
let destination = null;
let removal = null;
if (take) {
destination = "inventory";
removal = _t.char.key;
} else {
destination = _t.char.key;
removal = "inventory";
}
/* Cap by quantity */
if (UInv.BagHasItem(removal, item) < quantity) {
quantity = UInv.BagHasItem(removal, item);
}
UInv.DeleteItem(removal, item, quantity);
UInv.AddItem(destination, item, quantity);
_t.update_inventories();
};
_t.update_inventories = function() {
$("#playerInventory").empty();
$("#playerInventory").wiki("<<include characterMenuInventoryPlayer>>");
$("#inventory").empty();
$("#inventory").wiki("<<include characterMenuInventory>>");
/* Add category toggles */
$(".category").on("click", (event) => {
let self = $(event.currentTarget);
/* Find category list */
self.parent().parent().find("#inv_" + self.attr("id") + "_list").fadeToggle(0.1);
});
/* Click listener to add to transactions */
$(".listItem").on("click", (event) => {
let self = $(event.currentTarget);
let temp_item = UInv.GetDefaultItemObject(self.attr("title"));
let quantity = 10;
if (event.detail === 1) {
quantity = 1;
}
if (self.attr("id").contains("Player")) {
if (temp_item.type.contains("quest_item")) {
$.wiki("<<notify>>Cannot give quest items.<</notify>>");
} else if (_v.player.has_equipped(self.attr("title"), true).length > 0) {
let num_equipped = _v.player.has_equipped(self.attr("title"), true).length;
if (UInv.BagHasItem("inventory", self.attr("title")) - quantity < num_equipped) {
$.wiki("<<notify>>Cannot give equipped items.<</notify>>");
} else {
_t.move_items(self.attr("title"), quantity.clamp(0, UInv.BagHasItem("inventory", self.attr("title")) - num_equipped), false);
}
} else {
_t.move_items(self.attr("title"), quantity, false);
}
} else {
if (_t.char.has_equipped(self.attr("title"), true).length > 0) {
let num_equipped = _t.char.has_equipped(self.attr("title"), true).length;
if (UInv.BagHasItem(_t.char.key, self.attr("title")) - quantity < num_equipped) {
$.wiki("<<notify>>Cannot take equipped items.<</notify>>");
} else {
_t.move_items(self.attr("title"), quantity.clamp(0, UInv.BagHasItem(_t.char.key, self.attr("title")) - num_equipped), true);
}
} else {
_t.move_items(self.attr("title"), quantity, true);
}
}
});
};
<</script>><</silently>>
<<else>>
<div id="inventory" class="subbackground hidden">
<hr>
<center><h3>Inventory</h3>
<div class="textpassage">
You do not own <<= setup.titleCase(_char.first_name)>> and cannot manage <<= setup.his(_char)>> inventory.
</div>
</center>
</div>
<</if>><hr>
<center><h3>Modifications</h3>
<p class="textpassage">
Assignment: <span style="float: right"><<= setup.titleCase(_char.assignment)>>
<<if _char.assignment == "dayTrade">><<= "(" + _char.finances.investment + ")">><</if>>
</span><br>
<hr>
Diet Amount: <span style="float: right"><<= setup.titleCase(_char.diet.amount)>></span><br>
Diet Additives: <span style="float: right"><<= setup.titleCase(_char.diet.additives)>></span><br>
<hr>
Outfit: <span style="float: right"><<= setup.titleCase(_char.outfit)>></span><br>
<hr>
Rules: <span style="float: right"><<= setup.titleCase(_char.rules.degree)>></span><br>
Punishment: <span style="float: right"><<= setup.titleCase(_char.rules.punishment)>></span><br>
Reward: <span style="float: right"><<= setup.titleCase(_char.rules.reward)>></span><br>
<hr>
Makeup: <span style="float: right"><<= setup.titleCase(_char.makeup)>></span><br>
</p>
</center><<run $("#characterMenuCenterDetailsTitle").html("Addressing You")>>
<<run $("#characterMenuCenterDetailsBody").html("")>>
<<set $enable_keybinds = false>>
You call in <<= setup.titleCase(_char.first_name)>> and examine <<= setup.him(_char)>>.
<<= setup.titleCase(setup.he(_char))>>
<<set _disposition = _char.get_disposition()>>
<<switch _disposition>>
<<case "hateful">>
stares daggers at you.
<<case "depressed">>
keeps <<= (setup.his(_char))>> sight fixed on the floor, disinterested in <<= (setup.his(_char))>>
surroundings.
<<case "scared">>
holds <<= (setup.his(_char))>> body tightly, scared of what's to come next.
<<default>>
stands curiously, wondering what you wanted.
<</switch>>
<<set _temp_address = setup.titleCase(_char.address)>>
<br>
<<= $player.dialogue("You\'re to address me as...")>><br>
<center>
<<textbox "_temp_address" _temp_address>>
<br><br>
<<button "Confirm">>
<<if _temp_address.trim().length == 0>>
<<notify>>Invalid name.<</notify>>
<<elseif _temp_address.trim().toLowerCase() == _char.address.toLowerCase()>>
<<script>>
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
$("#naming").find("button").removeClass("disabled");
$("#naming").find("button").prop("disabled", false);
<</script>>
<<else>>
<<set _char.address = _temp_address.trim().toLowerCase()>>
<<set _response = "">>
<<switch _disposition>>
<<case "hateful">>
<<set _response = _char.dialogue("Yes... " + setup.titleCase(_char.address) + "...")>>
<<case "devoted">>
<<set _response = _char.dialogue("Yes, " + setup.titleCase(_char.address) + "! I\'m always happy to call you \
whatever you ask me to.")>>
<<default>>
<<set _response = _char.dialogue("Yes, " + setup.titleCase(_char.address) + ".")>>
<</switch>>
<<run $("#characterMenuCenterDetailsBody").html("")>>
<<run $("#characterMenuCenterDetailsBody").wiki(_response)>>
<<run $("#characterMenuCenterDetailsBody").wiki("<br><br><center><<button \"Done\">>\
<<script>>\
$(\"#characterMenuCenter\").removeClass(\"hidden\");\
$(\"#characterMenuLeft\").removeClass(\"hidden\");\
$(\"#characterMenuCenterDetails\").addClass(\"hidden\");\
$(\"#naming\").find(\"button\").removeClass(\"disabled\");\
$(\"#naming\").find(\"button\").prop(\"disabled\", false);\
<</script>>\
<<set $enable_keybinds = true>>\
<" + "</button>></center>")>>
<</if>>
<</button>>
<<button "Back">>
<<script>>
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
$("#naming").find("button").removeClass("disabled");
$("#naming").find("button").prop("disabled", false);
<</script>>
<<set $enable_keybinds = true>>
<</button>>
</center><<run $("#characterMenuCenterDetailsTitle").html("Changing First Name")>>
<<run $("#characterMenuCenterDetailsBody").html("")>>
<<set $enable_keybinds = false>>
You call in <<= setup.titleCase(_char.first_name)>> and examine <<= setup.him(_char)>>.
<<= setup.titleCase(setup.he(_char))>>
<<set _disposition = _char.get_disposition()>>
<<switch _disposition>>
<<case "hateful">>
stares daggers at you.
<<case "depressed">>
keeps <<= (setup.his(_char))>> sight fixed on the floor, disinterested in <<= (setup.his(_char))>>
surroundings.
<<case "scared">>
holds <<= (setup.his(_char))>> body tightly, scared of what's to come next.
<<default>>
stands curiously, wondering what you wanted.
<</switch>>
<<set _temp_first_name = setup.titleCase(_char.first_name)>>
<br>
<<= $player.dialogue("Perhaps it would be better if you were called...")>><br>
<center>
<<textbox "_temp_first_name" _temp_first_name>>
<br><br>
<<button "Confirm">>
<<if _temp_first_name.trim().length == 0>>
<<notify>>Invalid name.<</notify>>
<<elseif _temp_first_name.trim().toLowerCase() == _char.first_name.toLowerCase()>>
<<script>>
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
$("#naming").find("button").removeClass("disabled");
$("#naming").find("button").prop("disabled", false);
<</script>>
<<else>>
<<set _char.first_name = _temp_first_name.trim().toLowerCase()>>
<<run $("#characterMenuFullName").html(setup.titleCase(_char.first_name) + " " + setup.titleCase(_char.last_name))>>
<<set _response = "">>
<<switch _disposition>>
<<case "hateful">>
<<set _response = setup.titleCase(setup.he(_char)) + " nods " + setup.his(_char) +
" head and accepts " + setup.his(_char) + " new name, but you can tell there is resentment in " +
setup.his(_char) + " eyes that scream against the further wiping of " + setup.his(_char) +
" identity " + _char.print_delta({"obedience": -1}) + ".">>
<<set _char.slave_traits.obedience -= 1>>
<<case "devoted">>
<<set _response = setup.titleCase(setup.he(_char)) + " nods " + setup.his(_char) +
" head and accepts " + setup.his(_char) + " new name with utmost pleasure. You can tell that " +
" being given a new name by " + setup.his(_char) + " master brings " + setup.him(_char) +
" joy.">>
<<default>>
<<set _response = setup.titleCase(setup.he(_char)) + " nods " + setup.his(_char) +
" head and accepts " + setup.his(_char) + " new name.">>
<</switch>>
<<run $("#characterMenuCenterDetailsBody").html("")>>
<<run $("#characterMenuCenterDetailsBody").wiki(_response)>>
<<run $("#characterMenuCenterDetailsBody").wiki("<br><br><center><<button \"Done\">>\
<<script>>\
$(\"#characterMenuCenter\").removeClass(\"hidden\");\
$(\"#characterMenuLeft\").removeClass(\"hidden\");\
$(\"#characterMenuCenterDetails\").addClass(\"hidden\");\
$(\"#naming\").find(\"button\").removeClass(\"disabled\");\
$(\"#naming\").find(\"button\").prop(\"disabled\", false);\
<</script>>\
<" + "</button>></center>")>>
<</if>>
<</button>>
<<button "Back">>
<<script>>
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
$("#naming").find("button").removeClass("disabled");
$("#naming").find("button").prop("disabled", false);
<</script>>
<</button>>
</center><<run $("#characterMenuCenterDetailsTitle").html("Changing Last Name")>>
<<run $("#characterMenuCenterDetailsBody").html("")>>
<<set $enable_keybinds = false>>
You call in <<= setup.titleCase(_char.first_name)>> and examine <<= setup.him(_char)>>.
<<= setup.titleCase(setup.he(_char))>>
<<set _disposition = _char.get_disposition()>>
<<switch _disposition>>
<<case "hateful">>
stares daggers at you.
<<case "depressed">>
keeps <<= (setup.his(_char))>> sight fixed on the floor, disinterested in <<= (setup.his(_char))>>
surroundings.
<<case "scared">>
holds <<= (setup.his(_char))>> body tightly, scared of what's to come next.
<<default>>
stands curiously, wondering what you wanted.
<</switch>>
Since the crumbling of most structure in the world, family names are very symbolic and important. You can choose to
give your slaves a vassal name, or perhaps even your own surname if you want them to carry your legacy.
<<set _temp_last_name = setup.titleCase(_char.last_name)>>
<br>
<<= $player.dialogue("Perhaps it would be better if you were called...")>><br>
<center>
<<textbox "_temp_last_name" _temp_last_name>>
<br><br>
<<button "Confirm">>
<<set _temp_last_name = _temp_last_name.trim().toLowerCase()>>
<<if _temp_last_name.length == 0>>
<<notify>>Invalid name.<</notify>>
<<elseif _temp_last_name == "hiroyuki" || _temp_last_name == "namm" || _temp_last_name == "sike">>
<<notify>>You do not have the authority to bestow this family name.<</notify>>
<<elseif _temp_last_name.trim().toLowerCase() == _char.last_name.toLowerCase()>>
<<script>>
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
$("#naming").find("button").removeClass("disabled");
$("#naming").find("button").prop("disabled", false);
<</script>>
<<else>>
<<set _char.last_name = _temp_last_name.trim().toLowerCase()>>
<<run $("#characterMenuFullName").html(setup.titleCase(_char.first_name) + " " + setup.titleCase(_char.last_name))>>
<<set _response = "">>
<<switch _disposition>>
<<case "hateful">>
<<set _response = setup.titleCase(setup.he(_char)) + " nods " + setup.his(_char) +
" head and accepts " + setup.his(_char) + " new name, but you can tell there is resentment in " +
setup.his(_char) " eyes that scream against the further wiping of " + setup.his(_char) +
" identity " + _char.print_delta({"obedience": -2}) + ".">>
<<set _char.slave_traits.obedience -= 2>>
<<case "devoted">>
<<set _response = setup.titleCase(setup.he(_char)) + " nods " + setup.his(_char) +
" head and accepts " + setup.his(_char) + " new name with utmost pleasure. You can tell that " +
" being given a new name by " + setup.his(_char) + " master brings " + setup.him(_char) +
" joy.">>
<<default>>
<<set _response = setup.titleCase(setup.he(_char)) + " nods " + setup.his(_char) +
" head and accepts " + setup.his(_char) + " new name.">>
<</switch>>
<<run $("#characterMenuCenterDetailsBody").html("")>>
<<run $("#characterMenuCenterDetailsBody").wiki(_response)>>
<<run $("#characterMenuCenterDetailsBody").wiki("<br><br><center><<button \"Done\">>\
<<script>>\
$(\"#characterMenuCenter\").removeClass(\"hidden\");\
$(\"#characterMenuLeft\").removeClass(\"hidden\");\
$(\"#characterMenuCenterDetails\").addClass(\"hidden\");\
$(\"#naming\").find(\"button\").removeClass(\"disabled\");\
$(\"#naming\").find(\"button\").prop(\"disabled\", false);\
<</script>>\
<" + "</button>></center>")>>
<</if>>
<</button>>
<<button "Back">>
<<script>>
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
$("#naming").find("button").removeClass("disabled");
$("#naming").find("button").prop("disabled", false);
<</script>>
<</button>>
</center><div id="naming" class="subbackground hidden">
<hr>
<center><h3>Naming</h3>
<<if $player.slaves.contains(_char.key)>>
<div id="slaveName" class="threeHalfs smalltext longbutton column">
@@#firstName;<<button "First Name">><</button>>@@
@@#lastName;<<button "Last Name">><</button>>@@
</div>
<div id="playerName" class="threeHalfs smalltext longbutton column">
@@#address;<<button "Address">><</button>>@@
</div>
<<else>>
<div class="textpassage">
You do not own <<= setup.titleCase(_char.first_name)>> or have their permission to modify them in any way.
</div>
<</if>>
</center>
</div>
<<silently>><<timed 50ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
let player = State.variables.player;
let char = State.temporary.char;
$("#naming").find("button").on("click", (event) => {
$("#naming").find("button").removeClass("disabled");
$("#naming").find("button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
let passage = "naming" + setup.camelize(self.html()).toLocaleUpperFirst();
if (tale.has(passage)) {
$("#characterMenuCenterDetailsBody").wiki("<<include " + passage + ">>");
$("#characterMenuCenterDetails").removeClass("hidden");
$("#characterMenuCenter").addClass("hidden");
$("#characterMenuLeft").addClass("hidden");
} else {
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
/* TODO: Implement */
$.wiki("<<notify>>WIP<</notify>>")
}
});
<</script>><</timed>><</silently>><div id="otherSlaves" class="subbackground hidden">
<hr>
<center><h3>Manage</h3>
<<for _idx, _selection range $selection_queue>>
<<capture _idx>>
<div class="threeHalfs smalltext longbutton column">
<<if $selected == _selection>>
<<disable>>
<<button `setup.titleCase($characters[$selection_queue[_idx]].first_name)`>><</button>>
<</disable>>
<<else>>
<<button `setup.titleCase($characters[$selection_queue[_idx]].first_name)`>>
<<set $selected = $selection_queue[_idx]>>
<<goto characterMenu>>
<</button>>
<</if>>
</div>
<</capture>>
<</for>>
</center>
</div><div id="outfit" class="subbackground hidden">
<hr>
<center><h3>Outfit</h3>
<div id="outfitNormal" class="threeHalfs smalltext longbutton column">
@@#ownChoice;<<button "Own Choice">><</button>>@@
</div>
<hr>
<h3>Humiliating</h3>
<div id="outfitHumiliating" class="threeHalfs smalltext longbutton column">
@@#naked;<<button "Naked">><</button>>@@
</div>
</center>
</div>
<<silently>><<timed 50ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
let player = State.variables.player;
let char = State.temporary.char;
$("#outfit").find("#" + char.outfit + " button").addClass("disabled");
$("#outfit").find("#" + char.outfit + " button").prop("disabled", true);
$("#outfit").find("button").on("click", (event) => {
$("#outfit").find("button").removeClass("disabled");
$("#outfit").find("button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
let outfit = setup.camelize(self.html());
char.outfit = outfit;
});
<</script>><</timed>><</silently>><<run $("#characterMenuCenterDetailsTitle").html("Rule Enforcement");>>
<<set _flavor_text = "\
The level of enforcement or <em>degree</em> of the rules acts as a multiplier for the other rules. A lax \
degree of enforcement makes punishments less severe and rewards more common, while a strict degree of enforcement \
does the opposite."
>>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>><<run $("#characterMenuCenterDetailsTitle").html("Masturbation - Denied");>>
<<set _flavor_text = "\
You decide to deny " + setup.titleCase(_char.first_name) + " the right to masturbate and alleviate their sexual needs by themselves. \
This action has a chance of lowering " + setup.his(_char) + " libido, but if " + setup.he(_char) +
" already has a high libido " + setup.he(_char) + " will be unable to follow the rules, which will incur more punishment as well as raise " +
setup.his(_char) + " arousal and lower " + setup.his(_char) + " affection. Finally this \
rule will have no effect if they are wearing a chastity cage."
>>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>><<run $("#characterMenuCenterDetailsTitle").html("Masturbation - Required");>>
<<set _flavor_text = "\
You decide to force " + setup.titleCase(_char.first_name) + " to masturbate. This action has a chance of raising " +
setup.his(_char) + " libido, but if " + setup.he(_char) + " has a low libido " +
setup.he(_char) + " will be unable to follow the rules, which will incur more punishment as well as lower " +
setup.his(_char) + " affection. Finally this rule will have no effect if they are wearing a chastity cage."
>>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>><<run $("#characterMenuCenterDetailsTitle").html("Punishment - Chastity");>>
<<set _flavor_text = "\
As punishment for misbehavior you can force " + setup.titleCase(_char.first_name) + " to be completely devoid of sexual gratification \
for an extended period of time. Note that this punishment only works for those that are interestered in sex or have a high libido. \
Also completely ineffective for those with a chastity cage equipped."
>>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>><<run $("#characterMenuCenterDetailsTitle").html("Punishment - Whipping");>>
<<set _flavor_text = "\
The most classical of punishments is whipping. While it is very efficient at instilling fear and overall obedience, it does so \
at a steep price. Depending on how often one in punished, they may suffer from mental ailments such as depression, or suffer \
permanent physical injuries."
>>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>><<run $("#characterMenuCenterDetailsTitle").html("Reward - Free Time");>>
<<set _flavor_text = "\
The most classical of rewards is allowing " + setup.titleCase(_char.first_name) + " to have extra free time at the end of the day. \
This reward while increasing willpower, works especially well for those with high intelligence. It builds a good amount of obedience \
through time as well as acting as a counter measure against any possible developing mental ailments. Overall, this reward will increase \
" + setup.titleCase(_char.first_name) + "\'s happiness without too much adversarial effects."
>>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>><<run $("#characterMenuCenterDetailsTitle").html("Reward - Orgasm");>>
<<set _flavor_text = "\
As a reward for good behavior, you can make " + setup.titleCase(_char.first_name) + " orgasm. This reward is especially effective when \
paired with chastity or having a chastity cage equipped. Overtime, the pleasure of orgasm will be invariably linked with good behavior \
causing both an increase in libido as well as obedience."
>>
<<run $("#characterMenuCenterDetailsBody").html(_flavor_text)>><div id="rules" class="subbackground hidden" style="padding-bottom: 25px;">
<hr>
<center><h3>Rules</h3>
<div id="rulesDegree" class="threeHalfs smalltext longbutton column">
@@#lax;<<button "Lax">><</button>>@@
@@#normal;<<button "Normal">><</button>>@@
@@#strict;<<button "Strict">><</button>>@@
</div>
<hr>
<h3>Punishments</h3>
<div id="rulesPunishments" class="threeHalfs smalltext longbutton column">
@@#balanced;<<button "Balanced">><</button>>@@
@@#chastity;<<button "Chastity">><</button>>@@
@@#whipping;<<button "Whipping">><</button>>@@
</div>
<hr>
<h3>Rewards</h3>
<div id="rulesRewards" class="threeHalfs smalltext longbutton column">
@@#balanced;<<button "Balanced">><</button>>@@
@@#orgasm;<<button "Orgasm">><</button>>@@
@@#freeTime;<<button "Free Time">><</button>>@@
</div>
<hr>
<h3>Masturbation</h3>
<div id="rulesMasturbation" class="threeHalfs smalltext longbutton column">
@@#permitted;<<button "Permitted">><</button>>@@
@@#denied;<<button "Denied">><</button>>@@
@@#required;<<button "Required">><</button>>@@
</div>
<center class="threeHalfs smalltext longbutton column">
<hr>
<<button "Done">><<script>>
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
<</script>><</button>>
</center>
</center>
</div>
<<silently>><<timed 50ms>>
<<script>>
let _t = State.temporary;
let _v = State.variables;
let player = State.variables.player;
let char = State.temporary.char;
$("#rulesDegree").find("#" + char.rules.degree + " button").addClass("disabled");
$("#rulesDegree").find("#" + char.rules.degree + " button").prop("disabled", true);
$("#rulesPunishments").find("#" + char.rules.punishment + " button").addClass("disabled");
$("#rulesPunishments").find("#" + char.rules.punishment + " button").prop("disabled", true);
$("#rulesRewards").find("#" + char.rules.reward + " button").addClass("disabled");
$("#rulesRewards").find("#" + char.rules.reward + " button").prop("disabled", true);
$("#rulesMasturbation").find("#" + char.rules.masturbation + " button").addClass("disabled");
$("#rulesMasturbation").find("#" + char.rules.masturbation + " button").prop("disabled", true);
$("#rulesDegree").find("button").on("click", (event) => {
$("#rulesDegree").find("button").removeClass("disabled");
$("#rulesDegree").find("button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
let degree = setup.camelize(self.html());
char.rules.degree = degree;
$.wiki("<<include rulesDegree>>");
$("#characterMenuCenterDetails").removeClass("hidden");
$("#characterMenuCenter").addClass("hidden");
$("#characterMenuLeft").addClass("hidden");
});
$("#rulesPunishments").find("button").on("click", (event) => {
$("#rulesPunishments").find("button").removeClass("disabled");
$("#rulesPunishments").find("button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
let punishment = setup.camelize(self.html());
char.rules.punishment = punishment;
let passage = "rulesPunishments" + punishment.toLocaleUpperFirst();
if (tale.has(passage)) {
$.wiki("<<include " + passage + ">>");
$("#characterMenuCenterDetails").removeClass("hidden");
$("#characterMenuCenter").addClass("hidden");
$("#characterMenuLeft").addClass("hidden");
} else {
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
}
});
$("#rulesRewards").find("button").on("click", (event) => {
$("#rulesRewards").find("button").removeClass("disabled");
$("#rulesRewards").find("button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
let reward = setup.camelize(self.html());
char.rules.reward = reward;
let passage = "rulesRewards" + reward.toLocaleUpperFirst();
if (tale.has(passage)) {
$.wiki("<<include " + passage + ">>");
$("#characterMenuCenterDetails").removeClass("hidden");
$("#characterMenuCenter").addClass("hidden");
$("#characterMenuLeft").addClass("hidden");
} else {
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
}
});
$("#rulesMasturbation").find("button").on("click", (event) => {
$("#rulesMasturbation").find("button").removeClass("disabled");
$("#rulesMasturbation").find("button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
let masturbation = setup.camelize(self.html());
char.rules.masturbation = masturbation;
let passage = "rulesMasturbation" + masturbation.toLocaleUpperFirst();
if (tale.has(passage)) {
$.wiki("<<include " + passage + ">>");
$("#characterMenuCenterDetails").removeClass("hidden");
$("#characterMenuCenter").addClass("hidden");
$("#characterMenuLeft").addClass("hidden");
} else {
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
}
});
<</script>>
<</timed>><</silently>><<script>>
/* Set the title */
$("#characterMenuCenterDetailsTitle").html("Salon - Make Up");
/* Empty out the div */
$("#characterMenuCenterDetailsBody").empty();
<</script>>
Makeup is a rare commodity for the upper class. It allows deception of both the mind and heart. A higher beauty
is extremely desirable for larger profit margins at brothels.<br><br>
<center id="makeup" class="fiveQuarters column">
<<if _char.makeup == "none">>
<<disable>>@@#none;<<button "None">><</button>>@@<br><</disable>>
<<else>>
@@#none;<<button "None">><</button>>@@<br>
<</if>>
<<if _char.makeup == "nice">>
<<disable>>@@#nice;<<button "Nice">><</button>>@@<br><</disable>>
<<else>>
@@#nice;<<button "Nice">><</button>>@@<br>
<</if>>
<<if _char.makeup == "gorgeous">>
<<disable>>@@#gorgeous;<<button "Gorgeous">><</button>>@@<br><</disable>>
<<else>>
@@#gorgeous;<<button "Gorgeous">><</button>>@@<br>
<</if>>
</center><br>
<div id="makeupDesc">
<div id="nice" class="hidden">
A set of subtle, but nice, makeup which compliments <<= setup.titleCase(_char.first_name)>>'s features.
<ul>
<li>Beauty: <<= setup.show_change_html(0, 5, true)>></li>
<li>Cost: <span class="fail"><<= setup.LARI + "500">></span></li>
</ul>
</div>
<div id="gorgeous" class="hidden">
A set of gorgeous makeup which compliments <<= setup.titleCase(_char.first_name)>>'s features as well as fixes imperfections.
<ul>
<li>Beauty: <<= setup.show_change_html(0, 10, true)>></li>
<li>Cost: <span class="fail"><<= setup.LARI + "1500">></span></li>
</ul>
</div>
</div>
<center class="fiveQuarters">
<<button "Back">>
<<script>>
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
$("#salon_buttons").find("button").removeClass("disabled");
$("#salon_buttons").find("button").prop("disabled", false);
<</script>>
<</button>>
<<disable>>
@@#makeupConfirm;<<button "Confirm">>
<<if _char.makeup != _new_makeup>>
<<set _cost = 0>>
<<set _beauty_change = 0>>
<<if _new_makeup == "nice">>
<<set _cost = 500>>
<<set _beauty_change = 5>>
<<elseif _new_makeup == "gorgeous">>
<<set _cost = 1500>>
<<set _beauty_change = 10>>
<</if>>
<<if $player.get_money() gt _cost>>
/* Remove previous makeup */
<<if _char.makeup == "nice">>
<<set _char.physical_traits.beauty -= 5>>
<<elseif _char.makeup == "gorgeous">>
<<set _char.physical_traits.beauty -= 10>>
<</if>>
/* Apply new makeup */
<<set _char.physical_traits.beauty += _beauty_change>>
<<set _char.makeup = _new_makeup>>
<<unset _new_makeup>>
<<removemoney _cost>>
<<audio coins_sound play>>
<<script>>
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
$("#salon_buttons").find("button").removeClass("disabled");
$("#salon_buttons").find("button").prop("disabled", false);
/* Update summary */
$("#summary").empty();
$("#summary").wiki("<hr>\
<center><h3>Summary</h3></center>\
<div class=\"textpassage\">\
<<= _char.toString(true)>>\
</div>");
<</script>>
<<else>>
<<notify>>Insufficient funds.<</notify>>
<</if>>
<<else>>
<<script>>
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
$("#salon_buttons").find("button").removeClass("disabled");
$("#salon_buttons").find("button").prop("disabled", false);
<</script>>
<</if>>
<</button>>@@
<</disable>>
</center>
<<silently>><<timed 10ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
$("#makeup").find("button").on("click", (event) => {
let self = $(event.currentTarget);
$("#makeup").find("button").removeClass("disabled");
$("#makeup").find("button").prop("disabled", false);
self.addClass("disabled");
self.prop("disabled", true);
$("#makeupDesc").children().addClass("hidden");
$("#makeupDesc").find("#" + self.html().toLowerCase()).removeClass("hidden");
_t.new_makeup = self.html().toLowerCase();
if (_t.new_makeup == _t.char.makeup) {
$("#makeupConfirm button").addClass("disabled");
$("#makeupConfirm button").prop("disabled", true);
} else {
$("#makeupConfirm button").removeClass("disabled");
$("#makeupConfirm button").prop("disabled", false);
}
})
<</script>><</timed>><</silently>><div id="salon" class="subbackground hidden">
<hr>
<center><h3>Salon</h3>
<<if $player.slaves.contains(_char.key)>>
<div id="salon_buttons" class="threeHalfs smalltext longbutton column">
@@#hair;<<button "Hair">><</button>>@@
@@#makeUp;<<button "Makeup">><</button>>@@
@@#nails;<<button "Nails">><</button>>@@
@@#piercings;<<button "Piercings">><</button>>@@
@@#tattoos;<<button "Tattoos">><</button>>@@
</div>
<<else>>
<div class="textpassage">
You do not own <<= setup.titleCase(_char.first_name)>> or have their permission to modify them in any way.
</div>
<</if>>
</center>
</div>
<<silently>><<timed 50ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
let player = State.variables.player;
let char = State.temporary.char;
$("#salon_buttons").find("button").on("click", (event) => {
$("#salon_buttons").find("button").removeClass("disabled");
$("#salon_buttons").find("button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
let passage = "characterMenuSalon" + setup.camelize(self.html()).toLocaleUpperFirst();
if (tale.has(passage)) {
$("#characterMenuCenterDetailsBody").wiki("<<include " + passage + ">>");
$("#characterMenuCenterDetails").removeClass("hidden");
$("#characterMenuCenter").addClass("hidden");
$("#characterMenuLeft").addClass("hidden");
} else {
$("#characterMenuCenter").removeClass("hidden");
$("#characterMenuLeft").removeClass("hidden");
$("#characterMenuCenterDetails").addClass("hidden");
/* TODO: Implement */
$.wiki("<<notify>>WIP<</notify>>");
}
});
<</script>><</timed>><</silently>><<nobr>>
<div id="sexPrefs" class="subbackground hidden">
<hr>
<center><h3>Sex Preferences</h3></center>
<<if _char.sex_prefs_known>>
<div class="container twoCol">
<div style="text-align: left; margin-left: 20px">
<<for _i = 0; _i lt setup.SEX_PREFS.length; _i++>>
<<= setup.titleCase(setup.SEX_PREFS[_i])>>
<br>
<</for>>
</div>
<div style="text-align: right; margin-right: 20px">
<<for _i = 0; _i lt setup.SEX_PREFS.length; _i++>>
<<= setup.round2(_char.sex_prefs[setup.SEX_PREFS[_i]]).toString().padStart(3, '\u2000')>>
<br>
<</for>>
</div>
</div>
<<else>>
<div class="textpassage">
You do not know <<= setup.titleCase(_char.first_name)>>'s sex likes or dislikes.
</div>
<</if>>
<<if _char.fetishes_known>>
<div class="container twoCol">
<div style="text-align: left; margin-left: 20px">
<<for _i = 0; _i lt setup.SEX_FETISHES.length; _i++>>
<<= setup.titleCase(setup.SEX_FETISHES[_i])>>
<br>
<</for>>
</div>
<div style="text-align: right; margin-right: 20px">
<<for _i = 0; _i lt setup.SEX_FETISHES.length; _i++>>
<<= setup.round2(_char.sex_fetishes[setup.SEX_FETISHES[_i]]).toString().padStart(3, '\u2000')>>
<br>
<</for>>
</div>
</div>
<<else>>
<div class="textpassage">
You do not know <<= setup.titleCase(_char.first_name)>>'s fetishes.
</div>
<</if>>
</div>
<</nobr>><<nobr>>
<div id="skills" class="subbackground hidden">
<hr>
<center><h3>Skills</h3></center>
<<if _char.skills_known>>
<div class="container twoCol">
<div style="text-align: left; margin-left: 20px">
<<for _i = 0; _i lt setup.SKILLS.length; _i++>>
<<= setup.titleCase(setup.SKILLS[_i])>>
<br>
<</for>>
</div>
<div style="text-align: right; margin-right: 20px">
<<for _i = 0; _i lt setup.SKILLS.length; _i++>>
<<= setup.round2(_char.skills[setup.SKILLS[_i]]).toString().padStart(3, '\u2000')>>
<br>
<</for>>
</div>
</div>
<hr>
<center><h3>Sex Skills</h3></center>
<div class="container twoCol">
<div style="text-align: left; margin-left: 20px">
<<for _i = 0; _i lt setup.SEX_SKILLS.length; _i++>>
<<= setup.titleCase(setup.SEX_SKILLS[_i])>>
<br>
<</for>>
</div>
<div style="text-align: right; margin-right: 20px">
<<for _i = 0; _i lt setup.SEX_SKILLS.length; _i++>>
<<= setup.round2(_char.sex_skills[setup.SEX_SKILLS[_i]]).toString().padStart(3, '\u2000')>>
<br>
<</for>>
</div>
</div>
<<else>>
<div class="textpassage">
You do not know <<= setup.titleCase(_char.first_name)>>'s skills.
</div>
<</if>>
</div>
<</nobr>><<nobr>>
<div id="stats" class="subbackground hidden">
<hr>
<center><h3>Stats</h3></center>
<<if _char.stats_known>>
<div class="container twoCol">
<div style="text-align: left; margin-left: 20px">
Sex <br>
Age <br>
<br>
<<for _i = 0; _i lt setup.STATS.length; _i++>>
<<= setup.titleCase(setup.STATS[_i])>>
<br>
<</for>>
</div>
<div style="text-align: right; margin-right: 20px">
<<if _char.gender == 0>>
Male
<<else>>
Female
<</if>> <br>
<<= _char.age()>> <br>
<br>
<<for _i = 0; _i lt setup.STATS.length; _i++>>
<<if $difficulty == 2>>
<<= setup.titleCase(_char.get_descriptor(setup.STATS[_i]))>>
<<else>>
<<= _char.stats[setup.STATS[_i]]>>
<</if>>
<br>
<</for>>
</div>
</div>
<<else>>
<div class="textpassage">
You do not know <<= setup.titleCase(_char.first_name)>>'s stats.
</div>
<</if>>
</div>
<</nobr>><<nobr>>
<div id="summary" class="subbackground">
<hr>
<center><h3>Summary</h3></center>
<div class="textpassage">
<<= _char.toString(true)>>
</div>
</div>
<</nobr>><<nobr>>
<div id="surgery" class="subbackground hidden">
<hr>
<center><h3>Surgery</h3>
<<if $player.slaves.contains(_char.key)>>
<div class="textpassage">
You do not have the equipment or resources to perform surgey on <<= setup.titleCase(_char.first_name)>>.
</div>
<<else>>
<div class="textpassage">
You do not own <<= setup.titleCase(_char.first_name)>> and cannot perform surgery on <<= setup.him(_char)>>.
</div>
<</if>>
</center>
</div>
<</nobr>><<nobr>>
<div id="background" class="paper_border" style="position: relative">
<center><h1 style="color: red">You Died</h1></center>
<p id="death_summary" class="textpassage" style="display: none">
The harsh world has claimed your life whether it was exhaustion, injury, or sickness,
<<= $player.name()>> has perished in this land. Since you do not have any next of kin, your
story ends here, burried in the sands ashes of yesterday.
<br><br>
<center>
<<button Saves>>
<<script>>
UI.saves();
<</script>>
<</button>>
<<button Quit>>
<<run Engine.restart()>>
<</button>>
</center>
</p>
</div>
<<script>>
setTimeout(() => {
$("#death_summary").fadeIn();
}, 500);
<</script>>
/* Reset awake counter */
<<set $rest_momentum = 0>>
<<include round>>
<</nobr>><<button "Manipulation +10">>
<<set $player.stats.manipulation += 10>>
<<include round>>
<</button>>
<<button "Trust 100">>
<<set $player.slave_traits.trust = 100>>
<<include round>>
<<include updateBars>>
<</button>><br>
<<button "Willpower 100">>
<<set $player.slave_traits.willpower = 100>>
<<include round>>
<<include updateBars>>
<</button>>
<<button `setup.LARI + "1000"`>>
<<addmoney 1000>>
<<audio coins_sound play>>
<<updatetime>>
<</button>><hr>
<center><h3>Library</h3></center>
<div class="manageMenuBody textpassage">
A library is useful for studying as well as studying books.<br><br>
<div id="desc">
<<if $player_home[$last_visited].library == 0>>
You have not yet built the library.
<<else>>
<<set _fac = setup.playerHome[$last_visited].library[$player_home[$last_visited].library]>>
Current level: <<= $player_home[$last_visited].library>>.
<<= _fac.flavor_text>><br>
<b>Daily changes:</b>
<ul>
<<for _key, _val range _fac.daily_changes.player>>
<li>Player <<= setup.titleCase(_key)>>: <<= setup.show_change_html(0, _val)>></li>
<</for>>
</ul>
<</if>>
</div>
</div>
<div class="manageMenuButtons">
<center id="main" class="fiveQuarters">
<<if $player_home[$last_visited].library gt 0>>
<<if $player_home[$last_visited].library == 1>>
<<button "Deconstruct">>
<<set _build = -1>>
<<run $("#main").addClass("hidden")>>
<<run $("#confirm").removeClass("hidden")>>
<</button>>
<<else>>
<<button "Downgrade">>
<<set _build = -1>>
<<run $("#main").addClass("hidden")>>
<<run $("#confirm").removeClass("hidden")>>
<</button>>
<</if>>
<</if>>
<<button "Back">><<script>>
$("#manageMenuDetails").empty();
$("#manageMenuDetails").wiki("<<include manageMenuMain>>");
$("#facility_buttons").find(".enabled button").removeClass("disabled");
$("#facility_buttons").find(".enabled button").prop("disabled", false);
<</script>><</button>>
<<if $player_home[$last_visited].library lt setup.playerHome[$last_visited].library.max_stage>>
<<if $player_home[$last_visited].library == 0>>
<<button "Construct">>
<<set _build = 1>>
<<run $("#main").addClass("hidden")>>
<<run $("#confirm").removeClass("hidden")>>
<<run $("#desc").empty()>>
<<run $("#desc").wiki(
" <<set _fac = setup.playerHome[$last_visited].library[$player_home[$last_visited].library + 1]>>\
New level: <<= $player_home[$last_visited].library + 1>>. \
<<= _fac.flavor_text>><br>\
<b>Cost: " + setup.playerHome[$last_visited].library[$player_home[$last_visited].library + _build].cost + "</b><br>\
<b>Daily changes:</b>\
<ul>\
<<for _key, _val range _fac.daily_changes.player>>\
<li>Player <<= setup.titleCase(_key)>>: <<= setup.show_change_html(0, _val)>></li>\
<</for>>\
</ul>")>>
<</button>>
<<else>>
<<button "Upgrade">>
<<set _build = 1>>
<<run $("#main").addClass("hidden")>>
<<run $("#confirm").removeClass("hidden")>>
<<run $("#desc").empty()>>
<<run $("#desc").wiki(
" <<set _fac = setup.playerHome[$last_visited].library[$player_home[$last_visited].library + 1]>>\
New level: <<= $player_home[$last_visited].library + 1>>. \
<<= _fac.flavor_text>><br>\
<b>Cost: " + setup.playerHome[$last_visited].library[$player_home[$last_visited].library + _build].cost + "</b><br>\
<b>Daily changes:</b>\
<ul>\
<<for _key, _val range _fac.daily_changes.player>>\
<li>Player <<= setup.titleCase(_key)>>: <<= setup.show_change_html(0, _val)>></li>\
<</for>>\
</ul>")>>
<</button>>
<</if>>
<</if>>
</center>
<center id="confirm" class="hidden fiveQuarters">
<<button "Back">>
<<run $("#main").removeClass("hidden")>>
<<run $("#confirm").addClass("hidden")>>
<<run $("#desc").empty()>>
<<run $("#desc").wiki(
" <<if $player_home[$last_visited].library == 0>>\
You have not yet built the library.\
<<else>>\
<<set _fac = setup.playerHome[$last_visited].library[$player_home[$last_visited].library]>>\
Current level: <<= $player_home[$last_visited].library>>. \
<<= _fac.flavor_text>><br>\
<b>Daily changes:</b>\
<ul>\
<<for _key, _val range _fac.daily_changes.player>>\
<li>Player <<= setup.titleCase(_key)>>: <<= setup.show_change_html(0, _val)>></li>\
<</for>>\
</ul>\
<" + "</if>>")>>
<</button>>
<<button "Confirm">>
<<if _build lte 0>>
/* Deconstruct is free */
<<else>>
<<set _cost = setup.playerHome[$last_visited].library[$player_home[$last_visited].library + _build].cost>>
<<if $player.get_money() gte _cost>>
<<removemoney _cost>>
<<audio coins_sound play>>
<<set $player_home[$last_visited].library += _build>>
<<set _build = 0>>
<<run $("#manageMenuDetails").empty()>>
<<run $("#manageMenuDetails").wiki("<<include manageMenuLiasTowerLibrary>>")>>
<<run $("#capital").empty()>>
<<run $("#capital").wiki("<<= setup.LARI>><<money>><br>")>>
<<else>>
<<notify>>Insufficient funds.<</notify>>
<</if>>
<</if>>
<</button>>
</center>
</div><hr>
<center><h3><<= setup.locations.get($last_visited).name>></h3></center>
<div class="manageMenuBody textpassage">
<b>Facilities</b>
<ul>
<<for _key, _facility range setup.playerHome[$last_visited]>>
<li><<= setup.titleCase(_key)>>:
<<if _facility.construction>>
WIP
<<elseif $player_home[$last_visited][_key] == 0>>
Unconstructed
<<else>>
Level <<= $player_home[$last_visited][_key]>>
<</if>>
</li>
<</for>>
</ul>
</div>
<div class="manageMenuButtons">
<center id="main">
<<button "Back">>
<<set $in_menu = false>>
<<goto $last_visited>>
<<set $last_visited = "">>
<</button>>
</center>
</div><div class="charside left">
<<set _female_slaves = 0>>
<<for _idx, _val range $player.slaves>>
<<if $characters[_val].gender == 1>>
<<set _female_slaves += 1>>
<</if>>
<</for>>
<hr>
<center><h3>Finances</h3>
<div class="container twoCol" style="font-weight: normal; grid-template-columns: 40% 55%; column-gap: 5%">
<div style="text-align: left; margin-left: 10px">
Capital:<br>
</div>
<div id="capital" style="text-align: right; margin-right: 10px; font-weight: normal">
<<= setup.LARI>><<money>><br>
</div>
</div>
</center>
<hr>
<center><h3>Slaves</h3>
<div class="container twoCol" style="font-weight: normal; grid-template-columns: 45% 50%; column-gap: 5%">
<div style="text-align: left; margin-left: 10px">
Females:<br>
Males:<br>
Total:
</div>
<div id="owned_slaves" style="text-align: right; margin-right: 10px; font-weight: normal">
_female_slaves<br>
<<= $player.slaves.length - _female_slaves>><br>
<<= $player.slaves.length>>
</div>
</div>
</center>
</div>
<div id="background" class="paper_border notext">
<div class="main container threeCol" style="height: 100%; width: 100%;">
<div id="manageMenuDetails" class="subbackground">
<<include manageMenuMain>>
</div>
<div id="manageMenuActions" class="subbackground">
<hr>
<center><h3>Facilities</h3></center>
<center id="facility_buttons" class="threeHalfs smalltext longbutton column">
<<for _key, _facility range setup.playerHome[$last_visited]>>
<<if !_facility.construction>>
<<capture _key>>
@@.enabled;<<button `setup.titleCase(_key)`>>
<<run $("#manageMenuDetails").empty()>>
<<run $("#manageMenuDetails").wiki("<<include manageMenu" + $last_visited.toLocaleUpperFirst() +
setup.titleCase(_key).toLocaleUpperFirst() + ">>")>>
<</button>>@@
<</capture>>
<<else>>
<<disable>>
<<button `setup.titleCase(_key)`>><</button>>
<</disable>>
<</if>>
<</for>>
</center>
</div>
</div>
</div>
<<silently>><<timed 10ms>><<script>>
$("#facility_buttons").find("button").on("click", (event) => {
let self = $(event.currentTarget);
$("#facility_buttons").find(".enabled button").removeClass("disabled");
$("#facility_buttons").find(".enabled button").prop("disabled", false);
self.addClass("disabled");
self.prop("disabled", true);
});
<</script>><</timed>><</silently>><<set _char = $player>>
<<include characterMenuCombatStats>><<nobr>>
<div id="equipOverlay" class="hidden" style="position: relative; width: 0; height: 0; margin-left: -5px">
<div class="equipOverlay">
<div id="armor">
<div id="headLine"></div>
<div id="head" class="equipButton">
<<button "">><</button>>
</div>
<div id="chestLine"></div>
<div id="chest" class="equipButton">
<<button "">><</button>>
</div>
<div id="legsLine"></div>
<div id="legs" class="equipButton">
<<button "">><</button>>
</div>
<div id="feetLine"></div>
<div id="feet" class="equipButton">
<<button "">><</button>>
</div>
</div>
<div id="accessories">
<div id="neckLine"></div>
<div id="neck" class="equipButton">
<<button "">><</button>>
</div>
<div id="weaponLine"></div>
<div id="weapon1" class="equipButton">
<<button "">><</button>>
</div>
<div id="weapon2" class="equipButton">
<<button "">><</button>>
</div>
<div id="groinLine"></div>
<div id="groin1" class="equipButton">
<<button "">><</button>>
</div>
<div id="groin2" class="equipButton">
<<button "">><</button>>
</div>
</div>
</div>
</div>
<<timed 50ms>><<silently>><<script>>
let player = State.variables.player;
let equipButtons = $(".equipButton");
for (let _i = 0; _i < equipButtons.length; _i++) {
let id = equipButtons[_i].id;
if (player.equipment[id] != "none") {
let _temp_item = UInv.GetDefaultItemObject(player.equipment[id]);
if (_temp_item != null && _temp_item.skill != null && _temp_item.skillreq != null) {
if (player.skills[_temp_item.skill] >= _temp_item.skillreq) {
$(equipButtons[_i]).find("button").html("E");
} else {
$(equipButtons[_i]).find("button").html("<span class=\"fail\">E</span>");
}
} else if (_temp_item != null && _temp_item.stat != null && _temp_item.statreq != null) {
if (player.stats[_temp_item.stat] >= _temp_item.statreq) {
$(equipButtons[_i]).find("button").html("E");
} else {
$(equipButtons[_i]).find("button").html("<span class=\"fail\">E</span>");
}
} else {
$(equipButtons[_i]).find("button").html("E");
}
}
$(equipButtons[_i]).find("button").on("click", (event) => {
$(".equipButton button").removeClass("disabled");
$(".equipButton button").prop("disabled", false);
$("#equip_list").children().fadeOut(0.1);
if (player.is_slave) {
$("#neck button").addClass("disabled");
$("#neck button").prop("disabled", true);
}
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
$("#default_list").fadeOut(0.1);
State.temporary.slot = id;
$("#" + State.temporary.slot.replace(/[0-9]/g, '') + "_list").fadeIn(0.1);
});
}
if (player.is_slave) {
$("#neck button").addClass("disabled");
$("#neck button").prop("disabled", true);
}
<</script>><</silently>><</timed>>
<</nobr>><<nobr>>
<div id="equipment" class="subbackground hidden">
<div id="default_list">
<hr>
<center><h3 id="armors_title" class="tool">Armor</h3>
<<set _armors = UInv.GetItemsArrayByItemTag("inventory", "type", "armor")>>
<div id="armors_list" class="list container twoCol">
<div id="armors_list_names" style="text-align: left; margin-left: 20px">
</div>
<div style="text-align: right; margin-right: 20px; font-weight: normal">
<<for _i = 0; _i lt _armors.length; _i++>>
<<= UInv.BagHasItem("inventory", _armors[_i])>>
<br>
<</for>>
</div>
</div>
</center>
<hr>
<center><h3 id="weapons_title" class="tool">Weapons</h3>
<<set _weapons = UInv.GetItemsArrayByItemTag("inventory", "type", "weapon")>>
<div id="weapons_list" class="list container twoCol" style="font-weight: normal">
<div id="weapons_list_names" style="text-align: left; margin-left: 20px">
</div>
<div style="text-align: right; margin-right: 20px; font-weight: normal">
<<for _i = 0; _i lt _weapons.length; _i++>>
<<= UInv.BagHasItem("inventory", _weapons[_i])>>
<br>
<</for>>
</div>
</div>
</center>
<hr>
<center><h3 id="accessories_title" class="tool">Accessories</h3>
<<set _accessories = UInv.GetItemsArrayByItemTag("inventory", "type", "accessory")>>
<div id="accessories_list" class="list container twoCol" style="font-weight: normal">
<div id="accessories_list_names" style="text-align: left; margin-left: 20px">
</div>
<div style="text-align: right; margin-right: 20px; font-weight: normal">
<<for _i = 0; _i lt _accessories.length; _i++>>
<<= UInv.BagHasItem("inventory", _accessories[_i])>>
<br>
<</for>>
</div>
</div>
</center>
</div>
<div id="equip_list">
<center id="head_list"><hr><h3>Head</h3>
<div id="head_list_items" style="text-align: left; margin-left: 20px; font-weight: normal;"></div>
</center>
<center id="chest_list"><hr><h3>Chest</h3>
<div id="chest_list_items" style="text-align: left; margin-left: 20px; font-weight: normal;"></div>
</center>
<center id="legs_list"><hr><h3>Legs</h3>
<div id="legs_list_items" style="text-align: left; margin-left: 20px; font-weight: normal;"></div>
</center>
<center id="feet_list"><hr><h3>Feet</h3>
<div id="feet_list_items" style="text-align: left; margin-left: 20px; font-weight: normal;"></div>
</center>
<center id="neck_list"><hr><h3>Neck</h3>
<div id="neck_list_items" style="text-align: left; margin-left: 20px; font-weight: normal;"></div>
</center>
<center id="weapon_list"><hr><h3>Weapons</h3>
<div id="weapon_list_items" style="text-align: left; margin-left: 20px; font-weight: normal;"></div>
</center>
<center id="groin_list"><hr><h3>Groin</h3>
<div id="groin_list_items" style="text-align: left; margin-left: 20px; font-weight: normal;"></div>
</center>
</div>
</div>
<<timed 50ms>><<silently>><<script>>
let player = State.variables.player;
function refresh_list(place) {
let place_list = $("#" + place + "_list_items");
let item = $("<div class=\"tool\">None</div>");
item.on("click", (event) => {
let slot = State.temporary.slot;
player.equipment[slot] = "none";
$("#" + slot + " button").html("");
$("#equip_list").children().fadeOut(0.1);
$("#default_list").fadeIn(0.1);
$(".equipButton button").removeClass("disabled");
$(".equipButton button").prop("disabled", false);
$("#equip_list").children().fadeOut(0.1);
if (player.is_slave) {
$("#neck button").addClass("disabled");
$("#neck button").prop("disabled", true);
}
place_list.empty();
refresh_list(place);
$("#combatStats").html("");
$("#combatStats").wiki("<<include playerMenuCombatStats>>");
});
place_list.append(item);
place_list.append("<br>");
let items = UInv.GetItemsArrayByItemTag("inventory", "place", place);
for (let x of items) {
let item_str = setup.titleCase(UInv.GetItemPropertyValue("inventory", x, "name"));
let _temp_item = UInv.GetDefaultItemObject(x);
let equipped_slot = player.has_equipped(x);
if (equipped_slot != "none") {
item_str += " (E" + equipped_slot.replace(/\D/g,'') + ")";
}
let item = $("<div class=\"tool\" title=\"" + x + "\">" + item_str + "</div>");
item.on("click", (event) => {
let slot = State.temporary.slot;
let self = $(event.currentTarget);
let temp_item = UInv.GetDefaultItemObject(self.prop("title"));
if (temp_item != null) {
if ((slot == "weapon1" || slot == "weapon2") && temp_item.type.includes("2-handed")) {
player.equipment.weapon1 = "none";
player.equipment.weapon2 = "none";
$("#weapon1 button").html("");
$("#weapon2 button").html("");
} else if (slot == "weapon1" && player.equipment.weapon2 != "none") {
if (UInv.GetDefaultItemObject(player.equipment.weapon2).type.includes("2-handed")) {
player.equipment.weapon2 = "none";
$("#weapon2 button").html("");
}
} else if (slot == "weapon2" && player.equipment.weapon1 != "none") {
if (UInv.GetDefaultItemObject(player.equipment.weapon1).type.includes("2-handed")) {
player.equipment.weapon1 = "none";
$("#weapon1 button").html("");
}
}
}
player.equipment[slot] = self.prop("title");
$("#" + slot + " button").html("E");
if (_temp_item != null && _temp_item.skill != null && _temp_item.skillreq != null) {
if (player.skills[_temp_item.skill] >= _temp_item.skillreq) {
$("#" + slot + " button").html("E");
} else {
$("#" + slot + " button").html("<span class=\"fail\">E</span>");
}
} else if (_temp_item != null && _temp_item.stat != null && _temp_item.statreq != null) {
if (player.stats[_temp_item.stat] >= _temp_item.statreq) {
$("#" + slot + " button").html("E");
} else {
$("#" + slot + " button").html("<span class=\"fail\">E</span>");
}
} else {
$("#" + slot + " button").html("E");
}
if (equipped_slot != "none") {
$("#" + equipped_slot + " button").html("");
player.equipment[equipped_slot] = "none";
}
$("#equip_list").children().fadeOut(0.1);
$("#default_list").fadeIn(0.1);
$(".equipButton button").removeClass("disabled");
$(".equipButton button").prop("disabled", false);
if (player.is_slave) {
$("#neck button").addClass("disabled");
$("#neck button").prop("disabled", true);
}
place_list.empty();
refresh_list(place);
$("#combatStats").html("");
$("#combatStats").wiki("<<include playerMenuCombatStats>>");
});
place_list.append(item);
place_list.append("<br>");
}
let types = {"armor": "armors", "weapon": "weapons", "accessory": "accessories"};
for (let type in types) {
let item_list = $("#" + types[type] + "_list_names");
item_list.empty();
let items = UInv.GetItemsArrayByItemTag("inventory", "type", type);
for (let x of items) {
let item_str = setup.titleCase(UInv.GetItemPropertyValue("inventory", x, "name"));
let equipped_slot = player.has_equipped(x);
if (equipped_slot != "none") {
equipped_slot = equipped_slot.replace(/\D/g,'');
item_str += " (E" + equipped_slot + ")";
}
let item = $("<div class=\"tool\">" + item_str + "</div>");
item.on("click", (event) => {
if (type == "weapon") {
$.wiki("\
<<popover>>" +
"<<displayweapon " + x + ">>" +
"<</popover>>\
");
} else if (type == "armor") {
$.wiki("\
<<popover>>" +
"<<displayarmor " + x + ">>" +
"<</popover>>\
");
} else {
$.wiki("\
<<popover>>" +
"<h2>" + UInv.GetItemPropertyValue("inventory", x, "name") + "</h2>" +
UInv.GetItemPropertyValue("inventory", x, "description") +
"<</popover>>\
");
}
});
item_list.append(item);
item_list.append("<br>");
}
}
}
$("#armors_title").on("click", (event) => {
$("#armors_list").fadeToggle(0.1);
});
$("#weapons_title").on("click", (event) => {
$("#weapons_list").fadeToggle(0.1);
});
$("#accessories_title").on("click", (event) => {
$("#accessories_list").fadeToggle(0.1);
});
$("#equip_list").children().fadeOut(0.1);
let places = ["head", "chest", "legs", "feet", "neck", "weapon", "groin"];
for (let place of places) {
refresh_list(place);
}
<</script>><</silently>><</timed>>
<</nobr>><<nobr>>
<<set _total_income = 0>>
<<for _key, _val range $player.finances.businesses>>
<<set _total_income += _val>>
<</for>>
<<for _key, _val range $player.finances.slaves>>
<<set _slave_income = 0>>
<<for _sub_key, _sub_val range _val>>
<<if _sub_key == "total">>
<<continue>>
<</if>>
<<set _slave_income += _sub_val>>
<</for>>
<<set _total_income += _slave_income>>
<<set $player.finances.slaves[_key].total = _slave_income>>
<</for>>
<div id="finances" class="subbackground hidden">
<hr>
<center><h3>Finances</h3>
<div class="container twoCol" style="font-weight: normal; grid-template-columns: 60% 30%;">
<div style="text-align: left; margin-left: 20px">
Liquid capital: <br>
Active investments: <br>
Riskless passive income: <br>
</div>
<div style="text-align: right; margin-right: 20px; font-weight: normal">
<<= setup.LARI>><<money>><br>
<<= setup.LARI>><<= setup.round2($player.finances.investment)>><br>
<<= setup.show_money_change_html(0, _total_income)>><br>
</div>
</div>
</center>
<hr>
<center><h3 id="businesses_title" class="tool">Businesses</h3>
<div id="businesses_list" class="container twoCol" style="font-weight: normal; grid-template-columns: 60% 30%;">
<div style="text-align: left; margin-left: 20px">
<<for _key, _val range $player.finances.businesses>>
<<= setup.titleCase(_key)>>: <br>
<</for>>
</div>
<div style="text-align: right; margin-right: 20px; font-weight: normal">
<<for _key, _val range $player.finances.businesses>>
<<= setup.show_money_change_html(0, _val)>><br>
<</for>>
</div>
</div>
</center>
<hr>
<center><h3 id="slaves_title" class="tool">Slaves</h3>
<div id="slaves_list" class="container twoCol" style="font-weight: normal; grid-template-columns: 60% 30%;">
<div style="text-align: left; margin-left: 20px">
<<for _key, _val range $player.finances.slaves>>
<<= $characters[_key].name()>>: <br>
<</for>>
</div>
<div style="text-align: right; margin-right: 20px; font-weight: normal">
<<for _key, _val range $player.finances.slaves>>
<<set _temp = $player.finances.slaves[_key].total>>
<<= setup.show_money_change_html(0, _temp)>><br>
<</for>>
</div>
</div>
</center>
</div>
<<timed 50ms>><<script>>
$("#businesses_title").on("click", (event) => {
$("#businesses_list").fadeToggle(0.1);
});
$("#slaves_title").on("click", (event) => {
$("#slaves_list").fadeToggle(0.1);
});
<</script>><</timed>>
<</nobr>><<nobr>>
<div id="inventory" class="subbackground">
<hr>
<center><h3 id="inventory_title" class="tool">Inventory</h3>
<<set _items = UInv.GetItemsArrayWithoutAnyItemTags("inventory", "type",
["money", "quest_item", "armor", "accessory", "book"])>>
<div id="inventory_list" class="container twoCol" style="font-weight: normal">
<div style="text-align: left; margin-left: 20px">
<<for _i = 0; _i lt _items.length; _i++>>
<<= setup.titleCase(UInv.GetItemPropertyValue("inventory", _items[_i], "name"))>>
<br>
<</for>>
</div>
<div style="text-align: right; margin-right: 20px; font-weight: normal">
<<for _i = 0; _i lt _items.length; _i++>>
<<= UInv.BagHasItem("inventory", _items[_i])>>
<br>
<</for>>
</div>
</div>
</center>
<<set _books = UInv.GetItemsArrayByItemTag("inventory", "type", "book")>>
<hr>
<center><h3 id="books_title" class="tool">Books</h3>
<div id="books_list" style="text-align: left; margin-left: 20px; font-weight: normal">
</div>
</center>
<<set _quest_items = UInv.GetItemsArrayByItemTag("inventory", "type", "quest_item")>>
<hr>
<center><h3 id="quests_title" class="tool">Quest Items</h3>
<div id="quests_list" style="text-align: left; margin-left: 20px; font-weight: normal">
<<for _i = 0; _i lt _quest_items.length; _i++>>
<<= setup.titleCase(UInv.GetItemPropertyValue("inventory", _quest_items[_i], "name"))>>
<br>
<</for>>
</div>
</center>
</div>
<<timed 50ms>><<script>>
let _t = State.temporary;
$("#inventory_title").on("click", (event) => {
$("#inventory_list").fadeToggle(0.1);
});
$("#books_title").on("click", (event) => {
$("#books_list").fadeToggle(0.1);
});
$("#quests_title").on("click", (event) => {
$("#quests_list").fadeToggle(0.1);
});
for (let i = 0; i < _t.books.length; i++) {
let x = _t.books[i];
let item_str = setup.titleCase(UInv.GetItemPropertyValue("inventory", x, "name"));
let item = $("<div class=\"tool\">" + item_str + "</div>");
item.on("click", (event) => {
$.wiki("\
<<popover>>" +
"<h2>" + UInv.GetItemPropertyValue("inventory", x, "name") + "</h2>" +
UInv.GetItemPropertyValue("inventory", x, "description") +
"<</popover>>\
");
});
$("#books_list").append($(item));
$("#books_list").append("<br>");
}
<</script>><</timed>>
<</nobr>><<nobr>>
/* For updating versions */
<<if $player.is_slave && UInv.BagHasItem("inventory", "hironaka_amulet") == 0>>
<<run UInv.AddItem("inventory", "hironaka_amulet", 1)>>
<<set $player.equipment.neck = "hironaka_amulet">>
<</if>>
<div class="charside left">
<div id="left_actions" class="mapaction fiveQuarters smalltext">
<hr>
<<disable>>
@@#stats_but;<<button "Stats">>
<</button>>@@
<</disable>>
@@#combat_stats_but;<<button "Combat Stats">>
<</button>>@@
@@#skills_but;<<button "Skills">>
<</button>>@@
@@#titles_but;<<button "Titles">>
<</button>>@@
@@#party_but;<<button "Party">>
<<if $player.party == null || $player.party.length == 0>>
<<notify>>You do not have any party members.<</notify>>
<<else>>
<<set $selection_queue = $player.party>>
<<set $selected = $player.party[0]>>
<<goto characterMenu>>
<</if>>
<</button>>@@
</div>
</div>
<div id="background" class="paper_border notext">
<div class="main container threeCol" style="height: 100%; width: 100%;">
<div id="playerMenuLeft">
<<set _left_selection = "stats">>
<<include playerMenuStats>>
<div id="combatStats" class="subbackground hidden">
<<include playerMenuCombatStats>>
</div>
<<include playerMenuSkills>>
<<include playerMenuTitles>>
</div>
<div id="playerMenuCenter">
<div class="subbackground">
<center><h3><<= setup.titleCase($player.first_name)>>
<<if $player.is_slave>>
Hironaka
<<else>>
<<= setup.titleCase($player.last_name)>>
<</if>>
</h3></center>
<<include playerMenuEquip>>
<div id="playerMenuImage"></div>
<<timed 20ms>>
<<run $("#playerMenuImage").css("background-image", "url(resources/images/characters/player/" + $player.gender + ".png)")>>
<</timed>>
<div style="margin: 15px; margin-left: 30px; margin-right: 30px">
<<showmeter "player_health_bar" `$player.conditions.health/$player.conditions.max_health`>>
<<showmeter "player_stamina_bar" `$player.conditions.stamina/$player.conditions.max_stamina`>>
</div>
<center class="twoThirds">
<<button "Back">>
<<set $in_menu = false>>
<<goto $last_visited>>
<<set $last_visited = "">>
<</button>>
</center>
</div>
</div>
<div id="playerMenuRight">
<<set _right_selection = "inventory">>
<<include playerMenuInventory>>
<<include playerMenuEquipment>>
<<include playerMenuFinances>>
</div>
</div>
</div>
<div class="charside right">
<div id="right_actions" class="mapaction fiveQuarters smalltext">
<hr>
<<disable>>
@@#inventory_but;<<button "Inventory">><</button>>@@
<</disable>>
@@#equipment_but;<<button "Equipment">>
<<timed 60ms>>
<<removeclass "#equipOverlay" "hidden">>
<</timed>>
<</button>>@@
@@#finances_but;<<button "Finances">><</button>>@@
<<set _right_selection = "inventory">>
</div>
<div class="mapaction fiveQuarters smalltext">
@@#quests;<<button "Quests">>
<<script>>Dialog.close();<</script>>
<<popover>>
<<include questMenu>>
<</popover>>
<</button>>@@
@@#status;<<button "Status">>
<<set _selected_status = $player.get_status($last_visited)>>
<<popover>>
<<include statusTutorial>>
<</popover>>
<</button>>@@
</div>
</div>
<<timed 50ms>><<silently>><<script>>
$("#left_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
if (self.html() == "Party") {
return;
}
$("#left_actions").find("button").removeClass("disabled");
$("#left_actions").find("button").prop("disabled", false);
self.addClass("disabled");
self.prop("disabled", true);
var desc = setup.camelize(self.html());
$("#" + desc).removeClass("hidden");
$("#playerMenuLeft").removeClass("hidden");
$("#playerMenuCenter").removeClass("hidden");
$("#" + State.temporary.left_selection).addClass("hidden");
State.temporary.left_selection = desc;
$("#playerMenuCenterDetails").addClass("hidden");
});
$("#right_actions").find("button").on("click", (event) => {
$("#right_actions").find("button").removeClass("disabled");
$("#right_actions").find("button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
var desc = setup.camelize(self.html());
$("#" + desc).removeClass("hidden");
$("#playerMenuLeft").removeClass("hidden");
$("#playerMenuCenter").removeClass("hidden");
$("#" + State.temporary.right_selection).addClass("hidden");
State.temporary.right_selection = desc;
$("#playerMenuCenterDetails").addClass("hidden");
$("#equipOverlay").addClass("hidden");
});
<</script>><</silently>><</timed>>
<</nobr>><<nobr>>
<div id="skills" class="subbackground hidden">
<hr>
<center><h3>Skills</h3>
<div class="container twoCol">
<div style="text-align: left; margin-left: 20px">
<<for _i = 0; _i lt setup.SKILLS.length; _i++>>
<<= setup.titleCase(setup.SKILLS[_i])>>
<br>
<</for>>
</div>
<div style="text-align: right; margin-right: 20px">
<<for _i = 0; _i lt setup.SKILLS.length; _i++>>
<<= setup.round2($player.skills[setup.SKILLS[_i]]).toString().padStart(3, '\u2000')>>
<br>
<</for>>
</div>
</div>
</center>
<hr>
<center><h3>Sex Skills</h3>
<div class="container twoCol">
<div style="text-align: left; margin-left: 20px">
<<for _i = 0; _i lt setup.SEX_SKILLS.length; _i++>>
<<= setup.titleCase(setup.SEX_SKILLS[_i])>>
<br>
<</for>>
</div>
<div style="text-align: right; margin-right: 20px">
<<for _i = 0; _i lt setup.SEX_SKILLS.length; _i++>>
<<= setup.round2($player.sex_skills[setup.SEX_SKILLS[_i]]).toString().padStart(3, '\u2000')>>
<br>
<</for>>
</div>
</div>
</center>
</div>
<</nobr>><<nobr>>
<div id="stats" class="subbackground">
<hr>
<center><h3>Stats</h3>
<div class="container twoCol">
<div style="text-align: left; margin-left: 20px">
Sex <br>
Age <br>
<br>
<<for _i = 0; _i lt setup.STATS.length; _i++>>
<<= setup.titleCase(setup.STATS[_i])>>
<br>
<</for>>
</div>
<div style="text-align: right; margin-right: 20px">
<<if $player.gender == 0>>
Male
<<else>>
Female
<</if>> <br>
<<= $player.age()>> <br>
<br>
<<for _i = 0; _i lt setup.STATS.length; _i++>>
<<= setup.round2($player.stats[setup.STATS[_i]]).toString().padStart(3, '\u2000')>>
<br>
<</for>>
</div>
</div>
</center>
</div>
<</nobr>><<nobr>>
<div id="titles" class="subbackground hidden">
<hr>
<center><h3>Titles</h3>
/* Prints all titles and assigns a unique div id to them */
<div id="titles_body"></div>
<<set $done_setup = false>>
<<script>>
setTimeout(function(){
var html = "";
var titles = Array.from(State.variables.player.titles);
for (var i = 0; i < titles.length; i++) {
html += ("\
<div id=\"char_" + titles[i] + "\" class=\"tooltip\">" +
setup.titleCase(titles[i])
+ "</div><br>\
");
}
document.getElementById("titles_body").innerHTML = html;
State.variables.done_setup = true;
}, 1);
<</script>>
/* Creates artificial event-listener for setup of script above */
<<repeat 20ms>>
<<if $done_setup>>
<<for _idx, _title range $player.titles>>
<<capture _title>>
<<script>>
var title = State.temporary.title;
$("#char_" + title).click(
function(){
State.temporary.selected_title = title;
$.wiki("<<popover>><<include titleTutorial>><</popover>>")
}
);
<</script>>
<</capture>>
<</for>>
<<stop>>
<</if>>
<</repeat>>
</center>
</div>
<</nobr>><div class="popuptext">
<h2>Quest Journal</h2>
This is your quest journal and where you can view quests that are both ongoing and completed.
Note that these quests are meant to give a general guide on your experience and are completely
optional. Whether or not you formally get quests does not affect your ability to reap the rewards
of completing them (unless it is a direct request from another character).
<<if $quest_journal.ongoing.length gt 0>>
<h3>Active Quests</h3>
<</if>>
<<for _idx, _val range $quest_journal.ongoing>>
<div class="quest">
<<messenger setup.quests[_val].name>>
<p>
<div><<= setup.quests[_val].flavor_text>></div>
<br>
<ul>
<li><<= setup.quests[_val].stages[$quests[_val].stage]>></li>
<<for _i = $quests[_val].stage - 1; _i gte 0; _i-->>
<s><li><<= setup.quests[_val].stages[_i]>></li></s>
<</for>>
</ul>
</p>
<</messenger>>
<br>
</div>
<</for>>
<<set _completed_keys = Object.keys($quest_journal.completed)>>
<<if _completed_keys.length gt 0>>
<h3>Completed Quests</h3>
<</if>>
<<for _idx, _val range $quest_journal.completed>>
<div class="quest">
<<messenger setup.quests[_val].name>><p>
<div><<= setup.quests[_val].flavor_text>></div>
<br>
<ul>
<<for _idx2, _val2 range setup.quests[_val].stages>>
<s><li><<= _val2>></li></s>
<</for>>
</ul>
</p>
<</messenger>>
<br>
</div>
<</for>>
</div><<nobr>>
<div id="background" class="paper_border notext">
<center><h1>Settings</h1></center>
<div class="container threeCol">
<center id="left_col" class="column longbutton smalltext fiveQuarters">
''Testing Cheats''<br>
<<textbox "$testing_password" `$testing_password`>><br><br>
@@#submit_password;<<button "Submit">>
<<if _insert_cheats($testing_password)>>
<<addclass "#submit_password button" "disabled">>
<<run $("#submit_password button").prop("disabled", true)>>
<</if>>
<</button>>@@
</center>
<center>
''Text Speed''
<br><br>
<div class="textspeed">
@@#25.textspd;<<button "25%">>
<<set $words_per_sec = 1.5>>
/* Enable other options */
<<run $("#25 button").prop("disabled", true)>>
<<addclass "#25 button" "disabled">>
<<run $("#50 button").prop("disabled", false)>>
<<removeclass "#50 button" "disabled">>
<<run $("#100 button").prop("disabled", false)>>
<<removeclass "#100 button" "disabled">>
<<run $("#200 button").prop("disabled", false)>>
<<removeclass "#200 button" "disabled">>
<<run $("#X button").prop("disabled", false)>>
<<removeclass "#X button" "disabled">>
<</button>>@@@@#50.textspd;<<button "50%">>
<<set $words_per_sec = 3>>
/* Enable other options */
<<run $("#25 button").prop("disabled", false)>>
<<removeclass "#25 button" "disabled">>
<<run $("#50 button").prop("disabled", true)>>
<<addclass "#50 button" "disabled">>
<<run $("#100 button").prop("disabled", false)>>
<<removeclass "#100 button" "disabled">>
<<run $("#200 button").prop("disabled", false)>>
<<removeclass "#200 button" "disabled">>
<<run $("#X button").prop("disabled", false)>>
<<removeclass "#X button" "disabled">>
<</button>>@@@@#100.textspd;<<button "100%">>
<<set $words_per_sec = 5.5>>
/* Enable other options */
<<run $("#25 button").prop("disabled", false)>>
<<removeclass "#25 button" "disabled">>
<<run $("#50 button").prop("disabled", false)>>
<<removeclass "#50 button" "disabled">>
<<run $("#100 button").prop("disabled", true)>>
<<addclass "#100 button" "disabled">>
<<run $("#200 button").prop("disabled", false)>>
<<removeclass "#200 button" "disabled">>
<<run $("#X button").prop("disabled", false)>>
<<removeclass "#X button" "disabled">>
<</button>>@@@@#200.textspd;<<button "200%">>
<<set $words_per_sec = 11>>
/* Enable other options */
<<run $("#25 button").prop("disabled", false)>>
<<removeclass "#25 button" "disabled">>
<<run $("#50 button").prop("disabled", false)>>
<<removeclass "#50 button" "disabled">>
<<run $("#100 button").prop("disabled", false)>>
<<removeclass "#100 button" "disabled">>
<<run $("#200 button").prop("disabled", true)>>
<<addclass "#200 button" "disabled">>
<<run $("#X button").prop("disabled", false)>>
<<removeclass "#X button" "disabled">>
<</button>>@@@@#X.textspd;<<button "∞">>
<<set $words_per_sec = 1000000>>
/* Enable other options */
<<run $("#25 button").prop("disabled", false)>>
<<removeclass "#25 button" "disabled">>
<<run $("#50 button").prop("disabled", false)>>
<<removeclass "#50 button" "disabled">>
<<run $("#100 button").prop("disabled", false)>>
<<removeclass "#100 button" "disabled">>
<<run $("#200 button").prop("disabled", false)>>
<<removeclass "#200 button" "disabled">>
<<run $("#X button").prop("disabled", true)>>
<<addclass "#X button" "disabled">>
<</button>>@@
<<script>>
setTimeout(() => {
var words_per_sec = State.variables.words_per_sec;
if (words_per_sec <= 1.5) {
$("#25 button").prop("disabled", true);
$("#25 button").addClass("disabled");
} else if (words_per_sec <= 3) {
$("#50 button").prop("disabled", true);
$("#50 button").addClass("disabled");
} else if (words_per_sec <= 5.5) {
$("#100 button").prop("disabled", true);
$("#100 button").addClass("disabled");
} else if (words_per_sec <= 11) {
$("#200 button").prop("disabled", true);
$("#200 button").addClass("disabled");
} else {
$("#X button").prop("disabled", true);
$("#X button").addClass("disabled");
}
}, 10);
<</script>>
</div>
<br>
<hr>
''Music Volume''
<div style="margin-left: 20px; margin-right: 20px">
<<volume>>
</div>
<hr>
<<button Saves>>
<<script>>
UI.saves();
<</script>>
<</button>>
<<button Quit>>
<<popover>>
<center><h3>
Are you sure you want to quit? All unsaved progress will be lost.<br>
<<link "Confirm">><<run Engine.restart()>><</link>>
</h3></center>
<</popover>>
<</button>>
<hr>
<<button Back>>
<<set $in_menu = false>>
<<goto $last_visited>>
<<set $last_visited = "">>
<</button>>
</center>
<center>
''Autosave Frequency''<br>
(Larger for less lag and less frequent autosaves)<br>
<div class="textspeed">
@@#1_saveFreq.saveFreq;<<button "1">>
<</button>>@@@@#5_saveFreq.saveFreq;<<button "5">>
<</button>>@@@@#10_saveFreq.saveFreq;<<button "10">>
<</button>>@@@@#20_saveFreq.saveFreq;<<button "20">>
<</button>>@@@@#X_saveFreq.saveFreq;<<button "∞">><</button>>@@
</div>
<<script>>
setTimeout(() => {
$(".saveFreq").find("button").on("click", (event) => {
let self = $(event.currentTarget);
if (self.html() == "∞") {
State.variables.autoSaveFreq = 100000;
} else {
State.variables.autoSaveFreq = Number.parseInt(self.html());
}
$(".saveFreq").find("button").removeClass("disabled");
$(".saveFreq").find("button").prop("disabled", false);
self.addClass("disabled");
self.prop("disabled", true);
});
if (State.variables.autoSaveFreq == null) {
State.variables.autoSaveFreq = 10;
}
let id = "";
if (State.variables.autoSaveFreq == 100000) {
id = "X";
} else {
id = "" + State.variables.autoSaveFreq;
}
$("#" + id + "_saveFreq button").addClass("disabled");
$("#" + id + "_saveFreq button").prop("disabled", true);
}, 10);
<</script>>
</center>
</div>
</div>
<<silently>><<timed 50ms>><<script>>
State.temporary.insert_cheats = function(password) {
/* Change to if (true) if you are trying to crack the password, you won't be able to get it from the sha256 */
if (setup.sha256(password) == "d610f4d587e218c91d5246a05dd5419ca0e82817324202b9656731ceb7442ee1") {
$("#left_col").wiki(setup.decrypt(password));
/* Checking to see if you got the correct password, no need to change this part */
if (setup.sha256(password) == "d610f4d587e218c91d5246a05dd5419ca0e82817324202b9656731ceb7442ee1") {
/* Do nothing if you got here, you have inputted the right password */
} else {
$.wiki("<<notify>>Nice try, hacker. Try again.<</notify>>")
}
} else {
$.wiki("<<notify>>Incorrect Password!<</notify>>");
}
}
<</script>><</timed>><</silently>>
<</nobr>><<nobr>>
<div id="actions" class="mapaction fiveQuarters smalltext">
<hr>
<<set _added = 0>>
<<for _key, _val range setup.locations.get(passage()).sublocations>>
<<if _key == $player.home>>
<<continue>>
<</if>>
<<capture _key>>
<<set _location_button_dest = setup.locations.get(_key).passage>>
<<include locationButton>>
<</capture>>
<<set _added += 1>>
<</for>>
/* Add 11 slots */
<<for _i = _added; _i lt 9; _i++>>
<div class="buttonfiller fiveQuarters"></div>
<</for>>
<<unset _added>>
<hr>
<<button "Pass Time">>
/* Temperarily disable working status while relaxing */
<<set _temp_is_working = $player.is_working>>
<<set $player.is_working = false>>
<<addhours 1>>
<<set $player.is_working = _temp_is_working>>
<<unset _temp_is_working>>
<<include round>>
<<script>>
$(".mapside.left").html("");
$(".mapside.left").wiki("<<include niponActions>>");
$("#background").empty();
$("#background").wiki("<<include " + passage() + "Map>>");
<</script>>
<</button>>
<<button "Hours">>
<<popover>>
<<include hoursTutorial>>
<</popover>>
<</button>>
<<if passage() != "niponCentral">>
<<set _location_button_dest = "niponCentral">>
<<include locationButton>>
<<else>>
<<disable>>
<<button "Central">><</button>>
<</disable>>
<</if>>
<<if passage() != "niponMarket">>
<<set _location_button_dest = "niponMarket">>
<<include locationButton>>
<<else>>
<<disable>>
<<button "Market">><</button>>
<</disable>>
<</if>>
<<if passage() != "niponSlums">>
<<set _location_button_dest = "niponSlums">>
<<include locationButton>>
<<else>>
<<disable>>
<<button "Slums">><</button>>
<</disable>>
<</if>>
<div>
<<set _location_button_text = "Home">>
<<set _location_button_dest = $player.home>>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
<hr>
</div>
<</nobr>><<nobr>>
<div id="actions" class="action container row col longbutton fiveQuarters"
style="--rows: 4; --cols: 4">
<<set _queue_talk = false>>
<<button "Talk">>
<<if !_queue_talk>>
<<set _queue_talk = true>>
<<set _options = "\
<ol>\
<li id=\"li1\">\"Can you tell me more about Shintani?\"</li>\
<li id=\"li2\">\"Can you tell me more about Nipon?\"</li>\
<li id=\"li3\">\"Why doesn\'t Shintani sell you off as well?\"</li>\
<li id=\"li4\">\"Why are you still in Nipon?\"</li>\
<li id=\"li5\">\"What do you want to see Nipon become?\"</li>\
">>
<<if $quests.power_struggles.stage == 2>>
<<set _options += "<li id=\"li6\">\"What did you need me to do again?\"</li>">>
<<elseif $quests.power_struggles.stage == 5>>
<<set _options += "<li id=\"li6\">\"I got the things you asked of me.\"</li>">>
<<elseif $quests.path_to_freedom.added && $quests.path_to_freedom.stage == 4>>
<<set _options += "<li id=\"li6\">\"Nina\'s been rescued as per Emily\'s instruction.\"</li>\"">>
<</if>>
<<set _options = $(_options)>>
<<set _responses = [_options.clone()]>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses);
<</script>>
<</if>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<addclass "#actions" "hidden">>
<<removeclass "#events_actions" "hidden">>
<</button>>
<div style="grid-row: 1; grid-column: 4"></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div style="grid-row: 3; grid-column: 4"></div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<</nobr>><<nobr>>
<div id="events_actions" class="action container row col hidden"
style="--rows: 4; --cols: 5">
@@#events1;.event_button;<<button "1">>
<<if def _init_sequence && _init_sequence>>
<<set _responses = [
"You take a seat across from Lia,",
_lia.dialogue("\
I\'m assuming you don\'t know who I am right? While I\'m sure you have guessed by now that \
I am Shin\'s sister, my past is stained with blood as is the rest of our family. Shin has \
dishonored the Hiroyuki family name by first selling off our parents many years ago."),
"Lia pauses for a second to regain her composure,",
_lia.dialogue("Look, if you want out of your situation first you need to gain his trust. I heard that \
he was recently probing into the Nipon economy to justify his shift towards slavery. First help him \
with that, then afterwards, go into Shin\'s office at night and bring me his transaction logs. \
I need everything you can find. Also I need you to go into the library and get me our family history. \
It might be hidden away, but look for a crest like this."),
"Lia brings out a golden pendant which has a three leaves enclosed within a circle. It resembles \
the crest you know very well, but the entchings and geometry of one around your neck are pervertered \
beyond recognition. Lia sees the momentary weakness within your eyes, and puts her hand on your leg,",
_lia.dialogue("Trust me, I know your suffering better than you can imagine. Help me free you.")
]>>
<<run $(".event_button button").addClass("hidden")>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#events_actions_leave" "hidden">>
<<unset _done_appending>>
<<updatequests>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif ndef _action>>
<<set _options.find("#li1").css("text-decoration", "line-through")>>
<<set _action = 1>>
<<set _sub_options = $("<ol>\
<li id=\"li1\">\"What was like Shintani when he was young?\"</li>\
<li id=\"li2\">\"What are Shintani\'s true goals?\"</li>\
<li id=\"li3\">\"Nevermind\"</li>\
</ol>")>>
<<set _responses = [
"Lia lets out a long sigh,",
_lia.dialogue("Well... ask away, what did you want to know?"),
_sub_options.clone()
]>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 3>>
<<set _disable_buttons = false>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _action == 1>>
<<set _sub_options.find("#li1").css("text-decoration", "line-through")>>
<<set _responses = [
"Lia is visably puzzled at why you\'d inquire about that, but she obliges",
_lia.dialogue("Being the only male heir in the Hiroyuki household, Shin was treated as royalty \
since the day he was born. Our father especially had always told Shin that he was special and \
above others. I think his many servants at the time led him to develop a control complex. When \
one day he could no longer control the whims of our parents, he staged a coup, taking control \
of Nipon, selling off our parents, and sending assassins for me. Since then he was obsessed \
with slavery and controlling others. If only dad had known... Oh how we all loved Shin when he \
was younger..."),
"You see Lia\'s eyes slightly glaze over as her voice breaks off,",
_lia.dialogue("Sorry about that... anything else?"),
_sub_options.clone()
]>>
<<elseif _action == 2>>
<<set _sub_options.find("#li1").css("text-decoration", "line-through")>>
<<set _responses = [
"Lia sighs again",
_lia.dialogue("It is very unfortunate for all of us that Nipon is so successful. The analysts at the Union \
have thought about this issue and our conclusion is that it\'s due to Nipon great location. Because of \
the East Great Desert, Nipon is completely isolated from the world by land. Furthermore, my parents \
had the foresight to heavily invest in our docks, so we can be isolationist whilst still benefitting \
from the trade routes of the Union. Shin is convinced that Nipons success is all due to him and his \
increasingly concerning policies regarding slavery."),
_lia.dialogue("Is that all?"),
_sub_options.clone()
]>>
<<elseif _action == 6>>
<<unset _action>>
<<set _responses = [
"You hand over the materials to Lia and she examines them over for a little while",
]>>
<<if $quests.power_struggles.data.side == "lia">>
<<set _responses.push(_lia.dialogue("Hmm, yes this is exactly what we needed. Thanks to you I believe we \
can finally shift the balance of power in Nipon."))>>
<<else>>
<<set _responses.push(_lia.dialogue("Hmm, this is a bit unexpected, but given we change our plans to \
accomodate this, we should still be able to shift the balance of power in Nipon."))>>
<</if>>
<<set _responses.push("Lia pulls out an ornate brooch containing two lions around a coat of arms,")>>
<<set _responses.push(_lia.dialogue("This is the symbol of the Namm household. I don\'t know if you\'ve met \
Emily yet, but I believe she is employed under Shintani and working in the Nipon Barracks. While she \
is loyal in appearance, she holds a deep hatred of the Hiroyuki household for their sieze of power. Normally \
I would consider her an enemy as well, but enemies of enemies make for good friends."))>>
<<set _responses.push("She hands you the brooch")>>
<<set _responses.push(_lia.dialogue("Wear this in front of Emily and she\'ll further guide you. Luckily Shin is \
too self obsessed to know the historical significance of this symbol, so you should be safe wearing it."))>>
<<set _responses.push(_options.clone())>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<unset _done_appending>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<run UInv.AddItem("inventory", "namm_insignia", 1)>>
<<run UInv.DeleteItem("inventory", "hiroyuki_book", UInv.BagHasItem("inventory", "hiroyuki_book"))>>
<<run UInv.DeleteItem("inventory", "nipon_transaction_log", UInv.BagHasItem("inventory", "nipon_transaction_log"))>>
<<notify>>Acquired the Namm Insignia<</notify>>
<<set $quests.power_struggles.stage += 1>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<</button>>@@
@@#events2;.event_button;<<button "2">>
<<if ndef _action>>
<<set _options.find("#li2").css("text-decoration", "line-through")>>
<<set _action = 2>>
<<set _sub_options = $("<ol>\
<li id=\"li1\">\"What makes Nipon successful?\"</li>\
<li id=\"li2\">\"How did Nipon start?\"</li>\
<li id=\"li3\">\"Why is Nipon so... oriental? Has it always been this way?\"</li>\
<li id=\"li4\">\"Nevermind\"</li>\
</ol>")>>
<<set _responses = [
"Lia lets out a long sigh,",
_lia.dialogue("Well... ask away, what did you want to know?"),
_sub_options.clone()
]>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 4>>
<<set _disable_buttons = false>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _action == 1>>
<<set _sub_options.find("#li2").css("text-decoration", "line-through")>>
<<set _responses = [
_lia.dialogue("Not freedom. He claims to want a \"Free City,\" but his definitions of freedom \
are a complete perversion of the word. He wants to give everyone freedom by removing the need \
to worry about choice. He wants to resolve all interpersonal conflict by performing mass eugenics \
to completely cull the population of anyone not of eastern Asian descent. He wants to bring his \
people happiness by getting them addicted to drugs and dulling their senses. Monster would be putting \
it lightly. This is why we at the Trade Union are making a move."),
_lia.dialogue("Anything else you wanted to know?"),
_sub_options.clone()
]>>
<<elseif _action == 2>>
<<set _sub_options.find("#li2").css("text-decoration", "line-through")>>
<<set _responses = [
_lia.dialogue("Well I\'m sure Shin will tell you it was gifted to us by the gods, but actually our ancestors \
conquered Nipon from the Namm household many years ago. In fact the day that Nipon started is year 0 of the \
standard calendar. At that time Nipon worked hand-in-hand with the Trade Union, so the Nipon calendar was \
popularized through that."),
_lia.dialogue("Anything else you wanted to know?"),
_sub_options.clone()
]>>
<<elseif _action == 6>>
<<unset _action>>
<<set _roll = $player.get_status_prop("manipulation") + dice(1, 5 + $difficulty) - $difficulty>>
<<if _roll gt 50>>
<<set _responses = [
setup.pass("manipulation", false),
$player.dialogue("You wouldn\'t imagine the stress and hardship I had to go through to acquire these \
documents you wanted... Don\'t you think I should be rewarded?"),
"Lia looks at you in disbelief,",
_lia.dialogue("What... do you want?"),
"You shift your eyes down to Lia\'s breasts",
$player.dialogue("Nothing much, just a look at those..."),
"You point to her boobs. After a long silence, Lia relents,",
_lia.dialogue("Fine..."),
"(Lia\'s Affection " + setup.show_change_html(0, -2) + ", Willpower " + setup.show_change_html(0, -2, false) + ")"
]>>
<<set _lia.slave_traits.obedience -= 2>>
<<set _lia.slave_traits.willpower -= 2>>
<<set _success = true>>
<<else>>
<<set _responses = [
setup.fail("manipulation", false),
$player.dialogue("How about you should me your boobs first?"),
"Lia looks at you in disbelief,",
_lia.dialogue("Who do you think you are? Give me those materials or I'll scream and the guards outside will storm \
this place!"),
"(Lia\'s Affection " + setup.show_change_html(0, -5) + ", Willpower " + setup.show_change_html(0, 2, false) + ")"
]>>
<<set _lia.slave_traits.obedience -= 5>>
<<set _lia.slave_traits.willpower += 2>>
<<set _success = false>>
<</if>>
<<unset _done_appending>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<if _success>>
<<run $("#mainLogCharacterImage").css("background-image",
"url(\"" + _lia.image_folder() + "lia_sitting_neutral_notop.png\")"
)>>
<</if>>
<<set _responses = [
"You hand over the materials to Lia and she examines them over for a little while",
]>>
<<if $quests.power_struggles.data.side == "lia">>
<<set _responses.push(_lia.dialogue("Hmm, yes this is exactly what we needed. Thanks to you I believe we \
can finally shift the balance of power in Nipon."))>>
<<else>>
<<set _responses.push(_lia.dialogue("Hmm, this is a bit unexpected, but given we change our plans to \
accomodate this, we should still be able to shift the balance of power in Nipon."))>>
<</if>>
<<set _responses.push("Lia pulls out an ornate brooch containing two lions around a coat of arms,")>>
<<set _responses.push(_lia.dialogue("This is the symbol of the Namm household. I don\'t know if you\'ve met \
Emily yet, but I believe she is employed under Shintani and working in the Nipon Barracks. While she \
is loyal in appearance, she holds a deep hatred of the Hiroyuki household for their sieze of power. Normally \
I would consider her an enemy as well, but enemies of enemies make for good friends."))>>
<<set _responses.push("She hands you the brooch")>>
<<set _responses.push(_lia.dialogue("Wear this in front of Emily and she\'ll further guide you. Luckily Shin is \
too self obsessed to know the historical significance of this symbol, so you should be safe wearing it."))>>
<<set _responses.push(_options.clone())>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<unset _done_appending>>
<<run setup.mainLog_append_delayed(_responses, $buttons, $buttons_extra)>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<run UInv.AddItem("inventory", "namm_insignia", 1)>>
<<run UInv.DeleteItem("inventory", "hiroyuki_book", UInv.BagHasItem("inventory", "hiroyuki_book"))>>
<<run UInv.DeleteItem("inventory", "nipon_transaction_log", UInv.BagHasItem("inventory", "nipon_transaction_log"))>>
<<notify>>Acquired the Namm Insignia<</notify>>
<<set $quests.power_struggles.stage += 1>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<</button>>@@
@@#events3;.event_button;<<button "3">>
<<if ndef _action>>
<<set _options.find("#li3").css("text-decoration", "line-through")>>
<<set _responses = [
_lia.dialogue("Well actually when my parents were sold off he sent assassins after me. \
I guess my parents held some prestige of the Hiroyuki household thus there were buyers, \
but not me. I very luckily ran into the Trade Union, which as you know is an independent \
entity from Nipon. They took me in, and now Shin can\'t touch me. He has tried everything \
he could from limiting my movements though, even isolating me to a tower on the outskirts of \
town."),
_options.clone()
]>>
<<elseif _action == 1>>
<<unset _action>>
<<set _responses = [
_lia.dialogue("What did you need?"),
_options.clone()
]>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _action == 2>>
<<set _sub_options.find("#li3").css("text-decoration", "line-through")>>
<<set _responses = [
"Your question catches Lia off guard, and she chuckles a little to herself",
_lia.dialogue("Nipon has always been a little \"oriental\" as you call it, because when the Hiroyuki family \
conquered Nipon from the Namm household we wanted to integrate our cultures as fast as possible. However, \
Nipon as you know it now is way more extreme then it ever was before. This is due to Shin\'s racial \
superiority. I\'m pretty sure he just wants an excuse to be above others. While our parents did always \
teach us to appreciate our own culture due to the limited number of east Asians left today, they also \
always stressed the importance of diversity. Diversity is important in any system to ensure the continued \
survival of a species. The same is true for civilizations as well. Shin is heading down a dark path."),
"You are shocked at Lia\'s depth of knowledge",
$player.dialogue("How... do you know all this?"),
_lia.dialogue("Haha... that\'s a fair response. Not even Shin knows about how Nipon came to be. I\'m sure if \
you asked him, he\'d spout some garbage about the gods as our father always told him. But, I think he only \
pretends to care, because this information is readily available if you search through our old books. But of \
course that would delegitimize Shin\'s position. Anyways, anything else?"),
_sub_options.clone()
]>>
<</if>>
<</button>>@@
@@#events4;.event_button;<<button "4">>
<<if ndef _action>>
<<set _options.find("#li4").css("text-decoration", "line-through")>>
<<set _responses = [
_lia.dialogue("As in why not leave? Well firstly despite my brother trying to limit my rights \
Nipon is still better than the outside world. Plus I\'m still a Hiroyuki... and well I guess \
I also don\'t want to just leave my home because of Shin. If I do that, he wins doesn\'t he? \
I guess despite being much more intelligent than Shin I can still be irrationaly sentimental \
at times."),
_options.clone()
]>>
<<elseif _action == 2>>
<<unset _action>>
<<set _responses = [
_lia.dialogue("What did you need?"),
_options.clone()
]>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<</button>>@@
@@#events5;.event_button;<<button "5">>
<<set _options.find("#li5").css("text-decoration", "line-through")>>
<<set _responses = [
_lia.dialogue("Nipon needs to return to its origins. I want to see this trend of slavery \
abolished not matter what, and I want to prove to people that true freedom is possible even \
in this wretched world. And..."),
"Lia\'s words fade off and she turns again to stare at the horizon,",
_lia.dialogue("I... I just want my home back. I miss my family."),
_options.clone()
]>>
<</button>>@@
@@#events6;.event_button;<<button "6">>
<<set _options.find("#li6").css("text-decoration", "line-through")>>
<<if $quests.power_struggles.stage == 2>>
<<set _responses = [
_lia.dialogue("I need you to steal Shin\'s transaction log from his office and \
I also need the copy of the Hiroyuki family registry from his library. Bring them \
to me and I will ensure your eventual freedom."),
"Lia eyes you expecting your next question,",
_options.clone()
]>>
<<elseif $quests.power_struggles.stage == 5>>
<<set $enable_menu = false>>
<<set _action = 6>>
<<set _responses = [
_lia.dialogue("Great! Give them here."),
"Lia gesters for you to hand over the documents.\
<ol><li>Hand over the documents.</li><li>Only if she flashes you</li></ol>"
]>>
/* TODO: Add blowjob option for male */
<<set _choices = 2>>
<<set _disable_buttons = true>>
<<disableactions>>
<<elseif $quests.path_to_freedom.added && $quests.path_to_freedom.stage == 4>>
<<set _responses = [
_lia.dialogue("Yes I heard that you gave her quite the trashing in the arena before she abruptly fell. We don\'t have much time \
because a lot of people are suspicious about the circumstances of the fight. I wouldn\'t be surprised if you\'ve already \
been questioned. Listen, you need to go to the theater and attend the next showing. My sources tell me Shintani is there \
and we\'ll be staging our ambush them. I\'ve cleared the plan with the Union as well. Be prepared to fight as well.")
]>>
<<set $quests.path_to_freedom.stage += 1>>
<</if>>
<</button>>@@
@@#events7;.event_button;<<button "7">>
<</button>>@@
@@#events8;.event_button;<<button "8">>
<</button>>@@
<<set $buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set $buttons.push("#events" + _i)>>
<</for>>
<<set $buttons_extra = ["#events_actions_back", "#events_actions_leave"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div id="events_actions_back" style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<removeclass "#actions" "hidden">>
<<addclass "#events_actions" "hidden">>
<</button>>
</div>
<div id="events_actions_leave" style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<timed 50ms>><<silently>><<script>>
$(".event_button button").on("click", (event) => {
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
if (State.temporary.responses != "null") {
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
delete State.temporary.responses;
}
});
<</script>><</silently>><</timed>>
<</nobr>><<if $player.home == "liasTower">>
<<set $_to_log = "The tower that used to be a prison for Lia Hiroyuki sits barren and in your care. It seems \
that the sorrows faced here still slightly linger in some particular stagnant pockets of air.">>
<<loadVars>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
<<include infoLog>>
</div>
<<include info>>
<<include molestInfo>>
<<include sexInfo>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include liasTowerPlayerHomeActions>>
</div>
</div>
</div>
<<elseif $player.home == "shintaniHome">>
<<set _lia = $characters.lia_hiroyuki>>
<<if $quests.power_struggles.stage == 1>>
/* Update quest */
<<set $quests.power_struggles.stage = 2>>
<<set $quests.power_struggles.data.side = "lia">>
<<set $_to_log = "
<div>You enter Lia\'s tower to find her sitting and staring into the horizon. \
She notices that you arrived and turns around to greet you.</div><br>" +
$characters.lia_hiroyuki.dialogue("\
Oh, I didn\'t think you would actually come. Normally I\'m not allowed to have \
any visitors, but since you are technically property of the Hiroyuki family, you \
are an exception. Here, have a seat.\
") +
"<ol>\
<li>Take a seat.</li>\
</ol>"
>>
<<set _init_sequence = true>>
<<timed 50ms>>
<<removeclass "#events_actions" "hidden">>
<<addclass "#actions" "hidden">>
<<set _choices = 1>>
<<disableactions>>
<</timed>>
<<else>>
<<set $_to_log = "
<div>You enter Lia\'s tower to find her sitting and staring into the horizon. \
She notices that you arrived and turns around to greet you.</div><br>" +
$characters.lia_hiroyuki.dialogue("You\'re back.")
>>
<</if>>
/* Load in any saved variables */
<<loadVars>>
/* Audio engine */
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
<<script>>
setTimeout(() => {
var lia = State.variables.characters.lia_hiroyuki;
$("#mainLogCharacterImage").css("background-image",
"url(\"" + lia.image_folder() + "lia_sitting_neutral.png\")"
);
}, 10);
<</script>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include liasTowerActions>>
<<include liasTowerTalkOptions>>
</div>
</div>
</div>
<</if>>
<<updatetime>><div id="actions" class="action container row col longbutton fiveQuarters"
style="--rows: 4; --cols: 4">
<div style="grid-row: 1; grid-column: 1">
<<button "Manage">>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto manageMenu>>
<</button>>
</div>
<div style="grid-row: 2; grid-column: 1">
<<button "Relax">>
/* Temperarily disable working status while relaxing */
<<set _temp_is_working = $player.is_working>>
<<set $player.is_working = false>>
<<addhours 1>>
/* Cut time awake by two hours */
<<set $rest_momentum = ($rest_momentum - 2 * 60).clamp(Math.min(5 * 60, $rest_momentum), 1000000)>>
<<set $player.is_working = _temp_is_working>>
<<unset _temp_is_working>>
<<include round>>
/* Change image depending on day or night */
<<run $("#mainLogImage").css("background-image", "url(\"resources/images/places/liasTower" +
(setup.is_day($gameDate) ? "Day" : "Night") + "Image.png\")")>>
<</button>>
</div>
<div style="grid-row: 3; grid-column: 1">
<<button "Slaves">><<script>>
$("#action_bar").empty();
$("#action_bar").wiki("<<include liasTowerPlayerHomeSlavesOptions>>");
<</script>><</button>>
</div>
<div style="grid-row: 4; grid-column: 1">
<<button "Sleep">><<script>>
$("#action_bar").empty();
$("#action_bar").wiki("<<include liasTowerPlayerHomeSleepActions>>");
<</script>><</button>>
</div>
<div style="grid-row: 1; grid-column: 2">
<<button "Facilities">><<script>>
$("#action_bar").empty();
$("#action_bar").wiki("<<include liasTowerPlayerHomeFacilitiesOptions>>");
<</script>><</button>>
</div>
<div style="grid-row: 1; grid-column: 4"></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div style="grid-row: 3; grid-column: 4"></div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div><<nobr>>
<div id="events_actions" class="action container row col hidden"
style="--rows: 4; --cols: 5">
@@#events1;<<button "1">>
<<set _action = 1>>
<</button>>@@
@@#events2;<<button "2">>
<<set _action = 2>>
<</button>>@@
@@#events3;<<button "3">>
<<set _action = 3>>
<</button>>@@
@@#events4;<<button "4">>
<<set _action = 4>>
<</button>>@@
@@#events5;<<button "5">>
<<set _action = 5>>
<</button>>@@
@@#events6;<<button "6">>
<<set _action = 6>>
<</button>>@@
@@#events7;<<button "7">>
<<set _action = 7>>
<</button>>@@
@@#events8;<<button "8">>
<<set _action = 8>>
<</button>>@@
@@#events9;<<button "9">>
<<set _action = 9>>
<</button>>@@
@@#events10;<<button "10">>
<<set _action = 10>>
<</button>>@@
@@#events11;<<button "11">>
<<set _action = 11>>
<</button>>@@
@@#events12;<<button "12">>
<<set _action = 12>>
<</button>>@@
<<set $buttons = []>>
<<for _i = 1; _i lte 12; _i++>>
<<set $buttons.push("#events" + _i)>>
<</for>>
<<set $buttons_extra = ["#events_actions_back", "#events_actions_leave"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div id="events_actions_back" class="hidden" style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<if def _back_action && (ndef _refresh || !_refresh)>>
<<addclass "#events_actions" "hidden">>
<<removeclass `_back_action` "hidden">>
<<set _stop_loop = true>>
<<timed 100ms>>
<<unset _stop_loop>>
<</timed>>
<<else>>
<<unset _refresh>>
<<goto liasTower>>
<</if>>
<</button>>
</div>
<div id="events_actions_leave" class="hidden" style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "liasTower">>
<<include locationButton>>
</div>
</div>
<</nobr>><div id="actions" class="action container row col"
style="--rows: 4; --cols: 5">
<<button "Books">>
<<removeclass "#mainLogActionBar" "hidden">>
<<addclass "#mainLogImage" "hidden">>
<<addclass "#mainLogCharacterImage" "hidden">>
<<removeclass "#books_actions" "hidden">>
<<addclass "#actions" "hidden">>
<<run $("#info_title").html("Read in the Library")>>
<<set _default_info = $("<div>\
<div id=\"normal_study\">\
The environment of the library provides a good place to study some books. \
<ul>\
<li id=\"li1\">You can read (education + intelligence / 3) words per minute in the lost tongues.</li>\
</ul></div>\
</div>")>>
<<run $("#infoLogBody").html("")>>
<<run $("#infoLogBody").append(_default_info.clone())>>
<<removeclass "#infoLog" "hidden">>
<<addclass "#mainLog" "hidden">>
<<script>>
$("#mainLogActionBar button").removeClass("disabled");
$("#mainLogActionBar button").prop("disabled", false);
$(".read button").addClass("disabled");
$(".read button").prop("disabled", true);
$("#readStart button").addClass("disabled");
$("#readStart button").prop("disabled", true);
<</script>>
<</button>>
<<button "Study">>
<<run $("#info_title").html("Study in the Library")>>
<<set _default_info = $("<div>\
<div id=\"normal_study\">\
The shelves in the library are filled with knowledge just waiting to be learned.\
<ul id=\"change_list\">\
<li id=\"li1\">3% per hour chance to gain intelligence (capped at 40).</li>\
<li id=\"li2\" class=\"hidden\"></li>\
<li id=\"li3\" class=\"hidden\"></li>\
</ul></div>\
<div id=\"subject_study\">\
You could also expend some extra effort to focus on a specific topic if you\'d like.\
<ul>\
<li id=\"li4\">(intelligence/20)% per hour chance to increase subject stat.</li>\
<li id=\"li5\">-3 additional stamina per hour.</li>\
</ul></div>\
</div>")>>
<<run $("#infoLogBody").html("")>>
<<run $("#infoLogBody").append(_default_info.clone())>>
<<removeclass "#study_actions" "hidden">>
<<addclass "#actions" "hidden">>
<<removeclass "#infoLog" "hidden">>
<<addclass "#mainLog" "hidden">>
/* Reset study buttons */
<<script>>
$(".study button").removeClass("disabled");
$(".study button").prop("disabled", false);
$(".study_option button").addClass("disabled");
$(".study_option button").prop("disabled", true);
$("#studyStart button").addClass("disabled");
$("#studyStart button").prop("disabled", true);
<</script>>
<</button>>
<div style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Back">>
<<set _location_button_dest = "liasTower">>
<<set _location_button_dur = 2>>
<<include locationButton>>
</div>
</div><<nobr>>
<div id="books_actions" class="action container row col fiveQuarters smalltext longbutton hidden"
style="--rows: 4; --cols: 4">
/* How long we want to read for */
<div style="grid-row: 1; grid-column: 1">
@@#read1Hr;.read;<<button "1 Hour">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 2">
@@#read4Hr;.read;<<button "4 Hours">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 4">
<<disable>>
@@#booksStart;<<button "Start">>
<<include liasTowerLibraryBooksEngine>>
<</button>>@@
<</disable>>
</div>
<div style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<addclass "#mainLogActionBar" "hidden">>
<<removeclass "#mainLogImage" "hidden">>
<<removeclass "#mainLogCharacterImage" "hidden">>
<<addclass "#books_actions" "hidden">>
<<removeclass "#actions" "hidden">>
<<addclass "#infoLog" "hidden">>
<<removeclass "#mainLog" "hidden">>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "liasTower">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<timed 50ms>><<script>>
let player = State.variables.player;
let books = UInv.GetItemsArrayByItemTag("inventory", "type", "book");
$("#mainLogActionBar").wiki("<hr>");
let avail = false;
for (let i = 0; i < books.length; i++) {
if (player.books[books[i]] < 1) {
$("#mainLogActionBar").wiki(
"<<button \'" + setup.titleCase(UInv.GetItemPropertyValue("inventory", books[i], "name")) + "\'>>\
<<set _selected_book = \'" + books[i] + "\'>>\
<</button>>"
);
avail = true;
}
}
if (!avail) {
$("#mainLogActionBar").wiki("<center>No unread books.</center>");
}
$("#mainLogActionBar").wiki("<hr><center id=\'completed_title\'><b class=\'tool\'>Completed</b></center>");
$("#mainLogActionBar").wiki("<div id=\'completed_books\' style=\'padding-top: 10px\'></div>");
for (let i = 0; i < books.length; i++) {
if (player.books[books[i]] == 1) {
$("#mainLogActionBar #completed_books").wiki(
"<<button \'" + setup.titleCase(UInv.GetItemPropertyValue("inventory", books[i], "name")) + "\'>>\
<<set _selected_book = \'" + books[i] + "\'>>\
<</button>>"
);
}
}
$("#mainLogActionBar #completed_title").on("click", (event) => {
$("#mainLogActionBar #completed_books").fadeToggle(0.1);
});
$("#mainLogActionBar button").on("click", (event) => {
let _t = State.temporary;
let _v = State.variables;
let player = _v.player;
$("#mainLogActionBar button").removeClass("disabled");
$("#mainLogActionBar button").prop("disabled", false);
$("#booksStart button").addClass("disabled");
$("#booksStart button").prop("disabled", true);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
$("#info_title").html(setup.books[_t.selected_book].name);
if (player.books[_t.selected_book] != 1) {
_t.book_info = $("<div>\
<div>You examine <em>" + setup.books[_t.selected_book].title + "</em> by " + setup.books[_t.selected_book].author +
" to see that it is around " + setup.books[_t.selected_book].word_count + " words. You\'ve currently read " +
setup.round2(100 * player.books[_t.selected_book]) + "% of this book.\
<ul>\
<li id=\"li1\">You can read " + parseInt(player.skills.education + player.stats.intelligence / 3) + " words per minute.</li>\
<li id=\"li2\">There are " + parseInt((1 - player.books[_t.selected_book]) * setup.books[_t.selected_book].word_count) +
" words left in the book.</li>\
</ul></div>\
</div>");
$(".read button").removeClass("disabled");
$(".read button").prop("disabled", false);
} else {
_t.book_info = $("<div>You recall the experience you had when you finished <em>" + setup.books[_t.selected_book].title + "</em>." +
"<br>...<br>" + setup.books[_t.selected_book].completion_text + "</div>");
$(".read button").addClass("disabled");
$(".read button").prop("disabled", true);
}
$("#infoLogBody").html("");
$("#infoLogBody").append(_t.book_info.clone());
});
$(".read button").on("click", (event) => {
let _t = State.temporary;
let _v = State.variables;
let player = _v.player;
$(".read button").removeClass("disabled");
$(".read button").prop("disabled", false);
$("#booksStart button").addClass("disabled");
$("#booksStart button").prop("disabled", true);
let self = $(event.currentTarget);
let read_time = parseInt(setup.numerize(self.html()));
State.temporary.to_advance_hr = read_time;
if (Math.abs(setup.project_stamina_change(60 * read_time)) < player.conditions.stamina) {
self.addClass("disabled");
self.prop("disabled", true);
$("#booksStart button").removeClass("disabled");
$("#booksStart button").prop("disabled", false);
_t.words_read = parseInt(player.skills.education + player.stats.intelligence / 3) * 60 * read_time;
$("#infoLogBody").find("#li1").html("You will read " + _t.words_read + " words.");
} else {
let str = "<<notify>>You are too tired to read " + read_time + " ";
if (read_time == 1) {
str += "hour.";
} else {
str += "hours.";
}
str += "<</notify>>";
$.wiki(str);
$("#booksStart button").addClass("disabled");
$("#booksStart button").prop("disabled", true);
$("#infoLogBody").html("");
$("#infoLogBody").append(_t.book_info.clone());
}
});
<</script>><</timed>>
<</nobr>><<nobr>>
/* Information about work */
<<set $_temp_to_log = "\
<div>You spent time intensely reading in the your library.</div>\
">>
/* Get clone of player to display changes */
<<set _player = clone($player)>>
/* Forward time along with dynamics */
<<set $player.is_working = true>>
<<addhours _to_advance_hr>>
<<set $player.is_working = false>>
/* Simulate education roll */
<<set _thresh = setup.progressive_gain_chance($player.skills.education, 100, "linear")>>
<<if $difficulty == -2>>
<<set _thresh *= 2>>
<<elseif $difficulty == -1>>
<<set _thresh *= 1.5>>
<</if>>
<<set _roll = randomFloat(1.0)>>
<<if _roll lt _thresh>>
<<set $player.skills.education += Math.ceil(2 * _thresh)>>
<<set $_temp_to_log += "<div>Your literacy and reading ability has improved (Education " + setup.show_change_html(0, Math.ceil(2 * _thresh)) + ")</div>">>
<</if>>
<<set $player.books[_selected_book] = ($player.books[_selected_book] + _words_read / setup.books[_selected_book].word_count).clamp(0, 1)>>
<<if $player.books[_selected_book] == 1>>
/* Completed book */
<<set $_temp_to_log += "<div>After many long hours of reading, you have finally finished reading <em>" +
setup.books[_selected_book].title + "</em>. " + setup.books[_selected_book].completion_text + "</div>">>
/* Calculate skill changes and apply them to the player */
<<set setup.apply_delta($player, setup.books[_selected_book].changes)>>
<<if _selected_book == "heart_of_darkness">>
<<run setup.remove_val($quest_journal.ongoing, "knowledge_is_power")>>
<<set $quest_journal.completed.push("knowledge_is_power")>>
<<set $quest_journal.ongoing.push("something_lost")>>
<<notify>>Quest <em>Something Lost</em> added to journal!<</notify>>
<<audio "quest_added_sound" play>>
<<else>>
<<set $quests.something_lost.stage += 1>>
<<if $quests.something_lost.stage == 6>>
/* TODO: Complete quest */
<<run setup.remove_val($quest_journal.ongoing, "something_lost")>>
<<set $quest_journal.completed.push("something_lost")>>
<</if>>
<</if>>
<</if>>
/* Round off and clamp */
<<include round>>
<<set $_temp_to_log += "<br><b>Reading total stat changes:</b>">>
<<set $_temp_to_log += "<ul>">>
/* Add in stats changes */
<<for _key, _val range _player.stats>>
<<if _val != $player.stats[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.stats[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in skills changes */
<<for _key, _val range _player.skills>>
<<if _val != $player.skills[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.skills[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in condition changes */
<<for _key, _val range _player.conditions>>
<<if _val != $player.conditions[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.conditions[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in slave trait changes */
<<for _key, _val range _player.slave_traits>>
<<if _val != $player.slave_traits[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.slave_traits[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Close off changes */
<<set $_temp_to_log += "</ul>">>
/* Unset variables */
<<unset _changes>>
<<unset _to_advance_hr>>
<<unset $_player>>
/* Re-enable menu */
<<set $enable_menu = true>>
<<goto `passage()`>>
<</nobr>><<if $player_home.liasTower.library == 1>>
<<set $_to_log = "You enter an excuse for a library, more of a study space, made from clearing out some clutter and renovating \
a pre-existing room. A small light sits in the corner of the room and a couple of books line the walls. There\'s a faint smell \
of ancestry, as if you were meant to be here somehow.">>
<</if>>
/* Load in any saved variables */
<<loadVars>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
<<include infoLog>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include liasTowerLibraryActions>>
<<include liasTowerLibraryStudyActions>>
<<include liasTowerLibraryBooksActions>>
</div>
</div>
</div>
<<updatetime>><<nobr>>
<div id="study_actions" class="action container row col fiveQuarters smalltext longbutton hidden"
style="--rows: 4; --cols: 4">
/* How long we want to work for */
<div style="grid-row: 1; grid-column: 1">
@@#study1Hr;.study;<<button "1 Hour">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 2">
@@#study4Hr;.study;<<button "4 Hours">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 3">
@@#study8Hr;.study;<<button "8 Hours">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 4">
<<disable>>
@@#studyStart;<<button "Start">>
<<include liasTowerLibraryStudyEngine>>
<<audio page_sound play>>
<</button>>@@
<</disable>>
</div>
<<disable>>
@@#manipulation;.study_option;<<button "Manipulation">><</button>>@@
<</disable>>
<<disable>>
@@#tact;.study_option;<<button "Tact">><</button>>@@
<</disable>>
<div style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<removeclass "#actions" "hidden">>
<<addclass "#study_actions" "hidden">>
<<removeclass "#mainLog" "hidden">>
<<addclass "#infoLog" "hidden">>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "liasTower">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<timed 50ms>><<silently>><<script>>
$(".study button").on("click", (event) => {
let _v = State.variables;
let player = _v.player;
$(".study button").removeClass("disabled");
$(".study button").prop("disabled", false);
let self = $(event.currentTarget);
let study_time = parseInt(self.html().replace(/\D/g,''));
State.temporary.to_advance_hr = study_time;
if (Math.abs(setup.project_stamina_change(60 * study_time)) < player.conditions.stamina) {
self.addClass("disabled");
self.prop("disabled", true);
$(".study_option button").removeClass("disabled");
$(".study_option button").prop("disabled", false);
State.temporary.study_subject = "none";
$("#subject_study").addClass("hidden");
let intell_perc = 3;
if (_v.difficulty == -2) {
intell_perc *= 2;
} else if (_v.difficulty == -1) {
intell_perc *= 1.5;
}
if (player.stats.intelligence >= 40) {
intell_perc = 0;
}
$("#li1").html(intell_perc * study_time + "% chance to gain intelligence.");
$("#li2").addClass("hidden");
$("#li3").addClass("hidden");
$("#studyStart button").removeClass("disabled");
$("#studyStart button").prop("disabled", false);
} else {
let str = "<<notify>>You are too tired to study " + study_time + " ";
if (study_time == 1) {
str += "hour.";
} else {
str += "hours.";
}
str += "<</notify>>";
$.wiki(str);
$(".study_option button").addClass("disabled");
$(".study_option button").prop("disabled", true);
$("#studyStart button").addClass("disabled");
$("#studyStart button").prop("disabled", true);
$("#infoLogBody").html("");
$("#infoLogBody").append(State.temporary.default_info.clone());
}
});
$(".study_option button").on("click", (event) => {
let _v = State.variables;
let player = _v.player;
let study_time = State.temporary.to_advance_hr;
if (3 * study_time + Math.abs(setup.project_stamina_change(60 * study_time)) < player.conditions.stamina) {
$(".study_option button").removeClass("disabled");
$(".study_option button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
let study_subject = self.html().toLowerCase();
State.temporary.study_subject = study_subject;
let raise_perc = player.stats.intelligence / 20 * study_time;
if (_v.difficulty == -2) {
raise_perc *= 2;
} else if (_v.difficulty == -1) {
raise_perc *= 1.5;
}
$("#li2").html(raise_perc + "% chance to increase " + study_subject + ".");
$("#li2").removeClass("hidden");
$("#li3").html(-3 * study_time + " additional stamina.");
$("#li3").removeClass("hidden");
} else {
$.wiki("<<notify>>You are too tired to study an additional subject.<</notify>>");
}
})
<</script>><</silently>><</timed>>
<</nobr>><<nobr>>
/* Information about work */
<<set $_temp_to_log = "\
<div>You spent time intensely studying in the library.</div>\
">>
/* Get clone of player to display changes */
<<set _player = clone($player)>>
/* Forward time along with dynamics */
<<set $player.is_working = true>>
<<addhours _to_advance_hr>>
<<set $player.is_working = false>>
/* Simulate education roll */
<<set _thresh = setup.progressive_gain_chance($player.skills.education, 100, "linear")>>
<<if $difficulty == -2>>
<<set _thresh *= 2>>
<<elseif $difficulty == -1>>
<<set _thresh *= 1.5>>
<</if>>
<<set _roll = randomFloat(1.0)>>
<<if _roll lt _thresh>>
<<set $player.skills.education += Math.ceil(2 * _thresh)>>
<<set $_temp_to_log += "<div>Your literacy and reading ability has improved (Education " + setup.show_change_html(0, Math.ceil(2 * _thresh)) + ")</div>">>
<</if>>
/* Simulate intelligence roll */
<<set _roll = randomFloat(1.0)>>
<<set _thresh = _to_advance_hr * 3 / 100>>
<<if $difficulty == -2>>
<<set _thresh *= 2>>
<<elseif $difficulty == -1>>
<<set _thresh *= 1.5>>
<</if>>
<<if $player.stats.intelligence gte 40>>
<<set _thresh = 0>>
<</if>>
<<if _roll lt _thresh>>
<<set $player.stats.intelligence += 1>>
<<set $_temp_to_log += "<div>You studied the perfect combination of subjects, resulting in clear \
mental growth (Intelligence " + setup.show_change_html(0, 1) + ")</div>">>
<</if>>
/* Simulate subject learning */
<<if _study_subject != "none">>
<<set _roll = randomFloat(1.0)>>
<<set _thresh = (_to_advance_hr * $player.stats.intelligence / 20) / 100>>
<<if $difficulty == -2>>
<<set _thresh *= 2>>
<<elseif $difficulty == -1>>
<<set _thresh *= 1.5>>
<</if>>
<<if _roll lt _thresh>>
<<set $_temp_to_log += "<div>Your study of " + _study_subject + " was extremely successful and informative \
(" + setup.titleCase(_study_subject) + " " + setup.show_change_html(0, 1) + ")</div>">>
<<set $player.stats[_study_subject] += 1>>
<</if>>
<<set $player.conditions.stamina -= 3 * _to_advance_hr>>
<</if>>
/* Round off and clamp */
<<include round>>
<<set $_temp_to_log += "<br><b>Study total stat changes:</b>">>
<<set $_temp_to_log += "<ul>">>
/* Add in stats changes */
<<for _key, _val range _player.stats>>
<<if _val != $player.stats[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.stats[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in skills changes */
<<for _key, _val range _player.skills>>
<<if _val != $player.skills[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.skills[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in condition changes */
<<for _key, _val range _player.conditions>>
<<if _val != $player.conditions[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.conditions[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in slave trait changes */
<<for _key, _val range _player.slave_traits>>
<<if _val != $player.slave_traits[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.slave_traits[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Close off changes */
<<set $_temp_to_log += "</ul>">>
/* Unset variables */
<<unset _changes>>
<<unset _to_advance_hr>>
<<unset $_player>>
/* Re-enable menu */
<<set $enable_menu = true>>
<<goto `passage()`>>
<</nobr>><div id="facilities_options" class="action container row col longbutton fiveQuarters smalltext" style="--rows: 4; --cols: 4">
<<for _key, _facility range setup.playerHome[passage()]>>
<<if $player_home[passage()][_key] != null && $player_home[passage()][_key] != 0>>
<<capture _facility>>
<<button `setup.titleCase(_key)`>>
<<goto `_facility.passage`>>
<</button>>
<</capture>>
<<else>>
<<disable>>
<<button `setup.titleCase(_key)`>><</button>>
<</disable>>
<</if>>
<</for>>
<div style="grid-row: 4; grid-column: 4">
<<button "Back">><<script>>
$("#action_bar").empty();
$("#action_bar").wiki("<<include liasTowerPlayerHomeActions>>");
<</script>><</button>>
</div>
</div><div id="slaves_actions" class="action container row col"
style="--rows: 4; --cols: 5">
/* Fill up 5th column to prevent overflow */
<div style="grid-row: 1; grid-column: 5">
<<button "Inspect">>
<<set $selection_queue = []>>
<<for _idx, _slave range $player.slaves>>
<<set $selection_queue.push(_slave)>>
<</for>>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto characterMenu>>
<</button>>
</div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<script>>
$("#action_bar").empty();
$("#action_bar").wiki("<<include liasTowerPlayerHomeSlavesOptions>>");
$("#mainLogImage").css("background-image", "url(\"resources/images/places/liasTower" +
(setup.is_day(State.variables.gameDate) ? "Day" : "Night") + "Image.png\")");
$("#mainLogCharacterImage").css("background-image", "none");
$("#char_quick_info").empty();
$("#mainLog").html("");
$("#mainLog").wiki("<b><<= setup.titleCase(setup.locations.get(passage()).name)>>:</b><br>");
$("#mainLog").wiki(State.variables._to_log);
<</script>>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "liasTower">>
<<set _location_button_dur = 1>>
<<include locationButton>>
</div>
<<button "Ask">>
<<include "defaultAsk">>
<<script>>
$("#slaves_actions").addClass("hidden");
$("#events_actions").removeClass("hidden");
<</script>>
<<set _back_action = "#slaves_actions">>
<</button>>
<<button "Influence">>
<<include influenceEngine>>
<<addclass "#slaves_actions" "hidden">>
<<removeclass "#events_actions" "hidden">>
<<set _back_action = "#slaves_actions">>
<</button>>
<<button "Sex">>
<<if $characters[$selected].limits.fuck gt 0>>
<<include sexEngine2>>
<<addclass "#info" "hidden">>
<<addclass "#slaves_actions" "hidden">>
<<set _back_action = "#slaves_actions">>
<<else>>
<<notify>>
Already had sex with <<= setup.titleCase(_char.first_name)>>
today!
<</notify>>
<</if>>
<</button>>
</div><div id="slaves_asleep_actions" class="action container row col"
style="--rows: 4; --cols: 5">
/* Fill up 5th column to prevent overflow */
<div style="grid-row: 1; grid-column: 5">
<<button "Inspect">>
<<set $selection_queue = []>>
<<for _idx, _slave range $player.slaves>>
<<set $selection_queue.push(_slave)>>
<</for>>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto characterMenu>>
<</button>>
</div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<script>>
$("#action_bar").empty();
$("#action_bar").wiki("<<include liasTowerPlayerHomeSlavesOptions>>");
$("#mainLogImage").css("background-image", "url(\"resources/images/places/liasTower" +
(setup.is_day(State.variables.gameDate) ? "Day" : "Night") + "Image.png\")");
$("#mainLogCharacterImage").css("background-image", "none");
$("#mainLog").html("");
$("#mainLog").wiki("<b><<= setup.titleCase(setup.locations.get(passage()).name)>>:</b><br>");
$("#mainLog").wiki(State.variables._to_log);
<</script>>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "liasTower">>
<<set _location_button_dur = 1>>
<<include locationButton>>
</div>
<<button "Molest">>
<<if _char.limits.molest gt 0>>
<<include molestEngine>>
<<addclass "#slaves_asleep_actions" "hidden">>
<<addclass "#info" "hidden">>
<<else>>
<<notify>>
Already molested <<= setup.titleCase(_char.first_name)>>
today!
<</notify>>
<</if>>
<</button>>
</div><div id="slaves_options" class="action container row col" style="--rows: 4; --cols: 5">
<div style="grid-row: 4; grid-column: 5">
<<button "Back">><<script>>
$("#action_bar").empty();
$("#action_bar").wiki("<<include liasTowerPlayerHomeActions>>");
<</script>><</button>>
</div>
/* Fill up 5th column to prevent overflow */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 3; grid-column: 5"></div>
/* Player slaves */
<<set _iter2 = $player.slaves>>
<<for _i = 0; _i lt _iter2.length; _i++>>
<div>
<<capture _i>>
<<button `setup.titleCase($characters[_iter2[_i]].first_name)`>>
<<set $selected = _iter2[_i]>>
<<set _char = $characters[$selected]>>
<<if _char.assignment != "none" && "times" in setup.assignments[_char.assignment] &&
setup.in_range($gameDate.getHours(), setup.assignments[_char.assignment].times)>>
<<notify>><<= setup.titleCase(_char.first_name)>> is currently out on assignment.<</notify>>
<<else>>
<<script>>
var char = State.variables.characters[State.variables.selected];
$("#action_bar").empty();
$("#action_bar").wiki("<<include liasTowerPlayerHomeEventsActions>>");
var div = $("<div></div>");
var gameDate = State.variables.gameDate;
if (gameDate.getHours() <= 5 || gameDate.getHours() >= 22) {
$("#action_bar").wiki("<<include liasTowerPlayerHomeSlavesAsleepActions>>");
/* Molest actions */
$("#action_bar").wiki("<<include molestActions>>");
$("#action_bar").wiki("<<include molestCumActions>>");
var str = "
You make your way over to " + char.name() + "\'s room to find " +
setup.him(char) + " peacefully asleep.<br>\
";
if (char.mental_conditions.suspicion > 0) {
str += "<span class=\"fail\">(" + setup.titleCase(char.first_name) +
" will be harder to steal from or molest since they are suspicious)</span>"
}
div.html(str);
$("#slaves_asleep_actions").removeClass("hidden");
$("#mainLogImage").css("background-image",
"url(\"resources/images/places/shintaniHome" +
setup.titleCase(char.first_name)
+ "NightImage.png\")"
);
State.temporary.play_sound = true;
} else {
$("#action_bar").wiki("<<include liasTowerPlayerHomeSlavesActions>>");
if (char.assignment == "confinement") {
div.html("
You enter " + char.name() + "\'s confinement cell and approach " +
setup.him(char) + " huddling in the corner.<br>" + char.toString()
);
} else {
div.html("
You spot " + char.name() + " working and approach " + setup.him(char) +
".<br>" + char.toString()
);
}
$("#slaves_actions").removeClass("hidden");
State.temporary.play_sound = false;
}
$("#char_quick_info").empty();
$("#char_quick_info").html(`<b>${setup.titleCase(char.first_name)}'s Disposition: </b>` + setup.titleCase(char.get_disposition()));
setup.mainLog_append(div);
<</script>>
/* Forward time by 5 - 10 minutes */
<<addmins `dice(1, 5) + 5`>>
<<if _play_sound>>
<<audio "wooden_door_sound" play>>
<</if>>
<<unset _play_sound>>
<</if>>
<</button>>
<</capture>>
</div>
<</for>>
</div><div id="sleep_actions" class="action container row col longbutton fiveQuarters" style="--rows: 4; --cols: 4">
<div style="grid-row: 1; grid-column: 4"><<disable>>
@@#sleep_start;<<button "Start">>
<<set $_player = clone($player)>>
<<set $player.is_sleeping = true>>
<<if _to_advance == 24 * 60>>
<<advanceday>>
<<elseif _to_advance == 24 * 60 * 7>>
<<advanceweek>>
<<else>>
<<addmins _to_advance>>
<</if>>
<<set $player.is_sleeping = false>>
<<goto liasTowerPlayerHomeSleepEngine>>
<</button>>@@
<</disable>></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div style="grid-row: 3; grid-column: 4"></div>
<div style="grid-row: 4; grid-column: 4">
<<button "Back">>
<<script>>
$("#action_bar").empty();
$("#action_bar").wiki("<<include liasTowerPlayerHomeActions>>");
<</script>>
<</button>>
</div>
@@.sleep_option;<<button "4 Hours">><</button>>@@
@@.sleep_option;<<button "8 Hours">><</button>>@@
@@.sleep_option;<<button "12 Hours">><</button>>@@
@@.sleep_option;<<button "End Day">><</button>>@@
@@.sleep_option;<<button "End Week">><</button>>@@
</div>
<<silently>><<timed 20ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
$(".sleep_option button").on("click", (event) => {
let self = $(event.currentTarget);
$(".sleep_option button").removeClass("disabled");
$(".sleep_option button").prop("disabled", false);
self.addClass("disabled");
self.prop("disabled", true);
$("#sleep_start button").removeClass("disabled");
$("#sleep_start button").prop("disabled", false);
$("#infoLog").addClass("hidden");
$("#mainLog").removeClass("hidden");
if (self.html() == "End Day") {
$("#infoLog").removeClass("hidden");
$("#mainLog").addClass("hidden");
$("#info_title").html("Sleep Until Sunrise");
$("#infoLogBody").html("Rest your head until 7AM of the next calendar day.");
_t.to_advance = 24 * 60;
} else if (self.html() == "End Week") {
$("#infoLog").removeClass("hidden");
$("#mainLog").addClass("hidden");
$("#info_title").html("End Week");
$("#infoLogBody").html("Skip ahead to the next Sunday 7AM. All assignments, diets, and rules will \
remain in effect, but will be canceled if you cannot fund their upkeeps.");
_t.to_advance = 7 * 24 * 60;
} else {
$("#infoLog").removeClass("hidden");
$("#mainLog").addClass("hidden");
$("#info_title").html("Sleep for " + setup.numerize(self.html()) + " Hours");
$("#infoLogBody").html("Note that the effects of daily assignments and changes will depend on the sum of \
the amount of time since you last slept along with the amount of time you\'re planning on sleeping. Integer \
changes that are divide are made done probabilically while probability-based changes that are made integer \
are done via expected value.");
_t.to_advance = setup.numerize(self.html()) * 60;
}
});
<</script>><</timed>><</silently>>/* Check for fill or emptied slave_traits */
<<set _player_extra_changes = "">>
<<set _player_flavor_text = "">>
/* Update quest journal */
<<updatequests>>
/* Simulate slaves */
<<include slaveEngine>>
/* Remove money from player */
<<if _afford>>
<<if _total_profit gt 0>>
<<addmoney `setup.round2(_total_profit)`>>
<<elseif _total_profit lt 0>>
<<removemoney `Math.abs(setup.round2(_total_profit))`>>
<</if>>
<</if>>
<div id="background" class="paper_border" style="position: relative">
<center><h1><<= either([
"A Few More Grains Fall Down the Hourglass",
"The River of Time Continues to Flow",
"The Wind Chimes with the Passing of Time",
"Fates Continue to Bring Upon New Days",
"Time Passes in Nipon"
])>></h1></center>
<div style="overflow-y: auto; height: 450px; padding: 10px">
<p id="sleep_summary" class="textpassage" style="display: none">
<<capture $_player>>
<<messageopen "Player Summary">>
<<if $_to_advance / (60 * 24) gte 1>>
<<= parseInt($_to_advance / (60 * 24))>> days,
<</if>>
<<= parseInt(($_to_advance % (60 * 24)) / 60)>> hours and <<= parseInt($_to_advance % 60)>>
minutes pass. _player_flavor_text
<br>
''Sleep total stat changes:''
<ul class="sleepChanges">
/* Add in stat changes */
<<for _key, _val range $_player.stats>>
<<if _val != $player.stats[_key]>>
<li> <<= setup.titleCase(_key)>>: <<= setup.show_change_html(_val, $player.stats[_key], true)>></li>
<</if>>
<</for>>
/* Add in condition changes */
<<for _key, _val range $_player.conditions>>
<<if _val != $player.conditions[_key]>>
<li> <<= setup.titleCase(_key)>>: <<= setup.show_change_html(_val, $player.conditions[_key], true)>></li>
<</if>>
<</for>>
/* Add in slave trait changes */
<<for _key, _val range $_player.slave_traits>>
<<if _val != $player.slave_traits[_key]>>
<li> <<= setup.titleCase(_key)>>: <<= setup.show_change_html(_val, $player.slave_traits[_key], true)>></li>
<</if>>
<</for>>
<<if _afford && _total_profit != 0>>
<li>Profit: <<= setup.show_money_change_html(0, _total_profit)>></li>
<</if>>
</ul>
<</messageopen>><br>
<<messageopen "Slave Summary">>
<<if _to_simulate_day.size == 0>>
You do not have any slaves on assignment right now.
<<else>>
<<if _afford>>
<<for _key, _val range _slave_changes>>
<<set _char = $characters[_key]>>
<<capture _char, _key, _val>>
<<messageopen _char.name()>>
<<= _val.flavor_text>><br>
''<<= setup.titleCase(_char.first_name)>> Changes''
<ul class="sleepChanges">
<<for _sub_key, _sub_val range _slave_changes[_key].self>>
<<for _sub_sub_key, _sub_sub_val range _sub_val>>
<<if _sub_sub_val == 0>>
<<continue>>
<</if>>
<<if _sub_key == "sex_fetishes">>
<<set _tit = setup.titleCase(_sub_sub_key) + " Fetish">>
<<elseif _sub_key == "sex_skills">>
<<set _tit = setup.titleCase(_sub_sub_key) + " Skill">>
<<elseif _sub_key == "sex_prefs">>
<<set _tit = setup.titleCase(_sub_sub_key) + " Preference">>
<<elseif _sub_key == "slave_traits" && _sub_sub_key == "obedience">>
<<set _tit = "Affection">>
<<else>>
<<set _tit = setup.titleCase(_sub_sub_key)>>
<</if>>
<li>_tit:
<<if _sub_sub_key in setup.POSITIVES.character>>
<<= setup.show_change_html(0, _sub_sub_val, setup.POSITIVES.character[_sub_sub_key])>>
<<else>>
<<= setup.show_change(0, _sub_sub_val)>>
<</if>>
</li>
<</for>>
<</for>>
<<for _idx, _sub_val range _slave_changes[_key].special>>
<li><<= _sub_val>></li>
<</for>>
<li>Profit: <<= setup.show_money_change_html(0, -1 * _slave_changes[_key].cost)>></li>
<<if _slave_changes[_key].cost lt 0>>
<<set _char.finances.total_earned += -1 * _slave_changes[_key].cost>>
<<else>>
<<set _char.finances.cost += _slave_changes[_key].cost>>
<</if>>
</ul>
<</messageopen>><br>
<</capture>>
<</for>>
<<else>>
Your assigned slaves cost you
<span class="fail"><<= setup.LARI>><<= Math.abs(_total_profit)>></span>
which is more than you have. Thus they ignored all their assignments for
the day and returned to their default roles.
<</if>>
<</if>>
<</messageopen>><br>
<<set _year_start = new Date($gameDate.getFullYear(), 0, 0)>>
<<set _diff = $gameDate - _year_start>>
<<set _day = _diff / (1000 * 60 * 60 * 24)>>
<<messageopen "World Summary">><br>
<<if $player.titles.has("liberator") || $player.titles.has("hironaka") || $player.titles.has("trade_union_patron")>>
The prices of commodities have shifted with the chaotic world:<br>
<<for _commodity, _val range $commodities>>
<<set _sigma = _val.stable_price * _val.sigma_ratio>>
<<set _mu = _sigma * Math.sin(2 * Math.PI / 356 * _day + _val.mu_phase) + _val.stable_price>>
<<capture _commodity, _val, _mu>><<messageopen `setup.titleCase(_commodity)`>>
is currently <b><<= (_val.price > _mu) ? "<span class='success'>over priced</span>" : "<span class='fail'>under priced</span>">></b>
at <<= setup.LARI + setup.round2($commodities[_commodity].price)>> with its equilibrium price (mu) predicted at
<<= setup.LARI + setup.round2(_mu)>>. Trend analysis predicts this equilibrium price will
<b><<= (Math.cos(2 * Math.PI / 356 * _day + _val.mu_phase) > 0 ? "<span class='success'>increase</span>" : "<span class='fail'>decrease</span>")>></b>
in the future.
<</messageopen>><br><</capture>>
<</for>>
<</if>>
<</messageopen>>
<</capture>>
</p>
</div>
<div id="cont_button" style="position: absolute; bottom: 100px; left: calc(50% - 82px); display: none">
<<button "Continue" liasTower>><</button>>
</div>
</div>
<<script>>
setTimeout(() => {
var div = $("<div></div>");
div.html(State.temporary.player_extra_changes);
$("#sleep_summary").prepend(div);
$("#sleep_summary").fadeIn();
$("#cont_button").fadeIn();
}, 500);
<</script>>
/* Reset awake counter */
<<set $rest_momentum = 0>>
<<set $time_awake = 0>>
<<include round>>
<<unset $_player>><<if setup.is_day($gameDate)>>
<img src="resources/maps/niponCentralMap.jpeg" usemap="#image-map">
<<else>>
<img src="resources/maps/niponCentralMapNight.jpeg" usemap="#image-map">
<</if>>
<map name="image-map">
<area alt="shintaniHome" coords="472,214,452,230,453,262,466,274,470,281,471,302,472,482,452,504,456,535,479,546,498,540,510,533,697,531,697,477,749,435,798,433,794,337,780,300,755,265,714,243,674,235,515,235,501,217" shape="poly">
<area alt="niponArena" coords="1226,721,81" shape="circle">
<area alt="solBrothel" coords="185,508,269,662" shape="rect">
<area alt="niponTownHall" coords="506,611,726,780" shape="rect">
<area alt="yukisGourmet" coords="336,308,422,447" shape="rect">
<area alt="niponAcademy" coords="919,129,877,169,882,192,847,242,906,293,953,252,977,252,1011,200,971,158" shape="poly">
<area alt="liasTower" coords="180,137,55" shape="circle">
<area alt="niponCentralDocks" coords="1095,177,1095,229,1035,310,954,322,922,359,915,403,923,445,949,466,957,495,971,522,988,566,1006,564,1133,500,1155,418,1149,302,1179,218,1132,181" shape="poly">
<area alt="niponSlums" coords="211,756,373,796" shape="rect">
<area alt="niponMarket" coords="956,758,1137,796" shape="rect">
<area alt="niponBarracks" coords="745,512,709,481,753,446,795,445,838,464,850,487,823,540,826,563,797,560,749,559,745,532" shape="poly">
</map>
/* Remove quick bar and setup map */
<<script>>
setTimeout(() => {
$("#quickbar").addClass("hidden");
var areas = $("map").children("area");
for (var _i = 0; _i < areas.length; _i++) {
var obj = $(areas[_i]);
if (!(setup.locations.has(obj.attr("alt")))) {
continue;
}
var loc = setup.locations.get(obj.attr("alt"));
if (!State.variables.locations[loc.key].access) {
obj.addClass("noaccess");
obj.attr("onclick", "$.wiki('<<notify>>No Access!<</notify>>')");
obj.attr("title", "No access.");
} else if (!loc.has_access()) {
obj.addClass("closed");
obj.attr("onclick", "$.wiki('<<notify>>Closed!<</notify>>')");
var opening_time = loc.access_times[0];
var opening_time_str = "";
if (opening_time == 0) {
opening_time_str = "12 AM.";
} else if (opening_time < 12) {
opening_time_str = opening_time.toString() + " AM.";
} else if (opening_time == 12) {
opening_time_str = "12 PM.";
} else {
opening_time_str = (opening_time - 12).toString() + " PM.";
}
obj.attr("title", "Opens at " + opening_time_str);
} else {
obj.addClass("access");
var onclick = "SugarCube.setup.locations.get('" + obj.attr("alt") + "').goto(";
if (loc.inside) {
onclick += "'wooden_door_sound'";
}
onclick += ")";
obj.attr("onclick", onclick);
}
}
}, 10);
<</script>><div id="actions" class="action container row col longbutton fiveQuarters" style="--rows: 4; --cols: 4">
<<disable>>
<<button "Front Desk">>
<</button>>
<</disable>>
<<button "Back Room" niponArenaBackRoom>>
<</button>>
<<if ($quests.duty_of_a_slave.added && $quests.duty_of_a_slave.stage == 2) ||
($quests.path_to_freedom.added && $quests.path_to_freedom.stage == 2)>>
@@#prepRoom;<<button "Prep Room" niponArenaPrepRoom>><</button>>@@
<<else>>
<<disable>>
@@#prepRoom;<<button "Prep Room" niponArenaPrepRoom>><</button>>@@
<</disable>>
<</if>>
<div style="grid-row: 1; grid-column: 4"></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div style="grid-row: 3; grid-column: 4"></div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div><div id="duty_of_a_slave_actions" class="action container row col" style="--rows: 4; --cols: 5">
@@#events1;<<button "1">>
<<set _dead = true>>
<<set _disable_buttons = false>>
<<set $_temp_to_log>>
<<run $("#events2 button").addClass("disabled")>>
<<run $("#events2 button").prop("disabled", true)>>
<<if ndef _action>>
<<set _action = 1>>
<<set _responses = [
"You slow approach Nina, pulling out the Hiroyuki blade. As you get near her and press the sharp edge to her throat, \
her eyes slowly open,",
$player.dialogue("Fuck! You\'re awake?"),
"Nina\'s eyes are fixed on one spot on the ceiling and her lip trembles a bit. You can tell that fives minutes without \
the beating of a heart has made her suffer significant damage to her head. While you are unsure if she\'s still her, you can \
tell that the now completely paralyzed Nina was begging for the suffering to end.",
$player.dialogue("I\'m sorry it had to end this way."),
"A single tear rolls down the side of her head as you quickly slice her throat open. The room seemed to have a negative \
decibel level, as if the only sound left in this world was the gushing of blood and the faint puttering of Nina\'s body \
forcing her lungs to gasp for air.",
"You look down at your hands stained with Nina\'s blood, and to your surprise, after all you had gone through, a single tear drop \
escaped your eye. As it fell, you remembered the struggles that had gotten you here. But, when it finally hit your crimson skin, \
it mixed with the blood and was nowhere to be found.",
]>>
<<elseif _action == 2>>
<<set _responses = [
"After having your fun, you pull out the Hiroyuki blade and press it to Nina\'s neck.",
$player.dialogue("Sorry I couldn\'t play with you longer."),
"One last tear rolls down the side of her head as you quickly slice her throat open. The room seemed to have a negative \
decibel level, as if the only sound left in this world was the gushing of blood and the faint puttering of Nina\'s body \
forcing her lungs to gasp for air.",
"You look down at your hands stained with Nina\'s blood, and to your surprise, after all you had gone through, a single tear drop \
escaped your eye. As it fell, you remembered the struggles that had gotten you here. But, when it finally hit your crimson skin, \
it mixed with the blood and was nowhere to be found.",
]>>
<</if>>
<<set $quests.duty_of_a_slave.stage = 4>>
<</button>>@@
@@#events2;<<button "2">>
<<set _action = 2>>
<<set _responses = [
"You slowly approach Nina with impure intentions, but as you began removing her clothes her eyes slowly slid open,",
$player.dialogue("Fuck! You\'re awake?"),
"Nina\'s eyes are fixed on one spot on the ceiling and her lip trembles a bit. You can tell that fives minutes without \
the beating of a heart has made her suffer significant damage to her head. While you are unsure if she\'s still her, you can \
tell that the now completely paralyzed Nina was begging for the suffering to end.",
"Unfortunately for her, she was about to wish she hadn\'t woken up. You take off your bottoms and sit directly onto her face \
while removing the rest of her clothes.",
]>>
<<if $player.gender == 0>>
<<set _responses.push("You continually shove your anus deep into Nina\'s face, forcing her jaw open so that her tongue \
began rubbing against your ass.")>>
<<set _responses.push($player.dialogue("Serves you right, stupid whore."))>>
<<set _responses.push("You turn around and push your cock into her mouth. The room is completely silent except for the \
slathering of your dick into Nina\'s throat, and the occasional gagging as her body unconsciously begs for air. After your dick \
is properly wet, you ram it inside her tight dry pussy.")>>
<<set _responses.push($player.dialogue("You useless slut, you\'re not even wet?"))>>
<<set _responses.push("As you continually slam into her pussy, it slowly gets wet and more tears roll down Nina\'s face. \
To finish things off, you stick your cock back into her mouth to wetten it up before pushing it into her tight anus. Her body \
reflexively jolts a bit, as you can tell that she is an anal virgin. As you push deeper and deeper into her, you eventually \
cum, filling her anal cavity with your cum. You pull out your dick, which is now slick Nina\'s juices and use her tongue to clean it \
one last time.")>>
<<else>>
<<set _responses.push("You continually shove your anus and pussy deep into Nina\'s face, forcing her jaw open so that her tongue \
began rubbing against your clit.")>>
<<set _responses.push($player.dialogue("Serves you right, stupid whore."))>>
<<if $player.has_equipped("strap_on") != "none">>
<<set _responses.push("You turn around and push your strap-on into her mouth. The room is completely silent except for the \
slathering of silicon dick into Nina\'s throat, and the occasional gagging as her body unconsciously begs for air. After your strap-on \
is properly wet, you ram it inside her tight dry pussy.")>>
<<set _responses.push($player.dialogue("You useless slut, you\'re not even wet?"))>>
<<set _responses.push("As you continually slam into her pussy, it slowly gets wet and more tears roll down Nina\'s face. \
To finish things off, you stick your fake penis back into her mouth to wetten it up before pushing it into her tight anus. Her body \
reflexively jolts a bit, as you can tell that she is an anal virgin. As you push deeper and deeper into her, the fricton of the strap-on \
against your clit pushes you over the edge and you orgasm.")>>
<<else>>
<<set _responses.push("You turn around, grabbing Nina\'s legs and using her pussy to grind against yours. The room is completely \
silent except for the slathering of your pussy juices against Nina\'s legs, and occasional moan from you. Soon the friction against your \
clit pushes you off the edge and your orgasm, spraying a small amount of juices over Nina\'s naked body.")>>
<</if>>
<</if>>
<<if def _dead && _dead>>
<<set _disable_buttons = false>>
<</if>>
<</button>>@@
@@#events3;<<button "3">>
<</button>>@@
@@#events4;<<button "4">>
<</button>>@@
@@#events5;<<button "5">>
<</button>>@@
@@#events6;<<button "6">>
<</button>>@@
@@#events7;<<button "7">>
<</button>>@@
@@#events8;<<button "8">>
<</button>>@@
<<set $buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set $buttons.push("#events" + _i)>>
<</for>>
<<set $buttons_extra = ["#events_actions_back"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 3; grid-column: 5"></div>
<div id="events_actions_back" style="grid-row: 4; grid-column: 5">
<<button "Back" niponArena>>
<<set $enable_menu = true>>
<</button>>
</div>
</div>
<<silently>><<timed 20ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
$("#duty_of_a_slave_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
if (self.html() == "Back") {
return;
}
self.addClass("disabled");
self.prop("disabled", true);
_t.options.find("#li" + self.html()).css("text-decoration", "line-through");
if (_t.responses != null) {
_t.responses[_t.responses.length - 1] += _t.options.prop('outerHTML');
setup.mainLog_append_delayed(_t.responses, _v.buttons, _v.buttons_extra);
delete _t.responses;
}
})
<</script>><</timed>><</silently>><<set _nina = new setup.Character("nina")>>
<<set _nina.first_name = "???">>
<<set $_to_log = "<div>You find yourself in a quaint back room of the Nipon Arena. Through the walls you can hear \
some vague rumbles, as if the cheers that hailed the heros of yesterday resided in the very foundation of the place.">>
<<if ($quests.duty_of_a_slave.added && $quests.duty_of_a_slave.stage == 1) ||
($quests.path_to_freedom.added && $quests.path_to_freedom.stage == 1)>>
<<set $enable_menu = false>>
<<set _nina.first_name = "nina">>
<<set _init_sequence = true>>
<<set $_to_log += " A tall dark-skinned woman approaches you,<br>">>
<<set $_to_log += _nina.dialogue("You have no business here, leave immediately.")>>
<<set _options =
"<ol>\
<li id=\"li1\">\"I\'m here to relay a message from Emily.\"</li>\
</ol>">>
<<set $_to_log += _options>>
<<set _options = $(_options)>>
/* Set the UI */
<<timed 10ms>><<script>>
$("#actions").addClass("hidden");
$("#action_bar").wiki("<<include niponArenaBackRoomTalkOptions>>");
$.wiki("<<disableactions _options>>");
$("#mainLogCharacterImage").css("background-image", "url(resources/images/characters/nina/nina_neutral.png)");
<</script>><</timed>>
<<elseif !$quests.duty_of_a_slave.added && !$quests.path_to_freedom.added>>
<<set $_to_log += " A tall dark-skinned woman approaches you,<br>">>
<<set $_to_log += _nina.dialogue("You have no business here, leave immediately.")>>
<<timed 10ms>><<script>>
$("#mainLogCharacterImage").css("background-image", "url(resources/images/characters/nina/nina_neutral.png)");
<</script>><</timed>>
<<elseif $quests.duty_of_a_slave.added && $quests.duty_of_a_slave.stage == 3>>
<<set _shintani = $characters.shintani_hiroyuki>>
<<set _emily = $characters.emily_namm>>
<<set _responses = [
"In the middle of your fight, Nina collapses and a deafening silence is brought over the crowd. \
A couple of men rush forward to check her pulse, before lifting your hand into the air, declaring you the winner. As \
the crowd goes wild, you follow the men who carry Nina\'s body into the back room.",
"You are left momentarily alone with her before Shintani enters the room. Following him are a couple of guards who carry a \
now limp and swollen Emily. She looks up at you from her depraved state, but fails to say anything.",
_shintani.dialogue("She was a tough nut to crack, she gave in once I told her I\'d kill you in her stead... What naivity"),
"Emily looks up and sees Nina\'s limp body, realizing what was about to come next. A single tear drops from her head as she \
squeezes a couple of words from her throat,",
_emily.dialogue("You traitor... Long live Sakartvelo..."),
"She spits on Shintani\'s robe before a guard drives his fist up into her chest,",
_shintani.dialogue("Deplorable, get her out of here for now..."),
"Shintani faces you and darts his eyes to the still body on the floor,",
_shintani.dialogue("You know what must be done... I\'ll be waiting outside."),
"Shintani leaves you and a completely still Nina in the room alone."]>>
<<set _options = "<ol>\
<li id=\"li1\">Kill her.</li>\
<li id=\"li2\">Rape her.</li>\
</ol>">>
<<set _responses[_responses.length - 1] += _options>>
<<set _options = $(_options)>>
<<set _disable_buttons = false>>
<<timed 50ms>><<script>>
$("#actions").addClass("hidden");
$("#action_bar").wiki("<<include niponArenaBackRoomDutyOfASlaveOptions>>");
$.wiki("<<disableactions _options>>");
setup.mainLog_append_delayed(State.temporary.responses, State.variables.buttons, State.variables.buttons_extra);
<</script>><</timed>>
<<elseif $quests.path_to_freedom.added && $quests.path_to_freedom.stage == 3>>
<<set _emily = $characters.emily_namm>>
<<set _nina = new setup.Character("nina")>>
<<set _nina.first_name = "nina">>
<<set _examiner1 = new setup.Character("examiner1")>>
<<set _examiner1.first_name = "examiner 1">>
<<set _examiner2 = new setup.Character("examiner2")>>
<<set _examiner2.first_name = "examiner 2">>
<<set _responses = [
"In the middle of your fight, Nina collapses and a deafening silence is brought over the crowd. \
A couple of men rush forward to check her pulse, before lifting your hand into the air, declaring you the winner. As \
the crowd goes wild, you follow the men who carry Nina\'s body into the back room.",
"You are left momentarily alone with her before Emily enters the room with another body.",
_emily.dialogue("Please tell me you gave her the poison and she isn\'t actually dead?"),
$player.dialogue("Yes of course, and who the fuck is that?!"),
"You point to the other body across Emily\'s shoulder",
_emily.dialogue("What do you think? It's a body-double, dumbass... Hopefully this will buy us some time."),
"Nina groans a bit and starts to wake up,",
_nina.dialogue("What happened? Where am I?"),
"Emily rushes over to Nina and puts her arm around her,",
_emily.dialogue("Fuck, we need to get out of here immediately. I need you to stay here with the body until the medical \
team comes. Go tell Shintani you\'ve finished the deed. We\'ll rendezvous at the Hiroyuki manor once everything is \
in place. Try to keep Shintani occupied for as long as possible."),
"Emily exits the room with Nina in a black body-bag, leaving you completely in silence with the dead body in the \
middle of the room. After what seems like forever, two medical examiners enter the room.",
_examiner1.dialogue("Hey, if it isn\'t the champion who somehow bested the Black Dragon! We\'re just here to exam the body \
for the reports... boring stuff really, you can leave if you\'d like."),
"As you turn to leave the room the other examiner holds your shoulder,",
_examiner2.dialogue("Actually why don\'t you stay here for a bit... I had some... questions."),
"You look at the first examiner but he just shrugs."]>>
<<set _options = "<ol>\
<li id=\"li1\">\"Sorry I really have to go.\"</li>\
<li id=\"li2\">\"What did you need?\"</li>\
</ol>">>
<<set _responses[_responses.length - 1] += _options>>
<<set _options = $(_options)>>
<<set _disable_buttons = false>>
<<timed 50ms>><<script>>
$("#actions").addClass("hidden");
$("#action_bar").wiki("<<include niponArenaBackRoomPathToFreedomOptions>>");
$.wiki("<<disableactions _options>>");
setup.mainLog_append_delayed(State.temporary.responses, State.variables.buttons, State.variables.buttons_extra);
<</script>><</timed>>
<</if>>
<<set $_to_log += "</div>">>
/* Load in any saved variables */
<<loadVars>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<div id="actions" class="action container row col" style="--rows: 4; --cols: 4">
<div style="grid-row: 1; grid-column: 4"></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div style="grid-row: 3; grid-column: 4"></div>
<div style="grid-row: 4; grid-column: 4">
<<button "Back" niponArena>>
<<set $enable_menu = true>>
<</button>>
</div>
</div>
</div>
</div>
</div><div id="path_to_freedom_actions" class="action container row col" style="--rows: 4; --cols: 5">
@@#events1;<<button "1">>
<<if ndef _action>>
<<set _action = 1>>
<<set _thresh = 40>>
<<set _roll = $player.get_status_prop("tact") + $player.get_status_prop("manipulation") + dice(1, 4 + $difficulty) - $difficulty>>
<<if _roll gt _thresh>>
<<set _responses = [
setup.pass("Manipulation, Tact"),
_examiner2.dialogue("No, stop..."),
_examiner1.dialogue("Let " + setup.PRONOUNS[$player.gender]["?him"] + " go... " + setup.PRONOUNS[$player.gender]["?he"] + "\'s \
probably exhausted after that fight, did you even watch " + setup.PRONOUNS[$player.gender]["?him"] + " out there?"),
"The examiner losens his grip off your shoulder,",
_examiner2.dialogue("Okay okay, go ahead")
]>>
<<set _disable_buttons = false>>
<<set _choices = 0>>
<<disableactions>>
<<set $quests.path_to_freedom.stage += 1>>
<<else>>
<<set _responses = [
setup.fail("Manipulation, Tact"),
_examiner2.dialogue("No, sorry but it\'s policy that random checks are done to ensure there\'s no betting fraud."),
"The examines get to work and start noting down the injuries on the body-double. As they go to check her face they both \
pause...",
_examiner2.dialogue("..."),
_examiner1.dialogue("Ha, you really fucked her up good didn\'t you? I can barely tell it\'s her!"),
"The second examiner gives the other a serious look and he quickly gets inbetween you and the body,",
_examiner2.dialogue("Tell me, where and how exactly did you bruise her face to this degree?")
]>>
<<set _options = $("<ol>\
<li id='li1'>Lie (manipulation).</li>\
<li id='li2'>Feign ignorance (tact).</li>\
<li id='li3'>Threaten (strength).</li>\
")>>
<<set _responses[_responses.length - 1] += _options.prop("outerHTML")>>
<<disableactions _options>>
<</if>>
<<elseif _action == 1 || _action == 2>>
/* Fail -> Lie */
<<set _responses = [
setup.pass("manipulation"),
$player.dialogue("With the power of my attacks of course! Always aim for the head right?"),
"The examiner looks at you for a moment",
_examiner1.dialogue("Just let " + setup.PRONOUNS[$player.gender]["?him"] + " go, " + setup.PRONOUNS[$player.gender]["?he"] + "\'s \
probably exhausted after that fight, did you even watch " + setup.PRONOUNS[$player.gender]["?him"] + " out there?"),
"The examiner losens his grip off your shoulder,",
_examiner2.dialogue("Okay okay, go ahead")
]>>
<<set _disable_buttons = false>>
<<set _choices = 0>>
<<disableactions>>
<<set $quests.path_to_freedom.stage += 1>>
<</if>>
<</button>>@@
@@#events2;<<button "2">>
<<if ndef _action>>
<<set _action = 2>>
<<set _responses = [
"The examines get to work and start noting down the injuries on the body-double. As they go to check her face they both \
pause...",
_examiner2.dialogue("..."),
_examiner1.dialogue("Ha, you really fucked her up good didn\'t you? I can barely tell it\'s her!"),
"The second examiner gives the other a serious look and he quickly gets inbetween you and the body,",
_examiner2.dialogue("Tell me, where and how exactly did you bruise her face to this degree?")
]>>
<<set _options = $("<ol>\
<li id='li1'>Lie (manipulation).</li>\
<li id='li2'>Feign ignorance (tact).</li>\
<li id='li3'>Threaten (strength).</li>\
")>>
<<set _responses[_responses.length - 1] += _options.prop("outerHTML")>>
<<disableactions _options>>
<<elseif _action == 1 || _action == 2>>
<<set _responses = [
setup.pass("tact"),
$player.dialogue("Uh I don\'t know? I just fought as best I can. I\'m sure I probably hit her face a few times, but I wasn\'t targetting it or anything. Is \
it out of the usual?"),
"The examiner looks at you for a moment",
_examiner1.dialogue("Just let " + setup.PRONOUNS[$player.gender]["?him"] + " go, " + setup.PRONOUNS[$player.gender]["?he"] + "\'s \
probably exhausted after that fight, did you even watch " + setup.PRONOUNS[$player.gender]["?him"] + " out there?"),
"The examiner losens his grip off your shoulder,",
_examiner2.dialogue("Okay okay, go ahead")
]>>
<<set _disable_buttons = false>>
<<set _choices = 0>>
<<disableactions>>
<<set $quests.path_to_freedom.stage += 1>>
<</if>>
<</button>>@@
@@#events3;<<button "3">>
<<set _responses = [
setup.pass("strength"),
$player.dialogue("I fucked her face up along with the rest of her body. How? With my fists and my weapon. \
Can I go now?"),
"The examiner looks at you for a moment",
_examiner1.dialogue("Just let " + setup.PRONOUNS[$player.gender]["?him"] + " go, " + setup.PRONOUNS[$player.gender]["?he"] + "\'s \
probably exhausted after that fight, did you even watch " + setup.PRONOUNS[$player.gender]["?him"] + " out there?"),
"The examiner losens his grip off your shoulder,",
_examiner2.dialogue("Okay okay, go ahead")
]>>
<<set _disable_buttons = false>>
<<set _choices = 0>>
<<disableactions>>
<<set $quests.path_to_freedom.stage += 1>>
<</button>>@@
@@#events4;<<button "4">>
<</button>>@@
@@#events5;<<button "5">>
<</button>>@@
@@#events6;<<button "6">>
<</button>>@@
@@#events7;<<button "7">>
<</button>>@@
@@#events8;<<button "8">>
<</button>>@@
<<set $buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set $buttons.push("#events" + _i)>>
<</for>>
<<set $buttons_extra = ["#events_actions_back"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 3; grid-column: 5"></div>
<div id="events_actions_back" style="grid-row: 4; grid-column: 5">
<<button "Back" niponArena>>
<<set $enable_menu = true>>
<</button>>
</div>
</div>
<<silently>><<timed 20ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
$("#path_to_freedom_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
if (self.html() == "Back") {
return;
}
if (_t.responses != null) {
setup.mainLog_append_delayed(_t.responses, _v.buttons, _v.buttons_extra);
delete _t.responses;
}
})
<</script>><</timed>><</silently>><div id="events_actions" class="action container row col"
style="--rows: 4; --cols: 5">
@@#events1;<<button "1">>
<<if def _init_sequence && _init_sequence>>
<<unset _init_sequence>>
<<set _responses = [
"Nina loses her composure for a second and quickly slams the door behind you,",
_nina.dialogue("Excuse me?"),
"Her eyes drift down to meet the amulet on your neck and her grip around her sword tightens,",
_nina.dialogue("How do I know I can trust you?"),
"You quickly toss your hands up and slowly direct her gaze onto the Namm Insignia,",
$player.dialogue("I\'ve been working with Emily as well as Lia. I need you to drink this,"),
"You pull out the small vial of poison and start explaining the entire plan to Nina,",
_nina.dialogue("Honestly... stop my heart? I honestly couldn\'t care less about whatever the fuck \
you guys are all complaining about. I have no interest in anything that happens outside of this arena, but..."),
"She pauses and losens the grip on her sword",
_nina.dialogue("I guess I owe my life to Emily and her mother,"),
"Nina seems to think back to an important memory, before quickly snatching the poison out of your hand and gulping it down,",
_nina.dialogue("Will it work automatically? How long will it take?")
]>>
<<set _sub_options = "<ol>\
<li id=\"li1\">\"It will kick in when your heart rate shoots up. We will fight in the arena.\"</li>\
<li id=\"li2\">\"I need to massage your chest first (manipulate, fondle boobs).\"</li>\
<li id=\"li3\">\"You need a special ingredient for it to work (manipulate, oral sex).\"</li>\
</ol>">>
<<set _responses[_responses.length - 1] += _sub_options>>
<<set _sub_options = $(_sub_options)>>
<<set _disable_buttons = true>>
<<disableactions _sub_options>>
<<repeat 10ms>><<if def _done_appending && _done_appending>>
<<if $quests.duty_of_a_slave.added>>
<<set $quests.duty_of_a_slave.stage = 2>>
<<run UInv.DeleteItem("inventory", "strong_poison")>>
<<notify>>Strong poison removed from inventory.<</notify>>
<<else>>
<<set $quests.path_to_freedom.stage = 2>>
<<run UInv.DeleteItem("inventory", "weak_poison")>>
<<notify>>Weak poison removed from inventory.<</notify>>
<</if>>
<<stop>>
<</if>><</repeat>>
<<else>>
<<set _responses = [
"Nina laughs a bit to herself",
_nina.dialogue("Well, I had long predicted my last heart beat would be in the Arena. Luckily there\'s no scheduled \
fights today. I\'ll head into the arena. Go ahead and head to the prep room when you\'re ready. I\'ll let the staff \
know that you challenged me to a duel.")
]>>
<<repeat 10ms>><<if def _done_appending && _done_appending>><<script>>
$("#actions").removeClass("hidden");
$("#events_actions").addClass("hidden");
<</script>><<stop>><</if>><</repeat>>
<</if>>
<<run _button_fn()>>
<</button>>@@
@@#events2;<<button "2">>
<<set _roll = $player.get_status_prop("manipulation") + dice(1, 6 + $difficulty) - $difficulty>>
<<if _roll gte 15>>
<<run $("#mainLogCharacterImage").css("background-image", "url(resources/images/characters/nina/nina_neutral_notop.png)")>>
<<set _responses = [
setup.pass("manipulation"),
"Before you could even start manipulating Nina she has stripped off her armor and shirt, exposing her dark bare breasts,",
_nina.dialogue("Let\'s get this over with."),
"You slowly approach Nina apprehensively, and sink your hands into her soft boobs. As you start massaging them, you notice that \
her face is completely stoic, gaze fixed beyond you. Before long you get bored and back away,",
$player.dialogue("Okay, it\'s done. The poison will activate when you heart rate is very high, so we will duel each \
other in the arena and we\'ll fake your death then."),
_nina.dialogue("Well, I had long predicted my last heart beat would be in the Arena. Luckily there\'s no scheduled \
fights today. I\'ll head into the arena. Go ahead and head to the prep room when you\'re ready. I\'ll let the staff \
know that you challenged me to a duel.")
]>>
<<else>>
<<set _responses = [
setup.fail("manipulation"),
"Nina laughs to herself real quick before quickly charging at you, holding her blade against your neck,",
_nina.dialogue("I might be slow, but don\'t think you can take advantage of me so easily. Now, tell. me. How does \
this work?"),
$player.dialogue("Shouldn\'t you have asked that before drinking it? It will activate when you heart rate is very high, \
so we will duel each other in the arena and we\'ll fake your death then."),
"Nina pulls back and chuckles a bit to herself,",
_nina.dialogue("Well, I had long predicted my last heart beat would be in the Arena. Luckily there\'s no scheduled \
fights today. I\'ll head into the arena. Go ahead and head to the prep room when you\'re ready. I\'ll let the staff \
know that you challenged me to a duel.")
]>>
<</if>>
<<run _button_fn()>>
<<repeat 10ms>><<if def _done_appending && _done_appending>><<script>>
$("#actions").removeClass("hidden");
$("#events_actions").addClass("hidden");
<</script>><<stop>><</if>><</repeat>>
<</button>>@@
@@#events3;<<button "3">>
<<set _roll = $player.get_status_prop("manipulation") + dice(1, 6 + $difficulty) - $difficulty>>
<<if _roll gte 25>>
<<set _responses = [
setup.pass("manipulation"),
_nina.dialogue("What special ingredient?"),
$player.dialogue("This might seem hard to believe, and I was skeptical at first, but you need my juices"),
"You motion towards your crotch,",
$player.dialogue("Apparently, the poison is activate by pheromones, and you need mine in your system for your body \
to activate the necessary reactions to me."),
"Nina seems to consider this for a moment before dropping to her knees and sliding down your bottoms,",
_nina.dialogue("Let\'s get this over with.")
]>>
<<if $player.gender == 0>>
<<set _responses.push("You slowly slide your hard cock into Nina\'s mouth, and she immediately starts sucking and bobbing \
on your cock. It seems that she is quite experienced at this. You look down at her and see that her face is completely stoic, \
as if her gaze is set on a future far past you. After a while, you soon have to cum. You quickly grab the back and of her head and push \
your dick deep into her throat, coating the inside of her mouth with your cum. You pull out and some cum hangs off Nina\'s mouth,")>>
<<set _responses.push($player.dialogue("Good, now swallow."))>>
<<set _responses.push("Nina complies, licking the remaining sperm off her lips as well. She gets up.")>>
<<else>>
<<set _responses.push("You slowly push Nina\'s face deep into your vulva, and you feel her tongue climbing up your pussy and revolving around \
your hardening clit. She slowly pushes two of her fingers into you while massaging your anus with her other hand. You can tell that she has \
quite a bit of experience in pleasuring other women. Almost immediately you feel your juices slowly drip out of your slit and into Nina\'s mouth. \
Soon you have to orgasm, and squirt a stream of liquids directly into Nina\'s mouth. As you fasten her head to your pussy, she slowly gulps down \
all of it. Once you let her go, she takes a few moments to catch her breath as your pussy juices drip from her lips.")>>
<</if>>
<<set _responses.push($player.dialogue("Now that the pherimones have been set up, the poison will activate when you heart rate is very high, \
so we will duel each other in the arena and fake your death then."))>>
<<set _responses.push("Nina pulls back and chuckles a bit to herself,")>>
<<set _responses.push(_nina.dialogue("Well, I had long predicted my last heart beat would be in the Arena. Luckily there\'s no scheduled \
fights today. I\'ll head into the arena. Go ahead and head to the prep room when you\'re ready. I\'ll let the staff \
know that you challenged me to a duel."))>>
<<else>>
<<set _responses = [
setup.fail("manipulation"),
_nina.dialogue("What special ingredient?"),
$player.dialogue("My juices."),
"You motion to your crotch, and Nina laughs to herself real quick before quickly charging at you, holding her blade against your neck,",
_nina.dialogue("I might be slow, but don\'t think you can take advantage of me so easily. Now, tell. me. How does \
this work?"),
$player.dialogue("Shouldn\'t you have asked that before drinking it? It will activate when you heart rate is very high, \
so we will duel each other in the arena and we\'ll fake your death then."),
"Nina pulls back and chuckles a bit to herself,",
_nina.dialogue("Well, I had long predicted my last heart beat would be in the Arena. Luckily there\'s no scheduled \
fights today. I\'ll head into the arena. Go ahead and head to the prep room when you\'re ready. I\'ll let the staff \
know that you challenged me to a duel.")
]>>
<</if>>
<<run _button_fn()>>
<<repeat 10ms>><<if def _done_appending && _done_appending>><<script>>
$("#actions").removeClass("hidden");
$("#events_actions").addClass("hidden");
<</script>><<stop>><</if>><</repeat>>
<</button>>@@
@@#events4;<<button "4">>
<</button>>@@
@@#events5;<<button "5">>
<</button>>@@
@@#events6;<<button "6">>
<</button>>@@
@@#events7;<<button "7">>
<</button>>@@
@@#events8;<<button "8">>
<</button>>@@
<<set $buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set $buttons.push("#events" + _i)>>
<</for>>
<<set $buttons_extra = ["#events_actions_back"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 3; grid-column: 5"></div>
<div id="events_actions_back" style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Back">>
<<set _location_button_dest = "niponArena">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<script>>
let _t = State.temporary;
let _v = State.variables;
_t.button_fn = function() {
if (_t.responses != null) {
setup.mainLog_append_delayed(_t.responses, _v.buttons, _v.buttons_extra);
delete _t.responses;
}
}
<</script>><<if $quests.duty_of_a_slave.added && $quests.duty_of_a_slave.stage == 4>>
<<set _shintani = $characters.shintani_hiroyuki>>
<<set $_temp_to_log = "">>
<<set _responses = [
"You slowly exit the room to find Shintani standing near the door. You nod your head at him letting him know that \
the deed had been done,",
_shintani.dialogue("It looks like my other allies have finished setting up the last stages of this play. You know, recently \
our scholars have finished translating and recovering some ancient plays. One that seems to have caught the hearts of the people \
is Hamlet. Meet me at the Nipon theater for the next showing; we\'ll give the people the drama they\'ve been waiting for.")
]>>
<<set $quests.duty_of_a_slave.stage = 5>>
<<timed 5ms>><<run setup.mainLog_append_delayed(_responses)>><</timed>>
<</if>>
<<set $_to_log = "The Nipon Arena towers over the surrounding buildings, as if it were the center of the universe. Large monoliths \
of sunlight are filtered through the weaving pattern of layers of stone columns. You can hear distant chatter and the occasional \
roaring cheer of a crowd somewhere in the distance.">>
<<loadVars>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include niponArenaActions>>
</div>
</div>
</div><<set $_to_log = "<div>As you enter the prep room of the Nipon Arena you are hit with a vague odor of sweat and blood. You can tell that \
this room housed both excitement, dread, and disdain. Old equipment and lockers line the walls of the room. Perhaps you want to take some \
time to reorganize your inventory, party, and strategy.">>
/* Load in any saved variables */
<<loadVars>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<div id="actions" class="action container row col longbutton fiveQuarters" style="--rows: 4; --cols: 4">
<<button "Party">>
<<if $player.party == null || $player.party.length == 0>>
<<notify>>You do not have any party members.<</notify>>
<<else>>
<<set $selection_queue = $player.party>>
<<set $selected = $player.party[0]>>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto characterMenu>>
<</if>>
<</button>>
<<button "Enter Arena">>
<<if ($quests.duty_of_a_slave.added && $quests.duty_of_a_slave.stage == 2) ||
($quests.path_to_freedom.added && $quests.path_to_freedom.stage == 2)>>
<<set _nina = new setup.Character("nina")>>
<<set _nina.set_properties(
new Date(200 - 35, 12, 9),
1,
"Nina",
"Stike"
)>>
<<set _nina.stats.strength = 70>>
<<set _nina.stats.dexterity = 50>>
<<set _nina.skills.melee = 80>>
<<set _nina.skills_known = true>>
<<set _nina.stats_known = true>>
<<set _nina.equipment = {
"head": "none",
"chest": "iron_chestplate",
"legs": "leather_skirt",
"feet": "leather_boots",
"neck": "none",
"weapon1": "iron_gsword",
"weapon2": "none",
"groin1": "none",
"groin2": "none"
}>>
<<set _nina.conditions.max_health = 150>>
<<set _nina.conditions.health = 150>>
<<set _nina.images.combat = "resources/images/characters/nina/nina_combat2.png">>
<<set _opponents = [_nina]>>
<<set _retreat_blocked = true>>
<<set _inital_log = _nina.dialogue("Show me what you got, you dirty Hironaka!")>>
<<set _combat_background = "resources/images/places/combat/arena.png">>
<<include combatEngine>>
<<repeat 20ms>><<if _combat_result != null || _nina.conditions.health lt 75>>
<<if _combat_result == "lose">>
<<set $player.conditions.health = 10>>
<<set $_temp_to_log = "You barely made it back alive. UNDER CONSTRUCTION">>
<<goto $player.home>>
<<else>>
<<if $quests.duty_of_a_slave.added>>
<<set $quests.duty_of_a_slave.stage += 1>>
<<set $_temp_to_log = "">>
<<elseif $quests.path_to_freedom.added>>
<<set $quests.path_to_freedom.stage += 1>>
<<set $_temp_to_log = "UNDER CONSTRUCTION">>
<</if>>
<<goto niponArenaBackRoom>>
<</if>>
<<stop>><</if>><</repeat>>
<<else>>
<<notify>>You are not registered to fight.<</notify>>
<</if>>
<</button>>
<div style="grid-row: 1; grid-column: 4"></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div style="grid-row: 3; grid-column: 4"></div>
<div style="grid-row: 4; grid-column: 4">
<<button "Back" niponArena>>
<<set $enable_menu = true>>
<</button>>
</div>
</div>
</div>
</div>
</div><<nobr>>
<div id="actions" class="action container row col longbutton fiveQuarters"
style="--rows: 4; --cols: 4">
<<button "Emily">>
<<removeclass "#emily_actions" "hidden">>
<<addclass "#actions" "hidden">>
<<run $("#mainLogCharacterImage").css("background-image",
"url(" + _emily.image_folder() + "emily_barracks.png)")>>
<<set _responses = ["You walk into Emily\'s quarters to find her lost in thought."]>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses);
<</script>>
<</button>>
<div>
<<set _location_button_text = "Medic Bay">>
<<set _location_button_dest = "niponMedicBay">>
<<include locationButton>>
</div>
<div style="grid-row: 1; grid-column: 4"></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div style="grid-row: 3; grid-column: 4"></div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<</nobr>><<nobr>>
<div id="emily_actions" class="action container row col longbutton fiveQuarters hidden"
style="--rows: 4; --cols: 4">
<<button "Talk">>
<<if !_queue_talk>>
<<set _queue_talk = true>>
<<if ndef $phase || $phase == 1>>
<<set $phase = 1>>
<<set _options = "\
<ol>\
<li id=\"li1\">\"Do you work for Shintani?\"</li>\
<li id=\"li2\">\"How do you like Nipon?\"</li>\
<li id=\"li3\">\"What\'s your background?\"</li>\
<li id=\"li4\">\"Do you have any hopes or dreams?\"</li>\
">>
<<if $quests.path_to_greatness.stage == 1>>
<<if $player.get_money() gte 300>>
<<set _options += "<li id=\"li5\" value=\"5\">\"I\'d like like to pay my equipment fee (¤300)\"</li>">>
<<else>>
<<set _options += "<li id=\"li5\" value=\"5\">\"I can\'t afford the equipment fee, is there any other way?\"</li>">>
<</if>>
<</if>>
<<if ($quests.path_to_freedom.added && $quests.path_to_freedom.stage == 0) ||
($quests.duty_of_a_slave.added && $quests.duty_of_a_slave.stage == 0)>>
<<set _options += "<li id=\"li6\" value=\"6\">\"I was told to come here to get a shield?\"</li>">>
<</if>>
<<if $quests.power_struggles.stage == 6 && $player.has_equipped("namm_insignia") != "none">>
<<set _responses = ["You approach Emily and she immediately notices the Namm Insignia," + _options]>>
<<set $locations.niponBarracks.data.emily_insignia = true>>
<<else>>
<<set _responses = ["You approach Emily, what would you like to say?" + _options]>>
<</if>>
<<else>>
<<set _options = "\
<ol>\
<li id=\"li1\">\"So how\'s life treating you now?\"</li>\
</ol>\
">>
<<set _responses = ["You approach Emily, what would you like to ask?" + _options]>>
<</if>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses);
<</script>>
<<set _options = $(_options)>>
<</if>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<addclass "#emily_actions" "hidden">>
<<removeclass "#events_actions" "hidden">>
<<run $("#mainLogCharacterImage").css("background-image",
"url(" + _emily.image_folder() + "emily_barracks.png)")>>
<</button>>
<<disable>>
@@#train;<<button "Train">>
<<if $gameDate.getHours() gt 16>>
<<notify>>
Too late to train!
<</notify>>
<<elseif $player.conditions.stamina lt Math.abs(setup.project_stamina_change(4 * 60)) + 30>>
<<notify>>
Too tired to train!
<</notify>>
<<elseif $player.get_money() lt 50>>
<<notify>>
Need ¤50 to train!
<</notify>>
<<else>>
<<if !$quest_journal.completed.contains("path_to_greatness")>>
<<set $quest_journal.completed.push("path_to_greatness")>>
<<run setup.remove_val($quest_journal.ongoing, "path_to_greatness")>>
<</if>>
<<run $("#info_title").html("Train at the Nipon Barracks")>>
<<set _default_info = $("<div>\
<div id=\"normal_train\">\
The Nipon Barracks provides the perfect atmosphere to hone your physique. While it may be easy to build your body at first \
a more experienced body requires more and more training to perfect.\
<ul id=\"change_list\">\
<li id=\"li1\">" + setup.round2(100 * setup.progressive_gain_chance($player.stats.strength, 60, "linear")) +
"% change to increase strength (capped at 50).</li>\
<li id=\"li1\">" + setup.round2(100 * setup.progressive_gain_chance($player.stats.strength, 60, "linear")) +
"% change to increase dexterity (capped at 50).</li>\
</ul></div>\
<div id=\"focus\">\
You could also expend some extra effort to focus on a specific skill to train.\
<ul>\
<li id=\"li4\">" + setup.round2(100 * setup.progressive_gain_chance($player.skills.melee + $player.skills.ranged, 60, "linear")) +
"% chance to increase focus skill (capped at 30).</li>\
<li id=\"li5\">-10 additional stamina.</li>\
</ul></div>\
</div>")>>
<<run $("#infoLogBody").html("")>>
<<run $("#infoLogBody").append(_default_info.clone())>>
<<removeclass "#train_actions" "hidden">>
<<addclass "#emily_actions" "hidden">>
<<removeclass "#infoLog" "hidden">>
<<addclass "#mainLog" "hidden">>
/* Reset study buttons */
<<unset _focus>>
<<script>>
$(".train_option button").removeClass("disabled");
$(".train_option button").prop("disabled", false);
<</script>>
<</if>>
<</button>>@@
<</disable>>
<<timed 50ms>>
<<if $quests.path_to_greatness.stage gt 1 || $quest_journal.completed.contains("path_to_greatness")>>
<<removeclass "#train button" "disabled">>
<<run $("#train button").prop("disabled", false)>>
<</if>>
<</timed>>
<div style="grid-row: 1; grid-column: 4">
<<button "Inspect">>
<<set $selected = _emily.key>>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto characterMenu>>
<</button>>
</div>
<div style="grid-row: 2; grid-column: 4">
</div>
<div style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<addclass "#emily_actions" "hidden">>
<<removeclass "#actions" "hidden">>
<<run $("#mainLogCharacterImage").css("background-image", "")>>
<<set _queue_talk = false>>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<</nobr>><<nobr>>
<<set _emily = $characters.emily_namm>>
<<if !$quest_journal.completed.contains("path_to_greatness") && $quests.path_to_greatness.stage == 0>>
/* Update quest */
<<set $quests.path_to_greatness.stage = 1>>
/* No access to emily's trust initially */
<<set $locations.niponBarracks.data.emily_insignia = false>>
<<set $_to_log = "
<div>The Nipon barracks carry within a distinct mood of diligence. You hear multiple \
people training in the distance, and you can only imagine the terrors that have gone \
on within these walls. A muscular olive skinned woman approaches you,"
>>
<<set _choices = 2>>
<<if $quests.power_struggles.stage == 6 && $player.has_equipped("namm_insignia") != "none">>
<<set $_to_log += "and she immediately notices the Namm Insignia on your chest.</div><br>">>
<<set $_to_log += _emily.dialogue("\
Who... are you?") +
"<ol>\
<li>\"I\'m " + $player.name() + " and I\'m looking to train along side the troops.\"</li>\
<li>\"I\'m " + $player.name() + " and I\'m just looking around.\"</li>\
<li>\"I\'m " + $player.name() + " and I was told to come talk to you.\"</li>\
</ol>"
>>
<<set _choices += 1>>
<<else>>
<<set $_to_log += "</div><br>">>
<<set $_to_log += _emily.dialogue("\
Who are you and why have you come? Are you a new recruit for the army?") +
"<ol>\
<li>\"I\'m " + $player.name() + " and I\'m looking to train along side the troops.\"</li>\
<li>\"I\'m " + $player.name() + " and I\'m just looking around.\"</li>\
</ol>"
>>
<</if>>
<<set _init_sequence = true>>
<<timed 50ms>>
<<disableactions>>
<<removeclass "#events_actions" "hidden">>
<<addclass "#actions" "hidden">>
<<run $("#mainLogCharacterImage").css("background-image",
"url(" + _emily.image_folder() + "emily_barracks.png)")>>
<</timed>>
<<else>>
<<set $_to_log = "
<div>The Nipon barracks carry within a distinct mood of diligence. You hear multiple \
people training in the distance, and you can only imagine the terrors that have gone \
on within these walls.</div><br>"
>>
<</if>>
/* Load in any saved variables */
<<loadVars>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
<<include infoLog>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include niponBarracksActions>>
<<include niponBarracksEmilyActions>>
<<include niponBarracksTalkOptions>>
<<include niponBarracksTrainActions>>
</div>
</div>
</div>
<<updatetime>>
<</nobr>><div id="actions" class="action container row col longbutton fiveQuarters smalltext" style="--rows: 4; --cols: 4">
<<disable>><<button "Talk">><</button>><</disable>>
<<button "Recover Party" niponMedicBay>>
<<set $player.conditions.health = $player.conditions.max_health>>
<<for _idx, _member range $player.party>>
<<set $characters[_member].conditions.health = $characters[_member].conditions.max_health>>
<</for>>
<<set $_temp_to_log = "After some care, you and your party\'s health were fully restored.">>
<<addhours 1>>
<</button>>
<div style="grid-row: 1; grid-column: 4"></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div style="grid-row: 3; grid-column: 4"></div>
<div style="grid-row: 4; grid-column: 4">
<<button "Back" niponBarracks>><</button>>
</div>
</div><<set _nurse = new setup.Character("nurse")>>
<<set _nurse.first_name = "nurse">>
<<set $_to_log = "You walk into the medic bay which in stark contract to any other room you\'ve been in, boasts stark white \
walls, as if every inch had been scrubbed down meticulously. A nurse approaches you,<br>" +
_nurse.dialogue("Hello, is there anything I can help you with?")>>
/* Load in any saved variables */
<<loadVars>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include niponMedicBayActions>>
</div>
</div>
</div><<nobr>>
/* For ease */
<<set _emily = $characters.emily_namm>>
<div id="events_actions" class="action container row col hidden"
style="--rows: 4; --cols: 5">
@@#events1;<<button "1">>
<<if def _init_sequence && _init_sequence>>
<<unset _init_sequence>>
<<set _responses = [
"Emily looks you up and down,",
_emily.dialogue("I don\'t know you, and I don\'t like strangers. I\'m in charge of the \
training corp here. If you want to train with me you\'ll have to pay each session \
as well as an initial fee of 300 lari for your equipment."),
"Emily turns around and heads back into the main quarters."
]>>
<<set _done_appending = false>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<removeclass "#actions" "hidden">>
<<addclass "#events_actions" "hidden">>
<<run $("#mainLogCharacterImage").css("background-image", "")>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif ndef _action>>
<<set _options.find("#li1").css("text-decoration", "line-through")>>
<<if $phase == 1>>
<<if $locations[passage()].data.emily_insignia>>
<<set _responses = [
_emily.dialogue("Not here... come to my place after I get off at 9 PM. I live in Sonder Ville apartment 3."),
_options.clone()
]>>
<<if $quests.power_struggles.stage == 6>>
<<set $locations.emilyHome.access = true>>
<<set $quests.power_struggles.stage += 1>>
<</if>>
<<else>>
<<set _responses = ["UNDER CONSTRUCTION"]>>
<</if>>
<<else>>
<<if $locations.nipon.data.owner == "lia_hiroyuki">>
<<set _responses = [_emily.dialogue("Well, things are looking better. I no longer have to live in fear and \
hide my thoughts anymore, but what is life but suffering anyways? Perhaps one day I\'ll again feel the \
glory of the Namm household, but for now I can just live honestly."),
_options.clone()]>>
<<else>>
<<set _responses = ["Emily gives you an empty stare. Your eyes drift down to her neck and see the Hironaka \
amulet tightly bound to her,",
_emily.dialogue("Great... Everything... is great."),
_options.clone()]>>
<</if>>
<</if>>
<<elseif _action == 5 || _subaction == 3>>
<<unset _action>>
<<unset _subaction>>
<<set _responses = [
_emily.dialogue("Begging and you can\'t even beg properly? Is this the quality \
of Shintani\'s slaves these days? Disgraceful, you\'ll have to pay the \
fee like everyone else. Why are you still here?"),
_options.clone()
]>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<run $("#mainLogCharacterImage").css("background-image",
"url(" + _emily.image_folder() + "emily_barracks.png)")>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<</button>>@@
@@#events2;<<button "2">>
<<if def _init_sequence && _init_sequence>>
<<unset _init_sequence>>
<<set _responses = [
"Emily looks you up and down,",
_emily.dialogue("I don\'t know you, and I don\'t like strangers. I\'m in charge of the \
training corp here. If you want to train with me you\'ll have to pay each session \
as well as an initial fee of 300 lari for your equipment, else move along we don\'t like \
tourists here."),
"Emily turns around and heads back into the main quarters."
]>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#actions" "hidden">>
<<addclass "#events_actions" "hidden">>
<<run $("#mainLogCharacterImage").css("background-image", "")>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif ndef _action>>
<<set _options.find("#li2").css("text-decoration", "line-through")>>
<<if $locations[passage()].data.emily_insignia>>
<<set _responses = [
_emily.dialogue("Not here... come to my place after I get off at 9 PM. I live in Sonder Ville apartment 3."),
_options.clone()
]>>
<<if $quests.power_struggles.stage == 6>>
<<set $locations.emilyHome.access = true>>
<<set $quests.power_struggles.stage += 1>>
<</if>>
<<else>>
<<set _responses = ["UNDER CONSTRUCTION"]>>
<</if>>
<<elseif _action == 5 && ndef _subaction>>
<<unset _action>>
<<set _options.find("#li5").css("text-decoration", "line-through")>>
<<set _responses = [
"You get down on your knees, cupping Emily\'s sweaty foot in your hands and \
starting licking. Your tongue slides in between each toes, capturing every bit \
of saltiness. After her feet have been completely drenched in your saliva you can \
smell her fluids through her pants.",
_emily.dialogue("Um... okay, you can stop now... Come train with me anytime, \
did you need anything else?") + "(Willpower " +
setup.show_change_html(0, -4) + ") (Emily\'s Foot Fetish " +
setup.show_change_html(0, 2) + ")",
_options.clone()
]>>
<<set _emily.sex_fetishes.feet += 2>>
<<set $player.slave_traits.willpower -= 4>>
<<set $quests.path_to_greatness.stage = 2>>
<<removeclass "#train button" "disabled">>
<<run $("#train button").prop("disabled", false)>>
<<set _done_appending = false>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<run $("#mainLogCharacterImage").css("background-image",
"url(" + _emily.image_folder() + "emily_barracks.png)")>>
<<set _choices = 4>>
<<set _disable_buttons = false>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _action == 5 && _subaction == 3>>
<<unset _subaction>>
<<set _options.find("#li5").css("text-decoration", "line-through")>>
<<set _responses = [
"You continue licking Emily\'s feet covered with your cum until you clean up \
every last drop.",
_emily.dialogue(`Good ${($player.gender == 0 ? "boy" : "girl")}. Now you can train with me now. Now did you need anything else dog?`) + "(Willpower " +
setup.show_change_html(0, -4) + ") (Emily\'s Foot Fetish " +
setup.show_change_html(0, 2) + ")",
_options.clone()
]>>
<<set _emily.sex_fetishes.feet += 2>>
<<set $player.slave_traits.willpower -= 4>>
<<set $quests.path_to_greatness.stage = 2>>
<<removeclass "#train button" "disabled">>
<<run $("#train button").prop("disabled", false)>>
<<set _done_appending = false>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<run $("#mainLogCharacterImage").css("background-image",
"url(" + _emily.image_folder() + "emily_barracks.png)")>>
<<set _choices = 4>>
<<set _disable_buttons = false>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<</button>>@@
@@#events3;<<button "3">>
<<if def _init_sequence && _init_sequence>>
<<unset _init_sequence>>
<<set _responses = [
"Emily looks you up and down and whispers,",
_emily.dialogue("Not here... come to my place after I get off at 9 PM. I live in Sonder Ville apartment 3."),
"Emily turns around and heads back into the main quarters."
]>>
<<set $locations.emilyHome.access = true>>
<<set $quests.power_struggles.stage += 1>>
<<set $locations[passage()].data.emily_insignia = true>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<removeclass "#actions" "hidden">>
<<addclass "#events_actions" "hidden">>
<<run $("#mainLogCharacterImage").css("background-image", "")>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif ndef _action>>
<<set _options.find("#li3").css("text-decoration", "line-through")>>
<<if $locations[passage()].data.emily_insignia>>
<<set _responses = [
_emily.dialogue("Not here... come to my place after I get off at 9 PM. I live in Sonder Ville apartment 3."),
_options.clone()
]>>
<<if $quests.power_struggles.stage == 6>>
<<set $locations.emilyHome.access = true>>
<<set $quests.power_struggles.stage += 1>>
<</if>>
<<else>>
<<set _responses = [
_emily.dialogue("My background is none of your concern."),
_options.clone()
]>>
<</if>>
<<elseif _action == 5>>
<<set _subaction = 3>>
<<set _responses = [
"You get down on your knees, cupping Emily\'s sweaty foot in your hands and \
starting licking. As your tongue slides in between each toes, you slide down your \
pants and start stroking your cock. Emily doesn't say anything and looks even more \
amused,",
_emily.dialogue("Haha, that\'s a good dog! You like this don\'t you?"),
$player.dialogue("Yes mistress."),
"After her feet have been completely drenched in your saliva you can \
smell her fluids through her pants and you cum at the same time, covering \
her feet. (Willpower " +
setup.show_change_html(0, -4) + ")",
_emily.dialogue("What the fuck? You cleaned my feet just to get them dirty again? \
Lick it all off. NOW."),
"<ol>\
<li>Refuse.</li>\
<li>Do as she says.</li>\
</ol>"
]>>
<<set $player.slave_traits.willpower -= 4>>
<<set _done_appending = false>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<run $("#mainLogCharacterImage").css("background-image",
"url(" + _emily.image_folder() + "emily_foot_cum.png)")>>
<<set _choices = 2>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<</button>>@@
@@#events4;<<button "4">>
<<if ndef _action>>
<<set _options.find("#li4").css("text-decoration", "line-through")>>
<<if $quests.power_struggles.stage == 6>>
<<set _responses = ["Under Construction"]>>
<<else>>
<<set _responses = [
_emily.dialogue("Dreams are for dreamers, and I barely have the luxury to sleep."),
_options.clone()
]>>
<</if>>
<</if>>
<</button>>@@
@@#events5;<<button "5">>
<<set _action = 5>>
<<if $player.get_money() gte 300>>
<<addclass "#events5 button" "disabled">>
<<run $("#events5 button").prop("disabled", true)>>
<<set _responses = [
_emily.dialogue("Thanks, I\'m always up for some training, come by whenever between \
7AM and 4PM to train. Each session will cost you 50 laris. Did you need anything else?")
]>>
<<set _options.find("#li5").css("text-decoration", "line-through")>>
<<set _responses.push(_options.clone())>>
<<set $quests.path_to_greatness.stage = 2>>
<<removeclass "#train button" "disabled">>
<<run $("#train button").prop("disabled", false)>>
<<removemoney 300>>
<<audio "coins_sound" play>>
<<run UInv.AddItem("emily_namm", "lari", 300)>>
<<updatetime>>
<<else>>
<<set _choices = 2>>
<<set _responses = [
_emily.dialogue("No handouts here, go beg somewhere else... Actually, if you really \
are desperate, there is something you can do."),
"Emily sits down and slips off her boots",
_emily.dialogue("Training the troops is pretty tiring, and my feet sure could use a \
rub..."),
"You slowly reach out for her feet when she stops you",
_emily.dialogue("With your tongue, like all dogs do.")
]>>
<<set _response = "\
<ol>\
<li>Refuse.</li>\
<li>Do as she says.</li>\
">>
<<if $player.gender == 0>>
<<set _response += "<li>Do as she says and start jacking off as well.</li>">>
<<set _choices += 1>>
<</if>>
<<disableactions>>
<<set _response += "</ol>">>
<<set _responses.push(_response)>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<run $("#mainLogCharacterImage").css("background-image",
"url(\"" + _emily.image_folder() + "emily_foot.png")>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<</button>>@@
@@#events6;<<button "6">>
<<set _options.find("#li6").css("text-decoration", "line-through")>>
<<set _responses = [
_emily.dialogue("Yes, I just got word. Wait one moment."),
"Emily disappears for a few moments and returns with a small iron-banded shield. You can tell that she is trying very \
hard to seem natural, but her lip slightly quivers a bit when she speaks,",
_emily.dialogue("If you haven't any, make sure to buy some armor at the market stalls."),
"As you go to grab the shield, Emily holds it tightly. You lock eyes for a second and you give her a slight nod to assure \
her that all is going according to plan. With this, she releases the shield along with the tension in the room.",
_options.clone()
]>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<run UInv.AddItem("inventory", "small_shield")>>
<<notify>>Acquired a small shield.<</notify>>
<<if $quests.path_to_freedom.added>>
<<set $quests.path_to_freedom.stage += 1>>
<<elseif $quests.duty_of_a_slave.added>>
<<set $quests.duty_of_a_slave.stage += 1>>
<</if>>
<<stop>>
<</if>><</repeat>><</silently>>
<</button>>@@
@@#events7;<<button "7">>
<</button>>@@
@@#events8;<<button "8">>
<</button>>@@
<<set $buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set $buttons.push("#events" + _i)>>
<</for>>
<<set $buttons_extra = ["#events_actions_back", "#events_actions_leave"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div id="events_actions_back" style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<removeclass "#emily_actions" "hidden">>
<<addclass "#events_actions" "hidden">>
<</button>>
</div>
<div id="events_actions_leave" style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<timed 50ms>><<script>>
$("#events_actions").find("button").on("click", (event) => {
let _t = State.temporary;
let _v = State.variables;
let self = $(event.currentTarget);
if (self.html() == "Back" || self.html() == "Leave") {
return;
}
self.addClass("disabled");
self.prop("disabled", true);
if ("responses" in _t) {
setup.mainLog_append_delayed(_t.responses, _v.buttons, _v.buttons_extra);
delete _t.responses;
}
});
<</script>><</timed>>
<</nobr>><div id="train_actions" class="action container row col fiveQuarters smalltext longbutton hidden"
style="--rows: 4; --cols: 4">
/* Training focus */
@@#melee;.train_option;<<button "Melee">><</button>>@@
@@#ranged;.train_option;<<button "Ranged">><</button>>@@
<div style="grid-row: 1; grid-column: 4">
@@#trainStart;<<button "Start">>
<<include niponBarracksTrainEngine>>
<</button>>@@
</div>
<div style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<removeclass "#emily_actions" "hidden">>
<<addclass "#train_actions" "hidden">>
<<removeclass "#mainLog" "hidden">>
<<addclass "#infoLog" "hidden">>
<</button>>
</div>
</div>
<<timed 10ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
$(".train_option button").on("click", (event) => {
if (_v.player.conditions.stamina < Math.abs(setup.project_stamina_change(4 * 60)) + 40) {
$.wiki("<<notify>>Too tired to add an additional training focus.<</notify>>");
} else {
$(".train_option button").removeClass("disabled");
$(".train_option button").prop("disabled", false);
let self = $(event.currentTarget);
_t.focus = self.html().toLowerCase();
self.addClass("disabled");
self.prop("disabled", true);
}
});
<</script>><</timed>><<set $_temp_to_log = "You train rigorously for four hours. ">>
<<set _gain = 0>>
/* Strength gain */
<<set _thresh = setup.progressive_gain_chance($player.stats.strength, 60, "linear")>>
<<set _roll = randomFloat(1.0)>>
<<if _roll lt _thresh && $player.stats.strength lt 50>>
<<set $player.stats.strength += 1>>
<<set _gain = 1>>
<</if>>
/* Dexterity gain */
<<set _thresh = setup.progressive_gain_chance($player.stats.dexterity, 60, "linear")>>
<<set _roll = randomFloat(1.0)>>
<<if _roll lt _thresh && $player.stats.dexterity lt 50>>
<<set $player.stats.dexterity += 1>>
<<set _gain += 2>>
<</if>>
<<if _gain != 0>>
<<set $_temp_to_log += "Luckily you were able to train efficiently and increase ">>
<<if _gain == 1>>
<<set $_temp_to_log += "your strength (Strength " + setup.show_change_html(0, 1) + ").">>
<<elseif _gain == 2>>
<<set $_temp_to_log += "your dexterity (Dexterity " + setup.show_change_html(0, 1) + ").">>
<<else>>
<<set $_temp_to_log += "both your dexterity and strength (Dexterity " + setup.show_change_html(0, 1) +
", Strength " + setup.show_change_html(0, 1) + ").">>
<</if>>
<<else>>
<<set $_temp_to_log += "Unfortunately you were unfocused today and were unable to increase either of your stats.">>
<</if>>
/* Skill focus training */
<<if def _focus>>
<<set _thresh = setup.progressive_gain_chance($player.skills.melee + $player.skills.ranged, 60, "linear")>>
<<set _roll = randomFloat(1.0)>>
<<if _roll lt _thresh && $player.skills[_focus] lt 30>>
<<set $_temp_to_log += " Your focus on " + _focus + " paid off (" + setup.titleCase(_focus) + " " + setup.show_change_html(0, 1) + ").">>
<<set $player.skills[_focus] += 1>>
<</if>>
<<set $player.conditions.stamina -= 10>>
<</if>>
<<removemoney 50>>
<<run UInv.AddItem("emily_namm", "lari", 50)>>
<<audio "coins_sound" play>>
<<addhours 4>>
<<set $player.conditions.stamina -= 15>>
<<include round>>
<<goto "niponBarracks">>/* Player is outside */
<<set $player.is_home = false>>
<<set $player.is_outside = true>>
/* Load in any saved variables */
<<loadVars>>
/* Audio engine */
<div class="mapside left">
<<include niponActions>>
</div>
<div id="background" class="notext" style="padding: 0px">
<<include niponCentralMap>>
</div>
<div class="mapside right">
<hr>
<<include infoNoSubbackground>>
</div>
<<updatetime>><<if $player.home == "shintaniHome">>
<div id="actions" class="action container row col"
style="--rows: 4; --cols: 5">
<div style="grid-row: 1; grid-column: 1">
<<button "Work">>
<<script>>
$("#actions").addClass("hidden");
$("#work_actions").removeClass("hidden");
<</script>>
<</button>>
</div>
<div style="grid-row: 2; grid-column: 1">
<<button "Interact">>
<<script>>
$("#actions").addClass("hidden");
$("#interact_options").removeClass("hidden");
<</script>>
<</button>>
</div>
<div style="grid-row: 3; grid-column: 1">
<<button "Relax">>
<<if !$locations[passage()].data.relaxed>>
<<set $locations[passage()].data.relaxed = true>>
<<popover>>
<<include relaxTutorial>>
<</popover>>
<</if>>
/* Temperarily disable working status while relaxing */
<<set _temp_is_working = $player.is_working>>
<<set $player.is_working = false>>
<<addhours 1>>
/* Cut time awake by two hours */
<<set $rest_momentum = ($rest_momentum - 2 * 60).clamp(Math.min(5 * 60, $rest_momentum), 1000000)>>
<<set $player.is_working = _temp_is_working>>
<<unset _temp_is_working>>
<<include round>>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 1">
<<button "Sleep" shintaniHomeSleep>>
<<set $_player = clone($player)>>
<<set $player.is_sleeping = true>>
<<advanceday>>
<<set $player.is_sleeping = false>>
<</button>>
</div>
<div style="grid-row: 1; grid-column: 2">
<<set _location_button_text = "Library">>
<<set _location_button_dest = "shintaniHomeLibrary">>
<<include locationButton>>
</div>
<div style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<include locationButton>>
</div>
</div>
<<else>>
<div id="actions" class="action container row col"
style="--rows: 4; --cols: 5">
<div style="grid-row: 1; grid-column: 1">
<<button "Interact">>
<<script>>
$("#actions").addClass("hidden");
$("#interact_options").removeClass("hidden");
<</script>>
<</button>>
</div>
<div style="grid-row: 1; grid-column: 2">
<<set _location_button_text = "Library">>
<<set _location_button_dest = "shintaniHomeLibrary">>
<<include locationButton>>
</div>
<div style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<include locationButton>>
</div>
</div>
<</if>><<nobr>>
<div id="events_actions" class="action container row col hidden"
style="--rows: 4; --cols: 5">
@@#events1;<<button "1">>
<<set _action = 1>>
<</button>>@@
@@#events2;<<button "2">>
<<set _action = 2>>
<</button>>@@
@@#events3;<<button "3">>
<<set _action = 3>>
<</button>>@@
@@#events4;<<button "4">>
<<set _action = 4>>
<</button>>@@
@@#events5;<<button "5">>
<<set _action = 5>>
<</button>>@@
@@#events6;<<button "6">>
<<set _action = 6>>
<</button>>@@
@@#events7;<<button "7">>
<<set _action = 7>>
<</button>>@@
@@#events8;<<button "8">>
<<set _action = 8>>
<</button>>@@
@@#events9;<<button "9">>
<<set _action = 9>>
<</button>>@@
@@#events10;<<button "10">>
<<set _action = 10>>
<</button>>@@
@@#events11;<<button "11">>
<<set _action = 11>>
<</button>>@@
@@#events12;<<button "12">>
<<set _action = 12>>
<</button>>@@
<<set $buttons = []>>
<<for _i = 1; _i lte 12; _i++>>
<<set $buttons.push("#events" + _i)>>
<</for>>
<<set $buttons_extra = ["#events_actions_back", "#events_actions_leave"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div id="events_actions_back" class="hidden" style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<if def _back_action && (ndef _refresh || !_refresh)>>
<<addclass "#events_actions" "hidden">>
<<removeclass `_back_action` "hidden">>
<<set _stop_loop = true>>
<<timed 100ms>>
<<unset _stop_loop>>
<</timed>>
<<else>>
<<unset _refresh>>
<<goto shintaniHome>>
<</if>>
<</button>>
</div>
<div id="events_actions_leave" class="hidden" style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "shintaniHome">>
<<include locationButton>>
</div>
</div>
<</nobr>><<nobr>>
<<set _choices = 5>>
<<script>>
let _t = State.temporary;
let _v = State.variables;
let player = State.variables.player;
let div = $("<div></div>");
let html = "
You greet Himari,<br>" +
"<em><b>" + setup.titleCase(player.first_name) + "</b>: \"I was hoping I could \
ask you a couple of things?\"</em>\
<br>Himari eyes you up and down, wondering what you want.\
<br>\
What would you like to ask about?\
";
_t.options = "\
<ol>\
<li id=\"li1\">Her background.</li>\
<li id=\"li2\">How she feels about Shintani.</li>\
<li id=\"li3\">How she feels about the other slaves.</li>\
<li id=\"li4\">Her future plans.</li>\
<li id=\"li5\">What you can do to help.</li>";
let quest_journal = _v.quest_journal;
let quests = _v.quests;
if (quest_journal.ongoing.contains("knowledge_is_power")) {
if (quests.knowledge_is_power.stage == 0) {
_t.options += "<li id=\"li6\" value=\"6\">About the library.</li>";
} else if (quests.knowledge_is_power.stage == 1) {
if ("brothel" in quests.knowledge_is_power.data && quests.knowledge_is_power.data.brothel) {
_t.options += "<li id=\"li6\" value=\"6\">About having worked at the brothel.</li>";
} else if (player.get_money() >= 500) {
_t.options += "<li id=\"li6\" value=\"6\">About paying off the debt (¤500).</li>";
}
}
}
_t.options += "</ol>";
_t.options = $(_t.options);
if (_v.locations.nipon.data.owner == "lia_hiroyuki") {
_t.options.find("#li2").html("How she feels about Lia.");
}
html += _t.options.prop('outerHTML');
div.html(html);
setup.mainLog_append(div);
$.wiki("<<disableactions _options>>");
<</script>>
/* Allow back and leave buttons */
<<removeclass "#events_actions_back" "hidden">>
<<removeclass "#events_actions_leave" "hidden">>
/* Psuedoevent listener for action */
<<silently>><<repeat 10ms>>
<<if _action !== undefined>>
<<set _char = $characters[$selected]>>
<<if _char.limits.ask gt 0>>
<<set _char.limits.ask -= 1>>
<<switch _action>>
<<case 1>>
<<run $("#events1 button").prop("disabled", true)>>
<<addclass "#events1 button" "disabled">>
<<set _response = "">>
<<set _responses = [$player.dialogue("Can you tell me a little of your story?")]>>
<<if _char.mental_conditions.anger gt 0>>
<<set _responses.push("Himari is clearly still angry at you,")>>
<<set _dialogue = "How about you mind your own business?">>
<<elseif _char.get_disposition() == "scared">>
<<set _responses.push("Himari is too scared to answer,")>>
<<set _dialogue = "Just leave me alone!">>
<<elseif (_char.slave_traits.trust gte 20) ||
(_char.slave_traits.obedience gte 20) ||
(_char.slave_traits.willpower lte 50)>>
<<set _responses.push("Himari is taken aback by your sudden question.")>>
<<set _dialogue = "Well... I\'ve been in the Hiroyuki household since birth. \
My parents, and their parents all carried the name of Hironaka. I haven\'t really \
left Nipon before either aside from greeting important guests.\
">>
<<else>>
<<set _dialogue = "How about you mind your own business?">>
<</if>>
<<set _responses.push(_char.dialogue(_dialogue))>>
<<set _options.find("#li1").css("text-decoration", "line-through")>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<unset _response>>
<<unset _responses>>
<<unset _dialogue>>
<<case 2>>
<<run $("#events2 button").prop("disabled", true)>>
<<addclass "#events2 button" "disabled">>
<<if $locations.nipon.data.owner == "shintani_hiroyuki">>
<<set _response = "">>
<<set _responses = [$player.dialogue("What do you think about Shintani?")]>>
<<if (_char.slave_traits.trust gte 10) ||
(_char.slave_traits.obedience gte 15) ||
(_char.slave_traits.willpower lte 60)>>
/* Submissive to player and high regards for them */
<<if ((_char.slave_traits.trust gte 75) ||
(_char.slave_traits.obedience gte 80)) &&
(_char.slave_traits.willpower lte 5)>>
<<set _responses.push("Himari hesitates to look around before answering,")>>
<<set _dialogue = "He would be but a shadow of a you if you were my master.">>
<<set _responses.push(_char.dialogue(_dialogue))>>
<<set _responses.push("Himari looks into your eyes with absolute submission.")>>
<<elseif ((_char.slave_traits.trust gte 75) ||
(_char.slave_traits.obedience gte 80)) &&
(_char.slave_traits.willpower lte 20)>>
<<set _responses.push("Himari hesitates to look around before answering,")>>
<<set _dialogue = "Well, he hasn\'t been the worst master, but he hasn\'t been \
perfect either.">>
<<set _responses.push(_char.dialogue(_dialogue))>>
<<set _responses.push("Himari touches your hand, as if to let you know that she \
places you above Shintani but cannot risk saying it out loud.")>>
<<elseif ((_char.slave_traits.trust gte 75) ||
(_char.slave_traits.obedience gte 80))>>
<<set _dialogue = "I hold Shintani in pretty high regards. While he can be a bit \
childish at times, with large naive dreams, he\'s a solid figure of Nipon.">>
<<set _responses.push(_char.dialogue(_dialogue))>>
<<else>>
<<set _dialogue = "I would rather give my life than serve under anyone not of the \
Hiroyuki household.">>
<<set _responses.push(_char.dialogue(_dialogue))>>
<</if>>
<<else>>
<<set _dialogue = "Why don\'t you worry less about what I think about \
Shintani and more about what Shintani thinks of you?">>
<<set _responses.push(_char.dialogue(_dialogue))>>
<</if>>
<<else>>
<<set _responses = [
$player.dialogue("What do you think about Lia?"),
"UNDER CONSTRUCTION"
]>>
<</if>>
<<set _options.find("#li2").css("text-decoration", "line-through")>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<unset _response>>
<<unset _responses>>
<<unset _dialogue>>
<<case 3>>
<<run $("#events3 button").prop("disabled", true)>>
<<addclass "#events3 button" "disabled">>
<<set _options.find("#li3").css("text-decoration", "line-through")>>
<<set _responses = ["UNDER CONSTRUCTION."]>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<unset _response>>
<<unset _responses>>
<<unset _dialogue>>
<<case 4>>
<<run $("#events4 button").prop("disabled", true)>>
<<addclass "#events4 button" "disabled">>
<<set _options.find("#li4").css("text-decoration", "line-through")>>
<<set _responses = ["UNDER CONSTRUCTION."]>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<unset _response>>
<<unset _responses>>
<<unset _dialogue>>
<<case 5>>
<<run $("#events5 button").prop("disabled", true)>>
<<addclass "#events5 button" "disabled">>
<<set _options.find("#li5").css("text-decoration", "line-through")>>
<<set _responses = ["UNDER CONSTRUCTION."]>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<unset _response>>
<<unset _responses>>
<<unset _dialogue>>
<<case 6>>
<<set _options.find("#li6").css("text-decoration", "line-through")>>
<<run $("#events6 button").prop("disabled", true)>>
<<addclass "#events6 button" "disabled">>
<<set _responses = []>>
<<if $quests.knowledge_is_power.stage == 0>>
<<set _responses = [$player.dialogue("Can I have access to the library?")]>>
<<if (_char.slave_traits.trust gte 80) ||
(_char.slave_traits.obedience gte 90) ||
(_char.slave_traits.willpower lte 10)>>
<<set _responses.push(_char.dialogue(
"Oh the library? Why didn\'t you ask earlier? Here\'s the key."
))>>
<<set $locations["shintaniHomeLibrary"].access = true>>
<<else>>
<<set _responses.push(_char.dialogue(
"Well, I\'ve been the keeper of the library for many years now. \
Wouldn\'t it be irresponsible of me to let just anyone in?"
))>>
<<set _responses.push("You see a sickly smile spread over Himari\'s mouth.")>>
<<set _responses.push(_char.dialogue(
"I have a friend who owes some debt to the owner of the Sol Brothel. \
Help me settle that debt, then we can talk about giving you access \
to the Hiroyuki library."
))>>
<<set _responses.push("Himari pauses and thinks for a second,")>>
<<set _responses.push(_char.dialogue("500 lari should cover it."))>>
<<set $quests.knowledge_is_power.stage = 1>>
<</if>>
<<set _responses.push(_options.clone())>>
<<else>>
/* Worked at brothel */
<<if ("brothel" in $quests.knowledge_is_power.data && $quests.knowledge_is_power.data.brothel)>>
<<set _responses = [$player.dialogue(
"I went to the brothel and settled the debt, now about the library..."
)]>>
<<set _responses.push(_char.dialogue(
"I heard about your exploits at Sol, it nearly made me fall \
out of my chair! Well if you\'re willing to go that far for access to the \
dusty library, you deserve it."
))>>
<<set _responses.push("(Himari\'s Trust " + setup.show_change_html(0, 5) + ").")>>
<<set _char.slave_traits.trust += 5>>
<<set _to_round = $selected>>
<<include "round">>
<<else>>
<<set _responses = [$player.dialogue(
"Here\'s the 500 lari, now about the library..."
)]>>
/* Giving ¤500 */
<<set _responses.push(_char.dialogue(
"I won\'t question where you got this, but good job. Here\'s the key to \
the dusty old library. Have fun."
))>>
<<removemoney 500>>
<<audio "coins_sound" play>>
<<run UInv.AddItem("himari_hironaka", "lari", 500)>>
<<updatetime>>
<</if>>
<<set _refresh = true>>
<<set $locations["shintaniHomeLibrary"].access = true>>
<<set _responses.push(_options.clone())>>
<</if>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<updatequests>>
<<unset _response>>
<<unset _responses>>
<<unset _dialogue>>
<</switch>>
/* Advance time every time an ask is performed */
<<set _roll = dice(1, 5) + 5>>
<<addmins _roll>>
<<unset _roll>>
<<else>>
<<notify>>Already asked <<= setup.titleCase($characters[$selected].first_name)>>
too many things today!<</notify>>
<</if>>
<<unset _action>>
<<elseif def _stop_loop && _stop_loop>>
<<stop>>
<</if>>
<</repeat>><</silently>>
<</nobr>><<script>>
let _t = State.temporary;
let _v = State.variables;
let lia = _v.characters.lia_hiroyuki;
let player = _v.player;
_t.talk_path_idx = [];
_t.talk_path = [];
_t.talk_tree = [
[
`You walk in Shintani's office which has now been repurposed by Lia,`,
lia.dialogue("Ah it's you, what did you need?")
], null
];
let talk_root = `<ol>\
<li id='li1'>Ask about the transition.</li>\
<li id='li2'>Ask about Nipon.</li>\
<li id='li3'>Ask about herself.</li>\
<li id='li4'>Compliment.</li>`;
/* Add to talk root depending on quests */
if (_v.quests.a_secret_of_yuki.stage == 1) {
talk_root += `<li id='li5'>Ask about Yuki.</li>`;
}
/* Close talk root */
talk_root += `</ol>`;
_t.talk_tree[0].push($(talk_root));
_t.options = _t.talk_tree[0][_t.talk_tree[0].length - 1];
setup.mainLog_append_delayed(_t.talk_tree[0], _v.buttons, _v.buttons_extra, 1000, true, null, () => {
_t.disable_buttons = false;
$.wiki("<<disableactions _options>>");
});
$("#events_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
let cur_branch = null;
/* Filter out non-action buttons */
if (self.html() == "Leave") {
return;
} else if (self.html() == "Back") {
if (_t.talk_path.length == 0) {
$("#interact_actions").removeClass("hidden");
$("#events_actions").remove();
$("#action_bar").wiki("<<include shintaniHomeEventsActions>>");
$("#char_quick_info").empty();
delete(_t.talk_path);
} else {
_t.talk_path.pop();
_t.talk_path_idx.pop();
if (_t.talk_path.length == 0) {
cur_branch = _t.talk_tree;
} else {
cur_branch = _t.talk_path[_t.talk_path.length - 1];
}
/* Render last of dialogue list (choices) */
_t.options = cur_branch[0][cur_branch[0].length - 1];
_t.disable_buttons = false;
$.wiki("<<disableactions _options>>");
setup.mainLog_append_delayed([player.dialogue("Actually I wanted to ask about something else."), cur_branch[0][cur_branch[0].length - 1]], _v.buttons, _v.buttons_extra);
}
} else {
if (_t.talk_path.length == 0) {
cur_branch = _t.talk_tree;
} else {
cur_branch = _t.talk_path[_t.talk_path.length - 1];
}
/* Get index of the choice */
let choice_idx = Number(self.html()) - 1;
if (cur_branch[1] != null && cur_branch[1][choice_idx] != null) {
_t.talk_path.push(cur_branch[1][choice_idx]);
_t.talk_path_idx.push(choice_idx);
cur_branch = _t.talk_path[_t.talk_path.length - 1];
_t.options = cur_branch[0][cur_branch[0].length - 1].clone();
_t.disable_buttons = false;
$.wiki("<<disableactions _options>>");
setup.mainLog_append_delayed(cur_branch[0], _v.buttons, _v.buttons_extra);
} else {
let responses = [];
let end_hook = () => {};
let disposition = lia.get_disposition();
/* Used for useless button clicks (ie during compliment sequence) */
let do_nothing = false;
/* For unskippable events */
let is_event = false;
/* For end of event (returning) */
let is_event_end = false;
/* Leaf logic */
if (_t.talk_path.length == 0) {
switch(choice_idx) {
case 0:
do_nothing = true;
$.wiki("<<notify>>Under construction!<</notify>>");
break;
case 1:
do_nothing = true;
$.wiki("<<notify>>Under construction!<</notify>>");
break;
case 2:
do_nothing = true;
$.wiki("<<notify>>Under construction!<</notify>>");
break;
case 3:
do_nothing = true;
$.wiki("<<notify>>Under construction!<</notify>>");
break;
case 4:
responses = [
player.dialogue(`I recently encounted Yuki... I'm not sure where to start, but I guess I have questions...`),
`Lia looks at you with a bit of a confused look, before letting out a sigh,`,
lia.dialogue(`Who doesn't have questions? She's an enigma. I honestly don't know much except not to get in her business. She has the connections and ability to do whatever she wants, but she choses not to. \
Really she just seems obsessed with that restaurant of hers. I know better than to get in her way, and I suggest you do the same.`),
player.dialogue(`Interesting... I guess... there's something about the way she smells?`),
`Lia looks at you with a bit of a confused look, before letting out another sigh,`,
lia.dialogue(`Listen, if you really want to dig into it, you can go talk to an old friend of mine, he's a bit of a weirdo, but he's a good guy. I believe he works at that nasty brothel in the slums as the bartender. \
I'm sure he'll be able to help you.`),
];
_v.quests.a_secret_of_yuki.stage += 1;
break;
}
}
if (!do_nothing) {
if (is_event_end) {
/* Return to main, send responses to append */
_v._temp_to_log = responses.join(" ");
$.wiki("<<goto `passage()`>>");
} else {
/* Grab options */
if (_t.talk_path.length == 0) {
cur_branch = _t.talk_tree;
} else {
cur_branch = _t.talk_path[_t.talk_path.length - 1];
}
_t.options = cur_branch[0][cur_branch[0].length - 1];
if (is_event) {
_v.enable_menu = false;
} else {
_t.disable_buttons = false;
/* Disable picked option */
_t.options.find("#li" + (choice_idx + 1)).css("text-decoration", "line-through");
}
_t.options = _t.options.clone();
$.wiki("<<disableactions _options>>");
responses.push(_t.options);
setup.mainLog_append_delayed(responses, _v.buttons, _v.buttons_extra, 1000, true, null, end_hook);
}
}
}
}
});
<</script>><<nobr>>
/* For ease */
<<set _shintani = $characters.shintani_hiroyuki>>
<<script>>
var player = State.variables.player;
var div = $("<div></div>");
var html = "
You greet " + (player.is_slave ? "your master," : "Shintani,") + "<br>" +
"<em><b>" + setup.titleCase(player.first_name) + "</b>: \"I was hoping I could \
ask you a couple of things?\"</em>\
<br>Shintani eyes you up and down, wondering what you want.\
<br>\
What would you like to talk about?\
";
State.temporary.options = "
<ol>\
<li id=\"li1\">His rules.</li>\
<li id=\"li2\">How Nipon started.</li>\
<li id=\"li3\">His dream of \"Free Cities\".</li>\
<li id=\"li4\">How he feels about his slaves.</li>\
<li id=\"li5\">Where you can improve your skills.</li>\
<li id=\"li6\">The library.</li>\
<li id=\"li7\">What you can do to help.</li>";
State.temporary.choices = 7;
let quest_journal = State.variables.quest_journal;
let quests = State.variables.quests;
if (quest_journal.ongoing.contains("the_nipon_economy")) {
if (player.get_money() >= 1000) {
State.temporary.options += "<li id=\"li8\" value=\"8\">About successfully getting $1000.</li>";
} else {
State.temporary.options += "<li id=\"li8\" value=\"8\">About giving up on testing the economy.</li>";
}
State.temporary.choices += 1;
}
if (quest_journal.ongoing.contains("power_struggles") &&
(quests.power_struggles.stage == 3 || quests.power_struggles.stage == 4) &&
quest_journal.completed.contains("the_nipon_economy")) {
State.temporary.options += "<li id=\"li8\" value=\"8\">Lia\'s adversarial plans.</li>";
} else if (quest_journal.ongoing.contains("power_struggles") &&
(quests.power_struggles.stage == 8))
if (quests.power_struggles.data.side == "lia") {
State.temporary.options += "<li id=\"li8\" value=\"8\">Disposal of Nina.</li>";
} else {
State.temporary.options += "<li id=\"li8\" value=\"8\">Lia and Emily\'s plans.</li>"
}
if (quest_journal.ongoing.contains("cycle_of_abuse") && quests.cycle_of_abuse.stage <= 1) {
State.temporary.options += "<li id=\"li9\" value=\"9\">Purchasing a slave.</li>";
}
if (quest_journal.ongoing.contains("duty_of_a_slave") && quests.duty_of_a_slave.stage == 6) {
State.temporary.options += "<li id=\"li10\" value=\"10\">Events at the theater.</li>";
}
if (quest_journal.ongoing.contains("a_secret_of_yuki") && quests.a_secret_of_yuki.stage == 1) {
State.temporary.options += "<li id=\"li11\" value=\"11\">Yuki.</li>";
}
State.temporary.options += "</ol>";
html += State.temporary.options;
div.html(html);
setup.mainLog_append(div);
State.temporary.options = $(State.temporary.options);
<</script>>
<<set _disable_buttons = false>>
<<disableactions _options>>
/* Psuedoevent listener for action */
<<silently>><<repeat 10ms>>
<<if _action !== undefined>>
<<if $characters[$selected].limits.ask gt 0>>
<<set $characters[$selected].limits.ask -= 1>>
<<switch _action>>
<<case 1>>
<<if ndef _sub_action>>
<<if $difficulty == -2 && $player.is_slave>>
<<set _responses = [
_shintani.dialogue("I expect you to work and make saving you worth it, but I guess you can take some off days..., just \
don\'t make it a habit.")
]>>
<<elseif $difficulty == -1 && $player.is_slave>>
<<set _responses = [
"I expect you to work at least one hour a day in this household to make saving you worth it."
]>>
<<elseif $player.is_slave>>
<<set _responses = [
"I expect you to work at least four hours a day in this household to make saving you worth it."
]>>
<<else>>
<<set _responses = [
"Rules? You\'re a citizen now right? Just keep Nipon\'s interests at heart, else some troops may be \
visiting you soon."
]>>
<</if>>
<<if $player.get_status() == "slave" || $player.get_status() == "high_slave">>
<<set _responses.push("I suppose since you\'re trustworthy you can also manage and discipline some lower \
status slaves, but you\'ll have to pay for their opportunity cost if you take them away from their \
usual duties.")>>
<</if>>
<<run $("#events1 button").prop("disabled", true)>>
<<addclass "#events1 button" "disabled">>
<<set _options.find("#li1").css("text-decoration", "line-through")>>
<<set _disable_buttons = false>>
<<elseif _sub_action == 8>>
<<unset _sub_action>>
<<set _responses = [
_shintani.dialogue("Hmm, I can see the determination in your eyes. Wait right here."),
"Shintani steps out of his office for a moment, and comes back brandishing an ornate rapier,",
_shintani.dialogue("You shall be my champion. Most likely Nina will challenge you to fight her in \
the arena. This blade has a lot of historical significance. I want you to slit her throat with the honor \
of the Hiroyuki family."),
"Shintani carefully hands you the blade",
_shintani.dialogue("You'll also want to pick up a shield at the barracks. Now go and make me proud.")
]>>
<<set _disable_buttons = false>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<run setup.remove_val($quest_journal.ongoing, "power_struggles")>>
<<run $quest_journal.completed.push("power_struggles")>>
<<if $quests.power_struggles.data.side == "lia">>
<<set _quest = "path_to_freedom">>
<<else>>
<<set _quest = "duty_of_a_slave">>
<</if>>
<<set $quests[_quest].added = true>>
<<set $quest_journal.ongoing.push(_quest)>>
<<notify>>Quest <em><<= setup.quests[_quest].name>></em> added to journal!<</notify>>
<<audio "quest_added_sound" play>>
<<run UInv.AddItem("inventory", "hiroyuki_blade", 1)>>
<<notify>>Acquired Hiroyuki Blade<</notify>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _sub_action == 10>>
<<if ndef _sub_sub_action>>
<<set _sub_sub_action = 1>>
<<set _name = "same">>
<<set _responses = [
_shintani.dialogue("And you will bring honor throughout the world."),
"Shintani suddenly remembers,"
]>>
<<if !$quest_journal.completed.contains("cycle_of_abuse") && $quests.cycle_of_abuse.added && $quests.cycle_of_abuse.stage == 3>>
<<set _responses.push(_shintani.dialogue("You can forget about that debt you owe me for your first slave. See it as a parting gift in hopes \
that we may collaborate together in the future. The world through us will finally see hope. Hope of the Free Cities."))>>
<<run setup.remove_val($quest_journal.ongoing, "cycle_of_abuse")>>
<<set $quest_journal.completed.push("cycle_of_abuse")>>
<<for _idx, _slave range $player.slaves>>
<<set delete $characters[_slave].data.subsidy>>
<</for>>
<</if>>
<<if $quests.duty_of_a_slave.data.lia == "own">>
<<set _lia = $characters.lia_hiroyuki>>
<<set _lia.reputation = 200>>
<<set _lia.background = "Sister of Shintani Hiroyuki and the once spearhead of political and economic freedom in Nipon. You acquired her by helping \
Shintani clear Nipon of her influence.">>
<<set _lia.date_acquired = clone($gameDate)>>
<<set _lia.status = "slave">>
<<set _lia.owner = "player">>
<<set _lia.stats_known = true>>
<<set _lia.skills_known = true>>
<<set _lia.slave_traits.trust = 0>>
<<set _lia.is_slave = true>>
<<set $player.slaves.push("lia_hiroyuki")>>
<<set _responses.push("An armed guard brings in Lia whose eyes look completely hollow.")>>
<<set _responses.push(_shintani.dialogue("While I\'m a bit wistful to part with my beloved sister, as you request she will serve you from now on. \
I\'ll have her join you at your new residence. And, since we just happen to have a vacancy at Lia\'s Tower, you can stay there. I\'ll inform \
the guards to loosen up security so it won\'t feel like the prison it was intended to be. Finally, since there\'s quite a bit of land there \
you might want to construct some additional ammenities there."))>>
<<elseif $quests.duty_of_a_slave.data.lia == "sell">>
<<set _responses.push(_shintani.dialogue("While I\'m a bit wistful to part with my beloved sister, I did as you suggested and have sold Lia to a \
prospective slave owner. It seems that she\'s quite valuable. For my additional thanks, here\'s a cut of the proceeds. And, since we just \
happen to have a vacancy at Lia\'s Tower, you can stay there. I\'ll inform the guards to loosen up security so it won\'t feel like the prison \
it was intended to be. Finally, since there\'s quite a bit of land there you might want to construct some additional amenities there."))>>
<<set $removed_characters.push("lia_hiroyuki")>>
<<run delete $characters.lia_hiroyuki>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<addmoney 50000>>
<<audio coins_sound play>>
<<stop>>
<</if>><</repeat>><</silently>>
<<else>>
<<set _responses.push(_shintani.dialogue("While I\'m a bit wistful to part with my beloved sister, I did as you suggested and had Lia put to death. \
And, since we just happen to have a vacancy at Lia\'s Tower, you can stay there. I\'ll inform the guards to loosen up security so it won\'t \
feel like the prison it was intended to be. Finally, since there\'s quite a bit of land there you might want to construct some additional amenities \
there."))>>
<<set $removed_characters.push("lia_hiroyuki")>>
<<run delete $characters.lia_hiroyuki>>
<</if>>
<<set _options = $("<ol><li id=\"li1\">\"Thank you.\"</li></ol>")>>
<<set _disable_buttons = true>>
<<elseif _sub_sub_action == 1>>
/* Complete phase 1 quest line */
<<set setup.remove_val($quest_journal.ongoing, "duty_of_a_slave")>>
<<set $quest_journal.completed.push("duty_of_a_slave")>>
/* Remove amulet */
<<set $player.equipment.neck = "none">>
<<run UInv.DeleteItem("inventory", "hironaka_amulet")>>
<<set $player.is_slave = false>>
<<set $locations.nipon.status = "citizen">>
/* Do not allow resetting at phase2Finalization */
<<set $skipped_phase = false>>
<<set $enable_keybinds = false>>
/* Name changing options */
<<if _name == "same">>
<<set $player.last_name = "hironaka">>
<<goto phase2Finalization>>
<<elseif _name == "old">>
<<goto phase2Finalization>>
<<elseif _name == "new">>
<<goto phase2Intro6>>
<</if>>
<<unset _responses>>
<</if>>
<</if>>
<<if def _responses>>
<<disableactions _options>>
<<set _responses.push(_options.clone())>>
<<run setup.mainLog_append_delayed(State.temporary.responses, State.variables.buttons, State.variables.buttons_extra)>>
<</if>>
<<case 2>>
<<if ndef _sub_action>>
<<run $("#events2 button").prop("disabled", true)>>
<<addclass "#events2 button" "disabled">>
<<set _responses = [$player.dialogue("How did Nipon come to be?")]>>
<<set _responses.push("Shintani smiles with a subtle sparkle in his eye.")>>
<<script>>
var player = State.variables.player;
var div = $("<div></div>");
var html = "\
<em><b>Shintani</b>: \"I inhereted Nipon from my parents, whom \
I unfortunately had to sell due to some internal disputes. I was \
told from very little that Nipon was a settlement blessed by the gods \
as an apology for the destruction they laid to our world. Truthfully I\'ve \
been trying to find out our true history for a long time, but I\'ve been \
preoccupied with the refugees pouring in, the droughts, and\
";
if (player.get_status() == "low_slave") {
html += "...\"</em>\
<br>He trails off, realizing that he has said too much to a mere \
low slave.";
} else {
html += " the incursions from other settlements. But actually, recently I\'ve \
found some very old manuscripts in a language I cannot understand. I\'ve sent \
them to a couple of scholars, hoping to understand them. As you can see, I\'ve \
structured Nipon to reflect a very specific culture; one that my parents \
taught me. Perhaps it might be naivity, but";
if (player.get_status() == "slave") {
html += "...\"</em>\
<br>He trails off, realizing that he has said too much to a mere \
slave.";
} else {
html += " I want to hold onto what I deem to be the nature of humanity that was \
lost long ago in The Dusting. I believe in a world of complexity and rich culture. \
We are currently in a phase where man has yet to consolidate, and thus we can change \
the course of history as we know it. Whether you like it or not, we hold the reins \
of tomorrow.\"</em>\
<br>He catches himself in his ferver and calms down. He seems pleased that you were \
interested in Nipon.";
}
}
div.html(html);
State.temporary.responses.push(div);
<</script>>
<<set _options.find("#li2").css("text-decoration", "line-through")>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<set _responses.push(_options.clone())>>
<<run setup.mainLog_append_delayed(State.temporary.responses, State.variables.buttons, State.variables.buttons_extra)>>
<<elseif _sub_action == 8>>
<<unset _sub_action>>
<<set _responses = [
_shintani.dialogue("Hmm, I can see the determination in your eyes. Wait right here."),
"Shintani steps out of his office for a moment, and comes back brandishing an ornate rapier,",
_shintani.dialogue("You shall be my champion. Most likely Nina will challenge you to fight her in \
the arena. This blade has a lot of historical significance. I want you to slit her throat with the honor \
of the Hiroyuki family."),
"Shintani carefully hands you the blade",
_shintani.dialogue("You'll also want to pick up a shield at the barracks. Now go and make me proud.")
]>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<set _responses.push(_options.clone())>>
<<run setup.mainLog_append_delayed(State.temporary.responses, State.variables.buttons, State.variables.buttons_extra)>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<run setup.remove_val($quest_journal.ongoing, "power_struggles")>>
<<run $quest_journal.completed.push("power_struggles")>>
<<if $quests.power_struggles.data.side == "lia">>
<<set _quest = "path_to_freedom">>
<<else>>
<<set _quest = "duty_of_a_slave">>
<</if>>
<<set $quests[_quest].added = true>>
<<set $quest_journal.ongoing.push(_quest)>>
<<notify>>Quest <em><<= setup.quests[_quest].name>></em> added to journal!<</notify>>
<<audio "quest_added_sound" play>>
<<run UInv.AddItem("inventory", "hiroyuki_blade", 1)>>
<<notify>>Acquired Hiroyuki Blade<</notify>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _sub_action == 10>>
<<set _sub_sub_action = 1>>
<<set _responses = [
_shintani.dialogue("As you shall."),
"Shintani suddenly remembers,"
]>>
<<set _name = "new">>
<<if !$quest_journal.completed.contains("cycle_of_abuse") && $quests.cycle_of_abuse.added && $quests.cycle_of_abuse.stage == 3>>
<<set _responses.push(_shintani.dialogue("You can forget about that debt you owe me for your first slave. See it as a parting gift in hopes \
that we may collaborate together in the future. The world through us will finally see hope. Hope of the Free Cities."))>>
<<run setup.remove_val($quest_journal.ongoing, "cycle_of_abuse")>>
<<set $quest_journal.completed.push("cycle_of_abuse")>>
<<for _idx, _slave range $player.slaves>>
<<set delete $characters[_slave].data.subsidy>>
<</for>>
<</if>>
<<if $quests.duty_of_a_slave.data.lia == "own">>
<<set _lia = $characters.lia_hiroyuki>>
<<set _lia.reputation = 200>>
<<set _lia.background = "Sister of Shintani Hiroyuki and the once spearhead of political and economic freedom in Nipon. You acquired her by helping \
Shintani clear Nipon of her influence.">>
<<set _lia.status = "slave">>
<<set _lia.owner = "player">>
<<set _lia.stats_known = true>>
<<set _lia.skills_known = true>>
<<set _lia.slave_traits.trust = 0>>
<<set _lia.is_slave = true>>
<<set $player.slaves.push("lia_hiroyuki")>>
<<set _responses.push("An armed guard brings in Lia whose eyes look completely hollow.")>>
<<set _responses.push(_shintani.dialogue("While I\'m a bit wistful to part with my beloved sister, as you request she will serve you from now on. \
I\'ll have her join you at your new residence. And, since we just happen to have a vacancy at Lia\'s Tower, you can stay there. I\'ll inform \
the guards to loosen up security so it won\'t feel like the prison it was intended to be. Finally, since there\'s quite a bit of land there \
you might want to construct some additional ammenities there."))>>
<<elseif $quests.duty_of_a_slave.data.lia == "sell">>
<<set _responses.push(_shintani.dialogue("While I\'m a bit wistful to part with my beloved sister, I did as you suggested and have sold Lia to a \
prospective slave owner. It seems that she\'s quite valuable. For my additional thanks, here\'s a cut of the proceeds. And, since we just \
happen to have a vacancy at Lia\'s Tower, you can stay there. I\'ll inform the guards to loosen up security so it won\'t feel like the prison \
it was intended to be. Finally, since there\'s quite a bit of land there you might want to construct some additional amenities there."))>>
<<set $removed_characters.push("lia_hiroyuki")>>
<<run delete $characters.lia_hiroyuki>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<addmoney 50000>>
<<audio coins_sound play>>
<<stop>>
<</if>><</repeat>><</silently>>
<<else>>
<<set _responses.push(_shintani.dialogue("While I\'m a bit wistful to part with my beloved sister, I did as you suggested and had Lia put to death. \
And, since we just happen to have a vacancy at Lia\'s Tower, you can stay there. I\'ll inform the guards to loosen up security so it won\'t \
feel like the prison it was intended to be. Finally, since there\'s quite a bit of land there you might want to construct some additional amenities \
there."))>>
<<set $removed_characters.push("lia_hiroyuki")>>
<<run delete $characters.lia_hiroyuki>>
<</if>>
<<set _options = $("<ol><li id=\"li1\">\"Thank you.\"</li></ol>")>>
<<set _responses[_responses.length - 1] += _options.prop('outerHTML')>>
<<set _disable_buttons = true>>
<<disableactions _options>>
<<run setup.mainLog_append_delayed(State.temporary.responses, State.variables.buttons, State.variables.buttons_extra)>>
<</if>>
<<case 3>>
<<if ndef _sub_action>>
<<run $("#events3 button").prop("disabled", true)>>
<<addclass "#events3 button" "disabled">>
<<set _options.find("#li3").css("text-decoration", "line-through")>>
<<set _responses = [$player.dialogue("When you first found me, you mentioned a \"Free City\",")]>>
<<if $player.is_slave>>
<<set _responses.push(
"You raise your hand slowly to touch the collar on your neck with the crest of the \
Hiroyuki household engraved in it, implying that his city is anything but free."
)>>
<<set _response.push("Shintani chuckles,")>>
<<set _response.push(_shintani.dialogue(
"What is freedom really? Do we as humans desire true freedom? Freedom is you starving in the \
desert. It\'s your death. Humans like to be told what to do. We like to wake up and have somewhere \
to be. We like to slowly walk the monotonous march that leads the the great equalizer... death."
))>>
<</if>>
<<set _responses.push("Shintani pauses and considers his words,")>>
<<set _responses.push(_shintani.dialogue("Freedom is about freedom from starvation. It\'s about freedom from worry. \
Freedom is Slavery."))>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<unset _response>>
<<unset _responses>>
<<unset _dialogue>>
<<elseif _sub_action == 10>>
<<set _sub_sub_action = 1>>
<<set _responses = [
_shintani.dialogue("As you shall."),
"Shintani suddenly remembers,"
]>>
<<set _name = "old">>
<<if !$quest_journal.completed.contains("cycle_of_abuse") && $quests.cycle_of_abuse.added && $quests.cycle_of_abuse.stage == 3>>
<<set _responses.push(_shintani.dialogue("You can forget about that debt you owe me for your first slave. See it as a parting gift in hopes \
that we may collaborate together in the future. The world through us will finally see hope. Hope of the Free Cities."))>>
<<run setup.remove_val($quest_journal.ongoing, "cycle_of_abuse")>>
<<set $quest_journal.completed.push("cycle_of_abuse")>>
<<for _idx, _slave range $player.slaves>>
<<set delete $characters[_slave].data.subsidy>>
<</for>>
<</if>>
<<if $quests.duty_of_a_slave.data.lia == "own">>
<<set _lia = $characters.lia_hiroyuki>>
<<set _lia.reputation = 200>>
<<set _lia.background = "Sister of Shintani Hiroyuki and the once spearhead of political and economic freedom in Nipon. You acquired her by helping \
Shintani clear Nipon of her influence.">>
<<set _lia.status = "slave">>
<<set _lia.owner = "player">>
<<set _lia.stats_known = true>>
<<set _lia.skills_known = true>>
<<set _lia.slave_traits.trust = 0>>
<<set _lia.is_slave = true>>
<<set $player.slaves.push("lia_hiroyuki")>>
<<set _responses.push("An armed guard brings in Lia whose eyes look completely hollow.")>>
<<set _responses.push(_shintani.dialogue("While I\'m a bit wistful to part with my beloved sister, as you request she will serve you from now on. \
I\'ll have her join you at your new residence. And, since we just happen to have a vacancy at Lia\'s Tower, you can stay there. I\'ll inform \
the guards to loosen up security so it won\'t feel like the prison it was intended to be. Finally, since there\'s quite a bit of land there \
you might want to construct some additional ammenities there."))>>
<<elseif $quests.duty_of_a_slave.data.lia == "sell">>
<<set _responses.push(_shintani.dialogue("While I\'m a bit wistful to part with my beloved sister, I did as you suggested and have sold Lia to a \
prospective slave owner. It seems that she\'s quite valuable. For my additional thanks, here\'s a cut of the proceeds. And, since we just \
happen to have a vacancy at Lia\'s Tower, you can stay there. I\'ll inform the guards to loosen up security so it won\'t feel like the prison \
it was intended to be. Finally, since there\'s quite a bit of land there you might want to construct some additional amenities there."))>>
<<set $removed_characters.push("lia_hiroyuki")>>
<<run delete $characters.lia_hiroyuki>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<addmoney 50000>>
<<audio coins_sound play>>
<<stop>>
<</if>><</repeat>><</silently>>
<<else>>
<<set _responses.push(_shintani.dialogue("While I\'m a bit wistful to part with my beloved sister, I did as you suggested and had Lia put to death. \
And, since we just happen to have a vacancy at Lia\'s Tower, you can stay there. I\'ll inform the guards to loosen up security so it won\'t \
feel like the prison it was intended to be. Finally, since there\'s quite a bit of land there you might want to construct some additional amenities \
there."))>>
<<set $removed_characters.push("lia_hiroyuki")>>
<<run delete $characters.lia_hiroyuki>>
<</if>>
<<set _options = $("<ol><li id=\"li1\">\"Thank you.\"</li></ol>")>>
<<set _responses[_responses.length - 1] += _options.prop('outerHTML')>>
<<set _disable_buttons = true>>
<<disableactions _options>>
<<run setup.mainLog_append_delayed(State.temporary.responses, State.variables.buttons, State.variables.buttons_extra)>>
<</if>>
<<case 4>>
<<run $("#events4 button").prop("disabled", true)>>
<<addclass "#events4 button" "disabled">>
<<set _options.find("#li4").css("text-decoration", "line-through")>>
<<set _responses = [_shintani.dialogue("Well as you know numerous settlements including \
Nipon has been experimenting with indentured servitude, but as I\'m sure you also know, \
that always seemed to devolve into completely inhumane behavior anyways. I wanted \
to introduce slavery because we as owners shouldn\'t want to damage our property..."),
"Shintani smirks at you...",
_shintani.dialogue("Isn\'t that right?"),
"He pauses for a brief moment before continuing",
_shintani.dialogue("My slaves are my children. They bare my vassal name of Hironaka which \
is known far past Nipon\'s borders. We share not only our success but also failure."),
"It seems to be obvious to everyone but Shintani how fragile his naive ideals are."]>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<unset _response>>
<<unset _responses>>
<<unset _dialogue>>
<<case 5>>
<<run $("#events5 button").prop("disabled", true)>>
<<addclass "#events5 button" "disabled">>
<<set _responses = [
$player.dialogue("Where\'s a good place to improve my skills?")
]>>
<<if $player.get_status(passage()) == "low_slave">>
<<set _responses.push(_shintani.dialogue("Why don\'t you focus on being a better \
slave first before thinking about useless things?"))>>
<<else>>
<<set _response = "You can tell Shintani is happy that you are taking initiative to \
be more useful to him">>
<<if !$quests.path_to_greatness.added>>
<<set _response += " (Trust " + setup.show_change_html(0, 5) + ")">>
<<set $player.slave_traits.trust += 5>>
<<include round>>
<</if>>
<<set _response += ".">>
<<set _responses.push(_response)>>
<<set _responses.push(_shintani.dialogue("You can train at the Nipon barracks with \
our soldiers. They might give you a thrashing if you aren\'t careful though haha."))>>
<<if !$quests.path_to_greatness.added>>
<<set _add_quest = true>>
<</if>>
<</if>>
<<set _options.find("#li5").css("text-decoration", "line-through")>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
/* Wait for end of dialogue to add quest */
<<if def _add_quest && _add_quest>>
<<set _add_quest = false>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set $quests["path_to_greatness"].added = true>>
<<set $quest_journal.ongoing.push("path_to_greatness")>>
<<notify>>Quest <em>Path to Greatness</em> added to journal!<</notify>>
<<audio "quest_added_sound" play>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<<case 6>>
<<run $("#events6 button").prop("disabled", true)>>
<<addclass "#events6 button" "disabled">>
<<set _responses = [$player.dialogue("Do you think I could have access to the library?")]>>
<<if $locations["shintaniHomeLibrary"].access>>
<<set _responses.push(_shintani.dialogue("Don\'t you already have access to the library?"))>>
<<else>>
<<if $player.get_status() != "low_slave" || $player.slave_traits.trust gt 50>>
<<set _responses.push(_shintani.dialogue("Why don\'t you ask Himari, she takes care \
of the library and has the key."))>>
<<if !$quests["knowledge_is_power"].added>>
<<set _add_quest = true>>
<</if>>
<<else>>
<<set _responses.push(_shintani.dialogue("Why don\'t you focus on being a better \
slave first before thinking about useless things?"))>>
<<notify>>Ask again after raising your trust.<</notify>>
<</if>>
<</if>>
<<set _options.find("#li6").css("text-decoration", "line-through")>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<if def _add_quest && _add_quest>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _add_quest>>
<<set $quests["knowledge_is_power"].added = true>>
<<set $quest_journal.ongoing.push("knowledge_is_power")>>
<<notify>>Quest <em>Knowledge is Power</em> added to journal!<</notify>>
<<audio "quest_added_sound" play>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<<unset _response>>
<<unset _responses>>
<<case 7>>
<<set _to_add = []>>
<<run $("#events7 button").prop("disabled", true)>>
<<addclass "#events7 button" "disabled">>
<<set _responses = [$player.dialogue("Is there anything I could do to help out Nipon?")]>>
<<set _response = "Shintani is very happy that you\'d go out of your way to help Nipon">>
/* Complete tutorial quest */
<<if $quest_journal.ongoing.includes("a_new_life")>>
<<set $quest_journal.completed.push("a_new_life")>>
<<run setup.remove_val($quest_journal.ongoing, "a_new_life")>>
<</if>>
<<if $player.get_status() == "low_slave">>
<<if !$quests["life_of_a_slave"].added>>
<<set _add_quest = true>>
<<set _to_add.push("life_of_a_slave")>>
<<set _response += " (Trust " + setup.show_change_html(0, 5) + ").">>
<<set $player.slave_traits.trust += 5>>
<<include round>>
<<else>>
<<set _response += ".">>
<</if>>
<<set _responses.push(_response)>>
<<set _responses.push(_shintani.dialogue("\
Well, I\'m happy that you want to help out, but neither I nor the people \
of Nipon trust you at all yet. Why don\'t you keep following orders for a \
while and we can talk.\
"))>>
<<elseif $player.get_status() == "slave" || $player.get_status() == "high_slave">>
/* Allow access to Nipon */
<<set $locations["niponCentral"].access = true>>
<<set _refresh = true>>
<<if !$quests["life_of_a_slave"].added>>
<<set _add_quest = true>>
<<set _to_add.push("life_of_a_slave")>>
<<set _response += " (Trust " + setup.show_change_html(0, 5) + ").">>
<<set $player.slave_traits.trust += 5>>
<<include round>>
<<else>>
<<set _response += ".">>
<</if>>
<<set _responses.push(_response)>>
<<set _response = "<em><b>Shintani</b>: \"You\'ve done well in proving to me that you are to \
be trusted. ">>
<<if !$quest_journal.completed.contains("the_nipon_economy")>>
<<set _response += "Usually, I\'d still be more cautious, but there is something \
I need dealt with. So I\'m permitting you to leave the house. Here are 200 laris, \
I want you to go into Nipon, and using whatever legal means necessary, turn \
that ¤200 into ¤1000. I also want you to record in detail how exactly you do it. \
This is both a test of your abilities as well as an inquiry in our local economy. \
If the task deems too much for you, just let me know.\"</em><br>">>
<<if !$quests["the_nipon_economy"].added>>
<<set _add_quest = true>>
<<set _to_add.push("the_nipon_economy")>>
<</if>>
/* If the quest was removed but not completed, readd it */
<<if !$quest_journal.ongoing.contains("the_nipon_economy")>>
<<set _add_quest = true>>
<<set _to_add.push("the_nipon_economy")>>
<</if>>
<<elseif $quest_journal.ongoing.contains("power_struggles") && $quests.power_struggles.data.side == "shintani">>
<<set _response += "Just continue dealing with this whole Lia situation.\"</em><br>">>
<<else>>
<<set _response += "Unfortunately I don\'t have anything for you right now.\"</em><br>">>
<</if>>
<<set _responses.push(_response)>>
<</if>>
<<set _options.find("#li7").css("text-decoration", "line-through")>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<if def _add_quest && _add_quest>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _add_quest>>
<<if _to_add.contains("the_nipon_economy")>>
<<set $quest_journal.ongoing.push("the_nipon_economy")>>
<<notify>>Quest <em>The Nipon Economy</em> added to journal!<</notify>>
<<audio "quest_added_sound" play>>
<<if !$quests.the_nipon_economy.added>>
/* Give player money */
<<addmoney 200>>
<<audio "coins_sound" play>>
<<set $quests["the_nipon_economy"].added = true>>
<<include round>>
<<updatetime>>
<</if>>
<</if>>
<<if _to_add.contains("life_of_a_slave")>>
<<set $quests.life_of_a_slave.added = true>>
<<set $quest_journal.ongoing.push("life_of_a_slave")>>
<<notify>>Quest <em>Life of a Slave</em> added to journal!<</notify>>
<<audio "quest_added_sound" play>>
<</if>>
<<unset _to_add>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<<unset _response>>
<<unset _responses>>
<<case 8>>
<<set _options.find("#li8").css("text-decoration", "line-through")>>
<<run $("#events8 button").prop("disabled", true)>>
<<addclass "#events8 button" "disabled">>
<<if $quest_journal.completed.contains("the_nipon_economy")>>
<<if $quests.power_struggles.stage != 8>>
<<set _responses = [$player.dialogue("I\'ve had a run-in with your sister and it seems she\'s plotting \
something..."),
"You relay everything that Lia has told you so far and outline what she has tasked you to do. Shintani \
suddenly starts laughing",
_shintani.dialogue("Didn\'t have enough did she? Listen, I've been trying to destroy the Union\'s influence \
for a long time and I feel that this has presented a great opportunity to do so. I want you to return to \
Lia as if you had done everything she\'d asked."),
"Shintani looks through some files and hands you a book and a folder containing various forms",
_shintani.dialogue("These are some altered forms that\'s mostly accurate save for a couple of important items, \
bring these to Lia and do whatever she asks, then report back to me.")]>>
<<unset _done_appending>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<set $quests.power_struggles.stage = 5>>
<<set $quests.power_struggles.data.side = "shintani">>
<<run UInv.AddItem("inventory", "hiroyuki_book", 1)>>
<<run UInv.AddItem("inventory", "nipon_transaction_log", 1)>>
<<notify>>Acquired tampered Nipon Transaction Logs and Hiroyuki Family Registry<</notify>>
<<stop>>
<</if>><</repeat>><</silently>>
<<set _responses.push(_options.clone())>>
<<else>>
<<set _sub_action = 8>>
<<if $quests.power_struggles.data.side == "lia">>
<<set _responses = [
$player.dialogue("I\'ve heard around the barracks that there\'s a woman named Nina giving you some trouble?"),
"You do your best to play the role of an obedient slave looking out for Shintani\'s interests. Shintani \
is surprised at this sudden question and pauses for a few seconds to think,",
_shintani.dialogue("Hmmm, you know for quite a while I was beginning to doubt if saving you from the Desert \
that day was the right decision, but it seems like I was <b>-F</b>ortunate to have found such a useful slave."),
"With those words, the tension in the room dies down, and a smile creeps onto Shintani\'s face,",
_shintani.dialogue("I know you\'ve been training at the barracks, but do you think you could actually take someone... \
someone experienced in a fight?")
]>>
<<set _sub_options = $("<ol>\
<li id=\"li1\">\"Yes, anything for you master.\"</li>\
<li id=\"li2\">\"No, but I\'m willing to learn if it means helping you, master.\"</li>\
</ol>")>>
<<else>>
<<set _responses = [
$player.dialogue("I gave the papers to Lia like you asked, and she tasked me to go talk to Emily while wearing this,"),
"You hand Shintani the Namm Insignia,",
$player.dialogue("Emily wanted me to help some woman named Nina escape by faking her death. I\'m not too sure on the details \
of the plan because she was being purposefully vague, but she gave me this weak poison to stop Nina\'s heart for 60 seconds. \
She told me I should come talk to you and pose as wanting to help you get rid of her."),
"Shintani walks over to you, takes the small vial of poison out of your hand and starts laughing manically,",
_shintani.dialogue("Oh this is beautiful, Lia, Emily, and Nina! Who knew that the three great families left in Nipon, would \
try to topple me... Well, they\'re about to regret that they ever betrayed my mercy towards them."),
"Shintani fumbles around in his desk for a couple of seconds and pulls out a similar vial. He uncaps the poison he took from you \
and mixes in the foreign substance. He then steps even closer to you and slams the Namm Insignia back onto your chest and puts the \
contaminated vial back into your hand,",
_shintani.dialogue("You\'re going to help me wipe out the last remnants of conflict in Nipon. Do well and you will be rewarded \
handsomly. I\'ve mixed in a little of my own poison... not enough to kill her, but enough for her to suffer perminantly."),
"Shintani slides his finger between the band of the Hiroyuki amulet and your neck, bringing you closer,",
_shintani.dialogue("Yes... even your freedom, so don\'t get any funny ideas hear me? Now, do you think you could \
actually take someone experienced in a fight?")
]>>
<<set _sub_options = $("<ol>\
<li id=\"li1\"></li>\
<li id=\"li2\">\"No, but I\'m willing to learn.\"</li>\
</ol>")>>
<<if $player.titles.has("past_mercenary")>>
<<run _sub_options.find("#li1").html("\"Yes, I\'ve killed before.\" (Past mercenary)")>>
<<else>>
<<run _sub_options.find("#li1").html("\"Yes, I think I can.\"")>>
<</if>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<run UInv.DeleteItem("inventory", "weak_poison", UInv.BagHasItem("inventory", "weak_poison"))>>
<<run UInv.AddItem("inventory", "strong_poison", 1)>>
<<notify>>Acquired Strong Poison<</notify>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<<set _responses.push(_sub_options)>>
<<disableactions _sub_options>>
<</if>>
<<else>>
<<if $player.get_money() gte 1000>>
<<set _responses = [$player.dialogue("I\'ve completed your task, here\'s 1000 lari.")]>>
<<set _responses.push("\
You also hand Shintani some notes that you scribbled describing \
how you came up with the money. A loud silence hangs over the room as he \
closely examines the papers. After a very long five minutes, Shintani puts \
the papers down and looks up to you.\
")>>
<<set _responses.push(_shintani.dialogue("\
Honestly I didn\'t expect you to be able to do it, especially not like this,\
"))>>
<<set _responses.push("he points to the various points you laid out.")>>
<<set _responses.push(_shintani.dialogue("\
Regardless, thank you for your work. You can keep that 1000 lari as a token \
of my appreciation. Know I rarely give rewards, perhaps that should tell you how \
important this was.\
"))>>
<<set _responses.push("\
He waves his hand to dismiss you as he puzzles over the papers you gave him. \
You can tell that something has been troubling him for a long time, perhaps \
you can ask around town about it.\
")>>
<<set $quest_journal.completed.push("the_nipon_economy")>>
<<else>>
<<set _responses = [$player.dialogue("I\'ve tried but I don\'t think I can complete the task.")]>>
<<set _responses.push("Shintani looks at you with disappointment,")>>
<<set _responses.push(_shintani.dialogue("\
I can\'t say I\'m surprised. Let me know if you want to try again.\
"))>>
<<set _responses.push("(Trust " + setup.show_change_html(0, -5) + ")")>>
<<set $player.slave_traits.trust -= 5>>
<<include round>>
<</if>>
<<run setup.remove_val($quest_journal.ongoing, "the_nipon_economy")>>
<<set _responses.push(_options.clone())>>
<</if>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses, State.variables.buttons, State.variables.buttons_extra);
<</script>>
<<unset _response>>
<<unset _responses>>
<<case 9>>
<<set _options.find("#li9").css("text-decoration", "line-through")>>
<<run $("#events9 button").prop("disabled", true)>>
<<addclass "#events9 button" "disabled">>
<<if $quest_journal.ongoing.contains("cycle_of_abuse") && $quests.cycle_of_abuse.stage lte 1>>
<<if $quest_journal.completed.contains("the_nipon_economy") && $player.get_status(passage()) == "high_slave" && $player.slave_traits.trust gte 90>>
<<set _responses = [
"Shintani immediately chuckles a little to himself,",
_shintani.dialogue("Like master like slave huh? You\'ve done well to gain my trust and to serve \
Nipon. I\'ll give you permission to buy slaves as well as subsidize the first one \
by 90%, HOWEVER, I expect to be repaid in full with interest later on."),
]>>
<<set $quests.cycle_of_abuse.stage = 2>>
<<else>>
<<set _responses = [
"Shintani immediately chuckles a little to himself,",
_shintani.dialogue("Perhaps you\'ve forgotten your place here... did you need me to remind you?"),
"He pauses for a couple of seconds",
_shintani.dialogue("Well, I can\'t blame you for seeing the light and hope in slavery though... perhaps \
if you can prove your devotion and loyalty to me we can discuss it.")
]>>
<<set $quests.cycle_of_abuse.stage = 1>>
<</if>>
<</if>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses, State.variables.buttons, State.variables.buttons_extra);
<</script>>
<<unset _response>>
<<unset _responses>>
<<case 10>>
/* Increase ask limit to finish dialogue */
<<set $characters[$selected].limits.ask += 4>>
<<set _options.find("#li10").css("text-decoration", "line-through")>>
<<run $("#events10 button").prop("disabled", true)>>
<<addclass "#events10 button" "disabled">>
<<set _responses = [
$player.dialogue("You wanted to speak to me?"),
_shintani.dialogue("Yes... I honestly doubted you quite a bit till now, but my mettling sister is finally out of the way, the Trade Union has lost a \
significant amount of political power, you outed the rat-traitor Emily, and got rid of Nina. If that doesn't fully prove your loyalty I don\'t know \
what would."),
"Shintani knocks on a door in his office,",
_shintani.dialogue("Bring her in!"),
"Two guards bring in the still completely beat-up Emily. Shintani approaches you, and unlocks the Hironaka Amulet, swiftly placing it on Emily\'s neck.",
_shintani.dialogue("Emily, you\'ll going to be properly trained this time aren\'t you?"),
"Shintani shoos them away and reverts his attention back to you,",
_shintani.dialogue("You\'re the first slave in Nipon to be officially granted freedom. I hope you\'ll continue to bare the Hironaka name and spread my influence \
throughout the world, but if not, well, you are your own person now.")
]>>
<<set _sub_options = "<ol>\
<li id=\"li1\">\"I will continue to bare the family name of Hironaka.\"</li>\
<li id=\"li2\">\"I will choose a new name for myself.\"</li>">>
<<if $player.last_name.toLowerCase() != "hironaka">>
<<set _sub_options += "<li id=\"li3\">I will bare my original name of " + setup.titleCase($player.last_name) + "</li>">>
<</if>>
<<set _sub_options += "</ol>">>
<<set _responses[_responses.length - 1] += _sub_options>>
<<set _sub_options = $(_sub_options)>>
<<disableactions _sub_options>>
<<set _sub_action = 10>>
<<run setup.mainLog_append_delayed(_responses, $buttons, $buttons_extra)>>
<<case 11>>
<<set _options.find("#li11").css("text-decoration", "line-through")>>
<<run $("#events11 button").prop("disabled", true)>>
<<addclass "#events11 button" "disabled">>
<<set _responses = [
$player.dialogue(`I recently encounted Yuki... I'm not sure where to start, but I guess I have questions...`),
`Shintani looks at you with a bit of a confused look, before letting out a sigh,`,
_shintani.dialogue(`Who doesn't have questions? She's an enigma. I honestly don't know much except not to get in her business. She has the connections and ability to do whatever she wants, but she choses not to. \
Really she just seems obsessed with that restaurant of hers. I know better than to get in her way, and I suggest you do the same.`),
$player.dialogue(`Interesting... I guess... there's something about the way she smells?`),
`Shintani looks at you with a bit of a confused look, before letting out another sigh,`,
_shintani.dialogue(`Listen, if you really want to dig into it, you can go talk to an old friend of mine, he's a bit of a weirdo, but he's a good guy. I believe he works at that nasty brothel in the slums as the bartender. \
I'm sure he'll be able to help you.`),
_options
]>>
<<set $quests.a_secret_of_yuki.stage += 1>>
<<set _sub_action = 11>>
<<run setup.mainLog_append_delayed(_responses, $buttons, $buttons_extra, 1000, true, null, () => {})>>
<</switch>>
<<silently>><<repeat 20ms>><<if ndef _done_appending || (def _done_appending && _done_appending)>>
/* Advance time every time an ask is performed */
<<set _roll = dice(1, 5) + 5>>
<<addmins _roll>>
<<unset _roll>>
/* Update quests */
<<updatequests>>
<<stop>>
<</if>><</repeat>><</silently>>
<<else>>
<<notify>>Already asked Shintani too many things today!<</notify>>
<</if>>
<<unset _action>>
<<elseif def _stop_loop && _stop_loop>>
<<stop>>
<</if>>
<</repeat>><</silently>>
<</nobr>><div id="events_actions" class="action container row col" style="--rows: 4; --cols: 5">
/* Fill last column */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 3; grid-column: 5"></div>
<div style="grid-row: 4; grid-column: 5"></div>
@@#events1;<<button "1">>
<<if def _init_sequence && _init_sequence>>
<<unset _init_sequence>>
/* Change scenary */
<<script>>
$("#mainLogImage").css("background-image", "url(resources/images/places/shintaniHomeOfficeImage.png)");
$("#mainLogCharacterImage").css("background-image", "url(resources/images/characters/lia/niponTradeUnion_lia_neutral.png)");
<</script>>
<<set _responses = [
"You follow Lia into your old masters office. Lia shuts the door behind you,",
_lia.dialogue("Thanks for backing us up back there. Know that your name will be recorded in the history \
books. Emily spoke to the military for me and they agreed not to act until the trial. They said if they \
weren\'t convinced, they\'d have my head, but the evidence you provided in these transaction logs are \
overwhelming... Now as for you... come here"),
"Lia walks over to you and for the first time takes the Hironaka amulet off your neck,",
_lia.dialogue("You\'re free to go now, and as an extra thank you, you can stay in my previous tower for now. \
I\'ve instructed the guards to stop overlooking the place. I believe there\'s also quite a bit of \
land there as well, so you might want to consider renovating a bit. If it were up to me I\'d have the thing \
brought to the ground."),
"Lia starts examining some papers and thinks for a moment,",
_lia.dialogue(setup.titleCase($player.first_name) + "... Hironaka? I\'m currently working out your \
citizenship forms. Did you want to change your name?")
]>>
<<set _new_options = "<ol>\
<li id=\"li1\">\"I will continue to bare the family name of Hironaka.\"</li>\
<li id=\"li2\">\"I will choose a new name for myself.\"</li>">>
<<if $player.last_name.toLowerCase() != "hironaka">>
<<set _new_options += "<li id=\"li3\">I will bare my original name of " + setup.titleCase($player.last_name) + "</li>">>
<</if>>
<<set _new_options += "</ol>">>
<<elseif ndef _name>>
<<set _name = "same">>
<<set _responses = [
_lia.dialogue("Hmmm alright, I suppose you\'ll continue to carry the honor of our family line.")
]>>
<<include shintaniHomeEventsPathToFreedomSlaveHelper>>
<<else>>
/* Add in slaves */
<<for _idx, _slave range _new_slaves>>
<<set $player.slaves.push(_slave)>>
<</for>>
<<set $locations.nipon.data.owner = _lia.key>>
/* Remove amulet */
<<set $player.equipment.neck = "none">>
<<run UInv.DeleteItem("inventory", "hironaka_amulet")>>
<<set $player.is_slave = false>>
<<set $locations.nipon.status = "citizen">>
/* Do not allow resetting at phase2Finalization */
<<set $skipped_phase = false>>
<<set $enable_keybinds = false>>
/* Name changing options */
<<if _name == "same">>
<<set $player.last_name = "hironaka">>
<<goto phase2Finalization>>
<<elseif _name == "old">>
<<goto phase2Finalization>>
<<elseif _name == "new">>
<<goto phase2Intro6>>
<</if>>
<</if>>
<</button>>@@
@@#events2;<<button "2">>
<<set _name = "new">>
<<set _responses = [
_lia.dialogue("As you shall.")
]>>
<<include shintaniHomeEventsPathToFreedomSlaveHelper>>
<</button>>@@
@@#events3;<<button "3">>
<<set _name = "old">>
<<set _responses = [
_lia.dialogue("As you shall.")
]>>
<<include shintaniHomeEventsPathToFreedomSlaveHelper>>
<</button>>@@
@@#events4;<<button "4">>
<<set _action = 4>>
<</button>>@@
@@#events5;<<button "5">>
<<set _action = 5>>
<</button>>@@
@@#events6;<<button "6">>
<<set _action = 6>>
<</button>>@@
@@#events7;<<button "7">>
<<set _action = 7>>
<</button>>@@
@@#events8;<<button "8">>
<<set _action = 8>>
<</button>>@@
<<set _buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set _buttons.push("#events" + _i)>>
<</for>>
</div>
<<silently>><<timed 10ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
$("#events_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
if (_t.responses != null) {
if (_t.new_options != null) {
_t.responses[_t.responses.length - 1] += _t.new_options;
_t.options = $(_t.new_options);
delete _t.new_options;
$.wiki("<<disableactions _options>>");
} else if (_t.options != null) {
_t.options.find("#li" + self.html()).css("text-decoration", "line-through");
_t.responses.push(_t.options);
$.wiki("<<disableactions _options>>");
}
setup.mainLog_append_delayed(_t.responses, _t.buttons);
delete _t.responses;
}
});
<</script>><</timed>><</silently>><<set _new_slaves = []>>
<<set _mei = $characters.mei_hironaka>>
<<set _jae = $characters.jae_hironaka>>
<<set _mei_disposition = _mei.get_disposition()>>
<<set _responses.push("Suddenly Jae and Mei enter the room,")>>
<<set _responses.push(_lia.dialogue("Oh good you guys are here as well. I need Himari to take over my post at the Union \
but I don\'t really have too much of a need for you two. Of course, you two are free now, but \
did you have anything in mind?"))>>
<<if _mei_disposition == "devoted">>
<<set _new_slaves.push(_mei.key)>>
<<set _mei.date_acquired = clone($gameDate)>>
<<set _responses.push(_mei.dialogue("I would actually like to continue serving under " + setup.titleCase($player.first_name)) +
". I\'ve been a slave for so long, but I\'ve come to enjoy helping " + setup.PRONOUNS[$player.gender]["?him"] + ".")>>
<<set _responses.push(_lia.dialogue("Uh... are you sure? You\'re free now, you can do whatever you want!"))>>
<<set _responses.push(_mei.dialogue("Yes I\'m sure..."))>>
<<elseif _mei_disposition == "submissive">>
<<set _new_slaves.push(_mei.key)>>
<<set _mei.date_acquired = clone($gameDate)>>
<<set _responses.push(_mei.dialogue("I would actually like to continue serving under " + setup.titleCase($player.first_name)) +
". I\'ve been a slave for so long that I don\'t know how else to live my life.")>>
<<set _responses.push("You can tell that Mei is a very submissive and properly trained slave.")>>
<<set _responses.push(_lia.dialogue("Uh... are you sure? You\'re free now, you can do whatever you want!"))>>
<<set _responses.push(_mei.dialogue("Yes I\'m sure..."))>>
<<else>>
<<set _responses.push(_mei.dialogue("I don\'t really know what to do now that I\'m free... I don\'t even remember a time \
I didn\'t have a master..."))>>
<<set _responses.push("Mei looks at you, but you can tell that she does not want to serve you as a master. (Hint: \
Raise her affection higher or lower her willpower next time!)")>>
<<set _responses.push(_lia.dialogue("That\'s okay. Even though it was Shintani, you still served the Hiroyuki household well. \
Why don\'t you stay here in the manor and we\'ll figure it out in the future."))>>
<</if>>
<<set _responses.push("Lia looks over at Jae,")>>
<<set _responses.push(_lia.dialogue("And what about you Jae?"))>>
<<set _jae_disposition = _jae.get_disposition()>>
<<if _jae_disposition == "devoted" || _jae_disposition == "submissive">>
<<set _new_slaves.push(_jae.key)>>
<<set _jae.date_acquired = clone($gameDate)>>
<<if _mei_disposition == "devoted" || _mei_disposition == "submissive">>
<<set _responses.push(_jae.dialogue("I too want to continue serving under " + setup.titleCase($player.first_name) + ". " +
setup.titleCase(setup.PRONOUNS[$player.gender]["?he"]) + " has given me a new purpose in life."))>>
<<set _responses.push("Lia looks completely dumbfounded,")>>
<<else>>
<<set _responses.push(_jae.dialogue("I want to continue serving under " + setup.titleCase($player.first_name) + ". " +
setup.titleCase(setup.PRONOUNS[$player.gender]["?he"]) + " has given me a new purpose in life."))>>
<<set _responses.push(_lia.dialogue("Uh... are you sure? You\'re free now, you can do whatever you want!"))>>
<<set _responses.push(_jae.dialogue("Yes I\'m sure..."))>>
<</if>>
<<else>>
<<set _responses.push("Jei looks at you, but you can tell that she does not want to serve you as a master. (Hint: \
Raise her affection higher or lower her willpower next time!)")>>
<<set _responses.push(_jae.dialogue("I think I\'ll stay here and try to make something of my life."))>>
<<set _responses.push(_lia.dialogue("Good choice, hopefully I can help make up for the horrors that Shintani \
must have put your through."))>>
<<set _responses.push("Jae is quiet and shifts her eyes away from Lia.")>>
<<set _responses.push(_jae.dialogue("Actually, Shintani saved me you know... not just from the world, but from \
myself. I hope you\'ll have mercy on him. He just wants the best for us, you know..."))>>
<<set _responses.push("There is an awkward silence in the room which is abruptly broken Lia,")>>
<<set _responses.push(_lia.dialogue("Well I\'ll be fair."))>>
<</if>>
<<set _responses.push(_lia.dialogue("Well, that wraps up most of the logistics. You may go now " + setup.titleCase($player.first_name) + "."))>>
<<set _new_options = "<ol><li id='li1'>\"Thank you.\"</li></ol>">><<nobr>>
<<set _shintani = $characters["shintani_hiroyuki"]>>
<<script>>
var div = $("<div></div>");
div.html("
While helping Shintani in his office he hands you a couple of papers,<br>\
<em><b>Shintani</b>: \"Quickly check over these calculations, I need to attend \
to more important matters.\"</em>\
<br>Before you are around four pages of equations.\
<br>\
What do you do?\
<ol>\
<li>Tell him it's too complicated for you.</li>\
<li>Pretend to glance over it and praise his work.</li>\
<li>Diligently check his work.</li>\
<li>Purposefully add in errors.</li>\
</ol>\
");
setup.mainLog_append(div);
<</script>>
<<set $("#mainLogCharacterImage").css("background-image", "url(\"" + _shintani.image_folder() + _shintani.first_name.toLowerCase() + "_neutral.png\")")>>
<<set _choices = 4>>
<<disableactions>>
/* Psuedoevent listener for action */
<<silently>><<repeat 10ms>>
<<if _action !== undefined>>
<<switch _action>>
<<case 1>>
/* Roll */
<<set _roll = dice(1, $difficulty + 6)
+ $player.get_status_prop("tact")
+ 30 / $player.get_status_prop("intelligence")
- $difficulty>>
<<if _roll gt 30>>
<<set _success = true>>
<<set $_temp_to_log += setup.pass("intelligence")>>;
<<set $_temp_to_log += setup.pass("tact")>>;
<<else>>
<<set _success = false>>
<<set $_temp_to_log += setup.fail("intelligence")>>;
<<set $_temp_to_log += setup.fail("tact")>>;
<</if>>
/* Reaction */
<<if _success>>
<<set $_temp_to_log += "<div>You stare at him blankly for a couple of seconds before \
he realizes what he's asking of you.<br>\
<em><b>Shintani</b>: \"Oh nevermind,\"</em>\
<br>he says \
before gesturing to the door (Willpower " +
setup.show_change_html(0, 1) + ").</div>">>
<<set $player.slave_traits.willpower += 1>>
<<else>>
<<set $_temp_to_log += "<div>You tell him that this task is too difficult, but being \
a seasoned slave master, Shintani knows when someone is trying to \
get out of work. He eyes you for a second before dismissing you. \
(Obedience " + setup.show_change_html(0, -1) + ", Trust "+
setup.show_change_html(0, -0.5) + ")">>
<<set $player.slave_traits.obedience -= 1>>
<<set $player.slave_traits.trust -= 0.5>>
<</if>>
<<case 2>>
/* Dice roll */
<<set _roll = $player.get_status_prop("tact") + dice(1, $difficulty + 6) - $difficulty>>
<<if _roll gt 25>>
<<set _success = true>>
<<set $_temp_to_log += setup.pass("tact")>>;
<<else>>
<<set _success = false>>
<<set $_temp_to_log += setup.fail("tact")>>;
<</if>>
/* Reactions */
<<if _success>>
<<set $_temp_to_log += "<div>You look over the papers for a while, making purposeful yet \
discrete grunts of agreement to yourself. After reaching the last \
page, you return him the stack and tell him his work was meticulous \
and well done. He smiles at you and dismisses you. (Obedience " +
setup.show_change_html(0, 2) + ", Trust " +
setup.show_change_html(0, 0.5) + ")</div>">>
<<set $player.slave_traits.obedience += 2>>
<<set $player.slave_traits.trust += 0.5>>
<<else>>
<<set $_temp_to_log += "<div>You quickly look through the papers, and hand it back to him. \
He dismisses you, but as you leave, you see him take the pile of papers \
and move it back into his to-do stack. (Obedience " +
setup.show_change_html(0, -2) + ", Trust " +
setup.show_change_html(0, -0.75) + ").\
</div>">>
<<set $player.slave_traits.obedience -= 2>>
<<set $player.slave_traits.trust -= 0.75>>
<</if>>
<<case 3>>
<<set _roll = $player.get_status_prop("intelligence") + dice(1, $difficulty + 6) - $difficulty>>
<<if _roll gt 20>>
<<set _success = true>>
<<set $_temp_to_log += setup.pass("intelligence")>>;
<<else>>
<<set $_temp_to_log += setup.fail("intelligence")>>;
/* Sub-roll for willpower */
<<set _roll = $player.get_status_prop("willpower") + 2 * (dice(1, $difficulty + 6) - $difficulty)>>
<<if _roll gt 80>>
<<set _success = true>>
<<set _subroll = true>>
<<set $_temp_to_log += setup.pass("willpower")>>;
<<set $player.stats.intelligence += 0.5>>
<<else>>
<<set _success = false>>
<<set _subroll = false>>
<<set $_temp_to_log += setup.fail("willpower")>>;
<</if>>
<</if>>
<<if _success>>
<<set $_temp_to_log += "<div>Whether it was from your intelligence or pure willpower, \
you were able to diligently check through Shintani's work. \
After a while you spot a couple of small minor errors \
and Shintani thanks you for it. ">>
<<if _subroll>>
<<set $_temp_to_log += "(Intelligence " + setup.show_change_html(0, 0.5) + ", ">>
<<else>>
<<set $_temp_to_log += "(">>
<</if>>
<<unset _subroll>>
<<set $_temp_to_log += "Obedience " + setup.show_change_html(0, 2) +
", Trust " + setup.show_change_html(0, 1) + ").\
</div>">>
<<set $player.slave_traits.obedience += 2>>
<<set $player.slave_traits.trust += 1>>
<<else>>
<<set $_temp_to_log += "<div>You spent a long time looking through Shintani's work, trying \
to make sense what seems like completely gibberish to you. After a some \
time, Shintani realizes that this task was far beyond you. He dismisses \
you but not before commending your effort (Obedience "
+ setup.show_change_html(0, 1) + ").</div>">>
<<set $player.slave_traits.obedience += 1>>
<</if>>
<<case 4>>
<<set _roll = dice(1, $difficulty + 6) + $player.get_status_prop("intelligence") - $difficulty>>
<<if _roll gt 35>>
<<set _success = true>>
<<set $_temp_to_log += setup.pass("intelligence")>>;
<<set $_temp_to_log += "<div>Knowing your way around numbers, you purposefully add in some \
hard-to-find errors into Shintani\'s work. As you hand it off to him, he doesn\'t notice \
at all (Willpower " + setup.show_change_html(0, 10) + ").">>
<<else>>
<<set _success = false>>
<<set $_temp_to_log += setup.fail("intelligence")>>;
<<set $_temp_to_log += "<div>Knowing your way around numbers, you purposefully add in some \
errors into Shintani\'s work. As you hand it off to him, he notices your poor attempt of \
rebellion, but decides he is too busy right now to punish you \
(Obedience " + setup.show_change_html(0, -4) + ", Trust " +
setup.show_change_html(0, -1.5) + ").">>
<</if>>
<<if _success>>
<<set $player.slave_traits.willpower += 10>>
<<else>>
<<set $player.slave_traits.obedience -= 4>>
<<set $player.slave_traits.trust -= 1.5>>
<</if>>
<</switch>>
<<unset _action>>
<<unset _roll>>
<<unset _success>>
<<include shintaniHomeWorkEngineAfter>>
<</if>>
<</repeat>><</silently>>
<</nobr>><<set _prefix = "shintaniHomeEventsWorkEconomic">>
<<set _events = [
"CheckMath",
"FetchBook",
"GetTea",
"InformShintani",
"QuickBreak"
]>>
<<script>>
let _v = State.variables;
let _t = State.temporary;
for (const event of _t.events) {
_v.locations[passage()].data.work_event_pool.push(_t.prefix + event);
}
<</script>><<nobr>>
<<set _shintani = $characters.shintani_hiroyuki>>
<<script>>
var div = $("<div></div>");
div.html("
You were helping Shintani in his office when he realizes he forgot something,<br>\
<em><b>Shintani</b>: \"" + setup.titleCase(State.variables.player.first_name) + ", go \
fetch me my log book, it should be on the second shelf on the right.\"</em>\
<br>You look over and see the book, grabbing it. When you return to Shintani you \
notice he is completely immersed in his work.\
<br>\
What do you do?\
<ol>\
<li>Give him the book.</li>\
<li>Give him the wrong book.</li>\
<li>Leave without giving him the book.</li>\
</ol>\
");
setup.mainLog_append(div);
<</script>>
<<set $("#mainLogCharacterImage").css("background-image", "url(\"" + _shintani.image_folder() + _shintani.first_name.toLowerCase() + "_neutral.png\")")>>
<<set _choices = 3>>
<<disableactions>>
/* Psuedoevent listener for action */
<<silently>><<repeat 10ms>>
<<if _action !== undefined>>
<<switch _action>>
<<case 1>>
<<set $_temp_to_log += "<div>You hand him the book and leave him to focus on his work \
(Obedience " + setup.show_change_html(0, 1, true) + ", Trust " +
setup.show_change_html(0, 0.5, true) + ").</div>">>
<<set $player.slave_traits.obedience += 1>>
<<set $player.slave_traits.trust += 0.5>>
<<case 2>>
/* Dice roll */
<<set _roll = dice(1, $difficulty + 6) + $player.stats.intelligence>>
<<if _roll gt 30>>
<<set _success = false>>
<<set $_temp_to_log += setup.fail("intelligence")>>;
<<else>>
<<set _success = true>>
<<set $_temp_to_log += setup.pass("intelligence")>>;
<</if>>
/* Reactions */
<<set $_temp_to_log += "<div>You hand him the wrong book and leave him to focus on his work \
(Willpower " + setup.show_change_html(0, 2, true) + ").">>
<<set $player.slave_traits.willpower += 2>>
<<if _success>>
<<set $_temp_to_log += " He notices you handed him the wrong book, but quickly remembers \
you are too stupid to know any better.</div>">>
<<else>>
<<set $_temp_to_log += " He notices you handed in the wrong book on purpose, as you \
clearly are intelligent enough to know better (Obedience " +
setup.show_change_html(0, -2, true) + ", Trust " +
setup.show_change_html(0, -0.5, true) + ").\
</div>">>
<<set $player.slave_traits.obedience -= 2>>
<<set $player.slave_traits.trust -= 0.5>>
<</if>>
<<case 3>>
<<set _roll = dice(1, $difficulty + 6) + $player.stats.dexterity - $difficulty>>
<<if _roll gt 30>>
<<set _success = true>>
<<set $_temp_to_log += setup.pass("dexterity")>>;
<<else>>
<<set _success = false>>
<<set $_temp_to_log += setup.fail("dexterity")>>;
<</if>>
<<if _success>>
<<set $_temp_to_log += "<div>You left the room with Shintani too distracted to notice \
(Willpower " + setup.show_change_html(0, 1, true) + ").</div>">>
<<set $player.slave_traits.willpower += 1>>
<<else>>
<<set $_temp_to_log += "<div>You left the room but on your way out bump into a chair, \
Shintani is too engrossed in his work to stop you. (Obedience " +
setup.show_change_html(0, -1, true) + ", Trust " +
setup.show_change_html(0, -0.5, true) + ").\
</div>">>
<<set $player.slave_traits.obedience -= 1>>
<<set $player.slave_traits.trust -= 0.5>>
<</if>>
<</switch>>
<<unset _action>>
<<unset _roll>>
<<unset _success>>
<<include shintaniHomeWorkEngineAfter>>
<</if>>
<</repeat>><</silently>>
<</nobr>><<nobr>>
/* For ease */
<<set _char = $characters[either($characters.shintani_hiroyuki.slaves)]>>
<<set _higher_status = ($player.get_status("nipon") == "slave" && _char.status == "low_slave") ||
($player.get_status("nipon") == "high_slave" && _char.status == "slave") ||
($player.get_status("nipon") == "high_slave" && _char.status == "low_slave")>>
/* For eventual rounding and simulation */
<<set _to_round = _char.key>>
<<set $to_simulate.add(_char.key)>>
/* Show selected character's disposition */
<<script>>
let _char = State.temporary.char;
$("#char_quick_info").empty();
$("#char_quick_info").html(`<b>${setup.titleCase(_char.first_name)}'s Disposition: </b>` + setup.titleCase(_char.get_disposition()));
<</script>>
<<set _to_log = [
"As you were assisting " +
setup.titleCase(_char.first_name) + " with " + setup.his(_char) + " duties, " + setup.he(_char) + " starts to feel parched,",
_char.dialogue(
"Go make me a cup of jasmine tea, you should be able to do that at least, right?"
),
"You go to the kitchen and open the cabinet stocking tens of different teas.<br>\
What do you do?\
<ol>\
<li>Brew " + setup.him(_char) + " a cup of jasmine tea like " + setup.he(_char) + " asked.</li>\
<li>Brew " + setup.him(_char) + " the wrong type of tea.</li>\
</ol>"
]>>
<<set $("#mainLogCharacterImage").css("background-image", "url(\"" + _char.image_folder() + _char.first_name.toLowerCase() + "_" + _char.get_disposition() + ".png\")")>>
<<script>>
setup.mainLog_append_delayed(State.temporary.to_log,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 2>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
/* Psuedoevent listener for action */
<<silently>><<repeat 10ms>>
<<if _action !== undefined>>
<<switch _action>>
<<case 1>>
<<if ndef _selected_action>>
<<set _selected_action = 1>>
<<set _responses = [
"You brew " + setup.titleCase(_char.first_name) + " a nice cup of jasmine tea. \
As you inhale the soothing aroma you realize you could put something in it.<br>\
<ol>\
<li>Do nothing and give " + setup.him(_char) + " the tea.</li>\
<li>Spit in " + setup.his(_char) + " tea.</li>"
]>>
<<set _choices = 2>>
<<if $player.gender == 0>>
<<set _responses[0] += "<li>Cum into " + setup.his(_char) + " tea.</li></ol>">>
<<set _choices = 3>>
<</if>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
<<set $_temp_to_log = "\
As you walk back from the kitchen with the cup of tea, " + setup.titleCase(_char.first_name) + " immediately \
can tell from the aroma that you brewed the right tea. "
>>
<<elseif _selected_action == 1>>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand \
(Obedience " + setup.show_change_html(0, 2) + ").">>
<<set $player.slave_traits.obedience += 2>>
<<set $_temp_to_log += "<br>">>
<<include shintaniHomeWorkEngineAfter>>
<<elseif _selected_action == 2>>
<<set _char_disposition = _char.get_disposition()>>
<<switch _char_disposition>>
<<case "submissive">>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand \
too submissive to protest your error \
(Willpower " + setup.show_change_html(0, 2) + ").">>
<<case "devoted">>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand \
too devoted to protest your error \
(Willpower " + setup.show_change_html(0, 2) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Willpower " + setup.show_change_html(0, -1, false) + ").">>
<<set _char.slave_traits.willpower -= 1>>
<<case "scared">>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand \
too scared to protest your error \
(Willpower " + setup.show_change_html(0, 2) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Willpower " + setup.show_change_html(0, -1, false) + ").">>
<<set _char.slave_traits.willpower -= 1>>
<<default>>
<<if _higher_status>>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand \
and drinks the entire cup realizing that it would be a mistake to protest being a lower status than you. ">>
<<else>>
<<set $_temp_to_log += "<br>" + _char.dialogue("Can\'t even do something as simple \
as brewing a cup of tea?") + "\
(Obedience " + setup.show_change_html(0, -1) +
", Willpower " + setup.show_change_html(0, 2) + ").">>
<<set $player.slave_traits.obedience -= 1>>
<</if>>
<</switch>>
<<set $player.slave_traits.willpower += 2>>
<<set $_temp_to_log += "<br>">>
<<include shintaniHomeWorkEngineAfter>>
<</if>>
<<case 2>>
<<if ndef _selected_action>>
<<set _selected_action = 2>>
<<set _responses = [
"You brew " + setup.titleCase(_char.first_name) + " a nice cup of earl grey tea. As you inhale the soothing \
aroma you realize you could put something in it.<br>\
<ol>\
<li>Do nothing and give " + setup.him(_char) + " the tea.</li>\
<li>Spit in " + setup.his(_char) + " tea.</li>"
]>>
<<set _choices = 2>>
<<if $player.gender == 0>>
<<set _responses[0] += "<li>Cum into " + setup.his(_char) + " tea.</li></ol>">>
<<set _choices = 3>>
<</if>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
<<set $_temp_to_log = "\
As you brew the cup of tea, " + setup.titleCase(_char.first_name) + " immediately can tell from the aroma that \
you brewed the wrong tea. "
>>
<<elseif _selected_action == 1>>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand, not \
noticing that you had spit in it \
(Obedience " + setup.show_change_html(0, 1) +
", Willpower " + setup.show_change_html(0, 1) + ").">>
<<set $player.slave_traits.obedience += 1>>
<<set $player.slave_traits.willpower += 1>>
<<set $_temp_to_log += "<br>">>
<<include shintaniHomeWorkEngineAfter>>
<<elseif _selected_action == 2>>
<<set _char_disposition = _char.get_disposition()>>
<<switch _char_disposition>>
<<case "submissive">>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand \
too submissive to protest your error \
(Willpower " + setup.show_change_html(0, 3) + ").">>
<<case "devoted">>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand \
too devoted to protest your error. When " + setup.he(_char) + " takes a sip " + setup.he(_char) + " recognizes \
the taste of your saliva, savoring it \
(Willpower " + setup.show_change_html(0, 3) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Willpower " + setup.show_change_html(0, -1, false) + ").">>
<<set _char.slave_traits.willpower -= 1>>
<<case "scared">>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand \
too scared to protest your error \
(Willpower " + setup.show_change_html(0, 3) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Willpower " + setup.show_change_html(0, -1, false) + ").">>
<<set _char.slave_traits.willpower -= 1>>
<<default>>
<<if _higher_status>>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand \
and drinks the entire cup realizing that it would be a mistake to protest being a lower status than you. ">>
<<else>>
<<set $_temp_to_log += "<br>" + _char.dialogue("Can\'t even do something as simple \
as brewing a cup of tea?") + "She dumps the tea out in front of you \
(Obedience " + setup.show_change_html(0, -1) +
", Willpower " + setup.show_change_html(0, 3) + ").">>
<<set $player.slave_traits.obedience -= 1>>
<</if>>
<</switch>>
<<set $player.slave_traits.willpower += 3>>
<<set $_temp_to_log += "<br>">>
<<include shintaniHomeWorkEngineAfter>>
<</if>>
<<case 3>>
/* Roll for dexterity */
<<set _roll = $player.stats.dexterity + dice(1, 6 + $difficulty) - $difficulty>>
<<set _success = false>>
<<if _roll gte 20>>
<<set _success = true>>
<</if>>
<<if _success>>
<<set $_temp_to_log += "<br>" + setup.pass("dexterity") +
"You successfully jack off and came directly into the cup of tea you just \
brewed for " + setup.titleCase(_char.first_name) + ". You bring it out of the kitchen and hand it to " +
setup.him(_char) + ". "
>>
<<if _selected_action == 1>>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand, and \
drinks the entire cup. ">>
<<if _char.sex_fetishes.cum gte 50>>
<<set $_temp_to_log += "Being a cum slut " + setup.he(_char) + " recognizes the taste of your \
cum and savors it, greedily licking the bottom of the cup">>
<<set $_temp_to_log += "\
(Obedience " + setup.show_change_html(0, 1) +
", Willpower " + setup.show_change_html(0, 4) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Arousal " + setup.show_change_html(0, 4) +
", Cum Fetish " + setup.show_change_html(0, 1) + ").">>
<<set _char.mental_conditions.arousal += 4>>
<<else>>
<<set $_temp_to_log += setup.titleCase(setup.he(_char)) +
" can tell the tea is slightly different but enjoys it">>
<<set $_temp_to_log += "\
(Obedience " + setup.show_change_html(0, 1) +
", Willpower " + setup.show_change_html(0, 4) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Arousal " + setup.show_change_html(0, 1) +
", Cum Fetish " + setup.show_change_html(0, 1) + ").">>
<<set _char.mental_conditions.arousal += 1>>
<</if>>
<<set $player.slave_traits.obedience += 1>>
<<set $player.slave_traits.willpower += 4>>
<<set _char.sex_fetishes.cum += 1>>
<<set $_temp_to_log += "<br>">>
<<include shintaniHomeWorkEngineAfter>>
<<elseif _selected_action == 2>>
<<set _char_disposition = _char.get_disposition()>>
<<switch _char_disposition>>
<<case "submissive">>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand \
and drinks the entire cup, too submissive to protest your error. ">>
<<set $player.slave_traits.willpower += 2>>
<<case "devoted">>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand \
and drinks the entire cup, too devoted to protest your error. ">>
<<case "scared">>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand \
and drinks the entire cup too scared to protest your error. ">>
<<default>>
<<if _higher_status>>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " thanks you and takes the tea from your hand \
and drinks the entire cup realizing that it would be a mistake to protest being a lower status than you. ">>
<<else>>
<<set $_temp_to_log += "<br>" + _char.dialogue("Can\'t even do something as simple \
as brewing a cup of tea?") + "She dumps the tea out in front of you \
(Obedience " + setup.show_change_html(0, -1) +
", Willpower " + setup.show_change_html(0, 4) + ").">>
<<set $player.slave_traits.obedience -= 1>>
<</if>>
<</switch>>
/* If " + setup.he(_char) + " drank the tea */
<<if _char_disposition == "submissive" ||
_char_disposition == "devoted" ||
_char_disposition == "scared" || _higher_status>>
<<if _char.sex_fetishes.cum gte 50>>
<<set $_temp_to_log += "Being a cum slut " + setup.he(_char) + " recognizes the taste of your \
cum and savors it, greedily licking the bottom of the cup. After " +
setup.he(_char) + "\'s done " + setup.he(_char) +
" looks up at you and you can see a little of your cum dipping off " +
setup.his(_char) + " " + _char.physical_traits.ethnicity + " chin">>
<<set $_temp_to_log += "\
(Obedience " + setup.show_change_html(0, 1) +
", Willpower " + setup.show_change_html(0, 4) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Arousal " + setup.show_change_html(0, 4) +
", Cum Fetish " + setup.show_change_html(0, 1) + ").">>
<<set _char.mental_conditions.arousal += 4>>
<<else>>
<<set $_temp_to_log += "She can tell the tea is slightly different but enjoys \
it">>
<<set $_temp_to_log += "\
(Willpower " + setup.show_change_html(0, 4) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Arousal " + setup.show_change_html(0, 1) +
", Cum Fetish " + setup.show_change_html(0, 1) + ").">>
<<set _char.mental_conditions.arousal += 1>>
<</if>>
<<set _char.sex_fetishes.cum += 1>>
<</if>>
<<set $player.slave_traits.willpower += 4>>
<<set $_temp_to_log += "<br>">>
<<include shintaniHomeWorkEngineAfter>>
<</if>>
<<else>>
<<set $_temp_to_log += "<br>" + setup.fail("dexterity") +
"As you were jacking off in the kitchen you bump into the counter, causing \
" + setup.titleCase(_char.first_name) + " to come in. She catches you red-handed as you\'re aiming your member \
into " + setup.him(_char) + " cup of tea. "
>>
<<set _char_disposition = _char.get_disposition()>>
<<switch _char_disposition>>
<<case "submissive">>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " is so submissive, " + setup.he(_char) + " drops to " + setup.him(_char) + " knees \
immediately and takes your member into " + setup.him(_char) + " mouth. As you\'re about \
to cum " + setup.he(_char) + " aims your cock into " + setup.his(_char) + " tea, drinking the entire thing in one \
gulp.<br>">>
<<if _char.sex_fetishes.cum gte 50>>
<<set $_temp_to_log += _char.dialogue("I love drinking your cum so much!")>>
<<set $_temp_to_log += "\
(Willpower " + setup.show_change_html(0, 4) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Arousal " + setup.show_change_html(0, 4) +
", Cum Fetish " + setup.show_change_html(0, 1) + ").">>
<<set _char.mental_conditions.arousal += 4>>
<<else>>
<<set $_temp_to_log += _char.dialogue("Thank you for the extra treat.")>>
<<set $_temp_to_log += "\
(Willpower " + setup.show_change_html(0, 4) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Arousal " + setup.show_change_html(0, 1) +
", Cum Fetish " + setup.show_change_html(0, 1) + ").">>
<<set _char.mental_conditions.arousal += 1>>
<</if>>
<<set $player.slave_traits.willpower += 4>>
<<set _char.sex_fetishes.cum += 1>>
<<case "devoted">>
<<set $_temp_to_log += setup.titleCase(_char.first_name) + " is so devoted, " + setup.he(_char) + " drops to "
+ setup.him(_char) + " knees \
immediately and takes your member into " + setup.his(_char) + " mouth. As you\'re about \
to cum " + setup.he(_char) + " aims your cock into " + setup.his(_char) + " tea, drinking the entire thing in one \
gulp.<br>">>
<<if _char.sex_fetishes.cum gte 50>>
<<set $_temp_to_log += _char.dialogue("I love drinking your cum so much!")>>
<<set $_temp_to_log += "\
(Willpower " + setup.show_change_html(0, 4) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Arousal " + setup.show_change_html(0, 4) +
", Cum Fetish " + setup.show_change_html(0, 1) + ").">>
<<set _char.mental_conditions.arousal += 4>>
<<else>>
<<set $_temp_to_log += _char.dialogue("Thank you for the extra treat.")>>
<<set $_temp_to_log += "\
(Willpower " + setup.show_change_html(0, 4) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Arousal " + setup.show_change_html(0, 1) +
", Cum Fetish " + setup.show_change_html(0, 1) + ").">>
<<set _char.mental_conditions.arousal += 1>>
<</if>>
<<set $player.slave_traits.willpower += 4>>
<<set _char.sex_fetishes.cum += 1>>
<<case "scared">>
<<set $_temp_to_log += "<br>" +
_char.dialogue("What the FUCK are you doing?!!") +
"You look " + setup.titleCase(_char.first_name) + " in " +
setup.his(_char) + " eyes and can see that she\'s terrified,<br>" +
_char.dialogue("Pl...please don\'t make me drink that.") +
"You don\'t break eye contact and quickly finish into the tea, handing \
it to " + setup.him(_char) + ". She takes the cup, shaking and slowly sips the tea until it\'s \
empty ">>
<<if !_higher_status>>
<<set $_temp_to_log += "(Obedience " + setup.show_change_html(0, -3) + ", ">>
<<set $player.slave_traits.obedience -= 3>>
<<else>>
<<set $_temp_to_log += "(">>
<</if>>
<<set $_temp_to_log += "Willpower " + setup.show_change_html(0, 5) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Affection " + setup.show_change_html(0, -10) +
", Anger " + setup.show_change_html(0, 10, false) +
", Fear " + setup.show_change_html(0, 5, false) +
", Willpower " + setup.show_change_html(0, -3, false) + ").">>
<<set $player.slave_traits.willpower += 5>>
<<set _char.slave_traits.obedience -= 10>>
<<set _char.slave_traits.trust -= 5>>
<<set _char.mental_conditions.anger += 10>>
<<default>>
<<if _higher_status>>
<<set $_temp_to_log += "<br>" +
_char.dialogue("What the FUCK are you doing?!!") +
"You look " + setup.titleCase(_char.first_name) + " in " +
setup.his(_char) + " eyes to remind " +
setup.him(_char) + " of your higher status \
and can see that she\'s terrified,<br>" +
_char.dialogue("Pl...please don\'t make me drink that.") +
"You don\'t break eye contact and quickly finish into the tea, handing \
it to " + setup.him(_char) + ". She takes the cup, shaking and slowly sips the tea until it\'s \
empty \
(Willpower " + setup.show_change_html(0, 5) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Affection " + setup.show_change_html(0, -10) +
", Anger " + setup.show_change_html(0, 10, false) +
", Fear " + setup.show_change_html(0, 5, false) +
", Willpower " + setup.show_change_html(0, -3, false) + ").">>
<<set $player.slave_traits.willpower += 5>>
<<set _char.slave_traits.obedience -= 10>>
<<set _char.slave_traits.trust -= 5>>
<<set _char.mental_conditions.anger += 10>>
<<else>>
<<set $_temp_to_log += "<br>" +
_char.dialogue("What the FUCK are you doing?!!") +
"You quickly escape from the kitchen as fast as you could \
(Obedience " + setup.show_change_html(0, -3) +
", Willpower " + setup.show_change_html(0, 5) + ") \
(" + setup.titleCase(_char.first_name) + "\'s Affection " + setup.show_change_html(0, -10) +
", Anger " + setup.show_change_html(0, 10, false) +
", Trust " + setup.show_change_html(0, -5) + ").">>
<<set $player.slave_traits.obedience -= 3>>
<<set $player.slave_traits.willpower += 5>>
<<set _char.slave_traits.obedience -= 10>>
/* Do not induce fear */
<<if _char.slave_traits.trust gt 0>>
<<set _char.slave_traits.trust = Math.clamp(_char.slave_traits.trust - 5, 0, 100)>>
<</if>>
<<set _char.mental_conditions.anger += 10>>
<</if>>
<</switch>>
<<set $_temp_to_log += "<br>">>
<<include shintaniHomeWorkEngineAfter>>
<</if>>
<</switch>>
<<unset _action>>
<<unset _roll>>
<<unset _success>>
<</if>>
<</repeat>><</silently>>
<</nobr>><<nobr>>
/* For ease */
<<set _himari = $characters.himari_hironaka>>
<<set _to_round = _himari.key>>
<<set _shintani = $characters.shintani_hiroyuki>>
<<set _to_log = [
"As you were assisting Himari with her duties, she realizes she forgot something,",
_himari.dialogue(
"Oh I just remembered I needed to tell Shintani about the arrival of the Hoxel \
caravan. I\'m a bit busy right now, can you tell him for me?"
),
"You enter Shintani\'s office and he looks up at you wondering what you need\
<ol>\
<li>Tell him about the arrival of the Hoxel caravan like Himari told you to.</li>\
<li>Lie and say Himari told you to tell him about the arrival of the Fox Tail caravan.</li>\
</ol>"
]>>
<<script>>
let _t = State.temporary;
setup.mainLog_append_delayed(State.temporary.to_log, State.variables.buttons, State.variables.buttons_extra, 1000, true, null, () => {});
$("#mainLogCharacterImage").css("background-image", "url(\"" + _t.shintani.image_folder() + _t.shintani.first_name.toLowerCase() + "_neutral.png\")");
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 2>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
/* Psuedoevent listener for action */
<<silently>><<repeat 10ms>>
<<if _action !== undefined>>
<<switch _action>>
<<case 1>>
<<set $_temp_to_log = "\
You approach Shintani and relay what Himari told you,<br>" +
_shintani.dialogue("Thanks for letting me know.") +
"(Obedience " + setup.show_change_html(0, 1) +
", Trust " + setup.show_change_html(0, 0.5) + ")."
>>
<<set $player.slave_traits.obedience += 1>>
<<set $player.slave_traits.trust += 0.5>>
<<case 2>>
<<set _roll = $player.get_status_prop("manipulation") + dice(1, 6 + $difficulty) - $difficulty>>
<<if _roll gte 25>>
<<set _success = true>>
<<set $_temp_to_log = setup.pass("manipulation")>>
<<else>>
<<set _success = false>>
<<set $_temp_to_log = setup.fail("manipulation")>>
<</if>>
<<set $_temp_to_log += "You approach Shintani and relay false information from \
Himari,<br>" +
$player.dialogue("Himari wanted me to inform you about the arrival of the Fox \
Tail caravan.")>>
<<if _success>>
<<set $_temp_to_log += _shintani.dialogue("The Fox Tail caravan? They arrived \
last week... I\'ll have to have a talk with Himari.") +
"(">>
<<else>>
<<set $_temp_to_log += _shintani.dialogue("The Fox Tail caravan? They arrived \
last week... I think you better work on your listening skills.") +
"(Trust " + setup.show_change_html(0, -0.5) + ", ">>
<<set $player.slave_traits.trust -= 0.5>>
<</if>>
<<set $_temp_to_log += "Willpower " + setup.show_change_html(0, 2) + ") ">>
<<set $player.slave_traits.willpower += 2>>
<<if _success>>
<<set $_temp_to_log += "(Himari Affection " + setup.show_change_html(0, -1) +
", Trust " + setup.show_change_html(0, -1) +
", Willpower " + setup.show_change_html(0, -1, false) + ")">>
<<set _himari.slave_traits.obedience -= 1>>
<<if _himari.slave_traits.trust gt 0>>
<<set _himari.slave_traits.trust = Math.clamp(_himari.slave_traits.trust - 1, 0, 100)>>
<</if>>
<<set _himari.slave_traits.willpower -= 1>>
<</if>>
<</switch>>
<<set $_temp_to_log += "<br>">>
<<include shintaniHomeWorkEngineAfter>>
<</if>>
<</repeat>><</silently>>
<</nobr>><<script>>
let _v = State.variables;
let _t = State.temporary;
let player = _v.player;
/* Get shuffled version of slaves */
let slaves = [].concat(_v.characters.shintani_hiroyuki.slaves);
slaves.concat(player.slaves);
slaves.sort(function() {
return 0.5 - Math.random();
});
let found_slave = false;
let char = null;
for (const _char_name of slaves) {
char = _v.characters[_char_name];
let disposition = char.get_disposition();
if (disposition == "submissive" || disposition == "devoted") {
found_slave = true;
_t.char = char;
break;
}
}
if (!found_slave) {
_t.responses = [
"After working for a while you find some time which can be used to relax. It seems no one in the house cares for you enough to spend time with you though. What do you do? \
<ol>\
<li>Relax for a bit.</li>\
<li>Continue working hard.</li>\
</ol>"
];
setup.mainLog_append_delayed(_t.responses, State.variables.buttons, State.variables.buttons_extra, 1000, true, null,
() => {
_t.choices = 2;
$.wiki("<<disableactions>>");
/* Add event listener */
$("#events_actions").find("button").on("click", () => {
let self = $(event.currentTarget);
if (self.html() == "1" || self.html() == "2") {
let delta = {};
if (self.html() == "1") {
delta["conditions"] = {
"stamina": 5,
"max_stamina": 100
};
_v._temp_to_log = "You spent some time relaxing ";
} else {
delta["slave_traits"] = {
"obedience": 5,
"max_obedience": 100
};
_v._temp_to_log = "You spent extra time working ";
}
let true_delta = setup.apply_delta(player, delta);
_v._temp_to_log += _v.player.print_delta(true_delta) + "<br>";
$.wiki("<<include shintaniHomeWorkEngineAfter>>");
}
});
}
);
} else {
let fn = setup.titleCase(char.first_name);
$("#mainLogCharacterImage").css("background-image", "url(\"" + char.image_folder() + char.first_name.toLowerCase() + "_" + char.get_disposition() + ".png\")");
_t.responses = [
`After working for a while you find some time which can be used to relax. ${fn} slips around the corner,`,
char.dialogue("Hey, you taking a break? Maybe I can help you relax a bit?") + `<ol>\
<li>Relax for a bit.</li>\
<li>Continue working hard.</li>\
</ol>`
];
setup.mainLog_append_delayed(_t.responses, State.variables.buttons, State.variables.buttons_extra, 1000, true, null,
() => {
/* Show selected character's disposition */
$("#char_quick_info").empty();
$("#char_quick_info").html(`<b>${setup.titleCase(char.first_name)}'s Disposition: </b>` + setup.titleCase(char.get_disposition()));
_t.choices = 2;
$.wiki("<<disableactions>>");
/* Add event listener */
$("#events_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
if (self.html() == "1" || self.html() == "2") {
let player_delta = {};
let char_delta = null;
if (self.html() == "1") {
char_delta = {};
player_delta["conditions"] = {
"stamina": 7,
"max_stamina": 100
};
_v._temp_to_log = `You give in to ${fn}\'s advances, sitting yourself in a nearby chair. ${fn} slow makes ${setup.his(char)} way over, lowering ${setup.his(char)} head \
between your legs. `;
if (player.gender == 0) {
_v._temp_to_log += `After some hesitation, ${fn} takes the entirety of your penis into ${setup.his(char)} mouth. Skillfully, ${setup.he(char)} bobs up and down until you eventually \
cum into her mouth. ${fn} obediently opens her mouth and plays with your cum before swallowing every last drop, <br>` + char.dialogue("So tasty...");
if (char.sex_fetishes.cum >= 30) {
char_delta["mental_conditions"] = {
"cum_addiction": 0.5
};
}
char_delta["sex_fetishes"] = {
"cum": 1
};
char_delta["slave_traits"] = {
"obedience": 1,
"willpower": 1
};
} else {
}
} else {
player_delta["slave_traits"] = {
"obedience": 5,
"max_obedience": 100
};
_v._temp_to_log = `You spent extra time working, shooing ${fn} away `;
}
let true_player_delta = setup.apply_delta(player, player_delta);
_v._temp_to_log += player.print_delta(true_player_delta);
if (char_delta != null) {
let true_char_delta = setup.apply_delta(char, char_delta);
_v._temp_to_log += " " + char.print_delta(true_char_delta) + "<br>";
}
_t.to_round = char.key;
_v.to_simulate.add(char.key);
$.wiki("<<include round>>");
$.wiki("<<include shintaniHomeWorkEngineAfter>>");
}
});
}
);
}
<</script>><<script>>
let _v = State.variables;
let _t = State.temporary;
let player = _v.player;
let player_fn = setup.titleCase(player.first_name);
let shintani = _v.characters["shintani_hiroyuki"];
let player_status = player.get_status("nipon");
let char = _v.characters[either(_v.characters.shintani_hiroyuki.slaves)];
let fn = setup.titleCase(char.first_name);
/* Predeclare branches for reuse in main event tree */
let suck_event_branch = [
[
`As you continue to pleasure your master, you hear the office door open and ${fn} begin to speak.`,
char.dialogue(`Master, I came to ask for your advice on something, may I intrude?`),
shintani.dialogue(`You may, ${fn}. What seems to be the issue?`),
`As the two of them talk about the matter, you're left wondering what to do, so you...`,
$(`<ol>
<li id="li1">Continue sucking him off.</li>
<li id="li2">Stop sucking and wait for the conversation to end.</li>
<li id="li3">Lick his balls.</li>
</ol>`)
],
[
() => {
let str = `You do your duty to your master, making sure he's pleased all throughout the conversation.`;
let last_choice = _t.event_path[_t.event_path.length - 1];
if (last_choice == 1) {
str += ` Keeping up the pressure, you keep an even pace as you try to bring him to orgasm, repeating the same motions until you feel him twitch.`;
} else if (last_choice == 2) {
str += ` You move up and down on his cock slowly as he explains a subject to ${fn} with an even keel. As you return to his head, you draw your lips over the lip of his glans, getting a powerful throb as a reward.`;
} else if (last_choice == -2) {
str += ` You try to lick in odd areas to find a sensitive spot, but your attempts only seem to get light throbs as a response.`;
} else if (last_choice == 3) {
str += ` You take your master's entire length over and over again while keeping your subtle gags quiet. Taking his entire shaft all at once, you hold your position and tighten your throat around his pulsating cock, waiting for your meal.`;
} else if (last_choice == -3) {
str += ` Every attempt to take him completely fails as you try to hide your gagging and coughing from ${fn} standing behind you. You hope you didn't cause too much of a disturbance as you scramble to find an effective method.`;
}
let responses = [str];
if (last_choice > 0) {
responses = responses.concat([
char.dialogue(`So I should use this product instead?`),
shintani.dialogue(`Yes, I find it suits the task better than other things.`),
`Your master unloads in your mouth as he gives ${fn} advice, letting out much more seed than you anticipated. His cum flows down your throat into your gullet as you swallow it by the rope, the salty taste lingering in your \
mouth even after you consume it all. ${fn} soon leaves the room after having ${setup.his(char)} question answered. Your master puts his dick away and beckons you out from under the desk.`
]);
} else {
responses = responses.concat([
char.dialogue(`Are you okay, master? You look irritated. Did I do something to upset you?`),
shintani.dialogue(`No, it's nothing to do with you, don't worry about it. Now about your issue...`),
`${fn} soon leaves the room after having ${setup.his(char)} question answered. Your master puts his dick away and beckons you out from under the desk.`
]);
}
let delta = {
"slave_traits": {
"willpower": -3
}
};
if (last_choice == 1) {
responses = responses.concat([
shintani.dialogue(`You did well, ${player_fn}. You are dismissed.`),
`You leave the room and return to your duties, your mouth still tasting of your master's cum.`
]);
delta.slave_traits["obedience"] = 3;
delta.slave_traits["trust"] = 1;
} else if (last_choice == 2 || last_choice == 3) {
responses = responses.concat([
shintani.dialogue(`You did excellently, ${player_fn}. I may call on you for other tasks of this nature in the future.`),
`You leave the room and return to your duties, your mouth still tasting of your master's cum.`
]);
delta.slave_traits["obedience"] = 5;
delta.slave_traits["trust"] = 2;
} else {
responses = responses.concat([
shintani.dialogue(`I see that you put in effort, ${player_fn}. Practice before attempting such things while serving me.`)
]);
delta.slave_traits["obedience"] = 3;
delta.slave_traits["trust"] = -1;
}
responses = responses.concat([
player.print_delta(delta),
$(`<ol>
<li id="li1">Done.</li>
</ol>`)
]);
return [[responses, [
() => {
let next_response = '';
if (last_choice > 0 || _t.event_path[_t.event_path.length - 1] == 3) {
next_response = `You leave the room and return to your duties, your mouth still tasting of your master's cum.`;
} else {
next_response = `You return to the main room after Shintani ushers you away with disappointment.`;
}
return [[
[next_response], null
], () => {
$.wiki("<<include shintaniHomeWorkEngineAfter>>");
}, true, false, false];
}
]], () => {
setup.apply_delta(player, delta);
$("#mainLogCharacterImage").css("background-image", "url(\"" + shintani.image_folder() + "shintani_neutral.png\")");
}, false, false, false];
},
() => {
let delta = {
"slave_traits": {
"obedience": -1,
"trust": -1,
"willpower": 1
}
};
let responses = [
`You decide to stop pleasuring him while he deals with the slave who walked in. His dick throbs a few times in the open air before gradually going soft.`,
char.dialogue(`Are you okay, master? You look irritated. Did I do something to upset you?`),
shintani.dialogue(`No, it's nothing to do with you, don't worry about it. Now about your issue...`),
`${fn} soon leaves the room after having ${setup.his(char)} question answered. Your master puts his dick away and beckons you out from under the desk.`,
shintani.dialogue(`I did not order you to halt your duties, ${player_fn}! I sincerely hope you learn from this mistake.`),
player.print_delta(delta),
$(`<ol>
<li id="li1">Done.</li>
</ol>`)
];
return [[responses, [
() => {
return [[
[`You leave the room and return to your duties, your mouth still tasting of your master's cum.`], null
], () => {
$.wiki("<<include shintaniHomeWorkEngineAfter>>");
}, true, false, false];
}
]], () => {
setup.apply_delta(player, delta);
$("#mainLogCharacterImage").css("background-image", "url(\"" + shintani.image_folder() + "shintani_neutral.png\")");
}, false, false, false];
},
() => {
let delta = {
"slave_traits": {
"obedience": 4,
"trust": 1,
"willpower": -3
}
};
let responses = [
`Switching gears, you focus on pampering your master's balls as best you can. Pulling one into your mouth, you clean it to a shine with your tongue, despite his hair. You do the same for the other, \
pulling and sucking on them back and forth while inhaling his scent as his dick throbs. Before you know it, he comes to a sudden finish that coats your face in his seed. You take his dick in your \
mouth again to taste your reward and you swallow each rope that shoots into your throat.`,
char.dialogue(`Master? Are you okay?`),
shintani.dialogue(`Yes… I just felt a shiver down my spine for some reason. Pay it no mind.`),
`You keep sucking even after he finishes, scooping up any straggling drops before you let go of his cock. ${fn} soon leaves the room after having her question answered. Your master puts his dick \
away and beckons you out from under the desk.`,
shintani.dialogue(`That was extraordinary, ${player_fn}! I can see your willingness to serve clear as day.`),
player.print_delta(delta),
$(`<ol>
<li id="li1">Done.</li>
</ol>`)
];
return [[responses, [
() => {
return [[
[`You return to the main room after Shintani ushers you away with disappointment.`], null
], () => {
$.wiki("<<include shintaniHomeWorkEngineAfter>>");
}, true, false, false];
}
]], () => {
setup.apply_delta(player, delta);
$("#mainLogCharacterImage").css("background-image", "url(\"" + shintani.image_folder() + "shintani_neutral.png\")");
}, false, false, false];
}
]
];
_t.event_path = [];
_t.event_tree = [
[
`While performing your duties in the master's office, you feel your master gazing at you from behind.`,
shintani.dialogue(`Come here, ${player_fn}. I want you to do something for me.`),
`You follow his orders and stand before him waiting for instruction.`,
shintani.dialogue(`Kneel under my desk.`),
`Despite your reluctance, you know better than to ignore him. You do as he says and kneel in front of him between his legs. He pulls his dick free from his pants, his musk surrounding you in the tight space under the desk.`,
shintani.dialogue(`Suck it.`),
`He doesn't leave you many choices, but you...`,
$(`<ol>
<li id="li1">Suck him off in earnest.</li>
<li id="li2">Impress him with your technique at a methodical pace.</li>
<li id="li3">Deepthroat him.</li>
<li id="li4">Punch his balls.</li>
</ol>`)
],
[
() => {
let responses = [
`You quickly get to work to end this task as soon as possible. Up and down you bob on his cock, but his stamina is more than you anticipated.`
];
let next_branch = [
responses.concat(suck_event_branch[0]),
suck_event_branch[1]
];
return [next_branch, () => {
$("#mainLogCharacterImage").css("background-image", "url(\"" + char.image_folder() + char.first_name.toLowerCase() + "_" + char.get_disposition() + ".png\")");
}, false, false, false];
},
() => {
let responses = [];
let end_hook = () => {};
let roll = player.stats.dexterity + (dice(1, 5 + _v.difficulty) - _v.difficulty);
if (roll > 25) {
responses = [
setup.pass("dexterity"),
`You take your time licking the sides and head of his dick, taking extra care of his frenulum before engulfing his head with your lips. His cock hardens in your mouth as you lick up \
his leaking precum, working him towards orgasm gradually as you pamper his shaft.`
];
} else {
responses = [
setup.fail("dexterity"),
`You try to show off to your master, going slow as you nip around his shaft, but your movements are too broken up to get much of a reaction from his cock.`
];
end_hook = () => {
_t.event_path[_t.event_path.length - 1] *= -1;
};
}
let next_branch = [
responses.concat(suck_event_branch[0]),
suck_event_branch[1]
];
return [next_branch, () => {
end_hook();
$("#mainLogCharacterImage").css("background-image", "url(\"" + char.image_folder() + char.first_name.toLowerCase() + "_" + char.get_disposition() + ".png\")");
}, false, false, false];
},
() => {
let responses = [];
let end_hook = () => {};
let roll = player.stats.strength + (dice(1, 5 + _v.difficulty) - _v.difficulty);
if (roll > 25) {
responses = [
setup.pass("strength"),
`You line up your tongue with the length of his shaft before pushing his head past your lips and taking him to the hilt. His dick twitches deep in your throat as you hold your position at his base, \
using your tongue to lick at every inch it can reach while he throbs inside you.`
];
} else {
responses = [
setup.fail("strength"),
`You attempt to take his entire length into your mouth, but you gag halfway through, forcing you to retreat and cough to recover.`
];
end_hook = () => {
_t.event_path[_t.event_path.length - 1] *= -1;
};
}
let next_branch = [
responses.concat(suck_event_branch[0]),
suck_event_branch[1]
];
return [next_branch, () => {
end_hook();
$("#mainLogCharacterImage").css("background-image", "url(\"" + char.image_folder() + char.first_name.toLowerCase() + "_" + char.get_disposition() + ".png\")");
}, false, false, false];
},
() => {
let delta = {
"slave_traits": {
"obedience": -10,
"trust": -10,
"willpower": 8
},
"conditions": {
"stamina": -10
}
};
let responses = [
`You deliver the hardest punch you can to his testicles, taking pleasure in the loud yelp he expels.<br>`,
shintani.dialogue(`You bitch! I'll teach you what happens when you disobey me!`),
`Your master yanks you out from the desk by your hair before slapping you hard. He takes your head and forces you to suck his dick, taking you to the hilt whether you like it or not. You choke on \
his cock as he face fucks you for what feels like hours, your spit at least making him easier to take. Eventually, you feel him twitch in your throat as he holds you down and pours his load \
into your stomach. All you can do is swallow for fear of choking on his seed next, and wait for him to finish with you. He soon pulls you off his dick, throwing you to the floor as you make \
incessant coughs.<br>`,
shintani.dialogue(`You have it quite easy in this household, I hope you realize that. Now get out of my sight!`),
player.print_delta(delta),
$(`<ol>
<li id="li1">Done.</li>
</ol>`)
];
return [[responses, [
() => {
return [[
[`You scramble out of your master's office before he assaults you again, trying to recuperate from the unpleasant ordeal.`], null
], () => {
$.wiki("<<include shintaniHomeWorkEngineAfter>>");
}, true, false, false];
}
]], () => {
setup.apply_delta(player, delta);
}, false, false, false];
}
]
];
/* First round disable options */
_t.options = _t.event_tree[0][_t.event_tree[0].length - 1];
$.wiki("<<disableactions _options>>");
/* Register event listeners */
$.wiki("<<include registerEventListeners>>");
/* Start event */
setup.mainLog_append_delayed(_t.event_tree[0], _v.buttons, _v.buttons_extra, 1000, true, null, () => {});
$("#mainLogCharacterImage").css("background-image", "url(\"" + shintani.image_folder() + "shintani_neutral.png\")");
<</script>><<set _prefix = "shintaniHomeEventsWorkSexual">>
<<set _events = [
"FootjobCumFeeding",
"DickSuckingSecretary",
"ForcedOral"
]>>
<<script>>
let _v = State.variables;
let _t = State.temporary;
for (const event of _t.events) {
_v.locations[passage()].data.work_event_pool.push(_t.prefix + event);
}
<</script>><<script>>
let _v = State.variables;
let _t = State.temporary;
let player = _v.player;
let char1 = null;
let char2 = null;
let player_status = player.get_status("nipon");
if (player_status == "low_slave") {
char1 = _v.characters["mei_hironaka"];
char2 = _v.characters["jae_hironaka"];
} else {
char1 = _v.characters["himari_hironaka"];
char2 = _v.characters["mei_hironaka"];
}
let fn1 = setup.titleCase(char1.first_name);
let fn2 = setup.titleCase(char2.first_name);
/* Custom for genders */
let genital = (player.gender == 0) ? "dick" : "pussy";
let cum = (player.gender == 0) ? "cum" : "juice";
/* Predeclare branches for reuse in main event tree */
let drink_event_branch = [
[
`Your body thoroughly spent, ${fn1} and ${fn2} giggle at your fatigue as you catch your breath.`,
char1.dialogue(`Looks like you enjoyed yourself after all.`),
char2.dialogue(`But don't relax yet, we've got another surprise for you.`),
`${fn2} holds out the bowl with your fluids in it, swishing it around as she brings it closer to your face.`,
char2.dialogue(`Open wide. Let us know how it tastes, okay?`),
`As she inches the bowl closer to your lips, you have a choice to make...`,
$(`<ol>\
<li id="li1">Drink it up.</li>\
<li id="li2">Knock the bowl out of ${setup.his(char1)} hands.</li>\
</ol>`)
],
[
() => {
let delta = {
"player": {
"slave_traits": {
"obedience": 5,
"willpower": -5
}
},
"char1": {
"slave_traits": {
"obedience": 3,
"willpower": 3
}
},
"char2": {
"slave_traits": {
"obedience": 3,
"willpower": 3
}
}
};
let boy = "boy";
if (player.gender == 1) {
boy = "girl";
}
let next_branch = [
[
`You allow the bowl to touch your lips, and ${fn2} slowly tips the bowl to pour your ${cum} closer to your mouth. Your seed passes your lips with ease, spilling into your mouth and onto your tongue. \
A wince crosses your face as the salty taste assaults your tongue, but you recover as you quickly swallow your ${cum} by the globule. Gulp after gulp, ${fn2} makes sure you drink it all, \
your virile seed slithering down your throat in waves. After swallowing more semen, you start to wonder how much you actually produced. The process is almost beginning to feel natural \
as you drink up the salty liquid like water. Soon you finish the bowl, bringing smiles to ${fn1} and ${fn2}.<br>`,
char2.dialogue(`Such a good ${boy}, you finished your meal without wasting a drop.`),
char1.dialogue(`From the look on your face, I would almost say you liked it. Did you, you naughty ${boy}?`),
`You refrain from answering as the salty taste still lingers in your mouth.<br>`,
char1.dialogue('Thank you for the exquisite entertainment, your reactions were just as we imagined.'),
player.print_delta(delta.player),
char1.print_delta(delta.char1),
char2.print_delta(delta.char2),
],
null
];
return [next_branch, () => {
setup.apply_delta(player, delta.player);
setup.apply_delta(char1, delta.char1);
setup.apply_delta(char2, delta.char2);
$.wiki("<<include shintaniHomeWorkEngineAfter>>");
}, true, false, false];
},
() => {
let delta = {
"player": {
"slave_traits": {
"obedience": -2,
"willpower": 2,
}
},
"char1": {
"slave_traits": {
"obedience": -2,
"trust": -1,
"min_trust": 0,
}
},
"char2": {
"slave_traits": {
"obedience": -2,
"trust": -1,
"min_trust": 0,
}
}
};
let delta_char1 = setup.apply_delta(char1, delta.char1);
let delta_char2 = setup.apply_delta(char2, delta.char2);
let next_branch = [[
`As the bowl comes close to your mouth, you knock it out of ${fn2}'s hands with your chin, watching it break into pieces on the floor as your fluids spill out.`,
char2.dialogue(`And you were doing so well… I was having so much fun before you ruined it.`),
char1.dialogue(`Very disappointing indeed. It seems you don't know your place very well, do you?`),
char1.dialogue(`Why don't you stay there for the rest of the day to reflect?`),
`The two leave you in your restrained state, the rope still tight around your wrists. After some fiddling, you realize the rope isn't tied as tightly as you thought, and with some time and effort, you manage to break free and return to your room.`,
player.print_delta(delta.player),
char1.print_delta(delta_char1),
char2.print_delta(delta_char2),
], null];
return [next_branch, () => {
setup.apply_delta(player, delta.player);
$.wiki("<<include shintaniHomeWorkEngineAfter>>");
}, true, false, false];
}
]
];
_t.event_path = [];
_t.event_tree = [
[
`Finishing up the last of your tasks, ${fn1} and ${fn2} approach you with sly smiles.`,
char1.dialogue(`You're done with your work, right? Why don't you come with us?`),
char2.dialogue(`We just want to have a little fun with you today.`),
`You follow them into a bedroom where a rope is haphazardly tied to the bed frame and a ceramic bowl sits to the side.`,
char1.dialogue(`Just lie down and let us have our fun. You'll enjoy it, we promise.`),
`You make yourself comfortable on the bed while ${fn2} ties the rope around your wrists and undresses your bottom half. They both take their shoes and socks off as they look down at you hungrily.`,
char1.dialogue(`Now let's see how much you squirm from this.`),
`Both girls begin rubbing their feet against your ${genital},`,
$(`<ol>\
<li id="li1">Endure the situation.</li>
<li id="li2">Hump into the motions of their feet.</li>
<li id="li3">Kick them away.</li>
</ol>`)
],
[
() => {
let responses = [];
if (player.gender == 0) {
responses = [
`You do your best to ignore their taunting words and motions, becoming hard despite your intentional indifference. ${fn1}'s foot glides across your shaft back and forth, forcing a stream of \
precum to leak out of your glans. ${fn2} sits down and uses both of ${setup.his(char2)} feet to play with your constantly shifting balls, massaging them and coaxing out your load with gentle presses.`,
char1.dialogue(`You can pretend not to like it all you want, but your body knows what it wants.`),
char2.dialogue(`Just give up and enjoy yourself. Or don't, either way will be fun for us to watch.`),
`Try as you might to resist the temptation, your body can't help but be honest for your pleasers. You squirm under the scrutiny of their feet slowly and methodically taking care of you. Their \
soft skin teases you over and over until you burst at the height of your pleasure. ${fn2} grabs the bowl and catches all of your seed in it, still grasping your sack in-between ${setup.his(char2)} \
toes as ${fn1} strokes your member to get every last drop from you.`
];
} else {
responses = [
`You do your best to ignore their taunting words and motions, becoming wet despite your intentional indifference. ${fn1}'s foot glides across your sensitive nub back and forth, \
forcing a stream of arousal to leak out of you. ${fn2} sits down and uses both of ${setup.his(char2)} feet to play with your constantly shifting thighs, massaging them and coaxing \
out your pleasure with gentle presses.`,
char1.dialogue(`You can pretend not to like it all you want, but your body knows what it wants.`),
char2.dialogue(`Just give up and enjoy yourself. Or don't, either way will be fun for us to watch.`),
`Try as you might to resist the temptation, your body can't help but be honest for your pleasers. You can only squirm under the scrutiny of their feet slowly and methodically taking care of you. \
Their soft skin teases you over and over until you burst at the height of your pleasure. ${fn1} brings a bowl to your center and catches all of your release in it, still manipulating your sensitive \
folds in-between ${setup.his(char2)} toes as ${fn2} continues to stroke your clit, coaxing every last wave of pleasure from you.`
]
}
let next_branch = [
responses.concat(drink_event_branch[0]),
drink_event_branch[1]
];
return [next_branch, () => {}, false, false, false];
},
() => {
let responses = [];
if (player.gender == 0) {
responses = [
`As their bare feet begin to caress your shaft, your body makes an involuntary thrust along the surface of their soles. Your throbs become more intense as a wall of feet presses against your leaking dick, \
their soft soles gradually surrounding your cock. ${fn1} and ${fn2} use both of their feet to poke, prod, massage, and coax your dick into submission. You're only too happy to give in to their heavenly \
caresses, their toes grasping at your shaft and sack as they almost tickle you from their sheer gentility. Before you lose yourself in the soft pleasure, ${fn1} plants ${setup.his(char1)} feet at either \
side of your member, holding it tight between ${setup.his(char1)} soles.`,
char1.dialogue(`Looks like you're enjoying this more than you thought you would.`),
char1.dialogue(`If you want to enjoy it even more, thrust for me!`),
char2.dialogue(`I can't wait to see what kind of face you make when you cum for our feet…!`),
`Her toes touch your glans ever so slightly, prompting you to thrust between ${setup.his(char1)} plush feet and slide ${setup.his(char1)} toes across your head back and forth in a lusty craze. \
${fn2} prepares the bowl as she eyes your flowing precum running down your shaft and covering ${fn1}'s feet with a translucent, sticky sheen. Naughty squelching sounds resound through the room with each \
wild thrust between ${setup.his(char1)} soft soles, culminating in one final thrust that has you shooting your seed into the air. ${fn2} catches as much of your semen as she can in the bowl, \
accounting for your spasms and gradually putting the bowl closer to your head as your ropes become weaker. You lie in the bed, exhausted as you bask in the cozy sensation of ${fn1} caressing your dick \
for the last drops of your cum.`
];
} else {
responses = [
`As their bare feet begin to caress your sensitive folds, your body makes an involuntary jolt along the surface of their soles. Your shivers become more intense as a duet of feet presses against your \
leaking pussy, their soft soles gradually tracing the curves of your slit. ${fn1} and ${fn2} use both of their feet to poke, prod, massage, and coax your clit into submission. You're only too happy to \
give in to their heavenly caresses, their toes gently exploring your nether regions as they almost tickle you from their sheer gentility. Before you lose yourself in the soft pleasure, ${fn1} plants \
${setup.his(char1)} foot right on your clit, applying a steady pressure.`,
char1.dialogue(`Looks like you're enjoying this more than you thought you would.`),
char1.dialogue(`If you want to enjoy it even more, grind against my foot!`),
char2.dialogue(`I can't wait to see what kind of face you make when you orgasm for our feet…!`),
`The ball of ${setup.his(char)} foot grinds against your clit ever so slightly, prompting you to writhe against ${setup.his(char1)} plush foot, back and forth in a lusty craze. ${fn2} readies the bowl as she \
eyes the juices that are already starting to coat ${fn1}'s foot, leaving a translucent, sticky sheen. The room fills with the sounds of your moans and the wet squelching noises as your juices coat \
${setup.his(char1)} foot, culminating in a final grind that has you squirting in release. ${fn2} deftly positions the bowl, catching as much of your squirt as she can, accounting for your spasms \
and gradually putting the bowl closer as your squirts become weaker. You lie in the bed, exhausted as you bask in the cozy sensation of ${fn1} tracing the last traces of your climax with \
${setup.his(char1)} toes.`
];
}
let next_branch = [
responses.concat(drink_event_branch[0]),
drink_event_branch[1]
];
return [next_branch, () => {}, false, false, false];
},
() => {
let delta = {
"player": {
"slave_traits": {
"obedience": -3,
"willpower": 3,
}
},
"char1": {
"slave_traits": {
"obedience": -3,
"trust": -1,
"min_trust": 0,
}
},
"char2": {
"slave_traits": {
"obedience": -3,
"trust": -1,
"min_trust": 0,
}
}
};
let delta_char1 = setup.apply_delta(char1, delta.char1);
let delta_char2 = setup.apply_delta(char2, delta.char2);
let next_branch = [
[
`You kick their feet away with haste, resisting any attempts to lay their feet on you.`,
char1.dialogue(`Why won't you just behave?!`),
char2.dialogue(`Can't even let us have our fun, huh?`),
`${fn2} tries to restrain your legs, but you won't have it. In your raucous flailing and resisting, you knock the bowl off of the bed and hear it crash on the floor.`,
char1.dialogue(`You wretch! Look what you did!`),
char1.dialogue(`Never mind, then. Let's see how you like being tied up there for the rest of the day instead!`),
char2.dialogue(`What an unbelievable mess you made… What am I going to tell the master?`),
`The two leave you in your restrained state, the rope still tight around your wrists.`,
`After some fiddling, you realize the rope isn't tied as tightly as you thought, and with some time and effort, you manage to break free and return to your room.`,
player.print_delta(delta.player),
char1.print_delta(delta_char1),
char2.print_delta(delta_char2),
]
];
return [next_branch, () => {
setup.apply_delta(player, delta.player);
$.wiki("<<include shintaniHomeWorkEngineAfter>>");
}, true, false, false];
}
]
];
/* First round disable options */
_t.options = _t.event_tree[0][_t.event_tree[0].length - 1];
$.wiki("<<disableactions _options>>");
/* Register event listeners */
$.wiki("<<include registerEventListeners>>");
/* Start event */
setup.mainLog_append_delayed(_t.event_tree[0], _v.buttons, _v.buttons_extra, 1000, true, null, () => {});
$("#mainLogCharacterImage").css("background-image", "url(\"" + char1.image_folder() + char1.first_name.toLowerCase() + "_" + char1.get_disposition() + ".png\")");
<</script>><<set _char = $characters.himari_hironaka>>
<<set _disposition = _char.get_disposition()>>
<<script>>
let char = State.temporary.char;
var div = $("<div></div>");
div.html(
`As you go about your duties, you see ${setup.titleCase(char.first_name)} beckon you over.<br>\
${char.dialogue(`I've been distracted all day due to my desires. Come relieve me with your mouth so I can focus on my work.`)}
She removes her lower clothing and gives you a pointed look. She expects the best out of you, and you…
<ol>\
<li id="li1">Dutifully eat her out.</li>
<li id="li2">Rush it to get it over with.</li>
<li id="li3">Bite her pussy.</li>
</ol>`);
setup.mainLog_append(div);
$("#mainLogCharacterImage").css("background-image", "url(\"" + char.image_folder() + char.first_name.toLowerCase() + "_" + char.get_disposition() + ".png\")");
<</script>>
<<set _choices = 3>>
<<disableactions>>
<<silently>><<repeat 10ms>>
<<if _action !== undefined>>
<<switch _action>>
<<case 1>>
<<set _delta = {
"char": {
"slave_traits": {
"obedience": 1,
"trust": 1
}
},
"player": {
"slave_traits": {
"obedience": 1,
"willpower": -2
}
}
}>>
<<run _true_char_delta = setup.apply_delta(_char, _delta.char)>>
<<run _true_player_delta = setup.apply_delta($player, _delta.player)>>
<<set $_temp_to_log = `You maneuver your tongue between her folds as best you can, listening to her moans until she eventually reaches orgasm.<br>\
${_char.dialogue("You maneuver your tongue between her folds as best you can, listening to her moans until she eventually reaches orgasm.")}
${$player.print_delta(_delta.player)} ${_char.print_delta(_delta.char)}
`>>
<<case 2>>
<<if _disposition == "submissive" || _disposition == "devoted" || _disposition == "scared">>
<<set _delta = {
"char": {
"slave_traits": {
"obedience": 1,
"willpower": -1
}
},
"player": {
"slave_traits": {
"obedience": 0.5,
"willpower": 2
}
}
}>>
<<set $_temp_to_log = `You race her to orgasm with as much intensity as you can muster.<br>
${_char.dialogue("T-That was amazing… I hope we can do this again...")}`>>
<<elseif _disposition == "hateful" || _disposition == "cold">>
<<set _delta = {
"char": {
"slave_traits": {
"obedience": -1,
"trust": -1
}
},
"player": {
"slave_traits": {
"obedience": -1,
"willpower": 0.5
}
}
}>>
<<set $_temp_to_log = `You race her to orgasm with as much intensity as you can muster.<br>
${_char.dialogue("What a pitiful attempt, at least act like you’re trying next time.")}`>>
<<else>>
<<set _delta = {
"char": {
"slave_traits": {
"obedience": 0.5,
"willpower": 1
}
},
"player": {
"slave_traits": {
"obedience": 0.5,
"willpower": 1
}
}
}>>
<<set $_temp_to_log = `You race her to orgasm with as much intensity as you can muster.<br>
${_char.dialogue("Well, you did what was asked of you, I guess.")}`>>
<</if>>
<<run _true_char_delta = setup.apply_delta(_char, _delta.char)>>
<<run _true_player_delta = setup.apply_delta($player, _delta.player)>>
<<set $_temp_to_log += `${$player.print_delta(_delta.player)} ${_char.print_delta(_delta.char)}`>>
<<case 3>>
<<set _delta = {
"char": {
"slave_traits": {
"obedience": -3,
"trust": -1,
"willpower": -1
}
},
"player": {
"slave_traits": {
"obedience": -2,
"willpower": 2
}
}
}>>
<<run _true_char_delta = setup.apply_delta(_char, _delta.char)>>
<<run _true_player_delta = setup.apply_delta($player, _delta.player)>>
<<set $_temp_to_log = `You take the folds of her pussy in-between your teeth and hear her yelp in pain.<br>
${_char.dialogue("Ow! What the hell is wrong with you?!")}
${$player.print_delta(_delta.player)} ${_char.print_delta(_delta.char)}`>>
<</switch>>
<<unset _action>>
<<unset _success>>
<<include shintaniHomeWorkEngineAfter>>
<</if>>
<</repeat>><</silently>>/* Initial setup, declare characters in the scene. We'll pick a random slave for now. */
<<set _char = $characters[either($characters.shintani_hiroyuki.slaves)]>>
/* Bool to tell if the player is a higher status than the character */
<<set _higher_status = ($player.get_status("nipon") == "slave" && _char.status == "low_slave") ||
($player.get_status("nipon") == "high_slave" && _char.status == "slave") ||
($player.get_status("nipon") == "high_slave" && _char.status == "low_slave")>>
/* For eventual rounding and simulation */
<<set _to_round = _char.key>>
<<set $to_simulate.add(_char.key)>>
/* Initial writing setup */
<<set _to_log = [
"This is initialization text that will appear",
"Having this as an array will delay the appending to the main log",
_char.dialogue("I can talk like this."),
]>>
/* Options for the player to partake in */
<<set _options = "\
<ol>\
<li id=\"li1\">Action 1.</li>\
<li id=\"li2\">Action 2.</li>\
<li id=\"li3\">Action 3.</li>\
<li id=\"li4\">Leave.</li>\
</ol>\
">>
/* Append the options onto the log */
<<set _to_log[2] += _options>>
/* Make the options into a jquery for ease of access */
<<set _options = $(_options)>>
/* Disable the back and leave button (can't escape events) */
<<set _disable_buttons = true>>
/* Disable the buttons that don't correspond to an action */
<<disableactions _options>>
/* Append the _to_log onto the log for the player to see */
<<run setup.mainLog_append_delayed(_to_log, $buttons, $buttons_extra)>>
/* Listener for the player to click */
<<silently>><<repeat 10ms>>
<<if _action !== undefined>>
<<switch _action>>
<<case 1>>
<<set _responses = [
"Here are some responses",
_char.dialogue("Hello world."),
_options.clone()
]>>
<<run _button_fn()>>
<<case 2>>
/* First apply the changes */
<<set _delta = {
"stats": {
"dexterity": 0.9
},
"slave_traits": {
"obedience": -1,
"trust": 2
}
}>>
<<set _true_delta = setup.apply_delta($player, _delta)>>
<<set _responses = [
"This is how you print changes " + $player.print_delta(_true_delta) + ".",
"You should also see these changes on the bars.",
_options.clone()
]>>
<<include round>>
<<run _button_fn()>>
<<case 3>>
/* Cross out the option */
<<set _options.find("#li3").css("text-decoration", "line-through")>>
/* Disable leave and back button (have to do this everytime you call disableactions) */
<<set _disable_buttons = true>>
/* Disable the actions */
<<disableactions _options>>
/* Include cloned action in responses */
<<set _responses = [
"This is how you let an action only be called once.",
_options.clone()
]>>
<<run _button_fn()>>
<<case 4>>
<<set $_temp_to_log = "This is ending text. You can put summary of what happened here.">>
<<include shintaniHomeWorkEngineAfter>>
<</switch>>
<</if>>
<</repeat>><</silently>>
/* Temporary function for what happens when you click a button */
<<script>>
State.temporary.button_fn = () => {
let _t = State.temporary;
let _v = State.variables;
delete _t.action;
if (_t.responses != null) {
setup.mainLog_append_delayed(_t.responses, _v.buttons, _v.buttons_extra);
delete _t.responses;
}
}
<</script>><<nobr>>
<div id="interact_actions" class="action container row col hidden"
style="--rows: 4; --cols: 5">
/* Fill up 5th column to prevent overflow */
<div style="grid-row: 1; grid-column: 5">
<<button "Inspect">>
<<if $characters[$selected].is_slave && $player.is_slave>>
<<set $selection_queue = []>>
<<for _idx, _slave range $characters.shintani_hiroyuki.slaves>>
<<set $selection_queue.push(_slave)>>
<</for>>
<<for _idx, _slave range $player.slaves>>
<<set $selection_queue.push(_slave)>>
<</for>>
<</if>>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto characterMenu>>
<</button>>
</div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<script>>
$("#interact_actions").addClass("hidden");
$("#interact_options").removeClass("hidden");
$("#mainLogImage").css("background-image", "url(\"resources/images/places/shintaniHomeDayImage.png\")");
$("#mainLogCharacterImage").css("background-image", "none");
$("#mainLog").html("");
$("#mainLog").wiki("<b><<= setup.titleCase(setup.locations.get(passage()).name)>>:</b><br>");
$("#mainLog").wiki(State.variables._to_log);
$("#char_quick_info").empty();
<</script>>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "shintaniHome">>
<<include locationButton>>
</div>
<<button "Ask">>
<<set _ask_passage = "shintaniHomeEventsInteract" +
setup.titleCase($characters[$selected].first_name) +
"Ask">>
<<if tale.has(_ask_passage)>>
<<include _ask_passage>>
<<else>>
<<include "defaultAsk">>
<</if>>
<<script>>
$("#interact_actions").addClass("hidden");
$("#events_actions").removeClass("hidden");
<</script>>
<<set _back_action = "#interact_actions">>
<</button>>
<<button "Influence">>
<<if $selected == "shintani_hiroyuki">>
<<set _request_passage = "shintaniHomeEventsInteract" +
setup.titleCase($characters[$selected].first_name) +
"Influence">>
<<if tale.has(_request_passage)>>
<<include _request_passage>>
<<else>>
<<notify>>Cannot influence Shintani<</notify>>
<</if>>
<<else>>
<<include influenceEngine>>
<<addclass "#interact_actions" "hidden">>
<<removeclass "#events_actions" "hidden">>
<<set _back_action = "#interact_actions">>
<</if>>
<</button>>
<<button "Gift">>
<<if $characters[$selected].limits.gift gt 0>>
<<addclass "#interact_actions" "hidden">>
<<run $("#action_bar").wiki("<<include giftEngineActions>>")>>
<<set _back_action = "#interact_actions">>
<<else>>
<<notify>>
Already gave <<= setup.titleCase(_char.first_name)>> a gift today!
<</notify>>
<</if>>
<</button>>
<<button "Sex">>
<<if $selected == "shintani_hiroyuki">>
<<set _request_passage = "shintaniHomeEventsInteract" +
setup.titleCase($characters[$selected].first_name) +
"Influence">>
<<if tale.has(_request_passage)>>
<<include _request_passage>>
<<else>>
<<notify>>Under construction!<</notify>>
<</if>>
<<else>>
<<if $characters[$selected].limits.fuck gt 0>>
<<include sexEngine2>>
<<addclass "#info" "hidden">>
<<addclass "#interact_actions" "hidden">>
<<set _back_action = "#interact_actions">>
<<else>>
<<notify>>
Already had sex with <<= setup.titleCase(_char.first_name)>>
today!
<</notify>>
<</if>>
<</if>>
<</button>>
</div>
<</nobr>><<nobr>>
/* For engines */
<div id="interact_asleep_actions" class="action container row col hidden"
style="--rows: 4; --cols: 5">
/* Fill up 5th column to prevent overflow */
<div style="grid-row: 1; grid-column: 5">
<<button "Inspect">>
<<if $characters[$selected].is_slave>>
<<if $player.is_slave>>
<<set $selection_queue = []>>
<<for _idx, _slave range $characters.shintani_hiroyuki.slaves>>
<<set $selection_queue.push(_slave)>>
<</for>>
<<for _idx, _slave range $player.slaves>>
<<set $selection_queue.push(_slave)>>
<</for>>
<</if>>
<</if>>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto characterMenu>>
<</button>>
</div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Back">>
<<set _location_button_dest = "shintaniHome">>
<<set _location_button_dur = 2>>
<<include locationButton>>
</div>
<<button "Search">>
<<set _modifier = (_char.is_slave ? 20 : 0)>>
<<if $player.get_status_prop("willpower") gt 50 + _modifier>>
<<if _char.limits.search gt 0>>
<<include searchEngine>>
<<else>>
<<notify>>
Already searched <<= setup.titleCase(_char.first_name)>>
today!
<</notify>>
<</if>>
<<else>>
<<set _to_notify = "Your willpower is too low!">>
<<notify>>_to_notify<</notify>>
<</if>>
<<unset _modifier>>
<</button>>
<<button "Molest">>
<<set _modifier = (_char.is_slave ? 0 : 10)>>
<<if $player.get_status_prop("willpower") gt 60 + _modifier>>
<<if _char.key == "shintani_hiroyuki">>
<<notify>>You don't like the idea of courting death.<</notify>>
<<elseif _char.limits.molest gt 0>>
<<include molestEngine>>
<<addclass "#interact_asleep_actions" "hidden">>
<<addclass "#info" "hidden">>
<<else>>
<<notify>>
Already molested <<= setup.titleCase(_char.first_name)>>
today!
<</notify>>
<</if>>
<<else>>
<<set _to_notify = "Your willpower is too low!">>
<<notify>>_to_notify<</notify>>
<</if>>
<<unset _modifier>>
<</button>>
</div>
<</nobr>><div id="interact_options" class="action container row col hidden"
style="--rows: 4; --cols: 5">
<div style="grid-row: 4; grid-column: 5">
<<button "Back">>
<<script>>
$("#interact_options").addClass("hidden");
$("#actions").removeClass("hidden");
<</script>>
<</button>>
</div>
/* Fill up 5th column to prevent overflow */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 3; grid-column: 5"></div>
<<if $locations.nipon.data.owner == "shintani_hiroyuki">>
<div style="grid-row: 1; grid-column: 1">
<<button "Shintani">>
<<set $selected = "shintani_hiroyuki">>
<<set _char = $characters[$selected]>>
<<script>>
$("#interact_options").addClass("hidden");
var div = $("<div></div>");
var char = State.variables.characters.shintani_hiroyuki;
var gameDate = State.variables.gameDate;
if (gameDate.getHours() <= 5 || gameDate.getHours() >= 22) {
var str = "
You make your way over to Shintani\'s quarters to find him \
peacefully asleep.<br>\
";
if (char.mental_conditions.suspicion > 0) {
str += "<span class=\"fail\">(" + setup.titleCase(char.first_name) +
" will be harder to steal from or molest since they are suspicious)</span>"
}
div.html(str);
$("#interact_asleep_actions").removeClass("hidden");
$("#mainLogImage").css("background-image",
"url(\"resources/images/places/shintaniHomeShintaniNightImage.png\")"
);
} else {
div.html("
You approach Shintani in his office.<br>"
);
$("#interact_actions").removeClass("hidden");
$("#mainLogImage").css("background-image",
"url(\"resources/images/places/shintaniHomeOfficeImage.png\")"
);
$("#mainLogCharacterImage").css("background-image",
"url(\"" + char.image_folder() +
char.first_name.toLowerCase() + "_neutral.png\")"
);
}
setup.mainLog_append(div);
$("#char_quick_info").empty();
$("#char_quick_info").html(`<b>${setup.titleCase(char.first_name)}'s Disposition: </b>` + setup.titleCase(char.get_disposition()));
<</script>>
<<addmins `dice(1, 5) + 5`>>
<<audio "wooden_door_sound" play>>
<</button>>
</div>
<<set _iter = $characters.shintani_hiroyuki.slaves>>
<<for _i = 0; _i lt _iter.length; _i++>>
<div>
<<capture _i>>
<<button `setup.titleCase($characters[_iter[_i]].first_name)`>>
<<set $selected = _iter[_i]>>
<<set _char = $characters[$selected]>>
<<if _char.assignment != "none" && "times" in setup.assignments[_char.assignment] &&
setup.in_range($gameDate.getHours(), setup.assignments[_char.assignment].times)>>
<<notify>><<= setup.titleCase(_char.first_name)>> is currently out on assignment.<</notify>>
<<else>>
<<script>>
var char = State.variables.characters[State.variables.selected];
$("#interact_options").addClass("hidden");
var div = $("<div></div>");
var gameDate = State.variables.gameDate;
if (gameDate.getHours() <= 5 || gameDate.getHours() >= 22) {
var str = "
You make your way over to " + char.name() + "\'s room to find " +
setup.him(char) + " peacefully asleep.<br>\
";
if (char.mental_conditions.suspicion > 0) {
str += "<span class=\"fail\">(" + setup.titleCase(char.first_name) +
" will be harder to steal from or molest since they are suspicious)</span>"
}
div.html(str);
$("#interact_asleep_actions").removeClass("hidden");
$("#mainLogImage").css("background-image",
"url(\"resources/images/places/shintaniHome" +
setup.titleCase(char.first_name)
+ "NightImage.png\")"
);
State.temporary.play_sound = true;
} else {
if (char.assignment == "confinement") {
div.html("
You enter " + char.name() + "\'s confinement cell and approach " +
setup.him(char) + " huddling in the corner.<br>" + char.toString()
);
} else {
div.html("
You spot " + char.name() + " working and approach " + setup.him(char) +
".<br>" + char.toString()
);
}
$("#interact_actions").removeClass("hidden");
$("#mainLogImage").css("background-image",
"url(\"resources/images/places/shintaniHome" +
setup.titleCase(char.first_name)
+ "DayImage.png\")"
);
$("#mainLogCharacterImage").css("background-image",
"url(\"" + char.image_folder() +
char.first_name.toLowerCase() + "_" +
char.get_disposition() + ".png\")"
);
State.temporary.play_sound = false;
}
setup.mainLog_append(div);
$("#char_quick_info").empty();
$("#char_quick_info").html(`<b>${setup.titleCase(char.first_name)}'s Disposition: </b>` + setup.titleCase(char.get_disposition()));
<</script>>
/* Forward time by 5 - 10 minutes */
<<addmins `dice(1, 5) + 5`>>
<<if _play_sound>>
<<audio "wooden_door_sound" play>>
<</if>>
<<unset _play_sound>>
<</if>>
<</button>>
<</capture>>
</div>
<</for>>
<<else>>
<div style="grid-row: 1; grid-column: 1">
<<button "Lia">>
<<set $selected = "lia_hiroyuki">>
<<set _char = $characters[$selected]>>
<<script>>
$("#interact_options").addClass("hidden");
var div = $("<div></div>");
var char = State.temporary.char;
var gameDate = State.variables.gameDate;
if (gameDate.getHours() <= 5 || gameDate.getHours() >= 22) {
var str = "
You make your way over to Lia\'s quarters to find her \
peacefully asleep.<br>\
";
if (char.mental_conditions.suspicion > 0) {
str += "<span class=\"fail\">(" + setup.titleCase(char.first_name) +
" will be harder to steal from or molest since they are suspicious)</span>"
}
div.html(str);
$("#interact_asleep_actions").removeClass("hidden");
$("#mainLogImage").css("background-image",
"url(\"resources/images/places/shintaniHomeShintaniNightImage.png\")"
);
} else {
div.html("
You approach Lia in her office.<br>"
);
$("#interact_actions").removeClass("hidden");
$("#mainLogImage").css("background-image",
"url(\"resources/images/places/shintaniHomeOfficeImage.png\")"
);
$("#mainLogCharacterImage").css("background-image",
"url(\"" + char.image_folder() + "niponTradeUnion_lia_neutral.png\")"
);
}
setup.mainLog_append(div);
$("#char_quick_info").empty();
$("#char_quick_info").html(`<b>${setup.titleCase(char.first_name)}'s Disposition: </b>` + setup.titleCase(char.get_disposition()));
<</script>>
<<addmins `dice(1, 5) + 5`>>
<<audio "wooden_door_sound" play>>
<</button>>
</div>
<<if $locations.shintaniHome.data.residents == null>>
<<set $locations.shintaniHome.data.residents = []>>
<</if>>
<<set _iter = $locations.shintaniHome.data.residents>>
<<for _i = 0; _i lt _iter.length; _i++>>
<div>
<<capture _i>>
<<button `setup.titleCase($characters[_iter[_i]].first_name)`>>
<<set $selected = _iter[_i]>>
<<set _char = $characters[$selected]>>
<<if _char.assignment != "none" && "times" in setup.assignments[_char.assignment] &&
setup.in_range($gameDate.getHours(), setup.assignments[_char.assignment].times)>>
<<notify>><<= setup.titleCase(_char.first_name)>> is currently busy.<</notify>>
<<else>>
<<script>>
var char = State.variables.characters[State.variables.selected];
$("#interact_options").addClass("hidden");
var div = $("<div></div>");
var gameDate = State.variables.gameDate;
if (gameDate.getHours() <= 5 || gameDate.getHours() >= 22) {
var str = "
You make your way over to " + char.name() + "\'s room to find " +
setup.him(char) + " peacefully asleep.<br>\
";
if (char.mental_conditions.suspicion > 0) {
str += "<span class=\"fail\">(" + setup.titleCase(char.first_name) +
" will be harder to steal from or molest since they are suspicious)</span>"
}
div.html(str);
$("#interact_asleep_actions").removeClass("hidden");
$("#mainLogImage").css("background-image",
"url(\"resources/images/places/shintaniHome" +
setup.titleCase(char.first_name)
+ "NightImage.png\")"
);
State.temporary.play_sound = true;
} else {
if (char.assignment == "confinement") {
div.html("
You enter " + char.name() + "\'s confinement cell and approach " +
setup.him(char) + " huddling in the corner.<br>" + char.toString()
);
} else {
div.html("
You spot " + char.name() + " working and approach " + setup.him(char) +
".<br>" + char.toString()
);
}
$("#interact_actions").removeClass("hidden");
$("#mainLogImage").css("background-image",
"url(\"resources/images/places/shintaniHome" +
setup.titleCase(char.first_name)
+ "DayImage.png\")"
);
$("#mainLogCharacterImage").css("background-image",
"url(\"" + char.image_folder() +
char.first_name.toLowerCase() + "_" +
char.get_disposition() + ".png\")"
);
State.temporary.play_sound = false;
}
$("#char_quick_info").empty();
$("#char_quick_info").html(`<b>${setup.titleCase(char.first_name)}'s Disposition: </b>` + setup.titleCase(char.get_disposition()));
setup.mainLog_append(div);
<</script>>
/* Forward time by 5 - 10 minutes */
<<addmins `dice(1, 5) + 5`>>
<<if _play_sound>>
<<audio "wooden_door_sound" play>>
<</if>>
<<unset _play_sound>>
<</if>>
<</button>>
<</capture>>
</div>
<</for>>
<</if>>
/* Player slaves */
<<if $player.is_slave>>
<<set _iter2 = $player.slaves>>
<<for _i = 0; _i lt _iter2.length; _i++>>
<div>
<<capture _i>>
<<button `setup.titleCase($characters[_iter2[_i]].first_name)`>>
<<set $selected = _iter2[_i]>>
<<set _char = $characters[$selected]>>
<<if _char.assignment != "none" && "times" in setup.assignments[_char.assignment] &&
setup.in_range($gameDate.getHours(), setup.assignments[_char.assignment].times)>>
<<notify>><<= setup.titleCase(_char.first_name)>> is currently out on assignment.<</notify>>
<<else>>
<<script>>
var char = State.variables.characters[State.variables.selected];
$("#interact_options").addClass("hidden");
var div = $("<div></div>");
var gameDate = State.variables.gameDate;
if (gameDate.getHours() <= 5 || gameDate.getHours() >= 22) {
var str = "
You make your way over to " + char.name() + "\'s room to find " +
setup.him(char) + " peacefully asleep.<br>\
";
if (char.mental_conditions.suspicion > 0) {
str += "<span class=\"fail\">(" + setup.titleCase(char.first_name) +
" will be harder to steal from or molest since they are suspicious)</span>"
}
div.html(str);
$("#interact_asleep_actions").removeClass("hidden");
$("#mainLogImage").css("background-image",
"url(\"resources/images/places/shintaniHome" +
setup.titleCase(char.first_name)
+ "NightImage.png\")"
);
State.temporary.play_sound = true;
} else {
if (char.assignment == "confinement") {
div.html("
You enter " + char.name() + "\'s confinement cell and approach " +
setup.him(char) + " huddling in the corner.<br>" + char.toString()
);
} else {
div.html("
You spot " + char.name() + " working and approach " + setup.him(char) +
".<br>" + char.toString()
);
}
$("#interact_actions").removeClass("hidden");
State.temporary.play_sound = false;
}
$("#char_quick_info").empty();
$("#char_quick_info").html(`<b>${setup.titleCase(char.first_name)}'s Disposition: </b>` + setup.titleCase(char.get_disposition()));
setup.mainLog_append(div);
<</script>>
/* Forward time by 5 - 10 minutes */
<<addmins `dice(1, 5) + 5`>>
<<if _play_sound>>
<<audio "wooden_door_sound" play>>
<</if>>
<<unset _play_sound>>
<</if>>
<</button>>
<</capture>>
</div>
<</for>>
<</if>>
</div><<nobr>>
<div id="actions" class="action container row col"
style="--rows: 4; --cols: 5">
<<button "Books">>
<<removeclass "#mainLogActionBar" "hidden">>
<<addclass "#mainLogImage" "hidden">>
<<addclass "#mainLogCharacterImage" "hidden">>
<<removeclass "#books_actions" "hidden">>
<<addclass "#actions" "hidden">>
<<run $("#info_title").html("Read in the Hiroyuki Library")>>
<<set _default_info = $("<div>\
<div id=\"normal_study\">\
The environment of the Hiroyuki library provides a good place to study some books. \
<ul>\
<li id=\"li1\">You can read (education + intelligence / 3) words per minute in the lost tongues.</li>\
</ul></div>\
</div>")>>
<<run $("#infoLogBody").html("")>>
<<run $("#infoLogBody").append(_default_info.clone())>>
<<removeclass "#infoLog" "hidden">>
<<addclass "#mainLog" "hidden">>
<<script>>
$("#mainLogActionBar button").removeClass("disabled");
$("#mainLogActionBar button").prop("disabled", false);
$(".read button").addClass("disabled");
$(".read button").prop("disabled", true);
$("#readStart button").addClass("disabled");
$("#readStart button").prop("disabled", true);
<</script>>
<</button>>
<<button "Study">>
<<run $("#info_title").html("Study in the Hiroyuki Library")>>
<<set _default_info = $("<div>\
<div id=\"normal_study\">\
The shelves in the Hiroyuki library are stuffed to the brim with knowledge \
just waiting to be learned.\
<ul id=\"change_list\">\
<li id=\"li1\">3% per hour chance to gain intelligence (capped at 40).</li>\
<li id=\"li2\" class=\"hidden\"></li>\
<li id=\"li3\" class=\"hidden\"></li>\
</ul></div>\
<div id=\"subject_study\">\
You could also expend some extra effort to focus on a specific topic if you\'d like.\
<ul>\
<li id=\"li4\">(intelligence/20)% per hour chance to increase subject stat.</li>\
<li id=\"li5\">-3 additional stamina per hour.</li>\
</ul></div>\
</div>")>>
<<run $("#infoLogBody").html("")>>
<<run $("#infoLogBody").append(_default_info.clone())>>
<<removeclass "#study_actions" "hidden">>
<<addclass "#actions" "hidden">>
<<removeclass "#infoLog" "hidden">>
<<addclass "#mainLog" "hidden">>
/* Reset study buttons */
<<script>>
$(".study button").removeClass("disabled");
$(".study button").prop("disabled", false);
$(".study_option button").addClass("disabled");
$(".study_option button").prop("disabled", true);
$("#studyStart button").addClass("disabled");
$("#studyStart button").prop("disabled", true);
<</script>>
<</button>>
<<button "Search" `passage()`>>
<<if $quests.power_struggles.stage == 3>>
<<set $_temp_to_log = "You searched the library for an hour and found a tattered old book with \
the symbol that Lia showed you. ">>
<<if $player.titles.has("lost_knowledge")>>
<<set $_temp_to_log += "As you openned the book you were immediately greated with what you \
recognized as a \"lost tongue\", specifically an eastern variety. It seems the book \
describes the different births and deaths spanning since the beginning of time at year 0. ">>
<<else>>
<<set $_temp_to_log += "As you openned the book you were immediately greated with cryptic \
symbols that did not resemble any writing system you\'ve ever seen. ">>
<</if>>
<<set $_temp_to_log += "On the inside of the cover you see another symbol that looks extremely familiar.">>
<<set $_temp_to_log += "<br><span class=\"success\">(Acquired Hiroyuki Family Registry)</span>">>
<<set $quests.power_struggles.stage = 4>>
<<run UInv.AddItem("inventory", "hiroyuki_book", 1)>>
<<elseif $quests.knowledge_is_power.stage == 2 || $quests.knowledge_is_power.stage == 3>>
<<if $player.titles.has("lost_knowledge")>>
<<set $_temp_to_log = "After searching the library for an hour, you were about to give \
up until you find a book with a pitch black cover. Etched into the leather binding are \
runes and symbols that you recognize from the lost tongues. You didn\'t think this \
knowledge would ever come to use, but perhaps it might just be your saving grace.">>
<<set $_temp_to_log += "<br><span class=\"success\">(Acquired <em>Heart of Darkness</em>)</span>">>
<<run UInv.AddItem("inventory", "heart_of_darkness")>>
<<set $quests.knowledge_is_power.stage = 5>>
<<else>>
<<set $_temp_to_log = "You searched the library for an hour but only found either unimportant \
documents or scrolls with cryptic symbols on them. Perhaps you might be able to find \
someone who could decipher them.">>
<<set $quests.knowledge_is_power.stage = 3>>
/* TODO: Remove */
<<notify>>
There is currently no way to do this quest without Lost Knowledge. Please wait for future updates!
<</notify>>
<</if>>
<<else>>
<<set $_temp_to_log = "You searched the library for an hour but do not find anything of note.">>
<</if>>
<<addhours 1>>
<</button>>
<div style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Back">>
<<set _location_button_dest = "shintaniHome">>
<<set _location_button_dur = 2>>
<<include locationButton>>
</div>
</div>
<</nobr>><<nobr>>
<div id="books_actions" class="action container row col fiveQuarters smalltext longbutton hidden"
style="--rows: 4; --cols: 4">
/* How long we want to read for */
<div style="grid-row: 1; grid-column: 1">
@@#read1Hr;.read;<<button "1 Hour">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 2">
@@#read4Hr;.read;<<button "4 Hours">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 4">
<<disable>>
@@#booksStart;<<button "Start">>
<<include shintaniHomeLibraryBooksEngine>>
<</button>>@@
<</disable>>
</div>
<div style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<addclass "#mainLogActionBar" "hidden">>
<<removeclass "#mainLogImage" "hidden">>
<<removeclass "#mainLogCharacterImage" "hidden">>
<<addclass "#books_actions" "hidden">>
<<removeclass "#actions" "hidden">>
<<addclass "#infoLog" "hidden">>
<<removeclass "#mainLog" "hidden">>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "shintaniHome">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<timed 50ms>><<script>>
let player = State.variables.player;
let books = UInv.GetItemsArrayByItemTag("inventory", "type", "book");
$("#mainLogActionBar").wiki("<hr>");
let avail = false;
for (let i = 0; i < books.length; i++) {
if (player.books[books[i]] < 1) {
$("#mainLogActionBar").wiki(
"<<button \'" + setup.titleCase(UInv.GetItemPropertyValue("inventory", books[i], "name")) + "\'>>\
<<set _selected_book = \'" + books[i] + "\'>>\
<</button>>"
);
avail = true;
}
}
if (!avail) {
$("#mainLogActionBar").wiki("<center>No unread books.</center>");
}
$("#mainLogActionBar").wiki("<hr><center id=\'completed_title\'><b class=\'tool\'>Completed</b></center>");
$("#mainLogActionBar").wiki("<div id=\'completed_books\' style=\'padding-top: 10px\'></div>");
for (let i = 0; i < books.length; i++) {
if (player.books[books[i]] == 1) {
$("#mainLogActionBar #completed_books").wiki(
"<<button \'" + setup.titleCase(UInv.GetItemPropertyValue("inventory", books[i], "name")) + "\'>>\
<<set _selected_book = \'" + books[i] + "\'>>\
<</button>>"
);
}
}
$("#mainLogActionBar #completed_title").on("click", (event) => {
$("#mainLogActionBar #completed_books").fadeToggle(0.1);
});
$("#mainLogActionBar button").on("click", (event) => {
let _t = State.temporary;
let _v = State.variables;
let player = _v.player;
$("#mainLogActionBar button").removeClass("disabled");
$("#mainLogActionBar button").prop("disabled", false);
$("#booksStart button").addClass("disabled");
$("#booksStart button").prop("disabled", true);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
$("#info_title").html(setup.books[_t.selected_book].name);
if (player.books[_t.selected_book] != 1) {
_t.book_info = $("<div>\
<div>You examine <em>" + setup.books[_t.selected_book].title + "</em> by " + setup.books[_t.selected_book].author +
" to see that it is around " + setup.books[_t.selected_book].word_count + " words. You\'ve currently read " +
setup.round2(100 * player.books[_t.selected_book]) + "% of this book.\
<ul>\
<li id=\"li1\">You can read " + parseInt(player.skills.education + player.stats.intelligence / 3) + " words per minute.</li>\
<li id=\"li2\">There are " + parseInt((1 - player.books[_t.selected_book]) * setup.books[_t.selected_book].word_count) +
" words left in the book.</li>\
</ul></div>\
</div>");
$(".read button").removeClass("disabled");
$(".read button").prop("disabled", false);
} else {
_t.book_info = $("<div>You recall the experience you had when you finished <em>" + setup.books[_t.selected_book].title + "</em>." +
"<br>...<br>" + setup.books[_t.selected_book].completion_text + "</div>");
$(".read button").addClass("disabled");
$(".read button").prop("disabled", true);
}
$("#infoLogBody").html("");
$("#infoLogBody").append(_t.book_info.clone());
});
$(".read button").on("click", (event) => {
let _t = State.temporary;
let _v = State.variables;
let player = _v.player;
$(".read button").removeClass("disabled");
$(".read button").prop("disabled", false);
$("#booksStart button").addClass("disabled");
$("#booksStart button").prop("disabled", true);
let self = $(event.currentTarget);
let read_time = parseInt(setup.numerize(self.html()));
State.temporary.to_advance_hr = read_time;
if (Math.abs(setup.project_stamina_change(60 * read_time)) < player.conditions.stamina) {
self.addClass("disabled");
self.prop("disabled", true);
$("#booksStart button").removeClass("disabled");
$("#booksStart button").prop("disabled", false);
_t.words_read = parseInt(player.skills.education + player.stats.intelligence / 3) * 60 * read_time;
$("#infoLogBody").find("#li1").html("You will read " + _t.words_read + " words.");
} else {
let str = "<<notify>>You are too tired to read " + read_time + " ";
if (read_time == 1) {
str += "hour.";
} else {
str += "hours.";
}
str += "<</notify>>";
$.wiki(str);
$("#booksStart button").addClass("disabled");
$("#booksStart button").prop("disabled", true);
$("#infoLogBody").html("");
$("#infoLogBody").append(_t.book_info.clone());
}
});
<</script>><</timed>>
<</nobr>><<nobr>>
/* Information about work */
<<set $_temp_to_log = "\
<div>You spent time intensely reading in the Hiroyuki library.</div>\
">>
/* Get clone of player to display changes */
<<set _player = clone($player)>>
/* Forward time along with dynamics */
<<set $player.is_working = true>>
<<addhours _to_advance_hr>>
<<set $player.is_working = false>>
/* Simulate education roll */
<<set _thresh = setup.progressive_gain_chance($player.skills.education, 100, "linear")>>
<<if $difficulty == -2>>
<<set _thresh *= 2>>
<<elseif $difficulty == -1>>
<<set _thresh *= 1.5>>
<</if>>
<<set _roll = randomFloat(1.0)>>
<<if _roll lt _thresh>>
<<set $player.skills.education += Math.ceil(2 * _thresh)>>
<<set $_temp_to_log += "<div>Your literacy and reading ability has improved (Education " + setup.show_change_html(0, Math.ceil(2 * _thresh)) + ")</div>">>
<</if>>
<<set $player.books[_selected_book] = ($player.books[_selected_book] + _words_read / setup.books[_selected_book].word_count).clamp(0, 1)>>
<<if $player.books[_selected_book] == 1>>
/* Completed book */
<<set $_temp_to_log += "<div>After many long hours of reading, you have finally finished reading <em>" +
setup.books[_selected_book].title + "</em>. " + setup.books[_selected_book].completion_text + "</div>">>
/* Calculate skill changes and apply them to the player */
<<set setup.apply_delta($player, setup.books[_selected_book].changes)>>
<<if _selected_book == "heart_of_darkness">>
<<run setup.remove_val($quest_journal.ongoing, "knowledge_is_power")>>
<<set $quest_journal.completed.push("knowledge_is_power")>>
<<set $quest_journal.ongoing.push("something_lost")>>
<<notify>>Quest <em>Something Lost</em> added to journal!<</notify>>
<<audio "quest_added_sound" play>>
<<else>>
<<set $quests.something_lost.stage += 1>>
<<if $quests.something_lost.stage == 6>>
/* TODO: Complete quest */
<<run setup.remove_val($quest_journal.ongoing, "something_lost")>>
<<set $quest_journal.completed.push("something_lost")>>
<</if>>
<</if>>
<</if>>
/* Round off and clamp */
<<include round>>
<<set $_temp_to_log += "<br><b>Reading total stat changes:</b>">>
<<set $_temp_to_log += "<ul>">>
/* Add in stats changes */
<<for _key, _val range _player.stats>>
<<if _val != $player.stats[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.stats[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in skills changes */
<<for _key, _val range _player.skills>>
<<if _val != $player.skills[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.skills[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in condition changes */
<<for _key, _val range _player.conditions>>
<<if _val != $player.conditions[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.conditions[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in slave trait changes */
<<for _key, _val range _player.slave_traits>>
<<if _val != $player.slave_traits[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.slave_traits[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Close off changes */
<<set $_temp_to_log += "</ul>">>
/* Unset variables */
<<unset _changes>>
<<unset _to_advance_hr>>
<<unset $_player>>
/* Re-enable menu */
<<set $enable_menu = true>>
<<goto `passage()`>>
<</nobr>><<nobr>>
/* Add tutorial for shintaniHome as well as trigger on first enterance */
<<if !("entered" in $locations[passage()].data) && !$locations[passage()].data.entered>>
<<set $locations[passage()].data.entered = true>>
/* First interaction */
<<set $_to_log = "\
<div>You enter a library that seems to have been untouched for many years. While \
you realize that looking through everything will take a long time, you are sure that \
this room hides some answers to your curiosities and eventual escape from slavery.</div><br>\
">>
<<else>>
<<set $_to_log = "">>
<</if>>
<<set $_to_log += "
<div>The library spans multiple floors and seems to be frozen in time, as if it were \
quickly abandoned due to some emergency.</div><br>\
">>
/* Load in any saved variables */
<<loadVars>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
<<include infoLog>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include shintaniHomeLibraryActions>>
<<include shintaniHomeLibraryStudyActions>>
<<include shintaniHomeLibraryBooksActions>>
</div>
</div>
</div>
<<updatetime>>
<</nobr>><<nobr>>
<div id="study_actions" class="action container row col fiveQuarters smalltext longbutton hidden"
style="--rows: 4; --cols: 4">
/* How long we want to work for */
<div style="grid-row: 1; grid-column: 1">
@@#study1Hr;.study;<<button "1 Hour">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 2">
@@#study4Hr;.study;<<button "4 Hours">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 3">
@@#study8Hr;.study;<<button "8 Hours">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 4">
<<disable>>
@@#studyStart;<<button "Start">>
<<include shintaniHomeLibraryStudyEngine>>
<<audio page_sound play>>
<</button>>@@
<</disable>>
</div>
<<disable>>
@@#manipulation;.study_option;<<button "Manipulation">><</button>>@@
<</disable>>
<<disable>>
@@#tact;.study_option;<<button "Tact">><</button>>@@
<</disable>>
<div style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<removeclass "#actions" "hidden">>
<<addclass "#study_actions" "hidden">>
<<removeclass "#mainLog" "hidden">>
<<addclass "#infoLog" "hidden">>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "shintaniHome">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<timed 50ms>><<silently>><<script>>
$(".study button").on("click", (event) => {
let _v = State.variables;
let player = _v.player;
$(".study button").removeClass("disabled");
$(".study button").prop("disabled", false);
let self = $(event.currentTarget);
let study_time = parseInt(self.html().replace(/\D/g,''));
State.temporary.to_advance_hr = study_time;
if (Math.abs(setup.project_stamina_change(60 * study_time)) < player.conditions.stamina) {
self.addClass("disabled");
self.prop("disabled", true);
$(".study_option button").removeClass("disabled");
$(".study_option button").prop("disabled", false);
State.temporary.study_subject = "none";
$("#subject_study").addClass("hidden");
let intell_perc = 3;
if (_v.difficulty == -2) {
intell_perc *= 2;
} else if (_v.difficulty == -1) {
intell_perc *= 1.5;
}
if (player.stats.intelligence >= 40) {
intell_perc = 0;
}
$("#li1").html(intell_perc * study_time + "% chance to gain intelligence.");
$("#li2").addClass("hidden");
$("#li3").addClass("hidden");
$("#studyStart button").removeClass("disabled");
$("#studyStart button").prop("disabled", false);
} else {
let str = "<<notify>>You are too tired to study " + study_time + " ";
if (study_time == 1) {
str += "hour.";
} else {
str += "hours.";
}
str += "<</notify>>";
$.wiki(str);
$(".study_option button").addClass("disabled");
$(".study_option button").prop("disabled", true);
$("#studyStart button").addClass("disabled");
$("#studyStart button").prop("disabled", true);
$("#infoLogBody").html("");
$("#infoLogBody").append(State.temporary.default_info.clone());
}
});
$(".study_option button").on("click", (event) => {
let _v = State.variables;
let player = _v.player;
let study_time = State.temporary.to_advance_hr;
if (3 * study_time + Math.abs(setup.project_stamina_change(60 * study_time)) < player.conditions.stamina) {
$(".study_option button").removeClass("disabled");
$(".study_option button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
let study_subject = self.html().toLowerCase();
State.temporary.study_subject = study_subject;
let raise_perc = player.stats.intelligence / 20 * study_time;
if (_v.difficulty == -2) {
raise_perc *= 2;
} else if (_v.difficulty == -1) {
raise_perc *= 1.5;
}
$("#li2").html(raise_perc + "% chance to increase " + study_subject + ".");
$("#li2").removeClass("hidden");
$("#li3").html(-3 * study_time + " additional stamina.");
$("#li3").removeClass("hidden");
} else {
$.wiki("<<notify>>You are too tired to study an additional subject.<</notify>>");
}
})
<</script>><</silently>><</timed>>
<</nobr>><<nobr>>
/* Information about work */
<<set $_temp_to_log = "\
<div>You spent time intensely studying in the Hiroyuki library.</div>\
">>
/* Get clone of player to display changes */
<<set _player = clone($player)>>
/* Forward time along with dynamics */
<<set $player.is_working = true>>
<<addhours _to_advance_hr>>
<<set $player.is_working = false>>
/* Simulate education roll */
<<set _thresh = setup.progressive_gain_chance($player.skills.education, 100, "linear")>>
<<if $difficulty == -2>>
<<set _thresh *= 2>>
<<elseif $difficulty == -1>>
<<set _thresh *= 1.5>>
<</if>>
<<set _roll = randomFloat(1.0)>>
<<if _roll lt _thresh>>
<<set $player.skills.education += Math.ceil(2 * _thresh)>>
<<set $_temp_to_log += "<div>Your literacy and reading ability has improved (Education " + setup.show_change_html(0, Math.ceil(2 * _thresh)) + ")</div>">>
<</if>>
/* Simulate intelligence roll */
<<set _roll = randomFloat(1.0)>>
<<set _thresh = _to_advance_hr * 3 / 100>>
<<if $difficulty == -2>>
<<set _thresh *= 2>>
<<elseif $difficulty == -1>>
<<set _thresh *= 1.5>>
<</if>>
<<if $player.stats.intelligence gte 40>>
<<set _thresh = 0>>
<</if>>
<<if _roll lt _thresh>>
<<set $player.stats.intelligence += 1>>
<<set $_temp_to_log += "<div>You studied the perfect combination of subjects, resulting in clear \
mental growth (Intelligence " + setup.show_change_html(0, 1) + ")</div>">>
<</if>>
/* Simulate subject learning */
<<if _study_subject != "none">>
<<set _roll = randomFloat(1.0)>>
<<set _thresh = (_to_advance_hr * $player.stats.intelligence / 20) / 100>>
<<if $difficulty == -2>>
<<set _thresh *= 2>>
<<elseif $difficulty == -1>>
<<set _thresh *= 1.5>>
<</if>>
<<if _roll lt _thresh>>
<<set $_temp_to_log += "<div>Your study of " + _study_subject + " was extremely successful and informative \
(" + setup.titleCase(_study_subject) + " " + setup.show_change_html(0, 1) + ")</div>">>
<<set $player.stats[_study_subject] += 1>>
<</if>>
<<set $player.conditions.stamina -= 3 * _to_advance_hr>>
<</if>>
/* Round off and clamp */
<<include round>>
<<set $_temp_to_log += "<br><b>Study total stat changes:</b>">>
<<set $_temp_to_log += "<ul>">>
/* Add in stats changes */
<<for _key, _val range _player.stats>>
<<if _val != $player.stats[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.stats[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in skills changes */
<<for _key, _val range _player.skills>>
<<if _val != $player.skills[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.skills[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in condition changes */
<<for _key, _val range _player.conditions>>
<<if _val != $player.conditions[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.conditions[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in slave trait changes */
<<for _key, _val range _player.slave_traits>>
<<if _val != $player.slave_traits[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.slave_traits[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Close off changes */
<<set $_temp_to_log += "</ul>">>
/* Unset variables */
<<unset _changes>>
<<unset _to_advance_hr>>
<<unset $_player>>
/* Re-enable menu */
<<set $enable_menu = true>>
<<goto `passage()`>>
<</nobr>>/* Final stage of path to freedom interupts all of shintani's home */
<<if !$quest_journal.completed.contains("path_to_freedom") && $quests.path_to_freedom.added && $quests.path_to_freedom.stage == 7>>
<<set _lia = $characters.lia_hiroyuki>>
<<set $_to_log = "You enter Shintani\'s home to find Lia waiting for you. She seems to be addressing some guards \
before turning her attention towards you.<br>" +
_lia.dialogue("Ah you\'re here. Follow me into the office.") +
"<ol><li>Follow Lia.</li></ol>">>
<<set _init_sequence = true>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
</div>
<<timed 10ms>><<script>>
$("#mainLogCharacterImage").css("background-image", "url(resources/images/characters/lia/niponTradeUnion_lia_neutral.png)");
<</script>><</timed>>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include shintaniHomeEventsPathToFreedomActions>>
<<timed 10ms>>
<<set _choices = 1>>
<<disableactions>>
<</timed>>
</div>
</div>
</div>
<<else>>
<<if $player.home == "shintaniHome">>
/* Trigger on first enterance */
<<if !("entered" in $locations[passage()].data) && !$locations[passage()].data.entered>>
<<set $locations[passage()].data.entered = true>>
/* Enable menu keybinds */
<<set $enable_menu = true>>
<<popover "noclick">>
<<include welcome>>
<</popover>>
/* First interaction */
<<set $_to_log = "\
<div>Shintani brings you to a quite well-embellished mansion, and shows you to \
your dusty room. \"I'll give you a bit of time to settle in. You can report \
to Himari for work,\" he gestures to a slim woman across the hall staring \
daggers at you. He notices your fixed gaze on the large ornate door that led \
inside. \"Don't think about leaving this place for now. We need to make sure \
you're to be trusted first.\" Finally, he puts a necklace around your neck that \
seems to tighten in place once released, \"This will let everyone know that you \
are a Hironaka, you won\'t be able to take it off without my permission.\"</div><br>\
">>
/* Give player Hironaka Symbol */
<<run UInv.AddItem("inventory", "hironaka_amulet", 1)>>
<<set $player.equipment.neck = "hironaka_amulet">>
/* Give first intro quest */
<<if !$quests.a_new_life.added>>
<<set $quests.a_new_life.added = true>>
<<set $quest_journal.ongoing.push("a_new_life")>>
<</if>>
<<else>>
<<set $_to_log = "">>
<</if>>
<<set $_to_log += "
<div>The Hiroyuki Household is quiet but holds an eerie sense of providence, as if \
something world-changing could occur at any moment.</div><br>\
">>
/* Load in any saved variables */
<<loadVars>>
/* Player back inside */
<<set $player.is_home = true>>
<<set $player.is_outside = false>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
</div>
<<include info>>
<<include molestInfo>>
<<include sexInfo>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
/* Main actions */
<<include shintaniHomeActions>>
/* Work actions */
<<include shintaniHomeWorkActions>>
/* Event actions */
<<include shintaniHomeEventsActions>>
/* Interact options */
<<include shintaniHomeInteractOptions>>
/* Interact actions */
<<include shintaniHomeInteractActions>>
<<include shintaniHomeInteractAsleepActions>>
/* Molest actions */
<<include molestActions>>
<<include molestCumActions>>
</div>
</div>
</div>
<<else>>
<<set $_to_log = "
<div>The Hiroyuki Household is quiet but holds an eerie sense of providence, as if \
something world-changing could occur at any moment.</div><br>\
">>
<<loadVars>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
</div>
<<include info>>
<<include molestInfo>>
<<include sexInfo>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
/* Main actions */
<<include shintaniHomeActions>>
/* Event actions */
<<include shintaniHomeEventsActions>>
/* Interact options */
<<include shintaniHomeInteractOptions>>
/* Interact actions */
<<include shintaniHomeInteractActions>>
<<include shintaniHomeInteractAsleepActions>>
/* Molest actions */
<<include molestActions>>
<<include molestCumActions>>
</div>
</div>
</div>
<</if>>
<<updatetime>>
<</if>><<nobr>>
/* Check for fill or emptied slave_traits */
<<set _player_extra_changes = "">>
<<set _player_flavor_text = "">>
<<if $player.is_slave>>
/* If trust falls to zero lower status */
<<if $player.slave_traits.trust == 0>>
<<if $player.get_status("shintaniHome") == "slave">>
<<set $locations["nipon"].status = "low_slave">>
<<updatestatus>>
<<set _player_extra_changes += "\
You\'re low trust with Shintani has caused your status to drop within Nipon.\
">>
<<if $locations["niponCentral"].access>>
<<set $locations["niponCentral"].access = false>>
<<set _player_extra_changes += "\
Due to your status as a low slave, Shintani has decided to revoke your privledges \
to leave the household.\
">>
<</if>>
<<set $player.slave_traits.trust = 50>>
/* Prevent change from showing */
<<set $_player.slave_traits.trust = 50>>
/* Modify Shintani's view of the player */
<<set $characters.shintani_hiroyuki.slave_traits.obedience = 30>>
<<set $characters.shintani_hiroyuki.slave_traits.trust = 0>>
<<elseif $player.get_status("shintaniHome") == "high_slave">>
<<set $locations["nipon"].status = "slave">>
<<updatestatus>>
<<set _player_extra_changes += "\
You\'re low trust with Shintani has caused your status to drop within Nipon.\
">>
<<set $player.slave_traits.trust = 50>>
/* Prevent change from showing */
<<set $_player.slave_traits.trust = 50>>
/* Modify Shintani's view of the player */
<<set $characters.shintani_hiroyuki.slave_traits.obedience = 50>>
<<set $characters.shintani_hiroyuki.slave_traits.trust = 25>>
<</if>>
<</if>>
/* If obedience falls to zero, give beating */
<<if $player.slave_traits.obedience == 0>>
<<set _player_extra_changes += "\
You\'re low obedience in the Hiroyuki household now shows in the new lash marks \
now on your back. This severly affects your health and may lead to long-term consequences \
(">>
<<set $player.slave_traits.trust -= 10>>
<<set $player.slave_traits.obedience = 20>>
/* Prevent change from showing */
<<set $_player.slave_traits.obedience = 20>>
/* Roll to see whether or not dex / strength is reduced */
<<set _probability = setup.sigmoid($difficulty)>>
<<set _roll = Math.random()>>
<<if _roll lt _probability>>
<<set _player_extra_changes += "Dexterity " + setup.show_change_html(0, -1) + ", ">>
<<set $player.stats.dexterity -= 1>>
<</if>>
<<set _roll = Math.random()>>
<<if _roll lt _probability>>
<<set _player_extra_changes += "Strength " + setup.show_change_html(0, -1) + ", ">>
<<set $player.stats.strength -= 1>>
<</if>>
/* Roll to see how much health is lost */
<<set _roll = 10 * dice(1, $difficulty + 6) - $player.stats.strength>>
<<set _player_extra_changes += "Health " + setup.show_change_html(0, -1 * _roll) + ", ">>
<<set $player.conditions.health -= _roll>>
<<set _player_extra_changes += "Trust " + setup.show_change_html(0, -10) + ").">>
<<unset _probability>>
<<unset _roll>>
<</if>>
/* If obedience > 90, build trust */
<<if $player.slave_traits.obedience gt 90>>
<<if $player.get_status("nipon") == "low_slave">>
<<set _to_add = 15>>
<<else>>
<<set _to_add = 5>>
<</if>>
<<set _player_extra_changes += "\
Shintani has taken notice to your good behavior lately, building his trust in you \
(Trust " + setup.show_change_html(0, _to_add) + ").">>
<<set $player.slave_traits.trust += _to_add>>
<<unset _to_add>>
<</if>>
/* If trust reaches 100, raise status */
<<if $player.slave_traits.trust gte 100>>
<<if $player.get_status("shintaniHome") == "low_slave">>
<<if $quests.the_nipon_economy.added>>
<<set $locations["niponCentral"].access = true>>
<</if>>
<<set $locations["nipon"].status = "slave">>
<<updatestatus>>
<<set _player_extra_changes += "\
You\'re high trust with Shintani has caused your status to rise within Nipon.\
">>
<<set $player.slave_traits.trust = 5>>
/* Prevent change from showing */
<<set $_player.slave_traits.trust = 5>>
/* Modify Shintani's view of the player */
<<set $characters.shintani_hiroyuki.slave_traits.obedience = 50>>
<<set $characters.shintani_hiroyuki.slave_traits.trust = 25>>
<<elseif $player.get_status("shintaniHome") == "slave">>
<<set $locations["nipon"].status = "high_slave">>
<<updatestatus>>
<<set _player_extra_changes += "\
You\'re high trust with Shintani has caused your status to rise within Nipon.\
">>
<<set $player.slave_traits.trust = 5>>
/* Prevent change from showing */
<<set $_player.slave_traits.trust = 5>>
/* Modify Shintani's view of the player */
<<set $characters.shintani_hiroyuki.slave_traits.obedience = 60>>
<<set $characters.shintani_hiroyuki.slave_traits.trust = 50>>
<</if>>
<</if>>
<</if>>
/* Update quest journal */
<<updatequests>>
/* Simulate slaves */
<<include slaveEngine>>
/* Remove money from player */
<<if _afford>>
<<if _total_profit gt 0>>
<<addmoney `setup.round2(_total_profit)`>>
<<elseif _total_profit lt 0>>
<<removemoney `Math.abs(setup.round2(_total_profit))`>>
<</if>>
<</if>>
<div id="background" class="paper_border" style="position: relative">
<center><h1>Another Day Passes in Nipon</h1></center>
<div style="overflow-y: auto; height: 450px; padding: 10px">
<p id="sleep_summary" class="textpassage" style="display: none">
<<capture $_player>>
<<messageopen "Player Summary">>
You slept for <<= parseInt($_to_advance / 60)>> hours and <<= parseInt($_to_advance % 60)>>
minutes until the break of dawn when all slaves in the Hiroyuki household are told to wake
up; 7:00 AM. _player_flavor_text
<<if !$_obedient_sleep && $player.is_slave>>
Since you went to bed without working your daily quota, Shintani took it as you
lazying off (<span style="color: red">-Obedience</span>).
<</if>>
<br>
''Sleep total stat changes:''
<ul class="sleepChanges">
/* Add in stat changes */
<<for _key, _val range $_player.stats>>
<<if _val != $player.stats[_key]>>
<li> <<= setup.titleCase(_key)>>: <<= setup.show_change_html(_val, $player.stats[_key], true)>></li>
<</if>>
<</for>>
/* Add in condition changes */
<<for _key, _val range $_player.conditions>>
<<if _val != $player.conditions[_key]>>
<li> <<= setup.titleCase(_key)>>: <<= setup.show_change_html(_val, $player.conditions[_key], true)>></li>
<</if>>
<</for>>
/* Add in slave trait changes */
<<for _key, _val range $_player.slave_traits>>
<<if _val != $player.slave_traits[_key]>>
<li> <<= setup.titleCase(_key)>>: <<= setup.show_change_html(_val, $player.slave_traits[_key], true)>></li>
<</if>>
<</for>>
<<if _afford && _total_profit != 0>>
<li>Profit: <<= setup.show_money_change_html(0, _total_profit)>></li>
<</if>>
</ul>
<</messageopen>><br>
<<messageopen "Slave Summary">>
<<if _to_simulate_day.size == 0>>
You do not have any slaves on assignment right now.
<<else>>
<<if _afford>>
<<for _key, _val range _slave_changes>>
<<set _char = $characters[_key]>>
<<capture _char, _key, _val>>
<<messageopen _char.name()>>
<<= _val.flavor_text>><br>
''<<= setup.titleCase(_char.first_name)>> Changes''
<ul class="sleepChanges">
<<for _sub_key, _sub_val range _slave_changes[_key].self>>
<<for _sub_sub_key, _sub_sub_val range _sub_val>>
<<if _sub_sub_val == 0>>
<<continue>>
<</if>>
<<if _sub_key == "sex_fetishes">>
<<set _tit = setup.titleCase(_sub_sub_key) + " Fetish">>
<<elseif _sub_key == "sex_skills">>
<<set _tit = setup.titleCase(_sub_sub_key) + " Skill">>
<<elseif _sub_key == "sex_prefs">>
<<set _tit = setup.titleCase(_sub_sub_key) + " Preference">>
<<elseif _sub_key == "slave_traits" && _sub_sub_key == "obedience">>
<<set _tit = "Affection">>
<<else>>
<<set _tit = setup.titleCase(_sub_sub_key)>>
<</if>>
<li>_tit:
<<if _sub_sub_key in setup.POSITIVES.character>>
<<= setup.show_change_html(0, _sub_sub_val, setup.POSITIVES.character[_sub_sub_key])>>
<<else>>
<<= setup.show_change(0, _sub_sub_val)>>
<</if>>
</li>
<</for>>
<</for>>
<<for _idx, _sub_val range _slave_changes[_key].special>>
<li><<= _sub_val>></li>
<</for>>
<li>Profit: <<= setup.show_money_change_html(0, -1 * _slave_changes[_key].cost)>></li>
<<if _slave_changes[_key].cost lt 0>>
<<set _char.finances.total_earned += -1 * _slave_changes[_key].cost>>
<<else>>
<<set _char.finances.cost += _slave_changes[_key].cost>>
<</if>>
</ul>
<</messageopen>><br>
<</capture>>
<</for>>
<<else>>
Your assigned slaves cost you
<span class="fail"><<= setup.LARI>><<= Math.abs(_total_profit)>></span>
which is more than you have. Thus they ignored all their assignments for
the day and returned to their default roles.
<</if>>
<</if>>
<</messageopen>><br>
<<messageopen "World Summary">>
You do not have any way to gather intelligence about the world right now.
<</messageopen>>
<</capture>>
</p>
</div>
<div id="cont_button" style="position: absolute; bottom: 100px; left: calc(50% - 82px); display: none">
<<button "Continue" shintaniHome>><</button>>
</div>
</div>
<<script>>
setTimeout(() => {
var div = $("<div></div>");
div.html(State.temporary.player_extra_changes);
$("#sleep_summary").prepend(div);
$("#sleep_summary").fadeIn();
$("#cont_button").fadeIn();
}, 500);
<</script>>
/* Reset awake counter */
<<set $rest_momentum = 0>>
<<set $time_awake = 0>>
/* Reset work status */
<<set $player.hours_worked = 0>>
<<include round>>
<<unset $_player>>
<</nobr>><<nobr>>
<div id="work_actions" class="action container row col hidden"
style="--rows: 4; --cols: 5">
/* How long we want to work for */
<div style="grid-row: 1; grid-column: 1">
@@#work1Hr;<<button "1 Hour">>
<<run $("#workStartButton button").prop("disabled", true)>>
<<addclass "#workStartButton button" "disabled">>
/* Enable other options */
<<run $("#work4Hr button").prop("disabled", false)>>
<<removeclass "#work4Hr button" "disabled">>
<<run $("#work8Hr button").prop("disabled", false)>>
<<removeclass "#work8Hr button" "disabled">>
<<set _to_advance_hr = 1>>
/* Enable start */
<<if $player.conditions.stamina gt (_to_advance_hr * -180 * ((3/10 * $player.stats.strength - $rest_momentum / 7) - _to_advance_hr * 30 / 7) / 1440)>>
<<run $("#workStartButton button").prop("disabled", false)>>
<<removeclass "#workStartButton button" "disabled">>
/* Disable self */
<<run $("#work1Hr button").prop("disabled", true)>>
<<addclass "#work1Hr button" "disabled">>
<<else>>
<<set _to_notify = ("You are too tired to work " + _to_advance_hr + " hour.")>>
<<notify>><<= _to_notify>><</notify>>
<</if>>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 2">
@@#work4Hr;<<button "4 Hours">>
<<run $("#workStartButton button").prop("disabled", true)>>
<<addclass "#workStartButton button" "disabled">>
/* Enable other options */
<<run $("#work1Hr button").prop("disabled", false)>>
<<removeclass "#work1Hr button" "disabled">>
<<run $("#work8Hr button").prop("disabled", false)>>
<<removeclass "#work8Hr button" "disabled">>
<<set _to_advance_hr = 4>>
/* Enable start */
<<if $player.conditions.stamina gt (_to_advance_hr * -180 * ((3/10 * $player.stats.strength - $rest_momentum / 7) - _to_advance_hr * 30 / 7) / 1440)>>
<<run $("#workStartButton button").prop("disabled", false)>>
<<removeclass "#workStartButton button" "disabled">>
/* Disable self */
<<run $("#work4Hr button").prop("disabled", true)>>
<<addclass "#work4Hr button" "disabled">>
<<else>>
<<set _to_notify = ("You are too tired to work " + _to_advance_hr + " hours.")>>
<<notify>><<= _to_notify>><</notify>>
<</if>>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 3">
@@#work8Hr;<<button "8 Hours">>
<<run $("#workStartButton button").prop("disabled", true)>>
<<addclass "#workStartButton button" "disabled">>
/* Enable other options */
<<run $("#work1Hr button").prop("disabled", false)>>
<<removeclass "#work1Hr button" "disabled">>
<<run $("#work4Hr button").prop("disabled", false)>>
<<removeclass "#work4Hr button" "disabled">>
<<set _to_advance_hr = 8>>
/* Enable start */
<<if $player.conditions.stamina gt (_to_advance_hr * -180 * ((3/10 * $player.stats.strength - $rest_momentum / 7) - _to_advance_hr * 30 / 7) / 1440)>>
<<run $("#workStartButton button").prop("disabled", false)>>
<<removeclass "#workStartButton button" "disabled">>
/* Disable self */
<<run $("#work8Hr button").prop("disabled", true)>>
<<addclass "#work8Hr button" "disabled">>
<<else>>
<<set _to_notify = ("You are too tired to work " + _to_advance_hr + " hours.")>>
<<notify>><<= _to_notify>><</notify>>
<</if>>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 5">
<<disable>>
@@#workStartButton;<<button "Start">>
<<include shintaniHomeWorkEngine>>
<</button>>@@
<</disable>>
</div>
<div style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<script>>
$("#work_actions").addClass("hidden");
$("#actions").removeClass("hidden");
<</script>>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<</nobr>><<nobr>>
/* Information about work */
<<set $_temp_to_log = "\
<div>You spent time assisting Shintani with his duties.</div>\
">>
/* Get clone of player to display changes */
<<set $_player = clone($player)>>
/* Forward time along with dynamics */
<<set $player.is_slaving = true>>
<<addhours _to_advance_hr>>
<<set $player.hours_worked += _to_advance_hr>>
<<include round>>
<<set $player.is_slaving = false>>
/* Check if work-event occurs */
<<set _probability = (_to_advance_hr / 8)>>
<<set _roll = Math.random()>>
/* Fill event pool depending on content */
<<if (1 - _probability) lt _roll>>
/* Disable menu */
<<set $enable_menu = false>>
<<script>>
let _v = State.variables;
if (!("work_event_pool" in _v.locations[passage()].data) || _v.locations[passage()].data.work_event_pool.length == 0) {
_v.locations[passage()].data.work_event_pool = [];
/* Add events to pool depending on task */
$.wiki(`<<include shintaniHomeEventsWorkEconomicEvents>>`);
if (_v.tasks == 2) {
/* Add in two copies to double weight */
$.wiki(`<<include shintaniHomeEventsWorkSexualEvents>>`);
$.wiki(`<<include shintaniHomeEventsWorkSexualEvents>>`);
}
}
/* Draw and remove a random event from pool */
let _event = _v.locations[passage()].data.work_event_pool.splice(Math.floor(Math.random() * _v.locations[passage()].data.work_event_pool.length), 1)[0];
/* Trigger work event */
$.wiki(`<<include ${_event}>>`);
$("#work_actions").addClass("hidden");
$("#events_actions").removeClass("hidden");
<</script>>
<<unset _probability>>
<<unset _roll>>
<<unset _event_pool>>
<<else>>
<<include shintaniHomeWorkEngineAfter>>
<</if>>
<</nobr>><<nobr>>
<<include round>>
/* Check if there were any changes at all */
<<set _changes = false>>
<<for _key, _val range $_player.conditions>>
<<if _val != $player.conditions[_key]>>
<<set _changes = true>>
<<break>>
<</if>>
<</for>>
<<for _key, _val range $_player.slave_traits>>
<<if _val != $player.slave_traits[_key]>>
<<set _changes = true>>
<<break>>
<</if>>
<</for>>
<<if _changes>>
<<set $_temp_to_log += "<br><b>Work total stat changes:</b>">>
<<set $_temp_to_log += "<ul>">>
/* Add in condition changes */
<<for _key, _val range $_player.conditions>>
<<if _val != $player.conditions[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.conditions[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in slave trait changes */
<<for _key, _val range $_player.slave_traits>>
<<if _val != $player.slave_traits[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.slave_traits[_key], true) + "</li>")>>
<</if>>
<</for>>
<<set $_temp_to_log += "</ul>">>
<</if>>
/* Unset variables */
<<unset _changes>>
<<unset _to_advance_hr>>
<<unset $_player>>
/* Re-enable menu */
<<set $enable_menu = true>>
<<script>>Engine.play("shintaniHome");<</script>>
<</nobr>><<nobr>>
<div id="actions" class="action container row col longbutton fiveQuarters"
style="--rows: 4; --cols: 4">
/* TODO: PHASE2: Change talk options */
<<set _last_choice = "none">>
<<button "Talk">>
<<if _last_choice != "talk">>
<<set _last_choice = "talk">>
<<set _options = "\
<ol>\
<li id=\"li1\">\"Do you work for Shintani?\"</li>\
<li id=\"li2\">\"How do you like Nipon?\"</li>\
<li id=\"li3\">\"What\'s your background?\"</li>\
<li id=\"li4\">\"I'd like to work here.\"</li>\
">>
<<if !$quest_journal.completed.contains("knowledge_is_power") && $quests.knowledge_is_power.added && $quests.knowledge_is_power.stage == 1 &&
(!("brothel" in $quests.knowledge_is_power.data) || !$quests.knowledge_is_power.data.brothel)>>
<<set _options += "<li id=\"li5\">Himari said you had some debt that needs to be paid?\"</li>">>
<</if>>
<<set _options += "</ol>">>
<<set _responses = [_options]>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses);
<</script>>
<<set _options = $(_options)>>
<</if>>
<<addclass "#actions" "hidden">>
<<removeclass "#events_actions" "hidden">>
<<set _disable_buttons = false>>
<<disableactions _options>>
<</button>>
<<disable>>
<<button "Services">>
<</button>>
<</disable>>
<<if "brothel_work" in $quests.knowledge_is_power.data && $quests.knowledge_is_power.data.brothel_work>>
<<button "Work">>
<<run $("#info_title").html("Whore at the Sol Brothel")>>
<<set _default_info = $("<div>\
<div id=\"normal_whore\">\
The Sol Brothel is filled with sexual fantasies and nightmares. You think subjecting yourself to it might \
be an easy way to make some lari.\
<ul id=\"change_list\">\
<li id=\"li1\">" + setup.LARI + setup.round2((2 * $player.sex_value()).clamp(0, 200)) + "</li>\
<li id=\"li2\">12% chance to increase a random sex skill (capped at 60).</li>\
<li id=\"li3\" class=\"hidden\"></li>\
<li id=\"li4\" class=\"hidden\"></li>\
<li id=\"li5\" class=\"hidden\"></li>\
</ul></div>\
<div id=\"niche\">\
You realize that you could potentially make some extra money by filling a sexual niche.\
<ul>\
<li id=\"li6\">Switch: Additional (tact/2) average tip, -3 willpower.</li>\
<li id=\"li7\">Dom: No tip, +5 willpower.</li>\
<li id=\"li8\">Sub: Additional (tact) average tip, -5 willpower, (30 - strength)% chance of injury.</li>\
</ul></div>\
</div>")>>
<<run $("#infoLogBody").html("")>>
<<run $("#infoLogBody").append(_default_info.clone())>>
<<removeclass "#work_actions" "hidden">>
<<addclass "#actions" "hidden">>
<<removeclass "#infoLog" "hidden">>
<<addclass "#mainLog" "hidden">>
/* Reset disposition buttons */
<<script>>
$(".disposition button").removeClass("disabled");
$(".disposition button").prop("disabled", false);
$("#work_start button").addClass("disabled");
$("#work_start button").prop("disabled", true);
<</script>>
<</button>>
<<else>>
<<disable>>
<<button "Work">><</button>>
<</disable>>
<</if>>
<<button "Assignments">>
<<if _has_assignment>>
<<removeclass "#assignment_options" "hidden">>
<<addclass "#actions" "hidden">>
<<else>>
<<notify>>You do not have any slaves assigned to the Sol Brothel.<</notify>>
<</if>>
<</button>>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<</nobr>><<nobr>>
<div id="assignment_actions" class="action container longbutton fiveQuarters smalltext row col hidden"
style="--rows: 4; --cols: 4">
@@#check_up;<<button "Check Up">>
<<set _sex_val = _char.sex_value()>>
<<set _responses = [
$player.dialogue("How are you doing?")
]>>
<<if _sex_val lt 30>>
<<set _responses.push(
_char.dialogue("I feel so useless here. Every day they ask me to do things... things... I don\'t want, and when I don\'t \
do well they punish me... please let me leave here. I don\'t want to work here anymore.")
)>>
<<elseif _sex_val lt 60>>
<<set _responses.push(
_char.dialogue("I feel like I\'m slowly getting better at working here, but I\'m not the best at what I do. At least here \
there are others like me I can talk to.")
)>>
<<elseif _sex_val lt 100>>
<<set _responses.push(
_char.dialogue("For the first time I feel like I am good at what I\'m doing here. While the work isn\'t the best sometimes, \
I\'m glad that others acknowledge my usefulness.")
)>>
<<else>>
<<set _responses.push(
_char.dialogue("Thank you so much for letting me work here. The environment is so great, and I love sucking cock all \
day long! Actually...")
)>>
<<set _responses.push(
setup.titleCase(_char.first_name) + " looks around to make sure no one can see you guys, and quickly pulls down your pants,"
)>>
<<set _responses.push(
_char.dialogue("Let me show you how thankful I am.")
)>>
<<if $player.gender == 0>>
<<set _responses.push(
setup.titleCase(_char.first_name) + " quickly gulps down your cock and starts sucking rigorously to show you what they\'ve \
been learning here. After a few moments you quickly cum, filling " + setup.his(_char) + " mouth with \
your semen."
)>>
<<else>>
<<set _responses.push(
setup.titleCase(_char.first_name) + " quickly starts licking your bare pussy to show you what they\'ve \
been learning here. After a few moments you quickly cum, filling " + setup.his(_char) + " mouth with \
your juices."
)>>
<</if>>
<</if>>
<</button>>@@
@@#encourage;<<button "Encourage">>
<<if _char.limits.influence lte 0>>
<<notify>>Already influenced <<= setup.titleCase(_char.first_name)>>
too many times today!<</notify>>
<<else>>
<<set _char.limits.influence -= 1>>
<<set _roll = $player.get_status_prop("tact") + dice(1, 6 + $difficulty) - $difficulty>>
<<if _roll gt 35>>
<<set _responses = [
setup.pass("tact"),
$player.dialogue("I heard you were doing well here, keep up the good work!"),
setup.titleCase(_char.first_name) + " looks at you with joy,",
_char.dialogue("Thanks... I\'ve been trying to get better...") +
"(" + setup.titleCase(_char.first_name) + "\'s Affection " + setup.show_change_html(0, 2) + ")"
]>>
<<set _char.slave_traits.obedience += 2>>
<<set _to_round = _char.key>>
<<include round>>
<<else>>
<<set _responses = [
setup.fail("tact"),
$player.dialogue("I heard you were doing well here, keep up the good work!"),
setup.titleCase(_char.first_name) + " looks at you emotionlessly,",
_char.dialogue("Thanks... I guess...")
]>>
<</if>>
<</if>>
<</button>>@@
@@#insult;<<button "Insult">>
<<if _char.limits.manipulate lte 0>>
<<notify>>Already manipulated <<= setup.titleCase(_char.first_name)>>
too many times today!<</notify>>
<<else>>
<<set _char.limits.manipulate -= 1>>
<<set _roll = $player.get_status_prop("manipulation") + dice(1, 6 + $difficulty) - $difficulty>>
<<if _roll gt 35>>
<<set _responses = [
setup.pass("manipulation"),
$player.dialogue("God you look like shit, I wonder how this place hasn\'t shut down with you working here."),
setup.titleCase(_char.first_name) + " looks at you with bewilderment,",
_char.dialogue("Sorry, I\'ll try to be better...") +
"(" + setup.titleCase(_char.first_name) + "\'s Willpower " + setup.show_change_html(0, -2, false) + ")"
]>>
<<set _char.slave_traits.willpower -= 2>>
<<set _to_round = _char.key>>
<<include round>>
<<else>>
<<set _responses = [
setup.fail("manipulation"),
$player.dialogue("God you look like shit, I wonder how this place hasn\'t shut down with you working here."),
setup.titleCase(_char.first_name) + " looks at you with bewilderment, tears welding up in " + setup.his(_char) +
" eyes,",
_char.dialogue("I... I didn\'t want to work here in the first place! Let me leave then!") +
"(" + setup.titleCase(_char.first_name) + "\'s Anger " + setup.show_change_html(0, 7, false) +
", Affection " + setup.show_change_html(0, -2) +
", Willpower " + setup.show_change_html(0, -1, false) + ")"
]>>
<<set _char.mental_conditions.anger += 7>>
<<set _char.slave_traits.obedience -= 2>>
<<set _char.slave_traits.willpower -= 1>>
<<set $to_simulate.add(_char.key)>>
<<set _to_round = _char.key>>
<<include round>>
<</if>>
<</if>>
<</button>>@@
<div id="assignment_actions_back" style="grid-row: 3; grid-column: 4">
<<button "Back" `passage()`>><</button>>
</div>
<div id="assignment_actions_leave" style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
<<set _assignment_actions_buttons = ["#check_up", "#encourage", "#insult"]>>
</div>
<<timed 50ms>><<script>>
$("#assignment_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
if (self.html() == "Back" || self.html() == "Leave") {
return;
}
self.addClass("disabled");
self.prop("disabled", true);
setup.mainLog_append_delayed(State.temporary.responses, State.temporary.assignment_actions_buttons);
});
<</script>><</timed>>
<</nobr>><<nobr>>
<<set _has_assignment = false>>
<div id="assignment_options" class="action container smalltext row col hidden"
style="--rows: 4; --cols: 5">
<<set _to_simulate_day = new Set()>>
<<if $player.is_slave>>
<<if $player.get_status("nipon") == "slave">>
<<set _to_simulate_day.add("mei_hironaka")>>
<<elseif $player.get_status("nipon") == "high_slave">>
<<set _to_simulate_day.add("mei_hironaka")>>
<<set _to_simulate_day.add("jae_hironaka")>>
<</if>>
<</if>>
<<for _idx, _val range $player.slaves>>
<<set _to_simulate_day.add(_val)>>
<</for>>
<<for _idx, _val range _to_simulate_day>>
<<if $characters[_val].assignment == "solBrothel">>
<<set _has_assignment = true>>
<<capture _val>>
<<button `setup.titleCase($characters[_val].first_name)`>>
<<set _char = $characters[_val]>>
<<run setup.mainLog_append_delayed(["You approach " + setup.titleCase(_char.first_name) + " who is on break,"])>>
<<removeclass "#assignment_actions" "hidden">>
<<addclass "#assignment_options" "hidden">>
<<run $("#mainLogCharacterImage").css("background-image",
"url(\"" + _char.image_folder() +
_char.first_name.toLowerCase() + "_" +
_char.get_disposition() + ".png\")"
)>>
<</button>>
<</capture>>
<</if>>
<</for>>
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 3; grid-column: 5"><<button "Back">>
<<removeclass "#actions" "hidden">>
<<addclass "#assignment_options" "hidden">>
<<run $("#mainLogCharacterImage").css("background-image",
"url(\"" + _ronda.image_folder() + "ronda_neutral.png\")"
)>>
<</button>></div>
<div style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<</nobr>><<nobr>>
/* Setup Ronda */
<<set _ronda = new setup.Character("ronda_stike")>>
<<set _ronda.set_properties(
new Date(200 - 32, 2, 12),
1,
"Ronda",
"Stike"
)>>
/* Make Ronda static */
<<if $characters.ronda_stike != null>>
<<run delete $characters.ronda_stike>>
<</if>>
<<set $_to_log = "
<div>You enter the Sol Brothel and immediately are assaulted with an environment of pure \
sexual opulence. Despite such an esoteric atmosphere, there is a sense of dignity and \
refinement. Through the walls you can hear some slight giggling and moans. You approach \
a dark skinned woman who is clearly the head madam of this establishment.</div>\
">>
<<if $player.is_slave>>
<<set $_to_log += "She eyes the amulet around your neck and lets out an obvious sigh,<br>">>
<<set $_to_log += _ronda.dialogue("Bloody hell, another one of Shintani\'s little pets. Welcome to the Sol \
Brothel, not that I care about welcoming <b>you</b> in particular.")>>
<<else>>
<<set $_to_log += _ronda.dialogue("Welcome to the Sol Brothel. How can I be of assistance to you this fine day?")>>
<</if>>
/* Load in any saved variables */
<<loadVars>>
/* Player back inside */
<<set $player.is_home = false>>
<<set $player.is_outside = false>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
<<script>>
setTimeout(() => {
let ronda = State.temporary.ronda;
$("#mainLogCharacterImage").css("background-image",
"url(\"" + ronda.image_folder() + "ronda_neutral.png\")"
);
}, 10);
<</script>>
<<include infoLog>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
/* Main actions */
<<include solBrothelActions>>
<<include solBrothelTalkOptions>>
<<include solBrothelAssignmentOptions>>
<<include solBrothelAssignmentActions>>
<<include solBrothelWorkActions>>
</div>
</div>
</div>
<</nobr>><<nobr>>
<<set _refresh = false>>
<div id="events_actions" class="action container row col hidden"
style="--rows: 4; --cols: 5">
@@#events1;<<button "1">>
<<if ndef _action>>
<<run _options.find("#li1").css("text-decoration", "line-through")>>
<<set _responses = [
"Ronda\'s face twists",
_ronda.dialogue("Oh how I\'d looove to work for hooonorabble and gracious and caring and lovely Shintani. How I\'d love \
to be a dog licking his soles around the likes of... his oriental looking toys. I would totally fit in."),
"You can\'t help yourself but giggle a little, afterall her accent makes her speech sound even more flaboyant than its \
meant to be,",
_ronda.dialogue("Oh you think it\'s funny? Do you know what\'s funny? How about not being able to have children because of \
the color of your skin? How about despite your family being a foundational corner piece of this pile of trash \"Nipon\" as \
he now calls it, you are forced into a role where you sell your family members to his court? Is that funny?"),
"You are left speechless. Ronda\'s voice lowers,",
_ronda.dialogue("Let me tell you this, one day, when there are no more of our people left to oppose him, he will bring \
hell."),
_options.clone()
]>>
<<elseif _action == 5>>
<<unset _action>>
<<set _responses = [
"Ronda leads you and the large patron into an isolated room, dimly lit with red. She smiles at you one last time \
before closing the door, leaving only you and Will.",
_will.dialogue("Hello there pretty, are you ready to be my pretty little slut?"),
"Before you could even attempt to answer, Will is completely naked and has you pressed down to his crotch which reeks \
of onions and sulfur,",
_will.dialogue("Suck it you fucking whore!"),
"Despite you resisting he pushes his nasty cock into your mouth, spreading smegma all over your tongue. Even with you trying \
all you can, it seems Will\'s large physique gives him the extra leverage needed to keep forcing you down.",
_will.dialogue("Don\'t stop! I\'m going to cum!"),
"You are suddenly shocked that hearing those words come from a stout and disgusting old man would be like music to your \
ears. As your face is continually raped, Will lets out a stream of cum into your throat,",
_will.dialogue("Now swallow you pig, else I\'ll tell mistress you didn\'t satisfy me... and who is she going to believe, \
one of her most loyal customers, or a little bitch slave?"),
"Sunk-cost fallacy kicks in and you gulp down an obscene amount of semen. The taste still lingers in your throat, leaving \
you gagging and dry heaving. Will laughs at your predicament as you slowly make your way back outside (Oral Skill " +
setup.show_change_html(0, 1) + ", Willpower " + setup.show_change_html(0, -10) + ")."
]>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set $player.sex_skills.oral += 1>>
<<set $player.slave_traits.willpower -= 10>>
<<include round>>
<<run $("#mainLogCharacterImage").css("background-image", "url(\"" + _ronda.image_folder() + "ronda_neutral.png\")")>>
<<set _responses = [
"Ronda looks at you in shock",
_ronda.dialogue("The hell? That was fast... Did you back out?"),
"You look at her with dead eyes indicating that you in fact, did not, back out,",
"All of a sudden Ronda breaks her hard demeanor and lets out a beautifully warm laugh,",
_ronda.dialogue("Hahaha! It seems like you must be a professional! Well, consider the debt cleared. Now if you \
don\'t need anything else get out of here... You\'re ruining the atmosphere."),
_options.clone()
]>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<run setup.mainLog_append_delayed(_responses, $buttons, $buttons_extra);>>
<<set $quests.knowledge_is_power.data["brothel"] = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<</button>>@@
@@#events2;<<button "2">>
<<if ndef _action>>
<<run _options.find("#li2").css("text-decoration", "line-through")>>
<<set _responses = [
_ronda.dialogue("How do I like being defined by the color of my skin? Well, it\'s fan-fucking-tastic."),
_options.clone()
]>>
<<elseif _action == 5>>
<<unset _action>>
<<run $("#mainLogCharacterImage").css("background-image", "url(\"" + _ronda.image_folder() + "ronda_neutral.png\")")>>
<<set _responses = [
"Ronda\'s smile drifts away,",
_ronda.dialogue("Shintani\'s pets are getting more and more useless huh? Bloody pathetic."),
_options.clone()
]>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<</button>>@@
@@#events3;<<button "3">>
<<run _options.find("#li3").css("text-decoration", "line-through")>>
<<set _responses = [
"Ronda flashes a sly smile,",
_ronda.dialogue("Humph, have you no shame asking such a question in front of the heiress of the Stike fortune?"),
"You can tell she is happy that someone had asked,",
_ronda.dialogue("We served under the Namm household many many seasons ago, but now we are nothing but \"black devils\" \
that cause the misfortunes of others. At least we aren\'t doing as bad as the Namm household though, I heard not only \
were their assets all seized, but the sole survivor of them is a begger somewhere here in..."),
"Ronda cuts herself off, confused on why she would share gossip with the likes of you,",
_ronda.dialogue("Sorry, I'll have to get back to work now, did you need anything else or are you just here to \
make the view unpleasant?"),
_options.clone()
]>>
<</button>>@@
@@#events4;<<button "4">>
<<run _options.find("#li4").css("text-decoration", "line-through")>>
<<set _sex_val = setup.round2((2 * $player.sex_value()).clamp(0, 200))>>
<<if "brothel_work" in $quests.knowledge_is_power.data && $quests.knowledge_is_power.data.brothel_work>>
<<set _responses = [
"I already allowed you to work here. Your currently value per shift looks to be " + setup.LARI + _sex_val + ".",
_options.clone()
]>>
<<else>>
<<if "brothel" in $quests.knowledge_is_power.data && $quests.knowledge_is_power.data.brothel>>
<<set _responses = [
_ronda.dialogue("After what you did for Will? It would be criminal to not let you work here. Hmm let me take a good \
look at you"),
"Ronda inspects you for a good 15 minutes,",
_ronda.dialogue("Well it looks like your current value for a 4 hour shift here at the brothel will be " +
setup.LARI + _sex_val + " lari. If you want that value to go up maybe try increasing your sex skills, but \
we don\'t pay our workers here anymore than 200 lari per shift."),
_options.clone()
]>>
<<set $quests.knowledge_is_power.data.brothel_work = true>>
<<set _refresh = true>>
<<elseif _sex_val gt 50>>
<<set _responses = [
"Ronda backs up and takes a look at you,",
_ronda.dialogue("Hmm yeah you do look like you might have potential."),
"She inspects you for a good 15 minutes,",
_ronda.dialogue("Well it looks like your current value for a 4 hour shift here at the brothel will be " +
setup.LARI + _sex_val + " lari. If you want that value to go up maybe try increasing your sex skills, but \
we don\'t pay our workers here anymore than 200 lari per shift."),
_options.clone()
]>>
<<set $quests.knowledge_is_power.data.brothel_work = true>>
<<set _refresh = true>>
<<else>>
<<set _responses = [
"Ronda backs up and takes a look at you. She immediately can tell your value is too low,",
_ronda.dialogue("Yeah, no. If you really want to whore yourself go fuck some beggers in the slums. Have some class."),
_options.clone()
]>>
<<notify>>Raise your sex skills and ask again.<</notify>>
<</if>>
<</if>>
<</button>>@@
@@#events5;<<button "5">>
<<set _will = new setup.Character("will_zeng")>>
<<set _will.first_name = "Will">>
<<set _action = 5>>
<<run _options.find("#li5").css("text-decoration", "line-through")>>
<<set _responses = [
"Ronda eyes you for a second before her face tightens into an obscene smile,",
_ronda.dialogue("Why yes... we do have a particular customer that we could not... satisfy."),
"Ronda searches over a notebook in front of her for a couple of minutes before calling out to some of \
the other staff,",
_ronda.dialogue("Is our generous patron Will still around?"),
"A distant \"yes\" echos through the hall and a large man waddles out of a corridor,",
_ronda.dialogue("Last chance to turn back..."),
"<ol>\
<li>\"Fuck it, I'll do it.\"</li>\
<li>\"I\'ll have to pass on this one.\"</li>\
</ol>"
]>>
<<set _choices = 2>>
<<set _disable_buttons = false>>
<<disableactions>>
<<unset _done_appending>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<run $("#mainLogCharacterImage").css("background-image", "url(\"" + _will.image_folder() + "will.png\")");>>
<<stop>>
<</if>><</repeat>><</silently>>
<</button>>@@
@@#events6;<<button "6">>
<</button>>@@
@@#events7;<<button "7">>
<</button>>@@
@@#events8;<<button "8">>
<</button>>@@
<<set $buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set $buttons.push("#events" + _i)>>
<</for>>
<<set $buttons_extra = ["#events_actions_back", "#events_actions_leave"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div id="events_actions_back" style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<if _refresh>>
<<goto `passage()`>>
<<else>>
<<removeclass "#actions" "hidden">>
<<addclass "#events_actions" "hidden">>
<</if>>
<</button>>
</div>
<div id="events_actions_leave" style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<timed 50ms>><<script>>
$("#events_actions").find("button").on("click", (event) => {
let _t = State.temporary;
let _v = State.variables;
let self = $(event.currentTarget);
if (self.html() == "Back" || self.html() == "Leave") {
return;
}
self.addClass("disabled");
self.prop("disabled", true);
if ("responses" in _t) {
setup.mainLog_append_delayed(_t.responses, _v.buttons, _v.buttons_extra);
delete _t.responses;
}
});
<</script>><</timed>>
<</nobr>><<nobr>>
<div id="work_actions" class="action container row col fiveQuarters smalltext longbutton hidden"
style="--rows: 4; --cols: 4">
/* Disposition towards the work */
<div style="grid-row: 1; grid-column: 1">
@@#switch;.disposition;<<button "Switch">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 2">
@@#switch;.disposition;<<button "Dom">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 3">
@@#switch;.disposition;<<button "Sub">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 4">
<<disable>>
@@#work_start;<<button "Start">>
<<include solBrothelWorkEngine>>
<</button>>@@
<</disable>>
</div>
<div id="work_actions_back" style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<addclass "#work_actions" "hidden">>
<<removeclass "#actions" "hidden">>
<<addclass "#infoLog" "hidden">>
<<removeclass "#mainLog" "hidden">>
<</button>>
</div>
<div id="work_actions_leave" style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<timed 50ms>><<script>>
$(".disposition").find("button").on("click", (event) => {
let _v = State.variables;
let player = _v.player;
let work_time = 4;
if (!(_v.gameDate.getHours() < setup.locations.get("solBrothel").access_times[1] - 4 ||
_v.gameDate.getHours() >= setup.locations.get("solBrothel").access_times[0])) {
$.wiki("<<notify>>Not enough time to work a full shift before closing.<</notify>>");
} else if (Math.abs(setup.project_stamina_change(60 * work_time)) < player.conditions.stamina) {
$(".disposition button").removeClass("disabled");
$(".disposition button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
State.temporary.niche = self.html();
$("#niche").addClass("hidden");
$("#li3").removeClass("hidden");
$("#li4").addClass("hidden");
$("#li5").addClass("hidden");
switch (State.temporary.niche) {
case "Switch":
$("#li3").html("Additional " + setup.LARI + setup.round2(player.get_status_prop("tact") / 2) + " average tip.");
$("#li4").html("-3 willpower.");
$("#li4").removeClass("hidden");
break;
case "Sub":
$("#li3").html("Additional " + setup.LARI + setup.round2(player.get_status_prop("tact")) + " average tip.");
$("#li4").html("-5 willpower.");
$("#li5").html((30 - player.stats.strength).clamp(0, 100) + "% chance of injury.");
$("#li4").removeClass("hidden");
$("#li5").removeClass("hidden");
break;
case "Dom":
$("#li3").html("+5 willpower.");
break;
}
$("#work_start button").removeClass("disabled");
$("#work_start button").prop("disabled", false);
} else {
$.wiki("<<notify>>You are too tired to work.<</notify>>");
}
});
<</script>><</timed>>
<</nobr>><<nobr>>
<<set _player = clone($player)>>
<<set _pay = setup.round2((2 * $player.sex_value()).clamp(0, 200))>>
/* Simulate 12% skill increase roll */
<<set _thresh = 12 / 100>>
<<set _increasable = []>>
<<for _key, _val range $player.sex_skills>>
<<if _val lt 60>>
<<set _increasable.push(_key)>>
<</if>>
<</for>>
<<set _roll = randomFloat(1.0)>>
<<if _roll lt _thresh && _increasable.length gt 0>>
<<set $player.sex_skills[either(_increasable)] += 1>>
<</if>>
<<switch _niche>>
<<case "Switch">>
<<set $_temp_to_log = "You whored yourself at the Sol Brothel for 4 hours as a switch, playing into whatever roles or fantasies \
that were appropriate for the time.">>
<<set $player.slave_traits.willpower -= 3>>
<<set _pay += setup.randn_bm() + ($player.get_status_prop("tact") / 2)>>
<<case "Dom">>
<<set $_temp_to_log = "You whored yourself at the Sol Brothel for 4 hours as a dominant, ruling over your victims who drew sexual \
gratification from being used.">>
<<set $player.slave_traits.willpower += 5>>
<<case "Sub">>
<<set $_temp_to_log = "You whored yourself at the Sol Brothel for 4 hours as a submissive, begging, being used, and getting fucked \
however your customers saw fit.">>
<<set $player.slave_traits.willpower -= 5>>
<<set _pay += setup.randn_bm() + ($player.get_status_prop("tact"))>>
/* Simulate injury chance */
<<set _thresh = (30 - $player.stats.strength)/100>>
<<set _roll = randomFloat(1.0)>>
<<if _roll lt _thresh>>
<<set _roll = randomFloat(1.0)>>
<<set _to_injure = 1>>
<<if _roll gte .5>>
<<set _to_injure += 1>>
<</if>>
<<set $_temp_to_log += "<div>You were careless and got hurt during your BDSM activities (Dexterity " +
setup.show_change_html(_to_injure, 0) + ")</div>">>
<<set $player.stats.dexterity -= _to_injure>>
<</if>>
<</switch>>
<<set _pay = setup.round2(_pay)>>
<<addmoney _pay>>
<<audio "coins_sound" play>>
<<include round>>
<<showChanges "Work total stat changes">>
<<addhours 4>>
<<goto `passage()`>>
<</nobr>><div id="actions" class="action container row col longbutton fiveQuarters" style="--rows: 4; --cols: 4">
<<button "Yuki">>
<<script>>
let _v = State.variables;
let _t = State.temporary;
let player = _v.player;
let yuki = _v.characters.yuki_seieki;
$("#actions").addClass("hidden");
$("#action_bar").wiki("<<include yukisGourmetYukiTalkOptions>>");
/* Disable buttons */
_t.options = _t.talk_tree[0][_t.talk_tree[0].length - 1];
_t.disable_buttons = false;
$.wiki("<<disableactions _options>>");
let responses = [];
if (!_v.quests.a_secret_of_yuki.added) {
_t.started_talking = true;
responses.push(`\
As you approach Yuki, an intriguing scent fills your senses. It's familiar yet elusive - a tinge of sea breeze with a hint of musk, \
but underneath it all, there's a singular note, a delicate balance of sweetness and salt. It's Yuki's unique scent, but it's also \
something more - something unidentifiable that nudges at the back of your mind. Your thought gets quickly interrupted...\
`);
responses.push(yuki.dialogue("Welcome to Yuki's Gourmet, how may I help you?"));
responses.push(_t.talk_tree[0][0]);
setup.mainLog_append_delayed(responses, _v.buttons, _v.buttons_extra, 1000, true, null,
() => {
_v.quests.a_secret_of_yuki.added = true;
_v.quest_journal.ongoing.push("a_secret_of_yuki");
$.wiki(`<<notify>>Quest <em>A Secret of Yuki</em> added to journal!<</notify>>`);
$.wiki(`<<audio "quest_added_sound" play>>`);
}
);
} else if (!_t.started_talking) {
_t.started_talking = true;
responses.push(`\
As you approach Yuki, you are once again reminded of her unique scent. Despite expecting it, it still somehow sharply surprises you. Your thought gets quickly interrupted...\
`);
responses.push(yuki.dialogue("Welcome to Yuki's Gourmet, how may I help you?"));
responses.push(_t.talk_tree[0][0]);
setup.mainLog_append_delayed(responses, _v.buttons, _v.buttons_extra);
}
/* Show Yuki's disposition */
$("#char_quick_info").empty();
$("#char_quick_info").html("<b>Yuki's Disposition: </b>" + setup.titleCase(yuki.get_disposition()));
<</script>>
<</button>>
<<disable>>
<<button "Dining">>
<</button>>
<</disable>>
<<disable>>@@#work;<<button "Work">>
<<script>>
let player = State.variables.player;
if (player.is_slave) {
$.wiki("<<notify>>Must not be a slave to work at Yuki's!<</notify>>")
} else {
/* Hide actions and include work actions */
$("#actions").addClass("hidden");
$("#action_bar").wiki("<<include yukisGourmetWorkActions>>");
/* Hide main log and include info log */
$("#mainLog").addClass("hidden");
$("#infoLog").removeClass("hidden");
/* Fill info log with work information */
$("#info_title").html("Working at Yuki's Gourmet");
$("#infoLogBody").html("Under construction");
}
<</script>>
<</button>>@@<</disable>>
<div style="grid-row: 1; grid-column: 4"></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div style="grid-row: 3; grid-column: 4"></div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<script>>
let _v = State.variables;
let _t = State.temporary;
$(document).one(':passagedisplay', function() {
if ("work" in _v.locations.yukisGourmet.data && _v.locations.yukisGourmet.data.work) {
$("#work button").prop("disabled", false);
$("#work button").removeClass("disabled");
}
});
<</script>><div id="work_actions" class="action container row col longbutton fiveQuarters" style="--rows: 4; --cols: 4">
<div style="grid-row: 1; grid-column: 4">
<<disable>>
@@#workStartButton;<<button "Start">>
/* TODO: Engine */
<</button>>@@
<</disable>>
</div>
/* How long we want to work for */
<div style="grid-row: 1; grid-column: 1">
@@#work1Hr;<<button "1 Hour">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 2">
@@#work4Hr;<<button "4 Hours">>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 3">
@@#work8Hr;<<button "8 Hours">>
<</button>>@@
</div>
<div style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<run $("#work_actions").remove()>>
<<removeclass "#actions" "hidden">>
<<removeclass "#mainLog" "hidden">>
<<addclass "#infoLog" "hidden">>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<timed 50ms>><<script>>
let _v = State.variables;
let _t = State.temporary;
let player = _v.player;
$("#work_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
if ('1' <= self.html()[0] && self.html()[0] <= '8') {
let hours_to_work = parseInt(self.html()[0], 10);
/* Check if there's enough stamina and time to work */
if (player.conditions.stamina > setup.project_stamina_change(hours_to_work * 60, false, true, false)) {
if (_v.gameDate.getHours() + hours_to_work > 22) {
$.wiki(`<<notify>>Too late to work ${hours_to_work} ${(hours_to_work > 1) ? "hours" : "hour"}.<</notify>>`);
} else {
/* Disable self and enable others */
$("[id$='Hr']").find("button").prop("disabled", false);
$("[id$='Hr']").find("button").removeClass("disabled");
self.prop("disabled", true);
self.addClass("disabled");
/* Save number of hours to work */
_t.to_advance_hr = hours_to_work;
/* Enable start button */
$("#workStartButton button").prop("disabled", false);
$("#workStartButton button").removeClass("disabled");
}
} else {
$("#infoLogBody").html("");
/* TODO */
$("#infoLogBody").append(_t.default_info.clone());
var _to_notify = "You are too tired to work " + hours_to_work;
if (hours_to_work == 1) {
_to_notify += " hour.";
} else {
_to_notify += " hours.";
}
$.wiki("<<notify>>" + _to_notify + "<</notify>>");
}
}
});
<</script>><</timed>><div id="events_actions" class="action container row col" style="--rows: 4; --cols: 5">
<<set _talk_path_idx = []>>
<<set _talk_path = []>>
<<set _talk_tree = [
[$(`<ol>\
<li id='li1'>Ask about the restaurant.</li>\
<li id='li2'>Ask about Nipon.</li>\
<li id='li3'>Ask about herself.</li>\
<li id='li4'>Compliment.</li>\
</ol>`)
],
[
[
[
$player.dialogue("I wanted to ask some questions about this restaurant."),
_yuki.dialogue("Sure, what did you want to know?"),
$(`<ol>\
<li id='li1'>Type of establishment.</li>\
<li id='li2'>Dining options.</li>\
<li id='li3'>History of the restaurant.</li>\
<li id='li4'>Secret to success.</li>\
<li id='li5'>If you could work here.</li>\
</ol>`)
], null
],
[
[
$player.dialogue("I wanted to ask some questions about Nipon."),
_yuki.dialogue("Um... Sure I guess?"),
$(`<ol>\
<li id='li1'>Role in Nipon.</li>\
<li id='li2'>Opinion on Nipon.</li>\
</ol>`)
], null
],
[
[
$player.dialogue("I wanted to ask some questions personal questions."),
_yuki.dialogue("Um... Sure I guess?"),
$(`<ol>\
<li id='li1'>Her past.</li>\
<li id='li2'>Her likes and dislikes.</li>\
<li id='li3'>Her distinct scent.</li>\
</ol>`)
], null
],
[
[
`What would you like to compliment?`,
$(`<ol>\
<li id='li1'>Her outfit.</li>\
<li id='li2'>Her hair.</li>\
<li id='li3'>Her scent.</li>\
<li id='li4'>Her body.</li>\
</ol>`)
], null
]
]
]>>
@@#events1;<<button "1">>
<</button>>@@
@@#events2;<<button "2">>
<</button>>@@
@@#events3;<<button "3">>
<</button>>@@
@@#events4;<<button "4">>
<</button>>@@
@@#events5;<<button "5">>
<</button>>@@
@@#events6;<<button "6">>
<</button>>@@
@@#events7;<<button "7">>
<</button>>@@
@@#events8;<<button "8">>
<</button>>@@
<<set $buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set $buttons.push("#events" + _i)>>
<</for>>
<<set $buttons_extra = ["#events_actions_back", "#events_actions_leave"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div id="events_actions_back" style="grid-row: 3; grid-column: 5">
<<button "Back">>
<</button>>
</div>
<div id="events_actions_leave" style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "yukisGourmet">>
<<include locationButton>>
</div>
</div>
<<timed 50ms>><<script>>
let _v = State.variables;
let _t = State.temporary;
let player = _v.player;
let yuki = _v.characters.yuki_seieki;
$("#events_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
let cur_branch = null;
/* Filter out non-action buttons */
if (self.html() == "Leave") {
return;
} else if (self.html() == "Back") {
if (_t.talk_path.length == 0) {
$("#actions").removeClass("hidden");
$("#events_actions").remove();
$("#char_quick_info").empty();
delete(_t.talk_path);
} else {
_t.talk_path.pop();
_t.talk_path_idx.pop();
if (_t.talk_path.length == 0) {
cur_branch = _t.talk_tree;
} else {
cur_branch = _t.talk_path[_t.talk_path.length - 1];
}
/* Render last of dialogue list (choices) */
_t.options = cur_branch[0][cur_branch[0].length - 1];
_t.disable_buttons = false;
$.wiki("<<disableactions _options>>");
setup.mainLog_append_delayed([player.dialogue("Actually I wanted to ask about something else."), cur_branch[0][cur_branch[0].length - 1]], _v.buttons, _v.buttons_extra);
}
} else {
if (_t.talk_path.length == 0) {
cur_branch = _t.talk_tree;
} else {
cur_branch = _t.talk_path[_t.talk_path.length - 1];
}
/* Get index of the choice */
let choice_idx = Number(self.html()) - 1;
if (cur_branch[1] != null && cur_branch[1][choice_idx] != null) {
_t.talk_path.push(cur_branch[1][choice_idx]);
_t.talk_path_idx.push(choice_idx);
cur_branch = _t.talk_path[_t.talk_path.length - 1];
_t.options = cur_branch[0][cur_branch[0].length - 1].clone();
_t.disable_buttons = false;
$.wiki("<<disableactions _options>>");
setup.mainLog_append_delayed(cur_branch[0], _v.buttons, _v.buttons_extra);
} else {
let responses = [];
let end_hook = () => {};
let disposition = yuki.get_disposition();
/* Used for useless button clicks (ie during compliment sequence) */
let do_nothing = false;
/* For unskippable events */
let is_event = false;
/* For end of event (returning) */
let is_event_end = false;
let delta = null;
/* Leaf logic */
if (_t.talk_path.length == 1) {
switch(_t.talk_path_idx[_t.talk_path_idx.length - 1]) {
case 0:
switch(choice_idx) {
case 0:
responses = [
player.dialogue(`Tell me about this restaurant`),
`Yuki casts a quick glance around the bustling establishment, a fond smile gracing her lips.`,
yuki.dialogue(`Ah, Yuki's Gourmet. It's more than just a restaurant - it's a place where you can experience a symphony of unique flavors.`),
`She sweeps an arm across the room, a sense of pride shining in her eyes.`,
yuki.dialogue(`Every dish here tells a story, has its own personality. I create them with the intent of offering a culinary experience that you won't find anywhere else.`),
`The fond smile never leaves her face as she speaks about her restaurant, the one place in Nipon that's unmistakably hers.`
];
break;
case 1:
responses = [
player.dialogue(`What kind of dining options do you offer?`),
`Yuki gently taps her chin, her eyes reflecting a playful glint.`,
yuki.dialogue(`We pride ourselves on a diverse menu that appeals to a wide range of palates. From hearty comfort food to exotic delicacies, we've got it all.`),
`She lets out a soft chuckle, her gaze meeting yours. The corner of her lips curve up in a mischievous smile.`,
yuki.dialogue(`All of our food is quite... distinctively ours...`)
];
break;
case 2:
responses = [
player.dialogue(`Tell me about the history of this place.`),
`Yuki leans back, her gaze unfocused as she delves into memories.`,
yuki.dialogue(`Ah, the story of Yuki's Gourmet. It's a tale intertwined with the very roots of Nipon itself. You see, when this settlement was nothing but a dream in Shintani's mind, I had my own visions. I dreamt of a sanctuary of taste, a place where every bite told a story. So, as Nipon rose from the ashes of the old world, Yuki's Gourmet was born. It started small, just another building in a growing town. But as the settlement expanded, so did we. We've served everyone, from weary travelers to high-ranking officials. Our dishes have a way of bringing people together... despite the shattered world around us.`),
`She ends her narrative with a content sigh, her gaze coming back to focus on you.`
];
break;
case 3:
responses = [
player.dialogue(`What's your secret to success?`),
`Yuki pauses for a moment, taken aback by the directness of your question. A knowing smile tugs at the corners of her lips.`,
yuki.dialogue(`Well, much of it is hard work and a deep love for what I do. But I would be remiss not to acknowledge the... special ingredient that's played a role. It's very... unique, lending a certain allure to our dishes that people find hard to resist. But alas, a secret it must remain.`)
];
break;
case 4:
if ("work" in _v.locations.yukisGourmet.data && _v.locations.yukisGourmet.data.work && !player.is_slave) {
responses = [
yuki.dialogue(`I've already allowed you to work here haven't I? I don't give that permission lightly you know?`)
];
} else if ("work" in _v.locations.yukisGourmet.data && _v.locations.yukisGourmet.data.work) {
responses = [
yuki.dialogue(`I would... I really, really would... I'd love to share unique tastes with you, but...`),
`She glances down at the amulet adorning your neck`,
yuki.dialogue(`Maybe in the future when your circumstances change?`)
];
} else if (disposition == "devoted" || disposition == "submissive") {
if (player.is_slave) {
responses = [
yuki.dialogue(`I would... I really, really would... I'd love to share unique tastes with you, but...`),
`She glances down at the amulet adorning your neck`,
yuki.dialogue(`Maybe in the future when your circumstances change?`)
];
end_hook = () => {
$.wiki("<<notify>>Free yourself from Shintani before tangling yourself with Yuki.<</notify>>");
};
} else {
if (player.gender == 0) {
responses = [
player.dialogue(`Can I work here, Yuki?`),
`Yuki lights up, her pink cheeks growing even brighter, a mischievous glint flickering in her eyes.`,
yuki.dialogue(`I suppose... I could use some extra hands around the place. But...`),
`She lowers her gaze, looking almost shy.`,
yuki.dialogue(`You know about... my special ingredient, right? If you're willing to... contribute, then I'd be happy to have you.`),
`She steps closer, grazing across your crotch licking her lips.`
];
} else {
responses = [
player.dialogue(`Can I work here, Yuki?`),
`A flicker of contemplation lights up Yuki's eyes, considering the offer.`,
yuki.dialogue(`Well, I could certainly use the help. But... there's a condition. Normally I might ask for a taste or contribution, but you not having any cum to give me...`),
`Her gaze locks onto yours, equal parts earnest and excited. She looks away momentarily, as if gathering her thoughts, then looks back at you, eyes sparkling with anticipation.`,
yuki.dialogue(`Instead... Could you try... experiencing it? I mean, not just soaking in it, but also tasting it. Savour the creaminess, the tang, the life in it...`),
];
}
if (_v.quests.a_secret_of_yuki.stage == 3) {
_t.talk_path.push([
[
$(`<ol>\
<li id='li1'>Give into her demand.</li>\
<li id='li2'>Refuse.</li>\
<li id='li3'>Leverage connections instead.</li>\
</ol>`)
], null
]);
} else {
_t.talk_path.push([
[
$(`<ol>\
<li id='li1'>Give into her demand.</li>\
<li id='li2'>Refuse.</li>\
</ol>`)
], null
]);
}
_t.talk_path_idx.push(0);
is_event = true;
}
} else if (_v.quests.a_secret_of_yuki.stage == 3) {
if (player.is_slave) {
responses = [
player.dialogue(`Can I work here, Yuki?`),
`Yuki's eyes dart away, surprise flickering across her face. You can tell the question has caught her off-guard.`,
yuki.dialogue(`I... I'm afraid that's not possible. I prefer to keep the staff to a minimum for quality control. I apologize.`),
`The regret in her voice feels genuine, yet you sense something else, a hint of relief perhaps.`,
player.dialogue(`The provider deems it favorable`),
`Yuki's eyes widen, her hungry gaze locking onto yours. You swear you can almost see her slightly drool, her cheeks flushing pink.`,
yuki.dialogue(`I... I see. Well, in that case, I suppose I could use some extra hands around the place. But...`),
`She stops in her tracks and notices the amulet adorning your neck`,
yuki.dialogue(`Sorry... but no, I have hard lines that not even the provider can convince me to cross.`)
];
end_hook = () => {
$.wiki("<<notify>>Free yourself from Shintani before tangling yourself with Yuki.<</notify>>");
};
} else {
delta = {
"slave_traits": {
"obedience": 10
}
};
responses = [
player.dialogue(`Can I work here, Yuki?`),
`Yuki's eyes dart away, surprise flickering across her face. You can tell the question has caught her off-guard.`,
yuki.dialogue(`I... I'm afraid that's not possible. I prefer to keep the staff to a minimum for quality control. I apologize.`),
`The regret in her voice feels genuine, yet you sense something else, a hint of relief perhaps.`,
player.dialogue(`The provider deems it favorable`),
`Yuki's eyes widen, her hungry gaze locking onto yours. You swear you can almost see her slightly drool, her cheeks flushing pink.`,
yuki.dialogue(`I... I see. Well, in that case, I suppose I could use some extra hands around the place. But... if you behave even a bit out of line, I'll have to let you go. Understood?`),
player.dialogue(`Yes, Yuki.`),
yuki.print_delta(delta)
];
_v.quests.a_secret_of_yuki.stage += 1;
end_hook = () => {
setup.apply_delta(delta);
_v.locations.yukisGourmet.data["work"] = true;
$('#work').find("button").prop("disabled", false);
$('#work').find("button").removeClass("disabled");
};
}
} else {
responses = [
player.dialogue(`Can I work here, Yuki?`),
`Yuki's eyes dart away, surprise flickering across her face. You can tell the question has caught her off-guard.`,
yuki.dialogue(`I... I'm afraid that's not possible. I prefer to keep the staff to a minimum for quality control. I apologize.`),
`The regret in her voice feels genuine, yet you sense something else, a hint of relief perhaps.`
];
end_hook = () => {
$.wiki("<<notify>>Raise Yuki's disposition or delve into her secret.<</notify>>");
};
}
break;
}
break;
case 1:
switch(choice_idx) {
case 0:
responses = [
player.dialogue(`What's your opinion of Nipon?`),
`There's a pause before Yuki answers, her gaze fixed on something beyond the confines of the restaurant, something distant and intangible. Her gaze returns to you, a flicker of hidden intent dancing in her eyes.`,
yuki.dialogue(`My role here, as I see it, is to offer an oasis of flavors and experiences. I strive to craft moments of respite within these walls, moments that people can carry with them when they step back into the broader strokes of Nipon.`)
];
break;
case 1:
responses = [
player.dialogue(`What's your opinion of Nipon?`),
`Yuki glances out the window, her gaze distant.`,
yuki.dialogue(`Nipon... it's complex, full of shadows and light. But I'm more concerned with the happenings within these walls.`),
`She turns her attention back to you, the light in her eyes a curious mix of passion and mystery.`,
yuki.dialogue(`Here in Yuki's Gourmet, we serve more than just food. We serve experiences, each plate a story, each bite a memory. This, I believe, is where I can make a difference, in my own little way.`)
];
break;
}
break;
case 2:
switch(choice_idx) {
case 0:
if (disposition == "devoted" || disposition == "submissive" || disposition == "warm") {
responses = [
player.dialogue(`Tell me about your past.`),
`Yuki looks at you for a moment, her gaze thoughtful.`,
yuki.dialogue(`I was born into a world of prosperity and privilege, thanks to my family's close ties with the Hiroyukis. Politics and power plays were my lullabies, but I was more interested in the diverse cultures of the old world.`),
`She pauses, her fingers tracing the edge of a nearby table.`,
yuki.dialogue(`But amidst it all, I discovered a certain... addiction. A taste, a sensation that's uniquely captivating. A hidden pleasure that only the truly adventurous would dare to try.`),
`Her eyes gleam, hinting at a secret she's yet to reveal.`,
yuki.dialogue(`That's when the idea of Yuki's Gourmet came to me. A place where I could satisfy my newfound passion while also bringing a piece of the world's flavor to Nipon. It's a haven for all things unique and delightful, don't you think?`)
];
} else {
responses = [
player.dialogue(`Tell me about your past.`),
`Yuki's smile falters for a moment, replaced by a guarded expression.`,
yuki.dialogue(`I'm afraid my past isn't on the menu, not for today at least. Let's focus on the present and the delicacies that await us, shall we?`)
];
end_hook = () => {
$.wiki("<<notify>>Raise Yuki's disposition to learn more.<</notify>>");
};
}
break;
case 1:
if (disposition == "devoted" || disposition == "submissive") {
responses = [
player.dialogue(`What are your likes and dislikes?`),
`Yuki's eyes glimmer with a rare vulnerability, her guard seemingly lowered.`,
yuki.dialogue(`Since we share such a deep connection, I can confide in you. My passion, my obsession... it's cum.`),
`She opens her palm to reveal a small vial, containing a thick, milky substance. You realize it's semen.`,
yuki.dialogue(`The taste, the scent, the very essence of it... it's an addiction. Its sweetness is intertwined with an undercurrent of saltiness, a slight bitterness dancing beneath the surface. The scent... it's a heady, musky aroma that somehow feels comforting and intoxicating at the same time.`),
`She holds the vial close to her lips, her eyes closing as if savoring an invisible taste.`,
yuki.dialogue(`The texture, it's a dichotomy, thick yet fluid, each strand has its own identity. I savor it, let it roll on my tongue, feel its warmth filling my mouth. And the lingering aftertaste... it's like a secret promise that keeps me yearning for more.`),
`She tucks the vial back into her pocket, her gaze steady.`,
yuki.dialogue(`I always keep a vial with me. It's my personal indulgence, my hidden treasure. As for dislikes... anything that tries to deny me my passion. But this stays between us, doesn't it?`),
];
if ("work" in _v.locations.yukisGourmet.data && _v.locations.yukisGourmet.data["work"]) {
if (yuki.limits.fuck > 0) {
responses.push(`Yuki hestitates for a moment before she leans in, her lips brushing against your ear.`);
if (player.gender == 0) {
responses.push(yuki.dialogue(`Perhaps you can give me a taste of yours?`));
} else {
responses.push(yuki.dialogue(`Perhaps you'd like to experience it yourself?`));
}
_t.talk_path.push([
[
$(`<ol>\
<li id='li1'>Accept Yuki's proposal.</li>\
<li id='li2'>Refuse.</li>\
</ol>`)
], null
]);
_t.talk_path_idx.push(0);
is_event = true;
} else {
responses.push(`Yuki hestitates for a moment before she leans in, her lips brushing against your ear.`);
if (player.gender == 0) {
responses.push(yuki.dialogue(`I love to get a taste of yours, but I'm a little tired today, why don't you come back tomorrow?`));
} else {
responses.push(yuki.dialogue(`I'd love to indulge in it with you, but I'm a little tired today, why don't you come back tomorrow?`));
}
}
}
} else if (disposition == "warm") {
responses = [
player.dialogue(`What are your likes and dislikes?`),
`Yuki laughs softly, her eyes glowing with a mixture of amusement and excitement.`,
yuki.dialogue(`Now that we're on more familiar terms... I must confess, I'm drawn to distinctive... tastes and smells. You know, the kind that lingers, that leaves a trace, evokes a certain... sensation. It's intriguing, even addictive to some.`),
`She leans in closer, her gaze intensifying.`,
yuki.dialogue(`And what I dislike? The mundane, the lackluster. The world is a veritable banquet, each experience is like a flavor waiting to be savored. It would be a tragedy not to indulge, don't you agree?`),
`She leans back, her eyes never leaving yours, as if daring you to discover more.`
];
end_hook = () => {
$.wiki("<<notify>>Raise Yuki's disposition to learn more.<</notify>>");
};
} else {
responses = [
player.dialogue(`What are your likes and dislikes?`),
`Yuki seems slightly taken aback by your personal question, but she regains her composure quickly.`,
yuki.dialogue(`Well, that's an unexpected question. As the owner of a restaurant, I must say, I have a profound appreciation for... taste, in its many forms. As for dislikes... I suppose anything that compromises my patrons' dining experience.`),
];
end_hook = () => {
$.wiki("<<notify>>Raise Yuki's disposition to learn more.<</notify>>");
};
}
break;
case 2:
if (disposition == "devoted" || disposition == "submissive") {
responses = [
player.dialogue(`You smell quite interesting.`),
`A warm blush colors Yuki's cheeks as she looks at you, a spark of excitement in her eyes.`,
yuki.dialogue(`It's... it's cum. I love the smell of it. The rich, heady scent that's both sweet and salty, with a hint of muskiness... it's intoxicating.`),
`She sighs, a dreamy expression crossing her face.`,
yuki.dialogue(`Every morning, I apply a bit of cum behind my ears, on my wrists, my neck... It's a ritual for me. The smell... it gets me wet. I need it, need to have it on me, around me. It's a part of who I am...`),
];
if ("work" in _v.locations.yukisGourmet.data && _v.locations.yukisGourmet.data["work"]) {
if (yuki.limits.fuck > 0) {
responses.push(`Yuki hestitates for a moment before she leans in, her lips brushing against your ear.`);
if (player.gender == 0) {
responses.push(yuki.dialogue(`Perhaps you can give me a taste of yours?`));
} else {
responses.push(yuki.dialogue(`Perhaps you'd like to experience it yourself?`));
}
_t.talk_path.push([
[
$(`<ol>\
<li id='li1'>Accept Yuki's proposal.</li>\
<li id='li2'>Refuse.</li>\
</ol>`)
], null
]);
_t.talk_path_idx.push(0);
is_event = true;
} else {
responses.push(`Yuki hestitates for a moment before she leans in, her lips brushing against your ear.`);
if (player.gender == 0) {
responses.push(yuki.dialogue(`I love to get a taste of yours, but I'm a little tired today, why don't you come back tomorrow?`));
} else {
responses.push(yuki.dialogue(`I'd love to indulge in it with you, but I'm a little tired today, why don't you come back tomorrow?`));
}
}
}
} else if (disposition == "warm") {
responses = [
player.dialogue(`This might sound weird, but you smell... quite distinct.`),
`A blush deepens on Yuki's cheeks, her eyes glinting with a mix of amusement and arousal.`,
yuki.dialogue(`Well, isn't that quite the observation. I guess I can't hide my secret from you any longer. I do love my unique scent... it has a certain... allure, doesn't it?`),
`She pauses, her lips curling into a playful smile.`,
yuki.dialogue(`There's something I apply, something special... it's behind the ears, on the wrists... all over really. It's a part of me, my... essence if you will.`),
`The mysterious glow in her eyes intensifies as she watches your reaction, savoring your curiosity.`
];
end_hook = () => {
$.wiki("<<notify>>Raise Yuki's disposition to learn more.<</notify>>");
};
} else {
responses = [
player.dialogue(`You smell... quite distinct.`),
`A hint of surprise flashes across Yuki's face, but she quickly recovers, a subtle blush creeping onto her cheeks.`,
yuki.dialogue(`Why, thank you. I suppose it's the scent of the unique ingredients I work with. Quite unforgettable once you've had a taste...`)
];
end_hook = () => {
$.wiki("<<notify>>Raise Yuki's disposition to learn more.<</notify>>");
};
}
break;
}
/* Progress Yuki's quest to stage 1 regardless of option chosen */
_v.quests.a_secret_of_yuki.stage = 1;
break;
case 3:
/* Check compliment limits */
if (yuki.limits.influence <= 0) {
$.wiki("<<notify>>Already complimented Yuki too many times today!<</notify>>");
do_nothing = true;
break;
} else {
yuki.limits.influence -= 1;
}
/* Roll tact for success */
let difficulty = _v.difficulty;
let roll = player.get_status_prop("tact") + 2 * (dice(1, 6 + difficulty) - difficulty) - yuki.mental_conditions.anger + yuki.slave_traits.trust / 20;
let thresh = 25 + 5 * (-1/100 * yuki.slave_traits.obedience);
/* Harder to pass compliment of body */
if (choice_idx == 3) {
thresh += 5;
}
/* Silver tongue title */
if (player.titles.has("silver_tongued")) {
roll += 1;
}
let passed = roll >= thresh;
delta = {
"slave_traits": {}
};
if (yuki.slave_traits.obedience > 60) {
delta.slave_traits["obedience"] = 1;
} else {
delta.slave_traits["obedience"] = 2;
}
if (choice_idx == 3) {
delta.slave_traits["obedience"] += 1;
}
if (passed) {
responses = [setup.pass("tact", false)];
end_hook = () => {
setup.apply_delta(yuki, delta);
$("#char_quick_info").empty();
$("#char_quick_info").html("<b>Yuki's Disposition: </b>" + setup.titleCase(yuki.get_disposition()));
};
} else {
responses = [setup.fail("tact", false)];
}
switch(choice_idx) {
case 0:
if (passed) {
responses = responses.concat(either([
[
`Summoning your courage, you voice your admiration.`,
player.dialogue(`You look quite lovely in that pink hanfu, Yuki.`),
`Her eyes light up in surprise, a smile slowly spreading across her face.`,
yuki.dialogue(`Why, thank you. I appreciate the kind words.`),
`Her warmth encourages you, a testament to your successful compliment.`
],
[
`Noting the intricacies of her outfit, you decide to be more specific.`,
player.dialogue(`The embroidery on your dress is exquisite, Yuki.`),
`Her face brightens in delight, clearly pleased with your observation.`,
yuki.dialogue(`You have a keen eye. It's one of my favorite pieces.`),
`She appreciates your attention to detail, validating the success of your compliment.`
],
[
`Feeling confident, you express your thoughts about her overall appearance.`,
player.dialogue(`Yuki, the pink hanfu suits your demeanor perfectly.`),
`She pauses, obviously taken aback, then gives a warm laugh.`,
yuki.dialogue(`Well, that's certainly one I haven't heard before. Thank you.`),
`She seems genuinely amused, marking a successful compliment.`
],
[
`You take a moment to appreciate her entire look before complimenting.`,
player.dialogue(`The elegance of your dress matches your grace, Yuki.`),
`She gazes back at you, her eyes twinkling with appreciation.`,
yuki.dialogue(`That's quite the compliment. Thank you.`),
`Her gratitude is palpable, indicating that your compliment was indeed successful.`
]
]));
responses.push(yuki.print_delta(delta));
} else {
responses = responses.concat(either([
[
`You attempt to gather your thoughts, wanting to compliment her outfit but the words seem to stumble out awkwardly.`,
player.dialogue(`Your... um... the dress... it's... pink?`),
`A soft, flustered giggle escapes from Yuki. Her cheeks blush a rosy hue, matching her hanfu dress.`,
yuki.dialogue(`Well, yes, it is indeed pink. Thank you for noticing.`),
`She smiles, trying to ease your embarrassment, her graceful manner making you feel a bit better about your failed compliment.`
],
[
`You glance at Yuki, trying to articulate your thoughts about her dress.`,
player.dialogue(`That... um... your outfit, it's...uh... very hanfu?`),
`A puzzled frown creases her brows, but she maintains her composed demeanor.`,
yuki.dialogue(`Indeed, it is a hanfu. I'm glad you recognized it.`),
`Her curt response tells you that your compliment didn't land as intended, yet she manages to keep the situation from becoming too awkward.`
],
[
player.dialogue(`Your... um... the clothing... it's... like a flower?`),
`A thin smile forms on Yuki's lips as she holds back a chuckle.`,
yuki.dialogue(`Well, it is floral patterned. I appreciate the sentiment.`),
`Even though your attempt was clumsy, Yuki's graceful response softens the blunder.`
],
[
player.dialogue(`That... um... your dress... it's very... um... pinky?`),
`Yuki raises an eyebrow at the odd phrasing, a hint of amusement in her eyes.`,
yuki.dialogue(`'Pinky'? That's a new one. But yes, it's certainly pink. I'm flattered you noticed.`),
`Even with your stumbling words, Yuki handles the situation with finesse, easing the discomfort of your failed compliment.`
]
]));
}
break;
case 1:
if (passed) {
responses = responses.concat(either([
[
player.dialogue(`Your hair is quite eye-catching, Yuki. Its pink color adds a unique charm.`),
`Your compliment lands smoothly, eliciting a pleased smile from Yuki.`,
yuki.dialogue(`Thank you! I've always thought it was a bit bold, but I'm glad you like it.`),
`Her fingers play with a strand of her hair as she responds, the delight in her voice palpable.`
],
[
`Eyeing her hair, you take a moment before articulating your thoughts.`,
player.dialogue(`Your hair... it's really beautiful. The pink color suits you.`),
`The compliment earns you a genuinely pleased smile.`,
yuki.dialogue(`Thank you, that's very kind of you to say.`),
`Her face softens, her eyes sparkling with amusement.`
],
[
`With your eyes on her hair, you compliment her.`,
player.dialogue(`Your hair looks lovely, Yuki. Its pink hue gives off a lively vibe.`),
`A broad smile curves her lips at your words.`,
yuki.dialogue(`Thank you! I've always liked its pinkness too.`),
`Yuki runs her fingers through her hair, looking slightly more relaxed.`
],
[
player.dialogue(`I really like your hair, Yuki. The disheveled look gives it an interesting texture.`),
`Her eyes meet yours, the surprise giving way to a pleasant smile.`,
yuki.dialogue(`I didn't expect that, but thank you. I appreciate it.`),
`Yuki's fingers find her hair, teasing out the loose strands, her grin never leaving her face.`
],
[
`You take a moment to appreciate her appearance before saying,`,
player.dialogue(`The pink of your hair matches your dress perfectly, Yuki. It's quite charming.`),
`Her lips curve into a delighted smile at your words.`,
yuki.dialogue(`Thank you! I've always liked how they complement each other.`),
`Her fingers absentmindedly touch her hair as she grins, clearly pleased with your observation.`
]
]));
responses.push(yuki.print_delta(delta));
} else {
responses = responses.concat(either([
[
player.dialogue(`I like your...hair? It's interestingly pink.`),
`You cringe at your own words, hoping she doesn't take offense.`,
yuki.dialogue(`Interesting, you say? Well, thank you for the...compliment.`),
`She chuckles, her fingers brushing against her hair. The laughter is friendly, softening the awkward moment.`
],
[
`You decide to mention her hair, though your words don't come out as expected.`,
player.dialogue(`Your hair...looks like...erm...a pink... waterfall?`),
`You immediately regret the comparison, but Yuki only smiles.`,
yuki.dialogue(`Well, that's certainly creative. I'll take it as a compliment.`),
`She laughs, the sound echoing around the room and dissolving the awkwardness.`
],
[
player.dialogue(`Your hair...it's...very pink...and long.`),
`The words hang in the air, and Yuki simply raises an eyebrow.`,
yuki.dialogue(`Is that so? Well, thank you for observing.`),
`Despite the failed compliment, she handles it with grace and humor, lightening the mood.`
],
[
`Without thinking, you blurt out your thoughts on her hair.`,
player.dialogue(`Your hair...it's...like a pink, messy...uh...wave.`),
`There's a moment of silence before Yuki bursts into laughter.`,
yuki.dialogue(`A pink wave, huh? Well, that's new. Thanks, I suppose.`),
`Though your compliment came out a bit clumsily, she seems more amused than offended.`
],
[
`Attempting to compliment her unique hairstyle, you fumble.`,
player.dialogue(`Your hair, it's...unruly...in a good way?`),
`A moment of silence ensues, then Yuki bursts out laughing.`,
yuki.dialogue(`Well, that's one way to describe it. Thank you, I guess?`),
`Despite the awkwardness, she appreciates the effort, smoothing a hand through her hair with a chuckle.`
],
[
`Emboldened, you decide to voice your thoughts.`,
player.dialogue(`Your hair reminds me of...a candy floss cloud.`),
`Yuki blinks in surprise, and then a grin spreads across her face.`,
yuki.dialogue(`That's certainly a unique compliment. I appreciate it.`),
`She playfully tousles her hair, the tension easing.`
]
]));
}
break;
case 2:
if (passed) {
if (disposition == "devoted" || disposition == "submissive") {
responses = responses.concat(either([
[
player.dialogue(`You always smell so... vibrant, Yuki. It's like you've bathed in life's essence itself.`),
`Her eyes twinkle with delight, a wicked grin curling her lips.`,
yuki.dialogue(`Well, I do bathe in something... you could call it life's essence. Or cum, if you prefer. It's invigorating. It smells musky, a bit salty but also subtly sweet... it's alluring, isn't it? I can't help but crave for it.`),
`She chuckles, a blush spreading across her cheeks, her passion and appetite quite evident.`
],
[
player.dialogue(`Yuki, your scent is intoxicating. Like... raw passion embodied.`),
`She lets out a soft laugh, leaning in a bit closer.`,
yuki.dialogue(`Oh, it's more than passion. It's cum. Pure, blissful cum. The scent is powerful, rich... it's like the promise of unspoken pleasure, and it leaves me starving.`),
`Her words are hushed, her voice brimming with satisfaction.`
],
[
player.dialogue(`There's something about your scent, Yuki... It's hard to describe, but it's so captivating.`),
`Her lips curve into a knowing smile, her gaze sparkling with mischief.`,
yuki.dialogue(`You're too kind. I just simply adorn myself with my favorite scent... the fragrance of cum. It's like a feast for my senses, every whiff makes my mouth water.`),
`She says it so nonchalantly, it's almost mesmerizing.`
],
[
player.dialogue(`Your scent is potent, Yuki. It's like... virility and warmth.`),
`Her smile grows wider, her eyes twinkling with delight.`,
yuki.dialogue(`Well, it is the smell of cum. It's the smell I love the most in the world. It's heady, raw and inviting. I feel like I'm in the presence of a scrumptious meal... I can hardly resist.`),
`Her voice holds a note of pride, her satisfaction unmistakable.`
]
]));
} else {
responses = responses.concat(either([
[
player.dialogue(`Your scent, Yuki... It's quite intriguing. Like the sea... salty and fresh.`),
`Yuki's eyes light up, a warm smile appearing on her face. She seems pleasantly surprised.`,
yuki.dialogue(`Why, thank you. I take it as a compliment.`),
`There's a subtle blush on her cheeks, as if your words have touched something deep within her.`
],
[
player.dialogue(`You have a very unique scent, Yuki. It's like... rain on concrete. Clean and raw.`),
`She blinks in surprise, her features softening into a pleased expression.`,
yuki.dialogue(`That's... an interesting comparison. I'm flattered.`),
`Her voice carries a hint of amusement and curiosity, as though she's intrigued by your unconventional compliment.`
],
[
player.dialogue(`I must say, you smell... inviting. Almost comforting, in a way.`),
`Her eyes widen a fraction, her face flushing a pleasant shade of pink. There's a sparkle in her eyes that wasn't there before.`,
yuki.dialogue(`Well, that's very kind of you to say. Thank you.`),
`She sounds genuinely flattered, a pleased smile playing on her lips.`
],
[
player.dialogue(`Your scent... it's intriguing. Familiar, yet different. Alluring, even.`),
`Yuki blushes at your words, her eyes lighting up in a way that makes her look more youthful and alive.`,
yuki.dialogue(`I'm glad you think so. It's a scent I'm rather fond of myself.`),
`She sounds sincerely delighted, her enthusiasm making her more attractive.`
]
]));
}
responses.push(yuki.print_delta(delta));
} else {
delta.slave_traits["obedience"] = -1;
end_hook = () => {
setup.apply_delta(yuki, delta);
$("#char_quick_info").empty();
$("#char_quick_info").html("<b>Yuki's Disposition: </b>" + setup.titleCase(yuki.get_disposition()));
};
responses = responses.concat(either([
[
player.dialogue(`You... um... your scent, it's... odd... I mean...`),
`The wrong choice of words has definitely caused some tension. Yuki looks at you, clearly taken aback by the somewhat tactless compliment.`,
yuki.dialogue(`Oh, is that so? I... I see.`),
`She tries to hide the disappointment in her voice, but you can tell she's not entirely successful. You've certainly thrown her off, and not in a good way.`,
],
[
player.dialogue(`You smell... pungent. Like... like something raw and unprocessed.`),
`Yuki's eyes widen, taken aback. A hint of irritation flickers in her gaze as she masks her reaction with a strained smile.`,
yuki.dialogue(`Well, we all have our unique... attributes. Some are just less conventional.`),
`Her voice is as cool as ice, clearly disapproving your comment but choosing to keep her poise.`
],
[
player.dialogue(`Your scent... it's strange. Like, salty and... sort of sweet, but not in a good way.`),
`A frown forms on Yuki's face, her lips pressing into a thin line. Her polite demeanor momentarily slips away as she raises an eyebrow.`,
yuki.dialogue(`Everyone's entitled to their own opinions, but it's important to remember manners.`),
`Her words are frosty, a clear reprimand of your offhand remark.`
]
]));
responses.push(yuki.print_delta(delta));
}
break;
case 3:
if (passed) {
responses = responses.concat(either([
[
player.dialogue(`You have a lovely figure, Yuki.`),
`She blinks in surprise at your straightforward compliment, then her cheeks begin to glow with a soft blush.`,
yuki.dialogue(`Thank you... That's...very kind of you to say.`),
`She looks away, fidgeting with the hem of her hanfu, and you can see her swallow nervously. It's clear your words have had an effect.`
],
[
player.dialogue(`Yuki, you've got a fine ass.`),
`Caught off guard, Yuki blushes furiously, covering her backside with her hands.`,
yuki.dialogue(`I... um... thank you?`),
`She stammers, her tone full of surprise and a hint of pleasure. The sincerity of your compliment, though brazen, has apparently been accepted.`
],
[
player.dialogue(`Your ass is absolutely to die for.`),
`Yuki's eyes widen in shock as she hears your words, but then a shy, naughty smile creeps onto her lips.`,
yuki.dialogue(`Oh my... Thank you. That's... quite a compliment.`),
`She bows slightly, her cheeks tinged a deep pink, seemingly excited by the boldness of your words.`
],
[
player.dialogue(`Yuki, you've got such a body... It must get you all... heated, doesn't it?`),
`Her cheeks turn a deep shade of crimson as she shyly looks away. The explicit nature of your words has definitely caught her attention.`,
yuki.dialogue(`I... um... well, that's...`),
`She hesitates, unsure how to respond to such a brazen comment.`,
player.dialogue(`Because it sure as hell is getting me aroused.`),
`Yuki freezes for a moment, then slowly turns back to face you. A spark of curiosity flares in her eyes, mixed with a touch of excitement.`,
yuki.dialogue(`That's... quite flattering. I'm... I'm not sure what to say.`),
`Her voice trembles slightly, the hints of arousal not lost on you as she coyly glances at you, then away, her heart visibly pounding in her chest.`
]
]));
responses.push(yuki.print_delta(delta));
} else {
responses = responses.concat(either([
[
`Words stumble out of your mouth, as you try to find the right phrasing,`,
player.dialogue(`Y-Your body is... um... lean?`),
`You cringe, regretting your choice of words immediately.`,
`Yuki's eyes widen a fraction before she chuckles awkwardly,`,
yuki.dialogue(`Well, that's certainly... a way to put it.`),
`She quickly diverts the conversation, clearly trying to save both of you from further embarrassment.`
],
[
player.dialogue(`So, Yuki, you're pretty skinny, aren't you? Like one of those... skinny models?`),
`The moment the words leave your lips, you feel the atmosphere shift.`,
`Yuki's smile falters slightly, her eyebrows knitting together in slight confusion and offense,`,
yuki.dialogue(`Well, that's a rather... crude observation.`),
`She retorts, her tone colder than before, her professionalism wavers for a moment before she quickly regains her composure.`
],
[
player.dialogue(`Yuki, you've got quite a figure, especially...`),
`You trail off, your eyes dropping down her body. The change in the room is immediate, Yuki's face growing visibly colder.`,
yuki.dialogue(`I'm not sure I appreciate the direction this conversation is heading.`),
`Her tone is clipped, the warmth from earlier replaced with a steely defensiveness. It seems you've crossed a line.`
],
[
player.dialogue(`You've got some nice tits there, Yuki.`),
`The moment the crude words leave your mouth, Yuki's smile disappears.`,
yuki.dialogue(`I believe a measure of respect is necessary in every conversation.`),
`Her voice is frosty, her displeasure at your crass comment palpable. It's clear you've stepped out of line.`
]
]));
}
break;
}
break;
default:
alert("Error, undefined conversation tree leaf logic! See console for path.");
console.log(_t.talk_path);
console.log(_t.talk_path_idx);
}
} else if (_t.talk_path.length == 2) {
switch(_t.talk_path_idx[_t.talk_path_idx.length - 1]) {
case 0:
switch(choice_idx) {
case 0:
let cum_category = "_cum_2";
if (player.gender == 0) {
responses = [
`Yuki's eyes widen with anticipation as you accept her offer. She flashes you a seductive smile, her pink lips curling with excitement. Without hesitation, she takes your hand and leads you to a secluded area, a hidden corner away from prying eyes. The air is thick with anticipation as you both find yourselves in a more private setting.`,
`Yuki's slender fingers trail along your arm, sending shivers down your spine. She stands before you, her gaze fixed on your crotch, her lips parted with desire. Slowly, she sinks to her knees, her eyes never leaving yours. The hunger in her eyes is palpable as she reaches up, her delicate hands tracing the outline of your bulge.`,
`With a teasing smile, Yuki begins to unbutton your pants, revealing your throbbing cock. She breathes in sharply, her eyes widening at the sight. Her delicate fingers wrap around your shaft, stroking it slowly, her touch sending waves of pleasure through your body.`,
`Her warm breath caresses the sensitive skin as she leans in, her lips grazing the tip of your cock. She looks up at you, her gaze filled with a mix of innocence and hunger.`,
yuki.dialogue(`May I taste you?`),
`Without waiting for your response, Yuki takes you into her mouth, engulfing your cock with her wet warmth. Her tongue dances along your length, exploring every inch, as she bobs her head rhythmically. The sensations are exquisite, a symphony of pleasure that threatens to overwhelm your senses.`,
`Yuki's mouth becomes an oasis of pleasure, her lips tight around your shaft as she continues to suck you with fervor. Her tongue flicks and swirls, teasing the most sensitive spots, as she expertly brings you closer to the edge of ecstasy.`,
`The intensity builds, and you can feel the familiar tightening in your loins. Yuki's eyes lock with yours, her cheeks hollowing as she increases the pace, urging you towards release. The sensations become almost unbearable as the pressure within you reaches its peak.`,
`With a final, desperate thrust, you pull out of Yuki's mouth, your cock glistening with her saliva. A surge of pleasure courses through your body as you finally reach the point of no return. Your orgasm washes over you, and with a guttural moan, you explode, releasing your hot, sticky cum onto Yuki's eager face. Thick ropes of cum splatter across her delicate features, landing on her flushed cheeks, her rosy lips, and in her tousled hair.`,
player.dialogue(`Fuuckkk, take my cum you dirty slut!`),
`Yuki's eyes flutter closed for a moment as the warm liquid coats her skin. A satisfied smile plays on her lips as she opens her eyes, her gaze filled with a mix of lust and contentment. She brings her fingers to her face, smearing the cum across her skin, reveling in the sticky sensation.`,
yuki.dialogue(`Thank you. You taste exquisite, just like I imagined.`),
`Her tongue darts out, licking a stray droplet of cum from her lips.`
];
cum_category = "_cum_2";
} else {
responses = [
`A mixture of excitement and curiosity dances in your eyes as you accept Yuki's offer.`,
yuki.dialogue(`Come with me, I'll take you to a special place.`),
`Yuki takes your hand and leads you to a secluded area, hidden away from prying eyes. The air is charged with anticipation as you both step into this intimate space.`,
`Yuki reaches into a hidden pocket, pulling out several small vials filled with creamy liquid. She uncaps them one by one, pouring the contents onto your face and through your hair. Thick strands of cum cascade down your skin, coating you in its unique essence. The slippery fluid clings to you, glistening in the dim light, as you become an embodiment of Yuki's desires.`,
`Not content with just adorning you, Yuki also indulges herself in the sticky substance. She uncorks more vials, allowing the cum to rain down on her own body. It cascades over her curves, matting her hair and sticking to her flawless skin.`,
yuki.dialogue(`Mmmm, I've been waiting to do this all day...`),
`She continues by then pouring a couple vials of cum directly into her mouth, filling it`,
`Yuki steps closer, her cum-covered lips mere inches from yours. Her eyes burn with raw desire as she leans in, capturing your mouth in a passionate kiss. The taste of the creamy liquid on her lips mingles with your own, as her tongue explores your mouth, deepening the connection. With each fervent stroke, she releases small amounts of cum from her mouth, coaxing you to taste and swallow.`,
`As the intensity of the kiss subsides, Yuki pulls back slightly, a wicked smile playing on her lips. She lowers herself, her tongue tracing a path along your skin, lapping up the remnants of cum that cling to your face and hair. Her delicate fingers weave through your strands, guiding her tongue to every last drop. She sucks and licks with unabashed enthusiasm, ensuring not a single trace of cum is left on you.`,
`Finally, with a final flick of her tongue, Yuki captures the remaining cum on her lips. She swallows it down, her throat working with an enticing display of satisfaction. A satisfied sigh escapes her lips as she gazes at you, her eyes filled with a potent mix of pleasure and desire.`,
yuki.dialogue(`Mmm... you were incredible, my dear. You truly embraced the experience. Thank you for indulging me. I hope you found it as intoxicating as I did.`),
`Yuki's voice carries a husky tone, thick with satisfaction and a hunger for more. The scene around you is a tableau of desire, with the air heavy with the scent of cum.`,
`You can't help but let out a breathless sigh as you speak, your body still pulsing with desire and your senses alive with the memory of the intimate encounter.`
];
cum_category = "_cum_3";
}
_t.talk_path.push([
[
$(`<ol>\
<li id='li1'>Done.</li>\
</ol>`)
], null
]);
_t.talk_path_idx.push(0);
is_event = true;
delta = {
"slave_traits": {
"obedience": 8
}
};
responses.push(yuki.print_delta(delta));
end_hook = () => {
delta["slave_traits"]["max_obedience"] = 90;
setup.apply_delta(yuki, delta);
player.mental_conditions.arousal = 0;
$("#char_quick_info").empty();
$("#char_quick_info").html("<b>Yuki's Disposition: </b>" + setup.titleCase(yuki.get_disposition()));
$("#mainLogImage").css("background-image", "url(\"resources/images/places/yukisGourmetFloor2.png\")");
$("#mainLogCharacterImage").css("background-image", "url(\"" + yuki.image_folder() + yuki.first_name.toLowerCase() + cum_category + ".png\")")
};
break;
case 1:
if (player.gender == 0) {
responses = [
player.dialogue(`I'm sorry Yuki, but I just can't do that. I can't provide... what you're asking for.`),
`Yuki's eyes hold a playful glint, her lips curling into a knowing smile as she leans over the counter, closer to you.<br>`,
yuki.dialogue(`That's alright, I can be patient. I'm always offering... if you change your mind.`),
`She straightens up, her gaze lingering on you with an unmistakable implication. With a wink, she adds,<br>`,
yuki.dialogue(`And remember, I'll be waiting... eagerly... for that special contribution of yours.`)
];
} else {
response = [
player.dialogue(`I'm sorry Yuki, I don't think I can indulge in... what you're suggesting.`),
`Yuki's smile doesn't fade. Instead, her eyes glimmer with a mischievous light as she tilts her head slightly, regarding you with intrigue.<br>`,
yuki.dialogue(`Oh, that's no issue at all. I'm always offering whenever you feel ready to experience... my world.`),
`Her statement hangs in the air, a tantalizing offer coupled with an undercurrent of excitement. She runs her tongue over her lips, revealing a small bit of cum that glistens on her tongue before she swallows, a silent but provocative message.<br>`,
yuki.dialogue(`And remember... the offer stands. Whenever you're ready to embrace the taste and feel... my door is always open.`)
]
}
is_event_end = true;
break;
case 2:
delta = {
"slave_traits": {
"obedience": 10
}
};
responses = [
player.dialogue(`The provider deems it favorable`),
`Yuki's eyes widen, her hungry gaze locking onto yours. You swear you can almost see her slightly drool, her cheeks flushing pink.`,
yuki.dialogue(`I... I see. Well, in that case, I suppose I could use some extra hands around the place. But... if you behave even a bit out of line, I'll have to let you go. Understood?`),
player.dialogue(`Yes, Yuki.`),
yuki.print_delta(delta)
];
end_hook = () => {
$.wiki("<<notify>>Quest route under construction. Raise disposition for now.<</notify>>");
};
do_nothing = true;
break;
}
break;
}
} else if (_t.talk_path.length == 3) {
switch(_t.talk_path_idx[_t.talk_path_idx.length - 1]) {
case 0:
responses = [
`Before you return with Yuki back to the front of the restaurant she leans in, her face inches away from yours,<br>`,
yuki.dialogue(`I hope you enjoyed that as much as I did.`)
];
is_event_end = true;
if (!("work" in _v.locations.yukisGourmet.data) || !(_v.locations.yukisGourmet.data["work"])) {
_v.locations.yukisGourmet.data["work"] = true;
$('#work').find("button").prop("disabled", false);
$('#work').find("button").removeClass("disabled");
}
/* Secret learned and quest completed */
if (_v.quest_journal.ongoing.contains("a_secret_of_yuki")) {
setup.remove_val(_v.quest_journal.ongoing, "a_secret_of_yuki");
_v.quest_journal.completed.push("a_secret_of_yuki");
}
/* Start feed nipon */
if (!(_v.quests.feed_nipon.added || _v.quest_journal.completed.contains("feed_nipon") || _v.quest_journal.ongoing.contains("feed_nipon"))) {
_v.quests.feed_nipon.added = true;
_v.quest_journal.ongoing.push("feed_nipon");
$.wiki(`<<notify>>Quest <em>Feed Nipon</em> added to journal!<</notify>>`);
$.wiki(`<<audio "quest_added_sound" play>>`);
}
/* Lower sex limit */
yuki.limits.fuck -= 1;
break;
}
}
if (!do_nothing) {
if (is_event_end) {
/* Return to main, send responses to append */
_v._temp_to_log = responses.join(" ");
$.wiki("<<goto `passage()`>>");
} else {
/* Grab options */
if (_t.talk_path.length == 0) {
cur_branch = _t.talk_tree;
} else {
cur_branch = _t.talk_path[_t.talk_path.length - 1];
}
_t.options = cur_branch[0][cur_branch[0].length - 1];
if (is_event) {
_v.enable_menu = false;
} else {
_t.disable_buttons = false;
/* Disable picked option */
_t.options.find("#li" + (choice_idx + 1)).css("text-decoration", "line-through");
}
_t.options = _t.options.clone();
$.wiki("<<disableactions _options>>");
responses.push(_t.options);
setup.mainLog_append_delayed(responses, _v.buttons, _v.buttons_extra, 1000, true, null, end_hook);
}
}
}
}
});
<</script>><</timed>><<set $_to_log = "As you step through the elegant doors of the gourmet restaurant, you are immediately captivated by the enchanting ambiance that surrounds you. \
Soft, warm lighting casts a gentle glow upon the tastefully designed interior, creating an atmosphere of understated luxury. \
The walls are adorned with striking artwork that evokes a sense of sophistication and artistic appreciation. Your eyes, however, are drawn to the restaurant's heart and soul, Yuki Seieki.">>
<<loadVars>>
<<set _yuki = $characters["yuki_seieki"]>>
<<set _started_talking = false>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
<<include infoLog>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include yukisGourmetActions>>
</div>
</div>
</div>
<<script>>
$(document).one(':passagedisplay', function() {
let yuki = State.variables.characters["yuki_seieki"];
$("#mainLogCharacterImage").css("background-image", "url(\"" + yuki.image_folder() + yuki.first_name.toLowerCase() + "_neutral_warmlight.png\")");
});
<</script>><<if setup.is_day($gameDate)>>
<img src="resources/maps/niponMarketMap.jpeg" usemap="#image-map">
<<else>>
<img src="resources/maps/niponMarketMapNight.jpeg" usemap="#image-map">
<</if>>
<map name="image-map">
<area alt="niponMarketDocks" coords="90,112,116,127,128,104,184,128,181,137,218,151,225,132,279,144,289,127,368,28,75,27" shape="poly">
<area alt="niponTradeUnion" coords="806,473,995,590" shape="rect">
<area alt="niponFarms" coords="592,628,699,631,729,695,645,752,557,749,501,749,363,749,367,650,437,610" shape="poly">
<area alt="niponStalls" coords="173,200,230,174,296,204,314,246,374,261,416,294,420,364,415,403,363,469,260,410,162,340,136,278,143,228" shape="poly">
<area alt="niponBlacksmith" coords="440,334,442,413,487,444,546,460,608,449,646,434,646,406,611,335,556,290" shape="poly">
<area alt="niponTheater" coords="394,233,453,278,519,277,520,198,472,163,403,154,377,172,362,195" shape="poly">
<area alt="niponMines" coords="679,283,678,321,666,337,689,356,705,377,708,406,739,429,807,450,845,459,893,458,905,451,951,445,951,431,988,421,1009,411,1007,366,972,333,971,287,941,231,870,224,766,243,730,263" shape="poly">
<area alt="niponAuctionHouse" coords="71,394,158,365,230,409,230,445,165,483,65,459" shape="poly">
<area alt="niponCentral" coords="27,25,68,212" shape="rect">
<area alt="niponSlums" coords="30,229,64,401" shape="rect">
<area alt="east" coords="1368,400,1217,525,1135,650,1040,739,956,802,1371,802" shape="poly">
</map>
/* Remove quick bar and setup map */
<<script>>
setTimeout(() => {
$("#quickbar").addClass("hidden");
var areas = $("map").children("area");
for (var _i = 0; _i < areas.length; _i++) {
var obj = $(areas[_i]);
if (!(setup.locations.has(obj.attr("alt")))) {
continue;
}
var loc = setup.locations.get(obj.attr("alt"));
if (!State.variables.locations[loc.key].access) {
obj.addClass("noaccess");
obj.attr("onclick", "$.wiki('<<notify>>No Access!<</notify>>')");
obj.attr("title", "No access.");
} else if (!loc.has_access()) {
obj.addClass("closed");
obj.attr("onclick", "$.wiki('<<notify>>Closed!<</notify>>')");
var opening_time = loc.access_times[0];
var opening_time_str = "";
if (opening_time == 0) {
opening_time_str = "12 AM.";
} else if (opening_time < 12) {
opening_time_str = opening_time.toString() + " AM.";
} else if (opening_time == 12) {
opening_time_str = "12 PM.";
} else {
opening_time_str = (opening_time - 12).toString() + " PM.";
}
obj.attr("title", "Opens at " + opening_time_str);
} else {
obj.addClass("access");
var onclick = "SugarCube.setup.locations.get('" + obj.attr("alt") + "').goto(";
if (loc.inside) {
onclick += "'wooden_door_sound'";
}
onclick += ")";
obj.attr("onclick", onclick);
}
}
}, 10);
<</script>><<nobr>>
<div id="actions" class="action container row col longbutton fiveQuarters"
style="--rows: 4; --cols: 4">
<<set _last_choice = "none">>
<<button "Talk">>
<<if _last_choice != "talk">>
<<set _last_choice = "talk">>
<<set _options = "\
<ol>\
<li id=\"li1\">\"What is this place?\"</li>\
<li id=\"li2\">\"Can I purchase a slave here?\"</li>\
<li id=\"li3\">\"How often does new merchandise come in?\"</li>\
<li id=\"li4\">\"Who are you?\"</li>\
<li id=\"li5\">\"How do you like Nipon?\"</li>\
">>
<<set _options += "</ol>">>
<<set _responses = [
_options
]>>
<<set _options = $(_options)>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses, State.temporary.talk_buttons, State.temporary.talk_buttons_extra);
<</script>>
<</if>>
<<addclass "#actions" "hidden">>
<<removeclass "#talk_options" "hidden">>
<</button>>
<<button "Slaves">>
<<addclass "#actions" "hidden">>
<<removeclass "#slave_actions" "hidden">>
<</button>>
<div style="grid-row: 1; grid-column: 4"></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div style="grid-row: 3; grid-column: 4"></div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMarket">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<</nobr>><<nobr>>
/* Check if requires refreshing stock */
<<if !("last_visit" in $locations["niponAuctionHouse"].data)>>
<<set $locations["niponAuctionHouse"].data["last_visit"] = clone($gameDate)>>
<</if>>
<<set _date_diff = Math.floor(($gameDate - $locations["niponAuctionHouse"].data["last_visit"]) / 86400000)>>
<<if !("slaves" in $locations["niponAuctionHouse"].data) || _date_diff gt 7 || (def $shuffle_slaves && $shuffle_slaves)>>
<<unset $shuffle_slaves>>
<<set $locations["niponAuctionHouse"].data["last_visit"] = clone($gameDate)>>
<<set $locations["niponAuctionHouse"].data["slaves"] = {}>>
<<for _i = 0; _i lt 6; _i++>>
<<set _temp_slave = new setup.Character("temp", true, 40)>>
<<set _temp_slave.gender = 1>>
<<if _i lt 2>>
<<set _temp_slave.physical_traits.ethnicity = either(["Japanese", "Chinese", "Korean", "Vietnamese"])>>
<</if>>
<<run _temp_slave.shuffle()>>
<<set _temp_slave.stats_known = true>>
<<set _temp_slave.skills_known = true>>
<<set _temp_slave.is_slave = true>>
<<set _temp_slave.key = _temp_slave.first_name + "_" + _temp_slave.last_name + dice(1, 1000)>>
<<set $locations["niponAuctionHouse"].data.slaves[_temp_slave.key] = _temp_slave>>
<</for>>
<<for _i = 0; _i lt 6; _i++>>
<<set _temp_slave = new setup.Character("temp")>>
<<set _temp_slave.gender = 0>>
<<if _i lt 2>>
<<set _temp_slave.physical_traits.ethnicity = either(["Japanese", "Chinese", "Korean", "Vietnamese"])>>
<</if>>
<<run _temp_slave.shuffle()>>
<<set _temp_slave.stats_known = true>>
<<set _temp_slave.skills_known = true>>
<<set _temp_slave.is_slave = true>>
<<set _temp_slave.data.generated = true>>
<<set _temp_slave.key = _temp_slave.first_name + "_" + _temp_slave.last_name + dice(1, 1000)>>
<<set $locations["niponAuctionHouse"].data.slaves[_temp_slave.key] = _temp_slave>>
<</for>>
<</if>>
<<set _luka = new setup.Character("luka_namm")>>
<<set _luka.first_name = "Luka">>
<<set $_to_log = "
<div>The Nipon Auction House carries with it a strange smell of old burnt paper. You can tell that it \
was only recently modified to allow for the selling of human capital. In many corners of the room you find \
many gaurds armed to the teeth with weapons you\'ve never seen before. The shop owner with bags under his \
eyes makes his way over to you and says in a non-interested tone,</div><br>" +
_luka.dialogue("Welcome... are you here to make a bid on our merchandise?") +
"He weakly gesters a a group of several people doing menial chores around the room."
>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include niponAuctionHouseActions>>
<<include niponAuctionHouseTalkOptions>>
<<include niponAuctionHouseSlaveActions>>
</div>
</div>
</div>
/* Select first slave */
<<timed 50ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
let [first] = Object.keys(_v.locations.niponAuctionHouse.data.slaves);
_v.selected = first;
<</script>><</timed>>
<</nobr>><<nobr>>
<div id="slave_actions" class="action container row col longbutton fiveQuarters hidden"
style="--rows: 4; --cols: 4">
<<button "Buy">>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto niponAuctionHouseSlaveBuy>>
<</button>>
<<button "Sell">>
<<if $player.slaves.length == 0>>
<<notify>>Do not own any slaves to sell.<</notify>>
<<else>>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto niponAuctionHouseSlaveSell>>
<</if>>
<</button>>
<div style="grid-row: 1; grid-column: 4"></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<removeclass "#actions" "hidden">>
<<addclass "#slave_actions" "hidden">>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMarket">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<</nobr>><<nobr>>
<<set _char = $locations.niponAuctionHouse.data.slaves[$selected]>>
<<if $player.is_slave && !$quests.cycle_of_abuse.added>>
<<notify>>Hint: Talk to the manager to get a slave.<</notify>>
<</if>>
<div class="charside left">
<<set _female_slaves = 0>>
<<for _idx, _val range $player.slaves>>
<<if $characters[_val].gender == 1>>
<<set _female_slaves += 1>>
<</if>>
<</for>>
<hr>
<center><h3>Finances</h3>
<div class="container twoCol" style="font-weight: normal; grid-template-columns: 40% 55%; column-gap: 5%">
<div style="text-align: left; margin-left: 10px">
Capital:<br>
</div>
<div id="capital" style="text-align: right; margin-right: 10px; font-weight: normal">
<<= setup.LARI>><<money>><br>
</div>
</div>
</center>
<hr>
<center><h3>Slaves</h3>
<div class="container twoCol" style="font-weight: normal; grid-template-columns: 45% 50%; column-gap: 5%">
<div style="text-align: left; margin-left: 10px">
Females:<br>
Males:<br>
Total:
</div>
<div id="owned_slaves" style="text-align: right; margin-right: 10px; font-weight: normal">
_female_slaves<br>
<<= $player.slaves.length - _female_slaves>><br>
<<= $player.slaves.length>>
</div>
</div>
</center>
</div>
<div id="background" class="paper_border notext">
<div class="main container threeCol" style="height: 100%; width: 100%;">
<div id="characterMenuLeft" style="height: 710px">
<<include characterMenuSkills>>
<<timed 50ms>><<removeclass "#skills" "hidden">><</timed>>
</div>
<div id="characterMenuCenter" class="subbackground">
<center>
<h2 id="name" style="margin-top:20px; margin-bottom: 20px">
<<= setup.titleCase(_char.first_name)>> <<= setup.titleCase(_char.last_name)>>
</h2>
<div id="characterMenuImage"></div>
</center>
<<timed 20ms>>
<<run $("#characterMenuImage").css("background-image", "url(resources/images/characters/player/" + _char.gender + ".png)")>>
<</timed>>
<<if ($quests.cycle_of_abuse.stage == 2)>>
<<set _cost = setup.round2(0.1 * _char.value(1.2))>>
<<else>>
<<set _cost = setup.round2(_char.value(1.2))>>
<</if>>
<center id="cost" style="margin: 15px; margin-left: 30px; margin-right: 30px">
<<= setup.LARI>>
<<if $quests.cycle_of_abuse.stage == 2>>
<span style="text-decoration: line-through"><<= setup.round2(_cost / 0.1)>></span>
<</if>>
_cost
</center>
<center>
<<button "Back">>
<<set $in_menu = false>>
<<goto $last_visited>>
<<set $last_visited = "">>
<</button>>
<<if $player.is_slave && $quests.cycle_of_abuse.stage lt 2>>
<<disable>><<button "Purchase">><</button>><</disable>>
<<else>>
@@#purchase;<<button "Purchase">>
<<if $player.get_money() lt _cost>>
<<notify>>Insufficient funds.<</notify>>
<<else>>
<<set _char.background = "You acquired " + setup.him(_char) + " at the \
Nipon auction house">>
<<if $quests.cycle_of_abuse.stage == 2>>
<<set _char.background += " with the help of Shintani\'s subsidy.">>
<<if !("data" in _char)>>
<<set _char.data = {}>>
<</if>>
<<set _char.data.subsidy = true>>
<<set $quests.cycle_of_abuse.stage = 3>>
<<else>>
<<set _char.background += ".">>
<</if>>
<<set _char.date_acquired = clone($gameDate)>>
/* Update money */
<<removemoney _cost>>
<<audio "coins_sound" play>>
<<run $("#capital").html("")>>
<<run $("#capital").wiki("<<= setup.LARI>><<money>><br>")>>
<<set $player.slaves.push(_char.key)>>
/* Update number of slaves */
<<if _char.gender == 1>>
<<set _female_slaves += 1>>
<</if>>
<<run $("#owned_slaves").html("")>>
<<run $("#owned_slaves").wiki("_female_slaves<br>\
<<= $player.slaves.length - _female_slaves>><br>\
<<= $player.slaves.length>>")>>
/* Give them an inventory */
<<set _char.inventory = _char.key>>
<<run UInv.CreateBag(_char.key)>>
<<set _char.finances.purchase_cost = _cost>>
<<set _char.owner = "player">>
<<run delete $locations.niponAuctionHouse.data.slaves[_char.key]>>
<<set $characters[_char.key] = clone(_char)>>
<<run $("#purchase button").addClass("disabled")>>
<<run $("#purchase button").prop("disabled", true)>>
<<run $("#slave_choices").find("button.disabled").addClass("purchased")>>
<<run $("#slave_choices").find("button.disabled").html("PURCHASED")>>
<</if>>
<</button>>@@
<</if>>
</center>
</div>
<div id="characterMenuRight">
<<include characterMenuSummary>>
</div>
</div>
</div>
<div class="charside right">
<div id="slave_choices" class="mapaction fiveQuarters smalltext">
<hr>
<<for _key, _val range $locations.niponAuctionHouse.data.slaves>>
<<capture _key, _val>>
<<if _key == $selected>>
<<disable>>
<<button setup.titleCase(_val.first_name)>>
<<set _char = _val>>
<</button>>
<</disable>>
<<else>>
<<button setup.titleCase(_val.first_name)>>
<<set _char = _val>>
<</button>>
<</if>>
<</capture>>
<</for>>
</div>
</div>
<<timed 50ms>>
<<script>>
$("#slave_choices").find("button").on("click", (event) => {
let _t = State.temporary;
let _v = State.variables;
$("#slave_choices").find("button").removeClass("disabled");
$("#slave_choices").find("button").prop("disabled", false);
$("#slave_choices").find("button.purchased").addClass("disabled");
$("#slave_choices").find("button.purchased").prop("disabled", true);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
$("#characterMenuCenter").find("#name").html(setup.titleCase(_t.char.first_name) + " " +
setup.titleCase(_t.char.last_name));
$("#characterMenuImage").css("background-image", "url(resources/images/characters/player/" + _t.char.gender + ".png)");
if (_v.quests.cycle_of_abuse.stage == 2) {
_t.cost = setup.round2(0.1 * _t.char.value(1.2));
} else {
_t.cost = setup.round2(_t.char.value(1.2));
}
$("#purchase button").removeClass("disabled");
$("#purchase button").prop("disabled", false);
let cost_str = setup.LARI + " ";
if (_v.quests.cycle_of_abuse.stage == 2) {
cost_str += "<span style=\"text-decoration: line-through\">" + setup.round2(_t.cost / 0.1) + "</span> ";
}
$("#characterMenuCenter").find("#cost").html(cost_str + _t.cost);
$("#characterMenuLeft").html("");
$("#characterMenuLeft").wiki("<<include characterMenuSkills>>");
$("#skills").removeClass("hidden");
$("#characterMenuRight").html("");
$("#characterMenuRight").wiki("<<include characterMenuSummary>>");
});
<</script>>
<</timed>>
<</nobr>><div class="charside left">
<div id="description_actions" class="mapaction fiveQuarters smalltext">
<hr>
<<disable>>
@@#summary_but;<<button "Summary">>
<</button>>@@
<</disable>>
@@#stats_but;<<button "Stats">>
<</button>>@@
@@#skills_but;<<button "Skills">>
<</button>>@@
@@#sex_skills_but;<<button "Sex Prefs">>
<</button>>@@
<<set _left_selection = "summary">>
</div>
</div>
<<set $selected = $player.slaves[0]>>
<<set _char = $characters[$selected]>>
<div id="background" class="paper_border notext">
<div class="main container threeCol" style="height: 100%; width: 100%;">
<div id="characterMenuLeft" style="height: 710px">
<<include characterMenuSummary>>
<<include characterMenuStats>>
<<include characterMenuSkills>>
<<include characterMenuSexPrefs>>
</div>
<div id="characterMenuCenter" class="subbackground">
<center>
<h2 id="name" style="margin-top:20px; margin-bottom: 20px">
<<= setup.titleCase(_char.first_name)>> <<= setup.titleCase(_char.last_name)>>
</h2>
<div id="characterMenuImage"></div>
</center>
<<timed 20ms>>
<<run $("#characterMenuImage").css("background-image", "url(resources/images/characters/player/" + _char.gender + ".png)")>>
<</timed>>
<<if _char.data != null && _char.data.subsidy>>
<<set _price_str = "<span class=\"fail\">(Pays Shintani\'s debt)</span>">>
<<set _price = 0>>
<<else>>
<<set _price = setup.round2(_char.value(0.8))>>
<</if>>
<center id="cost" style="margin: 15px; margin-left: 30px; margin-right: 30px">
<<if def _price_str>>
_price_str
<<else>>
<<= setup.LARI>> _price
<</if>>
</center>
<center>
<<button "Back">>
<<set $in_menu = false>>
<<goto $last_visited>>
<<set $last_visited = "">>
<</button>>
@@#sell;<<button "Sell">>
<<if def _price_str && _price == 0>>
<<set setup.remove_val($quest_journal.ongoing, "cycle_of_abuse")>>
<<set $quest_journal.completed.push("cycle_of_abuse")>>
<</if>>
/* Recover investment */
<<if _char.finances.investment != 0>>
<<set $player.finances.investment -= _char.finances.investment>>
<</if>>
/* Add in sell price */
<<addmoney _price>>
<<audio "coins_sound" play>>
/* Remove as slave */
<<run delete $player.slaves[_char.key]>>
<<set setup.remove_val($player.slaves, _char.key)>>
<<set $to_simulate.delete(_char.key)>>
/* Delete them from characters */
<<run delete $characters[_char.key]>>
/* Remove from player finances */
<<if _char.key in $player.finances>>
<<run delete $player.finances[_char.key]>>
<</if>>
/* Remove inventory */
<<run UInv.DeleteBag(_char.key)>>
<<run $("#sell button").addClass("disabled")>>
<<run $("#sell button").prop("disabled", true)>>
<<run $("#slave_choices").find("button.disabled").addClass("sold")>>
<<run $("#slave_choices").find("button.disabled").html("SOLD")>>
<<run $("#description_actions").find("button").prop("disabled", true)>>
<<run $("#description_actions").find("button").addClass("disabled")>>
<</button>>@@
</center>
</div>
<div id="characterMenuRight">
<<include characterMenuFinances>>
<<timed 50ms>><<removeclass "#finances" "hidden">><</timed>>
<<if _char.finances.investment != 0>>
(Your investment amount will be returned if slave is sold.)
<</if>>
</div>
</div>
</div>
<div class="charside right">
<div id="slave_choices" class="mapaction fiveQuarters smalltext">
<hr>
<<for _idk, _val range $player.slaves>>
<<if $characters[_val].background.includes("with the help of Shintani") && $characters[_val].background.includes("subsidy")>>
<<if !("data" in _char)>>
<<set _char.data = {}>>
<</if>>
<<set _char.data.subsidy = true>>
<</if>>
<<capture _idx, _val>>
<<if _val == $selected>>
<<disable>>
<<button setup.titleCase($characters[_val].first_name)>>
<<set _char = $characters[_val]>>
<</button>>
<</disable>>
<<else>>
<<button setup.titleCase($characters[_val].first_name)>>
<<set _char = $characters[_val]>>
<</button>>
<</if>>
<</capture>>
<</for>>
</div>
</div>
<<timed 50ms>><<silently>><<script>>
$("#description_actions").find("button").on("click", (event) => {
$("#description_actions").find("button").removeClass("disabled");
$("#description_actions").find("button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
var desc = setup.camelize(self.html());
$("#" + desc).removeClass("hidden");
$("#" + State.temporary.left_selection).addClass("hidden");
State.temporary.left_selection = desc;
});
$("#slave_choices").find("button").on("click", (event) => {
let _t = State.temporary;
let _v = State.variables;
$("#slave_choices").find("button").removeClass("disabled");
$("#slave_choices").find("button").prop("disabled", false);
$("#slave_choices").find("button.sold").addClass("disabled");
$("#slave_choices").find("button.sold").prop("disabled", true);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
$("#characterMenuCenter").find("#name").html(setup.titleCase(_t.char.first_name) + " " +
setup.titleCase(_t.char.last_name));
$("#characterMenuImage").css("background-image", "url(resources/images/characters/player/" + _t.char.gender + ".png)");
if (_t.char.data != null && _t.char.data.subsidy) {
_t.price_str = "<span class=\"fail\">(Pays Shintani\'s debt)</span>";
_t.price = 0;
} else {
_t.price = setup.round2(_t.char.value(0.8));
delete _t.price_str;
}
$("#sell button").removeClass("disabled");
$("#sell button").prop("disabled", false);
if (_t.price_str != null && _t.price == 0) {
$("#characterMenuCenter").find("#cost").html(_t.price_str);
} else {
$("#characterMenuCenter").find("#cost").html(setup.LARI + " " + _t.price);
}
$("#description_actions").find("button").prop("disabled", false);
$("#description_actions").find("button").removeClass("disabled");
$("#description_actions").find("#summary_but button").prop("disabled", true);
$("#description_actions").find("#summary_but button").addClass("disabled");
$("#characterMenuLeft").html("");
$("#characterMenuLeft").wiki("<<include characterMenuSummary>>");
$("#characterMenuLeft").wiki("<<include characterMenuStats>>");
$("#characterMenuLeft").wiki("<<include characterMenuSkills>>");
$("#characterMenuLeft").wiki("<<include characterMenuSexPrefs>>");
$("#characterMenuRight").html("");
$("#characterMenuRight").wiki("<<include characterMenuFinances>>");
$("#characterMenuRight").find("#finances").removeClass("hidden");
if (_t.char.finances.investment != 0) {
$("#characterMenuRight").wiki("(Your investment amount will be returned if slave is sold.)")
}
});
<</script>><</silently>><</timed>><<nobr>>
<<set _refresh = false>>
<div id="talk_options" class="action container row col hidden"
style="--rows: 4; --cols: 5">
<<set _refresh = false>>
@@#events1;<<button "1">>
<<set _responses = [
_luka.dialogue("Oh this place? Uhh... well... this is where you can buy and sell slaves I guess..."),
"Luka lets out a sigh of exasperation",
_luka.dialogue("Not that anyone cares, but this used to be an auction house, now we just deal with human merchandise... \
what business did you have here?")
]>>
<</button>>@@
@@#events2;<<button "2">>
<<if $player.is_slave>>
<<if $quests.cycle_of_abuse.stage lte 1>>
<<set _responses = [
"Luka\'s eyes shift down to your neckline to see the Hiroyuki amulet, he suddently bursts into laughter",
_luka.dialogue("Listen, if Shintani wants a slave, he can just tell me. I doubt he would let one of his \
slaves purchase a slave!"),
"Luka continues chuckling to himself with a look of pity in his eye,",
_luka.dialogue("Now get out of here, you have no business here...")
]>>
<<if !$quests.cycle_of_abuse.added>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set $quests["cycle_of_abuse"].added = true>>
<<set $quest_journal.ongoing.push("cycle_of_abuse")>>
<<notify>>Quest <em>Cycle of Abuse</em> added to journal!<</notify>>
<<audio "quest_added_sound" play>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<<elseif $quests.cycle_of_abuse.stage == 2>>
<<set _responses = [
"Luka chuckles to himself,",
_luka.dialogue("I have no idea how you got Shintani to not only let you buy a slave but even offer to subsidize it \
for you. Go ahead and choose a slave... By the way, if you try to sell this slave back to me, all of it goes back to \
Shintani as per his instruction...")
]>>
<</if>>
<<else>>
<<set _responses = [
_luka.dialogue("Um... yeah that\'s kind of the whole point of this place right? You can go see our merchandise over there."),
"He points to a group of people doing menial tasks,",
_luka.dialogue("They\'re expensive, so uh, you break it, you buy it...")
]>>
<</if>>
<</button>>@@
@@#events3;<<button "3">>
<<set _responses = [
_luka.dialogue("Eh... it varies, but every week or so we refresh our stock... The unsold slaves are usually \
forced into labor or work in the slums, and uh, sometimes they are used as human shields in the Great Ea..."),
"Luka catches himself, as if he ran out of breath",
_luka.dialogue("Nevermind...")
]>>
<</button>>@@
@@#events4;<<button "4">>
<<set _responses = [
"Luka\'s demeanor completely changes. He stands up straight and stares you dead in the eyes.",
_luka.dialogue("Who sent you? I\'m no one of importance. Now get out of here if you didn\'t need anything else.")
]>>
<</button>>@@
@@#events5;<<button "5">>
<<set _responses = [
_luka.dialogue("Eh... it\'s fine. I don\'t really have any needs or uhh... standards, so uh, I\'m happy I guess...")
]>>
<</button>>@@
@@#events6;<<button "6">>
<</button>>@@
@@#events7;<<button "7">>
<</button>>@@
@@#events8;<<button "8">>
<</button>>@@
<<set _talk_buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set _talk_buttons.push("#talk_options #events" + _i)>>
<</for>>
<<set _talk_buttons_extra = ["#talk_options #events_actions_back", "#talk_options #events_actions_leave"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div id="events_actions_back" style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<if _refresh>>
<<goto `passage()`>>
<<else>>
<<removeclass "#actions" "hidden">>
<<addclass "#talk_options" "hidden">>
<</if>>
<</button>>
</div>
<div id="events_actions_leave" style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMarket">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<timed 50ms>><<script>>
$("#talk_options").find("button").on("click", (event) => {
let _t = State.temporary;
let _v = State.variables;
let self = $(event.currentTarget);
if (self.html() == "Back" || self.html() == "Leave") {
return;
}
self.addClass("disabled");
self.prop("disabled", true);
_t.options.find("#li" + self.html()).css("text-decoration", "line-through");
if ("responses" in _t) {
_t.responses.push(_t.options.clone());
setup.mainLog_append_delayed(_t.responses, _t.talk_buttons, _t.talk_buttons_extra);
delete _t.responses;
}
});
<</script>><</timed>>
<</nobr>><<if setup.is_day($gameDate)>>
<<set $_to_log += "
<div>The market district's bustling cacophony of civilization rings in your ears.</div><br>\
">>
<<else>>
<<set $_to_log += "
<div>The market district rests quietly with the rest of the people.</div><br>\
">>
<</if>>
/* Player is outside */
<<set $player.is_home = false>>
<<set $player.is_outside = true>>
/* Load in any saved variables */
<<loadVars>>
<div class="mapside left">
<<include niponActions>>
</div>
<div id="background" class="notext" style="padding: 0px">
<<include niponMarketMap>>
</div>
<div class="mapside right">
<hr>
<<include infoNoSubbackground>>
</div>
<<updatetime>><<nobr>>
<div id="actions" class="action container row col longbutton fiveQuarters"
style="--rows: 4; --cols: 4">
<<button "Work">>
<<run $("#info_title").html("Working at the Nipon Mines")>>
<<set _default_info = $("<div>\
<div id=\"normal_job\">\
It seems like there\'s never enough hands on deck at the Nipon mines. You could \
work here for a while and gain some lari if you wanted.\
<ul id=\"change_list\">\
<li id=\"li1\">" + setup.LARI + "10 per hour.</li>\
<li id=\"li2\">3% per hour chance to gain strength (capped at 30).</li>\
<li id=\"li3\">1% per hour chance of injury.</li>\
</ul></div>\
<div id=\"explore_job\">\
You also see some smaller crevasses that seem completely unexplored. If you wanted \
you could pick up a pickaxe lying about and go exploring for ore to keep for yourself.\
<ul>\
<li id=\"li3\">3% per hour chance to obtain iron.</li>\
<li id=\"li4\">1% per hour chance to obtain silver.</li>\
<li id=\"li6\">Additional 3% per hour chance of injury.</li>\
</ul></div>\
</div>")>>
<<run $("#infoLogBody").html("")>>
<<run $("#infoLogBody").append(_default_info.clone())>>
<<removeclass "#work_actions" "hidden">>
<<addclass "#actions" "hidden">>
<<removeclass "#infoLog" "hidden">>
<<addclass "#mainLog" "hidden">>
/* Reset all button states */
<<run $("#workStartButton button").prop("disabled", true)>>
<<addclass "#workStartButton button" "disabled">>
<<run $("#explore button").prop("disabled", true)>>
<<addclass "#explore button" "disabled">>
<<run $("#work1Hr button").prop("disabled", false)>>
<<removeclass "#work1Hr button" "disabled">>
<<run $("#work4Hr button").prop("disabled", false)>>
<<removeclass "#work4Hr button" "disabled">>
<<run $("#work8Hr button").prop("disabled", false)>>
<<removeclass "#work8Hr button" "disabled">>
<<set _explore = false>>
<</button>>
<<button "Assignments">>
<<if _has_assignment>>
<<if setup.in_range($gameDate.getHours(), setup.assignments["mines"]($player).times)>>
<<notify>>WIP<</notify>>
<<removeclass "#assignment_options" "hidden">>
<<addclass "#actions" "hidden">>
<<else>>
<<notify>>Slaves assigned the Nipon Mines are off work at this hour.<</notify>>
<</if>>
<<else>>
<<notify>>You do not have any slaves assigned to the Nipon Mines.<</notify>>
<</if>>
<</button>>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMarket">>
<<include locationButton>>
</div>
</div>
<</nobr>><<set _has_assignment = false>>
<div id="assignment_options" class="action container smalltext row col hidden"
style="--rows: 4; --cols: 5">
<<set _to_simulate_day = new Set()>>
<<if $player.is_slave>>
<<if $player.get_status("nipon") == "slave">>
<<set _to_simulate_day.add("mei_hironaka")>>
<<elseif $player.get_status("nipon") == "high_slave">>
<<set _to_simulate_day.add("mei_hironaka")>>
<<set _to_simulate_day.add("jae_hironaka")>>
<</if>>
<</if>>
<<for _idx, _val range $player.slaves>>
<<set _to_simulate_day.add(_val)>>
<</for>>
<<for _idx, _val range _to_simulate_day>>
<<if $characters[_val].assignment == "mines">>
<<set _has_assignment = true>>
<<capture _val>>
/* TODO: Add ability to check on slaves in mine */
<<disable>>
<<button `setup.titleCase($characters[_val].first_name)`>>
<<set _char = $characters[_val]>>
<<run setup.mainLog_append_delayed(["You approach " + setup.titleCase(_char.first_name) + " who is on break,"])>>
<<removeclass "#assignment_actions" "hidden">>
<<addclass "#assignment_options" "hidden">>
<<run $("#mainLogCharacterImage").css("background-image",
"url(\"" + _char.image_folder() +
_char.first_name.toLowerCase() + "_" +
_char.get_disposition() + ".png\")"
)>>
<</button>>
<</disable>>
<</capture>>
<</if>>
<</for>>
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 3; grid-column: 5"><<button "Back">>
<<removeclass "#actions" "hidden">>
<<addclass "#assignment_options" "hidden">>
<<run $("#mainLogCharacterImage").css("background-image", "")>>
<</button>></div>
<div style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponCentral">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div><<nobr>>
<<if $quests.the_nipon_economy.stage == 0>>
/* Forward Nipon Economy quest */
<<if !$quest_journal.completed.contains("the_nipon_economy") && $quests.the_nipon_economy.added && $quests.the_nipon_economy.stage lt 1>>
<<set $quests.the_nipon_economy.stage = 1>>
<</if>>
<</if>>
<<set $_to_log = "
<div>You find yourself at the northern Nipon river delta where there is a distict smell \
of smoke. Within the valley there are dozens of operating mines filled with workers with \
hollow eyes.</div><br>\
">>
/* Load in any saved variables */
<<loadVars>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
<<include infoLog>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include niponMinesActions>>
<<include niponMinesWorkActions>>
<<include niponMinesAssignmentOptions>>
<<include niponMinesEventsActions>>
</div>
</div>
</div>
<<updatetime>>
<</nobr>><<nobr>>
<div id="work_actions" class="action container row col fiveQuarters smalltext longbutton hidden"
style="--rows: 4; --cols: 4">
<<script>>
State.temporary.button_func = (adv) => {
var v = State.variables;
var _t = State.temporary;
var player = v.player;
if (_t.explore) {
$("#infoLogBody").html("");
$("#infoLogBody").append(_t.default_info.clone());
}
_t.explore = false;
_t.to_advance_hr = adv;
$("#workStartButton button").prop("disabled", true);
$("#workStartButton button").addClass("disabled");
$("#explore button").prop("disabled", true);
$("#explore button").addClass("disabled");
if (player.conditions.stamina > setup.project_stamina_change(adv * 60, false, true, true)) {
$("#explore button").prop("disabled", false);
$("#explore button").removeClass("disabled");
$("#workStartButton button").prop("disabled", false);
$("#workStartButton button").removeClass("disabled");
$("#work" + adv + "Hr button").prop("disabled", true);
$("#work" + adv + "Hr button").addClass("disabled");
$("#explore_job").addClass("hidden");
$("#li1").html(setup.LARI + (10 * adv).toString());
var _strength_perc = 3;
if (v.difficulty == -2) {
_strength_perc *= 2;
} else if (v.difficulty == -1) {
_strength_perc *= 1.5;
}
if (player.stats.strength >= 30) {
_strength_perc = 0;
}
$("#li2").html((_strength_perc * adv).toString() + "% chance to gain strength.");
$("#li3").html((1 * adv).toString() + "% chance of injury.");
} else {
$("#infoLogBody").html("");
$("#infoLogBody").append(_t.default_info.clone());
var _to_notify = "You are too tired to work " + adv;
if (adv == 1) {
_to_notify += " hour.";
} else {
_to_notify += " hours.";
}
$.wiki("<<notify>>" + _to_notify + "<</notify>>");
}
}
<</script>>
/* How long we want to work for */
<div style="grid-row: 1; grid-column: 1">
@@#work1Hr;<<button "1 Hour">>
/* Enable other options */
<<run $("#work4Hr button").prop("disabled", false)>>
<<removeclass "#work4Hr button" "disabled">>
<<run $("#work8Hr button").prop("disabled", false)>>
<<removeclass "#work8Hr button" "disabled">>
<<run _button_func(1)>>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 2">
@@#work4Hr;<<button "4 Hours">>
/* Enable other options */
<<run $("#work1Hr button").prop("disabled", false)>>
<<removeclass "#work1Hr button" "disabled">>
<<run $("#work8Hr button").prop("disabled", false)>>
<<removeclass "#work8Hr button" "disabled">>
<<run _button_func(4)>>
<</button>>@@
</div>
<div style="grid-row: 1; grid-column: 3">
@@#work8Hr;<<button "8 Hours">>
/* Enable other options */
<<run $("#work1Hr button").prop("disabled", false)>>
<<removeclass "#work1Hr button" "disabled">>
<<run $("#work4Hr button").prop("disabled", false)>>
<<removeclass "#work4Hr button" "disabled">>
<<run _button_func(8)>>
<</button>>@@
</div>
<div>
<<disable>>
@@#explore;<<button "Explore">>
<<run $("#explore button").prop("disabled", true)>>
<<addclass "#explore button" "disabled">>
<<set _explore = true>>
<<script>>
var adv = State.temporary.to_advance_hr;
let _v = State.variables;
let perc_iron = 3;
let perc_silver = 1;
if (_v.difficulty == -2) {
perc_iron *= 2;
perc_silver *= 2;
} else if (_v.difficulty == -1) {
perc_iron *= 1.5;
perc_silver *= 1.5;
}
$("#li3").html((4 * adv).toString() + "% chance of injury");
$("#change_list").append($("<li>" + (perc_iron * adv).toString() +
"% chance to obtain iron.</li>"));
$("#change_list").append($("<li>" + (perc_silver * adv).toString() +
"% chance to obtain silver.</li>"));
<</script>>
<</button>>@@
<</disable>>
</div>
<div style="grid-row: 1; grid-column: 4">
<<disable>>
@@#workStartButton;<<button "Start">>
<<include niponMinesWorkEngine>>
<</button>>@@
<</disable>>
</div>
<div style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<removeclass "#actions" "hidden">>
<<addclass "#work_actions" "hidden">>
<<removeclass "#mainLog" "hidden">>
<<addclass "#infoLog" "hidden">>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMarket">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<</nobr>><<nobr>>
/* Information about work */
<<set $_temp_to_log = "\
<div>You spent time working at the Nipon mines.</div>\
">>
/* Get clone of player to display changes */
<<set _player = clone($player)>>
/* Check if work-event occurs */
<<set _probability = (_to_advance_hr / 12)>>
<<set _roll = Math.random()>>
<<if (1 - _probability) lt _roll && _explore>>
/* Disable menu */
<<set $enable_menu = false>>
/* Show main log again */
<<addclass "#infoLog" "hidden">>
<<removeclass "#mainLog" "hidden">>
<<script>>
let _v = State.variables;
if (!("work_event_pool" in _v.locations[passage()].data) || _v.locations[passage()].data.work_event_pool.length == 0) {
_v.locations[passage()].data.work_event_pool = [];
/* Add events to pool */
$.wiki(`<<include niponMinesWorkEvents>>`);
}
/* Draw and remove a random event from pool */
let _event = _v.locations[passage()].data.work_event_pool.splice(Math.floor(Math.random() * _v.locations[passage()].data.work_event_pool.length), 1)[0];
/* Trigger work event */
$.wiki(`<<include ${_event}>>`);
$("#work_actions").addClass("hidden");
$("#events_actions").removeClass("hidden");
<</script>>
<<unset _probability>>
<<unset _roll>>
<<unset _event_pool>>
<<else>>
<<include niponMinesWorkEngineAfter>>
<</if>>
<</nobr>>/* Forward time along with dynamics */
<<set $player.is_working = true>>
<<addhours _to_advance_hr>>
<<set $player.is_working = false>>
/* Calculate pay */
<<set _pay = 10 * _to_advance_hr>>
<<addmoney _pay>>
<<audio "coins_sound" play>>
<<include round>>
/* Simulate strength roll */
<<set _roll = randomFloat(1.0)>>
<<set _thresh = _to_advance_hr * 3 / 100>>
<<if $difficulty == -2>>
<<set _thresh *= 2>>
<<elseif $difficulty == -1>>
<<set _thresh *= 1.5>>
<</if>>
<<if $player.stats.strength gte 30>>
<<set _thresh = 0>>
<</if>>
<<if _roll lt _thresh>>
<<set $player.stats.strength += 1>>
<<set $_temp_to_log += "<div>You worked yourself the perfect amount to build your frame (Strength " +
setup.show_change_html(0, 1) + ")</div>">>
<</if>>
/* Simulate injury roll */
<<set _roll = randomFloat(1.0)>>
<<set _thresh = _to_advance_hr * 2 / 100>>
<<if _explore>>
<<set _thresh += _to_advance_hr * 3 / 100>>
<</if>>
<<if _roll lt _thresh>>
<<set _roll = randomFloat(1.0)>>
<<set _to_injure = 1>>
<<if _roll gte .5>>
<<set _to_injure += 1>>
<</if>>
<<set $_temp_to_log += "<div>You over-worked yourself, tripping over some rocks and twisting your ankle (Dexterity " +
setup.show_change_html(_to_injure, 0) + ")</div>">>
<<set $player.stats.dexterity -= _to_injure>>
<</if>>
/* Check if there were any changes at all */
<<set _changes = false>>
<<for _key, _val range _player.conditions>>
<<if _val != $player.conditions[_key]>>
<<set _changes = true>>
<<break>>
<</if>>
<</for>>
<<for _key, _val range _player.slave_traits>>
<<if _val != $player.slave_traits[_key]>>
<<set _changes = true>>
<<break>>
<</if>>
<</for>>
<<for _key, _val range _player.stats>>
<<if _val != $player.stats[_key]>>
<<set _changes = true>>
<<break>>
<</if>>
<</for>>
<<if _changes>>
<<set $_temp_to_log += "<br><b>Work total stat changes:</b>">>
<<set $_temp_to_log += "<ul>">>
/* Add in stats changes */
<<for _key, _val range _player.stats>>
<<if _val != $player.stats[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.stats[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in condition changes */
<<for _key, _val range _player.conditions>>
<<if _val != $player.conditions[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.conditions[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in slave trait changes */
<<for _key, _val range _player.slave_traits>>
<<if _val != $player.slave_traits[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.slave_traits[_key], true) + "</li>")>>
<</if>>
<</for>>
<<set $_temp_to_log += "<li>Lari: <span style=\"color: green\">" + setup.LARI + _pay + "</span></li>">>
<</if>>
/* Simulate exploration */
<<if _explore>>
/* Roll for iron */
<<set _roll = randomFloat(1.0)>>
<<set _thresh = 3 * _to_advance_hr / 100>>
<<if $difficulty == -2>>
<<set _thresh *= 2>>
<<elseif $difficulty == -1>>
<<set _thresh *= 1.5>>
<</if>>
<<if _roll lt _thresh>>
<<run UInv.AddItem("inventory", "iron", 1)>>
<<set $_temp_to_log += "<li><span style=\"color: green\">Iron Ingot: " + setup.show_change_html(0, 1) + "</span></li>">>
<</if>>
/* Roll for silver */
<<set _roll = randomFloat(1.0)>>
<<set _thresh = 1 * _to_advance_hr / 100>>
<<if $difficulty == -2>>
<<set _thresh *= 2>>
<<elseif $difficulty == -1>>
<<set _thresh *= 1.5>>
<</if>>
<<if _roll lt _thresh>>
<<run UInv.AddItem("inventory", "silver", 1)>>
<<set $_temp_to_log += "<li><span style=\"color: green\">Silver Ingot: " + setup.show_change_html(0, 1) + "</span></li>">>
<</if>>
<</if>>
/* Close off changes */
<<set $_temp_to_log += "</ul>">>
/* Unset variables */
<<unset _changes>>
/* <<unset _to_advance_hr>> */
<<unset $_player>>
/* Re-enable menu */
<<set $enable_menu = true>>
<<goto "niponMines">><div id="events_actions" class="action container row col hidden"
style="--rows: 4; --cols: 5">
@@#events1;<<button "1">>
<<set _action = 1>>
<</button>>@@
@@#events2;<<button "2">>
<<set _action = 2>>
<</button>>@@
@@#events3;<<button "3">>
<<set _action = 3>>
<</button>>@@
@@#events4;<<button "4">>
<<set _action = 4>>
<</button>>@@
@@#events5;<<button "5">>
<<set _action = 5>>
<</button>>@@
@@#events6;<<button "6">>
<<set _action = 6>>
<</button>>@@
@@#events7;<<button "7">>
<<set _action = 7>>
<</button>>@@
@@#events8;<<button "8">>
<<set _action = 8>>
<</button>>@@
@@#events9;<<button "9">>
<<set _action = 9>>
<</button>>@@
@@#events10;<<button "10">>
<<set _action = 10>>
<</button>>@@
@@#events11;<<button "11">>
<<set _action = 11>>
<</button>>@@
@@#events12;<<button "12">>
<<set _action = 12>>
<</button>>@@
<<set $buttons = []>>
<<for _i = 1; _i lte 12; _i++>>
<<set $buttons.push("#events" + _i)>>
<</for>>
<<set $buttons_extra = ["#events_actions_back", "#events_actions_leave"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div id="events_actions_back" class="hidden" style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<if def _back_action && (ndef _refresh || !_refresh)>>
<<addclass "#events_actions" "hidden">>
<<removeclass `_back_action` "hidden">>
<<set _stop_loop = true>>
<<timed 100ms>>
<<unset _stop_loop>>
<</timed>>
<<else>>
<<unset _refresh>>
<<goto niponMines>>
<</if>>
<</button>>
</div>
<div id="events_actions_leave" class="hidden" style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMines">>
<<include locationButton>>
</div>
</div><<set _prefix = "niponMinesWorkEvents">>
<<set _events = [
"InjuredGirl"
]>>
<<script>>
let _v = State.variables;
let _t = State.temporary;
for (const event of _t.events) {
_v.locations[passage()].data.work_event_pool.push(_t.prefix + event);
}
<</script>><<script>>
let _v = State.variables;
let _t = State.temporary;
let player = _v.player;
let player_status = player.get_status("nipon");
/* Randomly generate a character */
let char = new setup.Character("temp_nipon_mines", true, 40);
/* Start off with an unknown first name */
let real_first_name = char.first_name;
let fn = "the girl";
char.gender = 1;
char.shuffle();
char.first_name = "???";
/* Custom for genders */
let genital = (player.gender == 0) ? "dick" : "pussy";
let cum = (player.gender == 0) ? "cum" : "juice";
/* Predeclare branches for reuse in main event tree */
let help_choice_good = () => {
let roll = randomFloat(1.0);
let gained_ore = null;
if (roll < 0.9) {
gained_ore = "iron";
} else {
gained_ore = "silver";
}
let responses = [
`As your eyes meet ${fn}'s, you're compelled by a sense of duty and compassion to help. Setting aside your tools, you approach her cautiously, ensuring you don't startle her further.`,
player.dialogue(`Hold on, I'll get you out`),
`you whisper soothingly. You carefully inspect the weight and position of the rock pinning her foot. With a combination of your pickaxe's leverage and brute strength, you begin to shift the rock. \
She winces in pain, biting her lower lip, her ${char.physical_traits.eye_color} eyes watering, but she doesn't cry out. After what feels like an eternity, the rock finally budges enough to free \
her foot. She collapses into your arms, her breaths ragged and heavy. You take a moment to ensure she's alright, noticing her ${char.physical_traits.hair_color} hair disheveled and the \
abrasions on her ${char.physical_traits.skin_color} skin.`,
char.dialogue(`Thank you...`),
`${fn} manages to whisper The two of you sit for a while, allowing her to gather her strength. As you head out of the mine with ${fn} in tow, she hands you some of the ores she dug up`,
char.dialogue(`Let's hope to never meet again in this cruel place... this makes us even.`),
(gained_ore == "iron") ? "<li><span style=\"color: green\">Iron Ingot: " + setup.show_change_html(0, 1) + "</span></li>" : "<li><span style=\"color: green\">Silver Ingot: " + setup.show_change_html(0, 1) + "</span></li>",
$(`<ol>
<li id="li1">Done.</li>
</ol>`)
];
let next_branch = [
responses,
[() => {
return [[
[`Soon as you approach the exit of the mines ${fn} mysteriously disappears from sight.`], null
], () => {
$.wiki("<<include niponMinesWorkEngineAfter>>");
}, true, false, false];
}]
];
return [next_branch, () => {
UInv.AddItem("inventory", "iron", 1);
}, false, false, false];
};
let walk_away_choice = () => {
let responses = [
`As your eyes lock onto ${fn}'s, a myriad of thoughts race through your mind. This place, known for its dangers and unpredictable turns, has taught you to be wary of every situation. \
Her distress is evident, but so is the uncertainty of her presence here. Without uttering a word, you take a few steps back, your instincts on high alert. The girl's ${char.physical_traits.eye_color} \
eyes follow your every movement, a mix of confusion and desperation clouding them. She barely manages to cry out`,
char.dialogue(`I... Please, don't leave...`),
`With one last glance at her, you turn away, retreating deeper into the mine. Her pleas grow fainter with distance, but the weight of the decision stays with you as you know that you've left here there to die.`,
$(`<ol>
<li id="li1">Done.</li>
</ol>`)
];
let next_branch = [
responses,
[() => {
return [[
[`Soon as you approach the exit of the mines with ${fn} still lingering in your mind.`], null
], () => {
$.wiki("<<include niponMinesWorkEngineAfter>>");
}, true, false, false];
}]
];
return [next_branch, () => {}, false, false, false];
};
let help_choice_bad = () => {
let responses = [
`Having had your way with ${fn} you decide you should help her.`,
player.dialogue(`Hold on, I'll get you out`),
`you whisper soothingly. You carefully inspect the weight and position of the rock pinning her foot. With a combination of your pickaxe's leverage and brute strength, you begin to shift the rock. \
She winces in pain, biting her lower lip, her ${char.physical_traits.eye_color} eyes watering, but she doesn't cry out. After what feels like an eternity, the rock finally budges enough to free \
her foot. She collapses into your arms, her breaths ragged and heavy. You take a moment to ensure she's alright, noticing her ${char.physical_traits.hair_color} hair disheveled and the \
abrasions on her ${char.physical_traits.skin_color} skin.`,
char.dialogue(`...`),
`${fn} shakes in shock as her eyes pool with tears. She is clearly conflicted on how she feels about you, both her savior and abuser. She keeps her arms tightly wrapped around her and doesn't say a word`,
$(`<ol>
<li id="li1">Done.</li>
</ol>`)
];
let next_branch = [
responses,
[() => {
return [[
[`Soon as you approach the exit of the mines ${fn} mysteriously disappears from sight.`], null
], () => {
$.wiki("<<include niponMinesWorkEngineAfter>>");
}, true, false, false];
}]
];
return [next_branch, () => {}, false, false, false];
};
_t.event_path = [];
_t.event_tree = [
[
`Deep within the echoing caverns of Nipon, your pickaxe strikes rhythmically against the stony walls. The dim light from your torch illuminates the rich veins of ore, \
but a faint whimper distracts you. Venturing further, you discover a young woman with her foot trapped beneath a heavy rock. Her eyes, filled with fear and hope, \
lock onto yours. Her chest rises and falls rapidly, her clothes tattered and dirt smeared across her clearly ${setup.titleCase(char.physical_traits.ethnicity)} face.`,
char.dialogue(`Please... help me`),
$(`<ol>\
<li id="li1">Examine her.</li>
<li id="li2">Ask her name.</li>
<li id="li3">Help her and bring her out of the mine.</li>
<li id="li4">Take advantage of the situation.</li>
<li id="li5">Walk away.</li>
</ol>`)
],
[
() => {
let responses = [
`You eye ${fn} up and down. Amidst the gloom of the mine, ${fn}'s ${char.physical_traits.eye_color} eyes shimmered with tears, reflecting both pain and a glimmer of hope. \
Strands of her ${char.physical_traits.hair_color} hair, now disheveled and coated with dust, clung to her sweat-drenched forehead. \
Her ${char.physical_traits.skin_color} skin bore the marks of hardship, abrasions, and dirt, hinting at the struggles she had endured in the mine. \
Despite the adversity, her ${char.physical_traits.ethnicity} features remained striking.`,
char.dialogue(`Please...`)
];
let next_branch = [
responses,
null
];
return [next_branch, () => {}, false, false, true];
},
() => {
let responses = [
`You can tell that it takes her a lot of effort to answer`,
char.dialogue(`My name is ${setup.titleCase(real_first_name)}... now please, it hurts so bad...`)
];
fn = setup.titleCase(real_first_name);
char.first_name = real_first_name;
let next_branch = [
responses,
null
];
return [next_branch, () => {}, false, false, true];
},
help_choice_good,
() => {
let responses = [
`The vulnerable state of ${fn} presents an opportunity too tempting to ignore. A sly smile curls your lips as you saunter towards her, your eyes raking over her trapped form. \
Her ${char.physical_traits.eye_color} eyes widen with fear, the weight of her situation pressing heavily upon her. Strands of her ${char.physical_traits.hair_color} hair stick to her face, accentuating \
her ${char.physical_traits.skin_color} skin that's marred with dirt and sweat from her ordeal. She pleads with dread in her voice`,
char.dialogue(`Please, help me`),
`You lean in, your face inches from hers, reveling in the power dynamic.`,
player.dialogue(`What's it worth to you?`),
`She looks up, her ${char.physical_traits.eye_color} eyes filled with tears that threaten to spill. Her voice is barely a whisper, laden with resignation.`,
char.dialogue(`I... I'll do anything, just please... please don't leave me here to die...`),
`Every ounce of pride and resistance seems to have been drained from her, leaving behind only vulnerability and despair`,
$(`<ol>\
<li id="li1">Put her mouth to use.</li>
<li id="li2">Change your mind and help her.</li>
<li id="li3">Walk away.</li>
</ol>`)
];
let next_branch = [
responses,
[
() => {
let responses = [];
if (player.gender == 0) {
responses = [
player.dialogue(`Anything? That's a pretty enticing offer that I'll indeed take.`),
`You see ${fn} slightly relax for a second until you pull out your hard erect penis. Her eyes widen with fear having misinterpreted your desire,`,
char.dialogue(`No please, I have money and ore! Just help me out first, plea...`),
`You quickly silence her by sticking your dick into her mouth. She tries to struggle but any movement seems to hurt her even more due to the position of the rock. You began vigorously \
thrusting in and out of ${fn}'s ${char.physical_traits.ethnicity} face, using it as a proper fuck hole.`,
player.dialogue(`Yeah shut the fuck up you slut. Imagine thinking you deserve anymore than this. What's even the point of your life if you can't be properly used?`),
`As you continue your assault, the sounds of choking, gagging and muffled crying echo through the mineshaft. Eventually you feel your bottled up orgasm approaching. You thrust one more time \
unloading a mouthful of cum into ${fn}'s mouth. You hold your pickaxe close to her throat,`,
player.dialogue(`Swallow that and tell me you enjoy it, or you'll wish you just died here under that rock.`),
`Terrified, ${fn} swallows every last drop of your cum, interrupted by gags, fits of crying, and painful gulps. With tears still streaming down her face, she makes a plea.`,
char.dialogue(`I... I... thank you, now please save me so I can have more of your cum.`),
$(`<ol>\
<li id="li1">Help her.</li>
<li id="li2">Walk away.</li>
</ol>`)
];
} else {
responses = [
player.dialogue(`Anything? That's a pretty enticing offer that I'll indeed take.`),
`You see ${fn} slightly relax for a second until you pull down your pants. Her eyes widen with fear having misinterpreted your desire,`,
char.dialogue(`No please, I have money and ore! Just help me out first, plea...`),
`You quickly silence her by sticking your mount onto her mouth, suffocating her with your pussy. She tries to struggle but any movement seems to hurt her even more due to the position of the rock. You began vigorously \
humping ${fn}'s ${char.physical_traits.ethnicity} face,`,
player.dialogue(`Stick your tongue out or I'll fucking kill you right here.`),
`She complies and as you continue your assault, the sounds of choking, gagging and muffled crying echo through the mineshaft. Eventually you feel your bottled up orgasm approaching. You hump one more time \
unloading a mouthful of piss into ${fn}'s mouth.`,
player.dialogue(`Swallow that and tell me you enjoy it, or you'll wish you just died here under that rock.`),
`Terrified, ${fn} swallows every last drop of your urine, interrupted by gags, fits of crying, and painful gulps. With tears still streaming down her face, she makes a plea.`,
char.dialogue(`I... I... thank you, now please save me so I can have more of your pee.`),
$(`<ol>\
<li id="li1">Help her.</li>
<li id="li2">Walk away.</li>
</ol>`)
];
}
let next_branch = [
responses,
[help_choice_bad, walk_away_choice]
];
return [next_branch, () => {}, false, false, false];
},
help_choice_good,
walk_away_choice
]
];
return [next_branch, () => {}, false, false, false];
},
walk_away_choice
]
];
_t.options = _t.event_tree[0][_t.event_tree[0].length - 1];
$.wiki("<<disableactions _options>>");
$.wiki("<<include registerEventListeners>>");
setup.mainLog_append_delayed(_t.event_tree[0], _v.buttons, _v.buttons_extra, 1000, true, null, () => {});
<</script>>/* Initial setup, declare characters in the scene. We'll pick a random slave for now. */
<<set _char = $characters[either($characters.shintani_hiroyuki.slaves)]>>
/* If you want a random character that's fine as well */
<<set _random_char = new setup.Character("random_key")>>
<<set _random_char.first_name = "Jane">>
<<set _random_char.last_name = "Doe">>
/* Bool to tell if the player is a higher status than the character */
<<set _higher_status = ($player.get_status("nipon") == "slave" && _char.status == "low_slave") ||
($player.get_status("nipon") == "high_slave" && _char.status == "slave") ||
($player.get_status("nipon") == "high_slave" && _char.status == "low_slave")>>
/* For eventual rounding and simulation */
<<set _to_round = _char.key>>
<<set $to_simulate.add(_char.key)>>
/* Initial writing setup */
<<set _to_log = [
"This is initialization text that will appear",
"Having this as an array will delay the appending to the main log",
_char.dialogue("I can talk like this."),
]>>
/* Options for the player to partake in */
<<set _options = "\
<ol>\
<li id=\"li1\">Action 1.</li>\
<li id=\"li2\">Action 2.</li>\
<li id=\"li3\">Action 3.</li>\
<li id=\"li4\">Leave.</li>\
</ol>\
">>
/* Append the options onto the log */
<<set _to_log[2] += _options>>
/* Make the options into a jquery for ease of access */
<<set _options = $(_options)>>
/* Disable the back and leave button (can't escape events) */
<<set _disable_buttons = true>>
/* Disable the buttons that don't correspond to an action */
<<disableactions _options>>
/* Append the _to_log onto the log for the player to see */
<<run setup.mainLog_append_delayed(_to_log, $buttons, $buttons_extra)>>
/* Listener for the player to click */
<<silently>><<repeat 10ms>>
<<if _action !== undefined>>
<<switch _action>>
<<case 1>>
<<set _responses = [
"Here are some responses",
_char.dialogue("Hello world."),
_random_char.dialogue("Who are you talking to?"),
_options.clone()
]>>
<<run _button_fn()>>
<<case 2>>
/* First apply the changes */
<<set _delta = {
"stats": {
"dexterity": 0.9
},
"slave_traits": {
"obedience": -1,
"trust": 2
}
}>>
<<set _char_delta = {
"slave_traits": {
"obedience": 2
}
}>>
<<set _true_delta = setup.apply_delta($player, _delta)>>
<<set _char_true_delta = setup.apply_delta(_random_char, _char_delta)>>
<<set _responses = [
"This is how you print changes " + $player.print_delta(_true_delta) + ".",
"This is similarly how you print character changes " + _random_char.print_delta(_char_true_delta) + ".",
"You should also see these changes on the bars.",
_options.clone()
]>>
<<include round>>
<<run _button_fn()>>
<<case 3>>
/* Cross out the option */
<<set _options.find("#li3").css("text-decoration", "line-through")>>
/* Disable leave and back button (have to do this everytime you call disableactions) */
<<set _disable_buttons = true>>
/* Disable the actions */
<<disableactions _options>>
/* Include cloned action in responses */
<<set _responses = [
"This is how you let an action only be called once.",
_options.clone()
]>>
<<run _button_fn()>>
<<case 4>>
<<set $_temp_to_log = "This is ending text. You can put summary of what happened here.">>
/* To end event just put this line anywhere */
<<include niponMinesWorkEngineAfter>>
<<run _button_fn()>>
<</switch>>
<</if>>
<</repeat>><</silently>>
/* Temporary function for what happens when you click a button */
<<script>>
State.temporary.button_fn = () => {
let _t = State.temporary;
let _v = State.variables;
delete _t.action;
if (_t.responses != null) {
setup.mainLog_append_delayed(_t.responses, _v.buttons, _v.buttons_extra);
delete _t.responses;
}
}
<</script>><<nobr>>
<div id="actions" class="action container row col longbutton fiveQuarters"
style="--rows: 4; --cols: 4">
<<button "Shop">>
<<set _shop_bag = "niponStalls">>
<<if $locations[passage()].data.shop_bag == null>>
<<set $locations[passage()].data.shop_bag = _shop_bag>>
<<run UInv.CreateBag(_shop_bag)>>
<</if>>
/* Check if refresh inventory */
<<if $locations[passage()].data.last_visit == null>>
<<set $locations[passage()].data.last_visit = clone($gameDate)>>
<<set _refresh = true>>
<</if>>
<<set _date_diff = Math.floor(($gameDate - $locations[passage()].data.last_visit) / 86400000)>>
<<if _date_diff gt 7>>
<<set _refresh = true>>
<</if>>
/* Refresh inventory */
<<if _refresh>>
<<run UInv.EmptyBag(_shop_bag)>>
<<addmoney `setup.round2(setup.randn_bm() * 500 + 4000)` _shop_bag>>
<<for _i = 0; _i lt 20; _i++>>
<<run UInv.AddItem(_shop_bag, either(UInv.Tier1), 1)>>
<</for>>
<<for _i = 0; _i lt 3; _i++>>
<<run UInv.AddItem(_shop_bag, either(UInv.Tier1_gifts), 1)>>
<</for>>
<</if>>
/* Check if first time shopping */
<<if !$locations["world"].data.shopped>>
<<set $locations["world"].data.shopped = true>>
<<popover>>
<<include shoppingTutorial>>
<</popover>>
<</if>>
<<include shopEngine>>
<</button>>
<<button "Trade">>
<<script>>
$("#actions").addClass("hidden");
$("#trade_options").removeClass("hidden");
<</script>>
<</button>>
<<disable>>
<<button "Work">><</button>>
<</disable>>
<<disable>>
<<button "Gamble">><</button>>
<</disable>>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMarket">>
<<include locationButton>>
</div>
</div>
<</nobr>><<nobr>>
/* TODO: Implement blackjack */
<div id="gamble_actions" class="action container row col"
style="--rows: 4; --cols: 5">
@@#round1;.rounds;<<button "1 Round">>
<</button>>@@
@@#round2;.rounds;<<button "2 Rounds">>
<</button>>@@
@@#round3;.rounds;<<button "3 Rounds">>
<</button>>@@
@@#round4;.rounds;<<button "4 Rounds">>
<</button>>@@
<<button "Rules">>
<<popover>>
The common game of jurook is the main game played at both parties and gambling sessions within Nipon. First popularized
by Shintani, Jurook is a simpler version of Blackjack where splitting and doubling down is not allowed.
<</popover>>
<</button>>
@@#bet20;.bet;<<button "¤20/round">>
<</button>>@@
@@#bet50;.bet;<<button "¤50/round">>
<</button>>@@
@@#bet100;.bet;<<button "¤100/round">>
<</button>>@@
@@#bet200;.bet;<<button "¤200/round">>
@@#gamble_start;<<button "Start">><</button>>@@
<</button>>@@
@@#gamble_back;<<button "Back">>
<</button>>@@
<div id="gamble_leave" style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMarket">>
<<include locationButton>>
</div>
<<set $buttons = ["#round1", "#round2", "#round3", "#round4",
"#bet20", "#bet50", "#bet100", "#bet200"]>>
<<set $buttons_extra = ["#gamble_back", "#gamble_leave"]>>
</div>
<<set _dealer = new setup.Character("dealer")>>
<<set _dealer.first_name = "Dealer">>
<<timed 50ms>><<script>>
$(".rounds button").on("click", (event) => {
let player = State.variables.player;
let dealer = State.temporary.dealer;
$(".rounds button").removeClass("disabled");
$(".rounds button").prop("disabled", false);
$(".bet button").addClass("disabled");
$(".bet button").prop("disabled", true);
let self = $(event.currentTarget);
let rounds = setup.numerize(self.html());
if (rounds >= 3) {
let responses = [player.dialogue("Let\'s play " + rounds + " rounds,")]
if (player.get_status_prop("tact") < 40) {
responses.push(setup.fail("tact"));
responses.push("The dealer looks at you and for some reason feels no need to push his luck,");
responses.push(dealer.dialogue("Yeah, I don\'t know about that..."));
} else {
responses.push(setup.pass("tact"));
responses.push(dealer.dialogue("Yeah, okay, goodluck."));
self.addClass("disabled");
self.prop("disabled", true);
State.temporary.rounds = rounds;
$(".bet button").removeClass("disabled");
$(".bet button").prop("disabled", false);
}
}
});
$(".bet button").on("click", (event) => {
let player = State.variables.player;
$(".bet button").removeClass("disabled");
$(".bet button").prop("disabled", false);
let self = $(event.currentTarget);
self.addClass("disabled");
self.prop("disabled", true);
if (player.get_money() < setup.numerize(self.html()))
});
<</script>><</timed>>
<</nobr>><<nobr>>
<<if $quests.the_nipon_economy.stage lte 1>>
/* Forward Nipon Economy quest */
<<if !$quest_journal.completed.contains("the_nipon_economy") && $quests.the_nipon_economy.added && $quests.the_nipon_economy.stage lt 2>>
<<set $quests.the_nipon_economy.stage = 2>>
<</if>>
<</if>>
<<set $_to_log = "
<div>You enter the bustling market stalls to find hundreds of people buying, selling and bartering \
away. With the lari to your name, you can feel the heavy greed in the air.</div><br>\
">>
/* Load in any saved variables */
<<loadVars>>
/* Audio engine */
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
<div id="commodityLog" class="mainLog hidden">
<center>
<div style="margin: 20px">
<b id="commodity_name"></b><br>
''Spread'': <span id="commodity_spread">2%</span>
</div>
</center>
<div class="container threeCol">
<div class="container twoCol">
<p>
Holding: <br>
Midprice: <br>
Sigma: <br>
Theta: <br>
EQ-price: <br>
EQ-trend: <br>
</p>
<p id="commodity_stats" style="text-align: right">
</p>
</div>
<center class="smalltext">
<div>
''Buy Price'': <span id="commodity_buy_price">$5</span>
</div><br>
<div class="column">
@@#buy1;<<button "Buy">>
<<removemoney _buy_price>>
<<run UInv.AddItem("inventory", _selected)>>
<<updatecommodities _selected>>
<<audio "coins_sound" play>>
<<addmins 10>>
<</button>>@@
@@#buy5;<<button "Buy 5">>
<<set _to_pay = 5 * _buy_price>>
<<removemoney _to_pay>>
<<run UInv.AddItem("inventory", _selected, 5)>>
<<updatecommodities _selected>>
<<unset _to_pay>>
<<audio "coins_sound" play>>
<<addmins 20>>
<</button>>@@
@@#buyall;<<button "Buy all">>
<<set _to_buy = parseInt($player.get_money() / _buy_price)>>
<<set _to_pay = _to_buy * _buy_price>>
<<removemoney _to_pay>>
<<run UInv.AddItem("inventory", _selected, _to_buy)>>
<<updatecommodities _selected>>
<<unset _to_buy>>
<<unset _to_pay>>
<<audio "coins_sound" play>>
<<addmins 30>>
<</button>>@@
</div>
</center>
<center class="smalltext">
<div>
''Sell Price'': <span id="commodity_sell_price">$5</span>
</div><br>
<div class="column">
@@#sell1;<<button "Sell">>
<<addmoney _sell_price>>
<<run UInv.DeleteItem("inventory", _selected, 1)>>
<<updatecommodities _selected>>
<<audio "coins_sound" play>>
<<addmins 10>>
<</button>>@@
@@#sell5;<<button "Sell 5">>
<<set _to_pay = 5 * _sell_price>>
<<addmoney _to_pay>>
<<run UInv.DeleteItem("inventory", _selected, 5)>>
<<updatecommodities _selected>>
<<unset _to_pay>>
<<audio "coins_sound" play>>
<<addmins 20>>
<</button>>@@
@@#sellall;<<button "Sell all">>
<<set _to_sell = UInv.BagHasItem("inventory", _selected)>>
<<set _to_pay = _to_sell * _sell_price>>
<<addmoney _to_pay>>
<<run UInv.DeleteItem("inventory", _selected, _to_sell)>>
<<updatecommodities _selected>>
<<unset _to_sell>>
<<unset _to_pay>>
<<audio "coins_sound" play>>
<<addmins 30>>
<</button>>@@
</div>
</center>
</div>
</div>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include niponStallsActions>>
<<include niponStallsTradeOptions>>
</div>
</div>
</div>
<<updatetime>>
<<timed 50ms>><<script>>
$(".column").find("button").on("click", (event) => {
let _t = State.temporary;
let _v = State.variables;
if (_v.gameDate.getHours() >= setup.locations.get(passage()).access_times[1]) {
$.wiki("<<notify>>The Nipon Stalls have closed.<</notify>>");
Engine.play("niponMarket");
}
});
<</script>><</timed>>
<</nobr>><<nobr>>
<div id="trade_options" class="action container row col longbutton fiveQuarters hidden"
style="--rows: 4; --cols: 4">
<div style="grid-row: 1; grid-column: 4"></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div id="back_button" style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<script>>
$("#actions").removeClass("hidden");
$("#trade_options").addClass("hidden");
<</script>>
<</button>>
</div>
<div id="back_to_options_button" class="hidden" style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<script>>
$("#commodityLog").addClass("hidden");
$("#mainLog").removeClass("hidden");
$("#back_to_options_button").addClass("hidden");
$("#back_button").removeClass("hidden");
$(".to_hide").removeClass("hidden");
<</script>>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMarket">>
<<include locationButton>>
</div>
<<for _key, _val range $commodities>>
<<capture _key>>
<div class="to_hide">
<<button `setup.titleCase(_key)`>>
<<set _selected = _key>>
<<set _halfspread = setup.sigmoid($difficulty) * .1>>
<<if $player.titles.has("well_connected")>>
<<set _halfspread *= 0.5>>
<</if>>
<<updatecommodities _selected>>
<</button>>
</div>
<</capture>>
<</for>>
</div>
<</nobr>><div id="actions" class="action container row col longbutton fiveQuarters" style="--rows: 4; --cols: 4">
<<button "Watch Play">>
<<if $gameDate.getHours() gte 22 || ($gameDate.getHours() lt 18)>>
<<notify>>
Too late watch play!
<</notify>>
<<else>>
<<script>>
/* Reset buttons */
$(".play_option").find("button").prop("disabled", false);
$(".play_option").find("button").removeClass("disabled");
$("#start_play").find("button").addClass("disabled");
$("#start_play").find("button").prop("disabled", true);
/* Show options */
$("#play_options").removeClass("hidden");
$("#actions").addClass("hidden");
/* Fill in play information */
$("#info_title").html("Watch a Play");
$("#infoLogBody").html("The Nipon Theaters allows both the upper and lower classes to enjoy a night of drama, forgetting \
the problems that trouble the heart. You can watch a three hour showing with or without slaves in your party.\
<ul>\
<li id=\"li1\">Cost: " + setup.LARI + "75 (or " + setup.LARI + "300 for box seating) per person</li>\
<li id=\"li2\">Player Willpower: " + setup.show_change_html(0, 7) + "</li>\
<li id=\"li3\">Party Affection: " + setup.show_change_html(0, 5, true) + " (or " +
setup.show_change_html(0, 7, true) + " for box seating)</li>\
<li id=\"li4\">Party Willpower: " + setup.show_change_html(0, 3, false) + " (or " +
setup.show_change_html(0, 4, false) + " for box seating)</li>\
</ul>");
/* Show info */
$("#infoLog").removeClass("hidden");
$("#mainLog").addClass("hidden");
<</script>>
<</if>>
<</button>>
<<button "Play Info">>
/* Fill in play information */
<<script>>
$("#info_title").html("Nipon Theater - <em>Hamlet</em>");
$("#infoLogBody").html("Introducing <em>Hamlet</em>, a play translated from incomplete sources by the researchers at \
the Nipon Academy. Written by William Shakespeare, <em>Hamlet</em> tells a story of revenge, madness, and the \
contemplation of life and death.");
<</script>>
/* Show info */
<<removeclass "#infoLog" "hidden">>
<<addclass "#mainLog" "hidden">>
/* Show actions */
<<addclass "#actions" "hidden">>
<<removeclass "#return_bar" "hidden">>
<</button>>
<<button "Party">>
<<if $player.party == null || $player.party.length == 0>>
<<notify>>You do not have any party members.<</notify>>
<<else>>
<<set $selection_queue = $player.party>>
<<set $selected = $player.party[0]>>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto characterMenu>>
<</if>>
<</button>>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMarket">>
<<include locationButton>>
</div>
</div><<script>>
/* Initialization */
let _t = State.temporary;
let _v = State.variables;
let player = _v.player;
let char = _v.characters[either(player.party)];
let fn = setup.titleCase(char.first_name);
let address = setup.titleCase(char.address);
_t.options = $(
`<ol>\
<li id="li1">Ignore them.</li>\
<li id="li2">Pet them.</li>\
<li id="li3">Use this opportunity to use their face while your enjoy the show.</li>\
</ol>`);
/* UI setup */
_t.responses = [
`You are seated comfortably at the traditional showing of Hamlet. You've always loved Shakespeare's work, the tension in the theater palpable as the audience awaits the dramatic turn of events.`,
`In the middle of the performance, ${fn} drops something - a key or a coin, you're not focused enough to discern. Their movements are quick and practiced as they bend down to retrieve the item. In their haste, they line their head to your crotch momentarily, stirring an unexpected sensation in the theater.`,
_t.options
];
/* Show select slave's disposition */
$("#char_quick_info").empty();
$("#char_quick_info").html(`<b>${fn}'s Disposition: </b>` + setup.titleCase(char.get_disposition()));
setup.mainLog_append_delayed(_t.responses, State.variables.buttons, State.variables.buttons_extra, 1000, true, null,
() => {
$.wiki("<<disableactions _options>>");
/* Add event listener */
$("#events_actions").find("button").on("click", () => {
let self = $(event.currentTarget);
if (self.html() == "1") {
$.wiki("<<include niponTheaterPlayEngineAfter>>");
} else if (self.html() == "2") {
let delta = {
"slave_traits": {
"obedience": 1
}
};
_v._temp_to_log += `<div>You unexpectantly pet ${fn} during the show when ${setup.he(char)} went to pick something up ${char.print_delta(delta)}.</div>`;
setup.apply_delta(char, delta);
$.wiki("<<include niponTheaterPlayEngineAfter>>");
} else if (self.html() == "3") {
let disposition = char.get_disposition();
let delta = {
"slave_traits": {}
};
let responses = [];
if (disposition == "devoted" || disposition == "submissive") {
delta.slave_traits["obedience"] = 1;
delta.slave_traits["willpower"] = -1;
let true_delta = setup.apply_delta(char, delta);
responses = [
`Caught off guard, ${fn}'s eyes widen at your unspoken demand. Yet, in the dimly lit theater, you see the spark of understanding flicker in their eyes. Their lips curve into a faint smile, accepting your command.`,
char.dialogue(`Yes, ${address}.`),
`The hushed words barely reach your ears, blending seamlessly with the Shakespearean dialogue resonating from the stage. The sense of empowerment coursing through ${fn} is palpable as they position themselves, prepared to serve you.`,
char.dialogue(`This... is for you, ${address}.`),
`As ${fn} leans in, their warm breath caresses you, setting off a trail of shivers. Their lips enclose around you in the shadowy confines of the theater, their movements rhythmic, steady, and entirely focused on your pleasure. The escalating tension, the mounting pleasure, both intensify with each passing moment.`,
char.dialogue(`Does it please you, ${address}?`),
`Their words vibrate against you, their voice muffled yet filled with a potent combination of devotion and thrill. The pulsing pleasure within you, magnified by the clandestine nature of the act, crescendos silently, a moment of shared intimacy savored under the guise of a public spectacle.`,
char.dialogue(`I... I hope it pleases you, ${address}.`)
];
} else {
delta.slave_traits["obedience"] = -4;
delta.slave_traits["willpower"] = -3;
responses = [
`At your command, ${fn}'s eyes widen in shocked surprise. A heavy silence hangs between you two in the dimly lit theater, a stark contrast to the theatrical drama unfolding onstage.`,
char.dialogue(`${address}...`),
`Their voice is a whisper, trembling with the undercurrent of dread. You see them swallow hard, a gloss of unshed tears making their eyes look bigger, more innocent.`,
char.dialogue(`Please...`),
`Despite their pleas, ${fn} leans in serving your crotch with ${setup.his(char)} mouth. They are dutiful, yes, but every inch of their face spells out their disdain. Their movements are mechanical, bereft of any warmth or enthusiasm. The theater reverberates with the echoes of Hamlet's soliloquy, a tragic soundtrack to the equally tragic scene in your midst.`,
char.dialogue(`Is...is this what you want, ${address}?`),
`Tears trail down ${fn}'s cheeks, their words choked and broken. The palpable fear in their voice, coupled with the violation of their previously anticipated enjoyment of Hamlet, taints the act with a bitter taste.`
];
}
let true_delta = setup.apply_delta(char, delta);
responses.push(char.print_delta(true_delta));
/* Append responses, then allow end of event */
_t.options = $(
`<ol>\
<li id="li1">Done.</li>\
</ol>`);
responses.push(_t.options);
setup.mainLog_append_delayed(responses, _v.buttons, _v.buttons_extra, 1000, true, null, () => {
$.wiki("<<disableactions _options>>");
});
}
});
}
);
<</script>><div id="events_actions" class="action container row col" style="--rows: 4; --cols: 5">
/* Fill last column */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 3; grid-column: 5"></div>
<div style="grid-row: 4; grid-column: 5"></div>
@@#events1;<<button "1">>
<<if def _init_sequence && _init_sequence>>
<<unset _init_sequence>>
<<set _responses = [
"You slowly head to the stage, and you can see Lia\'s heart sink. Her eyes show a look of pure disbelief, hoping that \
her suspicions about your betrayal is unfounded. Shintani shatters these hopes immediately,",
_shintani.dialogue("Did you think you could work your way into my own slave\'s mind? I saved " + setup.PRONOUNS[$player.gender]["?him"] +
"from the edge of death out in the desert. He is a key witness to your attempt at a coup. Nina? She\'s dead... for real, and Emily is \
trying her best to breath right now through her shattered nose. You broke the truce laid out by the Union. You are alone. No one will \
protect you now..."),
_lia.dialogue("... I... no... I broke the truce to expose your crimes. You don\'t think I know about the attrocities you committed \
to get your little slaves?"),
"Lia brings out the tampered documents that you gave her, but Shintani just smiles. Lia looks over at you and realizes what happened,",
_shintani.dialogue("Tell me, what did you want to show me in those?"),
_lia.dialogue("I... Let me..."),
"She fumbles a bit through the books before realizing that all the events have been properly sanitized. While some still remained somewhat \
circumstantially incriminating, it wouldn\'t be enough to get her out of her situation. Lia sinks to her knees,",
_lia.dialogue("I... just wanted... our family back... Please, just let us live. Let Nipon go back to how it used to be. We used to be \
good friends with the Namms remember? Don\'t you miss Ronda and Ni..."),
"Lia\'s voice gets caught, realizing that Nina had already been murdered. Clearly an appeal to emotion was not going to cut it. She quickly leaps towards \
Shintani, but is immediately apprehended by you.",
_shintani.dialogue(setup.titleCase($player.first_name) + ", you were the one who got tangled into her plot, what do you think we should do with her?")
]>>
<<set _new_options = "<ol>\
<li id=\"li1\">\"Leave her to me.\"</li>\
<li id=\"li2\">\"Sell her for the properity of Nipon.\"</li>\
<li id=\"li3\">\"Kill her.\"</li></ol>">>
<<set _sequence = 1>>
<<elseif _sequence == 1>>
<<set _sequence = 2>>
<<set _delta = {
"slave_traits": {
"obedience": -100,
"willpower": 100,
},
"mental_conditions": {
"anger": 100
}
}>>
<<set _delta = setup.apply_delta(_lia, _delta)>>
<<set _responses = [
"(Reputation " + setup.show_change_html(0, 50) + ").",
"Lia looks at you with pure disgust " + _lia.print_delta(_delta) + ",",
_shintani.dialogue("Hahaha! She\'s all yours! Guards, send her to the manor and prepare her." +
setup.titleCase($player.first_name) + ", meet me in my office later."),
"Shintani bows on the stage and the audience nervously starts clapping, which slowly grows into cheers. With his motion \
he and his guards exit the building, leaving you in the theater."
]>>
<<set $player.reputation += 50>>
<<set $quests.duty_of_a_slave.data.lia = "own">>
<<set _new_options = "<ol>\
<li id=\"li1\">Sit down.</li>\
</ol>">>
<<elseif _sequence == 2>>
<<unset _sequence>>
<<set $_to_log = "After a brief pause, the show resumes. However, along with the rest of the audience, a silence hung over you as you tried \
to contemplate what just took place.">>
<<set $quests.duty_of_a_slave.stage += 1>>
<<include niponTheaterPlayEngineAfter>>
<</if>>
<</button>>@@
@@#events2;<<button "2">>
<<if _sequence == 1>>
<<set _sequence = 2>>
<<set _delta = {
"slave_traits": {
"obedience": -100,
"willpower": 100,
},
"mental_conditions": {
"anger": 100
}
}>>
<<set _delta = setup.apply_delta(_lia, _delta)>>
<<set _responses = [
"(Reputation " + setup.show_change_html(0, 100) + ").",
"Lia looks at you with pure disgust " + _lia.print_delta(_delta) + ",",
_shintani.dialogue("Hahaha! You are the perfect slave! Guards, send her to the manor and prepare her to sell off. " +
setup.titleCase($player.first_name) + ", meet me in my office later."),
"Shintani bows on the stage and the audience nervously starts clapping, which slowly grows into cheers. With his motion \
he and his guards exit the building, leaving you in the theater."
]>>
<<set $player.reputation += 100>>
<<set $quests.duty_of_a_slave.data.lia = "sell">>
<<set _new_options = "<ol>\
<li id=\"li1\">Sit down.</li>\
</ol>">>
<</if>>
<</button>>@@
@@#events3;<<button "3">>
<<if _sequence == 1>>
<<set _sequence = 2>>
<<set _delta = {
"slave_traits": {
"obedience": -100,
""
"willpower": 100,
"trust": -100
},
"mental_conditions": {
"anger": 100,
}
}>>
<<set _delta = setup.apply_delta(_lia, _delta)>>
<<set _responses = [
"(Reputation " + setup.show_change_html(0, -10) + ").",
"Lia looks at you with pure anguish, disgust, and fear" + _lia.print_delta(_delta) + ",",
_shintani.dialogue("Hmm... well, it is true that I need her gone, but perhaps... nevermind. I\'ll think it over." +
setup.titleCase($player.first_name) + ", meet me in my office later."),
"Shintani bows on the stage and the audience nervously starts clapping, which slowly grows into cheers. With his motion \
he and his guards exit the building, leaving you in the theater."
]>>
<<set $player.reputation -= 10>>
<<set $quests.duty_of_a_slave.data.lia = "kill">>
<<set _new_options = "<ol>\
<li id=\"li1\">Sit down.</li>\
</ol>">>
<</if>>
<</button>>@@
@@#events4;<<button "4">>
<<set _action = 4>>
<</button>>@@
@@#events5;<<button "5">>
<<set _action = 5>>
<</button>>@@
@@#events6;<<button "6">>
<<set _action = 6>>
<</button>>@@
@@#events7;<<button "7">>
<<set _action = 7>>
<</button>>@@
@@#events8;<<button "8">>
<<set _action = 8>>
<</button>>@@
<<set _buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set _buttons.push("#events" + _i)>>
<</for>>
</div>
<<silently>><<timed 10ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
$("#events_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
if (_t.responses != null) {
if (_t.new_options != null) {
_t.responses[_t.responses.length - 1] += _t.new_options;
_t.options = $(_t.new_options);
delete _t.new_options;
$.wiki("<<disableactions _options>>");
} else if (_t.options != null) {
_t.options.find("#li" + self.html()).css("text-decoration", "line-through");
_t.responses.push(_t.options);
$.wiki("<<disableactions _options>>");
}
setup.mainLog_append_delayed(_t.responses, _t.buttons);
delete _t.responses;
}
});
<</script>><</timed>><</silently>>/* Clear the mainLog */
<<run $("#mainLog").html("<b>Theater</b>")>>
<<addclass "#infoLog" "hidden">>
<<removeclass "#mainLog" "hidden">>
<<set _actor = new setup.Character("actor")>>
<<set _actor.first_name = "actor">>
<<set _shintani = $characters.shintani_hiroyuki>>
<<set _lia = $characters.lia_hiroyuki>>
/* Switch action menu */
<<addclass "#play_options" "hidden">>
<<run $("#action_bar").wiki("<<include niponTheaterEventsDutyOfASlaveActions>>")>>
<<set _responses = [
"As you watch through <em>Hamlet</em>, you notice Lia sitting in the audience a couple of rows ahead of you. \
You also notice that during loud applause, many men who are subtly armed, are slowly encroaching the stage.",
_actor.dialogue("To be or not to be, that is the question:"),
"Suddenly a loud voice from the audience continues the famous Soliloquy",
_shintani.dialogue("Whether it is nobler in the mind to suffer"),
_shintani.dialogue("The slings and arrows of outrageous fortune"),
_shintani.dialogue("Or to take arms against a sea of troubles"),
_shintani.dialogue("And by opposing end them. To die -- to sleep..."),
"The actors and audience is completely silent, as Shintani steps onto the stage. Lia, completely frozen in shock is \
apprehended by the various armed men in the audience.",
_lia.dialogue("What is the meaning of this?! Get your hands off me!"),
_shintani.dialogue("No more; and by a sleep to saw we end"),
_shintani.dialogue("The heart-ache and the thousand natural shocks"),
_lia.dialogue("I don\'t know what you\'re trying to do, but the Union will be very unhappy about this!"),
"Suddenly another group of armed guards filter into the room, and the cacophony of confusion from the audience grows. \
Shintani eyes the actors of stage. They continue nervously,",
_actor.dialogue("That flesh is heir to: it is a consummation... Devoutly to be wished."),
"Lia is brought up to the stage and is quickly unhanded as the second group of guards from the Union start to struggle against Shintani\'s \
men. Shintani puts his hand up, and the room immediately is filled with an apprehensive silence. Everyone is standing completely still",
_shintani.dialogue("To die."),
_shintani.dialogue("To sleep."),
_lia.dialogue("What the fuck? Have you finally lost it? Stop this immediately."),
_shintani.dialogue("Bold words for a criminal. " + setup.titleCase($player.first_name) + ", come here.")
]>>
<<set _init_sequence = true>>
<<set _options = "<ol><li id=\"li1\">Walk up to the stage.</li></ol>">>
<<set _responses[_responses.length - 1] += _options>>
<<set _options = $(_options)>>
<<disableactions _options>>
<<run setup.mainLog_append_delayed(_responses, _buttons)>>
<<unset _responses>><div id="events_actions" class="action container row col" style="--rows: 4; --cols: 5">
/* Fill last column */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div style="grid-row: 3; grid-column: 5"></div>
<div id="path_to_freedom_back" style="grid-row: 4; grid-column: 5">
<<button "Back">>
<<set $_temp_to_log = "You exit to the main lobby of the theater with adrenalin stilled pumping through your veins. You are glad \
that you survived.">>
<<set $quests.path_to_freedom.stage = 7>>
/* Remove Nina from the party if added */
<<run setup.remove_val($player.party, "nina")>>
<<run delete $characters.nina>>
<<goto `passage()`>>
<</button>>
</div>
@@#events1;<<button "1">>
<<if def _init_sequence && _init_sequence>>
<<unset _init_sequence>>
<<set _roll = $player.stats.dexterity + dice(1, 4 + $difficulty) - $difficulty>>
<<if _roll gte 30>>
<<set _responses = [
setup.pass("dexterity"),
"You quickly intercept the blade that would have pieced Nina from behind. She looks back at you with a \
slight smirk,",
_lia.dialogue("People of Nipon! It is better to die fighting for freedom then be a prisoner all the days of your life! \
Charge!"),
"With Lia\'s call to action, the Union fighters clash with the defending guards, and Nina turns to assist you with the rear. \
She quickly pushes Shintani towards Lia, and she grabs onto him with another blade to his neck. The rear instantly starts \
pushing towards you and Nina.",
]>>
<<set $characters["nina"] = _nina>>
<<if $player.party.length == 3>>
<<set $player.party.pop()>>
<</if>>
<<set $player.party.push("nina")>>
<<else>>
<<set _responses = [
setup.fail("dexterity"),
"You quickly try to intercept the blade that would have pieced Nina from behind, but don\'t make it in time. As the \
blade pushes deep into her, Lia yells,",
_lia.dialogue("Fuck Nina!... People of Nipon! It is better to die fighting for freedom then be a prisoner all the days of your life! \
Charge!"),
"With Lia\'s call to action, the Union fighters clash with the defending guards, and Nina quickly pushes Shintani towards Lia \
before collapsing. The rear instantly starts pushing towards you.",
]>>
<</if>>
<<set _new_options = "<ol><li id=\"li1\">Fight back.</li></ol>">>
<<else>>
<<set _opponents = []>>
<<for _i = 0; _i lt 3; _i++>>
<<set _temp_opponent = new setup.Character("guard" + _i)>>
<<set _temp_opponent.gender = 0>>
<<set _temp_opponent.first_name = "Guard">>
<<set _temp_opponent.last_name = "" + (_i + 1)>>
<<set _temp_opponent.stats_known = true>>
<<set _temp_opponent.skills_known = true>>
<<set _temp_opponent.equipment.weapon1 = either(["iron_sword", "iron_rapier"])>>
<<set _temp_opponent.equipment.chest = either(["none", "leather_chestplate", "iron_chestplate"])>>
<<set _temp_opponent.equipment.feet = "none", "leather_boots">>
<<set _temp_opponent.equipment.legs = either(["none", "leather_skirt"])>>
<<set _temp_opponent.stats.strength = 50>>
<<set _temp_opponent.skills.melee = 50>>
<<set _opponents.push(_temp_opponent)>>
<</for>>
<<set _retreat_blocked = true>>
<<set _inital_log = _lia.dialogue("It is better to die fighting for freedom then be a prisoner all the days of your life!")>>
<<if setup.is_day($gameDate)>>
<<set _combat_background = "resources/images/places/combat/theaterDay.png">>
<<else>>
<<set _combat_background = "resources/images/places/combat/theaterNight.png">>
<</if>>
<<include combatEngine>>
<<repeat 20ms>><<if _combat_result != null>>
<<if _combat_result == "lose">>
<<set $player.conditions.health = 10>>
<<set $_temp_to_log = "You barely made it back alive. UNDER CONSTRUCTION">>
<<goto $player.home>>
<<else>>
<<set $quests.path_to_freedom.stage += 1>>
<<goto `passage()`>>
<</if>>
<<stop>><</if>><</repeat>>
<</if>>
<</button>>@@
@@#events2;<<button "2">>
<</button>>@@
@@#events3;<<button "3">>
<</button>>@@
@@#events4;<<button "4">>
<<set _action = 4>>
<</button>>@@
@@#events5;<<button "5">>
<<set _action = 5>>
<</button>>@@
@@#events6;<<button "6">>
<<set _action = 6>>
<</button>>@@
@@#events7;<<button "7">>
<<set _action = 7>>
<</button>>@@
@@#events8;<<button "8">>
<<set _action = 8>>
<</button>>@@
<<set _buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set _buttons.push("#events" + _i)>>
<</for>>
<<set _buttons_extra = ["#path_to_freedom_back"]>>
</div>
<<silently>><<timed 10ms>><<script>>
let _t = State.temporary;
let _v = State.variables;
$("#events_actions").find("button").on("click", (event) => {
let self = $(event.currentTarget);
if (self.html() == "Back") {
return;
}
if (_t.responses != null) {
if (_t.new_options != null) {
_t.responses[_t.responses.length - 1] += _t.new_options;
_t.options = $(_t.new_options);
delete _t.new_options;
$.wiki("<<disableactions _options>>");
} else if (_t.options != null) {
_t.options.find("#li" + self.html()).css("text-decoration", "line-through");
_t.responses.push(_t.options);
$.wiki("<<disableactions _options>>");
}
setup.mainLog_append_delayed(_t.responses, _t.buttons, _t.buttons_extra);
delete _t.responses;
}
});
<</script>><</timed>><</silently>>/* Clear the mainLog */
<<run $("#mainLog").html("<b>Theater</b>")>>
<<addclass "#infoLog" "hidden">>
<<removeclass "#mainLog" "hidden">>
<<set _actor = new setup.Character("actor")>>
<<set _actor.first_name = "actor">>
<<set _shintani = $characters.shintani_hiroyuki>>
<<set _lia = $characters.lia_hiroyuki>>
<<set _nina = new setup.Character("nina")>>
<<set _nina.set_properties(
new Date(200 - 35, 12, 9),
1,
"Nina",
"Stike"
)>>
<<set _nina.stats.strength = 70>>
<<set _nina.stats.dexterity = 50>>
<<set _nina.skills.melee = 80>>
<<set _nina.skills_known = true>>
<<set _nina.stats_known = true>>
<<set _nina.equipment = {
"head": "none",
"chest": "iron_chestplate",
"legs": "leather_skirt",
"feet": "leather_boots",
"neck": "none",
"weapon1": "iron_gsword",
"weapon2": "none",
"groin1": "none",
"groin2": "none"
}>>
<<set _nina.conditions.max_health = 150>>
<<set _nina.conditions.health = 150>>
<<set _nina.images.combat = "resources/images/characters/nina/nina_combat2.png">>
<<set _retreat_blocked = true>>
<<set _combat_background = "resources/images/places/combat/arena.png">>
/* Switch action menu */
<<addclass "#play_options" "hidden">>
<<run $("#action_bar").wiki("<<include niponTheaterEventsPathToFreedomActions>>")>>
<<set _responses = [
"As you watch through <em>Hamlet</em>, you notice Shintani sitting in the audience a couple of rows ahead of you. \
You also notice that during loud applause, many men who are subtly armed, are slowly encroaching the stage.",
_actor.dialogue("To be or not to be, that is the question:"),
"Suddenly a loud voice from the audience continues the famous Soliloquy",
_lia.dialogue("Whether it is nobler in the mind to suffer"),
"Tens of men rush forward and start surrounding Shintani and immediately another group of guards go to his defense,",
_shintani.dialogue("What is the meaning of this?"),
"Shintani looks at Lia in the audience. The spotlight have moved from the stage onto Lia. Shintani smirks,",
_shintani.dialogue("Do you really like some of your Union lackeys can take down the highly trained guards and \
military of Nipon? Have you finally gone insane in that tower of yours?"),
"The defending guards unsheathe their weapons, but Lia just continues Hamlet\'s monologue,",
_lia.dialogue("The slings and arrows of outrageous fortune"),
_lia.dialogue("Or to take arms against a sea of troubles"),
_lia.dialogue("And by opposing end them. To die -- to sleep..."),
"Suddenly the crowd gasps as somehow Nina broke behind the lines and took Shintani hostage, with a small blade to \
his throat,",
_nina.dialogue("Drop your weapons now, or I\'ll slit his throat!"),
"As the guards start lowering their weapons you see a man rushing towards the back of Nina."
]>>
<<set _init_sequence = true>>
<<set _options = "<ol><li id=\"li1\">Try to block his attack (dexterity).</li></ol>">>
<<set _responses[_responses.length - 1] += _options>>
<<set _options = $(_options)>>
<<disableactions _options>>
<<run setup.mainLog_append_delayed(_responses, _buttons)>>
<<unset _responses>><div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<<if !$quest_journal.completed.contains("path_to_freedom") && $quests.path_to_freedom.added && $quests.path_to_freedom.stage == 6>>
<<set _shintani = $characters.shintani_hiroyuki>>
<<set _lia = $characters.lia_hiroyuki>>
<<set $_to_log = "">>
<<set $player.conditions.health = Math.max(10, $player.conditions.health)>>
<div class="subbackground mainLogContainer">
<<include mainLog>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include niponTheaterEventsPathToFreedomActions>>
</div>
<<set _responses = [
"Nina collapses, but you were able to push back the rear while the rest of the Union took out the rest of the guards. Shintani now stands at the \
mercy of Lia with the crowd watching,",
_shintani.dialogue("The rest of the army will fall upon this theater. While perhaps you\'ll have claimed my head by then, know that yours too will fall. \
It\'s not too late Lia, let go of me and I might forgive your blantant act of treason."),
_lia.dialogue("No army is coming to save you."),
_shintani.dialogue("So was this your big plan? Turn my slave against me and assassinate me? Then what? Who are you to rule Nipon? Just because you carry the \
Hiroyuki blood doesn\'t make you any better of a ruler. Was Nipon not a safe haven in this dangerous world? Did I not provide my people with food, \
housing, and a will to live?"),
_lia.dialogue("All you provided was oppression and hatred towards those different than you!"),
_shintani.dialogue("Your naivity knows no bounds. You are no different than me. You kill and manipulate your way to power."),
"Shintani gesters to the crowd along with the Union fighters,",
_shintani.dialogue("Your success will also be built upon those without recognition or a name. Our philosophies may differ, but we are the same. Let me go \
and perhaps we can work something out."),
"Lia bites her lip,",
_lia.dialogue("I will not kill you Shin, unlike you I believe in compassion and fair due process of the law. You will be inprisoned and tried by fair \
court."),
"Shintani laughts",
_shintani.dialogue("I don\'t know what kind of kangaroo court you\'re going to run, but I\'ve done nothing wrong. I have always valued Nipon \
above all else. My policies are for the long-term establishment of the human condition."),
"Lia brings out the transaction logs that you found for her,",
_lia.dialogue("I\'m sure you know what these are. Your crimes are details very clearly here. We shall see how the people feel about your so called \"help\"."),
_shintani.dialogue("People like you will never understand the necessary and utilitarian sacrifices to get our freedom and peace here."),
"Lia and the Union guards escort Shintani out of the theater and the entire audience applauds,",
_lia.dialogue(setup.titleCase($player.first_name) + ", meet me in Shin\'s office later on.")
]>>
<<timed 10ms>>
<<set _choices = 0>>
<<set _disable_buttons = false>>
<<disableactions>>
<<run setup.mainLog_append_delayed(_responses, _buttons, _buttons_extra)>>
<</timed>>
<<else>>
<<set $_to_log = "The Nipon Theaters seems like a space completely detached from reality. People gather here to suspend \
their disbelief and seek solace in the drama and lifes of others. Many people of all kinds of backgrounds gather here, \
but the one thing that holds them all together is the general air of disillusionment.">>
/* Load in any saved variables */
<<loadVars>>
<div class="subbackground mainLogContainer">
<<include mainLog>>
<<include infoLog>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include niponTheaterActions>>
<<include niponTheaterPlayOptions>>
<div id="return_bar" class="action container row col longbutton fiveQuarters hidden" style="--rows: 4; --cols: 4">
<div style="grid-row: 4; grid-column: 4">
<<button "Back">>
<<removeclass "#actions" "hidden">>
<<addclass "#return_bar" "hidden">>
<<removeclass "#mainLog" "hidden">>
<<addclass "#infoLog" "hidden">>
<</button>>
</div>
</div>
</div>
<</if>>
</div>
</div><<set $_temp_to_log = "<div>You enjoyed a nice show of <em>Hamlet</em>">>
<<if $player.party.length gt 0>>
<<set $_temp_to_log += " with your slaves">>
<</if>>
<<set $_temp_to_log += ".</div><br>">>
/* Pre-images for change logging */
<<set _temp_prev_willpower = $player.slave_traits.willpower>>
<<set _prev_party = []>>
<<for _idx, _member range $player.party>>
<<set _prev_party.push(clone($characters[_member]))>>
<</for>>
/* Simulate events */
<<if !$quest_journal.completed.contains("duty_of_a_slave") &&
$quests.duty_of_a_slave.added && $quests.duty_of_a_slave.stage == 5>>
<<include niponTheaterEventsDutyOfASlave>>
<<elseif !$quest_journal.completed.contains("path_to_freedom") &&
$quests.path_to_freedom.added && $quests.path_to_freedom.stage == 5>>
<<include niponTheaterEventsPathToFreedom>>
<<else>>
<<if $player.party.length gt 0>>
/* Events that could occur */
<<set _events = [
"DropItem"
]>>
<<set _roll = randomFloat(1.0)>>
<<if _events.length gt 0 && (_roll gt 0.2)>>
<<script>>
$("#infoLog").addClass("hidden");
$("#mainLog").removeClass("hidden");
$("#action_bar").empty();
$("#action_bar").wiki("<<include eventsActions>>");
<</script>>
<<include `"niponTheaterEvents" + either(_events)`>>
<<else>>
<<include niponTheaterPlayEngineAfter>>
<</if>>
<<else>>
<<include niponTheaterPlayEngineAfter>>
<</if>>
<</if>>/* Increase player willpower */
<<set $player.slave_traits.willpower += 7>>
<<set $_temp_to_log += "<b>Changes:</b><ul class=\"mainLogChanges\">">>
<<if _temp_prev_willpower != $player.slave_traits.willpower>>
<<set $_temp_to_log += "<li>Willpower: " + setup.show_change_html(_temp_prev_willpower, $player.slave_traits.willpower) + "</li>">>
<</if>>
/* Show changes of each member of party */
<<for _idx, _member range $player.party>>
<<set _char = $characters[_member]>>
<<run setup.apply_delta(_char, _char_delta)>>
<<set $_temp_to_log = setup.add_changes($_temp_to_log, _prev_party[_idx], _char, true)>>
<</for>>
<<set $_temp_to_log += "</ul>">>
/* Forward time */
<<addhours 3>>
<<goto `passage()`>><div id="play_options" class="action container row col longbutton fiveQuarters smalltext hidden" style="--rows: 4; --cols: 4">
@@.play_option;<<button "General Seating">>
<<set _cost = ($player.party.length + 1) * 75>>
<<set _char_delta = {
"slave_traits": {
"obedience": 5,
"willpower": 3
}
}>>
<</button>>@@
@@.play_option;<<button "Box Seating">>
<<set _cost = ($player.party.length + 1) * 300>>
<<set _char_delta = {
"slave_traits": {
"obedience": 7,
"willpower": 4
}
}>>
<</button>>@@
<div id="start_play" style="grid-row: 1; grid-column: 4">
<<disable>>
<<button Start>>
<<if $player.get_money() gte _cost>>
<<removemoney _cost>>
<<audio "coins_sound" play>>
<<updatetime>>
<<include niponTheaterPlayEngine>>
<<else>>
<<notify>>Insufficient funds.<</notify>>
<</if>>
<</button>>
<</disable>>
</div>
<div style="grid-row: 4; grid-column: 4">
<<button "Back">>
<<removeclass "#actions" "hidden">>
<<addclass "#play_options" "hidden">>
<<removeclass "#mainLog" "hidden">>
<<addclass "#infoLog" "hidden">>
<</button>>
</div>
</div>
<<silently>><<timed 10ms>><<script>>
$(".play_option").find("button").on("click", (event) => {
let _t = State.temporary;
/* Enable other buttons (radio button) */
$(".play_option").find("button").prop("disabled", false);
$(".play_option").find("button").removeClass("disabled");
/* Disable self */
let self = $(event.currentTarget);
self.prop("disabled", true);
self.addClass("disabled");
/* Update infoLog */
$("#infoLogBody").find("#li1").html("Cost: " + setup.LARI + _t.cost);
$("#infoLogBody").find("#li3").html("Party Affection: " + setup.show_change_html(0, _t.char_delta.slave_traits.obedience));
$("#infoLogBody").find("#li4").html("Party Willpower: " + setup.show_change_html(0, _t.char_delta.slave_traits.willpower, false));
/* Enable start button */
$("#start_play").find("button").prop("disabled", false);
$("#start_play").find("button").removeClass("disabled");
});
<</script>><</timed>><</silently>><<nobr>>
<div id="actions" class="action container row col longbutton fiveQuarters"
style="--rows: 4; --cols: 4">
<<button "Talk">>
<<if ndef _shown_talk_options || !_shown_talk_options>>
<<set _shown_talk_options = true>>
<<if ndef $phase || $phase == 1>>
<<set $phase = 1>>
<<script>>
var div = $("<div></div>");
var html = "
<ol>\
<li>Ask about the Nipon Trade Union.</li>\
<li>Ask about trading.</li>\
<li>Ask about Nipon.</li>\
<li>Ask about her background.</li>\
<li>Patron options.</li>\
</ol>";
div.html(html);
setup.mainLog_append(div);
<</script>>
<<set _choices = 5>>
<<else>>
<<script>>
var div = $("<div></div>");
var html = "
<ol>\
<li id='li1'>Ask about the Nipon Trade Union.</li>\
<li id='li2'>Ask about trading.</li>\
<li id='li3'>Abut her new post.</li>\
<li id='li4'>Patron options.</li>\
</ol>";
div.html(html);
setup.mainLog_append(div);
<</script>>
<<set _choices = 4>>
<</if>>
<<set _disable_buttons = false>>
<<disableactions>>
<</if>>
<<addclass "#actions" "hidden">>
<<removeclass "#events_actions" "hidden">>
<</button>>
<<button "Trade">>
<<addclass "#actions" "hidden">>
<<removeclass "#trade_options" "hidden">>
<</button>>
<<disable>>
@@#office;<<button "Office">>
<</button>>@@
<</disable>>
<<button "Fixed Income">>
<<script>>
let _v = State.variables;
$("#actions").addClass("hidden");
$("#action_bar").wiki("<<include niponTradeUnionFixedIncomeOptions>>");
/* Get current interest rate */
let interest_rate = setup.round2(100 * _v.economy.interest_rate.rate);
/* Populate and unhide info log while hiding main log */
$("#mainLog").addClass("hidden");
$("#infoLog").removeClass("hidden");
$("#info_title").html("Fixed Income & Loans");
$("#infoLogBody").html(`Fixed Income allows patrons of the trade union to either borrow money or invest money with guarenteed returns. The credit line extended to patrons is approximately 40% of their total assets' \
median value of commodities which are used as collateral. If at any point a debt cannot be repayed, the union will seize all collateral and sell it to cover the debt as well as take personal measures to ensure \
the money of investors. Lending cash to the union will yield a prime rate of <b>${interest_rate}%</b> per year, while borrowing accures an interst of <b>${interest_rate + 2}%</b> per year, with loan contracts \
lasting no more than three years.`);
<</script>>
<</button>>
<div style="grid-row: 1; grid-column: 4"></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div style="grid-row: 3; grid-column: 4"></div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMarket">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<</nobr>><div id="fixed_income_options" class="action container row col longbutton fiveQuarters" style="--rows: 4; --cols: 4">
<div style="grid-row: 1; grid-column: 4"></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div id="back_button" style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<removeclass "#actions" "hidden">>
<<script>>
$("#infoLog").addClass("hidden");
$("#mainLog").removeClass("hidden");
$("#fixed_income_options").remove();
<</script>>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMarket">>
<<include locationButton>>
</div>
<<button "Bonds">>
<<if _is_patron>>
<<notify>>Under construction.<</notify>>
<<else>>
<<notify>>Fixed income is only available to patrons of the trade union.<</notify>>
<</if>>
<</button>>
<<button "Loans">>
<<if _is_patron>>
<<notify>>Under construction.<</notify>>
<<else>>
<<notify>>Fixed income is only available to patrons of the trade union.<</notify>>
<</if>>
<</button>>
</div><div id="events_actions" class="action container row col hidden"
style="--rows: 4; --cols: 5">
<<set _main_options = "\
<ol>\
<li id='li1'>Ask about the Nipon Trade Union.</li>\
<li id='li2'>Ask about trading.</li>\
<li id='li3'>Abut her new post.</li>\
<li id='li4'>Patron options.</li>\
</ol>\
">>
@@#events1;<<button "1">>
<<addclass "#events_actions_back" "hidden">>
<<addclass "#events_actions_leave" "hidden">>
<<set $enable_menu = false>>
<<if ndef _action>>
<<set _action = 1>>
<<set _responses = [_reception.dialogue(
"The Trade Union is one of the last structures left in tact after the great dusting. \
Our founders believed in free-trade and since we provide necessary resources, we yield \
a great deal of political power within settlements. This is exacerbated by the fact that \
we also act as a bank, providing backing for the lari. We mainly cater toward settlement \
owners or the very affluent. Finally, we are also information brokers, and have the latest \
news of the world for our patrons."
)]>>
<<set _options = $(
"<ol>\
<li id=\"li1\">\"What are patrons?\"</li>\
<li id=\"li2\">\"So where does that put you with Nipon?\"</li>\
<li id=\"li3\">\"I see.\"</li>\
</ol>"
)>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 3>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _action == 1>>
<<run $("#events1 button").prop("disabled", true)>>
<<addclass "#events1 button" "disabled">>
/* About Nipon Trade Union -> What are patrons? */
<<set _responses = [_reception.dialogue(
"Patrons are people throughout this world who keep the Trade Union in business. By \
supplying us with a monthly membership fee, you will have access to our information \
network. Something one might find immediately useful is our statistics of the different \
commodities around the world, though they require a bit of understanding about economics."
)]>>
<<set _options.find("#li1").css("text-decoration", "line-through")>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<elseif _action == 2>>
/* About Trading -> What's a semi-stable pattern? */
<<run $("#events1 button").prop("disabled", true)>>
<<addclass "#events1 button" "disabled">>
/* About Nipon Trade Union -> So where does that put you with Nipon? */
<<set _responses = [_reception.dialogue(
"On a high level, a semi-stable pattern describes an asset where the instantaneous \
behavior of the asset follows a mean-reverting trajectory. Specifically it follows \
an Ornstein-Uhlenbeck process. One of the perks of being a patron of the Trade Union \
is being able to know the parameters of this OU-process at any given time."
)]>>
<<set _options.find("#li1").css("text-decoration", "line-through")>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<elseif _action == 5>>
/* Patron options -> I'd like to become a patron */
/* TODO: Implement */
<<set _responses = [
_reception.dialogue("Is there anything else you need?"),
_main_options
]>>
<<unset _action>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<</button>>@@
@@#events2;<<button "2">>
<<addclass "#events_actions_back" "hidden">>
<<addclass "#events_actions_leave" "hidden">>
<<if ndef _action>>
<<set _action = 2>>
<<set _responses = [_reception.dialogue(
"The Trade Union offers trading in both commodities and equities, however we \
only offer commodity trading in bulk. If you want to trade a low amount of commodities \
I recommend checking out the market stalls during the day. Commodities in general follow \
a semi-stable pattern while equities are don\'t."
)]>>
<<set _options = $(
"<ol>\
<li id=\"li1\">\"What\'s a semi-stable pattern?\"</li>\
<li id=\"li2\">\"I see.\"</li>\
</ol>"
)>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 2>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _action == 1>>
<<run $("#events2 button").prop("disabled", true)>>
<<addclass "#events2 button" "disabled">>
/* About Nipon Trade Union -> So where does that put you with Nipon? */
<<set _responses = [_reception.dialogue(
"We have a good working relationship with Nipon. As you may already know Nipon is one of the \
best settlements currently in terms of its prosperity. Though of course it is not without its \
own issues. We hope that the Trade Union and Nipon can continue working hand-in-hand for the \
good of mankind."
)
]>>
<<set _options.find("#li2").css("text-decoration", "line-through")>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<elseif _action == 2>>
/* About Trading -> I see. */
<<set _responses = [
_reception.dialogue("Did you need anything else?"),
_main_options
]>>
<<unset _action>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _action == 5>>
/* Patron options -> I'd like to cancel my patronage */
/* TODO: Implement */
<<set _responses = [
_reception.dialogue("Is there anything else you need?"),
_main_options
]>>
<<unset _action>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<</button>>@@
@@#events3;<<button "3">>
<<addclass "#events_actions_back" "hidden">>
<<addclass "#events_actions_leave" "hidden">>
<<if ndef _action>>
<<if $locations.nipon.data.owner == "lia_hiroyuki">>
<<set _responses = [
_reception.dialogue("Well since I\'m free to do what I want now, I thought I may as well find a job. \
Lia told me that her old position at the Union would be available, so I decided to work here. Plus \
I happen to be quite good with numbers."),
_main_options
]>>
<<else>>
<<set _responses = [
_reception.dialogue("Well, since Lia can no longer work the post here, Shintani told me I should fill her \
vacancy as well as keep the Union in check. I can\'t tell you anything more in detail, but I\'m glad to \
be working here now."),
_main_options
]>>
<</if>>
<<elseif _action == 1>>
/* About Nipon Trade Union -> I see. */
<<set _responses = [
_reception.dialogue("Did you need anything else?"),
_main_options
]>>
<<elseif _action == 5>>
/* Patron options -> Nevermind */
<<set _responses = [
_reception.dialogue("Is there anything else you need?"),
_main_options
]>>
<</if>>
<<unset _action>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<</button>>@@
@@#events4;<<button "4">>
<<addclass "#events_actions_back" "hidden">>
<<addclass "#events_actions_leave" "hidden">>
<<set _action = 5>>
<<set _responses = [_reception.dialogue(
"There are many ways to become a patron of the trade union. Note that \
being a patron extends not only to the trade union in Nipon, but also \
the trade union in other settlements as well. The most common way is for \
someone to pay 200 lari per week, however this option is only available for \
citizens and not slaves. However, as-per the manager\'s request, you already \
have the benefits of a patron without needing to pay our fee."
)]>>
<<set _options = $(
"<ol>\
<li id=\"li1\">\"I\'d like to become a patron (¤200).\"</li>\
<li id=\"li2\">\"I\'d like to cancel my patronage.\"</li>\
<li id=\"li3\">\"Nevermind.\"</li>\
</ol>"
)>>
<<if $player.is_slave || $player.titles.has("trade_union_patron") || $player.titles.has("liberator") || $player.titles.has("hironaka")>>
<<run _options.find("#li1").css("text-decoration", "line-through")>>
<</if>>
<<if $player.is_slave || !$player.titles.has("trade_union_patron") || $player.titles.has("liberator") || $player.titles.has("hironaka")>>
<<run _options.find("#li2").css("text-decoration", "line-through")>>
<</if>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 3>>
<<disableactions>>
<<if $player.is_slave || $player.titles.has("trade_union_patron") || $player.titles.has("liberator") || $player.titles.has("hironaka")>>
<<run $("#events1 button").prop("disabled", true)>>
<<addclass "#events1 button" "disabled">>
<</if>>
<<if $player.is_slave || !$player.titles.has("trade_union_patron") || $player.titles.has("liberator") || $player.titles.has("hironaka")>>
<<run $("#events2 button").prop("disabled", true)>>
<<addclass "#events2 button" "disabled">>
<</if>>
<<stop>>
<</if>><</repeat>><</silently>>
<</button>>@@
@@#events6;<<button "5">>
<</button>>@@
@@#events6;<<button "6">>
<</button>>@@
@@#events7;<<button "7">>
<</button>>@@
@@#events8;<<button "8">>
<</button>>@@
<<set $buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set $buttons.push("#events" + _i)>>
<</for>>
<<set $buttons_extra = ["#events_actions_back", "#events_actions_leave"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div id="events_actions_back" style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<removeclass "#actions" "hidden">>
<<addclass "#events_actions" "hidden">>
<</button>>
</div>
<div id="events_actions_leave" style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMarket">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div><<nobr>>
<div id="events_actions" class="action container row col hidden"
style="--rows: 4; --cols: 5">
<<set _main_options = "\
<ol>\
<li>Ask about the Nipon Trade Union.</li>\
<li>Ask about trading.</li>\
<li>Ask about Nipon.</li>\
<li>Ask about her background.</li>\
<li>Patron options.</li>\
</ol>\
">>
@@#events1;<<button "1">>
<<addclass "#events_actions_back" "hidden">>
<<addclass "#events_actions_leave" "hidden">>
<<set $enable_menu = false>>
<<if ndef _action>>
<<set _action = 1>>
<<set _responses = [$characters.lia_hiroyuki.dialogue(
"The Trade Union is one of the last structures left in tact after the great dusting. \
Our founders believed in free-trade and since we provide necessary resources, we yield \
a great deal of political power within settlements. This is exacerbated by the fact that \
we also act as a bank, providing backing for the lari. We mainly cater toward settlement \
owners or the very affluent. Finally, we are also information brokers, and have the latest \
news of the world for our patrons."
)]>>
<<set _options = $(
"<ol>\
<li id=\"li1\">\"What are patrons?\"</li>\
<li id=\"li2\">\"So where does that put you with Nipon?\"</li>\
<li id=\"li3\">\"I see.\"</li>\
</ol>"
)>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 3>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _action == 1>>
<<run $("#events1 button").prop("disabled", true)>>
<<addclass "#events1 button" "disabled">>
/* About Nipon Trade Union -> What are patrons? */
<<set _responses = [$characters.lia_hiroyuki.dialogue(
"Patrons are people throughout this world who keep the Trade Union in business. By \
supplying us with a monthly membership fee, you will have access to our information \
network. Something one might find immediately useful is our statistics of the different \
commodities around the world, though they require a bit of understanding about economics."
)]>>
<<set _options.find("#li1").css("text-decoration", "line-through")>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<elseif _action == 2>>
/* About Trading -> What's a semi-stable pattern? */
<<run $("#events1 button").prop("disabled", true)>>
<<addclass "#events1 button" "disabled">>
/* About Nipon Trade Union -> So where does that put you with Nipon? */
<<set _responses = [$characters.lia_hiroyuki.dialogue(
"On a high level, a semi-stable pattern describes an asset where the instantaneous \
behavior of the asset follows a mean-reverting trajectory. Specifically it follows \
an Ornstein-Uhlenbeck process. One of the perks of being a patron of the Trade Union \
is being able to know the parameters of this OU-process at any given time."
)]>>
<<set _options.find("#li1").css("text-decoration", "line-through")>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<elseif _action == 3>>
/* About Nipon -> It's been a living hell */
<<set _responses = [
"Lia quickly realizes that there were eyes all around the room \
she leans in and whispers, (Lia\'s Trust " + setup.show_change_html(0, 2) + ")",
$characters.lia_hiroyuki.dialogue(
"Meet me at my place after I get off work at 7 PM. I live in the \
large tower in the north west corner of Central Nipon."
),
"Lia resumes her normal voice,",
$characters.lia_hiroyuki.dialogue(
"And that\'s what makes Nipon one of the best settlements in the world! \
Now, is there anything else you needed?"
),
_main_options
]>>
<<set $characters.lia_hiroyuki.slave_traits.trust += 2>>
<<set _to_round = "lia_hiroyuki">>
<<include round>>
<<set $locations["liasTower"].access = true>>
<<set $quests.power_struggles.stage = 1>>
<<notify>>Quest <em>Power Struggles</em> updated!<</notify>>
<<unset _action>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _action == 5>>
/* Patron options -> I'd like to become a patron */
<<set _responses = [
$characters.lia_hiroyuki.dialogue("Is there anything else you need?"),
_main_options
]>>
<<unset _action>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<</button>>@@
@@#events2;<<button "2">>
<<addclass "#events_actions_back" "hidden">>
<<addclass "#events_actions_leave" "hidden">>
<<if ndef _action>>
<<set _action = 2>>
<<set _responses = [$characters.lia_hiroyuki.dialogue(
"The Trade Union offers trading in both commodities and equities, however we \
only offer commodity trading in bulk. If you want to trade a low amount of commodities \
I recommend checking out the market stalls during the day. Commodities in general follow \
a semi-stable pattern while equities are don\'t."
)]>>
<<set _options = $(
"<ol>\
<li id=\"li1\">\"What\'s a semi-stable pattern?\"</li>\
<li id=\"li2\">\"I see.\"</li>\
</ol>"
)>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 2>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _action == 1>>
<<run $("#events2 button").prop("disabled", true)>>
<<addclass "#events2 button" "disabled">>
/* About Nipon Trade Union -> So where does that put you with Nipon? */
<<set _responses = [$characters.lia_hiroyuki.dialogue(
"We have a good working relationship with Nipon. As you may already know Nipon is one of the \
best settlements currently in terms of its prosperity. Though of course it is not without its \
own issues. We hope that the Trade Union and Nipon can continue working hand-in-hand for the \
good of mankind."
),
"You can tell that everything Lia is saying is memorized, and you sense a slight tremor in her voice.",
]>>
<<set _options.find("#li2").css("text-decoration", "line-through")>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<elseif _action == 2>>
/* About Trading -> I see. */
<<set _responses = [
$characters.lia_hiroyuki.dialogue("Did you need anything else?"),
_main_options
]>>
<<unset _action>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _action == 3>>
/* About Nipon -> What do you expect me to say? */
<<set _responses = [
"Lia quickly realizes that there were eyes all around the room \
she leans in and whispers, (Lia\'s Trust " + setup.show_change_html(0, 5) + ")",
$characters.lia_hiroyuki.dialogue(
"Meet me at my place after I get off work at 7 PM. I live in the \
large tower in the north west corner of Central Nipon."
),
"Lia resumes her normal voice,",
$characters.lia_hiroyuki.dialogue(
"And that\'s what makes Nipon one of the best settlements in the world! \
Now, is there anything else you needed?"
),
_main_options
]>>
<<set $characters.lia_hiroyuki.slave_traits.trust += 5>>
<<set _to_round = "lia_hiroyuki">>
<<include round>>
<<set $locations["liasTower"].access = true>>
<<set $quests.power_struggles.stage = 1>>
<<notify>>Quest <em>Power Struggles</em> updated!<</notify>>
<<unset _action>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _action == 5>>
/* Patron options -> I'd like to cancel my patronage */
/* TODO: Implement */
<<set _responses = [
$characters.lia_hiroyuki.dialogue("Is there anything else you need?"),
_main_options
]>>
<<unset _action>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<</button>>@@
@@#events3;<<button "3">>
<<addclass "#events_actions_back" "hidden">>
<<addclass "#events_actions_leave" "hidden">>
<<if ndef _action>>
<<set _action = 3>>
<<if $player.is_slave && $quests.power_struggles.stage == 0>>
<<set _responses = [
"Lia\'s eyes wonder over to your neck where the symbol of the Hiroyuki \
household rests. You see her expression soften a bit but you are unable \
to tell if it\'s simply pity or something more.",
$characters.lia_hiroyuki.dialogue("
Well Nipon is one of the most prosperous settlements right now. Like \
most settlements after the great dusting, Nipon\'s economy and culture \
is based on slavery...\
"),
"Lia\'s voice fades off to a whisper as she locks eye contact with you,",
$characters.lia_hiroyuki.dialogue("
You\'ve obviously experienced it yourself. Tell me, what do you think \
of being a slave in Nipon?\
")
]>>
<<set _options = $(
"<ol>\
<li>\"It\'s been a living hell.\"</li>\
<li>\"What do you expect me to say to that?\"</li>\
<li>\"It\'s been great overall.\"</li>\
</ol>"
)>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 3>>
<<disableactions>>
<<stop>>
<</if>><</repeat>><</silently>>
<<else>>
<<set _responses = [
"Lia leans in and says discretely,",
$characters.lia_hiroyuki.dialogue("Meet me at my place after I get off work at 7 PM."),
"Lia resumes her normal voice,",
$characters.lia_hiroyuki.dialogue(
"And that\'s what makes Nipon one of the best settlements in the world! \
Now, is there anything else you needed?"
),
_main_options
]>>
<<unset _action>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<<elseif _action == 1>>
/* About Nipon Trade Union -> I see. */
<<set _responses = [
$characters.lia_hiroyuki.dialogue("Did you need anything else?"),
_main_options
]>>
<<unset _action>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _action == 3>>
/* About Nipon -> It's been great overall */
<<set _responses = [
"Lia sighs and immediately forms an obviously fake smile on her face,",
$characters.lia_hiroyuki.dialogue(
"That\'s great to hear! Nipon is built so everyone, including slaves, \
can thrive! Did you need anything else?"
),
_main_options
]>>
<<unset _action>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif _action == 5>>
/* Patron options -> Nevermind */
<<set _responses = [
$characters.lia_hiroyuki.dialogue("Is there anything else you need?"),
_main_options
]>>
<<unset _action>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<</button>>@@
@@#events4;<<button "4">>
<<set _action = 4>>
<<set _responses = [
"Your eyes wonder over to the name plate sitting on the counter,",
$player.dialogue("Lia Hiroyuki... you\'re Shintani\'s sister?"),
"You catch yourself as you realize your tone is too impolite,",
$player.dialogue("\
Apologies, I was caught off guard, Shintani had not told me about him having \
any family in Nipon. If I may ask, what role do you serve in Nipon?\
"),
"Lia\'s eyes drift downwards,",
$characters.lia_hiroyuki.dialogue(
"Well yes, I am Shintani\'s younger sister, but I\'m afraid we don\'t see eye \
to eye on everything. When I joined the trade union Shintani sold off our parents \
to fund what Nipon is today. If it hadn\'t been for the union\'s support, I\'d \
have been long gone by now."
),
"Lia\'s voice fades and her eyes dart across the room, you can tell this isn\'t a good \
place for you to ask her these questions. After a moment, Lia remembers where she is,",
$characters.lia_hiroyuki.dialogue(
"Sorry it\'s quite complicated I\'d rather not get into it right now, was there \
anything else you needed?"
),
_main_options
]>>
<<unset _action>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 5>>
<<set _disable_buttons = false>>
<<disableactions>>
<<set $enable_menu = true>>
<<stop>>
<</if>><</repeat>><</silently>>
<</button>>@@
@@#events5;<<button "5">>
<<addclass "#events_actions_back" "hidden">>
<<addclass "#events_actions_leave" "hidden">>
<<set _action = 5>>
<<set _responses = [$characters.lia_hiroyuki.dialogue(
"There are many ways to become a patron of the trade union. Note that \
being a patron extends not only to the trade union in Nipon, but also \
the trade union in other settlements as well. The most common way is for \
someone to pay 200 lari per week, however this option is only available for \
citizens and not slaves. For a slave to get the benefits of a patron their \
owner must be a patron, and they must have a status of high slave."
)]>>
<<set _options = $(
"<ol>\
<li id=\"li1\">\"I\'d like to become a patron (¤200).\"</li>\
<li id=\"li2\">\"I\'d like to cancel my patronage.\"</li>\
<li id=\"li3\">\"Nevermind.\"</li>\
</ol>"
)>>
<<if $player.is_slave || $player.titles.has("trade_union_patron")>>
<<run _options.find("#li1").css("text-decoration", "line-through")>>
<</if>>
<<if $player.is_slave || !$player.titles.has("trade_union_patron")>>
<<run _options.find("#li2").css("text-decoration", "line-through")>>
<</if>>
<<set _responses.push(_options.clone())>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses,
State.variables.buttons,
State.variables.buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set _choices = 3>>
<<disableactions>>
<<if $player.is_slave || $player.titles.has("trade_union_patron")>>
<<run $("#events1 button").prop("disabled", true)>>
<<addclass "#events1 button" "disabled">>
<</if>>
<<if $player.is_slave || !$player.titles.has("trade_union_patron")>>
<<run $("#events2 button").prop("disabled", true)>>
<<addclass "#events2 button" "disabled">>
<</if>>
<<stop>>
<</if>><</repeat>><</silently>>
<</button>>@@
@@#events6;<<button "6">>
<</button>>@@
@@#events7;<<button "7">>
<</button>>@@
@@#events8;<<button "8">>
<</button>>@@
<<set $buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set $buttons.push("#events" + _i)>>
<</for>>
<<set $buttons_extra = ["#events_actions_back", "#events_actions_leave"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div id="events_actions_back" style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<removeclass "#actions" "hidden">>
<<addclass "#events_actions" "hidden">>
<</button>>
</div>
<div id="events_actions_leave" style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMarket">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<</nobr>><<if def $phase && $phase != 1>>
<<set _reception = $characters.himari_hironaka>>
<<else>>
<<if ndef $phase>>
<<set $phase = 1>>
<</if>>
<<set _reception = $characters.lia_hiroyuki>>
<<if !$quests.power_struggles.added && !$quest_journal.completed.contains("power_struggles")>>
<<set $quests["power_struggles"].added = true>>
<<set $quests.power_struggles.data.side = "lia">>
<<set $quest_journal.ongoing.push("power_struggles")>>
<<notify>>Quest <em>Power Struggles</em> added to journal!<</notify>>
<<audio "quest_added_sound" play>>
<</if>>
<</if>>
<<set _is_patron = ($player.titles.has("trade_union_patron") || $player.titles.has("liberator") || $player.titles.has("hironaka"))>>
/* Forward Nipon Economy quest */
<<if !$quest_journal.completed.contains("the_nipon_economy") && $quests.the_nipon_economy.added && $quests.the_nipon_economy.stage lt 3>>
<<set $quests.the_nipon_economy.stage = 3>>
<</if>>
<<set $_to_log = "
<div>You can tell the decadent trade union was one of the first buildings in Nipon. A heavy \
feeling of self-importance lingers in the main hall. You see a beautiful woman standing at \
the counter, and guards lining the walls of the room. She approaches you somewhat \
apprehensively.</div><br>" +
_reception.dialogue("Welcome to the Nipon Trade Union; how may I help you?")
>>
/* Load in any saved variables */
<<loadVars>>
/* Audio engine */
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
<<script>>
setTimeout(() => {
var reception = State.temporary.reception;
if (reception.key == "lia_hiroyuki") {
$("#mainLogCharacterImage").css("background-image",
"url(\"" + reception.image_folder() + "niponTradeUnion_lia_neutral.png\")"
);
} else {
$("#mainLogCharacterImage").css("background-image",
"url(\"" + reception.image_folder() + "himari_neutral.png\")"
);
}
}, 10);
<</script>>
<div id="commodityLog" class="mainLog hidden">
<center>
<div style="margin: 20px">
<b id="commodity_name"></b><br>
''Spread'': <span id="commodity_spread"></span>
</div>
</center>
<div class="container threeCol">
<div class="container twoCol">
<p>
Holding: <br>
Midprice: <br>
Sigma: <br>
Theta: <br>
EQ-price: <br>
EQ-trend: <br>
</p>
<p id="commodity_stats" style="text-align: right">
</p>
</div>
<center class="smalltext">
<div>
''Buy Price'': <span id="commodity_buy_price"></span>
</div><br>
<div class="column">
@@#buy20;<<button "Buy 20">>
<<set _to_pay = 20 * _buy_price>>
<<removemoney _to_pay>>
<<run UInv.AddItem("inventory", _selected, 20)>>
<<updatecommodities _selected>>
<<unset _to_pay>>
<<audio "coins_sound" play>>
<</button>>@@
@@#buy50;<<button "Buy 50">>
<<set _to_pay = 50 * _buy_price>>
<<removemoney _to_pay>>
<<run UInv.AddItem("inventory", _selected, 50)>>
<<updatecommodities _selected>>
<<unset _to_pay>>
<<audio "coins_sound" play>>
<</button>>@@
@@#buy100;<<button "Buy 100">>
<<set _to_pay = 100 * _buy_price>>
<<removemoney _to_pay>>
<<run UInv.AddItem("inventory", _selected, 100)>>
<<updatecommodities _selected>>
<<unset _to_pay>>
<<audio "coins_sound" play>>
<</button>>@@
</div>
</center>
<center class="smalltext">
<div>
''Sell Price'': <span id="commodity_sell_price"></span>
</div><br>
<div class="column">
@@#sell20;<<button "Sell 20">>
<<set _to_pay = 20 * _sell_price>>
<<addmoney _to_pay>>
<<run UInv.DeleteItem("inventory", _selected, 20)>>
<<updatecommodities _selected>>
<<unset _to_pay>>
<<audio "coins_sound" play>>
<</button>>@@
@@#sell50;<<button "Sell 50">>
<<set _to_pay = 50 * _sell_price>>
<<addmoney _to_pay>>
<<run UInv.DeleteItem("inventory", _selected, 50)>>
<<updatecommodities _selected>>
<<unset _to_pay>>
<<audio "coins_sound" play>>
<</button>>@@
@@#sell100;<<button "Sell 100">>
<<set _to_pay = 100 * _sell_price>>
<<addmoney _to_pay>>
<<run UInv.DeleteItem("inventory", _selected, 100)>>
<<updatecommodities _selected>>
<<unset _to_pay>>
<<audio "coins_sound" play>>
<</button>>@@
</div>
</center>
</div>
</div>
<<include infoLog>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include niponTradeUnionActions>>
<<if ndef $phase || $phase == 1>>
<<set $phase = 1>>
<<include niponTradeUnionLiaTalkOptions>>
<<else>>
<<include niponTradeUnionHimariTalkOptions>>
<</if>>
<<include niponTradeUnionTradeOptions>>
</div>
</div>
</div>
<<updatetime>><<nobr>>
<div id="trade_options" class="action container row col longbutton fiveQuarters hidden"
style="--rows: 4; --cols: 4">
<div style="grid-row: 1; grid-column: 4"></div>
<div style="grid-row: 2; grid-column: 4"></div>
<div id="back_button" style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<removeclass "#actions" "hidden">>
<<addclass "#trade_options" "hidden">>
<</button>>
</div>
<div id="back_to_options_button" class="hidden" style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<script>>
$("#commodityLog").addClass("hidden");
$("#mainLog").removeClass("hidden");
$("#back_to_options_button").addClass("hidden");
$("#back_button").removeClass("hidden");
$(".to_hide").removeClass("hidden");
<</script>>
<</button>>
</div>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponMarket">>
<<include locationButton>>
</div>
<<for _key, _val range $commodities>>
<<capture _key>>
<div class="to_hide">
<<button `setup.titleCase(_key)`>>
<<set _selected = _key>>
<<set _halfspread = setup.sigmoid($difficulty) * .02>>
<<updatecommodities _selected>>
<</button>>
</div>
<</capture>>
<</for>>
</div>
<</nobr>><<nobr>>
<div id="actions" class="mapaction fiveQuarters smalltext">
<hr>
<<set _added = 0>>
<<for _key, _val range setup.locations.get(passage()).sublocations>>
<<capture _key>>
<<set _location_button_dest = setup.locations.get(_key).passage>>
<<include locationButton>>
<</capture>>
<<set _added += 1>>
<</for>>
/* Add 13 slots */
<<for _i = _added; _i lt 12; _i++>>
<div class="buttonfiller fiveQuarters"></div>
<</for>>
<<unset _added>>
<hr>
<<button "Hours">>
<<popover>>
<<include hoursTutorial>>
<</popover>>
<</button>>
<div>
<<set _location_button_text = "Back">>
<<set _location_button_dest = "niponSlums">>
<<include locationButton>>
</div>
<div>
<<set _location_button_text = "Home">>
<<set _location_button_dest = $player.home>>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
<hr>
</div>
<</nobr>><<nobr>>
<div id="actions" class="action container row col longbutton fiveQuarters"
style="--rows: 4; --cols: 4">
<<set _last_choice = "none">>
<<button "Talk">>
<<if _last_choice != "talk">>
<<set _last_choice = "talk">>
<<set _options = "\
<ol>\
<li id=\"li1\">\"What is this place?\"</li>\
<li id=\"li2\">\"What\'s your name?\"</li>\
<li id=\"li3\">\"How do you like Nipon?\"</li>\
<li id=\"li4\">\"I\'m looking for work.\"</li>\
<li id=\"li5\">\"Hear any rumors lately?\"</li>\
">>
<<if $quest_journal.ongoing.contains("a_secret_of_yuki") && $quests.a_secret_of_yuki.stage == 2>>
<<run _options += `<li id="li6">"I was told you know of Yuki?"</li>`>>
<</if>>
<<set _options += "</ol>">>
<<set _responses = [
"You approach the bartender,",
_options
]>>
<<set _options = $(_options)>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses, State.temporary.talk_buttons, State.temporary.talk_buttons_extra);
<</script>>
<</if>>
<<addclass "#actions" "hidden">>
<<removeclass "#talk_options" "hidden">>
<</button>>
<<disable>><<button "Socialize">>
/* TODO: Implement */
<<run $("#info_title").html("Drink at the Divine Touch")>>
<<set _default_socialize_info = $("<div>\
</div>")>>
<</button>><</disable>>
<<button "Services">>
<<if _last_choice != "services">>
<<set _last_choice = "services">>
<<if $player.gender == 0>>
<<set _responses = [
$player.dialogue("I\'d like to hire some... services."),
"The bartender knocks on the slightly ajar door behind him and a well-trained girl comes out.",
_bartender.dialogue("Audrey is available right now, what kind of services were you thinking?")
]>>
<<else>>
<<set _responses = [
$player.dialogue("I\'d like to hire some... services."),
_bartender.dialogue("Sure thing missy, but we don\'t get a lot of female customers so we \
don\'t really have many men for hire if that\'s what you\'re looking for. If you want \
to just get fucked yourself, just go lay down on the table over there and spread your legs; it\'s \
free too. Otherwise you can take a look at our fine lady here."),
"He knocks on the slightly ajar door behind him and a well-trained girl comes out.",
_bartender.dialogue("Audrey is available right now, what kind of services were you thinking?")
]>>
<</if>>
<<set _options = $("\
<ol>\
<li id=\"li1\">\"Oral (" + setup.LARI + "50).\"</li>\
<li id=\"li2\">\"Full service (" + setup.LARI + "100).\"</li>\
</ol>\
")>>
<<set _responses.push(_options.clone())>>
<<set _disable_buttons = false>>
<<disableactions _options>>
<<unset _done_appending>>
<<script>>
setup.mainLog_append_delayed(State.temporary.responses, State.temporary.service_buttons, State.temporary.service_buttons_extra);
<</script>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<run $("#mainLogCharacterImage").css("background-image", "url(\"" + _audrey.image_folder() + "audrey.png\")")>>
<<stop>>
<</if>><</repeat>><</silently>>
<<else>>
<<run $("#mainLogCharacterImage").css("background-image", "url(\"" + _audrey.image_folder() + "audrey.png\")")>>
<</if>>
<<addclass "#actions" "hidden">>
<<removeclass "#service_options" "hidden">>
<</button>>
<<if "low_brothel_work" in $quests.knowledge_is_power.data && $quests.knowledge_is_power.data.low_brothel_work>>
<<button "Work">>
<<if !($gameDate.getHours() < setup.locations.get(passage()).access_times[1] - 4 ||
$gameDate.getHours() >= setup.locations.get(passage()).access_times[0])>>
<<notify>>Not enough time to work a full shift before closing.<</notify>>
<<elseif Math.abs(setup.project_stamina_change(60 * 4)) lt $player.conditions.stamina>>
<<run $("#info_title").html("Whore at the Divine Touch Brothel")>>
<<set _default_work_info = $("<div>\
<div id=\"normal_whore\">\
The Divine Touch Brothel is cestpool of sweat and sexual frustration. You think subjecting yourself to it might \
be an easy way to make some lari.\
<ul id=\"change_list\">\
<li id=\"li1\">" + setup.LARI + setup.round2(($player.sex_value()).clamp(0, 50)) + "</li>\
<li id=\"li2\">15% chance to increase a random sex skill (capped at 20).</li>\
<li id=\"li3\">20% chance to increase max arousal (decrease sensitivity) (capped at 70).</li>\
<li id=\"li4\">(20 - strength)% chance of injury.</li>\
<li id=\"li5\">-3 willpower.</li>\
</ul></div>\
</div>")>>
<<run $("#infoLogBody").html("")>>
<<run $("#infoLogBody").append(_default_work_info.clone())>>
<<removeclass "#work_actions" "hidden">>
<<addclass "#actions" "hidden">>
<<removeclass "#infoLog" "hidden">>
<<addclass "#mainLog" "hidden">>
<<else>>
<<notify>>You are too tired to work.<</notify>>
<</if>>
<</button>>
<<else>>
<<disable>>
<<button "Work">><</button>>
<</disable>>
<</if>>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponSlums">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<</nobr>><<nobr>>
<<set _bartender = new setup.Character("bartender")>>
<<set _bartender.first_name = "Bartender">>
<<set $_to_log = "
<div>You enter the Divine Touch Brothel and are greeted with a pungent smell of \
sweat and alcohol. The establishment on the outside seems like a normal local bar, but \
between the sounds of indistinctive chatter you can clearly hear loud moans echo through the \
thin walls. You take a seat at the bar and before you stands a tall clean man who drags with \
him a wistful sense of longing.</div>\
">>
<<if $player.is_slave>>
<<set $_to_log += "He notices the amulet around your neck,<br>">>
<<set $_to_log += _bartender.dialogue("Don\'t see much of your folk down here. I hope you\'re not planning \
on causing any trouble.")>>
<<else>>
<<set $_to_log += _bartender.dialogue("What\'s your poison?")>>
<</if>>
/* Load in any saved variables */
<<loadVars>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
<<include infoLog>>
<<timed 50ms>>
<<run $("#mainLogCharacterImage").css("background-image", "url(\"" + _bartender.image_folder() + "bartender.png\")")>>
<</timed>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
/* Main actions */
<<include divineTouchBrothelActions>>
<<include divineTouchBrothelTalkOptions>>
<<include divineTouchBrothelServiceOptions>>
<<include divineTouchBrothelWorkActions>>
</div>
</div>
</div>
<</nobr>><<nobr>>
<<set _audrey = new setup.Character("audrey")>>
<<set _audrey.first_name = "Audrey">>
<<set _refresh = false>>
<div id="service_options" class="action container row col hidden"
style="--rows: 4; --cols: 5">
<<set _refresh = false>>
@@#events1;<<button "1">>
<<if ndef _action>>
<<if $player.get_money() lt 50>>
<<notify>>Insufficient funds.<</notify>>
<<unset _responses>>
<<unset _done_appending>>
<<else>>
<<set _action = 1>>
<<set _responses = [
"You slide forth 50 lari and you can see Audrey face light up. She quickly grabs your hand and pulls you \
into an old empty room. As the door closes, the sound of the outside chatter fades, leaving only the faint moaning \
from the adjacent rooms. Audrey licks her lips before speaking,",
_audrey.dialogue("Take off your pants, did you want me clothes off as well?"),
"<ol><li>\"Yes, show me those tits.\"</li><li>\"No, just give me your mouth, you slut.\"</li></ol>"
]>>
<<set $enable_menu = false>>
<<set _disable_buttons = true>>
<<set _choices = 2>>
<<disableactions>>
<<removemoney 50>>
<<audio coins_sound play>>
<<addmins 2 + dice(1, $difficulty + 2)>>
<<updatetime>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<run $("#mainLogCharacterImage").css("background-image", "url(\"" + _audrey.image_folder() + "audrey_oral.png\")")>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<<elseif _action == 1 && ndef _sub_action>>
<<set _responses = [
"Audrey begins seductively removing her clothes all whilst giving you a show. She flashes her unshaven pussy \
and gives you a strip tease. She then drops to her knees and starts "
]>>
<<if $player.gender == 0>>
<<set _responses[0] += "sucking on your hard cock. Her skill is masterful and as your shaft moves in and out \
of her throat, you can feel her tongue climbing around your head like a parasitic vine on trunk of \
a tree. ">>
<<else>>
<<set _responses[0] += "sucking on your wet pussy. As her tongue climbs between your labia, slightly touching \
your clitoris every couple of seconds, you are hit with waves of pleasure. ">>
<</if>>
<<set _responses[0] += "As she continues to lick you, Audrey reaches her hand down and starts masturbating. The \
scent of her womanhood and sight of beads of wetness dripping down her legs pushes you over the edge.">>
<<set $player.mental_conditions.arousal = 0>>
<<addmins 5 + dice(1, $difficulty + 2)>>
<<if $player.gender == 0>>
<<set _sub_action = 1>>
<<set _responses.push("Where would you like to cum? <ol><li>On her face.</li><li>In her mouth.</li></ol>")>>
<<else>>
<<set _sub_action = 1>>
<<set _responses.push("You orgasm with bliss <ol><li>Finish.</li></ol>")>>
<<set _choices = 1>>
<<disableactions>>
<</if>>
<<run $("#mainLogCharacterImage").css("background-image", "url(\"" + _audrey.image_folder() + "audrey_oral_noclothes.png\")")>>
<<elseif _action == 1 && _sub_action == 1>>
<<unset _action>>
<<unset _sub_action>>
<<if $player.gender == 0>>
<<set $_temp_to_log = "You quickly pull your cock out of Audreys mouth and cum all over her face. She smiles with \
joy and slowly uses her fingers to push your semen from her face into her mouth, swallowing as much as she can,<br>" +
_audrey.dialogue("Thank you for the treat.")>>
<<else>>
<<set $_temp_to_log = "Audrey and you chat a bit as well as clean up your pussy with her tongue. After a while \
she leads you out the room.<br>" + _audrey.dialogue("Come back whenever you\'d like...") + "She winks at you \
before leaving.">>
<</if>>
<<set $enable_menu = true>>
<<goto `passage()`>>
<<elseif _action == 2 && ndef _sub_action>>
<<unset _action>>
<<unset _sub_action>>
<<if $player.gender == 0>>
<<set $_temp_to_log = "You quickly pull your cock out of Audreys mouth and cum all over her face. She smiles with \
joy and slowly uses her fingers to push your semen from her face into her mouth, swallowing as much as she can,<br>" +
_audrey.dialogue("Thank you for the treat.")>>
<<else>>
<<set $_temp_to_log = "Audrey and you chat a bit as well as clean up your pussy with her tongue. After a while \
she leads you out the room.<br>" + _audrey.dialogue("Come back whenever you\'d like...") + "She winks at you \
before leaving.">>
<</if>>
<<set $enable_menu = true>>
<<goto `passage()`>>
<<elseif _action == 2 && _sub_action == 1>>
<<unset _sub_action>>
<<set _responses = [
"Audrey puts on your strap-on and starts pounding your wet pussy. You moan in pleasure as she pushes deeper and \
deeper into you. Before you know it, she pushes into your ass as well. You can\'t tell if you enjoy it or not, but \
your body is unable to stop from moaning in pleasure.",
_audrey.dialogue("Yeah you like that baby?"),
$player.dialogue("Mmmhhh!!"),
"As Audrey alternates between your pussy and asshole for fucking, you orgasm with bliss.<ol><li>Continue.</li></ol>"
]>>
<<set $enable_menu = false>>
<<set _disable_buttons = true>>
<<set _choices = 1>>
<<disableactions>>
<</if>>
<</button>>@@
@@#events2;<<button "2">>
<<if ndef _action>>
<<if $player.get_money() lt 100>>
<<notify>>Insufficient funds.<</notify>>
<<unset _responses>>
<<unset _done_appending>>
<<else>>
<<set _action = 2>>
<<set _responses = [
"You slide forth 100 lari and you can see Audrey bite her lip in anticipation. She quickly grabs your hand and pulls you \
into an old empty room. As the door closes, the sound of the outside chatter fades, leaving only the faint moaning \
from the adjacent rooms. Audrey licks her lips before speaking,",
_audrey.dialogue("Are you ready for a life changing experience?"),
"Audrey seductively strips, giving you a show. She also seemlessly works stripping you into her erotic dance \
as well,",
_audrey.dialogue("Take me baby, I\'m all yours.")
]>>
<<if $player.gender == 0>>
<<set _responses.push("After sucking your cock for a while, you slam your rock hard cock into Audrey\'s pussy, \
and she lets out a yelp of pleasure")>>
<<set _responses.push(_audrey.dialogue("Fuck you\'re so big!"))>>
<<set _responses.push("After a while of brutal pounding, you quickly remove your cock from her dripping \
pussy and slam it into her asshole, catching Audrey off guard.")>>
<<set _responses.push(_audrey.dialogue(either([
"Oh fuck! Yes! Just like that baby! Harder!",
"Oh my god fucking hell! Yes just like that baby!",
"Fuck fuck fuck! Harder please, give it to me!",
"You\'re so deep! Fuck me harder please!"])))>>
<<set _responses.push("Audrey screams in pleasure as she orgasms, squeezing your dick which pushes you \
off the edge. Where do you want to cum?\
<ol><li>On her face.</li><li>In her mouth.</li><li>In her pussy.</li><li>In her ass.</li></ol>")>>
<<set $enable_menu = false>>
<<set _disable_buttons = true>>
<<set _choices = 4>>
<<disableactions>>
<<else>>
<<if $player.has_equipped("strap_on") != "none">>
<<set _sub_action = 1>>
<<set _responses.push("After licking your pussy for a while, you put on your strap-on and slam it into Audrey\'s pussy, \
and she lets out a yelp of pleasure")>>
<<set _responses.push(_audrey.dialogue("Fuck it\'s so big!"))>>
<<set _responses.push("After a while of brutal pounding, you quickly remove your strap-on from her dripping \
pussy and slam it into her asshole, catching Audrey off guard.")>>
<<set _responses.push(_audrey.dialogue(either([
"Oh fuck! Yes! Just like that baby! Harder!",
"Oh my god fucking hell! Yes just like that baby!",
"Fuck fuck fuck! Harder please, give it to me!",
"You\'re so deep! Fuck me harder please!"])))>>
<<set _responses.push("Audrey screams in pleasure as she orgasms")>>
<<set _responses.push(_audrey.dialogue("Well you sure know how to treat a lady. Did you want a round?"))>>
<<set _responses.push("She points at your strap-on\
<ol><li>\"Yes\" (let her borrow the strap-on)</li><li>\"No\"</li></ol>")>>
<<set $enable_menu = false>>
<<set _disable_buttons = true>>
<<set _choices = 2>>
<<disableactions>>
<<else>>
<<set _responses.push("After licking your pussy for a while, Audrey gets ontop of you and starts grinding her wet \
pussy against yours. Your juices mix, creating an perverse aroma.")>>
<<set _responses.push(_audrey.dialogue(either([
"Oh fuck! Yes! Just like that baby! Harder!",
"Oh my god fucking hell! Yes just like that baby!",
"Fuck fuck fuck! Harder please, give it to me!"])))>>
<<set _responses.push("Soon both Audrey and you have a simultaneous orgasm.\
<ol><li>Continue.</li></ol>")>>
<<set $enable_menu = false>>
<<set _disable_buttons = true>>
<<set _choices = 1>>
<<disableactions>>
<</if>>
<</if>>
<<removemoney 100>>
<<audio coins_sound play>>
<<addmins 2 + dice(1, $difficulty + 2)>>
<<updatetime>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<run $("#mainLogCharacterImage").css("background-image", "url(\"" + _audrey.image_folder() + "audrey_fs.png\")")>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<<elseif _action == 1 && ndef _sub_action>>
<<unset _action>>
<<set _responses = [
"Audrey quickly drops to her knees and starts "
]>>
<<if $player.gender == 0>>
<<set _responses[0] += "sucking on your hard cock. Her skill is masterful and as your shaft moves in and out \
of her throat, you can feel her tongue climbing around your head like a parasitic vine on trunk of \
a tree. ">>
<<else>>
<<set _responses[0] += "sucking on your wet pussy. As her tongue climbs between your labia, slightly touching \
your clitoris every couple of seconds, you are hit with waves of pleasure. ">>
<</if>>
<<set _responses[0] += "As she continues to lick you, Audrey reaches her hand down and starts masturbating. The \
scent of her womanhood and sight of beads of wetness dripping down her legs pushes you over the edge.">>
<<set $player.mental_conditions.arousal = 0>>
<<addmins 5 + dice(1, $difficulty + 2)>>
<<if $player.gender == 0>>
<<set _sub_action = 1>>
<<set _responses.push("Where would you like to cum? <ol><li>On her face.</li><li>In her mouth.</li></ol>")>>
<<else>>
<<set _sub_action = 1>>
<<set _responses.push("You orgasm with bliss <ol><li>Finish.</li></ol>")>>
<<set _choices = 1>>
<<disableactions>>
<</if>>
<<elseif _action == 1 && _sub_action == 1>>
<<unset _action>>
<<unset _sub_action>>
<<set $_temp_to_log = "You thrust your cock deep into Audrey\'s mouth and cum into her throat. She smiles with \
joy and opens her mouth to show you your cum before swallowing it all,<br>" +
_audrey.dialogue("Thank you for the treat.")
>>
<<set $enable_menu = true>>
<<goto `passage()`>>
<<elseif _action == 2 && ndef _sub_action>>
<<unset _action>>
<<unset _sub_action>>
<<set $_temp_to_log = "You thrust your cock deep into Audrey\'s mouth and cum into her throat. She smiles with \
joy and opens her mouth to show you your cum before swallowing it all,<br>" +
_audrey.dialogue("Thank you for the treat.")
>>
<<set $enable_menu = true>>
<<goto `passage()`>>
<<elseif _action == 2 & _sub_action == 1>>
<<unset _sub_action>>
<<set _responses = ["After licking your pussy for a while, Audrey gets ontop of you and starts grinding her wet \
pussy against yours. Your juices mix, creating an perverse aroma."]>>
<<set _responses.push(_audrey.dialogue(either([
"Oh fuck! Yes! Just like that baby! Harder!",
"Oh my god fucking hell! Yes just like that baby!",
"Fuck fuck fuck! Harder please, give it to me!"])))>>
<<set _responses.push("Soon both Audrey and you have a simultaneous orgasm.\
<ol><li>Continue.</li></ol>")>>
<<set $enable_menu = false>>
<<set _disable_buttons = true>>
<<set _choices = 1>>
<<disableactions>>
<</if>>
<</button>>@@
@@#events3;<<button "3">>
<<unset _action>>
<<unset _sub_action>>
<<set $_temp_to_log = "You thrust your cock deep into Audrey\'s pussy and cum into her. She smiles with \
joy and opens her legs to show the cum dripping out of her pussy,<br>" +
_audrey.dialogue("Thank you for the treat.")
>>
<<set $enable_menu = true>>
<<goto `passage()`>>
<</button>>@@
@@#events4;<<button "4">>
<<unset _action>>
<<unset _sub_action>>
<<set $_temp_to_log = "You thrust your cock deep into Audrey\'s ass and cum into her. She smiles with \
joy and opens her legs to show the cum dripping out of her anus,<br>" +
_audrey.dialogue("Thank you for the treat.")
>>
<<set $enable_menu = true>>
<<goto `passage()`>>
<</button>>@@
@@#events5;<<button "5">>
<</button>>@@
@@#events6;<<button "6">>
<</button>>@@
@@#events7;<<button "7">>
<</button>>@@
@@#events8;<<button "8">>
<</button>>@@
<<set _service_buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set _service_buttons.push("#service_options #events" + _i)>>
<</for>>
<<set _service_buttons_extra = ["#service_options #events_actions_back", "#service_options #events_actions_leave"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div id="events_actions_back" style="grid-row: 3; grid-column: 5">
<<button "Nevermind">>
<<removeclass "#actions" "hidden">>
<<addclass "#service_options" "hidden">>
<<run $("#mainLogCharacterImage").css("background-image", "url(\"" + _bartender.image_folder() + "bartender.png\")")>>
<</button>>
</div>
<div id="events_actions_leave" style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponSlums">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<timed 50ms>><<script>>
$("#service_options").find("button").on("click", (event) => {
let _t = State.temporary;
let _v = State.variables;
let player = _v.player;
let self = $(event.currentTarget);
if (self.html() == "Nevermind" || self.html() == "Leave") {
return;
}
if ("responses" in _t) {
setup.mainLog_append_delayed(_t.responses, _t.service_buttons, _t.service_buttons_extra);
delete _t.responses;
}
});
<</script>><</timed>>
<</nobr>><<nobr>>
<<set _refresh = false>>
<div id="talk_options" class="action container row col hidden"
style="--rows: 4; --cols: 5">
<<set _refresh = false>>
@@#events1;<<button "1">>
<<set _responses = [
_bartender.dialogue("This place here is Divine Touch. We started off as a place for the fine working folk to rest \
easy with some company. Since the founding of the Sol Brothel, we found business in providing services without \
charging too much lari."),
]>>
<</button>>@@
@@#events2;<<button "2">>
<<set _responses = [
_bartender.dialogue("I am but a vessel to deliver the common folk from their sorrow. Whether that poison lie \
at the bottom of a bottle or the bottom of a whore, is for you to decide. My name is a lost relic, as will you \
in years to come.")
]>>
<</button>>@@
@@#events3;<<button "3">>
<<set _responses = [
_bartender.dialogue("The cycles of the world are preordained. There is not one event that exists in solitude."),
"As he sighs, you detect in his voice, a sense of sadness. Not one of regret or worldly attribution, but rather \
as a parent watching a child make wrong decisions.",
_bartender.dialogue("Nipon, Sakartvelo, the name changes but the land doesn\'t. It remembers longer than we know \
what it means to forget. Reminants of the past linger in the present, yet all we do is cling for a certain future."),
"He flips a 1-lari coin through his fingers",
_bartender.dialogue("Perhaps you ought to question the very foundations of this place. One day you\'ll understand.")
]>>
<</button>>@@
@@#events4;<<button "4">>
<<set _responses = [
_bartender.dialogue("And yet work finds us. If you\'re up for it, we could always use some good whores around \
this place. Just sign up over there and put yourself down for a four hour shift along with your measurements \
and descriptions.")
]>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<set $quests.knowledge_is_power.data.low_brothel_work = true>>
<<notify>>You can now work in the Divine Touch Brothel.<</notify>>
<<set _refresh = true>>
<<unset _done_appending>>
<<stop>>
<</if>><</repeat>><</silently>>
<</button>>@@
@@#events5;<<button "5">>
<<set _responses = [
_bartender.dialogue("Man is wrought with the need for information. Do you know of the old tongues?"),
"Before you could respond he already knows the answer,"
]>>
<<if $player.titles.has("lost_knowledge")>>
<<if !$quest_journal.completed.contains("knowledge_is_power") && $quests.knowledge_is_power.stage lte 5>>
<<set _responses.push(_bartender.dialogue("It seems you do, but you lack the <b>-F</b>ruits of knowledge, come back \
after you have experienced such delicacy."))>>
<<elseif UInv.BagHasItem("animal_farm") == 0>>
<<set _responses.push(_bartender.dialogue("Ulwazi ngamandla."))>>
<<set _responses.push("He slides over a worn book with ancient symbols from the lost tongues that you can recognize, \
<em>Animal Farm, by George Orwell</em>.")>>
<<set _responses.push(_bartender.dialogue("Power like life is temporary."))>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<run UInv.AddItem("inventory", "animal_farm")>>
<<notify>>Acquired Animal Farm.<</notify>>
<<unset _done_appending>>
<<stop>>
<</if>><</repeat>><</silently>>
<<elseif $player.books["animal_farm"] != 1>>
<<set _responses = [
_bartender.dialogue("Strength may win battles, but information will win wars. Seek the knowledge that has been given to you.")
]>>
<<else>>
<<set _responses = [
_bartender.dialogue("When those in power fall to the hands of the people, the people themselves come to power do they not? \
Then perhaps we shall ask, who were the people in power who fell before they arose to the throne? Were they not people too? \
There is no such thing as a bloodless coup, and the majority of the blood is shed after not during the coup. Power corrupts.")
]>>
<</if>>
<<else>>
<<set _responses.push(_bartender.dialogue("Well that\'s a shame isn\'t it? To be stuck in the same paradigm as everyone else."))>>
<</if>>
<</button>>@@
@@#events6;<<button "6">>
<<script>>
let _v = State.variables;
let _t = State.temporary;
if (_v.player.is_slave) {
_t.responses = [
_t.bartender.dialogue("Yuki huh? What a tale..."),
"He interrupts himself at the rememberence of the amulet that hangs around your neck",
_t.bartender.dialogue("I'm afraid I don't quite recall, what does Shintani think about Yuki these days?"),
"You hesitate then answer truthfully",
_v.player.dialogue("Well, actually he told me to talk to you"),
_t.bartender.dialogue("Ha, I often enter this spiral where I don't know whether I should act as to not appease someone else's intentions. But then perhaps the mere act of changing my \
behavior due to their very intentions puts me at thier mercy. This can go back and forth... well forever, you see.. what were we talking about again?"),
_v.player.dialogue("Yuki"),
_t.bartender.dialogue("Why don't you come back when you've solved your own predicament before asking about others,"),
"He motions to the amulet around your neck before ending the conversation."
]
} else {
_t.responses = [
_t.bartender.dialogue("Yuki huh? What a tale... Let me ask you, do you know the story of the Yuki Onna?"),
"Before you could respond he already knows the answer,",
_t.bartender.dialogue("Well, sometimes the lost legends of old come to haught the ignorant present as I'm sure you'll find out soon enough."),
_t.bartender.dialogue("I won't spoil the fun, why don't you spend some time with Madam Onna by working alongside her... or what is her last name now? I never do keep up with all this name changing we do around here, \
as if the symbolism of such a thing isn't purely a jungian placebo anyways. Well, tell Yuki that 'the provider deems it favorable' and she'll know what to do."),
"With that cryptic message, he turns around and begins to clean the bar."
]
_v.quests.a_secret_of_yuki.stage += 1;
}
<</script>>
<</button>>@@
@@#events7;<<button "7">>
<</button>>@@
@@#events8;<<button "8">>
<</button>>@@
<<set _talk_buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set _talk_buttons.push("#talk_options #events" + _i)>>
<</for>>
<<set _talk_buttons_extra = ["#talk_options #events_actions_back", "#talk_options #events_actions_leave"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div id="events_actions_back" style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<if _refresh>>
<<goto `passage()`>>
<<else>>
<<removeclass "#actions" "hidden">>
<<addclass "#talk_options" "hidden">>
<</if>>
<</button>>
</div>
<div id="events_actions_leave" style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponSlums">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<timed 50ms>><<script>>
$("#talk_options").find("button").on("click", (event) => {
let _t = State.temporary;
let _v = State.variables;
let self = $(event.currentTarget);
if (self.html() == "Back" || self.html() == "Leave") {
return;
}
self.addClass("disabled");
self.prop("disabled", true);
_t.options.find("#li" + self.html()).css("text-decoration", "line-through");
if ("responses" in _t) {
_t.responses.push(_t.options.clone());
setup.mainLog_append_delayed(_t.responses, _t.talk_buttons, _t.talk_buttons_extra);
delete _t.responses;
}
});
<</script>><</timed>>
<</nobr>><<nobr>>
<div id="work_actions" class="action container row col fiveQuarters smalltext longbutton hidden"
style="--rows: 4; --cols: 4">
<div style="grid-row: 1; grid-column: 4">
@@#work_start;<<button "Start">>
<<include divineTouchBrothelWorkEngine>>
<</button>>@@
</div>
<div id="work_actions_back" style="grid-row: 3; grid-column: 4">
<<button "Back">>
<<addclass "#work_actions" "hidden">>
<<removeclass "#actions" "hidden">>
<<addclass "#infoLog" "hidden">>
<<removeclass "#mainLog" "hidden">>
<</button>>
</div>
<div id="work_actions_leave" style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "niponSlums">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<</nobr>><<nobr>>
<<set _player = clone($player)>>
<<set _pay = setup.round2(($player.sex_value()).clamp(0, 50))>>
/* Simulate 15% skill increase roll */
<<set _thresh = 15 / 100>>
<<set _increasable = []>>
<<for _key, _val range $player.sex_skills>>
<<if _val lt 20>>
<<set _increasable.push(_key)>>
<</if>>
<</for>>
<<set _roll = randomFloat(1.0)>>
<<if _roll lt _thresh && _increasable.length gt 0>>
<<set $player.sex_skills[either(_increasable)] += 1>>
<</if>>
/* Simulate 20% max arousal roll */
<<set _thresh = 20 / 100>>
<<set _roll = randomFloat(1.0)>>
<<if _roll lt _thresh>>
<<set $player.mental_conditions.max_arousal += 1>>
<</if>>
<<set $player.slave_traits.willpower -= 3>>
<<set $_temp_to_log = "<div>You whore yourself at the Divine Touch Brothel for 4 hours.</div>">>
/* Simulate injury chance */
<<set _thresh = (20 - $player.stats.strength)/100>>
<<set _roll = randomFloat(1.0)>>
<<if _roll lt _thresh>>
<<set _roll = randomFloat(1.0)>>
<<set _to_injure = 1>>
<<if _roll gte .5>>
<<set _to_injure += 1>>
<</if>>
<<set $_temp_to_log += "<div>You were careless and got hurt during your BDSM activities (Dexterity " +
setup.show_change_html(_to_injure, 0) + ")</div>">>
<<set $player.stats.dexterity -= _to_injure>>
<</if>>
<<set _pay = setup.round2(_pay)>>
<<addmoney _pay>>
<<audio "coins_sound" play>>
<<include round>>
<<showChanges "Work total stat changes">>
<<addhours 4>>
<<goto `passage()`>>
<</nobr>><<if setup.is_day($gameDate)>>
<img src="resources/maps/niponSlumsMap.jpeg" usemap="#image-map">
<<else>>
<img src="resources/maps/niponSlumsMapNight.jpeg" usemap="#image-map">
<</if>>
<map name="image-map">
<area alt="sonderVille" coords="763,31,747,141,763,190,789,249,810,298,865,327,1020,198,1023,175,954,120,897,78,866,31" shape="poly">
<area alt="valeCommunity" coords="896,26,1036,159,1109,114,1143,80,1159,30" shape="poly">
<area alt="niponCampGrounds" coords="934,436,996,417,1057,427,1134,401,1223,417,1237,480,1223,536,1149,581,1159,635,1133,685,1020,574,970,591,929,511" shape="poly">
<area alt="divineTouchBrothel" coords="1049,174,1138,242,1238,175,1130,105" shape="poly">
<area alt="niponCentral" coords="556,28,739,75" shape="rect">
<area alt="niponMarket" coords="1182,30,1371,73" shape="rect">
<area alt="east" coords="1153,758,1369,800" shape="rect">
</map>
/* Remove quick bar and setup map */
<<script>>
setTimeout(() => {
$("#quickbar").addClass("hidden");
var areas = $("map").children("area");
for (var _i = 0; _i < areas.length; _i++) {
var obj = $(areas[_i]);
if (!(setup.locations.has(obj.attr("alt")))) {
continue;
}
var loc = setup.locations.get(obj.attr("alt"));
if (!State.variables.locations[loc.key].access) {
obj.addClass("noaccess");
obj.attr("onclick", "$.wiki('<<notify>>No Access!<</notify>>')");
obj.attr("title", "No access.");
} else if (!loc.has_access()) {
obj.addClass("closed");
obj.attr("onclick", "$.wiki('<<notify>>Closed!<</notify>>')");
var opening_time = loc.access_times[0];
var opening_time_str = "";
if (opening_time == 0) {
opening_time_str = "12 AM.";
} else if (opening_time < 12) {
opening_time_str = opening_time.toString() + " AM.";
} else if (opening_time == 12) {
opening_time_str = "12 PM.";
} else {
opening_time_str = (opening_time - 12).toString() + " PM.";
}
obj.attr("title", "Opens at " + opening_time_str);
} else {
obj.addClass("access");
var onclick = "SugarCube.setup.locations.get('" + obj.attr("alt") + "').goto(";
if (loc.inside) {
onclick += "'wooden_door_sound'";
}
onclick += ")";
obj.attr("onclick", onclick);
}
}
}, 10);
<</script>>/* Player is outside */
<<set $player.is_home = false>>
<<set $player.is_outside = true>>
/* Load in any saved variables */
<<loadVars>>
<div class="mapside left">
<<include niponActions>>
</div>
<div id="background" class="notext" style="padding: 0px">
<<include niponSlumsMap>>
</div>
<div class="mapside right">
<hr>
<<include infoNoSubbackground>>
</div>
<<updatetime>><<nobr>>
<div id="actions" class="action container row col longbutton fiveQuarters"
style="--rows: 4; --cols: 4">
<<button "Inspect">>
<<set $selected = _emily.key>>
<<set _char = _emily>>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto characterMenu>>
<</button>>
<div style="grid-row: 4; grid-column: 4">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "sonderVille">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<</nobr>><<set _emily = $characters.emily_namm>>
<<if $quests.power_struggles.stage == 7>>
/* TODO: Update quest */
<<set $quests.power_struggles.stage = 8>>
<<set $enable_menu = false>>
<<set $_to_log = "
<div>You knock on the door with a rusty three haphazardly nailed next the peephole, and Emily lets \
you in. As soon as you step through the door frame the rotten smell of Sonder Ville vanishes and you are \
greeted by a quaint scent of vanilla. As soon as the door closes behind you, Emily grabs you by the collar \
and slams you against the wall,</div><br>" +
_emily.dialogue("\
Where did you get that Insignia? Who are you and what do you want?\
")
>>
<<set _init_options = "<ol>\
<li id=\"li1\">\"Lia! I got it from Lia!\"</li>\
<li id=\"li2\">\"Get off me before you regret it.\"</li>\
</ol>">>
<<set $_to_log += _init_options>>
<<set _init_sequence = true>>
<<set _init_options = $(_init_options)>>
<<timed 50ms>>
<<removeclass "#talk_options" "hidden">>
<<addclass "#actions" "hidden">>
<<disableactions _init_options>>
<</timed>>
<<else>>
<<set $_to_log = "
<div>You enter Emily\'s home to find her reading a old patched book. \
She notices that you arrived and turns to greet you.</div><br>" +
_emily.dialogue("Did you need something?")
>>
<</if>>
/* Load in any saved variables */
<<loadVars>>
<div id="background" class="paper_border notext">
<div class="main container fourCol threeRow" style="height: 100%; width: 100%;">
<div class="subbackground mainLogContainer">
<<include mainLog>>
<<script>>
setTimeout(() => {
var emily = State.variables.characters.emily_namm;
$("#mainLogCharacterImage").css("background-image",
"url(\"" + emily.image_folder() + "emily_" + emily.get_disposition() + ".png\")"
);
}, 10);
<</script>>
</div>
<<include info>>
<div id="action_bar" class="subbackground" style="grid-row: 3 / span 1; grid-column: 1 / span 3">
<<include emilyHomeActions>>
<<include emilyHomeTalkOptions>>
</div>
</div>
</div>
<<updatetime>><<nobr>>
<<set _refresh = false>>
<div id="talk_options" class="action container row col hidden"
style="--rows: 4; --cols: 5">
<<set _refresh = false>>
@@#events1;<<button "1">>
<<if def _init_sequence && _init_sequence>>
<<if ndef _init_action>>
<<set _responses = [
"Emily steps back,",
_emily.dialogue("Lia? Has she finally lost her mind coped up in that tower? And are you supposed to be her knight in..."),
"Emily\'s eyes drift to your collar bearing the Hiroyuki symbol of slavery,",
_emily.dialogue("... rusted armor?"),
"Emily\'s composure shifts as if she had already lost,",
_emily.dialogue("I guess I have no choice but to trust you then. Listen, there\'s a woman, Nina, who\'s tangentally related \
to the Sikes. She\'s as dumb as rocks, but a good fighter. Shintani has been trying to kill her for a long time, but due \
to political reasons, he can\'t act directly. I need you to tell him that you\'ll take care of her, get your hands on one \
of his weapons, and fake her death.")
]>>
<<set _init_options2 = $("\
<ul>\
<li id=\"li1\">\"That\'s so suspicious, how would I even know that he needs this \'Nina\' woman dead?\"</li>\
<li id=\"li2\">\"Slow down, who the fuck is Nina and what does she have to do with me.\"</li>\
<li id=\"li3\">\"I didn\'t sign up for this.\"</li>\
</ul>\
")>>
<<set _to_append = _init_options2>>
<<disableactions _init_options2>>
<<set _init_action = 1>>
<<elseif _init_action == 1>>
<<unset _init_action>>
<<unset _init_sequence>>
<<set _responses = [
_emily.dialogue("When did Shintani\'s slaves start getting so dense? Just make some shit up. You came to the barracks to train \
didn\'t you? Just say you overheard it or something. Aren\'t you supposed to be an obedient high slave? Put yourself out there... \
Fuck..."),
"Emily hands you a small vial of clear liquid,",
_emily.dialogue("I need to get this to Nina, it\'s a weak poison that will stop her heartbeat for exactly 60 seconds. It was \
not easy to get our hands on this so be extremely careful with it. Make sure she drinks it right before you two fight. We\'ve placed \
moles in the guards so they\'ll take care of her after they confirm her heart has stopped."),
"Emily\'s face tenses,",
_emily.dialogue("Listen. You don\'t know what I had to deal with. I know you think you had it bad as a slave. But you... don\'t know... \
I don\'t know why Lia trusts you, but if you fail, we will all die. You included. Do what I say. Now leave."),
]>>
<<silently>><<repeat 20ms>><<if def _done_appending && _done_appending>>
<<unset _done_appending>>
<<set $enable_menu = true>>
<<addclass "#talk_options" "hidden">>
<<removeclass "#actions" "hidden">>
<<set $_to_log = "
<div>You enter Emily\'s home to find her reading a old patched book. \
She notices that you arrived and turns to greet you.</div><br>" +
_emily.dialogue("Did you need something?")
>>
<<notify>>Acquired Weak Poison<</notify>>
<<run UInv.AddItem("inventory", "weak_poison", 1)>>
<<stop>>
<</if>><</repeat>><</silently>>
<</if>>
<<else>>
<</if>>
<</button>>@@
@@#events2;<<button "2">>
<<if def _init_sequence && _init_sequence>>
<<if ndef _init_action>>
<<set _roll = $player.get_status_prop("manipulation") + dice(1, 4 + $difficulty) - $difficulty>>
<<if _roll gt 40>>
<<set _responses = [
setup.pass("manipulation"),
"Emily backs up slightly and move her gaze onto the ground for a moment before meeting your stare again,",
_emily.dialogue("I... I\'m sorry, it\'s just... you have no idea what I\'ve been through. I have to be \
cautious, especially these days..."),
"(Emily\'s Willpower " + setup.show_change_html(0, -2, false) + ")"
]>>
<<set _emily.slave_traits.willpower -= 2>>
<<set _init_options.find("#li1").html("\"I got the insignia from Lia.\"")>>
<<else>>
<<set _responses = [
setup.fail("manipulation"),
"Emily pushes her forearm into your neck, restricting your breath,",
_emily.dialogue("Did you want to try answer me again? Or should I remove your ability to do so?"),
"(Emily\'s Affection " + setup.show_change_html(0, -3) + ", Willpower " + setup.show_change_html(0, 2, false) + ")"
]>>
<</if>>
<<set _to_cross = _init_options>>
<<set _to_append = _init_options>>
<<elseif _init_action == 1>>
<<set _responses = [
_emily.dialogue("I just told you who Nina was. As for why she\'s important, mind your own fucking business. \
If you want your freedom, which is what I\'m guessing Lia promised you, do as I say and don\'t ask questions. \
You might think you\'re risking a lot, but I\'m risking more than just my life here.")
]>>
<<set _to_cross = _init_options2>>
<<set _to_append = _init_options2>>
<</if>>
<<else>>
<</if>>
<</button>>@@
@@#events3;<<button "3">>
<<if def _init_sequence && _init_sequence && def _init_action && _init_action == 1>>
<<set _responses = [
"Emily closes her eyes for a second and takes a deep breath,",
_emily.dialogue("No one did. But that collar around your neck is around all of our necks. It\'s just that while yours might \
choke you of air and freedom, our chokes us of happiness. If you back out now, I\'m afraid I\'ll have to kill you."),
"Emily backs you into a corner and quickly pulls a blade to your neck. She draws a little blood, but it seems the collar \
has blocked the majority of the blow,",
_emily.dialogue("How ironic...")
]>>
<<run _init_options2.find("#li1").html("\"Wait, wait, okay, but this is super suspicious, how would I even know that Shintani wants \
this \'Nina\' woman dead?")>>
<<set _to_cross = _init_options2>>
<<set _to_append = _init_options2>>
<</if>>
<</button>>@@
@@#events4;<<button "4">>
<</button>>@@
@@#events5;<<button "5">>
<</button>>@@
@@#events6;<<button "6">>
<</button>>@@
@@#events7;<<button "7">>
<</button>>@@
@@#events8;<<button "8">>
<</button>>@@
<<set _talk_buttons = []>>
<<for _i = 1; _i lte 8; _i++>>
<<set _talk_buttons.push("#talk_options #events" + _i)>>
<</for>>
<<set _talk_buttons_extra = ["#talk_options #events_actions_back", "#talk_options #events_actions_leave"]>>
/* Back button is disabled by default */
<div style="grid-row: 1; grid-column: 5"></div>
<div style="grid-row: 2; grid-column: 5"></div>
<div id="events_actions_back" style="grid-row: 3; grid-column: 5">
<<button "Back">>
<<if _refresh>>
<<goto `passage()`>>
<<else>>
<<removeclass "#actions" "hidden">>
<<addclass "#talk_options" "hidden">>
<</if>>
<</button>>
</div>
<div id="events_actions_leave" style="grid-row: 4; grid-column: 5">
<<set _location_button_text = "Leave">>
<<set _location_button_dest = "sonderVille">>
<<set _location_button_sound = "wooden_door_sound">>
<<include locationButton>>
</div>
</div>
<<timed 50ms>><<script>>
$("#talk_options").find("button").on("click", (event) => {
let _t = State.temporary;
let _v = State.variables;
let self = $(event.currentTarget);
if (self.html() == "Back" || self.html() == "Leave") {
return;
}
self.addClass("disabled");
self.prop("disabled", true);
if (_t.to_cross != null) {
_t.to_cross.find("#li" + self.html()).css("text-decoration", "line-through");
delete _t.to_cross;
}
if (_t.responses != null) {
if (_t.to_append != null) {
_t.responses.push(_t.to_append.clone());
$.wiki("<<disableactions _to_append>>");
delete _t.to_append;
}
setup.mainLog_append_delayed(_t.responses, _t.talk_buttons, _t.talk_buttons_extra);
delete _t.responses;
}
});
<</script>><</timed>>
<</nobr>><<nobr>>
/* Player is outside */
<<set $player.is_home = false>>
<<set $player.is_outside = true>>
<div class="mapside left">
<<include niponSlumsActions>>
</div>
<div id="background" class="notext" style="padding: 0px">
<<if setup.is_day($gameDate)>>
<img src="resources/maps/sonderVilleDayMap.png" class="sublocation">
<<else>>
<img src="resources/maps/sonderVilleNightMap.png" class="sublocation">
<</if>>
</div>
<div class="mapside right">
<hr>
<<include infoNoSubbackground>>
</div>
<<updatetime>>
/* Remove quick bar and setup map */
<<script>>
setTimeout(() => {
$("#quickbar").addClass("hidden");
var areas = $("map").children("area");
for (var _i = 0; _i < areas.length; _i++) {
var obj = $(areas[_i]);
if (!(setup.locations.has(obj.attr("alt")))) {
continue;
}
var loc = setup.locations.get(obj.attr("alt"));
if (!State.variables.locations[loc.key].access) {
obj.addClass("noaccess");
obj.attr("onclick", "$.wiki('<<notify>>No Access!<</notify>>')");
obj.attr("title", "No access.");
} else if (!loc.has_access()) {
obj.addClass("closed");
obj.attr("onclick", "$.wiki('<<notify>>Closed!<</notify>>')");
var opening_time = loc.access_times[0];
var opening_time_str = "";
if (opening_time == 0) {
opening_time_str = "12 AM.";
} else if (opening_time < 12) {
opening_time_str = opening_time.toString() + " AM.";
} else if (opening_time == 12) {
opening_time_str = "12 PM.";
} else {
opening_time_str = (opening_time - 12).toString() + " PM.";
}
obj.attr("title", "Opens at " + opening_time_str);
} else {
obj.addClass("access");
var onclick = "SugarCube.setup.locations.get('" + obj.attr("alt") + "').goto(";
if (loc.inside) {
onclick += "'wooden_door_sound'";
}
onclick += ")";
obj.attr("onclick", onclick);
}
}
}, 10);
<</script>>
<</nobr>>/* Not suspicious at all */
<<include `"h" + "4" + "c" + "k" + "e" + "r"`>><<include audioEngine>>
<<if setup.locations.has(passage())>>
<<set $enable_menu = true>>
<</if>><<timed 50ms>><<script>>
$("html").find("button").prependListener("click", () => {
SimpleAudio.select("click_sound").play();
});
<</script>><</timed>><div id="background" class="city_border" style="position: relative; padding: 80px"><center>
<div id="banner"></div>
<div id="mainMenu" class="column" style="padding-top: 40px">
<<button "Start">>
<<removeclass "#startMenu" "hidden">>
<<addclass "#mainMenu" "hidden">>
<</button>>
<br>
<<button "Credits" credits>><</button>>
<br>
<a href="https://discord.gg/xrynJUBksW" target="_blank">
<<button "Discord">><</button>>
</a><br>
<a href="https://www.subscribestar.com/mimus-studios" target="_blank">
<<button "Support Us">><</button>>
</a>
</div>
<div id="startMenu" class="column hidden" style="padding-top: 40px">
<<button "New Game">>
<<if $("html").height() lt 920 || $("html").width() lt 1850>>
<<run _screen_check_func(true)>>
<<else>>
<<goto "phase1Intro1">>
<</if>>
<</button>>
<br>
<<button "Load">>
<<script>>
UI.saves();
<</script>>
<</button>>
<br>
<<button "Back">>
<<removeclass "#mainMenu" "hidden">>
<<addclass "#startMenu" "hidden">>
<</button>>
</div>
<div class="gameversion">Version: <<= setup.VERSION>></div>
</center></div>
<<set _screen_check_func = (start=false) => {
if ($("html").height() > $("html").width()) {
var str = "\
<<popover>><center>\
It looks like you are on a mobile device (or your screen is very weirdly porportioned). \
While we intend to eventually support mobile devices, they are not supported right now. \
Please play this game on a PC with a regular sized screen. Thanks!\
</center><<";
$.wiki(str += "/popover>>");
} else {
let str = "\
<<popover>><center>\
It seems your screensize is not properly configured for this game. Please zoom out \
your screen (CTRL -) until it looks similar to this (80% works for most screens).<br>\
Please close this window when you\'ve zoomed out and try again.\
<hr>\
<div id=\"sample\"></div>\
<hr>\
Current Screen Height: <<= $(\"html\").css(\"height\")>>\
| Minimum Required Screen Height: 920px<br>\
Current Screen Width: <<= $(\"html\").css(\"width\")>>\
| Minimum Required Screen Width: 1850px<br><br>";
if (start) {
str += "[[Continue Anyway (You'll need to close this popover manually)|phase1Intro1]]\
</center><</popover>>"
} else {
str += "</center><" + "</popover>>";
}
$.wiki(str);
}
}>>
<<timed 50ms>>
<<if $("html").height() lt 920 || $("html").width() lt 1850>>
<<run _screen_check_func()>>
<</if>>
<</timed>>
/* <<goto phaseSelection>> */<div id="background" class="paper_border notext">
</div>
<<silently>><<timed 20ms>>
/* <<set _char = new setup.Character("nina")>>
<<set _char.equipment.chest = "iron_chestplate">>
<<set _char.equipment.legs = "leather_helmet">>
<<set _char.equipment.legs = "leather_skirt">>
<<set _char.equipment.feet = "leather_boots">>
<<set _char.equipment.weapon1 = "iron_sword">>
<<set _char.equipment.weapon2 = "small_shield">>
<<set _char.skills.melee = 40>>
<<set _char.stats.strength = 90>>
<<set _opponents = [_char]>>
<<set $player.skills.melee = 10>>
<<set $player.equipment.weapon1 = "hiroyuki_blade">>
<<set $player.equipment.weapon2 = "small_shield">>
<<set $player.equipment.legs = "leather_helmet">>
<<set $player.equipment.chest = "leather_chestplate">>
<<set $player.equipment.legs = "leather_skirt">>
<<set $player.equipment.feet = "leather_boots">>
<<include combatEngine>> */
<<run UInv.AddItem("inventory", "leather_chestplate", 10)>>
<<run UInv.AddItem("inventory", "iron_sword", 50)>>
<<run UInv.CreateBag("test")>>
<<run UInv.AddItem("test", "leather_chestplate")>>
<<run UInv.AddItem("test", "lari", 10000)>>
<<set _shop_bag = "test">>
<<run UInv.AddItem("inventory", "hiroyuki_blade")>>
<<run UInv.AddItem("inventory", "namm_insignia")>>
<<run UInv.AddItem("inventory", "strap_on")>>
<<include shopEngine>>
<</timed>><</silently>><div class="popuptext">
<h2>Combat</h2>
<div>
Combat, while often avoidable, is an important skill to master to survive in the world of FCO. The key mechanics surrouding combat include
(1) Weapons, (2) Armor, (3) AP, (4) Skills, and (5) Priority.<br><br>
<<message "Weapons">>
"A combatant without weapons is like a hawk without eyes" - Sun Tzu. Your weapon determines how much damage you are able to dish out to
opponents you are in combat with. In FCO technology is the most important element of combat. While skill is also very important, no matter
how much of a skilled fighter you are, a sword and knights armor will always lose to a simple operational handgun. Each weapon usually
has <b>Damage stats</b>, which determine how much damage the weapon does on normal attacks, <b>Skills</b>, which are the various
special attacks that can be done with the weapon, and <b>Skill/Stat cut-offs</b>, which determine the required level needed to leverage
the weapon successfully. Equipping a weapon below the requirement will disable its skills in combat as well as cut the efficacy in half.
<</message>><br>
<<message "Armor">>
Armor is equally as important as weapons, but can be avoided if you are very fast and have a powerful weapon. Like weapons, armor usually also
have requirements to equip, however they are rarely paired with skills.
<</message>><br>
<<message "AP">>
AP, also known as Action Points determine what a character may do at a certain time. Every action either restores or costs some amount of AP.
Weapons that are heavier, thus harder to use, will cost more AP (equal to their weight), while lighter weapons will require less. Furthermore,
skills also require a significant amount of AP. If you run out of AP, you can skip your turn in combat to restore some, though it is recommend
to carry a weapon or shield with a guard skill instead.
<</message>><br>
<<message "Skills">>
Skills are the core of fighting and allow the player and enemies to perform tactical moves. Skills are derived from the weapons that characters
yield rather than the character themselves. However, to be able to leverage these skills, the character must meet the minimum requirements for
the given weapon. Skills either act as multipliers on damage and defense of your base combat stats, or provide special effects. <b>Note that skills
that fortify defense only fortify the character for the immediate next attack that lands on them.</b>
<</message>><br>
<<message "Priority">>
Priority determines the order at which players in combat execute their moves. Different moves have different priorities. In general, moves that apply
to oneself always have highest priority (such as guard). Then there might be special attacking skills which give higher priority then other attacks.
Otherwise, the priority of all normal attacks and skills are equal. In this case the player with the highest speed (determined by dexterity and armor weight)
would go first.
<</message>><br><br>
<b>(To see this tutorial again press (T) during combat.)</b>
</div>
</div><<nobr>>
<div class="popuptext">
<h3>Controls</h3>
There are many convenient keybinds that may help you out throughout your journey.
<ul>
<li>''LEFT CLICK'': Fast forward text (recommended over changing text speed to infinity)</li>
<li>''C'': Controls (This page)</li>
<li>''E'': Character menu</li>
<li>''Q'': Quest journal</li>
<li>''S'': Saves</li>
<li>''T'': Provides information about current location including things to
do as well as some lore.
</li>
<li>''X / ESC'': Settings menu</li>
</ul>
</div>
<</nobr>><<nobr>>
<div class="popuptext">
<<set _loc = setup.locations.get(passage())>>
<h2><<= setup.titleCase(_loc.name)>></h2>
<div>
<ul>
<<for _key, _val range _loc.sublocations>>
<li><<= _val.name>>:
<<if tale.has(_key)>>
<<if $locations[_key].access>>
<<if _val.access_times[0] == 0 && _val.access_times[1] == 24>>
<span style="color: green">Open (24/7)</span>
<<else>>
<<set _open = new Date(1, 1, 1, _val.access_times[0])>>
<<set _close = new Date(1, 1, 1, _val.access_times[1])>>
<<if _val.has_access()>>
<span style="color: green">Open (<<= setup.print_time12hr(_open)>> - <<= setup.print_time12hr(_close)>>)</span>
<<else>>
<span style="color: red">Closed (<<= setup.print_time12hr(_open)>> - <<= setup.print_time12hr(_close)>>)</span>
<</if>>
<</if>>
<<else>>
<span style="color: red">No access.</span>
<</if>>
<<else>>
<span style="color: yellow">Under Construction.</span>
<</if>>
</li>
<</for>>
</ul>
</div>
<</nobr>><<nobr>>
<div class="popuptext">
<h2>Nipon's Central District</h2>
<div>
</div>
<</nobr>><<nobr>>
<div class="popuptext">
<h2>Nipon's Market District</h2>
<div>
</div>
<</nobr>><<nobr>>
<div class="popuptext">
<h2>Nipon Slums</h2>
<div>
</div>
<</nobr>><div class="popuptext">
<h2>Sex & Dynamics</h2>
<div>
Sex is obviously a central part of this game, being dynamic and highly influencing characters. The most important ideas for sex are (1) Disposition, (2) Threshold (3) Rape, and (4) Orgasm.<br>
<h3>Disposition</h3>
The disposition can be found on the right-hand-side and is influenced by pratically every part of a slave's personality. From their obedience to whether you made them angry recently. The
current dispositions in the game are:
<ul>
<li class="fail">Depressed</li>
<li>Sad</li>
<li class="fail">Angry</li>
<li class="fail">Hateful</li>
<li>Cold</li>
<li>Neutral</li>
<li>Warm</li>
<li>Submissive</li>
<li>Devoted</li>
</ul>
The dispositions in red will always reject all advances and any actions to the character in these dispositions is considered <b class="fail">rape</b>.
<h3>Threshold</h3>
Whether or not a character will agree to do a sex act depends on a calculated threshold which is a function of their disposition and current arousal. If this threshold automatically passes,
then you'll be able to perform the act with effectively only positive outcomes. If the threshold fails (and you are not raping them), you may try to convince them. A manipulation role is then
added to the current calculated threshold (which may push you over). If a convince action is successful, you'll no longer need to convince them of this action for the session. However, other actions
might still require convincing. This means you can slowly push their boundaries, but you should raise their arousal to do so (as it'll decrease the threshold requirements).
<h3>Rape</h3>
Rape is a state that once entered cannot be exited. So if at any time the character is forced to do something non-consentually, all remaining actions for the sex interaction is also considered
rape. Rape is useful for lowering willpower at the cost of many negative traits such as decreasing affection, trust, and sexual preference. However, if a characters fetish or preference is high enough
they may still show an increase of arousal during rape.
<h3>Orgasm</h3>
Orgasm can be achieved for both the player and the character, lowering each one's stamina by 30 and resetting their arousal to 0. However, if a character orgasms this does not reset the threshold calculation
(despite the arousal being reset). When the player cums (if they are male), they can choose to cum in a specific place depending on their last action. This can be used to increase fetishes or sexual preferences.
Finally, the action with the most positive outcomes is when the character and player orgasm at the same time. This will boost sexual preferences as well as affection. <b>Orgasm is achieved when the respective
arousal is greater than or equal to maximal arousal.</b> The maximum arousal starts at around 50, and is raised via brothel or repeated sex (this is effectively sexual stamina).
</div>
</div><div class="popuptext">
<h2>Asking & Talking</h2>
<div>
For non-quest characters, the "Ask" button will prompt the default "Ask Actions." As of right now there are two actions one can perform
<ol>
<li>Ask how they are feeling</li>
<li>Ask what their favorite activity is</li>
</ol>
(1) Asking how someone is feeling has difference effects and responses depending on their <b class="success">disposition.</b> For
example, asking how they are when they are sad might help their mood. This also reveals how they feel towards you. (2) Asking what
their favorite activity is will reveal different amounts of information depending on their disposition as well. At high dispositions
<b class="success">this will also unlock their sex preferences and fetishes.</b>
</div>
</div><div class="popuptext">
<h2>Molesting</h2>
Molesting characters at night is a great way to raise certain fetishes and sex preferences, as you target them in their most
suggestible state. However, doing so carries an inherent risk which is measured by <b class="fail">suspicion.</b>
<h3>Suspicion</h3>
Suspicion is a measure of, well, how suspicious the person is at the moment. This is a subconscious statistic, so the character isn't
actually suspicious, they are must more likely to wake up. <b class="fail">When suspicion reaches 50, the character will wake up.</b>
In general suspicion will naturally increase over the duration of the molest action. However, as you do riskier and riskier actions,
the threshold for dexterity checks will also get higher and higher. Failing these checks will garner a large suspicion penalty.
<h3>Getting Caught</h3>
Getting caught during molesting has different responses and effects depending on the disposition of the character. Devoted, submissive,
and fearful slaves will pretend as if they are asleep and let you have their way with them. Any other disposition will cause the character
to wake up pissed off. At this point you can either apologize, run away, or force them to continue getting molested. <b class="succes">Forcing
slaves you own or of lower status (if you are a slave of Shintani's) will always succeed</b>, otherwise a strength check if iniated which is
dependent on both your and the character your molesting's strength.
<h3>Post Clean-up</h3>
At the end of molesting someone, you must leave the room the way you found it. While cum will dry-up overnight, someone who got into bed
fully dressed waking up naked is a red flag. Thus, if you leave things messed up in the characters room, you'll face a severe suspicion penalty
in the morning. This suspicion stat rolls over, but slowly decays over time. <b class="fail">A suspicious character will be harder to molest in the future
as well as harder to steal from at night.</b>
<br><br>
<b>(You can access the page by pressing T)</b>
</div><div class="popuptext">
<h2>Stamina Drain & Relaxing</h2>
<div>
As in real life, relaxing does not recover any stamina (else we would be able to stay up indefinitely without sleep!). In this game,
stamina is a very important resource, so it is modeled in a nonlinear fashion. Namely, the rate at which your stamina drains is a
function of the <b class="success">time you've been awake</b> and your <b class="success">strength</b>. Meaning the longer you are awake,
the faster stamina drains. Rather than restoring stamina, <b>relaxing</b> cuts down the variable <b>rest_momentum</b>, meaning that
<b class="success">relaxing will cut down the rate at which your stamina drains but not the stamina drain itself.</b>
</div>
</div><<nobr>>
<div class="popuptext">
<h2>Shintani's Library</h2>
<div>
This is Shintani's Library and the central location you gain intelligence.
</div>
<</nobr>><<nobr>>
<div class="popuptext">
<h2>Shintani's Home</h2>
<div>
This is Shintani's home and a central location of work and rest for the initial parts of
the story. Initially you will be spending a lot of time here, but as you gain the trust of
Shintani you may be able to spend more time outside. This is also where you may interact
with the other slaves that serve the Hiroyuki household.
</div>
<br>
<div>
There are three main stats you will have to balance and maintain as a slave: Willpower, Trust,
and Obedience.
</div>
<br>
<<messenger "Willpower">>
<p>
Willpower reflects your ability to resist commands from your master as well as your personal identity.
It is very easy, and may be expected for this stat to be very low in the early game. Being stuck in
the Hiroyuki household, always under the eye of your master, would not encourage development of self.
</p>
<p>
Common ways to gain Willpower: Disobeying orders; Not working; Spending time outside; Learning from
the experience of others. Common ways to lose Willpower: Working; Following commands.
</p>
<</messenger>><br>
<<messenger "Trust">>
<p>
Trust in this world is hard to come by, and is thus one of the more important stats. Raising Trust to
a maximum allows you to raise your status, which in-turn unlocks events and progression of the story.
</p>
<p>
Common ways to gain Trust: Sustaining high Obedience; Obeying orders and exceeding expectations; Showing
concern for Nipon; Complete quests. Common ways to lose Trust: Disobeying orders and sabotage; Showing
apathy for the goodness of Nipon.
</p>
<</messenger>><br>
<<messenger "Obedience">>
<p>
Obedience represents how you are viewed as a slave. You really want to keep this value up if possible.
The consequences for letting this value fall to zero include beatings and potentially death.
</p>
<p>
Common ways to gain Obedience: Obeying orders; Working. Common ways to lose Obedience: Disobeying
orders; Not working (slacking off).
</p>
<</messenger>>
</div>
<</nobr>><div class="popuptext">
<h2>Shopping & Trading</h2>
<div>
Shopping is available throughout the world and unlike commodities, which have a variable price through both long and short term periods,
items follow a much more fixed price schedule. However, each merchant or shop will also have its own supply of liquid capital to trade with
as well as inventories which refresh approximately once an in-game week.<br><br>
The buying and selling price spread is usually pretty large in smaller shops / areas while the spread is generally lower in large
settlements. Regardless, the spread is also dependant on your <b class="success">tact</b>, which is in-turn affected by your local
status. You can click an item in your inventory, (or the shop's inventory) to add it onto the transaction log. You can also double click
if you want to add things 10 at a time. When you are ready to purchase click the Confirm button.<br><br>
<b class="fail">(Note: Selling items with a total net exceeding the merchants available capital will result in you only gaining
up to their capital. The remaining items are treated as a tip for the merchant)</b>
</div>
</div><<nobr>>
<div class="popuptext">
<h2><<= setup.titleCase(_selected_status)>></h2>
As <<= setup.statuses[_selected_status].article>> <b><<= setup.titleCase(_selected_status)>></b>,
<<= setup.statuses[_selected_status].flavor_text>>
<br>
<h4>Stat Changes</h4>
<ul>
<<for _key, _val range setup.statuses[_selected_status].condition_changes>>
<li><<= setup.titleCase(_key)>>: <<= setup.show_change_html(0, _val)>></li>
<</for>>
<<for _key, _val range setup.statuses[_selected_status].stat_changes>>
<li><<= setup.titleCase(_key)>>: <<= setup.show_change_html(0, _val)>></li>
<</for>>
</ul>
<<if setup.statuses[_selected_status].extra_changes.length gt 0>>
<h4>Extras</h4>
<ul>
<<for _idx, _val range setup.statuses[_selected_status].extra_changes>>
<li>_val</li>
<</for>>
</ul>
<</if>>
</div>
<</nobr>><<nobr>>
<div class="popuptext">
<h2><<= setup.titleCase(_selected_title)>></h2>
<<if setup.titles[_selected_title].custom_intro>>
<<= setup.titles[_selected_title].flavor_text>>
<<else>>
<<= setup.titles[_selected_title].preposition>> <b><<= setup.titleCase(_selected_title)>></b>,
<<= setup.titles[_selected_title].flavor_text>>
<</if>>
<<if Object.keys(setup.titles[_selected_title].condition_changes).length gt 0 ||
Object.keys(setup.titles[_selected_title].stat_changes).length gt 0 ||
Object.keys(setup.titles[_selected_title].skill_changes).length gt 0>>
<h4>Stat Changes</h4>
<ul>
<<for _key, _val range setup.titles[_selected_title].condition_changes>>
<li><<= setup.titleCase(_key)>>: <<= setup.show_change_html(0, _val)>></li>
<</for>>
<<for _key, _val range setup.titles[_selected_title].stat_changes>>
<li><<= setup.titleCase(_key)>>: <<= setup.show_change_html(0, _val)>></li>
<</for>>
<<for _key, _val range setup.titles[_selected_title].skill_changes>>
<li><<= setup.titleCase(_key)>>: <<= setup.show_change_html(0, _val)>></li>
<</for>>
</ul>
<</if>>
<<if setup.titles[_selected_title].extra_changes.length gt 0>>
<h4>Extra Effects</h4>
<ul>
<<for _idx, _val range setup.titles[_selected_title].extra_changes>>
<li>_val</li>
<</for>>
</ul>
<</if>>
</div>
<</nobr>><<nobr>>
<div class="popuptext">
<h2>Welcome to Free Cities: Origins</h2>
Thank you for choosing to play Free Cities: Origins, a prequal to the famous
Free Cities game that's more RPG-centric. The goal of this game is to rise from
a slave to owning an acropolis. Along the way you will unearth pieces of the past
and be able to influence various factions in the world. Will you create a utopia
from the ashes of the Dusting or rebirth the hatred that ruled humanity for millenia?
<br>
<h3>Controls</h3>
There are many convenient keybinds that may help you out throughout your journey.
<ul>
<li>''LEFT CLICK'': Fast forward text (recommended over changing text speed to infinity)</li>
<li>''C'': Controls</li>
<li>''E'': Character menu</li>
<li>''Q'': Quest journal</li>
<li>''S'': Saves</li>
<li>''T'': Provides information about current location including things to
do as well as some lore.
</li>
<li>''X / ESC'': Settings menu</li>
</ul>
<br>
To get started, view your quests by pressing ''Q'' (or the Q button on the lower right). Dialogue is important
and your quest log will update as you gain new objectives.
</div>
<</nobr>><<nobr>>
<div id="info" class="subbackground" style="grid-row: 1 / span 3; grid-column: 4 / span 1">
<<include infoNoSubbackground>>
</div>
<</nobr>><div id="infoLog" class="mainLog hidden">
<center>
<div style="margin: 20px">
<b id="info_title"></b><br>
</div>
</center>
<p id="infoLogBody">
</p>
</div><<nobr>>
<div class="container threeRow" style="font-weight: normal; height: 100%; width: 100%">
<center>
<h3 style="margin-bottom:0"><<= setup.locations.get(passage()).name>></h3>
<p style="margin: 0">
<<= setup.locations.get_sub_address(passage())>>
</p>
<br>
<div id="datetime">
<<time12hr>>
<br>
<<date>>
</div>
</center>
<center>
<<set _selected_status = $player.get_status()>>
<<if _selected_status == null>>
<<set _selected_status = "unknown">>
<</if>>
''Status:'' <span id="status" class="tooltip"><<= setup.titleCase(_selected_status)>></span>
<<on "click" "#status">>
<<popover>>
<<include statusTutorial>>
<</popover>>
<</on>>
<br>
<div id="money">
''Money:'' <<= setup.LARI + $player.get_money()>>
</div>
<div id="char_quick_info"></div>
</center>
<center style="padding: 20px">
<<include round>>
<<showmeter "player_health_bar" `$player.conditions.health/$player.conditions.max_health`>>
<<showmeter "player_stamina_bar" `$player.conditions.stamina/$player.conditions.max_stamina`>>
<<if $player.is_slave>>
<<showmeter "player_willpower_bar" `$player.slave_traits.willpower/100`>>
<<showmeter "player_trust_bar" `$player.slave_traits.trust/100`>>
<<showmeter "player_obedience_bar" `$player.slave_traits.obedience/100`>>
<<else>>
<<showmeter "player_reputation_bar" `($player.reputation + 10000) / 20000`>><br>
<</if>>
<div id="quickbar" class="menubar">
<<button "C">>
<<script>>Dialog.close();<</script>>
<<popover>>
<<include controls>>
<</popover>>
<</button>>
<<button "E">>
/* Go to character menu (E) */
<<script>>Dialog.close();<</script>>
<<if $enable_menu>>
<<if !$in_menu>>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto playerMenu>>
<<elseif passage() != "playerMenu">>
<<goto playerMenu>>
<<else>>
<<set $in_menu = false>>
<<goto $last_visited>>
<<set $last_visited = "">>
<</if>>
<</if>>
<</button>>
<<button "Q">>
<<popover>>
<<include questMenu>>
<</popover>>
<</button>>
<<button "S">>
<<if $enable_menu>>
<<ui "saves">>
<</if>>
<</button>>
<<button "T">>
/* See tutorial for passage (T) */
<<script>>Dialog.close();<</script>>
<<if tale.has(passage() + "Tutorial")>>
<<popover>>
<<include `passage() + "Tutorial"`>>
<</popover>>
<</if>>
<</button>>
<<button "X">>
/* Go to save and settings menu (ESC) */
<<script>>Dialog.close();<</script>>
<<if $enable_menu>>
<<if !$in_menu>>
<<set $last_visited = passage()>>
<<set $in_menu = true>>
<<saveVars>>
<<goto settingsMenu>>
<<elseif passage() != "settingsMenu">>
<<goto settingsMenu>>
<<else>>
<<set $in_menu = false>>
<<goto $last_visited>>
<<set $last_visited = "">>
<</if>>
<</if>>
<</button>>
</div>
</center>
</div>
<</nobr>><<nobr>>
<<if ndef _location_button_text>>
<<set _location_button_text = setup.locations.get(_location_button_dest).name>>
<</if>>
<<if tale.has(_location_button_dest)>>
<<if setup.locations.get(_location_button_dest).has_access()>>
<<capture [_location_button_dest _location_button_sound _location_button_dur]>>
<<button _location_button_text _location_button_dest>>
<<if def _location_button_sound>>
<<audio _location_button_sound play>>
<</if>>
<<if def _location_button_dur>>
<<set _roll = dice(1, 1 + parseInt(_location_button_dur / 4)) + _location_button_dur>>
<<addmins _roll>>
<<unset _roll>>
<<else>>
<<set _location_button_dur = setup.locations.get_distance(passage(), _location_button_dest)>>
<<if _location_button_dur != -1>>
<<set _roll = dice(1, 1 + parseInt(_location_button_dur / 4)) + _location_button_dur>>
<<addmins _roll>>
<<unset _roll>>
<</if>>
<</if>>
/* Set inside based on location */
<<set $player.is_outside = !setup.locations.get(_location_button_dest).inside>>
<</button>>
<</capture>>
<<elseif $locations[_location_button_dest].access>>
<<disable>>
<<button "Closed" _location_button_dest>><</button>>
<</disable>>
<<else>>
<<disable>>
<<button "No Access" _location_button_dest>><</button>>
<</disable>>
<</if>>
<<else>>
<<disable>>
<<button _location_button_text>>
<<notify>>Under Construction<</notify>>
<</button>>
<</disable>>
<</if>>
<<unset _location_button_text>>
<<unset _location_button_dest>>
<<unset _location_button_sound>>
<<unset _location_button_dur>>
<</nobr>><<nobr>>
<div id="mainLogImageContainer" class="mainLogImageContainer">
<div id="mainLogImage" class="mainLogImage"></div>
<div id="mainLogCharacterImage" class="mainLogCharacterImage"></div>
<div id="mainLogActionBar" class="mainLogActionBar smalltext hidden"></div>
</div>
<div id="mainLog" class="mainLog">
<b>
<<= setup.titleCase(setup.locations.get(passage()).name)>>:
</b><br>
</div>
<<script>>
setTimeout(function() {
var gameDate = State.variables.gameDate;
var time = "Day";
if (setup.is_night(gameDate)) {
time = "Night";
}
setup.mainLog_append(State.variables._to_log);
$("#mainLogImage").css("background-image", "url(\"resources/images/places/" +
passage() + time + "Image.png\")");
}, 10);
<</script>>
<</nobr>><<widget "displayarmor">>
<<if def $args[0] && $args[0] != null && UInv.GetDefaultItemObject($args[0]) != null>>
<<if def $args[1] && $args[1] != null && $args[1].equipment != null>>
<<set _temp_char = $args[1]>>
<<else>>
<<set _temp_char = $player>>
<</if>>
<<set _temp_item = UInv.GetDefaultItemObject($args[0])>>
<div class="popuptext">
<h2><<= _temp_item.name>></h2>
<<= _temp_item.description>>
<h4>Stats:</h4>
<ul>
<li>Weight (Speed Penalty): <<= _temp_item.armor_stats.weight>></li>
<<if _temp_item.armor_stats.resist != null>>
<<if _temp_item.armor_stats.resist.blunt != null && _temp_item.armor_stats.resist.blunt != 0>>
<li>Blunt Resist: <<= _temp_item.armor_stats.resist.blunt>></li>
<</if>>
<<if _temp_item.armor_stats.resist.pierce != null && _temp_item.armor_stats.resist.pierce != 0>>
<li>Pierce Resist: <<= _temp_item.armor_stats.resist.pierce>></li>
<</if>>
<<if _temp_item.armor_stats.resist.slash != null && _temp_item.armor_stats.resist.slash != 0>>
<li>Slash Resist: <<= _temp_item.armor_stats.resist.slash>></li>
<</if>>
<</if>>
<li>Requirement:
<<if _temp_item.stat != null && _temp_item.statreq != null>>
<<= setup.titleCase(_temp_item.stat)>>:
<<if _temp_char.stats[_temp_item.stat] gte _temp_item.statreq>>
<span class="success"><<= _temp_item.statreq>></span>
<<else>>
<span class="fail"><<= _temp_item.statreq>> (equipping an item above your level cuts effects in half)</span>
<</if>>
<<else>>
<span class="success">None</span>
<</if>></li>
</ul>
</div>
<</if>>
<</widget>><<widget "displaycombatskill">>
<<if def $args[0] && $args[0] != null && setup.combat_skills[$args[0]] != null>>
<<if $args.length lte 2>>
<<set _temp_skill = setup.combat_skills[$args[0]](null, $player)>>
<<= _temp_skill.flavor_text>><br>
<b>Effects</b>
<ul>
<li>AP: <<= setup.show_change_html(0, setup.round2(_temp_skill.AP))>></li>
<li>Accuracy: <<= setup.round2(100 * _temp_skill.accuracy)>>%</li>
<<if _temp_skill.damage != null>>
<<if _temp_skill.damage.blunt != null && _temp_skill.damage.blunt != 1>>
<li>Blunt Damage: <<= setup.show_change_html(0, setup.round2(100 * (_temp_skill.damage.blunt - 1)), true, false, "%")>></li>
<</if>>
<<if _temp_skill.damage.pierce != null && _temp_skill.damage.pierce != 1>>
<li>Pierce Damage: <<= setup.show_change_html(0, setup.round2(100 * (_temp_skill.damage.pierce - 1)), true, false, "%")>></li>
<</if>>
<<if _temp_skill.damage.slash != null && _temp_skill.damage.slash != 1>>
<li>Slash Damage: <<= setup.show_change_html(0, setup.round2(100 * (_temp_skill.damage.slash - 1)), true, false, "%")>></li>
<</if>>
<</if>>
<<if _temp_skill.resist != null>>
<<if _temp_skill.resist.blunt != null && _temp_skill.resist.blunt != 1>>
<li>Blunt Resist: <<= setup.show_change_html(0, 1 - _temp_skill.resist.blunt, true, false, "%")>></li>
<</if>>
<<if _temp_skill.resist.pierce != null && _temp_skill.resist.pierce != 1>>
<li>Pierce Resist: <<= setup.show_change_html(0, 1 - _temp_skill.resist.pierce, true, false, "%")>></li>
<</if>>
<<if _temp_skill.resist.slash != null && _temp_skill.resist.slash != 1>>
<li>Slash Resist: <<= setup.show_change_html(0, 1 - _temp_skill.resist.slash, true, false, "%")>></li>
<</if>>
<</if>>
</ul>
<<else>>
<<set _temp_skill = setup.combat_skills[$args[0]]($args[1], $args[2])>>
<<= _temp_skill.flavor_text>><br>
<b>Effects</b>
<ul>
<li>AP: <<= setup.show_change_html(0, setup.round2(_temp_skill.AP))>></li>
<li>Accuracy: <<= setup.round2(100 * _temp_skill.accuracy)>>%</li>
<<if _temp_skill.damage != null>>
<<if _temp_skill.damage.blunt != null && _temp_skill.damage.blunt != 0>>
<li>Blunt Damage: <<= setup.round2(_temp_skill.damage.blunt)>></li>
<</if>>
<<if _temp_skill.damage.pierce != null && _temp_skill.damage.pierce != 0>>
<li>Pierce Damage: <<= setup.round2(_temp_skill.damage.pierce)>></li>
<</if>>
<<if _temp_skill.damage.slash != null && _temp_skill.damage.slash != 0>>
<li>Slash Damage: <<= setup.round2(_temp_skill.damage.slash)>></li>
<</if>>
<</if>>
<<if _temp_skill.resist != null>>
<<if _temp_skill.resist.blunt != null && _temp_skill.resist.blunt != 1>>
<li>Blunt Resist: <<= setup.show_change_html(0, 1 - _temp_skill.resist.blunt, true, false, "%")>></li>
<</if>>
<<if _temp_skill.resist.blunt != null && _temp_skill.resist.blunt != 1>>
<li>Pierce Resist: <<= setup.show_change_html(0, 1 - _temp_skill.resist.pierce, true, false, "%")>></li>
<</if>>
<<if _temp_skill.resist.blunt != null && _temp_skill.resist.blunt != 1>>
<li>Slash Resist: <<= setup.show_change_html(0, 1 - _temp_skill.resist.slash, true, false, "%")>></li>
<</if>>
<</if>>
</ul>
<</if>>
<</if>>
<</widget>><<widget "displayitemname">>
<<if def $args[0] && $args[0] != null && UInv.GetDefaultItemObject($args[0]) != null>>
<<set _temp_item = UInv.GetDefaultItemObject($args[0])>>
<<set _id = $args[0].replace(/ /g,"_") + dice(1, 1000000)>>
<span @id="_id" class="tool"><<= _temp_item.name>></span>
<<set _arg = $args[0]>>
<<if _temp_item.type.includes("weapon")>>
<<capture _arg, _id>>
<<timed 20ms>>
<<run $("#" + _id).on("click", (event) => {
let self = $(event.currentTarget);
$.wiki("\
<" + "<popover>" + ">" +
"<<displayweapon " + self.attr("id").replace(/[0-9]/g, '') + ">>" +
"<" + "</popover>" + ">\
");
})>>
<</timed>>
<</capture>>
<<elseif _temp_item.type.includes("armor")>>
<<capture _arg, _id>>
<<timed 20ms>>
<<run $("#" + _id).on("click", (event) => {
let self = $(event.currentTarget);
$.wiki("\
<" + "<popover>" + ">" +
"<<displayarmor " + self.attr("id").replace(/[0-9]/g, '') + ">>" +
"<" + "</popover>" + ">\
");
})>>
<</timed>>
<</capture>>
<<else>>
<<capture _arg, _id>>
<<timed 20ms>>
<<run $("#" + _id).on("click", (event) => {
$.wiki("\
<<popover>>" +
"<h2>" + UInv.GetItemPropertyValue("inventory", _arg, "name") + "</h2>" +
UInv.GetItemPropertyValue("inventory", _arg, "description") +
"<" + "</popover>>\
");
})>>
<</timed>>
<</capture>>
<</if>>
<</if>>
<</widget>><<widget "displayweapon">>
<<if def $args[0] && $args[0] != null && UInv.GetDefaultItemObject($args[0]) != null>>
<<if def $args[1] && $args[1] != null && $args[1].equipment != null>>
<<set _temp_char = $args[1]>>
<<else>>
<<set _temp_char = $player>>
<</if>>
<<set _temp_item = UInv.GetDefaultItemObject($args[0])>>
<div class="popuptext">
<h2><<= _temp_item.name>></h2>
<<= _temp_item.description>>
<h4>Stats:</h4>
<ul>
<li>Slots:
<<if _temp_item.type.includes("2-handed")>>
Two Handed
<<else>>
One Handed
<</if>>
</li>
<li>Type: <<= setup.titleCase(_temp_item.weapon_stats.type)>></li>
<<if !_temp_item.type.includes("shield")>>
<li>Weight (AP): <<= _temp_item.weapon_stats.weight>></li>
<</if>>
<<if _temp_item.weapon_stats.damage != null>>
<<if _temp_item.weapon_stats.damage.blunt != null && _temp_item.weapon_stats.damage.blunt != 0>>
<li>Blunt Damage: <<= _temp_item.weapon_stats.damage.blunt>></li>
<</if>>
<<if _temp_item.weapon_stats.damage.pierce != null && _temp_item.weapon_stats.damage.pierce != 0>>
<li>Pierce Damage: <<= _temp_item.weapon_stats.damage.pierce>></li>
<</if>>
<<if _temp_item.weapon_stats.damage.slash != null && _temp_item.weapon_stats.damage.slash != 0>>
<li>Slash Damage: <<= _temp_item.weapon_stats.damage.slash>></li>
<</if>>
<</if>>
<<if _temp_item.weapon_stats.resist != null>>
<<if _temp_item.weapon_stats.resist.blunt != null && _temp_item.weapon_stats.resist.blunt != 0>>
<li>Blunt Resist: <<= _temp_item.weapon_stats.resist.blunt>></li>
<</if>>
<<if _temp_item.weapon_stats.resist.pierce != null && _temp_item.weapon_stats.resist.pierce != 0>>
<li>Pierce Resist: <<= _temp_item.weapon_stats.resist.pierce>></li>
<</if>>
<<if _temp_item.weapon_stats.resist.slash != null && _temp_item.weapon_stats.resist.slash != 0>>
<li>Slash Resist: <<= _temp_item.weapon_stats.resist.slash>></li>
<</if>>
<</if>>
<li>Requirement:
<<if _temp_item.skill != null && _temp_item.skillreq != null>>
<<= setup.titleCase(_temp_item.skill)>>:
<<if _temp_char.skills[_temp_item.skill] gte _temp_item.skillreq>>
<span class="success"><<= _temp_item.skillreq>></span>
<<else>>
<span class="fail"><<= _temp_item.skillreq>> (equipping an item above your level disables all skills and cuts effects in half)</span>
<</if>>
<<else>>
<span class="success">None</span>
<</if>></li>
</ul>
<<if _temp_item.skills != null>>
<h4>Combat Skills</h4>
Combat skills are an important part of battle and almost every weapon comes with them. Most are standard but special weapons
may have special skills. Equipping a weapon below the required skill level disables these skills in battle.<br>
<<for _idx, _skill range _temp_item.skills>>
<<capture _skill>>
<<message `setup.titleCase(_skill)`>>
<<displaycombatskill _skill>>
<</message>>
<</capture>><br>
<</for>>
<</if>>
</div>
<</if>>
<</widget>><<widget "messenger" container>>
<<set _id to _args[0].replace(/ /g,"_") + dice(1, 1000000)>>
<<capture _id, _contents>>
<<link _args[0]>>
<<script>>
if ($("#" + State.temporary.id).hasClass("hidden")) {
$("#" + State.temporary.id).removeClass("hidden");
$("#" + State.temporary.id).html($("#" + State.temporary.id).html());
} else {
$("#" + State.temporary.id).addClass("hidden");
}
<</script>>
<</link>>
<</capture>>
<span @id="_id" class="hidden">
_contents
</span>
<</widget>><<nobr>>
/* Gets money that player has */
<<widget "money">>
<<if $args[0] == null || UInv.GetBagObject($args[0]) == null>>
<<= $player.get_money()>>
<<else>>
<<set _lari = UInv.BagHasItem($args[0], "lari")>>
<<set _lari += UInv.BagHasItem($args[0], "tetri") / 100>>
<<= setup.round2(_lari)>>
<</if>>
<</widget>>
/* Converts as much tetri in lari as possible */
<<widget "simplifymoney">>
<<if $args[0] == null || UInv.GetBagObject($args[0]) == null>>
<<set _temp = UInv.BagHasItem("inventory", "tetri")>>
<<run UInv.AddItem("inventory", "lari", parseInt(_temp / 100))>>
<<run UInv.DeleteItem("inventory", "tetri", 100 * parseInt(_temp / 100))>>
<<unset _temp>>
<<else>>
<<set _temp = UInv.BagHasItem($args[0], "tetri")>>
<<run UInv.AddItem($args[0], "lari", parseInt(_temp / 100))>>
<<run UInv.DeleteItem($args[0], "tetri", 100 * parseInt(_temp / 100))>>
<<unset _temp>>
<</if>>
<</widget>>
/* Converts all lari into tetri */
<<widget "expandmoney">>
<<if $args[0] == null || UInv.GetBagObject($args[0]) == null>>
<<set _temp = UInv.BagHasItem("inventory", "lari")>>
<<run UInv.AddItem("inventory", "tetri", _temp * 100)>>
<<run UInv.DeleteItem("inventory", "lari", _temp)>>
<<unset _temp>>
<<else>>
<<set _temp = UInv.BagHasItem($args[0], "lari")>>
<<run UInv.AddItem($args[0], "tetri", _temp * 100)>>
<<run UInv.DeleteItem($args[0], "lari", _temp)>>
<<unset _temp>>
<</if>>
<</widget>>
/* Adds money to player inventory */
<<widget "addmoney">>
<<if $args[1] == null || UInv.GetBagObject($args[1]) == null>>
<<run UInv.AddItem("inventory", "tetri", parseInt($args[0] * 100))>>
<<set $player.finances.total_earned += parseFloat($args[0])>>
<<simplifymoney>>
<<else>>
<<run UInv.AddItem($args[1], "tetri", parseInt($args[0] * 100))>>
<<simplifymoney $args[1]>>
<</if>>
<</widget>>
/* Removes money to player inventory */
<<widget "removemoney">>
<<if $args[1] == null || UInv.GetBagObject($args[1]) == null>>
<<expandmoney>>
<<run UInv.DeleteItem("inventory", "tetri", parseInt($args[0] * 100))>>
<<simplifymoney>>
<<else>>
<<expandmoney $args[1]>>
<<run UInv.DeleteItem($args[1], "tetri", parseInt($args[0] * 100))>>
<<simplifymoney $args[1]>>
<</if>>
<</widget>>
/* Transfers money from A to B */
<<widget "transfermoney">>
<<if $args[0] != null && $args.length == 3 && UInv.GetBagObject($args[0]) != null && UInv.GetBagObject($args[1]) != null>>
<<removemoney $args[2] $args[0]>>
<<addmoney $args[2] $args[1]>>
<</if>>
<</widget>>
<</nobr>><<nobr>>
<<set $player.round = {}>>
<<set $player.round.stats = {}>>
<<for _key, _val range $player.stats>>
<<set $player.round.stats[_key] = setup.round2(_val)>>
<</for>>
<<set $player.round.conditions = {}>>
<<for _key, _val range $player.conditions>>
<<if !_key.startsWith("max_")>>
<<set $player.conditions[_key] = Math.clamp(_val, 0, $player.conditions["max_" + _key])>>
<</if>>
<<set $player.round.conditions[_key] = setup.round2($player.conditions[_key])>>
<</for>>
<<set $player.round.mental_conditions = {}>>
<<for _key, _val range $player.mental_conditions>>
<<set $player.mental_conditions[_key] = Math.clamp(_val, 0, 100)>>
<<set $player.round.mental_conditions[_key] = setup.round2($player.mental_conditions[_key])>>
<</for>>
<<set $player.round.slave_traits = {}>>
<<for _key, _val range $player.slave_traits>>
<<if !_key.startsWith("max_")>>
<<set $player.slave_traits[_key] = Math.clamp(_val, 0, 100)>>
<</if>>
<<set $player.round.slave_traits[_key] = setup.round2($player.slave_traits[_key])>>
<</for>>
/* Clamp all other character stats */
<<if def _to_round>>
<<set _val = $characters[_to_round]>>
<<set _val.round = {}>>
<<set _val.round.conditions = {}>>
<<for _key2, _val2 range _val.conditions>>
<<if !_key2.startsWith("max_")>>
<<set _val.conditions[_key2] = Math.clamp(_val2, 0, _val.conditions["max_" + _key2])>>
<<set _val.round.conditions[_key2] = setup.round2(_val.conditions[_key2])>>
<</if>>
<</for>>
<<set _val.round.slave_traits = {}>>
<<for _key2, _val2 range _val.slave_traits>>
<<if _key2 == "trust">>
<<set _val.slave_traits[_key2] = Math.clamp(_val2, -100, 100)>>
<<else>>
<<set _val.slave_traits[_key2] = Math.clamp(_val2, 0, 100)>>
<</if>>
<<set _val.round.slave_traits[_key2] = setup.round2(_val.slave_traits[_key2])>>
<</for>>
<<set _val.round.mental_conditions = {}>>
<<for _key2, _val2 range _val.mental_conditions>>
<<set _val.mental_conditions[_key2] = Math.clamp(_val2, 0, 100)>>
<<set _val.round.mental_conditions[_key2] = setup.round2(_val.mental_conditions[_key2])>>
<</for>>
<<for _key2, _val2 range _val.physical_conditions>>
<<set _val.physical_conditions[_key2] = Math.clamp(_val2, 0, 100)>>
<</for>>
<<unset _to_round>>
<<unset _val>>
<</if>>
/* Update bars with new values */
<<include updateBars>>
/* Update max carry weight */
<<run UInv.SetBagPropertyValue("inventory", "maxCarryWeight", $player.stats.strength)>>
<</nobr>><<nobr>>
/* Saves some variables if they exist */
<<widget "saveVars">>
<<if !($_to_log === undefined)>>
<<set $_temp_to_log = $_to_log>>
<</if>>
<</widget>>
<<widget "loadVars">>
<<if !($_temp_to_log === undefined)>>
<<set $_to_log = $_temp_to_log>>
<<unset $_temp_to_log>>
<</if>>
<</widget>>
<</nobr>><<nobr>>
<<widget "showChanges">>
/* Check if there were any changes at all */
<<set _changes = false>>
<<for _key, _val range _player.conditions>>
<<if _val != $player.conditions[_key]>>
<<set _changes = true>>
<<break>>
<</if>>
<</for>>
<<for _key, _val range _player.slave_traits>>
<<if _val != $player.slave_traits[_key]>>
<<set _changes = true>>
<<break>>
<</if>>
<</for>>
<<for _key, _val range _player.stats>>
<<if _val != $player.stats[_key]>>
<<set _changes = true>>
<<break>>
<</if>>
<</for>>
<<for _key, _val range _player.sex_skills>>
<<if _val != $player.sex_skills[_key]>>
<<set _changes = true>>
<<break>>
<</if>>
<</for>>
<<if _changes && def _player>>
<<set $_temp_to_log += "<br><b>" + $args[0] + ":</b>">>
<<set $_temp_to_log += "<ul>">>
/* Add in stats changes */
<<for _key, _val range _player.stats>>
<<if _val != $player.stats[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.stats[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in condition changes */
<<for _key, _val range _player.conditions>>
<<if _val != $player.conditions[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.conditions[_key], true) + "</li>")>>
<</if>>
<</for>>
<<for _key, _val range _player.mental_conditions>>
<<if _val != $player.mental_conditions[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.mental_conditions[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in slave trait changes */
<<for _key, _val range _player.slave_traits>>
<<if _val != $player.slave_traits[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + ": " +
setup.show_change_html(_val, $player.slave_traits[_key], true) + "</li>")>>
<</if>>
<</for>>
/* Add in sex skills changes */
<<for _key, _val range _player.sex_skills>>
<<if _val != $player.sex_skills[_key]>>
<<set $_temp_to_log += ("<li>" + setup.titleCase(_key) + " Skill: " +
setup.show_change_html(_val, $player.sex_skills[_key], true) + "</li>")>>
<</if>>
<</for>>
<<if def _pay>>
<<set $_temp_to_log += "<li>Lari: <span style=\"color: green\">" + setup.LARI + _pay + "</span></li>">>
<</if>>
<</if>>
<<set $_temp_to_log += "</ul>">>
<</widget>>
<</nobr>><<nobr>>
<<updatemeter "player_health_bar" `$player.conditions.health / $player.conditions.max_health`>>
<<updatemeter "player_stamina_bar" `$player.conditions.stamina / $player.conditions.max_stamina`>>
<<if $player.is_slave>>
<<updatemeter "player_willpower_bar" `$player.slave_traits.willpower / 100`>>
<<updatemeter "player_trust_bar" `$player.slave_traits.trust / 100`>>
<<updatemeter "player_obedience_bar" `$player.slave_traits.obedience / 100`>>
<</if>>
<<if def _is_molesting && _is_molesting>>
<<updatemeter "player_arousal_bar" `$player.mental_conditions.arousal / 50`>>
<<updatemeter "char_arousal_bar" `_char.mental_conditions.arousal / 50`>>
<<updatemeter "char_suspicion_bar" `_char.mental_conditions.suspicion / 50`>>
<</if>>
<<if (def _is_fucking && _is_fucking) || (def _sex_state && _sex_state.started)>>
<<updatemeter "player_arousal_bar" `$player.mental_conditions.arousal / 50`>>
<<updatemeter "char_anger_bar" `_char.mental_conditions.anger / 100`>>
<<updatemeter "char_arousal_bar" `_char.mental_conditions.arousal / 50`>>
<<updatemeter "char_discomfort_bar" `_char.mental_conditions.discomfort / 50`>>
<<updatemeter "char_stamina_bar" `_char.conditions.stamina / _char.conditions.max_stamina`>>
<<updatemeter "char_willpower_bar" `_char.slave_traits.willpower / 100`>>
<</if>>
<</nobr>><<nobr>>
<<widget "updatecommodities">>
<<set _year_start = new Date($gameDate.getFullYear(), 0, 0)>>
<<set _diff = $gameDate - _year_start>>
<<set _day = _diff / (1000 * 60 * 60 * 24)>>
<<set _sigma = $commodities[$args[0]].stable_price * $commodities[$args[0]].sigma_ratio>>
<<set _theta = Math.exp(-1 * $difficulty)>>
<<set _mu = _sigma * Math.sin(2 * Math.PI / 356 * _day + $commodities[$args[0]].mu_phase) + $commodities[$args[0]].stable_price>>
/* dmu / dt */
<<set _trend = _sigma * 2 * Math.PI / 356 * Math.cos(2 * Math.PI / 356 * _day + $commodities[$args[0]].mu_phase)>>
<<set _buy_price = setup.round2($commodities[$args[0]].price * (1 + _halfspread))>>
<<set _sell_price = setup.round2($commodities[$args[0]].price * (1 - _halfspread))>>
<<set $("#commodity_name").html(setup.titleCase($commodities[$args[0]].name))>>
<<set $("#commodity_spread").html(setup.round2(2 * _halfspread * 100) + "%")>>
<<set $("#commodity_buy_price").html("¤" + _buy_price)>>
<<set $("#commodity_sell_price").html("¤" + _sell_price)>>
<<if ($player.titles.has("trade_union_patron") || $player.titles.has("liberator") || $player.titles.has("hironaka")) && passage().substring(passage().length - 10) == "TradeUnion">>
<<set $("#commodity_stats").html(
UInv.BagHasItem("inventory", $args[0]) + "<br>" +
setup.round2($commodities[$args[0]].price) + "<br>" +
setup.round2(_sigma) + "<br>" +
setup.round2(_theta) + "<br>" +
setup.round2(_mu) + "<br>" +
setup.round2(_trend)
)>>
<<else>>
<<set $("#commodity_stats").html(
UInv.BagHasItem("inventory", $args[0]) + "<br>" +
setup.round2($commodities[$args[0]].price) + "<br>" +
setup.round2(_sigma) + "<br>" +
"---<br>" +
"---<br>" +
"---"
)>>
<</if>>
<<script>>
$("#mainLog").addClass("hidden");
$("#commodityLog").removeClass("hidden");
$("#back_button").addClass("hidden");
$("#back_to_options_button").removeClass("hidden");
$(".to_hide").addClass("hidden");
<</script>>
/* Disable buttons according to holding and money */
<<script>>
var player = State.variables.player;
var selected = State.variables.args[0];
var buy_price = State.temporary.buy_price;
var sell_price = State.temporary.sell_price;
$("#buy1 button").prop("disabled", true);
$("#buy1 button").addClass("disabled");
$("#buy5 button").prop("disabled", true);
$("#buy5 button").addClass("disabled");
$("#buy20 button").prop("disabled", true);
$("#buy20 button").addClass("disabled");
$("#buy50 button").prop("disabled", true);
$("#buy50 button").addClass("disabled");
$("#buy100 button").prop("disabled", true);
$("#buy100 button").addClass("disabled");
$("#buyall button").prop("disabled", true);
$("#buyall button").addClass("disabled");
$("#sell1 button").prop("disabled", true);
$("#sell1 button").addClass("disabled");
$("#sell5 button").prop("disabled", true);
$("#sell5 button").addClass("disabled");
$("#sell20 button").prop("disabled", true);
$("#sell20 button").addClass("disabled");
$("#sell50 button").prop("disabled", true);
$("#sell50 button").addClass("disabled");
$("#sell100 button").prop("disabled", true);
$("#sell100 button").addClass("disabled");
$("#sellall button").prop("disabled", true);
$("#sellall button").addClass("disabled");
if (player.get_money() >= buy_price) {
$("#buy1 button").prop("disabled", false);
$("#buy1 button").removeClass("disabled");
$("#buyall button").prop("disabled", false);
$("#buyall button").removeClass("disabled");
}
if (player.get_money() >= 5 * buy_price) {
$("#buy5 button").prop("disabled", false);
$("#buy5 button").removeClass("disabled");
}
if (player.get_money() >= 20 * buy_price) {
$("#buy20 button").prop("disabled", false);
$("#buy20 button").removeClass("disabled");
}
if (player.get_money() >= 50 * buy_price) {
$("#buy50 button").prop("disabled", false);
$("#buy50 button").removeClass("disabled");
}
if (player.get_money() >= 100 * buy_price) {
$("#buy100 button").prop("disabled", false);
$("#buy100 button").removeClass("disabled");
}
if (UInv.BagHasItem("inventory", selected) >= 1) {
$("#sell1 button").prop("disabled", false);
$("#sell1 button").removeClass("disabled");
$("#sellall button").prop("disabled", false);
$("#sellall button").removeClass("disabled");
}
if (UInv.BagHasItem("inventory", selected) >= 5) {
$("#sell5 button").prop("disabled", false);
$("#sell5 button").removeClass("disabled");
}
if (UInv.BagHasItem("inventory", selected) >= 20) {
$("#sell20 button").prop("disabled", false);
$("#sell20 button").removeClass("disabled");
}
if (UInv.BagHasItem("inventory", selected) >= 50) {
$("#sell50 button").prop("disabled", false);
$("#sell50 button").removeClass("disabled");
}
if (UInv.BagHasItem("inventory", selected) >= 100) {
$("#sell100 button").prop("disabled", false);
$("#sell100 button").removeClass("disabled");
}
<</script>>
<<updatetime>>
<<unset _year_start>>
<<unset _diff>>
<<unset _day>>
<<unset _sigma>>
<<unset _theta>>
<<unset _mu>>
<</widget>>
<</nobr>><<nobr>>
<<widget "updatequests">>
<<if !$quest_journal.completed.includes("life_of_a_slave")>>
<<if $player.get_status("nipon") == "low_slave">>
<<set $quests.life_of_a_slave.stage = 0>>
<<else>>
<<if $locations["niponCentral"].access>>
<<if $player.get_status("nipon") == "high_slave">>
<<run setup.remove_val($quest_journal.ongoing, "life_of_a_slave")>>
<<set $quest_journal.completed.push("life_of_a_slave")>>
<<else>>
<<set $quests.life_of_a_slave.stage = 2>>
<</if>>
<<else>>
<<set $quests.life_of_a_slave.stage = 1>>
<</if>>
<</if>>
<</if>>
<<if !$quest_journal.completed.includes("knowledge_is_power")>>
<<if $locations["shintaniHomeLibrary"].access && $quests.knowledge_is_power.stage <= 1>>
<<set $quests.knowledge_is_power.stage = 2>>
<</if>>
<</if>>
<<if !$quest_journal.completed.includes("power_struggles") && $quests.power_struggles.stage == 2>>
<<if $quest_journal.completed.includes("the_nipon_economy") && $player.get_status("shintaniHome") == "high_slave">>
<<set $quests.power_struggles.stage = 3>>
<</if>>
<</if>>
/* Makes sure to remove all completed quests from ongoing */
<<for _idx, _val range $quest_journal.completed>>
<<run setup.remove_val($quest_journal.ongoing, _val)>>
<</for>>
<</widget>>
<</nobr>><<nobr>>
/* Gives knowledge of all slaves of lower status */
<<widget "updatestatus">>
<<if $player.is_slave>>
<<set _status = setup.HEIRARCHY[$player.get_status("nipon")]>>
<<for _idx, _val range $characters.shintani_hiroyuki.slaves>>
<<if _status gt setup.HEIRARCHY[$characters[_val].status]>>
<<set $characters[_val].stats_known = true>>
<<set $characters[_val].skills_known = true>>
<</if>>
<</for>>
<</if>>
<</widget>>
<</nobr>>