示例#1
0
        public void OnEnterStation()
        {
            s_Log.InfoFormat("OnEnterStation() message received at ContractManager".Color(LogColor.yellow));
            EnterStationEvent evt = new EnterStationEvent(nebulaObject);

            OnEvent(evt);
        }
示例#2
0
 public override ContractCheckStatus CheckEvent(BaseEvent evt)
 {
     if (evt.eventType == EventType.EnterStation && state == ContractState.accepted)
     {
         EnterStationEvent enterStationEvent = evt as EnterStationEvent;
         if (enterStationEvent != null)
         {
             if (evt.source.mmoWorld().GetID() == targetWorld)
             {
                 var player = enterStationEvent.source.GetComponent <MmoActor>();
                 if (player.Inventory.HasItem(InventoryObjectType.contract_item, itemId))
                 {
                     if (Ready())
                     {
                         if (player.Inventory.RemoveContractItems(id))
                         {
                             player.EventOnInventoryUpdated();
                         }
                         return(ContractCheckStatus.ready);
                     }
                 }
             }
         }
     }
     return(ContractCheckStatus.none);
 }
示例#3
0
 public override ContractCheckStatus CheckEvent(BaseEvent evt)
 {
     if (evt.eventType == EventType.InventoryItemsAdded && state == ContractState.accepted)
     {
         if (stage == 0)
         {
             InventoryItemsAddedEvent iiaEvent = evt as InventoryItemsAddedEvent;
             if (iiaEvent != null)
             {
                 if (iiaEvent.HasContractItem(itemId))
                 {
                     SetStage(1);
                     return(ContractCheckStatus.stage_changed);
                 }
             }
         }
     }
     if (evt.eventType == EventType.EnterStation && state == ContractState.accepted)
     {
         //if(stage == 1 ) {
         EnterStationEvent enterStationEvent = evt as EnterStationEvent;
         if (enterStationEvent != null)
         {
             if (evt.source.mmoWorld().GetID() == targetWorld)
             {
                 var player = enterStationEvent.source.GetComponent <MmoActor>();
                 if (player.Inventory.HasContractItems(id))
                 {
                     if (Ready())
                     {
                         if (player.Inventory.RemoveContractItems(id))
                         {
                             player.EventOnInventoryUpdated();
                         }
                         return(ContractCheckStatus.ready);
                     }
                 }
             }
         }
         //}
     }
     return(ContractCheckStatus.none);
 }