MusicBeat
This commit is contained in:
@@ -186,7 +186,7 @@ namespace Cielonos.MainGame.Buffs
|
||||
public class IntervalAction
|
||||
{
|
||||
public float timer;
|
||||
float interval;
|
||||
public float interval;
|
||||
Action action;
|
||||
|
||||
public IntervalAction(Action action, float interval)
|
||||
|
||||
@@ -7,14 +7,13 @@ namespace Cielonos.MainGame.Buffs.Character
|
||||
public partial class Decay : CharacterBuffBase
|
||||
{
|
||||
public float accumulatedDamage;
|
||||
public float damageInterval;
|
||||
public float maximumDamagePerInterval;
|
||||
public float Interval => timeSubmodule.intervalActions[0].interval;
|
||||
|
||||
public Decay(float damage, float damageInterval = 0.25f, float maximumDamagePerInterval = 10f)
|
||||
public Decay(float damage, float damageInterval = 0.5f, float maximumDamagePerInterval = 10f)
|
||||
{
|
||||
Initialize(BuffType.Negative, BuffDispelLevel.Basic);
|
||||
this.accumulatedDamage = damage;
|
||||
this.damageInterval = damageInterval;
|
||||
this.maximumDamagePerInterval = maximumDamagePerInterval;
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this);
|
||||
@@ -28,11 +27,12 @@ namespace Cielonos.MainGame.Buffs.Character
|
||||
{
|
||||
Decay existingDecay = existingBuff as Decay;
|
||||
existingDecay!.accumulatedDamage += this.accumulatedDamage;
|
||||
|
||||
if (existingDecay.damageInterval > this.damageInterval)
|
||||
|
||||
float existingDecayInterval = existingDecay.timeSubmodule.intervalActions[0].interval;
|
||||
float thisInterval = this.timeSubmodule.intervalActions[0].interval;
|
||||
if (existingDecayInterval > thisInterval)
|
||||
{
|
||||
existingDecay.damageInterval = this.damageInterval;
|
||||
existingDecay.timeSubmodule.intervalActions[0].SetInterval(existingDecay.damageInterval);
|
||||
existingDecay.timeSubmodule.intervalActions[0].SetInterval(thisInterval);
|
||||
}
|
||||
|
||||
if (existingDecay.maximumDamagePerInterval < this.maximumDamagePerInterval)
|
||||
@@ -80,7 +80,7 @@ namespace Cielonos.MainGame.Buffs.Character
|
||||
[Tooltip("初始衰变伤害总量。")]
|
||||
public int damage;
|
||||
[Tooltip("伤害间隔(秒)。")]
|
||||
public float damageInterval = 0.25f;
|
||||
public float damageInterval = 0.5f;
|
||||
[Tooltip("每次间隔的最大伤害量。")]
|
||||
public float maximumDamagePerInterval = 10f;
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
using Cielonos.MainGame.UI;
|
||||
using SLSUtilities.FunctionalAnimation;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Cielonos.MainGame.Buffs.Character
|
||||
{
|
||||
public class ElectronicDisturbance : CharacterBuffBase
|
||||
{
|
||||
public ElectronicDisturbance(int stackAmount)
|
||||
{
|
||||
Initialize(BuffType.Negative, BuffDispelLevel.Strong);
|
||||
this.contentSubmodule = new ContentSubmodule(this);
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stackAmount);
|
||||
this.timeSubmodule = new TimeSubmodule(this, true);
|
||||
this.timeSubmodule.AddIntervalAction(() =>
|
||||
{
|
||||
this.unitedStackSubmodule.ReduceStack(1);
|
||||
}, 1f);
|
||||
//this.independentStackSubmodule = new IndependentStackSubmodule(this, stackAmount, duration);
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterBuffBase existingBuff)
|
||||
{
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
//existingBuff.independentStackSubmodule.Merge(this.independentStackSubmodule);
|
||||
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnBuffUpdate()
|
||||
{
|
||||
base.OnBuffUpdate();
|
||||
if (unitedStackSubmodule.stackAmount >= 100)
|
||||
{
|
||||
new GeneralIncapacitation(5f).Apply(attachedCharacter, sourceCharacter);
|
||||
Remove();
|
||||
}
|
||||
|
||||
PlayerCanvas.BossInfoUIArea[attachedCharacter]?.UpdateArmor();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec8c49cf217c61f4895906d08e37e5b9
|
||||
Reference in New Issue
Block a user