public override void Deserialize() { type = (Helpers.KillType)_contentReader.ReadByte(); playerID = _contentReader.ReadUInt16(); vehicleID = _contentReader.ReadUInt16(); killerID = _contentReader.ReadUInt16(); }
/// <summary> /// Triggered when a player has died, by any means /// </summary> /// <remarks>killer may be null if it wasn't a player kill</remarks> public bool playerDeath(Player victim, Player killer, Helpers.KillType killType, CS_VehicleDeath update) { if (victim._team == _red || victim._team == _blue) { return(true); } if (_arena._bGameRunning) { if (killer == null) { _arena.sendArenaMessage(String.Format("{0} has been knocked out of the Tournament by the storm.", victim._alias)); } else if (killer._alias == victim._alias) { _arena.sendArenaMessage(String.Format("{0} has been knocked out of the Tournament by the storm.", victim._alias)); } else { _arena.sendArenaMessage(String.Format("{0} has been knocked out of the Tournament by {1}.", victim._alias, killer._alias)); } victim.sendMessage(0, "You've been knocked out of the tournament, You may continue to play Red/Blue until the next game!"); } return(true); }
public bool playerDeath(Player victim, Player killer, Helpers.KillType killType, CS_VehicleDeath update) { //Calculate rewards AGAIN if double exp if (doubleXP == 2 && killer != null) { Logic_Rewards.calculatePlayerKillRewards(victim, killer, update); } return(true); }
/// <summary> /// Deserializes the data present in the packet contents into data fields in the class. /// </summary> public override void Deserialize() { type = (Helpers.KillType)_contentReader.ReadByte(); killerPlayerID = _contentReader.ReadUInt32(); unk1 = _contentReader.ReadUInt16(); killedID = _contentReader.ReadUInt16(); positionX = _contentReader.ReadInt16(); positionY = _contentReader.ReadInt16(); unk2 = _contentReader.ReadUInt16(); }
public bool playerDeath(Player victim, Player killer, Helpers.KillType killType, CS_VehicleDeath update) { if (gameState != GameState.ActiveGame) { return(true); } //Update our kill counter UpdateDeath(victim, killer); return(true); }
public bool playerDeath(Player victim, Player killer, Helpers.KillType killType, CS_VehicleDeath update) { //Was it a player kill? if (killType == Helpers.KillType.Player) { //No team killing! if (victim._team != killer._team) { //Does the killer have an HQ? if (_hqs[killer._team] != null) { //Reward his HQ! (Victims bounty + half of own) _hqs[killer._team].Bounty += victim.Bounty + (killer.Bounty / 2); } } } //Was it a computer kill? if (killType == Helpers.KillType.Computer) { //Let's find the vehicle! Computer cvehicle = victim._arena.Vehicles.FirstOrDefault(v => v._id == update.killerPlayerID) as Computer; Player vehKiller = cvehicle._creator; //Do they exist? if (cvehicle != null && vehKiller != null) { //We'll take it from here... update.type = Helpers.KillType.Player; update.killerPlayerID = vehKiller._id; //Don't reward for teamkills if (vehKiller._team == victim._team) { Logic_Assets.RunEvent(vehKiller, _arena._server._zoneConfig.EventInfo.killedTeam); } else { Logic_Assets.RunEvent(vehKiller, _arena._server._zoneConfig.EventInfo.killedEnemy); } //Increase stats/HQ bounty and notify arena of the kill! if (_hqs[vehKiller._team] != null) { //Reward his HQ! (Victims bounty + half of own) _hqs[vehKiller._team].Bounty += victim.Bounty + (vehKiller.Bounty / 2); } vehKiller.Kills++; victim.Deaths++; Logic_Rewards.calculatePlayerKillRewards(victim, vehKiller, update); return(false); } } return(true); }
public bool playerDeath(Player victim, Player killer, Helpers.KillType killType, CS_VehicleDeath update) { //Respawn flag where it was initially spawn if a marine died carrying one try { _arena.flagResetPlayer(victim); } catch (Exception e) { Log.write(TLog.Exception, "exception in flagResetPlayer(victim):: '{0}'", e); } //Was it a computer kill? if (killType == Helpers.KillType.Computer) { //Let's find the vehicle! Computer cvehicle = victim._arena.Vehicles.FirstOrDefault(v => v._id == update.killerPlayerID) as Computer; Player vehKiller = cvehicle._creator; //Does it exist? if (cvehicle != null && vehKiller != null) { //We'll take it from here... update.type = Helpers.KillType.Player; update.killerPlayerID = vehKiller._id; //Don't reward for teamkills if (vehKiller._team == victim._team) { Logic_Assets.RunEvent(vehKiller, _arena._server._zoneConfig.EventInfo.killedTeam); } else { Logic_Assets.RunEvent(vehKiller, _arena._server._zoneConfig.EventInfo.killedEnemy); } //Increase stats and notify arena of the kill! vehKiller.Kills++; victim.Deaths++; Logic_Rewards.calculatePlayerKillRewards(victim, vehKiller, update); return(false); } } return(true); }
public bool playerDeath(Player victim, Player killer, Helpers.KillType killType, CS_VehicleDeath update) { return(true); }
public bool playerDeath(Player victim, Player killer, Helpers.KillType killType, CS_VehicleDeath update) { if (killer == null) { return(true); } //Was it a player kill? if (killType == Helpers.KillType.Player) { //No team killing! if (victim._team != killer._team) { //Does the killer have an HQ? if (_hqs[killer._team] != null) { //Reward his HQ! (Victims bounty + half of own) _hqs[killer._team].Bounty += victim.Bounty + (killer.Bounty / 2); } } //Find out if KOTH is running if (_activeCrowns.Count == 0 || killer == null) { return(true); } //Handle crowns if (_playerCrownStatus.ContainsKey(victim) && _playerCrownStatus[victim].crown) { //Incr crownDeaths _playerCrownStatus[victim].crownDeaths++; if (_playerCrownStatus[victim].crownDeaths >= _config.king.deathCount) { //Take it away now _playerCrownStatus[victim].crown = false; _noCrowns.Remove(victim); Helpers.Player_Crowns(_arena, false, _noCrowns); } if (_playerCrownStatus.ContainsKey(killer)) { if (!_playerCrownStatus[killer].crown) { _playerCrownStatus[killer].crownKills++; } } } //Reset their timer if (_playerCrownStatus.ContainsKey(killer)) { if (_playerCrownStatus[killer].crown) { updateCrownTime(killer); } else if (_config.king.crownRecoverKills != 0) { //Should they get a crown? if (_playerCrownStatus[killer].crownKills >= _config.king.crownRecoverKills) { _playerCrownStatus[killer].crown = true; giveCrown(killer); } } } } //Was it a computer kill? if (killType == Helpers.KillType.Computer) { //Let's find the vehicle! Computer cvehicle = victim._arena.Vehicles.FirstOrDefault(v => v._id == update.killerPlayerID) as Computer; Player vehKiller = cvehicle._creator; //Do they exist? if (cvehicle != null && vehKiller != null) { //We'll take it from here... update.type = Helpers.KillType.Player; update.killerPlayerID = vehKiller._id; //Don't reward for teamkills if (vehKiller._team == victim._team) { Logic_Assets.RunEvent(vehKiller, _arena._server._zoneConfig.EventInfo.killedTeam); } else { Logic_Assets.RunEvent(vehKiller, _arena._server._zoneConfig.EventInfo.killedEnemy); } //Increase stats/HQ bounty and notify arena of the kill! if (_hqs[vehKiller._team] != null) { //Reward his HQ! (Victims bounty + half of own) _hqs[vehKiller._team].Bounty += victim.Bounty + (vehKiller.Bounty / 2); } vehKiller.Kills++; victim.Deaths++; Logic_Rewards.calculatePlayerKillRewards(victim, vehKiller, update); return(false); } } return(true); }
public void playerDeath(Player victim, Player killer, Helpers.KillType killType, CS_VehicleDeath update) { }
public bool playerDeath(Player victim, Player killer, Helpers.KillType killType, CS_VehicleDeath update) { //Resets the flag to where the player picked up the flag //_arena.flagResetPlayer(victim); return(true); }