![]() |
Oolite 1.91.0.7658-250404-b1488af
|
Go to the source code of this file.
Classes | |
struct | Random_Seed |
struct | RNG_Seed |
struct | RANROTSeed |
struct | OORandomState |
Macros | |
#define | ranrot_rand() |
Typedefs | |
typedef struct Random_Seed | Random_Seed |
typedef struct RNG_Seed | RNG_Seed |
typedef struct RANROTSeed | RANROTSeed |
Variables | |
const Random_Seed | kNilRandomSeed |
#define ranrot_rand | ( | ) |
Definition at line 78 of file legacy_random.h.
Referenced by PlayerEntity::addEquipmentItem:withValidation:inContext:, ShipEntity::becomeExplosion, ShipEntity(PureAI)::checkGroupOddsVersusTarget, ShipEntity::considerFiringMissile:, PlayerEntity(Scripting)::d100_number, PlayerEntity(Scripting)::d256_number, ShipEntity::deployEscorts, WormholeEntity::disgorgeShips, ShipEntity::dumpItem:, ShipEntity(PureAI)::ejectCargo, PlayerEntity::enterWitchspace, PlayerEntity(OOControlsPrivate)::handleAutopilotOn:, DustEntity::init, PlanetEntity(OOPrivate)::initAsAtmosphereForPlanet:dictionary:, PlanetEntity(OOPrivate)::initialiseBaseTerrainArray:, PlayerEntity::launchEscapeCapsule, PlanetEntity(OOPrivate)::paintVertex:vi:, ShipEntity(OOAIPrivate)::performHyperSpaceExitReplace:toSystem:, PlayerSetEscapePodDestination(), ShipEntity::releaseCargoPodsDebris, ShipEntity(PureAI)::rollD:, ShipEntity(PureAI)::scanForOffenders, ShipEntity(PureAI)::scanForRandomMerchantman, OOCharacter(Private)::setCharacterFromDictionary:, ShipEntity::setEvasiveJink:, ShipEntity(PureAI)::setTargetToRandomStation, PlayerEntity::setUpAndConfirmOK:saveGame:, OOTrumble::setupForPlayer:digram:, OOSkyDrawable(OOPrivate)::setUpNebulaeWithColor1:color2:clusterFactor:nebulaHueFix:alpha:scale:, ShipEntity(Private)::setUpOneEscort:inGroup:withRole:atPosition:andCount:, StationEntity::setUpShipFromDictionary:, OOSkyDrawable(OOPrivate)::setUpStarsWithColor1:color2:, OOTrumble::spawnFrom:, ShipEntity(AI)::suggestEscortTo:, PlayerEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, ShipEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, PlayerEntity::takeInternalDamage, PlayerEntity::takeScrapeDamage:from:, OOExhaustPlumeEntity::update:, OOTrumble::updatePop:, and PlayerEntity(OOPrivate)::witchStart.
typedef struct Random_Seed Random_Seed |
typedef struct RANROTSeed RANROTSeed |
typedef struct RNG_Seed RNG_Seed |
Definition at line 178 of file legacy_random.h.
References OOINLINE.
float bellf | ( | int | n | ) |
Definition at line 168 of file legacy_random.c.
References EXPECT_NOT, and Ranrot().
Referenced by ShipEntity::randomEjectaTemperatureWithMaxFactor:.
void clear_checksum | ( | void | ) |
Definition at line 42 of file legacy_random.c.
References checksum.
Referenced by PlayerEntity::commanderDataDictionary, PlayerEntity::setTrumbleValueFrom:, and PlayerEntity::trumbleValue.
double cunningFee | ( | double | value, |
double | precision ) |
Definition at line 62 of file legacy_random.c.
Referenced by PlayerEntity::renovationCosts, Universe::shipsForSaleForSystem:withTL:atTime:, and PlayerEntity(ContractsPrivate)::tradeInValue.
RNG_Seed currentRandomSeed | ( | void | ) |
Definition at line 213 of file legacy_random.c.
References rnd_seed.
Referenced by OOCharacter::basicSetUp, GlobalRandomName(), PlanetEntity(OOPrivate)::initAsAtmosphereForPlanet:dictionary:, PlanetEntity::initFromDictionary:withAtmosphere:andSeed:, and PlayerEntity::setGuiToSystemDataScreenRefreshBackground:.
Definition at line 169 of file legacy_random.h.
References OOINLINE.
Referenced by OOSystemDescriptionManager::buildRouteCache, GuiDisplayGen(Internal)::drawAdvancedNavArrayAtX:y:z:alpha:usingRoute:optimizedBy:zoom:, GuiDisplayGen(Internal)::drawStarChart:x:y:z:alpha:, Universe::findConnectedSystemAtCoords:withGalaxy:, Universe::findNeighbouringSystemToCoords:withGalaxy:, PlayerEntity(OOPrivate)::hyperspaceJumpDistance, WormholeEntity::initWormholeTo:fromShip:, Universe::nearbyDestinationsWithinRange:, Universe::routeFromSystem:toSystem:optimizedBy:, PlayerEntity::setGuiToSystemDataScreenRefreshBackground:, WormholeEntity::setMisjump, WormholeEntity::setMisjumpWithRange:, SystemInfoDistanceToSystem(), travelTimeBetweenPlanetPositions(), and PlayerEntity(OOPrivate)::witchJumpTo:misjump:.
OOINLINE int equal_seeds | ( | Random_Seed | seed1, |
Random_Seed | seed2 ) |
Definition at line 148 of file legacy_random.h.
References Random_Seed::a, Random_Seed::b, Random_Seed::c, Random_Seed::d, Random_Seed::e, Random_Seed::f, and OOINLINE.
Referenced by is_nil_seed().
int gen_rnd_number | ( | void | ) |
Definition at line 225 of file legacy_random.c.
Referenced by OOCharacter::basicSetUp, OOCharacter::castInRole:, Universe::getWitchspaceExitRotation, PlanetEntity(OOPrivate)::initAsAtmosphereForPlanet:dictionary:, PlanetEntity::initFromDictionary:withAtmosphere:andSeed:, PlanetEntity(OOPrivate)::initialiseBaseTerrainArray:, make_pseudo_random_seed(), OldRandomDigrams(), PlayerEntity(ScriptMethods)::systemPseudoRandom100, PlayerEntity(ScriptMethods)::systemPseudoRandom256, and PlayerEntity(ScriptMethods)::systemPseudoRandomFloat.
OOINLINE int is_nil_seed | ( | Random_Seed | a_seed | ) |
Definition at line 154 of file legacy_random.h.
References equal_seeds(), kNilRandomSeed, and OOINLINE.
Referenced by PlanetEntity::initFromDictionary:withAtmosphere:andSeed:.
void make_pseudo_random_seed | ( | Random_Seed * | seed_ptr | ) |
Definition at line 309 of file legacy_random.c.
References Random_Seed::a, Random_Seed::b, Random_Seed::c, Random_Seed::d, Random_Seed::e, Random_Seed::f, and gen_rnd_number().
Referenced by GlobalRandomInhabitantsDescription(), and OOCharacter::initWithRole:andOriginalSystem:.
RANROTSeed MakeRanrotSeed | ( | uint32_t | seed | ) |
Definition at line 113 of file legacy_random.c.
References RanrotWithSeed().
Referenced by Universe::populateSystemFromDictionariesWithSun:andPlanet:, ranrot_srand(), and RanrotSeedFromRNGSeed().
Definition at line 48 of file legacy_random.c.
References checksum.
Referenced by PlayerEntity::commanderDataDictionary, PlayerEntity::mungChecksumWithNSString:, PlayerEntity::setTrumbleValueFrom:, and PlayerEntity::trumbleValue.
void OOInitReallyRandom | ( | uint64_t | seed | ) |
Definition at line 256 of file legacy_random.c.
References OOReallyRandom(), sReallyRandomInited, and sReallyRandomSeed.
Referenced by Universe::initWithGameView:.
uint32_t OOReallyRandom | ( | void | ) |
Definition at line 249 of file legacy_random.c.
References RanrotWithSeed(), sReallyRandomInited, and sReallyRandomSeed.
Referenced by OOInitReallyRandom(), OOSetReallyRandomRANROTSeed(), and OOSetReallyRandomRndSeed().
void OORestoreRandomState | ( | OORandomState | state | ) |
Definition at line 302 of file legacy_random.c.
References OORandomState::ranrot, OORandomState::rnd, rnd_seed, and sRANROT.
Referenced by OOExpandDescriptionString().
OORandomState OOSaveRandomState | ( | void | ) |
Definition at line 292 of file legacy_random.c.
References rnd_seed, and sRANROT.
Referenced by OOExpandDescriptionString().
void OOSetReallyRandomRANROTAndRndSeeds | ( | void | ) |
Definition at line 285 of file legacy_random.c.
References OOSetReallyRandomRANROTSeed(), and OOSetReallyRandomRndSeed().
Referenced by OOExpandDescriptionString().
void OOSetReallyRandomRANROTSeed | ( | void | ) |
Definition at line 267 of file legacy_random.c.
References OOReallyRandom(), sRANROT, sReallyRandomInited, and sReallyRandomSeed.
Referenced by OOSetReallyRandomRANROTAndRndSeeds().
void OOSetReallyRandomRndSeed | ( | void | ) |
Definition at line 275 of file legacy_random.c.
References OOReallyRandom(), and rnd_seed.
Referenced by OOSetReallyRandomRANROTAndRndSeeds().
float randf | ( | void | ) |
Definition at line 156 of file legacy_random.c.
References Ranrot().
Referenced by OOTrumble::actionBlink, OOTrumble::actionIdle, OOTrumble::actionPop, OOTrumble::actionProot, OOTrumble::actionShudder, OOTrumble::actionSleep, OOTrumble::actionSnarl, OOTrumble::actionSpawn, OOTrumble::actionStoned, Universe::addLaserHitEffectsAt:against:damage:color:, Universe::addShipAt:withRole:withinRadius:, Universe::addShips:withRole:atPosition:withCoordinateSystem:, Universe::addShips:withRole:intoBoundingBox:, Universe::addShipWithRole:launchPos:rfactor:, Universe::addWreckageFrom:withRole:at:scale:lifetime:, OOCommodities(OOPrivate)::adjustPrice:byRule:, OOCommodities(OOPrivate)::adjustQuantity:byRule:, OORoleSet::anyRole, ShipEntity::becomeExplosion, ShipEntity::behaviour_attack_fly_from_target:, ShipEntity::behaviour_attack_target:, ShipEntity::behaviour_flee_target:, ShipEntity(AI)::broadcastDistressMessageWithDumping:, Universe::cargoPodFromTemplate:, Universe::carryPlayerOn:inWormhole:, OOSunEntity::changeSunProperty:withDictionary:, PlayerEntity(Contracts)::checkPassengerContracts, PlayerEntity::clearRoleFromPlayer:, PlayerEntity::clearRolesFromPlayer:, ShipEntity::currentAimTolerance, WormholeEntity::disgorgeShips, ShipEntity::drawImmediate:translucent:, WormholeEntity::DrawWormholeCorona, ShipEntity::dumpItem:, PlayerEntity::enterWitchspace, PlayerEntity::enterWormhole:, ShipEntity(PureAI)::fightOrFleeHostiles, fillRanNoiseBuffer(), ShipEntity::fireDirectLaserShot:, ShipEntity::fireDirectLaserShotAt:, ShipEntity::fireMissileWithIdentifier:andTarget:, ShipEntity::fireWeapon:direction:range:, Universe(OOPrivate)::fractionalPositionFrom:to:withFraction:, OOCommodities(OOPrivate)::generatePriceForGood:inEconomy:, OOCommodities(OOPrivate)::generateQuantityForGood:inEconomy:, Universe::getSunSkimEndPositionForShip:, OOExplosionCloudEntity(OOPrivate)::initExplosionCloudWithEntity:size:andSettings:, OOSunEntity::initSunWithColor:andDictionary:, SkyEntity::initWithColors:col1:andSystemInfo:, OOParticleSystem::initWithPosition:velocity:count:minSpeed:maxSpeed:duration:baseColor:, ShipEntity::launchCascadeMine, StationEntity::launchIndependentShip:, ShipEntity::leaveWitchspace, Universe::locationByCode:withSun:andPlanet:, ShipEntity::noteTakingDamage:from:type:, ShipEntity::onTarget:withWeapon:, OOFuzzyBooleanFromObject(), OOHPRandomPositionInBoundingBox(), OOHPVectorRandomRadial(), OOHPVectorRandomSpatial(), OORandomPositionInBoundingBox(), OORandomPositionInCylinder(), OORandomUnitHPVector(), OORandomUnitVector(), OOVectorRandomRadial(), OOVectorRandomSpatial(), ShipEntity(AI)::performAttack, ShipEntity(AI)::performFlee, ShipEntity(AI)::performTumble, Universe::populateNormalSpace, OOTrumble::randomizeMotionX, OOTrumble::randomizeMotionY, OOConcreteMutableProbabilitySet::randomObject, ShipEntity::respondToAttackFrom:becauseOf:, ShipEntity::selectMissile, ShipEntity::setCargoFlag:, ShipEntity(PureAI)::setCourseToPlanet, ShipEntity(PureAI)::setDestinationToDockingAbort, ShipEntity(PureAI)::setDestinationWithinTarget, ShipEntity(PureAI)::setPlanetPatrolCoordinates, OOSunEntity::setSunColor:, ShipEntity(PureAI)::setTargetToPrimaryAggressor, OOTrumble::setupForPlayer:digram:, OOSkyDrawable(OOPrivate)::setUpNebulaeWithColor1:color2:clusterFactor:nebulaHueFix:alpha:scale:, ShipEntity(Private)::setUpOneEscort:inGroup:withRole:atPosition:andCount:, ShipEntity::setUpShipFromDictionary:, Universe::setUpSpace, Universe::setUpWitchspaceBetweenSystem:andSystem:, Universe::shipsForSaleForSystem:withTL:atTime:, OOTrumble::spawnFrom:, Universe::spawnShipWithRole:near:, ShipEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, PlayerEntity::takeInternalDamage, ShipEntity::takeScrapeDamage:from:, ShipEntity::throwSparks, OOExhaustPlumeEntity::update:, OOQuiriumCascadeEntity::update:, OOSunEntity::update:, OOTrumble::updateBlink:, OOTrumble::updateIdle:, OOTrumble::updatePop:, OOTrumble::updateProot:, OOTrumble::updateShudder:, OOTrumble::updateSleep:, OOTrumble::updateSnarl:, OOTrumble::updateTrumble:, PlayerEntity(OOPrivate)::witchJumpTo:misjump:, and Universe::witchspaceShipWithPrimaryRole:.
float randfWithSeed | ( | RANROTSeed * | ioSeed | ) |
Definition at line 162 of file legacy_random.c.
References RanrotWithSeed().
Referenced by OOProbabilisticTextureManager::selectTexture.
unsigned Ranrot | ( | void | ) |
Definition at line 93 of file legacy_random.c.
References sRANROT.
Referenced by PlayerEntity::addRoleToPlayer:, Universe::addShipAt:withRole:withinRadius:, PlayerEntity(Contracts)::awardContract:commodity:start:destination:eta:fee:premium:, ShipEntity::becomeExplosion, bellf(), PlayerEntity::clearRoleFromPlayer:, Universe::getContainersOfGoods:scarce:legal:, Universe::getRandomAmountOfCommodity:, OOCommodities::getRandomCommodity, Universe::getSafeVectorFromEntity:toDistance:fromPoint:, GlobalRandomName(), ShipEntity::initWithKey:definition:, StationEntity::launchDefenseShip, StationEntity::launchPatrol, StationEntity::launchPolice, PlayerEntity::leaveWitchspace, PlayerEntity(Contracts)::processEscapePods, quaternion_set_random(), randf(), OOCharacter::randomCharacterWithRole:andOriginalSystem:, Universe(OOPrivate)::randomDistanceWithinScanner, Octree::randomFullNodeFrom, ShipEntity::releaseCargoPodsDebris, ShipEntity(Private)::setUpMixedEscorts, Universe::setUpSpace, Universe::shipsForSaleForSystem:withTL:atTime:, StationAddShipToShipyard(), SVGDumpBeginPrimitive(), and Universe::witchspaceShipWithPrimaryRole:.
void ranrot_srand | ( | uint32_t | seed | ) |
Definition at line 150 of file legacy_random.c.
References MakeRanrotSeed(), and sRANROT.
Referenced by GameController::init, PlanetEntity(OOPrivate)::initialiseBaseTerrainArray:, PlanetEntity(OOPrivate)::paintVertex:vi:, OOTrumble::setupForPlayer:digram:, and Universe::shipsForSaleForSystem:withTL:atTime:.
RANROTSeed RANROTGetFullSeed | ( | void | ) |
Definition at line 185 of file legacy_random.c.
References sRANROT.
Referenced by OOCharacter::basicSetUp, fillRanNoiseBuffer(), PlanetEntity(OOPrivate)::initAsAtmosphereForPlanet:dictionary:, PlanetEntity::initFromDictionary:withAtmosphere:andSeed:, PlanetEntity(OOPrivate)::initialiseBaseTerrainArray:, PlanetEntity(OOPrivate)::paintVertex:vi:, Universe::populateSystemFromDictionariesWithSun:andPlanet:, PlayerEntity::setGuiToSystemDataScreenRefreshBackground:, and Universe::shipsForSaleForSystem:withTL:atTime:.
RANROTSeed RanrotSeedFromRandomSeed | ( | Random_Seed | seed | ) |
Definition at line 136 of file legacy_random.c.
References Random_Seed::c, Random_Seed::d, Random_Seed::e, Random_Seed::f, and RanrotSeedFromRNGSeed().
Referenced by Universe::populateSystemFromDictionariesWithSun:andPlanet:, and Universe::shipsForSaleForSystem:withTL:atTime:.
RANROTSeed RanrotSeedFromRNGSeed | ( | RNG_Seed | seed | ) |
Definition at line 130 of file legacy_random.c.
References RNG_Seed::a, RNG_Seed::b, RNG_Seed::c, RNG_Seed::d, and MakeRanrotSeed().
Referenced by RanrotSeedFromRandomSeed(), and seed_for_planet_description().
void RANROTSetFullSeed | ( | RANROTSeed | seed | ) |
Definition at line 191 of file legacy_random.c.
References sRANROT.
Referenced by OOCharacter::basicSetUp, PlanetEntity(OOPrivate)::initAsAtmosphereForPlanet:dictionary:, PlanetEntity::initFromDictionary:withAtmosphere:andSeed:, PlanetEntity(OOPrivate)::initialiseBaseTerrainArray:, PlanetEntity(OOPrivate)::paintVertex:vi:, Universe::populateSystemFromDictionariesWithSun:andPlanet:, PlayerEntity::setGuiToSystemDataScreenRefreshBackground:, and Universe::shipsForSaleForSystem:withTL:atTime:.
unsigned RanrotWithSeed | ( | RANROTSeed * | ioSeed | ) |
Definition at line 102 of file legacy_random.c.
References RANROTSeed::high, and RANROTSeed::low.
Referenced by MakeRanrotSeed(), OOReallyRandom(), Universe::populateSystemFromDictionariesWithSun:andPlanet:, randfWithSeed(), and Universe::shipsForSaleForSystem:withTL:atTime:.
void rotate_seed | ( | Random_Seed * | seed_ptr | ) |
Definition at line 320 of file legacy_random.c.
References Random_Seed::a, Random_Seed::b, Random_Seed::c, Random_Seed::d, Random_Seed::e, Random_Seed::f, x, and y.
Referenced by Universe::shipsForSaleForSystem:withTL:atTime:.
void seed_for_planet_description | ( | Random_Seed | s_seed | ) |
Definition at line 206 of file legacy_random.c.
References RanrotSeedFromRNGSeed(), rnd_seed, seed_RNG_only_for_planet_description(), and sRANROT.
Referenced by OOCharacter::basicSetUp, PlanetEntity::initFromDictionary:withAtmosphere:andSeed:, Universe::setUpPlanet, and Universe::setUpSpace.
void seed_RNG_only_for_planet_description | ( | Random_Seed | s_seed | ) |
Definition at line 197 of file legacy_random.c.
References Random_Seed::c, Random_Seed::d, Random_Seed::e, Random_Seed::f, and rnd_seed.
Referenced by OOCharacter::basicSetUp, ShipEntity::commsMessage:withUnpilotedOverride:, PlayerEntity(ScriptingPrivate)::expandMessage:, OOGenerateSystemDescription(), seed_for_planet_description(), ShipEntity::sendExpandedMessage:toShip:, PlayerEntity(ScriptMethods)::systemPseudoRandom100, PlayerEntity(ScriptMethods)::systemPseudoRandom256, and PlayerEntity(ScriptMethods)::systemPseudoRandomFloat.
void setRandomSeed | ( | RNG_Seed | a_seed | ) |
Definition at line 219 of file legacy_random.c.
References rnd_seed.
Referenced by OOCharacter::basicSetUp, GlobalRandomName(), PlanetEntity(OOPrivate)::initAsAtmosphereForPlanet:dictionary:, PlanetEntity::initFromDictionary:withAtmosphere:andSeed:, and PlayerEntity::setGuiToSystemDataScreenRefreshBackground:.
Definition at line 187 of file legacy_random.h.
References distanceBetweenPlanetPositions(), and OOINLINE.
|
extern |
Definition at line 34 of file legacy_random.c.
Referenced by OOSystemDescriptionManager::getRandomSeedForCurrentSystem, OOSystemDescriptionManager::getRandomSeedForSystem:inGalaxy:, GlobalExpandDescription(), GlobalExpandMissionText(), is_nil_seed(), and RandomSeedFromString().