summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-05-29 20:26:01 +0200 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-05-29 20:26:01 +0200 |
commit | b0ef49dd94ed0c20a82d0a6094c3e4399c83bd64 (patch) | |
tree | 2ef27df721029f75d13341b8237b4a7293264029 /src/battle/src/View | |
parent | d35c5a2213bdc13cfdcd5dc15dbe5000b655ea25 (diff) |
Updates attack elements in timeline and message board.
Diffstat (limited to 'src/battle/src/View')
-rw-r--r-- | src/battle/src/View/MessageBoard/Attack.elm | 96 | ||||
-rw-r--r-- | src/battle/src/View/SubMenu/Timeline/Attack.elm | 6 |
2 files changed, 49 insertions, 53 deletions
diff --git a/src/battle/src/View/MessageBoard/Attack.elm b/src/battle/src/View/MessageBoard/Attack.elm index e589bab..3d2281f 100644 --- a/src/battle/src/View/MessageBoard/Attack.elm +++ b/src/battle/src/View/MessageBoard/Attack.elm @@ -94,16 +94,16 @@ get_attack_html attacker defender attack = (Struct.Attack.Counter, _) -> ( - defender_name + attacker_name ++ " striked back, and " ++ (get_effect_text attack) ) (_, True) -> ( - attacker_name + defender_name ++ " attempted a hit, but " - ++ defender_name + ++ attacker_name ++ " parried, and " ++ (get_effect_text attack) ) @@ -153,29 +153,27 @@ get_attacker_card : ( ) get_attacker_card attack char = (Html.div - [ - (Html.Attributes.class - (case (attack.order, attack.parried) of - (Struct.Attack.Counter, True) -> - (get_attack_animation_class attack char) - - (Struct.Attack.Counter, _) -> - (get_defense_animation_class attack char) - - (_, True) -> - (get_defense_animation_class attack char) - - (_, _) -> - (get_attack_animation_class attack char) - ) - ), - (Html.Attributes.class "animated-portrait"), + ( + (Html.Attributes.class "animated-portrait") + :: ( - if (attack.order == Struct.Attack.Counter) - then (Html.Attributes.class "initial-target") - else (Html.Attributes.class "initial-attacker") + if ((attack.order == Struct.Attack.Counter) == attack.parried) + then + [ + (Html.Attributes.class + (get_attack_animation_class attack char) + ), + (Html.Attributes.class "initial-attacker") + ] + else + [ + (Html.Attributes.class + (get_defense_animation_class attack char) + ), + (Html.Attributes.class "initial-target") + ] ) - ] + ) [ (View.Controlled.CharacterCard.get_minimal_html (Struct.Character.get_player_index char) @@ -191,29 +189,27 @@ get_defender_card : ( ) get_defender_card attack char = (Html.div - [ - (Html.Attributes.class - (case (attack.order, attack.parried) of - (Struct.Attack.Counter, True) -> - (get_defense_animation_class attack char) - - (Struct.Attack.Counter, _) -> - (get_attack_animation_class attack char) - - (_, True) -> - (get_attack_animation_class attack char) - - (_, _) -> - (get_defense_animation_class attack char) - ) - ), - (Html.Attributes.class "animated-portrait"), + ( + (Html.Attributes.class "animated-portrait") + :: ( - if (attack.order == Struct.Attack.Counter) - then (Html.Attributes.class "initial-attacker") - else (Html.Attributes.class "initial-target") + if ((attack.order == Struct.Attack.Counter) == attack.parried) + then + [ + (Html.Attributes.class + (get_defense_animation_class attack char) + ), + (Html.Attributes.class "initial-target") + ] + else + [ + (Html.Attributes.class + (get_attack_animation_class attack char) + ), + (Html.Attributes.class "initial-attacker") + ] ) - ] + ) [ (View.Controlled.CharacterCard.get_minimal_html -1 char) ] @@ -240,18 +236,18 @@ get_placeholder_html characters attacker_ix defender_ix attack = (Html.Attributes.class "message-attack") ] ( - if (attack.order == Struct.Attack.Counter) + if ((attack.order == Struct.Attack.Counter) == attack.parried) then [ - (get_defender_card attack defchar), + (get_attacker_card attack atkchar), (get_attack_html atkchar defchar attack), - (get_attacker_card attack atkchar) + (get_defender_card attack defchar) ] else [ - (get_attacker_card attack atkchar), + (get_defender_card attack defchar), (get_attack_html atkchar defchar attack), - (get_defender_card attack defchar) + (get_attacker_card attack atkchar) ] ) ) diff --git a/src/battle/src/View/SubMenu/Timeline/Attack.elm b/src/battle/src/View/SubMenu/Timeline/Attack.elm index 9295951..1899ab4 100644 --- a/src/battle/src/View/SubMenu/Timeline/Attack.elm +++ b/src/battle/src/View/SubMenu/Timeline/Attack.elm @@ -108,16 +108,16 @@ get_attack_html attacker defender attack = (Struct.Attack.Counter, _) -> ( - defender_name + attacker_name ++ " striked back, and " ++ (get_effect_text attack) ) (_, True) -> ( - attacker_name + defender_name ++ " attempted a hit, but " - ++ defender_name + ++ attacker_name ++ " parried, and " ++ (get_effect_text attack) ) |