summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2019-11-15 18:30:00 +0100
committernsensfel <SpamShield0@noot-noot.org>2019-11-15 18:30:00 +0100
commitcc4e39960d3c56fceb2e31c01bf286dccc73615c (patch)
tree83eebd072022fe947e587c30f57f1957b41254ca /src/battle/struct
parent81ba7d62ce925150db1b537c28efb6b1314a3574 (diff)
...
Diffstat (limited to 'src/battle/struct')
-rw-r--r--src/battle/struct/btl_character.erl10
-rw-r--r--src/battle/struct/btl_condition_parameters.erl27
2 files changed, 5 insertions, 32 deletions
diff --git a/src/battle/struct/btl_character.erl b/src/battle/struct/btl_character.erl
index fa1fcde..9769f8f 100644
--- a/src/battle/struct/btl_character.erl
+++ b/src/battle/struct/btl_character.erl
@@ -21,7 +21,7 @@
{
player_ix :: non_neg_integer(),
rank :: rank(),
- location :: {non_neg_integer(), non_neg_integer()},
+ location :: shr_location:type(),
current_health :: integer(), %% Negative integers let us reverse attacks.
skill_points :: integer(), %% Negative integers let us reverse skill uses.
is_active :: boolean(),
@@ -37,7 +37,7 @@
{
player_ix :: non_neg_integer(),
rank :: rank(),
- location :: {non_neg_integer(), non_neg_integer()},
+ location :: shr_location:type(),
current_health :: integer(), %% Negative integers let us reverse attacks.
skill_points :: integer(), %% Negative integers let us reverse skill uses.
is_active :: boolean(),
@@ -156,7 +156,7 @@ get_player_index (#btl_char_ref{ player_ix = R }) -> R.
get_rank (#btl_char{ rank = R }) -> R;
get_rank (#btl_char_ref{ rank = R }) -> R.
--spec get_location (either()) -> {non_neg_integer(), non_neg_integer()}.
+-spec get_location (either()) -> shr_location:type().
get_location (#btl_char{ location = R }) -> R;
get_location (#btl_char_ref{ location = R }) -> R.
@@ -225,7 +225,7 @@ ataxia_set_rank (Rank, Char) ->
-spec set_location
(
- {non_neg_integer(), non_neg_integer()},
+ shr_location:type(),
shr_omnimods:type(),
type()
)
@@ -261,7 +261,7 @@ set_location (Location, LocOmnimods, Char) ->
-spec ataxia_set_location
(
- {non_neg_integer(), non_neg_integer()},
+ shr_location:type(),
shr_omnimods:type(),
type()
)
diff --git a/src/battle/struct/btl_condition_parameters.erl b/src/battle/struct/btl_condition_parameters.erl
index 280e37c..eb78245 100644
--- a/src/battle/struct/btl_condition_parameters.erl
+++ b/src/battle/struct/btl_condition_parameters.erl
@@ -10,7 +10,6 @@
targets :: list(non_neg_integer()),
locations :: list(shr_location:type()),
uses :: (non_neg_integer() | -1),
- duration :: (non_neg_integer() | -1),
chance :: (0..100 | -1),
other :: any()
}
@@ -40,10 +39,6 @@
set_uses/2,
ataxia_set_uses/2,
- get_duration/1,
- set_duration/2,
- ataxia_set_duration/2,
-
get_chance/1,
set_chance/2,
ataxia_set_chance/2,
@@ -115,28 +110,6 @@ ataxia_set_uses (Uses, Params) ->
ataxic:update_field(#btl_cond_params.uses, ataxic:constant(Uses))
}.
-%%%%%%%%%%%%%%%%%%
-%%%% Duration %%%%
-%%%%%%%%%%%%%%%%%%
--spec get_duration (type(_)) -> (non_neg_integer() | -1).
-get_duration (Params) -> Params#btl_cond_params.duration.
-
--spec set_duration ((non_neg_integer() | -1), type(ODT)) -> type(ODT).
-set_duration (Duration, Params) ->
- Params#btl_cond_params{ duration = Duration }.
-
--spec ataxia_set_duration
- (
- (non_neg_integer() | -1),
- type(ODT)
- )
- -> {type(ODT), ataxic:basic()}.
-ataxia_set_duration (Duration, Params) ->
- {
- set_duration(Duration, Params),
- ataxic:update_field(#btl_cond_params.duration, ataxic:constant(Duration))
- }.
-
%%%%%%%%%%%%%%%%
%%%% Chance %%%%
%%%%%%%%%%%%%%%%