/// <summary> /// Evaluates a requirement using the info given. /// </summary> /// <returns>Whether the requirement returned true or false</returns> public static bool ApplyRequirement(RequirementInfo info) { bool not = ((info._requirement >> 31) & 1) == 1; long req = info._requirement & 0x7FFFFFFF; bool v = false; switch (req) { case 0x03: //Is On Ground v = RunTime._location == RunTime.Location.Ground; break; case 0x04: //Is In Air v = RunTime._location == RunTime.Location.Air; break; case 0x06: //On a pass-through floor v = false; break; case 0x07: //Compare if (info._values.Count == 3) { v = info._values[0].Compare(info._values[2], info._values[1].Data); } break; case 0x08: //Bit is set v = info._values[0].RealValue != 0.0f; break; case 0x0C: //Touching something switch (info._values[0].Data) { case 1: //Floor break; case 2: //Left Wall break; case 3: //Ceiling break; case 4: //Right Wall break; } break; case 0x15: //Article Exists int aId = (int)info._values[0].RealValue; if (aId < 0 || aId >= RunTime._articles.Length) { break; } v = RunTime._articles[aId].Running; break; case 0x17: //Within distance from floor if (Manager.Moveset != null && Manager.Moveset.Data != null && Manager.Moveset.Data._misc != null) { Vector3 p = Manager.Moveset.Data._misc._boneRefs[4].BoneNode._frameMatrix.GetPoint(); v = p._y < info._values[0].RealValue; } break; case 0x2A: //In Water return(false); case 0x2B: //Roll a die //int sides = (int)info._values[0].RealValue; break; case 0x2C: //Subaction exists break; case 0x30: //Button Press break; case 0x31: //Button Release break; case 0x32: //Button Pressed break; case 0x33: //Button Not Pressed break; case 0x34: //Stick Dir Pressed break; case 0x35: //Stick Dir Not Pressed break; } return(not ? !v : v); }
/// <summary> /// 零件类配置匹配 /// </summary> /// <param name="info"></param> /// <returns></returns> bool ValidRequirement(ref RequirementInfo info) { return(true); }