Example #1
0
        protected virtual Node.Node CreateAttackingSequence()
        {
            Node.Node targetingSequence = CreateTargetingSequence();

            //create ability node
            CooldownNode cooldownNode       = new CooldownNode(this, ProjectileAttackRate);
            AnimatorNode shootAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsShooting", ref m_ShootLink);

            //TODO: UNCOMMENT THIS CODE AND ADD THE STRING NAME
            PlaySoundNode  shotNodeSFX            = new PlaySoundNode(this, "WorshipperShoot");
            SummonShotNode summonShotNode         = new SummonShotNode(this, ProjectileDamage, ProjectilePrefab, FireLocation, ProjectilePoolName, ProjectilePoolSize);
            CooldownNode   repositionCooldownNode = new CooldownNode(this, RepositionCooldown);

            //handle movement and movement
            BackAwayNode backAwayNode = new BackAwayNode(this, false, DirectionMultiplier);
            SideStepNode sideStep     = new SideStepNode(this, false, DirectionMultiplier);

            MovementOptionRandomNode randomMovementChoice = new MovementOptionRandomNode(this, backAwayNode, sideStep);

            SequenceNode attackingSequence = new SequenceNode(this, "Attacking Sequence", cooldownNode, shootAnimationNode, summonShotNode, shotNodeSFX, repositionCooldownNode, randomMovementChoice);

            //create the attacking options sequence for making the AI attack
            SequenceNode attackOptionSequence = new SequenceNode(this, "Attack Choice Sequence", targetingSequence, attackingSequence);

            return(attackOptionSequence);
        }
Example #2
0
        protected override Node.Node CreateAttackingSequence()
        {
            Node.Node targetingSequence = CreateTargetingSequence();

            //Create the VampireSuckieSuckie attack sequence
            HealthLessThanNode healthCheckNode        = new HealthLessThanNode(this, PercentageOfHealthToAttack);
            UseOnceNode        usedShadowDrain        = new UseOnceNode(this);
            SequenceNode       healthandAttackNotUsed = new SequenceNode(this, "Health and Attack Check", healthCheckNode, usedShadowDrain);
            AnimatorNode       shadowDrainNode        = new AnimatorNode(this, m_AnimatorRef, "IsUsingDrainShot", ref m_DrainShotLink);
            ToggleAINode       toggleAINode           = new ToggleAINode(this);
            DrainningShotNode  fireProjectileNode     = new DrainningShotNode(this, ShadowDrainDamage, ShadowDrainProjectile, FireLocation, "AcolyteProjectile", 5);

            //TODO: UNCOMMENT AND ADD SOUND NAME
            //PlaySoundNode shadowDrainSFX = new PlaySoundNode(this, );

            SequenceNode shadowDrainSequence = new SequenceNode(this, "Shadow Drain Attack", healthandAttackNotUsed, shadowDrainNode, toggleAINode, /*shadowDrainSFX,*/ fireProjectileNode);

            //Create ability node
            CooldownNode   cooldownNode           = new CooldownNode(this, ProjectileAttackRate);
            AnimatorNode   shootAnimationNode     = new AnimatorNode(this, m_AnimatorRef, "IsShooting", ref m_ShootLink);
            SummonShotNode summonShotNode         = new SummonShotNode(this, ProjectileDamage, ProjectilePrefab, FireLocation, ProjectilePoolName, ProjectilePoolSize);
            CooldownNode   repositionCooldownNode = new CooldownNode(this, RepositionCooldown);
            //PlaySoundNode summonSFX = new PlaySoundNode(this,);

            //handle movement and movement
            BackAwayNode backAwayNode = new BackAwayNode(this, false, DirectionMultiplier * 2);
            SideStepNode sideStep     = new SideStepNode(this, false, DirectionMultiplier);

            MovementOptionRandomNode randomMovementChoice = new MovementOptionRandomNode(this, backAwayNode, sideStep);

            SequenceNode basicAttackingSequence = new SequenceNode(this, "Basic Attack Sequence", cooldownNode, shootAnimationNode, summonShotNode, /*summonSFX, */ repositionCooldownNode, randomMovementChoice);

            //create the attacking options sequence for making the AI attack
            SelectorNode attackSelector       = new SelectorNode(this, "Attack Selector", shadowDrainSequence, basicAttackingSequence);
            SequenceNode attackOptionSequence = new SequenceNode(this, "Attack Choice Sequence", targetingSequence, attackSelector);

            return(attackOptionSequence);
        }
Example #3
0
        protected override SelectorNode CreateBehaviour()
        {
            //create the dig nodes
            CanDigNode               canDigNode         = new CanDigNode(this);
            HealthLessThanNode       healthCheckNode    = new HealthLessThanNode(this, 0.6f);
            AnimatorNode             digAnimationNode   = new AnimatorNode(this, m_AnimatorRef, "IsDigging", ref m_DigAnimationLink);
            ToggleParticleSystemNode toggleParticleNode = new ToggleParticleSystemNode(this, DigParticleSystem);

            DelegateNode.Delegate toggleTriggerFunc = SetColliderTrigger;
            DelegateNode          toggleTriggerNode = new DelegateNode(this, toggleTriggerFunc, true);

            DelegateNode.Delegate toggleColliderFunc = ToggleCollider;
            DelegateNode          toggleColliderNode = new DelegateNode(this, toggleColliderFunc);

            ToggleNavMeshAgentNode toggleAgentNode = new ToggleNavMeshAgentNode(this);
            DelayNode delayNode = new DelayNode(this, 2.0f);
            //TODO: COMMENT THIS SECTION AND ADD STRING
            PlaySoundNode digSFX       = new PlaySoundNode(this, "NergDig");
            LerpNode      lerpDownNode = new LerpNode(this, Vector3.down, 1.0f, 2.0f, 10.0f);

            DelegateNode.Delegate rotateFunc = RotateVertical;
            DelegateNode          rotateNode = new DelegateNode(this, rotateFunc);

            TeleportToTargetOffsetNode teleportNode     = new TeleportToTargetOffsetNode(this, new Vector3(0.0f, -5.0f, 0.0f));
            LerpToTargetNode           lerpToTargetNode = new LerpToTargetNode(this, 0.5f, 1.0f, 10.0f);
            AnimatorNode        biteAnimationNode       = new AnimatorNode(this, m_AnimatorRef, "IsBiting", ref m_BiteAnimationLink);
            RunUntillTargetNull targetNullNode          = new RunUntillTargetNull(this);

            //create the dig sequence
            SequenceNode digSequence = new SequenceNode(this, "DigSequence",
                                                        healthCheckNode,
                                                        canDigNode,
                                                        toggleParticleNode,
                                                        toggleTriggerNode,
                                                        toggleColliderNode,
                                                        toggleAgentNode,
                                                        delayNode,
                                                        digSFX,
                                                        lerpDownNode,
                                                        toggleParticleNode,
                                                        rotateNode,
                                                        teleportNode,
                                                        toggleColliderNode,
                                                        toggleParticleNode,
                                                        lerpToTargetNode,
                                                        digSFX,
                                                        delayNode,
                                                        toggleParticleNode,
                                                        targetNullNode
                                                        );

            //create the targeting nodes
            TargetingSightNode     sightNode  = new TargetingSightNode(this, 1);
            TargetingLowHealthNode lowHealth  = new TargetingLowHealthNode(this, 3);
            CalculateTargetNode    calcTarget = new CalculateTargetNode(this);

            //assign the targeting sequence
            SequenceNode targetingSequ = new SequenceNode(this, "TargetingSequence", sightNode, lowHealth, calcTarget);

            //create the spit nodes
            CooldownNode spitCooldownNode = new CooldownNode(this, 1.0f);
            //AnimatorNode spitAnimationNode = new AnimatorNode(this, m_AnimatorRef, "IsSpitting", ref m_SpitAnimationLink);
            ShootProjectileNode projectileNode = new ShootProjectileNode(this, 1, ProjectilePrefab, ProjectileSpawnLoc, "MasterNergProjectile", 10);
            //SFX for the sound of the nerg spitting
            PlaySoundNode spitSound = new PlaySoundNode(this, "NergSpit");


            //create the movement nodes
            CooldownNode movementCooldownNode = new CooldownNode(this, 3.0f);
            //BackAwayNode backAwayNode = new BackAwayNode(this, false, 1.0f);
            SideStepNode             sideStepNode        = new SideStepNode(this, false, 2.0f);
            PredictiveAvoidanceNode  predictMovementNode = new PredictiveAvoidanceNode(this, false, true, 2.0f, 5.0f);
            MovementOptionRandomNode movementNodes       = new MovementOptionRandomNode(this, sideStepNode, predictMovementNode);

            //SFX for the sound of the nerg moving backward
            //TODO: COMMENT THIS SECTION AND ADD STRING
            //PlaySoundNode crawlingSFX = new PlaySoundNode(this,);

            //create the spit sequence
            SequenceNode spitSequence = new SequenceNode(this, "SpitSequence", spitCooldownNode, projectileNode, spitSound, movementCooldownNode, movementNodes /*, crawlingSFX*/);

            //assign the attack selector
            SelectorNode attackSelector = new SelectorNode(this, "AttackSelector", digSequence, spitSequence);

            //create the attack sequence
            SequenceNode attackSequence = new SequenceNode(this, "AttackTargetSequence", targetingSequ, attackSelector);

            //create utility selector
            SelectorNode utilitySelector = new SelectorNode(this, "UtilitySelector", attackSequence);

            return(utilitySelector);
        }