b1OtherPerson Class Reference

Inheritance diagram for b1OtherPerson:

Inheritance graph
[legend]
Collaboration diagram for b1OtherPerson:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 29 of file b1-other-person.hpp.

Public Member Functions

 b1OtherPerson ()
void enlist ()
void skillTables (int n)


Constructor & Destructor Documentation

b1OtherPerson::b1OtherPerson (  ) 

Generic constructor

Definition at line 29 of file b1-other-person.cpp.

References enlist(), and personObj::setService().

00029                              : book1Person() {
00030         this->setService("Other");
00031         this->enlist();
00032         
00033 }

Here is the call graph for this function:


Member Function Documentation

void b1OtherPerson::enlist (  ) 

Enlist this character, and run them through the paces.

Definition at line 35 of file b1-other-person.cpp.

References personObj::setAccepted(), personObj::setAge(), personObj::setAlive(), personObj::setTerms(), and skillTables().

Referenced by b1OtherPerson().

00035                           {
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){ // while 
00048                 if ( this->getTerms() == 1 ) { // if
00049                         skill_rolls=2;
00050                 } else {
00051                         skill_rolls=1;
00052                 } //end-if
00053                 
00054                 // Determine Survival
00055                 //
00056                 dm=0;
00057                 if ( this->getIntelligence() > 8) 
00058                         dm = 2;
00059                 if ( (d2d6()+dm) > 4 ) {
00060                         // this->setTerms(this->getTerms()+1);
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                 // I've imposed my own DMS for sanity sake since I don't want people
00072                 // managing to be in for 60 terms like some trial runs had. 
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                 // A couple of sanity checks:
00088                 if ( this->getRank() > 5) this->setRank(5);
00089                 if ( re_enlisted != 1 ) return;
00090                         
00091         }
00092         
00093 }

Here is the call graph for this function:

Here is the caller graph for this function:

void b1OtherPerson::skillTables ( int  n  ) 

Invoke one several skill tables.

Parameters:
n number of rolls to run against the skill tables for a given term.

Definition at line 96 of file b1-other-person.cpp.

Referenced by enlist().

00096                                          {
00097         // There are 4 different skill tables to deal with here...
00098         // 3 of which are in play when education < 8 and all 4 are 
00099         // in play for education >= 8 
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 }

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Fri Mar 7 16:41:09 2008 for frpuniverse by  doxygen 1.4.7