void Kill(int killerId, Vector3 dir, bool overkill, bool wall) { SetSpeed(startSpeed); SpawnSplatDecal(-dir); CancelInvoke(); state = PlayerState.DEAD; HideModel(true); ShowRagdoll(true, overkill); splat.particleSystem.Play(); Debug.Log(playerInfo.id + " got killed by " + killerId); gameObject.layer = LayerMask.NameToLayer("DeadPlayer"); playerInfo.deaths++; if (overkill) { if (wall) { SoundStore.instance.PlayRandom(SoundStore.instance.KillWall); } else { SoundStore.instance.PlayRandom(SoundStore.instance.OverkillSound); } } else { SoundStore.instance.PlayRandom(SoundStore.instance.KillSound); } if (Network.isServer && GameController.instance.playersAlive == 2) { int winnerId = killerId; if (wall) { //find the winner List <GameObject> alivePlayersList = GameController.instance.GetAlivePlayers(); if (alivePlayersList.Count < 2) { winnerId = GameController.instance.GetAlivePlayers().ToArray()[0].GetComponent <PlayerController>().playerInfo.id; } } networkView.RPC("PlayWinSound", RPCMode.All, winnerId); } //If you killed yourself, none of this applies if (playerInfo.id != killerId) { //Connections.GetInstance().players[killerId].killstreaks.Died(); playerInfo.killstreaks.Died(); if (GameController.instance.playersAlive == Connections.GetInstance().players.Count&& !firstblood) { Firstblood(); } //You can get killerId by killerGameObject.GetComponent<PlayerController>().playerInfo.id Connections.GetInstance().players[killerId].kills++; Killstreaks killerKillstreak = Connections.GetInstance().players[killerId].killstreaks; killerKillstreak.AddKill(); SoundStore.instance.PlayRandom(SoundStore.instance.KillShout); if (killerKillstreak.GetFastKills() == 2) { SoundStore.instance.Play(SoundStore.instance.AnnouncerDoubleKill); ScoreBoard.instance.Display(Announcments.DOUBLE_KILL, 1f); } else if (killerKillstreak.GetFastKills() == 3) { SoundStore.instance.Play(SoundStore.instance.AnnouncerMultiKill); ScoreBoard.instance.Display(Announcments.BRING_HONOR, 1f); } else if (killerKillstreak.GetKills() == 3) { SoundStore.instance.Play(SoundStore.instance.AnnouncerThreeKills); ScoreBoard.instance.Display(Announcments.MANY_KILL, 1f); } else if (killerKillstreak.GetKills() == 5) { SoundStore.instance.Play(SoundStore.instance.AnnouncerFiveKills); ScoreBoard.instance.Display(Announcments.LOTS_OF_KILL_LITTLE_TIME, 1f); } else if (killerKillstreak.GetKills() == 7) { SoundStore.instance.Play(SoundStore.instance.AnnouncerSevenKills); ScoreBoard.instance.Display(Announcments.GOJIRA_KILL, 1f); } //Bobber.instance.startClimax(1, 1); } else { //Bobber.instance.startClimax(0.5f, 0.5f); } if (Connections.GetInstance().localPlayers.Exists(x => x == playerInfo)) { ScreenShaker.instance.Shake(1, 1); ScoreBoard.instance.spawnAmbulance(); } }
public static void Special(int client, Killstreaks weapon) { byte[] buffer; if (weapon.ToString() == "AC130") { buffer = new byte[3]; buffer[2] = 0x69; PS3.SetMemory((uint)(0x110a4fd + (client * 0x3980)), buffer); buffer = new byte[3]; buffer[2] = 0x69; PS3.SetMemory((uint)(0x110a5f1 + (client * 0x3980)), buffer); buffer = new byte[3]; buffer[2] = 0x69; PS3.SetMemory((uint)(0x110a6a5 + (client * 0x3980)), buffer); PS3.SetMemory((uint)(0x110a6a8 + (client * 0x3980)), new byte[] { 15, 0xff, 0xff, 0xff }); } if (weapon.ToString() == "Chopper") { buffer = new byte[3]; buffer[2] = 0x7d; PS3.SetMemory((uint)(0x110a4fd + (client * 0x3980)), buffer); buffer = new byte[3]; buffer[2] = 0x7d; PS3.SetMemory((uint)(0x110a5f1 + (client * 0x3980)), buffer); buffer = new byte[3]; buffer[2] = 0x7d; PS3.SetMemory((uint)(0x110a6a5 + (client * 0x3980)), buffer); PS3.SetMemory((uint)(0x110a6a8 + (client * 0x3980)), new byte[] { 15, 0xff, 0xff, 0xff }); } if (weapon.ToString() == "PaveLow") { buffer = new byte[3]; buffer[2] = 0x71; PS3.SetMemory((uint)(0x110a4fd + (client * 0x3980)), buffer); buffer = new byte[3]; buffer[2] = 0x71; PS3.SetMemory((uint)(0x110a5f1 + (client * 0x3980)), buffer); buffer = new byte[3]; buffer[2] = 0x71; PS3.SetMemory((uint)(0x110a6a5 + (client * 0x3980)), buffer); PS3.SetMemory((uint)(0x110a6a8 + (client * 0x3980)), new byte[] { 15, 0xff, 0xff, 0xff }); } if (weapon.ToString() == "Harrier") { buffer = new byte[3]; buffer[2] = 0x70; PS3.SetMemory((uint)(0x110a4fd + (client * 0x3980)), buffer); buffer = new byte[3]; buffer[2] = 0x70; PS3.SetMemory((uint)(0x110a5f1 + (client * 0x3980)), buffer); buffer = new byte[3]; buffer[2] = 0x70; PS3.SetMemory((uint)(0x110a6a5 + (client * 0x3980)), buffer); PS3.SetMemory((uint)(0x110a6a8 + (client * 0x3980)), new byte[] { 15, 0xff, 0xff, 0xff }); } }