Add nITG's various path shape & other modifiers - V2 (#1435)

* Implemented nITG's Square modifiers

Modifiers added:
Square
SquareOffset
SquarePeriod
SquareZ
SquareZOffset
SquareZPeriod

* Implemented nITG's BumpyX Modifiers

Also fixes up some tiny bits pertaining to the square modifiers.
Modifiers Added:
BumpyX
BumpyXPeriod
BumpyXOffset

* Implemented nITG's TornadoZ Modifiers

Modifiers Added:
TornadoZ
TornadoZPeriod
TornadoZOffset

Another commit is needed to update fallback's metrics

* Update fallback's metrics to accommodate TornadoX

* Implemented nITG's Parabola Modifiers

Modifiers Added:
ParabolaX
ParabolaY
ParabolaZ

* Implemented nITG's Sawtooth Modifiers

Modifiers Added:
Sawtooth
SawtoothPeriod
SawtoothZ
SawtoothZPeriod

* Implemented nITG's Zigzag Modifiers

Modifiers Added:
Zigzag
ZigzagPeriod
ZigzagOffset
ZigzagZ
ZigzagZPeriod
ZigzagZOffset

* Implemented nITG's ModTimer modifiers

Modifiers Added:
ModTimer (Lua method name is ModTimerSetting (takes enums. Ex: 'ModTimerType_Song'). Can be activated with mod strings 'modtimer(song/beat/game/default)' )
ModTimerOffset
ModTimerMult

* Remove Log use from ArrowEffects::GetTime()

* Accidentally removed a CPY(m_BatteryLives)

* Implemented nITG's DrunkZ modifiers

Modifiers added:
drunkz
drunkzspeed
drunkzoffset
drunkzperiod

Another commit is needed to update fallback's metrics

* Update fallback's metrics to accommodate DrunkZ

* Implemented nITG's BeatY & BeatZ Modifers

Modifiers Added:
beaty
beatyoffset
beatyperiod
beatymult	
beatz
beatzoffset
beatzperiod
beatzmult

Another commit is needed to update fallback's metrics

* Updated fallback's metrics to accommodate ...

the new Beat modifiers.

* Implemented nITG's Digital Modifiers

Modifers Added:
digital
digitalsteps
digitalperiod
digitaloffset
digitalz
digitalzsteps
digitalzperiod
digitalzoffset

* Removed duplicate zbuffer check.

* Updated Luadocs with the new modifiers

* Removed accidental duplicate Mini from Luadocs

* Split up long modifier lines.

Hopefully, this makes it a bit easier to read.

* Remove accidental commit to root of repo.

* Split up long modifier lines

Hopefully, this makes it easier to read.

* Redid Square functions to not use FastSin

This implementation is based off of 5.2's square_wave function from ModValue.

* Redid zigzag functions to not use FastSin

This implementation is based off of 5.2's triangle_wave function from ModValue.

* Moved square & zigzag calculation to RageMath.

New RageMath functions:
RageSquare
RageTriangle

* Made Square & Digital have the same period...

as Zigzag and Sawtooth.

* Deduplicate tornado calculations.

* Fixed typo in UpdateTornado, and moved UpdateTornado logic to ArrowEffects::Init because it doesn't depend on anything that changes every frame.  Tornado metrics are also loaded in ArrowEffects::Init.

* Deduplicated Beat mod update logic.

The logic is now placed into a function called UpdateBeat.
The m_fBeatFactor members are now a 1D array, similar to m_MaxTornado and m_MinTornado.
This commit is contained in:
MrThatKid
2017-05-13 11:34:34 -07:00
committed by Colby Klein
parent 31e99dc457
commit e15e0e68be
10 changed files with 801 additions and 97 deletions
+64
View File
@@ -37,6 +37,19 @@ const RString& DrainTypeToString( DrainType cat );
const RString& DrainTypeToLocalizedString( DrainType cat );
LuaDeclareType( DrainType );
enum ModTimerType
{
ModTimerType_Game,
ModTimerType_Beat,
ModTimerType_Song,
ModTimerType_Default,
NUM_ModTimerType,
ModTimerType_Invalid
};
const RString& ModTimerTypeToString( ModTimerType cat );
const RString& ModTimerTypeToLocalizedString( ModTimerType cat );
LuaDeclareType( ModTimerType );
/** @brief Per-player options that are not saved between sessions. */
class PlayerOptions
{
@@ -46,6 +59,7 @@ public:
*
* This code was taken from Init() to use proper initialization. */
PlayerOptions(): m_LifeType(LifeType_Bar), m_DrainType(DrainType_Normal),
m_ModTimerType(ModTimerType_Default),
m_BatteryLives(4),
m_bSetScrollSpeed(false),
m_fTimeSpacing(0), m_SpeedfTimeSpacing(1.0f),
@@ -62,6 +76,8 @@ public:
m_fSkew(0), m_SpeedfSkew(1.0f),
m_fPassmark(0), m_SpeedfPassmark(1.0f),
m_fRandomSpeed(0), m_SpeedfRandomSpeed(1.0f),
m_fModTimerMult(0), m_SpeedfModTimerMult(1.0f),
m_fModTimerOffset(0), m_SpeedfModTimerOffset(1.0f),
m_bMuteOnError(false), m_FailType(FailType_Immediate),
m_MinTNSToHideNotes(PREFSMAN->m_MinTNSToHideNotes)
{
@@ -117,6 +133,10 @@ public:
EFFECT_DRUNK_SPEED,
EFFECT_DRUNK_OFFSET,
EFFECT_DRUNK_PERIOD,
EFFECT_DRUNK_Z,
EFFECT_DRUNK_Z_SPEED,
EFFECT_DRUNK_Z_OFFSET,
EFFECT_DRUNK_Z_PERIOD,
EFFECT_DIZZY,
EFFECT_CONFUSION,
EFFECT_CONFUSION_OFFSET,
@@ -131,16 +151,57 @@ public:
EFFECT_TORNADO,
EFFECT_TORNADO_PERIOD,
EFFECT_TORNADO_OFFSET,
EFFECT_TORNADO_Z,
EFFECT_TORNADO_Z_PERIOD,
EFFECT_TORNADO_Z_OFFSET,
EFFECT_TIPSY,
EFFECT_TIPSY_SPEED,
EFFECT_TIPSY_OFFSET,
EFFECT_BUMPY,
EFFECT_BUMPY_OFFSET,
EFFECT_BUMPY_PERIOD,
EFFECT_BUMPY_X,
EFFECT_BUMPY_X_OFFSET,
EFFECT_BUMPY_X_PERIOD,
EFFECT_BEAT,
EFFECT_BEAT_OFFSET,
EFFECT_BEAT_PERIOD,
EFFECT_BEAT_MULT,
EFFECT_BEAT_Y,
EFFECT_BEAT_Y_OFFSET,
EFFECT_BEAT_Y_PERIOD,
EFFECT_BEAT_Y_MULT,
EFFECT_BEAT_Z,
EFFECT_BEAT_Z_OFFSET,
EFFECT_BEAT_Z_PERIOD,
EFFECT_BEAT_Z_MULT,
EFFECT_DIGITAL,
EFFECT_DIGITAL_STEPS,
EFFECT_DIGITAL_PERIOD,
EFFECT_DIGITAL_OFFSET,
EFFECT_DIGITAL_Z,
EFFECT_DIGITAL_Z_STEPS,
EFFECT_DIGITAL_Z_PERIOD,
EFFECT_DIGITAL_Z_OFFSET,
EFFECT_ZIGZAG,
EFFECT_ZIGZAG_PERIOD,
EFFECT_ZIGZAG_OFFSET,
EFFECT_ZIGZAG_Z,
EFFECT_ZIGZAG_Z_PERIOD,
EFFECT_ZIGZAG_Z_OFFSET,
EFFECT_SAWTOOTH,
EFFECT_SAWTOOTH_PERIOD,
EFFECT_SAWTOOTH_Z,
EFFECT_SAWTOOTH_Z_PERIOD,
EFFECT_SQUARE,
EFFECT_SQUARE_PERIOD,
EFFECT_SQUARE_OFFSET,
EFFECT_SQUARE_Z,
EFFECT_SQUARE_Z_PERIOD,
EFFECT_SQUARE_Z_OFFSET,
EFFECT_PARABOLA_X,
EFFECT_PARABOLA_Y,
EFFECT_PARABOLA_Z,
EFFECT_XMODE,
EFFECT_TWIRL,
EFFECT_ROLL,
@@ -210,6 +271,7 @@ public:
LifeType m_LifeType;
DrainType m_DrainType; // only used with LifeBar
ModTimerType m_ModTimerType;
int m_BatteryLives;
/* All floats have a corresponding speed setting, which determines how fast
* PlayerOptions::Approach approaches. */
@@ -236,6 +298,8 @@ public:
float m_fPassmark, m_SpeedfPassmark;
float m_fRandomSpeed, m_SpeedfRandomSpeed;
float m_fModTimerMult, m_SpeedfModTimerMult;
float m_fModTimerOffset, m_SpeedfModTimerOffset;
/* The maximum column number is 16.*/
float m_fMovesX[16], m_SpeedfMovesX[16];
float m_fMovesY[16], m_SpeedfMovesY[16];