Ejemplo n.º 1
0
                public async Task addAbility([Remainder, Summary("Ability")] string ability)
                {
                    if (characters == null)
                    {
                        characters = new List <CharacterNode>();
                    }
                    CharacterNode old = findCharacter(Context.User);

                    if (old == null)
                    {
                        await Context.User.SendMessageAsync("You do not have an active character.");

                        return;
                    }
                    bool s = old.removeAbilityProficiency(ability);

                    if (s)
                    {
                        await Context.User.SendMessageAsync("I added the proficiency for you.");
                    }
                    else
                    {
                        await Context.User.SendMessageAsync("That is not a valid proficiency.");
                    }
                }
Ejemplo n.º 2
0
                public async Task addST([Remainder, Summary("stat type")] string stat)
                {
                    if (characters == null)
                    {
                        characters = new List <CharacterNode>();
                    }
                    CharacterNode old = findCharacter(Context.User);

                    if (old == null)
                    {
                        await Context.User.SendMessageAsync("You do not have an active character.");

                        return;
                    }
                    bool s = old.addSavingThrowProf(stat);

                    if (s)
                    {
                        await Context.User.SendMessageAsync("I added the proficiency for you.");
                    }
                    else
                    {
                        await Context.User.SendMessageAsync("That is not a valid proficiency.");
                    }
                }
Ejemplo n.º 3
0
        public void ShouldApplyVariationsOnRegularInput()
        {
            // Arrange
            var characterNode  = new CharacterNode('a');
            var quantifierNode = new QuantifierNOrMoreNode(5, characterNode);
            var rootNode       = new ConcatenationNode(quantifierNode);
            var target         = new QuantifierUnlimitedQuantityMutator();

            var expectedResults = new List <string>
            {
                "a{4,}",
                "a{6,}",
            };

            // Act
            var mutations = target.ApplyMutations(quantifierNode, rootNode).ToList();

            // Assert
            var index = 0;
            var originalQuantifier = "a{5,}";

            foreach (var mutation in mutations)
            {
                mutation.OriginalNode.ShouldBe(quantifierNode);
                mutation.ReplacementNode.ToString().ShouldBe(expectedResults[index]);
                mutation.ReplacementPattern.ShouldBe(expectedResults[index]);
                mutation.DisplayName.ShouldBe("Regex greedy quantifier quantity mutation");
                mutation.Description.ShouldBe($"Quantifier \"{originalQuantifier}\" was replaced with \"{expectedResults[index]}\" at offset 1.");
                index++;
            }
            mutations.Count.ShouldBe(2);
        }
Ejemplo n.º 4
0
        public void GetDescendantsShouldReturnAllDescendants()
        {
            // Arrange
            // a+bc*
            var charNodeA      = new CharacterNode('a');
            var charNodeB      = new CharacterNode('b');
            var charNodeC      = new CharacterNode('c');
            var quantifierPlus = new QuantifierPlusNode(charNodeA);
            var quantifierStar = new QuantifierStarNode(charNodeC);
            var grandchildren  = new List <RegexNode> {
                quantifierPlus, charNodeB, quantifierStar
            };
            var concatenationNode = new ConcatenationNode(grandchildren);
            var target            = new TestRegexNode(concatenationNode);

            // Act
            IEnumerable <RegexNode> result = target.GetDescendantNodes();

            // Assert
            result.Count().ShouldBe(6);
            result.First().ShouldBe(charNodeA);
            result.ElementAt(1).ShouldBe(quantifierPlus);
            result.ElementAt(2).ShouldBe(charNodeB);
            result.ElementAt(3).ShouldBe(charNodeC);
            result.ElementAt(4).ShouldBe(quantifierStar);
            result.Last().ShouldBe(concatenationNode);
        }
Ejemplo n.º 5
0
        public ListResponse <BodyComponent> GetBodyComponentList(ListRequest <BodyComponent> request)
        {
            lock (_lock)
            {
                var actComponent = BodyComponentBase.GetActuallyComponent(request.Parameter);
                var compNode     = CharacterNode.SearchNode(actComponent.BaseNodePath);
                compNode.Nodes.SortByImgID();

                var resp = new ListResponse <BodyComponent>
                {
                    Results = compNode.Nodes.Skip(request.Start).Take(request.Num).Select(nd =>
                    {
                        var comp = new BodyComponent
                        {
                            ID         = actComponent.FormatID(nd.Text),
                            ConfigType = actComponent.ConfigType,
                            MotionName = actComponent.DefaultMotionName
                        };
                        return(GetBodyComponent(comp, false));
                    }).ToList()
                };
                resp.HasNext = resp.Results.Count == request.Num;
                return(resp);
            }
        }
Ejemplo n.º 6
0
        public async Task open([Remainder, Summary("File name")] string filename)
        {
            if (characters == null)
            {
                characters = new List <CharacterNode>();
            }
            CharacterNode old = findCharacter(Context.User);

            if (old != null)
            {
                characters.Remove(old);
            }
            CharacterNode character = new CharacterNode("temp");
            int           error     = character.openCharacter(filename, Context.User);

            if (error == 2)
            {
                await Context.Channel.SendMessageAsync("You are not the owner of that file");
            }
            else if (error == 3)
            {
                await Context.Channel.SendMessageAsync("I could not locate that file.");
            }
            else
            {
                await Context.Channel.SendMessageAsync("I successfully loaded the file. Enter **!c view** to view it.");
            }
            characters.Add(character);
        }
        public void SpanOnCommentGroupShouldStartAfter()
        {
            // Arrange
            var comment = new CommentGroupNode("This is a comment.");
            var a       = new CharacterNode('a');
            var b       = new CharacterNode('b')
            {
                Prefix = comment
            };
            var concat = new ConcatenationNode(new List <RegexNode> {
                a, b
            });

            // Act
            var(commentStart, commentLength) = comment.GetSpan();
            var(aStart, aLength)             = a.GetSpan();
            var(bStart, bLength)             = b.GetSpan();
            var(concatStart, concatLength)   = concat.GetSpan();

            // Assert
            concatStart.ShouldBe(0);
            concatLength.ShouldBe(a.ToString().Length + b.ToString().Length);
            aStart.ShouldBe(0);
            aLength.ShouldBe(1);
            commentStart.ShouldBe(1);
            commentLength.ShouldBe(comment.ToString().Length);
            bStart.ShouldBe(commentStart + commentLength);
            bLength.ShouldBe(1);
        }
Ejemplo n.º 8
0
    public List <string> GetParent(string ID)
    {
        List <string> result = new List <string>();
        CharacterNode target = new CharacterNode();

        foreach (CharacterNode NpcNode in characterNodeContainer.CharacterNodes)
        {
            if (NpcNode.ID == ID)
            {
                target = NpcNode;
                break;
            }
        }
        if (target.ID != null)
        {
            if (target.Parents.Length != 0)
            {
                foreach (string parent in target.Parents)
                {
                    foreach (string NpcID in player.NPCIDs)
                    {
                        if (parent == NpcID)
                        {
                            result.Add(parent);
                        }
                    }
                }
            }
            else
            {
                result.Add("00");
            }
        }
        return(result);
    }
Ejemplo n.º 9
0
    /**
     * Disables the current turn player and moves on to the next
     */
    private void turnOver()
    {
        Debug.Log("Disabling " + battleQueueController.getCharacterRef().charName);

        if (turn == TYPE.PLAYER)
        {
            plyPanel.changeCurrentActivePlayer(players.IndexOf(battleQueueController.getCharacterRef()), false);
        }

        battleQueueController.getCharacterRef().setActive(false);
        battleQueueController = battleQueueController.getNext();
        battleQueueController.getCharacterRef().setActive(true);

        Debug.Log("Enabling " + battleQueueController.getCharacterRef().charName);

        turn = battleQueueController.getCharacterRef().getType();

        if (turn == TYPE.PLAYER)
        {
            heroCursor.reposition(battleQueueController.getCharacterRef().getPosition());
            heroCursor.relocate(1.5f * scale, 0.5f * scale);
            plyPanel.changeCurrentActivePlayer(players.IndexOf(battleQueueController.getCharacterRef()), true);
        }
        else if (turn == TYPE.ENEMY)
        {
            heroCursor.gameObject.SetActive(false);
        }
    }
        public void ShouldSkipDecrementOnZeroEndValue()
        {
            // Arrange
            var characterNode  = new CharacterNode('a');
            var quantifierNode = new QuantifierNMNode(0, 0, characterNode);
            var rootNode       = new ConcatenationNode(quantifierNode);
            var target         = new QuantifierQuantityMutator();

            var expectedResults = new List <string>
            {
                "a{0,1}",
            };

            // Act
            var mutations = target.ApplyMutations(quantifierNode, rootNode).ToList();

            // Assert
            var index = 0;
            var originalQuantifier = "a{0,0}";

            foreach (var mutation in mutations)
            {
                mutation.OriginalNode.ShouldBe(quantifierNode);
                mutation.ReplacementNode.ToString().ShouldBe(expectedResults[index]);
                mutation.ReplacementPattern.ShouldBe(expectedResults[index]);
                mutation.DisplayName.ShouldBe("Regex greedy quantifier quantity mutation");
                mutation.Description.ShouldBe($"Quantifier \"{originalQuantifier}\" was replaced with \"{expectedResults[index]}\" at offset 1.");
                index++;
            }
            mutations.Count.ShouldBe(1);
        }
Ejemplo n.º 11
0
            public async Task setHitDie(int num)
            {
                if (characters == null)
                {
                    characters = new List <CharacterNode>();
                }
                CharacterNode character = findCharacter(Context.User);

                if (character == null)
                {
                    await Context.User.SendMessageAsync("You have no active character.");
                }
                else
                {
                    if (num == 4 || num == 6 || num == 8 || num == 12 || num == 10 || num == 20 || num == 100)
                    {
                        character.setHitDie(num);
                        await Context.User.SendMessageAsync("Hit die updated.");
                    }
                    else
                    {
                        await Context.User.SendMessageAsync("That is not a valid die.");
                    }
                }
            }
Ejemplo n.º 12
0
            public async Task setPrimaryStat(string stat)
            {
                if (characters == null)
                {
                    characters = new List <CharacterNode>();
                }
                CharacterNode character = findCharacter(Context.User);

                if (character == null)
                {
                    await Context.User.SendMessageAsync("You have no active character.");
                }
                else
                {
                    if (character.determineValidStat(stat))
                    {
                        character.setPrimaryStat(stat);
                        await Context.Channel.SendMessageAsync("Primary stat updated.");
                    }
                    else
                    {
                        await Context.Channel.SendMessageAsync("That is not a valid stat.");
                    }
                }
            }
Ejemplo n.º 13
0
 public bool equals(CharacterNode c)
 {
     if (c.getCharacterRef() == this.characterRef)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 14
0
 protected override void AssertCharacter(Character model, CharacterNode node)
 {
     var(testCharacter, testNode) = GetTestCharacter();
     AssertPropertiesAreEqual(testCharacter, model, nameof(model.Name),
                              nameof(model.Description));
     AssertPropertiesAreEqual(testNode, node, nameof(node.XPosition),
                              nameof(node.YPosition));
 }
Ejemplo n.º 15
0
        public override void PresentStep(int index, PresentationViewController presentationViewController)
        {
            SCNTransaction.Begin();

            switch (index)
            {
            case 0:
                // Set the slide's title and subtitle and add some text
                TextManager.SetTitle("Skinning");

                TextManager.AddBulletAtLevel("Animate characters", 0);
                TextManager.AddBulletAtLevel("Deform geometries with a skeleton", 0);
                TextManager.AddBulletAtLevel("Joints and bones", 0);

                // Animate the character
                CharacterNode.AddAnimation(IdleAnimationGroup, new NSString("idleAnimation"));

                // The character is hidden. Wait a little longer before showing it
                // otherwise it may slow down the transition from the previous slide
                var delayInSeconds = 1.5;
                var popTime        = new DispatchTime(DispatchTime.Now, (long)(delayInSeconds * Utils.NSEC_PER_SEC));
                DispatchQueue.MainQueue.DispatchAfter(popTime, () => {
                    SCNTransaction.Begin();
                    SCNTransaction.AnimationDuration = 0;
                    CharacterNode.Hidden             = false;
                    CharacterNode.Opacity            = 0;
                    SCNTransaction.Commit();

                    SCNTransaction.Begin();
                    SCNTransaction.AnimationDuration       = 1.5;
                    SCNTransaction.AnimationTimingFunction = CAMediaTimingFunction.FromName(CAMediaTimingFunction.EaseIn);
                    CharacterNode.Opacity = 1;
                    SCNTransaction.Commit();
                });
                break;

            case 1:
                SCNTransaction.AnimationDuration = 1.5f;
                //TODO SetShowsBones (true);
                break;

            case 2:
                CharacterNode.AddAnimation(AnimationGroup1, new NSString("animation"));
                break;

            case 3:
                SCNTransaction.AnimationDuration = 1.5f;
                //TODO SetShowsBones (false);
                break;

            case 4:
                CharacterNode.AddAnimation(AnimationGroup1, new NSString("animation"));
                break;
            }
            SCNTransaction.Commit();
        }
Ejemplo n.º 16
0
        public void ToStringShouldReturnCharAsString()
        {
            // Arrange
            var target = new CharacterNode('a');

            // Act
            var result = target.ToString();

            // Assert
            result.ShouldBe("a");
        }
Ejemplo n.º 17
0
        public void ToStringShouldReturnQuantifierQuestionMarkOnChildNodeToString()
        {
            // Arrange
            var characterNode = new CharacterNode('a');
            var target        = new QuantifierQuestionMarkNode(characterNode);

            // Act
            var result = target.ToString();

            // Assert
            result.ShouldBe("a?");
        }
Ejemplo n.º 18
0
        public void ToStringOnAtomicGroupWithChildNodeShouldReturnAtomicGroupWithChildNode()
        {
            // Arrange
            var childNode = new CharacterNode('a');
            var target    = new AtomicGroupNode(childNode);

            // Act
            var result = target.ToString();

            // Assert
            result.ShouldBe("(?>a)");
        }
        public void ToStringOnLookaroundGroupChildNodeShouldReturnLookaroundWithChildNode()
        {
            // Arrange
            var childNode = new CharacterNode('a');
            var target    = new LookaroundGroupNode(true, true, childNode);

            // Act
            var result = target.ToString();

            // Assert
            result.ShouldBe("(?=a)");
        }
Ejemplo n.º 20
0
        public void GetSpanShouldReturnTupleWithStart0AndLenght1()
        {
            // Arrange
            var target = new CharacterNode('a');

            // Act
            var(Start, Length) = target.GetSpan();

            // Assert
            Start.ShouldBe(0);
            Length.ShouldBe(1);
        }
Ejemplo n.º 21
0
        public void ToStringOnBalancingGroupWithChildNodeShouldReturnBalencingGroupWithChildNode()
        {
            // Arrange
            var childNode = new CharacterNode('a');
            var target    = new BalancingGroupNode("balancedGroup", "currentGroup", false, childNode);

            // Act
            var result = target.ToString();

            // Assert
            result.ShouldBe("(?<currentGroup-balancedGroup>a)");
        }
Ejemplo n.º 22
0
        public void ToStringShouldReturnOriginalQuantifierNMOnChildNodeToString()
        {
            // Arrange
            var characterNode = new CharacterNode('a');
            var target        = new QuantifierNMNode("05", "006", characterNode);

            // Act
            var result = target.ToString();

            // Assert
            result.ShouldBe("a{05,006}");
        }
Ejemplo n.º 23
0
        public void ToStringOnNamedGroupNodeWithChildNodeShouldReturnNamedGroupWithChildNode()
        {
            // Arrange
            var childNode = new CharacterNode('a');
            var target    = new NamedGroupNode("name", false, childNode);

            // Act
            var result = target.ToString();

            // Assert
            result.ShouldBe("(?<name>a)");
        }
Ejemplo n.º 24
0
        public void ToStringShouldReturnQuantifierNMOfIntegersNAndMIfNoOriginalNAndMIsGiven()
        {
            // Arrange
            var characterNode = new CharacterNode('a');
            var target        = new QuantifierNMNode(5, 6, characterNode);

            // Act
            var result = target.ToString();

            // Assert
            result.ShouldBe("a{5,6}");
        }
Ejemplo n.º 25
0
        public void ToStringOnModeModifierGroupNodeWithChildNodeShouldReturnModeModifierGroupWithChildNodeAfterColon()
        {
            // Arrange
            var childNode = new CharacterNode('a');
            var target    = new ModeModifierGroupNode("imsnx-imsnx", childNode);

            // Act
            var result = target.ToString();

            // Assert
            result.ShouldBe("(?imsnx-imsnx:a)");
        }
        public void ToStringOnNonCaptureGroupNodeWithChildNodeShouldReturnEmptyNonCaptureGroupWithChildNode()
        {
            // Arrange
            var childNode = new CharacterNode('a');
            var target    = new NonCaptureGroupNode(childNode);

            // Act
            var result = target.ToString();

            // Assert
            result.ShouldBe("(?:a)");
        }
        public void MutateShouldNotMutateNonQuantifierNode()
        {
            // Arrange
            var characterNode = new CharacterNode('a');
            var rootNode      = new ConcatenationNode(characterNode);
            var target        = new QuantifierRemovalMutator();

            // Act
            var result = target.Mutate(characterNode, rootNode);

            // Assert
            result.ShouldBeEmpty();
        }
Ejemplo n.º 28
0
            public async Task remove([Remainder, Summary("Spell name")] string spellName)
            {
                CharacterNode character = findCharacter(Context.User);

                if (character == null)
                {
                    await Context.User.SendMessageAsync("You have no active character.");

                    return;
                }
                character.removeSpell(spellName);
                await Context.User.SendMessageAsync("The spell was removed from your spell list.");
            }
Ejemplo n.º 29
0
        public void MutateShouldNotMutateNonCharacterClassNode()
        {
            // Arrange
            var characterNode = new CharacterNode('a');
            var root          = new ConcatenationNode(characterNode);
            var target        = new CharacterClassNegationMutator();

            // Act
            var result = target.Mutate(characterNode, root);

            // Assert
            result.ShouldBeEmpty();
        }
Ejemplo n.º 30
0
        public void SpanShouldStartAfterChildNodes()
        {
            // Arrange
            var childNode = new CharacterNode('a');
            var target    = new QuantifierQuestionMarkNode(childNode);

            // Act
            var(Start, Length) = target.GetSpan();

            // Assert
            Start.ShouldBe(childNode.ToString().Length);
            Length.ShouldBe(1);
        }
Ejemplo n.º 31
0
    public void traverse(string _desc, HtmlNode _node)
    {
        HtmlAgilityPack.HtmlNodeCollection nodes;
        CharacterNode chNode;
        nodes = _node.SelectNodes(@"//table[@class='ulist mt10']/tbody/tr");

        foreach (HtmlNode chnode in nodes)
        {
            saveNodeToFile(chnode);
            chNode = new CharacterNode(chnode);
        }
    }
Ejemplo n.º 32
0
    IEnumerator HandleEvent(GameObject goTarget)
    {
        //Debug.Log("Starting event!");
        goTarget.SetActive(true);               //We enable the frogs.

        yield return new WaitForSeconds(5.0f);  //We wait for a moment.

        int layerMask = 1 << 11;
        // This would cast rays only against colliders in layer 11, the Memory Layer.
        // But instead we want to collide against everything except layer 11. The ~ operator does this, it inverts a bitmask.
        layerMask = ~layerMask;

        //Creating the event within the shared event graph.
        //1. We create the core event node.
        //2. We add all the large enemy frogs to the graph, and link them to the event.
        //3. We add the location of the event to the graph, and link it to the event.
        //4. We create the sub-event, and add it to the graph.
        //5. We link the sub-event to the location.
        //6. We add all the small enemy frogs to the graph, and link them to the sub event.
        //7. We then generate the personalised memories for all agents in the area.

        EventNode coreSharedEvent = new EventNode("FrogAttack", new int[] { 3 }, new string[] { "EVN_FrogAttack" });
        MemoryGraphNode coreSharedEventNode = EventManager.Instance.SharedEventGraph.AddNamedNodeToGraph(coreSharedEvent);

        //We populate the shared event graph with info about the event.
        for (int i = 0; i < tLargeFrogs.Length; i++)
        {
            CharacterNode frogNode = new CharacterNode(tLargeFrogs[i].Tag);
            MemoryGraphNode frogEventNode = EventManager.Instance.SharedEventGraph.AddNamedNodeToGraph(frogNode);

            EventManager.Instance.SharedEventGraph.AddUndirectedEdge(coreSharedEventNode, frogEventNode, 11.0f);
        }

        LocationNode lNode = new LocationNode(Locations.SouthernPinnusula);
        MemoryGraphNode locationGraphNode = EventManager.Instance.SharedEventGraph.AddNamedNodeToGraph(lNode);
        EventManager.Instance.SharedEventGraph.AddUndirectedEdge(coreSharedEventNode, locationGraphNode, 11.0f);

        EventNode coreSharedSubEvent = new EventNode("SmallFrogEvent", new int[] { 17 }, new string[] { "Monsters" });
        MemoryGraphNode coreSharedSubEventNode = EventManager.Instance.SharedEventGraph.AddNamedNodeToGraph(coreSharedSubEvent);
        EventManager.Instance.SharedEventGraph.AddUndirectedEdge(coreSharedEventNode, coreSharedSubEventNode, 11.0f);
        EventManager.Instance.SharedEventGraph.AddUndirectedEdge(coreSharedSubEventNode, locationGraphNode, 11.0f);

        for (int i = 0; i < tSmallFrogs.Length; i++)
        {
            CharacterNode frogNode = new CharacterNode(tSmallFrogs[i].Tag);
            MemoryGraphNode frogEventNode = EventManager.Instance.SharedEventGraph.AddNamedNodeToGraph(frogNode);

            EventManager.Instance.SharedEventGraph.AddUndirectedEdge(coreSharedSubEventNode, frogEventNode, 11.0f);
        }

        for (int i = 0; i < AgentManager.Instance.GetAgentCount(); i++)
        {
            CharacterDetails charDetails = AgentManager.Instance.GetAgent(i);
            MemoryGraph charGraph = charDetails.IsPlayer ? charDetails.PlayerAgent.MindsEye.MemoryGraph : charDetails.CognitiveAgent.MindsEye.MemoryGraph;

            EventNode coreEvent = new EventNode("FrogAttack", null, new string[] { "EVN_FrogAttack" });
            MemoryGraphNode coreEventNode = charGraph.AddNamedNodeToGraph(coreEvent);

            string eventLocation = Locations.SouthernPinnusula.ToString();

            bool sawEvent = false;
            int frogCount = 0;
            for (int x = 0; x < tLargeFrogs.Length; x++)
            {
                RaycastHit hit;
                Vector3 direction = tLargeFrogs[x].cTransform.position - charDetails.HeadTarget.position;
                if (Physics.Raycast(charDetails.HeadTarget.position, direction, out hit, Mathf.Infinity, layerMask))
                {
                    //Debug.Log(charDetails.CharCue.UniqueNodeID + " - " + hit.transform.name);
                    EventTag eTag = hit.transform.GetComponent<EventTag>();
                    if (eTag != null && eTag.Tag == tLargeFrogs[x].Tag)
                        ++frogCount;
                }
            }

            MemoryGraphNode largeFrogNode = null;
            if (frogCount > 0)
            {
                sawEvent = true;
                //Create Large Frogs sub-event!
                EventNode largeFrogEvent = new EventNode("LargeFrogEvent", new int[] { frogCount }, new string[] { "Monsters" });
                largeFrogNode = charGraph.AddNamedNodeToGraph(largeFrogEvent);
                charGraph.AddUndirectedEdge(coreEventNode, largeFrogNode, 11.0f, 1.0f);        //Creates a strong connection between the core event and the optional sub-event.  

            }

            //Debug.Log(charDetails.name + " - I saw " + frogCount + " huge frogs!");

            frogCount = 0;
            for (int x = 0; x < tSmallFrogs.Length; x++)
            {
                RaycastHit hit;
                Vector3 direction = tSmallFrogs[x].cTransform.position - charDetails.HeadTarget.position;
                if (Physics.Raycast(charDetails.HeadTarget.position, direction, out hit, direction.magnitude, layerMask))
                {
                    //Debug.Log(charDetails.CharCue.UniqueNodeID + " - " + hit.transform.name);
                    EventTag eTag = hit.transform.GetComponent<EventTag>();

                    //if(eTag != null)
                    //Debug.Log(charDetails.CharCue.UniqueNodeID + " : " + eTag.Tag);

                    if (eTag != null && eTag.Tag == tSmallFrogs[x].Tag)
                        ++frogCount;
                }
            }

            MemoryGraphNode smallFrogNode = null;
            if (frogCount > 0)
            {
                sawEvent = true;
                //Create small frogs sub-event!
                EventNode smallFrogEvent = new EventNode("SmallFrogEvent", new int[] { frogCount }, new string[] { "Monsters" });
                smallFrogNode = charGraph.AddNamedNodeToGraph(smallFrogEvent);
                charGraph.AddUndirectedEdge(coreEventNode, smallFrogNode, 11.0f, 1.0f);        //Creates a strong connection between the core event and the optional sub-event.

            }

            if (sawEvent)
            {
                MemoryGraphNode retainedMemory;
                if (charGraph.Contains(eventLocation) == false)
                    retainedMemory = charGraph.AddNamedNodeToGraph(new LocationNode(Locations.SouthernPinnusula));  //This is a new memory! Add it to our memory graph.
                else
                    retainedMemory = charGraph.GetNamedNodeFromGraph(eventLocation);

                charGraph.UpdateCueOpinion(retainedMemory.MemoryNode, -5.0f);               //The agent will have a strong negative opinion about the area where they attack.
                charGraph.AddUndirectedEdge(coreEventNode, retainedMemory, 11.0f, 1.0f);     //They will also make a strong connection between the area and the frogs.

                if (largeFrogNode != null)
                    charGraph.AddDirectedEdge(largeFrogNode, retainedMemory, 11.0f, 1.0f);          //Creates a strong (but one-way, since we already connect the core event) connection to the location.

                if (smallFrogNode != null)
                    charGraph.AddDirectedEdge(smallFrogNode, retainedMemory, 11.0f, 1.0f);          //Creates a strong (but one-way, since we already connect the core event) connection to the location.
            }
        }

        //We broadcast the Frog Sight Event and create the Shared Events and personalised Sub Events.
        //We also broadcast the start of the event (so people flee).

        yield return new WaitForSeconds(5.0f);

        //We broadcast the end of the event, and hide the frogs again.
        goTarget.SetActive(false);
        //Debug.Log("Ending event!");

        //EventManager.Instance.SharedEventGraph.PrintGraph();
    }