summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/battle/reply/btl_add_armor.erl')
-rw-r--r-- | src/battle/reply/btl_add_armor.erl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/battle/reply/btl_add_armor.erl b/src/battle/reply/btl_add_armor.erl new file mode 100644 index 0000000..2c6a875 --- /dev/null +++ b/src/battle/reply/btl_add_armor.erl @@ -0,0 +1,34 @@ +-module(btl_add_armor). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-export([generate/1]). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-spec encode_category (sh_armor:category()) -> binary(). +encode_category (kinetic) -> <<"k">>; +encode_category (leather) -> <<"l">>; +encode_category (chain) -> <<"c">>; +encode_category (plate) -> <<"p">>. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-spec generate (sh_armor:type()) -> {list(any())}. +generate (Armor) -> + { + [ + {<<"msg">>, <<"add_armor">>}, + {<<"id">>, sh_armor:get_id(Armor)}, + {<<"nam">>, sh_armor:get_name(Armor)}, + {<<"ct">>, encode_category(sh_armor:get_category(Armor))}, + {<<"cf">>, sh_armor:get_coefficient(Armor)} + ] + }. |