From 6a294ff0ed9c69be2c49aa18a1589ef0a4be83f6 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Wed, 11 Sep 2019 17:07:23 +0200 Subject: ... --- src/battle/src/View/Controlled/CharacterCard.elm | 64 ++++++++++++++++++------ 1 file changed, 49 insertions(+), 15 deletions(-) (limited to 'src/battle') diff --git a/src/battle/src/View/Controlled/CharacterCard.elm b/src/battle/src/View/Controlled/CharacterCard.elm index 8857fbf..a48c631 100644 --- a/src/battle/src/View/Controlled/CharacterCard.elm +++ b/src/battle/src/View/Controlled/CharacterCard.elm @@ -282,28 +282,60 @@ get_weapon_field_header is_active weapon = ) get_weapon_details : ( + Battle.Struct.Omnimods.Type -> Battle.Struct.Omnimods.Type -> BattleCharacters.Struct.Weapon.Type -> (Html.Html Struct.Event.Type) ) -get_weapon_details other_wp_omnimods weapon = - (Html.div - [ - (Html.Attributes.class "character-card-weapon") - ] - [ - (get_weapon_field_header False weapon), - (Battle.View.Omnimods.get_html - (Battle.Struct.Omnimods.merge - (Battle.Struct.Omnimods.scale - -1 - other_wp_omnimods +get_weapon_details omnimods other_wp_omnimods weapon = + let + other_wp_omnimods_scaled = + (Battle.Struct.Omnimods.scale + -1 + (Battle.Struct.Omnimods.apply_damage_modifier + (Battle.Struct.Omnimods.get_attribute_mod + (Battle.Struct.Attributes.encode_category + Battle.Struct.Attributes.DamageModifier + ) + omnimods ) - (BattleCharacters.Struct.Weapon.get_omnimods weapon) + other_wp_omnimods ) ) - ] - ) + omnimods_without_other_wp = + (Battle.Struct.Omnimods.merge + (Battle.Struct.Omnimods.scale -1 other_wp_omnimods) + omnimods + ) + this_wp_omnimods = (BattleCharacters.Struct.Weapon.get_omnimods weapon) + omnimods_with_this_wp = + (Battle.Struct.Omnimods.merge + omnimods_without_other_wp + this_wp_omnimods + ) + in + (Html.div + [ + (Html.Attributes.class "character-card-weapon") + ] + [ + (get_weapon_field_header False weapon), + (Battle.View.Omnimods.get_html + (Battle.Struct.Omnimods.merge + other_wp_omnimods_scaled + (Battle.Struct.Omnimods.apply_damage_modifier + (Battle.Struct.Omnimods.get_attribute_mod + (Battle.Struct.Attributes.encode_category + Battle.Struct.Attributes.DamageModifier + ) + omnimods_with_this_wp + ) + this_wp_omnimods + ) + ) + ) + ] + ) get_weapon_summary : ( BattleCharacters.Struct.Weapon.Type -> @@ -410,6 +442,7 @@ get_summary_html char_turn player_ix char = ), (get_weapon_summary active_weapon), (get_weapon_details + omnimods (BattleCharacters.Struct.Weapon.get_omnimods active_weapon) (BattleCharacters.Struct.Character.get_inactive_weapon base_char @@ -472,6 +505,7 @@ get_full_html player_ix char = ) ), (get_weapon_details + omnimods (BattleCharacters.Struct.Weapon.get_omnimods active_weapon) (BattleCharacters.Struct.Character.get_inactive_weapon base_char -- cgit v1.2.3-70-g09d2