<<include "Top_Navbar_Menu">>
<<hideMenu>>
<div id="container-main">
<div class="chapter-header -textcenter">
Action
</div>
<div class="passage-main">
<p>You sit at your desk, staring out of your window, contemplating your options for the year ahead. The cultivation world is full of possibilities, and you know that you must choose your path wisely. You have <span class="lime"><<live $time.current>></span> days available.</p>
</div>
<div class="container-action-1">
<div class="action-left">
<div class="action-top">
<div>
<<listen>>
<<listbox "$active.action" autoselect>>
<<optionsfrom setup.actionList>>
<</listbox>>
<<when>>
<<update>>
<<selectAction>>
<</listen>>
</div>
<div class="action-button">
<<button "1">>
<<set _day = 1>>
<<update>>
<</button>>
<<button "7">>
<<set _day = 7>>
<<update>>
<</button>>
<<button "30">>
<<set _day = 30>>
<<update>>
<</button>>
<<button "90">>
<<set _day = 90>>
<<update>>
<</button>>
<<button "180">>
<<set _day = 180>>
<<update>>
<</button>>
</div>
<div>
<<listen>>
<<textbox "_day" 0 autofocus>>
<<when 'change'>>
<<update>>
<</listen>>
</div>
<div class="action-selected-indicator">
<div>SELECTED</div>
<div>
<div>Action: <<live $active.action>></div>
<div>Duration: <<live _day>> days</div>
</div>
</div>
<div class="action-add">
<<button "Add">>
<<if (isNaN(_day))>>
<<dialog "Error">>
<p>The input is not a number.</p>
<</dialog>>
<<else>>
<<addAction>>
<</if>>
<</button>>
<<button "Remove">>
<<removeAction>>
<</button>>
</div>
<div class="action-alert">
</div>
</div>
<div id="action-bottom">
<div class="actionDescription">
<<print setup.actionLibrary[$active.action].description>>
</div>
<div>
<div>
<div>Effect:</div>
<div class="actionEffect"><<print setup.actionLibrary[$active.action].effect>></div>
</div>
<div>
<div>Cost:</div>
<div class="actionCost"><<print setup.actionLibrary[$active.action].cost>></div>
</div>
</div>
</div>
</div>
<div class="action-right">
<div class="action-right-container">
<div class="action-right-cultivation">
<div class="orange-black">CULTIVATING</div>
<div class="-center-center"><<print $active.cultivating>></div>
</div>
<div class="action-right-learn">
<div>
<div class="orange-black">LEARNING</div>
<div class="-center-center"><<print $active.learning>></div>
</div>
<div>
<div class="actionSkill-info-level">
<div>LEVEL</div>
<div><<print $skills[$active.learning].level>> / <<print $skills[$active.learning].levelMax>></div>
</div>
<div class="actionSkill-info-exp">
<div>EXP</div>
<div><<calculateTimeToLearn>></div>
</div>
</div>
</div>
<div class="action-right-meditate">
<div class="orange-black">MENTAL STATE</div>
<div class="-center-center">
<div><<mentalStateStat>></div>
<div>( <<mentalStatePrint>> )</div>
</div>
</div>
<div class="action-right-freeTime">
<div class="orange-black">MISC</div>
<div class="-center-center">
<div>Use free time for assignments: </div>
<div>
<label><<radiobutton "$freeTime" true autocheck>>Yes</label>
<label><<radiobutton "$freeTime" false autocheck>>No</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<<set _day = 0>>
<<backButtonPassage>><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Road Map
</div>
<div class="roadmap-list">
<p>Instead of an actual roadmap, this is more of a wish list of things I want to implement, improve, and polish in the game.</p>
<p>The order and other things WILL certainly change in the future, depending on the development progress, my programming/design skills, player suggestions and my own selfish preference. There might even things that weren't here, but I did it anyway, like for example, the mobile support, just because I figured out how to do it.</p>
<ul>
<span class="lime">
<li>Basic Combat and Loot System</li>
<li>Adding Basic Relationship and NPC System.</li>
<li>Improving Events System and add more events.</li>
<li>Improving the Inventory System even more.</li>
<li>Improving Player Stats + Attributes System.</li>
<li>Improving The Newly Added Skill System</li>
<li>Improving The Newly Added Quest/Assignment System.</li>
</span>
<span class="yellow">
<li>Arrogant Young Masters System?</li>
<li>Improving character creation (With background, traits and other good stuff)</li>
<li>Basic Faction and Reputation System.</li>
<li>Basic Traits System</li>
<li>Basic Status Effect System</li>
<li>Basic Adventures</li>
<li>Basic Elements</li>
<li>Early Phase Main Story, but still not sure the details.</li>
<li>Basic Locations, tribulations and dungeons.</li>
<li>Improving mobile supports.</li>
</span>
<span class="turquoise">
<li>Codex, Lores and Wiki</li>
<li>If I have NPC, I should probably have some kind of dialog system, right?</li>
<li>Basic Tutorial</li>
<li>Non-Combat Skills</li>
<li>NPC companion.</li>
<li>Cultivation style of New Game+, a.k.a Reincarnation System.</li>
<li>Crafting, Alchemy + Base building system maybe? Not sure yet.</li>
<li>Spiritual beast as a pet.</li>
<li>World Generation.</li>
<li>Remake the game in GODOT Engine</li>
</span>
</ul>
</div>
<div class="margin-vertical">
[[Back|Start]]
</div>
</div><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
<h2 class="-textcenter">Change Log</h2>
</div>
<div class="passage-main">
<h2>V.0.107</h2>
<div class="changed-log">
<div class="changed-log-categories">
<div class="changed-log-categories-header bold">Bug Fixes</div>
<div class="changed-log-categories-list">
<ul>
<li>Scrolling effect will be temporary removed because its buggy and affecting a lot of players.</li>
</ul>
</div>
</div>
</div>
<h2>V.0.106</h2>
<div class="changed-log">
<div class="changed-log-categories">
<div class="changed-log-categories-header bold">Bug Fixes</div>
<div class="changed-log-categories-list">
<ul>
<li>Fixed scrolling bug caused by v.0.104 update.</li>
<li>Fixed typos and other text related mistakes</li>
</ul>
</div>
</div>
</div>
<h2>V.0.105</h2>
<div class="changed-log">
<div class="changed-log-categories">
<div class="changed-log-categories-header bold">Bug Fixes</div>
<div class="changed-log-categories-list">
<ul>
<li>Fixed character creation error when generating the character's elements.</li>
<li>Adjusted the margin for some links specific to mobile</li>
</ul>
</div>
</div>
</div>
<h2>V.0.104</h2>
<div class="changed-log">
<div class="changed-log-categories">
<div class="changed-log-categories-header bold">Bug Fixes</div>
<div class="changed-log-categories-list">
<ul>
<li>Fixed scrolling sometimes a bit janky and stuttery for some system.</li>
<li>Added End of Content Passage because well, I really don't have a lot content yet lol. Hopefully I could add more and more in the future update</li>
<li>Fixed error when player buying specific item</li>
<li>Fixed old man NPC spawning as female instead</li>
</ul>
</div>
</div>
</div>
<h2>V.0.103</h2>
<div class="changed-log">
<div class="changed-log-categories">
<div class="changed-log-categories-header bold">Bug Fixes</div>
<div class="changed-log-categories-list">
<ul>
<li>More balancing stat gain after breakthrough, I really apologize again for this. It's gonna cause smaller number. So if you're one of those people who likes big numbers (like me), I'm really sorry. I need to do this for future updates.</li>
<li>Fixed breakthrough penalty not working properly</li>
<li>Fixed NPC generation for <em>young master</em> character caused an error</li>
<li>Alleviate the bottom margin styling problem for mobile users. Might need to think better way to solve this for mobile users.</li>
</ul>
</div>
</div>
</div>
<h2>V.0.102</h2>
<div class="changed-log">
<div class="changed-log-categories">
<div class="changed-log-categories-header bold">Bug Fixes</div>
<div class="changed-log-categories-list">
<ul>
<li>Fixed the story recognizing player as the wrong gender</li>
<li>Fixed unbalance lifespan gain that caused characters could reach to 1000 years old even as Qi Condensation. My goal is to follow old novel like Record to Mortal Journey to Immortality and have 200 years max as Foundation Establishment, so I do apologize for the change</li>
</ul>
</div>
</div>
</div>
<h2>V.0.101</h2>
<div class="changed-log">
<div class="changed-log-categories">
<div class="changed-log-categories-header bold">Bug Fixes</div>
<div class="changed-log-categories-list">
<ul>
<li>Fixed cultivation failing to progress in some situation.</li>
<li>Fixed selected action does not change its description</li>
<li>Fixed selling items caused an error</li>
<li>Lowered attribute checks on some events</li>
<li>Fixed typos from the procedurally generated text</li>
</ul>
</div>
</div>
<div class="changed-log-categories">
<div class="changed-log-categories-header bold">Improvement</div>
<div class="changed-log-categories-list">
<ul>
<li>Added two more setting for the font size. 130% and 140%</li>
</ul>
</div>
</div>
</div>
<h2>V.0.1</h2>
<div class="changed-log">
<div class="changed-log-categories">
<div class="changed-log-categories-header bold">Major Changes</div>
<div class="changed-log-categories-list">
<ul>
<li>Game title changed from Xianxia Simulator to <span class="lightgreen">Xianxia Simulator</span>.</li>
<li>Complete rewrites of the old codes into more efficient codes(yaaay me, for doing Computer Science courses).</li>
<li>Complete UI rework.</li>
<li>Added basic SUPPORT to mobile. It's not perfect, but it's a start.</li>
</ul>
</div>
</div>
<div class="changed-log-categories">
<div class="changed-log-categories-header bold">New Gameplay Elements</div>
<div class="changed-log-categories-list">
<ul>
<li>Added basic CHARACTER CREATION system.</li>
<li>Added basic QUEST system. You can now take specific quests/assignments from the sect.</li>
<li>Reworked the PLAN mechanic into ACTION.</li>
<li>Reworked the ARTS mechanic into SKILLS.</li>
<li>Added basic LEARN mechanic where you can learn skill art or train your current one and increase its level.</li>
<li>More placeholder events.</li>
<li>Added new stats and attributes to the game.</li>
<li>Testing out keyboard shortcuts.</li>
<li>Testing out dynamic text generation for some passages.</li>
</ul>
</div>
</div>
<div class="changed-log-categories">
<div class="changed-log-categories-header bold">Gameplay Mechanics</div>
<div class="changed-log-categories-list">
<ul>
<li>SAVING CAN ONLY BE DONE at the main interface, which is your room. This is mostly to avoid potential bugs.</li>
<li>Added SKIP THE PROLOGUE feature if you already did the prologue and just want a QUICK START.</li>
<li>Changed MOOD to MENTAL STATE.</li>
<li>No more RESTING mechanic. A majority of actions will recover your condition (although the effect would certainly differ).</li>
<li>NPC is now procedurally generated. It doesn't do much for now since the game still doesn't have a relationship system, but it's there, and some of you might notice it.</li>
<li><b>No more annual mental state (mood) deterioration</b>, but more events, actions, and quests/assignments will affect your mental state. Do pay attention to that. You also start at a middling mental state, not at the max. Good luck.</li>
<li>Failed breakthroughs have <b>consequences</b>, some of which could be <b>fatal</b>. Make sure you're in the best condition to do it and try to increase your breakthrough chance.</li>
<li>Add more items and improve the "items/inventory" system mechanic.</li>
<li>Added basic "character appearance" at the moment, only for flavors.</li>
<li>Rearranged the flow of the game.</li>
</ul>
</div>
</div>
<div class="changed-log-categories">
<div class="changed-log-categories-header bold">Development Logs and Player Interaction</div>
<div class="changed-log-categories-list">
<ul>
<li>Added a link for bug reports that will open up a Google form in a new window. You don't have to do the fields you don't want to fill, except for your name. Which can be anything, but it's still best if you write down your itch username.</li>
<li>Added a more obvious link for Ko-fi donations for my own benefit. While I do have a Patreon, I prefer Ko-fi, they're just nicer in general and it allows people to make one-time donations.</li>
<li>Fixed more typos and errors.</li>
<li> More story rewrites and editing.</li>
</ul>
</div>
</div>
</div>
<div>
<<message 'older logs' btn>>
<div>
<<message 'V.0.0.601' btn>>
<div>V.0.0.601</div>
<ul>
<li>added font setting in the setting menu</li>
<li>added more placeholder events</li>
<li>added new logo to the welcome page</li>
<li>fixed typos and errors</li>
</ul>
<</message>>
</div>
<div>
<<message 'V.0.0.6' btn>>
<div>V.0.0.6</div>
<ul>
<li><b>added the basic sect + shop system</b></li>
<li><b>added the schedule/plan system, removed the focus mechanic</b></li>
<li><b>added the basic arts/skills system to prepare for future combat system</b></li>
<li><b>improved inventory and item system</b></li>
<li>changed the previous //narrative style// yearly reports to the simpler event logs</li>
<li>more improvement to the UI</li>
<li>added more placeholder events</li>
<li>added more bad endings (sorry everyone)</li>
<li>more rewrites to fit for future story and lores, expect even more rewrite in the future</li>
<li>updated some of the events to mesh with the updated system</li>
<li>fixed more typos and errors</li>
<li>more under the hood stuff</li>
</ul>
<</message>>
</div>
<div>
<<message 'V.0.0.510' btn>>
<div>V.0.0.510</div>
<ul>
<li>some changes to the inventory page</li>
<li>edited some part of the prologue to fit future story</li>
<li>added more placeholder scenes</li>
<li>added some scheduled scenes for lores</li>
<li>fixed several typos and errors</li>
</ul>
<</message>>
</div>
<div>
<<message 'V.0.0.501' btn>>
<div>V.0.0.501</div>
<ul>
<li>fixed some typos, error, and one game breaking bug</li>
</ul>
<</message>>
</div>
<div>
<<message 'V.0.0.5' btn>>
<div>V.0.0.5</div>
<ul>
<li><b>added the basic breakthrough/level system</b></li>
<li><b>improved the basic stats system and added basic stats page</b></li>
<li><b>added some quality of life features such as notification system</b></li>
<li><b>improved the UI</b></li>
<li>added more placeholder scenes and updated the current one so they interact with the stats</li>
<li>added share button for my own benefit</li>
<li>fixed pronouns not registering</li>
<li>fixed several typos and errors</li>
</ul>
<</message>>
</div>
<div>
<<message 'V.0.0.402' btn>>
<div>V.0.0.402</div>
<ul>
<li>fixed several typos and errors</li>
<li>added one placeholder event</li>
</ul>
<</message>>
</div>
<div>
<<message 'V.0.0.4' btn>>
<div>V.0.0.4</div>
<ul>
<li><b>added the basic inventory system</b></li>
<li>added more placeholder events</li>
<li>some changes to the UI</li>
<li>fixed several typos and errors</li>
</ul>
<</message>>
</div>
<div>
<<message 'V.0.0.302' btn>>
<div>V.0.0.302</div>
<ul>
<li>fixed errors</li>
</ul>
<</message>>
</div>
<div>
<<message 'V.0.0.3' btn>>
<div>V.0.0.3</div>
<ul>
<li><b>added the basic system for random NPC generation</b></li>
<li><b>added the basic system for events</b></li>
<li>added some placeholder events</li>
<li>expanded the consequences of the gender option</li>
<li>some changes to the UI</li>
<li>fixed several typos and errors</li>
</ul>
<</message>>
</div>
<div>
<<message 'V.0.0.2' btn>>
<div>V.0.0.2</div>
<ul>
<li><b>added gender option</b></li>
<li>some changes to the UI</li>
<li>added more placeholders</li>
<li>fixed several typos and errors</li>
<li>fixed some of the writing</li>
</ul>
<</message>>
</div>
<div>
<<message 'V.0.0.1' btn>>
<div>V.0.0.1</div>
<p>First release of the game</p>
<</message>>
</div>
<</message>>
</div>
</div>
<div class="margin-vertical">
[[Back|Start]]
</div>
</div><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
<h1 class="-textcenter">About</h1>
</div>
<div class="passage-main">
<p>Hello fellow daoist, <strong>Captain Wabbit</strong> here, </p>
<p>I'm the lone creator and developer of <strong>Xianxia Simulator</strong>, a text-based life simulation Xianxia RPG. Nice to meet you all.</p>
<p>A quick background about me: I am a regular guy who works full-time on weekdays and while also doing part-time on weekends. I have been a fan of the chinese immortal cultivation genre for a long time. I started with wuxia genre, such as Jinyoung and Gu Long novels, and eventually read tons of other genre and sub-genre related to it. I also love RPG games and text-based games because they're like reading a story come to life. I appreciate how they can take you away from everything that troubles you, into a new world, and heal you.</p>
<p>So, in one particular day on 2022, I had this idea to make a game and I just knew I had to do it.</p>
<p>I'm not a programmer, I know nothing about writing stories and English is not even my first language. That's why I'm gonna start from the very bottom. By learning as I go along with the development. Hopefully, with hard work and support from everyone, I would grow and be able to do this daunting task.</p>
<p>Just a heads up, I'm doing this for fun and because I love it, not because I have a ton of free time. So please, be patient with me. This is going to be a long journey. There are just so many things I wanna put into the game, with so little time. My guess is, that it's gonna take years before we reach that finished v.1.0 version of the game. But, that's okay! Think of it like a marathon, where I'm constantly adding new features and updating as I go.</p>
<p>And if you want to support me, there's an obvious kofi link in the welcome page and support link on the topbar. While I do have a patreon, <strong>Ko-fi</strong> is better because it allows you to just tip, access the supporter only content and support me for a one time donation.</p>
<p>Well anyway, let's see what we can create together. I'll see you around!</p>
<p><em>Sincerely, Captain Wabbit</em></p>
</div>
<div class="margin-vertical">
[[Back|Start]]
</div>
</div><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
<h1 class="-textcenter">Credits</h1>
</div>
<div class="passage-main">
<h3>Credits to:</h3>
<ul>
<li>
<a href="https://game-icons.net/1x1/delapouite/yin-yang.html" target="_blank">Yin yang icon</a>,
<a href="https://game-icons.net/1x1/delapouite/ring.html" target="_blank">Ring icon</a>,
<a href="https://game-icons.net/1x1/delapouite/walk.html" target="_blank">Walk icon</a> and
<a href="https://game-icons.net/1x1/delapouite/character.html" target="_blank">Character icon</a> by
<a href="https://delapouite.com/" target="_blank">Delapouite</a> is licensed under
<a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>
</li>
<li>
<a href="https://game-icons.net/1x1/guard13007/play-button.html" target="_blank">Play button icon</a> by
<a href="https://guard13007.com/" target="_blank">Guard13007</a> is licensed under
<a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>
</li>
<li>
<a href="https://game-icons.net/1x1/skoll/hearts.html" target="_blank">Hearts icon</a> by
<a href="https://game-icons.net/" target="_blank">Skoll</a> is licensed under
<a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>
</li>
<li>
<a href="https://game-icons.net/1x1/lorc/brain.html" target="_blank">Brain icon</a>,
<a href="https://game-icons.net/1x1/lorc/scroll-unfurled.html" target="_blank">Scroll unfurled icon</a>,
<a href="https://game-icons.net/1x1/lorc/return-arrow.html" target="_blank">Return arrow icon</a> and
<a href="https://game-icons.net/1x1/lorc/meditation.html" target="_blank">Meditation icon</a> by
<a href="https://lorcblog.blogspot.com/" target="_blank">Lorc</a> is licensed under
<a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>
</li>
</ul>
<h3>Special thanks to:</h3>
<ul>
<li>Professor David J Malan of Harvard CS50 for his amazing teaching</li>
<li>The supporters and followers with their support and kindness</li>
<li>My family who don't really understand of what the heck I'm doing but still very supportive of me</li>
<li>The kind people at twine discord</li>
<li>And my late grandmother who told me to start doing things that would make me happy. I miss you grandma. I'm sorry for being such a bad grandson who rarely visit and never said I love you. I should've would've could've... I love you grandma</li>
</ul>
</div>
<div class="margin-vertical">
[[Back|Start]]
</div>
</div><<if ($breakthrough.step === 0)>>
<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Breakthrough
</div>
<div class="passage-main">
<p>It's <<timeRNG>> <<seasonTimeRNG>> <<seasonRNG>>. You're now <<print $player.age>> years old and it's been <<print $year>> years since you arrived here. </p>
<p>First, you assess your physical condition and sense you're in <<healthUI>> at the moment.</p>
<p>Next, you tune in to your Qi, and start circulating it. You can feel that you have <<qiUI>> qi.</p>
<p>Lastly, you examine your own mental state. You heard that a focused mind is essential for any breakthrough. Your mental condition is at <<mentalStateUI>> state.</p>
<p>After sensing that you have a <span class="yellow"><<breakthroughChanceIndicator>></span> chance at breakingthrough, it is now the time for a decision. Should you attempt the breakthrough now, or should you wait?</p>
<p>You need to be careful about this. A failed breakthrough might affect your future cultivation, and for some people, it might even be <b class="flame">fatal</b>. You can always keep cultivating to stabilize your cultivation base and increase your chance. Or you can find pills, herbs, treasures, insights, and other things to help with the breakthrough and help you recover from injuries.</p>
</div>
<div class="margin-vertical -textcenter">
<div>
<<link "Breakthrough now!">>
<<set $breakthrough.step += 1>>
<<breakthroughCheck>>
<<generateRandomStatChange>>
<</link>>
</div>
<div>
<<link "Delay for another year">>
<<goto "reports">>
<</link>>
</div>
<div>
<<link "Delay for 5 more years">>
<<set $breakthrough.delay += 5>>
<<goto "reports">>
<</link>>
</div>
</div>
</div>
<</if>>
<<if (($breakthrough.step === 1) && !($breakthrough.isSuccess))>>
<<include "Top_Navbar_Menu">>
<<breakthroughFail>>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Breakthrough Failed
</div>
<div class="passage-main">
<p>You start with circulating your qi and channeling the spiritual energy throughout your body. Just like when you usually cultivate with <<print $active.cultivating>> almost everyday. After few hours of doing that, your start to lose control of your qi.</p>
<p>Frantically, you attempt to regain control, but your qi surge uncontrollably. Your vision blurs while an overwhelming surge of chaotic qi runs through your meridians, threatening to rupture them. You fight to stabilize the torrent, but the harder you struggle, the more chaotic it becomes.</p>
<p>Beads of sweat pour from your forehead, the pain now wracking your entire $player.weight body.</p>
<p><<failedBreakthrough>></p>
<p>Then, you open your eyes and blood spills from your mouth as your <<charmIndicator>> grow pale. Even your <<print $player.hair>> hair is wet. Ignoring the pain that throbs through your chest, you try to regain control of the wild qi that courses through your body. It's already <<timeRNG>> now, but you manage to stabilize your cultivation base.</p>
<p>Your health is now at <<healthUI>> while your qi is at <<qiUI>> state at the moment.</p>
</div>
<div class="margin-vertical -textcenter">
<<link "Continue" "reports">>
<</link>>
</div>
</div>
<</if>>
<<if (($breakthrough.step === 1) && ($breakthrough.isSuccess))>>
<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Breakthrough Success
</div>
<<breakthroughSuccess>>
<div class="passage-main">
<p>You start with circulating your qi and channeling the spiritual energy throughout your body. Just like when you usually cultivate with <<print $active.cultivating>> almost everyday.</p>
<p><<randomizeBreakthrough>></p>
<p>As the impurities are being expelled, a wave of relief washed over you. Your <<qiStrand>> within your dantian seemed to resonate with newfound <<CultivationStage>> cultivation. You continued to channel your qi, guiding it along the meridians. Your <<charmIndicator>> face made a frown after you realize how your dirty clothes is.</p>
<p>"I really need a shower."</p>
</div>
<div class="margin-vertical -textcenter">
<<link "Success!" "reports">>
<</link>>
</div>
</div>
<</if>>
/* <<if ($breakthrough.step === 0)>>
<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Breakthrough
</div>
<div class="passage-main">
<p>You're sitting inside of your room alone. You close your eyes and try to focus. You can feel that you have reach the peak of <<CultivationStage>> cultivation.</p>
<p>First, you assess your physical condition and sense you're in <<healthStat>> at the moment.</p>
<p>Next, you tune in to your Qi, and start circulating it. You can feel that you have <<qiStat>> qi.</p>
<p>Lastly, you examine your own mental state. You heard that a focused mind is essential for any breakthrough. Your mental condition is at <<mentalStateStat>> state.</p>
<p>You calm your mind as you contemplate. These three aspects would affect the chance of success of your breakthrough among other things. It might be best to make sure all three of them are in optimal condition.</p>
<p>But, it is time for a decision. You ask yourself this very question: Should you attempt the breakthrough now, or should you wait for another year?</p>
<p>While it's true you could attempt it now, you realize that might be wiser to just wait and prepare a bit more. You consider the possibilities of maybe, increase your understanding of your current internal skill, acquire pills or formations that could help your chance of breakingthrough, seek advice from other cultivators, or maybe, increasing the limit of your current physical, qi, divine sense and other things.</p>
</div>
<div class="margin-vertical -textcenter">
<div>
<<link "Breakthrough now!">>
<<set $breakthrough.step += 1>>
<<breakthroughCheck>>
<</link>>
</div>
<div>
<<link "Delay for another year">>
<<goto "reports">>
<</link>>
</div>
</div>
</div>
<<elseif (($breakthrough.step === 1) && !($breakthrough.isSuccess))>>
<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Breakthrough Failed
</div>
<div class="passage-main">
<p>With this decision, you then take a deep breath as you gather your resolve and begin the process of a breakthrough.</p>
<p>You start with circulating your qi and channeling the spiritual energy throughout your body. Just like when you usually cultivate with <<print $active.cultivating>> almost everyday. After few hours of doing that, you catch a glimpse of the barrier that stop you from climbing even higher with your cultivation.</p>
<p>Yet today, is gonna be different. Ignoring your nervousness you then push forward. An obstruction disrupts the flow of energy, the impurities that had been inside you, accumulating since you were born. Suddenly, you become off balance. The intricate web of qi you carefully wove starts to unravel, and panic grips your heart.</p>
<p>Frantically, you attempt to regain control, but your qi surge uncontrollably. Your vision blurs while an overwhelming surge of chaotic qi runs through your meridians, threatening to rupture them. You fight to stabilize the torrent, but the harder you struggle, the more chaotic it becomes.</p>
<p>Beads of sweat pour from your forehead, the pain now wracking your entire <<$player.weight>> body.</p>
<p>As the tumultuous energies peak, a deafening explosion shatters the silence, throwing you backward. You collapse to your knees, physically and emotionally drained.</p>
<p>Then, you open your eyes and blood spills from your mouth as your <<charmIndicator>> grow pale. Even your <<print $player.hair>> hair is wet. Ignoring the pain that throbs through your chest, you try to regain control of the wild qi that courses through your body. It's already <<timeRNG>> now, but you manage to recover.</p>
<p>You let out a sigh, disappointment heavy in your heart. You are injured and your spirits are low.</p>
<p>You have failed in your breakthrough.</p>
</div>
<<breakthroughFail>>
<div class="margin-vertical -textcenter">
<<link "Continue" "main">>
<</link>>
</div>
</div>
<<elseif (($breakthrough.step === 1) && ($breakthrough.isSuccess) && ($player.level === 1))>>
<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Breakthrough Success
</div>
<div class="passage-main">
<p>With this decision, you then take a deep breath as you gather your resolve and begin the process of a breakthrough. The time had come to break through the 1st Qi Condensation stage and advance to the 2nd level of cultivation.</p>
<p>You delve deep into your dantian, seeking the core of your cultivation. Your qi starts to swirl, carrying the burden of impurities that hindered your progress.</p>
<p>Then you begin to use <<print $active.cultivating>> while trying hard to stay calm. The energy surged through your meridians, and a tingling sensation swept across your skin. Slowly, the impurities emerged, oozing from your pores like black beads, carrying with them the heaviness of your past limitations.</p>
<p>As the impurities are being expelled, a wave of relief washed over you. Your spiritual energy within your dantian seemed to resonate with newfound clarity. You continued to channel your qi, guiding it along the meridians. You continue to purge the impurities, and a faint, lingering smell wafted through the air, evidence of your body's purification.</p>
<p>After eight hours or so, you feel tired and at the same time, vigorous. It's hard to describe the feeling. And the tiny strand of qi that is inside your body seems to grow even thicker now. With a strange feeling, you open your eyes.</p>
<p> "Is this, the Second Stage of Qi Condensation?"</p>
<p>With that, you then cast your spiritual sense into your body and examine everything. Sure enough, you're now at <<CultivationStage>> stage. You smile at the happy realization and start to laugh out loud until suddenly, you smell something. What is that smell?</p>
<p>You finally notice the disgusting sticky filth covering your body and the awful body odour. You heard something like this would happen. The breakthrough would basically push out the impurities from your <<print $player.weight>> body. Which, you assume, is a good thing. But still...</p>
<p>"I really need a shower."</p>
</div>
<<breakthroughSuccess>>
<div class="margin-vertical -textcenter">
<<link "Success!" "main">>
<</link>>
</div>
</div>
<<elseif (($breakthrough.step === 1) && ($breakthrough.isSuccess) && ($player.level === 2))>>
<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Breakthrough Success
</div>
<div class="passage-main">
<p>For hours on end, you sit cross-legged, circulating your cultivation base. And then, as it had all those years ago when you broke through to the second stage, something begins to pour out of your pores. This time, a glob of filth starts to pour out of your pores and stinks out your surroundings. But you are too deep in your cultivation to be bothered by it.</p>
<p>You focus on the strands of qi that are growing thicker and more pronounced like a stream rushing through your body. Pain begins to build in your dantian, but you push through it, knowing that this is the price of being a cultivator.</p>
<p>When you finally open your eyes, six hours have passed. Your eyes shine with a sharp, sword-like brilliance, and you can feel the power coursing through your body. You send your spiritual sense inside and are thrilled to find that your spiritual energy is now circulating freely throughout your body.</p>
<p>You stand, ignoring the stench that fills the room, and raise your fist in triumph. You have done it. You have broken through to the <<CultivationStage>> stage.</p>
<p>Your cultivation breakthrough is successful!</p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
</div>
<<breakthroughSuccess>>
<div class="margin-vertical -textcenter">
<<link "Success!" "main">>
<</link>>
</div>
</div>
<<elseif (($breakthrough.step === 1) && ($breakthrough.isSuccess) && ($player.level === 3))>>
<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Breakthrough Success
</div>
<div class="passage-main">
<p>You sit in deep meditation, isolated from the outside world. Your cultivation base is your sole focus. Unearthly impurities once again, seep from your very pores, polluting the air with a vile stench. But you try to remain resolute, undistracted.</p>
<p>You channel your qi into the torrents of Qi within, the essence of your being becoming a tempest. Pain surges from your dantian. Nevertheless, you endure. Unwavering, determined to claim your ascendancy.</p>
<p>As you finally open your eyes, you've traversed a temporal abyss of six hours. Your gaze shines with the incisiveness of a blade, an unmistakable power coursing through your veins. You probe your inner senses and discover the unbridled flow of spiritual energy, coursing through your being, granting you an entirely new perspective.</p>
<p>Rising to your feet, the pervasive stench is inconsequential. With a triumphant gesture, your clenched fist punctuates your success. The 4th Stage of Qi Condensation has been attained.</p>
<p>Your cultivation breakthrough is a testament to your unyielding determination!</p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
</div>
<<breakthroughSuccess>>
<div class="margin-vertical -textcenter">
<<link "Success!" "main">>
<</link>>
</div>
</div>
<</if>> */<<include "Top_Navbar_Menu">>
<<hideMenu>>
<div id="container-main">
<div class="chapter-header -textcenter">
PROFILE
</div>
<div class="container-character-1">
<div class="character-top">
<div class="character-personal-info">
<div class="character-title-header">Personal</div>
<div>
<div>Name</div>
<div><<playerFullName>></div>
</div>
<div>
<div>Age</div>
<div>$player.age Years Old</div>
</div>
<div>
<div>Gender</div>
<div>$player.gender</div>
</div>
<div>
<div>Race</div>
<div>$player.race</div>
</div>
<div>
<div>Rank</div>
<div>$faction.rank</div>
</div>
<div>
<div>Elements</div>
<div>$player.element</div>
</div>
</div>
<div class="character-core-attributes">
<div class="character-title-header">Core</div>
<div>
<div>Body</div>
<div>
<<bodyIndicator>>
</div>
</div>
<div>
<div>Comprehension</div>
<div>
<<comprehensionIndicator>>
</div>
</div>
<div>
<div>Psyche</div>
<div>
<<psycheIndicator>>
</div>
</div>
<div>
<div>Charm</div>
<div>
<<charmIndicator>>
</div>
</div>
<div>
<div>Spiritual Roots</div>
<div><<print setup.text.rootsLevel[$player.talent]>></div>
</div>
</div>
<div class="character-basic-attributes">
<div class="character-title-header">basic</div>
<div>
<div>Physical</div>
<div>
<<healthPrint>>
</div>
</div>
<div>
<div>Qi</div>
<div>
<<qiPrint>>
</div>
</div>
<div>
<div>Mental State</div>
<div>
<<mentalStatePrint>>
</div>
</div>
<div>
<div>Speed</div>
<div>
<<speedPrint>>
</div>
</div>
<div>
<div>Divine Sense</div>
<div>
<<sensePrint>>
</div>
</div>
</div>
</div>
<div class="character-middle">
<div class="character-middle-cultivation">
<div class="character-title-header">Cultivation</div>
<div class="character-cultivation-stage"><<CultivationStage>></div>
<div class="character-middle-breakthrough">
<div>Breakthrough Chance</div>
<div>
<<breakthroughChanceIndicator>>
</div>
</div>
<div class="character-middle-breakthrough">
<div>Internal Art</div>
<div>
<<print $active.cultivating>>
</div>
</div>
</div>
</div>
<div class="character-bottom">
<div class="character-bottom-description">
<div class="character-title-header">description</div>
<div>
<p>You have a $player.hair hair. You're $player.height and $player.weight with a $player.skin skin. In general, people think you have a <<charmIndicator>> face.</p>
<p>Considering your cultivation talent, you have <<playerRoots>> roots which is known as $player.potential talent. Your elements <<pluralElement>> <<=$player.element>> which <<pluralElement>> the qi you have to cultivate to progress in your cultivation.</p>
</div>
</div>
</div>
</div>
</div>
<<backButtonPassage>><<include "Top_Navbar_Menu">>
<div id="container-main">
<div class="chapter-header -textcenter">
Cheat
</div>
<div class="passage-main">
<p>For Testing Purposes Only</p>
</div>
<div class="margin-top-1rem -textcenter">
<<button "Add 500 to points">>
<<set $faction.contributionPoints += 500>>
<</button>>
<<button "Add Waterfall Event">>
<<run $player.event.push("waterfall")>>
<</button>>
<<button "Turn off rent">>
<<set $faction.rent = 0>>
<</button>>
</div>
</div>
<<backButtonPassage>><<include "Top_Navbar_Menu">>
<<if ($stats.playerHealth.current <= 0)>>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Death is here… - Year $year
</div>
<div class="passage-main">
<p><<randomizeGameOverFromInjuriesOpening>></p>
<p>You try to push yourself up, to rise from the ground, but your body protests. It urges you to lay down, to rest, to give in to the fatigue that weighs upon you like a heavy cloak. But how did you get here? Why are you being punished? You cannot remember, your mind is foggy and unclear.</p>
<p>You can feel yourself slipping away, fading into the darkness. Your entire body aches, a symphony of pain. The end is near, you can see it now. Your injuries are beyond saving, beyond the point of no return.</p>
<p>Your eyes grow heavy, the world around you blurs. You are exhausted, utterly spent.</p>
<p>And so, you surrender to your fate. This is the end for you.</p>
<h3 class="darkred -textcenter">//You have died at $player.age years old.//</h3>
</div>
<div class="margin-top-1rem -textcenter">
<h2>GAME OVER</h2>
</div>
</div>
<</if>>
<<if $stats.playerMentalState.current <= 0>>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Death is here… - Year $year
</div>
<div class="passage-main">
<p>Because of the awful condition of your mental state, your inner demon finally takes over when you're in the middle of cultivating.</p>
<p>You try to fight it, but your qi deviates and causes a backlash that paralyzes your body.</p>
<p>You never thought it would end like this, dying while your mind is getting attacked by all of the horrible thoughts and emotions from your inner demons. You can see every death and every painful moment that happened in your life.</p>
<p>You're tired, so tired. You just want to close your eyes and get it over with. You feel weak and powerless, as your qi spins wildly inside your body.</p>
<p>Soon it'll all be over. Soon you'll feel nothing forever.</p>
<p>Then, as tears fall down your face, you take your final breath.</p>
<h3 class="darkred -textcenter">
//You have died at $player.age years old.//
</h3>
</div>
<div class="margin-top-1rem -textcenter">
<h2>GAME OVER</h2>
</div>
</div>
<</if>>
<<if $player.age > $player.lifespan>>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Death is here… - Year $year
</div>
<div class="passage-main">
<p>You lie in your bed, your body growing weaker with each passing moment. The end of your lifespan is near, and with it comes a sense of regret. You never found a way back to Earth, never saw your family again. The truth of this world eluded you until the end.</p>
<p>Your eyes flutter shut, your breath growing shallow. You can no longer move, your mouth unable to form words. And then, as you take one final, gasping breath, everything goes silent.</p>
<p>"Goodbye, cruel world," you whisper, and the darkness takes you.</p>
<p>Then, everything goes quiet as you take your very last breath.</p>
<h3 class="darkred -textcenter">//You have died at $player.age years old.//</h3>
</div>
<div class="margin-top-1rem -textcenter">
<h2>GAME OVER</h2>
</div>
</div>
<</if>>
<<if $faction.contributionPoints < 0 && ((!($disciplinaryCountdown)) || ($disciplinaryCountdown === ($year - 3)))>>
<div id="container-prologue">
<div class="chapter-header -textcenter">
</div>
<div class="passage-main">
</div>
<div class="margin-top-1rem -textcenter">
</div>
</div>
<<first>>
<<set $disciplinaryCountdown = clone($year)>>
<<generateNPC>>
<<npcObjectCollection>>
<<set $active.NPC.role = "disciplinary elder">>
<<set $faction.contributionPoints -= 4>>
<<changeAlert "contributionPoints" -4>>
<<done>>
<<replace ".chapter-header">>
Disciplinary Action - Year $year
<</replace>>
<<replace ".passage-main">>
<p>You quickly rush toward the Outer Sect Main Hall. Some of your fellow disciples stare at you, as you ran past them, but you choose to ignore them.</p>
<p>When you get there, you turn to the right without delay and after walking straight through the hall, you finally find the place you're looking for. The two Outer Sect disciples guarding the hall instantly notice you.</p>
<p>"Are you<<playerFullName>>?" One of the disciples steps forward to stop you.</p>
<p>"Yes."</p>
<p>"The elder is waiting for you. You can enter."</p>
<p>You nod politely at them before you walk inside the room.</p>
<p>This is the Outer Sect Disciplinary Hall. The most dreaded place for a normal disciple like you. A wide worn statue in a gloomy space marks the entrance to the hall. Beyond the worn statue lies a bluish stone chair facing a black throne made of wood with an ancient pattern.</p>
<p>Next to the statues, you can see the elder facing the window, as <<his>> hand fiddles with some kind of beast skull. You heard tales about elder <<npcFullName>>. About <<his>> stern and unforgiving character. And also about <<his>> high-level Foundation Establishment cultivation that manages to oppress you, even just by being near <<him>>.</p>
<p>Suddenly <<he>> let out a cold snort.</p>
<p>"What an impolite youngster!"</p>
<p>Realizing that you haven't even said your greeting yet, you quickly kneel on the floor.</p>
<p>"This humble disciple <<playerFullName>> greets elder <<npcLastName>>. May you have a long and happy life!"</p>
<p>The elder stares at you for a while but doesn't say anything for a while. You decide to keep quiet.</p>
<p>Then finally, a minute or two has passed.</p>
<p>"Do you know why you're here?"</p>
<p>"Yes, elder."</p>
<p>"Good. Your contribution is lacking. And here in Pure Valley Sect, we don't tolerate lazy people."</p>
<p>"I humbly apologize, elder <<npcLastName>>. I promise this won't happen again."</p>
<p>"There will be no second time." He says as he stands in front of you, staring at you from above. "Raise your head."</p>
<p>You follow <<his>> instruction and raise your head.</p>
<p>"Next time we meet in this place, I will take your life."</p>
<p>"Y-yes elder." You can even hear the trembling in your voice.</p>
<p>"Your punishment is to pay a 4 contribution points fine. It will be due in 3 years." <<He>> walks away from you and back to <<his>> previous spot in front of the window. "Now go. Work hard to pay the fine if you don't want to see me again."</p>
<</replace>>
<<replace ".margin-top-1rem">>
<<link "Continue">>
<<normalGameLoop>>
<</link>>
<</replace>>
<</done>>
<<finally>>
<<findNPC "role" "disciplinary elder">>
<<unset $disciplinaryCountdown>>
<<done>>
<<replace ".chapter-header">>
Escape! - Year $year
<</replace>>
<<replace ".passage-main">>
<p>It's the middle of the night, and you're running away from the sect. You stupidly failed to fulfil your obligation to the sect. And you remember what elder <<npcLastName>> said about crippling your cultivation.</p>
<p>You don't want <<him>> to do that. You'd rather run away and try your luck out there. You still need to find out how to go back to Earth. You need your cultivation.</p>
<p>But suddenly, you stop running. There's something in the cold air of this eerie night. Then you can hear a whooshing sound from behind.</p>
<p>"You dare!"</p>
<p>There <<he>> is. Elder <<npcFullName>> is flying toward you with <<his>> usual stern expression.</p>
<p>"Nooo!" You wail pathetically.</p>
<p><<He>> swipes <<his>> finger, and a green light flashes.</p>
<p>PANG!</p>
<p>Something stabs your chest, and it goes through your heart. You don't even feel any pain.</p>
<p>But...</p>
<p>Everything feels so heavy. Your entire body is trying to force you to the ground, to lay down and close your eyes, but you can't. You can't give in, not yet. You can still make it. You just need some rest.</p>
<p>Maybe you can lay down for a little while?</p>
<p>But try not to close your eyes. Do not close your eyes.</p>
<p>Then everything goes dark as you close your eyes and take your very last breath.</p>
<h3 class="darkred -textcenter">//You have died at $player.age years old.//</h3>
<</replace>>
<<replace ".margin-top-1rem">>
<h2>GAME OVER</h2>
<</replace>>
<</done>>
<</first>>
<</if>><<include "Top_Navbar_Menu">>
<div id="container-main">
<div class="chapter-header -textcenter">
Inventory
</div>
<div class="passage-left">
<p>You put your spiritual sense into the storage ring. Revealing the space inside the storage ring:</p>
</div>
<div class="container-inventory-1">
<div class="inventory-list">
<div class="inventory-list-tabs">
<<listen>>
<<radiobutton "$active.itemType" "pill" checked>>
<label for="radiobutton-activeinventorytype-0" checked="checked">Pill</label>
<<radiobutton "$active.itemType" "manual">>
<label for="radiobutton-activeinventorytype-1">Manual</label>
<<radiobutton "$active.itemType" "weapon">>
<label for="radiobutton-activeinventorytype-2">Weapon</label>
<<radiobutton "$active.itemType" "Misc">>
<label for="radiobutton-activeinventorytype-3">Misc</label>
<<when>>
<<replace ".inventory-list-content">>
<<populateInventory>>
<</replace>>
<</listen>>
</div>
<div class="inventory-list-content">
<<populateInventory>>
</div>
</div>
</div>
</div>
<<backButtonPassage>><<include "Top_Navbar_Menu">>
<div id="container-main">
<div class="chapter-header -textcenter">
<<= "Home - Year " + $year>>
</div>
<div class="passage-main">
<<currencyIndicator>>
<<first>>
<p>You enter your room in the third floor of the dormitory of the Pure Valley Sect. The room is small and simple. The walls are adorned with faded tapestries depicting the sect's emblem—a serene valley surrounded by majestic mountains.</p>
<p>An old pair of wooden chair and desk sat at the corner of the room, its surface filled with marks from the previous occupant of the room. Not far from the desk, you can see a modest straw bed, a place for you to rest and meditate. It looks old, crumpled with obvious signs of wear.</p>
<p>A small bookshelf stands against the wall, holding a few worn volumes containing some mundane books from the mortal realm and sect rules. A set of spare robes, which was probably a hand down from the previous occupant, hang on the wall.</p>
<p>Outside the window, you can see glimpses of one of the sect's training grounds, bustling with fellow disciples. Their distant laughter and the occasional sound of clashing weapons fill the air.</p>
<p>You observe your surrounding for a little while before you sit down cross-legged on the bed and start circulating your <<CultivationStage>> cultivation.</p>
<<finally>>
<p>You're back in your room in the third floor of the dormitory of the Pure Valley Sect.
<p><<randomizeEnteringYourRoom>></p>
<p><<randomizeBookshelf>></p>
<p><<randomizeViewOutsideWindow>></p>
<p><<randomizeRoomSituation>> You then start circulating your <<CultivationStage>> and meditate.</p>
<</first>>
</div>
<div class="margin-top-1rem -textcenter">
</div>
</div>
<<run $(".img-play-button").attr("src", "assets/img/play-button.svg")>>
<<statLimit>>
<<set $nextButton to "END YEAR">>
<<set $nextPassage = "event">>
<<include "Menu_Button">>
<<changeEndButton>><<if $event.eventPassageVisitCounter !== 0>>
<<set $event.eventPassageVisitCounter += 1>>
<<else>>
<<set _canOnlyGetFromQuestRoll = random(0, 100)>>
<<if _canOnlyGetFromQuestRoll > 70>>
<<set _shuffledQuest = clone($player.quest)>>
<<run _shuffledQuest.shuffle()>>
<<for _i = 0; _i < $player.quest.length; _i++>>
<<if (setup.questLibrary[_shuffledQuest[_i]].event !== "")>>
<<run $player.event.push(setup.questLibrary[_shuffledQuest[_i]].event)>>
<<break>>
<</if>>
<</for>>
<</if>>
<<set $event.eventPassageVisitCounter += 1>>
<</if>>
<<if ($mainStory.length !== 0)>>
<<goto "mainStory">>
<<elseif ($player.event.length !== 0)>>
<<set $active.event = $player.event[0]>>
<<generateDiceTen>>
<<generateDiceSeven>>
<<generateDiceThree>>
<<goto "scenes">>
<<else>>
<<goto "processing">>
<</if>><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
<<= setup.eventLibrary[$active.event].header + " - Year " + $year>>
</div>
<div class="passage-main">
<<include setup.eventLibrary[$active.event].passage>>
</div>
<div class="margin-top-1rem -textcenter scene-links">
</div>
</div>
<<set $nextButton = "CONTINUE">>
<<include "Menu_Button">>
<<consumeScenes>><<set $event.eventPassageVisitCounter = 0>>
<<cultivationGain>>
<<potentialGain>>
<<cultivationCurrent>>
<<setupVariable>>
<<useFreeTime>>
<<gameloopProgress>>
<<if $player.age > $player.lifespan ||
$stats.playerHealth.current <= 0 ||
$stats.playerMentalState.current <= 0 ||
$faction.contributionPoints < -2 && ((!($disciplinaryCountdown)) || ($disciplinaryCountdown <= ($year - 3)))
>>
<<goto "gameOver">>
<<else>>
<<normalGameLoop>>
<</if>><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
End of Content - Year $year
</div>
<div class="passage-main">
<p>Greetings, fellow Daoist,</p>
<p>You have reached the end of content for this version of Xianxia Simulator at <<CultivationStage>> and $player.age years old. I want to thank you for playing this mess of a game made by an amateurish game dev like me.</p>
<p>If you have any bug report, suggestion, or something else, you can join the <a href="https://discord.gg/xAKMJNAvtj" target="_blank">discord</a> and fill out the bug reports/suggestions form there. I really appreciate any feedback. It would help me in making this game better in the future. Just please be nice and polite. Remember I'm not an actual game dev. I'm still learning and a lot of this stuff are new to me.</p>
<p>If you're interested in supporting me, there's a "support" link up there. You can also help me with giving a good rating for the game. It would help out with the algorithm.</p>
<p>Again, thank you very much.</p>
<p>Best regards,</p>
<p><i>Captain Wabbit</i></p>
</div>
<div class="margin-top-1rem -textcenter">
<h2>END OF CONTENT</h2>
</div>
</div><<if ($mainStory[0] === "yearOneRegistration")>>
<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
The Day After...
</div>
<div class="passage-main">
<p>The next <<timeRNG>>, you decide to go to the main hall to finish your registration. Your heart races with anticipation as you imbue the jade slip with spiritual energy, watching as it glows green and floats forward. With a mix of nerves and excitement, you follow the slip to its destination.</p>
<p>After a while, you finally arrive at the outer sect main hall for the first time. The three-story building looms before you, its sign proclaiming it as the hub of the sect. Inside, disciples bustle about, going about their business.</p>
<p>You approach one of the main hall officers who hands you a set of sect uniforms, a manual on "Breath Control Technique Art," and a storage ring.</p>
<p>"Storage Ring?"</p>
<p>The officer explains that by infusing it with spiritual energy, you can store a variety of items within its magical dimensions. Experimenting with the ring, you find that you can easily sense the space within and can't resist grinning at the discovery.</p>
<p>"Is there anything else I need to know?"</p>
<p>"Just make sure you pay your annual contribution. Every disciple needs to pay for their own lodging and other expenses by doing something for the sect."</p>
<p>"How much do I have to pay?"</p>
<p>"At your level, probably about 2 points a year for lodgings. But you need to pay more for other expenses." The officer succinctly said. "Now go away, I don't have time to chat all day."</p>
<p>After thanking the officer, you head back to your room, eager to rest and begin your journey as a member of the outer sect.</p>
</div>
<div class="margin-top-1rem -textcenter">
</div>
</div>
<<set $nextButton = "CONTINUE">>
<<include "Menu_Button">>
<</if>>
<<if ($mainStory[0] === "yearOneCultivation")>>
<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Start of cultivation
</div>
<div class="passage-main">
<p>In the <<timeRNG>> you perch on the edge of your bed, the worn "Breath Control Technique" manual cradled in your lap. Though you've long since mastered the ancient art of inner cultivation, you find yourself leafing through the pages once more, seeking a spark of inspiration.</p>
<p>With a deep inhale, you begin the breathing exercises taught to you by your master.</p>
<p>"Feel the power of heaven and earth. Gather the qi in your surroundings and condense it into the body. Become one with it. Open the blood vessels and circulate it throughout the body meridian." </p>
<p>After the time it takes an incense stick to burn, you feel a small strand of qi begin circulating. This gives you a warm comfortable feeling.</p>
<p>And as the seasons pass, you can feel your qi growing stronger, reaching new heights of power as you progress. After a year, you feel your <<CultivationStage>> energy getting stronger.</p>
</div>
<div class="margin-top-1rem -textcenter">
</div>
</div>
<<set $nextButton = "CONTINUE">>
<<include "Menu_Button">>
<</if>>
<<if ($mainStory[0] === "cultivationBasic")>>
<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
What is cultivation? - Year $year
</div>
<div class="passage-main">
<p>You're just <<walking>> across the <<outerLocationRNG>> after coming back from a lecture. It is now <<seasonTimeRNG>> <<seasonRNG>> almost four years after you joined the Pure Valley sect. A lot of things happened during the times you're here.</p>
<p>You especially learned more about the concept of cultivation. Which is basically the practice of improving health, longevity and mystical power by training your qi. Not everyone could cultivate. Only people that were born with spiritual roots such as yourself could practice it. While you don't know the exact statistic of these 'talented people', you assume they're just very rare.</p>
<p>Cultivators, like the stories said, could do a lot of mystical things. For example: chopping trees with palm strikes, casting fireballs or even flying into the air. But right now, at your current <<CultivationStage>> stage, you're probably only physically stronger than several adults.</p>
<p>And for you to be able to do all of those mystical things, you need to raise your cultivation stage and learn magical arts.</p>
</div>
<div class="margin-top-1rem -textcenter">
</div>
</div>
<<set $nextButton = "CONTINUE">>
<<include "Menu_Button">>
<</if>>
<<if ($mainStory[0] === "secondStage")>>
<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Second Stage - Year $year
</div>
<div class="passage-main">
<<findNPC "role" "first friend">>
<p>On a particular clear <<timeRNG>> in the summer, you're in the middle of resting under a big mulberry tree after you finish an errand given by one of the elders. <<npcFullName>> came over with a smile on <<his>> face and a gourd of wine in <<his>> hand.</p>
<p>“Hey <<playerBrotherName>>, I heard about your breakthrough. Congratulations on reaching the second stage.”</p>
<p>“Thank you, senior <<npcBrotherName>>. Have you been well?”</p>
<p>“Of course!” <<npcFullName>> laugh cheerfully and sit next to you. After taking a swig at the gourd, <<he>> offers you a sip, which you gladly take.</p>
<p>"You're lucky. Most cultivators in the world would stay at the first stage their whole life."</p>
<p>"Is that so?"</p>
<p><<npcFullName>> nods as <<he>> takes the gourd back and take another sip.</p>
<p>"Can I ask, what stage are senior <<brother>> at right now?"</p>
<p>"I'm at the third Stage of Qi Condensation. Been at this damn bottleneck for twelve years now. I would probably stay at this stage for another twenty. And die before I could do anything meaningful."</p>
<p>"Bottleneck? I heard about this. Can you tell me what caused it?"</p>
<p>"Failing a breakthrough..." <<He>> said as <<his>> eyes stares at you with a serious expression. "Every time it happens, some of the channels in your spiritual roots get blocked, and it would get harder and harder to break it." </p>
<p>"Oh, that's really troubling."</p>
<p>"Yeah. Just make sure you're in the very best condition before going with your breakthrough, junior <<playerBrother>>. Injuries are not the only problem. You can also ruin your future."</p>
You didn't really expect to hear this. This all makes sense now. With so many cultivators stuck in the low cultivation stage until they die from old age.
<p>Hearing <<npcFullName>> explanation, your mind starts to wander. How are you gonna be able to go back to earth? Even reaching Foundation Establishment Stage would not be easy. Not only do you need to breakthrough past all nine stages of Qi Condensation, but you need to do that before your lifespan runs out.</p>
<p>"Junior <<playerBrother>> let's stop talking about it. This is supposed to be a happy occasion." <<npcFullName>> taps your shoulder and offers you the gourd again.</p>
<p>"Of course senior <<brother>>. Let's drink." You reply with a forced smile.</p>
<p>"Let's drink!"</p>
<p>And then, you both stay to chat and drink your sorrow until midnight comes.</p>
</div>
<div class="margin-top-1rem -textcenter">
</div>
</div>
<<set $nextButton = "CONTINUE">>
<<include "Menu_Button">>
<</if>>
<<if ($mainStory[0] === "skillTutorial")>>
<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Elder Yun's Lecture - Year $year
</div>
<div class="passage-main">
<<set $stats.playerMentalState.current += random(1, 3)>>
<<changeAlert "mentalCurrent" 1>>
<p>One <<timeRNG>> <<seasonTimeRNG>> <<seasonRNG>>, you're just going about your daily routines when a peculiar invitation reaches your hands. An outer elder, Elder Yun, has extended invitations for a lecture to all the younger disciples.</p>
<p>Without thinking much about it, you make your way to the lecture hall.</p>
<p>As you enter the already crowded hall, you notice an old man with a messy long beard and equally messy long eyebrows, on a raised platform, already going with his speech.</p>
<p>"In the world of cultivation," Elder Yun said, "the most crucial principle is one unwavering dedication to one's skill. It's like forging a sword. The more you temper it, the sharper it becomes. A scattered mind disperses your true potential..."</p>
<p>You quickly pick a place to sit and listen to his lecture. Basically, Elder Yun is instructing the younger cultivators to practice and refine their technique. He mentioned that the difference in layers between each technique could significantly influence the type of potential you'll unlock after your breakthrough.</p>
</div>
<div class="margin-top-1rem -textcenter">
</div>
</div>
<<set $nextButton = "CONTINUE">>
<<include "Menu_Button">>
<</if>>
<<consumeStory>>
/*
<<if ($mainStory[0] === "breakthroughPenalty")>>
<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Consequences - Year $year
</div>
<div class="passage-main">
You're sitting inside your room when you see a scroll you never notice before, just behind some old books. The book, like most books from this world, looks like a pamflet made from cheap brownish paper. But there's something different about it.
A residual qi.
"Is it because I have better cultivation now?" You wonder as you reach out and pull out the book.
<<if $stats.playerSense.current > 7>>
And you do it with only using your divine sense. You let out a smile realizing, how much you improved in all those years.
<<else>>
But of course it doesn't work. Your divine sense is just too weak. You let out a weak smile and walk to the bookcase and take out the book.
<</if>>
After a time to finish a cup of tea, you're finally finish reading.
Apparently, it was a journal written by an old cultivator. He was already 70 years old when he wrote the journal, and reached
</div>
<div class="margin-top-1rem -textcenter">
</div>
</div>
<<set $nextButton = "CONTINUE">>
<<include "Menu_Button">>
<</if>> */
/* <<set $nextLink to "processing">>\
<h1><center>The Second Stage - Year $year</center></h1>
<<notify 2s>><span class="notifygood">Mood Improved!</span><</notify>>\
<<set $mood += random (1,10)>>
<<moodLimit>>\
On a particular clear <<timeRNG>> in the summer, you're in the middle of resting under a big mulberry tree after you finished with an errand given by one of the elders. $guardNPC.lastName $guardNPC.name came over with a smile on $guardNPC.possessive face and a gourd of wine on $guardNPC.possessive hand.
“Hey $player.Snick $player.lastName, I heard about your breakthrough. Congratulation on reaching the second stage.”
“Thank you, senior $guardNPC.Snick $guardNPC.lastName. Have you been well?”
“Of course!” $guardNPC.lastName $guardNPC.name laugh cheerfully and sit next to you. After taking a swig at the gourd, $guardNPC.pronoun offers you a sip, which you gladly take.
"You're lucky. Most cultivators in the world would stay at the first stage their whole life."
"Is that so?"
$guardNPC.lastName $guardNPC.name nods as $guardNPC.pronoun takes the gourd back and take another sip.
"Can I ask, what stage are senior $guardNPC.Snick at right now?"
"I'm at the third Stage of Qi Condensation. Been at this damn bottleneck for ten years now. I would probably stay at this stage for another twenty. And die before I could do anything meaningful."
"Bottleneck? Is it really that bad?"
*/<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
<<= "Year End Summary - Year " + ($year - 1)>>
</div>
<div class="passage-main">
<p><<randomizeYearEndReport>></p>
<div class="report-log-container -center-center">
<div class="report-log-box">
<div class="report-section">
<div class="report-title">Basic Activities</div>
<div class="report-description">
<ul>
<<reportActivities>>
</ul>
</div>
</div>
<div class="report-section">
<div class="report-title">Assignments</div>
<div class="report-description">
<ul>
<<reportQuest>>
</ul>
</div>
</div>
<div class="report-section">
<div class="report-title">Notable Events</div>
<div class="report-description">
<ul>
<<reportNotable>>
</ul>
</div>
</div>
<div class="report-section">
<div class="report-title">Finance</div>
<div class="report-description">
<ul>
<<print `${$player.lastName} ${$player.name} paid ${$faction.rent} points to the sect and received ${$reports.salary} points this year.`>>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="margin-top-1rem -textcenter scene-links">
</div>
</div>
<<resetReports>>
<<set $nextButton = "CONTINUE">>
<<set $nextPassage = "main">>
<<include "Menu_Button">><<first>>
<<set $stats.playerMentalState.current += random(1, 4)>>
<<changeAlert "mentalCurrent" 1>>
<p>There's a beautiful waterfall not too far from the Outer Sect sect It's in the southern part and not too many people like to visit the place.</p>
<p>As you sit and enjoy the serene atmosphere, you fall asleep. And when you wake up, it's already sunset. But you feel refreshed and your mind clearer. It's like, the very essence of the waterfall has rejuvenated your mind.</p>
<p>You then walk back to the dorm, with a <<mentalstateIndicator>> state of mind.</p>
<<then>>
<<set $stats.playerMentalState.current += random(1, 4)>>
<<changeAlert "mentalCurrent" 1>>
<p>You lay on the grassy bank, the sound of the waterfall providing soothing background noise. As you close your eyes and let yourself relax, you notice a small butterfly land on your $player.skin hand.</p>
<p>You watch as it flutters around for a bit before flying away. As you watch it disappear into the distance, you feel a sense of calm wash over you and you fall asleep.</p>
<p>The sun was already about to set when you woke up from your slumber. You feel <<mentalstateIndicator>> and just overall better. It's like, the very essence of the waterfall has rejuvenated your mind.</p>
<<finally>>
<<set $active.decisionLocked = true>>
<<set $stats.playerMentalState.current += random(1, 4)>>
<<changeAlert "mentalCurrent" 1>>
<p>It's <<seasonRNG>> now. You're back again at the waterfall.</p>
<p>As you sit and enjoy the peaceful atmosphere, you fall into a deep, refreshing sleep. And when you woke up, it's already sunset. But you feel refresh and your mind is clearer and in <<mentalstateIndicator>> state now. It's like, the very essence of the waterfall has rejuvenated your mind.</p>
<<done>>
<<replace ".scene-links">>
<<link "Meditate by the Waterfall">>
<<append ".passage-main">>
<p>But then you decide to stay for a week and try to meditate by the waterfall.</p>
<<set _random = random(1, 10)>>
<<if _random > 3>>
<<set $cultivation.time += random(30, 50)>>
<<changeAlert "cultivationCurrent" 1>>
<<append ".passage-main">>
<p>Because of that, you managed to improved a slightly faster rate compared when you were doing it normally.</p>
<</append>>
<<returnLink "Return To Your Dorm">>
<<else>>
<<set _damage = (random(1, 5)) / 5>>
<<set $stats.playerHealth.current -= _damage * $stats.playerHealth.max>>
<<set $stats.playerMentalState.current -= _damage * $player.level>>
<<changeAlert "healthCurrent" -1>>
<<changeAlert "mentalCurrent" -1>>
<<append ".passage-main">>
<p>Sadly, that didn't work out very well. Not only you didn't manage to improve your cultivation, you also got attacked by a wild demonic beast that came out of nowhere.</p>
<</append>>
<<returnLink "Return To Your Dorm">>
<</if>>
<</append>>
<</link>>
<<link "Return to the Sect" $nextPassage>>
<<set $active.decisionLocked = false>>
<</link>>
<</replace>>
<</done>>
<</first>><<first>>
<<findNPC "role" "first friend">>
<<set $stats.playerMentalState.current += random(1, 4)>>
<<changeAlert "mentalCurrent" 1>>
<p>You're in the middle of practicing your martial art at the courtyard when you see <<npcFullName>> walks by. You call out <<his>> name and <<he>> smile at you.</p>
"<<NpcBrotherName>> what are you doing here?" you said as you watch <<his>> <<height>> frame approach you.
"You practice too much, let's just have fun."
<p>You let out a laught and shake <<his>> hand. And then you both decide to spend the rest of days, chatting and drinking wine.</p>
<<finally>>
<<set $stats.playerMentalState.current += random(1, 4)>>
<<changeAlert "mentalCurrent" 1>>
<p>You're just walking back from <<outerLocationRNG>> after finishing some personal business when you see <<npcFullName>> just sitting by. You call out <<his>> name and <<he>> smile at you.</p>
<p>You both decide to spend the rest of days, chatting and drinking wine.</p>
<</first>><<set _location = either("courtyard", "library", "Outer Sect Main Hall")>>
<<set _diceRoll = random(1, 3)>>
<div>
<<if $core.comprehension > $seed.diceTen>>
<<set $breakthrough.bonus += _diceRoll>>
<<changeAlert "breakthroughBonus" 1>>
<<successRollIndicator "Comprehension">>
<<else>>
<<failedRollIndicator "Comprehension">>
<</if>>
</div>
<div>
<<if $core.psyche > $seed.diceTen>>
<<successRollIndicator "Psyche">>
<<else>>
<<set $stats.playerMentalState.current -= random(1, 4)>>
<<changeAlert "mentalCurrent" -1>>
<<failedRollIndicator "Psyche">>
<</if>>
</div>
<p>One of the outer sect elders is giving a lecture at the _location. Thinking this is a good opportunity to learn, you decide to go.</p>
<p>When you arrive, you see a lot of other disciples already there, getting ready to listen to the lecture. Just as you manage to find a good spot to sit, the elder arrives wearing a yellow-ish robe.</p>
<p>You then stay and listen to the lecture for about five hours until it finally finishes.</p><<set $stats.playerMentalState.current += random(2, 5)>>
<<changeAlert "mentalCurrent" 1>>
<p>One of the disciples you know <<celebration>> today. You're invited to the event along with several other disciples. When you arrive at the location, you see everyone is eating, drinking, and having a good time under the soft glow of lanterns.</p>
<p>You can't help but smile as you watch the festivities. The joy are infectious, and the dishes being served were amazing.</p>
<p>You smile and decide to join the celebration as the celebration continues well into the night.</p><div>
<<if $core.psyche > $seed.diceTen>>
<<successRollIndicator "Psyche">>
<<done>>
<<append ".passage-main">>
<p>Fortunately because of your mental strength, you managed to resist the frustration. Your mental state is at <<mentalStateUI>> state at the moment.</p>
<</append>>
<</done>>
<<else>>
<<failedRollIndicator "Psyche">>
<<set $stats.playerMentalState.current -= random(3, 13)>>
<<changeAlert "mentalCurrent" -1>>
<<done>>
<<append ".passage-main">>
<p>You sit for hours, but your mind remains restless, and your Qi refuses to respond to your will. Frustration mounts as you grapple with this stagnation, questioning your abilities. Your mental state is at <<mentalStateUI>> state at the moment.</p>
<</append>>
<</done>>
<</if>>
</div>
<p>Despite your diligent efforts, there are days when your meditation yields no progress.</p>
<p>Like today, you've been sitting for hours, but your mind remains restless, and your Qi refuses to respond to your will. Frustration mounts as you started thinking about your comfortable and happy life before coming to this world.</p><<set _randomEldergen = either("He", "She")>>
<<set _randomEldertask = either("fetch", "deliver", "do", "buy")>>
<p>Today, a servant disrupted your activity and delivered a message. Apparently one of the outer sect's esteemed elders called for you. _randomEldergen wants you to _randomEldertask something. Without delay, you just go and do the task. It's not even a that complicated.</p>
<<if $seed.diceThree === 1>>
<<set $faction.contributionPoints += 1>>
<<changeAlert "contributionPoints" 1>>
<p>After you completed the task, the elder smiles and gives you an additional contribution points.</p>
<p>Well, that's really lucky!</p>
<<else>>
<<set $faction.contributionPoints -= 1>>
<<changeAlert "contributionPoints" -1>>
<p>Unfortunately, a complication happened. Which in turn, cause you to fail. The elder looks at you with a dissapointed sigh and deduct your contribution points.</p>
<p>Well, that's unlucky!</p>
<</if>><<first>>
<p>Today is your first time coming to the Outer Sect herb garden for a sect mission. It is located in the lower section of the Northern Peak, about eight li from the dorm. The herb garden itself is a bit peculiar. Especially if you compare it to any garden on earth.</p>
<p>First of all, a herb garden in the cultivation world is a garden for Spiritual Herbs. Magical plants which capable of absorbing and has absorbed spiritual energy from the world, and in turn, become a plant that is filled with spiritual energy that's very beneficial for cultivators like you. Secondly, these kinds of plants usually, radiate spiritual light and aura that would make them look really magical. Especially at night.</p>
<p>Although the herb garden in the outer sect only contains the lowest tier of spiritual herbs, it is still a very important location for the sect. This garden is basically where the sect gets its ingredients for alchemy.</p>
<p>Fortunately for you, the mission is very simple. You just need to water the spiritual grass and watch over the garden for the duration of the assignment the next disciple arrives to take over your shift. And if you need help, you could go to the elder staying in a cultivation cave nearby.</p>
<<finally>>
<p>You arrive at the herb garden for one of the assignment again. So, you tend and watch over the garden for the duration, until another disciple arrives to take over your shift.</p>
<p>Fortunately for you, nothing happened during the assignment. After you reported the mission, you decide to go back and get some rest in your room.</p>
<</first>><<set $active.decisionLocked = true>>
<p>One <<timeRNG>> <<seasonTimeRNG>> <<seasonRNG>>, you were <<walking>> across the <<outerLocationRNG>> when you see a couple of disciple, a man and woman, sparring. Other disciples are watching, but you don't know any of them.</p>
<p>You decide to:</p>
<<done>>
<<replace ".scene-links">>
<<link "Stay and watch">>
<div>
<<if $core.comprehension > 4>>
<<set $breakthrough.bonus += $seed.diceThree>>
<<changeAlert "breakthroughBonus" 1>>
<<done>>
<<append ".passage-main">>
<<successRollIndicator "Comprehension">>
<p>You stay for about an few hours and managed to gain some enlightment.</p>
<</append>>
<</done>>
<<else>>
<<set $stats.playerMentalState.current -= random(1, 4)>>
<<changeAlert "mentalCurrent" -1>>
<<done>>
<<append ".passage-main">>
<<failedRollIndicator "Comprehension">>
<p>You stay for about an hour without learning anything, before going back to your room.</p>
<</append>>
<</done>>
<</if>>
</div>
<<replace ".scene-links">>
<<link "Continue" $nextPassage>>
<<set $active.decisionLocked = false>>
<</link>>
<</replace>>
<</link>>
<<link "Leave" $nextPassage>>
<<set $active.decisionLocked = false>>
<</link>>
<</replace>>
<</done>><<generateNPC>>
<<npcObjectCollection>>
<<set $active.NPC.role = "first rival">>
<<run $event.available.delete("misunderstandingUnfolds")>>
<<set $stats.playerMentalState.current -= $seed.diceThree>>
<<changeAlert "mentalCurrent" -1>>
<p>While walking through the lively training grounds during <<timeRNG>>, you encounter one of your fellow disciples. <<His>> name is <<npcFullName>>, a figure who has always been somewhat reserved and enigmatic. As you exchange greetings, an unintended remark escapes your lips, a seemingly harmless comment that you didn't anticipate could be offensive.</p>
<p>In the brief moment following your words, you sense a subtle shift in <<his>> demeanor. <<His>> expression darkens, and you then realize that you've unwittingly touched upon a sensitive topic. The atmosphere grows tense, and you desperately wish you could retract your words.</p>
<p>Your fellow disciple, clearly affected by your comment, offers you a tense nod and quickly departs. Leaving you pondering the repercussions of your thoughtless words.</p>
<p>Because of this, your mental state is at <<mentalStateUI>> state at the moment.</p><<set $active.decisionLocked = true>>
<<run $event.available.delete("goodbyeGrandmother")>>
<p>One day, you hear that one of the servants is sick and can't come to work anymore. You remember this particular servant as this kind-hearted old woman who used to sweep floors. So, you decide to visit her.</p>
<p>When you arrive at her living quarters, you meet with her nine-year-old granddaughter who stays with her. She quickly kneels when she sees you and drops her face because most mortals are very scared of cultivators like you. But you just tell her to be at ease, pat her head gently, and sit beside the old woman.</p>
<p>She's sleeping, and her face looks very sickly and pale. You decide not to wake her up. So for a while, you just sit and watch her face. A face that always reminded you of your own sickly grandmother back on Earth. At the time, she was already dying from pancreatic cancer. You remember that she always told you to come and visit her, but because you were busy with your own life, you kept on delaying.</p>
<p>Now, you feel remorseful. You used to be very close with your grandmother when you were a child. She was always there to wipe down your tears when you were sad and hug you when you were scared. But you couldn't be there for her.</p>
<p>You start to wonder, what did happen back on Earth after you died? Did your grandmother hear about it? Or maybe your family didn't tell even her about what happened to you and just keep thinking you just don't want to visit her? Wait, why are you blaming your family for? You had all the time in the world to visit her before all of this happened. So, why couldn't you do that?</p>
<p>Tears start to fall, and you weep silently for a moment before you feel a squeeze in your hand. You look to the side and see the old woman smile at you.</p>
<p>"Good child, why are you crying?"</p>
<p>You wipe down the tears away and force a smile.</p>
<p>"I'm fine."</p>
<p>You're not.</p>
<p>"You don't have to worry a thing now. I will take care of you and your granddaughter."</p>
<p>That day, you stayed at her quarter until very late.</p>
<p>Then, for several months, you routinely visited her until she finally passed away. You arranged for her funeral and made arrangements for her family in the neighboring village to come to the sect to take care of the granddaughter. You even make sure to offer them a good salary out of your pocket.</p>
<p>In fact, you probably spent in total about:</p>
<<done>>
<<replace ".scene-links">>
<<link "1 points">>
<<set $faction.contributionPoints -= 1>>
<<changeAlert "contributionPoints" -1>>
<<set $stats.playerMentalState.current += 1>>
<<changeAlert "mentalCurrent" 1>>
<<append ".passage-main">>
<p>1 contribution points. But because of that, you can at least feel some kind of closure from your past.</p>
<</append>>
<<returnLink>>
<</link>>
<<link "2 points">>
<<set $faction.contributionPoints -= 2>>
<<changeAlert "contributionPoints" -2>>
<<set $stats.playerMentalState.current += 2>>
<<changeAlert "mentalCurrent" 2>>
<<append ".passage-main">>
<p>2 contribution points. But because of that, you can at least feel some kind of closure from your past.</p>
<</append>>
<<returnLink>>
<</link>>
<<link "3 points">>
<<set $faction.contributionPoints -= 3>>
<<changeAlert "contributionPoints" -3>>
<<set $stats.playerMentalState.current += 3>>
<<changeAlert "mentalCurrent" 3>>
<<append ".passage-main">>
<p>3 contribution points. But because of that, you can at least feel some kind of closure from your past.</p>
<</append>>
<<returnLink>>
<</link>>
<</replace>>
<</done>><<first>>
<<set $stats.playerMentalState.current += $seed.diceThree>>
<<changeAlert "mentalCurrent" 1>>
<p>Pure Valley sect is a very big sect with many people living in its area. Imagine the headquarters of a multi-billion company on Earth if that company also provides all of their employees with on-site housing. That would mean there would be a lot of mouths to feed.</p>
<p>That's why you are traveling to the nearby village, on the North side of the Pure Valley sect with <<print random(2, 5)>> other outer sect disciples and more than 20 servants. You're here to trade some supplies from the village, more specifically, to buy grain and some cattle for the sect. From what you hear, there are other disciples with the same task as you, going to multiple destinations to do a supply run.</p>
<p>While doing this kind of task is somewhat risky, you don't really mind doing it. Cultivating all day long could be very tedious, and this is your chance to go outside of the sect.</p>
<p>So, you decide to enjoy your time in the village. You chat with your fellow disciples in a good mood and enjoy the hospitality of the villagers that treat cultivators such as yourself like royalties.</p>
<p>You stay in the village for several days to handle business, and after it's done, you're back in the sect with the supplies without anything bad happening to you and your fellow disciples.</p>
<<finally>>
<<set $stats.playerMentalState.current += $seed.diceThree>>
<<changeAlert "mentalCurrent" 1>>
<p>You're out again to do some supply run. Cultivating all day long could be very tedious and boring. And you don't have many chances to relax.</p>
<p>So, you decide to enjoy your time in the village. You chat with your fellow disciples in a good mood and enjoy the hospitality of the villagers that treat cultivators such as yourself, like royalties.</p>
<p>You stay in the village for several days to handle business, and after it's done, you're back in the sect with the supplies without anything bad happening to you and your fellow disciples.</p>
<</first>><<run $event.available.delete("badEncounter")>>
<<generateNPC>>
<<set $active.NPC.role = "troublemaker">>
<<set $active.NPC.relationship = -20>>
<<npcObjectCollection>>
<<first>>
<<set $active.decisionLocked = true>>
<p>You walk through the <<outerLocationRNG>>. Your mind still wandering about something and you don't pay much attention to your surrounding. But suddenly, the peace is interrupted by the commotion of your fellow disciples talking nearby. You notice a group of senior disciples, including a <<male>> disciple with the name <<npcFullName>> among them, a notorious troublemaker.</p>
<p><<His>> reputation for bullying and arrogance precedes <<him>> for quite some time now.</p>
<p>As you draw nearer, <<npcFullName>> steps into your path, <<his>> sneering grin making it clear that <<he>> is looking for trouble. <<He>> glares at you with disdain, <<his>> eyes fixated on you, and it's evident that <<he>> has singled you out for harassment today.</p>
<<done>>
<<replace ".scene-links">>
<<link "Confront Directly">>
<<append ".passage-main">>
<p>You stand your ground, challenging <<npcFullName>>'s bullying. The confrontation escalates into a physical scuffle, drawing the attention of the sect elders. They reprimand both of you, and you receive a fine for your role in the incident.</p>
<<if $player.level < 4>>
<<failedRollIndicator "Battle Power">>
<<set _damage = (random(1, 3)) / 5>>
<<set $stats.playerHealth.current -= (_damage * $stats.playerHealth.max)>>
<<changeAlert "healthCurrent" -1>>
<<set $stats.playerMentalState.current -= random(3, 10)>>
<<changeAlert "mentalCurrent" -2>>
<<set $faction.contributionPoints -= 2>>
<<changeAlert "contributionPoints" -2>>
<p>And on top of that, because your <<CultivationStage>> is lower that <<his>> 4th Stage of Qi Condensation, you got beat up.</p>
<<returnLink "Return To Your Dorm">>
<<elseif $player.level === 4>>
<<successRollIndicator "Battle Power">>
<<set $faction.contributionPoints -= 2>>
<<changeAlert "contributionPoints" -2>>
<p>Fortunately, because your <<CultivationStage>> is at the same level with <<him>>, none of you got injured.</p>
<<returnLink "Return To Your Dorm">>
<<else>>
<<successRollIndicator "Battle Power">>
<<set $stats.playerMentalState.current += random(2, 5)>>
<<changeAlert "mentalCurrent" 2>>
<<set $faction.contributionPoints -= 2>>
<<changeAlert "contributionPoints" -2>>
<p>Fortunately, because your <<CultivationStage>> is at the higher than <<him>>, you didn't get any injuries and even managed to hurt <<him>>.</p>
<p>Well, beating a bully is kind of satisfying.</p>
<<returnLink "Return To Your Dorm">>
<</if>>
<</append>>
<</link>>
<<link "Attempt to Defuse the Situation">>
<<append ".passage-main">>
<p>You try to defuse the situation by speaking calmly and respectfully to <<npcFullName>>.</p>
<<if $core.charm < 6>>
<<failedRollIndicator "Charm">>
<<set $stats.playerMentalState.current -= random(3, 7) + ($player.level * random(1, 3))>>
<<changeAlert "mentalCurrent" -2>>
<p><<He>> mocks your <<charmIndicator>> face, saying you're too ugly. But <<he>> eventually walks away, leaving you unharmed but with your pride slightly wounded.</p>
<<returnLink "Return To Your Dorm">>
<<else>>
<<successRollIndicator "Charm">>
<<set $stats.playerMentalState.current += random(1, 4)>>
<<changeAlert "mentalCurrent" 2>>
<p><<He>> look at you <<charmIndicator>> face and hesitated. The one of the other senior stopped <<him>> and <<he>> eventually walks away, leaving you unharmed.</p>
<<returnLink "Return To Your Dorm">>
<</if>>
<</append>>
<</link>>
<</replace>>
<</done>>
<<finally>>
<<goto $nextPassage>>
<</first>><<run $event.available.delete("mistreatedServant")>>
<<generateNPC>>
<<set $active.NPC.role = "elitist disciple">>
<<set $active.NPC.age = random(40, 55)>>
<<set $active.NPC.relationship = -20>>
<<npcObjectCollection>>
<<set $active.decisionLocked = true>>
<p>In the middle of the afternoon, you're having lunch in the dining room at your dorm when you see an old <<male>> cultivator, beating up a female servant with a stick. The servant is crying pitifully while the <<male>> cultivator is just smiling without a care in the world as people are watching.</p>
<p>You stop eating and watch what is happening with a conflicted expression. You notice, that there's no one stopping or helping the servant.</p>
<p>The Pure Valley sect is a big sect. There are a lot of people living in the sect, not just cultivators. Some people work as servants who are there to help with daily chores. Some of them are just regular people who work for money, but many are captured slaves.</p>
<p>Because you came from Earth, your morality differs from the people here. For you, slavery is one of the most awful things that could happen to a human being. This is your belief. Something important that you want to hold on to even when you're now living in this new world.</p>
<<done>>
<<replace ".scene-links">>
<<link "Speak Up">>
<<append ".passage-main">>
<p>"Stop!" You jump in front of the servant, shielding her from the beating.</p>
<p>"Junior <<playerBrother>>, what are you doing?" The <<male>> cultivator glares at you.</p>
<p>"Please, senior <<brother>>. You're gonna kill her!"</p>
<p>"That's not your concern." With a look of disdain, <<he>> drops the stick and then puts <<his>> hand on the sword hanging on <<his>> waist. "Move away or die."</p>
<p>"I can't…" You stuttered your answer.</p>
<p>After hearing your answer, without giving you any chance to do anything, <<he>> pulls out <<his>> sword and goes to stab you.</p>
<<if $player.level < 4>>
<<failedRollIndicator "Battle Power">>
<<set $stats.playerHealth.current += random(1, 5) + ($player.level * random(1, 3))>>
<<changeAlert "healthCurrent" -1>>
<<set $stats.playerMentalState.current -= random(3, 7)>>
<<changeAlert "mentalCurrent" -2>>
<p>She's fast!</p>
<p>You couldn't even believe what is happening right now. You try to circulate your <<CultivationStage>> stage energy and dodge, but <<his>> speed is just too inhumane.</p>
<p>Swish!</p>
<p>You feel a terrible amount of pain in your right shoulder as <<he>> stabs you. And with a fluid motion, <<he>> continues <<his>> attack with a swift kick to your stomach.</p>
<p>That's when everything goes black.</p>
<<returnLink>>
<<else>>
<<successRollIndicator "Battle Power">>
<<set $stats.playerMentalState.current += random(2, 5)>>
<<changeAlert "mentalCurrent" 2>>
<p>You deftly dodge <<his>> attack, your higher cultivation level making it look like child's play. In a swift movement, you disarm <<his>>, knocking the sword from <<his>> hand. The <<male>> cultivator is now unarmed and vulnerable.</p>
<p>You stand your ground, a determined look in your eyes, and say, "I won't let you harm her any further. This ends here."</p>
<p><<He>> looks shocked and angry, realizing <<he>>'s underestimated you. You now have the upper hand in this situation. The servant, wide-eyed and thankful, watches the turn of events, grateful for your intervention.</p>
<<returnLink "Return To Your Dorm">>
<</if>>
<</append>>
<</link>>
<<link "Try diplomacy">>
<<append ".passage-main">>
<<if $core.charm < 7>>
<<failedRollIndicator "Charm">>
<<set $stats.playerMentalState.current -= random(2, 5)>>
<<changeAlert "mentalCurrent" -2>>
<p>"Senior <<brother>>, forgive me for being rude." You say with a polite tone.</p>
<p>The <<male>> cultivator stops <<his>> beating and gives you a look. <<He>> doesn't seem impressed with what <<he>> is seeing. Probably because your appearance is not up to <<his>> liking. Most cultivators are shallow people.</p>
<p>"Can I ask, what did she do wrong?"</p>
<p>"She stole spirit stones that were on my table."</p>
<p>"She did?"</p>
<p>You look at the servant who is crying even harder.</p>
<p>"No, young master. I didn't steal anything. I wasn't even here until a minute ago because I was busy cooking."</p>
<p>"She's lying!" The <<male>> cultivator raises <<his>> stick and is about to hit her again.</p>
<p>"Senior <<brother>>, please. We should check everything fir—"</p>
<<if $player.level < 4>>
<<failedRollIndicator "Battle Power">>
<<set _damage = (random(1, 5) / 5)>>
<<set $stats.playerHealth.current -= _damage * $stats.playerHealth.max>>
<<changeAlert "healthCurrent" -1>>
<p>"Move!" <<He>> waves <<his>> hand and suddenly, a force wave comes crashing down and throws you out of the hall.</p>
<<returnLink "Return To Your Dorm">>
<<else>>
<<successRollIndicator "Battle Power">>
<<set $stats.playerMentalState.current += random(2, 5)>>
<<changeAlert "mentalCurrent" -2>>
<p>"Move!"</p>
<p>"Enough! I won't allow baseless violence to happen on my watch."</p>
<p>"You dare to defy me?"</p>
<p>Without answering, you create a subtle display of your power, causing the surroundings to vibrate. The <<male>> cultivator, intimidated, puts down <<his>> stick and backs away. The servant is spared, and the onlookers are left in awe of your action.</p>
<<returnLink "Return To Your Dorm">>
<</if>>
<<else>>
<<successRollIndicator "Charm">>
<<set $stats.playerMentalState.current += random(1, 3)>>
<<changeAlert "mentalCurrent" 2>>
<p>You speak with a charm and persuasiveness that captivates the room. "Senior <<brother>>, I understand your concern, but we must be fair in our judgments. Accusations should be thoroughly investigated."</p>
<p>The <<male>> cultivator, momentarily swayed by your charisma, lowers <<his>> stick and nods. "You're right. Let's get to the bottom of this."</p>
<p>You then calmly turn to the crying servant and say, "Please, tell us your side of the story." </p>
<p>The servant, encouraged by your presence, explains her innocence convincingly. The <<male>> cultivator, realizing <<his>> hasty actions, leaves without harming the servant further. Your charisma has diffused the situation and ensured justice.</p>
<<returnLink "Return To Your Dorm">>
<</if>>
<</append>>
<</link>>
<<link "Ignore">>
<<append ".passage-main">>
<<if $core.psyche < $seed.diceTen>>
<<failedRollIndicator "Psyche">>
<<set $stats.playerMentalState.current -= random(7, 20)>>
<<changeAlert "mentalCurrent" -2>>
<p>Feeling conflicted and uncertain, you decide to stay out of the situation, not daring to intervene. The cries of the servant haunt you as you leave to return to your dorm.</p>
<p>You're barely able to survive in this world, how are you gonna start involving yourself in other people's problems.</p>
<p>Regret washes over you. You can't shake the feeling of awfulness, knowing you had a chance to make a difference but chose not to act.</p>
<p>What made it worse, you later heard that the female servant is now bedridden from the injuries.</p>
<<else>>
<<successRollIndicator "Psyche">>
<p>Feeling conflicted and uncertain, you decide to stay out of the situation, not daring to intervene. The cries of the servant haunt you as you leave to return to your dorm.</p>
<p>You feel somewhat guilty, but soon manage to push the regret away, not long after.</p>
<</if>>
<<returnLink>>
<</append>>
<</link>>
<</replace>>
<</done>><<run $event.available.delete("oldFart")>>
<<generateNPC>>
<<set $active.NPC.role = "old fart">>
<<set $active.NPC.age = random(80, 120)>>
<<set $active.NPC.relationship = -20>>
<<npcObjectCollection>>
<p> One late <<timeRNG>> while you're <<walking>> across the <<outerLocationRNG>> you notice an old <<man>>, wearing a very dirty elder uniform, sitting lazily in one of the tree branches as you walk by. The branch is pretty thin and looks like it would've broken if a bird perched on it. Which is a weird sight to see.</p>
<p>Not knowing what to do, especially since this is the first time you have seen this <<man>>, you bow politely, before you continue with your journey.</p>
<p>"Little one, are you here to bring me my wine?" The elder suddenly asked.</p>
<p>"Wait, what?" You stopped.</p>
<p>"You're not too bright, aren't you little one? I want my wine."</p>
<p>"Please forgive me, elder. But I don't have any wine on me."</p>
<p>"That's unacceptable."</p>
<p><<He>> suddenly jump in front of you. But even <<his>> jump is very strange because of how slow gravitation seems to affect <<him>>.</p>
<<if $core.charm > 6>>
<<set $active.item = "Lesser Qi Gathering Pill">>
<<receiveItem>>
<<itemAlert true>>
<<set $stats.playerMentalState.current += random(1, 3)>>
<<changeAlert "mentalCurrent" 2>>
<<successRollIndicator "Charm">>
<p>"Hmmm... you're kind of good-looking, you have a <<playerFace>>. You might become someone important in the future." <<He>> gives you a smile before <<he>> takes out a Lesser Qi Gathering Pill and pushes it to your hand.</p>
<p>"Elder?"</p>
<p>"Now, leave. I'm already bored."</p>
<p>Knowing it's futile to continue this conversation, you decide to just leave. In fact, this is actually a good thing. You received a gift without even doing anything. This is probably one of the best things that happened to you in a year or so.</p>
<<else>>
<<set _damage = (random(1, 3) / 5)>>
<<set $stats.playerHealth.current -= (_damage * $stats.playerHealth.max)>>
<<changeAlert "healthCurrent" -1>>
<<set $stats.playerMentalState.current -= random(3, 13)>>
<<changeAlert "mentalCurrent" -1>>
<<failedRollIndicator "Charm">>
<p>"Then, if you can take one of my moves, I will believe that you really didn't just come here to annoy me."</p>
<p>What kind of nonsense is this? That doesn't even make any sense.</p>
<p>Without any warning, the old <<man>> flicks <<his>> finger sending a small qi turbulence shooting toward you.</p>
<p>"Elder! Please have merc--"</p>
<p>Pain runs through all over your body as the force hits your body, breaking several of your ribs.</p>
<p>"What a weak little one. I didn't even use 5 percent of my strength. You should've practiced harder if you plan to lie to old me."</p>
<</if>><p>You're sitting and drinking alone, looking at the night sky, on the nearby hill just right outside your dorm. You don't even like alcohol in your old life.</p>
<p>This is just one of those nights you're not doing well. You're here alone, suddenly waking up alone in this new world of cultivation, in a new family that hated you.</p>
<p>You remember your family from your previous life. Those happy memories of how your dad always tried to get you to play DnD with him. Or how your older brother keeps spinning tales on how amazing Lionel Messi is. Or how your mother just kept trying to come up with a new dish, just to impress you. Or even how your <<girlfriend>> just wanted to cuddle all day and watch Netflix on your birthday.</p>
<p>You missed them a lot.</p>
<<if $core.psyche < 6 || $stats.playerMentalState.current < 90>>
<<set $stats.playerMentalState.current -= random(4, 11)>>
<<changeAlert "mentalCurrent" -1>>
<<failedRollIndicator "Psyche">>
<p>You let out a sigh and spent the night outside.</p>
<<else>>
<<successRollIndicator "Psyche">>
<p>Fortunately, your mind is strong enough to not let this painful longing hurt you. After a few more sips, you then went back to your room.</p>
<</if>><<run $event.available.delete("injuredFriend")>>
<<findNPC "role" "first friend">>
<<set _damage = (random(6, 10) / 10)>>
<<set $stats.playerQi.current -= _damage * $stats.playerQi.max>>
<<if $stats.playerQi.current < 0>>
<<set $stats.playerQi.current = 0>>
<</if>>
<<changeAlert "qiCurrent" -1>>
<p>You're just back from a trip from the <<outerLocationRNG>> when you receive a frantic message from your friend, <<npcFullName>>, saying that <<he>>'s injured and needs your help. Rushing to <<his>> dwelling, you find <<him>> lying on a simple cot, <<his>> face pale and beads of sweat glistening on <<his>> forehead.</p>
<p>Concern fills your heart. After all, you've known <<him>> for quite a while now, and <<he>>'s always been good to you.</p>
<p><<npcFullName>> weakly explains that <<he>> was ambushed by rogue cultivators on <<his>> way home after finishing an assignment. And now, their brutal attack left <<him>> with severe internal injuries. <<His>> breathing is shallow, and <<his>> aura is dim.</p>
<p>Realizing that time is of the essence, you sit down beside <<npcFullName>> and concentrate on your qi. Closing your eyes, you visualize your own inner energy as a warm, golden light. With steady focus, you begin to channel this energy into your friend's body, carefully mending the damaged meridians and soothing the pain.</p>
<p>As you channel your qi, <<npcFullName>>'s condition gradually stabilizes. The pain in <<his>> face eases, and the color returns to <<his>> cheeks. You can sense the flow of energy within <<him>> returning to normal. With a sigh of relief, you wipe down the sweat from your forehead.</p>
<p>You spent a lot of qi today, leaving your qi at <<qiUI>> level.</p><<first>>
<p>You just finished your dinner and are now enjoying the beautiful night scene from one of the wooden stools in the courtyard. Suddenly, a very overweight teenager is running on top of the roof with a battle staff in his hand. He looks angry.</p>
<p>He immediately stops when he notices you sitting all by yourself and yells at you.</p>
<p>"Hey, you there!"</p>
<p>"Yes?"</p>
<p>"Have you seen a beautiful ghost wearing a blue dress running around?"</p>
<p>"Wait, what? A ghost? Wearing a blue dress?"</p>
<p>"Why are you repeating what I just said? Just answer my question!" He barks at you.</p>
<p>"Hmmm… I haven't seen any ghost in my whole life." But as you said that, it finally dawns on you. This world is so strange and magical, that the existence of ghosts wouldn't even be that weird. In fact, you should've realized this sooner.</p>
<p>"Are you sure?" He asked again with an annoyed expression.</p>
<p>"Yeah, I'm pretty sure."</p>
<p>He glares at you for a short moment before he finally nods.</p>
<p>"Fine. But, if I find out you're hiding her, then I'll be coming for you." With that, he flew toward the roof and continued his running. Leaving you, not knowing what to do.</p>
<p>Then, after a while, you decide that this is none of your business and go back to your room.</p>
<<finally>>
<<run $event.available.delete("ghostChasing")>>
<p>You're <<walking>> across the <<outerLocationRNG>> when you notice something is jumping over your head. You look up and see the fat teenager that you met in the past. He strangely still looks the same even after quite some time.</p>
<p>You heard from other disciples that he's a ghost cultivator, and that kind of cultivator is usually dangerous. You shake your head and decide to go about your day.</p>
<</first>><<first>>
<<set $active.decisionLocked = true>>
<<generateNPC "female">>
<<set $active.NPC.role = "peddler">>
<<npcObjectCollection>>
<<set _index = $seed.diceTen % setup.items.pillName.length>>
<<set $active.item = setup.items.pillName[_index] >>
<p>You are walking home to the dormitory after finishing a few business at Outer Sect main hall when someone approaches you. She is a <<print $active.NPC.weight>> looking girl, wearing the Pure Valley sect uniform with a sword on her waist. Her <<print $active.NPC.face>> looks haggard and tired.</p>
<p>“Fellow daoist, can I have a moment?”</p>
<p>“Of course, sister.” You nod to her politely.</p>
<p>“I have something here that might interest you.” She then pulls a $active.item from her storage ring to show it to you.</p>
<p>“A $active.item?” You look at it with interest.</p>
<<if $core.charm > 6>>
<<successRollIndicator "Charm">>
<<set _price = Math.trunc(setup.items.objects[$active.item].price / 2)>>
<p>She look at your $player.face face and smiles. “I can sell it to you for half the usual price, which is <<print _price>> points.”</p>
<<else>>
<<set _price = Math.trunc(setup.items.objects[$active.item].price * 0.66)>>
<<failedRollIndicator "Charm">>
<p>She look at your $player.face face with a lazy expression. “I can sell it to you for two third of the usual price, which is <<print _price>> points.”</p>
<</if>>
<<done>>
<<replace ".scene-links">>
<<disable $faction.contributionPoints < _price>>
<<link "Buy">>
<<append ".passage-main">>
<<set $faction.contributionPoints -= _price>>
<<changeAlert "contributionPoints" -3>>
<<receiveItem>>
<<itemAlert true>>
<p>You decide to buy it.</p>
<<returnLink "Return To Your Dorm">>
<</append>>
<</link>>
<</disable>>
<<link "No" $nextPassage>>
<<set $active.decisionLocked = false>>
<</link>>
<</replace>>
<</done>>
<<finally>>
<<findNPC "role" "peddler">>
<<set _index = $seed.diceTen % setup.items.pillName.length>>
<<set $active.item = setup.items.pillName[_index] >>
<p>You are walking home from the <<outerLocationRNG>> when someone approaches you. She is the <<print $active.NPC.weight>> looking girl that lately becoming famous for being some kind of peddler. Her <<print $active.NPC.face>> looks not as tired anymore.</p>
<p>“Fellow daoist, we meet again.”</p>
<p>“Good to see you, sister.” You nod to her politely.</p>
<p>“I have another thing here that might interest you.” She then pulls a $active.item from her storage ring to show it to you.</p>
<p>“A $active.item?” You look at it with interest.</p>
<<if $core.charm > 6>>
<<successRollIndicator "Charm">>
<<set _price = Math.trunc(setup.items.objects[$active.item].price / 2)>>
<p>She look at your $player.face face and smiles. “I can sell it to you for half the usual price, which is <<print _price>> points.”</p>
<<else>>
<<set _price = Math.trunc(setup.items.objects[$active.item].price * 0.66)>>
<<failedRollIndicator "Charm">>
<p>She look at your $player.face face with a lazy expression. “I can sell it to you for two third of the usual price, which is <<print _price>> points.”</p>
<</if>>
<<done>>
<<replace ".scene-links">>
<<link "Buy">>
<<append ".passage-main">>
<<set $faction.contributionPoints -= _price>>
<<changeAlert "contributionPoints" -3>>
<<receiveItem>>
<<itemAlert true>>
<p>You decide to buy it.</p>
<<returnLink "Return To Your Dorm">>
<</append>>
<</link>>
<<link "No" $nextPassage>>
<<set $active.decisionLocked = false>>
<</link>>
<</replace>>
<</done>>
<</first>><<run $event.available.delete("escapedSnake")>>
<<if $stats.playerSense.current > $seed.diceTen * $player.level>>
<<successRollIndicator "Divine Sense">>
<p>One serene <<timeRNG>>, as you <<walking>> through the tranquil bamboo forest on your way to the <<outerLocationRNG>>, a sudden rustling of leaves alerts your senses. Without hesitation, you instinctively leap to the side, evading the striking fangs of a venomous serpent.</p>
<p>The snake's fangs scrape the fabric of your robe but miss your flesh by a hair's breadth. You watch as the creature hisses and retreats into the underbrush. Your heart races from the close encounter, but you're unharmed.</p>
<p>You make your way back to the sect with relief, as you've narrowly avoided the danger. You find a senior disciple and report the incident, wanting them to know about the incident.</p>
<p>To your surprise, the senior gives you a stern glare and chastises you for letting the beast escape. They express their frustration about how they needed that specific beast core to craft beauty pills for one of the inner disciples. Regardless of your actions, you're still blamed for the incident.</p>
<<else>>
<<failedRollIndicator "Divine Sense">>
<<set $stats.playerSense.current -= $seed.diceThree>>
<<changeAlert "senseCurrent" -1>>
<<set $stats.playerHealth.current -= ($seed.diceTen / 11) * $stats.playerHealth.max>>
<<changeAlert "healthCurrent" -1>>
<p>One serene <<timeRNG>>, as you <<walking>> through the tranquil bamboo forest on your way to the <<outerLocationRNG>>, a sudden, sharp pain sears through your leg. You cry out in surprise and pain, collapsing to the ground. Clutching your wounded calf, you spot a slithering, venomous serpent disappearing into the underbrush.</p>
<p>As realization dawns, you understand that you've been bitten by a demonic brown-scaled snake. A somewhat rare creature that had managed to evade capture from the sect's alchemy pavilion. Panic surges through you as you recall the rumors of the snake's potent venom.</p>
<p>You hobble back to your sect, pain shooting through your leg with each step, and report the incident to a senior disciple. To your surprise, instead of helping you, the senior gives you a stern glare and blames you for allowing the beast to escape. You then have to listen to the ranting, about how they needed that specific beast core to make beauty pills for one of the inner disciples.</p>
<</if>>
<<if $core.charm > 6>>
<<successRollIndicator "Charm">>
<<set $stats.playerMentalState.current += $seed.diceThree>>
<<changeAlert "mentalCurrent" 1>>
<p>However, as you listen to their frustrations, you decide to talk your way out of it. You speak with eloquence and use your $player.face face, explaining the situation, and offering your help to recapture the escaped snake. Because of that, they decide not to fine you for the incident, realizing it was an unfortunate accident.</p>
<<else>>
<<failedRollIndicator "Charm">>
<<set $faction.contributionPoints -= -3>>
<<changeAlert "contributionPoints" -3>>
<<set $stats.playerMentalState.current -= random(1,3)>>
<<changeAlert "mentalCurrent" -1>>
<p>Despite you trying to reason with the senior disciple, your words fall on deaf ears. You lack charisma and you're just not good-looking enough. They not only blame you but also impose a fine for your negligence.</p>
<p>Well, that's depressing.</p>
<</if>><<run $event.available.delete("theWorldOfTheStrong")>>
<<generateNPC "male">>
<<set $active.NPC.role = "young master">>
<<npcObjectCollection>>
<p>The Pure Valley sect doesn't really have that many rules. They have the obvious, you shall not kill your fellow disciples (unless you have permission to do so), you shall not do anything that would hurt the sect and you shall always pay your annual contribution to the sect. Beyond that, if you have the strength to back your actions, you're free to do almost everything. Even things that are obviously immoral back on earth.</p>
<p>Today, one of the disciples got robbed by another disciple in broad daylight.</p>
<p>From what you heard, the robber is the grandson of one of the Outer Sect Elders called <<npcFullName>>. That was why, even when the victim tried to fight back, he just got beat up without any help from the people watching.</p>
<p>Including you.</p>
<p>From a distance, you witnessed the incident happened. The victim was no stranger; this same disciple did the same thing a week before to another fellow disciple. So he's not exactly a good person to begin with. You feel nothing for his suffering.</p>
<p>After you sighed as you stopped watching. While you walked away, you promised yourself to always be prepared for anything. This is a dangerous world. And if you want to survive, you have to be strong.</p><<run $event.available.delete("crystalDragon")>>
<<set $active.decisionLocked = true>>
<<ctp "crystalDragon">>
<p>You're reading in your room late at night when you hear someone crying. The sound is coming from the backyard. It's not actually close to your room, but since you became a cultivator, even your hearing is becoming stronger.</p>
<<if $stats.playerSense.current > 15>>
<<successRollIndicator "Divine Sense">>
<p>You sent your divine sense outside and found a sliver of strange spiritual energy floating around.</p>
<<else>>
<<failedRollIndicator "Divine Sense">>
<p>You sent your divine sense outside and found nothing out of the ordinary.</p>
<</if>>
<p>After thinking about it for a short while, you decide to go outside and check.</p>
<p>As you walk down the stairs of the outer sect dormitory, you start to wonder why there's no one else besides you going outside to investigate. Because even right now, the sound is only getting louder.</p>
<p>Then you start to get scared. Maybe you shouldn't do this. This world is just too strange to do something like this without any preparation.</p>
<p>You're on the verge of giving up and turning back to your room when you finally arrive in the backyard. You notice there's someone hanging upside down on a large tree. You remember someone telling you that the tree has been there for hundreds of years now. Not sure if that little trivia is related to this peculiar situation.</p>
<<done>>
<<replace ".scene-links">>
<<link "Next">>
<<ctpAdvance "crystalDragon">>
<</link>>
<</replace>>
<</done>>
<<ctpNext clear>>
<p>"Excuse me, senior?" You decide to be bold and greet the person. "Are you the one that was crying earlier?"</p>
<p>The person turns their head and answers, "Yes."</p>
<p>It's an old man with a weird eerie smile. He has long and very feminine white silky hair flowing down, almost reaching the ground.</p>
<p>"May I ask what happened? Is everything alright?"</p>
<p>He smiles again and says, "You're not supposed to be here."</p>
<p>"What do you mean, senior?"</p>
<p>He shakes his head and replies, "This world is not meant for you."</p>
<p>His behavior is making you feel even more nervous. Something is wrong.</p>
<p>"Can you please elaborate?"</p>
<p>You can see he doesn't want to tell you anything. However, you have come all this way, so you don't want to give up. You continue asking him questions until he answers, "I will make sure the crystal dragon dies."</p>
<p>"Crystal dragon?"</p>
<p>You suddenly feel drowsy, and your head is getting heavier. Your body feels numb as you fall unconscious.</p>
<p>You wake up in your room. As you try to move your body, you realize you are dreaming. It was a very vivid and strange dream. And for some unexplained reason, you couldn't stop thinking about that old man.</p>
<p>Surprisingly, something else happened. You suddenly enlightened on several concepts of cultivation you didn't understand before, which increased your breakthrough chance.</p>
<<set $breakthrough.bonus += $seed.diceTen>>
<<changeAlert "breakthroughBonus" 1>>
<<done>>
<<returnLink>>
<</done>>
<</ctp>>/*
On a bright morning, you're summoned by one of the outer sect elder to their chamber. Anticipation fills you as you imagine the possibility of an important task that could help you get more resources. The elder, a stern figure, informs you that there's a task to be completed, seemingly an opportunity for you to prove your worth.
However, as the elder reveals the task, it becomes evident that it's nothing but a mundane chore—cleaning and organizing a storage room filled with dusty and neglected items. You're disheartened, for this task hardly seems like a path to greatness in the world of cultivation.
With a heavy heart, you begin the laborious work of cleaning and sorting, all the while aware that your peers are engaged in meaningful training and advancement. The menial task feels like a setback, and it's difficult not to resent the wasted potential and opportunity cost.
As hours turn into days, you toil away, your initial excitement fading into frustration. It's a reminder of the hierarchy within the sect and the need to prove yourself even in the most thankless of situations.
Despite the setback, you vow to complete the task with diligence, determined to find a way to turn this seemingly trivial chore into an opportunity for growth. The path to greatness in the xianxia world is filled with unexpected challenges, and you're prepared to overcome them.
I hope this scene offers the variety you're seeking. If you have any specific ideas or adjustments you'd like to incorporate, please let me know.
*/
/*
One ordinary day, as you diligently practice your cultivation techniques in a secluded corner of the sect's library, you overhear hushed whispers and footsteps behind the ancient shelves. Curiosity piqued, you investigate, only to find a shadowy figure hastily making their way out, clutching a bundle of sacred scrolls.
With a sinking feeling, you realize that the scriptures they're stealing are vital texts containing ancient techniques and profound knowledge. In a split second decision, you give chase, but the thief, swift and elusive, manages to evade you.
Returning to the library, you report the theft to the sect elders. To your dismay, they express their disappointment and scold you for not guarding the precious scriptures more diligently. The weight of their disappointment presses upon you, emphasizing your lowly status as a cultivator.
As the news spreads, fellow disciples whisper behind your back, casting suspicious glances in your direction. The incident becomes a stain on your reputation, a reminder of your inability to protect valuable knowledge. In the competitive world of xianxia, the loss of these scriptures serves as a harsh lesson about the importance of vigilance and the consequences of failure.
*/
/* :: misunderstandingUnfoldsEvent [scenes]
<<generateNPC>>
<<npcObjectCollection>>
<<set $active.NPC.role = "first rival">>
<<run $event.available.delete("misunderstandingUnfolds")>>
<p>While walking through the lively training grounds during <<timeRNG>>, you encounter one of your fellow disciples. <<His>> name is <<npcFullName>>, a figure who has always been somewhat reserved and enigmatic. As you exchange greetings, an unintended remark escapes your lips, a seemingly harmless comment that you didn't anticipate could be offensive.</p>
<p>In the brief moment following your words, you sense a subtle shift in <<his>> demeanor. <<His>> expression darkens, and you then realize that you've unwittingly touched upon a sensitive topic. The atmosphere grows tense, and you desperately wish you could retract your words.</p>
<p>Your fellow disciple, clearly affected by your comment, offers you a tense nod and quickly departs. Leaving you pondering the repercussions of your thoughtless words.</p> */
/*
<<done>>
<<replace ".scene-links">>
<<link "Confront Directly">>
<<append ".passage-main">>
<p></p>
<<if $player.level < 4>>
<<set $stats.playerHealth.current += random(1, 5)>>
<<changeAlert "healthCurrent" -1>>
<<set $stats.playerMentalState.current -= random(2, 5)>>
<<changeAlert "mentalCurrent" -2>>
<<set $faction.contributionPoints -= 2>>
<<changeAlert "contributionPoints" -2>>
<p></p>
<<returnLink "Return To Your Dorm">>
<<elseif $player.level === 4>>
<<set $faction.contributionPoints -= 2>>
<<changeAlert "contributionPoints" -2>>
<p></p>
<<returnLink "Return To Your Dorm">>
<<else>>
<<set $stats.playerMentalState.current += random(2, 5)>>
<<changeAlert "mentalCurrent" 2>>
<<set $faction.contributionPoints -= 2>>
<<changeAlert "contributionPoints" -2>>
<p></p>
<p></p>
<<returnLink "Return To Your Dorm">>
<</if>>
<</append>>
<</link>>
<<link "Attempt to Defuse the Situation">>
<<append ".passage-main">>
<p></p>
<<if $core.charm < 6>>
<<set $stats.playerMentalState.current -= random(2, 5)>>
<<changeAlert "mentalCurrent" -2>>
<p></p>
<<returnLink "Return To Your Dorm">>
<<else>>
<<set $stats.playerMentalState.current += random(1, 3)>>
<<changeAlert "mentalCurrent" 2>>
<p></p>
<<returnLink "Return To Your Dorm">>
<</if>>
<</append>>
<</link>>
<</replace>>
<</done>>
*/
/*
<<if $player.>>
<</if>>
<<run $event.available.delete("jadeMaidenEvent")>>
<<generateNPC>>
<<set $active.NPC.role = "elitist disciple">>
<<set $active.NPC.age = random(40, 55)>>
<<set $active.NPC.relationship = -20>>
<<npcObjectCollection>>
<p></p>
<p></p>
<p></p>
In the midst of a bright afternoon, you find yourself seated in the bustling dining room of your dormitory. The clinking of dishes and the chatter of fellow disciples fill the air as you savor your meal.
Amid this ordinary setting, your attention is suddenly drawn to an extraordinary sight. A radiant maiden, her beauty rivaling the finest jade, graces the room with her presence. She is accompanied by a male cultivator, whose flattery flows like an unending river. His compliments seem ceaseless, and he wears the expression of one who is entirely captivated by her charm.
Your eyes involuntarily fixate on this enchanting display. The male cultivator, aware of your presence, swiftly pivots to face you. His expression sours, and he brusquely commands you to step aside, his impatience evident in his tone.
*/
/*
<<set $nextLink to "processing">>\
<h1><center>Something Happened… - Year $year</center></h1>
You never understand the hardship of cultivation when you're still only reading about it in some novel when you were on Earth. But after experiencing it yourself you realize. It's a very hard thing to do. Not only do you have to keep your focus on circulating your qi while protecting your dantian, but you can't even waver and think about other things that could disturb your state of mind.
That is why, on this particular evening, you decide to stroll and enjoy the majestic scenery in the forest on the western side of the sect. You're planning to maybe enjoy the sunset as you sip the plum tea you brought from the dorm.
Suddenly, you notice something drop from one of the trees.
Curious and also kind of hopeful for it to be a tasty fruit or something, you decide to check it out.
<<set _dice = random(1,12)>>\
<<if _dice gte 10>>\
<<set $mood = ($mood + random(1,10))>>\
<<moodLimit>>\
<<notify 2s>><span class="notifygood">Mood Improved!</span><</notify>>\
When you arrive, you actually find a pouch filled with spirit stones! Wait, how did it get here? You look up, but you find nothing.
You decide not to think about it too much and be happy with this fortunate encounter.
<<elseif _dice gte 4 and _dice lte 9>>\
When you arrive, you find a broken branch. Which is make perfect sense. You laugh at yourself for thinking it could be something good.
<<elseif _dice lte 3>>\
<<set $mood = ($mood - random(5,15))>>\
<<moodLimit>>\
<<notify 2s>><span class="notifybad">Mood Decreased!</span><</notify>>\
When you arrive, you find a dying eagle with a broken wing. It looks so pitiful and just give you a weak stare. You're not sure what happened to the poor bird but you don't want it to suffer much longer.
PANG!
You sent out a palm and hit its neck to give it an instant death. After that, you let out a sigh. This whole thing is just making your mood even worse.
<</if>>\
<div id= "devnotes">A placeholder scene for fortunate/mood-related random event in the future (so, nothing here affect you, not event the spirit stones, since I have implement currency yet). Might also have other branching consequences in the future. </div>
<<ui update>>\
**Consequence 1: Unwavering Focus**
As you venture into the tranquil forest to enjoy the scenery, you find a secluded spot with a perfect view of the sunset. With your plum tea in hand, you sit down to savor the moment. Your cultivation insights come into play here. You manage to maintain your unwavering focus, even as you enjoy the beautiful scene. This experience strengthens your mental discipline and concentration, improving your cultivation abilities. You gain a temporary boost in Qi control, making your future cultivation sessions more productive.
**Consequence 2: Distraction and Struggle**
While you sit in the forest, attempting to enjoy the majestic scenery and sip your tea, you find it challenging to keep your focus solely on the present moment. The beauty of the world around you captivates your senses, and your thoughts wander. Your attempt to balance cultivation and leisure becomes a struggle, as you occasionally waver in your mental state. You gain valuable experience about the challenges of maintaining focus and managing distractions in the midst of nature. However, your Qi control may slightly decrease due to these mental fluctuations.
**Consequence 3: Unexpected Encounter**
As you immerse yourself in the forest's beauty, an unexpected encounter occurs. Another disciple, more experienced than you, approaches. They see you enjoying the sunset and offer to share some insights into cultivating amidst nature's splendor. This unexpected guidance provides you with a fresh perspective and tips on enhancing your cultivation. While you might not fully master the technique immediately, it opens new avenues for you to explore in your journey as a cultivator. Your Qi control remains unchanged, but you gain knowledge and a potential mentor.
*/<<include "Top_Navbar_Menu">>
<<hideMenu>>
<div id="container-main">
<div class="chapter-header -textcenter">
Skill
</div>
<div class="passage-main">
<p>You stand at the outer disciple training yard, surrounded by the hustle and bustle of fellow disciples honing their skills. The sun beats down upon you, casting a warm glow over the training grounds as you ponder about.</p>
</div>
<div class="container-skill-1">
<div class="skill-top">
<div class="skill-list">
<div class="skill-list-tabs">
<<listen>>
<<radiobutton "$active.skillType" "internal" checked>>
<label for="radiobutton-activeskilltype-0" checked="checked">INTERNAL</label>
<<radiobutton "$active.skillType" "attack">>
<label for="radiobutton-activeskilltype-1">ATTACK</label>
<<radiobutton "$active.skillType" "defense">>
<label for="radiobutton-activeskilltype-2">DEFENSE</label>
<<radiobutton "$active.skillType" "movement">>
<label for="radiobutton-activeskilltype-3">MOVEMENT</label>
<<when>>
<<replace ".skill-list-content">>
<<populateSkill>>
<</replace>>
<</listen>>
</div>
<div class="skill-list-content">
<<populateSkill>>
</div>
</div>
</div>
<div class="skill-current">
<div class="skill-current-header">EQUIPPED SKILL</div>
<div>
<div class="skill-current-internal">Internal: <<live $active.cultivating>></div>
<div class="skill-current-attack">Attack: Nothing</div>
<div class="skill-current-defense">Defense: Nothing</div>
<div class="skill-current-movement">Movement: Nothing</div>
</div>
</div>
<div class="skill-focused">
<div>FOCUSED SKILL</div>
<div><<live $active.learning>></div>
</div>
</div>
</div>
<<backButtonPassage>><div id="container-start">
<div class="game-logo">
<img src="assets/img/XSLogo.svg" alt="Xianxia Simulator Logo">
</div>
<div class="passage-main">
<p>Hello, my name is <strong>Captain Wabbit</strong>, and welcome to <strong>Xianxia Simulator</strong>, a text-based life simulation immortal cultivation RPG where you play as a cultivator trying to survive in the cultivation world. Your goal, like most cultivators, is to ascend to immortality. However, you may have other goals as well.
</p>
<p>In this game, you will need to balance your time between cultivating, maintaining relationships with randomly generated NPCs, learning new skills and knowledge, exploring the world, and surviving threats from other cultivators and other dangers.</p>
<p>Please be aware that the game is still in very early development and is constantly changing with every update. Currently, many elements and mechanics in the game are placeholders for future content. As such, you may encounter repetitive text, amateurish implementation, imbalances, typos, bugs and other imperfections.</p>
<p>Hint: If you're having problem from getting decision locked, you probably need to pick an option below. If you couldn't see it because it's hidden under a toolbar, you can also press 'h' to hide the toolbar. All keyboard shortcut can be found on the 'shortcut' topbar.</p>
</div>
<div class="passage-start-links">
<div>[[New Game|CreateCharacter]]</div>
<div>
<<link "Continue">>
<<script>>
UI.saves ();
<</script>>
<</link>>
</div>
<div>[[Road Map|roadmap]]</div>
<div>[[Change Log|log]]</div>
<div>[[About|about]]</div>
<div>[[Credits|credits]]</div>
</div>
</div>
<div class="kofi">
<a href='https://ko-fi.com/N4N4EBDZ6' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi3.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
</div><div class="-center-center">
<button aria-label="Hey tooltip!" data-microtip-position="bottom" role="tooltip">
Hey
</button>
</div>
/*
const button = document.querySelector('#button');
const tooltip = document.querySelector('#tooltip');
computePosition(button, tooltip, {
placement: 'left',
}).then(({ x, y }) => {
Object.assign(tooltip.style, {
left: `${x}px`,
top: `${y}px`,
});
});
*/
[[back|Start]]<<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">Create a new character...</div>
<div class="passage-main">
<p>You find yourself suspended in a black, empty void where nothingness prevails. Your head feels heavy, and you have no memory of how you ended up here. You try to fight the disoriented feeling while trying to make sense of your surroundings.</p>
<p>After a short moment, you begin to search your brain for a name. Your name. It supposes to be simple, but it feels like even this trivial information is beyond your grasp. </p>
<p>Who are you? Where are you? What are you even doing here? These questions swirl around non stop inside your head. All you know for certain is that you are alone in this dark, empty void, completely lost and uncertain of what the future holds.</p>
</div>
<div class="creation-option">
<div class="-center-horizontal margin-rem -textuppercase orange">
Please enter your name:
</div>
<div class="name-box">
<div class="margin-rem"><<textbox "$player.lastName" "Wu" autofocus>> </div>
<div class="margin-rem"><<textbox "$player.name" "Fei">></div>
</div>
<div class="margin-top-2rem">
<<link "Confirm">>
<<if ($player.name === "") || ($player.lastName === "")>>
<<dialog "Confirm">>
<p>Are you sure you don't want to enter your name?</p>
<div>
<<link "Yes" "Gender">>
<<set $player.lastName = "Wu">>
<<set $player.name = "Fei">>
<<dialogclose>>
<</link>>
</div>
<div>
<<link "No">>
<<dialogclose>>
<</link>>
</div>
<</dialog>>
<<else>>
<<goto "Gender">>
<</if>>
<</link>>
</div>
<div class="dev-notes">
(Hint: In Chinese, the family name goes first before the given name. For example, Guan Yu, Guan is the family/last name while Yu is the given name)
</div>
</div>
</div><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">Gender</div>
<div class="passage-main">
<p>While floating through the dark, empty space, you stop for a moment to try to remember your gender. You already remembered your name, but your gender remains something you've yet to grasp. You feel a sense of discontent as you struggle to understand your identity.</p>
<p>Fortunately, while you couldn't really understand the reason, the vastness of this dark void seems to ease your racing thoughts. After a while, you come to a decision: </p>
<p>You're a <span id="gender" class="blue"><<print $player.gender>></span>.</p>
</div>
<div class="creation-option">
<div class="margin-top-2rem">
<<link "Male">>
<<set $player.gender to "male">>
<<replace "#gender">><<print $player.gender>><</replace>>
<</link>>
</div>
<div>
<<link "Female">>
<<set $player.gender to "female">>
<<replace "#gender">><<print $player.gender>><</replace>>
<</link>>
</div>
<div class="margin-top-2rem">
<<link "Confirm" "Allocation">>
<<if $player.gender === "male">>
<<set $player.sex = 0>>
<<else>>
<<set $player.sex = 1>>
<</if>>
<</link>>
</div>
</div>
</div><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">Fate Allocation</div>
<div class="passage-main">
<p>Waves of bluish energy begin to force their way inside of your body. You're still not sure what is happening but for some reason, you know that an unknown entity is making a decision for you.</p>
</div>
<div>
<div class="-textcenter -text-x-large">
Allocate your Fate : <span class="fate-points"><<print $core.fate>></span>
</div>
<div class="container-fate">
<div class="container-stat-allocation">
<div>
Body
</div>
<div>
Comprehension
</div>
<div>
Psyche
</div>
<div>
Charm
</div>
<div>
Potential
</div>
</div>
<div class="container-button-allocation">
<div>
<<button "+">>
<<allocateCoreBody>>
<</button>>
<<button "-">>
<<deallocateCoreBody>>
<</button>>
</div>
<div>
<<button "+">>
<<allocateCoreComprehension>>
<</button>>
<<button "-">>
<<deallocateCoreComprehension>>
<</button>>
</div>
<div>
<<button "+">>
<<allocateCorePsyche>>
<</button>>
<<button "-">>
<<deallocateCorePsyche>>
<</button>>
</div>
<div>
<<button "+">>
<<allocateCoreCharm>>
<</button>>
<<button "-">>
<<deallocateCoreCharm>>
<</button>>
</div>
<div>
<<button "+">>
<<allocatePlayerTalent>>
<</button>>
<<button "-">>
<<deallocatePlayerTalent>>
<</button>>
</div>
</div>
<div class="container-indicator-allocation">
<div><span class="indicator-body">( 5 ) Average</span></div>
<div><span class="indicator-comp">( 5 ) Ordinary</span></div>
<div><span class="indicator-psyche">( 5 ) Steady</span></div>
<div>
<span class="indicator-charm">
( 5 ) Plain
</span>
</div>
<div>
<span class="indicator-roots">
( 1 ) False
</span>
</div>
</div>
</div>
<div class="margin-top-2rem -textcenter">
<div>
<<link "Confirm" "Prologue">>
<</link>>
</div>
<div>
<<link "Skip Prologue" "main">>
<<initializePlayer>>
/* <<set $inventory["Lesser Healing Pill"] = {quantity: 1}>>
<<set $inventory["Lesser Qi Gathering Pill"] = {quantity: 1}>> */
<<addSkill "Breath Control Technique">>
/* DELETE THIS */
/* <<addSkill "Yin-Yang Balance Method">> */
<<set $cultivation.skill = "Breath Control Technique">>
<<prepareQuest>>
<<generateNPC "female">>
<<set $teacher = $active.NPC.lastName + " " + $active.NPC.name>>
<<set $active.NPC.role = "master">>
<<set $active.NPC.relationship = 60>>
<<npcObjectCollection>>
<<generateNPC>>
<<set $active.NPC.role = "first friend">>
<<npcObjectCollection>>
<</link>>
</div>
</div>
</div>
</div><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Prologue
</div>
<div class="passage-main">
<p>You are a nobody, a loner, and a coward. That's who you are. This is normal, considering that unlike most people in this realm, you were actually someone from Earth.</p>
<p>You were 25 years old with two older siblings whom you got along with nicely. You had a cool dad who worked in retail while spending his free time playing D&D with his old high school friends. You had a cheerful mom who was obsessed with trying to make her children laugh. You were also engaged to a
<<if $player.gender is "male">>
beautiful woman
<<else>>
handsome man
<</if>>
who had been your best friend since you were in 1st grade. Life was good to you.</p>
<p>Well, that was until you were killed by a truck. You were trying to save a little girl from getting hit. You didn't even know her. You just jumped without any thought whatsoever and pushed the little girl away, killing yourself in the process.</p>
<p>Why did you do that? You weren't even that nice of a
<<if $player.gender is "male">>
guy.
<<else>>
girl.
<</if>>
</p>
<p>Was it because your parents raised you right? Was it because the girl was just a child and you wanted her to have a future? You are unsure about everything. But the most confusing thing about all of this is that instead of dying, you suddenly woke up as a newborn baby
<<if $player.gender is "male">>
boy
<<else>>
girl
<</if>>
in a new world.
</p>
</div>
<div class="margin-vertical -textcenter">
[[Reincarnate|wdvillage]]
</div>
</div>
<<initializePlayer>>
/* <<set $inventory["Lesser Healing Pill"] = {quantity: 1}>>
<<set $inventory["Lesser Qi Gathering Pill"] = {quantity: 1}>> */
<<addSkill "Breath Control Technique">>
/* DELETE THIS */
/* <<addSkill "Yin-Yang Balance Method">> */
<<set $cultivation.skill = "Breath Control Technique">>
<<prepareQuest>><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Prologue
</div>
<div class="passage-main">
<p>You were born in a small village called White Deer Village, located within the borders of the State of Yuan on the eastern edge of the Zhao Empire. Although the village is quite beautiful, not many people know about it, mostly because it is too far from the nearest settlement. There was only one road, wide enough for carriages, in the southern part of the village, and your new father was one of the drivers.</p>
<p>On the day you were born, your father was drunk after losing money in a dice game and blamed you for it. It was irrational and stupid, something you later realized was fitting of him. Your second childhood was not a happy one. You were too different from the other children. You could walk at six months, talk at one year, read at two years, and when you were three, you managed to read all the books in the small village library. Everyone thought you were a monster.</p>
<p>For a long time, you were bullied by everyone, including all six of your siblings. They made fun of your $player.skin skin, beat you up, and stole your food. It got even worse because your father encouraged this behavior and your mother didn't care. There was nothing you wanted more in life than to go back to Earth and be with your actual family.</p>
</div>
<div class="margin-vertical -textcenter">
[[Until one day|catalyst]]
</div>
</div><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Prologue
</div>
<div class="passage-main">
<p>Until one <<timeRNG>>, when you were about eight years old, your father came home with a stranger. She was a wandering female cultivator with a sword hanging on her back. You were shocked. This was the first time you saw a real-life cultivator. Without saying anything, she put her palm on your head and suddenly, you felt somewhat warm.</p>
<p>"Good, <<playerHe>> has <<playerRoots>> roots. This is a <<= $player.potential>> talent. <<PlayerHe>> should be able to be a cultivator," she said after a few seconds staring at your <<charmIndicator>> face. </p>
<p>Pang!</p>
<p>With a wave of her hand, she threw a pouch filled with coins to the ground. "You're now my slave, child." With those words, you felt your body start to levitate and fly slowly towards her. You were panicking. This was your first time seeing something so magical.</p>
<p>You wanted to tell her no, but when you looked at your parents' greedy expressions, you realized they were the ones who sold you to her. You were heartbroken and angry, but you knew there was nothing you could do. You were now a slave, bound to serve this cultivator and do whatever she commanded.</p>
</div>
<div class="margin-vertical -textcenter">
[[A New Master|master]]
</div>
</div>
<<generateNPC "female">>
<<set $teacher = $active.NPC.lastName + " " + $active.NPC.name>>
<<set $active.NPC.role = "master">>
<<set $active.NPC.relationship = 60>>
<<npcObjectCollection>><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Prologue
</div>
<div class="passage-main">
<p>You watched <<his>> stoic face as <<he>> stare into the distance. Like <<he>> was sensing something from a large distance. After a while, <<he>> then flicked <<his>> wrist and produced a letter and a wooden badge out of thin air. An action you've already seen <<his>> do, for so many times.</p>
<p>You accepted silently as <<he>> gave you the two things and told you to travel north and find the Pure Valley Sect. <<His>> enemy is coming, and <<he>> might not survive. <<He>> looked at you gently as <<he>> patted your head for the first and the last time, and told you to join the sect.</p>
<p>As you listened to <<his>>, tears began to well up in your eyes. You didn't want to leave <<his>>, your only friend and mentor. You begged <<his>> to let you stay and help <<his>> fight, but <<he>> just shook <<his>> head and told you that you were not ready.</p>
<p>Despite your sadness and protests, <<npcFullName>> remained firm. With a sad smile, <<he>> waved <<his>> hand and teleported you away, against your will.</p>
<p>You found yourself standing in a dense forest about 50 miles away, feeling a mixture of confusion and gratitude. You knew that <<npcFullName>> had sent you away to protect you and ensure your survival. But still you can't help feeling tremendous sadness. You took a deep breath and squared your shoulders, determined to honor your master's wishes.</p>
</div>
<div class="margin-vertical -textcenter">
[[Escape|thesect]]
</div>
</div>
<<generateNPC>>
<<set $active.NPC.role = "first friend">>
<<npcObjectCollection>><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Prologue
</div>
<div class="passage-main">
<<ctp "story">>
<p>While walking up the steps of the Pure Valley sect, you take in the peaceful surroundings. The sect is nestled in a valley surrounded by lush green mountains, and a clear stream flows through the center of the compound. The scent of herbs and flowers fills the air, and the sound of chirping birds and babbling water fills your ears.</p>
<p>Despite the beauty of your surrounding you cannot shake off your tiredness. You have been traveling for days and your body aches from the long journey. Your mind is also heavy with sadness as you think about your master, who you left behind. You wonder if she was able to survive the attack and if she is wounded somewhere. The thought of her being alone and in danger weighs heavily on your mind, and you hope that by joining the Pure Valley sect, you will become stronger and might be able to meet her again.</p>
<p>"Fellow daoist, please stop right there," says a $active.NPC.weight <<male>> disciple of the Pure Valley sect, as <<he>> raises <<his>> sword. <<His>> $active.NPC.face face stares at you. "Can I ask your purpose for coming here?"</p>
<p>You let out a relieved smile as you look straight at them. A total of five disciples are guarding the entrance of the sect. You're happy to see them for an obvious reason.</p>
<<ctpNext clear>>
<p>"My name is <<playerFullName>> and I want to join the Pure Valley sect."</p>
<p>"Join our sect?" the <<male>> disciple replies, as <<he>> put down the sword. "Well then, you'll need to come back here in six months for our annual recruitment."</p>
<p>You nod and pull out the badge your master gave you. "Would this help?" you ask, holding it up for the disciples to see.</p>
<p>The <<male>> disciple glances at it, <<his>> brow furrowed. "And what is this?"</p>
<p>"It's an external elder badge," another disciple interjects.</p>
<p>"Is it?" The <<male>> disciple examines the badge more closely, <<his>> eyes narrowed. "Well, fellow daoist, I'll have to ask you to wait here for a moment while I consult with the elders." </p>
<p><<He>> gives you a polite nod before turning and disappear into the sect.</p>
<<done>>
<<replace ".scene-links">>
[[Wait|wait]]
<</replace>>
<</done>>
<</ctp>>
</div>
<div class="margin-vertical -textcenter scene-links">
<<link "Continue">>
<<ctpAdvance "story">>
<</link>>
</div>
</div><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Prologue
</div>
<div class="passage-main">
<p>After the time it takes to drink a cup of tea, the $active.NPC.weight male disciple comes back with an old cultivator, his white beard flowing down his chest.</p>
<p>"Fellow daoist $teacher is your master?" The elder asks with a tired face.</p>
<p>"Yes, elder." You reply with a bowed head.</p>
<p>"Why she's not with you?"</p>
<p>"I was given this by master," you said, pulling out the letter from your pocket and handing it to the elder.</p>
<p>The elder took the letter and read it for a few minutes before letting out a sigh.</p>
<p>"You said your name is <<playerFullName>>? Then you're welcome to join us." The elder pats your shoulder with a sad smile. "Little <<npcFullName>>, take your junior <<playerBrother>> to <<playerHis>> room." The elder says to the <<male>> disciple.</p>
<p>The elder gave you one last look before turning and walking away, his sigh hanging in the air.</p>
<p>The <<male>> disciple bowed to the elder before gesturing for you to follow.</p>
</div>
<div class="margin-vertical -textcenter">
[[Follow|purevalleysect]]
</div>
</div><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Prologue
</div>
<div class="passage-main">
<<ctp "story">>
<p>As you stroll along the path, you can't help but be struck by the scenic view of the lush green meadow that surrounds the sect. It's so peaceful and beautiful. You've probably never seen anything like this in your previous life. In the distance, the five mountains that make up the main sect are shrouded in fog. It's a truly breathtaking sight.</p>
<p>"Can I ask a question?" You glance at <<npcFullName>> as <<he>> leads you along the path.</p>
<p>"You're now an Outer Sect member," <<he>> replies. "Ask away."</p>
<p>For second, you stare at <<his>> $active.NPC.face face as you notice <<his>> $active.NPC.skin skin and $active.NPC.hair hair.</p>
<p>"How many people are in the sect?" You finally say.</p>
<p>"Excluding the non-cultivator workers, there are probably over two thousand disciples in the outer sect."</p>
<p>"That's a lot of people."</p>
<p>"I wouldn't say that. Our sect isn't the largest, but we still have a good reputation. So even as outer disciples, we'll still have a good life. But nothing is free. You still have to pay for everything."</p>
<p>"But I have no money."</p>
<p>"It's not money. You pay with points."</p>
<p>"Points? How do we get points?"</p>
<<ctpNext clear>>
<p>"You get these points by doing the assignments the sect gives you."</p>
<p>Suddenly, you remember that you still need to learn more about this world, and maybe you could find a way to go back to Earth.</p>
<p>"Senior <<brother>>, is there a library in the sect?" you ask nervously.</p>
<p>"You mean a place where you can read books? We have a Scripture Pavilion, but it's only for inner disciples."</p>
<p>"Really? What's the requirement for Inner Sect membership?"</p>
<p>"Only disciples who have reached the Foundation Establishment stage can enter the inner sect."</p>
<p>"How long will it take me to reach that?"</p>
<p>Hearing your question, <<npcFullName>> lets out a huge laugh.</p>
<p>"Junior <<playerBrother>>, we only have about thirty inner disciples in our sect. They are all geniuses with powerful families. The chances are that, like most of us, you'll never reach that level." <<He>> pats you on the back as <<he>> continues laughing. "Just cultivate and try to stay out of trouble."</p>
<p>You try to hide your disappointment while making a mental note to do more research about the Foundation Establishment stage and how to reach it. Perhaps there is a way for you to become an inner disciple and find out more about your master's situation.</p>
<<done>>
<<replace ".scene-links">>
[[Continue|competition]]
<</replace>>
<</done>>
<</ctp>>
</div>
<div class="margin-vertical -textcenter scene-links">
<<link "Continue">>
<<ctpAdvance "story">>
<</link>>
</div>
</div><<include "Top_Navbar_Menu">>
<div id="container-prologue">
<div class="chapter-header -textcenter">
Prologue
</div>
<div class="passage-main">
<<ctp "story">>
<p>You finally arrive at the crowded, bustling outer sect area located in the northern mountain, the sights and sounds of people working towards their own goals fill your senses. Outer sect disciples sit meditating in small groups while non-cultivator workers bustle about, tending to their chores. Despite the chaos, there is a sense of community here, as everyone strives for personal advancement in the cultivation world.</p>
<p>"Every ten years, the sect hold a competition for all disciples above the eighth Stage of Qi Condensation," <<npcFullName>> tells you as the two of you walk along the crowded place. "The top three winners are rewarded with a miraculous pill that helps with cultivation, as well as other prizes."</p>
<p>You nod along, as you take all of this information.</p>
<p>"We're here," <<npcFullName>> says, stopping at one of the residential buildings. <<He>> hands you a jade slip and a wooden badge with the number 304 written on it. "Your room is on the third floor."</p>
<p>"Thank you, senior <<brother>>."</p>
<<ctpNext clear>>
<p>After glancing it for a second or two, you quickly put the room badge in your pocket. You then study the jade slip for a few moments. You're not sure what it does.</p>
<p>"This is your first time seeing a jade slip?" <<He>> looks surprised.</p>
<p>"Yes," you admit.</p>
<p>"You can imbue the slip with spiritual energy and it will guide you to the outer sect main hall."</p>
<p>"Oh, really?" you say, intrigued. You have a basic understanding of spiritual energy and how to imbue it, thanks to your master's teachings.</p>
<p>"There is also a map in your room if you prefer doing it like mortals," <<he>> says with a smile, watching you study the jade slip.</p>
<p>"Don't worry, senior <<brother>>. I'll be fine," you assure <<him>>.</p>
<p><<npcFullName>> nods and then leaves. You watch <<his>> back for a few moments before entering the dorm and quickly finding your new room.</p>
<<done>>
<<replace ".scene-links">>
[[Your New Room|main]]
<</replace>>
<</done>>
<</ctp>>
</div>
<div class="margin-vertical -textcenter scene-links">
<<link "Continue">>
<<ctpAdvance "story">>
<</link>>
</div>
</div><a href="https://ko-fi.com/captainwabbit" target="_blank" rel="noopener">Donate to Ko-Fi</a>
<a href="https://twitter.com/captain_wabbit" target="_blank" rel="noopener">Check out my Twitter</a>
<a href="https://discord.gg/TbHWktqUhj" target="_blank">Join Discord</a><!-- https://www.motoslave.net/sugarcube/2/docs/#special-passage-storyinterface -->
<!-- take note of 'data-init-passage' and 'data-passage' -->
<div id="interface">
<!-- you must have one element with #id of 'passages' -->
<div id="passages">
</div>
<div id="" data-passage=""></div>
</div><!-- (A) MENU WRAPPER -->
<nav id="hamnav">
<!-- (B) THE HAMBURGER -->
<label for="hamburger">☰</label>
<input type="checkbox" id="hamburger"/>
<!-- (C) MENU ITEMS -->
<div id="hamitems">
<<if passage() == "main">>
<<link "Saves">>
<<run Engine.play(State.passage)>>
<<script>>
UI.saves ();
<</script>>
<</link>>
<</if>>
<<link "Restart">>
<<run UI.restart()>>
<</link>>
<<link "Support">>
<<run UI.share()>>
<</link>>
<<link "Setting">>
<<run UI.settings()>>
<</link>>
<<link "Shortcuts">>
<</link>>
</div>
</nav>
<div id="shortcut-screen">
<div id="shortcut-box">
<div id="menu-title" class="chapter-header -textcenter">
Keyboard Shortcuts
</div>
<div id="shortcut-list" class="-center-center">
<table class="shortcut-table">
<tr>
<th>SCREEN</th>
<th>KEY</th>
</tr>
<tr>
<td>Hide bottom bar</td>
<td>h</td>
</tr>
<tr>
<td>Character screen</td>
<td>c</td>
</tr>
<tr>
<td>Inventory screen</td>
<td>i</td>
</tr>
<tr>
<td>Task screen</td>
<td>q</td>
</tr>
<tr>
<td>Travel screen</td>
<td>t</td>
</tr>
<tr>
<td>This shortcut info</td>
<td>s</td>
</tr>
</table>
</div>
<div class="orange-button -center-center margin-top-1rem">
<button class="shortcut-close">
Close
</button>
</div>
</div>
</div>
<<script>>
$(function() {
function toggleScreen(myDiv) {
if (myDiv.css("display") === "none") {
$("#task-screen").css("display", "none");
$("#travel-screen").css("display", "none");
$("#menu-screen").css("display", "none");
$("#inventory-screen").css("display", "none");
$("#shortcut-screen").css("display", "none");
myDiv.toggle(500);
myDiv.css("display", "grid");
}
else {
myDiv.toggle(500);
}
}
$("#hamitems a.link-internal:last-child").on( "click", function() {
let myDiv = $("#shortcut-screen");
toggleScreen(myDiv);
});
$(".shortcut-close").on("click", function(event) {
let myDiv = $("#shortcut-screen");
toggleScreen(myDiv);
})
});
<</script>>
<<script>>
$(function () {
function toggleScreen(myDiv) {
if (myDiv.css("display") === "none") {
/* $("#task-screen").css("display", "none");
$("#travel-screen").css("display", "none");
$("#menu-screen").css("display", "none");
$("#inventory-screen").css("display", "none");
$("#shortcut-screen").css("display", "none");*/
$("#task-screen, #travel-screen, #menu-screen, #inventory-screen, #shortcut-screen").hide();
myDiv.toggle(500);
myDiv.css("display", "grid");
}
else {
myDiv.toggle(500);
}
}
Mousetrap.bind('s', function() {
let myDiv = $("#shortcut-screen");
toggleScreen(myDiv);
});
});
<</script>><div id="continue-button">
<<button '$nextButton<img src="assets/img/play-button.svg" alt="End Button" class="img-play-button"> ' $nextPassage>>
<<set $active.openMenu = "end">>
<</button>>
</div><div id="menu-button">
<<button '<<playerFullName>><img src="assets/img/character.svg" alt="Character" class="img-character">'>>
<</button>>
<<button 'Storage<img src="assets/img/ring.svg" alt="Storage Ring" class="img-ring">'>>
<<refreshInventoryScreen>>
<</button>>
<<button 'Task<img src="assets/img/scroll-unfurled.svg" alt="Task" class="img-scroll-unfurled">'>>
<<populateTask>>
<</button>>
<<button 'Travel<img src="assets/img/walk.svg" alt="Walking" class="img-walk">'>>
<</button>>
<<if !($active.decisionLocked)>>
<<button '$nextButton<img src="assets/img/play-button.svg" alt="End Button" class="img-play-button">' $nextPassage>>
<</button>>
<<else>>
<<button '$nextButton<img src="assets/img/play-button.svg" alt="End Button" class="img-play-button">'>>
<<dialog "Locked">>
<p>Pick a decision to proceed.</p>
<</dialog>>
<</button>>
<</if>>
</div>
<div id="menu-screen">
<div id="menu-box">
<div id="menu-title" class="chapter-header -textcenter">
<<playerFullName>>
</div>
<div class="statusWindow">
<div class="statusWindow-health">
<img src="assets/img/hearts.svg" alt="Heart" class="img-heart"> <<healthUI>>
</div>
<div class="statusWindow-mentalstate">
<img src="assets/img/brain.svg" alt="Brain" class="img-brain"> <<mentalStateUI>>
</div>
<div class="statusWindow-cultivationBar">
<img src="assets/img/meditation.svg" alt="Meditation" class="img-meditation"> <<cultivationPercentage>>
</div>
</div>
<div class="profile-basic">
<div>
<div>Age</div>
<div>$player.age years old</div>
</div>
<div>
<div>Gender</div>
<div>$player.gender</div>
</div>
<div>
<div>Race</div>
<div>$player.race</div>
</div>
<div>
<div>Rank</div>
<div>$faction.rank</div>
</div>
</div>
<div id="menu-links">
<<disable tags().includes("limitedMenu")>>
<<button "Action" "action">><</button>>
<</disable>>
<<disable tags().includes("limitedMenu")>>
<<button "Character" "character">><</button>>
<</disable>>
<<disable tags().includes("limitedMenu")>>
<<button "Skills" "skill">><</button>>
<</disable>>
</div>
</div>
</div>
<div id="task-screen">
<div id="task-box">
<div id="menu-title" class="chapter-header -textcenter">
Task List
</div>
<div class="-textcenter">Available time: <span class="lime"><<live $time.current>></span> days</div>
<div id="task-list">
</div>
</div>
</div>
<div id="travel-screen">
<div id="travel-box">
<div id="menu-title" class="chapter-header -textcenter">
Travel
</div>
<div class="-textcenter">Available time: <span class="lime"><<live $time.current>></span> days</div>
<div id="travel-list" class="-center">
<div>
<<disable tags().includes("limitedMenu")>>
<<button "Sect" "sect">><</button>>
<</disable>>
<<disable tags().includes("limitedMenu")>>
<<button "World" "world">><</button>>
<</disable>>
</div>
<div>
<<if $year > 1>>
<<disable tags().includes("limitedMenu")>>
<<button "Shop" "shop">><</button>>
<</disable>>
<<disable tags().includes("limitedMenu")>>
<<button "Assignment" "quest">><</button>>
<</disable>>
<<disable tags().includes("limitedMenu")>>
<<button "Stroll" "stroll">><</button>>
<</disable>>
<</if>>
</div>
</div>
</div>
</div>
<div id="inventory-screen">
<div id="inventory-box">
<div id="menu-title" class="chapter-header -textcenter">
Inventory
</div>
<div class="inventory-list">
<div class="inventory-list-tabs">
<<listen>>
<label checked="checked">
<<radiobutton "$active.itemType" "pill" checked>>
PILL
</label>
<label>
<<radiobutton "$active.itemType" "manual">>
MANUAL
</label>
<label>
<<radiobutton "$active.itemType" "weapon">>
WEAPON
</label>
<label>
<<radiobutton "$active.itemType" "Misc">>
MISC
</label>
<<when>>
<<replace ".inventory-list-content">>
<<populateInventory>>
<</replace>>
<</listen>>
</div>
<div class="inventory-list-content">
<<populateInventory>>
</div>
<div class="inventory-button">
<button class="inventory-close">
Close
</button>
</div>
</div>
</div>
</div>
<<script>>
$(function() {
function toggleScreen(myDiv) {
if (myDiv.css("display") === "none") {
/*$("#task-screen").css("display", "none");
$("#travel-screen").css("display", "none");
$("#menu-screen").css("display", "none");
$("#inventory-screen").css("display", "none");
$("#shortcut-screen").css("display", "none");*/
$("#task-screen, #travel-screen, #menu-screen, #inventory-screen, #shortcut-screen").hide();
myDiv.toggle(500);
myDiv.css("display", "grid");
}
else {
myDiv.toggle(500);
}
}
$("#menu-button > button:first-child").on( "click", function() {
let myDiv = $("#menu-screen");
toggleScreen(myDiv);
});
$("#menu-button > button:nth-child(2)").on( "click", function() {
let myDiv = $("#inventory-screen");
toggleScreen(myDiv);
});
$("#menu-button > button:nth-child(3)").on( "click", function() {
let myDiv = $("#task-screen");
toggleScreen(myDiv);
});
$("#menu-button > button:nth-child(4)").on( "click", function() {
let myDiv = $("#travel-screen");
toggleScreen(myDiv);
});
$(".inventory-close").on("click", function(event) {
let myDiv = $("#inventory-screen");
toggleScreen(myDiv);
})
});
<</script>>
<<script>>
$(function () {
Mousetrap.bind('h', function() {
$("#menu-button").toggle(500);
});
Mousetrap.bind('c', function() {
$("#menu-button > button:first-child").click();
});
Mousetrap.bind('i', function() {
$("#menu-button > button:nth-child(2)").click();
});
Mousetrap.bind('q', function() {
$("#menu-button > button:nth-child(3)").click();
});
Mousetrap.bind('t', function() {
$("#menu-button > button:nth-child(4)").click();
});
})
<</script>><<set _lockID = LoadScreen.lock()>>
<<set $ID = 0>>
<<set $confirm = "">>
<<set $counter = {}>>
<<set $year = 1>>
<<set $nextButton = "END YEAR">>
<<set $nextPassage = "event">>
<<set $gameVersion = "v.0.1">>
<<set $active = {}>>
<<set $seed = {}>>
<<set $seed.diceTen = 0>>
<<set $seed.diceFive = 0>>
<<set $seed.diceThree = 0>>
<<set $seed.health = 0>>
<<set $seed.mental = 0>>
<<set $seed.qi = 0>>
<<set $flags = {}>>
/* INITIALIZE PLAYERS */
<<include initPlayer>>
/* INITIALIZE NPC */
<<include initCharacter>>
/* INITIALIZE INDICATOR TEXT */
<<include initIndicatorText>>
/* INITIALIZE FACTION */
<<include initFaction>>
/* INITIALIZE ITEMS */
<<include initItems>>
/* INITIALIZE EVENTS */
<<include initEvents>>
/* INITIALIZE ACTIONS */
<<include initAction>>
/* INITIALIZE SKILLS */
<<include initSkill>>
/* INITIALIZE COMBAT */
<<include initCombat>>
/* INITIALIZE REPORTS/LOGS */
<<include initReports>>
/* INITIALIZE DYNAMIC TEXT */
<<include initDynamicText>>
<<run LoadScreen.unlock(_lockID);>><<set setup.stats = {}>>
<<set setup.stats.function = {}>>
<<set $player = {
race: "human",
gender: "male"
}>>
/* PLAYER CORE ATTRIBUTES */
<<set $core = {
comprehension: 5,
charm: 5,
body: 5,
psyche: 5,
fate: 0
}>>
/* PLAYER STATS */
<<set $stats = {
playerHealth: {
current: 1,
max: 1,
bonus: 0,
penalty: 0,
target: "health"
},
playerMentalState: {
current: 60,
max: 100,
bonus: 0,
penalty: 0,
target: "mental"
},
playerQi: {
current: 0,
max: 0,
bonus: 0,
penalty: 0,
target: "qi"
},
playerSense: {
current: 0,
max: 0,
bonus: 0,
penalty: 0,
target: "sense"
},
playerSpeed: {
current: 0,
max: 0,
bonus: 0,
penalty: 0,
target: "speed"
}
}>>
/* PROFILE */
<<set $player.lastName = "Wu">>
<<set $player.name = "Fei">>
<<set $player.level = 1>>
<<set $player.realm = 0>> /* Shouldn't be that important for now, but this is the current realm of the player. Which started in Qi Condensation. */
<<set $player.age = 18>>
<<set $player.lifespan = 75>>
/* TALENT */
<<set $player.talent = 1>>
<<set $player.element = "">>
<<set $player.roots = "">>
<<set $player.potential = "">>
<<set $player.face = "">>
/* CULTIVATION */
<<set $cultivation = {}>>
<<set $cultivation.current = 0>>
<<set $cultivation.max = 2000>>
<<set $cultivation.gain = 0>>
<<set $cultivation.time = 0>> /* This is the day that the player used for their cultivation */
<<set $cultivation.age = 0>> /* This is how many years the player has cultivated in the current realm */
<<set $cultivation.skill = "">>
/* BREAKTHROUGH */
<<set $breakthrough = {}>>
<<set $breakthrough.check = false>>
<<set $breakthrough.step = 0>>
<<set $breakthrough.isSuccess = false>>
<<set $breakthrough.bonus = 0>> /* bonus chance of breakingthrough */
<<set $breakthrough.penalty = 0>> /* negative chance of breakingthrough */
<<set $breakthrough.bonusExtra = 0>> /* extra bonus chance of breakingthrough from external things like item, events, and others */
<<set $breakthrough.delay = 0>> /* how many years you wan to delay */
<<set $breakthrough.attempt = 0>> /* how many times the player try to breakthrough their current level. will reset after success */
/* POTENTIAL/LEVEL UP */
/* This a value that would be added to player max stat after a successful level up */
<<set $potential = {}>>
<<set $potential.health = 0>>
<<set $potential.qi = 0>>
<<set $potential.sense = 0>>
<<set $potential.speed = 0>>
<<set $potential.lifespan = 0>>
/* RECOVERY */
<<set $recovery = {}>>
<<set $recovery.playerHealth = 0.5>>
<<set $recovery.playerQi = 0.5>>
<<set $recovery.playerSense = 0.5>>
<<set $recovery.playerMentalState = 0.1>>
/* DECAY */
<<set $decay = {}>>
<<set $decay.playerHealth = 0>>
<<set $decay.playerQi = 0>>
<<set $decay.playerSense = 0>>
<<set $decay.playerMentalState = 0>>
/* PASSIVE EFFECTS */
<<set $passive = {}>>
/* ACTIVE */
<<set $active.change = "">>/* Name Bank */
<<set $counter.NPC = 0>>
<<set $character = {}>>
<<set $namedNPC = {}>>
<<set setup.lastName = [ "Ai", "An", "Bai", "Ban", "Bang", "Bao", "Bo", "Cai", "Cao", "Chang", "Chen", "Cheng", "Chi", "Chu", "Cui", "Dai", "Dan", "Deng", "Ding", "Dong", "Dou", "Du", "Duan", "Fan", "Fang", "Feng", "Fu", "Gan", "Gao", "Ge", "Gong", "Gu", "Guan", "Guo", "Han", "Hao", "Hong", "Hu", "Hua", "Huang", "Huo", "Jia", "Jiang", "Jin", "Jing", "Ji", "Ju", "Kang", "Kong", "Lai", "Lei", "Li", "Liang", "Liao", "Lin", "Ling", "Liu", "Long", "Lu", "Luo", "Ma", "Mao", "Mei", "Mo", "Mu", "Nan", "Nangong", "Niu", "Ou", "Pan", "Pang", "Qian", "Qiang", "Qin", "Qiu", "Quan", "Ren", "Rong", "Shan", "Shang", "Shen", "Shi", "Shou", "Song", "Su", "Sun", "Tang", "Tao", "Tian", "Tong", "Wan", "Wang", "Wei", "Wen", "Wu", "Xia", "Xiang", "Xiao", "Xie", "Xiong", "Xu", "Yan", "Yang", "Yao", "Ye", "Yi", "Yin", "Yuan", "Zeng", "Zhang", "Zhao", "Zhen", "Zheng", "Zhong", "Zhou", "Zhu", "Zou", "Zuo"
]>>
<<set setup.nameMale = [ "An", "Ao", "Bai", "Bang", "Bei", "Bing", "Bingbing", "Bo", "Caihuan", "Cao", "Chanjing", "Chang", "Changtai", "Chao", "Chen", "Cheng", "Chong", "Chu", "Da", "Dai", "Dan", "Ding", "Dong", "Du", "Duan", "Duanmu", "Er", "Fa", "Fan", "Fei", "Feiyu", "Feng", "Fu", "Gan", "Gang", "Gong", "Gu", "Guo", "Hao", "Han", "He", "Hong", "Huang", "Hu", "Hui", "Jia", "Jian", "Jiang", "Jin", "Jing", "Jizi", "Ju", "Juren", "Jun", "Kai", "Kang", "Kong", "Kongtian", "Kui", "Lang", "Lei", "Li", "Liang", "Ling", "Long", "Lu", "Luo", "Ma", "Man", "Ming", "Mo", "Nan", "Ning", "Ouyang", "Peng", "Piao", "Ping", "Pu", "Qian", "Qin", "Qiu", "Quanzi", "Ran", "Rui", "San", "Sha", "Shan", "Shen", "Shi", "Shui", "Song", "Sun", "Tang", "Tao", "Teng", "Tian", "Tianlong", "Tianque", "Tianren", "Tie", "Tzu", "Wan", "Wanhe", "Wang", "Wei", "Wen", "Wu", "Xi", "Xia", "Xiaobo", "Xiaofeng", "Xie", "Xing", "Xu", "Xuan", "Yan", "Yang", "Yeluo", "Yu", "Yuan", "Yun", "Yunchong", "Zhan", "Zhang", "Zhao", "Zhen", "Zheng", "Zhengyang", "Zhi", "Zhong", "Zhou", "Zhu", "Zhuo", "Zu"
]>>
<<set setup.nameFemale = [ "An", "Bao", "Beibei", "Bingbing", "Bolan", "Cai", "Cui", "Daiyu", "Daxia", "Dongmei", "Feihua", "Fengmei", "Fumei", "Gongzhu", "Guangyin", "Guilin", "Hua", "Huifang", "Jia", "Jiao", "Jinlan", "Jinglin", "Jun", "Kai", "Lan", "Lanzhi", "Lei", "Li", "Lian", "Li Mei", "Li Ming", "Li Na", "Lihua", "Liling", "Ling", "Lingxue", "Liuying", "Liwei", "Liying", "Li Yuan", "Lixue", "Mei", "Mengrong", "Mengying", "Mengxin", "Min", "Mingxia", "Nan", "Ning", "Peiling", "Ping", "Qi", "Qiaoqian", "Qinqin", "Qiu", "Ran", "Rong", "Ruiying", "Ruolan", "Shanxian", "Shaohua", "Shuang", "Susu", "Wan", "Wen", "Wu", "Xia", "Xiaohong", "Xiaoling", "Xiaomei", "Xiaoxue", "Xin", "Xing", "Xiulan", "Xue", "Ya", "Yan", "Yang", "Yao", "Yaoyi", "Yi", "Ying", "Yingzhu", "Yue", "Yulan", "Yuqin", "Yuru", "Yuzhu", "Zhifang", "Zhilan", "Zhirong", "Zhixi", "Zhu", "Zi", "Zixin", "Ziyi"
]>>
<<set setup.genderMap = {
subjective: ['he', 'she'],
objective: ['him', 'her'],
possessive: ['his', 'hers'],
determiner: ['his', 'her'],
reflexive: ['himself', 'herself'],
noun: ['man', 'woman'],
gender: ['male', 'female'],
sibling: ['brother', 'sister']
}>>
<<set $NPC = {}>>
<<set $active.NPC = {}>>
<<set $active.NPCFullName = "">><<set setup.text = {}>>
<<set setup.text.cultivationLevel = [
"1st Stage of Qi Condensation", "2nd Stage of Qi Condensation", "3rd Stage of Qi Condensation", "4th Stage of Qi Condensation", "5th Stage of Qi Condensation", "6th Stage of Qi Condensation", "7th Stage of Qi Condensation", "8th Stage of Qi Condensation", "9th Stage of Qi Condensation", "Early Stage of Foundation Establishment", "Middle Stage of Foundation Establishment", "Late Stage of Foundation Establishment"
]>>
<<set setup.text.comprehensionLevel = [
"Dim-witted", "Unexceptional", "Ordinary", "Perceptive", "Insightful", "Brilliant"
]>>
<<set setup.text.bodyLevel = [
"Feeble", "Inept", "Average", "Capable", "Talented", "Unparalleled"
]>>
<<set setup.text.psycheLevel = [
"Frail", "Fragile", "Steady", "Resilient", "Indomitable", "Transcendent"
]>>
<<set setup.text.maleCharmLevel = [
"hideous",
"ugly",
"plain",
"attractive",
"dashing",
"exquisite"
]>>
<<set setup.text.femaleCharmLevel = [
"disfigured",
"unattractive",
"plain",
"attractive",
"elegant",
"jade-beauty"
]>>
<<set setup.text.rootsLevel = [
"Mortal", "False", "Mixed", "Superior", "True", "Heavenly"
]>>
<<set setup.text.potentialLevel = [
"talentless", "barely decent but passable", "decent", "good", "great", "once in a hundred years"
]>>
<<set setup.text.fateLevel = [
"cursed",
"unlucky",
"average",
"lucky",
"fortunate",
"destined"
]>>
<<set setup.text.statGrade = [
"F", "D", "C", "B", "A", "S"
]>>
<<set setup.text.itemGrade = ["Mortal", "Magical", "Artifact", "Primordial", "Immortal"]>>
<<set setup.text.rarity = ["Common", "Uncommon", "Rare", "Epic", "Legendary"]>>
<<set setup.text.indicatorColor = ["darkred", "firebrick", "mediumvioletred", "magenta", "mediumorchid", "greenyellow", "lime", "lime"]>>
<<set setup.text.elements = ["Wood", "Fire", "Metal", "Water", "Earth"]>>
<<set setup.text.health = ["Dying", "Near Death", "Fatally Injured", "Severely Injured", "Injured", "Slightly Injured", "Fine", "Perfect Health"]>>
<<set setup.text.mentalState = ["Inner Demon", "Inner Demon Approaching", "Depressed", "Erratic", "Fine", "Calm", "Peaceful", "State of Harmony"]>>
<<set setup.text.qi = ["Depleted", "Very Low", "Low", "Faint", "Adequate", "Good", "Very Good", "Overflowing"]>>
<<set setup.text.skin = ["pale", "fair", "light", "olive", "bronze", "dark", "alabaster", "porcelain"]>>
<<set setup.text.weight = ["slender", "chubby", "skinny", "lean", "average", "slender", "lean", "toned"]>>
<<set setup.text.height = ["short", "tall", "average-height", "average-height", "very tall", "petite", "lofty", "very short"]>>
<<set setup.text.qiStrand = ["Tiny Strand of White Qi", "Faint Thread of White Qi", "Delicate White Qi Filament", "Gossamer White Qi Strand", "Subtle Pool of White Qi", "Evolving White Qi Lake", "Steady White Qi Reservoir", "Reservoir of Blue Qi", "Resilient Blue Qi Lake", "Blue Qi Ocean"]>>
<<set setup.text.qiStrandDescriptor = ["tiny, delicate strand, shimmering in a pure white light", "faint thread, still bathed in the soft white radiance", "delicate white filament, now resembling the beginnings of a small pool", "gossamer strand, its purity undisturbed", "subtle white pool, mirroring the calm surface of a tranquil qi pool", "evolving white lake, hinting at the potential depths of your inner qi", "steady white reservoir, symbolizing the strength of your spiritual energy", "vibrant blue qi, signifying newfound depth of your strength", "qualities of a resilient blue lake, a testament to your unwavering determination", "an expansive blue ocean"]>>/* player reputation and rank */
<<set $faction = {}>>
<<set $faction.rank = "Outer Sect Disciple">>
<<set $faction.contributionPoints = 0>>
<<set $faction.spiritStones = 0>>
<<set $faction.salary = 0>>
<<set $faction.rent = 2>>
<<set $faction.expense = 0>>
<<set $faction.reputation = 0>>
/* ARRAY OF QUEST NAME THAT WOULD BE AVAIABLE, SHOULD BE IN STRINGS */
<<set $faction.quest = []>>/* string value, this is where we're gonna put the name of ALL the EVENTS */
<<set setup.eventName = ["waterfall", "courtyard", "lecture", "celebration", "cultivationIsHard", "randomErrand", "sparring", "misunderstandingUnfolds", "badEncounter", "mistreatedServant", "oldFart", "missingTheOldDays", "injuredFriend", "ghostChasing", "sisterPeddler", "escapedSnake", "theWorldOfTheStrong", "crystalDragon"]>>
<<set setup.eventLibrary = {
/* random event */
waterfall: {
header: "Waterfall",
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "waterfallEvent",
minLevel: 1
},
courtyard: {
header: "Just another day",
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "courtyardEvent",
minLevel: 1
},
lecture: {
header: "A Lecture",
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "lectureEvent",
minLevel: 1
},
celebration: {
header: "Celebration",
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "celebrationEvent",
minLevel: 1
},
cultivationIsHard: {
header: `A Hard Time`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "cultivationIsHardEvent",
minLevel: 2
},
randomErrand: {
header: `An Errand`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "randomErrandEvent",
minLevel: 1
},
sparring: {
header: `Sparring`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "sparringEvent",
minLevel: 1
},
misunderstandingUnfolds: {
header: `Misunderstanding Unfolds`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "misunderstandingUnfoldsEvent",
minLevel: 2
},
goodbyeGrandmother: {
header: `Goodbye Grandmother`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "goodbyeGrandmotherEvent",
minLevel: 3
},
badEncounter: {
header: `Something Happened`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "badEncounterEvent",
minLevel: 1
},
mistreatedServant: {
header: `Mistreated Servant`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "mistreatedServantEvent",
minLevel: 1
},
oldFart: {
header: `Crazy Old Fart`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "oldFartEvent",
minLevel: 3
},
missingTheOldDays: {
header: `A Cold Night`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "missingTheOldDaysEvent",
minLevel: 2
},
injuredFriend: {
header: `A Friend in Need`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "injuredFriendEvent",
minLevel: 3
},
ghostChasing: {
header: `A ghost?`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "ghostChasingEvent",
minLevel: 2
},
sisterPeddler: {
header: `A peddler`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "sisterPeddlerEvent",
minLevel: 2
},
escapedSnake: {
header: `Snake!`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "escapedSnakeEvent",
minLevel: 2
},
theWorldOfTheStrong: {
header: `In Broad Daylight!`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "theWorldOfTheStrongEvent",
minLevel: 2
},
crystalDragon: {
header: `Who's crying?`,
canGetRandom: true,
canOnlyGetFromQuest: false,
passage: "crystalDragonEvent",
minLevel: 3
},
/* quest event */
herbGardenQuest: {
header: `Herb Garden`,
canGetRandom: false,
canOnlyGetFromQuest: true,
passage: "herbGardenQuestEvent",
minLevel: 1
},
tradeRunQuest: {
header: `Trade Run`,
canGetRandom: false,
canOnlyGetFromQuest: true,
passage: "tradeRunQuestEvent",
minLevel: 1
}
}>>
<<set $event = {}>>
<<set $event.eventPassageVisitCounter = 0>>
<<set $event.available = ["waterfall", "courtyard", "lecture", "celebration", "cultivationIsHard", "randomErrand", "sparring", "misunderstandingUnfolds", "badEncounter", "mistreatedServant", "oldFart", "missingTheOldDays", "injuredFriend", "ghostChasing", "sisterPeddler", "escapedSnake", "theWorldOfTheStrong", "crystalDragon"]>>
<<set $mainStory = ["yearOneRegistration", "yearOneCultivation"]>> /* an array of string of main story name */
/* an array of strings filled with event that player has */
<<set $player.event = []>>
<<set $active.event = "">>
/* QUEST */
<<set setup.questLibrary = {
"Spirit Garden Tending": {
description: "Our sect's spirit garden requires care and attention to nurture the spiritual herbs and plants. To complete the task, you just need to tend the garden, watering the plants, and removing any harmful pests.",
time: 30,
pay: 2,
risk: 0,
rarity: 0,
minLevel: 1,
event: "herbGardenQuest",
type: "Mental",
difficulty: 1,
cost: 0.1
},
"Apprentice's Reprieve": {
description: "One of the Elder has a busy schedule and requires someone to manage their daily tasks. As an apprentice, you must take over their mundane responsibilities, such as organizing scrolls and fetching items.",
time: 30,
pay: 1,
risk: 0,
rarity: 0,
minLevel: 1,
event: "",
type: "Mental",
difficulty: 1,
cost: 0.1
},
"Lost Juniors": {
description: "A group of new disciples has lost their way in the nearby forest. Your task is to find and guide them back to the sect safely.",
time: 30,
pay: 2,
risk: 1,
rarity: 1,
minLevel: 2,
event: "",
type: "Physical",
difficulty: 2,
cost: 0.4
},
"Inkstone Engraving": {
description: "The sect's Scripture Pavilion requires new inkstones with spiritual inscriptions. Your task is to engrave spiritual runes on the inkstones using your cultivation skills.",
time: 30,
pay: 1,
risk: 0,
rarity: 0,
minLevel: 1,
event: "",
type: "Qi",
difficulty: 1,
cost: 0.1
},
"Elderly Sage's Favor": {
description: "An elderly sage residing outside the sect requires assistance in daily tasks due to their frailty. Your task is to help the sage with chores and bring them medicinal herbs.",
time: 30,
pay: 1,
risk: 0,
rarity: 0,
minLevel: 1,
event: "",
type: "Physical",
difficulty: 1,
cost: 0.1
},
"Sect's History Archive": {
description: "The sect's Scripture Pavilion needs organizing and cataloging. Your task is to arrange the scrolls and records to preserve the sect's rich history.",
time: 60,
pay: 3,
risk: 0,
rarity: 0,
minLevel: 1,
event: "",
type: "Mental",
difficulty: 2,
cost: 0.1
},
"Divine Incense Offering": {
description: "The Divine Incense Ceremony is approaching, and you must gather rare incense materials to help the elders create a potent incense offering.",
time: 30,
pay: 1,
risk: 0,
rarity: 0,
minLevel: 1,
event: "",
type: "Physical",
difficulty: 1,
cost: 0.1
},
"Ancient Cave Exploration": {
description: "A mysterious cave has been discovered near the sect. Your task is to explore its depths and uncover any hidden treasures or ancient secrets.",
time: 90,
pay: 6,
risk: 2,
rarity: 2,
minLevel: 6,
event: "",
type: "Physical",
difficulty: 4,
cost: 0.4
},
"Elderly Disciple's Errand": {
description: "An elderly outer disciple is feeling under the weather. Because of that, you need to deliver a letter to his family in the nearby village.",
time: 14,
pay: 2,
risk: 1,
rarity: 1,
minLevel: 2,
event: "",
type: "Physical",
difficulty: 2,
cost: 0.4
},
"Alchemy Recipe Collection": {
description: "The disciple from the alchemy departement needs additional recipes for their collection. Your task is to visit nearby city and obtain new recipes.",
time: 30,
pay: 2,
risk: 1,
rarity: 1,
minLevel: 2,
event: "",
type: "Mental",
difficulty: 2,
cost: 0.1
},
"Ancient Statue Cleaning": {
description: "The sect's ancient statues have gathered dust and require cleaning to maintain their spiritual resonance. Your task is to clean the statues.",
time: 30,
pay: 1,
risk: 0,
rarity: 0,
minLevel: 1,
event: "",
type: "Physical",
difficulty: 1,
cost: 0.1
},
"Elder's Snack Request": {
description: "The Master Elder craves a specific type of sweet delicacy from a distant town. Your task is to fetch the treat.",
time: 30,
pay: 1,
risk: 0,
rarity: 0,
minLevel: 1,
event: "",
type: "Physical",
difficulty: 1,
cost: 0.1
},
"Lost Item Retrieval": {
description: "A fellow disciple has lost a precious memento during training. Your task is to find and return the lost item.",
time: 7,
pay: 1,
risk: 1,
rarity: 0,
minLevel: 1,
event: "",
type: "Mental",
difficulty: 1,
cost: 0.4
},
"Disciple's Laundry Duty": {
description: "The sect's laundry is piling up. Because the owners are the elite disciple, they only allow cultivators to wash it for them. Your task is to collect the disciples' garments and assist in washing and drying them.",
time: 30,
pay: 1,
risk: 0,
rarity: 0,
minLevel: 1,
event: "",
type: "Physical",
difficulty: 1,
cost: 0.1
},
"Lost Kitten Rescue": {
description: "An elder's kitten has wandered into a nearby forest. Your task is to find and rescue the lost kitten.",
time: 15,
pay: 1,
risk: 0,
rarity: 1,
minLevel: 1,
event: "",
type: "Physical",
difficulty: 1,
cost: 0.1
},
"Party Preparation for Elder": {
description: "One of the senior disciple requests their juniors to help with a birthday party for one of the sect elder. Your task is to help with the preparation.",
time: 20,
pay: 1,
risk: 0,
rarity: 1,
minLevel: 1,
event: "",
type: "Physical",
difficulty: 1,
cost: 0.1
},
"Help the School": {
description: "There are always demands for teachers who could teach children how to read. And for some reason, cultivators prefer cultivators to teach their children. Even if it's unrelated to cultivation.",
time: 30,
pay: 1,
risk: 0,
rarity: 1,
minLevel: 1,
event: "",
type: "Mental",
difficulty: 1,
cost: 0.1
},
"Talisman Grunt Work": {
description: "The sect's Talisman Pavilion requires staff to do gruntwork for their talisman makers. You will need to do a lot of things, including cleaning, obtaining, delivering, and even injecting qi to prepare the materials.",
time: 30,
pay: 2,
risk: 0,
rarity: 1,
minLevel: 1,
event: "",
type: "Qi",
difficulty: 1,
cost: 0.15
},
"Trade Run": {
description: "Pure Valley sect is a very big sect with many people living in its area. Your task is, to go to a nearby settlement to trade for supplies.",
time: 30,
pay: 2,
risk: 1,
rarity: 1,
minLevel: 1,
event: "tradeRunQuest",
type: "Mental",
difficulty: 2,
cost: 0.1
}
}>>
<<set $active.quest = "">>
<<set $active.questID = "">>
<<set $player.quest = []>><<set $counter.lifespanPillUsed = 0>>
<<set setup.items = {}>>
<<set setup.items.objects = {}>>
<<set setup.items.pillName = ["Lesser Healing Pill", "Lesser Qi Gathering Pill", "Lesser Spirit Recovery Pill", "Lesser Pure Heart Pill", "Qi-Blossom Petal", "Jade Vitality Herb"]>>
<<set setup.items.manualName = ["Meridian Purification Technique", "Yin-Yang Balance Method", "Breath Control Technique(2nd)"]>>
<<set setup.items.effect = {
"Lesser Healing Pill": "Recover Physical/Health",
"Lesser Qi Gathering Pill": "Increase Cultivation",
"Lesser Spirit Recovery Pill": "Recover Qi",
"Lesser Pure Heart Pill": "Recover Mental State",
"Qi-Blossom Petal": "Increase Breakthrough Chance",
"Jade Vitality Herb": "Increase Lifespan",
"Meridian Purification Technique": "Learn a skill",
"Yin-Yang Balance Method": "Learn a skill",
"Breath Control Technique(2nd)": "Unlock the next level"
}>>
<<set setup.items.description = {
"Lesser Healing Pill": "A low-quality pill that will heal some of your injuries. You can take this at any level.",
"Lesser Qi Gathering Pill": "A low-quality pill that will improve your cultivation. It will take time for it to be effective. Might also cause harm to your vitality, although it should be barely noticeable.",
"Lesser Spirit Recovery Pill": "A low-quality pill that will help you recover your qi/spiritual energy. You can take this at any level.",
"Lesser Pure Heart Pill": "A low-quality pill that will help you stabilize your mental state. This pill is one of the specialities of the Pure Valley Sect.",
"Qi-Blossom Petal": "These rare petals, when consumed, enhance the flow of qi within the cultivator, making breakthroughs slightly more attainable. Unfortunately, it will also cause harm to your qi base, although it should be barely noticeable.",
"Jade Vitality Herb": "A very rare herb that, when consumed, can increase one's lifespan. Might also cause harm to your divine sense, although it should be barely noticeable. It would lose effect after the third consumption.",
/* Manuals */
"Breath Control Technique": "A manual for the early level of an inner art called Breath Control Technique. A very common mortal level technique for beginner cultivators.",
"Breath Control Technique(2nd)": "A manual for the 4th layer of an inner art called Breath Control Technique. You need to be at least at 3rd Stage of Qi Condensation.",
"Yin-Yang Balance Method": "A manual for the early level of an inner art called Yin-Yang Balance Method. Cultivators can attain a stable foundation and better growth in exchange of slower progress.",
"Meridian Purification Technique": "A manual for the early level of an inner art called Meridian Purification Technique. Faster cultivation progress with slightly harder breakthrough.",
/* Weapons */
"Fine Steel Sword": "A well-crafted sword made of fine steel. Its curved blade and ornate hilt showcase the blacksmith mastery of the sword-making art.",
"Ornate Dragon Saber": "A beautifully adorned saber with a blade etched with intricate dragon motifs. It represents the mythical power associated with dragons and ignites the wielder's spirit. Yet in the end, it is just a pretty weapon."
}>>
<<script>>
function createItem(name, family, type, soldInShop, minLevel) {
const item = {};
item.name = name;
item.family = family;
item.type = type;
item.soldInShop = soldInShop;
item.minLevel = minLevel;
return item;
}
function createWeapon(name, soldInShop, minLevel, family, type, attack, price, grade, rarity) {
const weapon = createItem(name, "gear", "weapon", soldInShop, minLevel);
weapon.attack = attack;
weapon.price = price;
weapon.grade = grade;
weapon.rarity = rarity;
return weapon;
}
function createPill(name, soldInShop, minLevel, target, value, price, grade, penalty) {
const pill = createItem(name, "consumable", "pill", soldInShop, minLevel);
pill.target = target;
pill.value = value;
pill.price = price;
pill.grade = grade;
pill.penalty = penalty;
return pill;
}
function createManual(name, soldInShop, minLevel, target, price, grade, unlock, newLevel, newMaxUnderstanding) {
const manual = createItem(name, "consumable", "manual", soldInShop, minLevel);
manual.target = target;
manual.price = price;
manual.grade = grade;
manual.unlock = unlock;
manual.newLevel = newLevel;
manual.newMaxUnderstanding = newMaxUnderstanding;
return manual;
}
/* PILLS */
/* Create Pills have this order: name, soldInShop, minLevel, target, value, price, grade, penalty */
setup.items.objects["Lesser Healing Pill"] = createPill("Lesser Healing Pill", true, 1, "health", 5, 5, 0, 0);
setup.items.objects["Lesser Qi Gathering Pill"] = createPill("Lesser Qi Gathering Pill", true, 1, "cultivation", 500, 20, 0, 5);
setup.items.objects["Lesser Spirit Recovery Pill"] = createPill("Lesser Spirit Recovery Pill", true, 1, "qi", 5, 5, 0, 0);
setup.items.objects["Lesser Pure Heart Pill"] = createPill("Lesser Pure Heart Pill", true, 1, "mental", 5, 5, 0, 0);
setup.items.objects["Qi-Blossom Petal"] = createPill("Qi-Blossom Petal", true, 1, "breakthrough", 10, 30, 0, 0);
setup.items.objects["Jade Vitality Herb"] = createPill("Jade Vitality Herb", true, 1, "lifespan", 0.5, 70, 0, 0);
/* MANUALS */
/* Create Manuals have this order: name, soldInShop, minLevel, target, price, grade, unlock, newLevel, newMaxUnderstanding */
setup.items.objects["Yin-Yang Balance Method"] = createManual("Yin-Yang Balance Method", true, 2, "inner", 50, 0, false, 0, 0);
setup.items.objects["Meridian Purification Technique"] = createManual("Meridian Purification Technique", true, 2, "inner", 30, 0, false, 0, 0);
setup.items.objects["Breath Control Technique(2nd)"] = createManual("Breath Control Technique", true, 3, "inner", 50, 0, true, 5, 1000);
<</script>>
/* INVENTORY */
<<set $inventory = {}>>
/* <<set $inventory["Lesser Healing Pill"] = {quantity: 1}>>
<<set $inventory["Lesser Qi Gathering Pill"] = {quantity: 1}>> */
<<set $active.item = "">>
<<set $active.itemType = "pill">>
<<set $active.shopType = "pill">>
<<set $active.isShopping = true>>/* TIME */
<<set $time = {}>>
/* the amount of available time that the player has per year time */
<<set $time.current = 360>>
<<set $time.used = 0>>
<<set $time.debt = 0>>
<<set $freeTime = false>>
/* an object of key value pair with name of the action and its duration*/
<<set $action = []>>
<<set $active.action = "Cultivation">>
<<set $active.decisionLocked = false>>
/* the object where we store ALL the actions in the game */
<<set setup.actionList = ["Cultivation", "Learn", "Meditate"]>>
<<set setup.actionLibrary = {
Cultivation: {
name: "Cultivation",
description: "Spend your time cultivating. It will also help with stabilizing your cultivation base which increase your breakthrough chance to a point.",
effect: "Increased cultivation and breakthrough chance",
cost: "1 Day / Action"
},
Learn: {
name: "Learn",
description: "Work diligently to increase your understanding of your skill. This involves reading manuscripts, discussing the skill with fellow cultivators, practicing it, and engaging in other activities that might aid your research.",
effect: "Increased your focused skill",
cost: "1 Day / Action"
},
Meditate: {
name: "Meditate",
description: "Enter the state of serene meditation, calming your mind and recovering your mental state to a certain degree.",
effect: "Slowly increased your mental state",
cost: "1 day / Action"
}
}>><<set setup.skills = {}>>
<<set setup.skills.objects = {}>>
<<set setup.skills.description = {
"Breath Control Technique": "A basic inner skill technique that is commonly trained by beginner cultivators. It teaches cultivators how to regulate their breathing and absorb spiritual energy from the surrounding environment. The skill is relatively easy to learn and is often the first step in a cultivator's journey." ,
"Yin-Yang Balance Method": "An internal cultivation technique that could balance the opposing forces of yin and yang. In theory, by achieving balance, cultivators can attain a stable foundation and better growth. Altough, it will also slow down your cultivation progress.",
"Meridian Purification Technique": "A low level internal skill for early stage cultivators to cleanse and purify their meridians. By removing blockages and promoting good cultivation habits, cultivators can ensure a smooth flow of qi throughout their meridian. It's a decent technique, with faster cultivation progress. But unfortunately, this technique also make your breakthrough slightly harder.",
"Sword Qi Harmonization": "An internal cultivation technique that sword cultivators practice to synchronize their internal qi with their sword, creating a stronger connection with their weapon. By cultivating this harmony, cultivators can increase their qi, on top of increasing the responsiveness and power of their sword strikes."
}>>
<<script>>
function createSkill(name, type, rarity, levelMax, maxUnderstandingCoefficient) {
const skill = {};
skill.name = name;
skill.type = type;
skill.grade = "mortal";
skill.rarity = rarity;
skill.description = setup.skills.description[name];
skill.currentUnderstanding = 0;
skill.maxUnderstanding = 100;
skill.level = 1;
skill.levelMax = levelMax;
skill.isLevelMax = false;
skill.maxUnderstandingCoefficient = maxUnderstandingCoefficient;
return skill;
}
function createInternalSkill(name, rarity, levelMax, cultivation, breakthroughBonus, breakthroughPenalty, potentialHealth, potentialQi, potentialSense, potentialSpeed, maxUnderstandingCoefficient) {
const internalSkill = createSkill(name, "internal", rarity, levelMax, maxUnderstandingCoefficient);
internalSkill.cultivation = cultivation;
internalSkill.breakthroughBonus = breakthroughBonus;
internalSkill.breakthroughPenalty = breakthroughPenalty;
internalSkill.potentialHealth = potentialHealth;
internalSkill.potentialQi = potentialQi;
internalSkill.potentialSense = potentialSense;
internalSkill.potentialSpeed = potentialSpeed;
return internalSkill;
}
function createAttackSkill(name, rarity, levelMax, attack, intricacy, qiCost, timeCost, maxUnderstandingCoefficient) {
const attackSkill = createSkill(name, "combat", levelMax, maxUnderstandingCoefficient);
attackSkill.value = attack;
attackSkill.intricacy = intricacy;
attackSkill.qiCost = qiCost;
attackSkill.timeCost = timeCost;
return attackSkill;
}
function createDefenseSkill(name, rarity, levelMax, defense, qiCost, timeCost, maxUnderstandingCoefficient) {
const defenseSkill = createSkill(name, "combat", levelMax, maxUnderstandingCoefficient);
defenseSkill.value = defense;
defenseSkill.qiCost = qiCost;
defenseSkill.timeCost = timeCost;
return defenseSkill;
}
/*createInternalSkill is name, rarity, levelMax, cultivation, breakthroughBonus, breakthroughPenalty, potentialHealth, potentialQi, potentialSense, potentialSpeed, maxUnderstandingCoefficient */
/* maxUnderstandingCoefficient is value that would help calculate what would be the maxUnderstanding value after skill level up */
setup.skills.objects["Breath Control Technique"] = createInternalSkill("Breath Control Technique", "Common", 3, 1, 0, 0, 0.9, 0.9, 0.9, 0.9, 2);
setup.skills.objects["Yin-Yang Balance Method"] = createInternalSkill("Yin-Yang Balance Method", "Common", 2, 0.8, 0, 0, 1, 2.2, 1.2, 0.9, 3);
setup.skills.objects["Meridian Purification Technique"] = createInternalSkill("Meridian Purification Technique", "Common", 2, 1.4, 0, 0.1, 0.95, 1.3, 1.2, 1, 3);
<</script>>
<<set $skills = {}>>
<<set $active.cultivating = "Breath Control Technique">>
<<set $active.learning = "Breath Control Technique">>
<<set $active.skill = "Breath Control Technique">>
<<set $active.skillType = "internal">><<set $reports = {}>>
<<set $reports.activities = []>>
<<set $reports.quest = []>>
<<set $reports.notable = []>>
<<set $reports.salary = 0>>/* TEXT FOR MAIN ROOM */
<<set setup.text.roomDescription = [
"An old pair of wooden chair and desk sat at the corner of the room, its surface filled with marks from the previous occupant of the room. Not far from the desk, you can see a modest straw bed, a place for you to rest and meditate. It looks old, crumpled with obvious signs of wear.",
"The small window in one corner allows a faint glimmer of light to enter the room. An old wooden chair and a modest straw bed provide minimal comfort. The room bears marks of its previous inhabitants.",
"The room is simple, furnished with a basic wooden chair and a well-used straw bed. It's not much, but it's your sanctuary for now.",
"You enter a modest room with an old chair and a straw bed. It's clear the room has seen many occupants before you. The marks on the desk tell stories of its past.",
"The room is sparsely furnished, with a simple wooden chair and a straw bed that has seen better days. You can sense the history in this place.",
"Upon entering the room, you notice an old wooden chair and a straw bed. The room feels like it has stories to tell, evident from the marks left on the desk.",
"The room is quite basic, with a simple wooden chair and a straw bed for you to rest. It carries the character of its previous occupants.",
"As you step into the room, an old wooden chair and a well-worn straw bed catch your eye. The room is a place of quiet contemplation, bearing the marks of those who came before."
]>>
<<set setup.text.bookshelfDescription = [
"A small bookshelf stands against the wall, holding a few well-worn volumes containing some mundane books from the mortal realm and the sect's rules. A set of spare robes, possibly a hand-me-down from the previous occupant, hangs on the wall.",
"You notice a modest bookshelf against the wall, with a collection of old volumes that include mundane books from the mortal realm and the sect's rules. Spare robes, which seem to be a hand-me-down, are neatly hung nearby.",
"The room features a bookshelf with some well-used volumes, including mundane books from the mortal realm and the sect's rules. Spare robes, perhaps passed down, are hanging on the wall.",
"Against the wall, there's a small bookshelf that contains well-worn volumes, housing mundane books from the mortal realm and the sect's rules. A set of spare robes, which you suspect were inherited, adorn the wall.",
"A humble bookshelf stands by the wall, with a selection of worn volumes that encompass both mundane books from the mortal realm and the sect's rules. Spare robes, probably passed down, are neatly hung on a hook.",
"You find a simple bookshelf filled with aged volumes, including mundane books from the mortal realm and the sect's rules. Spare robes, likely a hand-me-down, are hung on a peg on the wall.",
"The room features a small bookshelf, its shelves filled with well-loved volumes, including mundane books from the mortal realm and the sect's rules. Nearby, a set of spare robes, possibly inherited, hangs on the wall.",
"Against the wall, there's a bookshelf with a selection of worn volumes, housing mundane books from the mortal realm and the sect's rules. Spare robes, which you guess were passed down, are hanging on a hook."
]>>
<<set setup.text.viewDescriptions = [
"As you gaze out the window, you catch glimpses of one of the sect's training grounds, where your fellow outer sect disciples are bustling with activity. Their distant laughter and the occasional sound of clashing weapons create a lively atmosphere.",
"Through the window, you observe one of the sect's training grounds, where your fellow outer sect disciples are engaged in various activities. The distant laughter and the occasional clang of weapons add to the energy of the scene.",
"The window reveals a view of one of the sect's training grounds, where your fellow outer sect disciples are busy with their training. In the distance, their laughter and the occasional clash of weapons create a lively atmosphere.",
"Outside the window, you can see one of the sect's training grounds, alive with the presence of your fellow outer sect disciples. Their distant laughter and the occasional sound of weapons colliding add vibrancy to the surroundings.",
"As you peer out the window, you catch a glimpse of one of the sect's training grounds, where your fellow outer sect disciples are diligently honing their skills. Their distant laughter and the occasional clatter of weapons fill the air.",
"Through the window, you observe one of the sect's training grounds, where your fellow outer sect disciples are hard at work. Their distant laughter and the occasional sound of weapons being used create a spirited atmosphere.",
"The view outside the window reveals one of the sect's training grounds, where your fellow outer sect disciples are actively engaged. The distant laughter and the occasional clang of weapons contribute to the liveliness of the scene.",
"Outside the window, you can see one of the sect's training grounds, teeming with your fellow outer sect disciples. Their distant laughter and the occasional sound of clashing weapons infuse the air with energy."
]>>
<<set setup.text.roomSituations = [
"You observe your surroundings for a moment before you sit down cross-legged on the bed.",
"After a brief moment of observation, you lower yourself into a cross-legged position on the bed.",
"You take a moment to look around before settling into a cross-legged position on the bed.",
"Observing your surroundings briefly, you sit down cross-legged on the bed.",
"You spend a moment taking in your surroundings, then assume a cross-legged position on the bed.",
"After a brief observation, you find your place on the bed, cross-legged and ready for meditation or cultivation.",
"You glance around the room for a moment before sitting down cross-legged on the bed.",
"You take in your surroundings for a short while before settling into a cross-legged position on the bed."
]>>
<<set setup.text.viewAssignmentBoardOpening = [
"You make your way to the Pure Valley Sect assignment board once more. As usual, the main hall is abuzz with activity, filled with disciples and elders alike, all eager to seek new tasks and assignments. You notice a particularly colorful bird perched on the nearby window.",
"Once again, you find yourself at the Pure Valley Sect assignment board. The main hall is a hive of activity, disciples and elders bustling about, each seeking out new tasks and assignments. A gentle breeze rustles the scrolls hanging on the walls.",
"Returning to the Pure Valley Sect assignment board, you're greeted by the usual scene. The main hall is alive with activity, disciples and elders alike moving swiftly to secure new tasks and assignments. A ray of sunlight streams through the open window.",
"Back at the Pure Valley Sect assignment board, you're met with a familiar sight. The main hall is teeming with activity, disciples and elders busy as ever, all in pursuit of new tasks and assignments. A scent of incense wafts through the air.",
"You revisit the Pure Valley Sect assignment board, where the main hall is once again a hub of activity. Disciples and elders scurry about, their eyes set on new tasks and assignments. A soft melody from a nearby flute player fills the hall.",
"The Pure Valley Sect assignment board beckons you once more. Inside the main hall, the scene is as bustling as ever, with disciples and elders actively seeking new tasks and assignments. You catch a glimpse of a disciple performing an intricate martial arts move in front of his friends.",
"Back at the Pure Valley Sect assignment board, you encounter the customary sight. The main hall is in motion, filled with disciples and elders eager to secure new tasks and assignments. A flicker of candlelight adds to the ambiance.",
"You return to the Pure Valley Sect assignment board, where the main hall is a whirlwind of activity. Disciples and elders are busy as ever, each looking for new tasks and assignments. You find a stray kitten playfully chasing its tail near the entrance."
]>>
<<set setup.text.viewAssignmentBoardLooking to [
"You scan the board, taking in the various quests on offer. Some appear relatively simple, while others seem much more daunting. You spot an officer sitting at a nearby desk, overseeing the assignments.",
"While you scan the quest board you give a bow politely to the officer sitting at a nearby desk. But the officer is too distracted at the moment.",
"Surveying the quest board, you consider the diverse range of tasks presented, each with its own level of complexity. Nearby, an officer attentively manages the assignments.",
"Your gaze roams across the quest board, taking in the mix of quests, some straightforward and others formidable. An officer is stationed at a nearby desk, overseeing the assignments.",
"As you look over the quests, you note the varying degrees of difficulty they represent. An officer occupies a nearby desk, vigilantly overseeing the assignments. The officer doesn't look happy for some reason.",
"Your eyes move across the quest board, considering the spectrum of available quests. An officer is present at a nearby desk, not paying much attention.",
"Surveying the quest board, you contemplate the range of quests before you. An officer is stationed at a nearby desk, playing chess with an older disciple.",
"You scan the quest board, taking in the variety of tasks available, from simple to challenging. Nearby, an officer waiting patiently while sipping their tea."
]>>
<<set setup.text.shopDescriptions = [
"You enter the general shop. The middle-aged shopkeeper gives you a brief glance before returning to her work, seemingly ignoring your presence. A breeze from the open door gently rustles her hair.",
"Just as you step into the general shop, the middle-aged shopkeeper acknowledges your arrival with a brief look, then goes back to her tasks. Well again, you're just a lowly outer sect disciple.",
"Entering the general shop, the middle-aged shopkeeper spares you a cursory glance before focusing on her duties, paying little attention to your presence. You hear the sound of a distant bell tinkling outside.",
"You make your way into the general shop. The middle-aged shopkeeper gives you a momentary glance, then resumes her work, almost as if you're invisible. A caged songbird perched nearby sings a melodious tune.",
"Upon entering the general shop, the middle-aged shopkeeper briefly acknowledges your presence before returning to her tasks. A light aroma of incense wafts from an unseen source, adding to the atmosphere.",
"Inside the general shop, the middle-aged shopkeeper gives you a swift glance, then continues her work, unfazed by your arrival. You notice a flicker of candlelight, casting soft shadows on the shelves.",
"You step into the general shop, where the middle-aged shopkeeper looks at you briefly before going back to her duties, as if you're just part of the scenery. A fellow disciple flips through a stack of scrolls nearby. He's also ignoring your presence.",
"Entering the general shop, you catch the middle-aged shopkeeper's gaze for a moment before she returns to whatever tome she's reading. A mischievous kitten plays near the entrance, its antics amusing the other customers."
]>>
<<set setup.text.pathDescriptions = [
"On this well-trodden path, your fellow Outer Sect disciples move around you, their busy activities a familiar sight. Many faces greet you with a nod or a smile, recognizing you as one of their own. In the distance, the imposing presence of the Outer Sect Main Hall stands tall, a place of significance in your journey. A gentle breeze rustles the leaves in the trees lining the path.",
"While you traverse the familiar path, your fellow Outer Sect disciples go about their tasks, their bustling activities a common sight. Friendly nods and smiles from familiar faces acknowledge you as one of their own. The Outer Sect Main Hall looms in the distance, a symbol of your cultivation journey. A distant bird's call fills the air.",
"Walking along the path, you're surrounded by the familiar presence of Outer Sect disciples engrossed in their activities. Friendly nods and smiles from your peers reassure you of your place among them. The imposing Outer Sect Main Hall, a significant landmark, stands in the distance. Sunlight filters through the leaves above, casting dappled shadows on the ground.",
"On the frequently traveled path, your fellow Outer Sect disciples move about, their busyness a comforting sight. The familiar nods and smiles from acquaintances affirm your position among them. The Outer Sect Main Hall, a place of great importance in your journey, stands tall in the distance. You catch a glimpse of a colorful butterfly dancing through the air.",
"While jogging along the well-trodden path, the activity of your fellow Outer Sect disciples is a common sight. Warm nods and smiles from fellow cultivators remind you of your shared camaraderie. The Outer Sect Main Hall, an iconic landmark, is visible in the distance. The scent of blooming flowers wafts on the breeze.",
"As you proceed along the path, the presence of your fellow Outer Sect disciples engrossed in their duties surrounds you. Friendly greetings and smiles convey a sense of belonging among them. The Outer Sect Main Hall, a significant destination, looms in the distance. A gentle rain begins to fall, refreshing the surroundings.",
"Walking this familiar path, the movements of your fellow Outer Sect disciples are a customary sight. Nods and smiles from familiar faces signify your shared journey. The Outer Sect Main Hall, a prominent location, stands tall in the distance. You spot a small squirrel darting across the path.",
"On the familiar path, you are surrounded by the activities of fellow Outer Sect disciples, their presence reassuring. Nods and smiles from peers affirm your connection with them. The Outer Sect Main Hall, a place of importance, is a distant landmark. A group of disciples is engaged in a friendly sparring match nearby."
]>>
/* BREAKTHROUGH */
<<set setup.text.breakthroughVariations = [
"You start your breakthrough attempt, focusing on staying calm. Spiritual energy surges through your meridians, a tingling sensation sweeping your skin. Impurities slowly emerge, oozing from your pores.",
"You then transition into your breakthrough attempt, making a conscious effort to maintain composure. Spiritual energy flows through your meridians, a tingling sensation spreading over your skin. Gradually, impurities surface, seeping from your pores.",
"After an hour or so, you start your attempt, as you try to keep your emotions in check. Spiritual energy courses through your meridians, creating a tingling sensation that washes over your skin. Impurities slowly emerge, oozing from your pores.",
"You then initiate your breakthrough, while trying your best to keep your calm. Spiritual energy surges through your meridians, a tingling sensation enveloping your skin. Slowly, impurities emerge, oozing from your pores.",
"Feeling this would be the right time, you start your attempt while keeping focus on maintaining composure. Spiritual energy flows through your meridians, a tingling sensation enveloping your skin. Impurities start to emerge, seeping from your pores.",
"Initiating your breakthrough, you try to calm your nerve. Spiritual energy courses through your meridians, creating a tingling sensation that envelops your skin. Step by step, impurities begin to emerge, oozing from your pores.",
"You begin your breakthrough, while ensuring your composure. Spiritual energy surges through your meridians, a tingling sensation washing over your skin. Impurities emerge slowly, oozing from your pores.",
"You start your breakthrough while reminding yourself to stay calm. Spiritual energy surges through your meridians, a tingling sensation washing over your skin. Slowly, impurities emerge, oozing from your pores."
]>>
/* GAME OVER */
<<set setup.text.gameOverInjuriesOpening = [
"Your body lies broken, a shattered vessel. Weakness seeps through your bones, the crushing weight of injuries pressing down. It feels like the end, the final curtain. Yet, you refuse to surrender. Not now, not when the path back to Earth remains undiscovered.",
"In this dire moment, your body is shattered, weakened by the weight of injuries. The end appears near, like a final curtain. But you won't yield. Not when the way back to Earth eludes you.",
"Your body is a broken, shattered shell, your bones weakened by the weight of your injuries. It seems like the final chapter, the end of the line. However, you stand firm. Giving up is not an option, not when the path back to Earth is still unknown.",
"Your body is shattered and weakened, injuries taking their toll. The end is within reach, like a final curtain. But you refuse to succumb. The journey back to Earth remains uncharted, and you're not ready to abandon it.",
"As your body lies broken and weakened, the crushing weight of injuries taking its toll, you face what seems like the final chapter. But giving up is not in your nature. The way back to Earth remains undiscovered, and you're determined to find it.",
"In this critical moment, your body is shattered, your bones weakened by the injuries that have overcome you. It feels like the end, a final curtain. Yet, you stand resolute. The path back to Earth remains uncharted, and you're not ready to let go.",
"Your broken body betrays your strength, injuries weighing you down. The end is within sight, like a final curtain. But you won't yield. The journey back to Earth is yet to be found, and you're not giving up.",
"Despite your shattered body and the weight of injuries, the end seems near, like a final curtain. But you hold on. You won't give up, not when the path back to Earth remains unknown."
]>>
/* YEAR END REPORT */
<<set setup.text.yearEndVariations = [
"Well done! Another year of your cultivation journey reaches its conclusion. Let us now contemplate your accomplishments and the significant events of the year:",
"Impressive! You have triumphed in completing another year of your cultivation journey. It is time to reflect on your achievements and the noteworthy events that transpired during the year:",
"Splendid! A year of relentless cultivation draws to an end. Here's a summary of your achievements and events during the year:",
"You've succeeded! Another year of your cultivation journey concludes, and it is time to recognize your achievements and the events that have graced this year:",
"Great work! You have successfully navigated through yet another year of your cultivation journey. Let us now examine your achievements and the significant events that have unfolded during the year:",
"Magnificent! You have completed another year of your cultivation journey. It is now time to look back at your accomplishments and the memorable events that have marked this year:",
"Congratulations! Another year of your cultivation journey is at an end. Let us reflect on your achievements and the events that have shaped this year:",
"Impressive! You have successfully concluded another year of your cultivation journey. It is time to review your accomplishments and the notable events of the year:"
]>>
/* RANDOM TRIVIAL EVENTS */
<<set setup.text.randomTrivialEvents = [
"You helped a fellow cultivator repair their training equipment.",
"While meditating, you noticed the soothing sound of a nearby waterfall.",
"A bright shooting star streaked across the night sky, filling you with wonder.",
"You found a secluded spot to read some scroll you accidentally found, it turns out just a pamphlet for a dumpling place.",
"You shared a meal with other disciples and heard tales of their adventures.",
"During a walk in the forest, you spotted an exotic bird with vibrant plumage.",
"A gentle breeze rustled the leaves, carrying the whispers of nature's secrets.",
"You stumbled upon a small shrine and paid respects to the sect's ancestors.",
"A friendly senior cultivator offered you a pear. It was quite fresh.",
"You took a moment to reflect on your journey.",
"You witnessed a fellow disciple's pet doing amusing tricks.",
"A colorful bird soared in the sky, inspiring thoughts of freedom and aspiration.",
"You discovered a hidden garden with beautiful flowers.",
"In a tea shop, you sipped a new blend that you never tasted in your previous life. It was not that good.",
"You met a child in the sect who showed you their enthusiasm for cultivation.",
"You felt the energy of a passing dragonfly, a symbol of transformation.",
"You two kids having a friendly sparring match, and one of them got hurt.",
"You found a tree with a hollow trunk. There was nothing on it.",
"While practicing your techniques, a beautiful butterfly landed on your fingertip.",
"You explored the library filled with scrolls, but the elder asked you to leave.",
"A group of young disciples engaged in a playful game, you just watched from the side.",
"You listened to a fellow disciple play a hauntingly beautiful melody with their zither.",
"A flock of birds took flight as you approached, a sign of good fortune.",
"You joined a gathering of sect members to watch one of the elders try their hardest to sing. It was awful.",
"You encountered a wise elder who shared ancient parables, but given your past world experience, he instead sounded like a scammer.",
"As you walked by a pond, you marveled at the tranquility of the still water.",
"A rainbow appeared after the rain, reminding you of the beauty in the world.",
"You saw a fellow disciple practice calligraphy before another fellow disciple made fun of him.",
"You sat beneath a weeping willow, finding solace in its gentle shade."
]>>
<<set setup.text.location = [
"courtyard",
"library",
"training yard",
"lecture hall",
"Outer Sect Main Hall",
"entrance of meditation pavilion",
"herb garden",
"disciple's dormitory",
"entrance of alchemy pavilion",
"outside soul-refining chamber",
"outside of wisdom pavilion",
"outside of yin-yang courtyard",
"sacred tree grove",
"the entrance of serenity garden"
]>><<include "Top_Navbar_Menu">>
<<hideMenu>>
<div id="container-main">
<div class="chapter-header -textcenter">
Sect
</div>
<div class="passage-main">
<<currencyIndicator>>
<<first>>
<p>The Pure Valley Sect consists of five mountains; east, west, north, south, and central peaks; in which each grand Elders resides. Surrounding them are these beautiful green meadow which is also quite famous in the region. At the halfway point up Northern Peak is the Outer Sect residential area where your dorm is located. The way further up is protected by ancient defensive formations. Beyond them is the place where Inner Sect disciples and elders reside.</p>
<p>Each of the four mountains is like this. As for the flat area in between them all, it is filled with countless houses inhabited by non-cultivator servants.</p>
<p>As you walk across the path, you can see Outer Sect disciples bustling about. A few of them notice you as you walk past. From a distance, you can see the Outer Sect Main Hall building.</p>
<p>Where do you want to go?</p>
<<finally>>
<p>You're here again. The lush meadows that encircle these peaks retain their enchanting beauty, a hallmark of the region. Your visit to the place is just a regular occurrence now.</p>
<p>
<<randomizeWellTroddenPath>>
</p>
<p>Where will your steps lead you on this visit?</p>
<</first>>
</div>
<div class="margin-top-1rem -textcenter margin-bottom-4rem">
<div>[[Go to the shop|shop]]</div>
<div>[[Go to the assignment board|quest]]</div>
<div>[[Check out Events|stroll]]</div>
</div>
</div>
<<backButtonPassage>><<set $active.shopType = "pill">>
<<set $active.isShopping = true>>
<<include "Top_Navbar_Menu">>
<<hideMenu>>
<div id="container-shop">
<div class="chapter-header -textcenter">
Shop
</div>
<div class="passage-left">
<<currencyIndicator>>
<<first>>
<p>You walk for a few minutes until you arrive at the Outer Sect main hall in Nothern Peak. You enter the building and then take a left turn toward the Outer Sect General Shop. A middle-aged female cultivator is writing something in a scroll. She's probably the shopkeeper.</p>
<p>"Do you need something?" She says without even lifting her head.</p>
<p>"What do you sell here?"</p>
<<setupShopButton>>
<<finally>>
<p>
<<randomizeGeneralShop>>
</p>
<<setupShopButton>>
<</first>>
</div>
<div class="margin-top-1rem -textcenter">
<div>[[Go back to the hub|sect]]</div>
</div>
<div class="container-shop-1">
<div class="shop-box">
<div class="shop-list">
<div class="shop-list-tabs">
<<listen>>
<label checked="checked">
<<radiobutton "$active.shopType" "pill" checked>>
PILL
</label>
<label>
<<radiobutton "$active.shopType" "manual">>
MANUAL
</label>
<label>
<<radiobutton "$active.shopType" "weapon">>
WEAPON
</label>
<label>
<<radiobutton "$active.shopType" "misc">>
MISC
</label>
<<when>>
<<replaceShopContent>>
<</listen>>
</div>
<div class="shop-list-content">
<<populateShop>>
</div>
</div>
<div class="shop-info-container">
<div class="shop-info-name">
Item name...
</div>
<div class="shop-info-description">
Item description...
</div>
<div>
<div>
<div>EFFECT</div>
<div class="shop-info-effect">
Item effect...
</div>
</div>
<div>
<div>TYPE</div>
<div class="shop-info-type">
Item type...
</div>
</div>
<div>
<div>CATEGORY</div>
<div class="shop-info-family">
Item category...
</div>
</div>
<div>
<div>PRICE</div>
<div class="shop-info-price">
Item price...
</div>
</div>
</div>
<div>
<div class="shop-info-button orange-button">
</div>
</div>
</div>
</div>
</div>
</div>
<<backButtonPassage>><<include "Top_Navbar_Menu">>
<<hideMenu>>
<<calculateAllQuestTotalTime>>
<div id="container-quest">
<div class="chapter-header -textcenter">
Assignment Boards
</div>
<div class="passage-left">
<<currencyIndicator>>
<<first>>
<p>The assignment board is on the west side of the Outer Sect Main Hall. A large but somewhat dilapidated building that for some reason, gives you a familiar feeling of seeing your old college.</p>
<p>As you enter the main hall, you are struck by the size of the space, which is filled with rows of benches and desks where disciples are talking to each other.</p>
<p>The assignment board stands about 5 meters wide, filled with various quests. You make your way towards the, scanning the various tasks and assignments that are posted. You quickly notice an officer sitting at a desk nearby, overseeing the assignments.</p>
<p>You take a deep breath and make your way over to the officer. You remind yourself to choose carefully, as you know that if you cancel this assignment later, the officer will not offer it back to you. You approach the officer and ask for more information.</p>
<<finally>>
<p><<randomizeAssignmentBoard>></p>
<p><<randomizeQuestBoard>></p>
<p>What do you want to do now?</p>
<</first>>
<<setupQuestButton>>
</div>
<div class="margin-top-1rem -textcenter">
<div>[[Go back to the hub|sect]]</div>
<<disable _canTakeQuest || $faction.quest.length < 1>>
<<link "Take All">>
<<takeAllQuest>>
<</link>>
<</disable>>
</div>
<div class="container-quest-1">
<div class="quest-box">
<<populateQuest>>
</div>
</div>
</div>
<<backButtonPassage>><<include "Top_Navbar_Menu">>
<<hideMenu>>
<div id="container-world">
<div class="chapter-header -textcenter">
World
</div>
<div class="passage-main">
<<first>>
<p>You stand at the imposing entrance gate of the Pure Valley Sect, ready to venture beyond its protective walls for the first time. The sect is nestled within five majestic peaks, each housing a grand Elder. Surrounding these mountains is a lush expanse of green meadows, renowned throughout the region. Your journey began in the Outer Sect residential area, located halfway up the Northern Peak.</p>
<p>Beyond the gate, you can see the ancient defensive formations that guard the path further into the sect. These barriers separate you from the Inner Sect disciples and elders who reside in the higher peaks. It's a world you've only heard about until now.</p>
<p>Outer Sect disciples are a common sight as they go about their daily activities. Some of them notice you, offering friendly nods of recognition. In the distance, the Main Hall of the Outer Sect looms, a symbol of your journey's significance.</p>
<p>Where will your first steps beyond this gate take you?</p>
<<finally>>
<p>Standing at the sect's entrance gate has become a routine part of your life as a disciple. The enchanting beauty of the meadows surrounding the peaks remains unchanged, a constant reminder of the sect's unique charm.</p>
<p>In the distance, the Outer Sect Main Hall, a place of great importance, stands as a testament to your journey's progress.</p>
<p>Where will you choose to go on this visit, as a now-seasoned disciple of the Pure Valley Sect?</p>
<</first>>
</div>
<div class="margin-top-1rem -textcenter">
<div>[[Go back to the hub|sect]]</div>
</div>
<div class="dev-notes">
<p>Another plan for the future. Just a placeholder for incoming plan.</p>
</div>
</div>
<<backButtonPassage>><<include "Top_Navbar_Menu">>
<<hideMenu>>
<div id="container-world">
<div class="chapter-header -textcenter">
Stroll
</div>
<div class="passage-main">
<<currencyIndicator>>
<p>The Training Yard for the outer sect disciple is a bustling hub of activity, where many outer sect disciples come to hone their martial and magical skills. As a low-level cultivator, this is where you've spent countless hours practicing your basic techniques. The yard is an expansive open space with meticulously maintained gardens, stone pathways, and ancient, towering old trees that you rarely seen in your previous life.</p>
<p>Every day, the air is filled with the sounds of weapons clashing, qi manifestations, and martial shouts. Here, you spar with your fellow disciples, striving to improve your combat abilities. The senior disciples of higher cultivation stage and some of the outer sect elders often watch from the sidelines.</p>
</div>
<div class="margin-top-1rem -textcenter">
<div>[[Go back to the hub|sect]]</div>
</div>
<div class="dev-notes">
<p>Another plan for the future. Just a placeholder for incoming plan.</p>
</div>
</div>
<<backButtonPassage>>
/*
Certainly, here are three passages setting up locations for your xianxia cultivator game:
## Training Yard
The Training Yard in Pure Valley is a bustling hub of activity, where disciples of all levels come to hone their martial and spiritual skills. As a low-level cultivator, this is where you've spent countless hours practicing your basic techniques. The yard is an expansive open space with meticulously maintained gardens, stone pathways, and ancient, towering trees that cast dappled shadows on the ground.
Every day, the air is filled with the sounds of weapons clashing, energy manifestations, and martial shouts. Here, you spar with your fellow disciples, striving to improve your combat abilities and cultivation levels. The elders and masters often watch from the sidelines, their discerning eyes assessing your progress. It's a place of both sweat and enlightenment, where your journey as a cultivator truly begins.
## Mess Hall
The Mess Hall is the heart of the Pure Valley, a place where disciples gather to refuel their bodies and share stories of their cultivation journeys. As a low-level cultivator, you find solace in the hearty meals served here. The hall is a massive structure, adorned with traditional decor and long wooden tables, accommodating hundreds of cultivators at once.
The aroma of freshly cooked dishes wafts through the air, a tantalizing mix of aromatic herbs and spices. Disciples sit together, discussing their experiences, techniques, and the latest sect news. Elders and masters visit occasionally, imparting wisdom and guidance as disciples dine. It's a place of camaraderie, where bonds are forged over shared meals, and your connection to the sect and its teachings deepens.
## Nearby Forest
Beyond the boundaries of the sect lies the Nearby Forest, an ancient and mystical place filled with secrets and dangers. As a low-level cultivator, you often venture here to gather herbs and materials for your cultivation. The forest is a dense, enchanting expanse of towering trees, their leaves whispering in the wind, and meandering streams that glisten like liquid jade.
Here, you encounter creatures and challenges that test your skills and determination. The forest is a world of wonder and peril, with hidden caves concealing treasures and unknown perils. Disciples brave the wilderness, seeking rare herbs and relics, hoping to gain an edge in their cultivation journey. It's a place where you can uncover the mysteries of the world and prove your mettle as a cultivator.
These settings provide the backdrop for your xianxia cultivator's adventures, each holding its own significance in your journey. Let me know if you'd like to further elaborate on any of these locations or if you have any specific requests.
*//* Widget to iterate action array and check if args[0] is there */
<<widget "findActionID">>
<<set _found = false>>
<<for _i = 0; _i < $action.length; _i++>>
<<if $action[_i].hasOwnProperty(_args[0])>>
<<set _found = true>>
<<set $ID = _i>>
<<break>>
<</if>>
<</for>>
<</widget>>
<<widget "selectAction">>
<<replace ".actionDescription">>
<<print setup.actionLibrary[$active.action].description>>
<</replace>>
<<replace ".actionEffect">>
<<print setup.actionLibrary[$active.action].effect>>
<</replace>>
<<replace ".actionCost">>
<<print setup.actionLibrary[$active.action].cost>>
<</replace>>
<</widget>>
<<widget "addAction">>
<<set _day = Number(_day)>>
<<set _action = {}>>
<<set _action[$active.action] = {
name: $active.action,
duration: _day,
type: "Task"
}>>
/* Check if the array has the property */
<<findActionID $active.action>>
<<if ($time.current >= _day && _day > 0) && _found === false>>
<<run $action.push(clone(_action))>>
<<set $time.current -= _day>>
<<update>>
<<replace ".action-alert">>
Added $active.action - _day days to the task list.
<</replace>>>>
<<else>>
<<if ($time.current >= _day) && _found === true>>
<<replace ".action-alert">>
You already have the task. You should remove it first.
<</replace>>
<</if>>
<<if $time.current < _day>>
<<replace ".action-alert">>
You don't have enough available time.
<</replace>>
<</if>>
<</if>>
<</widget>>
<<widget "removeAction">>
<<findActionID $active.action>>
<<if _found>>
<<set $time.current += $action[$ID][$active.action]["duration"]>>
<<run $action.splice($ID, 1)>>
<<update>>
<<replace ".action-alert">>
You removed the task.
<</replace>>
<<else>>
<<replace ".action-alert">>
You don't have the task.
<</replace>>
<</if>>
<</widget>>
<<widget "populateTask">>
<<replace "#task-list">>
<<for _i = 0; _i < $action.length; _i++>>
<div>
<<set _task = Object.keys($action[_i])>>
<<print `${_task} (${$action[_i][_task].type}) - ${$action[_i][_task].duration} days`>>
</div>
<</for>>
<</replace>>
<</widget>><<widget "breakthroughBonusGain">>
<<set $breakthrough.bonus += setup.skills.objects[$active.cultivating].breakthroughBonus>>
<<set $breakthrough.bonus -= setup.skills.objects[$active.cultivating].breakthroughPenalty>>
<</widget>>
<<widget "calculateBreakthroughBarrier">>
<<switch $player.level>>
<<case 1>>
<<set _barrier = 10>>
<<case 2>>
<<set _barrier = 30>>
<<case 3>>
<<set _barrier = 60>>
<<case 4>>
<<set _barrier = 100>>
<<case 5>>
<<set _barrier = 150>>
<<case 7>>
<<set _barrier = 210>>
<<case 8>>
<<set _barrier = 280>>
<<case 9>>
<<set _barrier = 500>>
<<case 10>>
<<set _barrier = 2000>>
<<default>>
<<set _barrier = 450>>
<</switch>>
<</widget>>
/* WIDGET TO CALCULATE BREAKTHROUGH CHANCE, RETURN _chance */
<<widget "breakthroughChance">>
<<set _level = $player.level>>
<<set _mental = $stats.playerMentalState.current / $stats.playerMentalState.max>>
<<set _talent = $player.talent>>
<<if $breakthrough.bonus === 0>>
<<set _breakthroughBonus = 0>>
<</if>>
<<set _chance = _talent * _mental * ($breakthrough.bonus + $breakthrough.bonusExtra + $player.level + ($core.comprehension / 5))>>
/* <<set _chance = (_talent * 10) + (22 - (_level * 2)) + (_breakthroughBonus + $breakthrough.bonusExtra) + (_mental * 20)>> */
<</widget>>
/* WIDGET TO DECIDE IF BREAKTHROUGH SUCCESS OR NOT */
<<widget "breakthroughCheck">>
<<calculateBreakthroughBarrier>>
<<breakthroughChance>>
<<set _barrier = random(1, _barrier)>>
<<if _chance >= _barrier>>
<<set $breakthrough.isSuccess = true>>
<<goto "breakthrough">>
<<else>>
<<goto "breakthrough">>
<</if>>
<</widget>>
/* WIDGET TO CALCULATE THE EFFECTS OF FAILED BREAKTHROUGH */
<<widget "breakthroughFail">>
<<set _push = `${$player.lastName} ${$player.name} failed to breakthrough and suffered some injuries.`>>
<<run $reports.notable.push(_push)>>
<<set $stats.playerMentalState.current -= $seed.mental>>
<<set $stats.playerHealth.current -= $seed.health>>
<<set $stats.playerQi.current -= $seed.qi>>
<<changeAlert "mentalCurrent" -1>>
<<changeAlert "healthCurrent" -1>>
<<changeAlert "qiCurrent" -1>>
<<set $breakthrough.bonus -= (random(5, 20)) * $player.level>>
<<damagePotential>>
<<set $breakthrough.step = 0>>
<<set $breakthrough.attempt += 1>>
<<set $breakthrough.bonusExtra = 0>>
<</widget>>
/* WIDGET TO CALCULATE THE EFFECT OF SUCCESSFUL BREAKTHROUGH*/
<<widget "breakthroughSuccess">>
<<set _push = `${$player.lastName} ${$player.name} brokethrough to the ${setup.text.cultivationLevel[$player.level - 1]}.`>>
<<run $reports.notable.push(_push)>>
<<set $breakthrough.attempt = 0>>
<<set $breakthrough.isSuccess = false>>
<<set $breakthrough.bonus = 0>>
<<set $breakthrough.bonusExtra = 0>>
<<playerLevelUp>>
<<set $cultivation.current = 0>>
<<cultivationMaxValue>>
<<set $player.level += 1>>
<<set $cultivation.age = 0>>
<<resetPlayerCurrentValue>>
<<resetPotential>>
<</widget>>
/* LEVEL UP WIDGET */
<<widget "playerLevelUp">>
<<set $stats.playerHealth.max += $potential.health * ($core.body / 5 * $player.level)>>
<<set $stats.playerQi.max += $potential.qi * (($player.talent / 2.5) * $player.level)>>
<<set $stats.playerSense.max += $potential.sense * ((($core.psyche + $core.comprehension) / 10) * $player.level)>>
<<set $stats.playerSpeed.max += $potential.speed * ((($core.body + $core.psyche) / 10) * $player.level)>>
<<set $player.lifespan += $player.level>>
<</widget>>
<<widget "damagePotential">>
<<highPercentageRandomizer "mentalState">>
<<set $potential.health *= _randomizer>>
<<highPercentageRandomizer "mentalState">>
<<set $potential.qi *= _randomizer>>
<<highPercentageRandomizer "mentalState">>
<<set $potential.sense *= _randomizer>>
<<highPercentageRandomizer "mentalState">>
<<set $potential.speed *= _randomizer>>
<</widget>>
<<widget "resetPotential">>
<<set $potential.health = 0>>
<<set $potential.qi = 0>>
<<set $potential.sense = 0>>
<<set $potential.speed = 0>>
<<set $potential.lifespan = 0>>
<</widget>>/* WIDGET TO CALCULATE PLAYER'S CURRENT CULTIVATION */
<<widget "cultivationCurrent">>
<<set $cultivation.current += $cultivation.gain>>
<</widget>>
/* WIDGET TO CALCULATE PLAYER'S CULTIVATION GAIN */
<<widget "cultivationGain">>
<<findActionID "Cultivation">>
<<set $cultivation.time += $action[$ID]["Cultivation"].duration>>
<<highPercentageRandomizer "mentalState">>
<<if $cultivation.current < $cultivation.max>>
<<set $cultivation.gain += setup.skills.objects[$active.cultivating].cultivation * $cultivation.time * _randomizer * $player.talent * (($player.level + 10) / 10)>>
<<set $cultivation.gain = Math.trunc($cultivation.gain)>>
<<else>>
<<stabilizeCultivationBase>>
<</if>>
<</widget>>
<<widget "cultivationReset">>
<<set $cultivation.time = 0>>
<<set $cultivation.gain = 0>>
<</widget>>
<<widget "stabilizeCultivationBase">>
<<if $breakthrough.bonus < ($player.talent * $player.level * ($core.comprehension / 5))>>
<<highPercentageRandomizer "mentalState">>
<<set $breakthrough.bonus += $cultivation.time * $player.talent * _randomizer * 0.01 * ($core.comprehension / 10)>>
<</if>>
<</widget>>
/* WIDGET TO CHECK IF THE PLAYER READY FOR BREAK THROUGH OR NOT */
<<widget "cultivationCheck">>
<<if $breakthrough.delay === 0 && $cultivation.current >= $cultivation.max>>
<<set $cultivation.current = $cultivation.max>>
<<set $breakthrough.step = 0>>
<<goto "breakthrough">>
<<elseif $player.level > 6>>
<<goto "endOfContent">>
<<else>>
<<goto "reports">>
<</if>>
<</widget>>
/* WIDGET TO CALCULATE MAX CULTIVATION POINTS FOR THE NEXT LEVEL */
<<widget "cultivationMaxValue">>
<<set $cultivation.max *= 2>>
<</widget>>
/* POTENTIAL GAIN WIDGET */
<<widget "potentialGain">>
<<set _skill = setup.skills["objects"][$active.cultivating]>>
<<set _currentSkill = $skills[$active.cultivating]>>
<<if $cultivation.gain !== 0>>
<<set _percentage = $cultivation.gain/$cultivation.max>>
<<else>>
<<set _percentage = 0>>
<</if>>
<<highPercentageRandomizer "mentalState">>
<<set $potential.health += _percentage * _currentSkill.level * _skill.potentialHealth * _randomizer>>
<<highPercentageRandomizer "mentalState">>
<<set $potential.qi += _percentage * _currentSkill.level * _skill.potentialQi * _randomizer>>
<<highPercentageRandomizer "mentalState">>
<<set $potential.sense += _percentage * _currentSkill.level * _skill.potentialSense * _randomizer>>
<<highPercentageRandomizer "mentalState">>
<<set $potential.speed += _percentage * _currentSkill.level * _skill.potentialSpeed * _randomizer>>
<</widget>>/* Widget to handle main story */
<<widget "mainStory">>
<<if ($year === 3)>>
<<run $mainStory.push("cultivationBasic")>>
<</if>>
<<if ($year === 5)>>
<<run $mainStory.push("skillTutorial")>>
<</if>>
<<if $cultivation.age === 3 && $player.level === 2>>
<<run $mainStory.push("secondStage")>>
<</if>>
<</widget>>
<<widget "consumeStory">>
<<run $mainStory.shift()>>
<</widget>>
<<widget "consumeScenes">>
<<run $player.event.shift()>>
<</widget>>
<<widget "prepareRandomScenes">>
<<set _chance = random(0, 100)>>
<<set _availableEvent = clone($event.available)>>
<<set _max = 60>>
<<for _chance > _max && _availableEvent.length > 0>>
<<set $active.event = _availableEvent.pluck()>>
<<if setup.eventLibrary[$active.event].canGetRandom && $player.level >= setup.eventLibrary[$active.event].minLevel>>
<<set _chance = random(0, 100)>>
<<set _max += random (10, 20)>>
<<run $player.event.push($active.event)>>
<</if>>
<</for>>
<</widget>>
/* Widget removing scene from the list of available events */
<<widget "removeFromAvailableEvent">>
<<run $event.available.delete(_args[0])>>
<</widget>>/* YEARLY RECOVERY */
<<widget "setupVariable">>
<<findActionID "Cultivation">>
<<if (_found)>>
<<set _cultivation = $action[$ID]["Cultivation"].duration>>
<<set _report = `${$player.lastName} ${$player.name} cultivated for ${_cultivation} days.`>>
<<run $reports.activities.push(_report)>>
<<else>>
<<set _cultivation = 0>>
<<set _report = `${$player.lastName} ${$player.name} did not do any cultivation.`>>
<</if>>
<<findActionID "Meditate">>
<<if (_found)>>
<<set _meditate = $action[$ID]["Meditate"].duration>>
<<set _report = `${$player.lastName} ${$player.name} meditated for ${_meditate} days.`>>
<<run $reports.activities.push(_report)>>
<<else>>
<<set _meditate = 0>>
<<set _report = `${$player.lastName} ${$player.name} did not do any meditation.`>>
<</if>>
<<findActionID "Learn">>
<<if (_found)>>
<<set _learn = $action[$ID]["Learn"].duration>>
<<set _report = `${$player.lastName} ${$player.name} worked hard to learn ${$active.learning} for ${_learn} days.`>>
<<run $reports.activities.push(_report)>>
<<else>>
<<set _learn = 0>>
<<set _report = `${$player.lastName} ${$player.name} did not learn any skills.`>>
<</if>>
<</widget>>
<<widget "useFreeTime">>
<<if $freeTime>>
<<freeTimeQuest>>
<</if>>
<</widget>>
<<widget "gameloopProgress">>
<<if _cultivation>>
<<playerRecoveryCultivating _cultivation>>
<</if>>
<<if (_meditate > 0 && $stats.playerMentalState.current < 70)>>
<<set $stats.playerMentalState.current += _meditate * $recovery.playerMentalState>>
<<playerRecoveryNormal _meditate>>
<<elseif (_meditate > 0 && $stats.playerMentalState.current > 70 && $stats.playerMentalState.current < 100)>>
<<set $stats.playerMentalState.current += _meditate * $recovery.playerMentalState / (random(3, 10))>>
<<playerRecoveryNormal _meditate>>
<</if>>
<<if (_learn > 0)>>
<<playerLearn>>
<<playerRecoveryNormal _learn>>
<</if>>
<</widget>>
/* Widget for calculating the effect of learning action */
<<widget "playerLearn">>
<<if !($skills[$active.learning].isLevelMax)>>
<<set $skills[$active.learning].currentUnderstanding += _learn * ($core.comprehension/5)>>
<<checkUnderstanding>>
<<else>>
<<set _push = `Skill level is already at limit, there's nothing else you can learn for now.`>>
<<run $reports.notable.push(_push)>>
<</if>>
<</widget>>
/* Widget for player recovery */
<<widget "playerRecoveryCultivating">>
<<set _cultivation = _args[0]>>
<<set $stats.playerHealth.current += _cultivation * $recovery.playerHealth>>
<<set $stats.playerQi.current += _cultivation * $recovery.playerQi>>
<<set $stats.playerSense.current += _cultivation * $recovery.playerSense>>
<</widget>>
<<widget "playerRecoveryNormal">>
<<set _duration = _args[0]>>
<<set $stats.playerHealth.current += _duration * $recovery.playerHealth * 0.25>>
<<set $stats.playerQi.current += _duration * $recovery.playerQi * 0.25>>
<<set $stats.playerSense.current += _duration * $recovery.playerSense * 0.25>>
<</widget>>
<<widget "timeDebtCalculation">>
<<if $time.debt > 0>>
<<set $time.current -= $time.debt>>
<<set $time.used += $time.debt>>
<<set $time.debt = 0>>
<</if>>
<</widget>>
/* Age up the NPC by one year each year */
<<widget "npcAgeProgress">>
<<set _npc = Object.keys($NPC)>>
<<for _i = 0; _i < _npc.length; _i++>>
<<set $NPC[_npc[_i]].age += 1>>
<</for>>
<</widget>>
<<widget "salaryLoop">>
<<set $faction.contributionPoints += $faction.salary>>
<<set $reports.salary = $faction.salary>>
<<set $faction.salary = 0>>
<</widget>>
<<widget "disciplinaryCountdownCheck">>
<<if $disciplinaryCountdown>>
<<if $faction.contributionPoints > 0>>
<<unset $disciplinaryCountdown>>
<</if>>
<</if>>
<</widget>>
<<widget "normalGameLoop">>
<<set $year += 1>>
<<set $player.age += 1>>
<<set $cultivation.age += 1>>
<<set $faction.contributionPoints -= $faction.rent>>
<<npcAgeProgress>>
<<salaryLoop>>
<<disciplinaryCountdownCheck>>
<<prepareRandomScenes>>
<<mainStory>>
<<checkQuest>>
<<resetPlayerQuest>>
<<set $faction.quest = []>>
<<prepareQuest>>
<<if $breakthrough.delay > 0>>
<<set $breakthrough.delay -= 1>>
<</if>>
<<cultivationReset>>
<<statLimit>>
<<timeDebtCalculation>>
<<cultivationCheck>>
<</widget>>/* CULTIVATION STAGE */
<<widget "CultivationStage">>
<span class="cultivation-level">
<<print setup.text.cultivationLevel[$player.level - 1]>>
</span>
<</widget>>
<<widget "calculateCultivationPercentage">>
<<if ($cultivation.current > 0)>>
<<set _percentage = $cultivation.current/$cultivation.max>>
<<set _percentage *= 100>>
<<else>>
<<set _percentage = 0>>
<</if>>
<</widget>>
/* CULTIVATION PROGRESS */
<<widget "cultivationPercentage">>
<<calculateCultivationPercentage>>
<<live _percentage.toFixed() + "%">>
<</widget>>
/* Widget to calculate the ratio of player current stat */
<<widget "calculateStatRatio">>
<<set _percentage = 0>>
<<set _ratio = 0>>
<<if _args[0] == "health">>
<<if $stats.playerHealth.current > 0>>
<<set _percentage = ($stats.playerHealth.current / $stats.playerHealth.max) * 100>>
<</if>>
<<elseif _args[0] == "mental">>
<<if $stats.playerMentalState.current > 0>>
<<set _percentage = ($stats.playerMentalState.current / $stats.playerMentalState.max) * 100>>
<</if>>
<<elseif _args[0] == "qi">>
<<if $stats.playerQi.current > 0>>
<<set _percentage = ($stats.playerQi.current / $stats.playerQi.max) * 100>>
<</if>>
<</if>>
<<if _percentage >= 100>>
<<set _ratio = 7>>
<<elseif _percentage >= 90 and _percentage < 100>>
<<set _ratio = 6>>
<<elseif _percentage >= 70 and _percentage < 90>>
<<set _ratio = 5>>
<<elseif _percentage >= 50 and _percentage < 70>>
<<set _ratio = 4>>
<<elseif _percentage >= 30 and _percentage < 50>>
<<set _ratio = 3>>
<<elseif _percentage >= 10 and _percentage < 30>>
<<set _ratio = 2>>
<<elseif _percentage >= 1 and _percentage < 10>>
<<set _ratio = 1>>
<<elseif _percentage <= 0>>
<<set _ratio = 0>>
<</if>>
<<if _args[0] == "health">>
<<set _ratioHealth = _ratio>>
<</if>>
<<if _args[0] == "mental">>
<<set _ratioMental = _ratio>>
<</if>>
<<if _args[0] == "qi">>
<<set _ratioQi = _ratio>>
<</if>>
<</widget>>
/* HEALTH INDICATOR */
<<widget "healthStat">>
<<calculateStatRatio "health">>
<span class="player-health">
<<live setup.text.health[_ratioHealth]>>
</span>
<</widget>>
<<widget "healthIndicator">>
<<healthStat>>
<<done>>
<<addclass ".player-health" setup.text.indicatorColor[_ratioHealth]>>
<</done>>
<</widget>>
<<widget "healthUI">>
<<calculateStatRatio "health">>
<<switch _ratioHealth>>
<<case 0>>
<span class="player-health darkred">
<<live setup.text.health[_ratioHealth]>>
</span>
<<case 1>>
<span class="player-health firebrick">
<<live setup.text.health[_ratioHealth]>>
</span>
<<case 2>>
<span class="player-health mediumvioletred">
<<live setup.text.health[_ratioHealth]>>
</span>
<<case 3>>
<span class="player-health magenta">
<<live setup.text.health[_ratioHealth]>>
</span>
<<case 4>>
<span class="player-health mediumorchid">
<<live setup.text.health[_ratioHealth]>>
</span>
<<case 5>>
<span class="player-health greenyellow">
<<live setup.text.health[_ratioHealth]>>
</span>
<<case 6>>
<span class="player-health lime">
<<live setup.text.health[_ratioHealth]>>
</span>
<<case 7>>
<span class="player-health lime">
<<live setup.text.health[_ratioHealth]>>
</span>
<</switch>>
<</widget>>
/* MENTAL STATE INDICATOR */
<<widget "mentalStateStat">>
<<calculateStatRatio "mental">>
<span class="player-mentalState">
<<live setup.text.mentalState[_ratioMental]>>
</span>
<</widget>>
<<widget "mentalstateIndicator">>
<<mentalStateStat>>
<<done>>
<<addclass ".player-mentalState" setup.text.indicatorColor[_ratioMental]>>
<</done>>
<</widget>>
<<widget "mentalStateUI">>
<<calculateStatRatio "mental">>
<<switch _ratioMental>>
<<case 0>>
<span class="player-mentalState darkred">
<<live setup.text.mentalState[_ratioMental]>>
</span>
<<case 1>>
<span class="player-mentalState firebrick">
<<live setup.text.mentalState[_ratioMental]>>
</span>
<<case 2>>
<span class="player-mentalState mediumvioletred">
<<live setup.text.mentalState[_ratioMental]>>
</span>
<<case 3>>
<span class="player-mentalState magenta">
<<live setup.text.mentalState[_ratioMental]>>
</span>
<<case 4>>
<span class="player-mentalState mediumorchid">
<<live setup.text.mentalState[_ratioMental]>>
</span>
<<case 5>>
<span class="player-mentalState greenyellow">
<<live setup.text.mentalState[_ratioMental]>>
</span>
<<case 6>>
<span class="player-mentalState lime">
<<live setup.text.mentalState[_ratioMental]>>
</span>
<<case 7>>
<span class="player-mentalState lime">
<<live setup.text.mentalState[_ratioMental]>>
</span>
<</switch>>
<</widget>>
/* QI INDICATOR */
<<widget "qiStat">>
<<calculateStatRatio "qi">>
<span class="player-qi">
<<live setup.text.qi[_ratioQi]>>
</span>
<</widget>>
<<widget "qiIndicator">>
<<qiStat>>
<<done>>
<<addclass ".player-qi" setup.text.indicatorColor[_ratioQi]>>
<</done>>
<</widget>>
<<widget "qiUI">>
<<calculateStatRatio "qi">>
<<switch _ratioQi>>
<<case 0>>
<span class="player-qi darkred">
<<live setup.text.qi[_ratioQi]>>
</span>
<<case 1>>
<span class="player-qi firebrick">
<<live setup.text.qi[_ratioQi]>>
</span>
<<case 2>>
<span class="player-qi mediumvioletred">
<<live setup.text.qi[_ratioQi]>>
</span>
<<case 3>>
<span class="player-qi magenta">
<<live setup.text.qi[_ratioQi]>>
</span>
<<case 4>>
<span class="player-qi mediumorchid">
<<live setup.text.qi[_ratioQi]>>
</span>
<<case 5>>
<span class="player-qi greenyellow">
<<live setup.text.qi[_ratioQi]>>
</span>
<<case 6>>
<span class="player-qi lime">
<<live setup.text.qi[_ratioQi]>>
</span>
<<case 7>>
<span class="player-qi lime">
<<live setup.text.qi[_ratioQi]>>
</span>
<</switch>>
<</widget>>
<<widget "statusWindowRefresh">>
<<replace ".statusWindow">>
<div class="statusWindow-health">
<img src="assets/img/hearts.svg" alt="Heart" class="img-heart"> <<healthUI>>
</div>
<div class="statusWindow-mentalstate">
<img src="assets/img/brain.svg" alt="Brain" class="img-brain"> <<mentalStateUI>>
</div>
<div class="statusWindow-cultivationBar">
<img src="assets/img/meditation.svg" alt="Meditation" class="img-meditation"> <<cultivationPercentage>>
</div>
<</replace>>
<</widget>>
<<widget "cultivationMeter">>
<div class="progress-container">
<div class="progress-bar" id="cultivation-bar">
</div>
</div>
<<script>>
$(function(){
let max = State.variables.cultivation.max;
let current = State.variables.cultivation.current;
function updateCultivationBar(current, max){
const cultivationBar = document.getElementById('cultivation-bar');
if (current === 0) {
cultivationBar.style.width = `0%`;
} else {
let percentage = current/max * 100;
cultivationBar.style.width = `${percentage}%`;
}
}
updateCultivationBar(current, max);
});
<</script>>
<</widget>>
<<widget "healthPrint">>
<<live $stats.playerHealth.current.toFixed(2)>>
<<print ` / `>>
<<live $stats.playerHealth.max.toFixed(2)>>
<</widget>>
<<widget "mentalStatePrint">>
<<live $stats.playerMentalState.current.toFixed(2)>>
<<print ` / `>>
<<live $stats.playerMentalState.max.toFixed(2)>>
<</widget>>
<<widget "qiPrint">>
<<live $stats.playerQi.current.toFixed(2)>>
<<print ` / `>>
<<live $stats.playerQi.max.toFixed(2)>>
<</widget>>
<<widget "speedPrint">>
<<live $stats.playerSpeed.current.toFixed(2)>>
<<print ` / `>>
<<live $stats.playerSpeed.max.toFixed(2)>>
<</widget>>
<<widget "sensePrint">>
<<live $stats.playerSense.current.toFixed(2)>>
<<print ` / `>>
<<live $stats.playerSense.max.toFixed(2)>>
<</widget>>
<<widget "breakthroughChanceIndicator">>
<<calculateBreakthroughBarrier>>
<<breakthroughChance>>
<<set _bc = (_chance/_barrier) * 100>>
<<if _bc < 10>>
<<print "very low">>
<<elseif _bc >= 10 && _bc < 30>>
<<print "low">>
<<elseif _bc >= 30 && _bc < 50>>
<<print "less than half">>
<<elseif _bc >= 50 && _bc < 70>>
<<print "decent">>
<<elseif _bc >= 70 && _bc < 90>>
<<print "high">>
<<else>>
<<print "very high">>
<</if>>
<</widget>>
<<widget "currencyIndicator">>
<div class="-textcenter">Available</div>
<div class="time-and-points-info">
<div>Time: <span class="lime"><<live $time.current>></span> days</div>
<div>Contributions: <span class="lime"><<live $faction.contributionPoints>></span> points</div>
<div>Spirit Stones: <span class="lime"><<live $faction.spiritStones>></span> stones</div>
</div>
<</widget>>
<<widget "qiStrand">>
<<if $player.level > 1>>
<<set _qi = $player.level - 1>>
<<print setup.text.qiStrand[_qi]>>
<<else>>
<<print setup.text.qiStrand[$player.level]>>
<</if>>
<</widget>>
<<widget "qiStrandDescriptor">>
<<if $player.level > 1>>
<<set _qi = $player.level - 1>>
<<print setup.text.qiStrandDescriptor[_qi]>>
<<else>>
<<print setup.text.qiStrandDescriptor[$player.level]>>
<</if>>
<</widget>>
/* CORE INDICATOR */
<<widget "bodyIndicator">>
<<calculateIndicatorIndex $core.body>>
<<print setup.text.bodyLevel[_indicator]>>
<</widget>>
<<widget "comprehensionIndicator">>
<<calculateIndicatorIndex $core.comprehension>>
<<print setup.text.comprehensionLevel[_indicator]>>
<</widget>>
<<widget "psycheIndicator">>
<<calculateIndicatorIndex $core.psyche>>
<<print setup.text.psycheLevel[_indicator]>>
<</widget>>
<<widget "charmIndicator">>
<<print $player.face>>
<</widget>>/* Widget to list the item inside player inventory */
<<widget "populateInventory">>
<<set _key = clone(Object.keys($inventory))>>
<<for _i = 0; _i < _key.length; _i++>>
<<if (setup.items.objects[_key[_i]].type == $active.itemType)>>
<<capture _i>>
<div class="item-link-container">
<div class="item-link">
<<link _key[_i]>>
<<set $active.item = _key[_i]>>
<<clickInventory>>
<</link>>
</div>
<div class="lightgreen">
<<live $inventory[_key[_i]].quantity>>
</div>
</div>
<</capture>>
<</if>>
<</for>>
<</widget>>
/* Widget to open up item description */
<<widget "clickInventory">>
<<resizeDialogAdd "inventory-item-dialog">>
<<dialog $active.item "inventory-item-dialog">>
<div class="item-dialog-body">
<div>
<div class="item-dialog-info">
<div>
<div>TYPE</div>
<div class="inventory-info-type"></div>
</div>
<div>
<div>CATEGORY</div>
<div class="inventory-info-family"></div>
</div>
<div>
<div>EFFECTS</div>
<div class="inventory-info-effect"></div>
</div>
</div>
</div>
<div class="inventory-info-description">
</div>
<div class="inventory-dialog-button orange-button -flex-end">
<<button "Use">>
<<set _object = setup.items.objects[$active.item]>>
<<switch _object.type>>
<<case "manual">>
<<if $player.level < _object.minLevel>>
<<dialog "Insufficient Level">>
<p>You can't learn this skill yet.</p>
<div class="-flex-end orange-button">
<<button "Close">>
<<resizeDialogRemove "inventory-item-dialog">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<<elseif $skills[$active.item] && !(_object.unlock)>>
<<dialog "Learned Skill">>
<p>You already know this skill.</p>
<div class="-flex-end orange-button">
<<button "Close">>
<<resizeDialogRemove "inventory-item-dialog">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<<else>>
<<if !(_object.unlock)>>
<<useManual>>
<<else>>
<<if $skills[_object.name].level >= _object.newLevel>>
<<dialog "Insufficient Level">>
<p>You don't need to learn it anymore.</p>
<div class="-flex-end orange-button">
<<button "Close">>
<<resizeDialogRemove "inventory-item-dialog">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<<elseif !($skills[_object.name].isLevelMax)>>
<<dialog "Insufficient Level">>
<p>You can't learn this skill yet.</p>
<div class="-flex-end orange-button">
<<button "Close">>
<<resizeDialogRemove "inventory-item-dialog">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<<else>>
<<useManual>>
<</if>>
<</if>>
<</if>>
<<case "pill">>
<<usePill>>
<</switch>>
<</button>>
<<button "Discard">>
<<discardButton>>
<</button>>
<<button "Close">>
<<resizeDialogRemove "inventory-item-dialog">>
<<dialogclose>>
<</button>>
</div>
</div>
<</dialog>>
<<refreshItemDialog>>
<</widget>>
<<widget "refreshItemDialog">>
<<replace ".inventory-info-description">>
<<print setup.items.description[$active.item]>>
<</replace>>
<<replace ".inventory-info-effect">>
<<print setup.items.effect[$active.item]>>
<</replace>>
<<replace ".inventory-info-type">>
<<print setup.items["objects"][$active.item].type>>
<</replace>>
<<replace ".inventory-info-family">>
<<print setup.items["objects"][$active.item].family>>
<</replace>>
<</widget>>
/* Refresh Inventory */
<<widget "refreshInventoryScreen">>
<<replace ".inventory-list-content">>
<<populateInventory>>
<</replace>>
<</widget>>
<<widget "usePill">>
<<dialog "Confirm">>
<div>
<p>Are you sure?</p>
</div>
<div class="-flex-end orange-button">
<<button "Yes">>
<<activatePill>>
<<checkPillMinLevel>>
<<consumeItem>>
<<set _timer = 0>>
<<update>>
<<statusWindowRefresh>>
<<resizeDialogRemove "inventory-item-dialog">>
<<dialogclose>>
<</button>>
<<button "No">>
<<resizeDialogRemove "inventory-item-dialog">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<</widget>>
<<widget "useManual">>
<<dialog "Confirm">>
<p>Are you sure?</p>
<div class="-flex-end orange-button">
<<button "Yes">>
<<activateManual>>
<<consumeItem>>
<<set _timer = 0>>
<<update>>
<<statusWindowRefresh>>
<<resizeDialogRemove "inventory-item-dialog">>
<<dialogclose>>
<</button>>
<<button "No">>
<<resizeDialogRemove "inventory-item-dialog">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<</widget>>
<<widget "activateManual">>
<<set _object = setup.items.objects[$active.item]>>
<<if _object.unlock>>
<<set $skills[_object.name].isLevelMax = false>>
<<set $skills[_object.name].levelMax = _object.newLevel>>
<<set $skills[_object.name].maxUnderstanding = _object.newMaxUnderstanding>>
<<unlockAlert _object.name>>
<<else>>
<<addSkill _object.name>>
<<skillAlert>>
<</if>>
<</widget>>
/* Widget to use the items */
<<widget "activatePill">>
/* put the code for use item based on their name here*/
<<set _object = setup.items.objects[$active.item]>>
<<switch _object.target>>
<<case "health">>
<<set $stats.playerHealth.current += _object.value>>
<<changeAlert "healthCurrent" _object.value>>
<<case "cultivation">>
<<set $cultivation.time += _object.value>>
<<changeAlert "cultivationCurrent" _object.value>>
<<set $stats.playerHealth.max -= (random(1, 10)) / 100>>
<<if $stats.playerHealth.max < $stats.playerHealth.current>>
<<set $stats.playerHealth.current = clone($stats.playerHealth.max)>>
<</if>>
<<case "qi">>
<<set $stats.playerQi.current += _object.value>>
<<changeAlert "qiCurrent" _object.value>>
<<case "mental">>
<<set $stats.playerMentalState.current += _object.value>>
<<changeAlert "mentalCurrent" _object.value>>
<<case "lifespan">>
<<if $counter.lifespanPillUsed < 3>>
<<set $player.lifespan += _object.value * ($stats.playerHealth.max / $player.level)>>
<<changeAlert "lifespan" 1>>
<<set $stats.playerSense.max -= (random(1, 10)) / 100>>
<<if $stats.playerSense.max < $stats.playerSense.current>>
<<set $stats.playerSense.current = clone($stats.playerSense.max)>>
<</if>>
<<set $counter.lifespanPillUsed += 1>>
<<else>>
<<flash "Nothing special happened...">>
<</flash>>
<</if>>
<<case "breakthrough">>
<<set $breakthrough.bonus += _object.value / $player.level>>
<<changeAlert "breakthroughBonus" _object.value>>
<<set $stats.playerQi.max -= (random(1, 10)) / 100>>
<<if $stats.playerQi.max < $stats.playerQi.current>>
<<set $stats.playerQi.current = clone($stats.playerQi.max)>>
<</if>>
<<default>>
<<run console.log("Use Pill Failed!");>>
<</switch>>
<</widget>>
<<widget "consumeItem">>
<<if ($inventory[$active.item].quantity > 1)>>
<<reduceQuantity>>
<<update>>
<<else>>
<<removeItem>>
<</if>>
<</widget>>
<<widget "discardButton">>
<<dialog "Confirm">>
<p>Are you sure?</p>
<div class="-flex-end orange-button">
<<button "Yes">>
<<removeItem>>
<<resizeDialogRemove "inventory-item-dialog">>
<<dialogclose>>
<</button>>
<<button "No">>
<<resizeDialogRemove "inventory-item-dialog">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<</widget>>
/* Widget to add item to player inventory */
<<widget "addItem">>
<<set $inventory[$active.item] = {quantity: 1}>>
<</widget>>
/* Widget to remove item from player inventory */
<<widget "removeItem">>
<<script>>
delete State.variables.inventory[State.variables.active.item];
<</script>>
<<replace ".inventory-list-content">>
<<populateInventory>>
<</replace>>
<</widget>>
<<widget "increaseQuantity">>
<<set $inventory[$active.item].quantity += 1>>
<</widget>>
<<widget "reduceQuantity">>
<<set $inventory[$active.item].quantity -= 1>>
<</widget>>
<<widget "payPrice">>
<<set $faction.contributionPoints -= setup.items.objects[$active.item].price>>
<</widget>>
<<widget "receivePrice">>
<<set $faction.contributionPoints += Math.trunc(setup.items.objects[$active.item].price * 0.3)>>
<</widget>>
<<widget "receiveItem">>
<<if $inventory[$active.item]>>
<<increaseQuantity>>
<<else>>
<<addItem>>
<</if>>
<</widget>>
/* A widget for people to take points from their points when they buy something */
<<widget "buyItem">>
<<if ($inventory[$active.item])>>
<<payPrice>>
<<increaseQuantity>>
<<else>>
<<payPrice>>
<<set $inventory[$active.item] = {quantity: 1}>>
<</if>>
<<itemAlert true>>
<</widget>>
/* Widget when the player sell item to the item */
<<widget "sellItem">>
<<if ($inventory[$active.item].quantity > 1)>>
<<receivePrice>>
<<reduceQuantity>>
<<else>>
<<receivePrice>>
<<run delete State.variables.inventory[State.variables.active.item]>>
<</if>>
<<itemAlert false>>
<</widget>>
<<widget "discardItem">>
<<if ($inventory[$active.item].quantity > 1)>>
<<reduceQuantity>>
<<run $(".inventory-itemQuantity").text("Quantity: " + $inventory[$active.item].quantity)>>
<<else>>
<<removeItem>>
<</if>>
<<run Engine.play(State.passage)>>
<<populateInventory>>
<</widget>>
/* Check if the player level is greater than the item min level, if not, give penalty */
<<widget "checkPillMinLevel">>
<<set _object = setup.items["objects"][$active.item]>>
<<if $player.level < _object.minLevel>>
<<set $stats.playerHealth.current -= _object.penalty>>
<<changeAlert "healthCurrent" -(_object.penalty)>>
<</if>>
<</widget>>/* NPC generation with _args[0] as gender. if there's an _args[1] it would be the value for the charm */
<<widget "generateNPC">>
<<set _lockID = LoadScreen.lock()>>
<<if !(_args[0])>>
<<set $active.NPC.gender = either("male", "female")>>
<<else>>
<<set $active.NPC.gender = _args[0]>>
<</if>>
<<if $active.NPC.gender === "male">>
<<set $active.NPC.sex = 0>>
<<else>>
<<set $active.NPC.sex = 1>>
<</if>>
<<generateName _args[0]>>
<<checkName>>
<<generateAppearance _args[0]>>
<<if !(_args[1])>>
<<calculatingNPCCharm>>
<<else>>
<<settingNPCCharm _args[1]>>
<</if>>
<<set $active.NPC.alive = true>>
<<set $active.NPC.relationship = 0>>
<<set $active.NPC.age = random(20, 50)>>
<<run LoadScreen.unlock(_lockID);>>
<</widget>>
/* NPC OBJECT COLLECTION */
/* BETTER TO USE THIS OUTSIDE OF GENERATE NPC WIDGET SO WE HAVE MORE CONTROL FOR THE OBJECT */
<<widget "npcObjectCollection">>
<<set _npcName = $active.NPC.lastName + " " + $active.NPC.name>>
<<set $NPC[_npcName] = clone($active.NPC)>>
<</widget>>
/* WIDGET TO ADD THE NPC TO THE $namedNPC object */
<<widget "addNamedNPC">>
<<set _fullName = $active.NPC.lastName + " " + $active.NPC.name>>
<<set $namedNPC[_fullName] = $active.NPC.role>>
<</widget>>
/* GENERATING RANDOM NAME */
<<widget "generateName">>
<<set $active.NPC.lastName = setup.lastName.random()>>
<<if (_args[0] === "male")>>
<<set $active.NPC.name = setup.nameMale.random()>>
<<else>>
<<set $active.NPC.name = setup.nameFemale.random()>>
<</if>>
<<set $active.NPC.fullName = $active.NPC.lastName + " " + $active.NPC.name>>
<</widget>>
/* CHECK IF THE NAME IS VALID */
<<widget "checkName">>
<<for ($active.NPC.lastName.slice(0, 4) === $active.NPC.name.slice(0, 4))>>
<<generateName>>
<</for>>
<</widget>>
/* GENERATING RANDOM APPEARANCE */
<<widget "generateAppearance">>
<<generateSkin>>
<<generateWeight>>
<<generateHeight>>
/* GENERATING ACTIVE NPC HAIR */
<<if _args[0] === "male">>
<<set $active.NPC.hair to either("bald", "long", "straight long", "clean-shaven", "neat shoulder-length", "short cropped", "very short")>>
<<else>>
<<set $active.NPC.hair to either("loose and flowing","beautiful waist-length", "straight shoulder-length", "beautiful shoulder-length", "luxurious", "long braided", "tied-back ponytail", "low ponytail")>>
<</if>>
<</widget>>
<<widget "generateSkin">>
<<generateNumber>>
<<set _skin = _value>>
<<set $active.NPC.skin = setup.text.skin[_skin]>>
<</widget>>
<<widget "generateWeight">>
<<generateNumber>>
<<set _weight = _value>>
<<set $active.NPC.weight = setup.text.weight[_weight]>>
<</widget>>
<<widget "generateHeight">>
<<generateNumber>>
<<set _height = _value>>
<<set $active.NPC.height = setup.text.height[_height]>>
<</widget>>
<<widget "calculatingNPCCharm">>
<<set _dice = random(1, 100)>>
<<if _dice <= 100 && _dice > 97>>
<<set $active.NPC.charm = 5>>
<<set $active.NPC.face = ($active.NPC.gender === "male" ? "breathtakingly handsome" : "beautiful jade-like")>>
<<elseif _dice <= 97 && _dice > 85>>
<<set $active.NPC.charm = 4>>
<<set $active.NPC.face = ($active.NPC.gender === "male" ? "very dashing" : "very elegant")>>
<<elseif _dice <= 85 && _dice > 60>>
<<set $active.NPC.charm = 3>>
<<set $active.NPC.face = ($active.NPC.gender === "male" ? "handsome" : "charming")>>
<<elseif _dice <= 60 && _dice > 20>>
<<set $active.NPC.charm = 2>>
<<set $active.NPC.face = ($active.NPC.gender === "male" ? "plain" : "average")>>
<<elseif _dice <= 20 && _dice > 3>>
<<set $active.NPC.charm = 1>>
<<set $active.NPC.face = ($active.NPC.gender === "male" ? "ugly" : "unattractive")>>
<<else>>
<<set $active.NPC.face = ($active.NPC.gender === "male" ? "hideous" : "disfigured")>>
<</if>>
<</widget>>
/* setting up npc charm with _args[0] as the value of the charm */
<<widget "settingNPCCharm">>
<<set $active.NPC.charm = _args[0]>>
<<switch $active.NPC.charm>>
<<case 5>>
<<set $active.NPC.face = ($active.NPC.gender === "male" ? "exquisite" : "jade-beauty")>>
<<case 4>>
<<set $active.NPC.face = ($active.NPC.gender === "male" ? "dashing" : "elegant")>>
<<case 3>>
<<set $active.NPC.face = ($active.NPC.gender === "male" ? "handsome" : "charming")>>
<<case 2>>
<<set $active.NPC.face = ($active.NPC.gender === "male" ? "plain" : "plain")>>
<<case 1>>
<<set $active.NPC.face = ($active.NPC.gender === "male" ? "ugly" : "unattractive")>>
<<default>>
<<set $active.NPC.face = ($active.NPC.gender === "male" ? "hideous" : "disfigured")>>
<</switch>>
<</widget>>
/* Widget to check specific property of an NPC, _args[0] would be the property and _args[1] is the value they need to check. If it's true, return with _check = true */
<<widget "checkActiveNPC">>
<<if $active.NPC[_args[0]] === _args[1]>>
<<set _check = true>>
<</if>>
<</widget>>
/* Widget to check NPC array to find a specific NPC, _args[0] would be the property and _args[1] is the value they need to check. If it's true, set the current NPC as $active.NPC */
<<widget "findNPC">>
<<set _npc = Object.keys($NPC)>>
<<for _i = 0; _i < _npc.length; _i++>>
<<if _npc[_i][_args[0]] === _args[1]>>
<<set $active.NPC = clone(_npc[_i])>>
<<break>>
<</if>>
<</for>>
<</widget>><!-- INITIALIZE PLAYER STARTER ATTRIBUTES -->
<<widget "initializePlayer">>
<<set _lockID = LoadScreen.lock()>>
<!-- GENERATING PLAYER HAIR -->
<<if $player.gender == "male">>
<<set $player.hair to either("bald", "long", "straight long", "clean-shaven", "neat shoulder-length", "short cropped", "very short")>>
<<else>>
<<set $player.hair to either("loose and flowing","beautiful waist-length", "straight shoulder-length", "beautiful shoulder-length", "luxurious", "long braided hair", "tied-back ponytail", "low ponytail")>>
<</if>>
<!-- MORE PLAYER APPEARANCE -->
<<set $player.skin to either("pale", "tanned", "fair", "dark", "light")>>
<<set $player.weight to either("skinny", "fat", "lean", "healthy weight")>>
<<set $player.height to either("short", "tall", "average height")>>
<<calculatingTalent>>
<<calculatingElement>>
<<calculatingCharm>>
<<initializeStat>>
<<run LoadScreen.unlock(_lockID);>>
<</widget>>
<!-- CALCULATE PLAYER TALENT -->
<<widget "calculatingTalent">>
<<set $player.roots = setup.text.rootsLevel[$player.talent]>>
<<set $player.potential = setup.text.potentialLevel[$player.talent]>>
<</widget>>
<!-- CALCULATE PLAYER ELEMENT -->
<<widget "calculatingElement">>
<<set _element = []>>
<<set _number = 0>>
<<switch $player.talent>>
<<case 1>>
<<set _number = 5>>
<<case 2>>
<<set _number = 4>>
<<case 3>>
<<set _number = 3>>
<<case 4>>
<<set _number = 2>>
<<case 5>>
<<set _number = 1>>
<<default>>
<<run console.log("Calculating Element Widget Error")>>
<</switch>>
<<set _element = clone(setup.text.elements)>>
<<set $player.element = _element.pluckMany(_number)>>
<<if $player.talent < 5>>
<<run $player.element = $player.element.join(", ")>>
<<else>>
<<set $player.element = $player.element[0]>>
<</if>>
<</widget>>
/* <<widget "calculatingElement">>
<<set _element = []>>
<<switch $player.talent>>
<<case 1>>
<<set $player.element = setup.text.elements.join(", ")>>
<<case 2>>
<<set $player.element = setup.text.elements.pluckMany(4).join(", ")>>
<<case 3>>
<<set $player.element = setup.text.elements.pluckMany(3).join(", ")>>
<<case 4>>
<<set $player.element = setup.text.elements.pluckMany(2).join(", ")>>
<<default>>
<<set $player.element = setup.text.elements.pluck().join("")>>
<</switch>>
<</widget>> */
<<widget "calculatingCharm">>
<<calculateIndicatorIndex $core.charm>>
<<if $player.gender == "male">>
<<set $player.face = setup.text.maleCharmLevel[_indicator]>>
<<else>>
<<set $player.face = setup.text.femaleCharmLevel[_indicator]>>
<</if>>
<</widget>>
<<widget "gameOverCheck">>
<<if ($stats.playerHealth <= 0) || ($stats.playerMentalState <= 0)>>
<<goto "gameOver">>
<</if>>
<</widget>>
/* CHARACTER CREATION */
<<widget "allocateCoreBody">>
<<calculateStatCost $core.body>> /* this widget will resulted in _statCost */
<<if $core.fate >= _statCost && $core.body < 10>>
<<set $core.fate -= _statCost>>
<<set $core.body += 1>>
<<calculateIndicatorIndex $core.body>> /* this will resulted in _indicator */
<<replace ".fate-points">>$core.fate<</replace>>
<<replace ".indicator-body">>
<<print `( ${$core.body} ) ${setup.text.bodyLevel[_indicator]}`>>
<</replace>>
<</if>>
<</widget>>
<<widget "deallocateCoreBody">>
<<calculateStatCost $core.body "sell">> /* this widget will resulted in _statCost */
<<if $core.body > 1>>
<<set $core.fate += _statCost>>
<<set $core.body -= 1>>
<<calculateIndicatorIndex $core.body>> /* this will resulted in _indicator */
<<replace ".fate-points">>$core.fate<</replace>>
<<replace ".indicator-body">>
<<print `( ${$core.body} ) ${setup.text.bodyLevel[_indicator]}`>>
<</replace>>
<</if>>
<</widget>>
<<widget "allocateCoreComprehension">>
<<calculateStatCost $core.comprehension>> /* this widget will resulted in _statCost */
<<if $core.fate >= _statCost && $core.comprehension < 10>>
<<set $core.fate -= _statCost>>
<<set $core.comprehension += 1>>
<<calculateIndicatorIndex $core.comprehension>> /* this will resulted in _indicator */
<<replace ".fate-points">>$core.fate<</replace>>
<<replace ".indicator-comp">>
<<print `( ${$core.comprehension} ) ${setup.text.comprehensionLevel[_indicator]}`>>
<</replace>>
<</if>>
<</widget>>
<<widget "deallocateCoreComprehension">>
<<calculateStatCost $core.comprehension "sell">> /* this widget will resulted in _statCost */
<<if $core.comprehension > 1>>
<<set $core.fate += _statCost>>
<<set $core.comprehension -= 1>>
<<calculateIndicatorIndex $core.comprehension>> /* this will resulted in _indicator */
<<replace ".fate-points">>$core.fate<</replace>>
<<replace ".indicator-comp">>
<<print `( ${$core.comprehension} ) ${setup.text.comprehensionLevel[_indicator]}`>>
<</replace>>
<</if>>
<</widget>>
<<widget "allocateCorePsyche">>
<<calculateStatCost $core.psyche>> /* this widget will resulted in _statCost */
<<if $core.fate >= _statCost && $core.psyche < 10>>
<<set $core.fate -= _statCost>>
<<set $core.psyche += 1>>
<<calculateIndicatorIndex $core.psyche>> /* this will resulted in _indicator */
<<replace ".fate-points">>$core.fate<</replace>>
<<replace ".indicator-psyche">>
<<print `( ${$core.psyche} ) ${setup.text.psycheLevel[_indicator]}`>>
<</replace>>
<</if>>
<</widget>>
<<widget "deallocateCorePsyche">>
<<calculateStatCost $core.psyche "sell">> /* this widget will resulted in _statCost */
<<if $core.psyche > 1>>
<<set $core.fate += _statCost>>
<<set $core.psyche -= 1>>
<<calculateIndicatorIndex $core.psyche>> /* this will resulted in _indicator */
<<replace ".fate-points">>$core.fate<</replace>>
<<replace ".indicator-psyche">>
<<print `( ${$core.psyche} ) ${setup.text.psycheLevel[_indicator]}`>>
<</replace>>
<</if>>
<</widget>>
<<widget "allocateCoreCharm">>
<<calculateStatCost $core.charm>> /* this widget will resulted in _statCost */
<<if $core.fate >= _statCost && $core.charm < 10>>
<<set $core.fate -= _statCost>>
<<set $core.charm += 1>>
<<calculateIndicatorIndex $core.charm>> /* this will resulted in _indicator */
<<replace ".fate-points">>$core.fate<</replace>>
<<replace ".indicator-charm">>
<<if $player.gender == "male">>
<<print `( ${$core.charm} ) ${setup.text.maleCharmLevel[_indicator].toUpperFirst()}`>>
<<else>>
<<print `( ${$core.charm} ) ${setup.text.femaleCharmLevel[_indicator].toUpperFirst()}`>>
<</if>>
<</replace>>
<</if>>
<</widget>>
<<widget "deallocateCoreCharm">>
<<calculateStatCost $core.charm "sell">> /* this widget will resulted in _statCost */
<<if $core.charm > 1>>
<<set $core.fate += _statCost>>
<<set $core.charm -= 1>>
<<calculateIndicatorIndex $core.charm>> /* this will resulted in _indicator */
<<replace ".fate-points">>$core.fate<</replace>>
<<replace ".indicator-charm">>
<<if $player.gender == "male">>
<<print `( ${$core.charm} ) ${setup.text.maleCharmLevel[_indicator].toUpperFirst()}`>>
<<else>>
<<print `( ${$core.charm} ) ${setup.text.femaleCharmLevel[_indicator].toUpperFirst()}`>>
<</if>>
<</replace>>
<</if>>
<</widget>>
<<widget "allocatePlayerTalent">>
<<calculateTalentCost $player.talent>> /* this widget will resulted in _talentCost */
<<if $core.fate >= _talentCost && $player.talent < 5>>
<<set $core.fate -= _talentCost>>
<<set $player.talent += 1>>
<<replace ".fate-points">>$core.fate<</replace>>
<<replace ".indicator-roots">>
<<print `( ${$player.talent} ) ${setup.text.rootsLevel[$player.talent]} Root`>>
<</replace>>
<</if>>
<</widget>>
<<widget "deallocatePlayerTalent">>
<<calculateTalentCost $player.talent "sell">> /* this widget will resulted in _talentCost */
<<if $player.talent > 1>>
<<set $core.fate += _talentCost>>
<<set $player.talent -= 1>>
<<replace ".fate-points">>$core.fate<</replace>>
<<replace ".indicator-roots">>
<<print `( ${$player.talent} ) ${setup.text.rootsLevel[$player.talent]} Root`>>
<</replace>>
<</if>>
<</widget>>
<<widget "initializeStat">>
<<set $stats.playerHealth.max = $core.body>>
<<set $stats.playerHealth.current = $core.body>>
<<set $stats.playerQi.max = ($core.comprehension + $player.talent) / 2>>
<<set $stats.playerQi.current = ($core.comprehension + $player.talent) / 2>>
<<set $stats.playerSense.max = $core.psyche>>
<<set $stats.playerSense.current = $core.psyche>>
<<set $stats.playerSpeed.max = ($core.body + $player.talent) / 2>>
<<set $stats.playerSpeed.current = ($core.body + $player.talent) / 2>>
<<set $player.lifespan += ($stats.playerQi.max + $stats.playerHealth.max) / 2>>
<</widget>><<widget npcPrint>>
<span class="lightgreen"><<= _args[0]>></span>
<</widget>>
/* FACTION RANK */
<<widget "factionRank">>
<span class="darkblue"><<= $faction.rank>></span>
<</widget>>
/* PLAYER TALENT */
<<widget "playerRoots">>
<span class="lightgreen">
<<= $player.roots>>
</span>
<</widget>>
/* PLAYER FACE */
<<widget "playerFace">><<= $player.face>><</widget>>
/* for active NPC */
<<widget "male">><<print setup.genderMap.gender[$active.NPC.sex]>><</widget>>
<<widget "Male">><<print setup.genderMap.gender[$active.NPC.sex].toUpperFirst()>><</widget>>
<<widget "he">><<print setup.genderMap.subjective[$active.NPC.sex]>><</widget>>
<<widget "He">><<print setup.genderMap.subjective[$active.NPC.sex].toUpperFirst()>><</widget>>
<<widget "him">><<print setup.genderMap.objective[$active.NPC.sex]>><</widget>>
<<widget "Him">><<print setup.genderMap.objective[$active.NPC.sex].toUpperFirst()>><</widget>>
<<widget "his">><<print setup.genderMap.determiner[$active.NPC.sex]>><</widget>>
<<widget "His">><<print setup.genderMap.determiner[$active.NPC.sex].toUpperFirst()>><</widget>>
<<widget "himself">><<print setup.genderMap.reflexive[$active.NPC.sex]>><</widget>>
<<widget "Himself">><<print setup.genderMap.reflexive[$active.NPC.sex].toUpperFirst()>><</widget>>
<<widget "man">><<print setup.genderMap.noun[$active.NPC.sex]>><</widget>>
<<widget "Man">><<print setup.genderMap.noun[$active.NPC.sex].toUpperFirst()>><</widget>>
<<widget "brother">><<print setup.genderMap.sibling[$active.NPC.sex].trim()>><</widget>>
<<widget "Brother">><<print setup.genderMap.sibling[$active.NPC.sex].toUpperFirst()>><</widget>>
<<widget "npcFullName">><span class="lightgreen bold">$active.NPC.lastName $active.NPC.name</span><</widget>>
<<widget "npcLastName">><span class="lightgreen bold">$active.NPC.lastName</span><</widget>>
<<widget "npcBrotherName">>
<<nospace>>
<<if $active.NPC.gender is "male">>
brother <span class="lightgreen bold">$active.NPC.lastName</span>
<<else>>
sister <span class="lightgreen bold">$active.NPC.lastName</span>
<</if>>
<</nospace>>
<</widget>>
<<widget "NpcBrotherName">>
<<nospace>>
<<if $active.NPC.gender is "male">>
Brother <span class="lightgreen bold">$active.NPC.lastName</span>
<<else>>
Sister <span class="lightgreen bold">$active.NPC.lastName</span>
<</if>>
<</nospace>>
<</widget>>
<<widget "height">><<print $active.NPC.height>><</widget>>
/* end for active NPC */
/* for player */
<<widget "playerHe">><<print setup.genderMap.subjective[$player.sex]>><</widget>>
<<widget "PlayerHe">><<print setup.genderMap.subjective[$player.sex].toUpperFirst()>><</widget>>
<<widget "playerHis">><<print setup.genderMap.determiner[$player.sex]>><</widget>>
<<widget "PlayerHis">><<print setup.genderMap.determiner[$player.sex].toUpperFirst()>><</widget>>
<<widget "playerHim">><<print setup.genderMap.objective[$player.sex]>><</widget>>
<<widget "PlayerHim">><<print setup.genderMap.objective[$player.sex].toUpperFirst()>><</widget>>
<<widget "playerBrother">><<print setup.genderMap.sibling[$player.sex].trim()>><</widget>>
<<widget "PlayerBrother">><<print setup.genderMap.sibling[$player.sex].toUpperFirst()>><</widget>>
<<widget "playerFullName">><span class="player bold">$player.lastName $player.name</span><</widget>>
<<widget "playerBrotherName">>
<<nospace>>
<<if $player.gender is "male">>
brother <span class="player bold">$player.lastName</span>
<<else>>
sister <span class="player bold">$player.lastName</span>
<</if>>
<</nospace>>
<</widget>>
<<widget "PlayerBrotherName">>
<<nospace>>
<<if $player.gender is "male">>
Brother <span class="player bold">$player.lastName</span>
<<else>>
Sister <span class="player bold">$player.lastName</span>
<</if>>
<</nospace>>
<</widget>><<widget "failedBreakthrough">>
<<print either ("Amidst the surging energies, an ear-splitting blast hurls you backward.",
"The tumultuous energies reach their zenith, erupting in an explosion that propels you away. You collapse to the ground, feeling very weakened.",
"A violent eruption shatters the stillness, flinging you to the ground. You kneel, shattered and drained, both in spirit and physicality.",
"The volatile energies surge, leading to a deafening detonation that sends you sprawling. You fall to your knees, drained in both body and spirit.",
"As the energies reach their zenith, a resounding explosion tears through the silence, hurling you backward. You crumble to your knees, physically and emotionally enervated.",
"The turbulent energies peak, resulting in a thunderous explosion that casts you aside. You kneel, your strength and spirit equally depleted.",
"Amidst the climax of energies, a deafening blast rocks the surroundings, sending you reeling. You collapse on the floor.",
"The surging energies culminate in a deafening explosion, propelling you away. You fall to your knees, and you could.",
"At the zenith of the energies, an explosive shockwave hurls you backward, leaving you battered and drained.",
"A deafening explosion marks the zenith of the energies, launching you backward. You kneel, wounded in body and spirit.")
>>
<</widget>><<widget "populateQuest">>
<<calculateAllQuestTotalTime>>
<<for _i = 0; _i < $faction.quest.length; _i++>>
<<capture _i>>
<div class="quest-card">
<div class="quest-header">
<<print $faction.quest[_i]>>
</div>
<div class="quest-content">
<<print setup.questLibrary[$faction.quest[_i]].description>>
</div>
<div class="quest-card-info">
<div>
<div>RARITY</div>
<div class="quest-rarity">
<<print setup.text.rarity[setup.questLibrary[$faction.quest[_i]].rarity]>>
</div>
</div>
<div>
<div>DURATION</div>
<div class="quest-time">
<<print setup.questLibrary[$faction.quest[_i]].time>> days
</div>
</div>
<div>
<div>PAY</div>
<div class="quest-pay">
<<print setup.questLibrary[$faction.quest[_i]].pay>> points
</div>
</div>
<div>
<div>TYPE</div>
<div class="quest-type">
<<print setup.questLibrary[$faction.quest[_i]].type>>
</div>
</div>
</div>
<div class="quest-button">
<<takeButton>>
</div>
</div>
<</capture>>
<</for>>
<</widget>>
/* Widget to prepare some quest */
<<widget "prepareQuest">>
<<for _i = 0; _i < 6; _i++>>
<<set _chance = random(1, 100)>>
<<if _chance < 80>>
<<set _chance = 0>>
<<elseif (_chance >= 80) && (_chance < 97)>>
<<set _chance = 1>>
<<else>>
<<set _chance = 2>>
<</if>>
<<set _randomQuest = Object.keys(setup.questLibrary).random()>>
<<if (setup.questLibrary[_randomQuest].minLevel > $player.level) && (setup.questLibrary[_randomQuest].rarity > _chance)>>
<<set _i -= 1>>
<<else>>
<<run $faction.quest.push(_randomQuest)>>
<</if>>
<</for>>
<</widget>>
/* BUTTON TO TAKE QUEST */
<<widget "takeButton">>
<<button "Take">>
<<set $active.quest = $faction.quest[_i]>>
<<if $time.current >= setup.questLibrary[$faction.quest[_i]].time>>
<<dialog "Confirm">>
<p>Are you sure?</p>
<div class="orange-button -flex-end">
<<button "Yes">>
<<takeQuest>>
<<update>>
<<refreshQuest>>
<<dialogclose>>
<</button>>
<<button "No">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<<else>>
<<dialog "Insufficient Time">>
<p>You don't have enough time.</p>
<</dialog>>
<</if>>
<</button>>
<</widget>>
<<widget "refreshQuest">>
<<replace ".quest-box">>
<<populateQuest>>
<</replace>>
<</widget>>
/* Check your own quest if you want to cancel it or not */
<<widget "populateQuestPlayer">>
<<for _i = 0; _i < $player.quest.length; _i++>>
<<capture _i>>
<div class="quest-link">
<<link $player.quest[_i]>>
<<set $active.quest = $player.quest[_i]>>
<<clickQuestPlayer>>
<</link>>
</div>
<</capture>>
<</for>>
<</widget>>
<<widget "emptyQuestPlayerInfo">>
<<replace ".questPlayer-info">>
<</replace>>
<</widget>>
<<widget "refreshQuestPlayer">>
<<replace ".quest-box">>
<<populateQuestPlayer>>
<</replace>>
<</widget>>
<<widget "clickQuestPlayer">>
<<replace ".questPlayer-info">>
<div class="questPlayer-header">
<<print $active.quest>>
</div>
<div class="questPlayer-content">
<<print setup.questLibrary[$active.quest].description>>
</div>
<div class="questPlayer-details">
<div>
<div>RARITY</div>
<div class="questPlayer-rarity">
<<print setup.questLibrary[$active.quest].rarity>>
</div>
</div>
<div>
<div>DURATION</div>
<div class="questPlayer-time">
<<print setup.questLibrary[$active.quest].time>> days
</div>
</div>
<div>
<div>PAY</div>
<div class="questPlayer-pay">
<<print setup.questLibrary[$active.quest].pay>> points
</div>
</div>
</div>
<div class="questPlayer-button -center">
<<button "Remove">>
<<calculateQuestPenalty>>
<<if $faction.contributionPoints >= _penalty>>
<<dialog "Confirm">>
<p>You will have to pay half of the pay for the penalty. Are you sure?</p>
<div class="orange-button -flex-end">
<<button "Yes">>
<<removeQuest>>
<<dialogclose>>
<</button>>
<<button "No">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<<else>>
<<dialog "Insufficient Points">>
<p>You don't have enough points to pay the penalty.</p>
<</dialog>>
<</if>>
<</button>>
</div>
<</replace>>
<</widget>>
<<widget "setupQuestButton">>
<div class="assignment-passage-button">
<<button "Assignments">>
<<replace ".quest-box">>
<<populateQuest>>
<</replace>>
<</button>>
<<button "Remove">>
<<replace ".quest-box">>
<div class="questPlayer-container">
<div class="questPlayer-left">
<div class="questPlayer-header">CURRENT</div>
<div class="questPlayer-box">
<<populateQuestPlayer>>
</div>
</div>
<div class="questPlayer-info">
</div>
</div>
<</replace>>
<<if $player.quest.includes($active.quest)>>
<<clickQuestPlayer>>
<<else>>
<<replace ".questPlayer-info">>
<div class="questPlayer-header">
Name...
</div>
<div class="questPlayer-content">
Description...
</div>
<div class="questPlayer-details">
<div>
<div>RARITY</div>
<div class="questPlayer-rarity">
Rarity...
</div>
</div>
<div>
<div>DURATION</div>
<div class="questPlayer-time">
Duration...
</div>
</div>
<div>
<div>PAY</div>
<div class="questPlayer-pay">
Pay...
</div>
</div>
</div>
<</replace>>
<</if>>
<</button>>
<<button "Reroll">>
<<if $time.current >= 7>>
<<dialog "Confirm">>
<p>Wait one week to get new available quest?</p>
<div class="orange-button -flex-end">
<<button "Yes">>
<<rerollQuest>>
<<update>>
<<dialogclose>>
<</button>>
<<button "No">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<<else>>
<<dialog "Insufficient Time">>
<div>
<p>You don't have enough available time.</p>
</div>
<</dialog>>
<</if>>
<</button>>
</div>
<</widget>>
<<widget "takeQuest">>
<<run $player.quest.push(clone($active.quest))>>
<<run $faction.quest.splice(_i, 1)>>
<<set $time.current -= setup.questLibrary[$active.quest].time>>
<<set $time.used += setup.questLibrary[$active.quest].time>>
<<set $faction.salary += setup.questLibrary[$active.quest].pay>>
<<set _action = {}>>
<<set _action[$active.quest] = {
name: $active.quest,
duration: setup.questLibrary[$active.quest].time,
type: "Assignment"
}>>
<<run $action.push(clone(_action))>>
<</widget>>
/* Widget to calculate if the player has enough time to take a quest. it will return this boolean value _canTakeQuest */
<<widget "calculateAllQuestTotalTime">>
<<set _canTakeQuest = true>>
<<set _totalTime = 0>>
<<for _k = 0; _k < $faction.quest.length; _k++>>
<<set _totalTime += setup.questLibrary[$faction.quest[_k]].time>>
<</for>>
<<if $time.current >= _totalTime>>
<<set _canTakeQuest = false>>
<</if>>
<</widget>>
<<widget "takeAllQuest">>
<<if $faction.quest.length > 0>>
<<dialog "Confirm">>
<<resizeDialogAdd "skill-item-dialog">>
<p>Are you sure you want to take all of the assignments here? Removing it later will cost you a penalty.</p>
<div class="orange-button inventory-dialog-button">
<<button "Yes">>
<<for _i = 0; _i < $faction.quest.length; _i++>>
<<set $active.quest = $faction.quest[_i]>>
<<run $player.quest.push(clone($active.quest))>>
<<set $time.current -= setup.questLibrary[$active.quest].time>>
<<set $time.used += setup.questLibrary[$active.quest].time>>
<<set $faction.salary += setup.questLibrary[$active.quest].pay>>
<<set _action = {}>>
<<set _action[$active.quest] = {
name: $active.quest,
duration: setup.questLibrary[$active.quest].time,
type: "Assignment"
}>>
<<run $action.push(clone(_action))>>
<</for>>
<<set $faction.quest = []>>
<<update>>
<<refreshQuest>>
<<resizeDialogRemove "skill-item-dialog">>
<<dialogclose>>
<</button>>
<<button "No">>
<<resizeDialogRemove "skill-item-dialog">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<</if>>
<</widget>>
/* WIDGET THAT ALLOWS THE PLAYER TO USE THEIR FREE TIME FOR QUEST AND ASSIGNMENTS */
<<widget "freeTimeQuest">>
<<for _i = 0; _i < $faction.quest.length; _i++>>
<<run $faction.quest.shuffle()>>
<<set $active.quest = $faction.quest[_i]>>
<<if $time.current > setup.questLibrary[$active.quest].time && $active.quest !== "Trade Run">>
<<set $active.quest = $faction.quest[_i]>>
<<run $player.quest.push(clone($active.quest))>>
<<set $time.current -= setup.questLibrary[$active.quest].time>>
<<set $time.used += setup.questLibrary[$active.quest].time>>
<<set $faction.salary += setup.questLibrary[$active.quest].pay>>
<<set _action = {}>>
<<set _action[$active.quest] = {
name: $active.quest,
duration: setup.questLibrary[$active.quest].time,
type: "Assignment"
}>>
<<run $action.push(clone(_action))>>
<</if>>
<</for>>
<</widget>>
<<widget "calculateQuestPenalty">>
<<set _penalty = (Math.floor(setup.questLibrary[$active.quest].pay * 0.5))>>
<<if _penalty < 1>>
<<set _penalty = 1>>
<</if>>
<</widget>>
<<widget "removeQuest">>
<<for _i = 0; _i < $player.quest.length; _i++>>
<<if ($player.quest[_i] === $active.quest)>>
<<set $time.current += setup.questLibrary[$active.quest].time>>
<<set $time.used -= setup.questLibrary[$active.quest].time>>
<<set $faction.salary -= setup.questLibrary[$active.quest].pay>>
<<calculateQuestPenalty>>
<<set $faction.contributionPoints -= _penalty>>
<<findActionID $active.quest>>
<<run $action.splice($ID, 1)>>
<<run $player.quest.splice(_i, 1)>>
<<update>>
<<emptyQuestPlayerInfo>>
<<refreshQuestPlayer>>
<</if>>
<</for>>
<</widget>>
<<widget "rerollQuest">>
<<set _limit = $faction.quest.length>>
<<set $faction.quest = []>>
<<prepareQuest>>
<<set $faction.quest.splice(_limit)>>
<<set $time.current -= 7>>
<<set $time.used += 7>>
<<refreshQuest>>
<</widget>>
<<widget "resetPlayerQuest">>
<<for _j = 0; _j < $player.quest.length; _j++>>
<<findActionID $player.quest[_j]>>
<<run $action.splice($ID, 1)>>
<</for>>
<<set $time.current += $time.used>>
<<set $time.used = 0>>
<<set $player.quest = []>>
<</widget>>
<<widget "checkQuest">>
<<for _quest = 0; _quest < $player.quest.length; _quest++>>
<<set $active.quest = $player.quest[_quest]>>
<<processQuest>>
<</for>>
<</widget>>
<<widget "processQuest">>
<<set _rollQuest = setup.questLibrary[$active.quest]>>
<<switch _rollQuest.type>>
<<case "Mental">>
<<set _reduce = random($core.psyche, 10)>>
<<set _reduce = 1 / _reduce>>
<<set _costQuest = _rollQuest.cost * _rollQuest.time * _reduce>>
<<set $stats.playerMentalState.current -= _costQuest>>
<<set _push = `Completed ${$active.quest} and received ${_rollQuest.pay} points and used ${_costQuest.toFixed(2)} of mental strength.`>>
<<run $reports.quest.push(_push)>>
<<run console.log("Mental")>>
<<case "Physical">>
<<set _reduce = random($core.body, 10)>>
<<set _reduce = 1 / _reduce>>
<<set _costQuest = _rollQuest.cost * _rollQuest.time * _reduce>>
<<set $stats.playerHealth.current -= _costQuest>>
<<set _push = `Completed ${$active.quest} and received ${_rollQuest.pay} points and used ${_costQuest.toFixed(2)} of stamina.`>>
<<run $reports.quest.push(_push)>>
<<run console.log("Physical")>>
<<case "Qi">>
<<set _reduce = random($core.comprehension, 10)>>
<<set _reduce = 1 / _reduce>>
<<set _costQuest = _rollQuest.cost * _rollQuest.time * _reduce>>
<<set $stats.playerQi.current -= _costQuest>>
<<set _push = `Completed ${$active.quest} and received ${_rollQuest.pay} points and used ${_costQuest.toFixed(2)} of qi.`>>
<<run $reports.quest.push(_push)>>
<<run console.log("Qi")>>
<<default>>
<<run console.log("Nothing" + $active.quest)>>
<</switch>>
<</widget>><<widget "reportActivities">>
<<if $reports.activities.length > 0>>
<<for _i = 0; _i < $reports.activities.length; _i++>>
<li><<print $reports.activities[_i]>></li>
<</for>>
<<else>>
<<print `${$player.lastName} ${$player.name} did not cultivate, meditate or even learn anything.`>>
<</if>>
<</widget>>
<<widget "reportNotable">>
<<if $reports.notable.length > 0>>
<<for _i = 0; _i < $reports.notable.length; _i++>>
<li><<print $reports.notable[_i]>></li>
<</for>>
<<else>>
<li><<print `There was no notable events.`>></li>
<</if>>
<</widget>>
<<widget "reportQuest">>
<<if $reports.quest.length > 0>>
<<for _i = 0; _i < $reports.quest.length; _i++>>
<li><<print $reports.quest[_i]>></li>
<</for>>
<<else>>
<<print `${$player.lastName} ${$player.name} did not complete any assignment this year.`>>
<</if>>
<</widget>>
<<widget "resetReports">>
<<set $reports.quest = []>>
<<set $reports.activities = []>>
<<set $reports.notable = []>>
<</widget>>/* Widget when the player buy item from the shop */
<<widget "populateShop">>
<<if ($active.isShopping)>>
<<set _shop = clone(Object.keys(setup.items.objects))>>
<<for _i = 0; _i < _shop.length; _i++>>
<<if (setup.items.objects[_shop[_i]].type === ($active.shopType) && setup.items.objects[_shop[_i]].soldInShop)>>
<<capture _i>>
<div class="shop-link">
<<link _shop[_i]>>
<<set $active.item = _shop[_i]>>
<<clickShop>>
<</link>>
</div>
<</capture>>
<</if>>
<</for>>
<<else>>
<<set _sale = clone(Object.keys($inventory))>>
<<for _i = 0; _i < _sale.length; _i++>>
<<if (setup.items.objects[_sale[_i]].type == $active.shopType) && setup.items.objects[_sale[_i]].soldInShop>>
<<capture _i>>
<div class="shop-link">
<<link _sale[_i]>>
<<set $active.item = _sale[_i]>>
<<clickShop>>
<</link>>
</div>
<</capture>>
<</if>>
<</for>>
<</if>>
<</widget>>
<<widget "clickShop">>
<<replace ".shop-info-name">>
<<print $active.item>>
<</replace>>
<<replace ".shop-info-description">>
<<print setup.items.description[$active.item]>>
<</replace>>
<<replace ".shop-info-effect">>
<<print setup.items.effect[$active.item]>>
<</replace>>
<<replace ".shop-info-type">>
<<print setup.items["objects"][$active.item].type>>
<</replace>>
<<replace ".shop-info-family">>
<<print setup.items["objects"][$active.item].family>>
<</replace>>
<<replace ".shop-info-price">>
<<print setup.items["objects"][$active.item].price + " points">>
<</replace>>
<<replace ".shop-info-button">>
<<if ($active.isShopping)>>
<<button "Buy">>
<<if $faction.contributionPoints >= setup.items["objects"][$active.item].price>>
<<dialog "Confirm">>
<p>Are you sure?</p>
<div class="orange-button -flex-end">
<<button "Yes">>
<<buyItem>>
<<replaceShopContent>>
<<clearShopInfo>>
<<update>>
<<dialogclose>>
<</button>>
<<button "No">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<<else>>
<<dialog "Insufficient Funds">>
<p>You don't have enough points.</p>
<</dialog>>
<</if>>
<</button>>
<<else>>
<<button "Sell">>
<<dialog "Confirm">>
<p>Are you sure?</p>
<div class="orange-button -flex-end">
<<button "Yes">>
<<sellItem>>
<<replaceShopContent>>
<<clearShopInfo>>
/* <<update>> */
<<dialogclose>>
<</button>>
<<button "No">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<</button>>
<</if>>
<</replace>>
<</widget>>
<<widget "clearShopInfo">>
<<replace ".shop-info-name">>
<</replace>>
<<replace ".shop-info-description">>
<</replace>>
<<replace ".shop-info-effect">>
<</replace>>
<<replace ".shop-info-type">>
<</replace>>
<<replace ".shop-info-family">>
<</replace>>
<<replace ".shop-info-price">>
<</replace>>
<<replace ".shop-info-button">>
<</replace>>
<</widget>>
<<widget "setupShopButton">>
<div class="shop-passage-button -center orange-button">
<<button "Buy">>
<<set $active.isShopping = true>>
<<replaceShopContent>>
<<clearShopInfo>>
<</button>>
<<button "Sell">>
<<set $active.isShopping = false>>
<<replaceShopContent>>
<<clearShopInfo>>
<</button>>
</div>
<</widget>>
/* Widget to repopulate shop content */
<<widget "replaceShopContent">>
<<replace ".shop-list-content">>
<<populateShop>>
<</replace>>
<</widget>><<widget "populateSkill">>
<<set _skills = Object.keys($skills)>>
<<for _i = 0; _i < _skills.length; _i++>>
<<if(setup.skills["objects"][_skills[_i]].type === $active.skillType)>>
<<capture _i>>
<div class="skill-link">
<<link _skills[_i]>>
<<set $active.skill = _skills[_i]>>
<<clickSkill>>
<</link>>
</div>
<</capture>>
<</if>>
<</for>>
<</widget>>
<<widget "displaySkillDialogInfo">>
<div class="skill-dialog-body">
<div>
<div class="skill-dialog-info">
<div class="skill-info-level">
<div>LEVEL</div>
<div><<live $skills[$active.skill].level>> / <<live $skills[$active.skill].levelMax>></div>
</div>
<div class="skill-info-exp">
<div>EXP</div>
<div><<calculateTimeToLearn>></div>
</div>
<div class="skill-info-type">
<div>TYPE</div>
<div><<live setup.skills["objects"][$active.skill].type>></div>
</div>
<div class="skill-info-grade">
<div>GRADE</div>
<div><<live setup.skills["objects"][$active.skill].grade>></div>
</div>
<div class="skill-info-rarity">
<div>RARITY</div>
<div><<live setup.skills["objects"][$active.skill].rarity>></div>
</div>
</div>
</div>
<div class="skill-info-description">
<<live setup.skills.description[$active.skill]>>
</div>
</div>
<</widget>>
<<widget "clickSkill">>
<<resizeDialogAdd "skill-item-dialog">>
<<update>>
<<dialog $active.skill>>
<<displaySkillDialogInfo>>
<div class="skill-button">
<<button "Equip">>
<<if $active.skill !== $active.cultivating>>
<<dialog "Confirm">>
<p>Are you sure you want to change your cultivation skill?</p>
<div class="orange-button -flex-end">
<<button "Yes">>
<<set $active.cultivating = $active.skill>>
<<update>>
<<resizeDialogRemove "skill-item-dialog">>
<<dialogclose>>
<</button>>
<<button "Cancel">>
<<resizeDialogRemove "skill-item-dialog">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<</if>>
<</button>>
<<button "Learn">>
<<if $active.skill !== $active.learning>>
<<dialog "Confirm">>
<p>Are you sure you want to change the skill you're learning?</p>
<div class="orange-button -flex-end">
<<button "Yes">>
<<set $active.learning = $active.skill>>
<<update>>
<<resizeDialogRemove "skill-item-dialog">>
<<dialogclose>>
<</button>>
<<button "Cancel">>
<<resizeDialogRemove "skill-item-dialog">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<</if>>
<</button>>
<<button "Close">>
<<resizeDialogRemove "skill-item-dialog">>
<<dialogclose>>
<</button>>
</div>
<</dialog>>
<</widget>>
<<widget "calculateTimeToLearn">>
<<if ($skills[$active.skill].isLevelMax)>>
<span class="yellow"><<print "MAX">></span>
<<elseif ($skills[$active.skill].currentUnderstanding === 0) && !($skills[$active.skill].isLevelMax)>>
<<set _timeToLearn = $skills[$active.skill].maxUnderstanding / ($core.comprehension/5)>>
<<print Math.ceil(_timeToLearn) + " days to learn">>
<<else>>
<<set _timeToLearn = ($skills[$active.skill].maxUnderstanding - $skills[$active.skill].currentUnderstanding) / ($core.comprehension/5)>>
<<print Math.ceil(_timeToLearn) + " days to learn">>
<</if>>
<</widget>>
<<widget "addSkill">>
<<set _skill = _args[0]>>
<<set $skills[_skill] = {}>>
<<set _keysToCopy = ["level", "levelMax", "isLevelMax", "currentUnderstanding", "maxUnderstanding"]>>
<<for _copiedSkill range _keysToCopy>>
<<set $skills[_skill][_copiedSkill] = setup.skills["objects"][_skill][_copiedSkill]>>
<</for>>
<</widget>>
<<widget "learnSkill">>
<<set $skills.learn = $active.skill>>
<</widget>>
<<widget "checkUnderstanding">>
<<set _skill = $skills[$active.learning]>>
<<set _skillLib = setup.skills["objects"][$active.learning]>>
<<if (_skill.currentUnderstanding >= _skill.maxUnderstanding)>>
<<set _push = `This is good! ${$active.learning} skill level has increased.`>>
<<run $reports.notable.push(_push)>>
<<set _skill.level += 1>>
<<set _skill.currentUnderstanding = 0>>
<<set _skill.maxUnderstanding = _skillLib.maxUnderstandingCoefficient * _skillLib.cultivation * _skill.maxUnderstanding>>
<</if>>
<<if _skill.level === _skill.levelMax>>
<<set _skill.isLevelMax = true>>
<<set _push = `Good job! ${$active.learning} skill level has reached its current limit.`>>
<<run $reports.notable.push(_push)>>
<</if>>
<</widget>>
<<widget "skillExperienceBar">>
<<set _skill = $skills[$active.learning]>>
<<set _skillProgressRatio = 0>>
<<if (_skill.currentUnderstanding !== 0)>>
<<set _skillProgressRatio = (_skill.currentUnderstanding / _skill.maxUnderstanding) * 100>>
<<set _skillProgressRatio = _skillProgressRatio.toFixed(2) >>
<</if>>
<<set _skillProgressRatio += " %">>
<</widget>>
<<widget "skillProgression">>
<<lb>>
<<if $skills[$active.skill].currentUnderstanding === 0>>
<<print "0 days to learn">>
<<else>>
<<print $skills[$active.skill].currentUnderstanding / ($core.comprehension/2) + " days to learn">>
<</if>>
<</lb>>
<</widget>>/*Time of day*/
<<widget "timeRNG">>
<<print either ("morning", "afternoon", "evening")>>
<</widget>>
<<widget "seasonRNG">>
<<print either ("summer", "autumn", "springs", "winter")>>
<</widget>>
<<widget "seasonTimeRNG">>
<<print either ("in the beginning of the", "in the middle of the", "late in the", "at the end of the")>>
<</widget>>
/* Character Related */
<<widget "pronounRNG">>
<<print either ("he", "she")>>
<</widget>>
<<widget "walking">>
<<print either ("walking", "strolling")>>
<</widget>>
/*Location Related */
<<widget "outerLocationRNG">>
<<print either(setup.text.location)>>
<</widget>>
/* gender widget */
/* for active NPC */
<<widget "eventDescription">>
<<set _dice = random(1, 3)>>
<<set _eventDescriptions = {
1: "is getting married",
2: "is celebrating their breakthrough",
3: "is celebrating their birthday"
}>>
<</widget>>
<<widget "celebration">>
<<set _dice = random(1,3)>>
<<switch _dice>>
<<case 1>>
is getting married
<<case 2>>
is celebrating their breakthrough
<<case 3>>
is celebrating their birthday
<</switch>>
<</widget>>
/* FOR OVERVIEW ELEMENTS */
<<widget "pluralElement">>
<<if $player.talent === 5>>
<<= "is">>
<<else>>
<<= "are">>
<</if>>
<</widget>>
<<widget "girlfriend">>
<<if $player.gender === "male">>
<<print "girlfriend">>
<<else>>
<<print "boyfriend">>
<</if>>
<</widget>>
<<widget "randomDirection">>
<<print either("north", "northeast", "east", "southeast", "south", "southwest", "west", "northwest")>>
<</widget>>
<<widget "randomizeEnteringYourRoom">>
<<print either(setup.text.roomDescription)>>
<</widget>>
<<widget "randomizeBookshelf">>
<<print either(setup.text.bookshelfDescription)>>
<</widget>>
<<widget "randomizeViewOutsideWindow">>
<<print either(setup.text.viewDescriptions)>>
<</widget>>
<<widget "randomizeAssignmentBoard">>
<<print either(setup.text.viewAssignmentBoardOpening)>>
<</widget>>
<<widget "randomizeQuestBoard">>
<<print either(setup.text.viewAssignmentBoardLooking)>>
<</widget>>
<<widget "randomizeGeneralShop">>
<<print either(setup.text.shopDescriptions)>>
<</widget>>
<<widget "randomizeWellTroddenPath">>
<<print either(setup.text.pathDescriptions)>>
<</widget>>
<<widget "randomizeRoomSituation">>
<<print either(setup.text.roomSituations)>>
<</widget>>
<<widget "randomizeBreakthrough">>
<<print either(setup.text.breakthroughVariations)>>
<</widget>>
/* GAME OVER SCENES */
<<widget "randomizeGameOverFromInjuriesOpening">>
<<print either(setup.text.gameOverInjuriesOpening)>>
<</widget>>
/* YEAR END REPORT */
<<widget "randomizeYearEndReport">>
<<print either(setup.text.yearEndVariations)>>
<</widget>>
/* TRIVIAL EVENTS */
<<widget "randomXianxiaEvent">>
<<print either(setup.text.randomTrivialEvents)>>
<</widget>><<widget "BodyTooltip">>
<span class="stat-body" aria-label="How good you are in battle. Affect Body development." data-microtip-position="right" role="tooltip" data-microtip-size="large">Body</span>
<</widget>>
<<widget "comprehensionTooltip">>
<span class="stat-comprehension" aria-label="How fast are you at comprehending things. Slightly affect Qi development and learning speed." data-microtip-position="right" role="tooltip" data-microtip-size="large">Comprehension</span>
<</widget>>
<<widget "psycheTooltip">>
<span class="stat-psyche" aria-label="How strong you are in handling mental hardship. Affect Divine Sense development. Also affect your mental state resistance." data-microtip-position="right" role="tooltip" data-microtip-size="large">Psyche</span>
<</widget>>
<<widget "charmTooltip">>
<span class="stat-charm" aria-label="How charming you are when interacting with others. Affect many relationship events." data-microtip-position="right" role="tooltip" data-microtip-size="large">Charm</span>
<</widget>>
<<widget "potentialTooltip">>
<span class="stat-potential" aria-label="How high is your potential in cultivation. Affect your spiritual root, cultivation speed and Qi development. This attribute is much more expensive to raise." data-microtip-position="right" role="tooltip" data-microtip-size="large">Potential</span>
<</widget>>
<<widget "fateTooltip">>
<div class="macro-hover">
<span class="macro-hover-inner">Fate</span>
<span class="macro-hover-tip">This is your fate/destiny points.</span>
</div>
<</widget>>/* FIND ROLE INSIDE NPC OBJECT */
/* 1ST ARGUMENT IS THE KEY/CATEGORY, 2ND IS THE VALUE THAT WE SEARCH */
<<widget "findNPC">>
<<set _key = _args[0]>>
<<set _value = _args[1]>>
<<for _i to 0; _i < $NPC.length; _i++>>
<<if $NPC[_i][_key] === _value>>
<<set $active.NPC = $NPC[_i]>>
<<break>>
<</if>>
<</for>>
<</widget>>
<<widget "calculateTimer">>
<<if (_timer)>>
<<set _timer += 750>>
<<else>>
<<set _timer = 300>>
<</if>>
<</widget>>
/* Change Alert Widget with type as first argument and then value as 2nd */
<<widget "changeAlert">>
<<calculateTimer>>
<<timed _timer+"ms" >>
<<if (_args[1] > 0)>>
<<set _increase = "increased">>
<<set _firstSentence = either("Congrats!", "This is nice!", "Wow, this is good!")>>
<<else>>
<<set _increase = "decreased">>
<<set _firstSentence = either("Uh-oh!", "Be careful!", "Watch out!")>>
<</if>>
<<switch _args[0]>>
<<case "healthCurrent">>
<<set _attribute = "health">>
<<case "healthMax">>
<<set _attribute = "maximum health">>
<<case "mentalCurrent">>
<<set _attribute = "mental state">>
<<case "mentalMax">>
<<set _attribute = "maximum mental state">>
<<case "qiCurrent">>
<<set _attribute = "qi">>
<<case "qiMax">>
<<set _attribute = "maximum qi">>
<<case "senseCurrent">>
<<set _attribute = "divine sense">>
<<case "senseMax">>
<<set _attribute = "maximum divine sense">>
<<case "cultivationCurrent">>
<<set _attribute = "cultivation">>
<<case "lifespan">>
<<set _attribute = "lifespan">>
<<case "breakthroughBonus">>
<<set _attribute = "breakthrough chance">>
<<case "breakthroughPenalty">>
<<set _attribute = "breakthrough difficulty">>
<<case "contributionPoints">>
<<set _attribute = "contribution points">>
<<default>>
<<script>>
alert("Widget <<changeAlert>> Error! Please contact Captain Wabbit!");
<</script>>
<</switch>>
<<set _notificationMessage = `${_firstSentence} Your ${_attribute} has ${_increase}.`>>
<<if (_args[1] > 0)>>
<<flash _notificationMessage>>
<<flashType "success">>
<</flash>>
<<else>>
<<flash _notificationMessage>>
<<flashType "error">>
<</flash>>
<</if>>
<</timed>>
<</widget>>
/* Change Alert Widget with boolean as the value, true for receiving, false for losing the item */
<<widget "itemAlert">>
<<calculateTimer>>
<<timed _timer+"ms" >>
<<if (_args[0])>>
<<set _received = "received">>
<<else>>
<<set _received = "lost">>
<</if>>
<<set _notificationMessage = `You ${_received} ${$active.item}.`>>
<<if (_args[0])>>
<<flash _notificationMessage>>
<<flashType "success">>
<</flash>>
<<else>>
<<flash _notificationMessage>>
<<flashType "error">>
<</flash>>
<</if>>
<</timed>>
<</widget>>
<<widget "timeAlert">>
<<calculateTimer>>
<<timed _timer+"ms" >>
<<flash "You spent some of your time.">>
<<flashType "error">>
<</flash>>
<</timed>>
<</widget>>
<<widget "skillAlert">>
<<calculateTimer>>
<<timed _timer+"ms" >>
<<set _message = `You learned ${$active.item}!`>>
<<flash _message>>
<<flashType "success">>
<</flash>>
<</timed>>
<</widget>>
<<widget "unlockAlert">>
<<calculateTimer>>
<<timed _timer+"ms" >>
<<set _message = `You unlock the next layer of ${_args[0]}!`>>
<<flash _message>>
<<flashType "success">>
<</flash>>
<</timed>>
<</widget>>
<<widget "callNotification">>
<<set _attribute = _args[0]>>
<<set _firstSentence = either("Congrats!", "This is nice!", "Wow, this is good!")>>
<<set _notificationMessage = `${_firstSentence} Your ${_attribute} has increased.`>>
<<flash _notificationMessage>>
<</flash>>
<</widget>>
<<widget "resetPlayerCurrentValue">>
<<set $stats.playerHealth.current = $stats.playerHealth.max>>
<<set $stats.playerQi.current = $stats.playerQi.max>>
<<set $stats.playerSense.current = $stats.playerSense.max>>
<<set $stats.playerSpeed.current = $stats.playerSpeed.max>>
<</widget>>
/* Widget to check if player stat is over the limit */
<<widget "statLimit">>
<<if $stats.playerHealth.current > $stats.playerHealth.max>>
<<set $stats.playerHealth.current = $stats.playerHealth.max>>
<</if>>
<<if $stats.playerMentalState.current > $stats.playerMentalState.max>>
<<set $stats.playerMentalState.current = $stats.playerMentalState.max>>
<</if>>
<<if $stats.playerQi.current > $stats.playerQi.max>>
<<set $stats.playerQi.current = $stats.playerQi.max>>
<</if>>
<<if $stats.playerSense.current > $stats.playerSense.max>>
<<set $stats.playerSense.current = $stats.playerSense.max>>
<</if>>
<<if $stats.playerSpeed.current > $stats.playerSpeed.max>>
<<set $stats.playerSpeed.current = $stats.playerSpeed.max>>
<</if>>
<</widget>>
<<widget "generateNumber">>
<<set _dice = random(1, 100)>>
<<set _value = 0>>
<<if _dice > 0 and _dice <= 80>>
<<set _value = random(0, 3)>>
<<elseif _dice > 80 and _dice <= 98>>
<<set _value = random(4, 5)>>
<<else>>
<<set _value = random(6, 7)>>
<</if>>
<</widget>>
<<widget "changeBackButton">>
<<done>>
<<run $(".img-play-button").attr("src", "assets/img/return-arrow.svg")>>
<</done>>
<</widget>>
<<widget "changeEndButton">>
<<done>>
<<run $(".img-play-button").attr("src", "assets/img/play-button.svg")>>
<</done>>
<</widget>>
<<widget "backButtonPassage">>
<<set $nextButton to "BACK">>
<<set $nextPassage = "main">>
<<include "Menu_Button">>
<<changeBackButton>>
<</widget>>
/* Widget to resize dialog window, the first argument is the specific class name */
<<widget "resizeDialogAdd">>
<<addclass "#ui-dialog" _args[0]>>
<<addclass "#ui-dialog-body" _args[0]>>
<<addclass "#ui-dialog-titlebar" _args[0]>>
<</widget>>
<<widget "resizeDialogRemove">>
<<removeclass "#ui-dialog" _args[0]>>
<<removeclass "#ui-dialog-body" _args[0]>>
<<removeclass "#ui-dialog-titlebar" _args[0]>>
<</widget>>
<<widget "hideMenu">>
<<script>>
$("#task-screen, #travel-screen, #menu-screen, #inventory-screen, #shortcut-screen").hide();
/*$("#task-screen").css("display", "none");
$("#travel-screen").css("display", "none");
$("#menu-screen").css("display", "none");
$("#inventory-screen").css("display", "none");
$("#shortcut-screen").css("display", "none"); */
<</script>>
<</widget>>
/* a widget to setup a return link, if you have an _args[0], it will be used as the name of the link */
<<widget "returnLink">>
<<if (_args[0])>>
<<set _linkName = _args[0]>>
<<else>>
<<set _linkName = "Continue">>
<</if>>
<<replace ".scene-links">>
<<link _linkName $nextPassage>>
<<set $active.decisionLocked = false>>
<</link>>
<</replace>>
<</widget>>
<<widget "calculateStatCost">>
<<if _args[1] == "sell">>
<<switch _args[0]>>
<<case 2 3 4 5 6 7>>
<<set _statCost = 1>>
<<case 8 9 10>>
<<set _statCost = 2>>
<</switch>>
<<else>>
<<switch _args[0]>>
<<case 1 2 3 4 5 6>>
<<set _statCost = 1>>
<<case 7 8 9>>
<<set _statCost = 2>>
<</switch>>
<</if>>
<</widget>>
<<widget "calculateTalentCost">>
<<if _args[1] == "sell">>
<<switch $player.talent>>
<<case 2>>
<<set _talentCost = 2>>
<<case 3>>
<<set _talentCost = 3>>
<<case 4>>
<<set _talentCost = 4>>
<<case 5>>
<<set _talentCost = 6>>
<</switch>>
<<else>>
<<switch $player.talent>>
<<case 1>>
<<set _talentCost = 2>>
<<case 2>>
<<set _talentCost = 3>>
<<case 3>>
<<set _talentCost = 4>>
<<case 4>>
<<set _talentCost = 6>>
<</switch>>
<</if>>
<</widget>>
<<widget "calculateIndicatorIndex">>
<<switch _args[0]>>
<<case 0 1>>
<<set _indicator = 0>>
<<case 2 3>>
<<set _indicator = 1>>
<<case 4 5>>
<<set _indicator = 2>>
<<case 6 7>>
<<set _indicator = 3>>
<<case 8 9>>
<<set _indicator = 4>>
<<case 10 >>
<<set _indicator = 5>>
<<default>>
<<run console.log("Calculate Indicator Index")>>
<</switch>>
<</widget>>
<<widget "calculateFateLevel">>
<<if $core.fate < 1>>
<<set _fateLevel = 0>>
<<elseif $core.fate >= 1 && $core.fate < 4>>
<<set _fateLevel = 1>>
<<elseif $core.fate >= 4 && $core.fate < 8>>
<<set _fateLevel = 2>>
<<elseif $core.fate >= 8 && $core.fate < 12>>
<<set _fateLevel = 3>>
<<elseif $core.fate >= 12 && $core.fate < 15>>
<<set _fateLevel = 4>>
<<elseif $core.fate >= 15>>
<<set _fateLevel = 5>>
<</if>>
<</widget>>>>
/* randomize a ratio using args[0] as the base, resulted with _randomizer as its return value */
<<widget "highPercentageRandomizer">>
<<if $stats.playerMentalState.current > 0 && $stats.playerMentalState.current < 97>>
<<switch _args[0]>>
<<case "mentalState">>
<<set _randomizer = random($stats.playerMentalState.current, 97) / 100>>
<<default>>
<<set _randomizer = random(900, 970) / 1000>>
<</switch>>
<<else>>
<<set _randomizer = 0.97>>
<</if>>
<</widget>>
<<widget "generateDiceThree">>
<<set $seed.diceThree = random (1, 3)>>
<</widget>>
<<widget "generateDiceSeven">>
<<set $seed.diceSeven = random (1, 7)>>
<</widget>>
<<widget "generateDiceTen">>
<<set $seed.diceTen = random (1, 10)>>
<</widget>>
<<widget "generateRandomStatChange">>
<<set $seed.health = ((random(40, 99)) /100) * $stats.playerHealth.max>>
<<set $seed.mental = random(5, 20)>>
<<set $seed.qi = ((random(40, 99)) /100) * $stats.playerQi.max>>
<</widget>>
<<widget "successRollIndicator">>
<span class="lime"><<print `[${_args[0]} - Success]`>></span>
<</widget>>
<<widget "failedRollIndicator">>
<span class="mediumorchid"><<print `[${_args[0]} - Failed]`>></span>
<</widget>>