private void InitializeThreatList() { List <Script_IEntity> friendlies = _manager.GetFriendlies(); foreach (Script_IEntity entity in friendlies) { Script_IFriendly friendly = entity as Script_IFriendly; Assert.IsNotNull(friendly); _threatDictionary.Add(friendly, 0); } }
private void SetupChooseTargetToHeal(Script_Sequence p_chooseHealingTargetSequence) { Script_Action_SetFlag setFriendlies = new Script_Action_SetFlag(_behaviourTree, _manager.GetFriendlies(), _entityListFlag); Script_Action_SetEntitiesWithinRange setFriendliesWithinRange = new Script_Action_SetEntitiesWithinRange(_behaviourTree, _grid, _entityListFlag, _entityListFlag, this as Script_IEntity, _attackRange); Script_Action_SetEntityWithLowestHealth setFriendlyWithLowestHealth = new Script_Action_SetEntityWithLowestHealth(_behaviourTree, _entityListFlag, _targetToHealFlag); Script_LeafTask setFriendliesLeaf = new Script_LeafTask(_behaviourTree, setFriendlies); Script_LeafTask setFriendliesWithinRangeLeaf = new Script_LeafTask(_behaviourTree, setFriendliesWithinRange); Script_LeafTask setFriendlyWithLowestHealthLeaf = new Script_LeafTask(_behaviourTree, setFriendlyWithLowestHealth); Script_Decorator_AlwaysFail setfriendlyWithLowestHealthAndFailDecorator = new Script_Decorator_AlwaysFail(_behaviourTree, setFriendlyWithLowestHealthLeaf); p_chooseHealingTargetSequence.AddTask(setFriendliesLeaf); p_chooseHealingTargetSequence.AddTask(setFriendliesWithinRangeLeaf); p_chooseHealingTargetSequence.AddTask(setfriendlyWithLowestHealthAndFailDecorator); }