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 override void Update() { base.Update(); if (isAlive && isStuck && rock == null) { anim.SetTrigger("StandUp"); speech.fallBackLine = "I'll always be in your debt!"; speech.voiceLines = new List <string> { "Thank you kind sir!" }; ResetSpeech(); StaticStuff.AddKarma(10); isStuck = false; } }
// Update is called once per frame protected override void Update() { base.Update(); if (!rocksGone && rock1 == null && rock2 == null && rock3 == null) { rocksGone = true; StaticStuff.AddKarma(10); speech.voiceLines = new List <string> { "You krumped dem rocks? That's roight bloody sweet uv ya!", "Oi'll get roight ta plantin'!" }; speech.fallBackLine = "Stop buggerin' me! Oi'm right 'boutta get ta work, oi am!"; ResetSpeech(); } }
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; } }
// Update is called once per frame override protected void Update() { base.Update(); if (canonTriggered && !canonBoom) { canonTimer -= Time.deltaTime; if (canonTimer < 0) { canonAudio.clip = canonFire; canonAudio.Play(); canonBoom = true; Instantiate(smokeEffect, canon.transform.position + new Vector3(-2.4f, 0.1f), Quaternion.identity); canon.GetComponent <Animator>().SetTrigger("Reset"); Vector3 playerPos = GameObject.Find("Player").transform.position; //Ah shit he dead if (transform.position.x < playerPos.x && playerPos.x < canon.transform.position.x && Mathf.Abs(playerPos.y - transform.position.y) < 4) { GameObject.Find("Player").GetComponent <PlayerController>().Die(); speech.voiceLines = new List <string> { "Good Heavens!" }; ResetSpeech(); StaticStuff.AddKarma(10); } //Ah shit me dead else { anim.SetTrigger("Die"); Instantiate(smokeEffect, transform.position, Quaternion.Euler(1, 0, 0)); Die(true); } } } }