예제 #1
0
 public bool UpdateWin(MyPlayer player, MyEntity me)
 {
     if (Won || Lost)
     {
         return(true);
     }
     for (int i = 0; i < m_winTriggers.Count; i++)
     {
         var trigger = m_winTriggers[i];
         if (trigger.IsTrue || trigger.Update(player, me))
         { //Won!
             MySyncMissionTriggers.PlayerWon(player.Id, i);
             return(true);
         }
     }
     return(false);
 }
 public bool UpdateLose(MyPlayer.PlayerId Id, MyEntity me)
 {
     if (Won || Lost)
     {
         return(true);
     }
     for (int i = 0; i < m_loseTriggers.Count; i++)
     {
         var trigger = m_loseTriggers[i];
         if (trigger.IsTrue || trigger.Update(me))
         { //Loser!
             MySyncMissionTriggers.PlayerLost(Id, i);
             return(true);
         }
     }
     return(false);
 }
예제 #3
0
 public bool UpdateLose(MyCharacter me)
 {
     if (Won || Lost)
     {
         return(true);
     }
     for (int i = 0; i < m_loseTriggers.Count; i++)
     {
         var trigger = m_loseTriggers[i];
         if (trigger.IsTrue || trigger.Update(me))
         { //Loser!
             MySyncMissionTriggers.PlayerLost(me.ControllerInfo.Controller.Player.Id, i);
             return(true);
         }
     }
     return(false);
 }
예제 #4
0
        public bool RaiseSignal(MyPlayer.PlayerId Id, Signal signal)
        {
            if (Won || Lost)
            {
                return(true);
            }
            switch (signal)
            {
            case Signal.OTHER_WON:
            case Signal.PLAYER_DIED:
            case Signal.ALL_OTHERS_LOST:
                for (int i = 0; i < m_winTriggers.Count; i++)
                {
                    var trigger = m_winTriggers[i];
                    if (trigger.IsTrue || trigger.RaiseSignal(signal))
                    {     //Won!
                        MySyncMissionTriggers.PlayerWon(Id, i);
                        return(true);
                    }
                }

                for (int i = 0; i < m_loseTriggers.Count; i++)
                {
                    var trigger = m_loseTriggers[i];
                    if (trigger.IsTrue || trigger.RaiseSignal(signal))
                    {    //Lost
                        MySyncMissionTriggers.PlayerLost(Id, i);
                        return(true);
                    }
                }
                break;

            default:
                Debug.Fail("Wrong signal received");
                break;
            }
            return(false);
        }