never let me cook again

This commit is contained in:
Sylvia 2026-02-10 01:11:41 -08:00
parent 63e5e950de
commit 13bb58ea03
6 changed files with 56 additions and 4 deletions

View file

@ -70,10 +70,20 @@ public class Enemy : Entity
protected override void OnKillEffects()
{
Destroy(gameObject);
foreach (UpgradeDrop drop in possibleDrops)
{
DropUpgrade(drop);
}
}
protected virtual void DropUpgrade()
protected virtual void DropUpgrade(UpgradeDrop drop)
{
float random;
float random = Random.Range(0, 100);
{
if (random < drop.chance) //just so it matches up with the number. 80 chance means 80 percent? idk but less than 80 lol
{
// drop the item
}
}
}
}

View file

@ -0,0 +1,24 @@
using System;
using UnityEngine;
public class ItemPickup : MonoBehaviour
{
public bool inRange;
[Header("Movement")]
[SerializeField] private Rigidbody2D rb;
[SerializeField] private float speed;
private void FixedUpdate()
{
if (inRange)
{
rb.linearVelocity = (transform.position - AbilityManager.instance.player.transform.position).normalized * speed;
}
}
private void OnTriggerEnter2D(Collider2D other)
{
//pick up
Destroy(gameObject);
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 271a03dda998936fa99eb33e6272307b

View file

@ -0,0 +1,12 @@
using System;
using UnityEngine;
public class ItemPickupRange : MonoBehaviour
{
[SerializeField] private ItemPickup thisItem;
private void OnTriggerEnter2D(Collider2D other)
{
thisItem.inRange = true;
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 8ed6160da3b86db81b18fdaf0abf65da