public static void SetVictoryCondition(int plIDx, SkillData sd, SkillSlotAttr skillAttr) { if (!isSumo || sd.skillType == SkillTypeEnum.Performance || sd.anmData.Length < 2) { return; } Player attacker = PlayerMan.inst.GetPlObj(plIDx); Player defender = PlayerMan.inst.GetPlObj(attacker.TargetPlIdx); Referee mRef = RefereeMan.inst.GetRefereeObj(); bool isDownMove = false; var anmData = sd.anmData[1]; if (anmData.formDispList[anmData.formNum - 1].formIdx == 101 || anmData.formDispList[anmData.formNum - 1].formIdx == 100) { isDownMove = true; } if (!isDownMove || (sd.anmType == SkillAnmTypeEnum.Single)) { return; } //Handle back grapples if (attacker.animator.SkillSlotID == SkillSlotEnum.Back_X || attacker.animator.SkillSlotID == SkillSlotEnum.Back_A || attacker.animator.SkillSlotID == SkillSlotEnum.Back_B || attacker.animator.SkillSlotID == SkillSlotEnum.Back_B_UD || attacker.animator.SkillSlotID == SkillSlotEnum.Back_B_LR || attacker.animator.SkillSlotID == SkillSlotEnum.Back_XA) { attacker.animator.ReqBasicAnm(global::BasicSkillEnum.S1_Substitution_BackHold, true, defender.TargetPlIdx); return; } //Handle Irish Whips if (attacker.animator.BasicSkillID == BasicSkillEnum.HammerThrough_D || attacker.animator.BasicSkillID == BasicSkillEnum.HammerThrough_S || attacker.animator.BasicSkillID == BasicSkillEnum.HammerThrough_U || attacker.animator.BasicSkillID == BasicSkillEnum.HammerThrough_Back_D || attacker.animator.BasicSkillID == BasicSkillEnum.HammerThrough_Back_S || attacker.animator.BasicSkillID == BasicSkillEnum.HammerThrough_Back_U || attacker.animator.BasicSkillID == BasicSkillEnum.HammerThrough_To_Runway) { attacker.animator.ReqBasicAnm(global::BasicSkillEnum.Grapple_Cut, true, defender.TargetPlIdx); } //Substitute animation on invalid move or if the defender isn't worn down enough if (isDownMove && (defender.HP > (.25 * 65535f) && defender.SP > (.25 * 65535f) && defender.BP > (.25 * 65535f))) { attacker.ChangeState(global::PlStateEnum.NormalAnm); defender.ChangeState(global::PlStateEnum.NormalAnm); attacker.animator.ReqBasicAnm(global::BasicSkillEnum.S1_Substitution_FrontHold, true, attacker.TargetPlIdx); attacker.SetGrappleResult(attacker.TargetPlIdx, true); attacker.SetGrappleResult(plIDx, false); } }
public static void RemovePts(int plIDx, SkillData sd, SkillSlotAttr skillAttr) { if (isPancrase) { if (instantDQ.Contains(sd.skillName[(int)SaveData.inst.optionSettings.language])) { if (plIDx < 4) { points[0] = 0; dqChecked = true; } else { points[1] = 0; dqChecked = true; } } else if (illegalMoves.Contains(sd.skillName[(int)SaveData.inst.optionSettings.language]) || sd.flags == SkillData.SkillFlags.FoulTech) { if (plIDx < 4) { points[0]--; foulChecked = true; } else { points[1]--; foulChecked = true; } } if (foulChecked) { PlayerMan.inst.GetPlObj(plIDx).animator.isReqAnmLoopEnd = true; CheckMatchEnd("Foul"); } if (dqChecked) { CheckMatchEnd("Disqualification"); } } }
public static void FoulOpponent(int plIDx, SkillData sd, SkillSlotAttr skillAttr) { if (!isBoxing) { return; } Player attacker = PlayerMan.inst.GetPlObj(plIDx); Player defender = PlayerMan.inst.GetPlObj(attacker.TargetPlIdx); if (attacker.lastSkillHit = false) { return; } //Determine if attacker fouls opponent if (sd.filteringType != SkillFilteringType.Punch && sd.filteringType != SkillFilteringType.Chop && sd.filteringType != SkillFilteringType.Performance && sd.filteringType != SkillFilteringType.Thrust) { //Allow kicks if this is a kickboxing match if (MoreMatchTypes_Form.moreMatchTypesForm.cb_kickboxing.Checked) { if (sd.filteringType == SkillFilteringType.Kick) { return; } } //Increase bleeding rate on headbutts and elbows if (sd.filteringType == SkillFilteringType.Headbutt || sd.filteringType == SkillFilteringType.Elbow) { if (sd.bleedingRate < 10) { sd.bleedingRate = 10; } } int discretion = attacker.WresParam.aiParam.discreation; if (sd.anmType != SkillAnmTypeEnum.HitBranch_Single || sd.anmType != SkillAnmTypeEnum.HitBranch_Pair) { discretion = 0; } if (UnityEngine.Random.Range(1, 100) >= discretion) { //Execute the foul move isFoul = true; int foulIncrement = 1; int currFouls = 0; if (dqAttacks.Contains(sd.skillName[(int)SaveData.inst.optionSettings.language].ToLower()) || sd.flags == SkillData.SkillFlags.FoulTech) { foulIncrement = foulCeiling + 1; } //Determine if defender resists illegal blows if (sd.flags == SkillData.SkillFlags.FoulTech) { ResistBlow(defender); } //Determine if referee processes the foul if (plIDx < 4) { currFouls = foulCount[0]; } else { currFouls = foulCount[1]; } float foulValue = foulCeiling * (currFouls + 1); if (sd.filteringType != SkillFilteringType.Elbow || sd.filteringType != SkillFilteringType.Headbutt) { foulValue = foulCeiling * (currFouls + 2); } L.D("Foul Value: " + foulValue); if (UnityEngine.Random.Range(1, 50) > foulValue) { if (plIDx < 4) { foulCount[0] += foulIncrement; if (foulCount[0] > foulCeiling) { CallDQ(plIDx); } else { CallFoul(plIDx, sd.skillName[(int)SaveData.inst.optionSettings.language]); //Ensure that foul move does not continue defender.animator.isReqAnmLoopEnd = true; defender.SetDownTime(0); } } else { foulCount[1] += foulIncrement; if (foulCount[1] > foulCeiling) { CallDQ(plIDx); } else { CallFoul(plIDx, sd.skillName[(int)SaveData.inst.optionSettings.language]); //Ensure that foul move does not continue defender.animator.isReqAnmLoopEnd = true; defender.SetDownTime(0); } } } Audience.inst.PlayCheerVoice(CheerVoiceEnum.BOOING, 1); Audience.inst.TensionDown(); } else { //Clinch instead of committing a foul attacker.animator.ReqBasicAnm(global::BasicSkillEnum.S1_Substitution_FrontHold, true, attacker.TargetPlIdx); attacker.SetGrappleResult(attacker.TargetPlIdx, true); attacker.SetGrappleResult(plIDx, false); } } }
public static void RemovePts(int plIDx, SkillData sd, SkillSlotAttr skillAttr) { if (!isUwfi) { return; } bool ptChange = false; if (sd.filteringType == SkillFilteringType.Performance) { return; } Player attacker = PlayerMan.inst.GetPlObj(plIDx); Player defender = PlayerMan.inst.GetPlObj(attacker.TargetPlIdx); if (instantDQ.Contains(sd.skillName[(int)global::SaveData.inst.optionSettings.language])) { if (plIDx < 4) { points[0] -= 22; points[0] = CheckPoints(points[0]); } else { points[1] -= 22; points[1] = CheckPoints(points[1]); } ptChange = true; DisplayScore("Disqualification"); HandleFoul(); } else if (illegalMoves.Contains(sd.skillName[(int)global::SaveData.inst.optionSettings.language]) || sd.flags == SkillData.SkillFlags.FoulTech) { if (plIDx < 4) { foulCount[0]++; points[0] -= foulCount[0]; points[0] = CheckPoints(points[0]); } else { foulCount[1]++; points[1] -= foulCount[1]; points[1] = CheckPoints(points[1]); } ptChange = true; DisplayScore("Illegal " + sd.skillName[(int)global::SaveData.inst.optionSettings.language]); HandleFoul(); } else if (sd.filteringType == SkillFilteringType.Headbutt) { if (plIDx < 4) { foulCount[0]++; points[0] -= foulCount[0]; points[0] = CheckPoints(points[0]); } else { foulCount[1]++; points[1] -= foulCount[1]; points[1] = CheckPoints(points[1]); } ptChange = true; DisplayScore("Foul"); HandleFoul(); } else if (sd.filteringType == SkillFilteringType.Suplex) { if (plIDx < 4) { points[1]--; points[1] = CheckPoints(points[1]); } else { points[0]--; points[0] = CheckPoints(points[0]); } ptChange = true; if (sd.filteringType == SkillFilteringType.Suplex) { DisplayScore("Suplex"); } } if (!CheckForLoss()) { //Suplexes are legal, and the match should continue if (sd.filteringType != SkillFilteringType.Suplex && ptChange) { ForceCleanBreak(); } } }