00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "b1-other-person.hpp"
00026 #include "dice.hpp"
00027 #include "skill-obj.hpp"
00028
00029 b1OtherPerson::b1OtherPerson() : book1Person() {
00030 this->setService("Other");
00031 this->enlist();
00032
00033 }
00034
00035 void b1OtherPerson::enlist(){
00036 int dm=0;
00037 int skill_rolls=0;
00038
00039
00040 if ( (d2d6()) > 2 ) {
00041 this->setAccepted(1);
00042 } else {
00043 this->setAccepted(0);
00044 return ;
00045 }
00046 this->setTerms(1);
00047 while(1){
00048 if ( this->getTerms() == 1 ) {
00049 skill_rolls=2;
00050 } else {
00051 skill_rolls=1;
00052 }
00053
00054
00055
00056 dm=0;
00057 if ( this->getIntelligence() > 8)
00058 dm = 2;
00059 if ( (d2d6()+dm) > 4 ) {
00060
00061 this->setAge( this->getAge()+4);
00062 } else {
00063 this->setAlive(0);
00064 return;
00065 }
00066
00067
00068
00069 this->skillTables(skill_rolls);
00070
00071
00072
00073 dm=0;
00074 if ( this->getTerms() > 5 ) {
00075 dm = this->getTerms() - 5;
00076 }
00077 if ( this->getAge() > 50 ) {
00078 dm = dm + (this->getAge()/10);
00079 }
00080 int re_enlisted=0;
00081
00082 if ( (d2d6() - dm) > 4 ) {
00083 this->setTerms(this->getTerms()+1);
00084 re_enlisted=1;
00085 }
00086
00087
00088 if ( this->getRank() > 5) this->setRank(5);
00089 if ( re_enlisted != 1 ) return;
00090
00091 }
00092
00093 }
00094
00095
00096 void b1OtherPerson::skillTables(int nrolls){
00097
00098
00099
00100
00101
00102 int roll;
00103 for(roll=1;roll<=nrolls;roll++){
00104 if ( this->getEducation() < 8 ) {
00105 switch(d1d6()){
00106 case 1:
00107 case 2:
00108 this->skillTable1();
00109 break;
00110 case 3:
00111 case 4:
00112 this->skillTable2();
00113 break;
00114 case 5:
00115 case 6:
00116 this->skillTable3();
00117 break;
00118 };
00119 } else {
00120 switch(d2d6()){
00121 case 1:
00122 this->skillTable1();
00123 break;
00124 case 2:
00125 case 3:
00126 this->skillTable2();
00127 break;
00128 case 4:
00129 case 5:
00130 this->skillTable3();
00131 break;
00132 case 6:
00133 this->skillTable4();
00134 break;
00135 };
00136
00137 }
00138
00139 }
00140
00141
00142 }
00143
00144 void b1OtherPerson::skillTable1(){
00145 switch(d1d6()){
00146 case 1:
00147 this->incrementStrength(1);
00148 break;
00149 case 2:
00150 this->incrementDexterity(1);
00151 break;
00152 case 3:
00153 this->incrementEndurance(1);
00154 break;
00155 case 4:
00156 this->addSkill(BLADE_COMBAT,1);
00157 break;
00158 case 5:
00159 this->addSkill(BRAWLING,1);
00160 break;
00161 case 6:
00162 this->incrementSocialStanding(-1);
00163 break;
00164 }
00165
00166 }
00167
00168 void b1OtherPerson::skillTable2(){
00169 switch(d1d6()){
00170 case 1:
00171 this->addSkill(VEHICLE,1);
00172 break;
00173 case 2:
00174 this->addSkill(GAMBLING,1);
00175 break;
00176 case 3:
00177 this->addSkill(BRAWLING,1);
00178 break;
00179 case 4:
00180 this->addSkill(BRIBERY,1);
00181 break;
00182 case 5:
00183 this->addSkill(BLADE_COMBAT,1);
00184 break;
00185 case 6:
00186 this->addSkill(GUN_COMBAT,1);
00187 break;
00188 };
00189
00190 }
00191
00192 void b1OtherPerson::skillTable3(){
00193 switch(d1d6()){
00194 case 1:
00195 this->addSkill(STREETWISE,1);
00196 break;
00197 case 2:
00198 this->addSkill(MECHANICAL,1);
00199 break;
00200 case 3:
00201 this->addSkill(ELECTRONICS,1);
00202 break;
00203 case 4:
00204 this->addSkill(GAMBLING,1);
00205 break;
00206 case 5:
00207 this->addSkill(BRAWLING,1);
00208 break;
00209 case 6:
00210 this->addSkill(FORGERY,1);
00211 break;
00212 };
00213
00214 }
00215
00216 void b1OtherPerson::skillTable4(){
00217 switch(d1d6()){
00218 case 1:
00219 this->addSkill(MEDICAL,1);
00220 break;
00221 case 2:
00222 this->addSkill(FORGERY,1);
00223 break;
00224 case 3:
00225 this->addSkill(ELECTRONICS,1);
00226 break;
00227 case 4:
00228 this->addSkill(COMPUTER,1);
00229 break;
00230 case 5:
00231 this->addSkill(STREETWISE,1);
00232 break;
00233 case 6:
00234 this->addSkill(JACK_OF_ALL_TRADES,1);
00235 break;
00236 }
00237 }