コード例 #1
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);
		}
コード例 #2
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);
		}
コード例 #3
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();
		}
コード例 #4
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;
		}
コード例 #5
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();
		}
コード例 #6
0
		public void SetQuest(AbstractQuest quest)
		{ _quest = quest; }
コード例 #7
0
		public virtual void Commit(AbstractQuest map, StoryTeller storyTeller)
		{ } // Override with subclasses
コード例 #8
0
		public QuestAnalyzer(AbstractQuest quest):base()
		{
			_quest = quest;
		}