From 9d45e68f8daa748c58e28c77434b1377c508e32f Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Sat, 10 Aug 2019 14:49:13 +0200 Subject: Statistics -> Attributes. --- src/battle/mechanic/action/btl_action_attack.erl | 46 ++++++++++++------------ src/battle/mechanic/action/btl_action_move.erl | 4 +-- src/battle/struct/btl_character.erl | 8 ++--- 3 files changed, 29 insertions(+), 29 deletions(-) (limited to 'src/battle') diff --git a/src/battle/mechanic/action/btl_action_attack.erl b/src/battle/mechanic/action/btl_action_attack.erl index 56524af..04becc8 100644 --- a/src/battle/mechanic/action/btl_action_attack.erl +++ b/src/battle/mechanic/action/btl_action_attack.erl @@ -18,14 +18,14 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -spec roll_precision_modifier ( - shr_statistics:type(), - shr_statistics:type(), + shr_attributes:type(), + shr_attributes:type(), integer() ) -> {float(), integer(), integer()}. -roll_precision_modifier (Statistics, TargetStatistics, TargetLuck) -> - TargetDodges = shr_statistics:get_dodges(TargetStatistics), - Accuracy = shr_statistics:get_accuracy(Statistics), +roll_precision_modifier (Attributes, TargetAttributes, TargetLuck) -> + TargetDodges = shr_attributes:get_dodges(TargetAttributes), + Accuracy = shr_attributes:get_accuracy(Attributes), MissChance = max(0, (TargetDodges - Accuracy)), {Roll, _IsSuccess, PositiveModifier, NegativeModifier} = @@ -43,12 +43,12 @@ roll_precision_modifier (Statistics, TargetStatistics, TargetLuck) -> -spec roll_critical_modifier ( - shr_statistics:type(), + shr_attributes:type(), integer() ) -> {float(), integer(), integer()}. -roll_critical_modifier (Statistics, Luck) -> - CriticalHitChance = shr_statistics:get_critical_hits(Statistics), +roll_critical_modifier (Attributes, Luck) -> + CriticalHitChance = shr_attributes:get_critical_hits(Attributes), {_Roll, IsSuccess, PositiveModifier, NegativeModifier} = shr_roll:percentage_with_luck(CriticalHitChance, Luck), @@ -63,12 +63,12 @@ roll_critical_modifier (Statistics, Luck) -> -spec roll_parry ( - shr_statistics:type(), + shr_attributes:type(), integer() ) -> {boolean(), integer(), integer()}. -roll_parry (DefenderStatistics, DefenderLuck) -> - DefenderParryChance = shr_statistics:get_parries(DefenderStatistics), +roll_parry (DefenderAttributes, DefenderLuck) -> + DefenderParryChance = shr_attributes:get_parries(DefenderAttributes), {_Roll, IsSuccess, PositiveModifier, NegativeModifier} = shr_roll:percentage_with_luck(DefenderParryChance, DefenderLuck), @@ -265,12 +265,12 @@ effect_of_attack {ParryIsSuccessful, ParryPositiveLuckMod, ParryNegativeLuckMod} = case TargetCanParry of true -> - TargetStatistics = - shr_character:get_statistics + TargetAttributes = + shr_character:get_attributes ( btl_character:get_base_character(TargetCharacter) ), - roll_parry(TargetStatistics, TargetLuck); + roll_parry(TargetAttributes, TargetLuck); false -> {false, 0, 0} end, @@ -282,20 +282,20 @@ effect_of_attack end, AttackerBaseCharacter = btl_character:get_base_character(Attacker), - AttackerStatistics = shr_character:get_statistics(AttackerBaseCharacter), + AttackerAttributes = shr_character:get_attributes(AttackerBaseCharacter), DefenderBaseCharacter = btl_character:get_base_character(S0Defender), - DefenderStatistics = shr_character:get_statistics(DefenderBaseCharacter), + DefenderAttributes = shr_character:get_attributes(DefenderBaseCharacter), {PrecisionModifier, PrecisionPositiveLuckMod, PrecisionNegativeLuckMod} = roll_precision_modifier ( - AttackerStatistics, - DefenderStatistics, + AttackerAttributes, + DefenderAttributes, S0DefenderLuck ), {CriticalModifier, CriticalPositiveLuckMod, CriticalNegativeLuckMod} = - roll_critical_modifier(AttackerStatistics, S0AttackerLuck), + roll_critical_modifier(AttackerAttributes, S0AttackerLuck), Damage = shr_omnimods:get_attack_damage @@ -303,7 +303,7 @@ effect_of_attack ( PrecisionModifier * CriticalModifier - * shr_statistics:get_damage_modifier(AttackerStatistics) + * shr_attributes:get_damage_modifier(AttackerAttributes) ), shr_character:get_omnimods(AttackerBaseCharacter), shr_character:get_omnimods(DefenderBaseCharacter) @@ -513,12 +513,12 @@ handle_attack_sequence ) of true -> - Statistics = - shr_character:get_statistics + Attributes = + shr_character:get_attributes ( btl_character:get_base_character(S0Character) ), - DoubleAttackChance = shr_statistics:get_double_hits(Statistics), + DoubleAttackChance = shr_attributes:get_double_hits(Attributes), {_Roll, IsSuccessful, PositiveModifier, NegativeModifier} = shr_roll:percentage_with_luck(DoubleAttackChance, S0PlayerLuck), diff --git a/src/battle/mechanic/action/btl_action_move.erl b/src/battle/mechanic/action/btl_action_move.erl index 643912c..ebc79db 100644 --- a/src/battle/mechanic/action/btl_action_move.erl +++ b/src/battle/mechanic/action/btl_action_move.erl @@ -369,9 +369,9 @@ get_path_cost_and_destination (CharacterIX, Character, Update, Path) -> get_movement_points (Action, Character) -> case btl_action:get_movement_points(Action) of -1 -> - shr_statistics:get_movement_points + shr_attributes:get_movement_points ( - shr_character:get_statistics + shr_character:get_attributes ( btl_character:get_base_character(Character) ) diff --git a/src/battle/struct/btl_character.erl b/src/battle/struct/btl_character.erl index 790c809..f5f7ee0 100644 --- a/src/battle/struct/btl_character.erl +++ b/src/battle/struct/btl_character.erl @@ -111,10 +111,10 @@ -> {boolean(), integer()}. handle_max_health_change (OldBaseChar, NewBaseChar, OldHealth) -> OldMaxHealth = - shr_statistics:get_health(shr_character:get_statistics(OldBaseChar)), + shr_attributes:get_health(shr_character:get_attributes(OldBaseChar)), NewMaxHealth = - shr_statistics:get_health(shr_character:get_statistics(NewBaseChar)), + shr_attributes:get_health(shr_character:get_attributes(NewBaseChar)), case (OldMaxHealth == NewMaxHealth) of true -> {false, OldHealth}; @@ -427,14 +427,14 @@ new Location, Base ) -> - Statistics = shr_character:get_statistics(Base), + Attributes = shr_character:get_attributes(Base), #btl_char { player_ix = PlayerIX, rank = Rank, location = Location, - current_health = shr_statistics:get_health(Statistics), + current_health = shr_attributes:get_health(Attributes), is_active = (PlayerIX == 0), is_defeated = false, base = Base -- cgit v1.2.3-70-g09d2