73 lines
1.7 KiB
C#
73 lines
1.7 KiB
C#
![]() |
// ***********************************************************************
|
|||
|
// Assembly : Game
|
|||
|
// Author : Kimch
|
|||
|
// Created : 2020-09-02
|
|||
|
// Description :
|
|||
|
// Last Modified By :
|
|||
|
// Last Modified On :
|
|||
|
// ***********************************************************************
|
|||
|
// <copyright file= "Stat_ShockAction" company="Kimch"></copyright>
|
|||
|
// <summary></summary>
|
|||
|
// ***********************************************************************
|
|||
|
|
|||
|
using System.Collections.Generic;
|
|||
|
namespace G
|
|||
|
{
|
|||
|
public class Stat_ShockAction : Stat_BaseAction
|
|||
|
{
|
|||
|
private string animNam = string.Empty;
|
|||
|
|
|||
|
private bool m_bAnimEnd = true;
|
|||
|
|
|||
|
public Stat_ShockAction(Stat_StateManager statMgr)
|
|||
|
: base(statMgr)
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public override bool Enter(Dictionary<string, object> param, bool clearDelegates = false)
|
|||
|
{
|
|||
|
base.Enter(param, clearDelegates);
|
|||
|
//m_char.SetAttributeTexture(AtkDamageAttribute.SHOCK);
|
|||
|
m_curAniLength = 1.2f;
|
|||
|
if (param.ContainsKey("shock_time"))
|
|||
|
{
|
|||
|
m_curAniLength = (float)param["shock_time"];
|
|||
|
}
|
|||
|
animNam = "behitdown";
|
|||
|
m_bAnimEnd = false;
|
|||
|
m_statMgr.AddTimer(0.05f, AnimationLoop_CB, null, true);
|
|||
|
m_statMgr.AddTimer(m_curAniLength, AnimationEnd_CB);
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
private bool AnimationLoop_CB(object[] param)
|
|||
|
{
|
|||
|
m_char.StopAnimation();
|
|||
|
m_char.PlayAnimation(animNam);
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
private bool AnimationEnd_CB(object[] param)
|
|||
|
{
|
|||
|
m_bAnimEnd = true;
|
|||
|
return SetCurActionState(enStat.STAT_ACTION_IDLE);
|
|||
|
}
|
|||
|
|
|||
|
public override bool Exit()
|
|||
|
{
|
|||
|
//m_char.ResetMainTexture();
|
|||
|
return base.Exit();
|
|||
|
}
|
|||
|
|
|||
|
public override bool CanTransition(enStat stat)
|
|||
|
{
|
|||
|
bool result = false;
|
|||
|
if (m_bAnimEnd || stat == enStat.STAT_ACTION_DEAD)
|
|||
|
{
|
|||
|
result = true;
|
|||
|
}
|
|||
|
return result;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|