Esempio n. 1
0
            //handle the murder after it's ran
            public static void Postfix(PlayerControl __instance, PlayerControl CAKODNGLPDF)
            {
                var deadBody = new DeadPlayer();

                deadBody.PlayerId    = CAKODNGLPDF.PlayerId;
                deadBody.KillerId    = __instance.PlayerId;
                deadBody.KillTime    = DateTime.UtcNow;
                deadBody.DeathReason = DeathReason.Kill;
                if (__instance.isPlayerRole("Officer"))
                {
                    __instance.Data.IsImpostor = false;
                }
                if (__instance.PlayerId == CAKODNGLPDF.PlayerId)
                {
                    deadBody.DeathReason = (DeathReason)3;
                }
                killedPlayers.Add(deadBody);
            }
            //handle the murder after it's ran
            public static void Postfix(PlayerControl __instance, PlayerControl CAKODNGLPDF)
            {
                var deadBody = new DeadPlayer();

                deadBody.PlayerId    = CAKODNGLPDF.PlayerId;
                deadBody.KillerId    = __instance.PlayerId;
                deadBody.KillTime    = DateTime.UtcNow;
                deadBody.DeathReason = DeathReason.Kill;
                if (OfficerSettings.Officer != null)
                {
                    //check if killer is officer
                    if (__instance == OfficerSettings.Officer)
                    {
                        //finally, set them back to normal
                        __instance.Data.IsImpostor = false;
                    }
                    if (__instance.PlayerId == CAKODNGLPDF.PlayerId)
                    {
                        deadBody.DeathReason = (DeathReason)3;
                    }
                }
                killedPlayers.Add(deadBody);
            }