summaryrefslogtreecommitdiff
blob: 867f3137f6e7bb336313a830533e792ff1a1d7cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
m4_include(__MAKEFILE_DATA_DIR`/omnimods.m4.conf')m4_dnl
m4_dnl
m4_dnl
m4_dnl
m4_define(`__WEAPON_CHOOSE_STYLE',
   `m4_define(`__WEAPON',m4_defn(`$1'))m4_undefine(`$1')')m4_dnl
m4_dnl
m4_dnl
m4_dnl
m4_define(`__WEAPON_ERLANG_STYLE',`from_id (<<"`$1'">>) ->
   #weapon
   {
      id = <<"$1">>,
      name = <<"$2">>,
      is_primary = $3,
      range_min = $4,
      range_max = $5,
      omnimods = __OMNIMODS($6, $7, $8, $9)
   };
')m4_dnl
m4_define(`__WEAPON_USE_ERLANG_STYLE',
   `__WEAPON_CHOOSE_STYLE(`__WEAPON_ERLANG_STYLE')')m4_dnl
m4_dnl
m4_dnl
m4_dnl
m4_define(`__WEAPON_JSON_STYLE',`   {
      "msg": "add_weapon",
      "id": "$1",
      "nam": "$2",
      "pri": $3,
      "rmi": $4,
      "rma": $5,
      "omni": __OMNIMODS($6, $7, $8, $9)
   },
')m4_dnl
m4_define(`__WEAPON_USE_JSON_STYLE',
   `__WEAPON_CHOOSE_STYLE(`__WEAPON_JSON_STYLE')')m4_dnl
m4_dnl
m4_dnl
m4_dnl
m4_ifelse(__CODE_STYLE(),
   erlang, `__WEAPON_USE_ERLANG_STYLE()',
   __CODE_STYLE(), json, `__WEAPON_USE_JSON_STYLE()')m4_dnl