protected override SelectorNode CreateBehaviour() { //create attack nodes KamikazeNode kamikazeNode = new KamikazeNode(this); GustNode gustNode = new GustNode(this, DebrisPrefab); SwoopNode swoopNode = new SwoopNode(this); //create the flyabove node FlyAboveTargetNode flyAboveTargetNode = new FlyAboveTargetNode(this); //create the attack selector and attach the above nodes in the following sequence : KamakaziNode, GustNode, SwoopNode, FlyAboveTargetNode SelectorNode attackSelector = new SelectorNode(this, "AttackSelector"); attackSelector.AddChildren(kamikazeNode, gustNode, swoopNode, flyAboveTargetNode); //create the targeting nodes TargetingDistanceNode targetingDistanceNode = new TargetingDistanceNode(this, 1); TargetingLowHealthNode targetingLowHealthNode = new TargetingLowHealthNode(this, 1); TargetingHighestDamageNode targetingHighestDamageNode = new TargetingHighestDamageNode(this, 1); TargetingCharacterType targetingCharacterType = new TargetingCharacterType(this, 1, WeaponType.MELEE); CalculateTargetNode calculateTargetNode = new CalculateTargetNode(this); //create the targeting logic from the above nodes. The order is as follows: SequenceNode targetingSequence = new SequenceNode(this, "TargetingSequence"); targetingSequence.AddChildren(targetingDistanceNode, targetingLowHealthNode, targetingHighestDamageNode, targetingCharacterType, calculateTargetNode); //create the sequence for having a target behaviour (ie attacking, flying above players) SequenceNode attackSequence = new SequenceNode(this, "GetTargetAndAttack"); attackSequence.AddChildren(targetingSequence, attackSelector); //create the utility selector and return it SelectorNode utilitySelector = new SelectorNode(this, "UtilitySelector"); utilitySelector.AddChildren(attackSequence); return(utilitySelector); }
protected virtual Node.Node CreateTargetingSequence() { //Create the targeting nodes TargetingSightNode targetSightNode = new TargetingSightNode(this, 1); TargetingDistanceNode targetingDistanceNode = new TargetingDistanceNode(this, 1); TargetingHighHealthNode targetingHighHealthNode = new TargetingHighHealthNode(this, 1); TargetingHighestDamageNode targetingHighestDamageNode = new TargetingHighestDamageNode(this, 2); TargetingCharacterType targetingCharacterType = new TargetingCharacterType(this, 1, WeaponType.RANGED); CalculateTargetNode calculateTargetNode = new CalculateTargetNode(this); //Create the targeting sequence and attach nodes SequenceNode targetingSequence = new SequenceNode(this, "TargetingSequence"); targetingSequence.AddChildren(targetingDistanceNode, targetingHighHealthNode, targetingHighestDamageNode, targetingCharacterType, calculateTargetNode); return(targetingSequence); }
protected override SelectorNode CreateBehaviour() { //Create the reposition nodes SafetyCheckNode safetyCheckNode = new SafetyCheckNode(this); DelegateNode.Delegate invincibleFunc = SetInvincible; DelegateNode setInvincibleTrueNode = new DelegateNode(this, invincibleFunc, true); AnimatorNode jumpAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsInannaJumping", ref m_JumpLink); LerpNode lerpUpwardsNode = new LerpNode(this, Vector3.up, JumpToMaxTime, JumpHeight, JumpSpeed); //Grab all tower points in the map GameObject[] towerPointGameObjects = GameObject.FindGameObjectsWithTag("TowerPoint"); Transform[] towerPointTransforms = new Transform[towerPointGameObjects.Length]; for (int i = 0; i < towerPointTransforms.Length; i++) { towerPointTransforms[i] = towerPointGameObjects[i].transform; } InannaMoveTowerNode moveTowerNode = new InannaMoveTowerNode(this, towerPointTransforms); LerpNode lerpDownwardsNode = new LerpNode(this, Vector3.down, JumpToMaxTime, JumpHeight, JumpSpeed); AnimatorNode landAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsInannaLanding", ref m_LandingLink); PlaySoundNode InnanaJumpSoundNode = new PlaySoundNode(this, "WingFlap"); DelegateNode setInvincibleFalseNode = new DelegateNode(this, invincibleFunc, false); //Create reposition sequence SequenceNode repositionSequence = new SequenceNode(this, "RepositionSequence", safetyCheckNode, setInvincibleTrueNode, jumpAnimationNode, InnanaJumpSoundNode, lerpUpwardsNode, moveTowerNode, lerpDownwardsNode, InnanaJumpSoundNode, landAnimationNode, setInvincibleFalseNode); //Create arrow rain nodes PlaySoundNode ArrowRainSound = new PlaySoundNode(this, "ArrowRain", 8.0f); RainOfArrowsCooldownNode arrowRainCooldownNode = new RainOfArrowsCooldownNode(this, RainOfArrowsCooldown, RainOfArrowsDiameter); RainOfArrowsTargetingNode arrowRainTargetNode = new RainOfArrowsTargetingNode(this, RainOfArrowsDiameter); AnimatorNode arrowRainAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsFiringRainOfArrows", ref m_ArrowRainShotLink); RainOfArrowsAttackNode arrowRainAttackNode = new RainOfArrowsAttackNode(this, m_CircularAOEPrefab.GetComponent <CircularAOE>(), RainOfArrowsWaitTime); //Create arrow rain sequence SequenceNode arrowRainSequence = new SequenceNode(this, "RainOfArrowsSequence", arrowRainCooldownNode, arrowRainTargetNode, arrowRainAnimationNode, arrowRainAttackNode, ArrowRainSound); //Create snipe shot nodes PlaySoundNode HeavyShotSound = new PlaySoundNode(this, "HeavyShot"); SnipeDelayNode snipeDelayNode = new SnipeDelayNode(this, m_Ereshkigal.transform, m_LineRenderer, m_Ereshkigal.EreshkigalSafeSpace, HitScanBuildUp); AnimatorNode snipeAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsSniping", ref m_SnipeShotLink); HitScanShotNode hitScanShotNode = new HitScanShotNode(this, ShootLocation.transform, m_HitScanShot, HitscanShotDamage, HitScanShotDelay); //Create snipe sequence SequenceNode snipeSequence = new SequenceNode(this, "SnipeSequence", snipeDelayNode, snipeAnimationNode, hitScanShotNode, HeavyShotSound); //Create arrow shot targeting nodes TargetingDistanceFromLocationGreaterThenNode targetingDistanceNode = new TargetingDistanceFromLocationGreaterThenNode(this, m_Ereshkigal.transform, m_Ereshkigal.EreshkigalSafeSpace * 0.5f, 2); TargetingLowHealthNode targetingLowestHPNode = new TargetingLowHealthNode(this, 2); TargetingHighestDamageNode targetingHighestDamageNode = new TargetingHighestDamageNode(this, 1); TargetingSightNode targetingSightNode = new TargetingSightNode(this, 1, true); CalculateTargetNode calculateTargetNode = new CalculateTargetNode(this); //Create arrow shot targeting sequence SequenceNode targetingSequence = new SequenceNode(this, "ArrowTargetingSequence", targetingDistanceNode, targetingLowestHPNode, targetingHighestDamageNode, targetingSightNode, calculateTargetNode); //Create other arrow shot nodes PlaySoundNode ArrowShotSoundNode = new PlaySoundNode(this, "ArrowFire"); CooldownNode arrowShotCooldownNode = new CooldownNode(this, ArrowShotRate); AnimatorNode arrowShotAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsFiringArrowShot", ref m_RegularShotLink); ShootProjectileNode arrowShotProjectileNode = new ShootProjectileNode(this, ArrowShotDamage, ArrowProjectilePrefab, ShootLocation, "InannaArrowPool", 5); //Create arrow shot sequence SequenceNode arrowShotSequence = new SequenceNode(this, "ArrowShotSequence", targetingSequence, arrowShotCooldownNode, arrowShotAnimationNode, ArrowShotSoundNode, arrowShotProjectileNode); //Create utility selector SelectorNode utilitySelector = new SelectorNode(this, "InannaUtilitySelector", repositionSequence, arrowRainSequence, snipeSequence, arrowShotSequence); return(utilitySelector); }
protected override SelectorNode CreateBehaviour() { //Create melee attack nodes //Create ground slam nodes CooldownNode groundSlamCooldownNode = new CooldownNode(this, GroundSlamCooldownTime); AnimatorNode groundSlamStartAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsGroundSlamStarting", ref m_GroundSlamStartLink); GroundSlamNode groundSlamNode = new GroundSlamNode(this, FallingRockPrefab, PunchHitBox.transform); //TODO: COMMENT THIS SECTION AND ADD STRING PlaySoundNode slamSFX = new PlaySoundNode(this, "GolemGroundSlamImpact"); AnimatorNode groundSlamRecoveryAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsGroundSlamRecovering", ref m_GroundSlamRecoveryLink); ToggleParticleSystemNode toggleGroundSlamPartclesNode = new ToggleParticleSystemNode(this, SlamParticleSystem); //Create ground slam sequence SequenceNode groundSlamSequence = new SequenceNode(this, "GroundSlamSequence", groundSlamCooldownNode, groundSlamStartAnimationNode, groundSlamNode, toggleGroundSlamPartclesNode, slamSFX, groundSlamRecoveryAnimationNode); //Create punch nodes CheckDistanceToTargetNode punchDistanceNode = new CheckDistanceToTargetNode(this, 5.0f); ToggleMeleeColliderNode togglePunchNode = new ToggleMeleeColliderNode(this, PunchHitBox, 15); LookAtTargetNode lookAtTargetNode = new LookAtTargetNode(this); AnimatorNode punchAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsPunching", ref m_PunchLink); //TODO: COMMENT THIS SECTION AND ADD STRING PlaySoundNode punchSFX = new PlaySoundNode(this, "GolemPunchImpact"); //Create punch sequence SequenceNode punchSequence = new SequenceNode(this, "PunchSequence", punchDistanceNode, togglePunchNode, lookAtTargetNode, punchSFX, punchAnimationNode, togglePunchNode); //Create melee attack selector in order: GroundSlam, Punch SelectorNode meleeAttackSelector = new SelectorNode(this, "MeleeAttackSelector"); meleeAttackSelector.AddChildren(groundSlamSequence, punchSequence); //Create ranged attack nodes //Create rock throw nodes CooldownNode rockThrowCooldownNode = new CooldownNode(this, 10.0f); AnimatorNode rockThrowStartAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsRockThrowStarting", ref m_RockThrowStartLink); //TODO: COMMENT THIS SECTION AND ADD STRING PlaySoundNode rockThrowSFX = new PlaySoundNode(this, "GolemRockThrow"); DelegateNode.Delegate setRockMeshFunc = SetRockMesh; DelegateNode setRockMeshTrueNode = new DelegateNode(this, setRockMeshFunc, true); AnimatorNode rockThrowingAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsRockThrowing", ref m_RockThrowingLink); DelegateNode setRockMeshFalseNode = new DelegateNode(this, setRockMeshFunc, false); RockThrowNode rockThrowNode = new RockThrowNode(this, RockThrowPrefab, FireLocation, RockThrowDamage); AnimatorNode rockThrowRecoveryAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsRockThrowRecovering", ref m_RockThrowRecoveryLink); //Create rock throw sequence SequenceNode rockThrowSequence = new SequenceNode(this, "RockThrowSequence", rockThrowCooldownNode, rockThrowStartAnimationNode, setRockMeshTrueNode, rockThrowingAnimationNode, setRockMeshFalseNode, rockThrowNode, rockThrowSFX, rockThrowRecoveryAnimationNode ); //Create ground spike nodes CooldownNode groundSpikesCooldownNode = new CooldownNode(this, 10.0f); AnimatorNode groundSpikesStartAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsGroundSpikeStarting", ref m_GroundSpikesStartLink); GroundSpikesNode groundSpikesNode = new GroundSpikesNode(this, SpikePrefab, SpikesMovementTime); AnimatorNode groundSpikesRecoveryAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsGroundSpikesRecovering", ref m_GroundSpikesRecoveryLink); //Create ground spike sequence SequenceNode groundSpikesSequence = new SequenceNode(this, "GroundSpikesSequence", groundSpikesCooldownNode, groundSpikesStartAnimationNode, groundSpikesNode, groundSpikesRecoveryAnimationNode); //Create ranged attack selector in order: RockThrow, GroundSpikes SelectorNode rangedAttackSelector = new SelectorNode(this, "RangedAttackSelector"); rangedAttackSelector.AddChildren(rockThrowSequence, groundSpikesSequence); //Create targeting nodes TargetingAfflicted targetingAfflictedNode = new TargetingAfflicted(this, 8, Status.Stun); TargetingDistanceNode targetingDistanceNode = new TargetingDistanceNode(this, 1); TargetingHighHealthNode targetingHighHealthNode = new TargetingHighHealthNode(this, 1); TargetingHighestDamageNode targetingHighestDamageNode = new TargetingHighestDamageNode(this, 1); TargetingCharacterType targetingCharacterType = new TargetingCharacterType(this, 1, WeaponType.RANGED); CalculateTargetNode calculateTargetNode = new CalculateTargetNode(this); //Create the targeting sequence and attach nodes SequenceNode targetingSequence = new SequenceNode(this, "TargetingSequence"); targetingSequence.AddChildren(targetingAfflictedNode, targetingDistanceNode, targetingHighHealthNode, targetingHighestDamageNode, targetingCharacterType, calculateTargetNode); //Create approach node ApproachNode approachNode = new ApproachNode(this); //Create Abilities/Melee/Ranged/Approach Selector SelectorNode actionSelector = new SelectorNode(this, "ActionSelector"); actionSelector.AddChildren(meleeAttackSelector, rangedAttackSelector, approachNode); //Create Target->Action sequence SequenceNode getTargetAndUseAbilitySequence = new SequenceNode(this, "GetTargetAndUseAbilitySequence"); getTargetAndUseAbilitySequence.AddChildren(targetingSequence, actionSelector); //Create the utility selector with the previous sequence and approach node SelectorNode utilitySelector = new SelectorNode(this, "UtilitySelector"); utilitySelector.AddChildren(getTargetAndUseAbilitySequence); return(utilitySelector); }