Procházet zdrojové kódy

Merge branch 'master' into geta

geta
Fen Dweller před 6 roky
rodič
revize
e80cb9d858
2 změnil soubory, kde provedl 16 přidání a 2 odebrání
  1. +12
    -2
      .vscode/templates.code-snippets
  2. +4
    -0
      game.js

+ 12
- 2
.vscode/templates.code-snippets Zobrazit soubor

@@ -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",
" ",
" }", " }",
"});", "});",
"" ""


+ 4
- 0
game.js Zobrazit soubor

@@ -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;


Načítá se…
Zrušit
Uložit