public bool HasState(StateType sType) { StateData sd = null; for (int i = 0; i < stateList_.Count; ++i) { sd = StateData.GetData(stateList_[i].stateId_); if (sd._StateType == (int)sType) { return(true); } } return(false); }
bool DontPlayDefState() { for (int i = 0; i < stateList_.Count; ++i) { StateData data = StateData.GetData(stateList_[i].stateId_); if (data._StateType == (int)StateType.ST_ActionAbsorb || data._StateType == (int)StateType.ST_ActionBounce || data._StateType == (int)StateType.ST_ActionInvalid) { return(true); } } return(false); }
bool hasActionInvalid() { StateData sd = null; for (int i = 0; i < aim_.ControlEntity.stateList_.Count; ++i) { sd = StateData.GetData(aim_.ControlEntity.stateList_[i].stateId_); if ((StateType)sd._StateType == StateType.ST_ActionInvalid) { return(true); } } return(false); }
bool hasWuxiaoBuff(BattleActor aim) { StateData sd = null; for (int i = 0; i < aim.ControlEntity.stateList_.Count; ++i) { sd = StateData.GetData(aim.ControlEntity.stateList_[i].stateId_); if ((StateType)sd._StateType == StateType.ST_ActionInvalid && isPhysic_) { return(true); } if ((StateType)sd._StateType == StateType.ST_MagicInvalid && !isPhysic_) { return(true); } } return(false); }
public bool PlaySkillBeattackEffect(int skillId) { SkillData skill = SkillData.GetMinxiLevelData(skillId); StateData data = null; if (skill != null) { for (int i = 0; i < skill._StateIds.Length; ++i) { for (int j = 0; j < stateList_.Count; ++j) { data = StateData.GetData(stateList_[j].stateId_); if (data._StateType == skill._StateIds[i]) { return(false); } } } } return(true); }
public int GetStateBeattackEffectID(int skillId) { SkillData skill = SkillData.GetMinxiLevelData(skillId); StateData data = null; if (skill != null) { // stateType for (int i = 0; i < skill._StateIds.Length; ++i) { for (int j = 0; j < stateList_.Count; ++j) { data = StateData.GetData(stateList_[j].stateId_); if (data._StateType == skill._StateIds[i]) { return(data._BeattackPkg.effectId_); } } } } return(-1); }
void ExcuteStateInner() { if (stateIndex_ >= stateList_.Count) { if (dealStateCallBack_ != null) { dealStateCallBack_(counter_); dealStateCallBack_ = null; } return; } crtStateData_ = StateData.GetData(stateList_[stateIndex_].stateId_); if (!isPhysic_ && (crtStateData_._StateType == (int)StateType.ST_ActionAbsorb || crtStateData_._StateType == (int)StateType.ST_ActionBounce || crtStateData_._StateType == (int)StateType.ST_ActionInvalid)) { stateIndex_++; ExcuteStateInner(); return; } if (isPhysic_ && (crtStateData_._StateType == (int)StateType.ST_MagicAbsorb || crtStateData_._StateType == (int)StateType.ST_MagicBounce || crtStateData_._StateType == (int)StateType.ST_MagicInvalid)) { stateIndex_++; ExcuteStateInner(); return; } //如果不需要播放防御特效 并且这次要播放防御特效 则跳过 if (notPlayDef_ && (crtStateData_._StateType == (int)StateType.ST_Defense || crtStateData_._StateType == (int)StateType.ST_Shield)) { stateIndex_++; ExcuteStateInner(); return; } switch (type_) { case StateInst.ExcuteType.ET_Work: if (stateList_[stateIndex_].workingInst_ == null && crtStateData_._WorkPkg.effectId_ != 0) { EffectAPI.Play((EFFECT_ID)crtStateData_._WorkPkg.effectId_, ActorObj, null, null, null, (EffectInst ei, ParamData pData) => { if (pData.iParam < stateList_.Count) { if (stateList_[pData.iParam].workingInst_ != null) { GameObject.Destroy(stateList_[pData.iParam].workingInst_.gameObject); } stateList_[pData.iParam].workingInst_ = ei; if (renderer_ == null) { renderer_ = GetBody(ActorObj); } if (renderer_ == null) { renderer_ = new SkinnedMeshRenderer[0]; } if (renderer_ != null) { for (int i = 0; i < renderer_.Length; ++i) { renderer_[i].material.SetColor("_Color", crtStateData_._WorkPkg.mainColor_); renderer_[i].material.SetColor("_RimColor", crtStateData_._WorkPkg.rimColor_); renderer_[i].material.SetFloat("_RimWidth", crtStateData_._WorkPkg.rimWidth_); } } ExcuteStateInner(); } else { ei.DestorySelf(); } }, new ParamData(stateIndex_)); stateIndex_++; } else { stateIndex_++; ExcuteStateInner(); } break; case StateInst.ExcuteType.ET_Beattack: //如果是闪避且没有hp变化就不触发状态 if (crtStateData_._StateType == (int)StateType.ST_Dodge && !realDodge_) { } else { if (crtStateData_._BeattackPkg.effectId_ != 0) { EffectAPI.Play((EFFECT_ID)crtStateData_._BeattackPkg.effectId_, ActorObj, null, null, null, (EffectInst ei, ParamData data) => { ei.transform.parent = ActorObj.transform; ei.transform.localScale = Vector3.one; }); } if (!string.IsNullOrEmpty(crtStateData_._BeattackPkg.action_)) { takeDmgAction = crtStateData_._BeattackPkg.action_; } } stateIndex_++; ExcuteStateInner(); break; case StateInst.ExcuteType.ET_Action: selfActor_ = Battle.Instance.GetActorByInstId(PlayerID); // mutiple state in this case would be cause some error. call mutiple times. if (crtStateData_._ActionPkg.effectId_ != 0) { EffectAPI.Play((EFFECT_ID)crtStateData_._ActionPkg.effectId_, ActorObj, null, null, (int iVal) => { ExcuteStateInnerPopVal(); }); } else if (!string.IsNullOrEmpty(crtStateData_._ActionPkg.action_)) { ExcuteStateInnerPopVal(); } else { stateIndex_++; ExcuteStateInner(); } break; default: break; } }
public void UpdateStateTick(bool isPhysic) { List <int> tickedStates = new List <int>(); StateData sData = null; for (int i = 0; i < stateList_.Count;) { if (!tickedStates.Contains(stateList_[i].stateId_)) { if (stateList_[i].tick_ == 0) { sData = StateData.GetData(stateList_[i].stateId_); if (null == sData) { ClientLog.Instance.Log("stateData == nulll"); continue; } //如果是防御或圣盾 不计tick数 if (sData._StateType == (int)StateType.ST_Defense || sData._StateType == (int)StateType.ST_Shield) { i++; } else { tickedStates.Add(stateList_[i].stateId_); //RemoveState(stateList_[i].stateId_); } continue; } sData = StateData.GetData(stateList_[i].stateId_); if (!isPhysic && (sData._StateType == (int)StateType.ST_MagicAbsorb || sData._StateType == (int)StateType.ST_MagicBounce || sData._StateType == (int)StateType.ST_MagicInvalid || sData._StateType == (int)StateType.ST_Sleep)) { stateList_[i].tick_--; } if (isPhysic && (sData._StateType == (int)StateType.ST_ActionAbsorb || sData._StateType == (int)StateType.ST_ActionBounce || sData._StateType == (int)StateType.ST_ActionInvalid || sData._StateType == (int)StateType.ST_Dodge || sData._StateType == (int)StateType.ST_Sleep)) { stateList_[i].tick_--; } if (stateList_[i].tick_ == 0) { //如果是防御或圣盾 不计tick数 if (sData._StateType == (int)StateType.ST_Defense || sData._StateType == (int)StateType.ST_Shield) { i++; } else { tickedStates.Add(stateList_[i].stateId_); RemoveState(stateList_[i].stateId_); } } else { i++; } } else { i++; } } tickedStates.Clear(); }