From 2c93456a1954333393d430ffb1cfbe55fc9e75d6 Mon Sep 17 00:00:00 2001 From: ProtoSharkk Date: Mon, 28 Oct 2024 16:17:27 -0700 Subject: [PATCH] Fast fuckers will run away on taking damage --- Assets/Scripts C#/Ratbots/FastFucker.cs | 6 +++++- Assets/Scripts C#/Ratbots/Ratbot.cs | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts C#/Ratbots/FastFucker.cs b/Assets/Scripts C#/Ratbots/FastFucker.cs index 0738973..dc5c4a9 100644 --- a/Assets/Scripts C#/Ratbots/FastFucker.cs +++ b/Assets/Scripts C#/Ratbots/FastFucker.cs @@ -6,7 +6,7 @@ public class FastFucker : Ratbot bool attack = true; void Update() { if (attack) - MoveTowardsPlayer(moveSpeed*3); + MoveTowardsPlayer(moveSpeed*2); else MoveAwayFromPlayer(moveSpeed); } @@ -27,4 +27,8 @@ public class FastFucker : Ratbot yield return new WaitForSeconds (1F); attack = true; } + new void Damage (float hurtyAmount) { + RunAway(); + base.Damage(hurtyAmount); + } } diff --git a/Assets/Scripts C#/Ratbots/Ratbot.cs b/Assets/Scripts C#/Ratbots/Ratbot.cs index 65b34bd..5725651 100644 --- a/Assets/Scripts C#/Ratbots/Ratbot.cs +++ b/Assets/Scripts C#/Ratbots/Ratbot.cs @@ -46,7 +46,6 @@ public class Ratbot : MonoBehaviour // Die if health below zero public void Damage(float hurtyAmount) { - Debug.Log(hurtyAmount); health -= hurtyAmount; if (health <= 0) { Destroy(gameObject);