THE UNMATCHED POWER OF THE SUN

This commit is contained in:
reisenlol 2026-02-01 02:35:26 -08:00
parent 3364b5df68
commit 43a0b83748
No known key found for this signature in database
10 changed files with 134 additions and 9 deletions

View file

@ -1,8 +1,13 @@
using UnityEngine;
public class AbilityUpgrade : MonoBehaviour
public class AbilityUpgrade : ScriptableObject
{
[Header("Identification")]
public string upgradeName;
public PlayerAbility thisPlayerAbility;
public virtual void ApplyUpgrade()
{
}
}

View file

@ -0,0 +1,12 @@
using UnityEngine;
public class AttackSpeedUpgrade : AbilityUpgrade
{
[SerializeField] private float speedUpgradeAmount;
public override void ApplyUpgrade()
{
base.ApplyUpgrade();
thisPlayerAbility.cooldown *= speedUpgradeAmount;
}
}

View file

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

View file

@ -0,0 +1,13 @@
using UnityEngine;
public class EnemySpawner : MonoBehaviour
{
public Enemy[] enemiesToSpawn;
public float spawnRate;
public float currentSpawnTime;
public void SpawnEnemy()
{
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1feaa0eb8751bf4a1b4acb1457d0c538

View file

@ -2,19 +2,35 @@ using UnityEngine;
public class FireBullet : PlayerAbility
{
[Header("Stats")]
public float accuracy;
public float bulletLifetime;
public float damage;
public float projectileSpeed;
public enum FireMode {Angled, Offset};
[Header("Projectile")]
public FireMode fireMode = FireMode.Offset;
public float projectileCount;
public Vector2 offset;
public float angle;
[SerializeField] private Projectile projectile;
protected override void AbilityEffects()
{
Projectile newProjectile = Instantiate(projectile, transform.position, transform.rotation);
newProjectile.damage = damage;
newProjectile.speed = projectileSpeed;
newProjectile.lifetime = bulletLifetime;
newProjectile.RotateToTarget(thisPlayer.mouseWorldPos);
newProjectile.transform.Rotate(0, 0, Random.Range(-accuracy, accuracy));
newProjectile.tag = thisPlayer.tag;
for (int i = 0; i < projectileCount; i++)
{
Projectile newProjectile = Instantiate(projectile, thisPlayer.firingPointBase.position, transform.rotation);
newProjectile.RotateToTarget(thisPlayer.firingPoint.position);
newProjectile.transform.position = thisPlayer.firingPoint.position; //me when i set the position 3 times in a row. but it's to prevent the bullets firing behind marisa
if (fireMode == FireMode.Offset && projectileCount > 1)
{
newProjectile.transform.position += new Vector3(Random.Range(-offset.x, offset.x), Random.Range(-offset.y, offset.y));
}
newProjectile.damage = damage;
newProjectile.speed = projectileSpeed;
newProjectile.lifetime = bulletLifetime;
newProjectile.transform.Rotate(0, 0, Random.Range(-accuracy, accuracy));
newProjectile.tag = thisPlayer.tag;
}
}
}

View file

@ -1,4 +1,5 @@
using System;
using Core.Extensions;
using UnityEngine;
public class Marisa : Entity
@ -6,9 +7,12 @@ public class Marisa : Entity
[Header("Mouse")]
[SerializeField] private Camera cam;
public Vector2 mouseWorldPos;
public Transform firingPointBase;
public Transform firingPoint;
private void Update()
{
mouseWorldPos = cam.ScreenToWorldPoint(Input.mousePosition);
firingPointBase.Lookat2D(mouseWorldPos);
}
protected override void FixedUpdate()

View file

@ -10,7 +10,7 @@ public class PlayerAbility : MonoBehaviour
public bool canCooldown = true;
public float cooldown;
private float currentCooldown;
public void TryAbility()
{
if (currentCooldown <= 0 && canCooldown)