コード例 #1
0
 public bool SolveMission(ServerPlayer a_player, bool a_interactionOnly = false)
 {
     if (m_missions.ContainsKey(a_player.m_pid))
     {
         for (int i = 0; i < m_missionObjs.Length; i++)
         {
             Vector3 b   = a_player.GetPosition() + a_player.GetForward() * 2f;
             float   num = (!a_interactionOnly) ? 144f : 9f;
             if (!(null != m_missionObjs[i]) || !((m_missionObjs[i].gameObject.transform.position - b).sqrMagnitude < num))
             {
                 continue;
             }
             List <Mission> list = (List <Mission>)m_missions[a_player.m_pid];
             for (int j = 0; j < list.Count; j++)
             {
                 if ((!a_interactionOnly || list[j].m_type == eMissiontype.eRescue) && m_missionObjs[i].IsMission(list[j]))
                 {
                     a_player.AddXp(list[j].m_xpReward);
                     list.RemoveAt(j);
                     UpdatePlayer(a_player);
                     m_server.SendSpecialEvent(a_player, eSpecialEvent.missionComplete);
                     return(true);
                 }
             }
         }
     }
     return(false);
 }