summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-08-10 18:23:48 +0200 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-08-10 18:23:48 +0200 |
commit | 120b0b7f6df0c8978aac9a423cbf8364feac4779 (patch) | |
tree | 9fd0b29790de37c8f3f6c786391a543d79b74164 /src/shared/battle | |
parent | 69611b72a28333c129ad25c3daae92b4215ac5d4 (diff) |
Statistics -> Attributes.
Diffstat (limited to 'src/shared/battle')
-rw-r--r-- | src/shared/battle/Battle/Lang/English.elm | 64 | ||||
-rw-r--r-- | src/shared/battle/Battle/Struct/Attributes.elm (renamed from src/shared/battle/Battle/Struct/Statistics.elm) | 2 | ||||
-rw-r--r-- | src/shared/battle/Battle/Struct/Omnimods.elm | 42 | ||||
-rw-r--r-- | src/shared/battle/Battle/View/Attribute.elm (renamed from src/shared/battle/Battle/View/Statistic.elm) | 136 | ||||
-rw-r--r-- | src/shared/battle/Battle/View/Help/Attribute.elm (renamed from src/shared/battle/Battle/View/Help/Statistic.elm) | 12 | ||||
-rw-r--r-- | src/shared/battle/Battle/View/Omnimods.elm | 20 |
6 files changed, 138 insertions, 138 deletions
diff --git a/src/shared/battle/Battle/Lang/English.elm b/src/shared/battle/Battle/Lang/English.elm index 2568260..d8b0254 100644 --- a/src/shared/battle/Battle/Lang/English.elm +++ b/src/shared/battle/Battle/Lang/English.elm @@ -6,7 +6,7 @@ import Html.Attributes import Html.Events -- Battle ---------------------------------------------------------------------- -import Battle.Struct.Statistics +import Battle.Struct.Attributes import Battle.Struct.DamageType -- Local Module ---------------------------------------------------------------- @@ -64,7 +64,7 @@ base : String base = "Universal Damage" -- Help ------------------------------------------------------------------------ ----- Statistics ---------------------------------------------------------------- +---- Attributes ---------------------------------------------------------------- max_health_help : (Html.Html Struct.Event.Type) max_health_help = (Html.div @@ -108,7 +108,7 @@ dodges_help = the opponent's """ ), - (get_stats_reference_html Battle.Struct.Statistics.Accuracy), + (get_atts_reference_html Battle.Struct.Attributes.Accuracy), (Html.text """. Multiply by two to get the chance of at least avoiding partially (taking only half damage) an attack. @@ -142,7 +142,7 @@ accuracy_help = (Html.text "Accuracy lowers the target's chance to evade an incoming blow (" ), - (get_stats_reference_html Battle.Struct.Statistics.Dodges), + (get_atts_reference_html Battle.Struct.Attributes.Dodges), (Html.text ").") ] ) @@ -192,17 +192,17 @@ damage_modifier_help = ] ) -get_stats_reference_html : ( - Battle.Struct.Statistics.Category -> +get_atts_reference_html : ( + Battle.Struct.Attributes.Category -> (Html.Html Struct.Event.Type) ) -get_stats_reference_html cat = +get_atts_reference_html cat = (Html.div [ (Html.Attributes.class "tooltip-reference"), (Html.Events.onClick (Struct.Event.RequestedHelp - (Struct.HelpRequest.Statistic cat) + (Struct.HelpRequest.Attribute cat) ) ) ] @@ -213,14 +213,14 @@ get_stats_reference_html cat = (Html.Attributes.class ( "omnimod-icon-" - ++ (Battle.Struct.Statistics.encode_category cat) + ++ (Battle.Struct.Attributes.encode_category cat) ) ) ] [ ] ), - (Html.text (get_statistic_name cat)) + (Html.text (get_attribute_name cat)) ] ) @@ -267,46 +267,46 @@ base_help = ] ) -get_statistic_name : Battle.Struct.Statistics.Category -> String -get_statistic_name cat = +get_attribute_name : Battle.Struct.Attributes.Category -> String +get_attribute_name cat = case cat of - Battle.Struct.Statistics.MaxHealth -> (max_health) - Battle.Struct.Statistics.MovementPoints -> (movement_points) - Battle.Struct.Statistics.Dodges -> (dodges) - Battle.Struct.Statistics.Parries -> (parries) - Battle.Struct.Statistics.Accuracy -> (accuracy) - Battle.Struct.Statistics.DoubleHits -> (double_hits) - Battle.Struct.Statistics.CriticalHits -> (critical_hits) - Battle.Struct.Statistics.DamageModifier -> (damage_modifier) - -get_statistic_category_help : ( - Battle.Struct.Statistics.Category -> + Battle.Struct.Attributes.MaxHealth -> (max_health) + Battle.Struct.Attributes.MovementPoints -> (movement_points) + Battle.Struct.Attributes.Dodges -> (dodges) + Battle.Struct.Attributes.Parries -> (parries) + Battle.Struct.Attributes.Accuracy -> (accuracy) + Battle.Struct.Attributes.DoubleHits -> (double_hits) + Battle.Struct.Attributes.CriticalHits -> (critical_hits) + Battle.Struct.Attributes.DamageModifier -> (damage_modifier) + +get_attribute_category_help : ( + Battle.Struct.Attributes.Category -> (String, (Html.Html Struct.Event.Type)) ) -get_statistic_category_help cat = +get_attribute_category_help cat = case cat of - Battle.Struct.Statistics.MaxHealth -> + Battle.Struct.Attributes.MaxHealth -> ((max_health), (max_health_help)) - Battle.Struct.Statistics.MovementPoints -> + Battle.Struct.Attributes.MovementPoints -> ((movement_points), (movement_points_help)) - Battle.Struct.Statistics.Dodges -> + Battle.Struct.Attributes.Dodges -> ((dodges), (dodges_help)) - Battle.Struct.Statistics.Parries -> + Battle.Struct.Attributes.Parries -> ((parries), (parries_help)) - Battle.Struct.Statistics.Accuracy -> + Battle.Struct.Attributes.Accuracy -> ((accuracy), (accuracy_help)) - Battle.Struct.Statistics.DoubleHits -> + Battle.Struct.Attributes.DoubleHits -> ((double_hits), (double_hits_help)) - Battle.Struct.Statistics.CriticalHits -> + Battle.Struct.Attributes.CriticalHits -> ((critical_hits), (critical_hits_help)) - Battle.Struct.Statistics.DamageModifier -> + Battle.Struct.Attributes.DamageModifier -> ((damage_modifier), (damage_modifier_help)) get_damage_type_help : ( diff --git a/src/shared/battle/Battle/Struct/Statistics.elm b/src/shared/battle/Battle/Struct/Attributes.elm index 8ed145a..159404e 100644 --- a/src/shared/battle/Battle/Struct/Statistics.elm +++ b/src/shared/battle/Battle/Struct/Attributes.elm @@ -1,4 +1,4 @@ -module Battle.Struct.Statistics exposing +module Battle.Struct.Attributes exposing ( Type, Category(..), diff --git a/src/shared/battle/Battle/Struct/Omnimods.elm b/src/shared/battle/Battle/Struct/Omnimods.elm index 92bf636..7a61153 100644 --- a/src/shared/battle/Battle/Struct/Omnimods.elm +++ b/src/shared/battle/Battle/Struct/Omnimods.elm @@ -4,10 +4,10 @@ module Battle.Struct.Omnimods exposing new, merge, none, - apply_to_statistics, + apply_to_attributes, get_attack_damage, get_damage_sum, - get_statistics_mods, + get_attribute_mods, get_attack_mods, get_defense_mods, get_all_mods, @@ -22,7 +22,7 @@ import Json.Decode import Json.Decode.Pipeline -- Battle ---------------------------------------------------------------------- -import Battle.Struct.Statistics +import Battle.Struct.Attributes import Battle.Struct.DamageType -------------------------------------------------------------------------------- @@ -30,7 +30,7 @@ import Battle.Struct.DamageType -------------------------------------------------------------------------------- type alias Type = { - statistics : (Dict.Dict String Int), + attributes : (Dict.Dict String Int), attack : (Dict.Dict String Int), defense : (Dict.Dict String Int) } @@ -84,7 +84,7 @@ decoder : (Json.Decode.Decoder Type) decoder = (Json.Decode.succeed Type - |> (Json.Decode.Pipeline.required "stam" generic_mods_decoder) + |> (Json.Decode.Pipeline.required "attm" generic_mods_decoder) |> (Json.Decode.Pipeline.required "atkm" generic_mods_decoder) |> (Json.Decode.Pipeline.required "defm" generic_mods_decoder) ) @@ -95,9 +95,9 @@ new : ( (List (String, Int)) -> Type ) -new statistic_mods attack_mods defense_mods = +new attribute_mods attack_mods defense_mods = { - statistics = (Dict.fromList statistic_mods), + attributes = (Dict.fromList attribute_mods), attack = (Dict.fromList attack_mods), defense = (Dict.fromList defense_mods) } @@ -105,7 +105,7 @@ new statistic_mods attack_mods defense_mods = none : Type none = { - statistics = (Dict.empty), + attributes = (Dict.empty), attack = (Dict.empty), defense = (Dict.empty) } @@ -113,24 +113,24 @@ none = merge : Type -> Type -> Type merge omni_a omni_b = { - statistics = (merge_mods omni_a.statistics omni_b.statistics), + attributes = (merge_mods omni_a.attributes omni_b.attributes), attack = (merge_mods omni_a.attack omni_b.attack), defense = (merge_mods omni_a.defense omni_b.defense) } -apply_to_statistics : ( +apply_to_attributes : ( Type -> - Battle.Struct.Statistics.Type -> - Battle.Struct.Statistics.Type + Battle.Struct.Attributes.Type -> + Battle.Struct.Attributes.Type ) -apply_to_statistics omnimods statistics = +apply_to_attributes omnimods attributes = (Dict.foldl ( - (Battle.Struct.Statistics.decode_category) - >> (Battle.Struct.Statistics.mod) + (Battle.Struct.Attributes.decode_category) + >> (Battle.Struct.Attributes.mod) ) - statistics - omnimods.statistics + attributes + omnimods.attributes ) get_damage_sum : Type -> Int @@ -177,14 +177,14 @@ get_attack_damage dmg_modifier atk_omni def_omni = scale : Float -> Type -> Type scale multiplier omnimods = {omnimods | - statistics = (Dict.map (scale_dict_value multiplier) omnimods.statistics), + attributes = (Dict.map (scale_dict_value multiplier) omnimods.attributes), attack = (Dict.map (scale_dict_value multiplier) omnimods.attack), defense = (Dict.map (scale_dict_value multiplier) omnimods.defense) } -get_statistics_mods : Type -> (List (String, Int)) -get_statistics_mods omnimods = (Dict.toList omnimods.statistics) +get_attribute_mods : Type -> (List (String, Int)) +get_attribute_mods omnimods = (Dict.toList omnimods.attributes) get_attack_mods : Type -> (List (String, Int)) get_attack_mods omnimods = (Dict.toList omnimods.attack) @@ -195,7 +195,7 @@ get_defense_mods omnimods = (Dict.toList omnimods.defense) get_all_mods : Type -> (List (String, Int)) get_all_mods omnimods = ( - (get_statistics_mods omnimods) + (get_attribute_mods omnimods) ++ (get_attack_mods omnimods) ++ (get_defense_mods omnimods) ) diff --git a/src/shared/battle/Battle/View/Statistic.elm b/src/shared/battle/Battle/View/Attribute.elm index 0ced0dc..ae2edf3 100644 --- a/src/shared/battle/Battle/View/Statistic.elm +++ b/src/shared/battle/Battle/View/Attribute.elm @@ -1,4 +1,4 @@ -module Battle.View.Statistic exposing +module Battle.View.Attribute exposing ( get_html, get_all_html, @@ -14,7 +14,7 @@ import Html.Attributes import Html.Events -- Battle ---------------------------------------------------------------------- -import Battle.Struct.Statistics +import Battle.Struct.Attributes -- Local Module ---------------------------------------------------------------- import Struct.Event @@ -28,16 +28,16 @@ import Struct.HelpRequest -- EXPORTED -------------------------------------------------------------------- -------------------------------------------------------------------------------- get_html : ( - Battle.Struct.Statistics.Category -> + Battle.Struct.Attributes.Category -> Int -> (Html.Html Struct.Event.Type) ) -get_html statistic value = +get_html attribute value = (Html.div [ (Html.Events.onClick (Struct.Event.RequestedHelp - (Struct.HelpRequest.Statistic statistic) + (Struct.HelpRequest.Attribute attribute) ) ) ] @@ -48,7 +48,7 @@ get_html statistic value = (Html.Attributes.class ( "omnimod-icon-" - ++ (Battle.Struct.Statistics.encode_category statistic) + ++ (Battle.Struct.Attributes.encode_category attribute) ) ) ] @@ -62,7 +62,7 @@ get_html statistic value = [ (Html.text ( - if (Battle.Struct.Statistics.is_percent statistic) + if (Battle.Struct.Attributes.is_percent attribute) then ((String.fromInt value) ++ "%") else (String.fromInt value) ) @@ -73,11 +73,11 @@ get_html statistic value = ) get_signed_html : ( - Battle.Struct.Statistics.Category -> + Battle.Struct.Attributes.Category -> Int -> (Html.Html Struct.Event.Type) ) -get_signed_html statistic value = +get_signed_html attribute value = (Html.div [ ( @@ -87,7 +87,7 @@ get_signed_html statistic value = ), (Html.Events.onClick (Struct.Event.RequestedHelp - (Struct.HelpRequest.Statistic statistic) + (Struct.HelpRequest.Attribute attribute) ) ) ] @@ -98,7 +98,7 @@ get_signed_html statistic value = (Html.Attributes.class ( "omnimod-icon-" - ++ (Battle.Struct.Statistics.encode_category statistic) + ++ (Battle.Struct.Attributes.encode_category attribute) ) ) ] @@ -119,7 +119,7 @@ get_signed_html statistic value = ) ++ ( - if (Battle.Struct.Statistics.is_percent statistic) + if (Battle.Struct.Attributes.is_percent attribute) then "%" else "" ) @@ -131,129 +131,129 @@ get_signed_html statistic value = ) get_all_html : ( - Battle.Struct.Statistics.Type -> + Battle.Struct.Attributes.Type -> (List (Html.Html Struct.Event.Type)) ) -get_all_html stats = +get_all_html atts = [ (get_html - Battle.Struct.Statistics.Dodges - (Battle.Struct.Statistics.get_dodges stats) + Battle.Struct.Attributes.Dodges + (Battle.Struct.Attributes.get_dodges atts) ), (get_html - Battle.Struct.Statistics.Parries - (Battle.Struct.Statistics.get_parries stats) + Battle.Struct.Attributes.Parries + (Battle.Struct.Attributes.get_parries atts) ), (get_html - Battle.Struct.Statistics.Accuracy - (Battle.Struct.Statistics.get_accuracy stats) + Battle.Struct.Attributes.Accuracy + (Battle.Struct.Attributes.get_accuracy atts) ), (get_html - Battle.Struct.Statistics.DoubleHits - (Battle.Struct.Statistics.get_double_hits stats) + Battle.Struct.Attributes.DoubleHits + (Battle.Struct.Attributes.get_double_hits atts) ), (get_html - Battle.Struct.Statistics.CriticalHits - (Battle.Struct.Statistics.get_critical_hits stats) + Battle.Struct.Attributes.CriticalHits + (Battle.Struct.Attributes.get_critical_hits atts) ), (get_html - Battle.Struct.Statistics.MaxHealth - (Battle.Struct.Statistics.get_max_health stats) + Battle.Struct.Attributes.MaxHealth + (Battle.Struct.Attributes.get_max_health atts) ), (get_html - Battle.Struct.Statistics.MovementPoints - (Battle.Struct.Statistics.get_movement_points stats) + Battle.Struct.Attributes.MovementPoints + (Battle.Struct.Attributes.get_movement_points atts) ) ] get_all_signed_html : ( - Battle.Struct.Statistics.Type -> + Battle.Struct.Attributes.Type -> (List (Html.Html Struct.Event.Type)) ) -get_all_signed_html stats = +get_all_signed_html atts = [ (get_signed_html - Battle.Struct.Statistics.Dodges - (Battle.Struct.Statistics.get_dodges stats) + Battle.Struct.Attributes.Dodges + (Battle.Struct.Attributes.get_dodges atts) ), (get_signed_html - Battle.Struct.Statistics.Parries - (Battle.Struct.Statistics.get_parries stats) + Battle.Struct.Attributes.Parries + (Battle.Struct.Attributes.get_parries atts) ), (get_signed_html - Battle.Struct.Statistics.Accuracy - (Battle.Struct.Statistics.get_accuracy stats) + Battle.Struct.Attributes.Accuracy + (Battle.Struct.Attributes.get_accuracy atts) ), (get_signed_html - Battle.Struct.Statistics.DoubleHits - (Battle.Struct.Statistics.get_double_hits stats) + Battle.Struct.Attributes.DoubleHits + (Battle.Struct.Attributes.get_double_hits atts) ), (get_signed_html - Battle.Struct.Statistics.CriticalHits - (Battle.Struct.Statistics.get_critical_hits stats) + Battle.Struct.Attributes.CriticalHits + (Battle.Struct.Attributes.get_critical_hits atts) ), (get_signed_html - Battle.Struct.Statistics.MaxHealth - (Battle.Struct.Statistics.get_max_health stats) + Battle.Struct.Attributes.MaxHealth + (Battle.Struct.Attributes.get_max_health atts) ), (get_signed_html - Battle.Struct.Statistics.MovementPoints - (Battle.Struct.Statistics.get_movement_points stats) + Battle.Struct.Attributes.MovementPoints + (Battle.Struct.Attributes.get_movement_points atts) ) ] get_all_but_gauges_html : ( - Battle.Struct.Statistics.Type -> + Battle.Struct.Attributes.Type -> (List (Html.Html Struct.Event.Type)) ) -get_all_but_gauges_html stats = +get_all_but_gauges_html atts = [ (get_html - Battle.Struct.Statistics.Dodges - (Battle.Struct.Statistics.get_dodges stats) + Battle.Struct.Attributes.Dodges + (Battle.Struct.Attributes.get_dodges atts) ), (get_html - Battle.Struct.Statistics.Parries - (Battle.Struct.Statistics.get_parries stats) + Battle.Struct.Attributes.Parries + (Battle.Struct.Attributes.get_parries atts) ), (get_html - Battle.Struct.Statistics.Accuracy - (Battle.Struct.Statistics.get_accuracy stats) + Battle.Struct.Attributes.Accuracy + (Battle.Struct.Attributes.get_accuracy atts) ), (get_html - Battle.Struct.Statistics.DoubleHits - (Battle.Struct.Statistics.get_double_hits stats) + Battle.Struct.Attributes.DoubleHits + (Battle.Struct.Attributes.get_double_hits atts) ), (get_html - Battle.Struct.Statistics.CriticalHits - (Battle.Struct.Statistics.get_critical_hits stats) + Battle.Struct.Attributes.CriticalHits + (Battle.Struct.Attributes.get_critical_hits atts) ) ] get_all_but_gauges_signed_html : ( - Battle.Struct.Statistics.Type -> + Battle.Struct.Attributes.Type -> (List (Html.Html Struct.Event.Type)) ) -get_all_but_gauges_signed_html stats = +get_all_but_gauges_signed_html atts = [ (get_signed_html - Battle.Struct.Statistics.Dodges - (Battle.Struct.Statistics.get_dodges stats) + Battle.Struct.Attributes.Dodges + (Battle.Struct.Attributes.get_dodges atts) ), (get_signed_html - Battle.Struct.Statistics.Parries - (Battle.Struct.Statistics.get_parries stats) + Battle.Struct.Attributes.Parries + (Battle.Struct.Attributes.get_parries atts) ), (get_signed_html - Battle.Struct.Statistics.Accuracy - (Battle.Struct.Statistics.get_accuracy stats) + Battle.Struct.Attributes.Accuracy + (Battle.Struct.Attributes.get_accuracy atts) ), (get_signed_html - Battle.Struct.Statistics.DoubleHits - (Battle.Struct.Statistics.get_double_hits stats) + Battle.Struct.Attributes.DoubleHits + (Battle.Struct.Attributes.get_double_hits atts) ), (get_signed_html - Battle.Struct.Statistics.CriticalHits - (Battle.Struct.Statistics.get_critical_hits stats) + Battle.Struct.Attributes.CriticalHits + (Battle.Struct.Attributes.get_critical_hits atts) ) ] diff --git a/src/shared/battle/Battle/View/Help/Statistic.elm b/src/shared/battle/Battle/View/Help/Attribute.elm index 0e1f056..f7bd9e1 100644 --- a/src/shared/battle/Battle/View/Help/Statistic.elm +++ b/src/shared/battle/Battle/View/Help/Attribute.elm @@ -1,11 +1,11 @@ -module Battle.View.Help.Statistic exposing (get_html_contents) +module Battle.View.Help.Attribute exposing (get_html_contents) -- Elm ------------------------------------------------------------------------- import Html import Html.Attributes -- Battle ---------------------------------------------------------------------- -import Battle.Struct.Statistics +import Battle.Struct.Attributes import Battle.Lang.English -- Local Module ---------------------------------------------------------------- @@ -15,7 +15,7 @@ import Struct.Event -- LOCAL ----------------------------------------------------------------------- -------------------------------------------------------------------------------- get_header_html : ( - Battle.Struct.Statistics.Category -> + Battle.Struct.Attributes.Category -> String -> (Html.Html Struct.Event.Type) ) @@ -34,7 +34,7 @@ get_header_html cat name = (Html.Attributes.class ( "omnimod-icon-" - ++ (Battle.Struct.Statistics.encode_category cat) + ++ (Battle.Struct.Attributes.encode_category cat) ) ) ] @@ -49,12 +49,12 @@ get_header_html cat name = -- EXPORTED -------------------------------------------------------------------- -------------------------------------------------------------------------------- get_html_contents : ( - Battle.Struct.Statistics.Category -> + Battle.Struct.Attributes.Category -> (List (Html.Html Struct.Event.Type)) ) get_html_contents cat = let - (name, tooltip) = (Battle.Lang.English.get_statistic_category_help cat) + (name, tooltip) = (Battle.Lang.English.get_attribute_category_help cat) in [ (get_header_html cat name), diff --git a/src/shared/battle/Battle/View/Omnimods.elm b/src/shared/battle/Battle/View/Omnimods.elm index a41afba..8d8c4ce 100644 --- a/src/shared/battle/Battle/View/Omnimods.elm +++ b/src/shared/battle/Battle/View/Omnimods.elm @@ -14,10 +14,10 @@ import Html.Events -- Battle ---------------------------------------------------------------------- import Battle.Struct.DamageType import Battle.Struct.Omnimods -import Battle.Struct.Statistics +import Battle.Struct.Attributes import Battle.View.DamageType -import Battle.View.Statistic +import Battle.View.Attribute -- Local Module ---------------------------------------------------------------- import Struct.Event @@ -70,16 +70,16 @@ get_html_with_modifier attack_multiplier omnimods = ), (Html.div [ - (Html.Attributes.class "omnimod-statistics-mods") + (Html.Attributes.class "omnimod-attribute-mods") ] (List.map (\(k, v) -> - (Battle.View.Statistic.get_signed_html - (Battle.Struct.Statistics.decode_category k) + (Battle.View.Attribute.get_signed_html + (Battle.Struct.Attributes.decode_category k) v ) ) - (Battle.Struct.Omnimods.get_statistics_mods omnimods) + (Battle.Struct.Omnimods.get_attribute_mods omnimods) ) ) ] @@ -122,16 +122,16 @@ get_html omnimods = ), (Html.div [ - (Html.Attributes.class "omnimod-statistics-mods") + (Html.Attributes.class "omnimod-attributes-mods") ] (List.map (\(k, v) -> - (Battle.View.Statistic.get_signed_html - (Battle.Struct.Statistics.decode_category k) + (Battle.View.Attribute.get_signed_html + (Battle.Struct.Attributes.decode_category k) v ) ) - (Battle.Struct.Omnimods.get_statistics_mods omnimods) + (Battle.Struct.Omnimods.get_attribute_mods omnimods) ) ) ] |