summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-09-12 12:49:38 +0200 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-09-12 12:49:38 +0200 |
commit | 18bd70b35597a0581cfe59f07927e03492a8be81 (patch) | |
tree | 6572816e7b998a61dad90a49e60c97203b92ba34 /src/shared/battle/Battle/Struct | |
parent | ce03028ccd575af1dc38b26d23569601d3b5d491 (diff) |
Adds min values when displaying omnimods in battle.
Diffstat (limited to 'src/shared/battle/Battle/Struct')
-rw-r--r-- | src/shared/battle/Battle/Struct/Attributes.elm.m4 | 60 | ||||
-rw-r--r-- | src/shared/battle/Battle/Struct/Omnimods.elm | 20 |
2 files changed, 71 insertions, 9 deletions
diff --git a/src/shared/battle/Battle/Struct/Attributes.elm.m4 b/src/shared/battle/Battle/Struct/Attributes.elm.m4 index d008618..aad8504 100644 --- a/src/shared/battle/Battle/Struct/Attributes.elm.m4 +++ b/src/shared/battle/Battle/Struct/Attributes.elm.m4 @@ -19,8 +19,11 @@ module Battle.Struct.Attributes exposing get_true_double_hits, get_true_critical_hits, get_true_damage_modifier, + get, + get_true, decode_category, encode_category, + get_categories, mod, default, is_percent @@ -154,20 +157,59 @@ mod cat v t = CriticalHits -> (mod_critical_hits v t) DamageModifier -> (mod_damage_modifier v t) --- TODO: Link this to the server using tacticians-data. +get : Category -> Type -> Int +get cat t = + case cat of + MaxHealth -> (get_max_health t) + MovementPoints -> (get_movement_points t) + Dodges -> (get_dodges t) + Parries -> (get_parries t) + Accuracy -> (get_accuracy t) + DoubleHits -> (get_double_hits t) + CriticalHits -> (get_critical_hits t) + DamageModifier -> (get_damage_modifier t) + +get_true : Category -> Type -> Int +get_true cat t = + case cat of + MaxHealth -> (get_true_max_health t) + MovementPoints -> (get_true_movement_points t) + Dodges -> (get_true_dodges t) + Parries -> (get_true_parries t) + Accuracy -> (get_true_accuracy t) + DoubleHits -> (get_true_double_hits t) + CriticalHits -> (get_true_critical_hits t) + DamageModifier -> (get_true_damage_modifier t) + +get_categories : (List Category) +get_categories = + [ + MovementPoints, + MaxHealth, + Dodges, + Parries, + Accuracy, + DoubleHits, + CriticalHits, + DamageModifier + ] + +m4_include(__MAKEFILE_DATA_DIR/attributes.m4.conf) + default : Type default = { - movement_points = 8, - max_health = 1, - dodges = 0, - parries = 0, - accuracy = 0, - double_hits = 0, - critical_hits = 0, - damage_modifier = 0 + movement_points = __ATT_MOVEMENT_POINTS_MIN, + max_health = __ATT_MAX_HEALTH_MIN, + dodges = __ATT_DODGE_MIN, + parries = __ATT_PARRY_MIN, + accuracy = __ATT_ACCURACY_MIN, + double_hits = __ATT_DOUBLE_HITS_MIN, + critical_hits = __ATT_CRITICAL_HIT_MIN, + damage_modifier = __ATT_DAMAGE_MODIFIER_MIN } + m4_include(__MAKEFILE_DATA_DIR/names.m4.conf) decode_category : String -> Category diff --git a/src/shared/battle/Battle/Struct/Omnimods.elm b/src/shared/battle/Battle/Struct/Omnimods.elm index e9c3089..80d97a5 100644 --- a/src/shared/battle/Battle/Struct/Omnimods.elm +++ b/src/shared/battle/Battle/Struct/Omnimods.elm @@ -3,6 +3,7 @@ module Battle.Struct.Omnimods exposing Type, new, merge, + merge_attributes, none, apply_to_attributes, get_attack_damage, @@ -120,6 +121,25 @@ merge omni_a omni_b = defense = (merge_mods omni_a.defense omni_b.defense) } +merge_attributes : Battle.Struct.Attributes.Type -> Type -> Type +merge_attributes attributes omnimods = + (merge + omnimods + (new + (List.map + (\att -> + ( + (Battle.Struct.Attributes.encode_category att), + (Battle.Struct.Attributes.get_true att attributes) + ) + ) + (Battle.Struct.Attributes.get_categories) + ) + [] + [] + ) + ) + apply_to_attributes : ( Type -> Battle.Struct.Attributes.Type -> |