예제 #1
0
        public static bool CanLeaveSquad()
        {
            bool            result          = true;
            SquadController squadController = Service.Get <SquadController>();
            CurrentPlayer   currentPlayer   = Service.Get <CurrentPlayer>();
            Squad           currentSquad    = squadController.StateManager.GetCurrentSquad();

            if (currentSquad == null)
            {
                return(result);
            }
            SquadWarStatusType currentStatus = squadController.WarManager.GetCurrentStatus();

            if (currentStatus == SquadWarStatusType.PhaseCooldown)
            {
                return(result);
            }
            SquadMember squadMemberById = SquadUtils.GetSquadMemberById(currentSquad, currentPlayer.PlayerId);

            if (squadController.WarManager.IsMemberInWarParty(squadMemberById.MemberID) || squadController.WarManager.IsSquadMemberInWarOrMatchmaking(squadMemberById))
            {
                result = false;
            }
            return(result);
        }
예제 #2
0
        public static void SetSquadMemberRole(Squad squad, string memberId, SquadRole role)
        {
            SquadMember squadMemberById = SquadUtils.GetSquadMemberById(squad, memberId);

            if (squadMemberById != null)
            {
                squadMemberById.Role = role;
            }
        }
예제 #3
0
        public static void RemoveSquadMember(Squad squad, string memberId)
        {
            SquadMember squadMemberById = SquadUtils.GetSquadMemberById(squad, memberId);

            if (squadMemberById != null && squad != null)
            {
                squad.MemberList.Remove(squadMemberById);
                squad.BattleScore -= squadMemberById.Score;
                squad.MemberCount--;
            }
        }
예제 #4
0
 public unsafe static long $Invoke15(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(SquadUtils.GetSquadMemberById((Squad)GCHandledObjects.GCHandleToObject(*args), Marshal.PtrToStringUni(*(IntPtr *)(args + 1)))));
 }