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

scoutexplore.py (2916B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\behaviors\trees\scoutexplore.py
      2 from behaviors.actions.ballparks import WarpToNewLocation, FindPointToExplore
      3 from behaviors.conditions.ballparks import IsCoordinateInSameBubbleCondition
      4 from behaviors.const.blackboardchannels import WARP_SCRAMBLED_ADDRESS
      5 from behaviors.monitors.timers import StartTimerBlocks
      6 from behaviors.monitors.blackboards import BlackboardMessageMonitor
      7 from behaviors import composites
      8 from behaviors.decorators import modifiers
      9 from behaviors.blackboards.scopes import ScopeTypes
     10 import inventorycommon.const as invconst
     11 from brennivin.itertoolsext import Bundle
     12 WARP_TO_LOCATION_GROUP = (ScopeTypes.EntityGroup, 'WARP_TO_LOCATION_GROUP')
     13 RESET_TIMER = (ScopeTypes.EntityGroup, 'EXPLORATION_RESET_TIMER')
     14 LANDMARK_ARCHETYPE = 2
     15 AJS1 = 5460
     16 UNIDENTIFIED_STRUCTURE = 5610
     17 DUNGEON_WORMHOLE = 5643
     18 
     19 def CreateExplorationBehavior():
     20     root = composites.PrioritySelector(Bundle(name='Exploration'))
     21 
     22     def CreateShouldExplore():
     23         node = composites.Sequence(Bundle(name='Should Change Location'))
     24 
     25         def CreateFindNewExplorationPoint():
     26             node = FindPointToExplore(Bundle(name='Find Point To Explore', locationMessage=WARP_TO_LOCATION_GROUP, groupsOfInterest=[invconst.groupStargate,
     27              invconst.groupStation,
     28              invconst.groupPlanetaryCustomsOffices,
     29              invconst.groupAsteroidBelt], dungeonsOfInterest=[AJS1, UNIDENTIFIED_STRUCTURE, DUNGEON_WORMHOLE], dungeonArchetypesOfInterest=[], pickSpecificChance=0.3, shouldConsiderUnspawnedDungeons=False))
     30             return node
     31 
     32         node.AddSubTask(BlackboardMessageMonitor(Bundle(name='Reset On Timer Change', messageAddress=RESET_TIMER)))
     33         node.AddSubTask(StartTimerBlocks(Bundle(name='Exploration Reset Timer', timeoutSeconds=360, timerAddress=RESET_TIMER)))
     34         node.AddSubTask(CreateFindNewExplorationPoint())
     35         node.AddSubTask(IsCoordinateInSameBubbleCondition(Bundle(name='Force Fail So We Warp', coordinateAddress=WARP_TO_LOCATION_GROUP)))
     36         return node
     37 
     38     def CreateWarpToNewLocationBehavior():
     39         node = composites.Sequence(Bundle(name='Warp To New Location'))
     40 
     41         def CreateIsLocationNotInSameBubble():
     42             node = modifiers.Not()
     43             node.AddSubTask(IsCoordinateInSameBubbleCondition(Bundle(coordinateAddress=WARP_TO_LOCATION_GROUP)))
     44             return node
     45 
     46         node.AddSubTask(BlackboardMessageMonitor(Bundle(name='Reset On Warp Location Message', messageAddress=WARP_TO_LOCATION_GROUP)))
     47         node.AddSubTask(CreateIsLocationNotInSameBubble())
     48         node.AddSubTask(WarpToNewLocation(Bundle(name='Do Warp', locationMessage=WARP_TO_LOCATION_GROUP, warpScrambledAddress=WARP_SCRAMBLED_ADDRESS)))
     49         return node
     50 
     51     root.AddSubTask(CreateShouldExplore())
     52     root.AddSubTask(CreateWarpToNewLocationBehavior())
     53     return root