Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
  • Loading branch information
nikakd committed Feb 20, 2011
1 parent c9f1e28 commit f94cb09
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 66 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2011-02-20 Nicolas Laplume <[email protected]>

* V257

* Fixed bug in some failures in Lunar Missions (from V252)

* place.c: Changed the Prestige First screen in Mission Review to show also Prestige Seconds

* prest.c: Reduced penalty in manned missions when no-one dies to -7

2011-02-17 Nicolas Laplume <[email protected]>

* V256
Expand Down
53 changes: 45 additions & 8 deletions place.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ void writePrestigeFirst(char index) { ///index==plr
char w=0,i,draw=0;
extern char PF[29][40];
for (i=0;i<28;i++)
{
{ //Preestige First
if (w<6 && Data->Prestige[i].Place==index && Data->PD[index][i]==0)
{
if (draw==0) {
Expand All @@ -635,19 +635,56 @@ void writePrestigeFirst(char index) { ///index==plr
Data->PD[index][i]=1;
switch (i)
{
case 8: if (Data->Prestige[9].Place==index && Data->PD[index][9]==0)
PrintAt(0,0,", E");
case 8: if (Data->Prestige[9].Place==index && Data->PD[index][9]==0)
{PrintAt(0,0,", E"); Data->PD[index][9]=1;}
case 9: if (Data->Prestige[10].Place==index && Data->PD[index][10]==0)
PrintAt(0,0,", D");
case 10: if (Data->Prestige[11].Place==index && Data->PD[index][11]==0)
PrintAt(0,0,", C");
case 11: if (Data->Prestige[12].Place==index && Data->PD[index][12]==0)
PrintAt(0,0,", B");
{PrintAt(0,0,", D"); Data->PD[index][10]=1;}
case 10:if (Data->Prestige[11].Place==index && Data->PD[index][11]==0)
{PrintAt(0,0,", C"); Data->PD[index][11]=1;}
case 11:if (Data->Prestige[12].Place==index && Data->PD[index][12]==0)
{PrintAt(0,0,", B"); Data->PD[index][12]=1; i=11;}
case 12: i=12;
default: break;
}
}
}
for (i=0;i<28;i++)
{ //Prestige Seconds
if (w<6 && Data->Prestige[i].mPlace==index && Data->PD[index][i]==0)
{
if (draw==0) {
ShBox(6,170,314,197);
RectFill(10,173,310,194,7);InBox(9,172,311,195);
ShBox(216,156,314,172);
RectFill(220,160,310,168,9);InBox(219,159,311,169);
RectFill(216,171,216,171,3);
RectFill(312,172,313,172,3);
grSetColor(11);
PrintAt(224,166,"PRESTIGE FIRSTS");
draw=1;
}
grSetColor(11);
PrintAt( w>2?170:14,
w>2? 179+(w-3)*7:179+w*7,
&PF[i][0]);
++w;
Data->PD[index][i]=1;
switch (i)
{
case 8: if (Data->Prestige[9].mPlace==index && Data->PD[index][9]==0)
{PrintAt(0,0,", E"); Data->PD[index][9]=1;}
case 9: if (Data->Prestige[10].mPlace==index && Data->PD[index][10]==0)
{PrintAt(0,0,", D"); Data->PD[index][10]=1;}
case 10:if (Data->Prestige[11].mPlace==index && Data->PD[index][11]==0)
{PrintAt(0,0,", C"); Data->PD[index][11]=1;}
case 11:if (Data->Prestige[12].mPlace==index && Data->PD[index][12]==0)
{PrintAt(0,0,", B"); Data->PD[index][12]=1; i=11;}
case 12: i=12;
default: break;
}
PrintAt(0,0," (SCD)");
}
}
}


Expand Down
68 changes: 35 additions & 33 deletions prest.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void Set_Dock(char plr, char total)
{
int i;
for (i=0;i<total;i++) {
if (Mev[i].loc==8 && Mev[i].StepInfo==1)
if (Mev[i].loc==8 && Mev[i].StepInfo==1)
{Data->Prestige[24].Goal[plr]++;return;};
}
return;
Expand Down Expand Up @@ -101,7 +101,7 @@ int
PrestMap(int val)
{
switch (val) {
case ORBSAT:
case ORBSAT:
return MILE_OSAT;
case MANSPACE:
return MILE_MAN;
Expand Down Expand Up @@ -172,7 +172,7 @@ PrestMin(char plr)


/** Returns the amount of prestige added
*
*
* \note Assumes that the Mis Structure is Loaded
*/
int PrestCheck(char plr)
Expand All @@ -186,19 +186,19 @@ int PrestCheck(char plr)
if (tm!=-1 && Data->Prestige[tm].Goal[plr]==0) { // First Mission Bonus
if (Data->Prestige[tm].Goal[other(plr)]==0 && tm<27)
total+=Data->Prestige[tm].Add[0]; // your first
else total+=Data->Prestige[tm].Add[1]; // your second
else total+=Data->Prestige[tm].Add[1]; // your second
}
}

if (Mis.Doc==1 && Data->Prestige[24].Goal[plr]==0) {
if (Data->Prestige[24].Goal[other(plr)]==0)
total+=Data->Prestige[24].Add[0]; // your first
else total+=Data->Prestige[24].Add[1]; // your second
else total+=Data->Prestige[24].Add[1]; // your second
}

if (Mis.EVA==1 && Data->Prestige[26].Goal[plr]==0) {
if (Data->Prestige[26].Goal[other(plr)]==0)
total+=Data->Prestige[26].Add[0]; // your first
total+=Data->Prestige[26].Add[0]; // your first
else total+=Data->Prestige[26].Add[1]; // your second
}

Expand All @@ -211,7 +211,7 @@ int PrestCheck(char plr)
total+=Data->Prestige[14-Mis.Days].Add[0];
else if (Mis.Days==3 && Data->Prestige[14-Mis.Days].Goal[plr]==0)
total+=Data->Prestige[14-Mis.Days].Add[0];
else if (Mis.Days==2 && Data->Prestige[14-Mis.Days].Goal[plr]==0)
else if (Mis.Days==2 && Data->Prestige[14-Mis.Days].Goal[plr]==0)
total+=Data->Prestige[14-Mis.Days].Add[0];
}

Expand Down Expand Up @@ -245,12 +245,12 @@ int PrestCheck(char plr)
/** ???
*
* \deprecated
*
* \note Requires MEV to be packed
* Only checks goal steps ::
* returns GOAL value
*
* \note Requires MEV to be packed
* Only checks goal steps ::
* returns GOAL value
* Does not check if entire mission is a success
*
*
*/
char Was_Goal(char total,char which)
{
Expand All @@ -270,7 +270,7 @@ char Was_Goal(char total,char which)
case DOCK:val=8;break; // Docking
case EWALK:val=7;break; // E EVA
case LWALK:val=15;break; // L EVA
case -1:
case -1:
default:
return -1;
}
Expand Down Expand Up @@ -346,7 +346,7 @@ char Set_Goal(char plr,char which,char control)
if (Option==1)
{
pd=Mev[0].pad;
qt=MP[pd].Qty;
qt=MP[pd].Qty;
MP[pd].HInd=Data->P[1].PastMis;
MP[pd].Poss[qt]=which;
MP[pd].PossVal[qt]=0;
Expand All @@ -355,14 +355,14 @@ char Set_Goal(char plr,char which,char control)
}
else if (MAIL==0) {
pd=Mev[0].pad;
qt=Data->P[0].Udp[pd].Qty;
qt=Data->P[0].Udp[pd].Qty;
Data->P[0].Udp[pd].HInd=Data->P[0].PastMis;
Data->P[0].Udp[pd].Poss[qt]=which;
Data->P[0].Udp[pd].PossVal[qt]=0;
Data->P[0].Udp[pd].Mnth=tMo;
++Data->P[0].Udp[pd].Qty;
}
else
else
{
Data->Prestige[which].Place=plr;
Data->Prestige[which].Indec=Data->P[plr].PastMis;
Expand Down Expand Up @@ -409,7 +409,7 @@ char Set_Goal(char plr,char which,char control)
default: break;
};
}
}
}
else if (Data->Prestige[which].mPlace==-1 && Data->Prestige[which].Place!=plr){
Data->P[plr].Other|=4; // for astros

Expand Down Expand Up @@ -472,7 +472,7 @@ char Set_Goal(char plr,char which,char control)
Data->P[plr].History[Data->P[plr].PastMis].Duration=4;

switch(which) {
case ORBSAT: return(sum);
case ORBSAT: return(sum);
case MANSPACE:return(sum);
case EORBIT:return(sum+Set_Goal(plr,ORBSAT,1));
case LUNFLY:return(sum+Set_Goal(plr,EORBIT,1));
Expand All @@ -498,7 +498,7 @@ char Set_Goal(char plr,char which,char control)
}

/** Only sets negative for highest failed goal step
*
*
* checks if entire mission was a failure
*/
char Did_Fail(void)
Expand Down Expand Up @@ -533,7 +533,7 @@ int MaxFail(void)
++count;
}
if (count>=54) return 1; else return t;
}
}

#define PSTS(a) (PVal[a]==1 || PVal[a]==2)
#define NSTS(a) (PVal[a]==4)
Expand Down Expand Up @@ -608,7 +608,7 @@ int AllotPrest(char plr,char mis)
tYr=Data->Year;
tIDX=bIDX=0;
memset(PVal,0x00,sizeof PVal);

// SETUP INFO
mcode=Data->P[plr].Mission[mis].MissionCode;

Expand All @@ -629,24 +629,24 @@ int AllotPrest(char plr,char mis)

// FEMALE 'NAUTS
PVal[25]= (MA[0][0].A!=NULL && MA[0][0].A->Sex)
|| (MA[0][1].A!=NULL && MA[0][1].A->Sex)
|| (MA[0][2].A!=NULL && MA[0][2].A->Sex)
|| (MA[0][1].A!=NULL && MA[0][1].A->Sex)
|| (MA[0][2].A!=NULL && MA[0][2].A->Sex)
|| (MA[0][3].A!=NULL && MA[0][3].A->Sex)
|| (MA[1][0].A!=NULL && MA[1][0].A->Sex)
|| (MA[1][1].A!=NULL && MA[1][1].A->Sex)
|| (MA[1][2].A!=NULL && MA[1][2].A->Sex)
|| (MA[1][1].A!=NULL && MA[1][1].A->Sex)
|| (MA[1][2].A!=NULL && MA[1][2].A->Sex)
|| (MA[1][3].A!=NULL && MA[1][3].A->Sex);

for (i=0;i<STEPnum;i++) {
ival=abs(Mev[i].Prest);
cval=Mev[i].PComp;

// ival of 100 seems to mean "don't record this in PVal[]"
// Regardless of intention, it's out of bounds, so don't access or overwrite it
if (ival != 100) {
if (Mev[i].StepInfo==0 && PVal[ival]==0)
cval=4;

if (PVal[ival]!=4)
PVal[ival]=cval;
}
Expand Down Expand Up @@ -743,7 +743,7 @@ int AllotPrest(char plr,char mis)
// total+=Set_Goal(plr,27,0);
}

// GOAL NEGATIVE
// GOAL NEGATIVE
if (N_Goal!=-1) {
negs+=PrestNeg(plr,N_Goal);
PVal[N_Goal]=0;
Expand All @@ -752,7 +752,7 @@ int AllotPrest(char plr,char mis)
if (mcode==32 || mcode==36) PVal[23]=Check_Lab();

// TOTAL ALL MISSION FIRSTS
for (i=0;i<28;i++)
for (i=0;i<28;i++)
if (PVal[i]==1 || (PVal[i]==2 && other<3000))
total+=(char) Set_Goal(plr,i,0);
//else if (PVal[i]==4) negs+=Set_Goal(plr,i,0);
Expand Down Expand Up @@ -786,7 +786,7 @@ int AllotPrest(char plr,char mis)
// SET SUBSEQUENT Goal
if (S_Goal!=-1 && other<3000) total=Set_Goal(plr,S_Goal,0);

for (i=0;i<28;i++)
for (i=0;i<28;i++)
if (PVal[i]==1 || (PVal[i]==2 && other<3000))
total+=(char) Set_Goal(plr,i,0);
else if (PVal[i]==3) Set_Goal(plr,i,0);
Expand All @@ -797,7 +797,9 @@ int AllotPrest(char plr,char mis)
if (mcode>=48 && mcode<=52 && other<3000) Set_LM(plr,STEPnum);

// ADD IN NEGATIVES AND RETURN MIN of -10
total=((total+negs) < -10) ? -10 : total+negs;
total=((total+negs) < -10) ? -10 : total+negs;

if (!death && total==-10) total = -7;

return total;
}
Expand All @@ -823,7 +825,7 @@ int Find_MaxGoal(void)
int i,ival,cval;
char PVal[28];
memset(PVal,0x00,sizeof PVal);

for (i=0;i<STEPnum;i++) {
ival=abs(Mev[i].Prest);
cval=Mev[i].PComp;
Expand Down Expand Up @@ -866,7 +868,7 @@ int U_AllotPrest(char plr,char mis)
case 12: i=5;break;
case 13: i=6;break;
}


if (other==1) {
if (mcode==10 || mcode==12 || mcode==13) return 0;
Expand Down
Loading

0 comments on commit f94cb09

Please sign in to comment.