| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-09-12 10:42:33 +0200 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-09-12 10:42:33 +0200 | 
| commit | ce03028ccd575af1dc38b26d23569601d3b5d491 (patch) | |
| tree | ddb943e743aa2389ea63079e36a0f063d60e0155 /src/shared/battle/Battle/View/Omnimods.elm | |
| parent | aadf3043f8647c033cc14ba8a4d5ad01dd9057fb (diff) | |
Improves presentation of attributes in battle.
Diffstat (limited to 'src/shared/battle/Battle/View/Omnimods.elm')
| -rw-r--r-- | src/shared/battle/Battle/View/Omnimods.elm | 69 | 
1 files changed, 68 insertions, 1 deletions
| diff --git a/src/shared/battle/Battle/View/Omnimods.elm b/src/shared/battle/Battle/View/Omnimods.elm index 8d8c4ce..7af5709 100644 --- a/src/shared/battle/Battle/View/Omnimods.elm +++ b/src/shared/battle/Battle/View/Omnimods.elm @@ -1,7 +1,8 @@  module Battle.View.Omnimods exposing     (        get_html_with_modifier, -      get_html +      get_html, +      get_user_friendly_html     )  -- Elm ------------------------------------------------------------------------- @@ -136,3 +137,69 @@ get_html omnimods =           )        ]     ) + +get_user_friendly_html : ( +      Battle.Struct.Omnimods.Type -> +      (Html.Html Struct.Event.Type) +   ) +get_user_friendly_html omnimods = +   let +      -- TODO: Add minimal values to omnimods (e.g. +1 to health). +      scaled_omnimods = +         (Battle.Struct.Omnimods.apply_damage_modifier +            (Battle.Struct.Omnimods.get_attribute_mod +               Battle.Struct.Attributes.DamageModifier +               omnimods +            ) +            omnimods +         ) +   in +      (Html.div +         [ +            (Html.Attributes.class "omnimod-listing") +         ] +         [ +            (Html.div +               [ +                  (Html.Attributes.class "omnimod-attack-mods") +               ] +               (List.map +                  (\(k, v) -> +                     (Battle.View.DamageType.get_html +                        (Battle.Struct.DamageType.decode k) +                        v +                     ) +                  ) +                  (Battle.Struct.Omnimods.get_attack_mods scaled_omnimods) +               ) +            ), +            (Html.div +               [ +                  (Html.Attributes.class "omnimod-defense-mods") +               ] +               (List.map +                  (\(k, v) -> +                     (Battle.View.DamageType.get_html +                        (Battle.Struct.DamageType.decode k) +                        v +                     ) +                  ) +                  (Battle.Struct.Omnimods.get_defense_mods omnimods) +               ) +            ), +            (Html.div +               [ +                  (Html.Attributes.class "omnimod-attributes-mods") +               ] +               (List.map +                  (\(k, v) -> +                     (Battle.View.Attribute.get_html +                        (Battle.Struct.Attributes.decode_category k) +                        v +                     ) +                  ) +                  (Battle.Struct.Omnimods.get_attribute_mods omnimods) +               ) +            ) +         ] +      ) | 


