Exemple #1
0
    public override void OnInspectorGUI()
    {
        ViNoEditorUtil.BeginSoundGUIColor();

        PlaySoundNode node = target as PlaySoundNode;

        node.m_SoundType = (PlaySoundNode.SoundType)EditorGUILayout.EnumPopup("Category", node.m_SoundType);           // , GUILayout.Width( 75f ) );

        if (m_SoundPlInstance as ViNoSoundPlayer)
        {
            switch (node.m_SoundType)
            {
            case PlaySoundNode.SoundType.MUSIC:
                node.m_SoundID = EditorGUILayout.Popup("Music", node.m_SoundID, m_SoundEntries);
                if (m_SoundEntries != null && m_SoundEntries.Length > 0)
                {
                    if (node.m_SoundID >= m_SoundEntries.Length)
                    {
                        node.m_SoundID = 0;
                    }
                    node.m_SoundName = m_SoundEntries[node.m_SoundID];
                }
                break;

            case PlaySoundNode.SoundType.SE:
                node.m_SoundID = EditorGUILayout.Popup("SE", node.m_SoundID, m_SeEntries);
                if (m_SeEntries != null && m_SeEntries.Length > 0)
                {
                    if (node.m_SoundID >= m_SeEntries.Length)
                    {
                        node.m_SoundID = 0;
                    }
                    node.m_SoundName = m_SeEntries[node.m_SoundID];
                }
                break;

            case PlaySoundNode.SoundType.VOICE:
                node.m_SoundID = EditorGUILayout.Popup("Voice", node.m_SoundID, m_VoiceEntries);
                if (m_VoiceEntries != null && m_VoiceEntries.Length > 0)
                {
                    if (node.m_SoundID >= m_VoiceEntries.Length)
                    {
                        node.m_SoundID = 0;
                    }
                    node.m_SoundName = m_VoiceEntries[node.m_SoundID];
                }
                break;
            }

//			EditorGUILayout.EndHorizontal();
        }
        else if (m_SoundPlInstance as SimpleSoundPlayer)
        {
            node.m_SoundName = EditorGUILayout.TextField("Path", node.m_SoundName);                 // new GUIContent( "path" ,  ViNoEditorResources.folderIcon ).
        }

        node.m_Delay = EditorGUILayout.Slider("Delay(sec)", node.m_Delay, 0f, 5f);

        ViNoEditorUtil.EndSoundGUIColor();
    }
Exemple #2
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);
        }
Exemple #3
0
    protected void copy(PlaySoundNode nodeToCopy)
    {
        base.copy(nodeToCopy);

        soundPath      = nodeToCopy.soundPath;
        fadeIn         = nodeToCopy.fadeIn;
        fadeInDuration = nodeToCopy.fadeInDuration;
    }
Exemple #4
0
    IEnumerator FadeIn(PlaySoundNode node, AudioSource sound)
    {
        sound.volume = 0f;

        float timer = Time.time;

        while (Time.time - timer < node.fadeInDuration)
        {
            float ratio = (Time.time - timer) / node.fadeInDuration;
            sound.volume = ratio * node.volume;
            yield return(null);
        }

        sound.volume = node.volume;
    }
Exemple #5
0
    public void PlaySound(PlaySoundNode node)
    {
        GameObject  gO = new GameObject("Sound");
        AudioSource aS = gO.AddComponent <AudioSource> ();

        aS.clip   = node.sound;
        aS.loop   = node.loop;
        aS.volume = node.volume;

        currentSound.Add(aS);

        aS.Play();


        if (!aS.loop)
        {
            StartCoroutine(DestroySound(aS));
        }

        if (node.fadeIn)
        {
            StartCoroutine(FadeIn(node, aS));
        }
    }
Exemple #6
0
        protected override SelectorNode CreateBehaviour()
        {
            #region Spectral Chain Sequence
            //being section that deals with the attack
            #region Create the sequence for attacking
            //when ere begins to move to the center of the map she does it through this node
            AgentMoveToLocationNode moveToLocation = new AgentMoveToLocationNode(this, m_RoomCenter.position);
            //When ere's animation of her raising the chain happens
            AnimatorNode chainRaiseNode = new AnimatorNode(this, m_AnimatorRef, "IsChainRaising", ref m_SpearRaiseLink);
            //the chain move to player node which will move the chain to the player
            ChainMoveToPlayersNode chainMoveToPlayer = new ChainMoveToPlayersNode(this, SpearTipLocation, m_LineRenderer, ChainTravelTime);
            //this node determines if the chain attack is done
            HasChainReturnedNode hasChainReturned = new HasChainReturnedNode(this);
            AnimatorNode         chainLowerNode   = new AnimatorNode(this, m_AnimatorRef, "IsChainLowering", ref m_SpearLowerLink);
            PlaySoundNode        ChainSoundNode   = new PlaySoundNode(this, "ChainSound");


            //tieing all the nodes into the sequence

            SequenceNode chainAttackSection = new SequenceNode(this, "Spectral Chain Attack", moveToLocation, chainRaiseNode, chainMoveToPlayer, hasChainReturned, chainLowerNode);
            #endregion

            #region Target Selection region
            //determines if to much time has passed away from center of the map
            TimeAwayFromCenterNode timeAwayFromCenter = new TimeAwayFromCenterNode(this, m_RoomCenter.position, CenterMapSafeSpace, MaxWaitTimeAwayFromCenter);
            //determines the player's distance from Inanna
            PlayerToCloseTargetNode playerToCloseToTargetNode = new PlayerToCloseTargetNode(this, m_Inanna.transform, MinimumDistanceToTarget);

            SelectorNode spectralChainAttackSelector = new SelectorNode(this, "Choose Attack Selector Spectral Chain", timeAwayFromCenter, playerToCloseToTargetNode);
            #endregion
            //cooldown node for spectral chain
            CooldownNode spectralChainCooldown = new CooldownNode(this, SpectralChainCooldown);
            //determines if Ere can still use chain attack
            CanUseChainsNode canUseChain = new CanUseChainsNode(this, MaxChainCyclesPerCycle);


            SequenceNode specrtalChainSequence = new SequenceNode(this, "Spectral Chain Sequence", spectralChainCooldown, canUseChain, spectralChainAttackSelector, ChainSoundNode, chainAttackSection);
            #endregion

            #region Ereshkigal Attack Sequence

            #region Target Selector
            #region Protecting Inanna Sequence
            //puts points into anyone to far away from Ere
            TargetingDistanceFromLocationGreaterThenNode distanceFromEre = new TargetingDistanceFromLocationGreaterThenNode(this, transform, EreshkigalSafeSpace, 1);
            //puts points into anyone to close to Anna
            TargetingDistanceFromLocationNode distanceFromAnna = new TargetingDistanceFromLocationNode(this, m_Inanna.transform, MinimumDistanceToTarget, 2);
            CalculateTargetNode calcTarget = new CalculateTargetNode(this);
            SequenceNode        protectingInannaSequence = new SequenceNode(this, "Protecting Inanna Sequence", distanceFromEre, distanceFromAnna, calcTarget);
            #endregion

            TargetFollowUp   followup         = new TargetFollowUp(this);
            TargetSwitchNode switchTargetNode = new TargetSwitchNode(this);

            SelectorNode targetingSelector = new SelectorNode(this, "Taregting Selector", protectingInannaSequence, followup, switchTargetNode);
            #endregion

            #region Lunge Attack
            CooldownNode           lungeCooldown  = new CooldownNode(this, LungeCooldown);
            ToggleNavMeshAgentNode toggleAgentOff = new ToggleNavMeshAgentNode(this);
            //the crouch before the big jump animator node
            AnimatorNode preJump = new AnimatorNode(this, m_AnimatorRef, "IsPreJumping", ref m_PreJumpLink);
            //lerp and animation which will run in tandum
            LerpNode       jumpLerp            = new LerpNode(this, Vector3.up, 1.0f, JumpHeight, JumpSpeed);
            AnimatorNode   fulljump            = new AnimatorNode(this, m_AnimatorRef, "IsFullJumping", ref m_JumpLink);
            RunUntilSuceed runJumpAndAnimation = new RunUntilSuceed(this, "Run Animation and Jump", fulljump, jumpLerp);
            PlaySoundNode  LungeSoundNode      = new PlaySoundNode(this, "HeavyAttack2");
            PlaySoundNode  JumpSoundNode       = new PlaySoundNode(this, "WingFlap");
            PlaySoundNode  ScreamSoundNode     = new PlaySoundNode(this, "EreshkigalScream");



            AnimatorNode            jumpIdle         = new AnimatorNode(this, m_AnimatorRef, "IsJumpIdle", ref m_JumpIdleLink);
            LookAtTargetNode        lookAtTarget     = new LookAtTargetNode(this);
            ToggleMeleeColliderNode toggleLungeOn    = new ToggleMeleeColliderNode(this, SpearCollider, LungeDamage);
            AnimatorNode            diveAnimation    = new AnimatorNode(this, m_AnimatorRef, "IsDiving", ref m_DiveLink);
            LerpToTargetNode        diveLerp         = new LerpToTargetNode(this, DiveTime, JumpHeight, DiveSpeed);
            RunUntilSuceed          diveAtPlayer     = new RunUntilSuceed(this, "Run Dive and Animation", diveAnimation, diveLerp);
            ToggleMeleeColliderNode toggleLungeOff   = new ToggleMeleeColliderNode(this, SpearCollider, 0);
            ToggleNavMeshAgentNode  toggleAgentOn    = new ToggleNavMeshAgentNode(this);
            AnimatorNode            diveRecoveryNode = new AnimatorNode(this, m_AnimatorRef, "IsInDiveRecovery", ref m_DiveRecoverLink);

            SequenceNode lungeAttackSequence = new SequenceNode(this, "Lunge Attack Sequence",
                                                                lungeCooldown,
                                                                toggleAgentOff,
                                                                preJump,
                                                                runJumpAndAnimation,
                                                                JumpSoundNode,
                                                                jumpIdle,
                                                                toggleLungeOn,
                                                                lookAtTarget,
                                                                ScreamSoundNode,
                                                                diveAtPlayer,
                                                                JumpSoundNode,
                                                                toggleLungeOff,
                                                                toggleAgentOn,
                                                                diveRecoveryNode);
            #endregion

            #region Spear Toss Attack
            CooldownNode        spearTossCooldown          = new CooldownNode(this, SpearThrowCooldown);
            AnimatorNode        spearThrowAnimator         = new AnimatorNode(this, m_AnimatorRef, "IsSpearBeingThrow", ref m_SpearThrowLink);
            ShootProjectileNode spearProjectileShoot       = new ShootProjectileNode(this, SpearThrowDamage, SpearProjectilePrefab, SpearThrowLocation.gameObject, "SpearProjectile", 2);
            AnimatorNode        spearThrowRecoveryAnimator = new AnimatorNode(this, m_AnimatorRef, "IsInSpearRecovery", ref m_SpearThrowRecoveryLink);

            SequenceNode spearTossSequence = new SequenceNode(this, "Spear Toss Sequence", spearTossCooldown, spearThrowAnimator, spearProjectileShoot, LungeSoundNode, spearThrowRecoveryAnimator);
            #endregion

            #region Basic Attack Selector

            #region 360 Attack
            CheckDistanceToTargetNode attack360DistanceCheck = new CheckDistanceToTargetNode(this, Agent.stoppingDistance);
            AnimatorNode            buildUp360           = new AnimatorNode(this, m_AnimatorRef, "IsIn360BuildUp", ref m_360BuildUpLink);
            ToggleMeleeColliderNode toggleOn360Collider  = new ToggleMeleeColliderNode(this, SpearCollider, SpearAttack360Damage);
            AnimatorNode            swing360             = new AnimatorNode(this, m_AnimatorRef, "IsIn360Swing", ref m_360SwingLink);
            ToggleMeleeColliderNode toggleOff360Collider = new ToggleMeleeColliderNode(this, SpearCollider, 0);
            AnimatorNode            recovery360          = new AnimatorNode(this, m_AnimatorRef, "IsIn360Recovery", ref m_360RecoveryLink);

            SequenceNode sequence360Attack = new SequenceNode(this, "360 Attack Sequence", attack360DistanceCheck, buildUp360, toggleOn360Collider, swing360, LungeSoundNode, toggleOff360Collider, recovery360);
            #endregion

            #region Upper Stab
            PlaySoundNode             MedThrustSound           = new PlaySoundNode(this, "MedAttack3");
            CheckDistanceToTargetNode attackUpperStab          = new CheckDistanceToTargetNode(this, Agent.stoppingDistance);
            AnimatorNode            buildUpUpperStab           = new AnimatorNode(this, m_AnimatorRef, "IsInUpperStabBuildUp", ref m_UpperStabBuildUpLink);
            ToggleMeleeColliderNode toggleOnUpperStabCollider  = new ToggleMeleeColliderNode(this, SpearCollider, SpearAttackUpperStabDamage);
            AnimatorNode            swingUpperStab             = new AnimatorNode(this, m_AnimatorRef, "IsInUpperStabSwing", ref m_UpperStabSwingLink);
            ToggleMeleeColliderNode toggleOffUpperStabCollider = new ToggleMeleeColliderNode(this, SpearCollider, 0);
            AnimatorNode            recoveryUpperStab          = new AnimatorNode(this, m_AnimatorRef, "IsInUpperStabRecovery", ref m_UpperStabRecoveryLink);

            SequenceNode sequenceUpperStabAttack = new SequenceNode(this, "Upper Stab Sequence", attackUpperStab, buildUpUpperStab, toggleOnUpperStabCollider, swingUpperStab, MedThrustSound, toggleOffUpperStabCollider, recoveryUpperStab);
            #endregion

            #region Jab
            PlaySoundNode             PlayLightThrustSound   = new PlaySoundNode(this, "LightAttack2");
            CheckDistanceToTargetNode attackJabDistanceCheck = new CheckDistanceToTargetNode(this, Agent.stoppingDistance);
            AnimatorNode            buildUpJab           = new AnimatorNode(this, m_AnimatorRef, "IsInJabBuildUp", ref m_JabBuildUpLink);
            ToggleMeleeColliderNode toggleOnJabCollider  = new ToggleMeleeColliderNode(this, SpearCollider, SpearAttackJabDamage);
            AnimatorNode            swingJab             = new AnimatorNode(this, m_AnimatorRef, "IsInJabSwing", ref m_JabSwingLink);
            ToggleMeleeColliderNode toggleOffJabCollider = new ToggleMeleeColliderNode(this, SpearCollider, 0);
            AnimatorNode            recoveryJab          = new AnimatorNode(this, m_AnimatorRef, "IsInJabRecovery", ref m_JabRecoveryLink);

            SequenceNode sequenceJabAttack = new SequenceNode(this, "Jab Attack Sequence", attackJabDistanceCheck, buildUpJab, toggleOnJabCollider, swingJab, PlayLightThrustSound, toggleOffJabCollider, recoveryJab);
            #endregion

            ChooseRandomChildNode randomBasicAttackSelector = new ChooseRandomChildNode(this, "Basic Attack Selector, Random", sequence360Attack, sequenceJabAttack, sequenceUpperStabAttack);
            #endregion

            ApproachNode approachTargetPlayer     = new ApproachNode(this);
            SelectorNode chooseAttackSelector     = new SelectorNode(this, "Attack Choosing Selector", lungeAttackSequence, spearTossSequence, randomBasicAttackSelector, approachTargetPlayer);
            SequenceNode ereshkigalAttackSequence = new SequenceNode(this, "Ereshkigal Basic Attack Sequence", targetingSelector, chooseAttackSelector);
            #endregion

            SelectorNode utilitySelector = new SelectorNode(this, "UtilitySelector", specrtalChainSequence, ereshkigalAttackSequence);

            return(utilitySelector);
        }
    void ContextCallBack(object o)
    {
        string clb = o.ToString();

        if (clb.Equals("textNode"))
        {
            TextNode textNode = new TextNode();

            textNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(textNode);
        }
        else if (clb.Equals("imgNode"))
        {
            ImageNode imgNode = new ImageNode();

            imgNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 325);

            AddNode(imgNode);
        }
        else if (clb.Equals("clicNode"))
        {
            WaitForInputNode clicNode = new WaitForInputNode();

            clicNode.windowRect = new Rect(mousePos.x, mousePos.y, 150, 50);

            AddNode(clicNode);
        }
        else if (clb.Equals("lucNode"))
        {
            LucidityAddNode lucNode = new LucidityAddNode();

            lucNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(lucNode);
        }
        else if (clb.Equals("calcNode"))
        {
            SetVariableNode calcNode = new SetVariableNode();

            calcNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(calcNode);
        }
        else if (clb.Equals("waitNode"))
        {
            WaitNode waitNode = new WaitNode();

            waitNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(waitNode);
        }
        else if (clb.Equals("fadeNode"))
        {
            FadeNode fadeNode = new FadeNode();

            fadeNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(fadeNode);
        }
        else if (clb.Equals("choiceNode"))
        {
            ChoiceNode choiceNode = new ChoiceNode();

            choiceNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(choiceNode);
        }
        else if (clb.Equals("seqNode"))
        {
            GoToSequenceNode seqChoice = new GoToSequenceNode();

            seqChoice.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(seqChoice);
        }
        else if (clb.Equals("destroyNode"))
        {
            DestroyNode destroyNode = new DestroyNode();

            destroyNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(destroyNode);
        }
        else if (clb.Equals("conditionNode"))
        {
            ConditionNode conditionNode = new ConditionNode();

            conditionNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 175);

            AddNode(conditionNode);
        }
        else if (clb.Equals("placeNode"))
        {
            GoToPlaceNode placeNode = new GoToPlaceNode();

            placeNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(placeNode);
        }
        else if (clb.Equals("animNode"))
        {
            AnimationNode animNode = new AnimationNode();

            animNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 300);

            AddNode(animNode);
        }
        else if (clb.Equals("exploNode"))
        {
            GoToExplorationNode exploNode = new GoToExplorationNode();

            exploNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(exploNode);
        }
        else if (clb.Equals("soundNode"))
        {
            PlaySoundNode soundNode = new PlaySoundNode();

            soundNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(soundNode);
        }
        else if (clb.Equals("stopNode"))
        {
            StopSoundNode stopNode = new StopSoundNode();

            stopNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 150);

            AddNode(stopNode);
        }
        else if (clb.Equals("goNode"))
        {
            GameObjectNode goNode = new GameObjectNode();

            goNode.windowRect = new Rect(mousePos.x, mousePos.y, 200, 200);

            AddNode(goNode);
        }
        else if (clb.Equals("setFirst"))
        {
            int  selectedIndex   = -1;
            bool clickedOnWindow = CheckClicked(out selectedIndex);

            if (clickedOnWindow)
            {
                sequence.firstNodeId = sequence.nodes[selectedIndex].id;
            }
        }
        else if (clb.Equals("makeTransition"))
        {
            int  selectedIndex   = -1;
            bool clickedOnWindow = CheckClicked(out selectedIndex);

            if (clickedOnWindow)
            {
                selectedNode = sequence.nodes[selectedIndex];

                if (selectedNode.nextNodeId != -1)
                {
                    selectedNode.nextNodeId = -1;

                    selectedNode.nextNode.NodeDeleted(selectedNode);
                    selectedNode.nextNode = null;
                }

                makeTransitionMode = true;
            }
        }
        else if (clb.Equals("makeTransition1"))
        {
            MakeTransitionChoice(0);
        }
        else if (clb.Equals("makeTransition2"))
        {
            MakeTransitionChoice(1);
        }
        else if (clb.Equals("makeTransition3"))
        {
            MakeTransitionChoice(2);
        }
        else if (clb.Equals("makeTransition4"))
        {
            MakeTransitionChoice(3);
        }
        else if (clb.Equals("makeTransitionTrue"))
        {
            MakeTransitionCondition(0);
        }
        else if (clb.Equals("makeTransitionFalse"))
        {
            MakeTransitionCondition(1);
        }
        else if (clb.Equals("deleteNode"))
        {
            int  selectedIndex   = -1;
            bool clickedOnWindow = CheckClicked(out selectedIndex);

            if (clickedOnWindow)
            {
                EventNode selNode = sequence.nodes[selectedIndex];
                sequence.nodes.RemoveAt(selectedIndex);

                if (selNode.id == sequence.firstNodeId)
                {
                    if (sequence.nodes.Count > 0)
                    {
                        sequence.firstNodeId = sequence.nodes[0].id;
                    }
                    else
                    {
                        sequence.firstNodeId = -1;
                    }
                }

                foreach (EventNode n in sequence.nodes)
                {
                    n.NodeDeleted(selNode);
                }
            }
        }
    }
Exemple #8
0
        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);
        }
Exemple #9
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);
        }
Exemple #10
0
        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);
        }