Ejemplo n.º 1
0
        public override void OnDeath(PlayerControl killer = null)
        {
            killer = killer ?? meetingKiller;
            if (killer != null && killer != player && killer.isAlive() && !killer.isGM())
            {
                if ((revengeCrew && killer.isCrew()) ||
                    (revengeNeutral && killer.isNeutral()) ||
                    (revengeImpostor && killer.isImpostor()))
                {
                    if (meetingKiller == null)
                    {
                        player.MurderPlayer(killer);
                    }
                    else
                    {
                        killer.Exiled();
                        if (PlayerControl.LocalPlayer == killer)
                        {
                            HudManager.Instance.KillOverlay.ShowKillAnimation(player.Data, killer.Data);
                        }
                    }

                    finalStatuses[killer.PlayerId] = FinalStatus.Revenge;
                }
            }
            else if (killer == null && revengeExile && PlayerControl.LocalPlayer == player)
            {
                var candidates = PlayerControl.AllPlayerControls.ToArray().Where(x => x != player && x.isAlive()).ToList();
                int targetID   = rnd.Next(0, candidates.Count);
                var target     = candidates[targetID];

                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.NekoKabochaExile, Hazel.SendOption.Reliable, -1);
                writer.Write(target.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.nekoKabochaExile(target.PlayerId);
            }
            meetingKiller = null;
        }