00001
00002
00003
00004 #include <OSYS.H>
00005 #include <OIFACE.H>
00006 #include <OMATH.H>
00007 #include <OSYS.H>
00008 #include <OVGA.H>
00009 #include <OINFO.H>
00010 #include <OCONFIG.H>
00011 #include <OPSCHOOL.H>
00012 #include <OOPT.H>
00013 #include <OMOUSE.H>
00014 #include <ODEPT.H>
00015 #include <OBUTTON.H>
00016 #include <OLETTER.H>
00017 #include <OWORLD.H>
00018 #include <OFONT.H>
00019 #include <OFINANCE.H>
00020 #include <OAUDIO.H>
00021 #include <OATHLETI.H>
00022 #include <OENROLL.H>
00023
00024
00025
00026 enum {
00027 BUTTON_Y1=ZOOM_Y2-31,
00028 BUTTON_Y2=BUTTON_Y1+24
00029 };
00030
00031 enum {
00032 BUTTON_BACK_WIDTH = 80,
00033 BUTTON_NEXT_WIDTH = 80,
00034 BUTTON_DISTANCE = 60
00035 };
00036
00037 #if(GAME_VERSION>=200)
00038 enum {
00039 FACULTY_LISTS,
00040 FACULTY_DETAILS,
00041 };
00042 #endif
00043
00044
00045
00046 static report_screen_id;
00047 static Button button_back, button_next;
00048
00049
00050
00051 static void screen_intro();
00052 static void screen_opt_intro();
00053 static void screen_last_year_finance(int reportOrder, int reportType, int reportYear, char* reportTitle, int refreshFlag);
00054 static void screen_last_year_finance_detect(int reportType, int reportYear);
00055 static int screen_keeping;
00056 static int speed_keeping;
00057
00058
00059
00060 void Finance::new_fiscal_year() {
00061 if ( !update_projected_arrays_pre_optimization() )
00062 return;
00063
00064
00065
00066 if( info.prerun_year==1 ) {
00067
00068
00069 int i=AC_SPONSORED_RESEARCH_REVENUE;
00070
00071 revenue_array[i].direct = projected_revenue_array[i].last_month.direct * 12;
00072 revenue_array[i].indirect = projected_revenue_array[i].last_month.indirect * 12;
00073 revenue_array[i].total = projected_revenue_array[i].last_month.total * 12;
00074
00075
00076
00077 i=AC_SPONSORED_RESEARCH_EXPENSE;
00078
00079 double totalRevenue = revenue_array[AC_SPONSORED_RESEARCH_REVENUE].direct;
00080
00081 expense_array[i].faculty = totalRevenue * research_expense_fac_ratio;
00082 expense_array[i].staff = totalRevenue * research_expense_staff_ratio;
00083 expense_array[i].other = totalRevenue * ( 1-research_expense_fac_ratio-research_expense_staff_ratio);
00084 expense_array[i].total = expense_array[i].faculty + expense_array[i].staff + expense_array[i].other;
00085
00086
00087
00088 #if(GAME_VERSION>=200)
00089
00090
00091 #else
00092 revenue_array[AC_ENDOWMENT_SPENDING].total = this_year.asset_array[AC_ENDOWMENT] * math.get_random_snd(0.94f,0.003f) * 0.05f;
00093 #endif
00094
00095
00096
00097 calc_total_last_year();
00098
00099
00100
00101 apply_relative_wealth_effect();
00102
00103
00104
00105 calc_total_last_year();
00106 }
00107
00108
00109
00110 letter.init_eval_letter();
00111
00112 #if(GAME_VERSION>=200)
00113 {
00114
00115
00116 if ( player_school.is_public() ) {
00117 finance.update_appropiation();
00118 double temp = finance.revenue_array[AC_STATE_APPROPRIATION].total;
00119 RevenueItemChange* projRev;
00120 projRev = &finance.projected_revenue_array[AC_STATE_APPROPRIATION];
00121 projRev->change_budget_year.total
00122 = finance.calc_change( finance.budget_revenue_array[AC_STATE_APPROPRIATION].total, temp );
00123
00124 projRev->change_last_year.total = finance.calc_change( projRev->this_year.total, temp );
00125 }
00126 }
00127 #endif
00128
00129
00130
00131 if( config.disp_year_end_report ) {
00132 report_screen_id = 0;
00133
00134 #if(GAME_VERSION>=200)
00135 for ( int i=department_array.size(); i>0; i-- ) {
00136 optimization.pre_target_value[i-1] = finance.hiring_policy_array[i-1].target_value;
00137
00138 Department* deptPtr = department_array[i];
00139
00140
00141 faculty_res.is_year_end_report = 1;
00142 finance.hiring_policy_array[i-1].upper_bound = 10;
00143 finance.hiring_policy_array[i-1].target_value = optimization.pre_target_value[i-1] + deptPtr->faculty_departures_number();
00144 finance.hiring_policy_array[i-1].weight = 1/( max( 1, deptPtr->faculty_array.size() ) );
00145 }
00146 #endif
00147
00148 sys.set_staying_view_mode(MODE_YEAR_END_REPORT);
00149
00150 audio.play_wav("PHONE",audio.int_to_DsVolume(config.sound_effect_volume));
00151 }
00152 else {
00153
00154
00155
00156 optimize_policy_1();
00157
00158 optimize_policy_2();
00159 sys.yield();
00160 pre_optimization_stage_3();
00161 optimize_policy_3();
00162
00163 finance.calc_budget_report();
00164
00165 #if(GAME_VERSION>=200)
00166 for ( int i=department_array.size(); i>0; i-- ) {
00167
00168 finance.hiring_policy_array[i-1].target_value = 0;
00169 }
00170 #endif
00171
00172
00173
00174 sys.redraw_all_flag=1;
00175 }
00176 }
00177
00178
00179
00180
00181
00182 void Finance::new_fiscal_year_report(int refreshFlag) {
00183 switch( report_screen_id ) {
00184 case 0:
00185 screen_intro();
00186 speed_keeping=sys.save_speed;
00187 screen_keeping=sys.save_view_mode;
00188 optimization.is_optimized[0]=0;
00189 optimization.is_optimized[1]=0;
00190 optimization.is_optimized[2]=0;
00191 optimization.is_optimize_slider_modified[0]=0;
00192 optimization.is_optimize_slider_modified[1]=0;
00193 optimization.is_optimize_slider_modified[2]=0;
00194 break;
00195
00196 case 1:
00197 sys.staying_view_mode=MODE_EVALUATION_LETTER;
00198 sys.set_view_mode(MODE_EVALUATION_LETTER);
00199 sys.save_view_mode=MODE_YEAR_END_REPORT;
00200
00201 #if(GAME_VERSION>=200)
00202 #else
00203 report_screen_id=2;
00204 #endif
00205 break;
00206
00207 case 2:
00208
00209
00210 #if(GAME_VERSION>=200)
00211 sys.staying_view_mode=MODE_STATE_REPORT;
00212 sys.set_view_mode(MODE_STATE_REPORT);
00213 sys.save_view_mode=MODE_YEAR_END_REPORT;
00214 #else
00215 screen_last_year_finance(1, REPORT_TYPE_REVENUE, REPORT_YEAR_PREV, "Revenue and expenditure statement", refreshFlag);
00216 #endif
00217 break;
00218
00219 case 3:
00220 screen_last_year_finance(2, REPORT_TYPE_BALANCE, REPORT_YEAR_PREV, "Balance sheet", refreshFlag);
00221 break;
00222
00223 #if(GAME_VERSION>=200)
00224 case 4: player_school.summary_student_report_7(refreshFlag);
00225 break;
00226 case 5: faculty_res.is_year_end_report = 1;
00227 faculty_res.summary_report_9(refreshFlag);
00228 break;
00229
00230 case 6: faculty_res.summary_report_10(refreshFlag);
00231 break;
00232
00233 case 7:
00234 screen_opt_intro();
00235 break;
00236
00237 case 8:
00238 case 9:
00239 case 10:
00240 sys.view_mode=MODE_YEAR_END_REPORT;
00241 optimization.disp(refreshFlag);
00242 break;
00243
00244 case 11:
00245 finance.calc_budget_report();
00246 sys.save_view_mode=screen_keeping;
00247 #if(GAME_VERSION>=200)
00248 config.frame_speed=DEFAULT_SPEED;
00249 sys.save_speed=DEFAULT_SPEED;
00250 for ( int i=department_array.size(); i>0; i-- ) {
00251
00252 finance.hiring_policy_array[i-1].target_value = 0;
00253 }
00254 #else
00255 config.frame_speed=speed_keeping;
00256 sys.save_speed=speed_keeping;
00257 #endif
00258 sys.set_staying_view_mode(0);
00259 sys.set_view_mode(screen_keeping);
00260 optimization.is_optimized[0]=0;
00261 optimization.is_optimized[1]=0;
00262 optimization.is_optimized[2]=0;
00263 optimization.is_optimize_slider_modified[0]=0;
00264 optimization.is_optimize_slider_modified[1]=0;
00265 optimization.is_optimize_slider_modified[2]=0;
00266 sys.redraw_all_flag=1;
00267 break;
00268
00269 #else
00270 case 4:
00271 screen_opt_intro();
00272 break;
00273
00274 case 5:
00275 case 6:
00276 case 7:
00277 sys.view_mode=MODE_YEAR_END_REPORT;
00278 optimization.disp(refreshFlag);
00279 break;
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293 case 8:
00294 finance.calc_budget_report();
00295 sys.save_view_mode=screen_keeping;
00296 config.frame_speed=speed_keeping;
00297 sys.save_speed=speed_keeping;
00298 sys.set_staying_view_mode(0);
00299 optimization.is_optimized[0]=0;
00300 optimization.is_optimized[1]=0;
00301 optimization.is_optimized[2]=0;
00302 optimization.is_optimize_slider_modified[0]=0;
00303 optimization.is_optimize_slider_modified[1]=0;
00304 optimization.is_optimize_slider_modified[2]=0;
00305 sys.redraw_all_flag=1;
00306 break;
00307 #endif
00308 }
00309 }
00310
00311
00312
00313
00314
00315 void Finance::new_fiscal_year_report_detect() {
00316 int reportScreenId = report_screen_id;
00317
00318 switch( report_screen_id ) {
00319 case 0:
00320 if( mouse.single_click() )
00321 report_screen_id++;
00322 break;
00323
00324 case 1:
00325 #if(GAME_VERSION>=200)
00326 if ( letter.eval_letter_detect() == 2 ) {
00327 if ( player_school.is_public() ) {
00328 report_screen_id=2;
00329 sys.set_view_mode( MODE_STATE_REPORT );
00330 sys.staying_view_mode = MODE_STATE_REPORT;
00331 }
00332 else {
00333 report_screen_id=4;
00334 enroll_res.update_student_intake();
00335 sys.set_view_mode( MODE_YEAR_END_REPORT );
00336 sys.staying_view_mode = MODE_YEAR_END_REPORT;
00337 }
00338 }
00339 #endif
00340 break;
00341
00342 case 2:
00343 #if(GAME_VERSION>=200)
00344 switch ( letter.state_report_detect() ) {
00345 case 2:
00346 report_screen_id=4;
00347 enroll_res.update_student_intake();
00348 sys.set_view_mode(MODE_YEAR_END_REPORT);
00349 sys.staying_view_mode = MODE_YEAR_END_REPORT;
00350 break;
00351
00352 case 1:
00353 report_screen_id=1;
00354 sys.set_view_mode(MODE_EVALUATION_LETTER);
00355 sys.staying_view_mode = MODE_EVALUATION_LETTER;
00356 break;
00357 }
00358
00359 #else
00360 screen_last_year_finance_detect(REPORT_TYPE_REVENUE, REPORT_YEAR_PREV);
00361 #endif
00362 break;
00363
00364 case 3:
00365 screen_last_year_finance_detect(REPORT_TYPE_BALANCE, REPORT_YEAR_PREV);
00366 break;
00367
00368 #if(GAME_VERSION>=200)
00369 case 4:
00370 switch ( player_school.summary_student_report_detect() ) {
00371 case 1:
00372 if ( player_school.is_public() ) {
00373 sys.set_view_mode( MODE_STATE_REPORT );
00374 sys.staying_view_mode = MODE_STATE_REPORT;
00375 report_screen_id = 2;
00376 }
00377 else {
00378 sys.set_view_mode( MODE_EVALUATION_LETTER );
00379 sys.staying_view_mode = MODE_EVALUATION_LETTER;
00380 report_screen_id = 1;
00381 }
00382 break;
00383 case 2: report_screen_id++;
00384 faculty_res.current_year_report = FACULTY_LISTS;
00385 }
00386 break;
00387
00388 case 5:
00389 switch ( faculty_res.summary_report_detect() ) {
00390 case 1: report_screen_id++;
00391 faculty_res.current_year_report = FACULTY_DETAILS;
00392 break;
00393 case 2: report_screen_id--;
00394 break;
00395 case 3: report_screen_id=7;
00396 }
00397 break;
00398
00399 case 6:
00400 if ( faculty_res.summary_report_detect() ) {
00401 report_screen_id--;
00402 faculty_res.current_year_report = FACULTY_LISTS;
00403 }
00404 break;
00405
00406 case 7:
00407 if( mouse.single_click() ) {
00408 report_screen_id++;
00409 optimization.current_stage = 1;
00410 }
00411 break;
00412
00413 case 8:
00414 if ( optimization.detect() == 2 )
00415 report_screen_id = 5;
00416
00417 if( optimization.current_stage > 1 )
00418 report_screen_id++;
00419
00420 break;
00421
00422 case 9:
00423 optimization.detect();
00424
00425 if( optimization.current_stage < 2 )
00426 report_screen_id--;
00427
00428 else if( optimization.current_stage > 2 ) {
00429
00430 for ( int i=department_array.size(); i>0; i-- )
00431 finance.hiring_policy_array[i].result_value = 0;
00432 report_screen_id++;
00433 }
00434 break;
00435
00436 case 10:
00437 optimization.detect();
00438
00439 if( optimization.current_stage < 3 )
00440 report_screen_id--;
00441 else if( optimization.current_stage > 3 ) {
00442 report_screen_id++;
00443
00444 optimization.opt1_slider_group[0].lock_max = 0;
00445 float max = 5.0;
00446 *optimization.opt1_slider_group[0].up_ptr = max;
00447
00448 faculty_res.is_year_end_report = 0;
00449 player_school.is_year_end_report = 0;
00450 }
00451 break;
00452
00453 case 11:
00454 screen_last_year_finance_detect(REPORT_TYPE_REVENUE, REPORT_YEAR_THIS);
00455 break;
00456
00457 case 12:
00458 screen_last_year_finance_detect(REPORT_TYPE_BALANCE, REPORT_YEAR_THIS);
00459 break;
00460 }
00461 #else
00462 case 4:
00463 if( mouse.single_click() ) {
00464 report_screen_id++;
00465 optimization.current_stage = 1;
00466 }
00467 break;
00468
00469 case 5:
00470 optimization.detect();
00471
00472 if( optimization.current_stage < 1 )
00473 report_screen_id--;
00474
00475 else if( optimization.current_stage > 1 )
00476 report_screen_id++;
00477 break;
00478
00479 case 6:
00480 optimization.detect();
00481
00482 if( optimization.current_stage < 2 )
00483 report_screen_id--;
00484
00485 else if( optimization.current_stage > 2 )
00486 report_screen_id++;
00487 break;
00488
00489 case 7:
00490 optimization.detect();
00491
00492 if( optimization.current_stage < 3 )
00493 report_screen_id--;
00494 else if( optimization.current_stage > 3 ) {
00495 report_screen_id++;
00496 }
00497 break;
00498
00499 case 8:
00500 screen_last_year_finance_detect(REPORT_TYPE_REVENUE, REPORT_YEAR_THIS);
00501 break;
00502
00503 case 9:
00504 screen_last_year_finance_detect(REPORT_TYPE_BALANCE, REPORT_YEAR_THIS);
00505 break;
00506 }
00507 #endif
00508
00509 if( report_screen_id != reportScreenId )
00510 sys.redraw_zoom_flag = 1;
00511 }
00512
00513
00514
00515 #if(GAME_VERSION>=200)
00516
00517
00518 void Finance::update_appropiation() {
00519
00520
00521
00522
00523 finance.base_appropriation[0] = finance.base_appropriation[1];
00524 finance.enroll_appropriation[0] = finance.enroll_appropriation[1];
00525 finance.performance_appropriation[0] = finance.performance_appropriation[1];
00526 finance.education_quality_appropriation[0] = finance.education_quality_appropriation[1];
00527 finance.total_appropriation[0] = finance.total_appropriation[1];
00528 finance.facility_reserve_appropriation[0] = finance.facility_reserve_appropriation[1];
00529
00530
00531
00532
00533 double STt;
00534 double STDiv;
00535 double SEt;
00536 double SPIt;
00537 double SEQt;
00538 double SBt;
00539 double STAt;
00540
00541
00542 double XTDiv,X1Div,X2Div,X3Div,X4Div;
00543
00544 if ( info.prerun_year ) {
00545
00546 initial_state_appropriation = projected_revenue_array[AC_STATE_APPROPRIATION].this_year.total;
00547 initial_base_appropriation = 0.5*initial_state_appropriation;
00548 initial_enrollment_appropriation = 0.35*initial_state_appropriation;
00549 initial_performance_appropriation = 0.15*initial_state_appropriation;
00550 }
00551
00552
00554
00555 if( info.prerun_year || initial_state_appropriation == 0.0 )
00556 STDiv = 1.0;
00557 else
00558 STDiv = STt / initial_state_appropriation;
00559
00560
00561
00562
00563
00564 if( info.prerun_year || department_array.initial_convention_student_count[MAX_TEACHING_METHOD_N_TOTAL-1] == 0 )
00565 XTDiv = 1.0;
00566 else
00567 XTDiv = (double)department_array.convention_student_count_history[MAX_TEACHING_METHOD_N_TOTAL-1][HISTORY_TRIMESTER_COUNT-3]
00568 / department_array.initial_convention_student_count[MAX_TEACHING_METHOD_N_TOTAL-1];
00569
00570 SEt = initial_enrollment_appropriation
00571 *STDiv
00572 *XTDiv;
00573
00574 finance.enroll_appropriation[1] = SEt;
00575
00576
00577
00578
00579 if( info.prerun_year || player_school.sub_score_start[S_DEGREES_GRANTED] == 0.0 )
00580 X1Div = 1.0;
00581 else
00582 X1Div = player_school.sub_score[S_DEGREES_GRANTED][HISTORY_MONTH_COUNT-1]
00583 / player_school.sub_score_start[S_DEGREES_GRANTED];
00584
00585
00586
00587 if( info.prerun_year || player_school.sub_score_start[S_STUDENT_DIVERSITY] == 0.0 )
00588 X2Div = 1.0;
00589 else
00590 X2Div = player_school.sub_score[S_STUDENT_DIVERSITY][HISTORY_MONTH_COUNT-1]
00591 / player_school.sub_score_start[S_STUDENT_DIVERSITY];
00592
00593
00594
00595
00599
00600 if( info.prerun_year || department_array.initial_admission_denied_count[MAX_TEACHING_METHOD] == 0 )
00601 X3Div = 1.0;
00602 else
00603 X3Div = (double)(department_array.admission_denied_count_history[MAX_TEACHING_METHOD][HISTORY_TRIMESTER_COUNT-3]
00604 + department_array.admission_denied_count_history[MAX_TEACHING_METHOD][HISTORY_TRIMESTER_COUNT-2]
00605 + department_array.admission_denied_count_history[MAX_TEACHING_METHOD][HISTORY_TRIMESTER_COUNT-1] )
00606 / department_array.initial_admission_denied_count[MAX_TEACHING_METHOD];
00607
00608
00609
00610 if( info.prerun_year || department_array.initial_size_deviation[MAX_TEACHING_METHOD] == 0 )
00611 X4Div = 1.0;
00612 else
00613 X4Div = (double)department_array.size_deviation[MAX_TEACHING_METHOD]
00614 / department_array.initial_size_deviation[MAX_TEACHING_METHOD];
00615
00616 SPIt = initial_performance_appropriation
00617 *STDiv
00618 *math.safe_pow(X1Div,0.1)
00619 *math.safe_pow(X2Div,0.3)
00620 *math.safe_pow(X3Div,0.2)
00621 *math.safe_pow(X4Div,0.1);
00622
00623 finance.performance_appropriation[1] = SPIt;
00624
00625
00626
00627
00628 int result = player_school.think_protagonist_event(
00629 player_school.sub_score[S_EDUCATIONAL_QUALITY][HISTORY_MONTH_COUNT-1],
00630 player_school.sub_score[S_EDUCATIONAL_QUALITY][HISTORY_MONTH_COUNT-1-12],
00631 player_school.sub_score_start[S_EDUCATIONAL_QUALITY],
00632 player_school.get_protagonist_info(5),
00633 -1, 1 );
00634
00635 switch ( result ) {
00636 case 1: SEQt = 0.05*STt; break;
00637 case 2: SEQt = 0.02*STt; break;
00638 case 3: SEQt = -0.02*STt; break;
00639 case 4:
00640 case 7: SEQt = -0.05*STt; break;
00641 default: SEQt = 0;
00642 }
00643
00644 finance.education_quality_appropriation[1] = SEQt;
00645
00646
00647
00648 SBt = 0.5*STt;
00649
00650 finance.base_appropriation[1] = SBt;
00651
00652
00653 STAt = SBt + SEt + SPIt + SEQt;
00654
00655 finance.total_appropriation[1] = STAt;
00656
00657
00658 projected_revenue_array[AC_STATE_APPROPRIATION].this_year.total = STAt;
00659 budget_revenue_array[AC_STATE_APPROPRIATION].total = STAt;
00660
00661
00662
00663
00664
00665 double SFRt=0;
00666
00667 int rc1, rc2;
00668
00669
00670 rc1 = player_school.think_protagonist_event(
00671 math.safe_divide((float)athletics_office.football_graph[THIS_YEAR], float(athletics_office.football_graph[THIS_YEAR] + athletics_office.football_graph[HISTORY_YEAR_COUNT+THIS_YEAR]) * 100.0f),
00672 math.safe_divide((float)athletics_office.football_graph[THIS_YEAR-1], float(athletics_office.football_graph[THIS_YEAR-1] + athletics_office.football_graph[HISTORY_YEAR_COUNT+THIS_YEAR-1]) * 100.0f),
00673 math.safe_divide((float)athletics_office.initial_football_graph[0], float(athletics_office.initial_football_graph[0] + athletics_office.initial_football_graph[1]) * 100.0f),
00674 player_school.get_protagonist_info(29), -1,1 );
00675
00676 rc2 = player_school.think_protagonist_event(
00677 math.safe_divide((float)athletics_office.basketball_graph[THIS_YEAR], float(athletics_office.basketball_graph[THIS_YEAR] + athletics_office.basketball_graph[HISTORY_YEAR_COUNT+THIS_YEAR]) * 100.0f),
00678 math.safe_divide((float)athletics_office.basketball_graph[THIS_YEAR-1], float(athletics_office.basketball_graph[THIS_YEAR-1] + athletics_office.basketball_graph[HISTORY_YEAR_COUNT+THIS_YEAR-1]) * 100.0f),
00679 math.safe_divide((float)athletics_office.initial_basketball_graph[0], float(athletics_office.initial_basketball_graph[0] + athletics_office.initial_basketball_graph[1]) * 100.0f),
00680 player_school.get_protagonist_info(30), -1,1 );
00681
00682 if (( rc1 == 1) && (rc2 == 1)) {
00683 SFRt = 0.03;
00684 }
00685 else
00686 if ((rc1 == 1) || (rc2 == 1))
00687 SFRt = 0.01;
00688
00689
00690 rc1 = player_school.think_protagonist_event( player_school.sub_score[S_PRESTIGE][HISTORY_MONTH_COUNT-1],
00691 player_school.sub_score[S_PRESTIGE][HISTORY_MONTH_COUNT-13],
00692 player_school.sub_score_start[S_PRESTIGE],
00693 player_school.get_protagonist_info(4), -1,1 );
00694
00695 if ( rc1 == 1 )
00696 SFRt += 0.04;
00697
00698
00699 finance.this_year.asset_array[AC_CAPITAL_RESERVE] *= (1+SFRt);
00700
00701 finance.facility_reserve_appropriation[1] = SFRt;
00702
00703
00704
00705
00706
00707 rc1 = player_school.think_protagonist_event( finance.tuition_increase_history[THIS_YEAR],
00708 finance.tuition_increase_history[THIS_YEAR-1],
00709 finance.initial_tuition_increase,
00710 player_school.get_protagonist_info(27), -1,1 );
00711
00712
00713 float P;
00714 switch (rc1) {
00715 case 4:
00716 case 7: P=0.65;break;
00717 case 3: P=0.4;break;
00718 default: P=0.2;
00719 }
00720
00721 float randomNo = math.get_random_float();
00722
00723
00724 if ( randomNo <= P ) {
00725
00726 float max;
00727 switch (rc1) {
00728 case 4: max = math.get_random_snd((float)2.0,0.2); break;
00729 case 3: max = math.get_random_snd((float)1.5,0.3); break;
00730 default: max = math.get_random_snd((float)2.0,0.4); break;
00731 }
00732
00733
00734 finance.revenue_policy_array[0].upper_bound = max;
00735 }
00736 }
00737
00738
00739
00740 #endif
00741
00742
00743
00744 static void screen_intro() {
00745
00746
00747
00748 user_interface.bg_img(1, &vga_back);
00749
00750 String str;
00751
00752 str = "End of the Academic/Fiscal Year ";
00753 #if(GAME_VERSION>=200)
00754 str += m.format( info.financial_year(), 4);
00755 #else
00756 str += m.format( info.game_year-1, 4);
00757 str += "-";
00758 str += m.format( info.game_year, 4);
00759 #endif
00760
00761 font_charts.center_put(ZOOM_X1, ZOOM_Y1, ZOOM_X2, ZOOM_Y2-50, str );
00762
00763 font_charts.center_put(ZOOM_X1, ZOOM_Y2-50, ZOOM_X2, ZOOM_Y2,
00764 "Click to Continue..." );
00765
00766 vga.blt_buf(ZOOM_X1, ZOOM_Y1, ZOOM_X2, ZOOM_Y2, 1);
00767 sys.blt_virtual_buf();
00768 }
00769
00770
00771
00772
00773
00774 static void screen_opt_intro() {
00775
00776
00777 user_interface.bg_img(1, &vga_back);
00778
00779 String str;
00780
00781 str = "Resource Allocation for the Fiscal Year ";
00782 #if(GAME_VERSION>=200)
00783 str += m.format( info.financial_year()+1, 4);
00784 #else
00785 str += m.format( info.game_year-1, 4);
00786 str += "-";
00787 str += m.format( info.game_year, 4);
00788 #endif
00789
00790 font_charts.center_put(ZOOM_X1, ZOOM_Y1, ZOOM_X2, ZOOM_Y2-50, str );
00791
00792 font_charts.center_put(ZOOM_X1, ZOOM_Y2-50, ZOOM_X2, ZOOM_Y2,
00793 "Click to Begin Resource Allocation..." );
00794
00795 vga.blt_buf(ZOOM_X1, ZOOM_Y1, ZOOM_X2, ZOOM_Y2, 1);
00796 sys.blt_virtual_buf();
00797 }
00798
00799
00800
00801
00802
00803 static void screen_last_year_finance(int reportOrder, int reportType, int reportYear, char* reportTitle, int refreshFlag) {
00804 int saveReportType = finance.report_type;
00805 int saveReportYear = finance.report_year;
00806
00807 finance.report_type = reportType;
00808 finance.report_year = reportYear;
00809
00810
00811 finance.disp_report_main(refreshFlag, 0, reportTitle);
00812
00813
00814
00815 if( refreshFlag == INFO_REPAINT ) {
00816 int x;
00817
00818 if( reportOrder==1 ) {
00819 x = ( VGA_WIDTH - BUTTON_NEXT_WIDTH ) / 2;
00820
00821 button_back.reset();
00822
00823 button_next.paint_text( x, BUTTON_Y1,
00824 x+BUTTON_NEXT_WIDTH, BUTTON_Y2, "Next" );
00825 }
00826 else {
00827 x = ( VGA_WIDTH - (BUTTON_BACK_WIDTH + BUTTON_DISTANCE + BUTTON_NEXT_WIDTH) ) / 2;
00828
00829 button_back.paint_text( x, BUTTON_Y1,
00830 x+BUTTON_BACK_WIDTH, BUTTON_Y2, "Back" );
00831
00832 x += BUTTON_BACK_WIDTH + BUTTON_DISTANCE;
00833
00834 button_next.paint_text( x, BUTTON_Y1,
00835 x+BUTTON_NEXT_WIDTH, BUTTON_Y2, "Next" );
00836 }
00837 }
00838
00839 finance.report_type = saveReportType;
00840 finance.report_year = saveReportYear;
00841 }
00842
00843
00844
00845
00846
00847 static void screen_last_year_finance_detect(int reportType, int reportYear) {
00848 int saveReportType = finance.report_type;
00849 int saveReportYear = finance.report_year;
00850
00851 finance.report_type = reportType;
00852 finance.report_year = reportYear;
00853
00854 finance.report_detect(0);
00855
00856
00857
00858 if( button_back.detect() )
00859 report_screen_id--;
00860
00861 if( button_next.detect() )
00862 report_screen_id++;
00863
00864
00865
00866 finance.report_type = saveReportType;
00867 finance.report_year = saveReportYear;
00868 }
00869
00870