00001
00002
00003
00004
00005 #include <OSYS.H>
00006
00007 #include <OINFO.H>
00008 #include <ODEPT.H>
00009 #include <OPSCHOOL.H>
00010 #include <OTASK.H>
00011 #include <ODATE.H>
00012 #include <OSTR.H>
00013 #include <OCHANCE.H>
00014
00015
00016
00017 typedef bool (Task::*TaskFP)();
00018
00019
00020
00023 struct TaskInfo {
00024 TaskFP is_completed_func;
00025 TaskFP is_expired_func;
00026 };
00027
00028
00029
00030 static String str;
00031
00032 static TaskInfo task_info_array[TASK_COUNT] = {
00033 { Task::is_completed_rise_performance, Task::is_expired }, {
00034
00035 Task::is_completed_rise_educational_quality, Task::is_expired
00036 },
00037 { Task::is_completed_rise_student_morale, Task::is_expired },
00038 { Task::is_completed_rise_department_morale, Task::is_expired },
00039 { Task::is_completed_rise_faculty_research_Per, Task::is_expired },
00040 { Task::is_completed_rise_faculty_diversity_index, Task::is_expired },
00041 { Task::is_completed_rise_use_of_IT, Task::is_expired },
00042 { Task::is_completed_rise_staff_morale, Task::is_expired },
00043
00044 };
00045
00046
00047 void TaskArray::next_day() {
00048
00049
00050
00051
00052 Task* taskPtr;
00053
00054
00055 if ( info.game_day != 1) {
00056 return;
00057 }
00058
00059
00060
00061 for( int i=size() ; i>0 ; i-- ) {
00062 taskPtr = operator[](i);
00063
00064
00065 if ( taskPtr->task_msg_subtype == TASK_COMPLETED )
00066 continue;
00067
00068 if ( (taskPtr->*(task_info_array[taskPtr->id-1].is_completed_func))() == true ) {
00069
00070 news_array.new_task(taskPtr, TASK_COMPLETED);
00071
00072
00073 taskPtr->set_completed();
00074 }
00075
00076 else if ( (taskPtr->*(task_info_array[taskPtr->id-1].is_expired_func))() == true ) {
00077 news_array.new_task(taskPtr, TASK_EXPIRED);
00078
00079
00080
00081 News* newsPtr = news_array[news_array.size()];
00082 chance_event.news_str=newsPtr->msg();
00083 chance_event.news_news_str=chance_event.news_str;
00084
00085 strncpy(chance_event.news_date_str, info.date_str_julian(newsPtr->news_date), 55 );
00086 chance_event.news_date_str[55-1] = '\0';
00087
00088 chance_event.date_str=info.date_str_julian(newsPtr->news_date, INFO_DATE_DEFAULT|INFO_DATE_SHORT_MONTH|INFO_DATE_NO_DAY);
00089
00090 remove(i);
00091 }
00092
00093 sys.yield();
00094 }
00095 }
00096
00097
00098
00099
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129 if ( info.game_year > short_para6
00130 || info.game_year == short_para6 && info.game_month >= short_para5 ) {
00131
00132 sys.set_news_pop_up();
00133
00134
00135
00136 long endDay = date.julian(info.game_year, info.game_month, info.game_day);
00137
00138 strncpy(chance_event.news_date_str, info.date_str_julian(endDay), 55 );
00139 chance_event.news_date_str[55-1] = '\0';
00140
00141 chance_event.date_str=info.date_str_julian(endDay, INFO_DATE_DEFAULT|INFO_DATE_SHORT_MONTH|INFO_DATE_NO_DAY);
00142
00143 return true;
00144 }
00145 else
00146 return false;
00147 }
00148
00149
00150
00151
00157
00158 task_msg_subtype = TASK_COMPLETED;
00159 news_date = info.game_date;
00160
00161 task_array.total_bonus_pt += short_para7;
00162 }
00163
00164
00165
00166
00176
00177
00178
00179 float curRating = department_array[short_para1]->p_academic_standing;
00180
00181 return curRating >= short_para3;
00182 }
00183
00184
00185
00186
00196
00197 float curRating = department_array[short_para1]->p_educational_quality;
00198
00199 return curRating >= short_para3;
00200 }
00201
00202
00203
00204
00205 bool Task::is_completed_rise_student_morale() {
00206 float curRating = player_school.sub_score[S_STUDENT_MORALE][HISTORY_MONTH_COUNT-1];
00207
00208 return curRating >= short_para3;
00209 }
00210
00211
00212
00213
00215
00216 float curRating = department_array.p_faculty_morale_history[47];
00217
00218 return curRating >= short_para3;
00219 }
00220
00221
00222
00223
00224 bool Task::is_completed_rise_faculty_research_Per() {
00225 float curRating = department_array.p_faculty_research_history[47];
00226
00227 return curRating >= short_para3;
00228 }
00229
00230
00231
00232
00242
00243
00244 float curRating = department_array[short_para1]->p_faculty_diversity_history[7];
00245
00246 return curRating >= short_para3;
00247 }
00248
00249
00250
00251
00261
00262
00263 Department* cur_dept_ptr = department_array[short_para1];
00264 float curRating = cur_dept_ptr->var_educational_quality_history[4][23];
00265
00266 return curRating >= short_para3;
00267 }
00268
00269
00270
00271
00281
00282 float curRating = player_school.sub_score[S_STAFF_MORALE][THIS_MONTH];
00283
00284 return curRating >= short_para3;
00285 }
00286
00287