corpseharvesting.py (2206B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\behaviors\trees\corpseharvesting.py 2 from behaviors.blackboards.scopes import ScopeTypes 3 from behaviors.composites import Sequence, PrioritySelector 4 from brennivin.itertoolsext import Bundle 5 from behaviors.actions.ballparks import SelectItemByTypes, ApproachObject, EntityLootItem 6 from behaviors.conditions.blackboards import IsBlackboardValueNotNone 7 from behaviors.actions.blackboards import BlackboardSetMessageAsNoneAction 8 from behaviors.monitors.ballparks import TargetLeavingParkMonitor 9 from behaviors.decorators.timers import CooldownTimer 10 from behaviors.actions.timer import SucceedAfterTimeoutAction 11 from inventorycommon.const import typeCorpse, typeCorpseFemale 12 CORPSE_TYPES = [typeCorpse, typeCorpseFemale] 13 CORPSE_ITEM_ADDRESS = (ScopeTypes.Item, 'CORPSE_ITEM') 14 CORPSE_SCAN_COOLDOWN = (ScopeTypes.EntityGroup, 'CORPSE_SCAN_COOLDOWN') 15 CORPSE_SCAN_COOLDOWN_SEC = 300 16 17 def CreateCorpseHarvestingBehavior(): 18 return PrioritySelector(Bundle(name='Corpse Harvesting')).AddSubTask(Sequence(Bundle(name='Harvest Corpse If Valid Target')).AddSubTask(IsBlackboardValueNotNone(Bundle(name='Has Corpse Target', valueAddress=CORPSE_ITEM_ADDRESS))).AddSubTask(TargetLeavingParkMonitor(Bundle(targetAddress=CORPSE_ITEM_ADDRESS, clearValue=True))).AddSubTask(ApproachObject(Bundle(name='Approach Corpse', itemIdAddress=CORPSE_ITEM_ADDRESS, notifyRange=500, approachRange=0, blocking=True))).AddSubTask(EntityLootItem(Bundle(name='Pick Up Corpse For Loot', itemIdAddress=CORPSE_ITEM_ADDRESS))).AddSubTask(BlackboardSetMessageAsNoneAction(Bundle(name='Reset Corpse Target', messageAddress=CORPSE_ITEM_ADDRESS))).AddSubTask(SucceedAfterTimeoutAction(Bundle(name='Waiting On Object To Leave Park', timeoutSeconds=5))).AddSubTask(SelectItemByTypes(Bundle(name='Find Corpse In Bubble', typeIds=CORPSE_TYPES, selectedItemAddress=CORPSE_ITEM_ADDRESS)))).AddSubTask(CooldownTimer(Bundle(name='Corpse Harvest Cooldown Timer', timeoutSeconds=CORPSE_SCAN_COOLDOWN_SEC, timerAddress=CORPSE_SCAN_COOLDOWN)).AddSubTask(SelectItemByTypes(Bundle(name='Find Corpse In Bubble', typeIds=CORPSE_TYPES, selectedItemAddress=CORPSE_ITEM_ADDRESS))))