def set_lootPositions(self, prevLootPositions):
        for item in prevLootPositions:
            event = AirDropEvent(AirDropEvent.AIR_DROP_LOOP_LEFT, ctx=item)
            g_eventBus.handleEvent(event, scope=EVENT_BUS_SCOPE.BATTLE)

        for item in self.lootPositions:
            event = AirDropEvent(AirDropEvent.AIR_DROP_LOOP_ENTERED, ctx=item)
            g_eventBus.handleEvent(event, scope=EVENT_BUS_SCOPE.BATTLE)
    def setSlice_lootPositions(self, path, oldValue):
        addedItems = _getNewValue(self.lootPositions, path)
        removedItems = oldValue
        for item in addedItems:
            event = AirDropEvent(AirDropEvent.AIR_DROP_LOOP_ENTERED, ctx=item)
            g_eventBus.handleEvent(event, scope=EVENT_BUS_SCOPE.BATTLE)

        for item in removedItems:
            event = AirDropEvent(AirDropEvent.AIR_DROP_LOOP_LEFT, ctx=item)
            g_eventBus.handleEvent(event, scope=EVENT_BUS_SCOPE.BATTLE)
Beispiel #3
0
 def onCreated(self, placement):
     event = AirDropEvent(AirDropEvent.AIR_DROP_SPAWNED, ctx={'id': placement.id,
      'position': placement.position})
     g_eventBus.handleEvent(event, scope=EVENT_BUS_SCOPE.BATTLE)
     acmp = self._getAirdropCmp()
     if acmp:
         acmp.scheduleLoot(placement.id, placement.position, placement.dropTime)
Beispiel #4
0
 def onDestroyed(self, placement):
     event = AirDropEvent(AirDropEvent.AIR_DROP_LANDED, ctx={'id': placement.id})
     g_eventBus.handleEvent(event, scope=EVENT_BUS_SCOPE.BATTLE)