Files
SoulliesOfficial 25b6da25ae 同步
2026-03-31 07:51:40 -04:00

47 lines
1.3 KiB
C#

using System.Collections;
using System.Collections.Generic;
using Ichni.RhythmGame.Beatmap;
using UnityEngine;
namespace Ichni.RhythmGame
{
public class SetIntegerEffect : EffectBase
{
#region [] Effect Parameters
public string targetVariableName;
public int targetValue;
public bool isRandom;
public int minValue;
public int maxValue;
#endregion
#region [] Initialization
public SetIntegerEffect(string targetVariableName, int targetValue, bool isRandom, int minValue, int maxValue)
{
this.effectTime = 0;
this.targetVariableName = targetVariableName;
this.targetValue = targetValue;
this.isRandom = isRandom;
this.minValue = minValue;
this.maxValue = maxValue;
}
#endregion
#region [] Effect Pattern Overrides
public override void Recover()
{
GameManager.Instance.variablesContainer.RevertVariable(targetVariableName);
}
public override void Adjust()
{
GameManager.Instance.variablesContainer.SetVariable(targetVariableName, isRandom ? Random.Range(minValue, maxValue + 1) : targetValue);
}
#endregion
}
}