you really gotta calm down, marisa...
This commit is contained in:
parent
13bb58ea03
commit
b9fb490dce
68 changed files with 990 additions and 44 deletions
8
Assets/Scripts/Abilities.meta
Normal file
8
Assets/Scripts/Abilities.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ce5b9aa19d661c5e2b40ef0a74d1989c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
|
@ -19,9 +20,18 @@ public class AbilityManager : MonoBehaviour
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public class StoredUpgrade
|
||||
{
|
||||
public AbilityUpgrade upgrade;
|
||||
public int count;
|
||||
}
|
||||
public MarisaAbilityHandler player;
|
||||
public AbilityUpgrade upgradeToAdd;
|
||||
public Button upgradeButton;
|
||||
|
||||
[Header("Upgrades")]
|
||||
public List<StoredUpgrade> upgradesInventory;
|
||||
private void Start()
|
||||
{
|
||||
upgradeButton.onClick.AddListener((() => AddUpgrade(upgradeToAdd, player.mainAttackInstance)));
|
||||
8
Assets/Scripts/Abilities/PlayerAbilities.meta
Normal file
8
Assets/Scripts/Abilities/PlayerAbilities.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fe5e49884c882fcd5b60c9d30927a02f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -9,17 +9,16 @@ public class Laser : PlayerAbility
|
|||
public float length;
|
||||
public float width;
|
||||
public float duration;
|
||||
private float currentDuration;
|
||||
protected float currentDuration;
|
||||
[Header("Beam")]
|
||||
[SerializeField] private BeamCollider beamObject;
|
||||
[SerializeField] protected BeamCollider beamObject;
|
||||
private BeamCollider beamObjectInstance;
|
||||
public float turnSpeed;
|
||||
public float offset;
|
||||
[Header("Weapon Properties")]
|
||||
[HideInInspector] public List<Entity> enemyList = new();
|
||||
public float damageDebounceTime;
|
||||
private float currentDebounce;
|
||||
public float damage;
|
||||
protected float currentDebounce;
|
||||
private void Start()
|
||||
{
|
||||
CreateBeam();
|
||||
|
|
@ -36,6 +35,7 @@ public class Laser : PlayerAbility
|
|||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
if (currentDuration > 0)
|
||||
{
|
||||
Vector3 direction = (thisPlayer.mouseWorldPos - (Vector2)transform.position).normalized;
|
||||
|
|
@ -54,7 +54,7 @@ public class Laser : PlayerAbility
|
|||
enemyList.Remove(enemy);
|
||||
continue;
|
||||
}
|
||||
enemy.TakeDamage(damage);
|
||||
enemy.TakeDamage(power);
|
||||
}
|
||||
currentDebounce = damageDebounceTime;
|
||||
}
|
||||
|
|
@ -67,7 +67,7 @@ public class Laser : PlayerAbility
|
|||
}
|
||||
}
|
||||
|
||||
private void CreateBeam()
|
||||
protected virtual void CreateBeam()
|
||||
{
|
||||
beamObjectInstance = Instantiate(beamObject, transform.position, Quaternion.identity);
|
||||
beamObjectInstance.transform.SetParent(transform);
|
||||
|
|
@ -76,4 +76,6 @@ public class Laser : PlayerAbility
|
|||
beamObjectInstance.thisLaser = this;
|
||||
beamObjectInstance.gameObject.SetActive(false);
|
||||
}
|
||||
//maybe we should've made this a projectile instead of an ability lol
|
||||
//its ok we can work with this still
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class NondirectionalLaser : Laser
|
||||
{
|
||||
[SerializeField] private int beamCount = 1;
|
||||
[SerializeField] private Transform beamRoot;
|
||||
private List<BeamCollider> beamInstances = new();
|
||||
|
||||
protected override void AbilityEffects()
|
||||
{
|
||||
canCooldown = false;
|
||||
currentDuration = duration;
|
||||
currentDebounce = damageDebounceTime;
|
||||
beamRoot.gameObject.SetActive(true);
|
||||
}
|
||||
protected override void Update()
|
||||
{
|
||||
//we're doing this the stupid way i guess because i am stupid
|
||||
if (currentCooldown > 0)
|
||||
{
|
||||
currentCooldown -= Time.deltaTime;
|
||||
}
|
||||
if (currentDuration > 0)
|
||||
{
|
||||
// i think i can just put spinobject in it and that'll work lol
|
||||
if (currentDebounce > 0)
|
||||
{
|
||||
currentDebounce -= Time.deltaTime;
|
||||
if (currentDebounce <= 0)
|
||||
{
|
||||
foreach (Entity enemy in enemyList.ToArray())
|
||||
{
|
||||
if (!enemy)
|
||||
{
|
||||
enemyList.Remove(enemy);
|
||||
continue;
|
||||
}
|
||||
enemy.TakeDamage(power);
|
||||
}
|
||||
currentDebounce = damageDebounceTime;
|
||||
}
|
||||
}
|
||||
if (currentDuration <= 0)
|
||||
{
|
||||
canCooldown = true;
|
||||
beamRoot.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
protected override void CreateBeam()
|
||||
{
|
||||
float rotationAmount = 360f / beamCount;
|
||||
for (int i = 0; i < beamCount; i++)
|
||||
{
|
||||
BeamCollider newBeamObjectInstance = Instantiate(beamObject, transform.position, Quaternion.identity);
|
||||
beamInstances.Add(newBeamObjectInstance);
|
||||
newBeamObjectInstance.transform.SetParent(beamRoot);
|
||||
newBeamObjectInstance.transform.localScale = new Vector3(length, width, 1);
|
||||
newBeamObjectInstance.transform.Translate(Vector3.right * (newBeamObjectInstance.transform.localScale.x * 0.5f) + new Vector3(offset, 0, 0));
|
||||
newBeamObjectInstance.transform.RotateAround(beamRoot.position, Vector3.forward, rotationAmount * i);
|
||||
newBeamObjectInstance.thisLaser = this;
|
||||
}
|
||||
beamRoot.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b2d9c1454ecf94f459c14e302b316986
|
||||
|
|
@ -11,7 +11,7 @@ public class PlayerAbility : MonoBehaviour
|
|||
[Header("Cooldown")]
|
||||
public bool canCooldown = true;
|
||||
public float cooldown;
|
||||
private float currentCooldown;
|
||||
protected float currentCooldown;
|
||||
[Header("Stats")]
|
||||
public float power;
|
||||
public float projectileCount;
|
||||
8
Assets/Scripts/Abilities/Upgrades.meta
Normal file
8
Assets/Scripts/Abilities/Upgrades.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d560cfe20a1ec7b0581a0390c4d45434
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
10
Assets/Scripts/Abilities/Upgrades/UpgradePickup.cs
Normal file
10
Assets/Scripts/Abilities/Upgrades/UpgradePickup.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class UpgradePickup : ItemPickup
|
||||
{
|
||||
public AbilityUpgrade upgradeDropped;
|
||||
protected override void PickupEffects()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Abilities/Upgrades/UpgradePickup.cs.meta
Normal file
2
Assets/Scripts/Abilities/Upgrades/UpgradePickup.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 414126e6ddc5f8085af89e294a8deb38
|
||||
8
Assets/Scripts/Entities.meta
Normal file
8
Assets/Scripts/Entities.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6183f2d2f1a7e93008ff448fa746c3d4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Scripts/Items.meta
Normal file
8
Assets/Scripts/Items.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 899dfdf2c7b4ad4718c8f5ee206bdf9a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -18,7 +18,12 @@ public class ItemPickup : MonoBehaviour
|
|||
|
||||
private void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
//pick up
|
||||
PickupEffects();
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
protected virtual void PickupEffects()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
10
Assets/Scripts/Items/PowerPickup.cs
Normal file
10
Assets/Scripts/Items/PowerPickup.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class PowerPickup : ItemPickup
|
||||
{
|
||||
[SerializeField] private float powerAmount;
|
||||
protected override void PickupEffects()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Items/PowerPickup.cs.meta
Normal file
2
Assets/Scripts/Items/PowerPickup.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dac707185c38816bbb658ebbb2885694
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class MasterSpark : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e3b3742e855c4c7b499ab482efa2143e
|
||||
8
Assets/Scripts/Projectiles.meta
Normal file
8
Assets/Scripts/Projectiles.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: edb470ba0d075ab9d88588b4dc6d02b5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
10
Assets/Scripts/Projectiles/SpinSprite.cs
Normal file
10
Assets/Scripts/Projectiles/SpinSprite.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class SpinSprite : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private float rotationSpeed;
|
||||
void Update()
|
||||
{
|
||||
transform.eulerAngles = new Vector3(0, 0, transform.eulerAngles.z + (rotationSpeed * Time.deltaTime));
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Projectiles/SpinSprite.cs.meta
Normal file
2
Assets/Scripts/Projectiles/SpinSprite.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 367cdbe920b6609c2a25c4624980f56a
|
||||
Loading…
Add table
Add a link
Reference in a new issue