A collection of applications and libraries written in Java and C++ to create Science Fiction FRP Universes.
Be the first to post a text review of FRP Universe Builder. Rate and review a project by clicking thumbs up or thumbs down in the right column.
Fri Feb 15 23:19:16 EST 2008 Index: dev-utils/genSkillListDefs.pl =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/dev-utils/genSkillListDefs.pl,v retrieving revision 1.2 diff -u -r1.2 genSkillListDefs.pl --- dev-utils/genSkillListDefs.pl14 Feb 2008 21:37:24 -00001.2 +++ dev-utils/genSkillListDefs.pl16 Feb 2008 04:18:07 -0000 @@ -229,3 +229,6 @@ Vice Zero G Environ Blade Combat +Sword +Rifleman +Handgun Index: docs/man-pages/man3/MTBasicPerson.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/MTBasicPerson.3,v retrieving revision 1.1 diff -u -r1.1 MTBasicPerson.3 --- docs/man-pages/man3/MTBasicPerson.314 Feb 2008 21:59:19 -00001.1 +++ docs/man-pages/man3/MTBasicPerson.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "MTBasicPerson" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "MTBasicPerson" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/XMLFileObject.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/XMLFileObject.3,v retrieving revision 1.1 diff -u -r1.1 XMLFileObject.3 --- docs/man-pages/man3/XMLFileObject.314 Feb 2008 21:59:19 -00001.1 +++ docs/man-pages/man3/XMLFileObject.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "XMLFileObject" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "XMLFileObject" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/b1ArmyPerson.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/b1ArmyPerson.3,v retrieving revision 1.1 diff -u -r1.1 b1ArmyPerson.3 --- docs/man-pages/man3/b1ArmyPerson.314 Feb 2008 21:59:20 -00001.1 +++ docs/man-pages/man3/b1ArmyPerson.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "b1ArmyPerson" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "b1ArmyPerson" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/b1MarinePerson.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/b1MarinePerson.3,v retrieving revision 1.1 diff -u -r1.1 b1MarinePerson.3 --- docs/man-pages/man3/b1MarinePerson.314 Feb 2008 21:59:20 -00001.1 +++ docs/man-pages/man3/b1MarinePerson.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "b1MarinePerson" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "b1MarinePerson" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/b1MerchantPerson.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/b1MerchantPerson.3,v retrieving revision 1.1 diff -u -r1.1 b1MerchantPerson.3 --- docs/man-pages/man3/b1MerchantPerson.314 Feb 2008 21:59:21 -00001.1 +++ docs/man-pages/man3/b1MerchantPerson.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "b1MerchantPerson" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "b1MerchantPerson" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/b1NavyPerson.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/b1NavyPerson.3,v retrieving revision 1.1 diff -u -r1.1 b1NavyPerson.3 --- docs/man-pages/man3/b1NavyPerson.314 Feb 2008 21:59:21 -00001.1 +++ docs/man-pages/man3/b1NavyPerson.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "b1NavyPerson" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "b1NavyPerson" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/b1OtherPerson.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/b1OtherPerson.3,v retrieving revision 1.1 diff -u -r1.1 b1OtherPerson.3 --- docs/man-pages/man3/b1OtherPerson.314 Feb 2008 21:59:21 -00001.1 +++ docs/man-pages/man3/b1OtherPerson.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "b1OtherPerson" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "b1OtherPerson" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/b1ScoutPerson.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/b1ScoutPerson.3,v retrieving revision 1.1 diff -u -r1.1 b1ScoutPerson.3 --- docs/man-pages/man3/b1ScoutPerson.314 Feb 2008 21:59:21 -00001.1 +++ docs/man-pages/man3/b1ScoutPerson.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "b1ScoutPerson" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "b1ScoutPerson" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/book1Person.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/book1Person.3,v retrieving revision 1.1 diff -u -r1.1 book1Person.3 --- docs/man-pages/man3/book1Person.314 Feb 2008 21:59:21 -00001.1 +++ docs/man-pages/man3/book1Person.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "book1Person" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "book1Person" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME @@ -10,7 +10,7 @@ .PP Inherits \fBpersonObj\fP. .PP -Inherited by \fBb1ArmyPerson\fP, \fBb1MarinePerson\fP, \fBb1MerchantPerson\fP, \fBb1NavyPerson\fP, \fBb1OtherPerson\fP, and \fBb1ScoutPerson\fP. +Inherited by \fBb1ArmyPerson\fP, \fBb1MarinePerson\fP, \fBb1MerchantPerson\fP, \fBb1NavyPerson\fP, \fBb1OtherPerson\fP, \fBb1ScoutPerson\fP, \fBs4BarbarianPerson\fP, \fBs4BelterPerson\fP, \fBs4BureaucratPerson\fP, \fBs4DiplomatPerson\fP, \fBs4DoctorPerson\fP, \fBs4FlyerPerson\fP, \fBs4HunterPerson\fP, \fBs4NoblePerson\fP, \fBs4PiratePerson\fP, \fBs4RoguePerson\fP, \fBs4SailorPerson\fP, and \fBs4ScientistPerson\fP. .PP .SH "Detailed Description" .PP Index: docs/man-pages/man3/book4ArmyPerson.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/book4ArmyPerson.3,v retrieving revision 1.1 diff -u -r1.1 book4ArmyPerson.3 --- docs/man-pages/man3/book4ArmyPerson.314 Feb 2008 21:59:22 -00001.1 +++ docs/man-pages/man3/book4ArmyPerson.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "book4ArmyPerson" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "book4ArmyPerson" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/book4Marine.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/book4Marine.3,v retrieving revision 1.1 diff -u -r1.1 book4Marine.3 --- docs/man-pages/man3/book4Marine.314 Feb 2008 21:59:22 -00001.1 +++ docs/man-pages/man3/book4Marine.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "book4Marine" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "book4Marine" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/book5NavyPerson.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/book5NavyPerson.3,v retrieving revision 1.1 diff -u -r1.1 book5NavyPerson.3 --- docs/man-pages/man3/book5NavyPerson.314 Feb 2008 21:59:22 -00001.1 +++ docs/man-pages/man3/book5NavyPerson.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "book5NavyPerson" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "book5NavyPerson" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/book6ScoutPerson.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/book6ScoutPerson.3,v retrieving revision 1.1 diff -u -r1.1 book6ScoutPerson.3 --- docs/man-pages/man3/book6ScoutPerson.314 Feb 2008 21:59:22 -00001.1 +++ docs/man-pages/man3/book6ScoutPerson.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "book6ScoutPerson" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "book6ScoutPerson" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/book7MerchantPerson.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/book7MerchantPerson.3,v retrieving revision 1.1 diff -u -r1.1 book7MerchantPerson.3 --- docs/man-pages/man3/book7MerchantPerson.314 Feb 2008 21:59:22 -00001.1 +++ docs/man-pages/man3/book7MerchantPerson.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "book7MerchantPerson" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "book7MerchantPerson" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/gasGiant.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/gasGiant.3,v retrieving revision 1.1 diff -u -r1.1 gasGiant.3 --- docs/man-pages/man3/gasGiant.314 Feb 2008 21:59:22 -00001.1 +++ docs/man-pages/man3/gasGiant.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "gasGiant" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "gasGiant" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/mainPlanet.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/mainPlanet.3,v retrieving revision 1.1 diff -u -r1.1 mainPlanet.3 --- docs/man-pages/man3/mainPlanet.314 Feb 2008 21:59:29 -00001.1 +++ docs/man-pages/man3/mainPlanet.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "mainPlanet" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "mainPlanet" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/mercStylePerson.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/mercStylePerson.3,v retrieving revision 1.1 diff -u -r1.1 mercStylePerson.3 --- docs/man-pages/man3/mercStylePerson.314 Feb 2008 21:59:29 -00001.1 +++ docs/man-pages/man3/mercStylePerson.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "mercStylePerson" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "mercStylePerson" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/moon.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/moon.3,v retrieving revision 1.1 diff -u -r1.1 moon.3 --- docs/man-pages/man3/moon.314 Feb 2008 21:59:29 -00001.1 +++ docs/man-pages/man3/moon.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "moon" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "moon" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/orbitPlace.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/orbitPlace.3,v retrieving revision 1.1 diff -u -r1.1 orbitPlace.3 --- docs/man-pages/man3/orbitPlace.314 Feb 2008 21:59:29 -00001.1 +++ docs/man-pages/man3/orbitPlace.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "orbitPlace" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "orbitPlace" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/orbitPlane.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/orbitPlane.3,v retrieving revision 1.1 diff -u -r1.1 orbitPlane.3 --- docs/man-pages/man3/orbitPlane.314 Feb 2008 21:59:29 -00001.1 +++ docs/man-pages/man3/orbitPlane.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "orbitPlane" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "orbitPlane" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/parsec.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/parsec.3,v retrieving revision 1.1 diff -u -r1.1 parsec.3 --- docs/man-pages/man3/parsec.314 Feb 2008 21:59:29 -00001.1 +++ docs/man-pages/man3/parsec.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "parsec" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "parsec" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/personObj.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/personObj.3,v retrieving revision 1.1 diff -u -r1.1 personObj.3 --- docs/man-pages/man3/personObj.314 Feb 2008 21:59:30 -00001.1 +++ docs/man-pages/man3/personObj.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "personObj" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "personObj" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME @@ -12,16 +12,9 @@ .PP .SH "Detailed Description" .PP -Defines a base class from which PC and NPC character classes can be derived. Common to all such are physical characteristics which are set here. +Defines a base class from which PC and NPC character classes can be derived. Common to all such are physical characteristics which are set here. .PP -\fBTodo\fP -.RS 4 -eliminiate all the inlining in this class. -.RE -.PP - -.PP -Definition at line 34 of file person-obj.hpp. +Definition at line 41 of file person-obj.hpp. .SS "Public Member Functions" .in +1c @@ -68,12 +61,33 @@ .RI "int \fBgetAge\fP ()" .br .ti -1c -.RI "int \fBsetAge\fP (int a)" +.RI "void \fBsetAge\fP (int a)" .br .ti -1c .RI "void \fBincrementAttribute\fP (int attr, int incr)" .br .ti -1c +.RI "void \fBincrementStrength\fP (int ix)" +.br +.ti -1c +.RI "void \fBincrementDexterity\fP (int ix)" +.br +.ti -1c +.RI "void \fBincrementConstitution\fP (int ix)" +.br +.ti -1c +.RI "void \fBincrementIntelligence\fP (int ix)" +.br +.ti -1c +.RI "void \fBincrementEducation\fP (int ix)" +.br +.ti -1c +.RI "void \fBincrementSocialStanding\fP (int ix)" +.br +.ti -1c +.RI "void \fBincrementAge\fP (int ix)" +.br +.ti -1c .RI "void \fBsetService\fP (char *s)" .br .ti -1c @@ -106,7 +120,7 @@ .PP .SH "Member Function Documentation" .PP -.SS "int personObj::getAge ()\fC [inline]\fP" +.SS "int personObj::getAge ()" .PP Get the age attribute .PP @@ -117,15 +131,17 @@ .PP .PP -Definition at line 129 of file person-obj.hpp. +Definition at line 151 of file person-obj.cpp. .PP Referenced by book1Person::toStdOut(). .PP .nf -129 { return age;}; +151 { +152 return age; +153 } .fi .PP -.SS "int personObj::getConstitution ()\fC [inline]\fP" +.SS "int personObj::getConstitution ()" .PP get the constitution attribute .PP @@ -136,13 +152,15 @@ .PP .PP -Definition at line 80 of file person-obj.hpp. +Definition at line 123 of file person-obj.cpp. .PP .nf -80 { return physical_stats.a.constitution;}; +123 { +124 return physical_stats.a.constitution; +125 } .fi .PP -.SS "int personObj::getDexterity ()\fC [inline]\fP" +.SS "int personObj::getDexterity ()" .PP get the dexterity attribute .PP @@ -153,13 +171,15 @@ .PP .PP -Definition at line 67 of file person-obj.hpp. +Definition at line 115 of file person-obj.cpp. .PP .nf -67 { return physical_stats.a.dexterity;}; +115 { +116 return physical_stats.a.dexterity; +117 } .fi .PP -.SS "int personObj::getEducation ()\fC [inline]\fP" +.SS "int personObj::getEducation ()" .PP Get the education attribute .PP @@ -170,15 +190,17 @@ .PP .PP -Definition at line 101 of file person-obj.hpp. +Definition at line 135 of file person-obj.cpp. .PP Referenced by b1NavyPerson::enlist(). .PP .nf -101 { return physical_stats.a.education; }; +135 { +136 return physical_stats.a.education; +137 } .fi .PP -.SS "int personObj::getIntelligence ()\fC [inline]\fP" +.SS "int personObj::getIntelligence ()" .PP get the intelligence attribute .PP @@ -189,10 +211,12 @@ .PP .PP -Definition at line 87 of file person-obj.hpp. +Definition at line 127 of file person-obj.cpp. .PP .nf -87 { return physical_stats.a.intelligence; }; +127 { +128 return physical_stats.a.intelligence; +129 } .fi .PP .SS "char * personObj::getService ()" @@ -216,7 +240,7 @@ 73 } .fi .PP -.SS "int personObj::getSocialStanding ()\fC [inline]\fP" +.SS "int personObj::getSocialStanding ()" .PP get the social_standing attribute .PP @@ -227,15 +251,17 @@ .PP .PP -Definition at line 122 of file person-obj.hpp. +Definition at line 147 of file person-obj.cpp. .PP Referenced by b1NavyPerson::enlist(). .PP .nf -122 { return physical_stats.a.social_standing; }; +147 { +148 return physical_stats.a.social_standing; +149 } .fi .PP -.SS "int personObj::getStrength ()\fC [inline]\fP" +.SS "int personObj::getStrength ()" .PP get the strength attribute .PP @@ -246,13 +272,34 @@ .PP .PP -Definition at line 53 of file person-obj.hpp. +Definition at line 103 of file person-obj.cpp. .PP .nf -53 { return physical_stats.a.strength; }; +103 { +104 return physical_stats.a.strength; +105 } .fi .PP -.SS "void personObj::incrementAttribute (int attr, int incr)\fC [inline]\fP" +.SS "void personObj::incrementAge (int ix)" +.PP +Increment Age +.PP +\fBParameters:\fP +.RS 4 +\fIix\fP integer amount to increment by +.RE +.PP + +.PP +Definition at line 75 of file person-obj.cpp. +.PP +.nf +75 { +76 age = age + ix; +77 } +.fi +.PP +.SS "void personObj::incrementAttribute (int attr, int incr)" .PP Increment an attribute .PP @@ -265,15 +312,143 @@ .PP .PP -Definition at line 145 of file person-obj.hpp. +Definition at line 159 of file person-obj.cpp. +.PP +Referenced by incrementConstitution(), incrementDexterity(), incrementEducation(), incrementIntelligence(), incrementSocialStanding(), and incrementStrength(). +.PP +.nf +159 { +160 physical_stats.upp[attr] = physical_stats.upp[attr] + incr; +161 } +.fi +.PP +.SS "void personObj::incrementConstitution (int ix)" +.PP +Increment constitution +.PP +\fBParameters:\fP +.RS 4 +\fIix\fP integer amount to increment by +.RE +.PP + +.PP +Definition at line 87 of file person-obj.cpp. +.PP +References incrementAttribute(). +.PP +.nf +87 { +88 this->incrementAttribute(CONSTITUTION,ix); +89 } +.fi +.PP +.SS "void personObj::incrementDexterity (int ix)" +.PP +Increment Dexterity +.PP +\fBParameters:\fP +.RS 4 +\fIix\fP integer amount to increment by +.RE +.PP + +.PP +Definition at line 83 of file person-obj.cpp. +.PP +References incrementAttribute(). +.PP +.nf +83 { +84 this->incrementAttribute(DEXTERITY,ix); +85 } +.fi +.PP +.SS "void personObj::incrementEducation (int ix)" +.PP +Increment Education +.PP +\fBParameters:\fP +.RS 4 +\fIix\fP integer amount to increment by +.RE +.PP + +.PP +Definition at line 95 of file person-obj.cpp. +.PP +References incrementAttribute(). +.PP +.nf +95 { +96 this->incrementAttribute(EDUCATION,ix); +97 } +.fi +.PP +.SS "void personObj::incrementIntelligence (int ix)" +.PP +Increment Intelligence +.PP +\fBParameters:\fP +.RS 4 +\fIix\fP integer amount to increment by +.RE +.PP + +.PP +Definition at line 91 of file person-obj.cpp. +.PP +References incrementAttribute(). +.PP +.nf +91 { +92 this->incrementAttribute(INTELLIGENCE,ix); +93 } +.fi +.PP +.SS "void personObj::incrementSocialStanding (int ix)" +.PP +Increment Social Standing +.PP +\fBParameters:\fP +.RS 4 +\fIix\fP integer amount to increment by +.RE +.PP + +.PP +Definition at line 99 of file person-obj.cpp. +.PP +References incrementAttribute(). +.PP +.nf +99 { +100 this->incrementAttribute(SOCIALSTANDING,ix); +101 } +.fi +.PP +.SS "void personObj::incrementStrength (int ix)" +.PP +Increment Strength +.PP +\fBParameters:\fP +.RS 4 +\fIix\fP integer amount to increment by +.RE +.PP + +.PP +Definition at line 79 of file person-obj.cpp. +.PP +References incrementAttribute(). .PP .nf -145 { -146 physical_stats.upp[attr] = physical_stats.upp[attr] + incr; -147 } +79 { +80 this->incrementAttribute(STRENGTH,ix); +81 } .fi .PP -.SS "int personObj::setAge (int a)\fC [inline]\fP" +.SS "void personObj::setAge (int a)" .PP Set the age attribute .PP @@ -284,15 +459,17 @@ .PP .PP -Definition at line 136 of file person-obj.hpp. +Definition at line 155 of file person-obj.cpp. .PP Referenced by b1NavyPerson::enlist(). .PP .nf -136 { age=a; }; +155 { +156 age=a; +157 } .fi .PP -.SS "void personObj::setConstitution (int c)\fC [inline]\fP" +.SS "void personObj::setConstitution (int c)" .PP set the constitution attribute .PP @@ -303,13 +480,15 @@ .PP .PP -Definition at line 74 of file person-obj.hpp. +Definition at line 119 of file person-obj.cpp. .PP .nf -74 { physical_stats.a.constitution=c;}; +119 { +120 physical_stats.a.constitution=c; +121 } .fi .PP -.SS "void personObj::setDexterity (int d)\fC [inline]\fP" +.SS "void personObj::setDexterity (int d)" .PP set the dexterity attribute .PP @@ -320,13 +499,15 @@ .PP .PP -Definition at line 60 of file person-obj.hpp. +Definition at line 111 of file person-obj.cpp. .PP .nf -60 { physical_stats.a.dexterity=d;}; +111 { +112 physical_stats.a.dexterity=d; +113 } .fi .PP -.SS "void personObj::setEducation (int e)\fC [inline]\fP" +.SS "void personObj::setEducation (int e)" .PP Set the education attribute .PP @@ -337,13 +518,15 @@ .PP .PP -Definition at line 108 of file person-obj.hpp. +Definition at line 139 of file person-obj.cpp. .PP .nf -108 { physical_stats.a.education=e; }; +139 { +140 physical_stats.a.education=e; +141 } .fi .PP -.SS "void personObj::setIntelligence (int i)\fC [inline]\fP" +.SS "void personObj::setIntelligence (int i)" .PP set the intelligence attribute .PP @@ -354,10 +537,12 @@ .PP .PP -Definition at line 94 of file person-obj.hpp. +Definition at line 131 of file person-obj.cpp. .PP .nf -94 { physical_stats.a.intelligence=i; }; +131 { +132 physical_stats.a.intelligence=i; +133 } .fi .PP .SS "void personObj::setService (char * s)" @@ -373,7 +558,7 @@ .PP Definition at line 68 of file person-obj.cpp. .PP -Referenced by b1ArmyPerson::b1ArmyPerson(), b1MarinePerson::b1MarinePerson(), b1MerchantPerson::b1MerchantPerson(), b1OtherPerson::b1OtherPerson(), b1ScoutPerson::b1ScoutPerson(), book4ArmyPerson::book4ArmyPerson(), book4Marine::book4Marine(), book5NavyPerson::book5NavyPerson(), book6ScoutPerson::book6ScoutPerson(), book7MerchantPerson::book7MerchantPerson(), and b1NavyPerson::enlist(). +Referenced by b1ArmyPerson::b1ArmyPerson(), b1MarinePerson::b1MarinePerson(), b1MerchantPerson::b1MerchantPerson(), b1OtherPerson::b1OtherPerson(), b1ScoutPerson::b1ScoutPerson(), book4ArmyPerson::book4ArmyPerson(), book4Marine::book4Marine(), book5NavyPerson::book5NavyPerson(), book6ScoutPerson::book6ScoutPerson(), book7MerchantPerson::book7MerchantPerson(), b1NavyPerson::enlist(), s4BarbarianPerson::s4BarbarianPerson(), s4BelterPerson::s4BelterPerson(), s4BureaucratPerson::s4BureaucratPerson(), s4DoctorPerson::s4DoctorPerson(), s4FlyerPerson::s4FlyerPerson(), s4HunterPerson::s4HunterPerson(), s4NoblePerson::s4NoblePerson(), s4PiratePerson::s4PiratePerson(), s4RoguePerson::s4RoguePerson(), s4SailorPerson::s4SailorPerson(), and s4ScientistPerson::s4ScientistPerson(). .PP .nf 68 { @@ -381,7 +566,7 @@ 70 } .fi .PP -.SS "void personObj::setSocialStanding (int s)\fC [inline]\fP" +.SS "void personObj::setSocialStanding (int s)" .PP set the social_standing attribute .PP @@ -392,13 +577,15 @@ .PP .PP -Definition at line 115 of file person-obj.hpp. +Definition at line 143 of file person-obj.cpp. .PP .nf -115 { physical_stats.a.social_standing=s;}; +143 { +144 physical_stats.a.social_standing=s; +145 } .fi .PP -.SS "void personObj::setStrength (int s)\fC [inline]\fP" +.SS "void personObj::setStrength (int s)" .PP Set the strength attribute .PP @@ -409,10 +596,12 @@ .PP .PP -Definition at line 48 of file person-obj.hpp. +Definition at line 107 of file person-obj.cpp. .PP .nf -48 { physical_stats.a.strength=s; }; +107 { +108 physical_stats.a.strength=s; +109 } .fi .PP .SS "char * personObj::toString ()" Index: docs/man-pages/man3/planet.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/planet.3,v retrieving revision 1.1 diff -u -r1.1 planet.3 --- docs/man-pages/man3/planet.314 Feb 2008 21:59:30 -00001.1 +++ docs/man-pages/man3/planet.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "planet" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "planet" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/planetoidBelt.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/planetoidBelt.3,v retrieving revision 1.1 diff -u -r1.1 planetoidBelt.3 --- docs/man-pages/man3/planetoidBelt.314 Feb 2008 21:59:30 -00001.1 +++ docs/man-pages/man3/planetoidBelt.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "planetoidBelt" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "planetoidBelt" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/primaryStar.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/primaryStar.3,v retrieving revision 1.1 diff -u -r1.1 primaryStar.3 --- docs/man-pages/man3/primaryStar.314 Feb 2008 21:59:30 -00001.1 +++ docs/man-pages/man3/primaryStar.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "primaryStar" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "primaryStar" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/ring.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/ring.3,v retrieving revision 1.1 diff -u -r1.1 ring.3 --- docs/man-pages/man3/ring.314 Feb 2008 21:59:30 -00001.1 +++ docs/man-pages/man3/ring.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "ring" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "ring" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/satellite.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/satellite.3,v retrieving revision 1.1 diff -u -r1.1 satellite.3 --- docs/man-pages/man3/satellite.314 Feb 2008 21:59:30 -00001.1 +++ docs/man-pages/man3/satellite.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "satellite" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "satellite" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/skillEntry.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/skillEntry.3,v retrieving revision 1.1 diff -u -r1.1 skillEntry.3 --- docs/man-pages/man3/skillEntry.314 Feb 2008 21:59:34 -00001.1 +++ docs/man-pages/man3/skillEntry.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "skillEntry" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "skillEntry" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/skillList.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/skillList.3,v retrieving revision 1.1 diff -u -r1.1 skillList.3 --- docs/man-pages/man3/skillList.314 Feb 2008 21:59:34 -00001.1 +++ docs/man-pages/man3/skillList.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "skillList" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "skillList" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/skillObj.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/skillObj.3,v retrieving revision 1.1 diff -u -r1.1 skillObj.3 --- docs/man-pages/man3/skillObj.314 Feb 2008 21:59:34 -00001.1 +++ docs/man-pages/man3/skillObj.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "skillObj" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "skillObj" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/sparseArray.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/sparseArray.3,v retrieving revision 1.1 diff -u -r1.1 sparseArray.3 --- docs/man-pages/man3/sparseArray.314 Feb 2008 21:59:34 -00001.1 +++ docs/man-pages/man3/sparseArray.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "sparseArray" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "sparseArray" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/sparseArrayNode.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/sparseArrayNode.3,v retrieving revision 1.1 diff -u -r1.1 sparseArrayNode.3 --- docs/man-pages/man3/sparseArrayNode.314 Feb 2008 21:59:34 -00001.1 +++ docs/man-pages/man3/sparseArrayNode.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "sparseArrayNode" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "sparseArrayNode" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/sparseVector.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/sparseVector.3,v retrieving revision 1.1 diff -u -r1.1 sparseVector.3 --- docs/man-pages/man3/sparseVector.314 Feb 2008 21:59:34 -00001.1 +++ docs/man-pages/man3/sparseVector.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "sparseVector" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "sparseVector" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/sparseVectorNode.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/sparseVectorNode.3,v retrieving revision 1.1 diff -u -r1.1 sparseVectorNode.3 --- docs/man-pages/man3/sparseVectorNode.314 Feb 2008 21:59:34 -00001.1 +++ docs/man-pages/man3/sparseVectorNode.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "sparseVectorNode" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "sparseVectorNode" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/star.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/star.3,v retrieving revision 1.1 diff -u -r1.1 star.3 --- docs/man-pages/man3/star.314 Feb 2008 21:59:34 -00001.1 +++ docs/man-pages/man3/star.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "star" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "star" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/subordinatePlanet.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/subordinatePlanet.3,v retrieving revision 1.1 diff -u -r1.1 subordinatePlanet.3 --- docs/man-pages/man3/subordinatePlanet.314 Feb 2008 21:59:34 -00001.1 +++ docs/man-pages/man3/subordinatePlanet.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "subordinatePlanet" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "subordinatePlanet" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/subordinateStar.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/subordinateStar.3,v retrieving revision 1.1 diff -u -r1.1 subordinateStar.3 --- docs/man-pages/man3/subordinateStar.314 Feb 2008 21:59:34 -00001.1 +++ docs/man-pages/man3/subordinateStar.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "subordinateStar" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "subordinateStar" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/subsector.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/subsector.3,v retrieving revision 1.1 diff -u -r1.1 subsector.3 --- docs/man-pages/man3/subsector.314 Feb 2008 21:59:34 -00001.1 +++ docs/man-pages/man3/subsector.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "subsector" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "subsector" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME Index: docs/man-pages/man3/todo.3 =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/docs/man-pages/man3/todo.3,v retrieving revision 1.1 diff -u -r1.1 todo.3 --- docs/man-pages/man3/todo.314 Feb 2008 21:59:34 -00001.1 +++ docs/man-pages/man3/todo.316 Feb 2008 04:18:07 -0000 @@ -1,4 +1,4 @@ -.TH "todo" 3 "14 Feb 2008" "frpuniverse" \" -*- nroff -*- +.TH "todo" 3 "15 Feb 2008" "frpuniverse" \" -*- nroff -*- .ad l .nh .SH NAME @@ -92,11 +92,6 @@ .PP .PP -.IP "\fBClass \fBpersonObj\fP \fP" 1c -eliminiate all the inlining in this class. -.PP -.PP - .IP "\fBMember \fBplanetoidBelt::planetoidBelt\fP() \fP" 1c Implement me! .PP Index: src/b1-army-person.cpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/b1-army-person.cpp,v retrieving revision 1.2 diff -u -r1.2 b1-army-person.cpp --- src/b1-army-person.cpp14 Feb 2008 21:37:25 -00001.2 +++ src/b1-army-person.cpp16 Feb 2008 04:18:08 -0000 @@ -23,9 +23,241 @@ */ #include "b1-army-person.hpp" +#include "dice.hpp" +#include "skill-obj.hpp" b1ArmyPerson::b1ArmyPerson() : book1Person() { this->setService("Army"); +this->enlist(); } +void b1ArmyPerson::enlist(){ +int dm=0; +int skill_rolls=0; + +if ( this->getDexterity() > 5) +dm = 1; +if ( this->getConstitution() > 4 ) +dm = dm + 2; +if ( (d2d6()+dm) > 4 ) { +this->setAccepted(1); +this->addSkill(RIFLE,1); +} else { +this->setAccepted(0); +return ; +} +this->setTerms(1); +while(1){ // while +if ( this->getTerms() == 1 ) { // if +skill_rolls=2; +} else { +skill_rolls=1; +} //end-if + +// Determine Survival +// +dm=0; +if ( this->getEducation() > 5) +dm = 2; +if ( (d2d6()+dm) > 4 ) { +// this->setTerms(this->getTerms()+1); +this->setAge( this->getAge()+4); +} else { +this->setAlive(0); +return; +} + +// Check to see if commissioned either already or now. +// if already commissioned check for promotion. + +if ( this->getCommissioned() == 1 ) { +dm = ( this->getEducation() > 6 ? 1:0); +if ( (d2d6()+dm) > 5 ) { +this->setRank(this->getRank()+1); // promotion of an officer. +skill_rolls++; +} +} else { +dm = ( this->getConstitution() > 6 ? 1 : 0 ) ; +// Roll to see if they get commissioned. +if ( (d2d6()+dm)>5 ){ +this->setCommissioned(1); +this->setRank(1); +this->addSkill(SUBMACHINEGUN,1); + +dm = ( this->getEducation() > 6 ? 1:0); +skill_rolls++; + +if ( (d2d6()+dm) > 7 ) { +this->setRank(this->getRank()+1); // promotion of an officer. +skill_rolls++; +} +} +} + +this->skillTables(skill_rolls); + +// I've imposed my own DMS for sanity sake since I don't want people +// managing to be in for 60 terms like some trial runs had. +dm=0; +if ( this->getTerms() > 5 ) { +dm = this->getTerms() - 5; +} +if ( this->getAge() > 50 ) { +dm = dm + (this->getAge()/10); +} +int re_enlisted=0; + +if ( (d2d6() - dm) > 5 ) { +this->setTerms(this->getTerms()+1); +re_enlisted=1; +} + +// A couple of sanity checks: +if ( this->getRank() > 6) this->setRank(6); +if ( re_enlisted != 1 ) return; + +} +} + +void b1ArmyPerson::skillTables(int nrolls){ +// There are 4 different skill tables to deal with here... +// 3 of which are in play when education < 8 and all 4 are +// in play for education >= 8 + + +int roll; +for(roll=1;roll<=nrolls;roll++){ +if ( this->getEducation() < 8 ) { +switch(d1d6()){ +case 1: +case 2: +this->skillTable1(); +break; +case 3: +case 4: +this->skillTable2(); +break; +case 5: +case 6: +this->skillTable3(); +break; +}; +} else { +switch(d2d6()){ +case 1: +this->skillTable1(); +break; +case 2: +case 3: +this->skillTable2(); +break; +case 4: +case 5: +this->skillTable3(); +break; +case 6: +this->skillTable4(); +break; +}; + +} + +} +} + +void b1ArmyPerson::skillTable1(){ +switch(d1d6()){ +case 1: +this->incrementStrength(1); +break; +case 2: +this->incrementDexterity(1); +break; +case 3: +this->incrementConstitution(1); +break; +case 4: +this->addSkill(GAMBLING,1); +break; +case 5: +this->incrementEducation(1); +break; +case 6: +this->addSkill(BRAWLING,1); +break; + + +}; + +} + +void b1ArmyPerson::skillTable2(){ +switch(d1d6()){ +case 1: +this->addSkill(VEHICLE,1); +break; +case 2: +this->addSkill(AIR_RAFT,1); +break; +case 3: +this->addSkill(GUN_COMBAT,1); +break; +case 4: +this->addSkill(FORWARD_OBSERVER,1); +break; +case 5: +this->addSkill(BLADE_COMBAT,1); +break; +case 6: +this->addSkill(GUN_COMBAT,1); +break; +} + +} + +void b1ArmyPerson::skillTable3(){ +switch(d1d6()){ +case 1: +this->addSkill(VEHICLE,1); +break; +case 2: +this->addSkill(MECHANICAL,1); +break; +case 3: +this->addSkill(ELECTRONICS,1); +break; +case 4: +this->addSkill(TACTICS,1); +break; +case 5: +this->addSkill(BLADE_COMBAT,1); +break; +case 6: +this->addSkill(GUN_COMBAT,1); +break; +}; + +} + +void b1ArmyPerson::skillTable4(){ +switch(d1d6()){ +case 1: +this->addSkill(MEDICAL,1); +break; +case 2: +case 3: +this->addSkill(TACTICS,1); +break; +case 4: +this->addSkill(COMPUTER,1); +break; +case 5: +this->addSkill(LEADER,1); +break; +case 6: +this->addSkill(ADMIN,1); +break; + +}; +} Index: src/b1-army-person.hpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/b1-army-person.hpp,v retrieving revision 1.1 diff -u -r1.1 b1-army-person.hpp --- src/b1-army-person.hpp13 Feb 2008 16:31:14 -00001.1 +++ src/b1-army-person.hpp16 Feb 2008 04:18:08 -0000 @@ -31,12 +31,26 @@ /** * Generic constructor */ + b1ArmyPerson(); +/** + * Enlist this character, and run them through the paces. + */ +void enlist(); +/** + * Invoke one several skill tables. + * @param n number of rolls to run against the skill tables for a given term. + */ +void skillTables(int n); + protected: private: - +void skillTable1(); +void skillTable2(); +void skillTable3(); +void skillTable4(); }; #endif // _B1_ARMY_PERSON_HPP_ Index: src/b1-marine-person.cpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/b1-marine-person.cpp,v retrieving revision 1.2 diff -u -r1.2 b1-marine-person.cpp --- src/b1-marine-person.cpp14 Feb 2008 21:37:25 -00001.2 +++ src/b1-marine-person.cpp16 Feb 2008 04:18:08 -0000 @@ -23,9 +23,231 @@ */ #include "b1-marine-person.hpp" +#include "skill-obj.hpp" +#include "dice.hpp" b1MarinePerson::b1MarinePerson() : book1Person() { this->setService("Marines"); +this->enlist(); + } +void b1MarinePerson::enlist(){ +int dm=0; +int skill_rolls=0; + + +if ( this->getIntelligence() > 7 ) +dm = 1; +if ( this->getStrength() > 7 ) +dm = dm + 2; +if ( (d2d6()+dm) > 5 ) { +this->setAccepted(1); +this->addSkill(CUTLASS,1); + +} else { +this->setAccepted(0); +return ; +} +this->setTerms(1); +while(1){ // while +if ( this->getTerms() == 1 ) { // if +skill_rolls=2; +} else { +skill_rolls=1; +} //end-if + +// Determine Survival +// +dm=0; +if ( this->getConstitution() > 7) +dm = 2; +if ( (d2d6()+dm) > 5 ) { +// this->setTerms(this->getTerms()+1); +this->setAge( this->getAge()+4); +} else { +this->setAlive(0); +return; +} + +// Check to see if commissioned either already or now. +// if already commissioned check for promotion. + +if ( this->getCommissioned() == 1 ) { +dm = ( this->getSocialStanding() > 7 ? 1:0); +if ( (d2d6()+dm) > 8 ) { +this->setRank(this->getRank()+1); // promotion of an officer. + +skill_rolls++; +} +} else { +dm = ( this->getEducation() > 6 ? 1 : 0 ) ; +// Roll to see if they get commissioned. +if ( (d2d6()+dm)>8 ){ +this->setCommissioned(1); +this->addSkill(REVOLVER,1); +this->setRank(1); +dm = ( this->getSocialStanding() > 7 ? 1:0); +skill_rolls++; + +if ( (d2d6()+dm) > 8 ) { +this->setRank(this->getRank()+1); // promotion of an officer. +skill_rolls++; +} +} + +} + +this->skillTables(skill_rolls); + +// I've imposed my own DMS for sanity sake since I don't want people +// managing to be in for 60 terms like some trial runs had. +dm=0; +if ( this->getTerms() > 5 ) { +dm = this->getTerms() - 5; +} +if ( this->getAge() > 50 ) { +dm = dm + (this->getAge()/10); +} +int re_enlisted=0; + +if ( (d2d6() - dm) > 5 ) { +this->setTerms(this->getTerms()+1); +re_enlisted=1; +} + +// A couple of sanity checks: +if ( this->getRank() > 6) this->setRank(6); +if ( re_enlisted != 1 ) return; + +} +} + +void b1MarinePerson::skillTables(int nrolls){ +int roll; +for(roll=1;roll<=nrolls;roll++){ +if ( this->getEducation() < 8 ) { +switch(d1d6()){ +case 1: +case 2: +this->skillTable1(); +break; +case 3: +case 4: +this->skillTable2(); +break; +case 5: +case 6: +this->skillTable3(); +break; +}; +} else { +switch(d2d6()){ +case 1: +this->skillTable1(); +break; +case 2: +case 3: +this->skillTable2(); +break; +case 4: +case 5: +this->skillTable3(); +break; +case 6: +this->skillTable4(); +break; +}; + +} + +} +} + + +void b1MarinePerson::skillTable1(){ +switch(d1d6()){ +case 1: +this->incrementStrength(1); +break; +case 2: +this->incrementDexterity(1); +break; +case 3: +this->incrementConstitution(1); +break; +case 4: +this->addSkill(GAMBLING,1); +break; +case 5: +this->addSkill(BRAWLING,1); +break; +case 6: +this->addSkill(BLADE_COMBAT,1); +break; +} + +} +void b1MarinePerson::skillTable2(){ +switch(d1d6()){ +case 1: +this->addSkill(VEHICLE,1); +break; +case 2: +this->addSkill(VACC_SUIT,1); +break; +case 3: +case 5: +this->addSkill(BLADE_COMBAT,1); +break; +default: +this->addSkill(GUN_COMBAT,1); +break; +}; + +} +void b1MarinePerson::skillTable3(){ +switch(d1d6()){ +case 1: +this->addSkill(VEHICLE,1); +break; +case 2: +this->addSkill(MECHANICAL,1); +break; +case 3: +this->addSkill(ELECTRONICS,1); +break; +case 4: +this->addSkill(TACTICS,1); +break; +case 5: +this->addSkill(BLADE_COMBAT,1); +break; +case 6: +this->addSkill(GUN_COMBAT,1); +break; +} + +} +void b1MarinePerson::skillTable4(){ +switch(d1d6()){ +case 1: +this->addSkill(MEDICAL,1); +break; +case 2: +case 3: +this->addSkill(TACTICS,1); +break; +case 4: +this->addSkill(COMPUTER,1); +break; +case 5: +this->addSkill(LEADER,1); +break; +case 6: +this->addSkill(ADMIN,1); +break; +}; + +} Index: src/b1-marine-person.hpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/b1-marine-person.hpp,v retrieving revision 1.1 diff -u -r1.1 b1-marine-person.hpp --- src/b1-marine-person.hpp13 Feb 2008 16:31:15 -00001.1 +++ src/b1-marine-person.hpp16 Feb 2008 04:18:08 -0000 @@ -34,10 +34,25 @@ * Generic constructor */ b1MarinePerson(); + +/** + * Enlist this character, and run them through the paces. + */ +void enlist(); +/** + * Invoke one several skill tables. + * @param n number of rolls to run against the skill tables for a given term. + */ +void skillTables(int n); + protected: private: +void skillTable1(); +void skillTable2(); +void skillTable3(); +void skillTable4(); }; #endif // _B1_MARINE_PERSON_HPP_ Index: src/b1-navy-person.cpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/b1-navy-person.cpp,v retrieving revision 1.2 diff -u -r1.2 b1-navy-person.cpp --- src/b1-navy-person.cpp14 Feb 2008 21:37:25 -00001.2 +++ src/b1-navy-person.cpp16 Feb 2008 04:18:08 -0000 @@ -37,7 +37,12 @@ #include "b1-navy-person.hpp" #include "dice.hpp" - +b1NavyPerson::b1NavyPerson():book1Person(){ + + + +this->enlist(); +}; @@ -67,6 +72,7 @@ // Determine Survival // +dm=0; if ( this->getIntelligence() > 6) dm = 2; if ( (d2d6()+dm) > 4 ) { @@ -84,6 +90,12 @@ dm = ( this->getEducation() > 7 ? 1:0); if ( (d2d6()+dm) > 7 ) { this->setRank(this->getRank()+1); // promotion of an officer. +if ( (this->getRank() == 5) || +(this->getRank() == 6 ) ) { +this->incrementSocialStanding(1); +} + + skill_rolls++; } } else { @@ -94,11 +106,13 @@ this->setRank(1); dm = ( this->getEducation() > 7 ? 1:0); skill_rolls++; + +if ( (d2d6()+dm) > 7 ) { +this->setRank(this->getRank()+1); // promotion of an officer. +skill_rolls++; +} } -if ( (d2d6()+dm) > 7 ) { -this->setRank(this->getRank()+1); // promotion of an officer. -skill_rolls++; -} + } this->skillTables(skill_rolls); Index: src/b1-navy-person.hpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/b1-navy-person.hpp,v retrieving revision 1.3 diff -u -r1.3 b1-navy-person.hpp --- src/b1-navy-person.hpp14 Feb 2008 21:37:25 -00001.3 +++ src/b1-navy-person.hpp16 Feb 2008 04:18:08 -0000 @@ -39,15 +39,10 @@ /** * Non paramtized constructor. - * @todo this needs to be removed from inlining. + * */ -b1NavyPerson():book1Person(){ - - - -this->enlist(); -}; +b1NavyPerson(); Index: src/book1-person.hpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/book1-person.hpp,v retrieving revision 1.3 diff -u -r1.3 book1-person.hpp --- src/book1-person.hpp14 Feb 2008 21:37:25 -00001.3 +++ src/book1-person.hpp16 Feb 2008 04:18:08 -0000 @@ -175,6 +175,7 @@ */ char** listOfSkills(); + private: Index: src/skill-list.cpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/skill-list.cpp,v retrieving revision 1.2 diff -u -r1.2 skill-list.cpp --- src/skill-list.cpp14 Feb 2008 21:37:26 -00001.2 +++ src/skill-list.cpp16 Feb 2008 04:18:08 -0000 @@ -156,7 +156,7 @@ int level = p->getLevel(); char rval[10]; -sprintf(rval," - %d",level); +sprintf(rval,"-%d",level); if ( (linesize + strlen(skill) + strlen(rval) ) >=72 ) { Index: src/skill-obj.cpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/skill-obj.cpp,v retrieving revision 1.2 diff -u -r1.2 skill-obj.cpp --- src/skill-obj.cpp14 Feb 2008 21:37:26 -00001.2 +++ src/skill-obj.cpp16 Feb 2008 04:18:08 -0000 @@ -30,6 +30,120 @@ }; +void skillObj::ScienceCascade(){ +switch (randxInRange(1,7)){ +case 1: +this->setSkill(skillTable[BIOLOGY]); +break; +case 2: +this->setSkill(skillTable[CHEMISTRY]); +break; +case 3: +this->setSkill(skillTable[GENETICS]); +break; +case 4: +this->setSkill(skillTable[FORENSIC]); +break; +case 5: +this->setSkill(skillTable[MEDICAL]); +break; +case 6: +this->setSkill(skillTable[PHYSICS]); +break; +case 7: +this->setSkill(skillTable[ROBOTICS]); +break; +}; +} + +void skillObj::LargeBladeCascade(){ +switch(d1d6()){ +case 1: +case 2: +this->setSkill(skillTable[BROADSWORD]); +break; +case 3: +case 4: +this->setSkill(skillTable[CUTLASS]); +break; +case 5: +case 6: +this->setSkill(skillTable[SWORD]); +break; +}; + +} +void skillObj::SmallBladeCascade(){ +} + +void skillObj::GunCombatCascade(){ +switch (d1d6()){ +case 1: +this->setSkill(skillTable[ENERGY_WEAPONS]); +break; +case 2: +this->setSkill(skillTable[HANDGUN]); +break; +case 3: +this->setSkill(skillTable[LASER_WEAPONS]); +break; +case 4: +this->setSkill(skillTable[NEURAL_WEAPONS]); +break; +case 5: +this->setSkill(skillTable[RIFLEMAN]); +break; +default: +this->setSkill(skillTable[SUBMACHINEGUN]); +break; + +} + +} + + +void skillObj::BladeCombatCascade(){ +switch(d1d6()){ +case 1: +this->setSkill(skillTable[AXE]); +break; +case 2: +this->setSkill(skillTable[CUDGEL]); +break; +case 3: +this->setSkill(skillTable[FOIL]); +break; +case 4: +this->LargeBladeCascade(); +break; +case 5: +this->setSkill(skillTable[POLEARM]); +break; +default: +this->SmallBladeCascade(); +break; +}; + +} + +void skillObj::AircraftCascade(){ +switch(randxInRange(1,4)){ +case 1: +this->setSkill(skillTable[HELICOPTER]); +break; +case 2: +this->setSkill(skillTable[JET_PROPELLED_AIRCRAFT]); +break; + +case 3: +this->setSkill(skillTable[LIGHTER_THAN_AIR_CRAFT]); +break; +case 4: +this->setSkill(skillTable[PROPELLER_DRIVEN_CRAFT]); +break; +}; + +} skillObj::skillObj(personObj *p,int ix,int l) : skillEntry(skillTable[ix],l){ @@ -53,36 +167,22 @@ this->setSkill(skillTable[PERSUASION]); break; case 5: -switch (randxInRange(1,7)){ -case 1: -this->setSkill(skillTable[BIOLOGY]); -break; -case 2: -this->setSkill(skillTable[CHEMISTRY]); -break; -case 3: -this->setSkill(skillTable[GENETICS]); -break; -case 4: -this->setSkill(skillTable[FORENSIC]); -break; -case 5: -this->setSkill(skillTable[MEDICAL]); -break; -case 6: -this->setSkill(skillTable[PHYSICS]); -break; -case 7: -this->setSkill(skillTable[ROBOTICS]); -break; -}; +this->ScienceCascade(); break; case 6: p->setEducation(p->getEducation()+1); break; }; break; - +case BLADE_COMBAT: +this->BladeCombatCascade(); +break; +case GUN_COMBAT: +this->GunCombatCascade(); +break; +case SCIENCE: +this->ScienceCascade(); +break; default: break; }; Index: src/skill-obj.hpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/skill-obj.hpp,v retrieving revision 1.2 diff -u -r1.2 skill-obj.hpp --- src/skill-obj.hpp14 Feb 2008 21:37:26 -00001.2 +++ src/skill-obj.hpp16 Feb 2008 04:18:08 -0000 @@ -59,6 +59,13 @@ private: +void BladeCombatCascade(); +void LargeBladeCascade(); +void SmallBladeCascade(); +void ScienceCascade(); +void GunCombatCascade(); +void AircraftCascade(); + }; #endif // _SKILL_OBJ_HPP_ Index: src/skill_definitions.hpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/skill_definitions.hpp,v retrieving revision 1.2 diff -u -r1.2 skill_definitions.hpp --- src/skill_definitions.hpp14 Feb 2008 21:37:26 -00001.2 +++ src/skill_definitions.hpp16 Feb 2008 04:18:08 -0000 @@ -69,91 +69,93 @@ #define HAND_AXE 68 #define HAND_COMBAT 69 #define HAND_GUN 70 -#define HEAVY_WEAPONS 71 -#define HELICOPTER 72 -#define HERDING 73 -#define HIGH_G_ENVIRON 74 -#define HISTORY 75 -#define HOVERCRAFT 76 -#define HUNTING 77 -#define INBORN 78 -#define INSTRUCTION 79 -#define INSTRUCTOR 80 -#define INTERPERSONAL 81 -#define INTERROGATION 82 -#define INTERVIEW 83 -#define INTRUSION 84 -#define JACK_OF_ALL_TRADES 85 -#define JET_PROPELLED_AIRCRAFT 86 -#define LARGE_BLADE 87 -#define LARGE_WATERCRAFT 88 -#define LASER 89 -#define LASER_PISTOL 90 -#define LASER_RIFLE 91 -#define LASER_WEAPONS 92 -#define LEADER 93 -#define LEGAL 94 -#define LIASION 95 -#define LIGHT_ASSAULT_GUN 96 -#define LIGHTER_THAN_AIR_CRAFT 97 -#define LINGUISTICS 98 -#define MACHINE_GUN 99 -#define MASS_DRIVES 100 -#define MECHANICAL 101 -#define MEDICAL 102 -#define MENTAL 103 -#define MESON_GUNS 104 -#define MORTARS_AND_HOWITZERS 105 -#define NAVAL_ARCHITECT 106 -#define NAVIGATION 107 -#define NEURAL_WEAPONS 108 -#define PERSUASION 109 -#define PHYSICAL 110 -#define PHYSICS 111 -#define PIKE 112 -#define PILOT 113 -#define PISTOL 114 -#define PLASMA_GUN 115 -#define POLEARM 116 -#define PROPELLER_DRIVEN_CRAFT 117 -#define PROSPECTING 118 -#define RECON 119 -#define RECRUITING 120 -#define REVOLVER 121 -#define RIFLE 122 -#define RIFLEMAN 123 -#define ROBOT_OPS 124 -#define ROBOTICS 125 -#define SCIENCE 126 -#define SCREENS 127 -#define SENSOR_OPS 128 -#define SHIP_TACTICS 129 -#define SHIP_S_BOAT 130 -#define SLING 131 -#define SMALL_BLADE 132 -#define SMALL_WATERCRAFT 133 -#define SNUB_PISTOL 134 -#define SPACE 135 -#define SPACE_COMBAT 136 -#define SPACE_TECH 137 -#define SPEAR 138 -#define SPECIAL_COMBAT 139 -#define SPINAL_WEAPONS 140 -#define STEALTH 141 -#define STEWARD 142 -#define STREETWISE 143 -#define SUBMACHINEGUN 144 -#define SURVEY 145 -#define SURVIVAL 146 -#define TACTICS 147 -#define TECHNICAL 148 -#define TRACKED_VEHICLE 149 -#define TRADER 150 -#define TURRET_WEAPONS 151 -#define VRF_GAUSS_GUN 152 -#define VACC_SUIT 153 -#define VEHICLE 154 -#define VICE 155 -#define WHEELED_VEHICLE 156 -#define ZERO_G_COMBAT 157 -#define ZERO_G_ENVIRON 158 +#define HANDGUN 71 +#define HEAVY_WEAPONS 72 +#define HELICOPTER 73 +#define HERDING 74 +#define HIGH_G_ENVIRON 75 +#define HISTORY 76 +#define HOVERCRAFT 77 +#define HUNTING 78 +#define INBORN 79 +#define INSTRUCTION 80 +#define INSTRUCTOR 81 +#define INTERPERSONAL 82 +#define INTERROGATION 83 +#define INTERVIEW 84 +#define INTRUSION 85 +#define JACK_OF_ALL_TRADES 86 +#define JET_PROPELLED_AIRCRAFT 87 +#define LARGE_BLADE 88 +#define LARGE_WATERCRAFT 89 +#define LASER 90 +#define LASER_PISTOL 91 +#define LASER_RIFLE 92 +#define LASER_WEAPONS 93 +#define LEADER 94 +#define LEGAL 95 +#define LIASION 96 +#define LIGHT_ASSAULT_GUN 97 +#define LIGHTER_THAN_AIR_CRAFT 98 +#define LINGUISTICS 99 +#define MACHINE_GUN 100 +#define MASS_DRIVES 101 +#define MECHANICAL 102 +#define MEDICAL 103 +#define MENTAL 104 +#define MESON_GUNS 105 +#define MORTARS_AND_HOWITZERS 106 +#define NAVAL_ARCHITECT 107 +#define NAVIGATION 108 +#define NEURAL_WEAPONS 109 +#define PERSUASION 110 +#define PHYSICAL 111 +#define PHYSICS 112 +#define PIKE 113 +#define PILOT 114 +#define PISTOL 115 +#define PLASMA_GUN 116 +#define POLEARM 117 +#define PROPELLER_DRIVEN_CRAFT 118 +#define PROSPECTING 119 +#define RECON 120 +#define RECRUITING 121 +#define REVOLVER 122 +#define RIFLE 123 +#define RIFLEMAN 124 +#define ROBOT_OPS 125 +#define ROBOTICS 126 +#define SCIENCE 127 +#define SCREENS 128 +#define SENSOR_OPS 129 +#define SHIP_TACTICS 130 +#define SHIP_S_BOAT 131 +#define SLING 132 +#define SMALL_BLADE 133 +#define SMALL_WATERCRAFT 134 +#define SNUB_PISTOL 135 +#define SPACE 136 +#define SPACE_COMBAT 137 +#define SPACE_TECH 138 +#define SPEAR 139 +#define SPECIAL_COMBAT 140 +#define SPINAL_WEAPONS 141 +#define STEALTH 142 +#define STEWARD 143 +#define STREETWISE 144 +#define SUBMACHINEGUN 145 +#define SURVEY 146 +#define SURVIVAL 147 +#define SWORD 148 +#define TACTICS 149 +#define TECHNICAL 150 +#define TRACKED_VEHICLE 151 +#define TRADER 152 +#define TURRET_WEAPONS 153 +#define VRF_GAUSS_GUN 154 +#define VACC_SUIT 155 +#define VEHICLE 156 +#define VICE 157 +#define WHEELED_VEHICLE 158 +#define ZERO_G_COMBAT 159 +#define ZERO_G_ENVIRON 160 Index: src/skill_strings.h =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/skill_strings.h,v retrieving revision 1.2 diff -u -r1.2 skill_strings.h --- src/skill_strings.h14 Feb 2008 21:37:26 -00001.2 +++ src/skill_strings.h16 Feb 2008 04:18:08 -0000 @@ -69,6 +69,7 @@ "Hand Axe", "Hand Combat", "Hand Gun", +"Handgun", "Heavy Weapons", "Helicopter", "Herding", @@ -145,6 +146,7 @@ "Submachinegun", "Survey", "Survival", +"Sword", "Tactics", "Technical", "Tracked Vehicle", Index: src/test-personobj.cxx =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/test-personobj.cxx,v retrieving revision 1.1 diff -u -r1.1 test-personobj.cxx --- src/test-personobj.cxx31 Jan 2008 19:41:25 -00001.1 +++ src/test-personobj.cxx16 Feb 2008 04:18:08 -0000 @@ -13,7 +13,27 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA #include "b1-navy-person.hpp" +#include "b1-army-person.hpp" +#include "b1-marine-person.hpp" +#include "book1-person.hpp" #include <iostream> +#include "dice.hpp" + +book1Person* getNewPerson(int flip){ +switch(flip){ +case 1: +case 2: +return new b1NavyPerson(); +case 3: +case 4: +return new b1MarinePerson(); +case 5: +case 6: +return new b1ArmyPerson(); +}; + + +} void generateTest(){ int ix; @@ -21,9 +41,13 @@ for(iy=0;iy<25;iy++){ -b1NavyPerson* person = new b1NavyPerson(); +int flip = d1d6(); + +book1Person *person; + + person= getNewPerson(flip); while ( (person->getAccepted() != 1) || (person->getAlive() != 1) ) { -person = new b1NavyPerson(); +person = getNewPerson(flip);; } person->toStdOut(); -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
$Id: ChangeLog,v 1.5 2008/02/11 19:33:08 plankowner Exp $ $Log: ChangeLog,v $ Revision 1.5 2008/02/11 19:33:08 plankowner Checkpoint --- Revision 1.4 2008/02/01 21:05:53 plankowner Did some more hacking on the star attribute generation. Primary stars are finished at this point. Next increment will be companion stars. Revision 1.3 2008/01/29 19:38:35 plankowner attempting to coorce automake into setting up installations such that they do not include the test programs. Revision 1.2 2008/01/29 17:56:43 plankowner Updated some documentation files -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 2008-02-01 16:03 Changes Mon Feb 11 14:31:46 EST 2008 ---------- ? YES ? doxy ? frpuniverse-0.2.tar.gz ? include ? libfrpuniverse.pc ? test-dice ? test-spvect ? src/frpuniverse ? src/test-dice ? src/test-personobj ? src/test-spvect Index: ChangeLog =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/ChangeLog,v retrieving revision 1.4 diff -r1.4 ChangeLog 15,241c15,16 < < Index: src/dice.cxx < =================================================================== < RCS file: /cvsroot/frpuniverse/frpuniverse/src/dice.cxx,v < retrieving revision 1.2 < diff -r1.2 dice.cxx < 28,29c28,31 < < < < return retval; < --- < > if ( (1 <= retval) && ( retval <= 6)) < > return retval; < > else < > return d1d6(); < 36a39,51 < > int randxInRange(int min,int max){ < > if ( randomized == 0 ) { < > randomize(); < > randomized=1; < > } < > int retval = ((int) drand48() * (double)max) + min; < > < > if ( ( min <= retval ) && ( retval <= max) ) < > return retval; < > else return randxInRange(min,max); < > < > } < > < Index: src/dice.hpp < =================================================================== < RCS file: /cvsroot/frpuniverse/frpuniverse/src/dice.hpp,v < retrieving revision 1.2 < diff -r1.2 dice.hpp < 29a30 < > int randxInRange(int,int); // random number within a range.... < Index: src/star.cpp < =================================================================== < RCS file: /cvsroot/frpuniverse/frpuniverse/src/star.cpp,v < retrieving revision 1.3 < diff -r1.3 star.cpp < 323a324,456 < > int star::calculateHabitableOrbit(){ < > switch (size){ < > case STAR_SIZE_Ia: < > switch (type){ < > case STAR_TYPE_O: < > < > case STAR_TYPE_B: < > if ( spectral == 0 ) return 13; < > else return 12; < > break; < > case STAR_TYPE_A: < > return 12; < > case STAR_TYPE_F: < > if ( spectral == 0 ) return 12; < > else return return 11; < > case STAR_TYPE_G: < > case STAR_TYPE_K: < > case STAR_TYPE_M: < > return 12; < > }; < > < > case STAR_SIZE_Ib: < > switch (type){ < > case STAR_TYPE_O: < > < > case STAR_TYPE_B: < > if ( spectral == 0 ) return 13; < > else return 11; < > case STAR_TYPE_A: < > if ( spectral == 0 ) return 11; < > else return 10; < > case STAR_TYPE_F: < > case STAR_TYPE_G: < > return 10; < > case STAR_TYPE_K: < > return ( spectral == 0 ? 10:11); < > case STAR_TYPE_M: < > return ( spectral == 0 ? 11: 12); < > }; < > case STAR_SIZE_II: < > switch (type){ < > case STAR_TYPE_O: < > case STAR_TYPE_B: < > return ( spectral == 0 ? 8: 6); < > case STAR_TYPE_A: < > return 5; < > case STAR_TYPE_F: < > return 4; < > case STAR_TYPE_G: < > return ( spectral == 0 ? 4 : 5 ); < > case STAR_TYPE_K: < > return ( spectral == 0 ? 5 : 6 ); < > case STAR_TYPE_M: < > return ( spectral == 0 ? 6 : 7 ); < > }; < > case STAR_SIZE_III: < > switch (type){ < > case STAR_TYPE_O: < > case STAR_TYPE_B: < > return (spectral == 0 ? 12 : 10 ); < > case STAR_TYPE_A: < > return (spectral == 0 ? 8 : 7 ) ; < > case STAR_TYPE_F: < > return 6; < > case STAR_TYPE_G: < > return ( spectral == 0 ? 6 : 7 ); < > case STAR_TYPE_K: < > return ( spectral == 0 ? 7 : 8 ); < > case STAR_TYPE_M: < > return ( spectral == 0 ? 8 : 9 ); < > }; < > case STAR_SIZE_IV: < > switch (type){ < > case STAR_TYPE_O: < > case STAR_TYPE_B: < > return ( spectral == 0 ? 12: 9 ) ; < > case STAR_TYPE_A: < > return ( spectral == 0 ? 7 : 6); < > case STAR_TYPE_F: < > return ( spectral == 0 ? 6 : 5); < > case STAR_TYPE_G: < > return 5; < > case STAR_TYPE_K: < > case STAR_TYPE_M: < > return 4; < > }; < > case STAR_SIZE_V: < > switch (type){ < > case STAR_TYPE_O: < > case STAR_TYPE_B: < > return ( spectral == 0 ? 12 : 9 ); < > case STAR_TYPE_A: < > return ( spectral == 0 ? 7 : 6 ); < > case STAR_TYPE_F: < > return ( spectral == 0 ? 5 : 4 ); < > case STAR_TYPE_G: < > return ( spectral == 0 ? 3 : 2 ); < > case STAR_TYPE_K: < > return 1; < > case STAR_TYPE_M: < > return -1; // NO habitable zone... < > }; < > case STAR_SIZE_VI: < > switch (type){ < > case STAR_TYPE_O: < > case STAR_TYPE_B: < > case STAR_TYPE_A: < > case STAR_TYPE_F: < > return 3; < > case STAR_TYPE_G: < > return ( spectral == 0 ? 2 : 1 ); < > case STAR_TYPE_K: < > return ( spectral == 0 ? 0 : -1 ); < > case STAR_TYPE_M: < > return -1; < > }; < > case STAR_SIZE_D: < > switch (type){ < > case STAR_TYPE_O: < > case STAR_TYPE_B: < > return 0; < > case STAR_TYPE_A: < > case STAR_TYPE_F: < > case STAR_TYPE_G: < > case STAR_TYPE_K: < > case STAR_TYPE_M: < > return -1; < > }; < > }; < > < > } < > < > < 389a523 < > int dm; < 396a531,572 < > habitable_orbit = this->calculateHabitableOrbit(); < > < > // Calculate a DM based on star size. < > dm = ( size == STAR_SIZE_III ? 4 : < > ( ((STAR_SIZE_Ia <= size ) && ( size <= STAR_SIZE_II)) ? < > 8:0 ) ); < > // Add to or subtract from that DM based on type. < > dm = dm + ( type == STAR_TYPE_M ? -4 : < > ( type == STAR_TYPE_K ? -2 : 0 ) ); < > max_orbits = d2d6() + dm; < > // Eliminate negative values if present. < > max_orbits = ( max_orbits >= 0 ? max_orbits : 0 ); < > < > // Determine if gas giants are present and how many < > if ( d2d6() < 10 ) { < > int roll = d2d6(); < > gas_giants = < > ( roll < 4 ? 1 : < > ( (( roll == 4) || (roll == 5 )) ? 2 : < > ( ( roll == 6) || (roll == 7) ? 3 : 4 ) ) ); < > < > < > } else { < > gas_giants=0; < > } < > < > gas_giants = ( gas_giants > max_orbits ? max_orbits ? gas_giants); < > < > // Determine if planetoid belts are present and how many < > < > dm = gas_giants; < > < > if ( (d2d6() + dm ) > 6 ) { < > planetoid = 0; < > } else { < > int roll= d2d6() + roll; < > planetoid = ( roll > 6 ? 1 : 2 ) ; < > } < > < > planetoid = ( (gas_giants + planetoid) > max_orbits? (max_orbits-gas_giants) : < > planetoid); < > < Index: src/star.hpp < =================================================================== < RCS file: /cvsroot/frpuniverse/frpuniverse/src/star.hpp,v < retrieving revision 1.4 < diff -r1.4 star.hpp < 106a107,108 < > int gas_giants; < > int planetoid; --- > Mon Feb 11 14:31:46 EST 2008 > ---------- Index: Makefile.am =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/Makefile.am,v retrieving revision 1.6 diff -r1.6 Makefile.am 44,56d43 < #noinst_PROGRAMS = \ < #test-dice \ < #test-spvect < < #test_dice_SOURCES = src/test-dice.cxx < < #test_dice_LDADD = \ < #-lfrputil < < #test_spvect_SOURCES = src/test-spvect-main.cxx < < #test_spvect_LDADD= \ < #-lfrpuniverse 69a57,65 > # > # I really don't like having to hard code this, but until I find a > # way of autodetecting where pkg-config wants to find it's *.pc files > # I'll hard code it. FIXME > # > # > pkgconfigdir = /usr/lib/pkgconfig > pkgconfig_DATA = libfrpuniverse.pc > Index: configure.ac =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/configure.ac,v retrieving revision 1.3 diff -r1.3 configure.ac 32c32 < --- > pkgconfig_FILES=libfrpuniverse.pc 40a41 > libfrpuniverse.pc Index: src/Makefile.am =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/Makefile.am,v retrieving revision 1.10 diff -r1.10 Makefile.am 100c100,116 < xml-file-object.cpp --- > xml-file-object.cpp \ > orbit-plane.hpp \ > orbit-plane.cpp \ > sparse-array.hpp \ > sparse-array.cpp \ > sparse-array-node.hpp \ > sparse-array-node.cpp \ > parsec.hpp \ > parsec.cpp \ > subsector.hpp \ > subsector.cpp \ > planet.hpp \ > planet.cpp \ > gas-giant.hpp \ > gas-giant.cpp \ > planetoid-belt.hpp \ > planetoid-belt.cpp Index: src/orbit-place.cpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/orbit-place.cpp,v retrieving revision 1.2 diff -r1.2 orbit-place.cpp 34a35,52 > orbitPlace::orbitPlace() : sparseVectorNode(){ > > } > > > int orbitPlace::getOrbit(){ > return this->getIndex(); > } > > void orbitPlace::setOrbit(int ix){ > this->setIndex(ix); > } > > > char* orbitPlace::nodeSignature(){ > return "orbitPlace"; > } > Index: src/orbit-place.hpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/orbit-place.hpp,v retrieving revision 1.1 diff -r1.1 orbit-place.hpp 37,40c37,38 < orbitPlace() : sparseVectorNode() { < < < }; --- > orbitPlace(); > 44a43,46 > void setOrbit(int); > int getOrbit(); > > char* nodeSignature(); Index: src/orbit-plane.cpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/orbit-plane.cpp,v retrieving revision 1.1 diff -r1.1 orbit-plane.cpp 27a28,49 > > orbitPlane::orbitPlane() : sparseVector() { > root = new orbitPlace(); > > } > > void orbitPlane::add(orbitPlace* p){ > int ix = p->getOrbit(); > this->addAt(ix,p); > } > > void orbitPlane::add(int ix,orbitPlace *p){ > this->addAt(ix,p); > } > > int orbitPlane::isEmpty(int ix){ > if ( this->findAt(ix) == 0 ) > return 1; > else > return 0; > > } Index: src/orbit-plane.hpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/orbit-plane.hpp,v retrieving revision 1.1 diff -r1.1 orbit-plane.hpp 25,26c25,26 < #ifndef _ORBIT_PLANE_HPP_ < #define _ORBIT_PLANE_HPP_ --- > #include "orbit-place.hpp" > 29,30d28 < #define OPXML_START "<orbit-plane>" < #define OPXML_END "</orbit-plane" 32a31,33 > #ifndef _ORBIT_PLANE_HPP_ > #define _ORBIT_PLANE_HPP_ > 36,39c37 < orbitPlane():sparseVector() { < maxOrbits=0; < < }; --- > orbitPlane(); 41,42c39,40 < int getMaxOrbits(){ return maxOrbits; }; < void setMaxOrbits(int n){ maxOrbits=n; }; --- > void add(orbitPlace*); > void add(int,orbitPlace*); 44,45c42 < // Overloaded method < char* dumpAsXML(); --- > int isEmpty(int); 50c47 < int maxOrbits; --- > orbitPlace* root; 52d48 < Index: src/sparse-vector-node.cpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/sparse-vector-node.cpp,v retrieving revision 1.2 diff -r1.2 sparse-vector-node.cpp 41a42,45 > > char* sparseVectorNode::nodeSignature(){ > return "sparseVectorNode"; > } Index: src/sparse-vector-node.hpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/sparse-vector-node.hpp,v retrieving revision 1.2 diff -r1.2 sparse-vector-node.hpp 47a48 > char *nodeSignature(); Index: src/star.cpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/star.cpp,v retrieving revision 1.4 diff -r1.4 star.cpp 49a50,71 > // Constructors > > star::star():orbitPlace(){ > orbits= new orbitPlane(); > this->generateStarInfo(); > closeCompanionPresent=0; > } > > star::star(star* s) : orbitPlace() { > orbits=new orbitPlane(); > this->generateStarInfo(s); > closeCompanionPresent=0; > > } > > // Special cases.... don't upset us... > > int star::hasCloseCompanion() { > return closeCompanionPresent; > } > > 342c364 < else return return 11; --- > else return 11; 561c583 < gas_giants = ( gas_giants > max_orbits ? max_orbits ? gas_giants); --- > gas_giants = ( gas_giants > max_orbits ? max_orbits : gas_giants); 579a602,771 > void star::generateStarInfo(star* s){ > size_roll = s->size_roll + d2d6(); > type_roll = s->type_roll + d2d6(); > int dm; > > size = primarySizeLookup(size_roll); > type = primaryTypeLookup(type_roll); > > spectral = ( d1d6() > 3 ? 5 : 0 ); > min_orbit_number = this->calculateMinOrbit(); > habitable_orbit = this->calculateHabitableOrbit(); > > // Calculate a DM based on star size. > dm = ( size == STAR_SIZE_III ? 4 : > ( ((STAR_SIZE_Ia <= size ) && ( size <= STAR_SIZE_II)) ? > 8:0 ) ); > // Add to or subtract from that DM based on type. > dm = dm + ( type == STAR_TYPE_M ? -4 : > ( type == STAR_TYPE_K ? -2 : 0 ) ); > max_orbits = d2d6() + dm; > // Eliminate negative values if present. > max_orbits = ( max_orbits >= 0 ? max_orbits : 0 ); > > // Determine if gas giants are present and how many > if ( d2d6() < 10 ) { > int roll = d2d6(); > gas_giants = > ( roll < 4 ? 1 : > ( (( roll == 4) || (roll == 5 )) ? 2 : > ( ( roll == 6) || (roll == 7) ? 3 : 4 ) ) ); > > > } else { > gas_giants=0; > } > > gas_giants = ( gas_giants > max_orbits ? max_orbits : gas_giants); > > // Determine if planetoid belts are present and how many > > dm = gas_giants; > > if ( (d2d6() + dm ) > 6 ) { > planetoid = 0; > } else { > int roll= d2d6() + roll; > planetoid = ( roll > 6 ? 1 : 2 ) ; > } > > planetoid = ( (gas_giants + planetoid) > max_orbits? (max_orbits-gas_giants) : > planetoid); > > > > } > > void star::placeCompanion(star* s,int x){ > int dm = ( x == 3 ? 4:0); > int dist; > > switch (d2d6()+dm){ > case 0: > case 1: > case 2: > case 3: > closeCompanionPresent=1; > closeCompanion=s; > break; > case 4: > if ( min_orbit_number > 1 ) { > closeCompanionPresent=1; > closeCompanion=s; > } else { > orbits->addAt(1,s); > min_orbit_number = 2; > } > break; > case 5: > if ( min_orbit_number > 2 ) { > closeCompanionPresent=1; > closeCompanion=s; > } else { > orbits->addAt(2,s); > min_orbit_number=3; > } > break; > case 6: > if ( min_orbit_number > 3 ) { > closeCompanionPresent=1; > closeCompanion=s; > } else { > orbits->addAt(3,s); > min_orbit_number=4; > } > break; > case 7: > dist = 4 + d1d6(); > if ( min_orbit_number > dist ) { > closeCompanionPresent=1; > closeCompanion=s; > } else { > orbits->addAt(dist,s); > } > break; > case 8: > dist= 5 + d1d6(); > if ( min_orbit_number > dist ) { > closeCompanionPresent=1; > closeCompanion=s; > } else { > orbits->addAt(dist,s); > } > break; > case 9: > dist = 6 + d1d6(); > if ( min_orbit_number > dist ) { > closeCompanionPresent=1; > closeCompanion=s; > } else { > orbits->addAt(dist,s); > } > break; > case 10: > dist = 7 + d1d6(); > if ( min_orbit_number > dist ) { > closeCompanionPresent=1; > closeCompanion=s; > } else { > orbits->addAt(dist,s); > } > break; > case 11: > dist = 8+ d1d6(); > if ( min_orbit_number > dist ) { > closeCompanionPresent=1; > closeCompanion=s; > } else { > orbits->addAt(dist,s); > } > break; > default: > dist = 20+d2d6(); > orbits->addAt(dist,s); > break; > }; > > // Let's prevent some cosmological imposibilities... > // > if ( closeCompanionPresent == 1 ) { > closeCompanion->habitable_orbit=-1; // Take away the habitable orbit if it existed. > closeCompanion->gas_giants=0; > closeCompanion->planetoid=0; > closeCompanion->max_orbits=0; > } > > > } > > orbitPlane* star::getOrbits(){ > return orbits; > } > > void star::setOrbits(orbitPlane* op){ > orbits= op; > } > > > char* star::nodeSignature(){ > return "star"; > } Index: src/star.hpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/star.hpp,v retrieving revision 1.5 diff -r1.5 star.hpp 24a25,27 > #include "orbit-place.hpp" > #include "orbit-plane.hpp" > 27c30 < #include "orbit-place.hpp" --- > 54,56c57 < star():orbitPlace(){ < this->generateStarInfo(); < }; --- > star(); 63,65c64,65 < star(star* s) : orbitPlace() { < this->generateStarInfo(); < }; --- > star(star* s); > 97a98,110 > void setGasGiants(int g) { gas_giants=g;}; > int getGasGiants(){ return gas_giants; }; > > void setPlanetoid(int p) { planetoid=p; }; > int getPlanetoid(){ return planetoid; }; > > void placeCompanion(star*,int); > int hasCloseCompanion(); > > void setOrbits(orbitPlane*); > orbitPlane* getOrbits(); > > char* nodeSignature(); 111a125,127 > int closeCompanionPresent; > star *closeCompanion; > 114a131 > orbitPlane* orbits; ---------- Index: src/dice.cxx =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/dice.cxx,v retrieving revision 1.2 diff -r1.2 dice.cxx 28,29c28,31 < < return retval; --- > if ( (1 <= retval) && ( retval <= 6)) > return retval; > else > return d1d6(); 36a39,51 > int randxInRange(int min,int max){ > if ( randomized == 0 ) { > randomize(); > randomized=1; > } > int retval = ((int) drand48() * (double)max) + min; > > if ( ( min <= retval ) && ( retval <= max) ) > return retval; > else return randxInRange(min,max); > > } > Index: src/dice.hpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/dice.hpp,v retrieving revision 1.2 diff -r1.2 dice.hpp 29a30 > int randxInRange(int,int); // random number within a range.... Index: src/star.cpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/star.cpp,v retrieving revision 1.3 diff -r1.3 star.cpp 323a324,456 > int star::calculateHabitableOrbit(){ > switch (size){ > case STAR_SIZE_Ia: > switch (type){ > case STAR_TYPE_O: > > case STAR_TYPE_B: > if ( spectral == 0 ) return 13; > else return 12; > break; > case STAR_TYPE_A: > return 12; > case STAR_TYPE_F: > if ( spectral == 0 ) return 12; > else return return 11; > case STAR_TYPE_G: > case STAR_TYPE_K: > case STAR_TYPE_M: > return 12; > }; > > case STAR_SIZE_Ib: > switch (type){ > case STAR_TYPE_O: > > case STAR_TYPE_B: > if ( spectral == 0 ) return 13; > else return 11; > case STAR_TYPE_A: > if ( spectral == 0 ) return 11; > else return 10; > case STAR_TYPE_F: > case STAR_TYPE_G: > return 10; > case STAR_TYPE_K: > return ( spectral == 0 ? 10:11); > case STAR_TYPE_M: > return ( spectral == 0 ? 11: 12); > }; > case STAR_SIZE_II: > switch (type){ > case STAR_TYPE_O: > case STAR_TYPE_B: > return ( spectral == 0 ? 8: 6); > case STAR_TYPE_A: > return 5; > case STAR_TYPE_F: > return 4; > case STAR_TYPE_G: > return ( spectral == 0 ? 4 : 5 ); > case STAR_TYPE_K: > return ( spectral == 0 ? 5 : 6 ); > case STAR_TYPE_M: > return ( spectral == 0 ? 6 : 7 ); > }; > case STAR_SIZE_III: > switch (type){ > case STAR_TYPE_O: > case STAR_TYPE_B: > return (spectral == 0 ? 12 : 10 ); > case STAR_TYPE_A: > return (spectral == 0 ? 8 : 7 ) ; > case STAR_TYPE_F: > return 6; > case STAR_TYPE_G: > return ( spectral == 0 ? 6 : 7 ); > case STAR_TYPE_K: > return ( spectral == 0 ? 7 : 8 ); > case STAR_TYPE_M: > return ( spectral == 0 ? 8 : 9 ); > }; > case STAR_SIZE_IV: > switch (type){ > case STAR_TYPE_O: > case STAR_TYPE_B: > return ( spectral == 0 ? 12: 9 ) ; > case STAR_TYPE_A: > return ( spectral == 0 ? 7 : 6); > case STAR_TYPE_F: > return ( spectral == 0 ? 6 : 5); > case STAR_TYPE_G: > return 5; > case STAR_TYPE_K: > case STAR_TYPE_M: > return 4; > }; > case STAR_SIZE_V: > switch (type){ > case STAR_TYPE_O: > case STAR_TYPE_B: > return ( spectral == 0 ? 12 : 9 ); > case STAR_TYPE_A: > return ( spectral == 0 ? 7 : 6 ); > case STAR_TYPE_F: > return ( spectral == 0 ? 5 : 4 ); > case STAR_TYPE_G: > return ( spectral == 0 ? 3 : 2 ); > case STAR_TYPE_K: > return 1; > case STAR_TYPE_M: > return -1; // NO habitable zone... > }; > case STAR_SIZE_VI: > switch (type){ > case STAR_TYPE_O: > case STAR_TYPE_B: > case STAR_TYPE_A: > case STAR_TYPE_F: > return 3; > case STAR_TYPE_G: > return ( spectral == 0 ? 2 : 1 ); > case STAR_TYPE_K: > return ( spectral == 0 ? 0 : -1 ); > case STAR_TYPE_M: > return -1; > }; > case STAR_SIZE_D: > switch (type){ > case STAR_TYPE_O: > case STAR_TYPE_B: > return 0; > case STAR_TYPE_A: > case STAR_TYPE_F: > case STAR_TYPE_G: > case STAR_TYPE_K: > case STAR_TYPE_M: > return -1; > }; > }; > > } > > 389a523 > int dm; 396a531,572 > habitable_orbit = this->calculateHabitableOrbit(); > > // Calculate a DM based on star size. > dm = ( size == STAR_SIZE_III ? 4 : > ( ((STAR_SIZE_Ia <= size ) && ( size <= STAR_SIZE_II)) ? > 8:0 ) ); > // Add to or subtract from that DM based on type. > dm = dm + ( type == STAR_TYPE_M ? -4 : > ( type == STAR_TYPE_K ? -2 : 0 ) ); > max_orbits = d2d6() + dm; > // Eliminate negative values if present. > max_orbits = ( max_orbits >= 0 ? max_orbits : 0 ); > > // Determine if gas giants are present and how many > if ( d2d6() < 10 ) { > int roll = d2d6(); > gas_giants = > ( roll < 4 ? 1 : > ( (( roll == 4) || (roll == 5 )) ? 2 : > ( ( roll == 6) || (roll == 7) ? 3 : 4 ) ) ); > > > } else { > gas_giants=0; > } > > gas_giants = ( gas_giants > max_orbits ? max_orbits ? gas_giants); > > // Determine if planetoid belts are present and how many > > dm = gas_giants; > > if ( (d2d6() + dm ) > 6 ) { > planetoid = 0; > } else { > int roll= d2d6() + roll; > planetoid = ( roll > 6 ? 1 : 2 ) ; > } > > planetoid = ( (gas_giants + planetoid) > max_orbits? (max_orbits-gas_giants) : > planetoid); > Index: src/star.hpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/star.hpp,v retrieving revision 1.4 diff -r1.4 star.hpp 106a107,108 > int gas_giants; > int planetoid;
$Id: ChangeLog,v 1.4 2008/02/01 21:05:53 plankowner Exp $ $Log: ChangeLog,v $ Revision 1.4 2008/02/01 21:05:53 plankowner Did some more hacking on the star attribute generation. Primary stars are finished at this point. Next increment will be companion stars. Revision 1.3 2008/01/29 19:38:35 plankowner attempting to coorce automake into setting up installations such that they do not include the test programs. Revision 1.2 2008/01/29 17:56:43 plankowner Updated some documentation files -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 2008-02-01 16:03 Changes Index: src/dice.cxx =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/dice.cxx,v retrieving revision 1.2 diff -r1.2 dice.cxx 28,29c28,31 < < return retval; --- > if ( (1 <= retval) && ( retval <= 6)) > return retval; > else > return d1d6(); 36a39,51 > int randxInRange(int min,int max){ > if ( randomized == 0 ) { > randomize(); > randomized=1; > } > int retval = ((int) drand48() * (double)max) + min; > > if ( ( min <= retval ) && ( retval <= max) ) > return retval; > else return randxInRange(min,max); > > } > Index: src/dice.hpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/dice.hpp,v retrieving revision 1.2 diff -r1.2 dice.hpp 29a30 > int randxInRange(int,int); // random number within a range.... Index: src/star.cpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/star.cpp,v retrieving revision 1.3 diff -r1.3 star.cpp 323a324,456 > int star::calculateHabitableOrbit(){ > switch (size){ > case STAR_SIZE_Ia: > switch (type){ > case STAR_TYPE_O: > > case STAR_TYPE_B: > if ( spectral == 0 ) return 13; > else return 12; > break; > case STAR_TYPE_A: > return 12; > case STAR_TYPE_F: > if ( spectral == 0 ) return 12; > else return return 11; > case STAR_TYPE_G: > case STAR_TYPE_K: > case STAR_TYPE_M: > return 12; > }; > > case STAR_SIZE_Ib: > switch (type){ > case STAR_TYPE_O: > > case STAR_TYPE_B: > if ( spectral == 0 ) return 13; > else return 11; > case STAR_TYPE_A: > if ( spectral == 0 ) return 11; > else return 10; > case STAR_TYPE_F: > case STAR_TYPE_G: > return 10; > case STAR_TYPE_K: > return ( spectral == 0 ? 10:11); > case STAR_TYPE_M: > return ( spectral == 0 ? 11: 12); > }; > case STAR_SIZE_II: > switch (type){ > case STAR_TYPE_O: > case STAR_TYPE_B: > return ( spectral == 0 ? 8: 6); > case STAR_TYPE_A: > return 5; > case STAR_TYPE_F: > return 4; > case STAR_TYPE_G: > return ( spectral == 0 ? 4 : 5 ); > case STAR_TYPE_K: > return ( spectral == 0 ? 5 : 6 ); > case STAR_TYPE_M: > return ( spectral == 0 ? 6 : 7 ); > }; > case STAR_SIZE_III: > switch (type){ > case STAR_TYPE_O: > case STAR_TYPE_B: > return (spectral == 0 ? 12 : 10 ); > case STAR_TYPE_A: > return (spectral == 0 ? 8 : 7 ) ; > case STAR_TYPE_F: > return 6; > case STAR_TYPE_G: > return ( spectral == 0 ? 6 : 7 ); > case STAR_TYPE_K: > return ( spectral == 0 ? 7 : 8 ); > case STAR_TYPE_M: > return ( spectral == 0 ? 8 : 9 ); > }; > case STAR_SIZE_IV: > switch (type){ > case STAR_TYPE_O: > case STAR_TYPE_B: > return ( spectral == 0 ? 12: 9 ) ; > case STAR_TYPE_A: > return ( spectral == 0 ? 7 : 6); > case STAR_TYPE_F: > return ( spectral == 0 ? 6 : 5); > case STAR_TYPE_G: > return 5; > case STAR_TYPE_K: > case STAR_TYPE_M: > return 4; > }; > case STAR_SIZE_V: > switch (type){ > case STAR_TYPE_O: > case STAR_TYPE_B: > return ( spectral == 0 ? 12 : 9 ); > case STAR_TYPE_A: > return ( spectral == 0 ? 7 : 6 ); > case STAR_TYPE_F: > return ( spectral == 0 ? 5 : 4 ); > case STAR_TYPE_G: > return ( spectral == 0 ? 3 : 2 ); > case STAR_TYPE_K: > return 1; > case STAR_TYPE_M: > return -1; // NO habitable zone... > }; > case STAR_SIZE_VI: > switch (type){ > case STAR_TYPE_O: > case STAR_TYPE_B: > case STAR_TYPE_A: > case STAR_TYPE_F: > return 3; > case STAR_TYPE_G: > return ( spectral == 0 ? 2 : 1 ); > case STAR_TYPE_K: > return ( spectral == 0 ? 0 : -1 ); > case STAR_TYPE_M: > return -1; > }; > case STAR_SIZE_D: > switch (type){ > case STAR_TYPE_O: > case STAR_TYPE_B: > return 0; > case STAR_TYPE_A: > case STAR_TYPE_F: > case STAR_TYPE_G: > case STAR_TYPE_K: > case STAR_TYPE_M: > return -1; > }; > }; > > } > > 389a523 > int dm; 396a531,572 > habitable_orbit = this->calculateHabitableOrbit(); > > // Calculate a DM based on star size. > dm = ( size == STAR_SIZE_III ? 4 : > ( ((STAR_SIZE_Ia <= size ) && ( size <= STAR_SIZE_II)) ? > 8:0 ) ); > // Add to or subtract from that DM based on type. > dm = dm + ( type == STAR_TYPE_M ? -4 : > ( type == STAR_TYPE_K ? -2 : 0 ) ); > max_orbits = d2d6() + dm; > // Eliminate negative values if present. > max_orbits = ( max_orbits >= 0 ? max_orbits : 0 ); > > // Determine if gas giants are present and how many > if ( d2d6() < 10 ) { > int roll = d2d6(); > gas_giants = > ( roll < 4 ? 1 : > ( (( roll == 4) || (roll == 5 )) ? 2 : > ( ( roll == 6) || (roll == 7) ? 3 : 4 ) ) ); > > > } else { > gas_giants=0; > } > > gas_giants = ( gas_giants > max_orbits ? max_orbits ? gas_giants); > > // Determine if planetoid belts are present and how many > > dm = gas_giants; > > if ( (d2d6() + dm ) > 6 ) { > planetoid = 0; > } else { > int roll= d2d6() + roll; > planetoid = ( roll > 6 ? 1 : 2 ) ; > } > > planetoid = ( (gas_giants + planetoid) > max_orbits? (max_orbits-gas_giants) : > planetoid); > Index: src/star.hpp =================================================================== RCS file: /cvsroot/frpuniverse/frpuniverse/src/star.hpp,v retrieving revision 1.4 diff -r1.4 star.hpp 106a107,108 > int gas_giants; > int planetoid;
$Id: ChangeLog,v 1.3 2008/01/29 19:38:35 plankowner Exp $ $Log: ChangeLog,v $ Revision 1.3 2008/01/29 19:38:35 plankowner attempting to coorce automake into setting up installations such that they do not include the test programs. Revision 1.2 2008/01/29 17:56:43 plankowner Updated some documentation files Bug reports: Enhancements: Stuff to deal with: Installs should not include the test programs. Automake needs to be cooerced.
Be the first person to add a text review.
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use
Thanks for your rating!
Would you also like to write a review?
Thanks for your review!
Get credit for your review by logging in via OpenID. Click your account provider: