public void ExecuteAction(Player player, Pickup pickup) { if (Flag.IsPositionBase) { if (player.PlayerTeam.Id == TeamRival.Id) { Captured(player); pickup.Dispose(); } else if (player == TeamRival.Flag.PlayerCaptured) { TeamRival.Carry(player); } } else { if (player.PlayerTeam.Id == Id) { Recover(player); } else { Captured(player, false); } pickup.Dispose(); } }
public void Carry(Player player) { BasePlayer.SendClientMessageToAll($"{OtherColor}[Team {NameTeam}]: {player.Name} llevó la bandera {NameColor} del equipo {NameTeam} a su base."); BasePlayer.GameTextForAll($"~n~~n~~n~{TeamRival.ColorGameText}+1 score team {TeamRival.NameTeam}", 5000, 3); player.RemoveAttachedObject(0); Flag.Create(); PickupInfo.Dispose(); Flag.PlayerCaptured = null; Flag.IsPositionBase = true; ++TeamRival.Score; TeamRival.UpdateTdScore(); player.UpdateAdrenaline(10, "llevar la bandera tu base"); player.UpdateData("droppedFlags", ++player.Data.DroppedFlags); foreach (Player player1 in player.PlayerTeam.Players) { if (player != player1) { player1.UpdateAdrenaline(3, "ayudar a capturar la bandera"); } } }