summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2019-09-16 17:38:18 +0200 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2019-09-16 17:38:18 +0200 |
commit | 7bd57ea12ba9dde0b88b2476a91737fd4d3de840 (patch) | |
tree | f3978931742f6c2b9f0137f570b1e4dd7f57c491 /src | |
parent | f7c53eb60d2cba92a9da97dc1a09f574e0f91fbb (diff) |
Changes omni scale op, Sec. WP allows negative att
Diffstat (limited to 'src')
-rw-r--r-- | src/css/src/roster-editor/controlled-panel.scss | 3 | ||||
-rw-r--r-- | src/roster-editor/src/Struct/Character.elm | 47 | ||||
-rw-r--r-- | src/roster-editor/src/View/CharacterCard.elm | 43 | ||||
-rw-r--r-- | src/shared/battle/Battle/Struct/Omnimods.elm | 6 |
4 files changed, 66 insertions, 33 deletions
diff --git a/src/css/src/roster-editor/controlled-panel.scss b/src/css/src/roster-editor/controlled-panel.scss index bd7667c..724a702 100644 --- a/src/css/src/roster-editor/controlled-panel.scss +++ b/src/css/src/roster-editor/controlled-panel.scss @@ -38,7 +38,8 @@ } .roster-editor-invalid-character > .info-card-name, .roster-editor-invalid-character > .character-card-name, -.roster-editor-glyph-board-problem > .character-card-glyph-board-name +.roster-editor-glyph-board-problem > .character-card-glyph-board-name, +.character-card-weapon-problem { background-color: $RED-2; } diff --git a/src/roster-editor/src/Struct/Character.elm b/src/roster-editor/src/Struct/Character.elm index 6c01993..2633456 100644 --- a/src/roster-editor/src/Struct/Character.elm +++ b/src/roster-editor/src/Struct/Character.elm @@ -133,26 +133,28 @@ get_is_valid char = char.is_valid set_is_valid : Type -> Type set_is_valid char = - {char | - is_valid = - ( - (Set.isEmpty char.invalid_glyph_family_ids) - && - (List.all - (\(s, i) -> (i >= 0)) - (Battle.Struct.Omnimods.get_all_mods - (BattleCharacters.Struct.Character.get_omnimods char.base) - ) - ) - && + let + s0_base_char = char.base + s1_base_char = + if (BattleCharacters.Struct.Character.is_using_secondary s0_base_char) + then (BattleCharacters.Struct.Character.switch_weapons s0_base_char) + else s0_base_char + in + {char | + is_valid = ( - (Battle.Struct.Attributes.get_max_health - (BattleCharacters.Struct.Character.get_attributes char.base) + (Set.isEmpty char.invalid_glyph_family_ids) + && + (List.all + (\(s, i) -> (i >= 0)) + (Battle.Struct.Omnimods.get_all_mods + (BattleCharacters.Struct.Character.get_omnimods + s1_base_char + ) + ) ) - > 0 ) - ) - } + } get_invalid_glyph_family_indices : ( Type -> @@ -176,11 +178,12 @@ update_glyph_family_index_collections equipment char = (used_ids, overused_ids) = (compute_glyph_family_id_collections equipment) in - {char | - all_glyph_family_ids = used_ids, - invalid_glyph_family_ids = overused_ids, - is_valid = (char.is_valid && (Set.isEmpty overused_ids)) - } + (set_is_valid + {char | + all_glyph_family_ids = used_ids, + invalid_glyph_family_ids = overused_ids + } + ) resolve : ( ( diff --git a/src/roster-editor/src/View/CharacterCard.elm b/src/roster-editor/src/View/CharacterCard.elm index 7dd9f7c..ab6590c 100644 --- a/src/roster-editor/src/View/CharacterCard.elm +++ b/src/roster-editor/src/View/CharacterCard.elm @@ -206,13 +206,21 @@ get_weapon_field_header is_active_wp weapon = get_weapon_details : ( Struct.UI.Tab -> Bool -> + Bool -> BattleCharacters.Struct.Weapon.Type -> (Html.Html Struct.Event.Type) ) -get_weapon_details current_tab is_active_wp weapon = +get_weapon_details current_tab is_active_wp has_issue weapon = (Html.div [ (Html.Attributes.class "character-card-weapon"), + (Html.Attributes.class + ( + if (has_issue) + then "character-card-weapon-problem" + else "character-card-weapon-no-problem" + ) + ), (Html.Attributes.class "clickable"), (Html.Events.onClick ( @@ -416,11 +424,16 @@ get_full_html current_tab char = (get_weapon_details current_tab (not is_using_secondary) + ( + is_using_secondary + && (not (Struct.Character.get_is_valid char)) + ) (BattleCharacters.Struct.Equipment.get_primary_weapon equipment) ), (get_weapon_details current_tab is_using_secondary + False (BattleCharacters.Struct.Equipment.get_secondary_weapon equipment ) @@ -437,17 +450,29 @@ get_full_html current_tab char = ), (Html.div [ - (Html.Attributes.class "roster-editor-character-attributes") + (Html.Attributes.class "roster-editor-character-attributes"), + (Html.Attributes.class + ( + if (is_using_secondary) + then "roster-editor-character-attributes-secondary" + else "roster-editor-character-attributes-primary" + ) + ) ] [ - (Battle.View.Omnimods.get_unsigned_html - (Battle.Struct.Omnimods.apply_damage_modifier - (Battle.Struct.Omnimods.get_attribute_mod - Battle.Struct.Attributes.DamageModifier - omnimods + ( + if (is_using_secondary) + then (Battle.View.Omnimods.get_user_friendly_html omnimods) + else + (Battle.View.Omnimods.get_unsigned_html + (Battle.Struct.Omnimods.apply_damage_modifier + (Battle.Struct.Omnimods.get_attribute_mod + Battle.Struct.Attributes.DamageModifier + omnimods + ) + omnimods + ) ) - omnimods - ) ) ] ) diff --git a/src/shared/battle/Battle/Struct/Omnimods.elm b/src/shared/battle/Battle/Struct/Omnimods.elm index 80d97a5..f36efcd 100644 --- a/src/shared/battle/Battle/Struct/Omnimods.elm +++ b/src/shared/battle/Battle/Struct/Omnimods.elm @@ -79,7 +79,11 @@ merge_mods a_mods b_mods = scale_dict_value : Float -> String -> Int -> Int scale_dict_value modifier entry_name value = - (ceiling ((toFloat value) * modifier)) + let new_value = ((toFloat value) * modifier) in + if (new_value < 0) + then (floor new_value) + else (ceiling new_value) + -------------------------------------------------------------------------------- -- EXPORTED -------------------------------------------------------------------- -------------------------------------------------------------------------------- |