public bool TestCmd(string cmd, float cmdTime) { if (lasttimechange == joy.GetCommandList()[joy.GetCommandList().Count - 1].time) { return(false); } bool b = CmdMatch.CmdListMatch(cmd.ToUpper(), joy.GetCommandList(), aniPlayer.chardir, cmdTime); if (b) { lasttimechange = joy.GetCommandList()[joy.GetCommandList().Count - 1].time; } return(b); }
//检索技能 void CheckInput(bool bRepeat) { foreach (var p in stateTable.allStates) //遍历组合键 { foreach (var c in p.conditions) //遍历一个招式 所有可能的指令 { if (c.cmdActive.Length > 0 && !char.IsNumber(c.cmdActive[c.cmdActive.Length - 1]) && bRepeat) {//非方向结尾的指令不能在repeat时释放出 continue; } if (string.IsNullOrEmpty(c.stateBefore) || c.stateBefore == curStateName || c.stateBefore == "any") { if (breaklevel == -1) { continue; } if (c.breaklevel >= breaklevel) //技能的中断等级 { if ((c.isair && !Jump_IsFloor()) || (!c.isair && Jump_IsFloor())) //满足空中 地上条件 { int dir = aniPlayer.chardir; if (CmdMatch.CmdListMatch(c.cmdActive.ToUpper(), joy.GetCommandList(), dir, c.cmdTime)) { lastStateName = p.name; //breaklevel = c.breaklevel;//成功释放,改变当前中断等级 if (!string.IsNullOrEmpty(c.useattribute)) { var i = charLogic.GetParam(c.useattribute); if (i - c.usage_amount >= 0) { charLogic.SetParam(c.useattribute, i - c.usage_amount); } else { return; } } if (p.name == repeatInState && aniPlayer.frameid < repeatEndFrame) { if (repeatToState == null) { Debug.LogError("error in repeatInState:" + repeatInState + ":" + curBlockIndex); } ChangeBlock(repeatToState, repeatToIndex); repeatToState = null; repeatInState = null; } else { if (p.name == null) { Debug.LogError("error in change:" + c.cmdActive); } ChangeBlock(p.name, 0); } return; } } } } } } }