示例#1
0
        private void GivePlayerQuestRewards(Quest quest, TTS tts)
        {
            RaiseMessage("");
            RaiseMessage("Completaste a missão '" + quest.Name + "'!");
            RaiseMessage("Recompensa: ");
            RaiseMessage(quest.RewardExperiencePoints + " pontos de experiência.");
            RaiseMessage(quest.RewardGold + " moedas de ouro");
            RaiseMessage(quest.RewardItem.Name, true);

            AddExperiencePoints(quest.RewardExperiencePoints);
            Gold += quest.RewardGold;

            RemoveQuestCompletionItems(quest);
            AddItemToInventory(quest.RewardItem);

            MarkPlayerQuestCompleted(quest);
            if (quest.RewardItem == null)
            {
                tts.Speak(text + " e completáste a missão '" + quest.Name + "'!" + "\n" + " Gánháste " + quest.RewardExperiencePoints + " pontos de experiência, " + quest.RewardGold + " moedas de ouro.");
            }
            else
            {
                tts.Speak(text + " e completáste a missão '" + quest.Name + "'!" + "\n" + " Gánháste " + quest.RewardExperiencePoints + " pontos de experiência, " + quest.RewardGold + " moedas de ouro e o item: " + quest.RewardItem.Name + ".");
            }
            text = "";
        }
示例#2
0
        private void SetTheCurrentMonsterForTheCurrentLocation(Location location, TTS tts)
        {
            // Populate the current monster with this location's monster (or null, if there is no monster here)
            CurrentMonster = location.NewInstanceOfMonsterLivingHere();

            if (CurrentMonster != null)
            {
                RaiseMessage("Tu vês " + CheckMonsterGender(CurrentMonster.Name, 1) + " " + CurrentMonster.Name + ".");
                if (text != "")
                {
                    tts.Speak(text + " e vês " + CheckMonsterGender(CurrentMonster.Name, 1) + " " + CurrentMonster.Name + ".");
                    text = "";
                }
                else
                {
                    tts.Speak("Tu vês " + CheckMonsterGender(CurrentMonster.Name, 1) + " " + CurrentMonster.Name + ".");
                }
            }
            else
            {
                if (text != "")
                {
                    tts.Speak(text);
                    text = "";
                }
            }
        }
示例#3
0
 public void MoveWest(TTS tts)
 {
     if (CurrentLocation.LocationToWest != null)
     {
         text = "Foste para Oeste.";
         MoveTo(CurrentLocation.LocationToWest, tts);
     }
     else
     {
         tts.Speak("Não podes ir mais para Oeste.");
     }
 }
示例#4
0
 public void MoveSouth(TTS tts)
 {
     if (CurrentLocation.LocationToSouth != null)
     {
         text = "Foste para Sul.";
         MoveTo(CurrentLocation.LocationToSouth, tts);
     }
     else
     {
         tts.Speak("Não podes ir mais para Sul.");
     }
 }
示例#5
0
        private void LetTheMonsterAttack(TTS tts)
        {
            int damageToPlayer = RandomNumberGenerator.NumberBetween(0, CurrentMonster.MaximumDamage);

            RaiseMessage(CheckMonsterGender(CurrentMonster.Name, 0).ToUpper() + " " + CurrentMonster.Name + " tirou-te " + damageToPlayer + " pontos de vida.");
            CurrentHitPoints -= damageToPlayer;

            if (IsDead)
            {
                text = CheckMonsterGender(CurrentMonster.Name, 0).ToUpper() + " " + CurrentMonster.Name + " tirou-te " + damageToPlayer + " pontos de vida." + "E por isso Morrêste!";
                RaiseMessage(CheckMonsterGender(CurrentMonster.Name, 0).ToUpper() + " " + CurrentMonster.Name + " matou-te.");

                // Place PlayerPain sound here
                PlayAudio("PlayerPain", DisableAudio);
                tts.Speak(text);
                text = "";
                MoveHome(tts);
            }
            else
            {
                tts.Speak(text + CheckMonsterGender(CurrentMonster.Name, 0).ToUpper() + " " + CurrentMonster.Name + " tirou-te " + damageToPlayer + " pontos de vida.");
                text = "";
            }
        }
示例#6
0
        private void GiveQuestToPlayer(Quest quest, TTS tts)
        {
            RaiseMessage("Tens uma missão nova: " + quest.Name + ".");
            RaiseMessage(quest.Description);
            RaiseMessage("Para completá-la, volta com:");
            string items = "";

            foreach (QuestCompletionItem qci in quest.QuestCompletionItems)
            {
                items += string.Format("{0} {1}", qci.Quantity,
                                       qci.Quantity == 1 ? qci.Details.Name : qci.Details.NamePlural);
                items += ",";
                RaiseMessage(string.Format("{0} {1}", qci.Quantity,
                                           qci.Quantity == 1 ? qci.Details.Name : qci.Details.NamePlural));
            }

            RaiseMessage("");

            Quests.Add(new PlayerQuest(quest));
            tts.Speak(text + " e tens uma missão nova: " + quest.Name + "." + " Para completá-la, volta com: " + items);
            text = "";
        }
示例#7
0
        public void MoveTo(Location location, TTS tts)
        {
            if (PlayerDoesNotHaveTheRequiredItemToEnter(location))
            {
                RaiseMessage("Tens de obter " + location.ItemRequiredToEnter.Name + " primeiro para entrar neste local.");
                text = "Tens de obter " + location.ItemRequiredToEnter.Name + " primeiro para entrar neste local.";
                tts.Speak(text);
                text = "";
                return;
            }
            // The player can enter this location
            CurrentLocation = location;

            if (!LocationsVisited.Contains(CurrentLocation.ID))
            {
                LocationsVisited.Add(CurrentLocation.ID);
            }

            CompletelyHeal();

            if (location.HasAQuest)
            {
                if (PlayerDoesNotHaveThisQuest(location.QuestAvailableHere))
                {
                    GiveQuestToPlayer(location.QuestAvailableHere, tts);
                }
                else
                {
                    if (PlayerHasNotCompleted(location.QuestAvailableHere) &&
                        PlayerHasAllQuestCompletionItemsFor(location.QuestAvailableHere))
                    {
                        GivePlayerQuestRewards(location.QuestAvailableHere, tts);
                    }
                }
            }
            SetTheCurrentMonsterForTheCurrentLocation(location, tts);
        }