NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

explore.py (2102B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\behaviors\trees\explore.py
      2 from behaviors.actions.ballparks import FindPointToExplore
      3 from behaviors.conditions.ballparks import IsCoordinateInSameBubbleCondition
      4 from behaviors.monitors.timers import StartTimerBlocks
      5 from behaviors.monitors.blackboards import BlackboardMessageMonitor
      6 from behaviors.trees.travel import CreateWarpToNewLocationBehavior, WARP_TO_LOCATION_GROUP
      7 from behaviors import composites
      8 from behaviors.blackboards.scopes import ScopeTypes
      9 from brennivin.itertoolsext import Bundle
     10 RESET_TIMER = (ScopeTypes.EntityGroup, 'EXPLORATION_RESET_TIMER')
     11 
     12 def CreateExplorationBehavior(groupsOfInterest = None, dungeonsOfInterest = None, dungeonArchetypesOfInterest = None, explorationIntervalSeconds = 1800):
     13     groupsOfInterest = groupsOfInterest or []
     14     dungeonsOfInterest = dungeonsOfInterest or []
     15     dungeonArchetypesOfInterest = dungeonArchetypesOfInterest or []
     16     root = composites.PrioritySelector(Bundle(name='Exploration'))
     17 
     18     def CreateShouldExplore():
     19         node = composites.Sequence(Bundle(name='Should Change Location'))
     20 
     21         def CreateFindNewExplorationPoint():
     22             return FindPointToExplore(Bundle(name='Find Point To Explore', locationMessage=WARP_TO_LOCATION_GROUP, groupsOfInterest=groupsOfInterest, dungeonsOfInterest=dungeonsOfInterest, dungeonArchetypesOfInterest=dungeonArchetypesOfInterest, pickSpecificChance=0.3, shouldConsiderUnspawnedDungeons=False))
     23 
     24         node.AddSubTask(BlackboardMessageMonitor(Bundle(name='Reset On Timer Change', messageAddress=RESET_TIMER)))
     25         node.AddSubTask(StartTimerBlocks(Bundle(name='Exploration Reset Timer', timeoutSeconds=explorationIntervalSeconds, timerAddress=RESET_TIMER)))
     26         node.AddSubTask(CreateFindNewExplorationPoint())
     27         node.AddSubTask(IsCoordinateInSameBubbleCondition(Bundle(name='Force Fail So We Warp', coordinateAddress=WARP_TO_LOCATION_GROUP)))
     28         return node
     29 
     30     root.AddSubTask(CreateShouldExplore())
     31     root.AddSubTask(CreateWarpToNewLocationBehavior())
     32     return root