Add metrics for random modifier choosing.

This commit is contained in:
Jason Felds
2011-02-12 00:18:01 -05:00
parent b4e45fe65b
commit 30341de96e
3 changed files with 30 additions and 7 deletions
+6
View File
@@ -13,6 +13,12 @@ _____________________________________________________________________________
sm-ssc v1.?.? | 20110???
--------------------------------------------------------------------------------
20110212
--------
* Added metrics to allow changing how often random modifiers activate in
the proper setting. At this time, the mods to be activated have NOT been
changed. [Wolfman2000]
20110211
--------
* Introduced the .ssc file format for future features and expansion. All .sm
+9
View File
@@ -992,6 +992,15 @@ ComboStoppedAt=50
AttackRunTimeRandom=6
AttackRunTimeMine=7
[PlayerOptions]
RandomSpeedChance=0.2
RandomReverseChance=0.2
RandomDarkChance=0.1
RandomAccelChance=0.333
RandomEffectChance=0.667
RandomHiddenChance=0.05
RandomSuddenChance=0.1
[PlayerShared]
Fallback="Player"
ComboXOffsetOneSideP1=-120
+15 -7
View File
@@ -14,6 +14,14 @@
#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYLEN(arr); ++Z ) arr[Z]=1.0f; }
ThemeMetric<float> RANDOM_SPEED_CHANCE ( "PlayerOptions", "RandomSpeedChance" );
ThemeMetric<float> RANDOM_REVERSE_CHANCE ( "PlayerOptions", "RandomReverseChance" );
ThemeMetric<float> RANDOM_DARK_CHANCE ( "PlayerOptions", "RandomDarkChance" );
ThemeMetric<float> RANDOM_ACCEL_CHANCE ( "PlayerOptions", "RandomAccelChance" );
ThemeMetric<float> RANDOM_EFFECT_CHANCE ( "PlayerOptions", "RandomEffectChance" );
ThemeMetric<float> RANDOM_HIDDEN_CHANCE ( "PlayerOptions", "RandomHiddenChance" );
ThemeMetric<float> RANDOM_SUDDEN_CHANCE ( "PlayerOptions", "RandomSuddenChance" );
void PlayerOptions::Init()
{
m_bSetScrollSpeed = false;
@@ -526,22 +534,22 @@ void PlayerOptions::NextPerspective()
void PlayerOptions::ChooseRandomModifiers()
{
if( RandomFloat(0,1)>0.8f )
if( RandomFloat(0,1)<RANDOM_SPEED_CHANCE )
m_fScrollSpeed = 1.5f;
if( RandomFloat(0,1)>0.8f )
if( RandomFloat(0,1)<RANDOM_REVERSE_CHANCE )
m_fScrolls[SCROLL_REVERSE] = 1;
if( RandomFloat(0,1)>0.9f )
if( RandomFloat(0,1)<RANDOM_DARK_CHANCE )
m_fDark = 1;
float f;
f = RandomFloat(0,1);
if( f>0.66f )
if( f<RANDOM_ACCEL_CHANCE )
m_fAccels[RandomInt(NUM_ACCELS)] = 1;
else if( f>0.33f )
else if( f<RANDOM_EFFECT_CHANCE )
m_fEffects[RandomInt(NUM_EFFECTS)] = 1;
f = RandomFloat(0,1);
if( f>0.95f )
if( f<RANDOM_HIDDEN_CHANCE )
m_fAppearances[APPEARANCE_HIDDEN] = 1;
else if( f>0.9f )
else if( f<RANDOM_SUDDEN_CHANCE )
m_fAppearances[APPEARANCE_SUDDEN] = 1;
}