Example #1
0
void PadDraw(char plr, char pad)
{
    int i, j, k, l;
    int missions;     // Variable for how many missions each 'naut has flown

    FadeOut(2, 10, 0, 0);
    display::graphics.screen()->clear();
    ShBox(0, 0, 319, 22);
    ShBox(0, 24, 319, 198);
    InBox(3, 3, 30, 19);
    IOBox(243, 3, 316, 19);
    InBox(167, 27, 316, 176);
    fill_rectangle(168, 28, 315, 175, 0);
    IOBox(167, 179, 316, 195);
    ShBox(4, 28, 162, 43);
    InBox(6, 30, 160, 41);
    ShBox(4, 46, 162, 61);
    InBox(6, 48, 160, 59);
    ShBox(4, 68, 162, 97);
    InBox(6, 70, 160, 95);
    ShBox(56, 64, 110, 74);
    InBox(57, 65, 109, 73);
    ShBox(4, 180, 162, 195);
    InBox(6, 182, 160, 193); //sched. duration
    InBox(6, 99, 160, 178);
    display::graphics.setForegroundColor(9);
    draw_string(18, 190, "SCHEDULED DURATION: ");
    display::graphics.setForegroundColor(7);
    int MisCod;
    MisCod = Data->P[plr].Mission[pad].MissionCode;

    if ((MisCod > 24 && MisCod < 37) || MisCod == 40 || MisCod == 41 || MisCod == 43 || MisCod == 44 || MisCod > 45)
        // Show Duration level for manned missions with Duration steps (this keeps the Mission[pad].Duration
        // variable from continuing to show Duration level if mission is scrubbed or downgraded) - Leon
    {
        switch (Data->P[plr].Mission[pad].Duration) {
        case 1:
            draw_string(0, 0, "A");
            break;

        case 2:
            draw_string(0, 0, "B");
            break;

        case 3:
            draw_string(0, 0, "C");
            break;

        case 4:
            draw_string(0, 0, "D");
            break;

        case 5:
            draw_string(0, 0, "E");
            break;

        case 6:
            draw_string(0, 0, "F");
            break;

        default:
            draw_string(0, 0, "NONE");
            break;
        }
    } else {
        if (Data->P[plr].Mission[pad].PCrew - 1 >= 0 || Data->P[plr].Mission[pad].BCrew - 1 >= 0) {
            draw_string(0, 0, "A");
        } else {
            draw_string(0, 0, "NONE");
        }
    }

    display::graphics.setForegroundColor(7);
    draw_string(65, 71, "MISSION");
    draw_small_flag(plr, 4, 4);

    if (Data->P[plr].LaunchFacility[pad] == 1 && Data->P[plr].Mission[pad].MissionCode) {
        PadPict(2 + plr);
    } else if (Data->P[plr].LaunchFacility[pad] == 1 && Data->P[plr].Mission[pad].MissionCode == Mission_None) {
        PadPict(4 + plr);
    } else if (Data->P[plr].LaunchFacility[pad] > 1) {
        PadPict(0 + plr);
    }

    display::graphics.setForegroundColor(1);
    draw_string(15, 37, "STATUS: ");
    display::graphics.setForegroundColor(9);

    if (Data->P[plr].LaunchFacility[pad] == 1) {
        draw_string(0, 0, "OPERATIONAL");
    } else {
        draw_string(0, 0, "DESTROYED");
    }

    display::graphics.setForegroundColor(1);

    if (Data->P[plr].LaunchFacility[pad] > 1) {
        draw_string(15, 56, "REPAIR COST: ");
        display::graphics.setForegroundColor(9);
        draw_number(0, 0, Data->P[plr].LaunchFacility[pad]);
        draw_string(0, 0, "MB");

        if (Data->P[plr].Cash < Data->P[plr].LaunchFacility[pad]) {
            InBox(169, 181, 314, 193);
        }
    } else {
        display::graphics.setForegroundColor(9);

        if (Data->P[plr].Mission[pad].MissionCode == Mission_None) {
            draw_string(15, 56, "NO LAUNCH SCHEDULED");
            InBox(169, 181, 314, 193);
        } else {
            draw_string(15, 56, "PRE-MISSION CHECK");
        }
    }

    display::graphics.setForegroundColor(1);
    draw_string(258, 13, "CONTINUE");

    if (Data->P[plr].LaunchFacility[pad] == 1) {
        display::graphics.setForegroundColor(9);
        draw_string(210, 189, "S");
        display::graphics.setForegroundColor(1);
        draw_string(0, 0, "CRUB MISSION");
    } else {
        display::graphics.setForegroundColor(9);
        draw_string(205, 189, "F");
        display::graphics.setForegroundColor(1);
        draw_string(0, 0, "IX LAUNCH PAD");
    }

    draw_heading(37, 5, "LAUNCH FACILITY", 0, -1);

    switch (pad) {
    case 0:
        draw_heading(201, 5, "A", 0, -1);
        break;

    case 1:
        draw_heading(201, 5, "B", 0, -1);
        break;

    case 2:
        draw_heading(201, 5, "C", 0, -1);
        break;
    }

    display::graphics.setForegroundColor(6);
    MissionName(Data->P[plr].Mission[pad].MissionCode, 11, 81, 20);
    display::graphics.setForegroundColor(1);

    // joint mission part
    if (Data->P[plr].Mission[pad].Joint == 1) {
        ShBox(38, 91, 131, 101);
        InBox(39, 92, 130, 100);
        display::graphics.setForegroundColor(1);

        if (Data->P[plr].Mission[pad].part == 0) {
            draw_string(53, 98, "PRIMARY PART");
        } else {
            draw_string(44, 98, "SECONDARY PART");
        }
    }

    // Hardware to Use

    i = Data->P[plr].Mission[pad].Prog;
    j = Data->P[plr].Mission[pad].PCrew - 1;
    l = Data->P[plr].Mission[pad].BCrew - 1;

    // Crews
    display::graphics.setForegroundColor(7);
    draw_string(13, 107, "PRIMARY CREW  ");

    if (j >= 0) {
        display::graphics.setForegroundColor(11); // Now display the crew number, for player's easy reference - Leon

        if (j == 0) {
            draw_string(0, 0, "(CREW I)");
        }

        if (j == 1) {
            draw_string(0, 0, "(CREW II)");
        }

        if (j == 2) {
            draw_string(0, 0, "(CREW III)");
        }

        if (j == 3) {
            draw_string(0, 0, "(CREW IV)");
        }

        if (j == 4) {
            draw_string(0, 0, "(CREW V)");
        }

        if (j == 5) {
            draw_string(0, 0, "(CREW VI)");
        }

        if (j == 6) {
            draw_string(0, 0, "(CREW VII)");
        }

        if (j == 7) {
            draw_string(0, 0, "(CREW VIII)");
        }

        for (k = 0; k < Data->P[plr].CrewCount[i][j]; k++) {
            // Draw a morale box for each crew member - Leon
            display::graphics.setForegroundColor(1);
            fill_rectangle(13, 110 + 7 * k, 20, 110 + 7 * k, 2); // Top
            fill_rectangle(13, 110 + 7 * k, 13, 116 + 7 * k, 2); // Left
            fill_rectangle(13, 116 + 7 * k, 20, 116 + 7 * k, 4); // Bottom
            fill_rectangle(21, 110 + 7 * k, 21, 116 + 7 * k, 4); // Right

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Mood >= 65) {
                fill_rectangle(14, 111 + 7 * k, 20, 115 + 7 * k, 16);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Mood < 65 && Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Mood >= 40) {
                fill_rectangle(14, 111 + 7 * k, 20, 115 + 7 * k, 11);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Mood < 40 && Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Mood >= 20) {
                fill_rectangle(14, 111 + 7 * k, 20, 115 + 7 * k, 8);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Mood < 20) {
                fill_rectangle(14, 111 + 7 * k, 20, 115 + 7 * k, 0);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Mood == 0) {
                fill_rectangle(14, 111 + 7 * k, 20, 115 + 7 * k, 3);
            }

            display::graphics.setForegroundColor(1);

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Sex == 1) {
                display::graphics.setForegroundColor(5);    // Show female 'nauts in blue
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].RetirementDelay > 0) {
                display::graphics.setForegroundColor(0);    // Show anyone who's announced retirement in black
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Sex == 1 && Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].RetirementDelay > 0) {
                display::graphics.setForegroundColor(7);
            }

            // Show name in purple if 'naut is female AND has announced retirement
            draw_string(25, 115 + 7 * k, &Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Name[0]);
            missions = Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Missions;

            if (missions > 0) {
                draw_string(0, 0, " (");
                draw_number(0, 0, missions);
                draw_string(0, 0, ")");
            }
        }

        if (l == -1) {
            draw_string(25, 174, "UNAVAILABLE");
        }
    }

    display::graphics.setForegroundColor(7);
    draw_string(13, 145, "BACKUP CREW  ");

    if (l >= 0) {
        display::graphics.setForegroundColor(11); // Now display the crew number, for player's easy reference - Leon

        if (l == 0) {
            draw_string(0, 0, "(CREW I)");
        }

        if (l == 1) {
            draw_string(0, 0, "(CREW II)");
        }

        if (l == 2) {
            draw_string(0, 0, "(CREW III)");
        }

        if (l == 3) {
            draw_string(0, 0, "(CREW IV)");
        }

        if (l == 4) {
            draw_string(0, 0, "(CREW V)");
        }

        if (l == 5) {
            draw_string(0, 0, "(CREW VI)");
        }

        if (l == 6) {
            draw_string(0, 0, "(CREW VII)");
        }

        if (l == 7) {
            draw_string(0, 0, "(CREW VIII)");
        }

        for (k = 0; k < Data->P[plr].CrewCount[i][l]; k++) {
            // Draw a morale box for each crew member - Leon
            display::graphics.setForegroundColor(1);
            fill_rectangle(13, 148 + 7 * k, 20, 148 + 7 * k, 2); // Top
            fill_rectangle(13, 148 + 7 * k, 13, 154 + 7 * k, 2); // Left
            fill_rectangle(13, 154 + 7 * k, 20, 154 + 7 * k, 4); // Bottom
            fill_rectangle(21, 148 + 7 * k, 21, 154 + 7 * k, 4); // Right

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Mood >= 65) {
                fill_rectangle(14, 149 + 7 * k, 20, 153 + 7 * k, 16);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Mood < 65 && Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Mood >= 40) {
                fill_rectangle(14, 149 + 7 * k, 20, 153 + 7 * k, 11);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Mood < 40 && Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Mood >= 20) {
                fill_rectangle(14, 149 + 7 * k, 20, 153 + 7 * k, 8);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Mood < 20) {
                fill_rectangle(14, 149 + 7 * k, 20, 153 + 7 * k, 0);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Mood == 0) {
                fill_rectangle(14, 149 + 7 * k, 20, 153 + 7 * k, 3);
            }

            display::graphics.setForegroundColor(1);

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Sex == 1) {
                display::graphics.setForegroundColor(5);    // Show female 'nauts in blue
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].RetirementDelay > 0) {
                display::graphics.setForegroundColor(0);    // But show anyone who's announced retirement in black
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Sex == 1 && Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].RetirementDelay > 0) {
                display::graphics.setForegroundColor(7);
            }

            // Show name in purple if 'naut is female AND has announced retirement
            draw_string(25, 153 + 7 * k, &Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Name[0]);
        }

        if (j == -1) {
            draw_string(25, 136, "UNAVAILABLE");
        }
    }

    if (Data->P[plr].Mission[pad].Prog > 0)
        PatchMe(plr, 126, 40, Data->P[plr].Mission[pad].Prog - 1,
                Data->P[plr].Mission[pad].Patch, 32);

    FadeIn(2, 10, 0, 0);

    return;
}
Example #2
0
void ShowAstrosHist(char plr)
{
    char pos = 0, pos2 = 0, glorf = 0;
    vhptr2 = new display::Surface(112, 55);
    abuf = (struct Astros *) buffer;

    if (Data->P[plr].AstroCount == 0) {
        return;
    }

    memcpy(abuf, Data->P[plr].Pool, sizeof(Data->P[plr].Pool));
    qsort((void *)abuf, Data->P[plr].AstroCount, sizeof(struct Astros), astcomp);

    FadeOut(2, display::graphics.palette(), 5, 0, 0);
    fill_rectangle(1, 39, 157, 184, 3);
    draw_heading(68, 71, "NO", 0, -1);
    draw_heading(46, 90, "MISSION", 0, -1);
    draw_heading(27, 109, "EXPERIENCE", 0, -1);
    vhptr2->copyFrom(display::graphics.screen(), 22, 69, 133, 123);
    PatchMe(0, 0, 0, 0, 0, 32);
    display::graphics.screen()->clear(0);

    ORBox(0, 0, 319, 22, 3); // Draw Inbox around top

    if (plr == 0) {
        draw_heading(45, 4, "ASTRONAUT HISTORY", 0, -1);
    } else {
        draw_heading(45, 4, "COSMONAUT HISTORY", 0, -1);
    }

    IRBox(243, 3, 316, 19, 0); // Inbox around cont box
    ORBox(245, 5, 314, 17, 3); // box for cont box
    InBox(3, 3, 31, 19); // USA inbox

    if (plr == 0) {
        draw_small_flag(0, 4, 4);
    } else {
        draw_small_flag(1, 4, 4);
    }

    display::graphics.setForegroundColor(1);
    draw_string(257, 13, "CONTINUE");
    ShBox(0, 24, 158, 199);
    ShBox(161, 24, 319, 199);
    InBox(233, 29, 314, 80);
    InBox(287, 104, 309, 134);
    IRBox(165, 175, 315, 196, 0);
    IRBox(6, 185, 153, 197, 0);
    ORBox(8, 187, 151, 195, 3);
    IRBox(6, 26, 153, 38, 0);
    ORBox(8, 28, 151, 36, 3);
    display::graphics.setForegroundColor(11);
    draw_string(165, 32, "NAME:");
    draw_string(165, 60, "TENURE:");
    draw_string(165, 78, "MISSIONS: ");
    draw_string(165, 89, "PRESTIGE: ");
    draw_string(165, 99, "SKILLS:");
    draw_string(165, 149, "SPACE DURATION:");
    draw_string(165, 159, "LOCATION: ");
    display::graphics.setForegroundColor(6);
    draw_string(174, 107, "CAPSULE PILOT: ");
    draw_string(174, 115, "L.M. PILOT: ");
    draw_string(174, 123, "E.V.A.: ");
    draw_string(174, 131, "DOCKING: ");
    draw_string(174, 139, "ENDURANCE: ");
    ORBox(167, 177, 202, 194, 3);
    ORBox(204, 177, 239, 194, 3);
    ORBox(241, 177, 276, 194, 3);
    ORBox(278, 177, 313, 194, 3);

    Display_ARROW(0, 179, 179); //left
    Display_ARROW(1, 213, 179); //left arrow
    Display_ARROW(2, 250, 179); //right
    Display_ARROW(3, 290, 179); //right arrow
    display::graphics.setForegroundColor(11);
    draw_string(37, 34, "PREVIOUS MISSION");
    draw_string(47, 193, "NEXT MISSION");
    DisplAst(plr, &pos, &pos2);
    DisplAstData(plr, &pos, &pos2);
    FadeIn(2, display::graphics.palette(), 5, 0, 0);

    WaitForMouseUp();

    while (1) {
        GetMouse();

        // Parse Button actions, note that continue button is not a macro
        if ((x >= 245 && y >= 5 && x <= 314 && y <= 17 && mousebuttons > 0) || key == K_ENTER) {
            InBox(245, 5, 314, 17);

            if (key > 0) {
                delay(300);
                key = 0;
            };

            WaitForMouseUp();

            OutBox(245, 5, 314, 17);

            delete vhptr2;

            vhptr2 = NULL;

            key = 0;

            return;
        }

        pButton(8, 187, 151, 195, UpAstroData(plr, &pos, &pos2), key >> 8, 80);
        pButton(8, 28, 151, 36, DownAstroData(plr, &pos, &pos2), key >> 8, 72);
        pButton(167, 177, 202, 194, ShowAstroBack(plr, &pos, &pos2), key >> 8, 71); //Down to prev Astro
        pButton(204, 177, 239, 194, ShowAstroDown(plr, &pos, &pos2), key >> 8, 75);
        pButton(241, 177, 276, 194, ShowAstroUp(plr, &pos, &pos2), key >> 8, 77);
        pButton(278, 177, 313, 194, ShowAstroFor(plr, &pos, &pos2), key >> 8, 79);

        if (key >= 'A' && key <= 'Z') {
            glorf = 0;

            while (abuf[glorf].Name[0] < key && glorf < Data->P[plr].AstroCount - 1) {
                glorf++;
            }

            pos = glorf;
            DisplAst(plr, &pos, &pos2);
            key = 0;
        }

        key = 0;
    };
}
Example #3
0
void ShowSpHist(char plr)
{
    int pos;

    FadeOut(2, display::graphics.palette(), 5, 0, 0);
    PatchMe(0, 0, 0, 0, 0, 32);
    display::graphics.screen()->clear(0);

    if ((Data->Year == 57 && Data->Season == 0) || Data->P[plr].PastMissionCount == 0) {
        pos = (Data->Year - 57) * 2 + Data->Season;
    } else pos = (Data->P[plr].History[Data->P[plr].PastMissionCount - 1].MissionYear - 57) * 2 +
                     ((Data->P[plr].History[Data->P[plr].PastMissionCount - 1].Month <= 5) ? 0 : 1);

    ORBox(0, 0, 319, 22, 3); // Draw Inbox around top
    draw_heading(48, 5, "MISSION HISTORY", 0, -1);
    IOBox(243, 3, 316, 19);
    InBox(3, 3, 31, 19); // USA inbox
    draw_small_flag(plr, 4, 4);
    display::graphics.setForegroundColor(1);
    draw_string(257, 13, "CONTINUE");

    ORBox(0, 24, 319, 199, 3);
    IRBox(4, 28, 315, 170, 0);
    IRBox(4, 174, 315, 195, 0);
    ORBox(7, 176, 49, 193, 3);
    ORBox(51, 176, 93, 193, 3);
    ORBox(95, 176, 224, 193, 3); //draw the boxes under date
    ORBox(226, 176, 268, 193, 3);
    ORBox(270, 176, 312, 193, 3);
    Display_ARROW(0, 23, 178); //left
    Display_ARROW(1, 63, 178); //left arrow
    Display_ARROW(2, 239, 178); //right
    Display_ARROW(3, 285, 178); //right arrow
    DrawMisHist(plr, &pos);
    FadeIn(2, display::graphics.palette(), 5, 0, 0);

    WaitForMouseUp();

    while (1) {
        GetMouse();
        Mission_Data_Buttons(plr, &pos);

        // Parse Button actions, note that return is embedded in first pButton
        if ((x >= 245 && y >= 5 && x <= 314 && y <= 17 && mousebuttons > 0) || key == K_ENTER) {
            InBox(245, 5, 314, 17);

            if (key > 0) {
                delay(300);
                key = 0;
            };

            WaitForMouseUp();

            OutBox(245, 5, 314, 17);

            return;
        }

        pButton(7, 176, 49, 193, FullRewind(plr, &pos), key >> 8, 71); //FullRewind Button etc..
        pButton(51, 176, 93, 193, RewindOne(plr, &pos), key >> 8, 75);
        pButton(226, 176, 268, 193, FastOne(plr, &pos), key >> 8, 77);
        pButton(270, 176, 312, 193, FullFast(plr, &pos), key >> 8, 79);
        key = 0;
    };
}
Example #4
0
void DrawMisHist(char plr, int *where)
{
    char cYr[5], mtext[51];
    char yr, season, i, j, index = 0, prog, planet, pmis, temp = 0, temp2 = 11;


    //ai klugge

    for (i = 0; i < Data->P[plr].PastMissionCount; i++) {
        if (Data->P[plr].History[i].MissionCode == Mission_Jt_LunarLanding_EOR || Data->P[plr].History[i].MissionCode == Mission_Jt_LunarLanding_LOR) {
            for (j = 0; j < 4; j++)
                if (Data->P[plr].History[i].Man[PAD_A][j] != -1) {
                    Data->P[plr].History[i].Man[PAD_B][j] = Data->P[plr].History[i].Man[PAD_A][j];
                    Data->P[plr].History[i].Man[PAD_A][j] = -1;
                }
        }
    }

    yr = (*where - (*where % 2)) / 2 + 57;
    season = *where % 2;
    ORBox(95, 176, 224, 193, 3); //draw the boxes under date
    sprintf(cYr, "%d", 1900 + yr);
    draw_heading(103 + (yr - 57) * 4, 178, cYr, 0, -1);

    fill_rectangle(5, 29, 314, 169, 0);
    display::graphics.setForegroundColor(7 + 3 * plr);

    for (i = 0; i < 7; i++) {
        pline(13 + 49 * i, 29, 13 + 49 * i, 169);
    }

    display::graphics.setForegroundColor(12);

    if (*where % 2 == 0) for (i = 0; i < 6; i++) {
            strncpy(cYr, Month[i], 3);
            cYr[3] = 0;
            draw_string(29 + 49 * i, 36, cYr);
        }
    else for (i = 0; i < 6; i++) {
            strncpy(cYr, Month[i + 6], 3);
            cYr[3] = 0;
            draw_string(29 + 49 * i, 36, cYr);
        }


    // What the hell does this do

    while (yr > Data->P[plr].History[index].MissionYear) {
        index++;
    }

    if (Data->P[plr].History[index].MissionYear > yr) {

        return;
    }

    if (season == 1) {
        while (Data->P[plr].History[index].Month < 6 && yr == Data->P[plr].History[index].MissionYear) {
            index++;
        }

        if (Data->P[plr].History[index].MissionYear > yr) {

            return;
        }
    }

    do {
        if (Data->P[plr].History[index].Month >= 6 && season == 0) {
            break;
        }

        j = (Data->P[plr].History[index].Month < 6) ? Data->P[plr].History[index].Month
            : Data->P[plr].History[index].Month - 6;



        // first check for joint missions
        if (Data->P[plr].History[index].Hard[PAD_B][Mission_Capsule] > 0) {
            sprintf(mtext, "%s", Data->P[plr].History[index].MissionName[1]);
            display::graphics.setForegroundColor(11);
            draw_string(35 + 49 * j - strlen(mtext) / 2 * 5, 45 + 40 * temp, mtext);

            if (Data->P[plr].History[index].Man[PAD_A][0] != -1 && Data->P[plr].History[index].Hard[PAD_B][Mission_Capsule] != -1) {
                PatchMe(plr, 10 + 49 * j, 50 + 40 * temp, Data->P[plr].History[index].Hard[PAD_A][Mission_Capsule],
                        Data->P[plr].History[index].Patch[0], 32);
            }

            if (Data->P[plr].History[index].Man[PAD_B][0] != -1 && Data->P[plr].History[index].Hard[PAD_B][Mission_Capsule] != -1) {
                PatchMe(plr, 42 + 49 * j, 50 + 40 * temp, Data->P[plr].History[index].Hard[PAD_B][Mission_Capsule],
                        Data->P[plr].History[index].Patch[1], 32);
            }

            // FIXME: Same test on either side of this.  Need to research what was intended.
            if (Data->P[plr].History[index].Hard[PAD_B][Mission_Capsule] != -1 && Data->P[plr].History[index].Hard[PAD_B][Mission_Capsule] != -1) {
                if (Data->P[plr].History[index].Hard[PAD_A][Mission_Capsule] != -1 && Data->P[plr].History[index].Man[PAD_A][Mission_Capsule] != -1) {
                    planet = 0;
                    prog = Data->P[plr].History[index].Hard[PAD_A][Mission_Capsule];
                    SmHardMe(plr, 44 + 38 * j, 50 + 40 * temp, prog, planet, 64);
                }

                pmis = Data->P[plr].History[index].MissionCode;

                if (pmis == 55 || pmis == 56) {
                    temp2 = 0;
                } else {
                    temp2 = 11;
                }

                planet = 0;
                prog = Data->P[plr].History[index].Hard[PAD_B][Mission_Capsule];
                SmHardMe(plr, 44 + (38 + temp2)*j, 50 + 40 * temp, prog, planet, 64);
            }

            //else
            // {
            //  prog = (Data->P[plr].History[index].Hard[PAD_A][0] != -1) ?
            //  Data->P[plr].History[index].Hard[PAD_A][0] :
            //  Data->P[plr].History[index].Hard[PAD_A][3]+5;
            //  planet=0;
            //  SmHardMe(plr,44+49*j,50+40*temp,prog,planet,64);
            // }
        } else {
            //fix-Handle Joint Missions
            if (Data->P[plr].History[index].Hard[PAD_A][Mission_Capsule] != -1 && Data->P[plr].History[index].Man[PAD_A][0] != -1) {
                PatchMe(plr, 10 + 49 * j, 50 + 40 * temp, Data->P[plr].History[index].Hard[PAD_A][Mission_Capsule],
                        Data->P[plr].History[index].Patch[0], 32);
            }

            if (Data->P[plr].History[index].Hard[PAD_B][Mission_Capsule] != -1 && Data->P[plr].History[index].Man[PAD_B][0] != -1) {
                prog = Data->P[plr].History[index].Hard[PAD_B][Mission_Capsule];
            } else {
                prog = (Data->P[plr].History[index].Hard[PAD_A][Mission_Capsule] != -1) ?
                       Data->P[plr].History[index].Hard[PAD_A][Mission_Capsule] :
                       Data->P[plr].History[index].Hard[PAD_A][Mission_Probe_DM] + 5;
            }

            pmis = Data->P[plr].History[index].MissionCode;

            if (prog == 6 && pmis == 9) {
                planet = 2;
            } else if (prog == 6 && pmis == 10) {
                planet = 3;
            } else if (prog == 6 && pmis == 11) {
                planet = 1;
            } else if (prog == 6 && pmis == 12) {
                planet = 4;
            } else if (prog == 6 && pmis == 13) {
                planet = 5;
            } else if (pmis == 0) {
                planet = 7;
            } else if (pmis == 1) {
                planet = 7;
            } else if (pmis == 7) {
                planet = 6;
            } else if (pmis == 8) {
                planet = 6;
            } else {
                planet = 0;
            }

            sprintf(mtext, "%s", Data->P[plr].History[index].MissionName[0]);
            display::graphics.setForegroundColor(11);
            draw_string(35 + 49 * j - strlen(mtext) / 2 * 5, 45 + 40 * temp, mtext);
            SmHardMe(plr, 44 + 49 * j, 50 + 40 * temp, prog, planet, 64);
        }

        temp++;
        index++;
    } while (Data->P[plr].History[index].MissionYear == yr);

    return;
}
Example #5
0
void DisplAstData(char plr, char *where, char *where2)
{
    int num = abuf[*where].MissionNum[*where2], num2;

    fill_rectangle(1, 40, 157, 182, 3);

    if (abuf[*where].Missions == 0) {
        vhptr2->copyTo(display::graphics.screen(), 22, 69);
        return;
    }

    display::graphics.setForegroundColor(2);
    pline(20, 111, 138, 111);
    display::graphics.setForegroundColor(4);
    pline(20, 113, 138, 113);


    if (Data->P[plr].History[num].Hard[PAD_A][Mission_Capsule] != -1) {
        PatchMe(plr, 7, 41, Data->P[plr].History[num].Hard[PAD_A][Mission_Capsule], Data->P[plr].History[num].Patch[0], 32);
    } else {
        PatchMe(plr, 7, 41, Data->P[plr].History[num].Hard[PAD_B][Mission_Capsule], Data->P[plr].History[num].Patch[1], 32);
    }

    display::graphics.setForegroundColor(1);
    draw_string(43, 53, "PRESTIGE: ");
    draw_number(93, 53, Data->P[plr].History[num].Prestige);
    draw_string(43, 63, "DURATION: ");

    switch (Data->P[plr].History[num].Duration) {
    case 1:
        draw_string(93, 63, "A");
        break;

    case 2:
        draw_string(93, 63, "B");
        break;

    case 3:
        draw_string(93, 63, "C");
        break;

    case 4:
        draw_string(93, 63, "D");
        break;

    case 5:
        draw_string(93, 63, "E");
        break;

    case 6:
        draw_string(93, 63, "F");
        break;

    default:
        break;
    }

    draw_string(10, 83, "DESCRIPTION: ");

    display::graphics.setForegroundColor(9);
    draw_string(43, 45, &Data->P[plr].History[num].MissionName[0][0]);

    GetMisType(Data->P[plr].History[num].MissionCode);
    draw_string(10, 93, Mis.Abbr);

    if (*where2 == abuf[*where].Missions - 1) {
        fill_rectangle(1, 114, 157, 184, 3);

        return;
    }

    num2 = abuf[*where].MissionNum[*where2 + 1];

    if (num2 < 1 || num2 > 56) {
        return;
    }

    //astro history patch fix
    if (Data->P[plr].History[num2].Hard[PAD_A][Mission_Capsule] != -1) {
        PatchMe(plr, 7, 116, Data->P[plr].History[num2].Hard[PAD_A][Mission_Capsule], Data->P[plr].History[num2].Patch[0], 32);
    } else {
        PatchMe(plr, 7, 116, Data->P[plr].History[num2].Hard[PAD_B][Mission_Capsule], Data->P[plr].History[num2].Patch[1], 32);
    }

    display::graphics.setForegroundColor(9);
    draw_string(43, 120, &Data->P[plr].History[num2].MissionName[0][0]);

    GetMisType(Data->P[plr].History[num2].MissionCode);
    draw_string(10, 168, Mis.Abbr);

    display::graphics.setForegroundColor(1);
    draw_string(43, 128, "PRESTIGE: ");
    draw_number(93, 128, Data->P[plr].History[num2].Prestige);
    draw_string(43, 138, "DURATION: ");

    switch (Data->P[plr].History[num2].Duration) {
    case 1:
        draw_string(93, 138, "A");
        break;

    case 2:
        draw_string(93, 138, "B");
        break;

    case 3:
        draw_string(93, 138, "C");
        break;

    case 4:
        draw_string(93, 138, "D");
        break;

    case 5:
        draw_string(93, 138, "E");
        break;

    case 6:
        draw_string(93, 138, "F");
        break;

    default:
        break;
    }

    draw_string(10, 158, "DESCRIPTION: ");

    return;
}