summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'skill/global.m4.conf')
-rw-r--r--skill/global.m4.conf50
1 files changed, 50 insertions, 0 deletions
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