From 934b23252ab91012b644adb2493acd18566b1ded Mon Sep 17 00:00:00 2001 From: Giovani1906 <4cc.giovani1906@gmail.com> Date: Mon, 9 Mar 2026 12:51:43 +0100 Subject: [PATCH 1/5] Improve AATF codebase --- aatf.cpp | 1085 +++++++++++++++++++++++++-------------------------- aatf.h | 272 ++++++++++--- editor.h | 2 +- main.cpp | 122 +++--- resource.h | 8 +- resource.rc | 4 +- 6 files changed, 831 insertions(+), 662 deletions(-) diff --git a/aatf.cpp b/aatf.cpp index 75b3c57..e24c18a 100644 --- a/aatf.cpp +++ b/aatf.cpp @@ -3,7 +3,7 @@ #include "editor.h" #include "resource.h" #include "aatf.h" -#ifndef UNICODE +#ifndef UNICODE typedef std::string tstring; typedef std::stringstream tstringstream; #else @@ -41,55 +41,11 @@ int regPosToPlayPosMap[13] = { 12, 9, 10, 11, 5, 6, 7, 8, 4, 2, 3, 1, 0 }; //============================ //AATF Settings -int manletBonus = 5; -int silverManletBonus = 0; -int goldManletBonus = 0; -int silverGiantPen = 0; -int goldGiantPen = 0; - -int goldRate = 99; //Player skill ratings -int silverRate = 88; -int regRate = 77; -int gkRate = 74; - -int reqNumGold = 2; //Numbers of medals -int reqNumSilver = 3; - -int goldForm = 8; //possible range 1-8 -int silverForm = 8; -int regForm = 4; - -int goldIR = 3; //Injury resistence (possible range 1-3) -int silverIR = 3; -int regIR = 1; - -int goldWeakFootUse = 2; //Gold medal weak foot usage limit -int silverWeakFootUse = 2; -int regWeakFootUse = 2; - -int goldWeakFootAcc = 4; //Gold medal weak foot accuracy limit -int silverWeakFootAcc = 4; -int regWeakFootAcc = 2; - int manletCardBonus = 1; //Manlets get 1 extra card int manletWeakFootUse = 4; //Manlets get 4/4 weak foot usage/accuracy int manletWeakFootAcc = 4; int manletPosBonus = 1; //Manlets get 1 extra double A position -int gkSkillCards = 2; //Skill cards -int regSkillCards = 3; -int silverSkillCards = 4; -int goldSkillCards = 5; - -int gkTrickCards = 0; //Trick cards -int regTrickCards = 2; -int silverTrickCards = 3; -int goldTrickCards = 3; - -int regCOM = 0; //COM playing styles -int silverCOM = 1; -int goldCOM = 2; - int greenGiga = 0; //Green height bracket int greenGiant = 5; int greenTall = 6; @@ -110,17 +66,18 @@ int heightMid = 180; int heightManlet = 175; -void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplayers, team_entry* gteams, int gnum_players) +void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplayers, team_entry* gteams, int gnum_players, bool useSuggestions) { player_entry player; tstring msgOut; - msgOut+=_T("Team: "); - msgOut+=gteams[teamSel].name; - msgOut+=_T("\r\n"); + msgOut += _T("Team: "); + msgOut += gteams[teamSel].name; + msgOut += _T("\r\n"); //============================ bool hasCaptain = false; + bool captainHasCaptaincy = false; int numGK = 0; //Count of player ratings int numReg = 0; @@ -133,7 +90,6 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay int numMid = 0; int numManlet = 0; bool usingRed = true; - bool eCheck = false; //Run through all players once to determine height system for (int ii = 0; ii < gteams[teamSel].num_on_team; ii++) @@ -154,65 +110,101 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay break; } } - + //Now check each player for errors - int errorTot = 0; - for(int ii=0; ii 15) { rating = max(player.clearing, rating); rating = max(player.reflex, rating); rating = max(player.cover, rating); } - rating = max(player.body_ctrl, rating); - if (pesVersion > 16) rating = max(player.phys_cont, rating); //Not in 16 - rating = max(player.kick_pwr, rating); - rating = max(player.exp_pwr, rating); - rating = max(player.ball_ctrl, rating); - rating = max(player.ball_win, rating); - rating = max(player.jump, rating); - rating = max(player.place_kick, rating); - rating = max(player.stamina, rating); - rating = max(player.speed, rating); + rating = max(player.body_ctrl, rating); + if (pesVersion > 16) rating = max(player.phys_cont, rating); //Not in 16 + rating = max(player.kick_pwr, rating); + rating = max(player.exp_pwr, rating); + rating = max(player.ball_ctrl, rating); + rating = max(player.ball_win, rating); + rating = max(player.jump, rating); + rating = max(player.place_kick, rating); + rating = max(player.stamina, rating); + rating = max(player.speed, rating); if (pesVersion > 19) rating = max(player.aggres, rating); /*if(player.injury+1 > 3) { errorTot++; - errorMsg << _T("Injury resist is ") << player.injury+1 << _T(", cannot exceed 3; "); + errorMsg << _T("Injury resist is ") << player.injury+1 << _T(", cannot exceed 3; "); }*/ //Check if this player is the captain @@ -220,96 +212,94 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay //Check if registered pos has playable set to A int requiredAPos = regPosToPlayPosMap[player.reg_pos]; - if(player.play_pos[requiredAPos] != 2) + if (player.play_pos[requiredAPos] != 2) { errorTot++; - errorMsg << _T("Doesn't have A in registered position; "); + errorMsg << _T("\tDoesn't have A in registered position;\r\n"); } - + //Count number of registered GKs - if(player.reg_pos == 0) numGK++; + if (player.reg_pos == 0) numGK++; //Count A positions - int countA = 0; + int countA = 0; int countB = 0; - for(int jj=0;jj<13;jj++) - { - if(player.play_pos[jj] == 2) + for (int jj = 0; jj < 13; jj++) + { + if (player.play_pos[jj] == 2) countA++; else if (player.play_pos[jj] == 1) countB++; - } + } //No B positions allowed: - if(countB > 0) + if (countB > 0) { errorTot++; - errorMsg << _T("Has B position; "); + errorMsg << _T("\tHas B position;\r\n"); } - - //If more than 1 A, 1 card less for each - if(countA > 1) - { - if(player.play_pos[12] == 2) //Can't have GK as second A - { - errorTot++; - errorMsg << _T("Has GK as second A position; "); - } - cardMod -= (countA - 1); - } + if (player.reg_pos != 0 && player.play_pos[12] == 2) //Can't have GK as second A + { + errorTot++; + errorMsg << _T("\tHas GK as second A position;\r\n"); + } //Count cards int numTrick = 0; int numCom = 0; int numSkill; - if(pesVersion==19) numSkill=39; - else if(pesVersion>19) numSkill=41; - else numSkill=28; - for(int jj=0;jj 19) numSkill = 41; + else numSkill = 28; + for (int jj = 0; jj < numSkill; jj++) + { + if (player.play_skill[jj]) + { + cardCount++; //SPECIAL Winter/Spring 24: Malicia (21) is a free card - if(jj==21) cardMod++; - //Captain gets free captaincy card - if(jj==25 && player.id == gteams[teamSel].players[gteams[teamSel].captain_ind]) - cardMod++; - //Trick cards may be free, count number - if(jj<6 || jj==16 || jj==28 || jj==29 || jj==30 || jj==34) + if (jj == 21) cardMod++; + //Captain gets free captaincy card + if (jj == 25 && player.id == gteams[teamSel].players[gteams[teamSel].captain_ind]) { - hasTrick = true; + captainHasCaptaincy = true; + cardMod++; + } + //Trick cards may be free, count number + if (jj < 6 || jj == 16 || jj == 28 || jj == 29 || jj == 30 || jj == 34) + { + hasTrick = true; numTrick++; } - } - } - for(int jj=0;jj<7;jj++) - { - if(player.com_style[jj]) + } + } + + for (int jj = 0; jj < 7; jj++) + { + if (player.com_style[jj]) { cardCount++; numCom++; } } - if(player.age<15 || player.age>50) + if (player.age < 15 || player.age>50) { errorTot++; - errorMsg << _T("Age out of range (15,50); "); + errorMsg << _T("\tAge out of range (15,50);\r\n"); } - if(player.weight(player.height-81)) + if (player.weight(player.height - 81)) { errorTot++; - errorMsg << _T("Weight out of range (") << max(30,player.height-129) << _T(",") << player.height-81 << _T("); "); + errorMsg << _T("\tWeight out of range (") << max(30, player.height - 129) << _T(",") << player.height - 81 << _T(");\r\n"); } //Check playing style and registered position are in valid range per PES version - if (player.reg_pos > 12) + if (player.reg_pos > 12) { errorTot++; - errorMsg << _T("Registered position out of range (0-12); "); + errorMsg << _T("\tRegistered position out of range (0-12);\r\n"); } if (pesVersion <= 16) @@ -317,290 +307,266 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay if (player.play_style > 18 || player.play_style == 16) { errorTot++; - errorMsg << _T("Playing style out of range (0-18, excluding 16); "); + errorMsg << _T("\tPlaying style out of range (0-18, excluding 16);\r\n"); } } else if (pesVersion > 16 && pesVersion < 19) { - if (player.play_style > 17) + if (player.play_style > 17) { errorTot++; - errorMsg << _T("Playing style out of range (0-17); "); + errorMsg << _T("\tPlaying style out of range (0-17);\r\n"); } } else { - if (player.play_style > 21) + if (player.play_style > 21) { errorTot++; - errorMsg << _T("Playing style out of range (0-21); "); + errorMsg << _T("\tPlaying style out of range (0-21);\r\n"); } } - - /* REGULAR */ - if(rating < silverRate-silverGiantPen) //Regular player - { - numReg++; - targetRate = regRate; - targetRate2 = regRate; - targetRate3 = regRate; - if(player.reg_pos == 0) //GK target rate is 77 - { - targetRate = gkRate; - targetRate2 = gkRate; - targetRate3 = gkRate; - } - - weakFootUse = regWeakFootUse; - weakFootAcc = regWeakFootAcc; - - /*if(countA > 3) - { - errorTot++; - errorMsg << _T("Regular player with > 3 A positions; "); - }*/ - - /*//SPECIAL Summer 24: Malicia (21) is now mandatory on all non-medal players - if (!player.play_skill[21]) - { - errorTot++; - errorMsg << _T("Malicia card is mandatory for all non-medal players; "); - }*/ - - if(player.form+1 != regForm) - { - errorTot++; - errorMsg << _T("Form is ") << player.form+1 << _T(", should be ") << regForm << _T("; "); - } - - if(player.reg_pos == 0) //GK gets 2 cards - { - cardMod += min(gkTrickCards, numTrick); //1 free tricks - cardLimit = gkSkillCards + cardMod; - - if(player.height > heightMid && player.height < heightTallGK) - { - errorTot++; - errorMsg << _T("GKs in this bracket must be ") << heightTallGK << _T("cm; "); - } - //SPECIAL Autumn 24 - GK and medals can'ts be in giant height bracket - if (player.height >= heightGiant) - { - errorMsg << _T("GK heights cannot be ") << heightGiant << _T("cm; "); - } - } - else - { - cardMod += min(regCOM, numCom); //0 free COM styles - cardMod += min(regTrickCards, numTrick); //2 free tricks - //cardMod += min(1, (countA - 1)); //1 free A-position - cardLimit = regSkillCards + cardMod; //3 skill cards - } - - if(player.injury+1 > regIR) - { - errorTot++; - errorMsg << _T("Injury resist is ") << player.injury+1 << _T(", should be ") << regIR << _T("; "); - } - - if (player.height <= heightManlet && usingRed) - { - targetRate += manletBonus; - targetRate2 += manletBonus; - targetRate3 += manletBonus; + /* GOALKEEPER */ + if (player.reg_pos == 0) //Goalkeeper player, counts towards regular + { + numReg++; + using namespace goalkeeper; + + allowedInjResist = injury_resistance; + allowedForm = form; + allowedAPostions = a_pos; + weakFootUse = weak_foot_usage; + weakFootAcc = weak_foot_accuracy; + + allowedTricks = tricks; + allowedComs = coms; + allowedSkills = skills; + + targetRate = base_stat; + targetDrib = dribbling; + targetGk = gk_awareness; + targetFinish = finishing; + targetLowPass = low_pass; + targetLoftPass = lofted_pass; + targetHeader = header; + targetSwerve = curl; + targetCatching = catching; + targetClearing = clearing; + targetReflex = reflexes; + targetBodyCtrl = balance; + targetPhysCont = physical_contact; + targetKickPwr = kicking_power; + targetExpPwr = acceleration; + targetBallCtrl = ball_control; + targetBallWin = ball_winning; + targetJump = jump; + targetCover = gk_reach; + targetPlcKick = place_kicking; + targetStamina = stamina; + targetSpeed = speed; + targetAtkProw = offensive_awareness; + targetDefProw = defensive_awareness; + targetTightPos = tight_possession; + targetAggres = aggression; + + if (player.height >= heightGiant) //HA get penalty + { + targetRate -= height_nerf; + statMod -= height_nerf; + } + else if (player.height <= heightManlet && usingRed) + { + targetRate += manlet_buff; + statMod += manlet_buff; } - - /*//SPECIAL Spring 24: non-medals that are registered in a blue position (CB, LB, RB) get +5 defensive prowess - if (player.reg_pos >= 1 && player.reg_pos <= 3) - { - targetRate2 += 5; - }*/ - - /*//SPECIAL Spring 24: red heights non-medals registered in a red position (CF/SS/LWF/RWF) receive a +5 boost to all stats and can stack with the boost from being 175cm however these players cannot be given a 2nd A position - if (player.reg_pos >= 9 && player.reg_pos <= 12 && usingRed) - { - targetRate += 5; - targetRate2 += 5; - //SPECIAL Summer 24: Red Position non-medal manlet players (CF/SS/LWF/RWF) have stamina stat = 77 - if (player.height <= heightManlet && usingRed) - targetRate3 = regRate; - else - targetRate3 += 5; - if (countA > 1) - { - errorTot++; - errorMsg << _T("Illegal 2nd A position on red heights non-medal forward; "); - } - }*/ - - /*//SPECIAL Summer 24: green heights non-medals registered in a red position (CF/SS/LWF/RWF) get an additional 5cm of height except for 199cm players - if (player.reg_pos >= 9 && player.reg_pos <= 12 && !usingRed && player.height <= heightGiant) - { - heightMod = 5; - }*/ - - if (eCheck) - { - if (player.reg_pos == 0) - { - if (numTrick < gkTrickCards) errorMsg << _T("WARN: Has ") << numTrick << _T(" trick cards, allowed ") << gkTrickCards << _T("; "); - if (numCom < regCOM) errorMsg << _T("WARN: Has ") << numCom << _T(" COM cards, allowed ") << regCOM << _T("; "); - } - else - { - if (numTrick < regTrickCards) errorMsg << _T("WARN: Has ") << numTrick << _T(" trick cards, allowed ") << regTrickCards << _T("; "); - if (numCom < regCOM) errorMsg << _T("WARN: Has ") << numCom << _T(" COM cards, allowed ") << regCOM << _T("; "); - } - if (player.injury + 1 < regIR) errorMsg << _T("WARN: Has inj resist") << player.injury + 1 << _T(", allowed ") << regIR << _T("; "); + } + /* REGULAR */ + else if (rating < (silver::base_stat - silver::height_nerf)) //Regular player + { + numReg++; + using namespace regular; + + allowedInjResist = injury_resistance; + allowedForm = form; + allowedAPostions = a_pos; + weakFootUse = weak_foot_usage; + weakFootAcc = weak_foot_accuracy; + + allowedTricks = tricks; + allowedComs = coms; + allowedSkills = skills; + + targetRate = base_stat; + targetDrib = dribbling; + targetGk = gk_awareness; + targetFinish = finishing; + targetLowPass = low_pass; + targetLoftPass = lofted_pass; + targetHeader = header; + targetSwerve = curl; + targetCatching = catching; + targetClearing = clearing; + targetReflex = reflexes; + targetBodyCtrl = balance; + targetPhysCont = physical_contact; + targetKickPwr = kicking_power; + targetExpPwr = acceleration; + targetBallCtrl = ball_control; + targetBallWin = ball_winning; + targetJump = jump; + targetCover = gk_reach; + targetPlcKick = place_kicking; + targetStamina = stamina; + targetSpeed = speed; + targetAtkProw = offensive_awareness; + targetDefProw = defensive_awareness; + targetTightPos = tight_possession; + targetAggres = aggression; + + if (player.height >= heightGiant) //HA get penalty + { + targetRate -= height_nerf; + statMod -= height_nerf; + } + else if (player.height <= heightManlet && usingRed) + { + targetRate += manlet_buff; + statMod += manlet_buff; } } /* SILVER */ - else if(rating < goldRate-goldGiantPen) //Silver player - { - numSilver++; - targetRate = silverRate; - targetRate2 = silverRate; - targetRate3 = silverRate; - - weakFootUse = silverWeakFootUse; - weakFootAcc = silverWeakFootAcc; - - if(numSilver > reqNumSilver) - { - errorTot++; - errorMsg << _T("Too many Silver medals; "); - } - if(player.form+1 != silverForm) - { - errorTot++; - errorMsg << _T("Form is ") << player.form+1 << _T(", should be ") << silverForm << _T("; "); - } - if(player.reg_pos == 0) //Medals can't be GK - { - errorTot++; - errorMsg << _T("Medals cannot play as GK; "); - } - if(player.height >= heightGiant) //HA get penalty - { - targetRate -= silverGiantPen; - targetRate2 -= silverGiantPen; - targetRate3 -= silverGiantPen; - } - else if(player.height <= heightManlet && usingRed) - { - targetRate += silverManletBonus; - targetRate2 += silverManletBonus; - targetRate3 += silverManletBonus; - } - cardMod += min(silverTrickCards, numTrick); //3 free tricks - cardMod += min(silverCOM, numCom); //1 free COM - //cardMod += min(1, (countA - 1)); //1 free A-position - cardLimit = silverSkillCards + cardMod; //4 skill cards - - if(player.injury+1 > silverIR) + else if (rating < (gold::base_stat - gold::height_nerf)) //Silver player + { + numSilver++; + using namespace silver; + + allowedInjResist = injury_resistance; + allowedForm = form; + allowedAPostions = a_pos; + weakFootUse = weak_foot_usage; + weakFootAcc = weak_foot_accuracy; + + allowedTricks = tricks; + allowedComs = coms; + allowedSkills = skills; + + targetRate = base_stat; + targetDrib = dribbling; + targetGk = gk_awareness; + targetFinish = finishing; + targetLowPass = low_pass; + targetLoftPass = lofted_pass; + targetHeader = header; + targetSwerve = curl; + targetCatching = catching; + targetClearing = clearing; + targetReflex = reflexes; + targetBodyCtrl = balance; + targetPhysCont = physical_contact; + targetKickPwr = kicking_power; + targetExpPwr = acceleration; + targetBallCtrl = ball_control; + targetBallWin = ball_winning; + targetJump = jump; + targetCover = gk_reach; + targetPlcKick = place_kicking; + targetStamina = stamina; + targetSpeed = speed; + targetAtkProw = offensive_awareness; + targetDefProw = defensive_awareness; + targetTightPos = tight_possession; + targetAggres = aggression; + + if (player.reg_pos == 0) //Medals can't be GK { errorTot++; - errorMsg << _T("Injury resist is ") << player.injury+1 << _T(", should be ") << silverIR << _T("; "); - } - - if (eCheck) - { - if (numTrick < silverTrickCards) errorMsg << _T("WARN: Has ") << numTrick << _T(" trick cards, allowed ") << silverTrickCards << _T("; "); - if (numCom < silverCOM) errorMsg << _T("WARN: Has ") << numCom << _T(" COM cards, allowed ") << silverCOM << _T("; "); - if (player.injury + 1 < silverIR) errorMsg << _T("WARN: Has inj resist") << player.injury + 1 << _T(", allowed ") << silverIR << _T("; "); - } - - //SPECIAL FAG13: Medals can trade a card for 4/4 footedness - /*if (player.weak_use + 1 > weakFootUse) - { - weakFootUse = 4; - cardLimit--; - }*/ - } - /* GOLD */ - else //rating == 99 //Gold player - { - numGold++; - targetRate = goldRate; - targetRate2 = goldRate; - targetRate3 = goldRate; - - weakFootUse = goldWeakFootUse; - weakFootAcc = goldWeakFootAcc; - - if(numGold > reqNumGold) - { - errorTot++; - errorMsg << _T("Too many Gold medals; "); - } - if(player.form+1 != goldForm) - { - errorTot++; - errorMsg << _T("Form is ") << player.form+1 << _T(", should be ") << goldForm << _T("; "); - } - if(player.reg_pos == 0) //Medals can't be GK - { - errorTot++; - errorMsg << _T("Medals cannot play as GK; "); + errorMsg << _T("\tMedals cannot play as GK;\r\n"); } - if(player.height >= heightGiant) //Medal HA penalty + if (player.height >= heightGiant) //HA get penalty { - targetRate -= goldGiantPen; - targetRate2 -= goldGiantPen; - targetRate3 -= goldGiantPen; - } - else if(player.height <= heightManlet && usingRed) - { - targetRate += goldManletBonus; - targetRate2 += goldManletBonus; - targetRate3 += goldManletBonus; + targetRate -= height_nerf; + statMod -= height_nerf; } - - if (player.height > heightGiant) + else if (player.height <= heightManlet && usingRed) { - errorMsg << _T("Gold heights cannot exceed ") << heightGiant << _T("cm; "); + targetRate += manlet_buff; + statMod += manlet_buff; } - - cardMod += min(goldTrickCards, numTrick); //4 free tricks - cardMod += min(goldCOM, numCom); //2 free COMs - cardLimit = goldSkillCards + cardMod; //5 skill cards - - if(player.injury+1 > goldIR) + } + /* GOLD */ + else if (rating == gold::base_stat || rating == (gold::base_stat - gold::height_nerf)) //Gold player + { + numGold++; + using namespace gold; + + allowedInjResist = injury_resistance; + allowedForm = form; + allowedAPostions = a_pos; + weakFootUse = weak_foot_usage; + weakFootAcc = weak_foot_accuracy; + + allowedTricks = tricks; + allowedComs = coms; + allowedSkills = skills; + + targetRate = base_stat; + targetDrib = dribbling; + targetGk = gk_awareness; + targetFinish = finishing; + targetLowPass = low_pass; + targetLoftPass = lofted_pass; + targetHeader = header; + targetSwerve = curl; + targetCatching = catching; + targetClearing = clearing; + targetReflex = reflexes; + targetBodyCtrl = balance; + targetPhysCont = physical_contact; + targetKickPwr = kicking_power; + targetExpPwr = acceleration; + targetBallCtrl = ball_control; + targetBallWin = ball_winning; + targetJump = jump; + targetCover = gk_reach; + targetPlcKick = place_kicking; + targetStamina = stamina; + targetSpeed = speed; + targetAtkProw = offensive_awareness; + targetDefProw = defensive_awareness; + targetTightPos = tight_possession; + targetAggres = aggression; + + if (player.reg_pos == 0) //Medals can't be GK { errorTot++; - errorMsg << _T("Injury resist is ") << player.injury+1 << _T(", should be ") << goldIR << _T("; "); + errorMsg << _T("\tMedals cannot play as GK;\r\n"); } - - if (eCheck) + if (player.height >= heightGiant) //HA get penalty { - if (cardCount < 10) - { - if (numTrick < goldTrickCards) errorMsg << _T("WARN: Has ") << numTrick << _T(" trick cards, allowed ") << goldTrickCards << _T("; "); - if (numCom < goldCOM) errorMsg << _T("WARN: Has ") << numCom << _T(" COM cards, allowed ") << goldCOM << _T("; "); - } - if (player.injury + 1 < goldIR) errorMsg << _T("WARN: Has inj resist") << player.injury + 1 << _T(", allowed ") << goldIR << _T("; "); + targetRate -= height_nerf; + statMod -= height_nerf; } - - //SPECIAL Spring 25 - GK and gold medals can't be in giant height bracket - if (player.height >= heightGiant) + else if (player.height <= heightManlet && usingRed) { - errorMsg << _T("Gold medal heights cannot be ") << heightGiant << _T("cm; "); + targetRate += manlet_buff; + statMod += manlet_buff; } - - //SPECIAL FAG13: Medals can trade a card for 4/4 footedness - /*if (player.weak_use + 1 > weakFootUse) - { - weakFootUse = 4; - cardLimit--; - }*/ + } + else + { + errorTot++; + errorMsg << _T("\tIllegal Ability scores;\r\n"); + //spit out whatever errors were already found, but target scores can't be set, so quit out of this player to avoid useless error outputs + msgOut += errorMsg.str(); + continue; } //Check player height - if ( ((player.height - heightMod) <= heightManlet) ) + if (((player.height - heightMod) <= heightManlet)) { numManlet++; - cardLimit += manletCardBonus; //Manlets get a bonus card - if (countA > 1) cardLimit += manletPosBonus; //Manlets get a bonus double A position + cardMod += manletCardBonus; //Manlets get a bonus card + allowedAPostions++; //Manlets get a bonus double A position weakFootUse = manletWeakFootUse; //Manlets get weak foot acc/use 4/4 weakFootAcc = manletWeakFootAcc; } @@ -622,73 +588,84 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay errorMsg << _T("Illegal height (") << player.height << _T(" cm); "); } - //Check weak foot ratings - if (player.weak_use + 1 > weakFootUse) + if (player.form + 1 != allowedForm) { errorTot++; - errorMsg << _T("Weak foot usage > ") << weakFootUse << _T("; "); + errorMsg << _T("\tForm is ") << player.form + 1 << _T(", should be ") << allowedForm << _T(";\r\n"); } - if (player.weak_acc + 1 > weakFootAcc) + + //Check injury resistance + if (player.injury + 1 > allowedInjResist) { errorTot++; - errorMsg << _T("Weak foot accuracy > ") << weakFootAcc << _T("; "); + errorMsg << _T("\tInjury resist is ") << player.injury + 1 << _T(", should be ") << allowedInjResist << _T(";\r\n"); } - //Check player card count - if (cardCount > cardLimit) + //Check weak foot ratings + if (player.weak_use + 1 > weakFootUse) { errorTot++; - errorMsg << _T("Has ") << cardCount << _T(" cards, only allowed ") << cardLimit << _T("; "); + errorMsg << _T("\tWeak foot usage > ") << weakFootUse << _T(";\r\n"); } - - //Check PES skill card limit of 10 - if(cardCount-numCom > 10) + if (player.weak_acc + 1 > weakFootAcc) { - errorTot++; - errorMsg << _T("Has ") << cardCount-numCom << _T(" skill cards, PES limit is 10, please swap to COM cards or trade for additional A positions; "); + errorTot++; + errorMsg << _T("\tWeak foot accuracy > ") << weakFootAcc << _T(";\r\n"); } - if (eCheck) + //If more than allowed A positions, 1 card less for each + if (countA > allowedAPostions) cardMod -= (countA - allowedAPostions); + + //Count cards + cardMod += min(allowedTricks, numTrick); + cardMod += min(allowedComs, numCom); + cardLimit = allowedSkills + cardMod; + + //Check player card count + if (cardCount > cardLimit) { - if (cardCount < min(cardLimit,10)) errorMsg << _T("WARN: Has ") << cardCount << _T(" cards, allowed ") << cardLimit << _T("; "); - if (player.weak_use + 1 < weakFootUse) errorMsg << _T("WARN: Has weak usage ") << player.weak_use + 1 << _T(", allowed ") << weakFootUse << _T("; "); - if (player.weak_acc + 1 < weakFootAcc) errorMsg << _T("WARN: Has weak accuracy ") << player.weak_acc + 1 << _T(", allowed ") << weakFootAcc << _T("; "); + errorTot++; + errorMsg << _T("\tHas ") << cardCount - numTrick << _T(" cards, only allowed ") << cardLimit - numTrick << _T(";\r\n"); } - //Check player overall rating - if (rating != targetRate) + if (useSuggestions) { - errorTot++; - errorMsg << _T("Illegal Ability scores; "); + if (cardCount < cardLimit) errorMsg << _T("\tWARN: Has ") << cardCount << _T(" cards, allowed ") << cardLimit << _T(";\r\n"); + if (numTrick < allowedTricks) errorMsg << _T("\tWARN: Has ") << numTrick << _T(" trick cards, allowed ") << allowedTricks << _T(";\r\n"); + if (numCom < allowedComs) errorMsg << _T("\tWARN: Has ") << numCom << _T(" COM cards, allowed ") << allowedComs << _T(";\r\n"); + if (player.injury + 1 < allowedInjResist) errorMsg << _T("\tWARN: Has inj resist") << player.injury + 1 << _T(", allowed ") << allowedInjResist << _T(";\r\n"); + if (player.weak_use + 1 < weakFootUse) errorMsg << _T("\tWARN: Has weak usage ") << player.weak_use + 1 << _T(", allowed ") << weakFootUse << _T(";\r\n"); + if (player.weak_acc + 1 < weakFootAcc) errorMsg << _T("\tWARN: Has weak accuracy ") << player.weak_acc + 1 << _T(", allowed ") << weakFootAcc << _T(";\r\n"); + if (countA < allowedAPostions) errorMsg << _T("\tWARN; Has ") << countA << _T(" A positions, allowed ") << allowedAPostions << _T(";\r\n"); } //Check individual skill ratings // c_skillRate s_skillName n_minPesVersion n_targetRate - skillCheck skillChecks[25] = { {player.drib, _T("Dribbling"), 0, targetRate }, - {player.gk, _T("Goalkeeping"), 0, targetRate }, - {player.finish, _T("Finishing"), 0, targetRate }, - {player.lowpass, _T("Low Pass"), 0, targetRate }, - {player.loftpass, _T("Lofted Pass"), 0, targetRate }, - {player.header, _T("Header"), 0, targetRate }, - {player.swerve, _T("Swerve"), 0, targetRate }, - {player.catching, _T("Catching"), 0, targetRate }, - {player.clearing, _T("Clearing"), 16, targetRate }, - {player.reflex, _T("Reflexes"), 16, targetRate }, - {player.body_ctrl, _T("Body Control"), 0, targetRate }, - {player.phys_cont, _T("Physical Contact"), 17, targetRate }, - {player.kick_pwr, _T("Kicking Power"), 0, targetRate }, - {player.exp_pwr, _T("Explosive Power"), 0, targetRate }, - {player.ball_ctrl, _T("Ball Control"), 0, targetRate }, - {player.ball_win, _T("Ball Winning"), 0, targetRate }, - {player.jump, _T("Jump"), 0, targetRate }, - {player.cover, _T("Coverage"), 16, targetRate }, - {player.place_kick, _T("Place Kicking"), 0, targetRate }, - {player.stamina, _T("Stamina"), 0, targetRate3 }, - {player.speed, _T("Speed"), 0, targetRate }, - {player.atk, _T("Attacking Prowess"), 0, targetRate }, - {player.def, _T("Defensive Prowess"), 0, targetRate2 }, - {player.tight_pos, _T("Tight Possession"), 20, targetRate }, - {player.aggres, _T("Aggression"), 20, targetRate } }; + skillCheck skillChecks[25] = { {player.drib, _T("Dribbling"), 0, (targetDrib == 0) ? targetRate : (targetDrib + statMod) }, + {player.gk, _T("Goalkeeping"), 0, (targetGk == 0) ? targetRate : (targetGk + statMod) }, + {player.finish, _T("Finishing"), 0, (targetFinish == 0) ? targetRate : (targetFinish + statMod) }, + {player.lowpass, _T("Low Pass"), 0, (targetLowPass == 0) ? targetRate : (targetLowPass + statMod) }, + {player.loftpass, _T("Lofted Pass"), 0, (targetLoftPass == 0) ? targetRate : (targetLoftPass + statMod) }, + {player.header, _T("Header"), 0, (targetHeader == 0) ? targetRate : (targetHeader + statMod) }, + {player.swerve, _T("Swerve"), 0, (targetSwerve == 0) ? targetRate : (targetSwerve + statMod) }, + {player.catching, _T("Catching"), 0, (targetCatching == 0) ? targetRate : (targetCatching + statMod) }, + {player.clearing, _T("Clearing"), 16, (targetClearing == 0) ? targetRate : (targetClearing + statMod) }, + {player.reflex, _T("Reflexes"), 16, (targetReflex == 0) ? targetRate : (targetReflex + statMod) }, + {player.body_ctrl, _T("Body Control"), 0, (targetBodyCtrl == 0) ? targetRate : (targetBodyCtrl + statMod) }, + {player.phys_cont, _T("Physical Contact"), 17, (targetPhysCont == 0) ? targetRate : (targetPhysCont + statMod) }, + {player.kick_pwr, _T("Kicking Power"), 0, (targetKickPwr == 0) ? targetRate : (targetKickPwr + statMod) }, + {player.exp_pwr, _T("Explosive Power"), 0, (targetExpPwr == 0) ? targetRate : (targetExpPwr + statMod) }, + {player.ball_ctrl, _T("Ball Control"), 0, (targetBallCtrl == 0) ? targetRate : (targetBallCtrl + statMod) }, + {player.ball_win, _T("Ball Winning"), 0, (targetBallWin == 0) ? targetRate : (targetBallWin + statMod) }, + {player.jump, _T("Jump"), 0, (targetJump == 0) ? targetRate : (targetJump + statMod) }, + {player.cover, _T("Coverage"), 16, (targetCover == 0) ? targetRate : (targetCover + statMod) }, + {player.place_kick, _T("Place Kicking"), 0, (targetPlcKick == 0) ? targetRate : (targetPlcKick + statMod) }, + {player.stamina, _T("Stamina"), 0, (targetStamina == 0) ? targetRate : (targetStamina + statMod) }, + {player.speed, _T("Speed"), 0, (targetSpeed == 0) ? targetRate : (targetSpeed + statMod) }, + {player.atk, _T("Attacking Prowess"), 0, (targetAtkProw == 0) ? targetRate : (targetAtkProw + statMod) }, + {player.def, _T("Defensive Prowess"), 0, (targetDefProw == 0) ? targetRate : (targetDefProw + statMod) }, + {player.tight_pos, _T("Tight Possession"), 20, (targetTightPos == 0) ? targetRate : (targetTightPos + statMod) }, + {player.aggres, _T("Aggression"), 20, (targetAggres == 0) ? targetRate : (targetAggres + statMod) } }; for (int ii = 0; ii < 25; ii++) { @@ -698,23 +675,18 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay if (skillChecks[ii].n_minPesVersion <= pesVersion && skillChecks[ii].c_skillRate > skillChecks[ii].n_targetRate) { errorTot++; - errorMsg << skillChecks[ii].s_skillName << _T(" is ") << skillChecks[ii].c_skillRate << _T(", should be <= ") << skillChecks[ii].n_targetRate << _T("; "); + errorMsg << _T("\t") << skillChecks[ii].s_skillName << _T(" is ") << skillChecks[ii].c_skillRate << _T(", should be <= ") << skillChecks[ii].n_targetRate << _T(";\r\n"); } } - else if (skillChecks[ii].n_minPesVersion <= pesVersion && - skillChecks[ii].c_skillRate != skillChecks[ii].n_targetRate) + else if (skillChecks[ii].n_minPesVersion <= pesVersion && + skillChecks[ii].c_skillRate != skillChecks[ii].n_targetRate) { errorTot++; - errorMsg << skillChecks[ii].s_skillName << _T(" is ") << skillChecks[ii].c_skillRate << _T(", should be ") << skillChecks[ii].n_targetRate << _T("; "); + errorMsg << _T("\t") << skillChecks[ii].s_skillName << _T(" is ") << skillChecks[ii].c_skillRate << _T(", should be ") << skillChecks[ii].n_targetRate << _T(";\r\n"); } } - if(errorMsg.rdbuf()->in_avail()) - { - errorMsg << _T("\r\n"); - msgOut+=_T("\t"); - msgOut+=errorMsg.str(); - } + if (errorMsg.rdbuf()->in_avail()) msgOut += errorMsg.str(); } //Team level errors int diff; @@ -723,20 +695,22 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay if (!hasCaptain) { errorTot++; - errorMsg << _T("Team must have an assigned Captain; "); + errorMsg << _T("\tTeam must have an assigned Captain;\r\n"); } + if (!captainHasCaptaincy && useSuggestions) errorMsg << _T("\tWARN: Captain does not have the free Captaincy card;\r\n"); + //Must have at least 1 GK if (numGK < 1) { errorTot++; - errorMsg << _T("Team must have a registered GK; "); + errorMsg << _T("\tTeam must have a registered GK;\r\n"); } - //Check heights - if(!usingRed) //Using Green height system - { - msgOut+=_T("Using Green height system\r\n"); + //Check heights + if (!usingRed) //Using Green height system + { + msgOut += _T("Using Green height system\r\n"); if (diff = greenGiga - numGiga) { if (diff > 0) @@ -747,135 +721,134 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay { errorTot -= diff; } - errorMsg << _T("Has ") << numGiga << _T("/") << greenGiga << _T(" ") << heightGiga << _T("cm players; "); - } - if(diff = greenGiant - numGiant) - { - if(diff>0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } - errorMsg << _T("Has ") << numGiant << _T("/") << greenGiant << _T(" ") << heightGiant << _T("cm players; "); - } - if(diff = greenTall - numTall) - { - if(diff>0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } - errorMsg << _T("Has ") << numTall << _T("/") << greenTall << _T(" ") << heightTall << _T("/") << heightTallGK << _T("cm players; "); - } - if(diff = greenMid - numMid) - { - if(diff>0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } - errorMsg << _T("Has ") << numMid << _T("/") << greenMid << _T(" ") << heightMid << _T("cm players; "); - } - if(diff = greenManlet - numManlet) - { - if(diff>0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } - errorMsg << _T("Has ") << numManlet << _T("/") << greenManlet << _T(" ") << heightManlet << _T("cm players; "); - } - } - else //Using Red height system - { - msgOut+=_T("Using Red height system\r\n"); + errorMsg << _T("\tHas ") << numGiga << _T("/") << greenGiga << _T(" ") << heightGiga << _T("cm players;\r\n"); + } + if (diff = greenGiant - numGiant) + { + if (diff > 0) + { + errorTot += diff; + } + else + { + errorTot -= diff; + } + errorMsg << _T("\tHas ") << numGiant << _T("/") << greenGiant << _T(" ") << heightGiant << _T("cm players;\r\n"); + } + if (diff = greenTall - numTall) + { + if (diff > 0) + { + errorTot += diff; + } + else + { + errorTot -= diff; + } + errorMsg << _T("\tHas ") << numTall << _T("/") << greenTall << _T(" ") << heightTall << _T("/") << heightTallGK << _T("cm players;\r\n"); + } + if (diff = greenMid - numMid) + { + if (diff > 0) + { + errorTot += diff; + } + else + { + errorTot -= diff; + } + errorMsg << _T("\tHas ") << numMid << _T("/") << greenMid << _T(" ") << heightMid << _T("cm players;\r\n"); + } + if (diff = greenManlet - numManlet) + { + if (diff > 0) + { + errorTot += diff; + } + else + { + errorTot -= diff; + } + errorMsg << _T("\tHas ") << numManlet << _T("/") << greenManlet << _T(" ") << heightManlet << _T("cm players;\r\n"); + } + } + else //Using Red height system + { + msgOut += _T("Using Red height system\r\n"); if (diff = numGiga) { errorTot += diff; - errorMsg << _T("Has ") << numGiga << _T("/") << redGiga << _T(" ") << heightGiga << _T("cm players; "); - } - if(diff = numGiant) - { - errorTot += diff; - errorMsg << _T("Has ") << numGiant << _T("/") << redGiant << _T(" ") << heightGiant << _T("cm players; "); - } - if(diff = redTall - numTall) - { - if(diff>0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } - errorMsg << _T("Has ") << numTall << _T("/") << redTall << _T(" ") << heightTall << _T("/") << heightTallGK << _T("cm players; "); - } - if(diff = redMid - numMid) - { - if(diff>0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } - errorMsg << _T("Has ") << numMid << _T("/") << redMid << _T(" ") << heightMid << _T("cm players; "); - } - if(diff = redManlet - numManlet) - { - if(diff>0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } - errorMsg << _T("Has ") << numManlet << _T("/") << redManlet << _T(" ") << heightManlet << _T("cm players; "); - } - } - if(errorMsg.rdbuf()->in_avail()) + errorMsg << _T("\tHas ") << numGiga << _T("/") << redGiga << _T(" ") << heightGiga << _T("cm players;\r\n"); + } + if (diff = numGiant) + { + errorTot += diff; + errorMsg << _T("\tHas ") << numGiant << _T("/") << redGiant << _T(" ") << heightGiant << _T("cm players;\r\n"); + } + if (diff = redTall - numTall) + { + if (diff > 0) + { + errorTot += diff; + } + else + { + errorTot -= diff; + } + errorMsg << _T("\tHas ") << numTall << _T("/") << redTall << _T(" ") << heightTall << _T("/") << heightTallGK << _T("cm players;\r\n"); + } + if (diff = redMid - numMid) + { + if (diff > 0) + { + errorTot += diff; + } + else + { + errorTot -= diff; + } + errorMsg << _T("\tHas ") << numMid << _T("/") << redMid << _T(" ") << heightMid << _T("cm players;\r\n"); + } + if (diff = redManlet - numManlet) + { + if (diff > 0) + { + errorTot += diff; + } + else + { + errorTot -= diff; + } + errorMsg << _T("\tHas ") << numManlet << _T("/") << redManlet << _T(" ") << heightManlet << _T("cm players;\r\n"); + } + } + if (errorMsg.rdbuf()->in_avail()) { errorMsg << _T("\r\n"); - msgOut+=errorMsg.str(); + msgOut += errorMsg.str(); errorMsg.clear(); errorMsg.str(tstring()); } - - //Check ability stats - if(numReg != (23-reqNumSilver-reqNumGold)) - { - errorTot++; - errorMsg << _T("Number of Regular players is ") << numReg << _T(", should be ") << 23-reqNumSilver-reqNumGold << _T("; "); - } - if(numSilver != reqNumSilver) - { - errorTot++; - errorMsg << _T("Number of Silver medals is ") << numSilver << _T(", should be ") << reqNumSilver << _T("; "); - } - if(numGold != reqNumGold) - { - errorTot++; - errorMsg << _T("Number of Gold medals is ") << numGold << _T(", should be ") << reqNumGold << _T("; "); - } - if(errorMsg.rdbuf()->in_avail()) - errorMsg << _T("\r\n"); + + //Check ability stats + if (numReg != regular::count) + { + errorTot++; + errorMsg << _T("\tNumber of Regular players is ") << numReg << _T(", should be ") << regular::count << _T(";\r\n"); + } + if (numSilver != silver::count) + { + errorTot++; + errorMsg << _T("\tNumber of Silver medals is ") << numSilver << _T(", should be ") << silver::count << _T(";\r\n"); + } + if (numGold != gold::count) + { + errorTot++; + errorMsg << _T("\tNumber of Gold medals is ") << numGold << _T(", should be ") << gold::count << _T(";\r\n"); + } + if (errorMsg.rdbuf()->in_avail()) errorMsg << _T("\r\n"); errorMsg << _T("\r\nErrors: ") << errorTot << _T("\r\n"); - msgOut+=errorMsg.str(); + msgOut += errorMsg.str(); SetWindowText(GetDlgItem(hAatfbox, IDT_AATFOUT), msgOut.c_str()); if(errorTot) diff --git a/aatf.h b/aatf.h index 95521c9..1ddce6b 100755 --- a/aatf.h +++ b/aatf.h @@ -1,65 +1,223 @@ #pragma once -//============================ -//Settings -extern int manletBonus; -extern int silverManletBonus; -extern int goldManletBonus; -extern int silverGiantPen; -extern int goldGiantPen; +//this file is meant to make updating the editor for stat changes exceedingly simple. +//stats use pes21 names +//stats that are listed as 0 will be replaced with the base_stat value in the editor. +namespace gold { //gold stats + const int count = 2; //number of this type of player allowed + const int form = 8; + const int injury_resistance = 3; + const int weak_foot_usage = 2; + const int weak_foot_accuracy = 4; + const int skills = 5; //max number of non free skills allowed + const int tricks = 3; //max number of trick cards allowed + const int coms = 2; //free coms allowed + const int a_pos = 1; //free a positions allowed, note this includes the A position that a registered position gives -extern int goldRate; -extern int silverRate; -extern int regRate; -extern int gkRate; -extern int reqNumGold; -extern int reqNumSilver; + const int base_stat = 99; //base stat value used if no changes. if a stat below is set at 0, this value will be used. + const int manlet_buff = 0; //if running red bracket, buff by this amount + const int height_nerf = 0; //if running green bracket, nerf by this amount + const int offensive_awareness = 0; + const int ball_control = 0; + const int dribbling = 0; + const int low_pass = 0; + const int lofted_pass = 0; + const int finishing = 0; + const int place_kicking = 0; + const int curl = 0; + const int header = 0; + const int defensive_awareness = 0; + const int ball_winning = 0; + const int kicking_power = 0; + const int speed = 0; + const int acceleration = 0; + const int balance = 0; + const int physical_contact = 0; + const int jump = 0; + const int stamina = 0; + const int gk_awareness = 0; + const int catching = 0; + const int clearing = 0; + const int reflexes = 0; + const int gk_reach = 0; + const int tight_possession = 0; + const int aggression = 0; + const int stat_array[] = { offensive_awareness, ball_control, dribbling, low_pass, lofted_pass, finishing, place_kicking, curl, header, defensive_awareness, + ball_winning, kicking_power, speed, acceleration, balance, physical_contact, jump, stamina, gk_awareness, catching, clearing, reflexes, gk_reach, + tight_possession, aggression }; -extern int goldForm; -extern int silverForm; -extern int regForm; +} +namespace silver { //silver stats + const int count = 2; //number of this type of player allowed + const int form = 8; + const int injury_resistance = 3; + const int weak_foot_usage = 2; + const int weak_foot_accuracy = 4; + const int skills = 4; //max number of non free skills allowed + const int tricks = 3; //max number of trick cards allowed + const int coms = 1; //free coms allowed + const int a_pos = 2; //free a positions allowed, note this includes the A position that a registered position gives -extern int goldIR; //Injury resistence -extern int silverIR; -extern int regIR; + const int base_stat = 88; //base stat value used if no changes. if a stat below is set at 0, this value will be used. + const int manlet_buff = 0; //if running red bracket, buff by this amount + const int height_nerf = 0; //if running green bracket, nerf by this amount + const int offensive_awareness = 0; + const int ball_control = 0; + const int dribbling = 0; + const int low_pass = 0; + const int lofted_pass = 0; + const int finishing = 0; + const int place_kicking = 0; + const int curl = 0; + const int header = 0; + const int defensive_awareness = 0; + const int ball_winning = 0; + const int kicking_power = 0; + const int speed = 0; + const int acceleration = 0; + const int balance = 0; + const int physical_contact = 0; + const int jump = 0; + const int stamina = 0; + const int gk_awareness = 0; + const int catching = 0; + const int clearing = 0; + const int reflexes = 0; + const int gk_reach = 0; + const int tight_possession = 0; + const int aggression = 0; + const int stat_array[] = { offensive_awareness, ball_control, dribbling, low_pass, lofted_pass, finishing, place_kicking, curl, header, defensive_awareness, + ball_winning, kicking_power, speed, acceleration, balance, physical_contact, jump, stamina, gk_awareness, catching, clearing, reflexes, gk_reach, + tight_possession, aggression }; +} +namespace regular { //regular player stats + const int count = 19; //number of this type of player allowed + const int form = 4; + const int injury_resistance = 1; + const int weak_foot_usage = 2; + const int weak_foot_accuracy = 4; + const int skills = 3; //max number of non free skills allowed + const int tricks = 2; //max number of trick cards allowed + const int coms = 1; //free coms allowed + const int a_pos = 1; //free a positions allowed, note this includes the A position that a registered position gives -extern int goldWeakFootUse; -extern int silverWeakFootUse; -extern int regWeakFootUse; + const int base_stat = 77; //base stat value used if no changes. if a stat below is set at 0, this value will be used. + const int manlet_buff = 5; //if running red bracket, buff by this amount + const int height_nerf = 0; //if running green bracket, nerf by this amount + const int offensive_awareness = 0; + const int ball_control = 0; + const int dribbling = 0; + const int low_pass = 0; + const int lofted_pass = 0; + const int finishing = 0; + const int place_kicking = 0; + const int curl = 0; + const int header = 0; + const int defensive_awareness = 0; + const int ball_winning = 0; + const int kicking_power = 0; + const int speed = 0; + const int acceleration = 0; + const int balance = 0; + const int physical_contact = 0; + const int jump = 0; + const int stamina = 0; + const int gk_awareness = 0; + const int catching = 0; + const int clearing = 0; + const int reflexes = 0; + const int gk_reach = 0; + const int tight_possession = 0; + const int aggression = 0; + const int stat_array[] = { offensive_awareness, ball_control, dribbling, low_pass, lofted_pass, finishing, place_kicking, curl, header, defensive_awareness, + ball_winning, kicking_power, speed, acceleration, balance, physical_contact, jump, stamina, gk_awareness, catching, clearing, reflexes, gk_reach, + tight_possession, aggression }; +} +namespace goalkeeper { + const int count = 1; //it counts against regulars, it doesn't matter + const int form = 4; + const int injury_resistance = 1; + const int weak_foot_usage = 2; + const int weak_foot_accuracy = 4; + const int skills = 2; //max number of non free skills allowed + const int tricks = 0; //max number of trick cards allowed + const int coms = 0; //free coms allowed + const int a_pos = 1; //free a positions allowed, note this includes the A position that a registered position gives -extern int goldWeakFootAcc; -extern int silverWeakFootAcc; -extern int regWeakFootAcc; + const int base_stat = 77; //base stat value used if no changes. if a stat below is set at 0, this value will be used. + const int manlet_buff = 5; //if running red bracket, buff by this amount + const int height_nerf = 0; //if running green bracket, nerf by this amount + const int offensive_awareness = 0; + const int ball_control = 0; + const int dribbling = 0; + const int low_pass = 0; + const int lofted_pass = 0; + const int finishing = 0; + const int place_kicking = 0; + const int curl = 0; + const int header = 0; + const int defensive_awareness = 0; + const int ball_winning = 0; + const int kicking_power = 0; + const int speed = 0; + const int acceleration = 0; + const int balance = 0; + const int physical_contact = 0; + const int jump = 0; + const int stamina = 0; + const int gk_awareness = 0; + const int catching = 0; + const int clearing = 0; + const int reflexes = 0; + const int gk_reach = 0; + const int tight_possession = 0; + const int aggression = 0; + const int stat_array[] = { offensive_awareness, ball_control, dribbling, low_pass, lofted_pass, finishing, place_kicking, curl, header, defensive_awareness, + ball_winning, kicking_power, speed, acceleration, balance, physical_contact, jump, stamina, gk_awareness, catching, clearing, reflexes, gk_reach, + tight_possession, aggression }; -extern int gkSkillCards; -extern int regSkillCards; -extern int silverSkillCards; -extern int goldSkillCards; - -extern int gkTrickCards; -extern int regTrickCards; -extern int silverTrickCards; -extern int goldTrickCards; - -extern int regCOM; -extern int silverCOM; -extern int goldCOM; - -extern int greenGiga; -extern int greenGiant; -extern int greenTall; -extern int greenMid; -extern int greenManlet; - -extern int redGiga; -extern int redGiant; -extern int redTall; -extern int redMid; -extern int redManlet; - -extern int heightGiga; -extern int heightGiant; -extern int heightTall; -extern int heightTallGK; -extern int heightMid; -extern int heightManlet; +} +/* +namespace blank_example { //has all stats 0'd out for easier removal of stat changes + const int count = 0; //number of this type of player allowed + const int form = 0; + const int injury_resistance = 0; + const int weak_foot_usage = 0; + const int weak_foot_accuracy = 0; + const int skills = 0; //max number of non free skills allowed + const int tricks = 0; //max number of trick cards allowed + const int coms = 0; //free coms allowed + const int a_pos = 0; //free a positions allowed, note this includes the A position that a registered position gives + const int base_stat = 0; //base stat value used if no changes. if a stat below is set at 0, this value will be used. + const int manlet_buff = 5; //if running red bracket, buff by this amount + const int height_nerf = 0; //if running green bracket, nerf by this amount + const int offensive_awareness = 0; + const int ball_control = 0; + const int dribbling = 0; + const int low_pass = 0; + const int lofted_pass = 0; + const int finishing = 0; + const int place_kicking = 0; + const int curl = 0; + const int header = 0; + const int defensive_awareness = 0; + const int ball_winning = 0; + const int kicking_power = 0; + const int speed = 0; + const int acceleration = 0; + const int balance = 0; + const int physical_contact = 0; + const int jump = 0; + const int stamina = 0; + const int gk_awareness = 0; + const int catching = 0; + const int clearing = 0; + const int reflexes = 0; + const int gk_reach = 0; + const int tight_possession = 0; + const int aggression = 0; + const int stat_array[] = { offensive_awareness, ball_control, dribbling, low_pass, lofted_pass, finishing, place_kicking, curl, header, defensive_awareness, + ball_winning, kicking_power, speed, acceleration, balance, physical_contact, jump, stamina, gk_awareness, catching, clearing, reflexes, gk_reach, + tight_possession, aggression }; +} +*/ \ No newline at end of file diff --git a/editor.h b/editor.h index 2121287..578960a 100644 --- a/editor.h +++ b/editor.h @@ -737,7 +737,7 @@ void extract_team_info21(team_entry, int&, void*); void extract_teamplayer_info20(team_entry, int &, void*); void extract_team_tactics20(team_entry, int &, void*); -void aatf_single(HWND, int, int, player_entry*, team_entry*, int); +void aatf_single(HWND, int, int, player_entry*, team_entry*, int, bool); void save_comparator(HWND, int, player_entry*, int, team_entry*, int, TCHAR*, void*); diff --git a/main.cpp b/main.cpp index 889681e..da728ca 100644 --- a/main.cpp +++ b/main.cpp @@ -103,6 +103,7 @@ int gnum_players, gnum_teams, gn_listsel=-1, gn_teamsel=-1, gn_forceupdate=-1; bool gb_forceupdate = false; bool gb_firstsave = true; bool gb_importStats = true, gb_importAes = true; //Squad import options +bool useSuggestions = false; int gn_oldysize = 642; int g_prevx=0; int giPesVersion = 0; @@ -889,21 +890,25 @@ LRESULT CALLBACK wnd_proc(HWND H, UINT M, WPARAM W, LPARAM L) { if(HIWORD(W)==BN_CLICKED) { - _itow_s(goldRate, buffer, 3, 10); - for(int ii=IDT_ABIL_ATKP;ii -1) { + useSuggestions = false; update_tables(); ShowWindow(ghAatfbox, SW_SHOW); - aatf_single(ghAatfbox, giPesVersion, gn_teamsel, gplayers, gteams, gnum_players); + aatf_single(ghAatfbox, giPesVersion, gn_teamsel, gplayers, gteams, gnum_players, useSuggestions); } else MessageBox(H,_T("Please select a team to check."),NULL,MB_ICONWARNING); } break; + case IDM_DATA_AATFC_SUG: //Run AATF on currently-selected team and show results in a dialog box + { + if (gn_teamsel > -1) + { + useSuggestions = true; + update_tables(); + ShowWindow(ghAatfbox, SW_SHOW); + aatf_single(ghAatfbox, giPesVersion, gn_teamsel, gplayers, gteams, gnum_players, useSuggestions); + } + else MessageBox(H, _T("Please select a team to check."), NULL, MB_ICONWARNING); + } + break; case IDM_DATA_AATFS: //Run AATF on teams selected from a list { if(ghdescriptor) { + useSuggestions = false; + update_tables(); + DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_AATF_SEL), H, aatf_sel_dlg_proc); + } + } + break; + case IDM_DATA_AATFS_SUG: //Run AATF on teams selected from a list + { + if (ghdescriptor) + { + useSuggestions = true; update_tables(); DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_AATF_SEL), H, aatf_sel_dlg_proc); } @@ -5679,7 +5713,7 @@ BOOL CALLBACK aatf_mult_dlg_proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM { case WM_INITDIALOG: { - aatf_single(hwnd, giPesVersion, lParam, gplayers, gteams, gnum_players); + aatf_single(hwnd, giPesVersion, lParam, gplayers, gteams, gnum_players, useSuggestions); SetFocus(GetDlgItem(hwnd,IDB_AATFOK)); } break; diff --git a/resource.h b/resource.h index 2683633..081ff99 100644 --- a/resource.h +++ b/resource.h @@ -426,9 +426,11 @@ #define IDD_AATF 2000 #define IDT_AATFOUT 2001 #define IDM_DATA_AATFC 2002 -#define IDM_DATA_AATFS 2003 -#define IDB_AATFOK 2004 -#define IDM_DATA_COMPE 2005 +#define IDM_DATA_AATFC_SUG 2003 +#define IDM_DATA_AATFS 2004 +#define IDM_DATA_AATFS_SUG 2005 +#define IDB_AATFOK 2006 +#define IDM_DATA_COMPE 2007 #define IDD_AATF_SEL 2100 #define IDC_AATF_SEL 2101 diff --git a/resource.rc b/resource.rc index ddcb46e..0e397a6 100644 --- a/resource.rc +++ b/resource.rc @@ -60,7 +60,9 @@ BEGIN POPUP "&AATF" BEGIN MENUITEM "&Current Team", IDM_DATA_AATFC - MENUITEM "&Select Teams", IDM_DATA_AATFS //, GRAYED + MENUITEM "&Current Team w/ suggestions", IDM_DATA_AATFC_SUG + MENUITEM "&Select Teams", IDM_DATA_AATFS + MENUITEM "&Select Teams w/ suggestions", IDM_DATA_AATFS_SUG MENUITEM "Compare &EDITs", IDM_DATA_COMPE END MENUITEM "&Output rosters to TSV", IDM_DATA_OUTPUT From a67237e57119a19069e4fd63b2d7570500a23bf3 Mon Sep 17 00:00:00 2001 From: Giovani1906 <4cc.giovani1906@gmail.com> Date: Sat, 14 Mar 2026 21:12:55 +0100 Subject: [PATCH 2/5] Change how cards are calculated in order to provide better error messages Add back the 10 card limit check Change some variable names to be shorter Fix some minor oversight in aatf.h --- aatf.cpp | 189 ++++++++++++++++++++++++++++--------------------------- aatf.h | 4 +- 2 files changed, 98 insertions(+), 95 deletions(-) diff --git a/aatf.cpp b/aatf.cpp index e24c18a..8660a04 100644 --- a/aatf.cpp +++ b/aatf.cpp @@ -131,22 +131,19 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay tstringstream errorMsg; - int cardCount = 0; - int cardMod = 0; - int cardLimit = 0; int heightMod = 0; int statMod = 0; bool hasTrick = false; // Form, Injury Resist and Weak Foot - int allowedForm = 0; - int allowedInjResist = 0; - int allowedAPostions = 0; + int reqForm = 0; + int reqInjResist = 0; + int reqAPos = 0; int weakFootUse = 0; int weakFootAcc = 0; // Cards - int allowedSkills = 0; - int allowedTricks = 0; - int allowedComs = 0; + int reqSkill = 0; + int reqTrick = 0; + int reqCom = 0; // Individual Stat Comparison int targetRate = 0; int targetDrib = 0; @@ -218,9 +215,6 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay errorMsg << _T("\tDoesn't have A in registered position;\r\n"); } - //Count number of registered GKs - if (player.reg_pos == 0) numGK++; - //Count A positions int countA = 0; int countB = 0; @@ -245,44 +239,6 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay errorMsg << _T("\tHas GK as second A position;\r\n"); } - //Count cards - int numTrick = 0; - int numCom = 0; - int numSkill; - if (pesVersion == 19) numSkill = 39; - else if (pesVersion > 19) numSkill = 41; - else numSkill = 28; - for (int jj = 0; jj < numSkill; jj++) - { - if (player.play_skill[jj]) - { - cardCount++; - //SPECIAL Winter/Spring 24: Malicia (21) is a free card - if (jj == 21) cardMod++; - //Captain gets free captaincy card - if (jj == 25 && player.id == gteams[teamSel].players[gteams[teamSel].captain_ind]) - { - captainHasCaptaincy = true; - cardMod++; - } - //Trick cards may be free, count number - if (jj < 6 || jj == 16 || jj == 28 || jj == 29 || jj == 30 || jj == 34) - { - hasTrick = true; - numTrick++; - } - } - } - - for (int jj = 0; jj < 7; jj++) - { - if (player.com_style[jj]) - { - cardCount++; - numCom++; - } - } - if (player.age < 15 || player.age>50) { errorTot++; @@ -329,18 +285,19 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay /* GOALKEEPER */ if (player.reg_pos == 0) //Goalkeeper player, counts towards regular { + numGK++; numReg++; using namespace goalkeeper; - allowedInjResist = injury_resistance; - allowedForm = form; - allowedAPostions = a_pos; + reqAPos = a_pos; + reqForm = form; + reqInjResist = injury_resistance; weakFootUse = weak_foot_usage; weakFootAcc = weak_foot_accuracy; - allowedTricks = tricks; - allowedComs = coms; - allowedSkills = skills; + reqSkill = skills; + reqTrick = tricks; + reqCom = coms; targetRate = base_stat; targetDrib = dribbling; @@ -386,15 +343,15 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay numReg++; using namespace regular; - allowedInjResist = injury_resistance; - allowedForm = form; - allowedAPostions = a_pos; + reqAPos = a_pos; + reqForm = form; + reqInjResist = injury_resistance; weakFootUse = weak_foot_usage; weakFootAcc = weak_foot_accuracy; - allowedTricks = tricks; - allowedComs = coms; - allowedSkills = skills; + reqSkill = skills; + reqTrick = tricks; + reqCom = coms; targetRate = base_stat; targetDrib = dribbling; @@ -440,15 +397,15 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay numSilver++; using namespace silver; - allowedInjResist = injury_resistance; - allowedForm = form; - allowedAPostions = a_pos; + reqAPos = a_pos; + reqForm = form; + reqInjResist = injury_resistance; weakFootUse = weak_foot_usage; weakFootAcc = weak_foot_accuracy; - allowedTricks = tricks; - allowedComs = coms; - allowedSkills = skills; + reqSkill = skills; + reqTrick = tricks; + reqCom = coms; targetRate = base_stat; targetDrib = dribbling; @@ -499,15 +456,15 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay numGold++; using namespace gold; - allowedInjResist = injury_resistance; - allowedForm = form; - allowedAPostions = a_pos; + reqAPos = a_pos; + reqForm = form; + reqInjResist = injury_resistance; weakFootUse = weak_foot_usage; weakFootAcc = weak_foot_accuracy; - allowedTricks = tricks; - allowedComs = coms; - allowedSkills = skills; + reqSkill = skills; + reqTrick = tricks; + reqCom = coms; targetRate = base_stat; targetDrib = dribbling; @@ -561,12 +518,56 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay continue; } + //Count cards + int numSkill = 0; + int numTrick = 0; + int numCom = 0; + int cardCount; + if (pesVersion > 19) cardCount = 41; + else if (pesVersion == 19) cardCount = 39; + else cardCount = 28; + for (int jj = 0; jj < cardCount; jj++) + { + if (player.play_skill[jj]) + { + //SPECIAL Winter/Spring 24: Malicia (21) is a free card + if (jj == 21) + { + numSkill++; + reqSkill++; + } + //Captain gets free captaincy card + else if (jj == 25 && player.id == gteams[teamSel].players[gteams[teamSel].captain_ind]) + { + captainHasCaptaincy = true; + numSkill++; + reqSkill++; + } + //Trick cards may be free, count number + else if ((jj < 6 || jj == 16 || jj == 28 || jj == 29 || jj == 30 || jj == 34) && numTrick < reqTrick) + { + hasTrick = true; + numTrick++; + } + else numSkill++; + } + } + + for (int jj = 0; jj < 7; jj++) + { + if (player.com_style[jj]) + { + if (numCom < reqCom) numCom++; + else numSkill++; + } + } + //Check player height if (((player.height - heightMod) <= heightManlet)) { numManlet++; - cardMod += manletCardBonus; //Manlets get a bonus card - allowedAPostions++; //Manlets get a bonus double A position + reqSkill += manletCardBonus; //Manlets get a bonus card + reqAPos++; //Manlets get a bonus double A position weakFootUse = manletWeakFootUse; //Manlets get weak foot acc/use 4/4 weakFootAcc = manletWeakFootAcc; } @@ -588,17 +589,17 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay errorMsg << _T("Illegal height (") << player.height << _T(" cm); "); } - if (player.form + 1 != allowedForm) + if (player.form + 1 != reqForm) { errorTot++; - errorMsg << _T("\tForm is ") << player.form + 1 << _T(", should be ") << allowedForm << _T(";\r\n"); + errorMsg << _T("\tForm is ") << player.form + 1 << _T(", should be ") << reqForm << _T(";\r\n"); } //Check injury resistance - if (player.injury + 1 > allowedInjResist) + if (player.injury + 1 > reqInjResist) { errorTot++; - errorMsg << _T("\tInjury resist is ") << player.injury + 1 << _T(", should be ") << allowedInjResist << _T(";\r\n"); + errorMsg << _T("\tInjury resist is ") << player.injury + 1 << _T(", should be ") << reqInjResist << _T(";\r\n"); } //Check weak foot ratings @@ -614,29 +615,31 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay } //If more than allowed A positions, 1 card less for each - if (countA > allowedAPostions) cardMod -= (countA - allowedAPostions); - - //Count cards - cardMod += min(allowedTricks, numTrick); - cardMod += min(allowedComs, numCom); - cardLimit = allowedSkills + cardMod; + if (countA > reqAPos) reqSkill -= (countA - reqAPos); //Check player card count - if (cardCount > cardLimit) + if (numSkill > reqSkill) + { + errorTot++; + errorMsg << _T("\tHas ") << numSkill << _T(" skill cards, only allowed ") << reqSkill << _T(";\r\n"); + } + + //Check PES skill card limit of 10 + if (numSkill + numTrick > 10) { errorTot++; - errorMsg << _T("\tHas ") << cardCount - numTrick << _T(" cards, only allowed ") << cardLimit - numTrick << _T(";\r\n"); + errorMsg << _T("\tHas ") << numSkill + numTrick << _T(" cards, PES limit is 10, please swap to COM cards or trade for additional A positions;\r\n"); } if (useSuggestions) { - if (cardCount < cardLimit) errorMsg << _T("\tWARN: Has ") << cardCount << _T(" cards, allowed ") << cardLimit << _T(";\r\n"); - if (numTrick < allowedTricks) errorMsg << _T("\tWARN: Has ") << numTrick << _T(" trick cards, allowed ") << allowedTricks << _T(";\r\n"); - if (numCom < allowedComs) errorMsg << _T("\tWARN: Has ") << numCom << _T(" COM cards, allowed ") << allowedComs << _T(";\r\n"); - if (player.injury + 1 < allowedInjResist) errorMsg << _T("\tWARN: Has inj resist") << player.injury + 1 << _T(", allowed ") << allowedInjResist << _T(";\r\n"); + if (numSkill < reqSkill && numSkill + numTrick < 10) errorMsg << _T("\tWARN: Has ") << numSkill << _T(" skill cards, allowed ") << reqSkill << _T(";\r\n"); + if (numTrick < reqTrick && numSkill + numTrick < 10) errorMsg << _T("\tWARN: Has ") << numTrick << _T(" trick cards, allowed ") << reqTrick << _T(";\r\n"); + if (numCom < reqCom) errorMsg << _T("\tWARN: Has ") << numCom << _T(" COM cards, allowed ") << reqCom << _T(";\r\n"); + if (countA < reqAPos) errorMsg << _T("\tWARN; Has ") << countA << _T(" A positions, allowed ") << reqAPos << _T(";\r\n"); + if (player.injury + 1 < reqInjResist) errorMsg << _T("\tWARN: Has inj resist") << player.injury + 1 << _T(", allowed ") << reqInjResist << _T(";\r\n"); if (player.weak_use + 1 < weakFootUse) errorMsg << _T("\tWARN: Has weak usage ") << player.weak_use + 1 << _T(", allowed ") << weakFootUse << _T(";\r\n"); if (player.weak_acc + 1 < weakFootAcc) errorMsg << _T("\tWARN: Has weak accuracy ") << player.weak_acc + 1 << _T(", allowed ") << weakFootAcc << _T(";\r\n"); - if (countA < allowedAPostions) errorMsg << _T("\tWARN; Has ") << countA << _T(" A positions, allowed ") << allowedAPostions << _T(";\r\n"); } //Check individual skill ratings diff --git a/aatf.h b/aatf.h index 1ddce6b..9fd6455 100755 --- a/aatf.h +++ b/aatf.h @@ -55,7 +55,7 @@ namespace silver { //silver stats const int skills = 4; //max number of non free skills allowed const int tricks = 3; //max number of trick cards allowed const int coms = 1; //free coms allowed - const int a_pos = 2; //free a positions allowed, note this includes the A position that a registered position gives + const int a_pos = 1; //free a positions allowed, note this includes the A position that a registered position gives const int base_stat = 88; //base stat value used if no changes. if a stat below is set at 0, this value will be used. const int manlet_buff = 0; //if running red bracket, buff by this amount @@ -97,7 +97,7 @@ namespace regular { //regular player stats const int weak_foot_accuracy = 4; const int skills = 3; //max number of non free skills allowed const int tricks = 2; //max number of trick cards allowed - const int coms = 1; //free coms allowed + const int coms = 0; //free coms allowed const int a_pos = 1; //free a positions allowed, note this includes the A position that a registered position gives const int base_stat = 77; //base stat value used if no changes. if a stat below is set at 0, this value will be used. From 4bd7ae2217c6128362959e886b61ddfa47197c46 Mon Sep 17 00:00:00 2001 From: Giovani1906 <4cc.giovani1906@gmail.com> Date: Fri, 5 Jun 2026 18:15:19 +0200 Subject: [PATCH 3/5] Rebase and changes for the Spring rules --- aatf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aatf.h b/aatf.h index 9fd6455..4f895c8 100755 --- a/aatf.h +++ b/aatf.h @@ -47,7 +47,7 @@ namespace gold { //gold stats } namespace silver { //silver stats - const int count = 2; //number of this type of player allowed + const int count = 3; //number of this type of player allowed const int form = 8; const int injury_resistance = 3; const int weak_foot_usage = 2; @@ -90,7 +90,7 @@ namespace silver { //silver stats tight_possession, aggression }; } namespace regular { //regular player stats - const int count = 19; //number of this type of player allowed + const int count = 18; //number of this type of player allowed const int form = 4; const int injury_resistance = 1; const int weak_foot_usage = 2; @@ -143,7 +143,7 @@ namespace goalkeeper { const int coms = 0; //free coms allowed const int a_pos = 1; //free a positions allowed, note this includes the A position that a registered position gives - const int base_stat = 77; //base stat value used if no changes. if a stat below is set at 0, this value will be used. + const int base_stat = 74; //base stat value used if no changes. if a stat below is set at 0, this value will be used. const int manlet_buff = 5; //if running red bracket, buff by this amount const int height_nerf = 0; //if running green bracket, nerf by this amount const int offensive_awareness = 0; From 8a018e8e082aff14f30d23a8049cc90906b4867d Mon Sep 17 00:00:00 2001 From: Giovani1906 <4cc.giovani1906@gmail.com> Date: Tue, 16 Jun 2026 21:30:26 +0200 Subject: [PATCH 4/5] Add the option to prevent some stat brackets to use giant heights --- aatf.cpp | 80 +++++++++++++++++++++++++++----------------------------- aatf.h | 5 ++++ 2 files changed, 43 insertions(+), 42 deletions(-) diff --git a/aatf.cpp b/aatf.cpp index 8660a04..716df81 100644 --- a/aatf.cpp +++ b/aatf.cpp @@ -134,6 +134,10 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay int heightMod = 0; int statMod = 0; bool hasTrick = false; + // Height nerfs and buff + bool allowGreen = false; + int manletBuff = 0; + int heightNerf = 0; // Form, Injury Resist and Weak Foot int reqForm = 0; int reqInjResist = 0; @@ -289,6 +293,10 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay numReg++; using namespace goalkeeper; + allowGreen = allow_green; + manletBuff = manlet_buff; + heightNerf = height_nerf; + reqAPos = a_pos; reqForm = form; reqInjResist = injury_resistance; @@ -325,17 +333,6 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay targetDefProw = defensive_awareness; targetTightPos = tight_possession; targetAggres = aggression; - - if (player.height >= heightGiant) //HA get penalty - { - targetRate -= height_nerf; - statMod -= height_nerf; - } - else if (player.height <= heightManlet && usingRed) - { - targetRate += manlet_buff; - statMod += manlet_buff; - } } /* REGULAR */ else if (rating < (silver::base_stat - silver::height_nerf)) //Regular player @@ -343,6 +340,10 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay numReg++; using namespace regular; + allowGreen = allow_green; + manletBuff = manlet_buff; + heightNerf = height_nerf; + reqAPos = a_pos; reqForm = form; reqInjResist = injury_resistance; @@ -379,17 +380,6 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay targetDefProw = defensive_awareness; targetTightPos = tight_possession; targetAggres = aggression; - - if (player.height >= heightGiant) //HA get penalty - { - targetRate -= height_nerf; - statMod -= height_nerf; - } - else if (player.height <= heightManlet && usingRed) - { - targetRate += manlet_buff; - statMod += manlet_buff; - } } /* SILVER */ else if (rating < (gold::base_stat - gold::height_nerf)) //Silver player @@ -397,6 +387,10 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay numSilver++; using namespace silver; + allowGreen = allow_green; + manletBuff = manlet_buff; + heightNerf = height_nerf; + reqAPos = a_pos; reqForm = form; reqInjResist = injury_resistance; @@ -439,16 +433,6 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay errorTot++; errorMsg << _T("\tMedals cannot play as GK;\r\n"); } - if (player.height >= heightGiant) //HA get penalty - { - targetRate -= height_nerf; - statMod -= height_nerf; - } - else if (player.height <= heightManlet && usingRed) - { - targetRate += manlet_buff; - statMod += manlet_buff; - } } /* GOLD */ else if (rating == gold::base_stat || rating == (gold::base_stat - gold::height_nerf)) //Gold player @@ -456,6 +440,10 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay numGold++; using namespace gold; + allowGreen = allow_green; + manletBuff = manlet_buff; + heightNerf = height_nerf; + reqAPos = a_pos; reqForm = form; reqInjResist = injury_resistance; @@ -498,16 +486,6 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay errorTot++; errorMsg << _T("\tMedals cannot play as GK;\r\n"); } - if (player.height >= heightGiant) //HA get penalty - { - targetRate -= height_nerf; - statMod -= height_nerf; - } - else if (player.height <= heightManlet && usingRed) - { - targetRate += manlet_buff; - statMod += manlet_buff; - } } else { @@ -589,6 +567,24 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay errorMsg << _T("Illegal height (") << player.height << _T(" cm); "); } + if (player.height >= heightGiant) //HA get penalty + { + if (!allowGreen) + { + errorTot++; + errorMsg << _T("This player cannot be ") << heightGiant << _T("cm tall; "); + } + else { + targetRate -= heightNerf; + statMod -= heightNerf; + } + } + else if (player.height <= heightManlet && usingRed) + { + targetRate += manletBuff; + statMod += manletBuff; + } + if (player.form + 1 != reqForm) { errorTot++; diff --git a/aatf.h b/aatf.h index 4f895c8..f68f149 100755 --- a/aatf.h +++ b/aatf.h @@ -15,6 +15,7 @@ namespace gold { //gold stats const int base_stat = 99; //base stat value used if no changes. if a stat below is set at 0, this value will be used. const int manlet_buff = 0; //if running red bracket, buff by this amount + const bool allow_green = false; //if it can use height abuse const int height_nerf = 0; //if running green bracket, nerf by this amount const int offensive_awareness = 0; const int ball_control = 0; @@ -59,6 +60,7 @@ namespace silver { //silver stats const int base_stat = 88; //base stat value used if no changes. if a stat below is set at 0, this value will be used. const int manlet_buff = 0; //if running red bracket, buff by this amount + const bool allow_green = true; //if it can use height abuse const int height_nerf = 0; //if running green bracket, nerf by this amount const int offensive_awareness = 0; const int ball_control = 0; @@ -102,6 +104,7 @@ namespace regular { //regular player stats const int base_stat = 77; //base stat value used if no changes. if a stat below is set at 0, this value will be used. const int manlet_buff = 5; //if running red bracket, buff by this amount + const bool allow_green = true; //if it can use height abuse const int height_nerf = 0; //if running green bracket, nerf by this amount const int offensive_awareness = 0; const int ball_control = 0; @@ -145,6 +148,7 @@ namespace goalkeeper { const int base_stat = 74; //base stat value used if no changes. if a stat below is set at 0, this value will be used. const int manlet_buff = 5; //if running red bracket, buff by this amount + const bool allow_green = false; //if it can use height abuse const int height_nerf = 0; //if running green bracket, nerf by this amount const int offensive_awareness = 0; const int ball_control = 0; @@ -190,6 +194,7 @@ namespace blank_example { //has all stats 0'd out for easier removal of stat cha const int base_stat = 0; //base stat value used if no changes. if a stat below is set at 0, this value will be used. const int manlet_buff = 5; //if running red bracket, buff by this amount + const bool allow_green = true; //if it can use height abuse const int height_nerf = 0; //if running green bracket, nerf by this amount const int offensive_awareness = 0; const int ball_control = 0; From 70ea346aeaaefafc7477b381815396ad43a14ee3 Mon Sep 17 00:00:00 2001 From: Giovani1906 <4cc.giovani1906@gmail.com> Date: Sat, 20 Jun 2026 12:45:03 +0200 Subject: [PATCH 5/5] Add bufflet button Add auto nerf to players when using the "make" button if applicable when green bracket is used Fix COM cards counting towards the 10 card limit Some minor code refactor --- aatf.cpp | 143 ++++++++++++----------------------------------------- aatf.h | 26 ++++++++++ main.cpp | 58 ++++++++++++++-------- resource.h | 5 +- window.cpp | 13 +++-- 5 files changed, 107 insertions(+), 138 deletions(-) diff --git a/aatf.cpp b/aatf.cpp index 716df81..aa3eb69 100644 --- a/aatf.cpp +++ b/aatf.cpp @@ -39,33 +39,6 @@ struct skillCheck CF 12 0 */ int regPosToPlayPosMap[13] = { 12, 9, 10, 11, 5, 6, 7, 8, 4, 2, 3, 1, 0 }; -//============================ -//AATF Settings -int manletCardBonus = 1; //Manlets get 1 extra card -int manletWeakFootUse = 4; //Manlets get 4/4 weak foot usage/accuracy -int manletWeakFootAcc = 4; -int manletPosBonus = 1; //Manlets get 1 extra double A position - -int greenGiga = 0; //Green height bracket -int greenGiant = 5; -int greenTall = 6; -int greenMid = 6; -int greenManlet = 6; - -int redGiga = 0; //Red height bracket -int redGiant = 0; -int redTall = 10; -int redMid = 7; -int redManlet = 6; - -int heightGiga = 199; //Player heights in each category -int heightGiant = 194; -int heightTall = 185; -int heightTallGK = 189; -int heightMid = 180; -int heightManlet = 175; - - void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplayers, team_entry* gteams, int gnum_players, bool useSuggestions) { player_entry player; @@ -148,6 +121,7 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay int reqSkill = 0; int reqTrick = 0; int reqCom = 0; + int extraCom = 0; // Individual Stat Comparison int targetRate = 0; int targetDrib = 0; @@ -536,7 +510,11 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay if (player.com_style[jj]) { if (numCom < reqCom) numCom++; - else numSkill++; + else + { + numSkill++; + extraCom++; + } } } @@ -549,22 +527,15 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay weakFootUse = manletWeakFootUse; //Manlets get weak foot acc/use 4/4 weakFootAcc = manletWeakFootAcc; } - else if ((player.height - heightMod) <= heightMid) - { - numMid++; - } - else if ((player.height - heightMod) == heightTall) - numTall++; - else if ((player.height - heightMod) == heightTallGK && player.reg_pos == 0) //GK - numTall++; - else if ((player.height - heightMod) == heightGiant) - numGiant++; - else if ((player.height - heightMod) == heightGiga) - numGiga++; + else if ((player.height - heightMod) <= heightMid) numMid++; + else if ((player.height - heightMod) == heightTall) numTall++; + else if ((player.height - heightMod) == heightTallGK && player.reg_pos == 0) numTall++; //GK + else if ((player.height - heightMod) == heightGiant) numGiant++; + else if ((player.height - heightMod) == heightGiga) numGiga++; else { errorTot++; - errorMsg << _T("Illegal height (") << player.height << _T(" cm); "); + errorMsg << _T("\tIllegal height (") << player.height << _T(" cm);\r\n"); } if (player.height >= heightGiant) //HA get penalty @@ -572,7 +543,7 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay if (!allowGreen) { errorTot++; - errorMsg << _T("This player cannot be ") << heightGiant << _T("cm tall; "); + errorMsg << _T("\tThis player cannot be ") << heightGiant << _T("cm tall;\r\n"); } else { targetRate -= heightNerf; @@ -621,7 +592,7 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay } //Check PES skill card limit of 10 - if (numSkill + numTrick > 10) + if ((numSkill - extraCom) + numTrick > 10) { errorTot++; errorMsg << _T("\tHas ") << numSkill + numTrick << _T(" cards, PES limit is 10, please swap to COM cards or trade for additional A positions;\r\n"); @@ -712,62 +683,32 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay msgOut += _T("Using Green height system\r\n"); if (diff = greenGiga - numGiga) { - if (diff > 0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } + if (diff > 0) errorTot += diff; + else errorTot -= diff; errorMsg << _T("\tHas ") << numGiga << _T("/") << greenGiga << _T(" ") << heightGiga << _T("cm players;\r\n"); } if (diff = greenGiant - numGiant) { - if (diff > 0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } + if (diff > 0) errorTot += diff; + else errorTot -= diff; errorMsg << _T("\tHas ") << numGiant << _T("/") << greenGiant << _T(" ") << heightGiant << _T("cm players;\r\n"); } if (diff = greenTall - numTall) { - if (diff > 0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } + if (diff > 0) errorTot += diff; + else errorTot -= diff; errorMsg << _T("\tHas ") << numTall << _T("/") << greenTall << _T(" ") << heightTall << _T("/") << heightTallGK << _T("cm players;\r\n"); } if (diff = greenMid - numMid) { - if (diff > 0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } + if (diff > 0) errorTot += diff; + else errorTot -= diff; errorMsg << _T("\tHas ") << numMid << _T("/") << greenMid << _T(" ") << heightMid << _T("cm players;\r\n"); } if (diff = greenManlet - numManlet) { - if (diff > 0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } + if (diff > 0) errorTot += diff; + else errorTot -= diff; errorMsg << _T("\tHas ") << numManlet << _T("/") << greenManlet << _T(" ") << heightManlet << _T("cm players;\r\n"); } } @@ -786,38 +727,20 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay } if (diff = redTall - numTall) { - if (diff > 0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } + if (diff > 0) errorTot += diff; + else errorTot -= diff; errorMsg << _T("\tHas ") << numTall << _T("/") << redTall << _T(" ") << heightTall << _T("/") << heightTallGK << _T("cm players;\r\n"); } if (diff = redMid - numMid) { - if (diff > 0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } + if (diff > 0) errorTot += diff; + else errorTot -= diff; errorMsg << _T("\tHas ") << numMid << _T("/") << redMid << _T(" ") << heightMid << _T("cm players;\r\n"); } if (diff = redManlet - numManlet) { - if (diff > 0) - { - errorTot += diff; - } - else - { - errorTot -= diff; - } + if (diff > 0) errorTot += diff; + else errorTot -= diff; errorMsg << _T("\tHas ") << numManlet << _T("/") << redManlet << _T(" ") << heightManlet << _T("cm players;\r\n"); } } @@ -850,8 +773,6 @@ void aatf_single(HWND hAatfbox, int pesVersion, int teamSel, player_entry* gplay msgOut += errorMsg.str(); SetWindowText(GetDlgItem(hAatfbox, IDT_AATFOUT), msgOut.c_str()); - if(errorTot) - SendDlgItemMessage(hAatfbox, IDB_AATFOK, WM_SETTEXT, 0, (LPARAM) _T("Alright, get their clothes")); - else - SendDlgItemMessage(hAatfbox, IDB_AATFOK, WM_SETTEXT, 0, (LPARAM) _T("GO TEAM EXPORT!")); + if(errorTot) SendDlgItemMessage(hAatfbox, IDB_AATFOK, WM_SETTEXT, 0, (LPARAM) _T("Alright, get their clothes")); + else SendDlgItemMessage(hAatfbox, IDB_AATFOK, WM_SETTEXT, 0, (LPARAM) _T("GO TEAM EXPORT!")); } diff --git a/aatf.h b/aatf.h index f68f149..0431fad 100755 --- a/aatf.h +++ b/aatf.h @@ -2,6 +2,32 @@ //this file is meant to make updating the editor for stat changes exceedingly simple. //stats use pes21 names //stats that are listed as 0 will be replaced with the base_stat value in the editor. + +//AATF Settings +const int manletCardBonus = 1; //Manlets get 1 extra card +const int manletWeakFootUse = 4; //Manlets get 4/4 weak foot usage/accuracy +const int manletWeakFootAcc = 4; +const int manletPosBonus = 1; //Manlets get 1 extra double A position + +const int greenGiga = 0; //Green height bracket +const int greenGiant = 5; +const int greenTall = 6; +const int greenMid = 6; +const int greenManlet = 6; + +const int redGiga = 0; //Red height bracket +const int redGiant = 0; +const int redTall = 10; +const int redMid = 7; +const int redManlet = 6; + +const int heightGiga = 199; //Player heights in each category +const int heightGiant = 194; +const int heightTall = 185; +const int heightTallGK = 189; +const int heightMid = 180; +const int heightManlet = 175; + namespace gold { //gold stats const int count = 2; //number of this type of player allowed const int form = 8; diff --git a/main.cpp b/main.cpp index da728ca..6871296 100644 --- a/main.cpp +++ b/main.cpp @@ -892,17 +892,15 @@ LRESULT CALLBACK wnd_proc(HWND H, UINT M, WPARAM W, LPARAM L) { using namespace gold; //use gold stats only int ii; + int statmod = 0; + if (gplayers[gn_playind[gn_listsel]].height >= heightGiant) statmod = height_nerf; + for (ii = IDT_ABIL_ATKP; ii < gi_lastAbility; ii += 2) { if (stat_array[(ii - IDT_ABIL_ATKP) / 2] == 0) //stat is not changed from base stat value - { - SendDlgItemMessage(ghw_tab1, ii, WM_SETTEXT, 0, (LPARAM)std::to_wstring(base_stat).c_str()); - } + SendDlgItemMessage(ghw_tab1, ii, WM_SETTEXT, 0, (LPARAM)std::to_wstring(base_stat - statmod).c_str()); else //stat is changed - { - SendDlgItemMessage(ghw_tab1, ii, WM_SETTEXT, 0, (LPARAM)std::to_wstring(stat_array[(ii - IDT_ABIL_ATKP) / 2]).c_str()); - } - + SendDlgItemMessage(ghw_tab1, ii, WM_SETTEXT, 0, (LPARAM)std::to_wstring(stat_array[(ii - IDT_ABIL_ATKP) / 2] - statmod).c_str()); } SendDlgItemMessage(ghw_tab1, IDT_ABIL_FORM, WM_SETTEXT, 0, (LPARAM)std::to_wstring(form).c_str()); @@ -918,17 +916,15 @@ LRESULT CALLBACK wnd_proc(HWND H, UINT M, WPARAM W, LPARAM L) { using namespace silver; //use silver stats only int ii; + int statmod = 0; + if (gplayers[gn_playind[gn_listsel]].height >= heightGiant) statmod = height_nerf; + for (ii = IDT_ABIL_ATKP; ii < gi_lastAbility; ii += 2) { if (stat_array[(ii - IDT_ABIL_ATKP) / 2] == 0) //stat is not changed from base stat value - { - SendDlgItemMessage(ghw_tab1, ii, WM_SETTEXT, 0, (LPARAM)std::to_wstring(base_stat).c_str()); - } + SendDlgItemMessage(ghw_tab1, ii, WM_SETTEXT, 0, (LPARAM)std::to_wstring(base_stat - statmod).c_str()); else //stat is changed - { - SendDlgItemMessage(ghw_tab1, ii, WM_SETTEXT, 0, (LPARAM)std::to_wstring(stat_array[(ii - IDT_ABIL_ATKP) / 2]).c_str()); - } - + SendDlgItemMessage(ghw_tab1, ii, WM_SETTEXT, 0, (LPARAM)std::to_wstring(stat_array[(ii - IDT_ABIL_ATKP) / 2] - statmod).c_str()); } SendDlgItemMessage(ghw_tab1, IDT_ABIL_FORM, WM_SETTEXT, 0, (LPARAM)std::to_wstring(form).c_str()); @@ -938,23 +934,43 @@ LRESULT CALLBACK wnd_proc(HWND H, UINT M, WPARAM W, LPARAM L) } } break; + case IDB_MAKE_BUFF: + { + if (HIWORD(W) == BN_CLICKED) + { + using namespace regular; //use regular stats only + int ii; + + for (ii = IDT_ABIL_ATKP; ii < gi_lastAbility; ii += 2) + { + if (stat_array[(ii - IDT_ABIL_ATKP) / 2] == 0) //stat is not changed from base stat value + SendDlgItemMessage(ghw_tab1, ii, WM_SETTEXT, 0, (LPARAM)std::to_wstring(base_stat + manlet_buff).c_str()); + else //stat is changed + SendDlgItemMessage(ghw_tab1, ii, WM_SETTEXT, 0, (LPARAM)std::to_wstring(stat_array[(ii - IDT_ABIL_ATKP) / 2] + manlet_buff).c_str()); + } + + SendDlgItemMessage(ghw_tab1, IDT_ABIL_FORM, WM_SETTEXT, 0, (LPARAM)std::to_wstring(form).c_str()); + SendDlgItemMessage(ghw_tab1, IDT_ABIL_INJU, WM_SETTEXT, 0, (LPARAM)std::to_wstring(injury_resistance).c_str()); + SendDlgItemMessage(ghw_tab1, IDT_ABIL_WKUS, WM_SETTEXT, 0, (LPARAM)std::to_wstring(manletWeakFootUse).c_str()); + SendDlgItemMessage(ghw_tab1, IDT_ABIL_WKAC, WM_SETTEXT, 0, (LPARAM)std::to_wstring(manletWeakFootAcc).c_str()); + } + } + break; case IDB_MAKE_REGU: { if(HIWORD(W)==BN_CLICKED) { using namespace regular; //use regular stats only int ii; + int statmod = 0; + if (gplayers[gn_playind[gn_listsel]].height >= heightGiant) statmod = height_nerf; + for (ii = IDT_ABIL_ATKP; ii < gi_lastAbility; ii += 2) { if (stat_array[(ii - IDT_ABIL_ATKP) / 2] == 0) //stat is not changed from base stat value - { - SendDlgItemMessage(ghw_tab1, ii, WM_SETTEXT, 0, (LPARAM)std::to_wstring(base_stat).c_str()); - } + SendDlgItemMessage(ghw_tab1, ii, WM_SETTEXT, 0, (LPARAM)std::to_wstring(base_stat - statmod).c_str()); else //stat is changed - { - SendDlgItemMessage(ghw_tab1, ii, WM_SETTEXT, 0, (LPARAM)std::to_wstring(stat_array[(ii - IDT_ABIL_ATKP) / 2]).c_str()); - } - + SendDlgItemMessage(ghw_tab1, ii, WM_SETTEXT, 0, (LPARAM)std::to_wstring(stat_array[(ii - IDT_ABIL_ATKP) / 2] - statmod).c_str()); } SendDlgItemMessage(ghw_tab1, IDT_ABIL_FORM, WM_SETTEXT, 0, (LPARAM)std::to_wstring(form).c_str()); diff --git a/resource.h b/resource.h index 081ff99..025fc05 100644 --- a/resource.h +++ b/resource.h @@ -53,8 +53,9 @@ #define IDC_TEAM_LIST 1104 #define IDB_MAKE_GOLD 1105 #define IDB_MAKE_SILV 1106 -#define IDB_MAKE_REGU 1107 -#define IDC_STATIC_G1 1108 +#define IDB_MAKE_BUFF 1107 +#define IDB_MAKE_REGU 1108 +#define IDC_STATIC_G1 1109 #define IDD_BASIC 1110 #define IDC_STATIC_B1 1111 diff --git a/window.cpp b/window.cpp index f63207d..9ba3db2 100644 --- a/window.cpp +++ b/window.cpp @@ -48,14 +48,19 @@ void setup_main(HWND H) 20, 552, 250, 26, H, (HMENU)IDB_MAKE_SILV, GetModuleHandle(NULL), NULL); setup_control(hw_new, ghFont, scale_cntl_proc); - hw_new = CreateWindowEx(0, _T("Button"), _T("Make Regular"), + hw_new = CreateWindowEx(0, _T("Button"), _T("Make Buff"), + BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, + 20, 584, 65, 26, H, (HMENU)IDB_MAKE_BUFF, GetModuleHandle(NULL), NULL); + setup_control(hw_new, ghFont, scale_cntl_proc); + + hw_new = CreateWindowEx(0, _T("Button"), _T("Make Reg"), BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, - 20, 584, 110, 26, H, (HMENU)IDB_MAKE_REGU, GetModuleHandle(NULL), NULL); + 95, 584, 65, 26, H, (HMENU)IDB_MAKE_REGU, GetModuleHandle(NULL), NULL); setup_control(hw_new, ghFont, scale_cntl_proc); - hw_new = CreateWindowEx(0, _T("Button"), _T("Set Stats to:"), + hw_new = CreateWindowEx(0, _T("Button"), _T("Set Stats"), BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, - 140, 584, 80, 26, H, (HMENU)IDB_SET_STATS, GetModuleHandle(NULL), NULL); + 170, 584, 50, 26, H, (HMENU)IDB_SET_STATS, GetModuleHandle(NULL), NULL); setup_control(hw_new, ghFont, scale_cntl_proc); hw_new = CreateWindowEx(WS_EX_CLIENTEDGE, _T("EDIT"), _T(""),