Skip to content

Commit

Permalink
Updates to Promotion of Head Coaches, FCS Promotions, and other small…
Browse files Browse the repository at this point in the history
… bug fixes
  • Loading branch information
antdroidx committed Feb 22, 2019
1 parent dbeecad commit e4311cb
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 73 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -18,3 +18,4 @@
*.xml
.idea/workspace.xml
.idea/misc.xml
.idea/workspace.xml
137 changes: 76 additions & 61 deletions .idea/workspace.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build.gradle
Expand Up @@ -32,8 +32,8 @@ android {
applicationId "antdroid.cfbcoach"
minSdkVersion 21
targetSdkVersion 26
versionName 'v1.3.84'
versionCode 209
versionName 'v1.3.85'
versionCode 210
}
buildTypes {
release {
Expand Down
Binary file modified release/CFB-Coach-release.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion release/output.json
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":209,"versionName":"v1.3.84","enabled":true,"outputFile":"CFB-Coach-release.apk","fullName":"release","baseName":"release"},"path":"CFB-Coach-release.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":210,"versionName":"v1.3.85","enabled":true,"outputFile":"CFB-Coach-release.apk","fullName":"release","baseName":"release"},"path":"CFB-Coach-release.apk","properties":{}}]
2 changes: 1 addition & 1 deletion src/main/java/positions/HeadCoach.java
Expand Up @@ -175,7 +175,7 @@ public HeadCoach(String nm, int yr, int stars, Team t) {
ratOff = (int) (50 + stars * 5 - 15 * Math.random() + 15 * Math.random());
ratDef = (int) (50 + stars * 5 - 15 * Math.random() + 15 * Math.random());
ratTalent = (int) (45 + 50 * Math.random());
ratDiscipline = (int) (45 + 50 * Math.random());
ratDiscipline = (int) (45 + 45 * Math.random());
ratOvr = getHCOverall();
offStrat = rand.nextInt((max - min) + 1) + min;
if (offStrat > 4) offStrat = 4;
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/simulation/Conference.java
Expand Up @@ -67,6 +67,9 @@ public Conference(String name, League league, Boolean deal, int length, int term
if(name.split(",").length > 1) {
divisions.add(new Division(save[1], league));
divisions.add(new Division(save[2], league));
} else {
divisions.add(new Division("A", league));
divisions.add(new Division("B", league));
}

confTV = deal;
Expand All @@ -89,6 +92,9 @@ public Conference(String save, League league) {
if(data.length > 5) {
divisions.add(new Division(data[5], league));
divisions.add(new Division(data[6], league));
} else {
divisions.add(new Division("A", league));
divisions.add(new Division("B", league));
}

//Old Save Compatibility
Expand Down
13 changes: 8 additions & 5 deletions src/main/java/simulation/League.java
Expand Up @@ -1353,7 +1353,7 @@ private void setupSeason() {
Team b;

if (availTeamsB.isEmpty()) {
b = new Team(teamsFCS[(int) (teamsFCS.length * Math.random())], "FCS", "FCS Division", (int) (Math.random() * 40), "FCS1", 0, this, true);
b = new Team(teamsFCS[(int) (teamsFCS.length * Math.random())], "FCS", "FCS Division", (int) (Math.random() * 40), "FCS1", 0, this, false);
} else {
int selTeamB = (int) (availTeamsB.size() * Math.random());
b = availTeamsB.get(selTeamB);
Expand Down Expand Up @@ -1692,7 +1692,9 @@ public int getAverageConfPrestige() {
for (int i = 0; i < conferences.size(); ++i) {
avgPrestige += conferences.get(i).confPrestige;
}
return avgPrestige / conferences.size();

if (conferences.size() > 0) return avgPrestige / conferences.size();
else return 0;
}

//get League Avg Chemistry
Expand Down Expand Up @@ -4464,7 +4466,8 @@ public void conferenceRealignmentV2() {


//Promote FCS School
if(Math.random() < realignmentChance) {
//if(Math.random() < realignmentChance) {
if(Math.random() > 0) {
Conference indy = conferences.get(indConf);
if(conferences.get(indConf).confTeams.size() < indy.minConfTeams-1) {
String fcsName;
Expand All @@ -4482,7 +4485,7 @@ public void conferenceRealignmentV2() {
}
}

Team FCS = new Team(teamsFCS[(int) (teamsFCS.length * Math.random())], "FCS", "Independent", (int) (Math.random() * 35), "A", (int)(Math.random()*6), this);
Team FCS = new Team(teamsFCS[(int) (teamsFCS.length * Math.random())], "FCS", "Independent", (int)(Math.random()*35), "A", (int)(Math.random()*6), this, true);
FCS.abbr = FCS.name.substring(0,2);
FCS.rankTeamPollScore = teamList.size();
teamList.add(FCS);
Expand Down Expand Up @@ -4632,7 +4635,7 @@ public void convertUnivProRel() {

//check if there is an even number of teams
if(teamList.size() % 2 != 0) {
teamList.add(new Team(teamsFCS[(int) (teamsFCS.length * Math.random())], "FCS", "FCS Division", (int) (Math.random() * 40), "FCS1", (int)(Math.random()*6), this, true));
teamList.add(new Team(teamsFCS[(int) (teamsFCS.length * Math.random())], "FCS", "FCS Division", (int) (Math.random() * 40), "FCS1", (int)(Math.random()*6), this, false));
}

//Clear all Conferences
Expand Down
12 changes: 9 additions & 3 deletions src/main/java/simulation/Team.java
Expand Up @@ -12,6 +12,7 @@
import comparator.CompPlayer;
import comparator.CompRecruit;
import comparator.CompTeamConfWins;
import comparator.CompTeamPrestige;
import positions.HeadCoach;
import positions.Player;
import positions.PlayerCB;
Expand Down Expand Up @@ -316,6 +317,10 @@ public Team(String name, String abbr, String conference, int prestige, String di

newRoster(minQBs, minRBs, minWRs, minTEs, minOLs, minKs, minDLs, minLBs, minCBs, minSs, true);

if(FCS) {
teamPrestige = (int) (Math.random() * league.teamList.get((int) (league.teamList.size() * .75)).teamPrestige);
}

//set stats
totalWins = 0;
totalLosses = 0;
Expand Down Expand Up @@ -355,7 +360,7 @@ public Team(String name, String abbr, String conference, int prestige, String di
teamDiscplineBudget = 0;
teamDisciplineScore = disciplineStart;

rankTeamPollScore = league.teamList.size();
if(!FCS) rankTeamPollScore = league.teamList.size();
}

/**
Expand Down Expand Up @@ -1569,8 +1574,9 @@ private void newCoachTeamChanges() {
public void promoteCoach() {
//make team
boolean promote = true;
int stars = teamPrestige / 20;
stars = (int)(Math.random()*15) + (stars/4);
int stars = (int)((league.teamList.size() - rankTeamPrestige) / (league.teamList.size()/10.5));
stars = (int)(Math.random()*stars) + (stars/4);
if(stars > 10) stars = 10;

//MAKE HEAD COACH
HC.add(new HeadCoach(league.getRandName(), 0, stars, this, promote));
Expand Down

0 comments on commit e4311cb

Please sign in to comment.