Beispiel #1
0
        private static void Prefix(Collider other, MonsterBallGoal __instance)
        {
            if (other.gameObject.layer == 31 && Overload.NetworkManager.IsServer())
            {
                MpTeam mpTeam = (__instance.m_team != MpTeam.TEAM0) ? MpTeam.TEAM0 : MpTeam.TEAM1;

                if (mpTeam == MonsterballAddon.CurrentPlayer.m_mp_team)
                {
                    ServerStatLog.AddGoal();
                    MonsterballAddon.PlayerStats[MonsterballAddon.CurrentPlayer.netId].Goals++;
                    if (MonsterballAddon.LastPlayer != null)
                    {
                        MonsterballAddon.PlayerStats[MonsterballAddon.LastPlayer.netId].GoalAssists++;
                    }
                }
                else
                {
                    ServerStatLog.AddBlunder();
                    MonsterballAddon.PlayerStats[MonsterballAddon.CurrentPlayer.netId].Blunders++;
                }
                NetworkServer.SendToAll(MessageTypes.MsgMonsterballPlayerStats, new MonsterballAddon.PlayerStatesMessage()
                {
                    m_player_states = MonsterballAddon.PlayerStats
                });
            }
        }
Beispiel #2
0
        private static void Prefix(Collider other, MonsterBallGoal __instance)
        {
            if (other.gameObject.layer == 31 && NetworkManager.IsServer())
            {
                MpTeam mpTeam = (__instance.m_team != MpTeam.TEAM0) ? MpTeam.TEAM0 : MpTeam.TEAM1;

                if (mpTeam == MonsterballAddon.CurrentPlayer.m_mp_team)
                {
                    ServerStatLog.AddGoal();
                }
                else
                {
                    ServerStatLog.AddBlunder();
                }
            }
        }