本文整理汇总了C#中Dice.gurpsRoll方法的典型用法代码示例。如果您正苦于以下问题:C# Dice.gurpsRoll方法的具体用法?C# Dice.gurpsRoll怎么用?C# Dice.gurpsRoll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dice
的用法示例。
在下文中一共展示了Dice.gurpsRoll方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: calcEccentricity
public static void calcEccentricity(Dice ourDice, Star s)
{
int modifiers = 0; //reset the thing.
if (OptionCont.lessStellarEccent)
{
//now we generate eccentricities
if (s.orbitalSep == Star.ORBSEP_VERYCLOSE) modifiers = modifiers - 10; //Very Close
if (s.orbitalSep == Star.ORBSEP_CLOSE) modifiers = modifiers - 6; //Close
if (s.orbitalSep == Star.ORBSEP_MODERATE) modifiers = modifiers - 2; //Moderate
}
else
{
if (s.orbitalSep == Star.ORBSEP_VERYCLOSE) modifiers = modifiers - 6; //Very Close
if (s.orbitalSep == Star.ORBSEP_CLOSE) modifiers = modifiers - 4; //Close
if (s.orbitalSep == Star.ORBSEP_MODERATE) modifiers = modifiers - 2; //Moderate
}
int roll = ourDice.gurpsRoll(modifiers);
Star.generateEccentricity(roll, s);
if (OptionCont.forceVeryLowStellarEccent)
{
if (s.orbitalEccent > .2) s.orbitalEccent = .1;
if (s.orbitalEccent > .1 && s.orbitalEccent < .2) s.orbitalEccent = .05;
}
}
示例2: populateOrbits
/// <summary>
/// Populates orbits around a star, according to GURPS 4e rules. (Does not create them)
/// </summary>
/// <param name="s">The star we're populating around</param>
/// <param name="myDice">Our dice object.</param>
public static void populateOrbits(Star s, Dice myDice)
{
double maxRatio = 2.0;
double minRatio = 1.4;
double minDistance = .15;
bool firstGasGiant = true;
if (s.containsGasGiants()) firstGasGiant = false;
for (int i = 0; i < s.sysPlanets.Count; i++)
{
int roll = myDice.gurpsRoll();
//set gas giants first.
if (s.gasGiantFlag != Star.GASGIANT_NONE)
{
//BEFORE SNOW LINE: Only Eccentric, Epistellar
if (s.sysPlanets[i].orbitalRadius < Star.snowLine(s.initLumin))
{
if (roll <= 8 && s.gasGiantFlag == Star.GASGIANT_ECCENTRIC)
{
s.sysPlanets[i].updateType(Satellite.BASETYPE_GASGIANT);
libStarGen.updateGasGiantSize(s.sysPlanets[i],myDice.gurpsRoll() + 4);
}
if (roll <= 6 && s.gasGiantFlag == Star.GASGIANT_EPISTELLAR)
{
s.sysPlanets[i].updateType(Satellite.BASETYPE_GASGIANT);
libStarGen.updateGasGiantSize(s.sysPlanets[i], myDice.gurpsRoll() + 4);
}
}
//AFTER SNOW LINE: All three
if (s.sysPlanets[i].orbitalRadius >= Star.snowLine(s.initLumin))
{
if (roll <= 15 && s.gasGiantFlag == Star.GASGIANT_CONVENTIONAL)
{
s.sysPlanets[i].updateType(Satellite.BASETYPE_GASGIANT);
if (firstGasGiant)
{
libStarGen.updateGasGiantSize(s.sysPlanets[i], myDice.gurpsRoll() + 4);
firstGasGiant = false;
}
else
libStarGen.updateGasGiantSize(s.sysPlanets[i], myDice.gurpsRoll());
}
if (roll <= 14 && (s.gasGiantFlag == Star.GASGIANT_ECCENTRIC || s.gasGiantFlag == Star.GASGIANT_EPISTELLAR))
{
s.sysPlanets[i].updateType(Satellite.BASETYPE_GASGIANT);
if (firstGasGiant)
{
libStarGen.updateGasGiantSize(s.sysPlanets[i], myDice.gurpsRoll() + 4);
firstGasGiant = false;
}
else
libStarGen.updateGasGiantSize(s.sysPlanets[i], myDice.gurpsRoll());
}
}
}
//Done with the gas giant. Let's go start seeign what else it could be.
//We can get mods now.
if (s.sysPlanets[i].baseType != Satellite.BASETYPE_GASGIANT)
{
//INNER AND OUTER RADIUS
int mod = 0;
if (s.sysPlanets[i].orbitalRadius - minDistance <= Star.innerRadius(s.initLumin,s.initMass) ||
s.sysPlanets[i].orbitalRadius / Star.innerRadius(s.initLumin, s.initMass) <= maxRatio)
{
mod = mod - 3;
}
if (s.sysPlanets[i].orbitalRadius + minDistance >= Star.outerRadius(s.initMass) ||
Star.outerRadius(s.initMass) / s.sysPlanets[i].orbitalRadius <= maxRatio)
{
mod = mod - 3;
}
//FORBIDDDEN ZONE
if (s.getClosestDistToForbiddenZone(s.sysPlanets[i].orbitalRadius) <= minDistance || (s.getClosestForbiddenZoneRatio(s.sysPlanets[i].orbitalRadius) < maxRatio && s.getClosestForbiddenZoneRatio(s.sysPlanets[i].orbitalRadius) > minRatio))
{
//MessageBox.Show("THE FORBIDDEN ZONE!!!!");
mod = mod - 6;
}
//GAS GIANT LOCATION
if (s.isPrevSatelliteGasGiant(s.sysPlanets[i].orbitalRadius))
{
mod = mod - 6;
}
if (s.isNextSatelliteGasGiant(s.sysPlanets[i].orbitalRadius))
//.........这里部分代码省略.........
示例3: placeOurStars
/// <summary>
/// This places our stars around the primary, as well as creating the secondary stars if called for
/// </summary>
/// <param name="ourSystem">The star system to be added to.</param>
/// <param name="velvetBag">Our dice object.</param>
public static void placeOurStars(StarSystem ourSystem, Dice velvetBag)
{
int roll = 0;
//initiate the variables we need to ensure distances are kept
double minOrbitalDistance = 0.0, maxOrbitalDistance = 600.0, tempVal = 0.0;
int starLimit = ourSystem.sysStars.Count;
for (int i = 1; i < starLimit; i++)
{
int modifiers = 0;
minOrbitalDistance = ourSystem.sysStars[i - 1].orbitalRadius;
//set the min and max conditions for the first star here.
if (ourSystem.sysStars[i].parentID == 0 || ourSystem.sysStars[i].parentID == Star.IS_PRIMARY)
{
//apply modifiers
if (ourSystem.sysStars[i].selfID == Star.IS_TRINARY) modifiers = modifiers + 6;
if (OptionCont.forceGardenFavorable && ourSystem.sysStars[i].parentID == Star.IS_PRIMARY) modifiers = modifiers + 4;
if (minOrbitalDistance == 600.0)
{
//in this situation, orbital 3 or so can't be safely placed because the range is 0.
// so we autogenerate it.
tempVal = velvetBag.rollRange(25, 25);
ourSystem.sysStars[i].orbitalSep = 5;
ourSystem.sysStars[ourSystem.star2index].orbitalRadius = ourSystem.sysStars[ourSystem.star2index].orbitalRadius - tempVal;
ourSystem.sysStars[i].orbitalRadius = 600 + tempVal;
ourSystem.sysStars[i].distFromPrimary = ourSystem.sysStars[i].orbitalRadius;
minOrbitalDistance = ourSystem.sysStars[i].orbitalRadius;
}
else
{
do
{
double lowerBound = 0.0;
double higherBound = 0.0;
//roll the dice and generate the orbital radius
do
{
roll = velvetBag.gurpsRoll(modifiers);
if (roll <= 6) ourSystem.sysStars[i].orbitalSep = Star.ORBSEP_VERYCLOSE;
if (roll >= 7 && roll <= 9) ourSystem.sysStars[i].orbitalSep = Star.ORBSEP_CLOSE;
if (roll >= 10 && roll <= 11) ourSystem.sysStars[i].orbitalSep = Star.ORBSEP_MODERATE;
if (roll >= 12 && roll <= 14) ourSystem.sysStars[i].orbitalSep = Star.ORBSEP_WIDE;
if (roll >= 15) ourSystem.sysStars[i].orbitalSep = Star.ORBSEP_DISTANT;
tempVal = velvetBag.rng(2, 6) * libStarGen.getSepModifier(ourSystem.sysStars[i].orbitalSep);
} while (tempVal <= minOrbitalDistance);
//if (ourSystem.sysStars[i].selfID == 2) tempVal = this.velvetBag.six(1, 7) * ourSystem.sysStars[i].getSepModifier();
lowerBound = tempVal - .5 * libStarGen.getSepModifier(ourSystem.sysStars[i].orbitalSep);
higherBound = .5 * libStarGen.getSepModifier(ourSystem.sysStars[i].orbitalSep) + tempVal;
//set for constraints
if (lowerBound < minOrbitalDistance) lowerBound = minOrbitalDistance;
if (higherBound > maxOrbitalDistance) higherBound = maxOrbitalDistance;
ourSystem.sysStars[i].orbitalRadius = tempVal;
ourSystem.sysStars[i].distFromPrimary = ourSystem.sysStars[i].orbitalRadius;
} while (ourSystem.sysStars[i].orbitalRadius <= minOrbitalDistance);
//let's see if it has a subcompanion
if (ourSystem.sysStars[i].orbitalSep == Star.ORBSEP_DISTANT)
{
roll = velvetBag.gurpsRoll();
if (roll >= 11)
{
//generate the subcompanion
int order = 0;
if (ourSystem.sysStars[i].selfID == Star.IS_SECONDARY) order = Star.IS_SECCOMP;
if (ourSystem.sysStars[i].selfID == Star.IS_TRINARY) order = Star.IS_TRICOMP;
//add the star
ourSystem.addStar(order, ourSystem.sysStars[i].selfID, (i + 1));
ourSystem.sysStars[starLimit].name = Star.genGenericName(ourSystem.sysName, (i + 1));
//set the name, then generate the star
ourSystem.sysStars[starLimit].parentName = ourSystem.sysStars[i].name;
libStarGen.generateAStar(ourSystem.sysStars[starLimit], velvetBag, ourSystem.sysStars[i].currMass, ourSystem.sysName);
starLimit++; //increment the total number of stars we have generated
}
}
}
}
else
{
minOrbitalDistance = 0;
maxOrbitalDistance = ourSystem.sysStars[ourSystem.getStellarParentID(ourSystem.sysStars[i].parentID)].orbitalRadius;
//roll for seperation
do
{
//.........这里部分代码省略.........
示例4: getOrbitalRatio
/// <summary>
/// deteremine the orbital ratio between planets
/// </summary>
/// <param name="myDice">Dice object</param>
/// <returns>The orbital ratio between planets</returns>
public static double getOrbitalRatio(Dice myDice)
{
double ratio = 0;
int roll = myDice.gurpsRoll();
if (roll == 3 || roll == 4)
{
ratio = 1.4 + (myDice.rng(1, 5) * .01);
}
if (roll == 5 || roll == 6)
{
ratio = 1.5 + (myDice.rng(1, 10, -5) * .01);
}
if (roll == 7 || roll == 8)
{
ratio = 1.6 + (myDice.rng(1, 10, -5) * .01);
}
if (roll == 9 || roll == 10 || roll == 11 || roll == 12)
{
ratio = 1.7 + (myDice.rng(1, 10, -5) * .01);
}
if (roll == 13 || roll == 14)
{
ratio = 1.8 + (myDice.rng(1, 10, -5) * .01);
}
if (roll == 15 || roll == 16)
{
ratio = 1.9 + (myDice.rng(1, 10, -5) * .01);
}
if (roll == 17 || roll == 18)
{
ratio = 2.0 + (myDice.rng(1, 10, -5) * .01);
}
return ratio;
}
示例5: genSystemAge
/// <summary>
/// This function generates a random age per GURPS Space 4e rules.
/// </summary>
/// <param name="ourDice">The dice this rolls</param>
/// <returns>The system age</returns>
public static double genSystemAge(Dice ourDice)
{
//get first roll
int roll;
roll = ourDice.gurpsRoll();
if (OptionCont.getSystemAge() != -1)
return OptionCont.getSystemAge();
if (roll == 3)
return 0.01;
if (roll >= 4 && roll <= 6)
return (.1 + (ourDice.rng(1, 6, -1) * .3) + (ourDice.rng(1, 6, -1) * .05));
if (roll >= 7 && roll <= 10)
return (2 + (ourDice.rng(1, 6, -1) * .6) + (ourDice.rng(1, 6, -1) * .1));
if (roll >= 11 && roll <= 14)
return (5.6 + (ourDice.rng(1, 6, -1) * .6) + (ourDice.rng(1, 6, -1) * .1));
if (roll >= 15 && roll <= 17)
return (8 + (ourDice.rng(1, 6, -1) * .6) + (ourDice.rng(1, 6, -1) * .1));
if (roll == 18)
return (10 + (ourDice.rng(1, 6, -1) * .6) + (ourDice.rng(1, 6, -1) * .1));
return 13.8;
}
示例6: determineGeologicValues
/// <summary>
/// Determines RVM, and geologic values for a satelite
/// </summary>
/// <param name="s">The satelite</param>
/// <param name="ourBag">Dice object</param>
/// <param name="sysAge">System Age</param>
/// <param name="isGasGiantMoon">Is this a moon of a gas giant?</param>
public static void determineGeologicValues(Satellite s, Dice ourBag, double sysAge, bool isGasGiantMoon)
{
//volcanic set first.
double addVal = (s.gravity / sysAge) * 40;
if (s.majorMoons.Count == 1) addVal = addVal + 5;
if (s.majorMoons.Count == 2) addVal = addVal + 10;
if (s.SatelliteType == Satellite.SUBTYPE_SULFUR) addVal = addVal + 60;
if (isGasGiantMoon) addVal = addVal + 5;
int roll = ourBag.gurpsRoll();
addVal = addVal + roll;
if (addVal <= 16.5) s.volActivity = Satellite.GEOLOGIC_NONE;
if (addVal > 16.5 && addVal <= 20.5) s.volActivity = Satellite.GEOLOGIC_LIGHT;
if (addVal > 20.5 && addVal <= 26.5) s.volActivity = Satellite.GEOLOGIC_MODERATE;
if (addVal > 26.5 && addVal <= 70.5) s.volActivity = Satellite.GEOLOGIC_HEAVY;
if (addVal > 70.5) s.volActivity = Satellite.GEOLOGIC_EXTREME;
roll = ourBag.gurpsRoll();
if (s.volActivity == Satellite.GEOLOGIC_HEAVY && s.SatelliteType == Satellite.SUBTYPE_GARDEN && roll <= 8)
{
roll = ourBag.rng(6);
if (roll <= 3) s.addAtmCategory(Satellite.ATM_MARG_POLLUTANTS);
if (roll >= 4) s.addAtmCategory(Satellite.ATM_MARG_SULFUR);
}
roll = ourBag.gurpsRoll();
if (s.volActivity == Satellite.GEOLOGIC_EXTREME && s.SatelliteType == Satellite.SUBTYPE_GARDEN && roll <= 14)
{
roll = ourBag.rng(6);
if (roll <= 3) s.addAtmCategory(Satellite.ATM_MARG_POLLUTANTS);
if (roll >= 4) s.addAtmCategory(Satellite.ATM_MARG_SULFUR);
}
//tectonic next
roll = ourBag.gurpsRoll();
//negative mods
if (s.hydCoverage == 0) roll = roll - 4;
if (s.hydCoverage > 0 && s.hydCoverage < .5) roll = roll - 2;
if (s.volActivity == Satellite.GEOLOGIC_NONE) roll = roll - 8;
if (s.volActivity == Satellite.GEOLOGIC_LIGHT) roll = roll - 4;
//postive mods
if (s.volActivity == Satellite.GEOLOGIC_HEAVY) roll = roll + 4;
if (s.volActivity == Satellite.GEOLOGIC_EXTREME) roll = roll + 8;
if (s.majorMoons.Count == 1) roll = roll + 2;
if (s.majorMoons.Count > 1) roll = roll + 4;
//nullers.
if (s.SatelliteSize == Satellite.SIZE_TINY) roll = 0;
if (s.SatelliteSize == Satellite.SIZE_SMALL) roll = 0;
if (roll <= 6.5) s.tecActivity = Satellite.GEOLOGIC_NONE;
if (roll > 6.5 && roll <= 10.5) s.tecActivity = Satellite.GEOLOGIC_LIGHT;
if (roll > 10.5 && roll <= 14.5) s.tecActivity = Satellite.GEOLOGIC_MODERATE;
if (roll > 14.5 && roll <= 18.5) s.tecActivity = Satellite.GEOLOGIC_HEAVY;
if (roll > 18.5) s.tecActivity = Satellite.GEOLOGIC_EXTREME;
//update RVM
if (!OptionCont.highRVMVal) roll = ourBag.gurpsRoll();
if (OptionCont.highRVMVal) roll = ourBag.rng(1, 6, 10);
if (s.volActivity == Satellite.GEOLOGIC_NONE) roll = roll - 2;
if (s.volActivity == Satellite.GEOLOGIC_LIGHT) roll = roll - 1;
if (s.volActivity == Satellite.GEOLOGIC_HEAVY) roll = roll + 1;
if (s.volActivity == Satellite.GEOLOGIC_EXTREME) roll = roll + 2;
if (s.baseType == Satellite.BASETYPE_ASTEROIDBELT)
{
if (s.SatelliteSize == Satellite.SIZE_TINY) roll = roll - 1;
if (s.SatelliteSize == Satellite.SIZE_MEDIUM) roll = roll + 2;
if (s.SatelliteSize == Satellite.SIZE_LARGE) roll = roll + 4;
}
//set stable activity here:
if (OptionCont.stableActivity && s.SatelliteSize >= Satellite.SIZE_SMALL &&
(s.baseType == Satellite.BASETYPE_MOON || s.baseType == Satellite.BASETYPE_TERRESTIAL))
{
s.volActivity = Satellite.GEOLOGIC_MODERATE;
s.tecActivity = Satellite.GEOLOGIC_MODERATE;
}
s.populateRVM(roll);
}
示例7: createStars
/// <summary>
/// This function generates and populates our stars.
/// </summary>
/// <param name="ourBag">The Dice object used for our PRNG</param>
/// <param name="ourSystem">The solar system we are creating stars for</param>
public static void createStars(Dice ourBag, StarSystem ourSystem)
{
int numStars = 0;
//determine the number of stars
if (OptionCont.getNumberOfStars() != -1)
{
numStars = OptionCont.getNumberOfStars();
}
else
{
// We take the roll, add 2 if it's in an open cluster,subtract 1 if not, then divide it by 5.
// This matches the roll probablity to the table.
numStars = (int)(Math.Floor((ourBag.gurpsRoll() + (OptionCont.inOpenCluster ? 2 : -1)) / 5.0));
//fix a few possible logic bugs.
if (numStars < 1) numStars = 1;
if (numStars > 3) numStars = 3;
}
//creating the stars.
for (int i = 0; i < numStars; i++)
{
if (i == 0)
{
ourSystem.addStar(Star.IS_PRIMARY, Star.IS_PRIMARY, i);
//manually set the first star's mass and push it to the max mass setting
ourSystem.sysStars[0].updateMass(libStarGen.rollStellarMass(ourBag, Star.IS_PRIMARY));
ourSystem.maxMass = ourSystem.sysStars[0].currMass;
//generate the star
libStarGen.generateAStar(ourSystem.sysStars[i], ourBag, ourSystem.maxMass, ourSystem.sysName);
}
if (i == 1)
{
ourSystem.addStar(Star.IS_SECONDARY, Star.IS_PRIMARY, i);
//generate the star
libStarGen.generateAStar(ourSystem.sysStars[i], ourBag, ourSystem.maxMass, ourSystem.sysName);
}
if (i == 2)
{
ourSystem.addStar(Star.IS_TRINARY, Star.IS_PRIMARY, i);
//generate the star
libStarGen.generateAStar(ourSystem.sysStars[i], ourBag, ourSystem.maxMass, ourSystem.sysName);
}
libStarGen.gasGiantFlag(ourSystem.sysStars[i], ourBag.gurpsRoll());
}
//now generate orbitals
if (ourSystem.countStars() > 1)
{
libStarGen.placeOurStars(ourSystem, ourBag);
}
}
示例8: setFlareStatus
/// <summary>
/// This sets the flare status of a star
/// </summary>
/// <param name="s">The star we're setting for</param>
/// <param name="ourDice">The dice object we use.</param>
public static void setFlareStatus(Star s, Dice ourDice)
{
int roll = ourDice.gurpsRoll();
int limit = 12;
double massLimit = .45;
if (OptionCont.anyStarFlareStar) massLimit = 11;
if (OptionCont.moreFlareStarChance) limit = 9;
if (roll >= limit && s.currMass <= massLimit) s.isFlareStar = true;
}
示例9: rollStellarMass
/// <summary>
/// This function rolls for mass on a star.
/// </summary>
/// <param name="velvetBag">The dice object</param>
/// <param name="orderID">The order ID of the star</param>
/// <param name="maxMass">the maximum mass. Has a default value of 0.0, indicating no max mass (may be left out)</param>
/// <returns>The rolled mass of a star</returns>
public static double rollStellarMass(Dice velvetBag, int orderID, double maxMass = 0.0)
{
int rollA, rollB; //roll integers
double tmpRoll; //test value.
if (maxMass == 0.0)
{
if (!OptionCont.stellarMassRangeSet)
{
if (orderID == Star.IS_PRIMARY && OptionCont.forceGardenFavorable)
{
rollA = velvetBag.rng(6);
if (rollA == 1) rollA = 5;
if (rollA == 2) rollA = 6;
if (rollA == 3 || rollA == 4) rollA = 7;
if (rollA == 5 || rollA == 6) rollA = 8;
return Star.getMassByRoll(rollA, velvetBag.gurpsRoll());
}
else
{
return Star.getMassByRoll(velvetBag.gurpsRoll(), velvetBag.gurpsRoll());
}
}
else
{
return velvetBag.rollInRange(OptionCont.minStellarMass, OptionCont.maxStellarMass);
}
}
else
{
int currPos = Star.getStellarMassPos(maxMass);
//error bound checking. The entire program is kinda predicated aroudn the idea you won't have this happen.
//IF IT DOES, then do the simple method.
if (currPos == -1)
{
do
{
tmpRoll = Star.getMassByRoll(velvetBag.gurpsRoll(), velvetBag.gurpsRoll());
} while (tmpRoll > maxMass);
return tmpRoll;
}
//else, roll for the new index.
rollA = velvetBag.gurpsRoll();
rollB = velvetBag.rng(rollA, 6);
//get the new index
if (currPos - rollB <= 0) currPos = 0;
else currPos = currPos - rollB;
return Star.getMassByIndex(currPos);
}
}
示例10: createPlanets
//.........这里部分代码省略.........
moon.genDensity(velvetBag);
moon.genPhysicalParameters(velvetBag);
moon.setClimateData(ourSystem.maxMass, velvetBag);
moon.detSurfaceTemp(different);
moon.calcAtmPres();
if (s.baseType == Satellite.BASETYPE_GASGIANT)
{
//radiation test
if (moon.atmPres > .2)
{
moon.updateDescListing(Satellite.DESC_RAD_HIGHBACK);
}
else
{
moon.updateDescListing(Satellite.DESC_RAD_LETHALBACK);
}
}
//orbital period
moon.generateOrbitalPeriod(s.mass);
//update parent.
temp = (2230000 * moon.mass * s.diameter) / Math.Pow(moon.orbitalRadius, 3);
s.tideForce.Add((Satellite.TIDE_MOON_BASE + (moon.selfID + 1)), temp);
//moon tides
lunarTides = (2230000 * s.mass * moon.diameter) / Math.Pow(moon.orbitalRadius, 3);
lunarTides = (lunarTides * ourSystem.sysAge) / moon.mass;
moon.tideForce.Add(Satellite.TIDE_PARPLANET, lunarTides);
moon.tideTotal = moon.totalTidalForce(ourSystem.sysAge);
if (moon.tideTotal >= 50 && velvetBag.gurpsRoll() > 17)
{
moon.isResonant = true;
}
else if (moon.tideTotal >= 50)
{
moon.isTideLocked = true;
}
moon.generateOrbitalVelocity(velvetBag);
if (moon.isTideLocked && !moon.isResonant)
{
updateTidalLock(moon, velvetBag);
}
if (moon.isResonant)
{
moon.siderealPeriod = (moon.orbitalPeriod * 2.0 / 3.0);
moon.rotationalPeriod = moon.siderealPeriod;
}
if (velvetBag.gurpsRoll() >= 17)
{
moon.retrogradeMotion = true;
}
if (moon.orbitalPeriod == moon.siderealPeriod)
moon.rotationalPeriod = 0;
else //calculate solar day from sidereal
{
double sidereal;
if (moon.retrogradeMotion) sidereal = -1 * moon.siderealPeriod;
else sidereal = moon.siderealPeriod;