public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { WhenExit exit = (WhenExit)func.intParam1; bool active = false; if (exit == WhenExit.Direct) { active = true; } else if (exit == WhenExit.Jump_Fall && fight.Jump_IsFall()) { active = true; } else if (exit == WhenExit.Jump_Floor && fight.Jump_IsFloor()) { active = true; } else if (exit == WhenExit.Attack && fight.IsHit()) { active = true; } else if (exit == WhenExit.NotAttack && !fight.IsHit()) { active = true; } if (active) { fight.ChangeBlock(func.strParam1, func.intParam0); return(true); } return(false); }
//public bool Init(IFightFSM fight, BlockFunc func) //{ // //fight.Turn(); // return false; //} public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { //限制功能激活时间 //if(func.activeFrameBegin<0||frameindex<func.activeFrameBegin)return false; //if(func.activeFrameEnd>=0&&frameindex>func.activeFrameEnd)return false; if (func.intParam1 == 1 && !fight.IsHit()) //是否攻击中 { // Debug.Log("false"); return(false); } if (fight.TestCmd(func.strParam0, func.vecParam0.x)) { fight.ChangeBlock(func.strParam1, func.intParam0); /* Debug.Log("WantChangeBlock:" + func.strParam1 + "(" + func.intParam0 + ")");*/ return(true); } return(false); }
public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { if (func.intParam3 == 1 && !fight.IsHit()) //是否攻击中 { // Debug.Log("false"); return(false); } bool active = false; int v = fight.GetProp(func.strParam0); int tv = func.intParam1; PropOp op = (PropOp)func.intParam2; if (op == PropOp.Add) { v += tv; fight.SetProp(func.strParam0, v); active = true; } else if (op == PropOp.Set) { v = tv; fight.SetProp(func.strParam0, v); active = true; } else if (op == PropOp.Eat && v >= tv) { v -= tv; fight.SetProp(func.strParam0, v); active = true; } if (active && !string.IsNullOrEmpty(func.strParam1)) { fight.ChangeBlock(func.strParam1, func.intParam0); return(true); } return(false); }
public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { bool active = false; int v = fight.GetProp(func.strParam0); int tv = func.intParam1; WhenExit when = (WhenExit)func.intParam2; if (when == WhenExit.Equal && v == tv) { active = true; } else if (when == WhenExit.Great && v > tv) { active = true; } else if (when == WhenExit.GreatEqual && v >= tv) { active = true; } else if (when == WhenExit.Less && v < tv) { active = true; } else if (when == WhenExit.LessEqual && v <= tv) { active = true; } else if (when == WhenExit.NotEqual && v != tv) { active = true; } if (active) { fight.ChangeBlock(func.strParam1, func.intParam0); return(true); } return(false); }