From c9b6f414e25dd0275bd5e55f041854af9e1cb130 Mon Sep 17 00:00:00 2001 From: tvillegas98 Date: Fri, 13 Dec 2024 10:24:04 -0300 Subject: [PATCH 1/2] fix: add missing prestiges --- .../priv/arena_prestige_ranks.json | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/apps/game_backend/priv/arena_prestige_ranks.json b/apps/game_backend/priv/arena_prestige_ranks.json index 5c37df46f..45fdd3e5e 100644 --- a/apps/game_backend/priv/arena_prestige_ranks.json +++ b/apps/game_backend/priv/arena_prestige_ranks.json @@ -439,6 +439,136 @@ "reward": -12 } ] + }, + { + "position": 11, + "distributions": [ + { + "min": 0, + "max": 49, + "reward": 0 + }, + { + "min": 50, + "max": 99, + "reward": -1 + }, + { + "min": 100, + "max": 199, + "reward": -2 + }, + { + "min": 200, + "max": 299, + "reward": -3 + }, + { + "min": 300, + "max": 399, + "reward": -4 + }, + { + "min": 400, + "max": 499, + "reward": -5 + }, + { + "min": 500, + "max": 599, + "reward": -6 + }, + { + "min": 600, + "max": 699, + "reward": -7 + }, + { + "min": 700, + "max": 799, + "reward": -8 + }, + { + "min": 800, + "max": 899, + "reward": -9 + }, + { + "min": 900, + "max": 999, + "reward": -10 + }, + { + "min": 1000, + "max": 2147483647, + "reward": -12 + } + ] + }, + { + "position": 12, + "distributions": [ + { + "min": 0, + "max": 49, + "reward": 0 + }, + { + "min": 50, + "max": 99, + "reward": -1 + }, + { + "min": 100, + "max": 199, + "reward": -2 + }, + { + "min": 200, + "max": 299, + "reward": -3 + }, + { + "min": 300, + "max": 399, + "reward": -4 + }, + { + "min": 400, + "max": 499, + "reward": -5 + }, + { + "min": 500, + "max": 599, + "reward": -6 + }, + { + "min": 600, + "max": 699, + "reward": -7 + }, + { + "min": 700, + "max": 799, + "reward": -8 + }, + { + "min": 800, + "max": 899, + "reward": -9 + }, + { + "min": 900, + "max": 999, + "reward": -10 + }, + { + "min": 1000, + "max": 2147483647, + "reward": -12 + } + ] } ], "ranks": [ From 3b0ee5ad07d8eae7078efb56d45b0667b5898d44 Mon Sep 17 00:00:00 2001 From: tvillegas98 Date: Tue, 17 Dec 2024 18:17:18 -0300 Subject: [PATCH 2/2] fix: deathmatch position in game tracker --- apps/arena/lib/arena/game_tracker.ex | 6 ++++++ apps/arena/lib/arena/game_updater.ex | 1 + 2 files changed, 7 insertions(+) diff --git a/apps/arena/lib/arena/game_tracker.ex b/apps/arena/lib/arena/game_tracker.ex index ca98e3b12..7f430709b 100644 --- a/apps/arena/lib/arena/game_tracker.ex +++ b/apps/arena/lib/arena/game_tracker.ex @@ -30,6 +30,7 @@ defmodule Arena.GameTracker do | {:heal, player_id(), non_neg_integer()} | {:kill_by_zone, player_id()} | {:select_bounty, player_id(), bounty_quest_id()} + | {:deathmatch_position, player_id(), pos_integer()} @spec push_event(pid(), event()) :: :ok def push_event(match_pid, event) do @@ -136,6 +137,11 @@ defmodule Arena.GameTracker do |> put_in([:position_on_death], data.position_on_death - 1) end + defp update_data(data, {:deathmatch_position, player_id, position}) do + data + |> put_in([:players, player_id, :position], position) + end + defp update_data(data, {:damage_taken, player_id, amount}) do update_in(data, [:players, player_id, :damage_taken], fn damage_taken -> damage_taken + amount end) end diff --git a/apps/arena/lib/arena/game_updater.ex b/apps/arena/lib/arena/game_updater.ex index ff676c7fa..85fc75736 100644 --- a/apps/arena/lib/arena/game_updater.ex +++ b/apps/arena/lib/arena/game_updater.ex @@ -354,6 +354,7 @@ defmodule Arena.GameUpdater do teams_with_kills |> Enum.reduce(game_state, fn {team, position}, game_state_acc -> Enum.reduce(team.players, game_state_acc, fn player, game_state_acc -> + GameTracker.push_event(self(), {:deathmatch_position, player.id, position}) put_player_position(game_state_acc, player.id, position) end) end)