Definition at line 29 of file b1-scout-person.hpp.
Public Member Functions | |
b1ScoutPerson () | |
void | enlist () |
void | skillTables (int n) |
b1ScoutPerson::b1ScoutPerson | ( | ) |
Generic constructor
Definition at line 29 of file b1-scout-person.cpp.
References enlist(), and personObj::setService().
00029 : book1Person() { 00030 this->setService("Scout"); 00031 this->enlist(); 00032 00033 }
Here is the call graph for this function:
void b1ScoutPerson::enlist | ( | ) |
Enlist this character, and run them through the paces.
Definition at line 35 of file b1-scout-person.cpp.
References personObj::setAccepted(), personObj::setAge(), personObj::setAlive(), personObj::setTerms(), and skillTables().
Referenced by b1ScoutPerson().
00035 { 00036 int dm=0; 00037 int skill_rolls=0; 00038 00039 if ( this->getIntelligence() > 5 ) 00040 dm = 1; 00041 if ( this->getStrength() > 7 ) 00042 dm = dm + 2; 00043 if ( (d2d6()+dm) > 6 ) { 00044 this->setAccepted(1); 00045 } else { 00046 this->setAccepted(0); 00047 return ; 00048 } 00049 this->setTerms(1); 00050 while(1){ // while 00051 if ( this->getTerms() == 1 ) { // if 00052 skill_rolls=2; 00053 } else { 00054 skill_rolls=1; 00055 } //end-if 00056 00057 // Determine Survival 00058 // 00059 dm=0; 00060 if ( this->getEndurance() > 8) 00061 dm = 2; 00062 if ( (d2d6()+dm) > 6 ) { 00063 // this->setTerms(this->getTerms()+1); 00064 this->setAge( this->getAge()+4); 00065 } else { 00066 this->setAlive(0); 00067 return; 00068 } 00069 00070 00071 00072 this->skillTables(skill_rolls); 00073 00074 // I've imposed my own DMS for sanity sake since I don't want people 00075 // managing to be in for 60 terms like some trial runs had. 00076 dm=0; 00077 if ( this->getTerms() > 5 ) { 00078 dm = this->getTerms() - 5; 00079 } 00080 if ( this->getAge() > 50 ) { 00081 dm = dm + (this->getAge()/10); 00082 } 00083 int re_enlisted=0; 00084 00085 if ( (d2d6() - dm) > 3 ) { 00086 this->setTerms(this->getTerms()+1); 00087 re_enlisted=1; 00088 } 00089 00090 // A couple of sanity checks: 00091 if ( this->getRank() > 5) this->setRank(5); 00092 if ( re_enlisted != 1 ) { 00093 this->musterOut(); 00094 return; 00095 } 00096 00097 00098 } 00099 00100 }
Here is the call graph for this function:
Here is the caller graph for this function:
void b1ScoutPerson::skillTables | ( | int | n | ) |
Invoke one several skill tables.
n | number of rolls to run against the skill tables for a given term. |
Definition at line 103 of file b1-scout-person.cpp.
Referenced by enlist().
00103 { 00104 // There are 4 different skill tables to deal with here... 00105 // 3 of which are in play when education < 8 and all 4 are 00106 // in play for education >= 8 00107 00108 00109 int roll; 00110 for(roll=1;roll<=nrolls;roll++){ 00111 if ( this->getEducation() < 8 ) { 00112 switch(d1d6()){ 00113 case 1: 00114 case 2: 00115 this->skillTable1(); 00116 break; 00117 case 3: 00118 case 4: 00119 this->skillTable2(); 00120 break; 00121 case 5: 00122 case 6: 00123 this->skillTable3(); 00124 break; 00125 }; 00126 } else { 00127 switch(d2d6()){ 00128 case 1: 00129 this->skillTable1(); 00130 break; 00131 case 2: 00132 case 3: 00133 this->skillTable2(); 00134 break; 00135 case 4: 00136 case 5: 00137 this->skillTable3(); 00138 break; 00139 case 6: 00140 this->skillTable4(); 00141 break; 00142 }; 00143 00144 } 00145 00146 } 00147 00148 00149 }
Here is the caller graph for this function: