From 44d4dbc70bda12d57205a35b69e883c8f52b61f7 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Sun, 20 Oct 2019 21:43:05 +0200 Subject: Adds skills. --- skill/global.m4.conf | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 skill/global.m4.conf (limited to 'skill/global.m4.conf') diff --git a/skill/global.m4.conf b/skill/global.m4.conf new file mode 100644 index 0000000..7a7cd10 --- /dev/null +++ b/skill/global.m4.conf @@ -0,0 +1,50 @@ +m4_define(`__SKILL_CHOOSE_STYLE', + `m4_define(`__SKILL',m4_defn(`$1'))m4_undefine(`$1')')m4_dnl +m4_dnl +m4_dnl +m4_dnl +m4_define(`__SKILL_ERLANG_STYLE',`from_id (<<"`$1'">>) -> + #skill + { + id = <<"$1">>, + module = $2, + name = <<"$3">>, + cost = $4, + reserve = $5, + targets = $6, + locations = $7, + duration = $8, + uses = $9, + chance = $10, + power = $11, + range = $12 + }; +')m4_dnl +m4_define(`__SKILL_USE_ERLANG_STYLE', + `__SKILL_CHOOSE_STYLE(`__SKILL_ERLANG_STYLE')')m4_dnl +m4_dnl +m4_dnl +m4_dnl +m4_define(`__SKILL_JSON_STYLE',` { + "msg": "add_skill", + "id": "$1", + "nam": "$3", + "cos": $4, + "res": $5, + "tar": $6, + "loc": $7, + "dur": $8, + "use": $9, + "cha": $10, + "pow": $11, + "ran": $12 + }, +')m4_dnl +m4_define(`__SKILL_USE_JSON_STYLE', + `__SKILL_CHOOSE_STYLE(`__SKILL_JSON_STYLE')')m4_dnl +m4_dnl +m4_dnl +m4_dnl +m4_ifelse(__CODE_STYLE(), + erlang, `__SKILL_USE_ERLANG_STYLE()', + __CODE_STYLE(), json, `__SKILL_USE_JSON_STYLE()')m4_dnl -- cgit v1.2.3-70-g09d2