Skip to content

Commit

Permalink
Cap bonus defense amount (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
agustinesco authored Aug 8, 2024
1 parent bcb1c1d commit 2ff1191
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/arena/lib/arena/game/effect.ex
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ defmodule Arena.Game.Effect do
end

defp apply_stat_modifier(player, {:defense_change, defense_change}) do
update_in(player, [:aditional_info, :bonus_defense], fn bonus_defense -> bonus_defense + defense_change.modifier end)
update_in(player, [:aditional_info, :bonus_defense], fn bonus_defense ->
min(1.0, bonus_defense + defense_change.modifier)
end)
end

defp apply_stat_modifier(player, {:reduce_stamina_interval, reduce_stamina_interval}) do
Expand Down

0 comments on commit 2ff1191

Please sign in to comment.