summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-05-29 17:48:47 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-05-29 17:48:47 +0200
commitd35c5a2213bdc13cfdcd5dc15dbe5000b655ea25 (patch)
treee46ee2802ebb992a6a23ba57be468d7ccc91a81e /src/battle/src/View
parent9193b4b42310f6d5712373a4adcb95375e3699e9 (diff)
Restores the message board attack displays.
Diffstat (limited to 'src/battle/src/View')
-rw-r--r--src/battle/src/View/MessageBoard/Attack.elm41
1 files changed, 30 insertions, 11 deletions
diff --git a/src/battle/src/View/MessageBoard/Attack.elm b/src/battle/src/View/MessageBoard/Attack.elm
index 041b3e3..e589bab 100644
--- a/src/battle/src/View/MessageBoard/Attack.elm
+++ b/src/battle/src/View/MessageBoard/Attack.elm
@@ -15,6 +15,7 @@ import Struct.Battle
import Struct.Character
import Struct.Event
import Struct.Model
+import Struct.TurnResult
import View.Controlled.CharacterCard
@@ -168,7 +169,12 @@ get_attacker_card 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")
+ )
]
[
(View.Controlled.CharacterCard.get_minimal_html
@@ -201,7 +207,12 @@ get_defender_card 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")
+ )
]
[
(View.Controlled.CharacterCard.get_minimal_html -1 char)
@@ -229,11 +240,19 @@ get_placeholder_html characters attacker_ix defender_ix attack =
(Html.Attributes.class "message-attack")
]
(
- [
- (get_attacker_card attack atkchar),
- (get_attack_html atkchar defchar attack),
- (get_defender_card attack defchar)
- ]
+ if (attack.order == Struct.Attack.Counter)
+ then
+ [
+ (get_defender_card attack defchar),
+ (get_attack_html atkchar defchar attack),
+ (get_attacker_card attack atkchar)
+ ]
+ else
+ [
+ (get_attacker_card attack atkchar),
+ (get_attack_html atkchar defchar attack),
+ (get_defender_card attack defchar)
+ ]
)
)
@@ -250,13 +269,13 @@ get_placeholder_html characters attacker_ix defender_ix attack =
--------------------------------------------------------------------------------
get_html : (
Struct.Model.Type ->
- Struct.Attack.Type ->
+ Struct.TurnResult.Attack ->
(Html.Html Struct.Event.Type)
)
get_html model attack =
(get_placeholder_html
(Struct.Battle.get_characters model.battle)
- 0 -- TODO: get attacker IX
- 0 -- TODO: get defender IX
- attack
+ (Struct.TurnResult.get_attack_actor_index attack)
+ (Struct.TurnResult.get_attack_target_index attack)
+ (Struct.TurnResult.get_attack_data attack)
)