7 //==========================================================================
\r
17 void ClearSplitVWB (void)
\r
19 memset (update,0,sizeof(update));
\r
27 //==========================================================================
\r
31 ////////////////////////////////////////////////////////
\r
33 // End of Spear of Destiny
\r
35 ////////////////////////////////////////////////////////
\r
37 void EndScreen (int palette, int screen)
\r
39 CA_CacheScreen (screen);
\r
41 CA_CacheGrChunk (palette);
\r
42 VL_FadeIn(0,255,grsegs[palette],30);
\r
43 UNCACHEGRCHUNK (palette);
\r
44 IN_ClearKeysDown ();
\r
52 EndScreen (END1PALETTE, ENDSCREEN11PIC);
\r
54 CA_CacheScreen (ENDSCREEN3PIC);
\r
56 CA_CacheGrChunk (END3PALETTE);
\r
57 VL_FadeIn(0,255,grsegs[END3PALETTE],30);
\r
58 UNCACHEGRCHUNK (END3PALETTE);
\r
65 US_CPrint (STR_ENDGAME1"\n");
\r
66 US_CPrint (STR_ENDGAME2);
\r
70 while (!IN_CheckAck () && TimeCount < 700);
\r
74 VWB_Bar(0,180,320,20,0);
\r
75 US_CPrint (STR_ENDGAME3"\n");
\r
76 US_CPrint (STR_ENDGAME4);
\r
80 while (!IN_CheckAck () && TimeCount < 700);
\r
84 EndScreen (END4PALETTE, ENDSCREEN4PIC);
\r
85 EndScreen (END5PALETTE, ENDSCREEN5PIC);
\r
86 EndScreen (END6PALETTE, ENDSCREEN6PIC);
\r
87 EndScreen (END7PALETTE, ENDSCREEN7PIC);
\r
88 EndScreen (END8PALETTE, ENDSCREEN8PIC);
\r
89 EndScreen (END9PALETTE, ENDSCREEN9PIC);
\r
91 EndScreen (END2PALETTE, ENDSCREEN12PIC);
\r
93 MainMenu[savegame].active = 0;
\r
98 //==========================================================================
\r
108 void Victory (void)
\r
112 int i,min,kr,sr,tr,x;
\r
122 StartCPMusic (XTHEEND_MUS);
\r
124 CA_CacheGrChunk(BJCOLLAPSE1PIC);
\r
125 CA_CacheGrChunk(BJCOLLAPSE2PIC);
\r
126 CA_CacheGrChunk(BJCOLLAPSE3PIC);
\r
127 CA_CacheGrChunk(BJCOLLAPSE4PIC);
\r
129 VWB_Bar(0,0,320,200,VIEWCOLOR);
\r
130 VWB_DrawPic (124,44,BJCOLLAPSE1PIC);
\r
131 VW_UpdateScreen ();
\r
134 VWB_DrawPic (124,44,BJCOLLAPSE2PIC);
\r
135 VW_UpdateScreen ();
\r
137 VWB_DrawPic (124,44,BJCOLLAPSE3PIC);
\r
138 VW_UpdateScreen ();
\r
140 VWB_DrawPic (124,44,BJCOLLAPSE4PIC);
\r
141 VW_UpdateScreen ();
\r
144 UNCACHEGRCHUNK(BJCOLLAPSE1PIC);
\r
145 UNCACHEGRCHUNK(BJCOLLAPSE2PIC);
\r
146 UNCACHEGRCHUNK(BJCOLLAPSE3PIC);
\r
147 UNCACHEGRCHUNK(BJCOLLAPSE4PIC);
\r
148 VL_FadeOut (0,255,0,17,17,5);
\r
151 StartCPMusic (URAHERO_MUS);
\r
153 CacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END);
\r
154 CA_CacheGrChunk(STARTFONT);
\r
157 CA_CacheGrChunk(C_TIMECODEPIC);
\r
161 VWB_Bar (0,0,320,200-STATUSLINES,127);
\r
164 CA_CacheGrChunk(C_ENDRATIOSPIC);
\r
165 VWB_DrawPic(0,0,C_ENDRATIOSPIC);
\r
166 UNCACHEGRCHUNK(C_ENDRATIOSPIC);
\r
169 Write(18,2,STR_YOUWIN);
\r
171 Write(TIMEX,TIMEY-2,STR_TOTALTIME);
\r
173 Write(12,RATIOY-2,"averages");
\r
176 Write(RATIOX+2, RATIOY, STR_RATKILL);
\r
177 Write(RATIOX+2, RATIOY+2, STR_RATSECRET);
\r
178 Write(RATIOX+2, RATIOY+4,STR_RATTREASURE);
\r
180 Write(RATIOX+8,RATIOY, STR_RATKILL);
\r
181 Write(RATIOX+4,RATIOY+2, STR_RATSECRET);
\r
182 Write(RATIOX, RATIOY+4,STR_RATTREASURE);
\r
188 VWB_DrawPic (8,4,L_BJWINSPIC);
\r
193 for (kr = sr = tr = sec = i = 0;i < 8;i++)
\r
195 for (kr = sr = tr = sec = i = 0;i < 20;i++)
\r
198 sec += LevelRatios[i].time;
\r
199 kr += LevelRatios[i].kill;
\r
200 sr += LevelRatios[i].secret;
\r
201 tr += LevelRatios[i].treasure;
\r
221 VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(min/10));
\r
223 VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(min%10));
\r
225 Write(i/8,TIMEY,":");
\r
227 VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(sec/10));
\r
229 VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(sec%10));
\r
230 VW_UpdateScreen ();
\r
232 itoa(kr,tempstr,10);
\r
233 x=RATIOX+24-strlen(tempstr)*2;
\r
234 Write(x,RATIOY,tempstr);
\r
236 itoa(sr,tempstr,10);
\r
237 x=RATIOX+24-strlen(tempstr)*2;
\r
238 Write(x,RATIOY+2,tempstr);
\r
240 itoa(tr,tempstr,10);
\r
241 x=RATIOX+24-strlen(tempstr)*2;
\r
242 Write(x,RATIOY+4,tempstr);
\r
249 // TOTAL TIME VERIFICATION CODE
\r
251 if (gamestate.difficulty>=gd_medium)
\r
253 VWB_DrawPic (30*8,TIMEY*8,C_TIMECODEPIC);
\r
255 fontcolor = READHCOLOR;
\r
257 PrintY = TIMEY*8+8;
\r
259 tempstr[0] = (((min/10)^(min%10))^0xa)+'A';
\r
260 tempstr[1] = (((sec/10)^(sec%10))^0xa)+'A';
\r
261 tempstr[2] = (tempstr[0]^tempstr[1])+'A';
\r
272 VW_UpdateScreen ();
\r
278 if (Keyboard[sc_P] && MS_CheckParm("goobers"))
\r
285 UNCACHEGRCHUNK(C_TIMECODEPIC);
\r
287 UnCacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END);
\r
295 #endif // SPEARDEMO
\r
299 //==========================================================================
\r
313 VWB_Bar(0,0,320,200,0x82); // background
\r
315 CA_CacheGrChunk (PG13PIC);
\r
316 VWB_DrawPic (216,110,PG13PIC);
\r
317 VW_UpdateScreen ();
\r
319 UNCACHEGRCHUNK (PG13PIC);
\r
322 IN_UserInput(TickBase*7);
\r
329 //==========================================================================
\r
331 void Write(int x,int y,char *string)
\r
333 int alpha[]={L_NUM0PIC,L_NUM1PIC,L_NUM2PIC,L_NUM3PIC,L_NUM4PIC,L_NUM5PIC,
\r
334 L_NUM6PIC,L_NUM7PIC,L_NUM8PIC,L_NUM9PIC,L_COLONPIC,0,0,0,0,0,0,L_APIC,L_BPIC,
\r
335 L_CPIC,L_DPIC,L_EPIC,L_FPIC,L_GPIC,L_HPIC,L_IPIC,L_JPIC,L_KPIC,
\r
336 L_LPIC,L_MPIC,L_NPIC,L_OPIC,L_PPIC,L_QPIC,L_RPIC,L_SPIC,L_TPIC,
\r
337 L_UPIC,L_VPIC,L_WPIC,L_XPIC,L_YPIC,L_ZPIC};
\r
345 for (i=0;i<strlen(string);i++)
\r
346 if (string[i]=='\n')
\r
361 VWB_DrawPic(nx,ny,L_EXPOINTPIC);
\r
366 VWB_DrawPic(nx,ny,L_APOSTROPHEPIC);
\r
373 VWB_DrawPic(nx,ny,L_COLONPIC);
\r
378 VWB_DrawPic(nx,ny,L_PERCENTPIC);
\r
382 VWB_DrawPic(nx,ny,alpha[ch]);
\r
390 // Breathe Mr. BJ!!!
\r
392 void BJ_Breathe(void)
\r
394 static int which=0,max=10;
\r
395 int pics[2]={L_GUYPIC,L_GUY2PIC};
\r
401 VWB_DrawPic(0,16,pics[which]);
\r
415 = Entered with the screen faded out
\r
416 = Still in split screen mode with the status bar
\r
418 = Exit with the screen faded out
\r
424 LRstruct LevelRatios[8];
\r
426 LRstruct LevelRatios[20];
\r
429 void LevelCompleted (void)
\r
432 #define PAR_AMOUNT 500
\r
433 #define PERCENT100AMT 10000
\r
439 int x,i,min,sec,ratio,kr,sr,tr;
\r
442 long bonus,timeleft=0;
\r
447 // Episode One Par Times
\r
457 {0, "??:??"}, // Boss level
\r
458 {0, "??:??"}, // Secret level
\r
461 // Episode Two Par Times
\r
475 // Episode Three Par Times
\r
489 // Episode Four Par Times
\r
503 // Episode Five Par Times
\r
517 // Episode Six Par Times
\r
531 // SPEAR OF DESTINY TIMES
\r
537 {0, "??:??"}, // Boss 1
\r
542 {0, "??:??"}, // Boss 2
\r
548 {0, "??:??"}, // Boss 3
\r
550 {0, "??:??"}, // Boss 4
\r
551 {0, "??:??"}, // Secret level 1
\r
552 {0, "??:??"}, // Secret level 2
\r
558 CacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END);
\r
559 ClearSplitVWB (); // set up for double buffering in split screen
\r
560 VWB_Bar (0,0,320,200-STATUSLINES,127);
\r
561 StartCPMusic(ENDLEVEL_MUS);
\r
564 // do the intermission
\r
566 IN_ClearKeysDown();
\r
570 CA_CacheGrChunk(C_INTERMISSIONPIC);
\r
571 VWB_DrawPic(0,0,C_INTERMISSIONPIC);
\r
572 UNCACHEGRCHUNK(C_INTERMISSIONPIC);
\r
574 VWB_DrawPic(0,16,L_GUYPIC);
\r
587 Write(14,2,"piso\ncompletado");
\r
589 Write(14,2,"floor\ncompleted");
\r
592 Write(14,7,STR_BONUS" 0");
\r
593 Write(16,10,STR_TIME);
\r
594 Write(16,12,STR_PAR);
\r
597 Write(11,14, STR_RAT2KILL);
\r
598 Write(11,16, STR_RAT2SECRET);
\r
599 Write(11,18,STR_RAT2TREASURE);
\r
601 Write(9,14, STR_RAT2KILL);
\r
602 Write(5,16, STR_RAT2SECRET);
\r
603 Write(1,18,STR_RAT2TREASURE);
\r
606 Write(26,2,itoa(gamestate.mapon+1,tempstr,10));
\r
610 Write(30,12,parTimes[gamestate.episode*10+mapon].timestr);
\r
612 Write(26,12,parTimes[gamestate.episode*10+mapon].timestr);
\r
618 sec=gamestate.TimeCount/70;
\r
620 if (sec > 99*60) // 99 minutes max
\r
623 if (gamestate.TimeCount<parTimes[gamestate.episode*10+mapon].time*4200)
\r
624 timeleft=(parTimes[gamestate.episode*10+mapon].time*4200)/70-sec;
\r
634 VWB_DrawPic(i,10*8,L_NUM0PIC+(min/10));
\r
636 VWB_DrawPic(i,10*8,L_NUM0PIC+(min%10));
\r
640 VWB_DrawPic(i,10*8,L_NUM0PIC+(sec/10));
\r
642 VWB_DrawPic(i,10*8,L_NUM0PIC+(sec%10));
\r
644 VW_UpdateScreen ();
\r
649 // FIGURE RATIOS OUT BEFOREHAND
\r
652 if (gamestate.killtotal)
\r
653 kr=(gamestate.killcount*100)/gamestate.killtotal;
\r
654 if (gamestate.secrettotal)
\r
655 sr=(gamestate.secretcount*100)/gamestate.secrettotal;
\r
656 if (gamestate.treasuretotal)
\r
657 tr=(gamestate.treasurecount*100)/gamestate.treasuretotal;
\r
661 // PRINT TIME BONUS
\r
663 bonus=timeleft*PAR_AMOUNT;
\r
666 for (i=0;i<=timeleft;i++)
\r
668 ltoa((long)i*PAR_AMOUNT,tempstr,10);
\r
669 x=36-strlen(tempstr)*2;
\r
670 Write(x,7,tempstr);
\r
671 if (!(i%(PAR_AMOUNT/10)))
\r
672 SD_PlaySound(ENDBONUS1SND);
\r
674 while(SD_SoundPlaying())
\r
681 SD_PlaySound(ENDBONUS2SND);
\r
682 while(SD_SoundPlaying())
\r
696 for (i=0;i<=ratio;i++)
\r
698 itoa(i,tempstr,10);
\r
699 x=RATIOXX-strlen(tempstr)*2;
\r
700 Write(x,14,tempstr);
\r
702 SD_PlaySound(ENDBONUS1SND);
\r
703 VW_UpdateScreen ();
\r
704 while(SD_SoundPlaying())
\r
712 VW_WaitVBL(VBLWAIT);
\r
714 bonus+=PERCENT100AMT;
\r
715 ltoa(bonus,tempstr,10);
\r
716 x=(RATIOXX-1)-strlen(tempstr)*2;
\r
717 Write(x,7,tempstr);
\r
719 SD_PlaySound(PERCENT100SND);
\r
724 VW_WaitVBL(VBLWAIT);
\r
726 SD_PlaySound(NOBONUSSND);
\r
729 SD_PlaySound(ENDBONUS2SND);
\r
732 while(SD_SoundPlaying())
\r
740 for (i=0;i<=ratio;i++)
\r
742 itoa(i,tempstr,10);
\r
743 x=RATIOXX-strlen(tempstr)*2;
\r
744 Write(x,16,tempstr);
\r
746 SD_PlaySound(ENDBONUS1SND);
\r
747 VW_UpdateScreen ();
\r
748 while(SD_SoundPlaying())
\r
757 VW_WaitVBL(VBLWAIT);
\r
759 bonus+=PERCENT100AMT;
\r
760 ltoa(bonus,tempstr,10);
\r
761 x=(RATIOXX-1)-strlen(tempstr)*2;
\r
762 Write(x,7,tempstr);
\r
764 SD_PlaySound(PERCENT100SND);
\r
769 VW_WaitVBL(VBLWAIT);
\r
771 SD_PlaySound(NOBONUSSND);
\r
774 SD_PlaySound(ENDBONUS2SND);
\r
776 while(SD_SoundPlaying())
\r
784 for (i=0;i<=ratio;i++)
\r
786 itoa(i,tempstr,10);
\r
787 x=RATIOXX-strlen(tempstr)*2;
\r
788 Write(x,18,tempstr);
\r
790 SD_PlaySound(ENDBONUS1SND);
\r
791 VW_UpdateScreen ();
\r
792 while(SD_SoundPlaying())
\r
799 VW_WaitVBL(VBLWAIT);
\r
801 bonus+=PERCENT100AMT;
\r
802 ltoa(bonus,tempstr,10);
\r
803 x=(RATIOXX-1)-strlen(tempstr)*2;
\r
804 Write(x,7,tempstr);
\r
806 SD_PlaySound(PERCENT100SND);
\r
811 VW_WaitVBL(VBLWAIT);
\r
813 SD_PlaySound(NOBONUSSND);
\r
816 SD_PlaySound(ENDBONUS2SND);
\r
818 while(SD_SoundPlaying())
\r
823 // JUMP STRAIGHT HERE IF KEY PRESSED
\r
827 itoa(kr,tempstr,10);
\r
828 x=RATIOXX-strlen(tempstr)*2;
\r
829 Write(x,14,tempstr);
\r
831 itoa(sr,tempstr,10);
\r
832 x=RATIOXX-strlen(tempstr)*2;
\r
833 Write(x,16,tempstr);
\r
835 itoa(tr,tempstr,10);
\r
836 x=RATIOXX-strlen(tempstr)*2;
\r
837 Write(x,18,tempstr);
\r
839 bonus=(long)timeleft*PAR_AMOUNT+
\r
840 (PERCENT100AMT*(kr==100))+
\r
841 (PERCENT100AMT*(sr==100))+
\r
842 (PERCENT100AMT*(tr==100));
\r
845 ltoa(bonus,tempstr,10);
\r
846 x=36-strlen(tempstr)*2;
\r
847 Write(x,7,tempstr);
\r
850 // SAVE RATIO INFORMATION FOR ENDGAME
\r
852 LevelRatios[mapon].kill=kr;
\r
853 LevelRatios[mapon].secret=sr;
\r
854 LevelRatios[mapon].treasure=tr;
\r
855 LevelRatios[mapon].time=min*60+sec;
\r
863 case 4: Write(14,4," trans\n"
\r
865 STR_DEFEATED); break;
\r
866 case 9: Write(14,4,"barnacle\n"
\r
868 STR_DEFEATED); break;
\r
869 case 15: Write(14,4,"ubermutant\n"
\r
870 STR_DEFEATED); break;
\r
871 case 17: Write(14,4," death\n"
\r
873 STR_DEFEATED); break;
\r
874 case 18: Write(13,4,"secret tunnel\n"
\r
876 " completed!"); break;
\r
877 case 19: Write(13,4,"secret castle\n"
\r
879 " completed!"); break;
\r
883 Write(14,4,"secret floor\n completed!");
\r
886 Write(10,16,"15000 bonus!");
\r
900 while(!IN_CheckAck())
\r
907 if (gamestate.mapon == 1)
\r
909 SD_PlaySound (BONUS1UPSND);
\r
911 CA_CacheGrChunk (STARTFONT+1);
\r
912 Message ("This concludes your demo\n"
\r
913 "of Spear of Destiny! Now,\n"
\r
914 "go to your local software\n"
\r
915 "store and buy it!");
\r
916 UNCACHEGRCHUNK (STARTFONT+1);
\r
918 IN_ClearKeysDown();
\r
924 if (gamestate.mapon == 3)
\r
926 SD_PlaySound (BONUS1UPSND);
\r
928 CA_CacheGrChunk (STARTFONT+1);
\r
929 Message ("This concludes your demo\n"
\r
930 "of Wolfenstein 3-D! Now,\n"
\r
931 "go to your local software\n"
\r
932 "store and buy it!");
\r
933 UNCACHEGRCHUNK (STARTFONT+1);
\r
935 IN_ClearKeysDown();
\r
941 if (Keyboard[sc_P] && MS_CheckParm("goobers"))
\r
949 bufferofs = screenloc[i];
\r
954 UnCacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END);
\r
959 //==========================================================================
\r
967 = Fill the cache up
\r
972 boolean PreloadUpdate(unsigned current, unsigned total)
\r
974 unsigned w = WindowW - 10;
\r
977 VWB_Bar(WindowX + 5,WindowY + WindowH - 3,w,2,BLACK);
\r
978 w = ((long)w * current) / total;
\r
981 VWB_Bar(WindowX + 5,WindowY + WindowH - 3,w,2,0x37); //SECONDCOLOR);
\r
982 VWB_Bar(WindowX + 5,WindowY + WindowH - 3,w-1,1,0x32);
\r
986 // if (LastScan == sc_Escape)
\r
988 // IN_ClearKeysDown();
\r
995 void PreloadGraphics(void)
\r
998 ClearSplitVWB (); // set up for double buffering in split screen
\r
1000 VWB_Bar (0,0,320,200-STATUSLINES,127);
\r
1002 LatchDrawPic (20-14,80-3*8,GETPSYCHEDPIC);
\r
1004 WindowX = 160-14*8;
\r
1008 VW_UpdateScreen();
\r
1011 PM_Preload (PreloadUpdate);
\r
1012 IN_UserInput (70);
\r
1015 DrawPlayBorder ();
\r
1016 VW_UpdateScreen ();
\r
1020 //==========================================================================
\r
1023 ==================
\r
1027 ==================
\r
1030 void DrawHighScores(void)
\r
1032 char buffer[16],*str,buffer1[5];
\r
1033 byte temp,temp1,temp2,temp3;
\r
1043 // CA_CacheGrChunk (C_CODEPIC);
\r
1044 CA_CacheGrChunk (HIGHSCORESPIC);
\r
1045 CA_CacheGrChunk (STARTFONT);
\r
1046 CA_CacheGrChunk (C_LEVELPIC);
\r
1047 CA_CacheGrChunk (C_SCOREPIC);
\r
1048 CA_CacheGrChunk (C_NAMEPIC);
\r
1053 VWB_DrawPic(48,0,HIGHSCORESPIC);
\r
1054 UNCACHEGRCHUNK (HIGHSCORESPIC);
\r
1056 VWB_DrawPic(4*8,68,C_NAMEPIC);
\r
1057 VWB_DrawPic(20*8,68,C_LEVELPIC);
\r
1058 VWB_DrawPic(28*8,68,C_SCOREPIC);
\r
1060 // VWB_DrawPic(35*8,68,C_CODEPIC);
\r
1065 CacheLump (BACKDROP_LUMP_START,BACKDROP_LUMP_END);
\r
1068 UnCacheLump (BACKDROP_LUMP_START,BACKDROP_LUMP_END);
\r
1070 CacheLump (HIGHSCORES_LUMP_START,HIGHSCORES_LUMP_END);
\r
1071 CA_CacheGrChunk (STARTFONT+1);
\r
1072 VWB_DrawPic (0,0,HIGHSCORESPIC);
\r
1079 SETFONTCOLOR(15,0x29);
\r
1081 SETFONTCOLOR(HIGHLIGHT,0x29);
\r
1084 for (i = 0,s = Scores;i < MaxScores;i++,s++)
\r
1086 PrintY = 76 + (16 * i);
\r
1096 US_Print(s->name);
\r
1101 ultoa(s->completed,buffer,10);
\r
1103 for (str = buffer;*str;str++)
\r
1104 *str = *str + (129 - '0'); // Used fixed-width numbers (129...)
\r
1105 USL_MeasureString(buffer,&w,&h);
\r
1106 PrintX = (22 * 8)-w;
\r
1108 USL_MeasureString(buffer,&w,&h);
\r
1115 itoa(s->episode+1,buffer1,10);
\r
1117 US_Print(buffer1);
\r
1123 if (s->completed == 21)
\r
1124 VWB_DrawPic (PrintX+8,PrintY-1,C_WONSPEARPIC);
\r
1132 ultoa(s->score,buffer,10);
\r
1134 for (str = buffer;*str;str++)
\r
1135 *str = *str + (129 - '0'); // Used fixed-width numbers (129...)
\r
1136 USL_MeasureString(buffer,&w,&h);
\r
1137 PrintX = (34 * 8) - 8 - w;
\r
1139 USL_MeasureString(buffer,&w,&h);
\r
1152 temp=(((s->score >> 28)& 0xf)^
\r
1153 ((s->score >> 24)& 0xf))+'A';
\r
1154 temp1=(((s->score >> 20)& 0xf)^
\r
1155 ((s->score >> 16)& 0xf))+'A';
\r
1156 temp2=(((s->score >> 12)& 0xf)^
\r
1157 ((s->score >> 8)& 0xf))+'A';
\r
1158 temp3=(((s->score >> 4)& 0xf)^
\r
1159 ((s->score >> 0)& 0xf))+'A';
\r
1161 SETFONTCOLOR(0x49,0x29);
\r
1169 SETFONTCOLOR(15,0x29);
\r
1176 VW_UpdateScreen ();
\r
1179 UnCacheLump (HIGHSCORES_LUMP_START,HIGHSCORES_LUMP_END);
\r
1184 //===========================================================================
\r
1188 =======================
\r
1192 =======================
\r
1195 void CheckHighScore (long score,word other)
\r
1199 HighScore myscore;
\r
1201 strcpy(myscore.name,"");
\r
1202 myscore.score = score;
\r
1203 myscore.episode = gamestate.episode;
\r
1204 myscore.completed = other;
\r
1206 for (i = 0,n = -1;i < MaxScores;i++)
\r
1210 (myscore.score > Scores[i].score)
\r
1212 (myscore.score == Scores[i].score)
\r
1213 && (myscore.completed > Scores[i].completed)
\r
1217 for (j = MaxScores;--j > i;)
\r
1218 Scores[j] = Scores[j - 1];
\r
1219 Scores[i] = myscore;
\r
1226 StartCPMusic (XAWARD_MUS);
\r
1228 StartCPMusic (ROSTER_MUS);
\r
1230 DrawHighScores ();
\r
1237 // got a high score
\r
1239 PrintY = 76 + (16 * n);
\r
1242 backcolor = BORDCOLOR;
\r
1244 US_LineInput(PrintX,PrintY,Scores[n].name,nil,true,MaxHighName,100);
\r
1248 VWB_Bar (PrintX-2,PrintY-2,145,15,0x9c);
\r
1249 VW_UpdateScreen ();
\r
1252 US_LineInput(PrintX,PrintY,Scores[n].name,nil,true,MaxHighName,130);
\r
1257 IN_ClearKeysDown ();
\r
1258 IN_UserInput(500);
\r
1267 ////////////////////////////////////////////////////////
\r
1269 // NON-SHAREWARE NOTICE
\r
1271 ////////////////////////////////////////////////////////
\r
1272 void NonShareware(void)
\r
1279 CA_CacheGrChunk(STARTFONT+1);
\r
1282 SETFONTCOLOR(READHCOLOR,BKGDCOLOR);
\r
1287 US_Print("Atencion");
\r
1289 US_Print("Attention");
\r
1292 SETFONTCOLOR(HIGHLIGHT,BKGDCOLOR);
\r
1293 WindowX=PrintX=40;
\r
1296 US_Print("Este juego NO es gratis y\n");
\r
1297 US_Print("NO es Shareware; favor de\n");
\r
1298 US_Print("no distribuirlo.\n\n");
\r
1300 US_Print("This game is NOT shareware.\n");
\r
1301 US_Print("Please do not distribute it.\n");
\r
1302 US_Print("Thanks.\n\n");
\r
1304 US_Print(" Id Software\n");
\r
1306 VW_UpdateScreen ();
\r
1316 ////////////////////////////////////////////////////////
\r
1318 // COPY PROTECTION FOR FormGen
\r
1320 ////////////////////////////////////////////////////////
\r
1321 char far CopyProFailedStrs[][100] = {
\r
1350 far BackDoorStrs[5][16] = {
\r
1362 far GoodBoyStrs[10][40] = {
\r
1363 "...is the CORRECT ANSWER!",
\r
1366 "Consider yourself bitten, sir.",
\r
1369 "Greetings Professor Falken, would you",
\r
1370 "like to play Spear of Destiny?",
\r
1372 "Do you have any gold spray paint?",
\r
1376 "Beta testing approved.",
\r
1378 "I wish I had a 21\" monitor...",
\r
1383 far bossstrs[4][24] = {
\r
1385 "BARNACLE WILHELM",
\r
1386 "UBERMUTANTUBER MUTANT",
\r
1390 far WordStr[5][20] = {
\r
1394 "Change View...F5",
\r
1397 far WordCorrect[5][2] = {"3","4","4","5","5"},
\r
1399 far MemberStr[10][40] = {
\r
1415 far MemberCorrect[5][24] = {
\r
1417 "john carmackjohn romero",
\r
1422 far DosMessages[9][80] = {
\r
1433 far MiscTitle[4][20] = {
\r
1437 "I AM WHAT I AMMO"
\r
1440 far MiscStr[12][40] = {
\r
1458 far MiscCorrect[4][5] = {"ss","8",STR_STAR,"45"};
\r
1461 int BackDoor(char *s)
\r
1469 if (!_fstrcmp(s,BackDoorStrs[i]))
\r
1471 SETFONTCOLOR(14,15);
\r
1474 VWB_DrawPic (0,20*8,COPYPROTBOXPIC);
\r
1475 US_CPrint(GoodBoyStrs[i*2]);
\r
1476 US_CPrint(GoodBoyStrs[i*2+1]);
\r
1477 VW_UpdateScreen();
\r
1485 void CopyProtection(void)
\r
1487 #define TYPEBOX_Y 177
\r
1488 #define TYPEBOX_BKGD 0x9c
\r
1489 #define PRINTCOLOR HIGHLIGHT
\r
1491 int i,match,whichboss,bossnum,try,whichline,enemypicked[4]={0,0,0,0},
\r
1492 bosses[4] = { BOSSPIC1PIC,BOSSPIC2PIC,BOSSPIC3PIC,BOSSPIC4PIC },
\r
1493 whichone,whichpicked[4]={0,0,0,0},quiztype,whichmem,
\r
1494 memberpicked[5]={0,0,0,0,0},wordpicked[5]={0,0,0,0,0},whichword;
\r
1496 char inputbuffer[20],
\r
1513 CA_CacheGrChunk(C_BACKDROPPIC);
\r
1514 CacheLump(COPYPROT_LUMP_START,COPYPROT_LUMP_END);
\r
1515 CA_CacheGrChunk(STARTFONT+1);
\r
1516 CA_LoadAllSounds();
\r
1517 StartCPMusic(COPYPRO_MUS);
\r
1518 US_InitRndT(true);
\r
1523 SETFONTCOLOR(PRINTCOLOR-2,15);
\r
1524 VWB_DrawPic (0,0,C_BACKDROPPIC);
\r
1525 VWB_DrawPic (0,0,COPYPROTTOPPIC);
\r
1526 VWB_DrawPic (0,20*8,COPYPROTBOXPIC);
\r
1527 WindowX = WindowY = 0;
\r
1532 quiztype = US_RndT()%totaltypes;
\r
1540 US_Print(STR_DEBRIEF);
\r
1541 SETFONTCOLOR(PRINTCOLOR,15);
\r
1543 while (enemypicked[whichboss = US_RndT()&3]);
\r
1544 enemypicked[whichboss] = 1;
\r
1545 bossnum = bosses[whichboss];
\r
1546 VWB_DrawPic(128,60,bossnum);
\r
1549 US_CPrint(STR_ENEMY1"\n");
\r
1550 US_CPrint(STR_ENEMY2"\n\n");
\r
1552 VW_UpdateScreen();
\r
1557 backcolor = TYPEBOX_BKGD;
\r
1558 inputbuffer[0] = 0;
\r
1559 PrintY = TYPEBOX_Y;
\r
1561 US_LineInput(PrintX,PrintY,inputbuffer,nil,true,20,100);
\r
1564 for (i=0;i<_fstrlen(bossstrs[whichboss]);i++)
\r
1565 if (!_fstrnicmp(inputbuffer,bossstrs[whichboss]+i,strlen(inputbuffer)) &&
\r
1566 strlen(inputbuffer)>3)
\r
1569 match += BackDoor(inputbuffer);
\r
1576 while (wordpicked[whichword = US_RndT()%5]);
\r
1577 wordpicked[whichword] = 1;
\r
1578 US_CPrint(STR_CHECKMAN);
\r
1579 SETFONTCOLOR(PRINTCOLOR,15);
\r
1581 US_CPrint(STR_MAN1);
\r
1582 US_CPrint(STR_MAN2);
\r
1583 _fstrcpy(message,STR_MAN3" \"");
\r
1584 _fstrcat(message,WordStr[whichword]);
\r
1585 _fstrcat(message,"\" "STR_MAN4);
\r
1586 US_CPrint(message);
\r
1587 VW_UpdateScreen();
\r
1592 backcolor = TYPEBOX_BKGD;
\r
1593 inputbuffer[0] = 0;
\r
1594 PrintY = TYPEBOX_Y;
\r
1595 US_LineInput(PrintX,PrintY,inputbuffer,nil,true,6,100);
\r
1597 strlwr(inputbuffer);
\r
1598 match = 1-(_fstrcmp(inputbuffer,WordCorrect[whichword])!=0);
\r
1599 match += BackDoor(inputbuffer);
\r
1606 while (memberpicked[whichmem = US_RndT()%5]);
\r
1607 memberpicked[whichmem] = 1;
\r
1608 US_CPrint(STR_ID1);
\r
1609 SETFONTCOLOR(PRINTCOLOR,15);
\r
1611 US_CPrint(MemberStr[whichmem*2]);
\r
1612 US_CPrint(MemberStr[whichmem*2+1]);
\r
1613 VW_UpdateScreen();
\r
1618 backcolor = TYPEBOX_BKGD;
\r
1619 inputbuffer[0] = 0;
\r
1620 PrintY = TYPEBOX_Y;
\r
1621 US_LineInput(PrintX,PrintY,inputbuffer,nil,true,20,120);
\r
1623 strlwr(inputbuffer);
\r
1625 for (i=0;i<_fstrlen(MemberCorrect[whichmem]);i++)
\r
1626 if (!_fstrnicmp(inputbuffer,MemberCorrect[whichmem]+i,strlen(inputbuffer)) &&
\r
1627 strlen(inputbuffer)>2)
\r
1629 match += BackDoor(inputbuffer);
\r
1633 // MISCELLANEOUS QUESTIONS
\r
1636 while (whichpicked[whichone = US_RndT()&3]);
\r
1637 whichpicked[whichone] = 1;
\r
1638 US_CPrint(MiscTitle[whichone]);
\r
1639 SETFONTCOLOR(PRINTCOLOR,15);
\r
1641 US_CPrint(MiscStr[whichone*3]);
\r
1642 US_CPrint(MiscStr[whichone*3+1]);
\r
1643 US_CPrint(MiscStr[whichone*3+2]);
\r
1644 VW_UpdateScreen();
\r
1649 backcolor = TYPEBOX_BKGD;
\r
1650 inputbuffer[0] = 0;
\r
1651 PrintY = TYPEBOX_Y;
\r
1652 US_LineInput(PrintX,PrintY,inputbuffer,nil,true,6,100);
\r
1654 strlwr(inputbuffer);
\r
1655 match = 1-(_fstrcmp(inputbuffer,MiscCorrect[whichone])!=0);
\r
1656 match += BackDoor(inputbuffer);
\r
1661 // IF NO MATCH, WE'VE GOT A (MINOR) PROBLEM!
\r
1666 whichline = 2*(US_RndT()%9);
\r
1667 SETFONTCOLOR(14,15);
\r
1670 VWB_DrawPic (0,20*8,COPYPROTBOXPIC);
\r
1671 US_CPrint(CopyProFailedStrs[whichline]);
\r
1672 US_CPrint(CopyProFailedStrs[whichline+1]);
\r
1674 VW_UpdateScreen();
\r
1675 SD_PlaySound(NOWAYSND);
\r
1676 IN_UserInput(TickBase*3);
\r
1685 SD_PlaySound(BONUS1UPSND);
\r
1686 SD_WaitSoundDone();
\r
1687 UNCACHEGRCHUNK (STARTFONT+1);
\r
1688 UNCACHEGRCHUNK (C_BACKDROPPIC);
\r
1689 UnCacheLump (COPYPROT_LUMP_START,COPYPROT_LUMP_END);
\r
1693 case sdm_Off: return;
\r
1694 case sdm_PC: start = STARTPCSOUNDS; break;
\r
1695 case sdm_AdLib: start = STARTADLIBSOUNDS;
\r
1698 for (i=0;i<NUMSOUNDS;i++,start++)
\r
1699 MM_FreePtr ((memptr *)&audiosegs[start]);
\r
1707 _fstrcpy(message,DosMessages[US_RndT()%9]);
\r
1710 geninterrupt(0x10);
\r
1712 printf("%s\n",message);
\r
1716 #endif // SPEARDEMO
\r
1718 //===========================================================================
\r