diff --git a/.vscode/templates.code-snippets b/.vscode/templates.code-snippets index da62a33..fe8b876 100644 --- a/.vscode/templates.code-snippets +++ b/.vscode/templates.code-snippets @@ -80,7 +80,7 @@ " \"conditions\": [", "", " ],", - " \"hooks\" [", + " \"hooks\": [", " ", " ]", "}," @@ -97,6 +97,16 @@ ], "description": "Condition" }, + "Hook": { + "prefix": "hook", + "body": [ + "(room, exit, state) => {", + " return ${1:true}", + "}", + "" + ], + "description": "Condition" + }, "Stat": { "prefix": "stat", "body": [ @@ -147,7 +157,7 @@ "", " ],", " \"world\": {", - " s", + " ", " }", "});", "" diff --git a/game.js b/game.js index 1694c70..eda6e59 100644 --- a/game.js +++ b/game.js @@ -55,6 +55,10 @@ function initGamePostSetup(state) { createStatDisplays(state.player.stats, "player"); } +function getStat(stat, state) { + return state.palyer.stats[stat].value; +} + function changeStat(stat, amount, state) { let value = state.player.stats[stat].value; value += amount;