|
@@ -487,6 +487,7 @@ namespace CommonAI.ZoneClient
|
|
|
public System.Action OnChargeStateChange;
|
|
|
//蓄力条进度
|
|
|
public float ChargeProgress { private set; get; }
|
|
|
+ public uint ChargeTimeMS { private set; get; }
|
|
|
|
|
|
internal SkillState(SkillTemplate data, ZoneUnit owner)
|
|
|
{
|
|
@@ -556,6 +557,7 @@ namespace CommonAI.ZoneClient
|
|
|
if (Data.ActionQueue[CurrentActionID].ShowChargeTimeMS > 0)
|
|
|
{
|
|
|
ChargeProgress = 0f;
|
|
|
+ ChargeTimeMS = 0;
|
|
|
OnChargeStateChange?.Invoke();
|
|
|
}
|
|
|
else if (ChargeProgress > 0 && ChargeProgress < 1)
|
|
@@ -606,6 +608,13 @@ namespace CommonAI.ZoneClient
|
|
|
}
|
|
|
internal void ChangeAction(int step)
|
|
|
{
|
|
|
+ var aq = Data.ActionQueue[CurrentActionID];
|
|
|
+ if (aq.ShowChargeTimeMS > 0 && ChargeProgress < 1)
|
|
|
+ {
|
|
|
+ ChargeProgress = 1f;
|
|
|
+ OnChargeStateChange?.Invoke();
|
|
|
+ }
|
|
|
+
|
|
|
this.CurrentActionID = step;
|
|
|
}
|
|
|
internal void ClearCD()
|
|
@@ -636,7 +645,7 @@ namespace CommonAI.ZoneClient
|
|
|
this.pass_time_ms = syn.PassTime;
|
|
|
this.use_Times = syn.useTimes;
|
|
|
this.is_use_tiems = syn.useTimes >= 0 ? true : false;
|
|
|
- internal_update();
|
|
|
+ internal_update(0);
|
|
|
}
|
|
|
internal void TimeChange(PlayerSkillTimeChangedEvent e)
|
|
|
{
|
|
@@ -656,7 +665,7 @@ namespace CommonAI.ZoneClient
|
|
|
this.is_period_cd_end = this.Data.IsSingleAction;
|
|
|
this.is_Skill_Block = false;
|
|
|
this.is_skill_end = true;
|
|
|
- internal_update();
|
|
|
+ internal_update(0);
|
|
|
OnCDStateChange?.Invoke();
|
|
|
if(ChargeProgress > 0 && ChargeProgress < 1)
|
|
|
{
|
|
@@ -667,8 +676,7 @@ namespace CommonAI.ZoneClient
|
|
|
internal void Update(int intervalMS)
|
|
|
{
|
|
|
if (!IsActive && IsPauseOnDeactive) { return; }
|
|
|
- this.pass_time_ms += intervalMS;
|
|
|
- internal_update();
|
|
|
+ internal_update(intervalMS);
|
|
|
if (this.isPeriodCDEnd)
|
|
|
{
|
|
|
SetMutilTime();
|
|
@@ -677,9 +685,10 @@ namespace CommonAI.ZoneClient
|
|
|
var aq = Data.ActionQueue[CurrentActionID];
|
|
|
if (aq.ShowChargeTimeMS > 0)
|
|
|
{
|
|
|
+ ChargeTimeMS += (uint)intervalMS;
|
|
|
if (ChargeProgress < 1)
|
|
|
{
|
|
|
- ChargeProgress = pass_time_ms / aq.ShowChargeTimeMS;
|
|
|
+ ChargeProgress = ChargeTimeMS / (float)aq.ShowChargeTimeMS;
|
|
|
if (ChargeProgress > 1) ChargeProgress = 1f;
|
|
|
OnChargeStateChange?.Invoke();
|
|
|
}
|
|
@@ -693,7 +702,7 @@ namespace CommonAI.ZoneClient
|
|
|
internal void SetPassTime(int passTime)
|
|
|
{
|
|
|
this.pass_time_ms = passTime;
|
|
|
- internal_update();
|
|
|
+ internal_update(0);
|
|
|
}
|
|
|
|
|
|
void SetMutilTime()
|
|
@@ -709,7 +718,7 @@ namespace CommonAI.ZoneClient
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void internal_update()
|
|
|
+ private void internal_update(int intervalMS)
|
|
|
{
|
|
|
if (pass_time_ms >= FullCDTimeMS)
|
|
|
{
|
|
@@ -722,6 +731,7 @@ namespace CommonAI.ZoneClient
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ pass_time_ms += intervalMS;
|
|
|
percent = (float)pass_time_ms / FullCDTimeMS;
|
|
|
}
|
|
|
}
|