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); }
void Start() { controller = GetComponent <RigidbodyFirstPersonController>(); camera = GameObject.FindGameObjectWithTag("MainCamera").transform; ammo = GameObject.Find("GameMaster").GetComponent <AmmoCount>(); interact = GameObject.Find("InteractMessage"); interact.SetActive(false); }
// 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(); }
void Start() { controller = GetComponent <CharacterController>(); power = minPower; if (!p1) { horizontal = "AimHP2"; vertical = "AimVP2"; fire = "FireP2"; } myAmmo = Instantiate(ammoDisplayPrefab, GameData.Canvas.transform).GetComponent <AmmoCount>(); myAmmo.updateCount(numArrows); }
private void OnCollisionEnter2D(Collision2D collision) { if (pickUpLayer.value == (pickUpLayer | 1 << collision.gameObject.layer)) { if (collision.gameObject.tag == "Ammo") { SingleFireGun singleFireGun; if (TryGetComponent(out singleFireGun)) { AmmoCount ammo = singleFireGun.GetAmmo(); if (ammo.currentAmmo < ammo.maxAmmo) { singleFireGun.AddAmmo(collision.gameObject.GetComponent <AmmoPickup>().Pickup(singleFireGun.maxAmmo)); } } } } }
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(); } }
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; } }
void Start() { ammo = GameObject.Find("GameMaster").GetComponent <AmmoCount>();; text = GameObject.Find("AmmoCountDisplay").GetComponent <Text>(); }