summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-07-11 17:56:00 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-07-11 17:56:00 +0200
commit93b51e71e7009a286b6cf168bb59bcea1c83bd89 (patch)
treefb64151e76c1602e130ffb828f2d480a1a5b444f /src/battlemap/src/View/SubMenu/Timeline
parentf974d5b263140d8564d7e36ed8cfd0eac1734e2c (diff)
"Battlemap" -> "Battle".
Diffstat (limited to 'src/battlemap/src/View/SubMenu/Timeline')
-rw-r--r--src/battlemap/src/View/SubMenu/Timeline/Attack.elm164
-rw-r--r--src/battlemap/src/View/SubMenu/Timeline/Movement.elm62
-rw-r--r--src/battlemap/src/View/SubMenu/Timeline/PlayerDefeat.elm38
-rw-r--r--src/battlemap/src/View/SubMenu/Timeline/PlayerTurnStart.elm38
-rw-r--r--src/battlemap/src/View/SubMenu/Timeline/PlayerVictory.elm38
-rw-r--r--src/battlemap/src/View/SubMenu/Timeline/WeaponSwitch.elm58
6 files changed, 0 insertions, 398 deletions
diff --git a/src/battlemap/src/View/SubMenu/Timeline/Attack.elm b/src/battlemap/src/View/SubMenu/Timeline/Attack.elm
deleted file mode 100644
index 875bc89..0000000
--- a/src/battlemap/src/View/SubMenu/Timeline/Attack.elm
+++ /dev/null
@@ -1,164 +0,0 @@
-module View.SubMenu.Timeline.Attack exposing (get_html)
-
--- Elm -------------------------------------------------------------------------
-import Array
-
-import Html
-import Html.Attributes
---import Html.Events
-
--- Battlemap -------------------------------------------------------------------
-import Struct.Attack
-import Struct.Event
-import Struct.TurnResult
-import Struct.Character
-
-import View.Character
-
---------------------------------------------------------------------------------
--- LOCAL -----------------------------------------------------------------------
---------------------------------------------------------------------------------
-get_title_html : (
- Struct.Character.Type ->
- Struct.Character.Type ->
- (Html.Html Struct.Event.Type)
- )
-get_title_html attacker defender =
- (Html.div
- [
- (Html.Attributes.class "battlemap-timeline-attack-title")
- ]
- [
- (Html.text
- (
- (Struct.Character.get_name attacker)
- ++ " attacked "
- ++ (Struct.Character.get_name defender)
- ++ "!"
- )
- )
- ]
- )
-
-get_effect_text : Struct.Attack.Type -> String
-get_effect_text attack =
- (
- (
- case attack.precision of
- Struct.Attack.Hit -> " hit for "
- Struct.Attack.Graze -> " grazed for "
- Struct.Attack.Miss -> " missed."
- )
- ++
- (
- if (attack.precision == Struct.Attack.Miss)
- then
- ""
- else
- (
- ((toString attack.damage) ++ " damage")
- ++
- (
- if (attack.critical)
- then " (Critical Hit)."
- else "."
- )
- )
- )
- )
-
-get_attack_html : (
- Struct.Character.Type ->
- Struct.Character.Type ->
- Struct.Attack.Type ->
- (Html.Html Struct.Event.Type)
- )
-get_attack_html attacker defender attack =
- let
- attacker_name = (Struct.Character.get_name attacker)
- defender_name = (Struct.Character.get_name defender)
- in
- (Html.div
- []
- [
- (Html.text
- (
- case (attack.order, attack.parried) of
- (Struct.Attack.Counter, True) ->
- (
- defender_name
- ++ " attempted to strike back, but "
- ++ attacker_name
- ++ " parried, and "
- ++ (get_effect_text attack)
- )
-
- (Struct.Attack.Counter, _) ->
- (
- defender_name
- ++ " striked back, and "
- ++ (get_effect_text attack)
- )
-
- (_, True) ->
- (
- attacker_name
- ++ " attempted a hit, but "
- ++ defender_name
- ++ " parried, and "
- ++ (get_effect_text attack)
- )
-
- (_, _) ->
- (attacker_name ++ " " ++ (get_effect_text attack))
- )
- )
- ]
- )
-
---------------------------------------------------------------------------------
--- EXPORTED --------------------------------------------------------------------
---------------------------------------------------------------------------------
-get_html : (
- (Array.Array Struct.Character.Type) ->
- Int ->
- Struct.TurnResult.Attack ->
- (Html.Html Struct.Event.Type)
- )
-get_html characters player_ix attack =
- case
- (
- (Array.get attack.attacker_index characters),
- (Array.get attack.defender_index characters)
- )
- of
- ((Just atkchar), (Just defchar)) ->
- (Html.div
- [
- (Html.Attributes.class "battlemap-timeline-element"),
- (Html.Attributes.class "battlemap-timeline-attack")
- ]
- (
- [
- (View.Character.get_portrait_html player_ix atkchar),
- (View.Character.get_portrait_html player_ix defchar),
- (get_title_html atkchar defchar)
- ]
- ++
- (List.map
- (get_attack_html atkchar defchar)
- attack.sequence
- )
- )
- )
-
- _ ->
- (Html.div
- [
- (Html.Attributes.class "battlemap-timeline-element"),
- (Html.Attributes.class "battlemap-timeline-attack")
- ]
- [
- (Html.text "Error: Attack with unknown characters")
- ]
- )
diff --git a/src/battlemap/src/View/SubMenu/Timeline/Movement.elm b/src/battlemap/src/View/SubMenu/Timeline/Movement.elm
deleted file mode 100644
index 2f7acd3..0000000
--- a/src/battlemap/src/View/SubMenu/Timeline/Movement.elm
+++ /dev/null
@@ -1,62 +0,0 @@
-module View.SubMenu.Timeline.Movement exposing (get_html)
-
--- Elm -------------------------------------------------------------------------
-import Array
-
-import Html
-import Html.Attributes
---import Html.Events
-
--- Battlemap -------------------------------------------------------------------
-import Struct.Event
-import Struct.TurnResult
-import Struct.Character
-
-import View.Character
-
---------------------------------------------------------------------------------
--- LOCAL -----------------------------------------------------------------------
---------------------------------------------------------------------------------
-
---------------------------------------------------------------------------------
--- EXPORTED --------------------------------------------------------------------
---------------------------------------------------------------------------------
-get_html : (
- (Array.Array Struct.Character.Type) ->
- Int ->
- Struct.TurnResult.Movement ->
- (Html.Html Struct.Event.Type)
- )
-get_html characters player_ix movement =
- case (Array.get movement.character_index characters) of
- (Just char) ->
- (Html.div
- [
- (Html.Attributes.class "battlemap-timeline-element"),
- (Html.Attributes.class "battlemap-timeline-movement")
- ]
- [
- (View.Character.get_portrait_html player_ix char),
- (Html.text
- (
- (Struct.Character.get_name char)
- ++ " moved to ("
- ++ (toString movement.destination.x)
- ++ ", "
- ++ (toString movement.destination.y)
- ++ ")."
- )
- )
- ]
- )
-
- _ ->
- (Html.div
- [
- (Html.Attributes.class "battlemap-timeline-element"),
- (Html.Attributes.class "battlemap-timeline-movement")
- ]
- [
- (Html.text "Error: Moving with unknown character")
- ]
- )
diff --git a/src/battlemap/src/View/SubMenu/Timeline/PlayerDefeat.elm b/src/battlemap/src/View/SubMenu/Timeline/PlayerDefeat.elm
deleted file mode 100644
index 7bbff11..0000000
--- a/src/battlemap/src/View/SubMenu/Timeline/PlayerDefeat.elm
+++ /dev/null
@@ -1,38 +0,0 @@
-module View.SubMenu.Timeline.PlayerDefeat exposing (get_html)
-
--- Elm -------------------------------------------------------------------------
-import Html
-import Html.Attributes
---import Html.Events
-
--- Battlemap -------------------------------------------------------------------
-import Struct.Event
-import Struct.TurnResult
-
---------------------------------------------------------------------------------
--- LOCAL -----------------------------------------------------------------------
---------------------------------------------------------------------------------
-
---------------------------------------------------------------------------------
--- EXPORTED --------------------------------------------------------------------
---------------------------------------------------------------------------------
-get_html : (
- Struct.TurnResult.PlayerDefeat ->
- (Html.Html Struct.Event.Type)
- )
-get_html pdefeat =
- (Html.div
- [
- (Html.Attributes.class "battlemap-timeline-element"),
- (Html.Attributes.class "battlemap-timeline-player-defeat")
- ]
- [
- (Html.text
- (
- "Player "
- ++ (toString pdefeat.player_index)
- ++ " has been eliminated."
- )
- )
- ]
- )
diff --git a/src/battlemap/src/View/SubMenu/Timeline/PlayerTurnStart.elm b/src/battlemap/src/View/SubMenu/Timeline/PlayerTurnStart.elm
deleted file mode 100644
index 11f639e..0000000
--- a/src/battlemap/src/View/SubMenu/Timeline/PlayerTurnStart.elm
+++ /dev/null
@@ -1,38 +0,0 @@
-module View.SubMenu.Timeline.PlayerTurnStart exposing (get_html)
-
--- Elm -------------------------------------------------------------------------
-import Html
-import Html.Attributes
---import Html.Events
-
--- Battlemap -------------------------------------------------------------------
-import Struct.Event
-import Struct.TurnResult
-
---------------------------------------------------------------------------------
--- LOCAL -----------------------------------------------------------------------
---------------------------------------------------------------------------------
-
---------------------------------------------------------------------------------
--- EXPORTED --------------------------------------------------------------------
---------------------------------------------------------------------------------
-get_html : (
- Struct.TurnResult.PlayerTurnStart ->
- (Html.Html Struct.Event.Type)
- )
-get_html pturns =
- (Html.div
- [
- (Html.Attributes.class "battlemap-timeline-element"),
- (Html.Attributes.class "battlemap-timeline-turn-start")
- ]
- [
- (Html.text
- (
- "Player "
- ++ (toString pturns.player_index)
- ++ "'s turn has started."
- )
- )
- ]
- )
diff --git a/src/battlemap/src/View/SubMenu/Timeline/PlayerVictory.elm b/src/battlemap/src/View/SubMenu/Timeline/PlayerVictory.elm
deleted file mode 100644
index 77494b6..0000000
--- a/src/battlemap/src/View/SubMenu/Timeline/PlayerVictory.elm
+++ /dev/null
@@ -1,38 +0,0 @@
-module View.SubMenu.Timeline.PlayerVictory exposing (get_html)
-
--- Elm -------------------------------------------------------------------------
-import Html
-import Html.Attributes
---import Html.Events
-
--- Battlemap -------------------------------------------------------------------
-import Struct.Event
-import Struct.TurnResult
-
---------------------------------------------------------------------------------
--- LOCAL -----------------------------------------------------------------------
---------------------------------------------------------------------------------
-
---------------------------------------------------------------------------------
--- EXPORTED --------------------------------------------------------------------
---------------------------------------------------------------------------------
-get_html : (
- Struct.TurnResult.PlayerVictory ->
- (Html.Html Struct.Event.Type)
- )
-get_html pvict =
- (Html.div
- [
- (Html.Attributes.class "battlemap-timeline-element"),
- (Html.Attributes.class "battlemap-timeline-player-victory")
- ]
- [
- (Html.text
- (
- "Player "
- ++ (toString pvict.player_index)
- ++ " has won the battle."
- )
- )
- ]
- )
diff --git a/src/battlemap/src/View/SubMenu/Timeline/WeaponSwitch.elm b/src/battlemap/src/View/SubMenu/Timeline/WeaponSwitch.elm
deleted file mode 100644
index e66cfed..0000000
--- a/src/battlemap/src/View/SubMenu/Timeline/WeaponSwitch.elm
+++ /dev/null
@@ -1,58 +0,0 @@
-module View.SubMenu.Timeline.WeaponSwitch exposing (get_html)
-
--- Elm -------------------------------------------------------------------------
-import Array
-
-import Html
-import Html.Attributes
---import Html.Events
-
--- Battlemap -------------------------------------------------------------------
-import Struct.Event
-import Struct.TurnResult
-import Struct.Character
-
-import View.Character
-
---------------------------------------------------------------------------------
--- LOCAL -----------------------------------------------------------------------
---------------------------------------------------------------------------------
-
---------------------------------------------------------------------------------
--- EXPORTED --------------------------------------------------------------------
---------------------------------------------------------------------------------
-get_html : (
- (Array.Array Struct.Character.Type) ->
- Int ->
- Struct.TurnResult.WeaponSwitch ->
- (Html.Html Struct.Event.Type)
- )
-get_html characters player_ix weapon_switch =
- case (Array.get weapon_switch.character_index characters) of
- (Just char) ->
- (Html.div
- [
- (Html.Attributes.class "battlemap-timeline-element"),
- (Html.Attributes.class "battlemap-timeline-weapon-switch")
- ]
- [
- (View.Character.get_portrait_html player_ix char),
- (Html.text
- (
- (Struct.Character.get_name char)
- ++ " switched weapons."
- )
- )
- ]
- )
-
- _ ->
- (Html.div
- [
- (Html.Attributes.class "battlemap-timeline-element"),
- (Html.Attributes.class "battlemap-timeline-weapon-switch")
- ]
- [
- (Html.text "Error: Unknown character switched weapons")
- ]
- )