summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/battle')
-rw-r--r--src/battle/src/Constants/DisplayEffects.elm2
-rw-r--r--src/battle/src/ElmModule/Update.elm22
-rw-r--r--src/battle/src/Struct/CharacterTurn.elm42
-rw-r--r--src/battle/src/Struct/Event.elm3
-rw-r--r--src/battle/src/Struct/Navigator.elm2
-rw-r--r--src/battle/src/Struct/PuppeteerAction.elm38
-rw-r--r--src/battle/src/Struct/TurnResult.elm58
-rw-r--r--src/battle/src/Struct/UI.elm8
-rw-r--r--src/battle/src/Update/Character/DisplayCharacterInfo.elm35
-rw-r--r--src/battle/src/Update/Character/DisplayInfo.elm7
-rw-r--r--src/battle/src/Update/Character/DisplayNavigator.elm10
-rw-r--r--src/battle/src/Update/Character/ScrollTo.elm14
-rw-r--r--src/battle/src/Update/CharacterTurn/RequestDirection.elm45
-rw-r--r--src/battle/src/Update/CharacterTurn/SwitchWeapon.elm25
-rw-r--r--src/battle/src/Update/SelectCharacter.elm2
-rw-r--r--src/battle/src/Update/SelectTile.elm6
-rw-r--r--src/battle/src/View/Character.elm4
-rw-r--r--src/battle/src/View/SubMenu.elm25
-rw-r--r--src/battle/src/View/SubMenu/CharacterStatus.elm (renamed from src/battle/src/View/SubMenu/Status/CharacterInfo.elm)2
-rw-r--r--src/battle/src/View/SubMenu/Characters.elm4
-rw-r--r--src/battle/src/View/SubMenu/Status.elm62
-rw-r--r--src/battle/src/View/SubMenu/Timeline.elm4
-rw-r--r--src/battle/src/View/SubMenu/Timeline/Attack.elm20
23 files changed, 209 insertions, 231 deletions
diff --git a/src/battle/src/Constants/DisplayEffects.elm b/src/battle/src/Constants/DisplayEffects.elm
index 2b02163..366c4e5 100644
--- a/src/battle/src/Constants/DisplayEffects.elm
+++ b/src/battle/src/Constants/DisplayEffects.elm
@@ -19,7 +19,7 @@ ally : String
ally = "ally"
enemy : String
-enemy = "ally"
+enemy = "enemy"
in_team : String
in_team = "team-"
diff --git a/src/battle/src/ElmModule/Update.elm b/src/battle/src/ElmModule/Update.elm
index c6c7ae3..cc9b9b8 100644
--- a/src/battle/src/ElmModule/Update.elm
+++ b/src/battle/src/ElmModule/Update.elm
@@ -1,5 +1,10 @@
module ElmModule.Update exposing (update)
+-- Elm -------------------------------------------------------------------------
+
+-- Shared ----------------------------------------------------------------------
+import Shared.Update.Sequence
+
-- Local Module ----------------------------------------------------------------
import Struct.Event
import Struct.Model
@@ -11,8 +16,8 @@ import Update.SelectCharacterOrTile
import Update.SelectTile
import Update.SetRequestedHelp
-import Update.Character.DisplayCharacterInfo
-import Update.Character.LookForCharacter
+import Update.Character.ScrollTo
+import Update.Character.DisplayNavigator
import Update.CharacterTurn.AbortTurn
import Update.CharacterTurn.Attack
@@ -65,11 +70,14 @@ update event model =
(Struct.Event.CharacterSelected char_id) ->
(Update.SelectCharacter.apply_to char_id model)
- (Struct.Event.CharacterInfoRequested char_id) ->
- (Update.Character.DisplayCharacterInfo.apply_to char_id model)
-
- (Struct.Event.LookingForCharacter char_id) ->
- (Update.Character.LookForCharacter.apply_to char_id model)
+ (Struct.Event.CharacterCardSelected char_id) ->
+ (Shared.Update.Sequence.sequence
+ [
+ (Update.Character.ScrollTo.apply_to_ref char_id),
+ (Update.Character.DisplayNavigator.apply_to_ref char_id)
+ ]
+ model
+ )
Struct.Event.TurnEnded ->
(Update.CharacterTurn.EndTurn.apply_to model)
diff --git a/src/battle/src/Struct/CharacterTurn.elm b/src/battle/src/Struct/CharacterTurn.elm
index decdab1..514803d 100644
--- a/src/battle/src/Struct/CharacterTurn.elm
+++ b/src/battle/src/Struct/CharacterTurn.elm
@@ -271,37 +271,23 @@ clear_path ct = {ct | path = []}
encode : Type -> (Json.Encode.Value)
encode ct =
case ct.active_character of
- Nothing ->
- (Json.Encode.object
- [
- ("cix", (Json.Encode.int 0)),
- ("act", (Json.Encode.list (\a -> a) []))
- ]
- )
+ Nothing -> (Json.Encode.list (\a -> a) [])
(Just actor) ->
- (Json.Encode.object
- [
- ("cix", (Json.Encode.int (Struct.Character.get_index actor))),
+ (Json.Encode.list
+ (\a -> a)
+ (
(
- "act",
- (Json.Encode.list
- (\a -> a)
- (
- (
- if (List.isEmpty (get_path ct))
- then [(encode_path ct)]
- else []
- )
- ++
- (
- if (ct.action == None)
- then []
- else [(encode_action ct)]
- )
- )
- )
+ if (List.isEmpty (get_path ct))
+ then []
+ else [(encode_path ct)]
)
- ]
+ ++
+ (
+ if (ct.action == None)
+ then []
+ else [(encode_action ct)]
+ )
+ )
)
diff --git a/src/battle/src/Struct/Event.elm b/src/battle/src/Struct/Event.elm
index 1f5c89f..950b00d 100644
--- a/src/battle/src/Struct/Event.elm
+++ b/src/battle/src/Struct/Event.elm
@@ -20,13 +20,12 @@ type Type =
AbortTurnRequest
| AnimationEnded
| AttackRequest
- | CharacterInfoRequested Int
| CharacterOrTileSelected BattleMap.Struct.Location.Ref
| CharacterSelected Int
+ | CharacterCardSelected Int
| DirectionRequested BattleMap.Struct.Direction.Type
| Failed Struct.Error.Type
| GoToMainMenu
- | LookingForCharacter Int
| None
| RequestedHelp Struct.HelpRequest.Type
| ScaleChangeRequested Float
diff --git a/src/battle/src/Struct/Navigator.elm b/src/battle/src/Struct/Navigator.elm
index 01ee47a..537351a 100644
--- a/src/battle/src/Struct/Navigator.elm
+++ b/src/battle/src/Struct/Navigator.elm
@@ -11,8 +11,8 @@ module Struct.Navigator exposing
get_summary,
clear_path,
lock_path,
- unlock_path,
lock_path_with_new_attack_ranges,
+ unlock_path,
maybe_add_step,
maybe_get_path_to
)
diff --git a/src/battle/src/Struct/PuppeteerAction.elm b/src/battle/src/Struct/PuppeteerAction.elm
index 9627cae..cc55cee 100644
--- a/src/battle/src/Struct/PuppeteerAction.elm
+++ b/src/battle/src/Struct/PuppeteerAction.elm
@@ -54,18 +54,14 @@ from_attacked attack =
(RefreshCharacter (False, defender_ix))
]
),
- (PerformFor (2.0, [(Focus attacker_ix)])),
- (PerformFor (2.0, [(Focus defender_ix)]))
- ]
- ++
- (List.map
- (\hit->
- (PerformFor (5.0, [(Hit hit)]))
- )
- (Struct.TurnResult.get_attack_sequence attack)
- )
- ++
- [
+ (PerformFor
+ (
+ 5.0,
+ [
+ (Hit (Struct.TurnResult.get_attack_data attack))
+ ]
+ )
+ ),
(Perform
[
(RefreshCharacter (True, attacker_ix)),
@@ -75,6 +71,23 @@ from_attacked attack =
]
)
+from_targeted : Struct.TurnResult.Target -> (List Type)
+from_targeted target =
+ [
+ (PerformFor
+ (
+ 2.0,
+ [(Focus (Struct.TurnResult.get_target_actor_index target))]
+ )
+ ),
+ (PerformFor
+ (
+ 2.0,
+ [(Focus (Struct.TurnResult.get_target_target_index target))]
+ )
+ )
+ ]
+
from_moved : Struct.TurnResult.Movement -> (List Type)
from_moved movement =
let actor_ix = (Struct.TurnResult.get_movement_actor_index movement) in
@@ -175,6 +188,7 @@ from_turn_result : Struct.TurnResult.Type -> (List Type)
from_turn_result turn_result =
case turn_result of
(Struct.TurnResult.Moved movement) -> (from_moved movement)
+ (Struct.TurnResult.Targeted target) -> (from_targeted target)
(Struct.TurnResult.Attacked attack) -> (from_attacked attack)
(Struct.TurnResult.SwitchedWeapon weapon_switch) ->
(from_switched_weapon weapon_switch)
diff --git a/src/battle/src/Struct/TurnResult.elm b/src/battle/src/Struct/TurnResult.elm
index d5d43ad..ef70082 100644
--- a/src/battle/src/Struct/TurnResult.elm
+++ b/src/battle/src/Struct/TurnResult.elm
@@ -2,6 +2,7 @@ module Struct.TurnResult exposing
(
Type(..),
Attack,
+ Target,
Movement,
WeaponSwitch,
PlayerVictory,
@@ -15,7 +16,9 @@ module Struct.TurnResult exposing
get_movement_path,
get_attack_actor_index,
get_attack_target_index,
- get_attack_sequence,
+ get_attack_data,
+ get_target_actor_index,
+ get_target_target_index,
decoder
)
@@ -52,11 +55,17 @@ type alias Movement =
destination : BattleMap.Struct.Location.Type
}
+type alias Target =
+ {
+ actor_index : Int,
+ target_index : Int
+ }
+
type alias Attack =
{
attacker_index : Int,
defender_index : Int,
- sequence : (List Struct.Attack.Type),
+ data : Struct.Attack.Type,
attacker_luck : Int,
defender_luck : Int
}
@@ -83,6 +92,7 @@ type alias PlayerTurnStart =
type Type =
Moved Movement
+ | Targeted Target
| Attacked Attack
| SwitchedWeapon WeaponSwitch
| PlayerWon PlayerVictory
@@ -101,15 +111,29 @@ movement_decoder =
(Json.Decode.field "nlc" (BattleMap.Struct.Location.decoder))
)
-attack_decoder : (Json.Decode.Decoder Attack)
-attack_decoder =
- (Json.Decode.map5
- Attack
+target_decoder : (Json.Decode.Decoder Target)
+target_decoder =
+ (Json.Decode.map2
+ Target
(Json.Decode.field "aix" Json.Decode.int)
(Json.Decode.field "dix" Json.Decode.int)
- (Json.Decode.field "seq" (Json.Decode.list (Struct.Attack.decoder)))
- (Json.Decode.field "alk" Json.Decode.int)
- (Json.Decode.field "dlk" Json.Decode.int)
+ )
+
+attack_decoder : (Json.Decode.Decoder Attack)
+attack_decoder =
+ (Json.Decode.andThen
+ (
+ \attack ->
+ (Json.Decode.map5
+ Attack
+ (Json.Decode.field "aix" Json.Decode.int)
+ (Json.Decode.field "dix" Json.Decode.int)
+ (Json.Decode.succeed attack)
+ (Json.Decode.field "alk" Json.Decode.int)
+ (Json.Decode.field "dlk" Json.Decode.int)
+ )
+ )
+ (Struct.Attack.decoder)
)
weapon_switch_decoder : (Json.Decode.Decoder WeaponSwitch)
@@ -161,6 +185,12 @@ internal_decoder kind =
(attack_decoder)
)
+ "tar" ->
+ (Json.Decode.map
+ (\x -> (Targeted x))
+ (target_decoder)
+ )
+
"pwo" ->
(Json.Decode.map
(\x -> (PlayerWon x))
@@ -219,5 +249,11 @@ get_attack_actor_index attack = attack.attacker_index
get_attack_target_index : Attack -> Int
get_attack_target_index attack = attack.defender_index
-get_attack_sequence : Attack -> (List Struct.Attack.Type)
-get_attack_sequence attack = attack.sequence
+get_attack_data : Attack -> Struct.Attack.Type
+get_attack_data attack = attack.data
+
+get_target_actor_index : Target -> Int
+get_target_actor_index target = target.actor_index
+
+get_target_target_index : Target -> Int
+get_target_target_index target = target.target_index
diff --git a/src/battle/src/Struct/UI.elm b/src/battle/src/Struct/UI.elm
index 6f6a48e..78469dc 100644
--- a/src/battle/src/Struct/UI.elm
+++ b/src/battle/src/Struct/UI.elm
@@ -41,7 +41,8 @@ import Struct.Navigator
-- TYPES -----------------------------------------------------------------------
--------------------------------------------------------------------------------
type Tab =
- StatusTab
+ TileStatusTab BattleMap.Struct.Location.Ref
+ | CharacterStatusTab Int
| CharactersTab
| SettingsTab
| TimelineTab
@@ -101,14 +102,15 @@ reset_displayed_tab ui = {ui | displayed_tab = Nothing}
tab_to_string : Tab -> String
tab_to_string tab =
case tab of
- StatusTab -> "Status"
+ (TileStatusTab _) -> "Status"
+ (CharacterStatusTab _) -> "Status"
CharactersTab -> "Characters"
SettingsTab -> "Settings"
TimelineTab -> "Timeline"
get_all_tabs : (List Tab)
get_all_tabs =
- [StatusTab, CharactersTab, SettingsTab, TimelineTab]
+ [CharactersTab, SettingsTab, TimelineTab]
-- Navigator -------------------------------------------------------------------
maybe_get_displayed_navigator : Type -> (Maybe Struct.Navigator.Type)
diff --git a/src/battle/src/Update/Character/DisplayCharacterInfo.elm b/src/battle/src/Update/Character/DisplayCharacterInfo.elm
deleted file mode 100644
index aa2e29a..0000000
--- a/src/battle/src/Update/Character/DisplayCharacterInfo.elm
+++ /dev/null
@@ -1,35 +0,0 @@
-module Update.Character.DisplayCharacterInfo exposing (apply_to)
-
--- Elm -------------------------------------------------------------------------
-
--- Local Module ----------------------------------------------------------------
-import Struct.Event
-import Struct.Model
-import Struct.UI
-
---------------------------------------------------------------------------------
--- LOCAL -----------------------------------------------------------------------
---------------------------------------------------------------------------------
-
---------------------------------------------------------------------------------
--- EXPORTED --------------------------------------------------------------------
---------------------------------------------------------------------------------
-apply_to : (
- Int ->
- Struct.Model.Type ->
- (Struct.Model.Type, (Cmd Struct.Event.Type))
- )
-apply_to target_ref model =
- (
- {model |
- ui =
- (Struct.UI.set_displayed_tab
- Struct.UI.StatusTab
- (Struct.UI.set_previous_action
- (Just (Struct.UI.SelectedCharacter target_ref))
- model.ui
- )
- )
- },
- Cmd.none
- )
diff --git a/src/battle/src/Update/Character/DisplayInfo.elm b/src/battle/src/Update/Character/DisplayInfo.elm
index f00ee20..583d380 100644
--- a/src/battle/src/Update/Character/DisplayInfo.elm
+++ b/src/battle/src/Update/Character/DisplayInfo.elm
@@ -24,11 +24,8 @@ apply_to_ref target_ref model =
{model |
ui =
(Struct.UI.set_displayed_tab
- Struct.UI.StatusTab
- (Struct.UI.set_previous_action
- (Just (Struct.UI.SelectedCharacter target_ref))
- model.ui
- )
+ (Struct.UI.CharacterStatusTab target_ref)
+ model.ui
)
},
Cmd.none
diff --git a/src/battle/src/Update/Character/DisplayNavigator.elm b/src/battle/src/Update/Character/DisplayNavigator.elm
index cb94846..76779cc 100644
--- a/src/battle/src/Update/Character/DisplayNavigator.elm
+++ b/src/battle/src/Update/Character/DisplayNavigator.elm
@@ -8,8 +8,6 @@ module Update.Character.DisplayNavigator exposing
import Task
-- Local Module ----------------------------------------------------------------
-import Action.Scroll
-
import Struct.Battle
import Struct.Character
import Struct.Event
@@ -39,13 +37,7 @@ apply_to_character char model =
model.ui
)
},
- (Task.attempt
- (Struct.Event.attempted)
- (Action.Scroll.to
- (Struct.Character.get_location char)
- model.ui
- )
- )
+ Cmd.none
)
apply_to_ref : (
diff --git a/src/battle/src/Update/Character/ScrollTo.elm b/src/battle/src/Update/Character/ScrollTo.elm
index 9c935ee..359ba5f 100644
--- a/src/battle/src/Update/Character/ScrollTo.elm
+++ b/src/battle/src/Update/Character/ScrollTo.elm
@@ -1,4 +1,4 @@
-module Update.Character.ScrollTo exposing (apply_to_ref, apply_to_character)
+module Update.Character.ScrollTo exposing (apply_to_ref, apply_to)
-- Elm -------------------------------------------------------------------------
import Task
@@ -18,12 +18,12 @@ import Struct.Model
--------------------------------------------------------------------------------
-- EXPORTED --------------------------------------------------------------------
--------------------------------------------------------------------------------
-apply_to_character : (
+apply_to : (
Struct.Character.Type ->
Struct.Model.Type ->
(Struct.Model.Type, (Cmd Struct.Event.Type))
)
-apply_to_character char model =
+apply_to char model =
(
model,
(Task.attempt
@@ -35,8 +35,12 @@ apply_to_character char model =
)
)
-apply_to_ref : Int -> Struct.Model.Type -> (Cmd Struct.Event.Type)
+apply_to_ref : (
+ Int ->
+ Struct.Model.Type ->
+ (Struct.Model.Type, (Cmd Struct.Event.Type))
+ )
apply_to_ref char_ix model =
case (Struct.Battle.get_character char_ix model.battle) of
- (Just char) -> (apply_to_character char model)
+ (Just char) -> (apply_to char model)
Nothing -> (model, Cmd.none)
diff --git a/src/battle/src/Update/CharacterTurn/RequestDirection.elm b/src/battle/src/Update/CharacterTurn/RequestDirection.elm
index bbfbe4d..a4d5e6b 100644
--- a/src/battle/src/Update/CharacterTurn/RequestDirection.elm
+++ b/src/battle/src/Update/CharacterTurn/RequestDirection.elm
@@ -2,6 +2,7 @@ module Update.CharacterTurn.RequestDirection exposing (apply_to)
-- Battle Map ------------------------------------------------------------------
import BattleMap.Struct.Direction
+import BattleMap.Struct.Location
import BattleMap.Struct.Map
-- Battle Characters -----------------------------------------------------------
@@ -30,33 +31,37 @@ make_it_so : (
make_it_so model char navigator dir =
case (Struct.Navigator.maybe_add_step dir navigator) of
(Just new_navigator) ->
- {model |
- char_turn =
- (Struct.CharacterTurn.set_navigator
- new_navigator
- (Struct.CharacterTurn.set_active_character
- (Struct.Character.set_base_character
- (BattleCharacters.Struct.Character.set_extra_omnimods
+ let
+ new_location = (Struct.Navigator.get_current_location new_navigator)
+ in
+ {model |
+ char_turn =
+ (Struct.CharacterTurn.set_navigator
+ new_navigator
+ (Struct.CharacterTurn.set_active_character
+ (Struct.Character.set_location
+ new_location
(BattleMap.Struct.Map.get_omnimods_at
- (Struct.Navigator.get_current_location
- new_navigator
- )
+ new_location
model.map_data_set
(Struct.Battle.get_map model.battle)
)
- (Struct.Character.get_base_character char)
+ char
)
- char
+ model.char_turn
+ )
+ ),
+ ui =
+ (Struct.UI.set_displayed_tab
+ (Struct.UI.TileStatusTab
+ (BattleMap.Struct.Location.get_ref new_location)
+ )
+ (Struct.UI.set_previous_action
+ (Just Struct.UI.UsedManualControls)
+ model.ui
)
- model.char_turn
)
- ),
- ui =
- (Struct.UI.set_previous_action
- (Just Struct.UI.UsedManualControls)
- model.ui
- )
- }
+ }
Nothing ->
(Struct.Model.invalidate
diff --git a/src/battle/src/Update/CharacterTurn/SwitchWeapon.elm b/src/battle/src/Update/CharacterTurn/SwitchWeapon.elm
index 973ac36..e71a5ed 100644
--- a/src/battle/src/Update/CharacterTurn/SwitchWeapon.elm
+++ b/src/battle/src/Update/CharacterTurn/SwitchWeapon.elm
@@ -10,8 +10,7 @@ import Struct.CharacterTurn
import Struct.Error
import Struct.Event
import Struct.Model
-
-import Util.Navigator
+import Struct.Navigator
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
@@ -22,8 +21,13 @@ import Util.Navigator
--------------------------------------------------------------------------------
apply_to : Struct.Model.Type -> (Struct.Model.Type, (Cmd Struct.Event.Type))
apply_to model =
- case (Struct.CharacterTurn.maybe_get_active_character model.char_turn) of
- (Just char) ->
+ case
+ (
+ (Struct.CharacterTurn.maybe_get_active_character model.char_turn),
+ (Struct.CharacterTurn.maybe_get_navigator model.char_turn)
+ )
+ of
+ ((Just char), (Just nav)) ->
let
new_base_character =
(BattleCharacters.Struct.Character.switch_weapons
@@ -45,9 +49,14 @@ apply_to model =
(Struct.CharacterTurn.set_action
Struct.CharacterTurn.SwitchingWeapons
(Struct.CharacterTurn.set_navigator
- (Util.Navigator.get_character_attack_navigator
- model.battle
- new_character
+ (Struct.Navigator.lock_path_with_new_attack_ranges
+ (BattleCharacters.Struct.Weapon.get_defense_range
+ active_weapon
+ )
+ (BattleCharacters.Struct.Weapon.get_attack_range
+ active_weapon
+ )
+ nav
)
(Struct.CharacterTurn.set_active_character
new_character
@@ -59,4 +68,4 @@ apply_to model =
Cmd.none
)
- Nothing -> (model, Cmd.none)
+ _ -> (model, Cmd.none)
diff --git a/src/battle/src/Update/SelectCharacter.elm b/src/battle/src/Update/SelectCharacter.elm
index 5111544..0020cdd 100644
--- a/src/battle/src/Update/SelectCharacter.elm
+++ b/src/battle/src/Update/SelectCharacter.elm
@@ -19,8 +19,6 @@ import BattleMap.Struct.Map
import BattleMap.Struct.Location
-- Local Module ----------------------------------------------------------------
-import Action.Scroll
-
import Struct.Battle
import Struct.Character
import Struct.CharacterTurn
diff --git a/src/battle/src/Update/SelectTile.elm b/src/battle/src/Update/SelectTile.elm
index 1d42490..56a23f3 100644
--- a/src/battle/src/Update/SelectTile.elm
+++ b/src/battle/src/Update/SelectTile.elm
@@ -72,7 +72,7 @@ go_to_current_tile model loc_ref =
ui =
(Struct.UI.reset_displayed_navigator
(Struct.UI.set_displayed_tab
- Struct.UI.StatusTab
+ (Struct.UI.TileStatusTab loc_ref)
(Struct.UI.set_previous_action
(Just (Struct.UI.SelectedLocation loc_ref))
model.ui
@@ -125,7 +125,7 @@ go_to_another_tile model char navigator loc_ref =
),
ui =
(Struct.UI.set_displayed_tab
- Struct.UI.StatusTab
+ (Struct.UI.TileStatusTab loc_ref)
(Struct.UI.set_previous_action
(Just (Struct.UI.SelectedLocation loc_ref))
model.ui
@@ -194,7 +194,7 @@ apply_to loc_ref model =
ui =
(Struct.UI.reset_displayed_navigator
(Struct.UI.set_displayed_tab
- Struct.UI.StatusTab
+ (Struct.UI.TileStatusTab loc_ref)
(Struct.UI.set_previous_action
(Just (Struct.UI.SelectedLocation loc_ref))
model.ui
diff --git a/src/battle/src/View/Character.elm b/src/battle/src/View/Character.elm
index 1b2d2e4..19acb83 100644
--- a/src/battle/src/View/Character.elm
+++ b/src/battle/src/View/Character.elm
@@ -28,7 +28,9 @@ get_portrait_html char =
(BattleCharacters.View.Portrait.get_html
(
(Html.Events.onClick
- (Struct.Event.LookingForCharacter (Struct.Character.get_index char))
+ (Struct.Event.CharacterCardSelected
+ (Struct.Character.get_index char)
+ )
)
::
(List.map
diff --git a/src/battle/src/View/SubMenu.elm b/src/battle/src/View/SubMenu.elm
index 1261764..d188f65 100644
--- a/src/battle/src/View/SubMenu.elm
+++ b/src/battle/src/View/SubMenu.elm
@@ -10,6 +10,9 @@ import Html.Lazy
-- Shared ----------------------------------------------------------------------
import Shared.Util.Html
+-- Battle Map ------------------------------------------------------------------
+import BattleMap.View.TileInfo
+
-- Local Module ----------------------------------------------------------------
import Struct.Battle
import Struct.Event
@@ -18,9 +21,9 @@ import Struct.UI
import View.Controlled.CharacterCard
+import View.SubMenu.CharacterStatus
import View.SubMenu.Characters
import View.SubMenu.Settings
-import View.SubMenu.Status
import View.SubMenu.Timeline
--------------------------------------------------------------------------------
@@ -33,8 +36,24 @@ get_inner_html : (
)
get_inner_html model tab =
case tab of
- Struct.UI.StatusTab ->
- (View.SubMenu.Status.get_html model)
+ (Struct.UI.TileStatusTab tile_loc) ->
+ (Html.Lazy.lazy3
+ (BattleMap.View.TileInfo.get_html)
+ model.map_data_set
+ tile_loc
+ model.battle.map
+ )
+
+ (Struct.UI.CharacterStatusTab char_ref) ->
+ case (Struct.Battle.get_character char_ref model.battle) of
+ (Just char) ->
+ (Html.Lazy.lazy2
+ (View.SubMenu.CharacterStatus.get_html)
+ model.battle.own_player_ix
+ char
+ )
+
+ _ -> (Html.text "Error: Unknown character selected.")
Struct.UI.CharactersTab ->
(Html.Lazy.lazy2
diff --git a/src/battle/src/View/SubMenu/Status/CharacterInfo.elm b/src/battle/src/View/SubMenu/CharacterStatus.elm
index a8891e4..c1553aa 100644
--- a/src/battle/src/View/SubMenu/Status/CharacterInfo.elm
+++ b/src/battle/src/View/SubMenu/CharacterStatus.elm
@@ -1,4 +1,4 @@
-module View.SubMenu.Status.CharacterInfo exposing (get_html)
+module View.SubMenu.CharacterStatus exposing (get_html)
-- Elm -------------------------------------------------------------------------
import Html
diff --git a/src/battle/src/View/SubMenu/Characters.elm b/src/battle/src/View/SubMenu/Characters.elm
index 411e5e0..821940e 100644
--- a/src/battle/src/View/SubMenu/Characters.elm
+++ b/src/battle/src/View/SubMenu/Characters.elm
@@ -33,7 +33,9 @@ get_character_element_html player_ix char =
(Html.Attributes.class "")
),
(Html.Events.onClick
- (Struct.Event.LookingForCharacter (Struct.Character.get_index char))
+ (Struct.Event.CharacterCardSelected
+ (Struct.Character.get_index char)
+ )
),
(
if (Struct.Character.is_enabled char)
diff --git a/src/battle/src/View/SubMenu/Status.elm b/src/battle/src/View/SubMenu/Status.elm
deleted file mode 100644
index e351b34..0000000
--- a/src/battle/src/View/SubMenu/Status.elm
+++ /dev/null
@@ -1,62 +0,0 @@
-module View.SubMenu.Status exposing (get_html)
-
--- Elm -------------------------------------------------------------------------
-import Array
-
-import Html
-import Html.Attributes
-import Html.Lazy
-
--- Battle Map ------------------------------------------------------------------
-import BattleMap.Struct.Location
-
-import BattleMap.View.TileInfo
-
--- Local Module ----------------------------------------------------------------
-import Struct.Battle
-import Struct.Event
-import Struct.Model
-import Struct.UI
-
-import View.SubMenu.Status.CharacterInfo
-
---------------------------------------------------------------------------------
--- LOCAL -----------------------------------------------------------------------
---------------------------------------------------------------------------------
-
---------------------------------------------------------------------------------
--- EXPORTED --------------------------------------------------------------------
---------------------------------------------------------------------------------
-get_html : Struct.Model.Type -> (Html.Html Struct.Event.Type)
-get_html model =
- (Html.div
- [
- (Html.Attributes.class "footer-tabmenu-content"),
- (Html.Attributes.class "footer-tabmenu-content-status")
- ]
- [
- (case (Struct.UI.get_previous_action model.ui) of
- (Just (Struct.UI.SelectedLocation loc)) ->
- (Html.Lazy.lazy3
- (BattleMap.View.TileInfo.get_html)
- model.map_data_set
- loc
- model.battle.map
- )
-
- (Just (Struct.UI.SelectedCharacter target_char)) ->
- case (Struct.Battle.get_character target_char model.battle) of
- (Just char) ->
- (Html.Lazy.lazy2
- (View.SubMenu.Status.CharacterInfo.get_html)
- model.battle.own_player_ix
- char
- )
-
- _ -> (Html.text "Error: Unknown character selected.")
-
- _ ->
- (Html.text "Nothing is being focused.")
- )
- ]
- )
diff --git a/src/battle/src/View/SubMenu/Timeline.elm b/src/battle/src/View/SubMenu/Timeline.elm
index 18d6eca..2c1818e 100644
--- a/src/battle/src/View/SubMenu/Timeline.elm
+++ b/src/battle/src/View/SubMenu/Timeline.elm
@@ -7,6 +7,9 @@ import Html
import Html.Attributes
import Html.Lazy
+-- Shared ----------------------------------------------------------------------
+import Shared.Util.Html
+
-- Local Module ----------------------------------------------------------------
import Struct.Battle
import Struct.Character
@@ -32,6 +35,7 @@ get_turn_result_html : (
)
get_turn_result_html characters player_ix turn_result =
case turn_result of
+ (Struct.TurnResult.Targeted target) -> (Shared.Util.Html.nothing)
(Struct.TurnResult.Moved movement) ->
(View.SubMenu.Timeline.Movement.get_html
characters
diff --git a/src/battle/src/View/SubMenu/Timeline/Attack.elm b/src/battle/src/View/SubMenu/Timeline/Attack.elm
index fe43b6a..9295951 100644
--- a/src/battle/src/View/SubMenu/Timeline/Attack.elm
+++ b/src/battle/src/View/SubMenu/Timeline/Attack.elm
@@ -151,18 +151,16 @@ get_html characters player_ix attack =
(Html.Attributes.class "timeline-element"),
(Html.Attributes.class "timeline-attack")
]
- (
- [
- (View.Character.get_portrait_html atkchar),
- (View.Character.get_portrait_html defchar),
- (get_title_html atkchar defchar)
- ]
- ++
- (List.map
- (get_attack_html atkchar defchar)
- attack.sequence
+ [
+ (View.Character.get_portrait_html atkchar),
+ (View.Character.get_portrait_html defchar),
+ (get_title_html atkchar defchar),
+ (get_attack_html
+ atkchar
+ defchar
+ (Struct.TurnResult.get_attack_data attack)
)
- )
+ ]
)
_ ->