travel.py (1556B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\behaviors\trees\travel.py 2 from behaviors.actions.ballparks import WarpToNewLocation, GetRandomDeepSpacePosition 3 from behaviors.actions.entities import UnspawnSelf 4 from behaviors.blackboards.scopes import ScopeTypes 5 from behaviors.composites import Sequence 6 from behaviors.conditions.ballparks import IsLocationWithinWarpDistance 7 from behaviors.const.blackboardchannels import WARP_SCRAMBLED_ADDRESS 8 from behaviors.monitors.blackboards import BlackboardMessageMonitor 9 from brennivin.itertoolsext import Bundle 10 WARP_TO_LOCATION_GROUP = (ScopeTypes.EntityGroup, 'WARP_TO_LOCATION_GROUP') 11 WARP_TO_LOCATION_ENTITY = (ScopeTypes.Item, 'WARP_TO_LOCATION_ENTITY') 12 13 def CreateWarpToNewLocationBehavior(warpToAddress = WARP_TO_LOCATION_GROUP): 14 node = Sequence(Bundle(name='Warp To New Location')) 15 node.AddSubTask(BlackboardMessageMonitor(Bundle(name='Reset On Warp Location Message', messageAddress=warpToAddress))) 16 node.AddSubTask(IsLocationWithinWarpDistance(Bundle(coordinateAddress=warpToAddress))) 17 node.AddSubTask(WarpToNewLocation(Bundle(name='Do Warp', locationMessage=warpToAddress, warpScrambledAddress=WARP_SCRAMBLED_ADDRESS))) 18 return node 19 20 21 def CreateWarpAndUnspawnBehavior(warpToAddress = WARP_TO_LOCATION_GROUP): 22 return Sequence(Bundle(name='Warp to random location and unspawn')).AddSubTask(GetRandomDeepSpacePosition(Bundle(locationAddress=warpToAddress))).AddSubTask(CreateWarpToNewLocationBehavior(warpToAddress)).AddSubTask(UnspawnSelf())