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 override SelectorNode CreateBehaviour() { //Create ability nodes DiveNode diveNode = new DiveNode(this, DiveCooldown, DiveDamage, DiveAngle); //TODO: COMMENT THIS SECTION AND ADD STRING //PlaySoundNode diveSFX = new PlaySoundNode(this, ); CooldownNode spitCooldownNode = new CooldownNode(this, 1.0f); SequenceNode diveSequence = new SequenceNode(this, "Dive Sequence", diveNode /*, diveSFX*/); //TODO: COMMENT THIS SECTION AND ADD STRING //PlaySoundNode spitSFX = new PlaySoundNode(this, ); ShootProjectileNode shootProjectileNode = new ShootProjectileNode(this, ProjectileDamage, ProjectilePrefab, FireLocation, ProjectilePoolName, ProjectilePoolSize); SequenceNode spitSequence = new SequenceNode(this, "SpitSequence", spitCooldownNode, shootProjectileNode /*, spitSFX*/); //Create ability selector in order: Dive, Shoot Projectile SelectorNode abilitySelector = new SelectorNode(this, "AbilitySelector"); abilitySelector.AddChildren(diveSequence, spitSequence); //Create targeting nodes TargetingMasterNergTarget targetingMasterNergTarget = new TargetingMasterNergTarget(this, 10); TargetingSightNode targetingSightNode = new TargetingSightNode(this, 1); CalculateTargetNode calculateTargetNode = new CalculateTargetNode(this); //Create targeting sequence SequenceNode targetingSequence = new SequenceNode(this, "TargetingSequence"); targetingSequence.AddChildren(targetingMasterNergTarget, targetingSightNode, calculateTargetNode); //Create the Target->Abilities sequence SequenceNode getTargetAndUseAbilitySequence = new SequenceNode(this, "GetTargetAndUseAbilitySequence"); getTargetAndUseAbilitySequence.AddChildren(targetingSequence, abilitySelector); //Create utility selector SelectorNode utilitySelector = new SelectorNode(this, "UtilitySelector"); utilitySelector.AddChildren(getTargetAndUseAbilitySequence); 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); }