never let me cook again
This commit is contained in:
parent
63e5e950de
commit
13bb58ea03
6 changed files with 56 additions and 4 deletions
|
|
@ -45,15 +45,17 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
abilityName: Magic Missile
|
abilityName: Magic Missile
|
||||||
|
abilityIcon: {fileID: 0}
|
||||||
thisPlayer: {fileID: 0}
|
thisPlayer: {fileID: 0}
|
||||||
canCooldown: 1
|
canCooldown: 1
|
||||||
cooldown: 0.2
|
cooldown: 0.2
|
||||||
|
power: 0
|
||||||
|
projectileCount: 12
|
||||||
|
pierceAmount: 0
|
||||||
accuracy: 1
|
accuracy: 1
|
||||||
bulletLifetime: 3
|
bulletLifetime: 3
|
||||||
damage: 5
|
|
||||||
projectileSpeed: 16
|
projectileSpeed: 16
|
||||||
fireMode: 1
|
fireMode: 1
|
||||||
projectileCount: 1
|
|
||||||
offset: {x: 1, y: 1}
|
offset: {x: 1, y: 1}
|
||||||
angle: 0
|
angle: 0
|
||||||
projectile: {fileID: 41144518337917555, guid: c8c4bd2326cbed637aa720d1a4d73968, type: 3}
|
projectile: {fileID: 41144518337917555, guid: c8c4bd2326cbed637aa720d1a4d73968, type: 3}
|
||||||
|
|
|
||||||
|
|
@ -70,10 +70,20 @@ public class Enemy : Entity
|
||||||
protected override void OnKillEffects()
|
protected override void OnKillEffects()
|
||||||
{
|
{
|
||||||
Destroy(gameObject);
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
24
Assets/Scripts/ItemPickup.cs
Normal file
24
Assets/Scripts/ItemPickup.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/ItemPickup.cs.meta
Normal file
2
Assets/Scripts/ItemPickup.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 271a03dda998936fa99eb33e6272307b
|
||||||
12
Assets/Scripts/ItemPickupRange.cs
Normal file
12
Assets/Scripts/ItemPickupRange.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/ItemPickupRange.cs.meta
Normal file
2
Assets/Scripts/ItemPickupRange.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8ed6160da3b86db81b18fdaf0abf65da
|
||||||
Loading…
Add table
Add a link
Reference in a new issue