summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2018-06-06 16:42:42 +0200 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2018-06-06 16:42:42 +0200 |
commit | 82081d45fd64294f4bc417085e06284f3487b32f (patch) | |
tree | 1da77dd39829f8bfdcbf200df6a12a0a53edf661 /src/battlemap/reply | |
parent | ee9c2ac044cc77b80f30420c8f0788cad4281084 (diff) |
...
Diffstat (limited to 'src/battlemap/reply')
-rw-r--r-- | src/battlemap/reply/bm_add_char.erl (renamed from src/battlemap/reply/add_char.erl) | 44 | ||||
-rw-r--r-- | src/battlemap/reply/bm_set_map.erl (renamed from src/battlemap/reply/set_map.erl) | 10 | ||||
-rw-r--r-- | src/battlemap/reply/bm_set_timeline.erl (renamed from src/battlemap/reply/set_timeline.erl) | 2 | ||||
-rw-r--r-- | src/battlemap/reply/bm_turn_results.erl (renamed from src/battlemap/reply/turn_results.erl) | 2 |
4 files changed, 29 insertions, 29 deletions
diff --git a/src/battlemap/reply/add_char.erl b/src/battlemap/reply/bm_add_char.erl index 86b1e9c..d6f5965 100644 --- a/src/battlemap/reply/add_char.erl +++ b/src/battlemap/reply/bm_add_char.erl @@ -1,4 +1,4 @@ --module(add_char). +-module(bm_add_char). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -14,18 +14,18 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -spec attributes_as_json ( - attributes:type() + sh_attributes:type() ) -> {list({binary(), non_neg_integer()})}. attributes_as_json (Attributes) -> { [ - {<<"con">>, attributes:get_constitution(Attributes)}, - {<<"dex">>, attributes:get_dexterity(Attributes)}, - {<<"int">>, attributes:get_intelligence(Attributes)}, - {<<"min">>, attributes:get_mind(Attributes)}, - {<<"spe">>, attributes:get_speed(Attributes)}, - {<<"str">>, attributes:get_strength(Attributes)} + {<<"con">>, sh_attributes:get_constitution(Attributes)}, + {<<"dex">>, sh_attributes:get_dexterity(Attributes)}, + {<<"int">>, sh_attributes:get_intelligence(Attributes)}, + {<<"min">>, sh_attributes:get_mind(Attributes)}, + {<<"spe">>, sh_attributes:get_speed(Attributes)}, + {<<"str">>, sh_attributes:get_strength(Attributes)} ] }. @@ -35,38 +35,38 @@ attributes_as_json (Attributes) -> -spec generate ( non_neg_integer(), - character:type(), - player:id() + bm_character:type(), + bm_player:id() ) -> {list(any())}. generate (IX, Character, PlayerID) -> - IsAlive = character:get_is_alive(Character), - Attributes = character:get_attributes(Character), - {ActiveWeapon, SecondaryWeapon} = character:get_weapon_ids(Character), - OwnerID = character:get_owner_id(Character), + IsAlive = bm_character:get_is_alive(Character), + Attributes = bm_character:get_attributes(Character), + {ActiveWeapon, SecondaryWeapon} = bm_character:get_weapon_ids(Character), + OwnerID = bm_character:get_owner_id(Character), Location = case IsAlive of - true -> character:get_location(Character); - _ -> location:get_nowhere() + true -> bm_character:get_location(Character); + _ -> bm_location:get_nowhere() end, { [ {<<"msg">>, <<"add_char">>}, {<<"ix">>, IX}, - {<<"nam">>, character:get_name(Character)}, - {<<"ico">>, character:get_icon(Character)}, - {<<"prt">>, character:get_portrait(Character)}, + {<<"nam">>, bm_character:get_name(Character)}, + {<<"ico">>, bm_character:get_icon(Character)}, + {<<"prt">>, bm_character:get_portrait(Character)}, { <<"hea">>, - character:get_current_health(Character) + bm_character:get_current_health(Character) }, - {<<"lc">>, location:encode(Location)}, + {<<"lc">>, bm_location:encode(Location)}, {<<"pla">>, OwnerID}, { <<"ena">>, ( - character:get_is_active(Character) + bm_character:get_is_active(Character) and (OwnerID == PlayerID) ) diff --git a/src/battlemap/reply/set_map.erl b/src/battlemap/reply/bm_set_map.erl index 8518ac5..992581b 100644 --- a/src/battlemap/reply/set_map.erl +++ b/src/battlemap/reply/bm_set_map.erl @@ -1,4 +1,4 @@ --module(set_map). +-module(bm_set_map). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -16,13 +16,13 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --spec generate (battlemap:type()) -> {list(any())}. +-spec generate (bm_battlemap:type()) -> {list(any())}. generate (Battlemap) -> { [ {<<"msg">>, <<"set_map">>}, - {<<"w">>, battlemap:get_width(Battlemap)}, - {<<"h">>, battlemap:get_height(Battlemap)}, - {<<"t">>, array:sparse_to_list(battlemap:get_tile_ids(Battlemap))} + {<<"w">>, bm_battlemap:get_width(Battlemap)}, + {<<"h">>, bm_battlemap:get_height(Battlemap)}, + {<<"t">>, array:sparse_to_list(bm_battlemap:get_tile_ids(Battlemap))} ] }. diff --git a/src/battlemap/reply/set_timeline.erl b/src/battlemap/reply/bm_set_timeline.erl index bfe621a..cea3790 100644 --- a/src/battlemap/reply/set_timeline.erl +++ b/src/battlemap/reply/bm_set_timeline.erl @@ -1,4 +1,4 @@ --module(set_timeline). +-module(bm_set_timeline). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/battlemap/reply/turn_results.erl b/src/battlemap/reply/bm_turn_results.erl index 0f3ff25..d47a693 100644 --- a/src/battlemap/reply/turn_results.erl +++ b/src/battlemap/reply/bm_turn_results.erl @@ -1,4 +1,4 @@ --module(turn_results). +-module(bm_turn_results). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |