229 lines
6.3 KiB
C#
229 lines
6.3 KiB
C#
//// ***********************************************************************
|
|
//// Assembly : Game
|
|
//// Author : Kimch
|
|
//// Created : 2020-09-02
|
|
//// Description :
|
|
//// Last Modified By :
|
|
//// Last Modified On :
|
|
//// ***********************************************************************
|
|
//// <copyright file= "Stat_GrabAtkAction" company="Kimch"></copyright>
|
|
//// <summary></summary>
|
|
//// ***********************************************************************
|
|
//using System.Collections.Generic;
|
|
//using UnityEngine;
|
|
//namespace G
|
|
//{
|
|
// public class Stat_GrabAtkAction : Stat_BaseAction
|
|
// {
|
|
// private int m_animationIndex = -1;
|
|
|
|
// private bool m_isFinish;
|
|
|
|
// private string[] aniName = new string[3];
|
|
|
|
// public Stat_GrabAtkAction(Stat_StateManager statMgr)
|
|
// : base(statMgr)
|
|
// {
|
|
// }
|
|
|
|
// public override bool Enter(Dictionary<string, object> param, bool clearDelegates = false)
|
|
// {
|
|
// if (param == null || param.Count <= 0 || !param.ContainsKey("grab_animation_id"))
|
|
// {
|
|
// Debug.LogError("param is error");
|
|
// return false;
|
|
// }
|
|
// m_isFinish = false;
|
|
// m_animationIndex = -1;
|
|
// m_animationIndex = (int)param["grab_animation_id"];
|
|
// if (m_animationIndex == -1)
|
|
// {
|
|
// Debug.LogError("AnimationIndex is error");
|
|
// return false;
|
|
// }
|
|
// Vector3 b = (Vector3)param["grab_enemy"];
|
|
// Vector3 vector = m_char.transform.position - b;
|
|
// base.Enter(param, clearDelegates);
|
|
// m_char.ResetRigidBody();
|
|
// m_char.GetComponent<Rigidbody>().Sleep();
|
|
// m_char.SetAtkCollision(false);
|
|
// m_char.SetAtkCollision(true);
|
|
// m_char.transform.forward = vector.normalized;
|
|
// m_char.GetComponent<SphereCollider>().enabled = false;
|
|
// m_char.invincible = true;
|
|
// m_char.SetGrabColliderEnabled(false);
|
|
// if (Game.myGeneral != null)
|
|
// {
|
|
// CharacterData data = Game.myGeneral.m_data;
|
|
// if (data != null)
|
|
// {
|
|
// Game.myGeneral.invincible = true;
|
|
// if (!Game.myGeneral.IsDead())
|
|
// {
|
|
// Game.myGeneral.SetCurActionState(enStat.STAT_ACTION_IDLE, null, true);
|
|
// }
|
|
// Game.myGeneral.EndAI(true);
|
|
// }
|
|
// }
|
|
// SetAnimationName(m_animationIndex);
|
|
// AnimationState animationState = null;
|
|
// float num = 0f;
|
|
// if (aniName[0] != string.Empty)
|
|
// {
|
|
// m_char.m_animation.Play(aniName[0]);
|
|
// num += m_char.m_animation[aniName[0]].length / m_char.m_animation[aniName[0]].speed;
|
|
// }
|
|
// for (int i = 1; i < aniName.Length; i++)
|
|
// {
|
|
// animationState = m_char.m_animation.PlayQueued(aniName[i], QueueMode.CompleteOthers);
|
|
// animationState.speed = m_char.m_animation[aniName[i]].speed;
|
|
// num += animationState.length / animationState.speed;
|
|
// if (i == 1)
|
|
// {
|
|
// if (m_animationIndex == 1 || m_animationIndex == 2 || m_animationIndex == 4)
|
|
// {
|
|
// m_statMgr.AddTimer(num, PlayHitFx_CB);
|
|
// }
|
|
// }
|
|
// else
|
|
// {
|
|
// m_statMgr.AddTimer(num, AnimationEnd_CB);
|
|
// }
|
|
// }
|
|
// return true;
|
|
// }
|
|
|
|
// public override bool CanTransition(enStat stat)
|
|
// {
|
|
// if (stat == enStat.STAT_ACTION_DEAD)
|
|
// {
|
|
// return true;
|
|
// }
|
|
// return m_isFinish;
|
|
// }
|
|
|
|
// protected bool PlayHitFx_CB(object[] param)
|
|
// {
|
|
// HitFx();
|
|
// return false;
|
|
// }
|
|
|
|
// protected bool AnimationEnd_CB(object[] param)
|
|
// {
|
|
// if (m_char.bNeedAddHpAfterGrab)
|
|
// {
|
|
// Transform transform = PrefabManager.Instance().Spawn("ef_other_jiaxue_01", m_char.transform.position, Quaternion.identity);
|
|
// float num = m_char.GetDataMaxPro(2);
|
|
// if (m_char.m_data.HasBuffState(140))
|
|
// {
|
|
// BufferParams stateParam = m_char.m_data.getStateParam(140);
|
|
// num = (int)(num * (1f + (float)stateParam.percent) + (int)stateParam.num);
|
|
// }
|
|
// m_char.OnHp((int)(num * StaticGlobal_parameter.Instance().getFloat(850047, "parameter")));
|
|
// transform.parent = m_char.transform;
|
|
// }
|
|
// m_isFinish = true;
|
|
// m_char.StopAnimation();
|
|
// //if (MonoInstancePool.getInstance<GuideLocalData>().curGuideModule == 1 && MonoInstancePool.getInstance<GuideLocalData>().curGuideModuleStep <= 4)
|
|
// //{
|
|
// // SetCurActionState(enStat.STAT_ACTION_IDLE);
|
|
// // return false;
|
|
// //}
|
|
// if (m_char.normalAtkEnableMove)
|
|
// {
|
|
// SetCurActionState(enStat.STAT_ACTION_MOVE);
|
|
// }
|
|
// else
|
|
// {
|
|
// SetCurActionState(enStat.STAT_ACTION_IDLE);
|
|
// }
|
|
// return false;
|
|
// }
|
|
|
|
// public override bool ExitDelegate()
|
|
// {
|
|
// m_char.GetComponent<SphereCollider>().enabled = true;
|
|
// m_char.invincible = false;
|
|
// m_char.SetGrabColliderEnabled(false);
|
|
// Debug.Log("退出GrabAtk状态");
|
|
// if (Game.myGeneral != null)
|
|
// {
|
|
// CharacterData data = Game.myGeneral.m_data;
|
|
// if (data != null)
|
|
// {
|
|
// Game.myGeneral.invincible = false;
|
|
// Game.myGeneral.StartAI();
|
|
// }
|
|
// }
|
|
// return true;
|
|
// }
|
|
|
|
// private void SetAnimationName(int aniIndex)
|
|
// {
|
|
// float delay = 0f;
|
|
// switch (aniIndex)
|
|
// {
|
|
// case 0:
|
|
// delay = 1.6f;
|
|
// aniName[0] = "grab10";
|
|
// aniName[1] = "grab10_finish";
|
|
// aniName[2] = "grab10_finish2";
|
|
// break;
|
|
// case 1:
|
|
// delay = 1.6f;
|
|
// aniName[0] = "grab11";
|
|
// aniName[1] = "grab11_finish";
|
|
// aniName[2] = "grab11_finish2";
|
|
// break;
|
|
// case 2:
|
|
// delay = 2f;
|
|
// aniName[0] = "grab12";
|
|
// aniName[1] = "grab12_finish";
|
|
// aniName[2] = "grab12_finish2";
|
|
// break;
|
|
// case 3:
|
|
// delay = 1.6f;
|
|
// aniName[0] = "grab20";
|
|
// aniName[1] = "grab20_finish";
|
|
// aniName[2] = "grab20_finish2";
|
|
// break;
|
|
// case 4:
|
|
// delay = 1.6f;
|
|
// aniName[0] = "grab21";
|
|
// aniName[1] = "grab21_finish";
|
|
// aniName[2] = "grab21_finish2";
|
|
// break;
|
|
// case 5:
|
|
// delay = 3f;
|
|
// aniName[0] = "grab22";
|
|
// aniName[1] = "grab22_finish";
|
|
// aniName[2] = "grab22_finish2";
|
|
// break;
|
|
// case 6:
|
|
// delay = 1.2f;
|
|
// aniName[0] = "grab30";
|
|
// aniName[1] = "grab30_finish";
|
|
// aniName[2] = "grab30_finish2";
|
|
// break;
|
|
// default:
|
|
// Debug.LogError("进入了奇怪的地方 = = 查bug吧骚年");
|
|
// break;
|
|
// }
|
|
// var myPlayer = m_char as EntityMainPlayer;
|
|
// if (myPlayer != null)
|
|
// {
|
|
// myPlayer.m_camScript.ZoomIn(5, 13, delay);
|
|
// }
|
|
// }
|
|
|
|
// private void HitFx()
|
|
// {
|
|
// var myPlayer = m_char as EntityMainPlayer;
|
|
// if (myPlayer != null)
|
|
// {
|
|
// myPlayer.SuperSkillHit();
|
|
// }
|
|
// }
|
|
// }
|
|
//}
|