Exemple #1
0
        public string GetShortDescription()
        {
            //
            string description = Description.Replace("**", "");

            description = description
                          .Replace("{spell_DieStrRaw}", DieStrRaw)
                          .Replace("{spell_DieStr}", DieStr)
                          .Replace("{SpellcastingAbilityModifierStr}", "+3")
                          .Replace("{spell_AmmoCount_word}", AmmoCount_word)
                          .Replace("{spell_AmmoCount_Word}", AmmoCount_Word)
                          .Replace("{spell_AmmoCount}", AmmoCount.ToString())
                          .Replace("{spell_DoubleAmmoCount}", DoubleAmmoCount.ToString());

            string    shortDescription = string.Empty;
            const int maxLength        = 200;

            while (shortDescription.Length < maxLength)
            {
                string nextSentence = GetNextSentence(ref description);
                if (shortDescription.Length + nextSentence.Length > maxLength && shortDescription.Length > 0)
                {
                    return(shortDescription);
                }
                shortDescription += nextSentence;
            }
            return(shortDescription);
        }
Exemple #2
0
 // Update is called once per frame
 void Update()
 {
     // Debug.Log("GuiScoreboard updating...");
     TimeText.text      = TimeLabel + NewLine + GameTimers[ActiveTimer].ShowElapsed();
     HitsText.text      = HitsLabel + NewLine + HitsCount.ToString();
     MarkHitsText.text  = MarkHitsLabel + NewLine + MarkHitsCount.ToString();
     KillsText.text     = KillsLabel + NewLine + KillsCount.ToString();
     MarkKillsText.text = MarkKillsLabel + NewLine + MarkKillsCount.ToString();
     AmmoText.text      = AmmoLabel + NewLine + AmmoCount.ToString();
     ScoreText.text     = ScoreLabel + NewLine + ScoreCount.ToString("D5");
     PlaceText.text     = PlaceLabel + NewLine + PlaceCount.ToString();
     MarkPlaceText.text = MarkPlaceLabel + NewLine + MarkPlaceCount.ToString();
 }
Exemple #3
0
        public void Inspect()
        {
            Console.WriteLine("Name: " + Name);
            Console.WriteLine(Description);
            Console.WriteLine("Weapon type: " + WeaponType);
            foreach (var item in Attributes)
            {
                Console.WriteLine(item);
            }
            Console.WriteLine("Ammunition Left: " + AmmoCount.ToString());
            Console.WriteLine("Base Damage: " + Damage);
            Console.WriteLine("Press E To Equip/Unequip this item.");
            ConsoleKey Keypress = Console.ReadKey(true).Key;

            if (Keypress == ConsoleKey.E)
            {
                Equip();
            }
        }
Exemple #4
0
 void weaponHandlingUpdate()
 {
     anim.SetBool("Fire", Input.GetMouseButton(0));
     anim.SetBool("NoAmmo", AmmoCount <= 0);
     if (Input.GetKeyDown(KeyCode.R))
     {
         anim.SetTrigger("Reload");
     }
     if (Input.GetKeyDown(KeyCode.T))
     {
         anim.SetTrigger("ToggleSilencer");
     }
     if (Input.GetKeyDown(KeyCode.Y))
     {
         toggleLaserSight();
     }
     ammoCounter.text = AmmoCount.ToString();
     if (overchargeAmount > 0)
     {
         float overchargeDiv = overchargeAmount / (overchargeAmount * 0.5f);
         anim.SetFloat("Firerate", 1 + overchargeDiv);
         anim.SetFloat("ReloadSpeed", 1 + overchargeDiv);
     }
     else
     {
         anim.SetFloat("Firerate", 1);
         anim.SetFloat("ReloadSpeed", 1);
     }
     if (recoilIntensity > 0)
     {
         recoilIntensity -= recoilCooldownSpeed * Time.deltaTime;
     }
     if (recoilIntensity > recoilIntensityMax)
     {
         recoilIntensity = recoilIntensityMax;
     }
     if (recoilIntensity < 0)
     {
         recoilIntensity = 0;
     }
 }