Преглед на файлове

Merge branch 'master' into geta

geta
Fen Dweller преди 5 години
родител
ревизия
e80cb9d858
променени са 2 файла, в които са добавени 16 реда и са изтрити 2 реда
  1. +12
    -2
      .vscode/templates.code-snippets
  2. +4
    -0
      game.js

+ 12
- 2
.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",
" ",
" }",
"});",
""


+ 4
- 0
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;


Loading…
Отказ
Запис