| @@ -80,7 +80,7 @@ | |||||
| " \"conditions\": [", | " \"conditions\": [", | ||||
| "", | "", | ||||
| " ],", | " ],", | ||||
| " \"hooks\" [", | |||||
| " \"hooks\": [", | |||||
| " ", | " ", | ||||
| " ]", | " ]", | ||||
| "}," | "}," | ||||
| @@ -97,6 +97,16 @@ | |||||
| ], | ], | ||||
| "description": "Condition" | "description": "Condition" | ||||
| }, | }, | ||||
| "Hook": { | |||||
| "prefix": "hook", | |||||
| "body": [ | |||||
| "(room, exit, state) => {", | |||||
| " return ${1:true}", | |||||
| "}", | |||||
| "" | |||||
| ], | |||||
| "description": "Condition" | |||||
| }, | |||||
| "Stat": { | "Stat": { | ||||
| "prefix": "stat", | "prefix": "stat", | ||||
| "body": [ | "body": [ | ||||
| @@ -147,7 +157,7 @@ | |||||
| "", | "", | ||||
| " ],", | " ],", | ||||
| " \"world\": {", | " \"world\": {", | ||||
| " s", | |||||
| " ", | |||||
| " }", | " }", | ||||
| "});", | "});", | ||||
| "" | "" | ||||
| @@ -55,6 +55,10 @@ function initGamePostSetup(state) { | |||||
| createStatDisplays(state.player.stats, "player"); | createStatDisplays(state.player.stats, "player"); | ||||
| } | } | ||||
| function getStat(stat, state) { | |||||
| return state.palyer.stats[stat].value; | |||||
| } | |||||
| function changeStat(stat, amount, state) { | function changeStat(stat, amount, state) { | ||||
| let value = state.player.stats[stat].value; | let value = state.player.stats[stat].value; | ||||
| value += amount; | value += amount; | ||||