alot of stuff i forgot to commit

This commit is contained in:
Sylvia 2026-06-24 22:09:38 -07:00
parent fc2329a873
commit b8d516e734
60 changed files with 7397 additions and 64 deletions

View file

@ -0,0 +1,27 @@
using UnityEngine;
public class Effect : ScriptableObject
{
[SerializeField] private EffectInstance effectInstanceObject;
[Header("Stats")]
public float duration;
public bool isConstant; //that means if it uses the tick function or not
public virtual void ApplyEffect(EntityStats affectedEntity)
{
EffectInstance newEffectInstance = Instantiate(effectInstanceObject, affectedEntity.transform);
newEffectInstance.affectedEntity = affectedEntity;
newEffectInstance.thisEffect = this;
}
public virtual void EffectTick(EntityStats affectedEntity)
{
}
public virtual void RemoveEffect(EntityStats affectedEntity)
{
}
}

View file

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

View file

@ -0,0 +1,21 @@
using UnityEngine;
public class EffectInstance : MonoBehaviour
{
public Effect thisEffect;
public EntityStats affectedEntity;
public float timeElapsed;
private void Update()
{
timeElapsed += Time.deltaTime;
if (timeElapsed > thisEffect.duration)
{
thisEffect.RemoveEffect(affectedEntity);
return;
}
if (thisEffect.isConstant)
{
thisEffect.EffectTick(affectedEntity);
}
}
}

View file

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

View file

@ -0,0 +1,16 @@
using UnityEngine;
public class HypnotismEffect : 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()
{
}
}

View file

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

View file

@ -0,0 +1,18 @@
using UnityEngine;
[CreateAssetMenu(fileName = "New Stun Effect", menuName = "Effects/Stun Effect")]
public class StunEffect : Effect
{
public override void ApplyEffect(EntityStats affectedEntity)
{
base.ApplyEffect(affectedEntity);
affectedEntity.isStalled = true;
Debug.Log(affectedEntity.isStalled);
}
public override void RemoveEffect(EntityStats affectedEntity)
{
base.RemoveEffect(affectedEntity);
affectedEntity.isStalled = false;
}
}

View file

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