shaoxiadiablo/Assets/AGame/Scripts/Game/Stat/Stat_DodegeAction.cs

123 lines
3.3 KiB
C#
Raw Permalink Normal View History

2025-05-18 01:04:31 +08:00
// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2020-09-02
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
// <copyright file= "Stat_DodegeAction" company="Kimch"></copyright>
// <summary></summary>
// ***********************************************************************
using System.Collections.Generic;
using UnityEngine;
namespace G
{
public class Stat_DodegeAction : Stat_BaseAction
{
public Stat_DodegeAction(Stat_StateManager statMgr)
: base(statMgr)
{
}
public override bool Enter(Dictionary<string, object> param, bool clearDelegates = false)
{
base.Enter(param, clearDelegates);
//m_curAniLength = m_char.PlayAnimation("dodge");
if (m_curAniLength == -1f)
{
return false;
}
var player = m_char as EntityPlayer;
//player.SetDodge();
//player.OnSp(-10);
m_statMgr.AddTimer(m_curAniLength, AnimationEnd_CB);
m_char.invincible = true;
return true;
}
public override bool Exit()
{
m_char.SetAtkCollision(true);
((EntityPlayer)m_char).ResetRigidBody();
m_char.invincible = false;
return base.Exit();
}
public override bool CanTransition(enStat stat)
{
switch (stat)
{
case enStat.STAT_ACTION_DEAD:
return true;
case enStat.STAT_ACTION_SKILL:
case enStat.STAT_ACTION_JUMP_SKILL:
case enStat.STAT_ACTION_WHEEL_SKILL:
case enStat.STAT_ACTION_ROLL_SKILL:
case enStat.STAT_ACTION_SPURT_SKILL:
case enStat.STAT_ACTION_ZHANGFEI2_SKILL:
case enStat.STAT_ACTION_LVBU3_SKILL:
case enStat.STAT_ACTION_DIANWEI3_SKILL:
case enStat.STAT_ACTION_XULI_SKILL:
case enStat.STAT_ACTION_GENERAL_CAST:
case (enStat)60:
case (enStat)61:
case (enStat)62:
case (enStat)63:
case (enStat)64:
case (enStat)65:
case (enStat)66:
case (enStat)67:
case (enStat)68:
case (enStat)69:
case (enStat)70:
case (enStat)71:
case (enStat)72:
case (enStat)73:
case (enStat)74:
case (enStat)75:
case (enStat)76:
case (enStat)77:
case (enStat)78:
case (enStat)79:
return true;
default:
if (stat == enStat.STAT_ACTION_DODGE && m_statMgr.GetCurActionState() == enStat.STAT_ACTION_DODGE)
{
return false;
}
if (stat == enStat.STAT_ACTION_CHACKLES)
{
return true;
}
//if (m_char.m_animation.IsPlaying("dodge"))
//{
// return false;
//}
return true;
}
}
protected virtual bool AnimationEnd_CB(object[] param)
{
//m_char.m_animation.Stop("dodge");
bool flag = false;
flag = ((!m_char.normalAtkEnableMove) ? SetCurActionState(enStat.STAT_ACTION_IDLE) : SetCurActionState(enStat.STAT_ACTION_MOVE));
//if (MonoInstancePool.getInstance<GuideLocalData>().curGuideModule == 0)
//{
// int curGuideModuleStep = MonoInstancePool.getInstance<GuideLocalData>().curGuideModuleStep;
// if (curGuideModuleStep == 7 || curGuideModuleStep == 9)
// {
// GuideManager guideManager = (GuideManager)Object.FindObjectOfType(typeof(GuideManager));
// if (guideManager != null)
// {
// guideManager.getCurEvent()?.next();
// }
// }
//}
return flag;
}
}
}