diff --git a/apps/arena/lib/arena/game/effect.ex b/apps/arena/lib/arena/game/effect.ex index e82d7d92f..66973ef85 100644 --- a/apps/arena/lib/arena/game/effect.ex +++ b/apps/arena/lib/arena/game/effect.ex @@ -50,20 +50,14 @@ defmodule Arena.Game.Effect do cond do Map.has_key?(game_state.players, entity_id) -> update_in(game_state, [:players, entity_id, :aditional_info, :effects], fn current_effects -> - # TODO: here we filter "all damage" effects for toxic Shinko attacks. This needs a better handling. - Enum.reject(current_effects, fn effect -> - effect.owner_id == owner_id and - not Enum.all?(effect.effect_mechanics, fn mechanic -> mechanic.name == "damage" end) - end) + # Here we remove all effects from owner if they only apply there (pools for now). + Enum.reject(current_effects, fn effect -> effect.owner_id == owner_id and effect.disabled_outside_pool end) end) Map.has_key?(game_state.crates, entity_id) -> update_in(game_state, [:crates, entity_id, :aditional_info, :effects], fn current_effects -> - # TODO: here we filter "all damage" effects for toxic Shinko attacks. This needs a better handling. - Enum.reject(current_effects, fn effect -> - effect.owner_id == owner_id and - not Enum.all?(effect.effect_mechanics, fn mechanic -> mechanic.name == "damage" end) - end) + # Here we remove all effects from owner if they only apply there (pools for now). + Enum.reject(current_effects, fn effect -> effect.owner_id == owner_id and effect.disabled_outside_pool end) end) true -> diff --git a/apps/game_backend/lib/game_backend/curse_of_mirra/effect.ex b/apps/game_backend/lib/game_backend/curse_of_mirra/effect.ex index 151cc58ad..fb41ad288 100644 --- a/apps/game_backend/lib/game_backend/curse_of_mirra/effect.ex +++ b/apps/game_backend/lib/game_backend/curse_of_mirra/effect.ex @@ -13,6 +13,7 @@ defmodule GameBackend.CurseOfMirra.Effect do :allow_multiple_effects, :consume_projectile, :effect_mechanics, + :disabled_outside_pool, :name ]} embedded_schema do @@ -22,6 +23,7 @@ defmodule GameBackend.CurseOfMirra.Effect do field(:one_time_application, :boolean) field(:allow_multiple_effects, :boolean) field(:consume_projectile, :boolean) + field(:disabled_outside_pool, :boolean) embeds_many(:effect_mechanics, EffectMechanic) end @@ -33,12 +35,14 @@ defmodule GameBackend.CurseOfMirra.Effect do :one_time_application, :allow_multiple_effects, :consume_projectile, + :disabled_outside_pool, :name ]) |> validate_required([ :remove_on_action, :one_time_application, :allow_multiple_effects, + :disabled_outside_pool, :name ]) |> cast_embed(:effect_mechanics) diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs index 5a6f73857..c43484839 100644 --- a/priv/repo/seeds.exs +++ b/priv/repo/seeds.exs @@ -240,6 +240,7 @@ singularity_effect = %{ remove_on_action: false, one_time_application: true, allow_multiple_effects: true, + disabled_outside_pool: true, effect_mechanics: [ %{ name: "pull", @@ -262,6 +263,7 @@ denial_of_service = remove_on_action: false, one_time_application: true, allow_multiple_effects: true, + disabled_outside_pool: true, effect_mechanics: [ %{ name: "damage", @@ -279,6 +281,7 @@ invisible_effect = remove_on_action: true, one_time_application: false, allow_multiple_effects: true, + disabled_outside_pool: true, effect_mechanics: [ %{ name: "invisible", @@ -301,6 +304,7 @@ whirlwind_effect = remove_on_action: false, one_time_application: false, allow_multiple_effects: true, + disabled_outside_pool: true, effect_mechanics: [ %{ name: "defense_change", @@ -318,6 +322,7 @@ buff_singularity_effect = one_time_application: true, consume_projectile: true, allow_multiple_effects: true, + disabled_outside_pool: true, effect_mechanics: [ %{ name: "buff_pool", @@ -334,6 +339,7 @@ inferno_effect = %{ remove_on_action: false, one_time_application: true, allow_multiple_effects: true, + disabled_outside_pool: true, effect_mechanics: [ %{ name: "speed_boost", @@ -356,6 +362,7 @@ toxic_onion_effect = %{ duration_ms: 3000, one_time_application: false, allow_multiple_effects: true, + disabled_outside_pool: false, effect_mechanics: [ %{ name: "damage", @@ -372,6 +379,7 @@ peb_effect = %{ duration_ms: 4000, one_time_application: true, allow_multiple_effects: true, + disabled_outside_pool: false, effect_mechanics: [ %{ name: "damage", @@ -1221,6 +1229,7 @@ golden_clock_effect = %{ remove_on_action: false, one_time_application: true, allow_multiple_effects: true, + disabled_outside_pool: false, effect_mechanics: [ %{ name: "reduce_stamina_interval", @@ -1266,6 +1275,7 @@ magic_boots_effect = remove_on_action: false, one_time_application: true, allow_multiple_effects: true, + disabled_outside_pool: true, effect_mechanics: [ %{ name: "speed_boost", @@ -1295,6 +1305,7 @@ mirra_blessing_effect = remove_on_action: false, one_time_application: true, allow_multiple_effects: true, + disabled_outside_pool: true, effect_mechanics: [ %{ name: "damage_immunity", @@ -1323,6 +1334,7 @@ giant_effect = remove_on_action: false, one_time_application: true, allow_multiple_effects: true, + disabled_outside_pool: true, effect_mechanics: [ %{ name: "modify_radius", @@ -1367,6 +1379,7 @@ polymorph_effect = %{ name: "polymorph_effect", duration_ms: 9000, remove_on_action: true, + disabled_outside_pool: false, one_time_application: true, allow_multiple_effects: true, effect_mechanics: [] @@ -1423,6 +1436,7 @@ _slow_field_effect = %{ remove_on_action: true, one_time_application: true, allow_multiple_effects: true, + disabled_outside_pool: false, effect_mechanics: [ %{ name: "speed_boost",