コード例 #1
0
		override public void Commit(AbstractQuest quest, StoryTeller storyTeller)
		{
			//Story story = new Story();
			//story.Add(storyTeller.NarratorVoice, _avatar.ClassDescription + " moves");
			//storyTeller.StoryComplete += OnStoryComplete;
			//storyTeller.TellStory(story);

			// Look up the avatars tile
			MapTile avatarTile = quest.GetAvatarMapTile(_avatar);
			Point avatarCurrentLocation = quest.GetAvatarLocation(_avatar);

			// Update the avatars vector
			Point moveToPoint = _stepsToLocation[0];
			_stepsToLocation.RemoveAt(0);

			HasMoreTurns = (_stepsToLocation.Count > 0) ? true : false; // If there are more steps, then we can be used in subsequent turns!
			AcceptsAvatarFocus = HasMoreTurns;

			_avatar.movementVector.X = moveToPoint.X - avatarCurrentLocation.X;
			_avatar.movementVector.Y = moveToPoint.Y - avatarCurrentLocation.Y;
			
			_avatar.TurnState.MovementPointsLeft--;

			// Move the tile
			quest.Map.MoveMapTile(avatarTile, moveToPoint);
			quest.Map.SetFactionWalkedOn(_avatar.Faction, moveToPoint);

			DoComplete();
		}
コード例 #2
0
		override public void Commit(AbstractQuest quest, StoryTeller storyTeller)
		{
			Story story = new Story();
			story.Add(storyTeller.NarratorVoice, _actor.ClassDescription + " is confused and doesn't know what to do.");
			storyTeller.StoryComplete += OnStoryComplete;
			storyTeller.TellStory(story);
		}
コード例 #3
0
		override public void Commit(AbstractQuest map, StoryTeller storyTeller)
		{
			Story story = new Story();
			story.Add(storyTeller.NarratorVoice, _actor.ClassDescription + " is dead.");
			storyTeller.StoryComplete += OnStoryComplete;
			storyTeller.TellStory(story);
		}
コード例 #4
0
		public GameIntroduction(StoryTeller storyTeller)
		{
			InitializeComponent();

			_storyTeller = storyTeller;

			Loaded += OnLoaded;
		}
コード例 #5
0
		public HeroesLose(StoryTeller storyTeller)
		{
			InitializeComponent();

			_storyTeller = storyTeller;

			Loaded += OnLoaded;
		}
コード例 #6
0
		public TheTrial(List<Hero> heroes):base(new Point(1, 14), heroes)
		{
			// Configure the story
			StoryTeller storyTeller = new StoryTeller();
			IntroductionStory = new Story();
			IntroductionStory.Add(storyTeller.NarratorVoice, "Quest one.  The Trial.");
			//IntroductionStory.Add(storyTeller.MentorVoice, "You have learned well, my friends.  Now has come the time of your first trial.  You must first enter the catacombs which contain Fellmarg's Tomb.  You must seek out and destroy Verag, a foul Gargoyle who hides in the catacombs.  This Quest is not easy and you must work together in order to survive.  This is your first step on the road to becoming true Heroes.  Tread carefully my friends.");

			// Prepare the map
			Map.SetBaseAreaWithTile(new Point(0, 0), 26, 1, new FloorBlockedTile());
			Map.SetBaseAreaWithTile(new Point(12, 0), 2, 5, new FloorBlockedTile());
			Map.SetBaseAreaWithTile(new Point(14, 1), 12, 5, new FloorBlockedTile());
			Map.SetBaseAreaWithTile(new Point(17, 6), 9, 7, new FloorBlockedTile());
			Map.SetBaseAreaWithTile(new Point(18, 13), 8, 5, new FloorBlockedTile());
			Map.SetBaseAreaWithTile(new Point(14, 18), 12, 1, new FloorBlockedTile());
			Map.SetBaseAreaWithTile(new Point(5, 10), 4, 3, new FloorBlockedTile());

			Map.SetBaseTile(0, 1, new RockTile());
			Map.SetBaseTile(12, 5, new RockTile());
			Map.SetBaseTile(13, 5, new RockTile());
			Map.SetBaseTile(17, 9, new RockTile());
			Map.SetBaseTile(14, 18, new RockTile());

			List<TwoLinkedPoints> doorLocations = new List<TwoLinkedPoints>();
			doorLocations.Add(new TwoLinkedPoints(3, 4, 3, 3));
			doorLocations.Add(new TwoLinkedPoints(4, 2, 5, 2));
			doorLocations.Add(new TwoLinkedPoints(8, 2, 9, 2));
			doorLocations.Add(new TwoLinkedPoints(3, 8, 3, 9));
			doorLocations.Add(new TwoLinkedPoints(0, 11, 1, 11));
			doorLocations.Add(new TwoLinkedPoints(3, 18, 3, 17));
			doorLocations.Add(new TwoLinkedPoints(7, 17, 7, 18));
			doorLocations.Add(new TwoLinkedPoints(8, 15, 9, 15));
			doorLocations.Add(new TwoLinkedPoints(10, 12, 10, 13));
			doorLocations.Add(new TwoLinkedPoints(13, 15, 14, 15));
			doorLocations.Add(new TwoLinkedPoints(15, 9, 16, 9));

			//Map.RemoveBarriersBetween(1, 17, 1, 18); // Debug, chop a hole to test line of sight.

			foreach (TwoLinkedPoints linkedPoints in doorLocations)
			{ Map.RemoveBarriersBetween(linkedPoints.PointA, linkedPoints.PointB); }

			// Calculate nodes
			Map.CalculatePathfindingGraph();

			foreach (TwoLinkedPoints linkedPoints in doorLocations)
			{ Map.AddDoorBetween(linkedPoints.PointA, linkedPoints.PointB); }

			Map.AddTile(10, 5, new TreasureChestHorizontalTile());
			Map.AddTile(11, 7, new TreasureChestHorizontalTile());
			Map.AddTile(17, 16, new TreasureChestVerticalTile());

			//AddMonster(new Monster(new AvatarClassOrc()), new Point(7, 14));
			//AddMonster(new Monster(new AvatarClassOrc()), new Point(8, 15));
		}
コード例 #7
0
		public QuestView(AbstractQuest quest, ChanceProvider chanceProvider, StoryTeller storyTeller)
		{
			InitializeComponent();

			_quest = quest;
			_chanceProvider = chanceProvider;
			_storyTeller = storyTeller;

			_turnTakers = new List<Avatar>();
			_currentTurnTaker = null;
			_currentTurnTakerIndex = -1;

			_turnTimer = new DispatcherTimer();
			_turnTimer.Interval = TimeSpan.FromMilliseconds(500);
			_turnTimer.Tick += OnTurnTimerTick;

			Loaded += OnLoaded;
		}
コード例 #8
0
		override public void Commit(AbstractQuest quest, StoryTeller storyTeller)
		{
			if (_tileAction is IRequiresModifiableMap)
			{ ((IRequiresModifiableMap)_tileAction).SetModifiableMap(quest.Map); }
			if (_tileAction is IRequiresAvatar)
			{ ((IRequiresAvatar)_tileAction).SetAvatar(_avatar); }
			if (_tileAction is IRequiresQuest)
			{ ((IRequiresQuest)_tileAction).SetQuest(quest); }

			if (_tileAction.ConsumesTurnAction)
			{
				RequiresAction = true;
				_avatar.TurnState.HasTakenAction = true;
				if (_avatar.TurnState.TotalMovementPointsForTurn != _avatar.TurnState.MovementPointsLeft)
				{ _avatar.TurnState.MovementPointsLeft = 0; }
			}
			
			_tileAction.Execute();

			DoComplete();
		}
コード例 #9
0
		public MasterController(NavigationService navigationService)
			: base()
		{
			_navigationService = navigationService;
			_storyTeller = new StoryTeller();
		}
コード例 #10
0
		public virtual void Commit(AbstractQuest map, StoryTeller storyTeller)
		{ } // Override with subclasses