bug fixes
This commit is contained in:
@@ -40,14 +40,14 @@ public class Damageable : MonoBehaviour
|
||||
|
||||
private void Damage(GameObject damageSource) // Damages player
|
||||
{
|
||||
if (dying) return;
|
||||
if (dying || damageSource.CompareTag("Hat")) return; // Exclude hat from taking damage
|
||||
|
||||
float actualForce = damageSource.GetComponent<Damageable>().force;
|
||||
Block blockComponent = GetComponent<Block>();
|
||||
|
||||
GetComponentInChildren<UseItem>().DropItem(); // Drops hat if held
|
||||
|
||||
if (blockComponent != null && blockComponent.blocking)
|
||||
if (blockComponent != null && blockComponent.blocking)
|
||||
{
|
||||
if (blockComponent.IsParrying()) // Player receives damage if punching a parrying player
|
||||
{
|
||||
@@ -106,7 +106,6 @@ public class Damageable : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void HandleDeath() // Removes player from dying state after respawn
|
||||
{
|
||||
GameManager.Instance.PlayerDied(this);
|
||||
|
||||
@@ -61,6 +61,7 @@ public class UseItem : MonoBehaviour
|
||||
heldItem.GetComponent<Collider2D>().enabled = true;
|
||||
heldItem.GetComponent<Rigidbody2D>().bodyType = RigidbodyType2D.Dynamic;
|
||||
heldItem.transform.position += Vector3.up * 3f;
|
||||
heldItem.GetComponent<HatRespawn>().OnHatDropped();
|
||||
heldItem = null;
|
||||
isHoldingItem = false;
|
||||
if (GameManager.playerHoldTimes.ContainsKey(gameObject))
|
||||
@@ -69,4 +70,5 @@ public class UseItem : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user