Beispiel #1
0
		public string GetKickerPunterString(Team team)
		{
			Player k, p;
			k = team.GetPlayer("K",null,null,null,1);
			if(k.position == "X")
				k.skinColor = 1;
			p = team.GetPlayer("P",null,null,null,1);
			if(p.position == "X")
				p.skinColor = 1;
			string k_str = GetPlayerString(k,"K");
			string p_str = GetPlayerString(p,"P");
			// if we don't have a kicker, but do have a punter
			/*if(k_str.IndexOf("NOBODY") > -1 && p_str.IndexOf("NOBODY") == -1)
			{
				k_str = GetPlayerString(k,"P");
			}
			// we don't have a punter, but do have a kicker.
			else if( k_str.IndexOf("NOBODY") == -1 && p_str.IndexOf("NOBODY") > -1 )
			{
				p_str = GetPlayerString(k,"P");
			}*/
			return k_str + p_str;
		}
Beispiel #2
0
		public string GetOLineString(Team team)
		{
			Player lt,lg,c,rg,rt;
			int t_count = team.CountPositions("T");
			int c_count = team.CountPositions("C");
			int g_count = team.CountPositions("G");
			if(t_count < 2|| g_count < 2|| c_count < 1)
			{
				lt = team.GetPlayer("T","G","C",null,1);
				rt = team.GetPlayer("T","G","C",null,4);
				lg = team.GetPlayer("T","G","C",null,3);
				rg = team.GetPlayer("T","G","C",null,5);
				c  = team.GetPlayer("T","G","C",null,2);
			}
			else
			{
				lt = team.GetPlayer("T",null,null,null,1);
				rt = team.GetPlayer("T",null,null,null,2);
				lg = team.GetPlayer("G",null,null,null,2);
				rg = team.GetPlayer("G",null,null,null,1);
				c  = team.GetPlayer("C",null,null,null,1);
			}
			int max, min; max= min=0;
			if(team.offenseRank < 5){
				min = 0;
				max = 15;
			}
			else if(team.offenseRank < 10){
				min = 10;
				max = 25;
			}
			else if( team.offenseRank < 15){
				min = 20;
				max = 35;
			}
			else if(team.offenseRank < 20){
				min = 30;
				max = 45;
			}
			else if(team.offenseRank < 28){
				min = 40;
				max =  5*28;// TSBData.OLmen.Length;
			}
			int cd,ltd,rtd,lgd,rgd;
			/*cd = r.Next(min,max);
			ltd = r.Next(min,max);
			rtd = r.Next(min,max);
			rgd = r.Next(min,max);
			lgd = r.Next(min,max);*/
			cd  = min + (((c.fname.Length  + c.lname.Length ) * 3 ) % 15 );
			ltd = min + (((lt.fname.Length + lt.lname.Length) * 3 ) % 15 );
			rtd = min + (((rt.fname.Length + rt.lname.Length) * 3 ) % 15 );
			rgd = min + (((rg.fname.Length + rg.lname.Length) * 3 ) % 15 );
			lgd = min + (((lg.fname.Length + lg.lname.Length) * 3 ) % 15 );
			string ret = string.Format(
			"{0}{1}{2}{3}{4}",
			GetOLPlayerString(c,"C",cd),
			GetOLPlayerString(lg,"LG",lgd),
			GetOLPlayerString(rg,"RG",rgd),
			GetOLPlayerString(lt,"LT",ltd),
			GetOLPlayerString(rt,"RT",rtd) );
			return ret;
		}
Beispiel #3
0
		public string GetDefenseString(Team team)
		{
			Player re,nt,le,lolb,lilb,rolb,rilb,rcb,lcb,fs,ss,db1,db2;
			rcb=lcb=fs=ss=db1=db2=null;
			le = team.GetPlayer("DE","DT","NT",null,1);
			re = team.GetPlayer("DE","DT","NT",null,2);
			nt = team.GetPlayer("DE","DT","NT",null,3);
			rolb = team.GetPlayer("LB",null,null,null,1);
			lolb = team.GetPlayer("LB",null,null,null,2);
			lilb = team.GetPlayer("LB",null,null,null,3);
			rilb = team.GetPlayer("LB",null,null,null,4);

			int s_count = team.CountPositions("S") + 
				          team.CountPositions("SS")+ 
				          team.CountPositions("FS");
			if(s_count > 3 )
				s_count = 3;
			switch(s_count)
			{
				case 0:
					rcb = team.GetPlayer("CB","DB",null,null,1);
					fs  = team.GetPlayer("CB","DB",null,null,3);
					ss  = team.GetPlayer("CB","DB",null,null,2);
					lcb = team.GetPlayer("CB","DB",null,null,4);
					db1 = team.GetPlayer("CB","DB",null,null,5);
					db2 = team.GetPlayer("CB","DB",null,null,6);
					break;
				case 1:
					rcb = team.GetPlayer("CB","DB",null,null,1);
					fs  = team.GetPlayer("CB","DB",null,null,3);
					ss  = team.GetPlayer("S","SS","FS", null,1);
					lcb = team.GetPlayer("CB","DB",null,null,2);
					db1 = team.GetPlayer("CB","DB",null,null,4);
					db2 = team.GetPlayer("CB","DB",null,null,5);
					break;
				case 2:
					rcb = team.GetPlayer("CB","DB",null,null,1);
					fs  = team.GetPlayer("S","SS","FS", null,2);
					ss  = team.GetPlayer("S","SS","FS", null,1);
					lcb = team.GetPlayer("CB","DB",null,null,2);
					db1 = team.GetPlayer("CB","DB",null,null,3);
					db2 = team.GetPlayer("CB","DB",null,null,4);
					break;
				case 3:
					rcb = team.GetPlayer("CB","DB",null,null,1);
					fs  = team.GetPlayer("S","SS","FS", null,2);
					ss  = team.GetPlayer("S","SS","FS", null,1);
					lcb = team.GetPlayer("CB","DB",null,null,2);
					db1 = team.GetPlayer("S","SS","FS",null,3);
					db2 = team.GetPlayer("CB","DB",null,null,3);
					break;
			}
			if(ss.position == "CB"&& rcb.position == "DB"){
				Player tmp = ss;
				ss = rcb;
				ss=tmp;
			}
			if(ss.position == "CB"&& lcb.position == "DB"){
				Player tmp = ss;
				ss = lcb;
				ss=tmp;
			}
			if(fs.position == "CB"&& lcb.position == "DB"){
				Player tmp = fs;
				fs = lcb;
				fs=tmp;
			}
			if(fs.position == "CB"&& rcb.position == "DB"){
				Player tmp = fs;
				fs = lcb;
				fs=tmp;
			}
			string ret = string.Format(
            "{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}",
				GetPlayerString(re,"RE"),
				GetPlayerString(nt,"NT"),
				GetPlayerString(le,"LE"),
				GetPlayerString(rolb,"ROLB"),
				GetPlayerString(rilb,"RILB"),
				GetPlayerString(lilb,"LILB"),
				GetPlayerString(lolb,"LOLB"),
				GetPlayerString(rcb,"RCB"),
				GetPlayerString(lcb,"LCB"),
				GetPlayerString(fs,"FS"),
				GetPlayerString(ss,"SS")); 
			
			if( MainClass.AutoCorrectDefenseSimData )
			{
				ret = AdjustSimPassRush(
					re.sacks,   nt.sacks,   le.sacks,  rolb.sacks, 
					rilb.sacks, lilb.sacks, lolb.sacks, ret).Trim()+"\n";

				ret = AdjustSimPassDefense(
					rolb.ints, rilb.ints,  lilb.ints, lolb.ints, 
					rcb.ints, lcb.ints, fs.ints, ss.ints, ret ).Trim()+"\n";
			}

			if( MainClass.GenerateForSNES )
			{
				string db1Str = GetPlayerString(db1,"DB1");
				string db2Str = GetPlayerString(db2,"DB2");
				int index = db1Str.IndexOf("[");
				
				if( index > -2 )
					db1Str = db1Str.Substring(0, index);
				index = db2Str.IndexOf("[");
				
				if( index > -2 )
					db2Str = db2Str.Substring(0, index);
				
				ret += db1Str + "\n";
				ret += db2Str + "\n";
			}
			return ret;
		}
Beispiel #4
0
		/// <summary>
		/// Returns an array of 2 strings.
		/// ret[0] = the offensive string.
		/// ret[1] = the KR_PR string.
		/// </summary>
		/// <param name="team"></param>
		/// <returns></returns>
		public string[] GetOffensiveSkillPlayerString(Team team)
		{
			Player qb1,qb2,rb1,rb2,rb3,rb4,wr1,wr2,wr3,wr4,te1,te2=null;
			rb1=rb2=rb3=rb4=null;
			int fb_count = team.CountPositions("FB");
			if(fb_count > 2)
				fb_count =2;
			qb1 = team.GetQBPlayer(1);
			qb2 = team.GetQBPlayer(2);
			
			if(qb2.ranking < qb1.ranking && qb1.passingYards > qb2.passingYards)
			{
				qb2.ranking = qb1.ranking + 5;
			}

			if(qb2 == null)
				rb1=null;
			rb1 = team.GetPlayer("RB","HB",null,null,1);
			switch(fb_count)
			{
				case 0:
					rb2 = team.GetPlayer("RB","HB",null,null,2);
					rb3 = team.GetPlayer("RB","HB",null,null,3);
					rb4 = team.GetPlayer("RB","HB",null,null,4);
					break;
				case 1:
					rb2 = team.GetPlayer("FB",null,null,null,1);
					rb3 = team.GetPlayer("RB","HB",null,null,2);
					rb4 = team.GetPlayer("RB","HB",null,null,3);
					break;
				case 2:
					rb2 = team.GetPlayer("FB",null,null,null,1);
					rb3 = team.GetPlayer("RB","HB",null,null,2);
					rb4 = team.GetPlayer("FB",null,null,null,2);
					break;
			}
			int wr_count = 1;
			wr1 = team.GetPlayer("WR",null,null,null,wr_count++);
			wr2 = team.GetPlayer("WR",null,null,null,wr_count++);
			wr3 = team.GetPlayer("WR",null,null,null,wr_count++);
			wr4 = team.GetPlayer("WR",null,null,null,wr_count++);
			te1 = team.GetPlayer("TE",null,null,null,1);
			te2= team.GetPlayer("TE",null,null,null,2);

			//Take care of run+ shoot teams
			if(rb2.lname.ToLower() == "nobody"){
				rb2 = team.GetPlayer("WR",null,null,null,wr_count++);
				rb3 = team.GetPlayer("WR",null,null,null,wr_count++);
				rb4 = team.GetPlayer("WR",null,null,null,wr_count++);
			}
			else if(rb3.lname.ToLower() == "nobody"){
				rb3 = team.GetPlayer("WR",null,null,null,wr_count++);
				rb4 = team.GetPlayer("WR",null,null,null,wr_count++);
			}
			else if(rb4.lname.ToLower() == "nobody"){
				rb4 = team.GetPlayer("WR",null,null,null,wr_count++);
			}

			// take care of team with no or few tightends
			if(te1.lname.ToLower() == "nobody"){
				te1 = team.GetPlayer("WR",null,null,null,wr_count++);
				te2 = team.GetPlayer("WR",null,null,null,wr_count++);
			}
			else if(te2.lname.ToLower() == "nobody"){
				te2 = team.GetPlayer("WR",null,null,null,wr_count++);
			}

			// make sure the guy with the most Rush yards starts at RB
			if( rb1.rushYards < rb3.rushYards )
			{   // swap players
				Player tmp;
				tmp = rb1;
				rb1 = rb3;
				rb3 = tmp;
			}

			Player returnMan = team.GetTopReturnMan();
			if( returnMan!= null && returnMan.kickRetYards + returnMan.puntRetYards > 500 )
			{
				if( returnMan != rb1 && returnMan != rb2 && returnMan != rb3 && returnMan != rb4 &&
					returnMan != wr1 && returnMan != wr2 && returnMan != wr3 && returnMan != wr4 &&
					returnMan != te1 && returnMan != te2                                            )
				{
					if(wr4.recYards+ wr4.rushYards < rb4.rushYards+rb4.recYards)
						wr4 = returnMan;
					else
						rb4=returnMan;
				}
			}

			string ret = //string.Format(
				//"{0}(1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}",
				GetPlayerString(qb1,"QB1")+
				GetPlayerString(qb2,"QB2")+
				GetPlayerString(rb1,"RB1")+
				GetPlayerString(rb2,"RB2")+
				GetPlayerString(rb3,"RB3")+
				GetPlayerString(rb4,"RB4")+
				GetPlayerString(wr1,"WR1")+
				GetPlayerString(wr2,"WR2")+
				GetPlayerString(wr3,"WR3")+
				GetPlayerString(wr4,"WR4")+
				GetPlayerString(te1,"TE1")+
				GetPlayerString(te2,"TE2");

			
			string KR_PR = getKR_PR(rb1,rb2,rb3,rb4,wr1,wr2,wr3,wr4,te1,te2);

			string[] retArray = new string[2];
			retArray[0] = ret;
			retArray[1] = KR_PR;
			return retArray;
			//return KR_PR +"\r\n"+ ret ;
		}