예제 #1
0
    private void Kick(string arg, string arg2)
    {
        GameObject hit = GetRaycastObject();

        if (hit == null)
        {
            if (arg == null)
            {
                DialogueScript.GameInformationText("You kick out wildly into the air. Not sure that is helping anyone.");
                return;
            }
            DialogueScript.ErrorText("Somehow, you fail to kick anything.");
            return;
        }
        if (arg2 == null)
        {
            if (string.Equals(hit.transform.gameObject.tag, arg, StringComparison.CurrentCultureIgnoreCase))
            {
                DialogueScript.GameInformationText("You kick the " + arg + ". Did it help you?");
                return;
            }
        }
        if (arg.ToUpper() == "THE")
        {
            if (string.Equals(hit.transform.gameObject.tag, arg, StringComparison.CurrentCultureIgnoreCase))
            {
                DialogueScript.GameInformationText("You kick " + arg + " " + arg2 + ". Did it help you?");
                return;
            }
        }
        else
        {
            DialogueScript.ErrorText("What exactly are you trying to kick?");
        }
    }
예제 #2
0
 /// <summary>
 /// Emote "Hide". Can take none, one or two arguments.
 /// </summary>
 /// <param name="arg">Players first argument</param>
 /// <param name="arg2">Players second argument</param>
 private void Hide(string arg, string arg2)
 {
     if (arg == null && arg2 == null)
     {
         DialogueScript.GameInformationText("The big bad warrior tries to hide.");
     }
 }
예제 #3
0
 public void Cleave()
 {
     if (OnCooldown("cleave"))
     {
         return;
     }
     lastMove = "Cleave";
     //Do a vertical cleave for x damage
     if (PlayerPrefs.GetInt("Level") < 4)
     {
         DialogueScript.ErrorText("You're not quite sure how to do that yet.");
         DialogueScript.ErrorText("Maybe after a couple more battles");
         DialogueScript.CombatTextEnemy("You space out a bit, and the enemy strikes!");
         ChangeTurn(null, null);
         return;
     }
     if (chargeAmount <= 0)
     {
         DialogueScript.GameInformationText("You fill up with rage.");
         DialogueScript.GameInformationText("Next turn you can do the attack!");
         EndOfTurn("Cleave", 1, 0);
         chargeAmount = 3;
     }
     else
     {
         chargeAmount = 0;
         DialogueScript.GameInformationText("You strike the enemy with a heavy hit!");
         EndOfTurn("Cleave", 3, Random.Range(PlayerPrefs.GetInt("Strength") + chargeAmount, PlayerPrefs.GetInt("Strenght") + PlayerPrefs.GetInt("Level") + chargeAmount));
     }
 }
예제 #4
0
 public void CounterAttack()
 {
     if (OnCooldown("counterattack"))
     {
         return;
     }
     if (PlayerPrefs.GetInt("Level") < 6)
     {
         DialogueScript.ErrorText("Oh, that is something you havn't learnt to do yet.");
         DialogueScript.CombatTextEnemy("The enemy sees an opening, and stikes!");
         ChangeTurn(null, null);
         return;
     }
     if (lastMove != "ShieldBlock")
     {
         DialogueScript.ErrorText("You need to block first!");
     }
     else
     {
         int cm = PlayerPrefs.GetInt("Level");
         if (cm > 3)
         {
             cm = 3;
         }                                 //cant do more than three times stored damage
         DialogueScript.GameInformationText("You see an opening, and strike!");
         EndOfTurn("CounterAttack", 1, Random.Range(storedDamage, storedDamage * cm));
     }
     //Do a quick attack for x damage after blocking an attack
     lastMove     = "CounterAttack";
     storedDamage = 0;
 }
예제 #5
0
    public void StrainSlash()
    {
        if (OnCooldown("strainslash"))
        {
            return;
        }
        lastMove = "StrainSlash";
        if (PlayerPrefs.GetInt("Level") < 8)
        {
            DialogueScript.ErrorText("While you grasp the consept, you still don't know how to do it");
            DialogueScript.CombatTextEnemy("The enemy sees your uncertainty, and strikes!");
            ChangeTurn(null, null);
            return;
        }

        if (PlayerPrefs.GetInt("Strength") > 5)
        {
            DialogueScript.GameInformationText("You strain yourself in the attack!");
            DialogueScript.GameInformationText("You feel weaker.");
            PlayerPrefs.SetInt("Strenght", PlayerPrefs.GetInt("Strenght") - 1);             //-1 permanent strenght
            EndOfTurn("StrainSlash", 3, Random.Range((PlayerPrefs.GetInt("Strength") + 1) * 2,
                                                     (PlayerPrefs.GetInt("Strenght") + 1 + PlayerPrefs.GetInt("Level")) * 2));
        }
        else
        {
            DialogueScript.GameInformationText("You are not strong enough for this anymore.");
            DialogueScript.GameInformationText("Try a different attack");
        }
    }
예제 #6
0
 /// <summary>
 /// Rest for 4x5% of total health. Calls an IEnumerator that in turn calls AddRestingHealth x 4 every 1.5 seconds.
 /// </summary>
 /// <param name="arg">The argument.</param>
 public void Rest(string arg)
 {
     MovementHappening = true;
     DialogueScript.GameInformationText("You rest to regain health.");
     ClearCommandPool();
     StartCoroutine("Resting");
 }
예제 #7
0
    IEnumerator Darken()
    {
        if (GameObject.Find("ScriptHolder").GetComponent <LevelScript>().TorchNumber == 0)        //if all torches are dead, don't do anything but speak
        {
            DialogueScript.CombatTextEnemy("The darkness is the best isn't it?");
        }
        else
        {
            int randomText = Random.Range(0, 3);            //for picking a text

            if (randomText == 1)
            {
                DialogueScript.CombatTextEnemy("Dagur shall stay here forever!");
            }
            else if (randomText == 2)
            {
                DialogueScript.CombatTextEnemy("The sun will never rise!");
            }
            else
            {
                DialogueScript.CombatTextEnemy("Let there be darkness!");
            }

            yield return(new WaitForSeconds(3));

            DialogueScript.GameInformationText("One of the torches flickers");
            GameObject.Find("ScriptHolder").GetComponent <LevelScript>().TorchCountdown += 20;      //add to the tourchcounter
            GameObject.Find("ScriptHolder").GetComponent <LevelScript>().TorchCounter();            //dim one light
        }

        FinishTurn();
    }
예제 #8
0
 /// <summary>
 /// Adds the health to PlayerPrefs
 /// </summary>
 /// <param name="amountHealth">The amount of health to add.</param>
 private void AddRestingHealth(int amountHealth)
 {
     DialogueScript.GameInformationText("Resting....");
     PlayerPrefs.SetInt("Health", PlayerPrefs.GetInt("Health") + amountHealth);
     if (PlayerPrefs.GetInt("Health") > PlayerPrefs.GetInt("Constitution") * 10)
     {
         PlayerPrefs.SetInt("Health", PlayerPrefs.GetInt("Constitution") * 10);
     }
 }
예제 #9
0
 /// <summary>
 /// Prints out the Players current stats
 /// </summary>
 /// <param name="arg">The argument.</param>
 public void Stats(string arg)
 {
     DialogueScript.GameInformationText("Your stats are :\n" +
                                        "Strength: " + PlayerPrefs.GetInt("Strength") + "\n" +
                                        "Dexterity: " + PlayerPrefs.GetInt("Dexterity") + "\n" +
                                        "Constitution: " + PlayerPrefs.GetInt("Constitution"));
     DialogueScript.GameInformationText("You currently have " + PlayerPrefs.GetInt("Health") + " out of maximum " + PlayerPrefs.GetInt("Constitution") * 10 + " health!");
     DialogueScript.GameInformationText("You are carrying " + Keys + " keys.");
     DialogueScript.GameInformationText("You have " + PlayerPrefs.GetInt("CommandsPool") + " free command slots.");
     DialogueScript.GameInformationText("You're currently level " + PlayerPrefs.GetInt("Level") + ".");
 }
예제 #10
0
 //Special Abilities
 public void Shield(string arg)
 {
     if (OnCooldown("shield"))
     {
         return;
     }
     lastMove = "ShieldBlock";
     DialogueScript.GameInformationText("You raise your shield.");
     EndOfTurn("ShieldBlock", 1, 0);
     //You block all attacks for 5 seoconds
 }
예제 #11
0
    private void Wear(string arg, string arg2)
    {
        if (arg2 == null)
        {
            DialogueScript.GameInformationText("You try to wear a " + arg + ". You look really pretty.");
            return;
        }

        if (arg.ToUpper() == "A")
        {
            DialogueScript.GameInformationText("You try to wear " + arg + " " + arg2 + ". You look really pretty.");
        }
    }
예제 #12
0
    /// <summary>
    /// Emote "Jump". Can take none, one or two arguments.
    /// </summary>
    /// <param name="arg">Players first argument</param>
    /// <param name="arg2">Players second argument</param>
    private void Jump(string arg, string arg2)
    {
        GameObject stairs = GetRaycastObject("Stairs");
        GameObject hit    = GetRaycastObject();

        if (arg == null && arg2 == null)
        {
            if (stairs != null && hit == null)
            {
                DialogueScript.GameInformationText("You should be careful jumping around ladders like that.");
                return;
            }
            if (hit != null)
            {
                DialogueScript.GameInformationText("Are you trying to jump on the " + hit.tag + "?");
                return;
            }
            if (stairs == null && hit == null)
            {
                DialogueScript.GameInformationText("Pretending to be a balloon, you jump up in the air.");
                return;
            }
        }
        if (arg != null && arg2 == null)
        {
            if (hit != null)
            {
                if (string.Equals(hit.tag, arg, StringComparison.CurrentCultureIgnoreCase))
                {
                    DialogueScript.GameInformationText("You'd like to jump on the " + arg + "?");
                    return;
                }
                DialogueScript.GameInformationText("That's not a " + arg + "!");
                return;
            }
            if (string.Equals(arg, "up", StringComparison.CurrentCultureIgnoreCase))
            {
                DialogueScript.GameInformationText("Barely getting off your feet, you jump up.");
                return;
            }
            if (hit == null)
            {
                DialogueScript.GameInformationText("There's no " + arg + " that you can jump on.");
                return;
            }
        }
        if (arg != null && arg2 != null)
        {
            DialogueScript.GameInformationText("I haven't taken two arguments into account yet.");
        }
    }
예제 #13
0
 public void GettingLoot(string potionType)
 {
     StopCoroutine("ActivatingCommands");
     ClearCommandPool();
     if (LootedPermPotion)
     {
         DialogueScript.GameInformationText("You looted a " + potionType + " potion!");
         DialogueScript.GameInformationText("If you want to use it, write yes! Otherwise write anything else.");
         InterfaceScript.IsGettingLoot = true;
         InterfaceScript.ActivateInput();
         GameTurnController.CurrentState = GameTurnController.PlayerState.PlayerTurn;
         return;
     }
     StartChain();
 }
예제 #14
0
    /// <summary>
    /// Activates the instant command.
    /// </summary>
    /// <param name="instantCommand">The instant command.</param>
    /// <returns></returns>
    public IEnumerator ActivateInstantCommand(string instantCommand)
    {
        //Change the state to CommandChain
        if (GameTurnController.CurrentState == GameTurnController.PlayerState.PlayerTurn)
        {
            GameTurnController.CurrentState = GameTurnController.PlayerState.CommandChain;
        }
        //Deactivate the input and run the command through the dissecting script
        InterfaceScript.DeActivateInput();
        DissectingScript.DissectPlayerInput(instantCommand, 2);
        //For the commands that needs it (like Rest), wait until they are done before moving on
        if (MovementCommands.MovementHappening)
        {
            while (MovementCommands.MovementHappening)
            {
                yield return(new WaitForEndOfFrame());
            }
        }

        yield return(new WaitForSeconds(0.2f));

        //Check if it is dark, and check of rest was used which will take up the entire turn then move to enemyturn
        if (LevelScript.Darkness)
        {
            LevelScript.DarknessHealthLoss();
        }
        if (instantCommand.ToUpper() == "REST")
        {
            if (CheckForEnemies() == 0 || SceneManager.GetActiveScene().name == "Level20")
            {
                DialogueScript.GameInformationText("It's your turn.");
                GameTurnController.CurrentState = GameTurnController.PlayerState.PlayerTurn;
                InterfaceScript.ActivateInput();
                yield break;
            }
            DialogueScript.GameInformationText("Enemies are moving.");
            GameTurnController.CurrentState = GameTurnController.PlayerState.EnemyTurn;
            yield break;
        }
        //Or return to playerturn and activate the input
        if (GameTurnController.CurrentState == GameTurnController.PlayerState.CommandChain)
        {
            GameTurnController.CurrentState = GameTurnController.PlayerState.PlayerTurn;
        }
        InterfaceScript.ActivateInput();
    }
예제 #15
0
    private IEnumerator Resting()
    {
        int amountHealed = ((PlayerPrefs.GetInt("Constitution") * 10) * 5) / 100;

        AddRestingHealth(amountHealed);
        yield return(new WaitForSeconds(1.5f));

        AddRestingHealth(amountHealed);
        yield return(new WaitForSeconds(1.5f));

        AddRestingHealth(amountHealed);
        yield return(new WaitForSeconds(1.5f));

        AddRestingHealth(amountHealed);
        yield return(new WaitForSeconds(1.5f));

        DialogueScript.GameInformationText("You finish resting.");
        DialogueScript.GameInformationText("You regained " + amountHealed * 4 + " health.");
        MovementHappening = false;


        RaycastHit hit;

        //FindPositonForEnemy(randPos);
        if (UnityEngine.Random.Range(0, 3) == 0)
        {
            GameObject[] spawnPoints = GameObject.FindGameObjectsWithTag("Spawner");
            if (spawnPoints.Length > 0)
            {
                GameObject pickedSpawnpoint = spawnPoints[UnityEngine.Random.Range(0, spawnPoints.Length - 1)];
                if (!Physics.Raycast(pickedSpawnpoint.transform.position, pickedSpawnpoint.transform.up, out hit, 1))
                {
                    if (PlayerPrefs.GetInt("Level") > 5)
                    {
                        Instantiate(troll, pickedSpawnpoint.transform.position, Quaternion.identity);
                    }
                    else
                    {
                        Instantiate(skeleton, pickedSpawnpoint.transform.position, Quaternion.identity);
                    }
                }
            }
        }
    }
예제 #16
0
    /// <summary>
    /// Examine an object. Distance is up to 9 meters (5 blocks ahead).
    /// </summary>
    /// <param name="arg">Object to examine</param>
    void Examine(string arg)
    {
        //TODO: Add option to examine items on floor that are not showing, i.e. weapon.
        RaycastHit hit;

        if (Physics.Raycast(PlayerScript.PlayerCamera.transform.position, transform.forward, out hit, 9))
        {
            //Find if the Player is using a valid word, then place that list into a new list.
            List <string> nameList = new List <string>();
            foreach (List <string> list in ItemNameListScript.AllItemNamesList)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    if (!string.Equals(list[i], arg, StringComparison.CurrentCultureIgnoreCase))
                    {
                        continue;
                    }
                    nameList = list;
                }
            }
            //If nothing was placed in the list, i.e. the player didn't use a valid command
            if (nameList.Count == 0)
            {
                DialogueScript.ErrorText("I'm not sure what you want to examine...");
                return;
            }
            //Go through the now filled up list to make sure that the tag matches a string from it
            if (nameList.Any(s => string.Equals(s, hit.transform.gameObject.tag, StringComparison.CurrentCultureIgnoreCase)))
            {
                //Round the distance to what the Player is examining up to an int.
                int distance = (int)Math.Ceiling((double)hit.distance);
                DialogueScript.GameInformationText("You attempt to examine what's " + distance + " meters ahead.");
                StartCoroutine(ReturnExamination(hit.transform.gameObject, hit.transform.tag));
            }
            else
            {
                DialogueScript.ErrorText("I think you have the wrong name of that.");
            }
        }
        else
        {
            DialogueScript.ErrorText("There nothing ahead of you.");
        }
    }
예제 #17
0
    /// <summary>
    /// Get the object.
    /// </summary>
    /// <param name="arg">Object to get</param>
    public void Get(string arg)
    {
        //TODO: Need to rewrite a bit to allow for the player to get the stone piece.
        GameObject hit = GetRaycastObject();

        if (arg.ToUpper() == "KEY")
        {
            if (hit == null)
            {
                DialogueScript.ErrorText("There's nothing there");
                return;
            }
            if (hit.transform.tag == "Key")
            {
                hit.transform.gameObject.GetComponent <AudioSource>().Play();
                DialogueScript.GameInformationText("You picked up a shiny key!");
                hit.transform.position = Vector3.one * 99999f;
                Destroy(hit.transform.gameObject, 2);
                MovementCommands.Forward("1");
                Keys += 1;
                InterfaceScript.InfoKeyText.text = "Your Keys: " + Keys;
            }
            else
            {
                DialogueScript.ErrorText("You can't get that");
            }
        }
        if (ItemNameListScript.StoneNameList.Any(s => s.Equals(arg, StringComparison.CurrentCultureIgnoreCase)))
        {
            if (hit.tag == "Tablet")
            {
                MovementCommands.Forward("1");
            }
        }
        else
        {
            DialogueScript.ErrorText("Get what?");
        }
    }
예제 #18
0
    private void Lick(string arg, string arg2)
    {
        GameObject hit = GetRaycastObject();

        if (hit == null)
        {
            if (arg == null)
            {
                DialogueScript.ErrorText("You lick your lips...");
                return;
            }
            else
            {
                DialogueScript.ErrorText("There's nothing in front of you, so your tongue licks your nose...");
                return;
            }
        }
        if (arg2 == null)
        {
            if (string.Equals(hit.transform.gameObject.tag, arg, StringComparison.CurrentCultureIgnoreCase))
            {
                DialogueScript.GameInformationText("You lick the " + arg + ". Taste good?");
                return;
            }
        }
        if (arg.ToUpper() == "THE")
        {
            if (string.Equals(hit.transform.gameObject.tag, arg, StringComparison.CurrentCultureIgnoreCase))
            {
                DialogueScript.GameInformationText("You lick " + arg + " " + arg2 + ". Taste good?");
                return;
            }
        }
        else
        {
            DialogueScript.ErrorText("You might not understand how licking works...");
        }
    }
예제 #19
0
    public void Slam()
    {
        if (OnCooldown("slam"))
        {
            return;
        }
        lastMove = "Slam";
        int damageToWeapon = Random.Range(0, 2);

        if (PlayerPrefs.GetInt("Level") < 2)
        {
            DialogueScript.ErrorText("I think you're trying to do something you've not learned yet.");
            DialogueScript.CombatTextEnemy("Your confusing face makes the foe ready to strike.");
            ChangeTurn(null, null);
            return;
        }
        DialogueScript.GameInformationText("You slam your weapon hard into the enemy, stunning him!");
        if (PlayerPrefs.GetInt("StrenghtWeaponBuff") > 0 && damageToWeapon > 2)
        {
            PlayerPrefs.SetInt("StrengthWeaponBuff", PlayerPrefs.GetInt("StrenghtWeaponBuff") - damageToWeapon);
            DialogueScript.GameInformationText("Your weapon dulls in with your attack.");
        }
        EndOfTurn("Slam", 3, Random.Range(PlayerPrefs.GetInt("Strength") / 2, PlayerPrefs.GetInt("Strenght")));
    }
예제 #20
0
    /// <summary>
    /// Enters the specified argument.
    /// </summary>
    /// <param name="arg">The argument.</param>
    public void Enter()
    {
        //CheckString("Enter", arg);
        GameObject hit = CommandScript.GetRaycastObject();

        if (hit == null)
        {
            DialogueScript.ErrorText("There's nothing in front of you to enter");
            return;
        }
        if (hit.transform.tag == "Hatch")
        {
            if (LevelScript.ExitOpen || SceneManager.GetActiveScene().name == "Tutorial")
            {
                PlayerPrefs.SetInt("PlayedTutorial", 1);
                DialogueScript.GameInformationText("You slowly descend into the darkness.");
                GameObject.FindGameObjectWithTag("ScriptHolder").GetComponent <LevelChanger>().ChangeLevel();
                LevelFinished = true;
                return;
            }

            DialogueScript.ErrorText("You can't enter something that isn't open.");
        }
    }
예제 #21
0
    /// <summary>
    /// Print out a list of argument
    /// </summary>
    /// <param name="arg">The argument.</param>
    new public void List(string arg)
    {
        CheckString("List", arg);
        if (NoInput)
        {
            return;
        }
        if (arg.ToUpper() == "ALIAS")
        {
            //Make sure that the Player has actually saved an alias
            if (CommandListScript.AliasDictionary.Count != 0)
            {
                //Inform the Player that these are the aliases created
                DialogueScript.GameInformationText(
                    "Here's a list of aliases. ");
                //Iterate through the dictionary and print out each alias alongside the function
                foreach (string s in CommandListScript.AliasDictionary.Keys)
                {
                    string value = CommandListScript.AliasDictionary[s];
                    DialogueScript.MovementText(s + " : " + value);
                }
            }
            else
            {
                DialogueScript.ErrorText("No aliases saved.");
            }
        }

        if (arg.ToUpper() == "COMMANDS")
        {
            StringBuilder builtString = new StringBuilder();
            foreach (var list in CommandListScript.ValidCommandsList)
            {
                foreach (string s in list)
                {
                    builtString.Append(s).Append(" | ");
                }
            }
            foreach (string s in CommandListScript.CommandsList)
            {
                builtString.Append(s).Append(" | ");
            }
            foreach (string s in CommandListScript.CombatCommands)
            {
                builtString.Append(s).Append(" | ");
            }
            InterfaceScript.PlaceText(builtString.ToString(), new Color(0, 255, 200), 15);
        }

        if (string.Equals(arg, "emotes", StringComparison.CurrentCultureIgnoreCase))
        {
            var builtString = new StringBuilder();
            foreach (string s in CommandListScript.EmoteList)
            {
                builtString.Append(s).Append(" - ");
            }
            InterfaceScript.PlaceText(builtString.ToString(), new Color(0, 255, 200), 15);
        }
        if (GameTurnController.CurrentState == GameTurnController.PlayerState.Combat)
        {
            InterfaceScript.ActivateInput();
        }
    }
예제 #22
0
    /// <summary>
    /// Move the Player forward 'steps' blocks.
    /// </summary>
    /// <param name="steps"></param>
    /// <returns></returns>
    private IEnumerator MoveForward(int steps)
    {
        for (int i = 0; i < (steps * 20); i++)
        {
            if (i % 20 == 0 || i == 0 && steps > 0)
            {
                CorrectPosition();
                GetComponent <AudioSource>().Play();
                GameObject hit         = CommandScript.GetRaycastObject();
                bool       canContinue = false;
                if (hit == null)
                {
                    continue;
                }
                switch (hit.transform.tag)
                {
                case "Tablet":
                    DialogueScript.GameInformationText("You swoop up a piece of interesting stone on your way past...");
                    hit.GetComponent <PuzzlePieceScript>().WalkedOverPiece();
                    canContinue = true;
                    break;

                case "Hatch":
                    if (LevelScript.ExitOpen)
                    {
                        DialogueScript.GameInformationText("You almost trip and fall into the black void....");
                        DialogueScript.GameInformationText("Maybe you should try to enter it instead?");
                        MovementHappening = false;
                    }
                    if (!LevelScript.ExitOpen)
                    {
                        canContinue = true;
                    }
                    break;

                case "Enemy":
                case "Door":
                case "Chest":
                case "Wall":
                case "PushableWall":
                case "Button":
                case "Torch":
                    DialogueScript.ErrorText("You can't move further that direction");
                    MetObstacle       = true;
                    MovementHappening = false;
                    break;

                case "Stairs":
                    DialogueScript.ErrorText("That'd make you walk into the ladder.");
                    DialogueScript.ErrorText("Maybe try to climb it?");
                    MetObstacle       = true;
                    MovementHappening = false;
                    break;

                case "Key":
                    DialogueScript.GameInformationText("You pick up a key as you walk past it.");
                    hit.transform.gameObject.GetComponent <AudioSource>().Play();
                    hit.transform.position = Vector3.one * 99999f;
                    Destroy(hit.transform.gameObject, 2);
                    Keys += 1;
                    InterfaceScript.InfoKeyText.text = "Your Keys: " + Keys;
                    canContinue = true;
                    break;
                }
                if (!canContinue)
                {
                    yield break;
                }
            }
            transform.Translate(0, 0, 0.1f);
            yield return(new WaitForEndOfFrame());
        }
        CorrectRotation();
        MovementHappening = false;
    }
예제 #23
0
 /// <summary>
 /// Emote "Dance"
 /// </summary>
 private void Dance()
 {
     DialogueScript.GameInformationText("What are you, a ballerino?");
 }
예제 #24
0
 /// <summary>
 /// Emote "Clap"
 /// </summary>
 private void Clap()
 {
     DialogueScript.GameInformationText("You clap wildly about the situation.");
 }
예제 #25
0
 /// <summary>
 /// Emote "Cheer"
 /// </summary>
 private void Cheer()
 {
     DialogueScript.GameInformationText("I'm not sure that you have anything to cheer about.");
 }
예제 #26
0
    /// <summary>
    /// Returns the examination.
    /// </summary>
    /// <param name="hit">GameObject to be examined</param>
    /// <param name="objectTag">Tag of object.</param>
    /// <returns></returns>
    IEnumerator ReturnExamination(GameObject hit, string objectTag)
    {
        DialogueScript.GameInformationText("...");
        yield return(new WaitForSeconds(1.5f));

        DialogueScript.GameInformationText("...");
        yield return(new WaitForSeconds(1.5f));

        switch (objectTag)
        {
        case "Enemy":
            DialogueScript.GameInformationText("There is some sort of foe ahead of you.");
            if (hit.transform.gameObject.GetComponent <EnemyScript>().Level < PlayerPrefs.GetInt("Level"))
            {
                DialogueScript.GameInformationText(
                    "By closer examination, it appears to be somewhat weaker than you.");
            }
            else if (hit.transform.gameObject.GetComponent <EnemyScript>().Level == PlayerPrefs.GetInt("Level"))
            {
                DialogueScript.GameInformationText(
                    "You appear to be on equal footing. This might be an even match.");
            }
            else if (hit.transform.gameObject.GetComponent <EnemyScript>().Level > PlayerPrefs.GetInt("Level"))
            {
                DialogueScript.GameInformationText(
                    "You feel that it is stronger than you. You consider your options...");
            }
            break;

        case "Hatch":
            DialogueScript.GameInformationText("Looking closely, you think that it is a trapdoor,");
            if (SceneManager.GetActiveScene().name == "Tutorial")
            {
                bool isPressed = GameObject.FindGameObjectWithTag("Button").GetComponent <Button>().IsPressed;
                DialogueScript.GameInformationText(isPressed
                                                ? "and it appears to be open."
                                                : "and it appears to be closed. There should be something that opens it somewhere.");
                break;
            }
            DialogueScript.GameInformationText(LevelScript.ExitOpen
                    ? "and it appears to be open."
                    : "and it appears to be closed. There should be something that opens it somewhere.");
            break;

        case "Torch":
            DialogueScript.GameInformationText("Judging by what you see, it seems to be a torch.");
            GameObject torchChildLight = hit.transform.FindChild("Point light").gameObject;
            DialogueScript.GameInformationText(torchChildLight.GetComponent <Light>().intensity < 4
                    ? "It doesn't shine as brightly as it perhaps could."
                    : "It's shining brightly just as it should.");
            break;

        case "Chest":
            DialogueScript.GameInformationText("It's golden and has a heavy lid. You logically consider it to be a chest.");
            DialogueScript.GameInformationText(Keys > 0
                    ? "Feeling your pockets, you notice the key you picked up earlier. Maybe it could be useful..."
                    : "It appears to be locked. Now how do one unlock something locked...");
            break;

        case "Key":
            DialogueScript.GameInformationText("Floating in the air with sparkles seems unnatural, but it also looks like a key.");
            DialogueScript.GameInformationText("You could try to pick it up by walking to it.");
            break;

        case "Wall":
            DialogueScript.GameInformationText("Nothing but an empty wall up front...");
            break;

        case "Button":
            DialogueScript.GameInformationText("It appears to be a button carved into the wall.");
            DialogueScript.GameInformationText(hit.transform.gameObject.GetComponent <Button>().IsPressed
                    ? "You have pressed this button previously."
                    : "It is most likely used to open something in the dungeon...");
            break;

        case "PushableWall":
            DialogueScript.GameInformationText("The wall in this area seems to stand out from the rest.");
            DialogueScript.GameInformationText("Perhaps you'll be able to push it out of the way.");
            break;

        case "Door":
            DialogueScript.GameInformationText("Looks like an old door.");
            DialogueScript.GameInformationText(hit.transform.gameObject.GetComponent <WoodenDoor>().IsLocked
                    ? "You shake the handle only to find that it's locked"
                    : "You gently push the door and it appears open.");
            break;

        case "Tablet":
            DialogueScript.GameInformationText("The stone piece in front of you seem to be a part of some sort of tablet.");
            DialogueScript.GameInformationText("There's also some strange language on it. Might be important.");
            break;
        }
        MovementHappening = false;
    }
예제 #27
0
 /// <summary>
 /// Emote "Strut"
 /// </summary>
 private void Strut()
 {
     DialogueScript.GameInformationText("Is appearing arrogant going to scare your enemies?");
 }
예제 #28
0
    //\\//CHEAT COMMANDS FOR DEVS\\//\\
    //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\\

    /// <summary>
    /// Give the Player enough XP to gain a level
    /// </summary>
    void GainLevel()
    {
        PlayerPrefs.SetInt("CurrentXP", PlayerPrefs.GetInt("CurrentXP") + 123456789);
        DialogueScript.GameInformationText("You cheat and gain way too much XP.");
        GetComponent <LevelUP>().CheckForLevelUp();
    }
예제 #29
0
 /// <summary>
 /// Show current XP and how much is needed for the next level.
 /// </summary>
 /// <param name="arg">The argument.</param>
 private void Experience(string arg)
 {
     DialogueScript.GameInformationText("You currently have " + PlayerPrefs.GetInt("CurrentXP") +
                                        " XP. Next level is at " + GetComponent <LevelUP>().NextLevel() + ".");
     DialogueScript.GameInformationText("Currently you are level " + PlayerPrefs.GetInt("Level") + ".");
 }
예제 #30
0
    /// <summary>
    /// IEnumerator that will go through the command chain until it is done, then reset everything that needs resetting to be ready for next turn.
    /// This is called from the function Start in the in-game commands list
    /// </summary>
    /// <returns></returns>
    public IEnumerator ActivatingCommands()
    {
        GameTurnController.CurrentState = GameTurnController.PlayerState.CommandChain;
        int textToRemove = 0;

        InterfaceScript.DeActivateInput();
        if (DialogueScript.CommandHistoryList.Count > 0)
        {
            foreach (string s in DialogueScript.CommandHistoryList)
            {
                DialogueScript.MovementText("You perform " + s);
                DissectingScript.DissectPlayerInput(s, 2);
                InterfaceScript.CommandPoolTexts[textToRemove].color = Color.green;
                if (MovementCommands.MovementHappening)
                {
                    while (MovementCommands.MovementHappening)
                    {
                        yield return(new WaitForEndOfFrame());
                    }
                }
                if (MetObstacle)
                {
                    DialogueScript.MovementText("You appear too disoriented to continue.");
                    MetObstacle = false;
                    break;
                }
                if (
                    CommandListScript.EmoteList.Any(
                        x =>
                        string.Equals(InterfaceScript.CommandPoolTexts[textToRemove].text, x,
                                      StringComparison.CurrentCultureIgnoreCase)))
                {
                    InterfaceScript.CommandPoolTexts[textToRemove].text = "";
                    textToRemove++;
                    yield return(new WaitForSeconds(1.7f));
                }
                else
                {
                    InterfaceScript.CommandPoolTexts[textToRemove].text = "";
                    textToRemove++;
                    yield return(new WaitForSeconds(0.7f));
                }
            }
        }
        ClearCommandPool();
        if (LevelScript.Darkness)
        {
            LevelScript.DarknessHealthLoss();
        }
        if (GameTurnController.CurrentState == GameTurnController.PlayerState.Combat ||
            GameTurnController.CurrentState == GameTurnController.PlayerState.EnemyCombatTurn)
        {
            yield break;
        }
        if (SceneManager.GetActiveScene().name == "Tutorial")
        {
            GameTurnController.CurrentState = GameTurnController.PlayerState.PlayerTurn;
            InterfaceScript.ActivateInput();
            yield break;
        }
        if (LevelFinished)
        {
            GameTurnController.CurrentState = GameTurnController.PlayerState.PlayerTurn;
            yield break;
        }
        if (CheckForEnemies() == 0 || SceneManager.GetActiveScene().name == "Level20")
        {
            DialogueScript.GameInformationText("It's your turn.");
            GameTurnController.CurrentState = GameTurnController.PlayerState.PlayerTurn;
            InterfaceScript.ActivateInput();
            yield break;
        }

        DialogueScript.GameInformationText("Enemies are moving.");
        GameTurnController.CurrentState = GameTurnController.PlayerState.EnemyTurn;
    }