Ejemplo n.º 1
0
    void LostAndFoundQuestion()
    {
        bool askingTime = type.AskAboutLostAndFound();

        askingTime = true;
        // making it so all customers ask if possible, unless they are not a liar and have no matching weapons
        // if(askingTime == true)
        {
            var wepList = GameObject.FindGameObjectsWithTag("Weapon");
            if (!type.IsLiar())
            {
                foreach (var wep in wepList)
                {
                    var wepStats = wep.GetComponent <WeaponStats>();
                    if (CheckMatch(wepStats, type))
                    {
                        preferredWeapon = wepStats;
                    }
                }
            }
            else
            {
                int chosen = Random.Range(0, wepList.Length - 1);
                preferredWeapon = wepList[chosen].GetComponent <WeaponStats>();
            }
            // int chosen = Random.Range( 0,wepList.Length - 1 );
            // preferredWeapon = wepList[chosen].GetComponent<WeaponStats>();

            if (preferredWeapon != null)
            {
                speech.SpawnText(GenWepText(preferredWeapon));
                // print( GenWepText( preferredWeapon ) );
            }
            else
            {
                speech.SpawnText("ty for the drink");
                mid = true;
            }
        }
        // else
        {
            // move to exit
        }
    }