Beispiel #1
0
 public override void CompleteInteract()
 {
     if (!Flags.AcquireRod)
     {
         var storyOver = _gameFrameStory.GetVariableState <int>("acquire_rod") == 1;
         if (storyOver)
         {
             GameFlags.SetVariable("acquire_rod", true);
         }
     }
 }
Beispiel #2
0
 public override GameFrameStory Interact()
 {
     if (StoryOver && !AcquireSword)
     {
         AcquireSword = true;
         GameFlags.SetVariable("acquire_sword", true);
         return(ReadStory("dojo_master_acquire_sword.ink"));
     }
     else
     {
         return(base.Interact());
     }
 }
 public override GameFrameStory Interact()
 {
     GameStory = ReadStory("princess_pre_kidnapping.ink");
     GameStory.ObserveVariable("move_bandit", (varName, newValue) =>
     {
         var moveTo = PlayerEntity.Instance.Position.ToPoint();
         MoveDelegate(_fakeGuard, moveTo);
     });
     GameStory.ObserveVariable("fwacked", (varName, newValue) =>
     {
         if (!Fwacked)
         {
             Fwacked = true;
             _removeEntity.Invoke(_fakeGuard);
             _removeEntity.Invoke(this);
             GameFlags.SetVariable("princess_kidnapped", true);
         }
     });
     return(GameStory);
 }
Beispiel #4
0
        public override GameFrameStory Interact()
        {
            GameFrameStory toReturn;

            if (Flags.AcquiredSword)
            {
                _complete = true;
                toReturn  = ReadStory("sword_blocker_complete.ink");
                GameFlags.SetVariable("sword_blocker_moved", true);
            }
            else if (!_moved)
            {
                toReturn = ReadStory("sword_blocker.ink");
            }
            else
            {
                toReturn = ReadStory("sword_blocker_moved.ink");
            }
            return(toReturn);
        }
Beispiel #5
0
        public override GameFrameStory Interact()
        {
            var scriptName = Flags.LearnedFight ? "north_guard_post_fight.ink" : "north_guard_pre_fight.ink";

            GameStory = ReadStory(scriptName);
            if (Flags.LearnedFight)
            {
                GameStory.ChoosePathString("dialog");
                CompleteEvent completeEvent = victory =>
                {
                    if (victory)
                    {
                        var collision = _collision.Invoke(Position.ToPoint(), EndPosition.ToPoint());
                        var endPoint  = collision ? _alternativeEndPoint : EndPosition;
                        MoveDelegate?.Invoke(this, endPoint.ToPoint());
                        GameFlags.SetVariable(FlagName, true);
                        AlreadyMoved = true;
                    }
                };
                ReadStory(GameStory, completeEvent);
            }
            return(GameStory);
        }
Beispiel #6
0
 public override void CompleteInteract()
 {
     if (Flags.PrincessKidnapped)
     {
         if (GaveFish)
         {
             var preStoryOver = StoryOver;
             base.CompleteInteract();
             if (StoryOver && !preStoryOver)
             {
                 GameFlags.SetVariable("learned_fight", true);
             }
         }
         else
         {
             GaveFish = GameStory.GetVariableState <int>(GaveFishVariable) == 1;
             if (GaveFish)
             {
                 GameFlags.SetVariable(GaveFishVariable, GaveFish);
                 Flags.FishCount -= 3;
             }
         }
     }
 }
Beispiel #7
0
        public override GameFrameStory Interact()
        {
            GameStory = ReadStory(ScriptName);
            GameStory.ChoosePathString("dialog");
            CompleteEvent completeEvent = win =>
            {
                if (win)
                {
                    var collision = _collision.Invoke(Position.ToPoint(), EndPosition.ToPoint());
                    var endPoint  = collision ? _alternativeEndPoint : EndPosition;
                    MoveDelegate?.Invoke(this, endPoint.ToPoint());
                    GameFlags.SetVariable(FlagName, true);
                    AlreadyMoved = true;
                }
                var dialog      = win ? "victory.ink" : "defeat.ink";
                var storyScript = StoryImporter.ReadStory(dialog);
                var newStory    = new GameFrameStory(storyScript);
                newStory.Continue();
                _say.Invoke(newStory);
            };

            ReadStory(GameStory, completeEvent);
            return(GameStory);
        }