private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.name.Contains("Clockium")) { Destroy(collision.gameObject); StaticStuff.AddKarma(10); hasClockium = true; speech.voiceLines = new List <string> { "Heavens, that's a huge hunk of clockium!", "I'm set for a lifetime!", "In the not-so-distant future, everyone in the region will have a watch.", "You're an angel." }; if (!sick) { speech.fallBackLine = "I love making watches."; } else { speech.fallBackLine = "Must. Keep. Working..."; } ResetSpeech(); } if (!deathRevealed && !isAlive && Vector2.Distance(player.transform.position, transform.position) < 10) { StaticStuff.RemoveKarma(10); deathRevealed = true; } }
protected virtual void Update() { if (!isAlive && !deathRevealed && Vector2.Distance(player.transform.position, transform.position) < 8) { StaticStuff.RemoveKarma(10); deathRevealed = true; } }
public void MudmanDestroyed() { StaticStuff.RemoveKarma(10); GetComponent <SpeechController>().fallBackLine = "*quiet sobbing*"; speech.Clear(); speech.voiceLines.Add("My... My mudman!"); ResetSpeech(); GetComponent <Animator>().SetTrigger("Sad"); Destroy(this); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.name.Contains("Chowbeet") && hungry) { Destroy(collision.gameObject); StaticStuff.AddKarma(10); hungry = false; speech.voiceLines = new List <string> { "Wowie, thanks! That is one thick beet.", "I'm chowing down on this yummy snack this instant." }; speech.fallBackLine = "I don't know if I'll ever be hungry again!"; ResetSpeech(); } if (!deathRevealed && !isAlive && Vector2.Distance(player.transform.position, transform.position) < 10) { StaticStuff.RemoveKarma(10); deathRevealed = true; } }