state sync, many changes:
* separated css/js/rule files to pak file (glorified zip) to reduce full rebuilds * implemented build cache * some frontend UI spiffing up
This commit is contained in:
@@ -35,13 +35,30 @@ div#main-content {
|
||||
|
||||
padding-left: 5px;
|
||||
}
|
||||
div#main-day-stats {
|
||||
|
||||
div#main-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
min-height: 100px;
|
||||
vertical-align: middle;
|
||||
|
||||
border-bottom: 0.125em solid rgb(192,192,192);
|
||||
}
|
||||
|
||||
div#main-day-stats {
|
||||
width: 100%;
|
||||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div#main-button-bar {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
min-height: 125px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div#main-log {
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
@@ -109,4 +126,12 @@ div#modal {
|
||||
height: 90%;
|
||||
border: 1.25em double rgba(192, 192, 192, 255);
|
||||
background-color: rgba(255, 255, 255, 255);
|
||||
}
|
||||
|
||||
button.main-bar {
|
||||
width: 2.5em;
|
||||
height: 2.5em;
|
||||
background-color: rgba(0,0,0,0);
|
||||
border: 1px solid black;
|
||||
font-size: 2em;
|
||||
}
|
@@ -24,7 +24,8 @@ const gamestate_default = {
|
||||
"enc_human": "pause",
|
||||
"enc_seagull": "pause",
|
||||
"agility": 0,
|
||||
"instinct": 0
|
||||
"instinct": 0,
|
||||
"leadership": 0
|
||||
};
|
||||
|
||||
var bool_log_alt = false
|
||||
@@ -109,7 +110,8 @@ async function open_modal_dialog(dialog) {
|
||||
if (!modal_dialog_open) {
|
||||
tick_meter_running = false;
|
||||
modal_dialog_open = true;
|
||||
modal_background.style = "z-index: 10 !important; visibility: visible !important;";
|
||||
modal_background.style.zIndex = "10 !important";
|
||||
modal_background.style.visibility = "visible !important";
|
||||
}
|
||||
|
||||
dialog_data = await fetch(`/dialog/${dialog}`)
|
||||
@@ -162,6 +164,15 @@ function reward_xp(amount) {
|
||||
gamestate["xp"] -= old_xp_next;
|
||||
gamestate["level"] += 1;
|
||||
gamestate["xp_next"] = (old_xp_next * 1.5) + (gamestate["level"] * 5);
|
||||
|
||||
if (gamestate["level"] == 2) {
|
||||
gamestate["story_beat"] = 1;
|
||||
record_log("The humans have fired off some sort of large rocket from a nearby platform. You watch it as it pierces the sky above you and fades into the heavens.");
|
||||
} else if (gamestate["level"] == 3) {
|
||||
gamestate["story_beat"] = 2;
|
||||
gamestate["class"] = "Seagull";
|
||||
record_log("You have grown up from a young, eager seaglet to a full blown Seagull. As your colony participates in the ritual honoring your coming of age, you begin to detect a shift in the winds, though you're not certain exactly how.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,6 +191,10 @@ async function steal_resource(resource, target, amount, itemstr) {
|
||||
}
|
||||
|
||||
async function recruit(amount) {
|
||||
if (gamestate["shinies"] < amount) {
|
||||
record_log("You do not have enough shinies to recruit this seagull.");
|
||||
return;
|
||||
}
|
||||
var stealdata = await fetch("/act/recruit", {method: "POST", body: JSON.stringify({gamestate: gamestate})})
|
||||
.then(res => { return res.json(); })
|
||||
.catch(e => { throw e; });
|
||||
@@ -375,9 +390,13 @@ target.addEventListener(start_event, function (ev) {
|
||||
page_elements["lbl_level"] = document.querySelector("#lbl-seagull-lvl");
|
||||
page_elements["menu_enc_human"] = document.querySelector("#menu-enc-human");
|
||||
page_elements["menu_enc_seagull"] = document.querySelector("#menu-enc-seagull");
|
||||
page_elements["btn_charsheet"] = document.querySelector("#button-charsheet");
|
||||
page_elements["btn_settings"] = document.querySelector("#button-settings");
|
||||
page_elements["btn_about"] = document.querySelector("#button-about");
|
||||
|
||||
page_elements["menu_enc_human"].addEventListener("change", (ev) => {update_action("human", ev.target.value)})
|
||||
page_elements["menu_enc_seagull"].addEventListener("change", (ev) => {update_action("seagull", ev.target.value)})
|
||||
page_elements["menu_enc_human"].addEventListener("change", (ev) => {update_action("human", ev.target.value)});
|
||||
page_elements["menu_enc_seagull"].addEventListener("change", (ev) => {update_action("seagull", ev.target.value)});
|
||||
page_elements["btn_charsheet"].addEventListener("click", (ev) => {open_modal_dialog("charsheet")});
|
||||
|
||||
prepare_gamestate();
|
||||
|
||||
|
Reference in New Issue
Block a user