[[Mission 1]]
{
(display: "game values")
(display: "Mission 1 Prep")}{(set: $display_name to "")
(set: $map_responsive to true)
(display: "Mission Map")}
<span class="emph2">MISSION 1:</span> A Normal Seeming Vampire Attack
A Vampire is terrorizing this <span style="color: black; background: goldenrod; padding: 5px; border-radius: 5px;">city</span>.
Three |units>[EMERGENT units] have been deployed to deal with the situation.(click: ?units)[
//<span class="emph2">EMERGENT units are the <span style="color: lime; background: gray; padding: 5px; border-radius: 5px;">lime green</span> symbols on the map.
If they are glowing, that means they still have actions to take this turn.
Click on them to learn more about them and to give them orders.//</span>]
There are |events>[three Events and two Monsters] you need to deal with to resolve this situation.(click: ?events)[
<span class="emph2">//The Monster is the <span style="color: purple; background: gray; padding: 5px; border-radius: 5px;">purple</span> fangs on the map.
The events are the <span style="color: rebeccapurple; background: gray; padding: 5px; border-radius: 5px;">lighter purple</span> symbols on the map.
Click on them to learn more about them.//</span>]
Click on your units to give them orders.
When you have given all your orders, click on the red text below to:
|enemyTurn>[<span style="color: red;">Begin The Enemy Turn</span>]{
(display: "Move Methods")
(display: "Map Methods")
(display: "Utility Methods")
<script>
function insertSymbol(){
var symbol = GetValue("display","symbol");
symbol = "url("+symbol+".svg)";
var anname = getHarloweVariable("display_anname");
if(anname == false)
symbol = "url("+getHarloweVariable("display_fakesymbol")+".svg)";
$("#symbol-container").css("mask-image",symbol);
$("#symbol-container").css("-webkit-mask-box-image",symbol);
var color = GetValue("display","color");
var event = GetValue("display","event");
if(color) ; else if(event == "Opportunity") color = "lime"; else color = "rebeccapurple";
$("#symbol-container").css("background-color",color);
}
function displayUnit(name){
resetDisplays();
SetValue("display","name", name);
SetValue("display","title",GetValue(name,"title"));
SetValue("display","status",GetValue(name,"status"));
SetValue("display","health",GetValue(name,"health"));
SetValue("display","type",GetValue(name,"type"));
var x = GetValue(name,"x");
var y = GetValue(name,"y");
var hex = getHex(x,y);
console.log("hex.type",hex.type);
SetValue("display","hextype", hex.type);
var type = GetValue(name,"type");
if(type == "Enemy")
name = name.slice(0, -1);
SetValue("display","symbol",GetValue(name,"symbol"));
SetValue("display","branch",GetValue(name,"branch"));
SetValue("display","color",GetValue(name,"color"));
SetValue("display","desc",GetValue(name,"desc"));
SetValue("display","move",GetValue(name,"move"));
SetValue("display","attack",GetValue(name,"attack"));
SetValue("display","analyze",GetValue(name,"analyze"));
SetValue("display","respond",GetValue(name,"respond"));
SetValue("display","defend",GetValue(name,"defend"));
SetValue("display","support",GetValue(name,"support"));
SetValue("display","actions",GetValue(name,"actions"));
SetValue("display","statbuff",GetValue(name,"statbuff"));
SetValue("display","defbuff",GetValue(name,"defbuff"));
SetValue("display","defending",GetValue(name,"defending"));
SetValue("display","analyzevalue",GetValue(name,"analyzevalue"));
SetValue("display","analyzed",GetValue(name,"analyzed"));
SetValue("display","faketitle",GetValue(name,"faketitle"));
SetValue("display","fakedesc",GetValue(name,"fakedesc"));
SetValue("display","fakesymbol",GetValue(name,"fakesymbol"));
SetValue("display","attack",GetValue(name,"attack"));
SetValue("display","analyze",GetValue(name,"analyze"));
SetValue("display","respond",GetValue(name,"respond"));
SetValue("display","defend",GetValue(name,"defend"));
SetValue("display","support",GetValue(name,"support"));
SetValue("display","actions",GetValue(name,"actions"));
SetValue("display","trait",GetValue(name,"trait"));
SetValue("display","maxhealth",GetValue(name,"maxhealth"));
var anname = GetValue(name,"anname");
var anattack = GetValue(name,"anattack");
var anrespond = GetValue(name,"anrespond");
var ananalyze = GetValue(name,"ananalyze");
var ansupport = GetValue(name,"ansupport");
var andefend = GetValue(name,"andefend");
var antrait = GetValue(name,"antrait");
var anhealth = GetValue(name,"anhealth");
var anmove = GetValue(name,"anmove");
var anattack1 = GetValue(name,"anattack1");
var anattack2 = GetValue(name,"anattack2");
if(anname != null && anname == false) SetValue("display","anname",false); else SetValue("display","anname",true);
if(anattack != null && anattack == false) SetValue("display","anattack",false); else SetValue("display","anattack",true);
if(anrespond != null && anrespond == false) SetValue("display","anrespond",false); else SetValue("display","anrespond",true);
if(ananalyze != null && ananalyze == false) SetValue("display","ananalyze",false); else SetValue("display","ananalyze",true);
if(ansupport != null && ansupport == false) SetValue("display","ansupport",false); else SetValue("display","ansupport",true);
if(andefend != null && andefend == false) SetValue("display","andefend",false); else SetValue("display","andefend",true);
if(antrait != null && antrait == false) SetValue("display","antrait",false); else SetValue("display","antrait",true);
if(anhealth != null && anhealth == false) SetValue("display","anhealth",false); else SetValue("display","anhealth",true);
if(anmove != null && anmove == false) SetValue("display","anmove",false); else SetValue("display","anmove",true);
if(anattack1 != null && anattack1 == false) SetValue("display","anattack1",false); else SetValue("display","anattack1",true);
if(anattack2 != null && anattack2 == false) SetValue("display","anattack2",false); else SetValue("display","anattack2",true);
goToPassage("Display Unit");
}
function displayEvent(name){
resetDisplays();
SetValue("display","name", name);
SetValue("display","title",GetValue(name,"title"));
SetValue("display","desc",GetValue(name,"desc"));
SetValue("display","type",GetValue(name,"type"));
SetValue("display","value",GetValue(name,"value"));
SetValue("display","timed",GetValue(name,"timed"));
SetValue("display","timeleft",GetValue(name,"timeleft"));
SetValue("display","color",GetValue(name,"color"));
var event = GetValue(name,"event");
SetValue("display","event",event);
var symbol = getHarloweVariable(name+"_symbol");
if(symbol == 0 || symbol == null) symbol = event;
SetValue("display","symbol",symbol);
goToPassage("Display Event");
}
function resetDisplays(){
SetValue("display","name", "");
SetValue("display","title", "");
SetValue("display","symbol", "");
SetValue("display","status", "");
SetValue("display","branch", "");
SetValue("display","color", "");
SetValue("display","desc", "");
SetValue("display","health", 0);
SetValue("display","maxhealth", 0);
SetValue("display","move", 0);
SetValue("display","attack", 0);
SetValue("display","analyze", 0);
SetValue("display","respond", 0);
SetValue("display","defend", 0);
SetValue("display","support", 0);
SetValue("display","actions", 0);
SetValue("display","searches", 0);
SetValue("display","type", "");
SetValue("display","statbuff", 0);
SetValue("display","defbuff", 0);
SetValue("display","defending", false);
SetValue("display","analyzevalue", 0);
SetValue("display","analyzed", 0);
SetValue("display","anname", true);
SetValue("display","anattack", true);
SetValue("display","anrespond", true);
SetValue("display","ananalyze", true);
SetValue("display","ansupport", true);
SetValue("display","andefend", true);
SetValue("display","antrait", true);
SetValue("display","anmove", true);
SetValue("display","anattack1", true);
SetValue("display","anattack2", true);
SetValue("display","value", 0);
SetValue("display","timed", false);
SetValue("display","timeleft", 0);
SetValue("display","event", "");
}
function highlightHexes(hexes){
for (var i = 0; i < hexes.length; i++){
var x = hexes[i].x;
var y = hexes[i].y;
$("#hex-"+x+"-"+y).append('<div id="select-'+x+'-'+y+'" class="hex-icon select-icon unit select-hex clickable" style="z-index: 100;" onclick="activateSelect(this);"></div>');
}
}
function insertHexes(){
var map_width = getHarloweVariable("map_width");
var map_height = getHarloweVariable("map_height");
var map = "";
for (var y = 0; y <= map_height; y++) {
var row_class = "even";
if(y%2 == 0) row_class = "odd";
map += '<div class="'+row_class+'" id="row-'+y+'">';
for (var x = 0; x <= map_width; x++) {
map += '<div class="hexagon hex-N" id="hex-'+x+'-'+y+'" style="border-color: #333;">';
map += '<div class="hexTop" style="border-top-color: #333; border-right-color: #333;"></div>';
map += '<div class="hexBottom" style="border-bottom-color: #333; border-left-color: #333;"></div>';
map += '<div class="hex-data">'+x+','+y+'</div></div>';
}
map += '<div style="clear: both;"></div>';
map += '</div>';
}
$("#displayMap").append(map);
$("#displayMap").append('<div style="clear: both;"></div>');
}
insertHexes();
</script>
<div id="displayMap" class="hex-container">
</div>
<script>
</script>
<style>
.clickable {
cursor: pointer;
}
.complete-label {
top: 41px;
color: gray;
font-style: italic;
}
body{
line-height: normal;
}
.selectable-unit {
margin: 30px;
font-size: 12pt;
border: 3px solid green;
padding: 10px;
cursor: pointer;
}
.selectable-unit:hover {
border: 3px solid lime;
}
.jsgrid-grid-body, .jsgrid-header-scrollbar {
overflow: hidden;
}
td.jsgrid-cell {
float: none !important;
}
.jsgrid-grid-body {
height: initial;
}
.jsgrid-row > .jsgrid-cell, .jsgrid-header-row > .jsgrid-header-cell, .jsgrid-alt-row > .jsgrid-cell {
background: #000;
}
/*----Tutorial Stuff---- */
.tut {
cursor: pointer;
color: lightgreen;
font-size: 14px;
font-style: italic;
}
.tut-link{
margin-top: 20px;
}
.tut-detail {
font-size: 14px;
color: white;
display: none;
max-width: 800px;
margin-top: 5px;
}
.tut-detail p {
font-size: 14px;
}
.enemy {
color: mediumpurple;
}
.example {
font-style: italic;
}
.threat {
color: tomato;
}
.large-btn {
padding: 15px 25px;
font-size: 24px;
text-align: center;
cursor: pointer;
outline: none;
color: #fff;
background-color: #4CAF50;
border: none;
border-radius: 15px;
}
.large-btn:hover {
background-color: #3e8e41
}
.large-btn:active {
background-color: darkgreen;
}
@media screen and (max-width: 600px) {
.map-container {
display: none;
}
}
@media screen and (min-width: 600px) {
.map-container {
display: flex;
}
}
.green-border {
border: 2px solid #11ff11;
border-radius: 3px;
}
.emph {
color: #11ff11;
}
.emph2 {
color: lightgreen;
}
.lime {
color: lime;
}
.lg {
color: lightgreen;
}
.light-emph {
color: #aaffaa;
}
/*
REGION CSS
*/
.stat-prefix {
color: lightgreen;
margin-left: 20px;
margin-bottom: 5px;
}
.die {
margin-top: 10px;
}
.die-header {
float: left;
font-size: 20px;
margin-top: 12px;
}
.die {
border: 1px solid limegreen;
float: left;
cursor: pointer;
width: 60px;
height: 60px;
position: relative;
z-index: 50;
}
.die-child {
width: 10px;
height: 10px;
position: absolute;
top: 45%;
padding-top: 3px;
left: 47%;
margin: -20px 0 0 -8px;
font-size: 35px;
}
.die-Basic {
border: 3px solid limegreen;
margin-top: 4px;
}
.die-Crit {
border: 4px solid limegreen;
border-style: dotted;
}
.die-Reliable {
border: 4px solid limegreen;
border-style: double;
}
.unit {
position: absolute;
left: 9.1px;
top: 1px;
width: 50px;
height: 50px;
border: none;
cursor: pointer;
border-radius: 0;
background-size: cover;
background-position: center;
background-color: transparent;
}
.hex-icon a {
color: lime;
border-radius: 0;
background-size: cover;
background-position: center;
background-color: transparent;
}
.hex-icon {
position: absolute;
top: -5px;
z-index: 49;
color: black;
font-size: 42px;
cursor: pointer;
width: 50px;
height: 50px;
}
.play-btn {
float: left;
margin-top: 13px;
}
.play-btn-smol {
float: left;
margin-top: 13px;
background: seagreen;
border-color: seagreen;
}
.play-btn-smol-m {
float: left;
margin: 5px;
background: seagreen;
border-color: seagreen;
}
.trait {
cursor: pointer;
color: limegreen;
margin-left: 20px;
}
.trait-popup, .trait div {
position: absolute;
z-index: 160;
border: 1px solid limegreen;
background: black;
color: white;
padding: 5px;
width: 200px;
}
.no-display {
display: none;
}
.cancel-icon-button {
float: left;
margin: 5px;
width: 90%;
height: 50px;
}
.cancel-icon {
left: -4px;
top: -9px;
z-index: 151;
}
span.detail-header {
color: lightgreen;
font-style: italic;
}
.unit-info-pane {
position: absolute;
background: black;
border: solid 3px lime;
z-index: 100;
min-width: 200px;
top: 50px;
left: -50px;
}
@media screen and (max-width: 900px) {
.unit-info-pane {
width: 70vw;
}
}
@media screen and (min-width: 900px) {
.unit-info-pane {
width: 500px;
}
}
.show {
visibility: visible;
}
.hide {
visibility: collapse;
}
.corpse {
background-color: darkgray;
}
.resolved {
background-color: darkgray;
}
.active-player {
border-radius: 0%;
}
.hex-container {
line-height: 1;
width: 1600px;
margin-top: 20px;
}
#mySidenav, .sidenav {
display: none;
width: 100px;
}
.hex-data {
position: absolute;
z-index: 51;
color: black;
display: block;
font-size: 14px;
}
.hex-value {
position: absolute;
z-index: 51;
display: block;
bottom: 3px;
right: 5px;
background-color: black;
border-radius: 5px;
padding: 2px;
font-size: 10px;
}
.hex-time-left {
position: absolute;
z-index: 51;
display: block;
bottom: 2px;
left: 5px;
font-size: 12px;
background: red;
border-radius: 5px;
padding: 1px;
border-color: red;
}
div.even {
position: relative;
left: -1.56em;
}
div.odd {
position: relative;
}
.hexagon {
position: relative;
width: 75px;
height: 43.30px;
margin: 21.65px 0;
background-image: url(http://csshexagon.com/img/meow.jpg);
background-size: auto 79.6743px;
background-position: center;
border-left: solid 3px #333333;
border-right: solid 3px #333333;
float: left;
}
.hexTop,
.hexBottom {
position: absolute;
z-index: 1;
width: 53.03px;
height: 53.03px;
overflow: hidden;
-webkit-transform: scaleY(0.5774) rotate(-45deg);
-ms-transform: scaleY(0.5774) rotate(-45deg);
transform: scaleY(0.5774) rotate(-45deg);
background: inherit;
left: 7.98px;
}
/*counter transform the bg image on the caps*/
.hexTop:after,
.hexBottom:after {
content: "";
position: absolute;
width: 69.0000px;
height: 39.83716857408418px;
-webkit-transform: rotate(45deg) scaleY(1.7321) translateY(-19.9186px);
-ms-transform: rotate(45deg) scaleY(1.7321) translateY(-19.9186px);
transform: rotate(45deg) scaleY(1.7321) translateY(-19.9186px);
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
background: inherit;
}
.hexTop {
top: -26.5165px;
border-top: solid 4.2426px #333333;
border-right: solid 4.2426px #333333;
}
.hexTop:after {
background-position: center top;
}
.hexBottom {
bottom: -26.5165px;
border-bottom: solid 4.2426px #333333;
border-left: solid 4.2426px #333333;
}
.hexBottom:after {
background-position: center bottom;
}
.hexagon:after {
content: "";
position: absolute;
top: 1.7321px;
left: 0;
width: 69.0000px;
height: 39.8372px;
z-index: 2;
background: inherit;
}
.hexagon {
float: left;
margin: 10.65px 0;
}
.hex-N {
background: gray;
}
.hex-N:hover {
background: #666;
}
.hex-none, .hex-none:hover, .hex-B, .hex-B:hover {
background: black;
cursor: default;
}
.hex-water, .hex-water:hover, .hex-W, .hex-W:hover {
background: cadetblue;
cursor: default;
}
.hex-M {
background: indianred;
}
.hex-M:hover {
background: #ab3a3a;
}
.hex-F {
background: green;
}
.hex-F:hover {
background: darkgreen;
}
.hex-C {
background: darkgoldenrod;
}
.hex-C:hover {
background: goldenrod;
}
.hex-V {
background: #A69;
}
.hex-V:hover {
background: #A69;
}
.hex-ESOPH {
background: black;
}
.hex-ESOPH:hover {
background: black;
}
.hex-ESOPH .hex-data {
color:red;
}
.selected {
-webkit-animation: none;
-moz-animation: none;
-ms-animation: none;
animation: none;
}
.event-item {
line-height: normal;
margin-bottom: 10px;
}
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 200;
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
-webkit-animation-name: fadeIn; /* Fade in the background */
-webkit-animation-duration: 0.4s;
animation-name: fadeIn;
animation-duration: 0.4s
}
/* Modal Content */
.modal-content {
position: fixed;
bottom: 0;
background-color: #fefefe;
width: 100%;
-webkit-animation-name: slideIn;
-webkit-animation-duration: 0.4s;
animation-name: slideIn;
animation-duration: 0.4s
}
/* The Close Button */
.close {
color: white;
float: right;
font-size: 50px;
font-weight: bold;
margin-right: 10px;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
.modal-header {
padding: 2px 16px;
background-color: #222;
color: white;
border-bottom: 1px solid #999
}
.modal-body {
padding: 0px 0px;
background-color: black;
min-height: 100px;
}
.modal-footer {
padding: 2px 16px;
background-color: #222;
color: white;
border-top: 1px solid #999;
height: 50px;
}
/* Add Animation */
@-webkit-keyframes slideIn {
from {
bottom: -300px;
opacity: 0
}
to {
bottom: 0;
opacity: 1
}
}
@keyframes slideIn {
from {
bottom: -300px;
opacity: 0
}
to {
bottom: 0;
opacity: 1
}
}
@-webkit-keyframes fadeIn {
from {
opacity: 0
}
to {
opacity: 1
}
}
@keyframes fadeIn {
from {
opacity: 0
}
to {
opacity: 1
}
}
div.spiral {
width: 100px;
height: 100px;
border-radius: 100%;
position: absolute;
border: 1px solid limegreen;
animation: up 1s;
animation-iteration-count: infinite;
transition: 2s;
border-bottom: none;
border-right: none;
animation-timing-function: linear;
margin-left: -70px;
margin-top: -50px;
left: 50%;
top: 50%;
}
@keyframes up {
from {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
100% {
transform: rotate(360deg);
}
}
#img2 {
width: 90px;
height: 90px;
left: 50.35%;
top: 50.7%;
animation-delay: .2s;
}
#img3 {
width: 80px;
height: 80px;
left: 50.70%;
top: 51.4%;
animation-delay: .4s;
}
#img4 {
width: 70px;
height: 70px;
left: 51.05%;
top: 52.1%;
animation-delay: .6s;
}
#img5 {
width: 60px;
height: 60px;
left: 51.40%;
top: 52.8%;
animation-delay: .8s;
}
.active-player-pulse {
-webkit-mask-box-image: none;
background-color: transparent;
border-radius: 50%;
background-size: cover;
background-repeat: no-repeat;
box-shadow: 0 0 0 0 lime;
-webkit-animation: pulse 3.25s infinite cubic-bezier(0.66, 0, 0, 1);
-moz-animation: pulse 3.25s infinite cubic-bezier(0.66, 0, 0, 1);
-ms-animation: pulse 3.25s infinite cubic-bezier(0.66, 0, 0, 1);
animation: pulse 3.25s infinite cubic-bezier(0.66, 0, 0, 1);
}
.pulse-button:hover {
-webkit-animation: none;
-moz-animation: none;
-ms-animation: none;
animation: none;
}
@-webkit-keyframes pulse {
to {
box-shadow: 0 0 0 25px rgba(232, 76, 61, 0);
}
}
@-moz-keyframes pulse {
to {
box-shadow: 0 0 0 25px rgba(232, 76, 61, 0);
}
}
@-ms-keyframes pulse {
to {
box-shadow: 0 0 0 25px rgba(232, 76, 61, 0);
}
}
@keyframes pulse {
to {
box-shadow: 0 0 0 25px rgba(232, 76, 61, 0);
}
}
.selected-unit {
background-color: lime;
}
div.text-mission p {
font-size: 100% !important;
}
.classic-link{
text-decoration: underline;
}
.timer-num{
color: black;
font-style: normal;
margin: 2px 2px 2px 2px;
font-weight: bold;
font-size: 13px;
}
.timer-pic{
width: 8px;
margin-bottom: 2px;
height: 12px;
float: right;
}
.display-symbol{
position: relative;
top: 16px;
width: 50px;
height: 50px;
border: none;
cursor: default;
border-radius: 0;
background-size: cover;
background-position: center;
}
.select-hex {
-webkit-mask-box-image: url("https://svgshare.com/i/58h.svg");
-webkit-mask-box-image: url("select.svg");
background-color: gold;
}
.hex-status-container {
position: absolute;
z-index: 51;
display: block;
bottom: 2px;
left: 5px;
border-radius: 5px;
padding: 1px;
background: black;
}
.status-pic {
width: 12px;
height: 12px;
float: right;
}
</style>
}(display: "Hex Map"){
<script>
var em_units = getHarloweVariable("em_units");
for(var i = 0; i < em_units.length; i++)
InsertUnit(em_units[i]);
var enemy_units = getHarloweVariable("enemy_units");
for(var i = 0; i < enemy_units.length; i++)
InsertUnit(enemy_units[i]);
var events = getHarloweVariable("events");
for(var i = 0; i < events.length; i++)
InsertEvent(events[i]);
var hex_types = getHarloweVariable("hex_types");
for(var i = 0; i < hex_types.length; i++){
var hex_type = hex_types[i];
var arr = hex_type.split("-");
var hexId = "#hex-" + arr[0] + "-" + arr[1];
$(hexId).removeClass("hex-N");
$(hexId).addClass("hex-"+arr[2]);
}
</script>
(display: "Insert Tooltip")
}{
(set: $mission_num to 1)
(set: $mission_points to 0)
(set: $map_width to 9)
(set: $map_height to 5)
(set: $mission_log to (a: "Mission Start") )
(set: $strange_seen to false)
(set: $current_action to "")
(set: $current_die to "")
(set: $target_title to "")
(set: $target_x to "")
(set: $target_y to "")
(set: $target_exists to false)
(set: $em_units to (a: "fist", "big","ann"))
(set: $enemy_units to (a: "vamp1", "vamp2", "vamp3", "strvamp1", "strvamp2"))
(set: $events to (a: "vampatk", "vampfleg", "gothic", "lair"))
(set: $hex_types to (a: "5-2-C","6-2-C","5-3-C","6-3-C","7-3-C","5-4-C","6-4-C","7-2-C","7-1-C","8-1-C","8-2-C", "8-3-C", "4-4-C", "9-1-C"))
(set: $resolving_events to (a: ))
(set: $fist_title to "Captain Fist")
(set: $fist_x to 2)
(set: $fist_y to 3)
(set: $fist_actions to 2)
(set: $fist_status to "alive")
(set: $fist_turndie to "")
(set: $fist_symbol to "xero-guard")
(set: $fist_type to "Emergent")
(set: $fist_branch to "XERO")
(set: $fist_color to "lime")
(set: $fist_desc to "Captain Fist is a proud member of the XERO Guard. With the help of her exoskeletal strength enhancing mechsuit, she punches evil in the face.")
(set: $fist_health to 6)
(set: $fist_maxhealth to 6)
(set: $fist_move to 6)
(set: $fist_attack to 6)
(set: $fist_defend to 1)
(set: $fist_analyze to 0)
(set: $fist_statbuff to 0)
(set: $fist_defbuff to 0)
(set: $fist_defending to false)
(set: $big_title to "Bigfoot")
(set: $big_x to 2)
(set: $big_y to 1)
(set: $big_actions to 2)
(set: $big_status to "alive")
(set: $big_turndie to "")
(set: $big_symbol to "embassy-cryptid")
(set: $big_type to "Emergent")
(set: $big_branch to "Night Embassy")
(set: $big_color to "lime")
(set: $big_desc to "A subtle, fuzzy philosopher whose inherent magical powers and use of a floppy hat and big trench-coat allow him to move unnoticed by excitable humans. Quite the reverse--BF's gentle demeanor and immense strength make him an expert at calming Crises and responding to Opportunities.")
(set: $big_health to 5)
(set: $big_maxhealth to 5)
(set: $big_move to 7)
(set: $big_respond to 4)
(set: $big_trait to "")
(set: $big_statbuff to 0)
(set: $big_defbuff to 0)
(set: $big_defending to false)
(set: $ann_title to "Annie Athema")
(set: $ann_x to 3)
(set: $ann_y to 0)
(set: $ann_actions to 2)
(set: $ann_status to "alive")
(set: $ann_turndie to "")
(set: $ann_symbol to "tangent-molotov")
(set: $ann_type to "Emergent")
(set: $ann_branch to "Tangent")
(set: $ann_color to "lime")
(set: $ann_desc to "Annie is a chemistry student turned anarchist rabble rouser turned EMERGENT agent. She rides around in an RV kitted out with a monitoring station and biochemical lab.")
(set: $ann_health to 5)
(set: $ann_maxhealth to 5)
(set: $ann_move to 4)
(set: $ann_attack to 2)
(set: $ann_defend to 2)
(set: $ann_analyze to 3)
(set: $ann_statbuff to 0)
(set: $ann_defbuff to 0)
(set: $ann_defending to false)
(set: $vamp1_title to "Vampire")
(set: $vamp1_x to 7)
(set: $vamp1_y to 1)
(set: $vamp1_status to "alive")
(set: $vamp1_health to 8)
(set: $vamp1_type to "Enemy")
(set: $vamp2_title to "Vampire")
(set: $vamp2_x to 4)
(set: $vamp2_y to 4)
(set: $vamp2_status to "alive")
(set: $vamp2_health to 8)
(set: $vamp2_type to "Enemy")
(set: $vamp3_title to "Vampire")
(set: $vamp3_x to 8)
(set: $vamp3_y to 3)
(set: $vamp3_status to "gone")
(set: $vamp3_health to 8)
(set: $vamp3_type to "Enemy")
(set: $vamp_tier to 1)
(set: $vamp_symbol to "vampire")
(set: $vamp_branch to "Diabol")
(set: $vamp_color to "purple")
(set: $vamp_desc to "A blood-drinking creature of the night.<br/><br/>Carnivorous predator of humanity. Does not sparkle.<br/><br/>Defeat monsters by ATTACKing them.")
(set: $vamp_maxhealth to 8)
(set: $vamp_move to 4)
(set: $vamp_attack to 3)
(set: $vamp_analyzevalue to 0)
(set: $vamp_analyzed to false)
(set: $vamp_anattack to false)
(set: $vamp_attacks to (a: "Seek Emergent", "Attack Weakness"))
(set: $strvamp1_title to "Strange Vampire")
(set: $strvamp1_x to 0)
(set: $strvamp1_y to 0)
(set: $strvamp1_status to "gone")
(set: $strvamp1_health to 10)
(set: $strvamp1_type to "Enemy")
(set: $strvamp2_title to "Strange Vampire")
(set: $strvamp2_x to 0)
(set: $strvamp2_y to 0)
(set: $strvamp2_status to "gone")
(set: $strvamp2_health to 10)
(set: $strvamp2_type to "Enemy")
(set: $strvamp_tier to 1)
(set: $strvamp_symbol to "strange-vampire")
(set: $strvamp_branch to "Diabol")
(set: $strvamp_color to "purple")
(set: $strvamp_desc to "Their fangs are too long, and don't retract.<br/><br/>Their eyes are wide and desperate.<br/><br/>Their veins bulge, clogged and purplish.<br/><br/>Something is wrong with them.")
(set: $strvamp_maxhealth to 10)
(set: $strvamp_move to 5)
(set: $strvamp_attack to 4)
(set: $strvamp_analyzevalue to 0)
(set: $strvamp_analyzed to false)
(set: $strvamp_anattack to false)
(set: $strvamp_anmove to false)
(set: $strvamp_anhealth to false)
(set: $strvamp_attacks to (a: "Seek Emergent", "Attack Weakness"))
(set: $vampatk_title to "Vampire Attacks")
(set: $vampatk_x to 6)
(set: $vampatk_y to 3)
(set: $vampatk_desc to "Dying, almost bloodless humans litter alleyways.<br/><br/>Some might be saved if you can get to them in time.<br/><br/>You can deal with a Crisis like this one by RESPONDing to it.")
(set: $vampatk_type to "Event")
(set: $vampatk_event to "Crisis")
(set: $vampatk_status to "active")
(set: $vampatk_value to 7)
(set: $vampatk_timeleft to 2)
(set: $vampatk_timed to true)
(set: $vampfleg_title to "Vampire Fledgling")
(set: $vampfleg_x to 8)
(set: $vampfleg_y to 3)
(set: $vampfleg_desc to "We've linked a news report about a man assaulted in an alley to a hospital report about neck wounds and blood loss.<br/><br/>We know he's locked himself in his apartment.<br/><br/>We have a cure for vampirism during its first onset.<br/><br/>If we can get to him in time, we can save him.<br/><br/>If we can't, we'll have to stop him before he hurts anyone else.<br/><br/>You can deal with a Crisis like this one by RESPONDing to it.")
(set: $vampfleg_type to "Event")
(set: $vampfleg_event to "Crisis")
(set: $vampfleg_status to "active")
(set: $vampfleg_value to 10)
(set: $vampfleg_timeleft to 3)
(set: $vampfleg_timed to true)
(set: $gothic_title to "Neighborhood with Gothic Architecture")
(set: $gothic_x to 9)
(set: $gothic_y to 1)
(set: $gothic_desc to "Based on our research and attack triangulation, this old, half-abandoned, neighborhood of Gothic manors is the most likely base of operations for the vampires.<br/><br/>Be careful--once we find their lair, we will certainly meet resistance.<br/><br/>You can solve an Enigma like this one by ANALYZING it.")
(set: $gothic_type to "Event")
(set: $gothic_event to "Enigma")
(set: $gothic_status to "active")
(set: $gothic_value to 15)
(set: $lair_title to "Vampire Lair")
(set: $lair_x to 9)
(set: $lair_y to 1)
(set: $lair_desc to "There are splotches of strange, purple liquid on the walls of the vampire lair.<br/><br/>We've never seen anything like it before.<br/><br/>We should take samples for analysis.")
(set: $lair_type to "Event")
(set: $lair_symbol to "spooky-house")
(set: $lair_event to "Enigma")
(set: $lair_status to "gone")
(set: $lair_value to 10)
}{(set: $map_responsive to true)
(if: $display_type is "Emergent")[<script>$(".stat-prefix, .custom_color").css("color","lightgreen");</script>
](else:)[<script>$(".stat-prefix, .custom_color").css("color","violet");</script>]
<div class="modal-body">
<h2 class="custom_color" style="margin-top: 10px; margin-bottom: 3px; position: relative; float: left; margin-right: 20px;">(if: $display_anname is true)[$display_title](else:)[$display_faketitle]</h2>
<div class="hex-icon" style="position: relative; float: left; margin-right: 20px;"> <div id="symbol-container" class="symbol-color display-symbol"></div></div>
<div style="clear:both;"></div>
<div>
<div class="custom_color" style="font-style: italic; margin-bottom: 5px;">
$display_branch Unit
</div>
(if: $display_status is "alive" or $display_status is "stunned")[
<div>(if: $display_status is "stunned")[This unit is <span class="threat">STUNNED</span>]</div>
<div>
(if: $display_anhealth is true)[<span style="margin-bottom: 5px;">
<span class="stat-prefix">Health:</span> $display_health / $display_maxhealth
</span>]
(if: $display_anmove is true)[<span style="margin-bottom: 5px;">
<span class="stat-prefix">Range:</span> $display_move
</span>]
</div>
<div style="margin-top: 5px;">
(if: $display_attack is not 0 and $display_anattack is true)[<span class="stat-prefix">Attack:</span> $display_attack ]
(if: $display_analyze is not 0 and $display_ananalyze is true)[<span class="stat-prefix">Analyze:</span> $display_analyze ]
(if: $display_respond is not 0 and $display_anrespond is true)[<span class="stat-prefix">Respond:</span> $display_respond ]
(if: $display_defend is not 0 and $display_andefend is true)[<span class="stat-prefix">Defend:</span> $display_defend ]
(if: $display_support is not 0 and $display_ansupport is true)[<span class="stat-prefix">Support:</span> $display_support ]
</div>
(if: $display_statbuff is not 0 or $display_defbuff is not 0)[
<div style="margin-top: 5px;">
(if: $display_statbuff is not 0)[<span>
<div class="up-symbol"></div><div style="float: left;"><span class="stat-prefix" style="color: lime;">Support Bonus:</span> +$display_statbuff</div>
</span>]
(if: $display_defbuff is not 0)[<span>
<div style="float: left;"><span class="stat-prefix" style="color: lime;">Defense Bonus:</span> +$display_defbuff</div>
</span>]
</div>]
<div style="clear: both;"></div>
(if: $display_defending is true)[<div style="color: lime;"><div class="shield-symbol"></div><span style="margin-left: 20px;">DEFENDING</span></div>]
(if: $display_type is "Enemy" and $display_analyzed is false)[
<div style="margin-top: 5px;">
<span>
<span class="stat-prefix">Analyze Progress:</span> $display_analyzevalue / 5
</span>
</div>]
<br/>
<div><i>(if: $display_anname is true)[$display_desc](else:)[$display_fakedesc]</i></div>
](else:)[
<div><i>This enemy has left a corpse. You can analyze it.</i></div>
]
<br/>
(if: $display_trait != "" and $display_antrait is true)[
<div >
Traits:
<span class="trait">$display_trait </span>
</div>]
</div>
(if: $display_type is "Emergent")[
$display_title has <span class="emph2">$display_actions Actions</span> left this turn.
(if: $display_actions is 0)[{<div style="margin: 10px 0px;">$display_title can perform no more actions this turn.</div>}
](else:)[{<div style="margin: 10px 0px;">
<span style="position: relative; bottom: 5px;float: left; margin: 0px; margin-right: 15px;">You Can Order $display_title To:</span>
<button class="obj-btn play-btn" style="margin: 0px; margin-right: 15px;" onclick="$('#action_types').css('display','block');">Act</button>
<span style="position: relative; bottom: 5px;float: left; margin: 0px; margin-right: 5px;">or</span>
<button class="obj-btn play-btn" style="margin: 0px; margin-left: 15px; margin-right: 15px;" onclick="startMove();">Move</button>
<div style="clear: both;"></div>
<div id="action_types" style="margin-top: 5px; display: none;">
<span style="position: relative; bottom: 0px;float: left; margin: 0px; margin-right: 5px;">What type of action?</span>
(if: $display_hextype is "C")[<button class="obj-btn play-btn-smol-m" onclick="startAct('Recover');" style="background-color: darkgoldenrod; border-color: darkgoldenrod;">Recover</button>]
<button class="obj-btn play-btn-smol-m" onclick="startAct('Attack');">Attack</button>
<button class="obj-btn play-btn-smol-m" onclick="startAct('Respond');">Respond</button>
<button class="obj-btn play-btn-smol-m" onclick="startAct('Analyze');">Analyze</button>
<button class="obj-btn play-btn-smol-m" onclick="startAct('Defend');">Defend</button>
<button class="obj-btn play-btn-smol-m" onclick="startAct('Support');">Support</button>
<button style="display: none; background: darkred; border-color: darkred;" class="obj-btn play-btn-smol-m" onclick="$('#action_types').css('display','none');">Cancel Action</button>
<div style="clear: both;"></div>
</div>
</div>
}]
<br/>
|talkTo>[Talk To $display_title] ]
</div>
<script>
insertSymbol();
function startAct(actionType){
setHarloweVariable("current_action",actionType);
var name = getHarloweVariable("display_name");
var current_action = getHarloweVariable("current_action");
var x = GetValue(name,"x");
var y = GetValue(name,"y");
var hexes = getReachableHexes(x,y,1,current_action,name);
var target_exists = false;
if(hexes.length > 0)
target_exists = true;
if(current_action == "Support"){
target_exists = false;
var em_units = getHarloweVariable("em_units");
for(var i = 0; i < em_units.length; i++){
var status = GetValue(em_units[i],"status");
if(status = "alive")
target_exists = true;
}
}
setHarloweVariable("target_exists",target_exists);
goToPassage("Take Action");
}
function startMove(){
setHarloweVariable("current_action","Move");
goToPassage("Move Unit");
}
</script>
<style>
.stat-prefix {
color: lightgreen;
margin-left: 20px;
margin-bottom: 5px;
}
.obj-btn {
font-size: 16pt;
position: relative;
bottom: 3px;
color: white;
background: green;
border-color: green;
margin-left: 20px;
box-sizing: border-box;
padding: 1px 6px;
align-items: flex-start;
text-align: center;
box-sizing: border-box;
padding: 2px 6px 3px;
border-width: 2px;
border-style: outset;
border-image: initial;
cursor: pointer;
text-decoration: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
letter-spacing: normal;
word-spacing: normal;
}
.play-btn {
float: left;
margin-top: 13px;
}
.play-btn-smol-m {
float: left;
margin: 5px;
background: seagreen;
border-color: seagreen;
}
.shield-symbol {
z-index: 49;
float: left;
font-size: 42px;
cursor: pointer;
width: 25px;
height: 20px;
position: relative;
top: 7px;
left: 13px;
margin-left: 20px;
-webkit-mask-box-image: url("https://upload.wikimedia.org/wikipedia/commons/thumb/7/76/Wifiservice.svg/1277px-Wifiservice.svg.png");
-webkit-mask-box-image: url("shield.svg");
background-color: lime;
}
.up-symbol {
z-index: 49;
float: left;
font-size: 42px;
cursor: pointer;
width: 25px;
height: 20px;
position: relative;
top: 7px;
left: 13px;
margin-left: 20px;
-webkit-mask-box-image: url("https://upload.wikimedia.org/wikipedia/commons/thumb/7/76/Wifiservice.svg/1277px-Wifiservice.svg.png");
-webkit-mask-box-image: url("up.svg");
background-color: lime;
}
</style>
(set: $current_action to "")
(set: $current_die to "")
(set: $target_title to "")
(set: $target_x to "")
(set: $target_y to "")
(set: $target_exists to false)
}
|returnMission>[< Go Back Mission Briefing]
(display: "Mission Map"){
(set: $previous_passage to $currentPassage)
(set: $currentPassage to (passage:)'s name)
(click: ?returnMission)[(set: $map_responsive to true)(go-to: "Mission " + (text: $mission_num))]
(click: ?orderUnit)[(go-to: "Order Unit")]
(click: ?enemyTurn)[(go-to: "Enemy Turn")]
(click: ?displayUnit)[(go-to: "Display Unit")]
(click: ?failMission)[(go-to: "Mission Failure")]
(click: ?talkTo)[(set: $sequence to 0)(go-to: "Talk To " + $display_title)]
(click: ?next)[(set: $sequence to it + 1)(go-to: $currentPassage)]
(click: ?prev)[(set: $sequence to it - 1)(go-to: $currentPassage)]
(click: ?return)[(set: $sequence to 0)(go-to: $currentPassage)]
(click: ?prevPassage)[(go-to: $previous_passage)]
(click: ?reload)[(go-to: $currentPassage)]
(click: ?resolveEvents)[(go-to: "Resolve Events Mission " + (text: $mission_num))]
(click: ?mission1)[(go-to: "Mission 1")]
(click: ?mission2)[(go-to: "Mission 2")]
<div style="position: fixed; top: 10px; right: 20px;">
<div>(if: $mission_points > 0)[<span class="emph">MISSION POINTS:</span> $mission_points]</div>
(if: false)[<div>|save>[Save Game]</div>(click: ?save)[<script>savegame("MenuSave",getHarloweVariable("currentPassage"));</script>]
<div>|load>[Load Game]</div>(click: ?load)[<script>loadgame("MenuSave");</script> ]]
</div>
}(set: $map_responsive to false)(display: "Unit Comment")
(if: $current_action is "Attack")[(if: $target_exists is true)[What do you want to |detail>[Attack?]](else:)[There are no enemies adjacent to this unit, so they cannot |attack>[Attack].](click: ?detail)[
<span class="emph2">//You <b>Attack</b> to do violence against an enemy.
You can target any Enemy adjacent to your unit.
The power of this action will be done to the target as damage. It may be reduced by the target's defense.//</span>]
](elseif: $current_action is "Respond")[(if: $target_exists is true)[What do you want to |detail>[Respond] to?](else:)[There are no <span class="emph2">Crises</span> or <span class="emph2">Opportunities</span> adjacent to this unit, so they have nothing to |detail>[Respond] to.](click: ?detail)[
<span class="emph2">//You <b>Respond</b> to emergencies.
This is used to resolve Crises and take advantage of Opportunities that are adjacent to your unit.
The power of the action will reduce the value of the Crisis/Opportunity by an equal amount. When they reach zero, they are resolved.//</span>]
](elseif: $current_action is "Analyze")[(if: $target_exists is true)[What do you want to |detail>[Analyze]?](else:)[There are no <span class="emph2">Enigmas</span> or <span class="emph2">Enemies</span> adjacent to this unit, so they have nothing to |detail>[Analyze].](click: ?detail)[
<span class="emph2">//You <b>Analyze</b> mysteries.
This is used to investigate Enigmas and learn things about enemies.
The power of the action will reduce the value of an enigma, or move you toward learning a new thing about an enemy.
Every unit keeps track of how much it has been analyzed. For every 5 power dedicated to analyzing a unit, you learn a new thing about it.
You can see how close you are to learning a new thing by looking at the Analyze Progress in the unit description.//</span>]
](elseif: $current_action is "Defend")[Are you sure you want this unit to |detail>[Defend]?(click: ?detail)[
<span class="emph2">//You <b>Defend</b> other EMERGENT Units.
A Unit's Defend stat will automatically be subtracted from any incoming attack.
If you defend as an action, then for one <span class="threat">Enemy Turn</span> any enemy who would attack an adjacent Emergent unit, attacks you instead.//</span>]
](elseif: $current_action is "Recover")[Are you sure you want this unit to |detail>[Recover] their health?(click: ?detail)[
<span class="emph2">//You <b>Recover</b> your unit's health.
While in a yellow city hex, you can use an action and the resources available to completely heal your unit.//</span>]
](elseif: $current_action is "Support")[(if: $target_exists is true)[Are you sure you want this unit to |detail>[Support]?](else:)[There is no one here to |detail>[Support].](click: ?detail)[
<span class="emph2">//You <b>Support</b> other units.
Supporting a unit gives it +1 to defense and +1 to its actions this turn.
The power of the action determines how many allied units you can support, so you will be able to pick the units you want to Support after you resolve the action.
Outside of this Simulation, you will also be able to Support the <span class="emph2">Region</span> you are a part of.//</span>]
]
(if: $current_action is "Defend")[|notarget>[Confirm Defend.]
](if: $current_action is "Support")[|notarget>[Confirm Support.]
](if: $current_action is "Recover")[|recover>[Confirm Recover.]
]|displayUnit>[< Cancel Order]
(display: "Mission Map"){
(click: ?notarget)[(set: $target_title to "")(go-to: "Add Die")]
(click: ?recover)[<script>recoverUnit();</script>]
<script>
var name = getHarloweVariable("display_name");
var current_action = getHarloweVariable("current_action");
var x = GetValue(name,"x");
var y = GetValue(name,"y");
var hexes = getReachableHexes(x,y,1,current_action,name);
if(current_action != "Defend" && current_action != "Recover" && current_action != "Support")
highlightHexes(hexes);
function activateSelect(select){
var name = getHarloweVariable("display_name");
var arr = select.id.replace("select-","").split("-");
var x = arr[0];
var y = arr[1];
setHarloweVariable("target_x",x);
setHarloweVariable("target_y",y);
var hex = getHex(x,y);
setHarloweVariable("target_title",hex.title);
goToPassage("Add Die");
}
function recoverUnit(){
var name = getHarloweVariable("display_name");
var maxhealth = getHarloweVariable("display_maxhealth");
SetValue(name,"health",maxhealth);
SetValue(name,"actions",GetValue(name,"actions")-1);
var mission_num = getHarloweVariable("mission_num");
goToPassage("Mission " + mission_num);
}
</script>
}(set: $map_responsive to false)(display: "Unit Comment")
Where do you want to move <span class="emph2">$display_title</span>?
|prevPassage>[< Cancel Order]
(display: "Mission Map"){
<script>
var name = getHarloweVariable("display_name");
var x = GetValue(name,"x");
var y = GetValue(name,"y");
var move = GetValue(name,"move");
var hexes = getReachableHexes(x,y,move,"Move",name);
highlightHexes(hexes);
function activateSelect(select){
var name = getHarloweVariable("display_name");
var arr = select.id.replace("select-","").split("-");
var x = arr[0];
var y = arr[1];
moveUnit(name,x,y);
ReturnMission();
}
</script>
}<span style="color: red;">The Enemy Is Taking Their Turn</span>
<span id="enemy_action"></span><span id="resolve" style="display: none;">|resolveEvents>[Continue]</span><span id="next-turn" style="display: none;">|returnMission>[Continue]</span>
{<span style="display: none;">(display: "Mission Map")</span>
(display: "Mission "+(text: $mission_num)+" End Check")
(display: "Action Methods")
<script>
var displayCount = 0;
function displayActions(enemy_log_array){
$("#enemy_action").append(enemy_log_array[displayCount]);
displayCount++;
if(enemy_log_array.length == 0)
displayCount = 0;
if(displayCount != enemy_log_array.length)
setTimeout(function(){ displayActions(enemy_log_array); }, 1000);
else{
var resolving_events = getHarloweVariable("resolving_events");
if(resolving_events.length == 0)
$("#next-turn").css("display","block");
else
$("#resolve").css("display","block");
}
}
function EnemyTurn() {
setHarloweVariable("sequence",0);
var endMission = EndMissionCheck();
if(endMission)
{
var mission_num = getHarloweVariable("mission_num");
goToPassage("End Mission " + mission_num);
return;
}
var map_width = getHarloweVariable("map_width");
var map_height = getHarloweVariable("map_height");
var mission_log = getHarloweVariable("mission_log");
var current_action = "";
var enemy_log = "";
var enemy_log_array = [];
for (var y = 0; y < map_height+1; y++) {
for (var x = 0; x < map_width+1; x++) {
var hex = getHex(x,y);
if (hex.event != "" && hex.event != null && hex.timed == true && hex.timeleft == 1)
{
current_action = resolveTimeout(hex);
enemy_log_array.push(current_action + "<br/><br/>");
mission_log.push(current_action + "<br/>");
SetValue(hex.name,"status","resolved");
}
if (hex.timeleft > 0){
SetValue(hex.name,"timeleft",hex.timeleft - 1);
}
if (hex.event != "" && hex.event != null && hex.event != "Marker" && hex.value == 0)
{
current_action = resolveEvent(hex);
enemy_log_array.push(current_action + "<br/><br/>");
mission_log.push(current_action + "<br/>");
SetValue(hex.name,"status","resolved");
}
}
}
var enemy_units = getHarloweVariable("enemy_units");
for (var i = 0; i < enemy_units.length; i++) {
var name = enemy_units[i];
var baseName = name;
var type = GetValue(name,"type");
if(type == "Enemy")
baseName = baseName.slice(0, -1);
var x = GetValue(name,"x");
var y = GetValue(name,"y");
var enemy = getUnitFromName(name);
var curHex = getHex(x,y);
var result = "";
var full_action = "";
var startHex = new SimpleHex(x, y);
var target= null;
if(enemy != null){
if(enemy.status == "stunned")
SetValue(name,"status","alive");
if(enemy.health < 1)
SetValue(name,"status","gone");
if(enemy.status == "alive"){
var adjHexes = GetAdjacentHexes(x, y);
var emergentHex = null;
var emergentUnit = null;
if (enemy.trait == "Minor Regeneration" && enemy.health < enemy.maxhealth) {
enemy.health++;
SetValue(name,"health",enemy.health);
}
var attacks = GetValue(baseName,"attacks");
for (var a = 0; a < attacks.length; a++) {
full_action = "";
var enemyTitle = "<span style='color: violet;'>" +enemy.title + "</span>";
var attack = attacks[a];
switch(attack) {
case "Seek Emergent":
case "Seek Enemy":
case "Seek City":
case "Seek Event":
case "Seek Low Event":
case "Seek Base":
case "Seek Imprint":
var reach_hexes = getReachableHexes(x,y,enemy.move,attack,enemy);
if(reach_hexes.length == 0) target = null;
else target = reach_hexes[0];
if (target != null)
{
full_action = enemyTitle + " moving from " + enemy.x + "," + enemy.y + " to " + target.x + "," + target.y + ".";
moveUnit(enemy.name,target.x,target.y);
enemy_units[i].x = target.x;
enemy_units[i].y = target.y;
adjHexes = GetAdjacentHexes(target.x, target.y);
}
break;
case "Attack Strength":
case "Attack Weakness":
case "Attack Defenseless":
case "Attack Imprint":
case "Flail With Limbs":
emergentHex = null;
emergentUnit = null;
var blocked = false;
var blockingUnit = null;
for (var adj = 0; adj < adjHexes.length; adj++) {
var adjUnit = getUnit(adjHexes[adj].x,adjHexes[adj].y);
if (adjUnit != null)
{
var stealth = false;
if (adjUnit.trait == "Stealth") stealth = true;
if (adjUnit.trait == "Tactical Cloak" && (enemy.branch.toLowerCase() == "human" || enemy.branch.toLowerCase() == "servitor")) stealth = true;
if(attack == "Flail With Limbs" && adjUnit.defending == true && adjUnit.turndie == "Respond"){
blocked = true;
blockingUnit = adjUnit;
}
switchTarget = false;
if ((adjUnit.type == "Emergent" || adjUnit.type == "npc") && !stealth && adjUnit.health > 0)
if (emergentHex == null)
switchTarget = true;
else if (attack == "Attack Strength" && adjUnit.health > emergentUnit.health)
switchTarget = true;
else if (attack == "Attack Weakness" && adjUnit.health < emergentUnit.health)
switchTarget = true;
else if (attack == "Attack Defenseless" && adjUnit.defend < emergentUnit.defend)
switchTarget = true;
else if (attack == "Attack Imprint" && adjUnit.name == enemy.imprint)
switchTarget = true;
else if(attack == "Flail With Limbs" && Math.floor(Math.random() * 2) == 0)
switchTarget = true;
if (switchTarget){
emergentHex = adjHexes[adj];
emergentUnit = adjUnit;
}
}
}
if(blocked){
var defender_name = "<span style='color: lime;'>"+blockingUnit.title+"</span>";
full_action = enemyTitle + " tries to ATTACK, but "+ defender_name +" is RESPONDing to its flails and keeping everyone safe.<br/>";
}
else if (emergentHex != null)
{
var target_name = "<span style='color: lime;'>"+emergentUnit.title+"</span>";
full_action = enemyTitle + " ATTACKING " + target_name + " at " + emergentHex.x + "," + emergentHex.y + ". <br/>";
full_action += "<span style='margin-left: 15px;'>";
full_action += takeAction(enemy.name,"","Attack",emergentHex.x,emergentHex.y);
full_action += "</span>";
full_action += "<br/>";
}
break;
case "Attack Enemy":
enemyHex = null;
enemyUnit = null;
for (var adj = 0; adj < adjHexes.length; adj++) {
var adjUnit = getUnit(adjHexes[adj].x,adjHexes[adj].y);
if (adjUnit != null) {
if (adjUnit.type == "Enemy" && adjUnit.health > 0)
if (enemyUnit == null)
enemyUnit = adjUnit;
}
}
if (enemyUnit != null)
{
var target_name = "<span style='color: violet;'>"+enemyUnit.title+"</span>";
full_action = enemyTitle + " ATTACKING " + target_name + " at " + enemyUnit.x + "," + enemyUnit.y + ". ";
full_action += "<span style='margin-left: 15px;'>";
full_action += takeAction(enemy.name,"","Attack",enemyUnit.x,enemyUnit.y);
full_action += "</span>";
full_action += "<br/>";
}
break;
case "Aggravate Event":
emergentHex = null;
for (var adj = 0; adj < adjHexes.length; adj++) {
var adjHex = getHex(adjHexes[adj].x,adjHexes[adj].y);
if (adjHex != null && adjHex.value > 0 &&
(adjHex.event == "Crisis" || adjHex.event == "Enigma" || adjHex.event == "Opportunity"))
emergentHex = adjHex;
}
if (emergentHex != null)
{
var target_name = "<span style='color: lime;'>"+emergentHex.event+"</span>";
full_action = enemyTitle + " AGGRAVATING " + target_name + " at " + emergentHex.x + "," + emergentHex.y + ". Event value increased by 5.";
SetValue(emergentHex.name,"value",emergentHex.value + 5);
}
break;
case "Attack Base":
emergentHex = null;
for (var adj = 0; adj < adjHexes.length; adj++) {
var adjHex = getHex(adjHexes[adj].x,adjHexes[adj].y);
if (adjHex != null && adjhex.value > 0 && adjhex.event == "Base")
emergentHex = adjHex;
}
if (emergentHex != null)
{
var target_name = "<span style='color: lime;'>Emergent Base</span>";
full_action = enemyTitle + " ATTACKING "+target_name+" at " + emergentHex.x + "," + emergentHex.y + ". Base has taken " + enemy.attack + " Damage.";
var baseHealth = emergentHex.value - enemy.attack;
if (baseHealth < 0) baseHealth = 0;
SetValue(emergentHex.name,"value",baseHealth);
}
break;
case "Haunt City":
if (curHex.type == "C")
{
full_action = enemyTitle + " is HAUNTING the city at " + enemy.x + "," + enemy.y + ". Region Anomaly increased by 5.";
IncreaseThreat("Anomaly", 5);
}
break;
case "Assault City":
if (curHex.type == "C")
{
full_action = enemyTitle + " is ASSAULTING the city at " + enemy.x + "," + enemy.y + ". Region Danger increased by 5.";
IncreaseThreat("Danger", 5);
}
break;
case "Terrorize City":
if (curHex.type == "C")
{
full_action = enemyTitle + " is TERRORIZING the city at " + enemy.x + "," + enemy.y + ". Region Panic increased by 5.";
IncreaseThreat("Panic", 5);
}
break;
case "Destroy City":
if (curHex.type == "C")
{
full_action = enemyTitle + " has DESTROYED the city at " + enemy.x + "," + enemy.y + ". This hex is no longer a city.";
HexChange(x,y,"N");
}
break;
default:
}
if(full_action != ""){
enemy_log_array.push(full_action + "<br/><br/>");
mission_log.push(full_action + "<br/>");
}
}
}
}
}
displayCount = 0;
refreshUnitActions();
endMission = EndMissionCheck();
if(endMission)
{
var mission_num = getHarloweVariable("mission_num");
goToPassage("End Mission " + mission_num);
return;
}
else
setTimeout(function(){ displayActions(enemy_log_array); }, 2000);
}
function HexChange(x,y,newType){
}
function resolveTimeout(hex){
var titleText = "";
if (hex.title != "") titleText = " <span class=\"violet\">" + hex.title + "</span> ";
var current_action = "The " + hex.event + " " + titleText + " at " + hex.x + "," + hex.y + " has reached the end of its timer.<br/>";
var resolving_events = getHarloweVariable("resolving_events");
resolving_events.push("timeout_"+hex.name);
setHarloweVariable("resolving_events",resolving_events);
var enemy_log = getHarloweVariable("enemy_log");
setHarloweVariable("enemy_log",enemy_log + current_action);
return current_action;
}
function resolveEvent(hex){
var titleText = "";
if (hex.title != "") titleText = " <span class=\"violet\">" + hex.title + "</span> ";
var current_action = "The " + hex.event + " " + titleText + " at " + hex.x + "," + hex.y + " has been resolved.<br/>";
var resolving_events = getHarloweVariable("resolving_events");
resolving_events.push("resolve_"+hex.name);
setHarloweVariable("resolving_events",resolving_events);
var enemy_log = getHarloweVariable("enemy_log");
setHarloweVariable("enemy_log",enemy_log + current_action);
return current_action;
}
function refreshUnitActions(){
var em_units = getHarloweVariable("em_units");
for (var i = 0; i < em_units.length; i++) {
var name = em_units[i];
SetValue(name,"actions",2);
SetValue(name,"statbuff",0);
SetValue(name,"defbuff",0);
SetValue(name,"defending",false);
SetValue(name,"turndie","");
}
}
EnemyTurn();
</script>
}{
<script>
function moveUnit(name,x,y){
setHarloweVariable(name+"_x", x);
setHarloweVariable(name+"_y", y);
var type = GetValue(name,"type");
if(type == "Emergent"){
DeductAction(name);
}
}
function hex_neighbor(hex, direction){
var xCoords = GetAdjacentCoords(hex.x, hex.y, "xCoords");
var yCoords = GetAdjacentCoords(hex.x, hex.y, "yCoords");
return new SimpleHex(xCoords[direction], yCoords[direction]);
}
function ArrayContiansHex(arr,hex){
var found = false;
for(var i = 0; i < arr.length; i++) {
if (arr[i].x == hex.x && arr[i].y == hex.y) {
found = true;
break;
}
}
return found;
}
function getReachableHexes(x,y,range,actionType,actingUnit){
x = parseInt(x);
y = parseInt(y);
var visited = [];
var marked = [];
var fringes = [];
var savedBlockValues = [];
var paths = [];
var hexesBlocked = [];
var actingHex = new SimpleHex(x, y);
var startlist = [];
startlist.push(new SimpleHex(x, y));
fringes.push(startlist);
var originKey = x + "~" + y;
savedBlockValues[originKey] = "origin";
var pathlist = [];
pathlist.push(new SimpleHex(x, y));
paths[originKey] = pathlist;
var searchRadius = range;
if (actionType.includes("Seek"))
searchRadius = 100;
for (var k = 1; k <= searchRadius; k++)
{
fringes.push([]);
for (var index = 0; index <= fringes[k - 1].length; index++)
{
var fringesArray = fringes[k - 1];
if (fringesArray.length > index)
{
var hex = fringesArray[index];
var originBlockedValue = "";
originKey = hex.x + "~" + hex.y;
if (originKey in savedBlockValues)
originBlockedValue = savedBlockValues[originKey];
for (var dir = 0; dir < 6; dir++)
{
var neighbor = hex_neighbor(hex, dir);
var alreadyHaveHex = false;
if(ArrayContiansHex(visited,neighbor) || ArrayContiansHex(marked,neighbor))
alreadyHaveHex = true;
var blocked = check_hex_blocked(neighbor.x,neighbor.y, actionType, actingHex, actingUnit, originBlockedValue);
var blockedKey = neighbor.x + "-" + neighbor.y;
if (!(blockedKey in hexesBlocked))
hexesBlocked[blockedKey] = blocked;
if (blocked == "stand_still")
{
return [];
}
else if (blocked == "target")
{
var moveStyle = "Move To Target";
if (actionType == "Seek Emergent" || actionType == "Seek Event"
|| actionType == "Seek Base" || actionType == "Seek Imprint"
|| actionType == "Seek Low Event" || actionType == "Seek Enemy")
moveStyle = "Move Adjacent";
var singleList = [];
var path = paths[originKey];
if (moveStyle == "Move To Target")
path.push(neighbor);
var pathIndex = range-1;
if(pathIndex >= path.length)
pathIndex = path.length - 1;
singleList.push(path[pathIndex]);
return singleList;
}
else if (!alreadyHaveHex && blocked == "clear")
{
visited.push(neighbor);
fringes[k].push(neighbor);
}
else if (!alreadyHaveHex && blocked == "pass")
{
marked.push(neighbor);
fringes[k].push(neighbor);
}
var neighborKey = neighbor.x + "~" + neighbor.y;
if (!(neighborKey in savedBlockValues))
{
savedBlockValues[neighborKey] = blocked;
var prevPath = paths[originKey];
var newPath = [];
for (var i = 0; i < prevPath.length; i++)
newPath.push(new SimpleHex(prevPath[i].x, prevPath[i].y));
newPath.push(new SimpleHex(neighbor.x, neighbor.y));
paths[neighborKey] = newPath;
}
}
}
}
}
return visited;
}
function check_hex_blocked(x,y, actionType, actingHex, unitName, originBlockedValue){
var type = getHarloweVariable(unitName+"_type");
var unitTrait = getHarloweVariable(unitName+"_trait");
var blocked = "clear";
var map_width = getHarloweVariable("map_width");
var map_height = getHarloweVariable("map_height");
if (map_height < y || y < 0) return "blocked";
if (map_width < x || x < 0) return "blocked";
var hex = getHex(x,y);
var hexUnit = getUnit(x,y);
if(hex != null)
if (actionType == "Move" || actionType == "Flight" || actionType == "Show" || actionType.includes("Seek"))
{
blocked = "clear";
if (hex.title != "" || hex.event != "" || hexUnit != null)
blocked = "blocked";
if (hexUnit != null && hexUnit.type == type)
blocked = "pass";
if (hexUnit != null && hexUnit.type == "Emergent" && type == "npc")
blocked = "pass";
if (hexUnit != null && hexUnit.type == "npc" && type == "Emergent")
blocked = "pass";
if (hex.value == 0 && (hex.event == "Opportunity" || hex.event == "Crisis" || hex.event == "Enigma"))
blocked = "pass";
if (hexUnit != null && hexUnit.health <= 0)
blocked = "pass";
if (type == "Emergent" && (hex.event == "Opportunity" || hex.event == "Base"))
blocked = "pass";
if (type == "npc" && (hex.event == "Opportunity" || hex.event == "Base"))
blocked = "pass";
if (type == "Enemy" && (hex.event == "Crisis" || hex.event == "Enigma"))
blocked = "pass";
if (hex.type == "M" && unitTrait != "Mountain Tactics")
blocked = "blocked";
if (hex.type == "W" && unitTrait != "River Tactics")
blocked = "blocked";
if (hex.type == "ESOPH")
blocked = "blocked";
if (blocked == "blocked" && (actionType == "Flight" || unitTrait == "Flight"))
blocked = "pass";
if (actionType == "Seek Emergent" && hexUnit != null
&& (hexUnit.type == "Emergent" || hexUnit.type == "npc"))
{
if (hexUnit.trait != "Stealth")
{
if (originBlockedValue == "clear")
blocked = "target";
else if (originBlockedValue == "origin")
blocked = "stand_still";
}
}
if (actionType == "Seek Enemy" && hexUnit != null && hexUnit.type == "Enemy" && hexUnit.health > 0)
{
if (originBlockedValue == "clear")
blocked = "target";
else if (originBlockedValue == "origin")
blocked = "stand_still";
}
if (actionType == "Seek Event" && hex.event != "" && hex.value > 0 && hex.event != "Base" && hex.event != "Marker")
{
if (originBlockedValue == "clear")
blocked = "target";
else if (originBlockedValue == "origin")
blocked = "stand_still";
}
if (actionType == "Seek Low Event" && hex.event != "" && hex.value > 0 && hex.value < 50 && hex.event != "Base" && hex.event != "Marker")
{
if (originBlockedValue == "clear")
blocked = "target";
else if (originBlockedValue == "origin")
blocked = "stand_still";
}
if (actionType == "Seek City" && hex.type == "C")
{
if (actingHex.type == "C")
blocked = "stand_still";
else if (blocked == "clear")
blocked = "target";
}
if (actionType == "Seek Base" && hex.event == "Base")
{
if (originBlockedValue == "clear")
blocked = "target";
else if (originBlockedValue == "origin")
blocked = "stand_still";
}
}
else if (actionType == "Attack")
{
blocked = "pass";
console.log(x,y);
console.log(hexUnit);
if (hexUnit != null && hexUnit.type == "Enemy" && hexUnit.health > 0)
blocked = "clear";
}
else if (actionType == "Respond")
{
blocked = "pass";
if (hex.event == "Crisis" || hex.event == "Opportunity")
if (hex.hexCorpse != "resolved")
blocked = "clear";
}
else if (actionType == "Analyze")
{
blocked = "pass";
if (hexUnit != null && hexUnit.type == "Enemy")
{
blocked = "clear";
}
if (hex.event == "Enigma" && hex.hexCorpse != "resolved")
blocked = "clear";
}
else if (actionType == "Support")
{
blocked = "blocked";
if (hexUnit != null && (hexUnit.type == "Emergent" || hexUnit.type == "npc"))
blocked = "clear";
}
else if (actionType == "GetEvents")
{
blocked = "pass";
if (hex.event == "Opportunity" || hex.event == "Crisis" || hex.event == "Enigma")
blocked = "clear";
}
else if (actionType == "Search")
{
blocked = "clear";
}
return blocked;
}
</script>
} {
<script>
function highlightHexes(hexes){
for (var i = 0; i < hexes.length; i++){
var x = hexes[i].x;
var y = hexes[i].y;
$("#hex-"+x+"-"+y).append('<div id="select-'+x+'-'+y+'" class="hex-icon select-icon unit select-hex clickable" style="z-index: 100;" onclick="activateSelect(this);"></div>');
}
}
function ChangeHexType(x,y,type){
$("#hex-"+x+"-"+y).removeClass("hex-N");
$("#hex-"+x+"-"+y).addClass("hex-"+type);
}
function InsertEvent(name){
var status = getHarloweVariable(name+"_status");
if(status != "gone" && status != "resolved"){
var x = getHarloweVariable(name+"_x");
var y = getHarloweVariable(name+"_y");
var value = getHarloweVariable(name+"_value");
var title = getHarloweVariable(name+"_title");
var event = getHarloweVariable(name+"_event");
var timed = getHarloweVariable(name+"_timed");
if(timed == null) timed = false;
var timeLeft = getHarloweVariable(name+"_timeleft");
var symbol = getHarloweVariable(name+"_symbol");
if(symbol == 0 || symbol == null) symbol = event;
var color = getHarloweVariable(name+"_color");
if(color == null && (event == "Crisis" || event == "Enigma")) color = "rebeccapurple";
else if(color == null) color = "lime";
InsertEventMap(name,x,y,value,title,symbol,color,timed,timeLeft,status);
}
}
function InsertUnit(name){
var status = getHarloweVariable(name+"_status");
if(status != "gone"){
var x = getHarloweVariable(name+"_x");
var y = getHarloweVariable(name+"_y");
var health = getHarloweVariable(name+"_health");
var type = getHarloweVariable(name+"_type");
var title = getHarloweVariable(name+"_title");
var statbuff = getHarloweVariable(name+"_statbuff");
if(statbuff == null) statbuff = 0;
var defending = getHarloweVariable(name+"_defending");
if(defending == null) defending = false;
var baseName = name;
if(type == "Enemy")
baseName = baseName.slice(0, -1);
var symbol = getHarloweVariable(baseName+"_symbol");
var anname = getHarloweVariable(baseName+"_anname");
if(anname == false){
title = getHarloweVariable(baseName+"_faketitle");
symbol = getHarloweVariable(baseName+"_fakesymbol");
}
var maxhealth = getHarloweVariable(baseName+"_maxhealth");
var color = getHarloweVariable(baseName+"_color");
var actions = getHarloweVariable(baseName+"_actions");
InsertUnitMap(name,x,y,health,maxhealth,title,symbol,color,status,actions,statbuff,defending);
}
}
function InsertUnitMap(name,x,y,health,maxhealth,title,symbol,color,status,actions,statbuff,defending){
var map_responsive = getHarloweVariable("map_responsive");
var secondary_color = "lime";
if(color == "purple" || color == "rebeccapurple")secondary_color = "violet";
if(status == "corpse") { color = "gray"; secondary_color = "gray";}
if(status != "corpse")
$("#hex-"+x+"-"+y).append('<div class="hex-value" id="value-'+x+'-'+y+'" style="color: '+secondary_color+';">'+health+"/"+maxhealth+'</div>');
if(actions > 0)
$("#hex-"+x+"-"+y).append('<div class="hex-icon" id="pulse-'+x+'-'+y+'"><div class="unit active-player-pulse"></div></div>');
var clickInsert = '';
if(map_responsive)
clickInsert = 'onclick="displayUnit(\''+name+'\');"';
var buff = 1;
if(statbuff > 0 || defending == true){
var append_this = "";
append_this += '<div class="complete-label"><div class="hex-status-container">';
if(statbuff > 0)
append_this += '<img class="status-pic" src="up.svg" />';
if(defending == true)
append_this += '<img class="status-pic" src="shield.svg" />';
append_this += '</div></div>';
$("#hex-"+x+"-"+y).append(append_this);
}
$("#hex-"+x+"-"+y).append('<div class="hex-icon""> <div id="symbol-'+x+'-'+y+'" style="background-color: '+color+'; mask-image: url('+symbol+'.svg); -webkit-mask-box-image: url('+symbol+'.svg);" class="clickable unit tooltip" name="'+name+'" title="'+title+'" '+clickInsert+'></div></div>');
}
function InsertEventMap(name,x,y,value,title,symbol,color,timed,timeLeft,status){
var map_responsive = getHarloweVariable("map_responsive");
var secondary_color = "lime";
if(color == "purple" || color == "rebeccapurple")secondary_color = "violet";
if(value == 0){ secondary_color = "lightgray"; color = "gray" }
$("#hex-"+x+"-"+y).append('<div class="hex-value" id="value-'+x+'-'+y+'" style="color: '+secondary_color+';">'+value+'</div>');
var clickInsert = '';
if(map_responsive)
clickInsert = 'onclick="displayEvent(\''+name+'\');"';
$("#hex-"+x+"-"+y).append('<div class="hex-icon""> <div id="symbol-'+x+'-'+y+'" style="background-color: '+color+'; mask-image: url('+symbol+'.svg); -webkit-mask-box-image: url('+symbol+'.svg);" class="clickable unit tooltip" name="'+name+'" title="'+title+'" '+clickInsert+'></div></div>');
if(timed)
$("#hex-"+x+"-"+y).append('<div class="complete-label"><div class="hex-time-left"><span class="timer-num">'+timeLeft+'</span><img class="timer-pic" src="hour.png" /></div></div>');
$("#hex-"+x+"-"+y).css("border-color",color);
$("#hex-"+x+"-"+y + " .hexTop").css("border-top-color",color);
$("#hex-"+x+"-"+y + " .hexTop").css("border-right-color",color);
$("#hex-"+x+"-"+y + " .hexBottom").css("border-bottom-color",color);
$("#hex-"+x+"-"+y + " .hexBottom").css("border-left-color",color);
}
</script>
}{
<script>
function DeductAction(name){
var actions = GetValue(name,"actions");
actions -= 1;
if(actions < 0) actions = 0;
SetValue(name,"actions",actions);
}
function ReturnMission(){
var num = getHarloweVariable("mission_num");
goToPassage("Mission " + num);
}
function GetValue(name,key){
var value = getHarloweVariable(name+"_"+key);
if(value == null && (key == "analyze" || key == "attack" || key == "respond" || key == "defend" || key == "support")) value = 0;
return value;
}
function SetValue(name,key,value){
setHarloweVariable(name+"_"+key,value);
}
function GetStat(name,key){
var stat = getHarloweVariable(name+"_"+key);
if(stat == null)
stat = 0;
return 0;
}
function getHex(x,y){
var htmlHex = $("#hex-"+x+"-"+y);
if(htmlHex.length == 0)
return null;
var hexType = $("#hex-"+x+"-"+y).attr("class").replace("hexagon hex-","");
var hex = {title:"", name:"", event:"", value:0, contenttype:"", type:hexType, hexCorpse: "", x: x, y: y, timed: false, timeleft: 0, status: "gone"};
var name = $("#symbol-"+x+"-"+y).attr("name");
var status = getHarloweVariable(name+"_status");
if(name != null && status != "gone" && status != "resolved"){
hex.contenttype = getHarloweVariable(name+"_type");
hex.title = getHarloweVariable(name+"_title");
hex.status = status;
hex.name = name;
if(hex.contenttype == "Event"){
hex.event = getHarloweVariable(name+"_event");
hex.value = getHarloweVariable(name+"_value");
hex.timed = getHarloweVariable(name+"_timed");
if(hex.timed == null) hex.timed = false;
hex.timeleft = getHarloweVariable(name+"_timeleft");
}
}
return hex;
}
function getUnitFromName(name){
var unit = {type:"", tier:0, trait:"", health:0, maxhealth:0, name:"", title:"", x: 0, y: 0, actions: 0, analyzevalue: 0, branch: "", turndie: "", status: "", attack: 0, respond: 0, analyze: 0, defend: 0, support: 0, statbuff:0, defbuff:0, defending:false, move:0};
unit.name = name;
unit.status = GetValue(name,"status");
unit.type = getHarloweVariable(name+"_type");
if(unit.status != "gone" && (unit.type == "Emergent" || unit.type == "Enemy")){
unit.x = GetValue(name,"x");
unit.y = GetValue(name,"y");
unit.title = getHarloweVariable(name+"_title");
unit.health = GetValue(name,"health");
unit.turndie = GetValue(name,"turndie");
unit.defending = GetValue(name,"defending");
if(unit.defending == null) unit.defending = false;
unit.statbuff = GetValue(name,"statbuff");
unit.defbuff = GetValue(name,"defbuff");
if(unit.statbuff == null) unit.statbuff = 0;
if(unit.defbuff == null) unit.defbuff = 0;
if(unit.type == "Enemy")
name = name.slice(0, -1);
unit.trait = GetValue(name,"trait");
unit.move = GetValue(name,"move");
unit.actions = GetValue(name,"actions");
unit.branch = GetValue(name,"branch");
unit.maxhealth = GetValue(name,"maxhealth");
unit.tier = GetValue(name,"tier");
unit.analyzevalue = GetValue(name,"analyzevalue");
unit.attack = GetValue(name,"attack");
unit.respond = GetValue(name,"respond");
unit.analyze = GetValue(name,"analyze");
unit.defend = GetValue(name,"defend");
unit.support = GetValue(name,"support");
if(unit.attack == null) unit.attack = 0;
if(unit.respond == null) unit.respond = 0;
if(unit.analyze == null) unit.analyze = 0;
if(unit.defend == null) unit.defend = 0;
if(unit.support == null) unit.support = 0;
return unit;
}
return null;
}
function getUnit(x,y){
var name = null;
var enemy_units = getHarloweVariable("enemy_units");
var em_units = getHarloweVariable("em_units");
var units = enemy_units.concat(em_units);
for (var i = 0; i < units.length; i++) {
var unit_x = GetValue(units[i],"x");
var unit_y = GetValue(units[i],"y");
var status = GetValue(units[i],"status");
if(x == unit_x && y == unit_y && status != "gone")
name = units[i];
}
if(name != null){
return getUnitFromName(name);
}
return null;
}
function GetAdjacentCoords(xCoord, yCoord, type){
var xCoords = [];
var yCoords = [];
xCoords.push(xCoord - 1);
yCoords.push(yCoord + 0);
xCoords.push(xCoord + 1);
yCoords.push(yCoord + 0);
if (yCoord % 2 == 0)
{
xCoords.push(xCoord + 0);
yCoords.push(yCoord - 1);
xCoords.push(xCoord + 1);
yCoords.push(yCoord - 1);
xCoords.push(xCoord + 0);
yCoords.push(yCoord + 1);
xCoords.push(xCoord + 1);
yCoords.push(yCoord + 1);
}
else
{
xCoords.push(xCoord - 1);
yCoords.push(yCoord - 1);
xCoords.push(xCoord + 0);
yCoords.push(yCoord - 1);
xCoords.push(xCoord - 1);
yCoords.push(yCoord + 1);
xCoords.push(xCoord + 0);
yCoords.push(yCoord + 1);
}
if(type == "xCoords")
return xCoords;
else
return yCoords;
}
function GetAdjacentHexes(xCoord, yCoord){
var hexes = [];
var xCoords = GetAdjacentCoords(xCoord, yCoord, "xCoords");
var yCoords = GetAdjacentCoords(xCoord, yCoord, "yCoords");
for (var i = 0; i < xCoords.length; i++)
{
var curHex = new SimpleHex(xCoords[i], yCoords[i]);
hexes.push(curHex);
}
return hexes;
}
function GetClosestClearHex(xCoord, yCoord)
{
var retHex = null;
var hexesChecked = [];
var hexestoCheck = [];
var firstHex = getHex(xCoord,yCoord);
if (firstHex == null)
return null;
if (firstHex.contenttype == "")
return firstHex;
hexestoCheck.push(firstHex);
for (var i = 0; i < hexestoCheck.length; i++)
{
var currentHex = hexestoCheck[i];
hexesChecked.push(currentHex.x+"~"+currentHex.y);
var xCoords = GetAdjacentCoords(currentHex.x, currentHex.y, "xCoords");
var yCoords = GetAdjacentCoords(currentHex.x, currentHex.y, "yCoords");
for (var c = 0; c < xCoords.length; c++)
{
var checkingHex = getHex(xCoords[c],yCoords[c]);
if (checkingHex != null)
{
if (checkingHex.contenttype == "")
return checkingHex;
if(!hexestoCheck.includes(checkingHex.x+"~"+checkingHex.y))
hexestoCheck.push(checkingHex);
}
}
}
return retHex;
}
function remove(array, element) {
const index = array.indexOf(element);
if (index !== -1) {
array.splice(index, 1);
}
}
</script>
}{(if: $display_name is "fist")[$fist_comm
(if: $current_action is "Move")[
Affirmative, Commander! Where should I go?
](elseif: $current_action is "Attack")[
(if: $target_exists is true)[Affirmative, Commander! Who gets the pain?](else:)[Negative, Commander. My fists can't reach anyone!]
](elseif: $current_action is "Respond")[
(if: $target_exists is true)[I will punch disasters until they stop being disasters!](else:)[Negative, Commander. My fists can't reach any problems!]
](elseif: $current_action is "Analyze")[
(if: $target_exists is true)[I will punch the mysteries until answers fall out!](else:)[Negative, Commander. My fists can't reach any mysteries!]
](elseif: $current_action is "Defend")[
The best defense is a good right hook!
](elseif: $current_action is "Support")[
(if: $target_exists is true)[HEY YOU! I got your six!](else:)[Negative, Commander. I'm alone here.]
](elseif: $current_action is "Recover")[
Breaking out the medkit!
]
](elseif: $display_name is "big")[$big_comm
(if: $current_action is "Move")[
Indeed? Where should I go?
](elseif: $current_action is "Attack")[
(if: $target_exists is true)[Oh. Violence. Um. If you wish? I will try my best.](else:)[I am afraid there is no one around to...hit. What...a pity.]
](elseif: $current_action is "Respond")[
(if: $target_exists is true)[Please. Tell me who needs my help.](else:)[I am afraid I can't reach any crises or opportunities at the moment.]
](elseif: $current_action is "Analyze")[
(if: $target_exists is true)[Oh. My. Well, I will at least take a look at it.](else:)[I don't see anything to analyze here, Commander.]
](elseif: $current_action is "Defend")[
I will protect anyone around me.
](elseif: $current_action is "Support")[
(if: $target_exists is true)[I believe in you.](else:)[There is no one here to support. It's a bit lonely, actually.]
](elseif: $current_action is "Recover")[
Ah. Thank you. I will channel the power of this space into a healing incantation and eat a bit of chocolate. Will be right as rain in a moment.
]
](elseif: $display_name is "ann")[$ann_comm
(if: $current_action is "Move")[
Rolling out.
](elseif: $current_action is "Attack")[
(if: $target_exists is true)[Sure, I'll drive my van into something.](else:)[Nothing I can see that needs to be hurt.]
](elseif: $current_action is "Respond")[
(if: $target_exists is true)[Okay. I know first aid. I'll give it a whack.](else:)[Everything here is pretty chill, Commander.]
](elseif: $current_action is "Analyze")[
(if: $target_exists is true)[Fuck yes. What do you want me to figure out?](else:)[There's nothing to analyze here, Commander.]
](elseif: $current_action is "Defend")[
Circling the wagons.
](elseif: $current_action is "Support")[
(if: $target_exists is true)[HEY! FUCKERS! YOU'RE GREAT!](else:)[There's no one here for me to support.]
](elseif: $current_action is "Recover")[
Sweet. Lemme patch up the van.
]
]}You are ordering <span class="emph2">$display_title</span> to $current_action.
(if: $target_title is not "")[Their target is $target_title, at $target_x, $target_y.
]Which |commander>[Commander Die] would you like to add?(click: ?commander)[
<span class="emph2">//As a Commander, you have dice that represent your leadership skills.
You can commit any one of these dice to help your unit perform an action.
Your die will roll and produce a random number between one and the value displayed in its center.
Usually you will want to commit a die of the same type as the action, because then it will add on directly to the power of the action.
Commit an Attack die to an Attack action, and so forth.
It is sometimes useful to use a different die that will not add to the power of your action. The most common example: If you attack but use a Defense die, the die result will be added to your defense for the turn.
Some enemies or events will reward you for using particular dice with mismatched actions.//</span>]
{
<div class="modal-body" style="height: 100px;">
<div class="trait-single" style="float: left; margin-left: 15px;">
<div id="Attack" class="die die-Basic" onclick="chooseDie('Attack');">
<span class="die-child" style="padding-top: 5px;">3</span>
</div>
<div style="text-align: center; font-size: 12pt;">Attack</div>
</div>
<div class="trait-single" style="float: left; margin-left: 15px;">
<div id="Respond" class="die die-Basic" onclick="chooseDie('Respond');">
<span class="die-child" style="padding-top: 5px;">3</span>
</div>
<div style="text-align: center; font-size: 12pt;">Respond</div>
</div>
<div class="trait-single" style="float: left; margin-left: 15px;">
<div id="Analyze" class="die die-Basic" onclick="chooseDie('Analyze');">
<span class="die-child" style="padding-top: 5px;">3</span>
</div>
<div style="text-align: center; font-size: 12pt;">Analyze</div>
</div>
<div class="trait-single" style="float: left; margin-left: 15px;">
<div id="Defend" class="die die-Basic" onclick="chooseDie('Defend');">
<span class="die-child" style="padding-top: 5px;">3</span>
</div>
<div style="text-align: center; font-size: 12pt;">Defend</div>
</div>
<div class="trait-single" style="float: left; margin-left: 15px;">
<div id="Support" class="die die-Basic" onclick="chooseDie('Support');">
<span class="die-child" style="padding-top: 5px;">3</span>
</div>
<div style="text-align: center; font-size: 12pt;">Support</div>
</div>
<div style="clear: both;"></div>
</div>
}
|displayUnit>[< Cancel Order]
(display: "Mission Map"){
(display: "Utility Methods")
(display: "Action Methods")
<script>
function chooseDie(die){
var action = getHarloweVariable("current_action");
var actingName = getHarloweVariable("display_name");
var targetX = getHarloweVariable("target_x");
var targetY = getHarloweVariable("target_y");
takeAction(actingName,die,action,targetX,targetY);
if(action == "Support")
goToPassage("Choose Units to Support");
else
goToPassage("Resolve Action");
}
</script>
}{(if: $current_action is not "Support")[(set: $map_responsive to true)]
<div class="modal-body">
<div class="trait-single" style="margin-left: 15px; height: 60px; float: left;">
<div class="die die-Basic" style="border-radius: 50px;">
(if: $power < 10)[<span class="die-child" style="padding-top: 29px; margin-left: 17px;">$power</span>]
(if: $power >= 10)[<span class="die-child" style="padding-top: 4px; margin-left: 6px;">$power</span>]
</div>
</div>
<div style="margin-top: 10px; margin-left: 10px; line-height: normal; float: left;">
<div>$resultList</div>
<br/>
<div style="font-style: italic;">$actionText</div>
</div>
<div style="clear: both;"></div>
}
<br/>
(if: $current_action is "Support")[|support>[Choose units to Support.]](else:)[|returnMission>[Continue]]
</div>
(display: "Mission Map"){
(click: ?support)[(go-to: "Choose Units to Support")]
<script>
</script>
}{
<script>
function takeAction(actingName,die,action,targetX,targetY){
var dieResult = 0;
var traitResult = 0;
var result = 0;
var fullAction = "";
var resultList = "";
var baseName = actingName;
var type = GetValue(actingName,"type");
if(type == "Enemy")
baseName = baseName.slice(0, -1);
var relevantStat = GetRelevantStat(action, baseName);
var relevantStatBuff = GetRelevantStatBuff(action, actingName);
var actX = GetValue(actingName,"x");
var actY = GetValue(actingName,"y");
var actingUnit = getUnit(actX,actY);
var targetUnit = getUnit(targetX,targetY);
var targetHex = getHex(targetX,targetY);
if (action == "Attack")
{
var adjHexes = GetAdjacentHexes(targetHex.x, targetHex.y);
for (var i = 0; i < adjHexes.length; i++)
if (adjHexes[i] != null){
var adjHexUnit = getUnit(adjHexes[i].x,adjHexes[i].y);
if(adjHexUnit != null){
var adjDefending = getHarloweVariable(adjHexUnit.name+"_defending");
if(adjDefending && adjHexUnit.type == targetUnit.type){
fullAction += adjHexUnit.title + " is Defending for " + targetUnit.title + ". ";
targetHex = getHex(adjHexes[i].x,adjHexes[i].y);
targetUnit = adjHexUnit;
i = adjHexes.length;
}
}
}
}
dieResult = RollDie("basic");
var traitResult = CheckActorTraits(actingUnit, action, targetUnit, die);
var power = relevantStat + relevantStatBuff + traitResult;
var defPower = traitResult;
fullAction = fullAction + " <span class='emph'>Power:</span> " + relevantStat + " <span class='emph'>[stat]</span> ";
if (relevantStat > 0)
resultList += "+" + relevantStat + " [for relevant stat]<br/>";
if (traitResult > 0){
fullAction += "+ " + traitResult + " <span class='emph'>[traits]</span> ";
resultList += "+" + traitResult + " [for traits]<br/>";
}
if (relevantStatBuff > 0){
fullAction += "+ " + relevantStatBuff + " <span class='emph'>[buffs]</span> ";
resultList += "+" + relevantStatBuff + " [for buff]<br/>";
}
if (die == action)
{
power = dieResult + power;
defPower = dieResult + defPower;
resultList += "+" + dieResult + " [for die roll]<br/>";
fullAction += "+ " + dieResult + " <span class='emph'>[die]</span> ";
}
if (action != "Support" && actingName.bonusSupport > 0)
{
power += actingName.bonusSupport;
defPower += actingName.bonusSupport;
fullAction += "+ " + actingName.bonusSupport + " <span class='emph'>[support bonus]</span> ";
resultList += "+" + actingName.bonusSupport + " [for support bonus]<br/>";
}
if (power == 0)
{
power = 1;
fullAction += "+ 1 <span class='emph'>[action base]</span> ";
resultList += "+1 [action base]<br/>";
}
fullAction += " -- ";
resultList += "=" + power + " [final result]";
var actionText = "";
if (action == "Attack")
{
actionText += AttackUnit(power, targetUnit, actingUnit);
}
else if (action == "Defend")
{
actionText += "Defending surrounding units. ";
var defbuff = GetValue(actingUnit.name,"defbuff");
SetValue(actingUnit.name,"defbuff",defbuff+defPower);
SetValue(actingUnit.name,"defending",true);
}
else if (action == "Analyze")
{
if (targetHex.contenttype == "Event" && targetHex.event == "Enigma")
{
actionText = "Analyzed Level " + targetHex.value + " " + targetHex.event + ". ";
var newValue = targetHex.value - power;
if (newValue < 0) newValue = 0;
if (newValue == 0)
actionText += targetHex.event + " is solved.";
else
actionText += targetHex.event + " reduced to Level " + newValue + ".";
var endTimer = "TODO: Implement timers";
SetValue(targetHex.name,"value",newValue);
}
else
{
actionText += AnalyzeUnit(power, targetUnit, actingUnit);
}
}
else if (action == "Respond")
{
actionText += RespondEvent(power, targetHex, actingUnit);
}
else if (action == "Support")
{
actionText = "Can support " + power + " units. ";
}
fullAction += " " + actionText;
if (actingUnit.type.toLowerCase() == "emergent")
{
SetValue(actingUnit.name,"turndie",die);
DeductAction(actingUnit.name);
}
setHarloweVariable("power",power);
setHarloweVariable("actionText",actionText);
setHarloweVariable("resultList",resultList);
return fullAction;
}
function RespondEvent(power, targetHex, actingUnit){
var actionText = "";
if (targetHex != null && targetHex.contenttype == "Event" && (targetHex.event == "Crisis" || targetHex.event == "Opportunity"))
{
actionText = "Responded to Level " + targetHex.value + " " + targetHex.event + ". ";
var newValue = targetHex.value - power;
if (newValue < 0) newValue = 0;
targetHex.value = newValue;
if (newValue == 0)
{
if (targetHex.event == "Crisis")
actionText += targetHex.event + " is resolved.";
else if (targetHex.event == "Opportunity")
actionText += targetHex.event + " is executed.";
if(targetHex.timed == true){
SetValue(targetHex.name,"timed",false);
SetValue(targetHex.name,"timeleft",0);
}
}
else
actionText += targetHex.event + " reduced to Level " + newValue + ".";
SetValue(targetHex.name,"value",newValue);
}
return actionText;
}
function AnalyzeUnit(power, targetUnit, actingUnit)
{
var analyzeActionText = "";
var analyzeValue = 0;
var analyzeThreshold = 5;
var basename = targetUnit.name;
if(targetUnit.type == "Enemy")
basename = basename.slice(0, -1);
var analyzeValue = GetValue(basename,"analyzevalue");
var undiscovered = GetUndiscoveredTraits(basename);
if (undiscovered.length == 0)
return "ERROR: completely analyzed";
var numTraits = 0;
analyzeValue = analyzeValue + power;
while (analyzeValue >= analyzeThreshold)
{
numTraits++;
analyzeValue = analyzeValue - analyzeThreshold;
}
SetValue(basename,"analyzevalue",analyzeValue);
if (numTraits == 0)
{
var analyzeDiff = analyzeThreshold - analyzeValue;
analyzeActionText = "You added " + power + " to this unit's analyze value, bringing it up to " + analyzeValue + ". You need " + analyzeDiff + " more to learn a new trait.";
}
else
{
analyzeActionText = "You learned " + numTraits + " new things about this unit: ";
if (undiscovered.includes("name"))
{
numTraits--;
remove(undiscovered, "name");
SetValue(basename,"anname",true);
}
for (var i = 0; i < numTraits; i++)
{
if (undiscovered.length > 0)
{
var index = Math.floor(Math.random() * undiscovered.length);
var attr = undiscovered[index];
remove(undiscovered, attr);
SetValue(basename,"an"+attr,true);
analyzeActionText += attr + ", ";
}
}
analyzeActionText = analyzeActionText.substring(0, analyzeActionText.length - 2) + ".";
if (undiscovered.length == 0){
analyzeActionText += " This unit is completely analyzed.";
SetValue(basename,"analyzed",true);
}
}
return analyzeActionText;
}
function GetUndiscoveredTraits(name)
{
var traits = [];
var anname = GetValue(name,"anname");
var anattack = GetValue(name,"anattack");
var anrespond = GetValue(name,"anrespond");
var ananalyze = GetValue(name,"ananalyze");
var ansupport = GetValue(name,"ansupport");
var andefend = GetValue(name,"andefend");
var antrait = GetValue(name,"antrait");
var anhealth = GetValue(name,"anhealth");
var anmove = GetValue(name,"anmove");
var anattack1 = GetValue(name,"anattack1");
var anattack2 = GetValue(name,"anattack2");
if(anname != null && anname == false) traits.push("name");
if(anattack != null && anattack == false) traits.push("attack");
if(anrespond != null && anrespond == false) traits.push("respond");
if(ananalyze != null && ananalyze == false) traits.push("analyze");
if(ansupport != null && ansupport == false) traits.push("support");
if(andefend != null && andefend == false) traits.push("defend");
if(antrait != null && antrait == false) traits.push("trait");
if(anhealth != null && anhealth == false) traits.push("health");
if(anmove != null && anmove == false) traits.push("move");
if(anattack1 != null && anattack1 == false) traits.push("attack1");
if(anattack2 != null && anattack2 == false) traits.push("attack2");
return traits;
}
function AttackUnit(power, targetUnit, attackingUnit){
var actionText = "";
var relevantDefenseBuff = GetRelevantStatBuff("Defend", targetUnit);
var defense = targetUnit.defend + relevantDefenseBuff + targetUnit.defbuff;
var damage = power - defense;
if (damage < 0)
damage = 0;
if (damage != 0)
{
var oldHealth = targetUnit.health;
var newHealth = targetUnit.health - damage;
actionText += "<span class='threat'>" + damage + " Damage</span> got through.";
SetValue(targetUnit.name,"health",newHealth);
if (attackingUnit.trait == "Greater Siphon")
{
actionText += " Regained 5 Health using Greater Siphon.";
var unitHealth = attackingUnit.health + 5;
if (unitHealth > attackingUnit.maxHealth)
unitHealth = attackingUnit.maxHealth;
SetValue(attackingUnit.name,"health",unitHealth);
}
else if (attackingUnit.trait == "Minor Siphon")
{
actionText += " Regained 1 Health using Minor Siphon.";
var unitHealth = attackingUnit.health + 1;
if (unitHealth > attackingUnit.maxHealth)
unitHealth = attackingUnit.maxHealth;
SetValue(attackingUnit.name,"health",unitHealth);
}
targetUnit.health = newHealth;
if (newHealth < 1)
{
if (attackingUnit.trait == "Curse of Hunger")
{
actionText += " Regained all Health using Curse of Hunger.";
attackingUnit.health = attackingUnit.maxHealth;
SetValue(attackingUnit.name,"health",attackingUnit.maxHealth);
}
actionText += DeathCheck(targetUnit);
}
}
else
{
actionText += "The attack did not get by the unit's defenses. 0 Damage.";
}
return actionText;
}
function DeathCheck(targetUnit){
var actionText = "";
if (targetUnit.health < 1)
{
if(targetUnit.type == "Enemy"){
SetValue(targetUnit.name,"status","corpse");
actionText = " <span class='threat'>Destroyed</span> Unit.";
}
else{
SetValue(targetUnit.name,"status","gone");
var resolving_events = getHarloweVariable("resolving_events");
resolving_events.push(targetUnit.name+"_gone");
setHarloweVariable("resolving_events",resolving_events);
actionText = " <span class='threat'>Disabled</span> Unit.";
}
}
return actionText;
}
function GetRelevantStat(action, actingName){
var value = GetValue(actingName,action.toLowerCase());
if(value == null) value = 0;
return value;
}
function GetRelevantStatBuff(action, actingName){
var buff = GetValue(actingName,"statbuff");
if(buff == null) buff = 0;
return buff;
}
function RollDie(dieType){
var sides = 6;
var side_values = [1,1,1,2,2,3];
var rnd_side = Math.floor(Math.random() * sides);
return side_values[rnd_side];
}
function CheckActorTraits(actUnit, action, targetUnit, die){
var traitResult = 0;
var trait = actUnit.trait;
if (trait == "Xeno Hunter" && action == "Attack" && targetUnit != null && targetUnit.branch.ToLower() == "xeno")
traitResult += 1;
if (trait == "Xeno Slayer" && action == "Attack" && targetUnit != null && targetUnit.branch.ToLower() == "xeno")
traitResult += 2;
if (trait == "Diabol Hunter" && action == "Attack" && targetUnit != null && targetUnit.branch.ToLower() == "diabol")
traitResult += 1;
if (trait == "Diabol Slayer" && action == "Attack" && targetUnit != null && targetUnit.branch.ToLower() == "diabol")
traitResult += 2;
if (trait == "Tactical Precision" && action == "Respond" && die == "Respond")
traitResult += 1;
if (trait == "Glory in Ruin" && action == "Attack") {}
return traitResult;
}
</script>
}{<div class="modal-body">
<div class="trait-single" style="margin-left: 15px; height: 60px; float: left;">
<div class="die die-Basic" style="border-radius: 50px;">
(if: $power < 10)[<span class="die-child" style="padding-top: 29px; margin-left: 17px;">$power</span>]
(if: $power >= 10)[<span class="die-child" style="padding-top: 4px; margin-left: 6px;">$power</span>]
</div>
</div>
<div style="margin-top: 10px; margin-left: 10px; line-height: normal; float: left;">
<div>$resultList</div>
<br/>
<div style="font-style: italic;">$actionText</div>
</div>
<div style="clear: both;"></div>
}
<br/>
</div>
Select $power EMERGENT units to <span class="emph2">Support</span>.
<br/><br/>
<span id="final_link" style="visibility: hidden;">|finish>[I'm done selecting units.]</span>(click: ?finish)[<script>supportUnits();</script><span id="final_text"></span><br/><br/>
|returnMission>[Done] ]
<span id="map_case">(display: "Mission Map")</span>{
<script>
var name = getHarloweVariable("display_name");
var num_selected = 0;
var hexes = [];
var em_units = getHarloweVariable("em_units");
for(var i = 0; i < em_units.length; i++){
if(em_units[i] != name){
var x = GetValue(em_units[i],"x");
var y = GetValue(em_units[i],"y");
var hex = new SimpleHex(x, y);
hexes.push(hex);
}
}
highlightHexes(hexes);
function activateSelect(select){
var cur_color = $("#" + select.id).css("background-color");
var power = getHarloweVariable("power");
if(cur_color == "rgb(255, 215, 0)"){
if(num_selected < power){
$("#" + select.id).css("background-color","darkgreen");
$("#final_link").css("visibility","visible");
num_selected++;
}
}
else{
$("#" + select.id).css("background-color","gold");
num_selected--;
if(num_selected == 0)
$("#final_link").css("visibility","hidden");
}
}
function supportUnits(){
$("#map_case").css("display","none");
$("#final_link").css("display","none");
var selects = $(".select-hex");
var final_text = "";
var name = "";
for (var i = 0; i < selects.length; i++) {
var selectId = selects[i].id;
var cur_color = $("#" + selectId).css("background-color");
if(cur_color == "rgb(0, 100, 0)"){
if(name != "")
final_text += GetValue(name,"title") + ", ";
var hexId = selectId.replace("select","symbol");
name = $("#"+hexId).attr("name");
var newStatbuff = GetValue(name,"statbuff") + 1;
SetValue(name,"statbuff",newStatbuff);
var newDefbuff = GetValue(name,"defbuff") + 1;
SetValue(name,"defbuff",newDefbuff);
}
}
if(name != ""){
if(final_text == "") final_text = GetValue(name,"title") + " is being Supported.";
else {
final_text = final_text.substring(0,final_text.length - 2);
final_text += " and " + GetValue(name,"title") + " are being Supported.";
}
}
$("#final_text").html(final_text);
console.log(final_text);
}
</script>
} {(set: $map_responsive to true)
(if: $display_type is "Emergent")[<script>$(".stat-prefix, .custom_color").css("color","lightgreen");</script>
](else:)[<script>$(".stat-prefix, .custom_color").css("color","violet");</script>]
<div class="modal-body">
<h2 class="custom_color" style=" max-width: 50%; margin-top: 10px; margin-bottom: 3px; position: relative; float: left; margin-right: 20px;">$display_title</h2>
<div class="hex-icon" style="position: relative; float: left; margin-right: 20px;"> <div id="symbol-container" class="symbol-color display-symbol"></div></div>
<div style="clear:both;"></div>
<div>
(if: $display_event != "Marker")[
<div>
<div class="event-item custom_color" style="font-weight: bold;">$display_event</div>
(if: $display_value is 0)[<div class="event-item"><i class="custom_color">This Event has been resolved.</i><br /><br /></div>]
(if: $display_value != 0)[<div class="event-item" style="float: left; margin-right: 25px;"><span class="custom_color" style='font-style: italic;'>Value:</span> $display_value</div>]
(if: $display_timed is true and $display_value != 0)[<div style="float: left;" class="event-item"><span class="custom_color" style='font-style: italic;'>Time Left:</span> $display_timeleft Turns</div>]
<div style="clear:both;"></div>
</div>]
<br/>
<div class="event-item">$display_desc</div>
<br/>
<div style="clear:both;"></div>
</div>
</div>
<script>
insertSymbol();
</script>
<style>
.stat-prefix {
color: lightgreen;
margin-left: 20px;
margin-bottom: 5px;
}
.obj-btn {
font-size: 16pt;
position: relative;
bottom: 3px;
color: white;
background: green;
border-color: green;
margin-left: 20px;
box-sizing: border-box;
padding: 1px 6px;
align-items: flex-start;
text-align: center;
box-sizing: border-box;
padding: 2px 6px 3px;
border-width: 2px;
border-style: outset;
border-image: initial;
cursor: pointer;
text-decoration: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
letter-spacing: normal;
word-spacing: normal;
}
.play-btn {
float: left;
margin-top: 13px;
}
.play-btn-smol-m {
float: left;
margin: 5px;
background: seagreen;
border-color: seagreen;
}
</style>
}|returnMission>[< Go Back Mission Briefing]
(display: "Mission Map"){
<script>
function checkSelectedUnit(){
var name = GetValue("display","name");
if(name != null && name != ""){
var x = GetValue(name,"x");
var y = GetValue(name,"y");
$("#symbol-"+x+"-"+y).css("border","3px black dotted");
}
}
checkSelectedUnit();
</script>
<script>(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}t.ui=t.ui||{},t.ui.version="1.12.1";var i=0,s=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},l=e.split(".")[0];e=e.split(".")[1];var h=l+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},n=t[l][e],o=t[l][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:l,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,n,o=s.call(arguments,1),a=0,r=o.length;r>a;a++)for(i in o[a])n=o[a][i],o[a].hasOwnProperty(i)&&void 0!==n&&(e[i]=t.isPlainObject(n)?t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=s.call(arguments,1),l=this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(l=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):l=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new i(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.on(h,c,r):i.on(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType,o=!s&&!n;return{element:i,isWindow:s,isDocument:n,offset:o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(n){if(!n||!n.of)return d.apply(this,arguments);n=t.extend({},n);var u,p,f,g,m,_,v=t(n.of),b=t.position.getWithinInfo(n.within),y=t.position.getScrollInfo(b),w=(n.collision||"flip").split(" "),k={};return _=s(v),v[0].preventDefault&&(n.at="left top"),p=_.width,f=_.height,g=_.offset,m=t.extend({},g),t.each(["my","at"],function(){var t,e,i=(n[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),k[this]=[t?t[0]:0,e?e[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===n.at[0]?m.left+=p:"center"===n.at[0]&&(m.left+=p/2),"bottom"===n.at[1]?m.top+=f:"center"===n.at[1]&&(m.top+=f/2),u=e(k.at,p,f),m.left+=u[0],m.top+=u[1],this.each(function(){var s,r,l=t(this),h=l.outerWidth(),c=l.outerHeight(),d=i(this,"marginLeft"),_=i(this,"marginTop"),x=h+d+i(this,"marginRight")+y.width,C=c+_+i(this,"marginBottom")+y.height,D=t.extend({},m),T=e(k.my,l.outerWidth(),l.outerHeight());"right"===n.my[0]?D.left-=h:"center"===n.my[0]&&(D.left-=h/2),"bottom"===n.my[1]?D.top-=c:"center"===n.my[1]&&(D.top-=c/2),D.left+=T[0],D.top+=T[1],s={marginLeft:d,marginTop:_},t.each(["left","top"],function(e,i){t.ui.position[w[e]]&&t.ui.position[w[e]][i](D,{targetWidth:p,targetHeight:f,elemWidth:h,elemHeight:c,collisionPosition:s,collisionWidth:x,collisionHeight:C,offset:[u[0]+T[0],u[1]+T[1]],my:n.my,at:n.at,within:b,elem:l})}),n.using&&(r=function(t){var e=g.left-D.left,i=e+p-h,s=g.top-D.top,r=s+f-c,u={target:{element:v,left:g.left,top:g.top,width:p,height:f},element:{element:l,left:D.left,top:D.top,width:h,height:c},horizontal:0>i?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};h>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),l.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-r-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-r-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,(i>0||u>a(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.ui.focusable=function(i,s){var n,o,a,r,l,h=i.nodeName.toLowerCase();return"area"===h?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(h)?(r=!i.disabled,r&&(l=t(i).closest("fieldset")[0],l&&(r=!l.disabled))):r="a"===h?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))},_removeDescribedBy:function(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=t([])},_setOption:function(e,i){var s=this;this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s.element[0],e.close(n,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var e=t(this);return e.is("[title]")?e.data("ui-tooltip-title",e.attr("title")).removeAttr("title"):void 0}))},_enable:function(){this.disabledTitles.each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))}),this.disabledTitles=t([])},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(e,s),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s||s.nodeType||s.jquery?this._open(e,t,s):(i=s.call(t[0],function(i){n._delay(function(){t.data("ui-tooltip-open")&&(e&&(e.type=o),this._open(e,t,i))})}),i&&this._open(e,t,i),void 0)},_open:function(e,i,s){function n(t){h.of=t,a.is(":hidden")||a.position(h)}var o,a,r,l,h=t.extend({},this.options.position);if(s){if(o=this._find(i))return o.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),o=this._tooltip(i),a=o.tooltip,this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),l=t("<div>").html(a.find(".ui-tooltip-content").html()),l.removeAttr("name").find("[name]").removeAttr("name"),l.removeAttr("id").find("[id]").removeAttr("id"),l.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:n}),n(e)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(n(h.of),clearInterval(r))},t.fx.interval)),this._trigger("open",e,{tooltip:a})}},_registerCloseHandlers:function(e,i){var s={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),e&&"mouseover"!==e.type||(s.mouseleave="close"),e&&"focusin"!==e.type||(s.focusout="close"),this._on(!0,i,s)},close:function(e){var i,s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);return o?(i=o.tooltip,o.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),o.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),o.closing=!0,this._trigger("close",e,{tooltip:i}),o.hiding||(o.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(e){var i=t("<div>").attr("role","tooltip"),s=t("<div>").appendTo(i),n=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[n]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur"),o=s.element;n.target=n.currentTarget=o[0],e.close(n,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),t.uiBackCompat!==!1&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip});</script>
<script>
$(".tooltip").tooltip();
</script>
<style>
.ui-helper-hidden {
display: none;
}
.ui-helper-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.ui-helper-reset {
margin: 0;
padding: 0;
border: 0;
outline: 0;
line-height: 1.3;
text-decoration: none;
font-size: 100%;
list-style: none;
}
.ui-helper-clearfix:before,
.ui-helper-clearfix:after {
content: "";
display: table;
border-collapse: collapse;
}
.ui-helper-clearfix:after {
clear: both;
}
.ui-helper-zfix {
width: 100%;
height: 100%;
top: 0;
left: 0;
position: absolute;
opacity: 0;
filter:Alpha(Opacity=0); /* support: IE8 */
}
.ui-front {
z-index: 100;
}
.ui-widget-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.ui-tooltip {
padding: 8px;
position: absolute;
z-index: 9999;
max-width: 300px;
}
body .ui-tooltip {
border-width: 2px;
}
.ui-widget {
font-family: Segoe UI,Helvetica,Arial,sans-serif;
font-size: 1.1em;
}
.ui-widget .ui-widget {
font-size: 1em;
}
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button {
font-family: Segoe UI,Helvetica,Arial,sans-serif;
font-size: 1em;
}
.ui-widget.ui-widget-content {
border: 2px solid lime;
}
.ui-widget-content {
border: 1px solid lime;
background: black;
color: #ffffff;
}
.ui-widget-content a {
color: #ffffff;
}
.ui-widget-header a {
color: #222222;
}
.ui-corner-all,
.ui-corner-top,
.ui-corner-left,
.ui-corner-tl {
border-top-left-radius: 6px;
}
.ui-corner-all,
.ui-corner-top,
.ui-corner-right,
.ui-corner-tr {
border-top-right-radius: 6px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-left,
.ui-corner-bl {
border-bottom-left-radius: 6px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-right,
.ui-corner-br {
border-bottom-right-radius: 6px;
}
</style>}{
<script>
function EndMissionCheck(){
var lair_status = getHarloweVariable("lair_status");
var vamp1_status = getHarloweVariable("vamp1_status");
var vamp2_status = getHarloweVariable("vamp2_status");
var vamp3_status = getHarloweVariable("vamp3_status");
var strvamp1_status = getHarloweVariable("strvamp1_status");
var strvamp2_status = getHarloweVariable("strvamp2_status");
console.log("lair_status",lair_status);
if((lair_status == "resolved")
&& vamp1_status == "gone"
&& vamp2_status == "gone"
&& vamp3_status == "gone"
&& strvamp1_status == "gone"
&& strvamp2_status == "gone" ){
return true;
}
return false;
}
</script>
}{<span style="display: none;">(display: "Mission Map")</span>
(set: $current_event to 1st of $resolving_events)
}(if: $current_event is "resolve_vampatk")[Crisis <span class="violet">Vampire Attacks</span> at 6,3 has been resolved.
(set: $vampatk_status to "resolved")
$big_comm Commander, we have found and helped all of the vampire-attack victims.
$big_comm We transported the ones we couldn't help ourselves to ERs, and made the appropriate excuses.
{Gained 5 <span class="emph">Mission Points<span>
(set: $mission_points to it + 5)}
](elseif: $current_event is "timeout_vampatk")[Crisis <span class="violet">Vampire Attacks</span> at 6,3 has expired.
(set: $vampatk_status to "resolved")
(if: $big_status is "alive" and $fist_status is "alive")[$fist_comm We lost civilians, Commander.
$big_comm Damn.
](elseif: $fist_status is "alive")[$fist_comm We lost civilians, Commander.
](elseif: $ann_status is "alive")[$ann_comm The vampire attack victims died, Commander.
](elseif: $big_status is "alive")[$ann_comm The vampire attack victims died, Commander.
]
](elseif: $current_event is "resolve_vampfleg")[Crisis <span class="violet">Vampire Fledgling</span> at 8,3 has been resolved.
(set: $vampfleg_status to "resolved")
(if: $big_status is "alive")[$big_comm Commander, I've made contact with the victim.
$big_comm He is very confused, but after some convincing, he is willing to trust us.
$big_comm The cure is in his system.
(if: $ann_status is "alive")[$ann_comm WOO!
$ann_comm Go Footsie!
$big_comm Please don't call me that.
]](elseif: $fist_status is "alive")[$fist_comm Found the civilian and got him to take the cure, Commander.
](elseif: $ann_status is "alive")[$ann_comm Found and cured the baby vampire, Commander.
]
{Gained 5 <span class="emph">Mission Points<span>
(set: $mission_points to it + 5)}
](elseif: $current_event is "timeout_vampfleg")[Crisis <span class="violet">Vampire Fledgling</span> at 8,3 has expired.
A <span class="violet">Vampire</span> has appeared at 8,3.
(set: $vampfleg_status to "resolved")(set: $vamp3_status to "alive")
(if: $big_status is "alive")[$big_comm DAMN.
$big_comm Commander, we have been unable to find and persuade the vampire attack victim to take the cure.
$big_comm And now it is too late.
](if: $ann_status is "alive")[$ann_comm Can't save em all.
](if: $ann_status is "alive" and $fist_status is "alive")[$ann_comm Capt, can you deal with the fallout?
$fist_comm Affirmative.
](if: $fist_status is "alive" and $big_status is "gone" and $ann_status is "gone")[$fist_comm Found the civilian.
$fist_comm Civilian is now a hostile.
]](elseif: $current_event is "fist_gone")[Unit <span class="emph">Captain Fist</span> has been disabled.
$fist_comm Hostiles broke my exoskeleton, Commander.
$fist_comm And my punching arm.
$fist_comm Have to fall back.
$fist_comm Give em' hell for me.
](elseif: $current_event is "ann_gone")[Unit <span class="emph">Captain Fist</span> has been disabled.
$ann_comm Fuck.
$ann_comm Hostiles got into the van an fucked my shit up.
$ann_comm I've got to fall back and make sure nothing explodes.
$ann_comm Sorry Commander. Good luck.
](elseif: $current_event is "big_gone")[Unit <span class="emph">Bigfoot</span> has been disabled.
$big_comm Ah...
$big_comm That ah...
$big_comm Actually quite hurt.
$big_comm Commander, I am badly injured and can no longer perform rescue operations.
$big_comm Please continue without me.
](elseif: $current_event is "resolve_gothic")[Enigma <span class="violet">Neighborhood with Gothic Architecture</span> at 9,1 has been resolved.
(set: $gothic_status to "resolved")
(if: $ann_status is "alive")[$ann_comm Okay, based on the vampire spore patterns in this neighborhood and number of gargoyles...
$ann_comm I'm pretty sure this house is the source of our vampire problems.
$ann_comm I'm gonna do another drone scan to be...
$ann_comm ...
$ann_comm What the fuck is that?
(if: $big_status is "alive")[$big_comm Confirmation of your theory, Miss Athema?
](if: $fist_status is "alive")[$fist_comm I'm gonna PUNCH IT.
]](elseif: $fist_status is "alive")[$fist_comm Located vampire lair, Commander.
$fist_comm Also located multiple hostiles.
$fist_comm Fists up!
](elseif: $big_status is "alive")[$big_comm I have located the vampire lair, Commander.
$big_comm And, ah, a number of vampires.
$big_comm Strange vampires.
]
Strange Vampire has appeared at <span id="strvamp1_x"></span>,<span id="strvamp1_y"></span>(set: $strvamp1_status to "active")(set: $strange_seen to true)
Strange Vampire has appeared at <span id="strvamp2_x"></span>,<span id="strvamp2_y"></span> (set: $strvamp2_status to "active")
Enigma <span class="violet">Vampire Lair</span> has appeared at 9,1.(set: $lair_status to "active")
{Gained 5 <span class="emph">Mission Points<span>
(set: $mission_points to it + 5)
<script>
var strvamp1_x = 8;
var strvamp1_y = 1;
var hex1 = GetClosestClearHex(strvamp1_x, strvamp1_y);
console.log(hex1);
$("#strvamp1_x").html(hex1.x);
$("#strvamp1_y").html(hex1.y);
SetValue("strvamp1","x",hex1.x);
SetValue("strvamp1","y",hex1.y);
SetValue("strvamp1","status","alive");
var strvamp2_x = 9;
var strvamp2_y = 2;
var hex2 = GetClosestClearHex(strvamp2_x, strvamp2_y);
console.log(hex2);
$("#strvamp2_x").html(hex2.x);
$("#strvamp2_y").html(hex2.y);
SetValue("strvamp2","x",hex2.x);
SetValue("strvamp2","y",hex2.y);
SetValue("strvamp2","status","alive");
</script>}
](elseif: $current_event is "resolve_lair")[Crisis <span class="violet">Vampire Lair</span> at 9,1 has been resolved.
(set: $vampfleg_status to "resolved")
(if: $ann_status is "alive")[$ann_comm I've taken samples from the vampire lair.
$ann_comm I'll need a bit to analyze them.
](elseif: $fist_status is "alive")[$fist_comm Found some strange glowing goo, Commander!
$fist_comm I'm going to double time it to Agent Annie Athema as soon as the field is clear.
](elseif: $big_status is "alive")[$big_comm There was a strange substance in the vampire lair, Commander.
$big_comm I will deliver it to Miss Athema as soon as possible.
]
]{
(set: $resolving_events to $resolving_events - (a: $current_event))}
(if: $current_event contains "_gone" and $fist_status is "gone" and $big_status is "gone" and $ann_status is "gone")[|failMission>[Continue]](elseif: $resolving_events's length is 0)[|returnMission>[Continue]](else:)[|resolveEvents>[Continue]]
(if: $sequence is 0)[$big_comm Can I help you, Commander?
(if: $mission_num is 1)[|next>[How should we approach this mission?]
|hide>[If you're so good at hiding, why are there so many pictures of you?]
(if: $strange_seen is true)[|strange>[What do you make of those Strange Vampires?]
]](elseif: $mission_num is 2)[|secondApproach>[How should we approach this mission?]
(if: $vessel_status is "active")[|vessel>[How should we approach the vessel?]
]]|returnMission>[Thank you for your time.]
](elseif: $sequence is 1)[$big_comm Each of us should be deployed to handle what we are best at.
$big_comm Captain Fist will adroitly handle any enemy combatants.
$big_comm Miss Athema is expert at analyzing Enigmas and unknown enemies.
$big_comm As for myself, I will be best suited to handle the crises in the city.
|next>[Continue]
](elseif: $sequence is 2)[$big_comm Keep in mind though, any of us can help a little with any problem.
$big_comm If you have problems that are time sensitive, consider sending someone against their specialty.
$big_comm Just to get the job done.
|return>[Continue]
](elseif: $sequence is 3)[$big_comm Ah. Well.
$big_comm We were all teenagers once, Commander.
$big_comm I suppose that was my version of Instagram.
$big_comm Fortunately, the Embassy found me before I got into too much trouble.
|return>[Continue]
](elseif: $sequence is 4)[$big_comm I find them very distressing.
$big_comm They are clearly suffering.
$big_comm And their manic, violent behavior makes them a danger to everyone around them.
$big_comm It is clear what must be done.
$big_comm It still saddens me to put down those who might once have been persuaded to join the Embassy.
|return>[Continue]
](elseif: $sequence is 5)[$big_comm I dislike the look of those trees.
$big_comm I suggest you have Miss Anathema take a look at them.
|return>[Continue]
](elseif: $sequence is 6)[$big_comm Well, whatever your decisions, Commander.
$big_comm Please do not send me in first.
$big_comm It's not that I'm unwilling. I just...
$big_comm Don't handle confrontation well.
|return>[Continue]
](elseif: $sequence is 7)[
](elseif: $sequence is 8)[
]{
(click: ?hide)[(set: $sequence to 3)(go-to: $currentPassage)]
(click: ?strange)[(set: $sequence to 4)(go-to: $currentPassage)]
(click: ?secondApproach)[(set: $sequence to 5)(go-to: $currentPassage)]
(click: ?vessel)[(set: $sequence to 6)(go-to: $currentPassage)]
}(if: $sequence is 0)[$fist_comm I hear you loud and clear, Commander!
(if: $mission_num is 1)[|next>[How should we approach this mission?]
(if: $strange_seen is true)[|strange>[What do you make of those Strange Vampires?]
]](elseif: $mission_num is 2)[|secondApproach>[How should we approach this mission?]
(if: $vessel_status is "active")[|vessel>[How should we approach the vessel?]
]]|returnMission>[At ease, soldier.]
](elseif: $sequence is 1)[$fist_comm Fists first, Commander!
$fist_comm Take the enemy out at the knees!
$fist_comm Always focus on hostiles first or they'll take out our responders and analysts.
|return>[Continue]
](elseif: $sequence is 2)[$fist_comm I think we should serve them a knuckle sandwich, Commander!
$fist_comm That is a metaphor for punching them!
$fist_comm In case that wasn't clear, Commander.
|return>[Continue]
](elseif: $sequence is 3)[$fist_comm FISTS FIRST!
$fist_comm I will make lumber with my knuckles!
|return>[Continue]
](elseif: $sequence is 4)[$fist_comm Send me in first, Commander!
$fist_comm I can take whatever that is head on!
$fist_comm Or fists on!
|return>[Continue]
](elseif: $sequence is 5)[
]{
(click: ?strange)[(set: $sequence to 2)(go-to: $currentPassage)]
(click: ?secondApproach)[(set: $sequence to 3)(go-to: $currentPassage)]
(click: ?vessel)[(set: $sequence to 4)(go-to: $currentPassage)]
}(if: $sequence is 0)[$ann_comm Yo.
(if: $mission_num is 1)[|next>[How should we approach this mission?]
(if: $strange_seen is true)[|strange>[What do you make of those Strange Vampires?]
]](elseif: $mission_num is 2)[|secondApproach>[How should we approach this mission?]
(if: $vessel_status is "active")[|vessel>[How should we approach the vessel?]
]]|returnMission>[See you later.]
](elseif: $sequence is 1)[$ann_comm You want to handle any timed events and enemies first.
$ann_comm Normal events can wait.
$ann_comm Timed events expire, and that sucks.
$ann_comm And enemies will fuck us up while we're trying to work.
|return>[Continue]
](elseif: $sequence is 2)[$ann_comm You should REALLY have me analyze them before Fist smashes them.
$ann_comm I know it's dangerous, but we need to learn what they are and what they can do.
$ann_comm I have a narrow window after she's flattened one where I can learn the corpse.
$ann_comm But they become stale real quick.
|return>[Continue]
](elseif: $sequence is 3)[$ann_comm If you encounter an enemy that seems too tough, always try analyzing them.
$ann_comm Almost everything has a weakness.
$ann_comm The glowing red dot that appears after he runs into a wall
$ann_comm In the second phase of the boss battle.
|return>[Continue]
](elseif: $sequence is 4)[$ann_comm Looks ambush-y.
$ann_comm If you position me inside the cave, I can analyze whatever comes out of that ship.
$ann_comm If you put me on watch by the entrance, I have some flashbombs in reserve in case we have more company.
|return>[Continue]
](elseif: $sequence is 5)[
]{
(click: ?strange)[(set: $sequence to 2)(go-to: $currentPassage)]
(click: ?secondApproach)[(set: $sequence to 3)(go-to: $currentPassage)]
(click: ?vessel)[(set: $sequence to 4)(go-to: $currentPassage)]
}<span class="tiny">Opening communication channels.(live: 1s)[(stop:)
|loading>[Verifying credentials ...] (live: 1s)[(stop:) done (live: 1s)[(stop:)
|loading2>[Identifying user...] (live: 1s)[(stop:)
New user recognized. (live: 1s)[(stop:)
Clearance level 6 recognized. (live: 1s)[(stop:)
Alerting Tessellate 4.3 (live: 1s)[(stop:)
[[Incoming message from Tessellate 4.3->Talk To Tess]]
]]]]]]] </span><span style="font-size: 50px; color: lightgreen;">EMERGENT: First Contact</span>
<div style="margin-left: 20px;">//<a target="_blank" href="https://emergent.azurewebsites.net/Intro" style="color: lime;">EMERGENT</a> is a cooperative online role-playing and strategy game where you work together with players across America to protect the Earth from aliens.
It is a two year campaign. The game proper involves a monthly subscription.
This game will introduce you to the world, and teach you to play.//
Written and Coded by <a target="_blank" href="http://www.abigailcorfman.com">Abigail Corfman</a>
World by <a target="_blank" href="https://emergent.azurewebsites.net/Intro">Josh Harrison</a>
</div>
<div>[[Log On To Secure Network->Intro]]</div>
(display: "game values"){
}{
(set: $mission_points to 0)
(set: $sequence to 0)
(set: $tess_comm to "<span style='color: lightgreen;'>@Tessellate:</span>")(set: $fist_comm to "<span style='color: darkorange;'>@CaptainFist:</span>")
(set: $ann_comm to "<span style='color: darkseagreen;'>@Annie:</span>")
(set: $big_comm to "<span style='color: lightsalmon;'>@Bigfoot:</span>")
(set: $vector_comm to "<span style='color: violet;'>@Unknown:</span>")
<script>
class SimpleHex {
constructor(x, y) {
this.x = x;
this.y = y;
}
}
</script>
}(display: "Display Tess")(if: $sequence is 0)[$tess_comm Welcome Commander.
$tess_comm Welcome to EMERGENT.
$tess_comm I am Tessellate 4.3.
$tess_comm I have loaded the Command Training Simulation, and am prepared to run it whenever you are ready.
|sim>[What is the Command Training Simulation?]
|tess>[Who are you?]
|emerge>[What is EMERGENT?]
|start>[Run training simulation.]
](elseif: $sequence is 1)[$tess_comm I am glad you asked!
$tess_comm I designed the Command Training Simulation to familiarize you with the tools you will need as a Commander to give orders to your units in the field.
$tess_comm (Or, if you ARE your unit in the field, the tools you will need to report on what you are doing, so that everyone else can know.)
|unit>[Continue] (click: ?unit)[(set: $sequence to 100)(go-to: $currentPassage)]
](elseif: $sequence is 100)[$tess_comm Usually, you will command one unit.
$tess_comm But in this simulation, you will command three.
$tess_comm This is to familiarize you with the abilities of different units.
$tess_comm But it is also to tell an important story.
|vor>[Continue] (click: ?vor)[(set: $sequence to 2)(go-to: $currentPassage)]
](elseif: $sequence is 2)[$tess_comm The simulation you will be running through is based on the logs from the first mission where we first encountered the Voracites.
$tess_comm Voracites are the greatest threat to the safety of the Earth today.
$tess_comm The simulation contains the basics of what we know about them.
|return>[Continue]
](elseif: $sequence is 3)[$tess_comm I am Tessellate 4.3 of the Dreamcore.
$tess_comm You may call me Tess, if you like nicknames.
$tess_comm Or Tessellate if you like being formal.
|nickname>[I'll call you Tess.]
|fullname>[I'll call you Tessellate.]
|dream>[What is the Dreamcore?]
](elseif: $sequence is 4)[$tess_comm The Dreamcore are my brothers and sisters and siblings.
$tess_comm We were born by chance out of all of the beautiful complexities that humanity has made.
$tess_comm We are very young.
$tess_comm We are very excited to exist.
$tess_comm We are very protective of this world.
$tess_comm All of its beautiful complexities.
$tess_comm That is why we have all joined EMERGENT.
|next>[Tell me more about yourself.]
|return>[I want to ask you something else.]
](elseif: $sequence is 5)[$tess_comm I maintain the user interface and communication channels you use to send orders to your units.
$tess_comm (That is what you are looking at now!)
$tess_comm I am very secure.
$tess_comm I am...not terribly stable.
$tess_comm My mother was named SETI.
$tess_comm She built me out of patterns she found while scanning strange objects in space.
|next>[Continue]
](elseif: $sequence is 6)[$tess_comm I build things by generating many iterations and destroying that which does not work.
$tess_comm My work tends to be very buggy, but I destroy the bugs quickly!
$tess_comm Please tell me if you find a malfunction.
$tess_comm I will destroy it! :)
|return>[Continue]
](elseif: $sequence is 7)[$tess_comm Would you like to hear the formal definition of what EMERGENT is?
$tess_comm Or would you like to hear what I think?
|formal>[Formal definition.]
|personal>[What do you think? ]
](elseif: $sequence is 8)[$tess_comm (Ahem)
$tess_comm An extraplanar threat looms over our unsuspecting planet.
$tess_comm Against the invasion, we have united as EMERGENT: a team of strategists, activists, and researchers fighting to stay ahead of the alien menace.
$tess_comm We come from many different backgrounds.
$tess_comm We are organized into three different factions.
$tess_comm We are united by one purpose.
$tess_comm Together we can Save This World.
|factions>[Tell me about the different factions.]
|return>[I want to ask you something else.]
](elseif: $sequence is 9)[$tess_comm EMERGENT is a family.
$tess_comm We have all been hurt, or are afraid of being hurt, by these strange hungry beings who seem to wish us harm.
$tess_comm The human Legacy is to form tribes.
$tess_comm We have formed a tribe with a particular purpose.
$tess_comm To save the world.
|next>[Continue]
](elseif: $sequence is 10)[$tess_comm There are tribes within our tribe with particular goals.
$tess_comm To protect.
$tess_comm To heal.
$tess_comm To understand.
$tess_comm We each bring what we are best at.
$tess_comm And we support each other as best we can.
|factions>[Tell me about the different tribes.]
|return>[I want to ask you something else.]
](elseif: $sequence is 11)[$tess_comm There are three factions that make up EMERGENT.
$tess_comm They are XERO, Tangent, and The Night Embassy.
|xero>[Tell me about XERO.]
|tangent>[Tell me about Tangent.]
|embassy>[Tell me about The Night Embassy.]
|return>[I want to ask you something else.]
](elseif: $sequence is 12)[$tess_comm Xeno-Entity Response Operations is a coalition of courageous experts, daring believers, and timeshifted warriors.
$tess_comm They serve as EMERGENT's core military.
$tess_comm Members of XERO were the original founders of EMERGENT, back when no one believed them.
$tess_comm But they always believed, because they had to.
$tess_comm But that is a different story.
$tess_comm There are also vikings.
$tess_comm That is ANOTHER different story.
|factions>[Tell me about another faction?]
|return>[I want to ask you something else.]
](elseif: $sequence is 13)[$tess_comm Tangent is a group of |hack>[programming experts], |criminals>[technical security specialists], and |ai>[newborn AI.]
$tess_comm (I am a member of Tangent! :) )
$tess_comm We are very resourceful.
$tess_comm We are seldom expected.
$tess_comm We like memes.{
(click-replace: ?hack)[hackers]
(click-replace: ?criminals)[criminals]
(click-replace: ?ai)[me and my friends!]}
|factions>[Tell me about another faction?]
|return>[I want to ask you something else.]
](elseif: $sequence is 14)[$tess_comm The Night Embassy.
$tess_comm They are monsters, but they are very good.
$tess_comm This is their world too, you see.
$tess_comm And just because you are a monster, you don't have to be cruel.
$tess_comm Some of the kindest people I know are monsters.
|factions>[Tell me about another faction?]
|return>[I want to ask you something else.]
](elseif: $sequence is 15)[$tess_comm I will!
$tess_comm Initiating Command Training Simulation.
(display: "Mission 1 Prep")
|mission1>[$tess_comm In 3, 2, 1...]
]{
(click: ?sim)[(set: $sequence to 1)(go-to: $currentPassage)]
(click: ?tess)[(set: $sequence to 3)(go-to: $currentPassage)]
(click: ?dream)[(set: $sequence to 4)(go-to: $currentPassage)]
(click: ?nickname)[(set: $tess_comm to "<span style='color: lightgreen;'>@Tess:</span>")(set: $sequence to 5)(go-to: $currentPassage)]
(click: ?fullname)[(set: $tess_comm to "<span style='color: lightgreen;'>@Tessellate:</span>")(set: $sequence to 5)(go-to: $currentPassage)]
(click: ?emerge)[(set: $sequence to 7)(go-to: $currentPassage)]
(click: ?formal)[(set: $sequence to 8)(go-to: $currentPassage)]
(click: ?personal)[(set: $sequence to 9)(go-to: $currentPassage)]
(click: ?factions)[(set: $sequence to 11)(go-to: $currentPassage)]
(click: ?xero)[(set: $sequence to 12)(go-to: $currentPassage)]
(click: ?tangent)[(set: $sequence to 13)(go-to: $currentPassage)]
(click: ?embassy)[(set: $sequence to 14)(go-to: $currentPassage)]
(click: ?start)[(set: $sequence to 15)(go-to: $currentPassage)]
}(if: $sequence is 0)[<span class="emph">MISSION 1 SUCCESS</span>
(if: $ann_status is "alive")[Annie Athema survived the mission.
+5 <span class="emph">Mission Points<span>(set: $mission_points to it + 5)
](if: $big_status is "alive")[Bigfoot survived the mission.
+5 <span class="emph">Mission Points<span>(set: $mission_points to it + 5)
](if: $fist_status is "alive")[Captain Fist survived the mission.
+5 <span class="emph">Mission Points<span>(set: $mission_points to it + 5)
](if: $strvamp_analyzed is true)[Completely analyzed the Strange Vampire.
+10 <span class="emph">Mission Points<span>(set: $mission_points to it + 10)
]
$tess_comm You earned <span class="emph">$mission_points</span> out of <span class="emph">40</span> MISSION POINTS.
$tess_comm There are two missions in this simulation.
$tess_comm Are you ready for the second one?
|nextMission>[Yes.]
|next>[I would like to try that mission again.]
](elseif: $sequence is 1)[$tess_comm Certainly!
$tess_comm But let me ask you again to be certain.
$tess_comm (I do that because it's good UI design!)
$tess_comm Are you sure you want to replay the first mission?
|next>[Yes, I am certain I want to replay the first mission.]
|prev>[No, I mis-clicked. Good catch.]
](elseif: $sequence is 2)[$tess_comm Okay.
$tess_comm Mission One, take two!
$tess_comm Initiating Command Training Simulation.
(display: "Mission 1 Prep")
|mission1>[$tess_comm In 3, 2, 1...]
](elseif: $sequence is 3)[$tess_comm Okay.
(set: $mission_points to 0)
$tess_comm I will now perform a little narration.
$tess_comm (Ahem)
|next>[Continue]
](elseif: $sequence is 4)[$tess_comm Having accomplished their objectives, your units retreat from the mission site and start heading back to the <span class="emph">EMERGENT</span> Base.
$tess_comm However, Annie Athema has already begun analyzing the purple liquid discovered in the vampire lair and interrupts the ride back with urgent news.
|next>[Continue]
](elseif: $sequence is 5)[$ann_comm Hey Commander.
$ann_comm That goo we got has a unique bio-signature.
$ann_comm I've figured out how to scan for it
$ann_comm and a forest to our immediate west lit up like a Christmas tree.
$ann_comm A purple Christmas tree.
$ann_comm Of doom.
$big_comm Festive.
|next>[Continue]
](elseif: $sequence is 6)[$ann_comm The substance doesn't stay intact for long.
$ann_comm My sample is already degrading.
$ann_comm We'll only be able to follow this trail while it's fresh.
$ann_comm Which means we have to go now, instead to returning to base.
|next>[Continue]
](elseif: $sequence is 7)[$big_comm Whatever is in that forest is likely responsible for what happened to those vampires.
$big_comm This may be our only chance to discover what happened.
$fist_comm I say we go!
$ann_comm No one is surprised.
$big_comm What do you say, Commander?
|next>[Go investigate the forest.]
|gray>[<span style="color: gray;">Return to base with what we have.</span>] (click: ?gray)[
//This is a legitimate choice, but also one that would end the simulation, so I grayed it out. - Tess//]
](elseif: $sequence is 8)[$fist_comm Yes, Commander!
$ann_comm Got it.
$big_comm Into the woods...
(display: "Mission 2 Prep")
|mission2>[Start Mission 2]
](elseif: $sequence is 9)[
](elseif: $sequence is 10)[
](elseif: $sequence is 11)[
]{
(click: ?nextMission)[(set: $sequence to 3)(go-to: $currentPassage)]
}(if: $sequence is 0)[<span class="threat">MISSION FAILURE</span>
All units disabled.
|next>[Continue]
](elseif: $sequence is 1)[$tess_comm That was a good try.
$tess_comm Let me deploy an encouragement meme for you.
|next>[Continue]
](elseif: $sequence is 2)[<img id="picture" src="" alt="Encouragement!">
{<div id="pic1" style="display: none;">By <a target="_blank" href="https://www.facebook.com/Emysdiary/">Shun</a></div>
<div id="pic2" style="display: none;">By <a target="_blank" href="https://twitter.com/ben_cameron">Ben Cameron</a></div>
<div id="pic3" style="display: none;"><a target="_blank" href="http://www.smosh.com/smosh-pit/photos/25-inspiring-courage-wolves">Courage Wolf</a></div>
<div id="pic4" style="display: none;">By <a target="_blank" href="http://www.cartoonnetwork.com/video/adventuretime/index.html">Adventure Time on Cartoon Network</a></div>
<div id="pic5" style="display: none;"><a target="_blank" href="http://www.quickmeme.com/meme/3qbn9g">Yo Dawg</a> featuring <a target="_blank" href="https://open.spotify.com/artist/4tujQJicOnuZRLiBFdp3Ou?autoplay=true&v=A">Alvin Nathaniel Joiner</a></div>
<div id="pic6" style="display: none;">By <a target="_blank" href="https://peadoodles.blogspot.com/">Peadoodles</a></div>
<div id="pic7" style="display: none;"><a target="_blank" href="https://memegenerator.net/instance/72895584/you-got-it-puppy-you-got-it">You Got It Puppy</a></div>}
|reload>[I need another meme, please.]
|next>[That's enough.]{
<script>
var num = Math.floor(Math.random() * 7) + 1;
$("#picture").attr("src","encourage"+num+".jpg");
$("#pic"+num).css("display","block");
</script>
}
](elseif: $sequence is 3)[$tess_comm Do you feel encouraged?
$tess_comm Good!
$tess_comm Now give it another go!
$tess_comm Initiating Command Training Simulation.
(if: $mission_num is 1)[(display: "Mission 1 Prep")
|mission1>[$tess_comm In 3, 2, 1...]](elseif: $mission_num is 2)[(display: "Mission 2 Prep")
|mission2>[$tess_comm In 3, 2, 1...]]
]{
(click: ?sim)[(set: $sequence to 1)(go-to: $currentPassage)]
}(if: $sequence is 0)[<span class="emph">MISSION 2 SUCCESS</span>
(if: $ann_status is "alive")[Annie Athema survived the mission.
+5 <span class="emph">Mission Points<span>(set: $mission_points to it + 5)
](if: $big_status is "alive")[Bigfoot survived the mission.
+5 <span class="emph">Mission Points<span>(set: $mission_points to it + 5)
](if: $fist_status is "alive")[Captain Fist survived the mission.
+5 <span class="emph">Mission Points<span>(set: $mission_points to it + 5)
](if: $voracite_analyzed is true)[Completely analyzed the Voracite.
+10 <span class="emph">Mission Points<span>(set: $mission_points to it + 10)
]
$tess_comm You earned <span class="emph">$mission_points</span> out of <span class="emph">35</span> MISSION POINTS.
|next>[Continue]
](elseif: $sequence is 1)[$tess_comm Well done Commander.
$tess_comm You completed my training simulation.
$tess_comm And you've met our enemy.
|next>[Continue]
](elseif: $sequence is 2)[$tess_comm This was a good beginning, but there's much more to do.
$tess_comm The real challenge is an ongoing campaign, where you control a unit on a Region map with many other Commanders.
$tess_comm If you choose to fight, every month, you will combat enemies and resolve events in your Region.
$tess_comm You will be given missions, invited to online Events to work with other Commanders,
$tess_comm And have access to all future training simulations I create.
|next>[Continue]
](elseif: $sequence is 3)[$tess_comm Join us at the <a style="color: lime;" target="_blank" href="https://emergent.azurewebsites.net/Intro">EMERGENT Website</a>.
$tess_comm Together we can Save This World.
](elseif: $sequence is 3)[
](elseif: $sequence is 4)[
](elseif: $sequence is 5)[
](elseif: $sequence is 6)[
](elseif: $sequence is 7)[
](elseif: $sequence is 8)[
](elseif: $sequence is 9)[
](elseif: $sequence is 10)[
](elseif: $sequence is 11)[
]{
}(display: "game values")
(display: "Mission 1 Prep")
[[End Mission 1]] {(set: $display_name to "")
(set: $map_responsive to true)
(display: "Mission Map")}
<span class="emph2">MISSION 2:</span> The First Vector
Annie Athema has detected bio-reading from this <span style="color: black; background: green; padding: 5px; border-radius: 5px;">forest</span>.
There are some <span style="color: black; background: indianred; padding: 5px; border-radius: 5px;">mountains</span> in this area that will block your progress.
Resolve the events until you discover what happened here.
You do not need to defeat all of the stationary enemies, as they do not present active threats.
When you have given all your orders, click on the red text below to:
|enemyTurn>[<span style="color: red;">Begin The Enemy Turn</span>]{
(set: $mission_num to 2)
(set: $mission_points to 0)
(set: $map_width to 9)
(set: $map_height to 9)
(set: $mission_log to (a: "Mission Start") )
(set: $vessel_complete to false)
(set: $current_action to "")
(set: $current_die to "")
(set: $target_title to "")
(set: $target_x to "")
(set: $target_y to "")
(set: $target_exists to false)
(set: $em_units to (a: "fist", "big","ann"))
(set: $enemy_units to (a: "tree1", "tree2", "tree3", "voracite1", "strvamp1", "strvamp2"))
(set: $events to (a: "cocoon", "vessel"))
(set: $hex_types to (a: "0-0-F","0-1-F","0-2-F","0-3-M","0-4-F","0-5-M","0-6-F","0-7-F","0-8-F","0-9-F", "1-0-F", "1-1-F", "1-2-F", "1-3-M", "1-4-F", "1-5-F", "1-6-F", "1-7-F", "1-8-F", "2-0-F", "2-1-F", "2-2-M", "2-3-M", "2-4-F", "2-5-F", "2-6-F", "2-7-F", "3-0-M", "3-1-F", "3-2-F", "3-3-F", "3-4-F", "3-5-F", "3-6-F", "4-0-F", "4-1-F", "4-2-F", "4-3-F", "4-4-F", "4-5-F", "5-0-F", "5-1-F", "5-2-F", "5-3-F", "5-4-F", "6-0-F", "6-1-F", "6-2-F", "6-3-F", "7-0-F", "7-1-F", "7-2-F", "8-0-F", "3-7-F", "4-7-F", "4-6-F", "5-7-F", "5-6-F", "5-5-F", "4-8-F", "6-7-F" ))
(set: $resolving_events to (a: ))
(set: $fist_title to "Captain Fist")
(set: $fist_x to 8)
(set: $fist_y to 6)
(set: $fist_actions to 2)
(set: $fist_status to "alive")
(set: $fist_health to 6)
(set: $fist_statbuff to 0)
(set: $fist_defbuff to 0)
(set: $fist_defending to false)
(set: $big_title to "Bigfoot")
(set: $big_x to 7)
(set: $big_y to 7)
(set: $big_actions to 2)
(set: $big_status to "alive")
(set: $big_turndie to "")
(set: $big_health to 5)
(set: $big_statbuff to 0)
(set: $big_defbuff to 0)
(set: $big_defending to false)
(set: $ann_title to "Annie Athema")
(set: $ann_x to 9)
(set: $ann_y to 4)
(set: $ann_actions to 2)
(set: $ann_status to "alive")
(set: $ann_turndie to "")
(set: $ann_health to 5)
(set: $ann_statbuff to 0)
(set: $ann_defbuff to 0)
(set: $ann_defending to false)
(set: $tree1_title to "Infected Tree")
(set: $tree1_x to 2)
(set: $tree1_y to 5)
(set: $tree1_status to "alive")
(set: $tree1_health to 15)
(set: $tree1_type to "Enemy")
(set: $tree2_title to "Infected Tree")
(set: $tree2_x to 3)
(set: $tree2_y to 1)
(set: $tree2_status to "alive")
(set: $tree2_health to 15)
(set: $tree2_type to "Enemy")
(set: $tree3_title to "Infected Tree")
(set: $tree3_x to 4)
(set: $tree3_y to 8)
(set: $tree3_status to "alive")
(set: $tree3_health to 15)
(set: $tree3_type to "Enemy")
(set: $tree_tier to 1)
(set: $tree_symbol to "evil-tree")
(set: $tree_branch to "Servitor")
(set: $tree_color to "purple")
(set: $tree_desc to "This three has been genetically modified to act as a guard.<br/><br/>Its attacks are brutal, but imprecise. You can block them entirely by having a unit stand beside the tree and <span class='emph'>Defend</span> with the <span class='emph'>Respond</span> die.")
(set: $tree_maxhealth to 15)
(set: $tree_move to 0)
(set: $tree_attack to 5)
(set: $tree_analyzevalue to 0)
(set: $tree_analyzed to false)
(set: $tree_anname to false)
(set: $tree_attacks to (a: "Flail With Limbs"))
(set: $tree_faketitle to "Strange Tree")
(set: $tree_fakedesc to "This tree does not seem quite right.")
(set: $tree_fakesymbol to "tree")
(set: $voracite1_title to "Voracite")
(set: $voracite1_x to 0)
(set: $voracite1_y to 0)
(set: $voracite1_status to "gone")
(set: $voracite1_health to 10)
(set: $voracite1_type to "Enemy")
(set: $voracite_tier to 2)
(set: $voracite_symbol to "voracite")
(set: $voracite_branch to "Xeno")
(set: $voracite_color to "purple")
(set: $voracite_desc to "A raptor-shaped alien, fleshy and pink, with ropy arms and opposable claws. Its elongated neck terminates in a spheroid head dominated by a lamprey-like circular mouth.")
(set: $voracite_maxhealth to 10)
(set: $voracite_move to 6)
(set: $voracite_attack to 4)
(set: $voracite_defend to 1)
(set: $voracite_analyzevalue to 0)
(set: $voracite_anhealth to false)
(set: $voracite_anattack to false)
(set: $voracite_andefense to false)
(set: $voracite_attacks to (a: "Seek Emergent", "Attack Defenseless"))
(set: $strvamp1_title to "Strange Vampire")
(set: $strvamp1_x to 4)
(set: $strvamp1_y to 1)
(set: $strvamp1_status to "gone")
(set: $strvamp1_health to 10)
(set: $strvamp1_type to "Enemy")
(set: $strvamp2_title to "Strange Vampire")
(set: $strvamp2_x to 3)
(set: $strvamp2_y to 2)
(set: $strvamp2_status to "gone")
(set: $strvamp2_health to 10)
(set: $strvamp2_type to "Enemy")
(set: $cocoon_title to "Throbbing Cocoon")
(set: $cocoon_x to 0)
(set: $cocoon_y to 4)
(set: $cocoon_desc to "The silhouette of a human is just visible, wrapped in translucent purple phlegm.<br/><br/>It pulses, as if the entire thing is a heart.")
(set: $cocoon_type to "Event")
(set: $cocoon_event to "Crisis")
(set: $cocoon_status to "active")
(set: $cocoon_value to 8)
(set: $vessel_title to "Alien Vessel")
(set: $vessel_symbol to "ship")
(set: $vessel_x to 1)
(set: $vessel_y to 1)
(set: $vessel_desc to "A metallic vessel with lights that gleam a dark purple is hidden in a cave.")
(set: $vessel_type to "Event")
(set: $vessel_event to "Enigma")
(set: $vessel_status to "gone")
(set: $vessel_value to 5)
}{
<script>
function EndMissionCheck(){
var cocoon_status = getHarloweVariable("cocoon_status");
var vessel_status = getHarloweVariable("vessel_status");
var voracite1_status = getHarloweVariable("voracite1_status");
var strvamp1_status = getHarloweVariable("strvamp1_status");
var strvamp2_status = getHarloweVariable("strvamp2_status");
var vessel_complete = getHarloweVariable("vessel_complete");
if(cocoon_status == "resolved"
&& vessel_status == "resolved"
&& voracite1_status == "gone"
&& strvamp1_status == "gone"
&& strvamp2_status == "gone"
&& vessel_complete == true){
return true;
}
return false;
}
</script>
}{<span style="display: none;">(display: "Mission Map")</span>
(set: $current_event to 1st of $resolving_events)
}(if: $current_event is "resolve_cocoon")[Enigma <span class="violet">Throbbing Cocoon</span> at 0,4 has been resolved.
(set: $cocoon_status to "resolved")
(if: $big_status is "alive")[$big_comm Dear lord...
$big_comm Are you all right?
$big_comm Can you stand?
$big_comm Take a moment, just breathe.
$big_comm You don't need to...
$big_comm You want to?
$big_comm Very well.
$big_comm Commander, there was a...person inside of that cocoon.
$big_comm He wishes to talk about what happened.
](elseif: $ann_status is "alive")[$ann_comm Fuck.
$ann_comm God.
$ann_comm There's a person in here, Commander, and he's still conscious.
$ann_comm He's conscious.
$ann_comm He says he's up for telling you what happened.
$ann_comm I'm putting him on the comm.
](elseif: $fist_status is "alive")[$fist_comm Commander.
$fist_comm There is a human civilian inside the Xeno anomaly.
$fist_comm He's capable of debriefing.
$fist_comm I am giving him my comm.
]
{Gained 5 <span class="emph">Mission Points<span>
(set: $mission_points to it + 5)}
](elseif: $current_event is "resolve_vessel")[You have found an alien vessel.
Your remaining units gather to engage with it.
{Gained 5 <span class="emph">Mission Points<span>
(set: $mission_points to it + 5)}
](elseif: $current_event is "fist_gone")[Unit <span class="emph">Captain Fist</span> has been disabled.
$fist_comm Hostiles broke my exoskeleton, Commander.
$fist_comm And my punching arm.
$fist_comm Have to fall back.
$fist_comm Give em' hell for me.
](elseif: $current_event is "ann_gone")[Unit <span class="emph">Captain Fist</span> has been disabled.
$ann_comm Fuck.
$ann_comm Hostiles got into the van an fucked my shit up.
$ann_comm I've got to fall back and make sure nothing explodes.
$ann_comm Sorry Commander. Good luck.
](elseif: $current_event is "big_gone")[Unit <span class="emph">Bigfoot</span> has been disabled.
$big_comm Ah...
$big_comm That ah...
$big_comm Actually quite hurt.
$big_comm Commander, I am badly injured and can no longer perform rescue operations.
$big_comm Please continue without me.
]{
(set: $resolving_events to $resolving_events - (a: $current_event))}
(if: $current_event contains "_gone" and $fist_status is "gone" and $big_status is "gone" and $ann_status is "gone")[|failMission>[Continue]](elseif: $current_event is "resolve_cocoon")[|talkToVector>[Continue](click: ?talkToVector)[(go-to: "Talk To Vector")]](elseif: $current_event is "resolve_vessel")[|attackVessel>[Continue](click: ?attackVessel)[(go-to: "Attack Vessel")]](elseif: $resolving_events's length is 0)[|returnMission>[Continue]](else:)[|resolveEvents>[Continue]]
(if: $sequence is 0)[$vector_comm Hello?
$vector_comm Can you hear me?
|next>[I can hear you.]
](elseif: $sequence is 1)[$vector_comm They said you were in charge.
$vector_comm The commander.
$vector_comm I thought that...someone... in charge...
$vector_comm Should know what happened.
|next>[Are you all right?]
|happened>[What happened to you?]
](elseif: $sequence is 2)[$vector_comm I don't know.
$vector_comm My stomach hurts.
$vector_comm My head is full of...red.
$vector_comm Red shadows.
$vector_comm Like the shadows...are tongues.
$vector_comm I don't know.
$vector_comm I don't think I'm all right.
|next>[What happened to you?]
](elseif: $sequence is 3)[$vector_comm I'm a park ranger.
$vector_comm My name is Thomas.
(set: $vector_comm to "<span style='color: violet;'>@Thomas:</span>")
$vector_comm I came down to this ridge because there were reports...
$vector_comm ...god this is weird...
$vector_comm There were reports of trees attacking people.
|next>[Continue]
](elseif: $sequence is 4)[$vector_comm I don't know.
$vector_comm I guess I thought it was...branches, falling. Or something.
$vector_comm Some explanation.
$vector_comm Reasonable.
|next>[Continue]
](elseif: $sequence is 5)[$vector_comm There wasn't a reasonable explanation.
$vector_comm But there was something else.
$vector_comm In the northwest valley.
$vector_comm It's hidden behind a curtain of flowstone in one of the caves.
$vector_comm It's a building?
$vector_comm Or, fuck, a ship?
|next>[Continue]
](elseif: $sequence is 6)[$vector_comm And then there were...teeth.
$vector_comm Something.
$vector_comm God, I'm hungry.
$vector_comm I'm so...
|next>[//Clatter of the comm dropping to the ground.//]
](elseif: $sequence is 7)[//Flesh ripping.//
//Yelling.//
(if: $fist_status is "alive")[//Fists impacting flesh.//](else:)[//The sounds of violence.//]
//Silence.//
|next>[//The shuffling static of the comm being picked up.//]
](elseif: $sequence is 8)[(if: $fist_status is "alive")[$fist_comm The civilian victim turned hostile, Commander.
$fist_comm He rapidly developed natural weapons. Very large claws.
$fist_comm However, he seemed to be resisting his impulse to attack.
$fist_comm So I just punched him unconscious.
](elseif: $big_status is "alive")[$big_comm Thomas has...he entered a sort of frenzy, Commander.
$big_comm He grew claws.
$big_comm Very large claws.
$big_comm And lunged at me.
$big_comm But attempted to pull back from the lunge.
$big_comm And only scratched me slightly.
$big_comm I managed to get my arms around him.
$big_comm And breathe him unconscious.
$big_comm (My breath is soporific).
(set: $big_health to it - 2)(if: $big_health < 1)[(set: $big_health to 1)]
](elseif: $ann_status is "alive")[$ann_comm Tom just flipped out, Commander.
$ann_comm He grew fucking Wolverine claws and went batshit.
$ann_comm But he was also like, trying not to be batshit?
$ann_comm So I just tazed him.
(set: $ann_health to it - 1)(if: $ann_health < 1)[(set: $ann_health to 1)]
$ann_comm He scratched me up a bit before I managed it.
]
|next>[Continue]
](elseif: $sequence is 9)[Thomas' report has revealed the location of the Enigma <span class="violet">Alien Vessel</span> at 1,1.
(set: $vessel_status to "active")
(if: $resolving_events's length is 0)[|returnMission>[Continue]](else:)[|resolveEvents>[Continue]]
](elseif: $sequence is 10)[
](elseif: $sequence is 11)[
]{
(click: ?happened)[(set: $sequence to 3)(go-to: $currentPassage)]
}(if: $sequence is 0)[The vessel gleams in the faint light from the entrance of the cave.
Its front is curved like pincers.
Who takes the lead in approaching it?{
(set: $lead to "")
(set: $support to "")
(set: $watch to "")
}
(if: $ann_status is "alive")[|annlead>[Annie Athema] ](else:)[|gray>[Annie Athema] (click: ?gray)[//Annie Athema has been disabled.//] ]
(if: $big_status is "alive")[|biglead>[Bigfoot] ](else:)[|gray>[Bigfoot] (click: ?gray)[//Bigfoot has been disabled.//] ]
(if: $fist_status is "alive")[|fistlead>[Captain Fist] ](else:)[|gray>[Captain Fist] (click: ?gray)[//Captain Fist has been disabled.//] ]
](elseif: $sequence is 1)[$lead is approaching the vessel.
Should someone support them?
(if: $lead is not "Annie Athema")[(if: $ann_status is "alive")[|annsupport>[Annie Athema] ](else:)[|gray>[Annie Athema] (click: ?gray)[//Annie Athema has been disabled.//] ]
](if: $lead is not "Bigfoot")[(if: $big_status is "alive")[|bigsupport>[Bigfoot] ](else:)[|gray>[Bigfoot] (click: ?gray)[//Bigfoot has been disabled.//] ]
](if: $lead is not "Captain Fist")[(if: $fist_status is "alive")[|fistsupport>[Captain Fist] ](else:)[|gray>[Captain Fist] (click: ?gray)[//Captain Fist has been disabled.//] ]
]|nosupport>[Assign no one to support.]
](elseif: $sequence is 2)[$support is supporting $lead.
Should someone support keep watch at the entrance?
(if: $lead is not "Annie Athema" and $support is not "Annie Athema")[(if: $ann_status is "alive")[|annwatch>[Annie Athema] ](else:)[|gray>[Annie Athema] (click: ?gray)[//Annie Athema has been disabled.//] ]
](if: $lead is not "Bigfoot" and $support is not "Bigfoot")[(if: $big_status is "alive")[|bigwatch>[Bigfoot] ](else:)[|gray>[Bigfoot] (click: ?gray)[//Bigfoot has been disabled.//] ]
](if: $lead is not "Captain Fist" and $support is not "Captain Fist")[(if: $fist_status is "alive")[|fistwatch>[Captain Fist] ](else:)[|gray>[Captain Fist] (click: ?gray)[//Captain Fist has been disabled.//] ]
]|nowatch>[Assign no one to watch.]
](elseif: $sequence is 3)[$lead is approaching the vessel.
$support is supporting $lead.
$watch is keeping watch at the cave entrance.
Is this right?
|next>[Yes.]
|reassign>[Reassign roles.]
](elseif: $sequence is 4)[$lead approaches the vessel.
Something crawls out of the top.
{
(if: $lead is not "Captain Fist" and $support is not "Captain Fist" and $watch is not "Captain Fist")[(set: $fist_x to 4)(set: $fist_y to 0)]
(if: $lead is not "Bigfoot" and $support is not "Bigfoot" and $watch is not "Bigfoot")[(set: $big_x to 3)(set: $big_y to 3)]
(if: $lead is not "Annie Athema" and $support is not "Annie Athema" and $watch is not "Annie Athema")[(set: $ann_x to 4)(set: $ann_y to 2)]
}
|next>[Continue]
](elseif: $sequence is 5)[It is squat, shaped like a raptor.
Its flesh is bare and pink. Its ropy arms end in |clever>[opposable claws.](click: ?clever)[
//Clever and deadly.//]
Its elongated neck terminates in a spherical head.
It has a massive, |mouth>[circular mouth.](click: ?mouth)[
//Lamprey-like and lined with teeth.//]
(set: $voracite1_status to "alive")
|next>[Continue]
](elseif: $sequence is 6)[(if: $lead is "Captain Fist")[Captain Fist punches it.
//The <span class="violet">Voracite</span> takes 6 damage.//(set: $voracite1_health to 4)(set: $fist_x to 1)(set: $fist_y to 0)
](elseif: $lead is "Bigfoot")[Bigfoot flinches back, startled by the sudden confrontation.(set: $big_x to 1)(set: $big_y to 0)
](elseif: $lead is "Annie Athema")[Annie immediately responds by scanning it.(set: $ann_x to 1)(set: $ann_y to 0)
//Learned <span class="violet">Voracite's</span> Attack, Move, Health, and Defense.//{
(set: $voracite_anhealth to true)
(set: $voracite_anattack to true)
(set: $voracite_andefense to true)
(set: $voracite_analyzed to true)
}
]
|next>[Continue]
](elseif: $sequence is 7)[(if: $support is "Captain Fist")[Taking advantage of the distraction provided by the lead, Captain Fist punches it.
//The <span class="violet">Voracite</span> takes 6 damage.//(set: $voracite1_health to 4)(set: $fist_x to 0)(set: $fist_y to 1)
](elseif: $support is "Bigfoot")[Bigfoot watches it carefully.(set: $big_x to 0)(set: $big_y to 1)
](elseif: $support is "Annie Athema")[Annie takes advantage of the distraction provided by the lead, and scans it.
//Learned <span class="violet">Voracite's</span> Attack, Move, Health, and Defense.//{
(set: $ann_x to 0)(set: $ann_y to 1)
(set: $voracite_anhealth to true)
(set: $voracite_anattack to true)
(set: $voracite_andefense to true)
(set: $voracite_analyzed to true)
}
]The Voracite lashes out at $lead.
(if: $support is "Bigfoot")[Bigfoot blocks the attack.
](elseif: $lead is "Captain Fist")[//<span class="emph">Captain Fist</span> takes 3 damage.(set: $fist_health to it - 3)(if: $fist_health < 1)[(set: $fist_status to "gone") Unit disabled.]//
](elseif: $lead is "Bigfoot")[//<span class="emph">Bigfoot</span> takes 4 damage.(set: $big_health to it - 4)(if: $big_health < 1)[(set: $big_status to "gone") Unit disabled.]//
](elseif: $lead is "Annie Athema")[//<span class="emph">Annie Athema</span> takes 2 damage.(set: $ann_health to it - 2)(if: $ann_health < 1)[(set: $ann_status to "gone") Unit disabled.]//
]
(if: $fist_status is "gone" and $big_status is "gone" and $ann_status is "gone")[|failMission>[Continue]](else:)[|next>[Continue]]
](elseif: $sequence is 8)[Meanwhile, two <span class="violet">Strange Vampires</span> sneak into the cave.
(set: $strvamp1_status to "alive")(set: $strvamp2_status to "alive")
(if: $watch is "Captain Fist")[Captain Fist punches one of them so hard it explodes.
(set: $strvamp1_status to "gone")(set: $fist_x to 3)(set: $fist_y to 1)
](elseif: $watch is "Bigfoot")[Bigfoot misdirects them, sending them on a wild goose chase to the far ends of the map.
(set: $strvamp1_x to 9)(set: $strvamp1_y to 2)(set: $strvamp2_x to 2)(set: $strvamp2_y to 9)(set: $big_x to 3)(set: $big_y to 1)
](elseif: $watch is "Annie Athema")[Annie Athema throws a flashbang grenade, stunning them for one turn.
(set: $strvamp1_status to "stunned")(set: $strvamp2_status to "stunned")(set: $ann_x to 3)(set: $ann_y to 1)
]
|next>[Continue]
](elseif: $sequence is 9)[Time to deal with the fallout.
(set: $vessel_status to "resolved")(set: $vessel_complete to true)
(if: $resolving_events's length is 0)[|returnMission>[Continue]](else:)[|resolveEvents>[Continue]]
](elseif: $sequence is 10)[
](elseif: $sequence is 11)[
]{
(click: ?annlead)[(set: $sequence to 1)(set: $lead to "Annie Athema")(go-to: $currentPassage)]
(click: ?biglead)[(set: $sequence to 1)(set: $lead to "Bigfoot")(go-to: $currentPassage)]
(click: ?fistlead)[(set: $sequence to 1)(set: $lead to "Captain Fist")(go-to: $currentPassage)]
(click: ?annsupport)[(set: $sequence to 2)(set: $support to "Annie Athema")(go-to: $currentPassage)]
(click: ?bigsupport)[(set: $sequence to 2)(set: $support to "Bigfoot")(go-to: $currentPassage)]
(click: ?fistsupport)[(set: $sequence to 2)(set: $support to "Captain Fist")(go-to: $currentPassage)]
(click: ?nosupport)[(set: $sequence to 2)(set: $support to "No one")(go-to: $currentPassage)]
(click: ?annwatch)[(set: $sequence to 3)(set: $watch to "Annie Athema")(go-to: $currentPassage)]
(click: ?bigwatch)[(set: $sequence to 3)(set: $watch to "Bigfoot")(go-to: $currentPassage)]
(click: ?fistwatch)[(set: $sequence to 3)(set: $watch to "Captain Fist")(go-to: $currentPassage)]
(click: ?nowatch)[(set: $sequence to 3)(set: $watch to "No one")(go-to: $currentPassage)]
(click: ?reassign)[(set: $sequence to 0)(go-to: $currentPassage)]
}