public ShitPile SpawnShit(Vector3 position) { ShitPile shitPile = PrefabManager.Instantiate("ShitPile", position).GetComponent <ShitPile>(); shits.Add(shitPile); return(shitPile); }
void Poop() { if (shitsAvailable > 0 || endgamed) { StoredShit -= 1f; currentShitPile = ShitManager.main.SpawnShit(transform.position - transform.forward / 6f); GlobalSoundEffects.main.PlayClipAtPoint("poot", transform.position, .2f, 1.2f, .6f); if (endgamed) { currentShitPile.transform.localScale *= 2f; } } }
protected override void DoLogic() { if (endgamed) { if (poopDelayTimer > 0) { poopDelayTimer -= Time.deltaTime; } else { Poop(); poopDelayTimer = poopDelay / shitSpeed; } poopDelay -= Time.deltaTime / 10f; } shitmeter.SetShit(Mathf.Clamp(StoredShit * 1f / maxShit * 1f, 0f, 1f)); base.DoLogic(); StoredShit += Time.deltaTime * shitSpeed; shitSpeed += Time.deltaTime * .1f; if (shitCooldownTimer > 0) { shitCooldownTimer -= Time.deltaTime; currentInput = Vector3.zero; } if (inputDevice.Action1.IsPressed) { currentInput = Vector3.zero; } if (inputDevice.Action1.IsPressed && !s******g && movement.magnitude < 1f) { s******g = true; Poop(); } if (inputDevice.Action2.IsPressed && !s******g && movement.magnitude < 1f) { s******g = true; StoredShit *= .66f; if (StoredShit > 10) { GlobalSoundEffects.main.PlayClipAtPoint("gasp1", transform.position, "BGM", 1f); } rbody.AddForce(transform.forward * StoredShit * 10f); for (int i = 0; i < shitsAvailable; i++) { ShitPile shitPile = PrefabManager.Instantiate("ShitPile", transform.position - transform.forward / 6f).GetComponent <ShitPile>(); shitPile.GetComponent <Rigidbody>().AddForce(Random.onUnitSphere); Poop(); } poopDelayTimer = poopDelay / 2f; } if (s******g && inputDevice.Action1.IsPressed) { if (poopDelayTimer > 0) { poopDelayTimer -= Time.deltaTime; } else { Poop(); poopDelayTimer = poopDelay; } // currentShitPile.magnitude += shitSpeed * Time.deltaTime; currentInput = Vector3.zero; fader.fullColor = Color.white; } else if (s******g && !inputDevice.Action1.IsPressed) { s******g = false; fader.fullColor = Color.black; shitCooldownTimer = shitCooldown; } animator.speed = movement.magnitude; }