00001
00002
00003
00004 #include <time.h>
00005 #include <ALL.H>
00006 #include <ODATE.H>
00007 #include <OINFO.H>
00008 #include <OIMGRES.H>
00009 #include <OMISC.H>
00010 #include <OMUSIC.H>
00011 #include <OMOUSE.H>
00012 #include <OMOUSECR.H>
00013 #include <OFIRMRES.H>
00014 #include <OSTR.H>
00015 #include <OSYS.H>
00016 #include <OVGA.H>
00017 #include <OFONT.H>
00018 #include <ODEPT.H>
00019 #include <OFIRM.H>
00020 #include <OWORLD.H>
00021 #include <OSTUDENT.H>
00022 #include <OFACULTY.H>
00023 #include <OCOURSE.H>
00024 #include <OSCHOOL.H>
00025 #include <OPSCHOOL.H>
00026 #include <OSCHLRES.H>
00027 #include <OCOLTBL.H>
00028 #include <OFINANCE.H>
00029 #include <OAthleti.h>
00030 #include <ODEVELOP.H>
00031 #include <OFACILIT.H>
00032 #include <OLIBTECH.H>
00033 #include <OINVEST.H>
00034 #include <ODEPTRES.H>
00035 #include <OENROLL.H>
00036 #include <OSTUOFF.H>
00037 #include <OTEXT.H>
00038 #include <OTASK.H>
00039 #include <OCHANCE.H>
00040 #include <OCONFIG.H>
00041 #include <OBOX.H>
00042 #include <OLETTER.H>
00043 #include <OMATH.H>
00044
00045
00046
00047 #define DATE_BMP_RES_FILE_NAME DIR_RES"I_DATE.RES"
00048
00049
00050
00051 static int last_month = 0, last_year = 0, last_day = 0;
00052 static short digit_y1, year_x1_1, year_x1_2, day_x1_0, day_x1_1, day_x1_2;
00053
00054
00055
00056 #define YIELD { if ( info.game_day == 1 ) sys.yield(); }
00057
00058
00059
00060 static void update_faculty_count();
00061
00062
00064
00065 disp_6_graphs_flag=true;
00066 }
00067
00068
00069
00070
00072
00073 deinit();
00074 }
00075
00076
00077
00078
00080
00081 deinit();
00082 #define GAME_START_YEAR 1
00083 game_day = 1;
00084 game_month = 9;
00085 game_year = GAME_START_YEAR;
00086
00087 game_start_date = date.julian( game_year, game_month, game_day );
00088
00089 game_date = game_start_date;
00090 year_day = date.day_year( game_year, game_month, game_day );
00091
00092 year_passed= 1;
00093
00094
00095 graph_year_passed = 1;
00096 graph_month_passed = 1;
00097 graph_trimester_passed = 1;
00098
00099 graph_year = 3;
00100 graph_month = 3;
00101 graph_trimester = 3;
00102
00103
00104
00105
00106 start_play_time = m.get_time();
00107 total_play_time = 0;
00108
00109
00110
00111 date_res_bitmap.init(DATE_BMP_RES_FILE_NAME, 1, 0);
00112
00113 short *shortPtr = (short *) date_res_bitmap.get_ptr("0");
00114 short digitWidth = *shortPtr++;
00115 short digitHeight = *shortPtr;
00116
00117 digit_y1 = (DIGIT_Y1 + DIGIT_Y2 - digitHeight) / 2;
00118 day_x1_2 = (DAY_X1 + DAY_X2) / 2;
00119 day_x1_1 = day_x1_2 - digitWidth;
00120 day_x1_0 = day_x1_2 - digitWidth / 2;
00121 year_x1_2 = (YEAR_X1 + YEAR_X2) / 2;
00122 year_x1_1 = year_x1_2 - digitWidth;
00123
00124
00125
00126 disp_panel_init();
00127 image_interface.put_large( &vga_back, 0, 0, "MAINSCR" );
00128 }
00129
00130
00131
00132
00134
00135
00136
00137 if( top_info_bitmap ) {
00138 mem_del( top_info_bitmap );
00139 top_info_bitmap = NULL;
00140
00141 mem_del( bottom_info_bitmap );
00142 bottom_info_bitmap = NULL;
00143
00144 mem_del( surplus_info_bitmap );
00145 surplus_info_bitmap = NULL;
00146
00147 mem_del( score_info_bitmap );
00148 score_info_bitmap = NULL;
00149
00150 mem_del( uscore_info_bitmap );
00151 uscore_info_bitmap = NULL;
00152
00153 mem_del( date_info_bitmap );
00154 mem_del( year_info_bitmap );
00155
00156 mem_del( top_left_column_bitmap );
00157 mem_del( top_right_column_bitmap );
00158
00159 mem_del( bottom_left_column_bitmap );
00160 mem_del( bottom_right_column_bitmap );
00161
00162 mem_del( menu_up_bitmap );
00163 mem_del( menu_down_bitmap );
00164
00165 mem_del( more_report_bitmap );
00166 more_report_bitmap = NULL;
00167
00168 mem_del( help_quest_bitmap );
00169 help_quest_bitmap = NULL;
00170
00171 mem_del( list_button_bitmap );
00172 list_button_bitmap = NULL;
00173
00174 for (int i = 0; i < REPORT_ITEMS + 1; i++)
00175 mem_del( report_bitmap[i] );
00176 }
00177
00178
00179 }
00180
00181
00182
00183
00190
00191 if( randomSeed )
00192 random_seed = randomSeed;
00193 else {
00194 randomSeed = time(NULL);
00195 randomSeed = (int) _rotr( randomSeed, 4 );
00196 if( randomSeed < 0 )
00197 randomSeed = ~randomSeed;
00198 if( randomSeed == 0 )
00199 randomSeed = 1;
00200 random_seed = randomSeed;
00201 }
00202
00203 m.set_random_seed(random_seed);
00204 }
00205
00206
00207
00208
00209
00210 void Info::next_day() {
00211 inc_game_day();
00212
00213
00214
00215 int oldCursor;
00216
00217 if ( game_day == 1 ) {
00218 oldCursor = mouse_cursor.get_icon();
00219 mouse_cursor.set_icon(CURSOR_WAITING);
00220 sys.redraw_all_flag=1;
00221 }
00222
00223
00224
00225 player_school.next_day();
00226
00227
00228 YIELD;
00229
00230
00231
00232 enroll_res.next_day();
00233
00234 development_office.next_day();
00235
00236 #if(GAME_VERSION>=200)
00237 #else
00238 finance.next_day();
00239 #endif
00240
00241 YIELD;
00242
00243
00244
00245 if ( is_begin_trimester() )
00246 new_trimester_course_enrollment();
00247
00248 #if(GAME_VERSION>=200)
00249 finance.next_day();
00250 #endif
00251
00252 YIELD;
00253
00254
00255
00256
00257 facility_office.next_day();
00258 library_tech_office.next_day();
00259
00260 athletics_office.next_day();
00261 student_office.next_day();
00262 investment_office.next_day();
00263
00264 YIELD;
00265
00266
00267
00268
00269 department_array.next_day();
00270
00271 department_res.general_dept.next_day();
00272
00273 school_res.next_day();
00274
00275 YIELD;
00276
00277
00278
00279 if ( is_begin_trimester() ) {
00280 player_school.update_history(UPDATE_TRIMESTER);
00281 }
00282
00283
00284
00285 if ( info.game_day == 1 ) {
00286 player_school.update_history(UPDATE_MONTH);
00287
00288
00289
00290 if ( info.game_month == finance.fiscal_year_start_month ) {
00291 player_school.update_history(UPDATE_YEAR);
00292
00293
00294
00295 finance.calc_total_last_year();
00296 finance.calc_projected_total_n_percent(1);
00297 }
00298 }
00299
00300
00301
00302 if (info.prerun_year==0)
00303 player_school.scenario_check_target();
00304
00305
00306
00307 if (info.prerun_year==0) {
00308 int lastYear = 90;
00309
00310 #ifndef ADMIN // standard and demo versions have 3 year time limit only
00311 lastYear = 3;
00312 #endif
00313
00314 if( info.game_year == lastYear-1 && info.game_month == 9 && info.game_day==1 ) {
00315 news_array.open_game_near_end();
00316 }
00317 else if( info.game_year == lastYear && info.game_month == 9 && info.game_day==1 ) {
00318 news_array.open_game_end();
00319 }
00320
00321 else if( info.game_year == lastYear && info.game_month == 9 && info.game_day>1 ) {
00322 sys.set_staying_view_mode(MODE_RETIREMENT);
00323
00324 if ( config.cd_music_volume <=0 )
00325 music.stop();
00326 }
00327 }
00328
00329
00330
00331 if (info.prerun_year==0) {
00332 chance_event.next_day();
00333 task_array.next_day();
00334
00335 #if(GAME_VERSION>=200)
00336 player_school.think_protagonist();
00337 #endif
00338
00339 }
00340
00341
00342
00343 if( info.prerun_year==1 && info.game_day==1 ) {
00344
00345 box.progress_update( 28 + int( float(info.game_date - info.game_start_date)/5.7f ) );
00346 }
00347
00348
00349
00350
00351 if (info.game_year==2 && info.game_month==9 && info.game_day==1 && info.prerun_year==1) {
00352 end_prerun_year();
00353 oldCursor=CURSOR_NORMAL;
00354 }
00355
00356
00357
00358 if ( game_day == 1 )
00359 mouse_cursor.restore_icon(oldCursor);
00360 }
00361
00362
00363
00364
00365
00366 void Info::inc_game_day() {
00367
00368
00369 if( ++game_day > 30 )
00370 game_day = 30;
00371
00372 game_date++;
00373
00374 week_day=game_date%7;
00375
00376 if( date.month(game_date) != game_month ) {
00377 game_day = 1;
00378 game_month = date.month(game_date);
00379
00380 graph_month_passed = min(graph_month_passed+1, HISTORY_MONTH_COUNT);
00381 graph_month = min(graph_month+1, HISTORY_MONTH_COUNT);
00382
00383 if ( game_month == finance.fiscal_year_start_month ) {
00384 year_passed++;
00385
00386 graph_year_passed = min(graph_year_passed+1, HISTORY_YEAR_COUNT);
00387 graph_year = min(graph_year+1, HISTORY_YEAR_COUNT);
00388 }
00389 }
00390
00391 if( date.year(game_date) != game_year ) {
00392 game_month = 1;
00393 game_year = date.year(game_date);
00394 }
00395
00396
00397 year_day = date.day_year( game_year, game_month, game_day );
00398 }
00399
00400
00401
00402
00404
00405 for( int i=department_array.size() ; i>0 ; i--) {
00406 if( department_array.is_deleted(i) )
00407 continue;
00408
00409
00410 department_array[i]->course_array.next_trimester();
00411
00412 }
00413
00414 int count_course = 0;
00415
00416 for( i=department_array.size(); i>0; i--) {
00417 if( department_array.is_deleted(i) )
00418 continue;
00419
00420 Department* deptPtr = department_array[i];
00421
00422 deptPtr->student_array.select_course();
00423 }
00424
00425 department_res.general_dept.student_array.select_course();
00426
00427 #if(GAME_VERSION>=200) // Item 8d v)
00428 update_distance_learning_variables();
00429 #endif
00430
00431 int w;
00432 int gd;
00433 avg_tal_acd = 0.0;
00434 avg_tal_ext = 0.0;
00435 avg_tal_ath = 0.0;
00436 int total_stu_no = 0;
00437 StudentArray* stuArray_cal_tal;
00438 Student *studentPtr_cal_tal;
00439
00440 err_when( department_array.size() == 0 );
00441
00442 for ( w=department_array.size(); w>=0; w-- ) {
00443 if (w) {
00444 if ( department_array.is_deleted(w) )
00445 continue;
00446 stuArray_cal_tal = &(department_array[w]->student_array);
00447
00448 }
00449 else {
00450 stuArray_cal_tal = &(department_res.general_dept.student_array);
00451 }
00452
00453
00454
00455 for (gd=stuArray_cal_tal->size(); gd>0; gd--) {
00456 if ( stuArray_cal_tal->is_deleted(gd) )
00457 continue;
00458 studentPtr_cal_tal = stuArray_cal_tal->operator[](gd);
00459 if ( studentPtr_cal_tal->talent_academic == 0)
00460 continue;
00461 avg_tal_acd += studentPtr_cal_tal->talent_academic;
00462 avg_tal_ext += studentPtr_cal_tal->talent_extracurricular;
00463 avg_tal_ath += studentPtr_cal_tal->talent_athletics;
00464 total_stu_no ++;
00465 }
00466 }
00467
00468 avg_tal_acd /= total_stu_no;
00469 avg_tal_ext /= total_stu_no;
00470 avg_tal_ath /= total_stu_no;
00471
00472
00473
00474
00475
00476 int s;
00477 int g;
00478 StudentArray* stuArray;
00479 Student *studentPtr;
00480
00481 err_when( department_array.size() == 0 );
00482 for ( s=department_array.size(); s>=0; s-- ) {
00483 if (s) {
00484 if ( department_array.is_deleted(s) )
00485 continue;
00486 stuArray = &(department_array[s]->student_array);
00487
00488 }
00489 else {
00490 stuArray = &(department_res.general_dept.student_array);
00491 }
00492
00493
00494
00495 for (g=stuArray->size(); g>0; g--) {
00496 if ( stuArray->is_deleted(g) )
00497 continue;
00498 studentPtr = stuArray->operator[](g);
00499
00500 if (studentPtr->talent_academic == 0) {
00501
00502
00503 char studentLevel = studentPtr->student_level;
00504 char stuSeg = studentPtr->student_segment;
00505 char genderEthnicGroup = studentPtr->gender_ethnic_group;
00506
00507 if ( studentLevel == UG_TRADITION ) {
00508
00509 studentPtr->talent_academic = (char)(math.get_random_snd(avg_tal_acd, float(1.5),true));
00510 studentPtr->talent_extracurricular = (char)math.get_random_snd(avg_tal_ext, float(1.5), true );
00511 studentPtr->talent_athletics = (char)math.get_random_snd(avg_tal_ath, float(1.5), true );
00512 }
00513 else {
00514
00515 if ( studentLevel == DOCTOR )
00516 studentPtr->talent_academic = (char)(m.fmin(100.0f, math.get_random_snd(math.single_response_func(0.7f, 1.3f, 100, 50,avg_tal_acd ), float(1.5), true )));
00517 else
00518 studentPtr->talent_academic = (char)(math.get_random_snd(avg_tal_acd, float(1.5),true));
00519 studentPtr->talent_extracurricular = 0;
00520 studentPtr->talent_athletics = 0;
00521
00522 }
00523 }
00524
00525 }
00526 }
00527 }
00528
00529
00530
00531
00537
00538 game_day = 1;
00539 game_month = 9;
00540 game_year = GAME_START_YEAR;
00541
00542 game_start_date = date.julian( game_year, game_month, game_day );
00543
00544 game_date = game_start_date;
00545 year_day = date.day_year( game_year, game_month, game_day );
00546 year_passed= 1;
00547
00548 graph_year_passed = 1;
00549 graph_month_passed = 1;
00550 graph_trimester_passed = 1;
00551 graph_year = 3;
00552 graph_month = 3;
00553 graph_trimester = 3;
00554 chance_event.profit_competition_act = 0;
00555
00556 start_play_time = m.get_time();
00557 total_play_time = 0;
00558
00559 config.disp_year_end_report=1;
00560
00561
00562
00563 update_faculty_count();
00564
00565
00566
00567 player_school.init_score();
00568
00569
00570
00571 player_school.init_scenario();
00572
00573 task_array.rand_init = 1.0f - m.random(15)/10;
00574
00575 box.progress_update(89);
00576 box.progress_val=0;
00577
00578 letter.init_welcome_letter();
00579
00580
00581 #if(GAME_VERSION>=200)
00582 finance.save_initial_value();
00583 for (int i = department_array.size() ; i > 0; i--)
00584 department_array[i]->save_initial_data();
00585
00586 department_array.save_initial_data();
00587 player_school.save_initial_data();
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601 enroll_res.save_initial_data();
00602 development_office.save_initial_data();
00603 facility_office.save_initial_data();
00604 library_tech_office.save_initial_data();
00605 investment_office.save_initial_data();
00606 department_res.general_dept.save_initial_data();
00607 athletics_office.save_initial_data();
00608 #endif
00609
00610
00611
00612
00613 info.prerun_year=0;
00614
00615 }
00616
00617
00618
00619
00623
00624
00625
00626 department_array.faculty_count_tenured = 0;
00627 department_array.faculty_count_on_tenure_line = 0;
00628 Department* departPtr;
00629
00630 for (int cond=department_array.size(); cond>=0; cond-- ) {
00631 if ( department_array.is_deleted(cond) )
00632 continue;
00633
00634 departPtr = department_array[cond];
00635
00636 for (int con = departPtr->faculty_array.size(); con>0; con--) {
00637 if (departPtr->faculty_array.is_deleted(con))
00638 continue;
00639
00640 switch(departPtr->faculty_array[con]->rank_level) {
00641 case ASSOC_PROF:
00642 case FULL_PROF:
00643 department_array.faculty_count_tenured++;
00644 case ASST_PROF:
00645 department_array.faculty_count_on_tenure_line++;
00646 break;
00647 }
00648
00649
00650
00651 int testU =0;
00652 int testU1 =0;
00653 Faculty* facultyPtr;
00654
00655 for (int e = 0; e < MAX_RESEARCH_PROPOSAL ; e++) {
00656 testU = departPtr->faculty_array[con]->research_proposal_array[e].date_to_next_status;
00657
00658 if(departPtr->faculty_array[con]->research_proposal_array[e].date_to_next_status!=0)
00659 departPtr->faculty_array[con]->research_proposal_array[e].date_to_next_status -= 365;
00660
00661 facultyPtr = departPtr->faculty_array[con];
00662 testU1 = departPtr->faculty_array[con]->research_proposal_array[e].date_to_next_status;
00663 }
00664 }
00665 }
00666 }
00667
00668
00669
00670
00672
00673 return ( game_day == player_school.trimester_array[player_school.cur_trimester].start_day
00674 && game_month == player_school.trimester_array[player_school.cur_trimester].start_month );
00675 }
00676
00677
00678
00679
00681
00682 image_interface.put_large( &vga_back, 0, 0, "MAINSCR2" );
00683
00684
00685
00686 top_info_bitmap = vga_back.save_area( TOP_INFO_X1, TOP_INFO_Y1+4, TOP_INFO_X2, TOP_INFO_Y2);
00687 bottom_info_bitmap = vga_back.save_area( BOTTOM_INFO_X1, BOTTOM_INFO_Y1, BOTTOM_INFO_X2, BOTTOM_INFO_Y2);
00688 surplus_info_bitmap = vga_back.save_area( SURPLUS_INFO_X1, SURPLUS_INFO_Y1, SURPLUS_INFO_X2, SURPLUS_INFO_Y2);
00689 score_info_bitmap = vga_back.save_area( SCORE_INFO_X1, SCORE_INFO_Y1, SCORE_INFO_X2, SCORE_INFO_Y2);
00690
00691
00692 uscore_info_bitmap = vga_back.save_area( U_SCORE_INFO_X1, U_SCORE_INFO_Y1, U_SCORE_INFO_X2+10, U_SCORE_INFO_Y2);
00693
00694
00695 more_report_bitmap = vga_back.save_area( MORE_REPORT_X1, MORE_REPORT_Y1+2, MORE_REPORT_X2, MORE_REPORT_Y2);
00696 help_quest_bitmap = vga_back.save_area( HELP_QUEST_X1, HELP_QUEST_Y1+2, HELP_QUEST_X2, HELP_QUEST_Y2);
00697 list_button_bitmap = vga_back.save_area( LIST_BUTTON_X1, LIST_BUTTON_Y1, LIST_BUTTON_X2, LIST_BUTTON_Y2);
00698 date_info_bitmap = vga_back.save_area( DATE_INFO_X1, DATE_INFO_Y1, DATE_INFO_X2, DATE_INFO_Y2);
00699 year_info_bitmap = vga_back.save_area( YEAR_INFO_X1, YEAR_INFO_Y1, YEAR_INFO_X2, YEAR_INFO_Y2);
00700
00701
00702
00703 top_left_column_bitmap = vga_back.save_area( ZOOM_X1, ZOOM_Y1, ZOOM_X1+COLUMN_WIDTH-1, ZOOM_Y1+COLUMN_HEIGHT-1);
00704 top_right_column_bitmap = vga_back.save_area( ZOOM_X2-COLUMN_WIDTH+1, ZOOM_Y1, ZOOM_X2, ZOOM_Y1+COLUMN_HEIGHT-1);
00705
00706 bottom_left_column_bitmap = vga_back.save_area( ZOOM_X1, ZOOM_Y2-COLUMN_HEIGHT+1, ZOOM_X1+COLUMN_WIDTH-1, ZOOM_Y2);
00707 bottom_right_column_bitmap = vga_back.save_area( ZOOM_X2-COLUMN_WIDTH+1, ZOOM_Y2-COLUMN_HEIGHT+1, ZOOM_X2, ZOOM_Y2);
00708
00709
00710
00711 menu_up_bitmap = vga_back.save_area(MENU_BUTTON_X1, MENU_BUTTON_Y1, MENU_BUTTON_X2, MENU_BUTTON_Y2);
00712 vga_back.put_bitmap(MENU_BUTTON_X1, MENU_BUTTON_Y1, image_interface.get_ptr("MENUDOWN"));
00713 menu_down_bitmap = vga_back.save_area(MENU_BUTTON_X1, MENU_BUTTON_Y1, MENU_BUTTON_X2, MENU_BUTTON_Y2);
00714
00715 short *bitmapPtr = (short *)image_interface.get_ptr("REPORT-0");
00716
00717 for (int i = 0; i < REPORT_ITEMS+1; i++)
00718 report_bitmap[i] = mem_add(*(bitmapPtr) * *(bitmapPtr+1) + 2*sizeof(short));
00719
00720
00721 char strBuf[100];
00722 strcpy(strBuf,"REPORT-?");
00723
00724 for (i = 0; i < REPORT_ITEMS+1; i++) {
00725 strBuf[7] = i + '0';
00726 bitmapPtr = (short *)image_interface.get_ptr(strBuf);
00727 memcpy(report_bitmap[i], bitmapPtr, *(bitmapPtr) * *(bitmapPtr+1) + 2);
00728 }
00729 }
00730
00731
00732
00733
00735
00736 if( sys.signal_exit_flag )
00737 return;
00738
00739
00740
00741 disp_selected_name();
00742
00743
00744
00745 vga.use_back();
00746 vga_back.rest_area( surplus_info_bitmap, 0 );
00747 font_fdiamond.center_put(SURPLUS_INFO_X1, SURPLUS_INFO_Y1, SURPLUS_INFO_X2, SURPLUS_INFO_Y2, m.format((float)((int)finance.this_year.surplus_deficit),7));
00748 vga.use_front();
00749
00750 vga.blt_buf(SURPLUS_INFO_X1, SURPLUS_INFO_Y1, SURPLUS_INFO_X2, SURPLUS_INFO_Y2);
00751
00752
00753
00754 disp_calendar();
00755
00756
00757
00758 int scoreChange = (int)player_school.cur_game_score - (int)player_school.game_score_history[THIS_MONTH-1];
00759 String str;
00760
00761 image_interface.put_back( 578, 0, "CUP" );
00762 vga.blt_buf(578,0,623,31);
00763
00764
00765 str = m.format( (int) player_school.cur_game_score, 4 );
00766
00767 if( scoreChange >= 0 ) {
00768 image_interface.put_back(514, 0, "REPU-UP" );
00769 vga.blt_buf(514,0,544,29);
00770 }
00771 else {
00772 image_interface.put_back( 508, 0, "REPU-DWN" );
00773 vga.blt_buf(514,0,544,29);
00774 }
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789 vga.use_back();
00790 vga_back.rest_area(score_info_bitmap,0,0);
00791
00792 font_numbers.put( SCORE_INFO_X1, SCORE_INFO_Y1, str, 1, SCORE_INFO_X2 );
00793
00794 vga.blt_buf(SCORE_INFO_X1, SCORE_INFO_Y1, SCORE_INFO_X2, SCORE_INFO_Y2);
00795
00796
00797 str = m.format( (int)player_school.ultimate_game_score, 4 );
00798 vga_back.rest_area(uscore_info_bitmap,0,0);
00799
00800
00801
00802 if( player_school.ultimate_game_score > 0 )
00803 font_numbers.put( U_SCORE_INFO_X1, U_SCORE_INFO_Y1, str, 1, U_SCORE_INFO_X2+10 );
00804 else
00805 font_redcharts.put( U_SCORE_INFO_X1, U_SCORE_INFO_Y1-5, str, 1, U_SCORE_INFO_X2+10 );
00806
00807 vga.blt_buf(U_SCORE_INFO_X1, U_SCORE_INFO_Y1, U_SCORE_INFO_X2+10, U_SCORE_INFO_Y2);
00808
00809
00810 vga_back.rest_area(more_report_bitmap,0,0);
00811
00812 if(sys.view_mode==MODE_MORE_REPORT)
00813 font_hstone.put( MORE_REPORT_X1, MORE_REPORT_Y1-1, "more reports", 1, MORE_REPORT_X2 );
00814 else
00815 font_stone.put( MORE_REPORT_X1, MORE_REPORT_Y1-1, "more reports", 1, MORE_REPORT_X2 );
00816
00817 vga.blt_buf(MORE_REPORT_X1, MORE_REPORT_Y1-1, MORE_REPORT_X2, MORE_REPORT_Y2);
00818
00819
00820 vga_back.rest_area(help_quest_bitmap,0,0);
00821
00822 if(sys.view_mode==MODE_HELP_TOPIC)
00823 font_hstone.put( HELP_QUEST_X1, HELP_QUEST_Y1-1, "?", 1, HELP_QUEST_X2 );
00824 else
00825 font_stone.put( HELP_QUEST_X1, HELP_QUEST_Y1-1, "?", 1, HELP_QUEST_X2 );
00826
00827 vga.blt_buf(HELP_QUEST_X1, HELP_QUEST_Y1-1, HELP_QUEST_X2, HELP_QUEST_Y2);
00828
00829 }
00830
00831
00832
00833
00837
00838 vgaBuf->rest_area( top_left_column_bitmap, 0, 1 );
00839 vgaBuf->rest_area( top_right_column_bitmap, 0, 1 );
00840
00841 vgaBuf->rest_area( bottom_left_column_bitmap, 0, 1 );
00842 vgaBuf->rest_area( bottom_right_column_bitmap, 0, 1 );
00843 }
00844
00845
00846
00847
00851
00852
00853
00854 vga_back.rest_area( top_info_bitmap, 0 );
00855
00856 String deptStr;
00857
00858
00859
00860 if( sys.is_institution_report ) {
00861 #if(GAME_VERSION>=200)
00862 if( sys.view_mode >= MODE_FIRST_NONDEPARTMENTAL_FIRM && sys.view_mode <= MODE_LAST_NONDEPARTMENTAL_FIRM )
00863 deptStr = firm_res[sys.view_mode - MODE_FIRST_NONDEPARTMENTAL_FIRM + FIRST_NONDEPARTMENTAL_FIRM_ID]->name;
00864 else
00865 #endif
00866 deptStr = player_school.school_name;
00867 }
00868 #if(GAME_VERSION>=200)
00869 #else
00870 else if( sys.view_mode >= MODE_FIRST_NONDEPARTMENTAL_FIRM &&
00871 sys.view_mode <= MODE_LAST_NONDEPARTMENTAL_FIRM ) {
00872 deptStr = firm_res[sys.view_mode - MODE_FIRST_NONDEPARTMENTAL_FIRM + 1]->name;
00873 }
00874 #endif
00875 else if( department_array.selected_recno ) {
00876
00877
00878
00879 deptStr = department_res[department_array[department_array.selected_recno]->department_id]->name;
00880 deptStr += " Department";
00881 }
00882
00883 if( deptStr.len() > 0 ) {
00884
00885
00886 for( char *strPtr = deptStr.str_buf; *strPtr != NULL; strPtr++ ) {
00887 if (*strPtr >= 'A' && *strPtr <= 'Z')
00888 *strPtr += 32;
00889 if (*strPtr ==':')
00890 *strPtr = ':'+2;
00891 }
00892
00893 vga.use_back();
00894 font_stone.center_put(TOP_INFO_X1, TOP_INFO_Y1, TOP_INFO_X2, TOP_INFO_Y2, deptStr);
00895 vga.use_front();
00896 }
00897
00898 vga.blt_buf( TOP_INFO_X1, TOP_INFO_Y1+4, TOP_INFO_X2, TOP_INFO_Y2 );
00899
00900
00901
00902 vga_back.rest_area( bottom_info_bitmap, 0 );
00903
00904 if( sys.view_mode == MODE_NORMAL &&
00905 firm_array.touched_recno &&
00906
00907 sys.frame_count - firm_array.touched_frame_count <= 1 ) {
00908 String deptStr(firm_array[firm_array.touched_recno]->name());
00909
00910
00911
00912
00913
00914
00915 for( char *strPtr = deptStr.str_buf; *strPtr != NULL; strPtr++ ) {
00916 if (*strPtr >= 'A' && *strPtr <= 'Z')
00917 *strPtr += 32;
00918 if (*strPtr ==':')
00919 *strPtr = ':'+2;
00920 }
00921
00922 vga.use_back();
00923 font_stone.center_put(BOTTOM_INFO_X1, BOTTOM_INFO_Y1, BOTTOM_INFO_X2, BOTTOM_INFO_Y2, deptStr);
00924 vga.use_front();
00925 }
00926
00927 vga.blt_buf( BOTTOM_INFO_X1, BOTTOM_INFO_Y1, BOTTOM_INFO_X2, BOTTOM_INFO_Y2 );
00928 }
00929
00930
00931
00932
00933
00934 void Info::disp_calendar() {
00935
00936
00937 int newDay;
00938
00939 if (last_day != (newDay = date.day(info.game_date))||sys.redraw_all_flag==1) {
00940 mouse.hide_area(DATE_INFO_X1,DATE_INFO_Y1,DATE_INFO_X2,DATE_INFO_Y2);
00941 vga_front.rest_area( date_info_bitmap, 0 );
00942 char digitStr[2];
00943 digitStr[1] = '\0';
00944 digitStr[0] = char(newDay % 10) + '0';
00945 if (newDay > 9) {
00946 vga_front.put_bitmap_trans(day_x1_2, digit_y1, date_res_bitmap.get_ptr(digitStr));
00947 digitStr[0] = char(newDay / 10) + '0';
00948 vga_front.put_bitmap_trans(day_x1_1, digit_y1, date_res_bitmap.get_ptr(digitStr));
00949 }
00950 else {
00951 vga_front.put_bitmap_trans(day_x1_0, digit_y1, date_res_bitmap.get_ptr(digitStr));
00952 }
00953 mouse.show_area();
00954 last_day = newDay;
00955 }
00956
00957
00958
00959 int newYear;
00960 #if(GAME_VERSION>=200)
00961 if( last_year != (newYear=info.financial_year()) || sys.redraw_all_flag==1 )
00962 #else
00963 if( last_year != (newYear=info.game_year) || sys.redraw_all_flag==1 )
00964 #endif
00965 {
00966 mouse.hide_area(YEAR_INFO_X1,YEAR_INFO_Y1,YEAR_INFO_X2,YEAR_INFO_Y2);
00967 vga_front.rest_area( year_info_bitmap, 0 );
00968 char digitStr[2];
00969 digitStr[1] = '\0';
00970 digitStr[0] = char((newYear % 100) / 10) + '0';
00971 vga_front.put_bitmap_trans(year_x1_1, digit_y1, date_res_bitmap.get_ptr(digitStr));
00972 digitStr[0] = char(newYear % 10) + '0';
00973 vga_front.put_bitmap_trans(year_x1_2, digit_y1, date_res_bitmap.get_ptr(digitStr));
00974 mouse.show_area();
00975 last_year = newYear;
00976 }
00977
00978
00979
00980 char* bitmapNameArray[] = { "FALL", "WINTER", "SUMMER" };
00981
00982 mouse.hide_area(YEAR_INFO_X1,YEAR_INFO_Y1,YEAR_INFO_X2,YEAR_INFO_Y2);
00983 if( player_school.is_trimester_off )
00984 vga_front.put_bitmap(SEASON_X1, SEASON_Y1, date_res_bitmap.get_ptr("BREAK") );
00985 else
00986 vga_front.put_bitmap(SEASON_X1, SEASON_Y1, date_res_bitmap.get_ptr(bitmapNameArray[player_school.cur_trimester]) );
00987 mouse.show_area();
00988
00989
00990
00991 int newMonth;
00992
00993 if (last_month != (newMonth = date.month(info.game_date))||sys.redraw_all_flag==1) {
00994 char *monthPtr;
00995
00996 switch (last_month = newMonth) {
00997 case 1:
00998 monthPtr = date_res_bitmap.get_ptr("JAN"); break;
00999 case 2:
01000 monthPtr = date_res_bitmap.get_ptr("FEB"); break;
01001 case 3:
01002 monthPtr = date_res_bitmap.get_ptr("MAR"); break;
01003 case 4:
01004 monthPtr = date_res_bitmap.get_ptr("APR"); break;
01005 case 5:
01006 monthPtr = date_res_bitmap.get_ptr("MAY"); break;
01007 case 6:
01008 monthPtr = date_res_bitmap.get_ptr("JUN"); break;
01009 case 7:
01010 monthPtr = date_res_bitmap.get_ptr("JUL"); break;
01011 case 8:
01012 monthPtr = date_res_bitmap.get_ptr("AUG"); break;
01013 case 9:
01014 monthPtr = date_res_bitmap.get_ptr("SEP"); break;
01015 case 10:
01016 monthPtr = date_res_bitmap.get_ptr("OCT"); break;
01017 case 11:
01018 monthPtr = date_res_bitmap.get_ptr("NOV"); break;
01019 case 12:
01020 monthPtr = date_res_bitmap.get_ptr("DEC"); break;
01021 }
01022
01023 mouse.hide_area(DATE_INFO_X1,DATE_INFO_Y1,DATE_INFO_X2,DATE_INFO_Y2);
01024 vga_front.put_bitmap(MONTH_X1, MONTH_Y1, monthPtr);
01025 mouse.show_area();
01026 }
01027 }
01028
01029
01030
01031
01032
01033 int Info::financial_year() {
01034 if( game_month<finance.fiscal_year_start_month )
01035 return game_year-1;
01036 else
01037 return game_year;
01038 }
01039
01040
01041
01042
01043
01044 char* Info::date_str_ymd( int year, int month, int day, int formatFlag) {
01045 static String str;
01046
01047 str = "";
01048
01049 int seperatorFlag = 0;
01050
01051
01052 if( month && !(formatFlag & INFO_DATE_NO_MONTH) ) {
01053 if( seperatorFlag )
01054 str += " ";
01055
01056 if( formatFlag & INFO_DATE_SHORT_MONTH ) {
01057 char shortMonthStr[3+1];
01058 m.str_shorten(shortMonthStr, date.month_str(month), 3 );
01059 str += shortMonthStr;
01060 }
01061 else
01062 str += date.month_str(month);
01063
01064 seperatorFlag = 1;
01065 }
01066
01067
01068 if( day && !(formatFlag & INFO_DATE_NO_DAY) ) {
01069 if( seperatorFlag )
01070 str += " ";
01071
01072 str += day;
01073
01074 seperatorFlag = 1;
01075 }
01076
01077
01078
01079 if( year && !(formatFlag & INFO_DATE_NO_YEAR) ) {
01080
01081 if( (formatFlag & INFO_DATE_F_YEAR) && month && month < finance.fiscal_year_start_month )
01082 year--;
01083
01084 if( formatFlag & INFO_DATE_ADD_YR ) {
01085 if( seperatorFlag )
01086 str += " ";
01087 str += m.format( year, 16 );
01088 }
01089 else {
01090 if( seperatorFlag )
01091 str += ", ";
01092 str += m.format(year, 4);
01093 }
01094
01095 seperatorFlag = 1;
01096 }
01097
01098 return str;
01099 }
01100
01101
01102
01103
01104
01105 char* Info::date_str_julian( long julianDate, int formatFlag) {
01106
01107
01108
01109
01110 if( formatFlag & (INFO_DATE_NO_MONTH|INFO_DATE_NO_YEAR|INFO_DATE_F_YEAR|INFO_DATE_ADD_YR)
01111 == INFO_DATE_ADD_YR )
01112 return date.date_str( julianDate, formatFlag & INFO_DATE_SHORT_MONTH, !(formatFlag & INFO_DATE_NO_DAY) );
01113 return date_str_ymd( date.year(julianDate), date.month(julianDate), date.day(julianDate), formatFlag );
01114 }
01115
01116
01117
01118 #if(GAME_VERSION>=200)
01119
01120
01121
01122 void Info::update_distance_learning_variables(char initValue) {
01123
01124 int deptSize = department_array.size();
01125 for( int i=deptSize ; i>0 ; i--) {
01126 if ( department_array.is_deleted(i) )
01127 continue;
01128
01129 Department* deptPtr = department_array[i];
01130 deptPtr->total_distance_learning_place = 0;
01131 CourseArray* courseArrayPtr = &department_array[i]->course_array;
01132 int courseSize = courseArrayPtr->size();
01133 for (int j=courseSize; j>0; j--) {
01134 if ( courseArrayPtr->is_deleted(j) )
01135 continue;
01136
01137 Course* coursePtr = courseArrayPtr->operator [](j);
01138
01139 int randomNo = m.random(100);
01140 if ( randomNo < deptPtr->p_tech_utilization ) {
01141
01142
01143
01144
01145
01146 if ( initValue )
01147 coursePtr->distance_learning_place = (coursePtr->normal_class_size()*1.25*coursePtr->class_section_count-
01148 coursePtr->convention_student_count)*coursePtr->class_section_count*
01149 deptPtr->distance_learning_credits/100;
01150 else
01151 coursePtr->distance_learning_place = (coursePtr->normal_class_size()*1.5*coursePtr->class_section_count-
01152 coursePtr->convention_student_count)*coursePtr->class_section_count*
01153 deptPtr->distance_learning_credits/100;
01154 }
01155 else
01156 coursePtr->distance_learning_place = 0;
01157
01158
01159 deptPtr->total_distance_learning_place += coursePtr->distance_learning_place;
01160 }
01161 }
01162
01163
01164 int totalDLProvided = 0;
01165 for ( i=deptSize; i>0; i-- ) {
01166 if ( department_array.is_deleted(i) )
01167 continue;
01168
01169 Department* deptPtr = department_array[i];
01170 CourseArray* courseArrayPtr = &department_array[i]->course_array;
01171 int courseSize = courseArrayPtr->size();
01172
01173
01174 deptPtr->distance_learning_enrollment = 0;
01175
01176 for ( int j=courseSize; j>0; j-- ) {
01177 if ( courseArrayPtr->is_deleted(j) )
01178 continue;
01179
01180 Course* coursePtr = courseArrayPtr->operator [](j);
01181
01182
01183
01184 if ( deptPtr->total_distance_learning_place == 0 )
01185 coursePtr->actual_distance_learning_enrollment = 0;
01186 else
01187 coursePtr->actual_distance_learning_enrollment = enroll_res.total_matrics[4]*coursePtr->distance_learning_place/
01188 deptPtr->total_distance_learning_place;
01189
01190
01191 coursePtr->convention_student_count += coursePtr->actual_distance_learning_enrollment;
01192
01193
01194 deptPtr->distance_learning_enrollment += coursePtr->actual_distance_learning_enrollment;
01195 }
01196
01197
01198 deptPtr->distance_credits_provided = deptPtr->distance_learning_enrollment;
01199 totalDLProvided += deptPtr->distance_credits_provided;
01200 }
01201
01202 finance.calc_distance_learning_expenditure();
01203
01204
01205 int h = THIS_YEAR;
01206 shift_history( enroll_res.distance_credits_provided_history, HISTORY_TRIMESTER_COUNT );
01207 enroll_res.distance_credits_provided_history[THIS_TRIMESTER] = (int)totalDLProvided;
01208
01209 }
01210
01211
01212
01213 #endif