public override void Death(bool gibbed = false) { if (CustomNetworkManager.Instance._isServer) { PlayerNetworkActions pNet = GetComponent <PlayerNetworkActions>(); pNet.RpcSpawnGhost(); PlayerMove pM = GetComponent <PlayerMove>(); pM.isGhost = true; pM.allowInput = true; if (lastDamager == gameObject.name) { pNet.CmdSendAlertMessage("<color=red><b>" + gameObject.name + " commited suicide</b></color>", true); //killfeed } else if (lastDamager.EndsWith(gameObject.name)) // chain reactions { pNet.CmdSendAlertMessage("<color=red><b>" + gameObject.name + " screwed himself up with some help (" + lastDamager + ")</b></color>", true); //killfeed } else { PlayerList.Instance.UpdateKillScore(lastDamager); pNet.CmdSendAlertMessage( "<color=red><b>" + lastDamager + "</b> has killed <b>" + gameObject.name + "</b></color>", true); //killfeed } countRespawn = true; respawnTime = 0f; GetComponent <PlayerNetworkActions>().CmdDropItem("leftHand"); GetComponent <PlayerNetworkActions>().CmdDropItem("rightHand"); gameObject.GetComponent <WeaponNetworkActions>().BloodSplat(transform.position, Sprites.BloodSplatSize.medium); Debug.Log("respawn initiated.."); } mobStat = MobConsciousStat.DEAD; base.Death(gibbed); }
protected override void OnDeathActions() { if (CustomNetworkManager.Instance._isServer) { playerNetworkActions.RpcSpawnGhost(); PlayerMove pM = GetComponent <PlayerMove>(); pM.isGhost = true; pM.allowInput = true; if (LastDamagedBy == gameObject.name) { playerNetworkActions.CmdSendAlertMessage("<color=red><b>" + gameObject.name + " commited suicide</b></color>", true); //killfeed } else if (LastDamagedBy.EndsWith(gameObject.name)) // chain reactions { playerNetworkActions.CmdSendAlertMessage("<color=red><b>" + gameObject.name + " screwed himself up with some help (" + LastDamagedBy + ")</b></color>", true); //killfeed } else { PlayerList.Instance.UpdateKillScore(LastDamagedBy); playerNetworkActions.CmdSendAlertMessage( "<color=red><b>" + LastDamagedBy + "</b> has killed <b>" + gameObject.name + "</b></color>", true); //killfeed } playerNetworkActions.ValidateDropItem("leftHand", true); playerNetworkActions.ValidateDropItem("rightHand", true); if (isServer) { EffectsFactory.Instance.BloodSplat(transform.position, BloodSplatSize.large); } //FIXME Remove for next demo playerNetworkActions.RespawnPlayer(10); } }