| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-07-01 22:19:58 +0200 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-07-01 22:19:58 +0200 | 
| commit | 5f8694f2ecae5084f9ad1332e69403f3f79de4bc (patch) | |
| tree | a4357e1a871c79099f44c46a457dd8e03d3892de /src/battlemap/struct/bm_character.erl | |
| parent | 47ff1d1dc4eb3d7fb7434ec0c27ea2272e1f00fe (diff) | |
Preparing for player defeats...
Diffstat (limited to 'src/battlemap/struct/bm_character.erl')
| -rw-r--r-- | src/battlemap/struct/bm_character.erl | 20 | 
1 files changed, 10 insertions, 10 deletions
| diff --git a/src/battlemap/struct/bm_character.erl b/src/battlemap/struct/bm_character.erl index 41c0fb4..45b2361 100644 --- a/src/battlemap/struct/bm_character.erl +++ b/src/battlemap/struct/bm_character.erl @@ -4,7 +4,7 @@  %% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  -type id() :: non_neg_integer(). --type rank() :: ('optional' | 'target' | 'commander'). +-type rank() :: ('optional' | 'target' | 'commander' | 'defeated').  -record  ( @@ -22,7 +22,7 @@        armor_id :: sh_armor:id(),        location :: {non_neg_integer(), non_neg_integer()},        current_health :: integer(), %% Negative integers let us reverse attacks. -      active :: boolean() +      is_active :: boolean()     }  ). @@ -62,7 +62,7 @@        get_weapons_field/0,        get_location_field/0,        get_current_health_field/0, -      get_active_field/0 +      get_is_active_field/0     ]  ). @@ -148,9 +148,9 @@ get_is_alive (Char) ->  -spec get_is_active (type()) -> boolean().  get_is_active (Char) ->     ( -      Char#character.active -      and -      get_is_alive(Char) +      (Char#character.rank /= defeated) +      and Char#character.is_active +      and get_is_alive(Char)     ).  -spec set_location @@ -176,7 +176,7 @@ set_current_health (Health, Char) ->  set_is_active (Active, Char) ->     Char#character     { -      active = Active +      is_active = Active     }.  -spec set_armor_id (sh_armor:id(), type()) -> type(). @@ -243,7 +243,7 @@ random (ID, OwnerID, BattlemapWidth, BattlemapHeight, ForbiddenLocations) ->        statistics = Statistics,        location = Location,        current_health = sh_statistics:get_health(Statistics), -      active = false +      is_active = false     }.  -spec get_statistics_field() -> non_neg_integer(). @@ -254,5 +254,5 @@ get_weapons_field () -> #character.weapon_ids.  get_location_field () -> #character.location.  -spec get_current_health_field() -> non_neg_integer().  get_current_health_field () -> #character.current_health. --spec get_active_field() -> non_neg_integer(). -get_active_field () -> #character.active. +-spec get_is_active_field() -> non_neg_integer(). +get_is_active_field () -> #character.is_active. | 


