summaryrefslogtreecommitdiff |
diff options
-rw-r--r-- | src/battle/src/Struct/Character.elm | 49 | ||||
-rw-r--r-- | src/battle/src/Struct/CharacterTurn.elm | 16 | ||||
-rw-r--r-- | src/battle/src/Struct/Model.elm | 18 | ||||
-rw-r--r-- | src/battle/src/Struct/Omnimods.elm | 13 | ||||
-rw-r--r-- | src/battle/src/Struct/Statistics.elm | 2 | ||||
-rw-r--r-- | src/battle/src/Struct/TurnResult.elm | 78 | ||||
-rw-r--r-- | src/battle/src/Struct/Weapon.elm | 28 | ||||
-rw-r--r-- | src/battle/src/Update/AttackWithoutMoving.elm | 6 | ||||
-rw-r--r-- | src/battle/src/Update/HandleServerReply.elm | 8 | ||||
-rw-r--r-- | src/battle/src/Update/SelectTile.elm | 5 | ||||
-rw-r--r-- | src/battle/src/Update/SwitchWeapon.elm | 1 | ||||
-rw-r--r-- | src/battle/src/View/Controlled/CharacterCard.elm | 165 |
12 files changed, 253 insertions, 136 deletions
diff --git a/src/battle/src/Struct/Character.elm b/src/battle/src/Struct/Character.elm index 42472b3..b837962 100644 --- a/src/battle/src/Struct/Character.elm +++ b/src/battle/src/Struct/Character.elm @@ -11,6 +11,7 @@ module Struct.Character exposing get_armor, get_armor_variation, get_current_health, + get_current_omnimods, get_sane_current_health, set_current_health, get_location, @@ -150,6 +151,9 @@ get_portrait_id c = c.portrait get_current_health : Type -> Int get_current_health c = c.health +get_current_omnimods : Type -> Struct.Omnimods.Type +get_current_omnimods c = c.current_omnimods + get_sane_current_health : Type -> Int get_sane_current_health c = (max 0 c.health) @@ -226,16 +230,21 @@ decoder = ) ) -refresh_omnimods : Struct.Omnimods.Type -> Type -> Type -refresh_omnimods tile_omnimods char = +refresh_omnimods : ( + (Struct.Location.Type -> Struct.Omnimods.Type) -> + Type -> + Type + ) +refresh_omnimods tile_omnimods_fun char = let + previous_max_health = (Struct.Statistics.get_max_health char.statistics) current_omnimods = (Struct.Omnimods.merge (Struct.Weapon.get_omnimods (Struct.WeaponSet.get_active_weapon char.weapons) ) (Struct.Omnimods.merge - tile_omnimods + (tile_omnimods_fun char.location) char.permanent_omnimods ) ) @@ -249,26 +258,42 @@ refresh_omnimods tile_omnimods char = current_omnimods (Struct.Statistics.new_raw current_attributes) ) + new_max_health = (Struct.Statistics.get_max_health current_statistics) in {char | attributes = current_attributes, statistics = current_statistics, - current_omnimods = current_omnimods + current_omnimods = current_omnimods, + health = + (clamp + 1 + new_max_health + (round + ( + ((toFloat char.health) / (toFloat previous_max_health)) + * (toFloat new_max_health) + ) + ) + ) } fill_missing_equipment_and_omnimods : ( - Struct.Omnimods.Type -> + (Struct.Location.Type -> Struct.Omnimods.Type) -> Struct.Weapon.Type -> Struct.Weapon.Type -> Struct.Armor.Type -> Type -> Type ) -fill_missing_equipment_and_omnimods tile_omnimods awp swp ar char = - (refresh_omnimods - tile_omnimods - {char | - weapons = (Struct.WeaponSet.new awp swp), - armor = ar - } +fill_missing_equipment_and_omnimods tile_omnimods_fun awp swp ar char = + (set_current_health + -- We just changed the omnimods, but already had the right health value + char.health + (refresh_omnimods + (tile_omnimods_fun) + {char | + weapons = (Struct.WeaponSet.new awp swp), + armor = ar + } + ) ) diff --git a/src/battle/src/Struct/CharacterTurn.elm b/src/battle/src/Struct/CharacterTurn.elm index ddc80d4..d31e21a 100644 --- a/src/battle/src/Struct/CharacterTurn.elm +++ b/src/battle/src/Struct/CharacterTurn.elm @@ -19,10 +19,12 @@ module Struct.CharacterTurn exposing -- Elm ------------------------------------------------------------------------- --- Map ------------------------------------------------------------------- +-- Battle ---------------------------------------------------------------------- import Struct.Character import Struct.Direction +import Struct.Location import Struct.Navigator +import Struct.Omnimods -------------------------------------------------------------------------------- -- TYPES ----------------------------------------------------------------------- @@ -88,18 +90,20 @@ get_state ct = ct.state get_path : Type -> (List Struct.Direction.Type) get_path ct = ct.path -lock_path : Type -> Type -lock_path ct = - case ct.navigator of - (Just old_nav) -> +lock_path : (Struct.Location.Type -> Struct.Omnimods.Type) -> Type -> Type +lock_path tile_omnimods ct = + case (ct.navigator, ct.active_character) of + ((Just old_nav), (Just char)) -> {ct | + active_character = + (Just (Struct.Character.refresh_omnimods (tile_omnimods) char)), state = MovedCharacter, path = (Struct.Navigator.get_path old_nav), target = Nothing, navigator = (Just (Struct.Navigator.lock_path old_nav)) } - Nothing -> + (_, _) -> ct try_getting_navigator : Type -> (Maybe Struct.Navigator.Type) diff --git a/src/battle/src/Struct/Model.elm b/src/battle/src/Struct/Model.elm index aa4ce4a..c32db67 100644 --- a/src/battle/src/Struct/Model.elm +++ b/src/battle/src/Struct/Model.elm @@ -14,7 +14,8 @@ module Struct.Model exposing move_animator_to_next_step, reset, full_debug_reset, - clear_error + clear_error, + tile_omnimods_fun ) -- Elm ------------------------------------------------------------------------- @@ -22,14 +23,16 @@ import Array import Dict --- Map ------------------------------------------------------------------- +-- Battle ---------------------------------------------------------------------- import Struct.Armor -import Struct.Map import Struct.Character import Struct.CharacterTurn import Struct.Error import Struct.Flags import Struct.HelpRequest +import Struct.Location +import Struct.Map +import Struct.Omnimods import Struct.Tile import Struct.TurnResult import Struct.TurnResultAnimator @@ -67,6 +70,10 @@ type alias Type = -------------------------------------------------------------------------------- -- EXPORTED -------------------------------------------------------------------- -------------------------------------------------------------------------------- +tile_omnimods_fun : Type -> (Struct.Location.Type -> Struct.Omnimods.Type) +tile_omnimods_fun model = + (\loc -> (Struct.Map.get_omnimods_at loc model.tiles model.map)) + new : Struct.Flags.Type -> Type new flags = let @@ -192,7 +199,9 @@ initialize_animator model = ui = (Struct.UI.default), characters = (List.foldr - (Struct.TurnResult.apply_inverse_to_characters) + (Struct.TurnResult.apply_inverse_to_characters + (tile_omnimods_fun model) + ) model.characters timeline_list ) @@ -220,6 +229,7 @@ apply_animator_step model = of (Struct.TurnResultAnimator.TurnResult turn_result) -> (Struct.TurnResult.apply_step_to_characters + (tile_omnimods_fun model) turn_result model.characters ) diff --git a/src/battle/src/Struct/Omnimods.elm b/src/battle/src/Struct/Omnimods.elm index 1420f6b..e98540a 100644 --- a/src/battle/src/Struct/Omnimods.elm +++ b/src/battle/src/Struct/Omnimods.elm @@ -6,6 +6,9 @@ module Struct.Omnimods exposing apply_to_attributes, apply_to_statistics, get_attack_damage, + get_damage_sum, + get_attack_mods, + get_defense_mods, decoder ) @@ -123,6 +126,10 @@ apply_to_statistics omnimods statistics = omnimods.statistics ) +get_damage_sum : Type -> Int +get_damage_sum omni = + (Dict.foldl (\t -> \v -> \result -> (result + v)) 0 omni.attack) + get_attack_damage : Float -> Type -> Type -> Int get_attack_damage dmg_modifier atk_omni def_omni = let @@ -157,3 +164,9 @@ get_attack_damage dmg_modifier atk_omni def_omni = 0 atk_omni.attack ) + +get_attack_mods : Type -> (List (String, Int)) +get_attack_mods omnimods = (Dict.toList omnimods.attack) + +get_defense_mods : Type -> (List (String, Int)) +get_defense_mods omnimods = (Dict.toList omnimods.defense) diff --git a/src/battle/src/Struct/Statistics.elm b/src/battle/src/Struct/Statistics.elm index 064d806..f676648 100644 --- a/src/battle/src/Struct/Statistics.elm +++ b/src/battle/src/Struct/Statistics.elm @@ -74,7 +74,7 @@ sudden_exp_growth_f : Float -> Int sudden_exp_growth_f f = (float_to_int (4.0^(f/25.0))) damage_base_mod : Float -> Float -damage_base_mod str = (((str^1.8)/2000.0) - 0.75) +damage_base_mod str = ((((str + 10) * 4)^1.5)/3000.0) make_movement_points_safe : Int -> Int make_movement_points_safe val = (clamp 0 200 val) diff --git a/src/battle/src/Struct/TurnResult.elm b/src/battle/src/Struct/TurnResult.elm index c113994..90d9420 100644 --- a/src/battle/src/Struct/TurnResult.elm +++ b/src/battle/src/Struct/TurnResult.elm @@ -23,11 +23,12 @@ import Array import Json.Decode --- Map ------------------------------------------------------------------- +-- Battle ---------------------------------------------------------------------- import Struct.Attack import Struct.Character import Struct.Direction import Struct.Location +import Struct.Omnimods import Struct.WeaponSet -------------------------------------------------------------------------------- @@ -80,18 +81,23 @@ type Type = -------------------------------------------------------------------------------- apply_movement_to_character : ( Movement -> + (Struct.Location.Type -> Struct.Omnimods.Type) -> Struct.Character.Type -> Struct.Character.Type ) -apply_movement_to_character movement char = - (Struct.Character.set_location movement.destination char) +apply_movement_to_character movement tile_omnimods char = + (Struct.Character.refresh_omnimods + (tile_omnimods) + (Struct.Character.set_location movement.destination char) + ) apply_movement_step_to_character : ( Movement -> + (Struct.Location.Type -> Struct.Omnimods.Type) -> Struct.Character.Type -> Struct.Character.Type ) -apply_movement_step_to_character movement char = +apply_movement_step_to_character movement tile_omnimods char = case (List.head movement.path) of (Just dir) -> (Struct.Character.set_location @@ -99,33 +105,42 @@ apply_movement_step_to_character movement char = char ) - Nothing -> char + Nothing -> + (Struct.Character.refresh_omnimods (tile_omnimods) char) apply_inverse_movement_to_character : ( Movement -> + (Struct.Location.Type -> Struct.Omnimods.Type) -> Struct.Character.Type -> Struct.Character.Type ) -apply_inverse_movement_to_character movement char = - (Struct.Character.set_location - (List.foldr - (Struct.Location.neighbor) - (movement.destination) - (List.map (Struct.Direction.opposite_of) movement.path) +apply_inverse_movement_to_character movement tile_omnimods char = + (Struct.Character.refresh_omnimods + (tile_omnimods) + (Struct.Character.set_location + (List.foldr + (Struct.Location.neighbor) + (movement.destination) + (List.map (Struct.Direction.opposite_of) movement.path) + ) + char ) - char ) apply_weapon_switch_to_character : ( + (Struct.Location.Type -> Struct.Omnimods.Type) -> Struct.Character.Type -> Struct.Character.Type ) -apply_weapon_switch_to_character char = - (Struct.Character.set_weapons - (Struct.WeaponSet.switch_weapons - (Struct.Character.get_weapons char) +apply_weapon_switch_to_character tile_omnimods char = + (Struct.Character.refresh_omnimods + (tile_omnimods) + (Struct.Character.set_weapons + (Struct.WeaponSet.switch_weapons + (Struct.Character.get_weapons char) + ) + char ) - char ) apply_attack_to_characters : ( @@ -342,18 +357,19 @@ maybe_remove_attack_step attack = -- EXPORTED -------------------------------------------------------------------- -------------------------------------------------------------------------------- apply_to_characters : ( + (Struct.Location.Type -> Struct.Omnimods.Type) -> Type -> (Array.Array Struct.Character.Type) -> (Array.Array Struct.Character.Type) ) -apply_to_characters turn_result characters = +apply_to_characters tile_omnimods turn_result characters = case turn_result of (Moved movement) -> case (Array.get movement.character_index characters) of (Just char) -> (Array.set movement.character_index - (apply_movement_to_character movement char) + (apply_movement_to_character movement (tile_omnimods) char) characters ) @@ -365,7 +381,7 @@ apply_to_characters turn_result characters = (Just char) -> (Array.set weapon_switch.character_index - (apply_weapon_switch_to_character char) + (apply_weapon_switch_to_character (tile_omnimods) char) characters ) @@ -383,18 +399,23 @@ apply_to_characters turn_result characters = (PlayerTurnStarted pturns) -> characters apply_step_to_characters : ( + (Struct.Location.Type -> Struct.Omnimods.Type) -> Type -> (Array.Array Struct.Character.Type) -> (Array.Array Struct.Character.Type) ) -apply_step_to_characters turn_result characters = +apply_step_to_characters tile_omnimods turn_result characters = case turn_result of (Moved movement) -> case (Array.get movement.character_index characters) of (Just char) -> (Array.set movement.character_index - (apply_movement_step_to_character movement char) + (apply_movement_step_to_character + movement + (tile_omnimods) + char + ) characters ) @@ -406,7 +427,7 @@ apply_step_to_characters turn_result characters = (Just char) -> (Array.set weapon_switch.character_index - (apply_weapon_switch_to_character char) + (apply_weapon_switch_to_character (tile_omnimods) char) characters ) @@ -424,18 +445,23 @@ apply_step_to_characters turn_result characters = (PlayerTurnStarted pturns) -> characters apply_inverse_to_characters : ( + (Struct.Location.Type -> Struct.Omnimods.Type) -> Type -> (Array.Array Struct.Character.Type) -> (Array.Array Struct.Character.Type) ) -apply_inverse_to_characters turn_result characters = +apply_inverse_to_characters tile_omnimods turn_result characters = case turn_result of (Moved movement) -> case (Array.get movement.character_index characters) of (Just char) -> (Array.set movement.character_index - (apply_inverse_movement_to_character movement char) + (apply_inverse_movement_to_character + movement + (tile_omnimods) + char + ) characters ) @@ -447,7 +473,7 @@ apply_inverse_to_characters turn_result characters = (Just char) -> (Array.set weapon_switch.character_index - (apply_weapon_switch_to_character char) + (apply_weapon_switch_to_character (tile_omnimods) char) characters ) diff --git a/src/battle/src/Struct/Weapon.elm b/src/battle/src/Struct/Weapon.elm index 7f9a049..2035fe4 100644 --- a/src/battle/src/Struct/Weapon.elm +++ b/src/battle/src/Struct/Weapon.elm @@ -8,6 +8,7 @@ module Struct.Weapon exposing get_attack_range, get_defense_range, get_omnimods, + get_damage_sum, decoder, none ) @@ -37,7 +38,8 @@ type alias Type = name : String, def_range : Int, atk_range : Int, - omnimods : Struct.Omnimods.Type + omnimods : Struct.Omnimods.Type, + damage_sum : Int } type alias Ref = Int @@ -56,7 +58,8 @@ new id name range_min range_max omnimods = name = name, def_range = range_min, atk_range = range_max, - omnimods = omnimods + omnimods = omnimods, + damage_sum = (Struct.Omnimods.get_damage_sum omnimods) } get_id : Type -> Int @@ -74,15 +77,22 @@ get_defense_range wp = wp.def_range get_omnimods : Type -> Struct.Omnimods.Type get_omnimods wp = wp.omnimods +get_damage_sum : Type -> Int +get_damage_sum wp = wp.damage_sum + decoder : (Json.Decode.Decoder Type) decoder = - (Json.Decode.Pipeline.decode - Type - |> (Json.Decode.Pipeline.required "id" Json.Decode.int) - |> (Json.Decode.Pipeline.required "nam" Json.Decode.string) - |> (Json.Decode.Pipeline.required "rmi" Json.Decode.int) - |> (Json.Decode.Pipeline.required "rma" Json.Decode.int) - |> (Json.Decode.Pipeline.required "omni" Struct.Omnimods.decoder) + (Json.Decode.map + (\e -> {e | damage_sum = (Struct.Omnimods.get_damage_sum e.omnimods)}) + (Json.Decode.Pipeline.decode + Type + |> (Json.Decode.Pipeline.required "id" Json.Decode.int) + |> (Json.Decode.Pipeline.required "nam" Json.Decode.string) + |> (Json.Decode.Pipeline.required "rmi" Json.Decode.int) + |> (Json.Decode.Pipeline.required "rma" Json.Decode.int) + |> (Json.Decode.Pipeline.required "omni" Struct.Omnimods.decoder) + |> (Json.Decode.Pipeline.hardcoded 0) + ) ) none : Type diff --git a/src/battle/src/Update/AttackWithoutMoving.elm b/src/battle/src/Update/AttackWithoutMoving.elm index 3d64e57..002fbc1 100644 --- a/src/battle/src/Update/AttackWithoutMoving.elm +++ b/src/battle/src/Update/AttackWithoutMoving.elm @@ -14,7 +14,11 @@ import Struct.Model make_it_so : Struct.Model.Type -> Struct.Model.Type make_it_so model = {model | - char_turn = (Struct.CharacterTurn.lock_path model.char_turn) + char_turn = + (Struct.CharacterTurn.lock_path + (Struct.Model.tile_omnimods_fun model) + model.char_turn + ) } -------------------------------------------------------------------------------- diff --git a/src/battle/src/Update/HandleServerReply.elm b/src/battle/src/Update/HandleServerReply.elm index 3b90800..85e7a39 100644 --- a/src/battle/src/Update/HandleServerReply.elm +++ b/src/battle/src/Update/HandleServerReply.elm @@ -87,12 +87,6 @@ add_character char_and_refs current_state = (model, _) -> let (char, awp_ref, swp_ref, ar_ref) = char_and_refs - tile_omnimods = - (Struct.Map.get_omnimods_at - (Struct.Character.get_location char) - model.tiles - model.map - ) awp = (weapon_getter model awp_ref) swp = (weapon_getter model swp_ref) ar = (armor_getter model ar_ref) @@ -100,7 +94,7 @@ add_character char_and_refs current_state = ( (Struct.Model.add_character (Struct.Character.fill_missing_equipment_and_omnimods - tile_omnimods + (Struct.Model.tile_omnimods_fun model) awp swp ar diff --git a/src/battle/src/Update/SelectTile.elm b/src/battle/src/Update/SelectTile.elm index aa9215a..64cee2f 100644 --- a/src/battle/src/Update/SelectTile.elm +++ b/src/battle/src/Update/SelectTile.elm @@ -55,7 +55,10 @@ go_to_tile model navigator loc_ref = ( {model | char_turn = - (Struct.CharacterTurn.lock_path model.char_turn) + (Struct.CharacterTurn.lock_path + (Struct.Model.tile_omnimods_fun model) + model.char_turn + ) }, Cmd.none ) diff --git a/src/battle/src/Update/SwitchWeapon.elm b/src/battle/src/Update/SwitchWeapon.elm index d9375dd..f265bcb 100644 --- a/src/battle/src/Update/SwitchWeapon.elm +++ b/src/battle/src/Update/SwitchWeapon.elm @@ -33,6 +33,7 @@ make_it_so model = (Struct.CharacterTurn.set_has_switched_weapons True (Struct.CharacterTurn.lock_path + (Struct.Model.tile_omnimods_fun model) (Struct.CharacterTurn.set_navigator (Struct.Navigator.new (Struct.Character.get_location new_char) diff --git a/src/battle/src/View/Controlled/CharacterCard.elm b/src/battle/src/View/Controlled/CharacterCard.elm index 95dfa6c..a26f8bb 100644 --- a/src/battle/src/View/Controlled/CharacterCard.elm +++ b/src/battle/src/View/Controlled/CharacterCard.elm @@ -6,11 +6,13 @@ module View.Controlled.CharacterCard exposing ) -- Elm ------------------------------------------------------------------------- +import List + import Html import Html.Attributes import Html.Events --- Map ------------------------------------------------------------------- +-- Battle ---------------------------------------------------------------------- import Struct.Armor import Struct.Attributes import Struct.Character @@ -18,6 +20,7 @@ import Struct.CharacterTurn import Struct.Event import Struct.HelpRequest import Struct.Navigator +import Struct.Omnimods import Struct.Statistics import Struct.Weapon import Struct.WeaponSet @@ -192,20 +195,19 @@ get_movement_bar char_turn char = Nothing -> (get_inactive_movement_bar char) -get_weapon_details : ( +get_weapon_field_header : ( Float -> Struct.Weapon.Type -> (Html.Html Struct.Event.Type) ) -get_weapon_details damage_multiplier weapon = +get_weapon_field_header damage_multiplier weapon = (Html.div [ - (Html.Attributes.class "battle-character-card-weapon") + (Html.Attributes.class "battle-character-card-header") ] [ (Html.div [ - (Html.Attributes.class "battle-character-card-weapon-name") ] [ (Html.text (Struct.Weapon.get_name weapon)) @@ -213,15 +215,25 @@ get_weapon_details damage_multiplier weapon = ), (Html.div [ - (Html.Attributes.class "battle-character-card-weapon-name") ] [ (Html.text ( - -- TODO [VISUAL][HIGH]: unimplemented - "[PH] WEAPON RANGE AND CHAR (ATK MODS * " - ++ (toString damage_multiplier) - ++ ")" + "~" + ++ + (toString + (ceiling + ( + (toFloat (Struct.Weapon.get_damage_sum weapon)) + * damage_multiplier + ) + ) + ) + ++ " dmg @ [" + ++ (toString (Struct.Weapon.get_defense_range weapon)) + ++ ", " + ++ (toString (Struct.Weapon.get_attack_range weapon)) + ++ "]" ) ) ] @@ -229,48 +241,88 @@ get_weapon_details damage_multiplier weapon = ] ) -get_weapon_summary : ( +get_mod_html : (String, Int) -> (Html.Html Struct.Event.Type) +get_mod_html mod = + let + (category, value) = mod + in + (Html.div + [ + (Html.Attributes.class "battle-character-card-mod") + ] + [ + (Html.text + (category ++ ": " ++ (toString value)) + ) + ] + ) + +get_multiplied_mod_html : Float -> (String, Int) -> (Html.Html Struct.Event.Type) +get_multiplied_mod_html multiplier mod = + let + (category, value) = mod + in + (Html.div + [ + (Html.Attributes.class "battle-character-card-mod") + ] + [ + (Html.text + ( + category + ++ ": " + ++ (toString (ceiling ((toFloat value) * multiplier))) + ) + ) + ] + ) + +get_weapon_details : ( + Struct.Omnimods.Type -> Float -> Struct.Weapon.Type -> (Html.Html Struct.Event.Type) ) -get_weapon_summary damage_multiplier weapon = +get_weapon_details omnimods damage_multiplier weapon = (Html.div [ - (Html.Attributes.class "battle-character-card-weapon-summary") + (Html.Attributes.class "battle-character-card-weapon") ] [ + (get_weapon_field_header damage_multiplier weapon), (Html.div [ - (Html.Attributes.class "battle-character-card-weapon-name") - ] - [ - (Html.text (Struct.Weapon.get_name weapon)) - ] - ), - (Html.div - [ - (Html.Attributes.class "battle-character-card-weapon-name") - ] - [ - (Html.text - ( - -- TODO [VISUAL][HIGH]: unimplemented - "[PH] WEAPON (ATK_SUM * " - ++ (toString damage_multiplier) - ++ ") AND RANGES" - ) - ) + (Html.Attributes.class "battle-character-card-weapon-stats") ] + (List.map + (get_multiplied_mod_html damage_multiplier) + (Struct.Omnimods.get_attack_mods omnimods) + ) ) ] ) +get_weapon_summary : ( + Float -> + Struct.Weapon.Type -> + (Html.Html Struct.Event.Type) + ) +get_weapon_summary damage_multiplier weapon = + (Html.div + [ + (Html.Attributes.class "battle-character-card-weapon-summary") + ] + [ + (get_weapon_field_header damage_multiplier weapon) + ] + ) + get_armor_details : ( + Struct.Omnimods.Type -> Struct.Armor.Type -> (Html.Html Struct.Event.Type) ) -get_armor_details armor = +get_armor_details omnimods armor = (Html.div [ (Html.Attributes.class "battle-character-card-armor") @@ -288,9 +340,10 @@ get_armor_details armor = [ (Html.Attributes.class "battle-character-card-armor-stats") ] - [ - (Html.text "[PH] CHAR DEF MODS") - ] + (List.map + (get_mod_html) + (Struct.Omnimods.get_defense_mods omnimods) + ) ) ] ) @@ -352,31 +405,6 @@ get_relevant_stats stats = ] ) -get_attributes : ( - Struct.Attributes.Type -> - (Html.Html Struct.Event.Type) - ) -get_attributes atts = - (Html.div - [ - (Html.Attributes.class "battle-character-card-stats") - ] - [ - (stat_name "Con"), - (stat_val (Struct.Attributes.get_constitution atts) False), - (stat_name "Dex"), - (stat_val (Struct.Attributes.get_dexterity atts) False), - (stat_name "Int"), - (stat_val (Struct.Attributes.get_intelligence atts) False), - (stat_name "Min"), - (stat_val (Struct.Attributes.get_mind atts) False), - (stat_name "Spe"), - (stat_val (Struct.Attributes.get_speed atts) False), - (stat_name "Str"), - (stat_val (Struct.Attributes.get_strength atts) False) - ] - ) - -------------------------------------------------------------------------------- -- EXPORTED -------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -428,9 +456,9 @@ get_summary_html char_turn player_ix char = weapon_set = (Struct.Character.get_weapons char) main_weapon = (Struct.WeaponSet.get_active_weapon weapon_set) char_statistics = (Struct.Character.get_statistics char) - char_attributes = (Struct.Character.get_attributes char) damage_modifier = (Struct.Statistics.get_damage_modifier char_statistics) secondary_weapon = (Struct.WeaponSet.get_secondary_weapon weapon_set) + omnimods = (Struct.Character.get_current_omnimods char) in (Html.div [ @@ -457,8 +485,8 @@ get_summary_html char_turn player_ix char = (get_statuses char) ] ), - (get_weapon_details damage_modifier main_weapon), - (get_armor_details (Struct.Character.get_armor char)), + (get_weapon_details omnimods damage_modifier main_weapon), + (get_armor_details omnimods (Struct.Character.get_armor char)), (get_relevant_stats char_statistics), (get_weapon_summary damage_modifier secondary_weapon) ] @@ -474,10 +502,10 @@ get_full_html player_ix char = weapon_set = (Struct.Character.get_weapons char) main_weapon = (Struct.WeaponSet.get_active_weapon weapon_set) char_statistics = (Struct.Character.get_statistics char) - char_attributes = (Struct.Character.get_attributes char) damage_modifier = (Struct.Statistics.get_damage_modifier char_statistics) secondary_weapon = (Struct.WeaponSet.get_secondary_weapon weapon_set) armor = (Struct.Character.get_armor char) + omnimods = (Struct.Character.get_current_omnimods char) in (Html.div [ @@ -505,10 +533,9 @@ get_full_html player_ix char = (get_statuses char) ] ), - (get_weapon_details damage_modifier main_weapon), - (get_armor_details armor), + (get_weapon_details omnimods damage_modifier main_weapon), + (get_armor_details omnimods armor), (get_relevant_stats char_statistics), - (get_weapon_summary damage_modifier secondary_weapon), - (get_attributes char_attributes) + (get_weapon_summary damage_modifier secondary_weapon) ] ) |