void Victory (void) { #ifndef SPEARDEMO long sec; int i,min,kr,sr,tr,x; char tempstr[8]; #define RATIOX 6 #define RATIOY 14 #define TIMEX 14 #define TIMEY 8 #ifdef SPEAR StartCPMusic (XTHEEND_MUS); CA_CacheGrChunk(BJCOLLAPSE1PIC); CA_CacheGrChunk(BJCOLLAPSE2PIC); CA_CacheGrChunk(BJCOLLAPSE3PIC); CA_CacheGrChunk(BJCOLLAPSE4PIC); VWB_Bar(0,0,320,200,VIEWCOLOR); VWB_DrawPic (124,44,BJCOLLAPSE1PIC); VW_UpdateScreen (); VW_FadeIn (); VW_WaitVBL(2*70); VWB_DrawPic (124,44,BJCOLLAPSE2PIC); VW_UpdateScreen (); VW_WaitVBL(105); VWB_DrawPic (124,44,BJCOLLAPSE3PIC); VW_UpdateScreen (); VW_WaitVBL(105); VWB_DrawPic (124,44,BJCOLLAPSE4PIC); VW_UpdateScreen (); VW_WaitVBL(3*70); UNCACHEGRCHUNK(BJCOLLAPSE1PIC); UNCACHEGRCHUNK(BJCOLLAPSE2PIC); UNCACHEGRCHUNK(BJCOLLAPSE3PIC); UNCACHEGRCHUNK(BJCOLLAPSE4PIC); VL_FadeOut (0,255,0,17,17,5); #endif StartCPMusic (URAHERO_MUS); ClearSplitVWB (); CacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END); CA_CacheGrChunk(STARTFONT); #ifndef SPEAR CA_CacheGrChunk(C_TIMECODEPIC); #endif VWB_Bar (0,0,320,200-STATUSLINES,127); #ifdef JAPAN #ifndef JAPDEMO CA_CacheGrChunk(C_ENDRATIOSPIC); VWB_DrawPic(0,0,C_ENDRATIOSPIC); UNCACHEGRCHUNK(C_ENDRATIOSPIC); #endif #else Write(18,2,STR_YOUWIN); Write(TIMEX,TIMEY-2,STR_TOTALTIME); Write(12,RATIOY-2,"averages"); #ifdef SPANISH Write(RATIOX+2, RATIOY, STR_RATKILL); Write(RATIOX+2, RATIOY+2, STR_RATSECRET); Write(RATIOX+2, RATIOY+4,STR_RATTREASURE); #else Write(RATIOX+8,RATIOY, STR_RATKILL); Write(RATIOX+4,RATIOY+2, STR_RATSECRET); Write(RATIOX, RATIOY+4,STR_RATTREASURE); #endif #endif #ifndef JAPDEMO VWB_DrawPic (8,4,L_BJWINSPIC); #endif #ifndef SPEAR for (kr = sr = tr = sec = i = 0;i < 8;i++) #else for (kr = sr = tr = sec = i = 0;i < 20;i++) #endif { sec += LevelRatios[i].time; kr += LevelRatios[i].kill; sr += LevelRatios[i].secret; tr += LevelRatios[i].treasure; } #ifndef SPEAR kr /= 8; sr /= 8; tr /= 8; #else kr /= 14; sr /= 14; tr /= 14; #endif min = sec/60; sec %= 60; if (min > 99) min = sec = 99; i = TIMEX*8+1; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(min/10)); i += 2*8; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(min%10)); i += 2*8; Write(i/8,TIMEY,":"); i += 1*8; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(sec/10)); i += 2*8; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(sec%10)); VW_UpdateScreen (); itoa(kr,tempstr,10); x=RATIOX+24-strlen(tempstr)*2; Write(x,RATIOY,tempstr); itoa(sr,tempstr,10); x=RATIOX+24-strlen(tempstr)*2; Write(x,RATIOY+2,tempstr); itoa(tr,tempstr,10); x=RATIOX+24-strlen(tempstr)*2; Write(x,RATIOY+4,tempstr); #ifndef SPANISH #ifndef UPLOAD #ifndef SPEAR // // TOTAL TIME VERIFICATION CODE // if (gamestate.difficulty>=gd_medium) { VWB_DrawPic (30*8,TIMEY*8,C_TIMECODEPIC); fontnumber = 0; fontcolor = READHCOLOR; PrintX = 30*8-3; PrintY = TIMEY*8+8; PrintX+=4; tempstr[0] = (((min/10)^(min%10))^0xa)+'A'; tempstr[1] = (((sec/10)^(sec%10))^0xa)+'A'; tempstr[2] = (tempstr[0]^tempstr[1])+'A'; tempstr[3] = 0; US_Print(tempstr); } #endif #endif #endif fontnumber = 1; VW_UpdateScreen (); VW_FadeIn (); IN_Ack(); #ifndef SPEAR if (Keyboard[sc_P] && MS_CheckParm("goobers")) PicturePause(); #endif VW_FadeOut (); #ifndef SPEAR UNCACHEGRCHUNK(C_TIMECODEPIC); #endif UnCacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END); #ifndef SPEAR EndText(); #else EndSpear(); #endif #endif // SPEARDEMO }
void Victory() { #ifndef SPEARDEMO long sec; int i,min,kr,sr,tr,x; char tempstr[8]; #define RATIOX 6 #define RATIOY 14 #define TIMEX 14 #define TIMEY 8 #ifdef SPEAR StartCPMusic(XTHEEND_MUS); CA_CacheGrChunk(BJCOLLAPSE1PIC); CA_CacheGrChunk(BJCOLLAPSE2PIC); CA_CacheGrChunk(BJCOLLAPSE3PIC); CA_CacheGrChunk(BJCOLLAPSE4PIC); VW_Bar(0,0,320,200,VIEWCOLOR); VWB_DrawPic (124,44,BJCOLLAPSE1PIC); VW_UpdateScreen (); VW_FadeIn (); VW_WaitVBL(2*70); VWB_DrawPic (124,44,BJCOLLAPSE2PIC); VW_UpdateScreen (); VW_WaitVBL(105); VWB_DrawPic (124,44,BJCOLLAPSE3PIC); VW_UpdateScreen (); VW_WaitVBL(105); VWB_DrawPic (124,44,BJCOLLAPSE4PIC); VW_UpdateScreen (); VW_WaitVBL(3*70); CA_UnCacheGrChunk(BJCOLLAPSE1PIC); CA_UnCacheGrChunk(BJCOLLAPSE2PIC); CA_UnCacheGrChunk(BJCOLLAPSE3PIC); CA_UnCacheGrChunk(BJCOLLAPSE4PIC); VL_FadeOut (0,255,0,17,17,5); #endif StartCPMusic (URAHERO_MUS); ClearSplitVWB (); CacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END); CA_CacheGrChunk(STARTFONT); VW_Bar (0,0,320,200-STATUSLINES,127); Write(18,2,STR_YOUWIN); Write(TIMEX,TIMEY-2,STR_TOTALTIME); Write(12,RATIOY-2,"averages"); Write(RATIOX+8,RATIOY, STR_RATKILL); Write(RATIOX+4,RATIOY+2, STR_RATSECRET); Write(RATIOX, RATIOY+4,STR_RATTREASURE); VWB_DrawPic (8,4,L_BJWINSPIC); #ifndef SPEAR for (kr = sr = tr = sec = i = 0;i < 8;i++) #else for (kr = sr = tr = sec = i = 0;i < 20;i++) #endif { sec += LevelRatios[i].time; kr += LevelRatios[i].kill; sr += LevelRatios[i].secret; tr += LevelRatios[i].treasure; } #ifndef SPEAR kr /= 8; sr /= 8; tr /= 8; #else kr /= 14; sr /= 14; tr /= 14; #endif min = sec/60; sec %= 60; if (min > 99) min = sec = 99; i = TIMEX*8+1; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(min/10)); i += 2*8; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(min%10)); i += 2*8; Write(i/8,TIMEY,":"); i += 1*8; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(sec/10)); i += 2*8; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(sec%10)); VW_UpdateScreen (); itoa(kr,tempstr,10); x=RATIOX+24-strlen(tempstr)*2; Write(x,RATIOY,tempstr); itoa(sr,tempstr,10); x=RATIOX+24-strlen(tempstr)*2; Write(x,RATIOY+2,tempstr); itoa(tr,tempstr,10); x=RATIOX+24-strlen(tempstr)*2; Write(x,RATIOY+4,tempstr); fontnumber = 1; VW_UpdateScreen (); VW_FadeIn (); IN_Ack(); #ifndef SPEAR if (IN_KeyDown(sc_P) && MS_CheckParm("debugmode")) PicturePause(); #endif VW_FadeOut (); UnCacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END); #ifndef SPEAR EndText(); #else EndSpear(); #endif #endif /* SPEARDEMO */ }