瀏覽代碼

Log can be toggled now

tags/v0.2.8
Fen Dweller 7 年之前
父節點
當前提交
496d35f865
共有 3 個文件被更改,包括 23 次插入2 次删除
  1. +1
    -1
      feast.css
  2. +1
    -0
      feast.html
  3. +21
    -1
      feast.js

+ 1
- 1
feast.css 查看文件

@@ -133,7 +133,7 @@ button {
}

#player-stats {
height: 50%;
height: 65%;
}

#foe-stats {


+ 1
- 0
feast.html 查看文件

@@ -50,6 +50,7 @@
<div class="stat-line" id="stat-fullness">Candy Corn: 3</div>
<div class="stat-line" id="stat-bowels">Emotions: 35/100</div>
<button class="stat-button" id="stat-button-status">Status</button>
<button class="stat-button" id="log-button">Log: Enabled</button>
</div>
<div id="foe-stats">
FOE


+ 21
- 1
feast.js 查看文件

@@ -24,11 +24,23 @@ let killingBlow = null;
let deaths = [];
let respawnRoom;

let noLog = false;

let MIDNIGHT = 0;
let MORNING = 21600;
let NOON = 43200;
let EVENING = 64800;

function toggleLog() {
noLog = !noLog;

if (noLog) {
document.getElementById("log-button").innerHTML = "Log: Disabled";
} else {
document.getElementById("log-button").innerHTML = "Log: Enabled";
}
}

function join(things) {
if (things.length == 1) {
return things[0].description("a");
@@ -281,6 +293,8 @@ function renderTime(time) {
}

function move(direction) {
if (noLog)
clearScreen();
let target = currentRoom.exits[direction];
if (target == null) {
alert("Tried to move to an empty room!");
@@ -323,6 +337,7 @@ function start() {
document.getElementById("create").style.display = "none";
document.getElementById("game").style.display = "block";
document.getElementById("stat-button-status").addEventListener("click", status, false);
document.getElementById("log-button").addEventListener("click", toggleLog, false);
loadActions();
loadCompass();
loadDialog();
@@ -502,7 +517,8 @@ function startCombat(opponent) {
}

function attackClicked(index) {
clearScreen();
if (noLog)
clearScreen();
update(playerAttacks[index].attack(currentFoe).concat([newline]));

if (currentFoe.health <= 0) {
@@ -546,6 +562,8 @@ function attackHovered(index) {
}

function struggleClicked(index) {
if (noLog)
clearScreen();
let struggle = struggles[index];

let result = struggle.struggle(player);
@@ -578,6 +596,8 @@ function struggleHovered(index) {
}

function startDialog(dialog) {
if (noLog)
clearScreen();
currentDialog = dialog;
changeMode("dialog");
update(currentDialog.text.concat([newline]));


Loading…
取消
儲存