Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Sonic_Adventure_3.cpp : Defines the exported functions for the DLL application.
- //
- #include "stdafx.h"
- #include "SADXModLoader.h"
- #include <cstdlib>
- #include <vector>
- #include <math.h>
- //#include "LandTableInfo.h"
- #include "Models_Header.h"
- #include "Functions.h"
- //Gameplay Reset variables
- char invinsize_orig[] = { 0xD9, 0x41, 0x30, 0xD8, 0x0D, 0x8C, 0xD5, 0x7D, 0 };
- char invin_stuff_unNOP[] = { 0xD9, 0x5E, 0x2C };
- char gravity_orig[] = { 0x89, 0x90, 0x14, 0x01, 0, 0 };
- char rollingdata[] = { 0xC6, 0x07, 0x05 };
- char homingoutspeed_orig[] = { 0xD9, 0x5F, 0x38 };
- char homingaction_orig[] = { 0x80, 0x65, 0x05, 0xFA };
- char homingstuff_orig[] = { 0xC6, 0x45, 0, 0x0C };
- char enable_aiming[] = { 0x0F, 0xBE, 0x06 };
- char enable_shooting[] = { 0xC6, 0x46, 0x01, 0x03 };
- char shooting05_unNOP[] = { 0xC6, 0x46, 0x01, 0x05 };
- char landing_NOattack1_unNOP[] = { 0x80, 0x65, 0x05, 0xFA };
- char landing_NOattack2_unNOP[] = { 0x80, 0x65, 0x05, 0xFA };
- char landing_NOattack3_unNOP[] = { 0x80, 0x65, 0x05, 0xFA };
- char landing_NOattack4_unNOP[] = { 0x80, 0x65, 0x05, 0xFA };
- char SpindashData[] = { 0xC6, 0x7, 0x4 };
- char gravity_underwater_orig[] = { 0xD9, 0x98, 0x14, 0x01, 0, 0 };
- char shadow3rdpunchspeed_orig[] = { 0xC7, 0x47, 0x38, 0, 0, 0x80, 0x40 };
- char jumpdashspeed1_normal[] = { 0xC7, 0x47, 0x38, 0, 0, 0xA0, 0x40 };
- char jumpdashspeed2_normal[] = { 0xC7, 0x47, 0x38, 0, 0, 0xA0, 0x40 };
- char enable_SONIC_KNUXflashing[] = { 0x66, 0x89, 0x45, 0x06 };
- char HSpeed_data[] = { 0x89, 0x48, 0x3C };
- char VSpeed_data[] = { 0x89, 0x48, 0x38 };
- char to_standing_data[] = { 0x66, 0x89, 0x8E, 0x24, 0x01, 0, 0 };
- char SonicLSAcharged_RunSpeed_orig[] = { 0xC7, 0x86, 0xAC, 0, 0, 0, 0, 0, 0, 0x3F };
- char always_attract_rings_unNOP[] = { 0x0F, 0x84, 0xAF, 0x01, 0, 0 };
- char spindash_outspeed_orig[] = { 0x89, 0x4E, 0x38 };
- char blaze_lasting_time_orig[] = { 0x66, 0x3D, 0x68, 0x01 };
- char rollingweirdfix1[] = { 0x66, 0xC7, 0x81, 0x24, 0x01, 0, 0, 0x1D, 0 };
- char rollingweirdfix2[] = { 0x66, 0x89, 0x8E, 0x24, 0x01, 0, 0 };
- char SuperSplashData[] = { 0x8B, 0x43, 0x74, 0x85, 0xC0 };
- char SuperSplashScale[] = { 0x8B, 0x45, 0x74, 0x33, 0xC9 };
- char SuperSplashAura[] = { 0xD9, 0x43, 0x38, 0xD8, 0x1D };
- char unknown_49876D[] = { 0x80, 0x65, 0x05, 0xFA };
- char unknown_492F73[] = { 0x66, 0xC7, 0x87, 0x24, 0x01, 0, 0, 0x12, 0 };
- char unknown_55E95C[] = { 0x0F, 0x84, 0x8D, 0x06, 0, 0 };
- char unknown_444103[] = { 0xD9, 0x87, 0xC4, 0, 0, 0 };
- char unknown_493067[] = { 0xC7, 0x47, 0x38, 0, 0, 0, 0x41 };
- char unknown_492CAE[] = { 0xD8, 0x1D, 0x48, 0xDC, 0x7D, 0 };
- char unknown_4975AC[] = { 0x66, 0xC7, 0x83, 0x24, 0x01, 0, 0, 0x14, 0 };
- char unknown_49304C[] = { 0x66, 0xC7, 0x87, 0x24, 0x01, 0, 0, 0x40, 0 };
- char unknown_460EA6[] = { 0xBB, 0x10, 0, 0, 0 };
- char unknown_4950A9[] = { 0x80, 0x4F, 0x05, 0x02 };
- char unknown_492F68[] = { 0xC6, 0x06, 0x0C };
- char unknown_4975BC[] = { 0xC7, 0x43, 0x38, 0, 0, 0, 0x40 };
- char unknown_494C19[] = { 0xC7, 0x47, 0x38, 0, 0, 0x20, 0x41 };
- float missilespeed_orig = 5.0f;
- float invinmult_orig = 0.60000002;
- float NormalHomingSpeed = 5.0f;
- float ringmaxspeed_orig = 5.0f;
- //Shared variables
- bool r = false;
- bool fall_after_roll = false;
- bool homing = false;
- bool just_homing_attacked = false;
- bool in_air_after_homing = false;
- bool dashing = false;
- bool no_longer_dashing = false;
- bool was_on_trampoline = false;
- bool was_invincible_before = false;
- bool LightDash_SuperDash_ON = false;
- bool just_flipped = false;
- bool just_spindashed = false;
- bool no_light_attack = false;
- bool Z_was_pressed_on_ground = false;
- bool Z_was_pressed_in_air = false;
- bool was_on_ground = false;
- bool LSA_launch = false;
- bool LSA_used = false;
- bool ok = false;
- bool is_paused = false;
- bool LD_fix = false;
- bool GO_sound_played = false;
- bool BLUE_GEM_ON = false;
- bool RED_GEM_ON = false;
- bool GREEN_GEM_ON = false;
- bool PURPLE_GEM_ON = false;
- bool SKY_GEM_ON = false;
- bool WHITE_GEM_ON = false;
- bool YELLOW_GEM_ON = false;
- bool NO_GEM_ON = false;
- bool has_rings = false;
- bool has_shield = false;
- bool has_invincibility = false;
- bool was_hit = false;
- bool gauge_full = false;
- bool homing_attacking = false;
- bool cant_play_again = false;
- bool just_charged = false;
- bool CB_active = false;
- bool is_super = false;
- bool punching = false;
- bool PURPLE_GEM_used = false;
- bool stop_sky_gem = false;
- char balldata[] = { 0xBD, 0x20, 0, 0, 0 };
- char HangTimeCheckData[] = { 0x3B, 0x90, 0x9C, 0, 0, 0 };
- char LightDash_unNOP[] = { 0xC6, 0x06, 0x06, 0x33, 0xD2 };
- char WalkOnWaterData[] = { 0xF, 0x85, 0xCF, 0, 0, 0 };
- char LightDashTrail_unNOP[] = { 0xE8, 0x15, 0x91, 0xFF, 0xFF };
- char LD_forced_out_speed[] = { 0xC7, 0x43, 0x38, 0, 0, 0x80, 0x40 };
- char LSA_sound[] = { 0xE8, 0xDE, 0x0C, 0xF9, 0xFF };
- char TrailData[] = { 0x66, 0x09, 0x5D, 0x04 };
- char gravity_orig_hovering[] = { 0x89, 0x90, 0x14, 0x01, 0, 0 };
- char gravity_underwater_orig_hovering[] = { 0xD9, 0x98, 0x14, 0x01, 0, 0 };
- char disable_dying[] = { 0x90, 0xE9 };
- char enable_dying[] = { 0x0F, 0x84 };
- char enable_drowning[] = { 0x66, 0xFF, 0x46, 0x0C };
- char Can_get_1up[] = { 0xE8, 0x33, 0xFF, 0xFF, 0xFF };
- char CharSelScreen_position_orig1[] = { 0x89, 0x42, 0x24 };
- char CharSelScreen_position_orig2[] = { 0x89, 0x41, 0x24 };
- char invinsize[] = { 0xC7, 0x46, 0x2C, 0x9A, 0x99, 0x99, 0x3F, 0x90, 0x90 };
- float LightDash_SuperDash = -100.0f;
- float Boost_SuperTornado = -100.0f;
- float LightAttackStatic = 0.0f;
- float LightAttackMoving = 8.0f;
- float LightAttackMoving_orig = 10.0f;
- float SuperLightAttackMoving = 12.0f;
- float LDringdist = 0.0f;
- int LightAttackTimer = 0;
- int HangTimeLikeHeroes = 0;
- int OldEnemyBonus;
- int SpeedShoesCount = 0;
- int HomingSounds[]{ 762, 777, 778, 779 };
- int homing_reattack_timer = 0;
- int NOP_forced_out_speed = 0;
- int paused = 0;
- int rings_now_zero = 0;
- int shield_now_zero = 0;
- int invincibility_now_zero = 0;
- int OldRings;
- int OldLives;
- int OldSpeedShoesCount;
- int OldEnemyBonus2 = 0;
- int OldEnemyBonus3;
- int make_HA_false = 0;
- int restore_oldenemybonus3 = 0;
- int can_play_again = 0;
- int shield_level = 0;
- int FOV = 70;
- ObjectMaster *auraobj = nullptr;
- ObjectMaster *trailobj = nullptr;
- ObjectMaster *hypersparkles = nullptr;
- CollisionInfo *oldcol = nullptr; //character change stuff
- bool just_untransformed = false;
- bool gauge2_lv1 = false;
- bool gauge2_lv2 = false;
- bool gauge2_full = false;
- bool HUD_loaded = false;
- bool glow_down = false;
- bool lvl_glow_down = false;
- bool LV1_obtained = false;
- bool LV2_obtained = false;
- bool LV3_obtained = false;
- bool LV1_active = false;
- bool LV2_active = false;
- bool LV3_active = false;
- bool LV1_usable = false;
- bool LV2_usable = false;
- bool LV3_usable = false;
- bool sonic_lv1_glow_down = false;
- bool sonic_lv2_glow_down = false;
- bool sonic_lv3_glow_down = false;
- bool character_reset = false;
- bool is_sonic = false;
- bool is_tails = false;
- bool is_knuckles = false;
- bool is_shadow = false;
- bool is_amy = false;
- bool is_gamma = false;
- bool is_metalsonic = false;
- bool is_tailsdoll = false;
- bool is_metalknuckles = false;
- bool HUD_alpha_fix = false;
- bool sounds_reset = false;
- bool SONsounds_loaded = false;
- bool SHAsounds_loaded = false;
- bool MSsounds_loaded = false;
- bool PURPLE_GEM_active = false;
- bool black_shield_active = false;
- bool game_start_done = false;
- bool gamma_initialized = false;
- bool sonic_model_loaded = false;
- bool sonic_init_loaded = false;
- bool shadow_init_loaded = false;
- bool metalsonic_init_loaded = false;
- int Gauge;
- int OldGauge;
- int Gauge2;
- int OldGauge2;
- int Gaugebis;
- int OldGaugebis;
- int Gauge2bis;
- int OldGauge2bis;
- int OldRingsHUD;
- int can_animate_gain = 0;
- int can_animate_loss = 0;
- int zero_ring_alpha = 0;
- int energy_glow;
- int energy_lvl_glow;
- int lv1_stretch;
- int lv2_stretch;
- int lv3_stretch;
- int sonic_lv1_glow;
- int sonic_lv2_glow;
- int sonic_lv3_glow;
- int star_glow = 0;
- int circle_glow = 0;
- int level3_glow = 0;
- int sparkletimer = 0;
- int sparkleCBbolttimer = 0;
- int sparkleCBLV3timer = 0;
- float LV3alpha = 0.0f;
- int sparklegemstimer = 0;
- int sparklegems_tiny_timer = 0;
- int sparkleCBtimer = 0;
- int sparkleCB_tiny_timer = 0;
- int sparklechaosblasttimer = 0;
- int sparklechaosblast_tiny_timer = 0;
- int draw = 0;
- int drawCB = 0;
- int checkH = 0;
- int checkV = 0;
- short values[] = { 20, 20, 20, 20, 20, 20 };
- static float heat_float1 = 1.0f; //1
- static float heat_float2 = 0.2f; //0.5
- //From SONIC
- bool air_boost_used = false;
- bool stomp_was_used = false;
- bool bouncing = false;
- bool stomp_was_used_twice = false;
- bool can_use_twice = false;
- bool B_or_X_pressed = false;
- bool bounce_attacking = false;
- bool lightdashflag = false;
- bool NoBoost_OnWater = false;
- bool is_hyper = false;
- bool transforming = false;
- bool just_transformed = false;
- bool is_boosting = false;
- bool is_flying = false;
- bool up_was_pressed = false;
- bool down_was_pressed = false;
- bool spincharging = false;
- bool no_LSA_sound = false;
- bool lightattacking = false;
- bool stop_flying = false;
- bool LSA_charged = false;
- bool no_boost_aura = false;
- bool bouncebracelet_obtained = false;
- bool flamering_obtained = false;
- char LightDashSpeedOUT_unNOP[] = { 0xC7, 0x47, 0x38, 0, 0, 0, 0 };
- char StompAnim[] = { 0x66, 0xC7, 0x87, 0x24, 0x01, 0, 0, 0x40, 0 };
- char HomingSpeed_Data[] = { 0xD9, 0x5F, 0x38 };
- char oldaction;
- char oldmusic;
- char jumpdashspeed1_hyper[] = { 0xC7, 0x47, 0x38, 0, 0, 0xE4, 0x40 };
- char jumpdashspeed1_super[] = { 0xC7, 0x47, 0x38, 0, 0, 0xD0, 0x40 };
- char jumpdashspeed2_hyper[] = { 0xC7, 0x47, 0x38, 0, 0, 0xE4, 0x40 };
- char jumpdashspeed2_super[] = { 0xC7, 0x47, 0x38, 0, 0, 0xD0, 0x40 };
- char SonicLSAcharged_RunSpeed[] = { 0xC7, 0x86, 0xAC, 0, 0, 0, 0, 0, 0x40, 0x40 }; //original 0000003F
- char SuperLSAcharged_RunSpeed[] = { 0xC7, 0x86, 0xAC, 0, 0, 0, 0, 0, 0xC0, 0x40 };
- char alpha = 0;
- float SuperDash = 0.0f;
- float SuperTornado = 16.0f;
- float HyperLightAttackMoving = 16.0f;
- float ringdist = 100.0f;
- float ringmaxspeed = 16.0f;
- float LDringmaxspeed = 0.0f;
- float ringaccel = 0.052f;
- float ringspeedmultiplier = 1.0f;
- float average[2160000]{};//speedometer
- float dist = 0;
- float invinmult = 0.9;
- float SuperHomingSpeed = 6.0f;
- float HyperHomingSpeed = 7.0f;
- float mult = 5;
- float Testtt = 0.0f;
- float S_GA_NO_B_NO_SS = 0.05f;
- float S_GA_NO_B_SS = 0.1f;
- float S_GA_B1_NO_SS = 0.225f;
- float S_GA_B2_NO_SS = 0.15f;
- float S_GA_B1_SS = 0.45f;
- float S_GA_B2_SS = 0.225f;
- float SS_GA_NO_B_NO_SS = 0.085f;
- float SS_GA_NO_B_SS = 0.125f;
- float SS_GA_B1_NO_SS = 0.4f;
- float SS_GA_B2_NO_SS = 0.2f;
- float SS_GA_B1_SS = 0.6f;
- float SS_GA_B2_SS = 0.3f;
- float HS_GA_NO_B_NO_SS = 0.11f;
- float HS_GA_NO_B_SS = 0.15f;
- float HS_GA_B1_NO_SS = 0.5f;
- float HS_GA_B2_NO_SS = 0.25f;
- float HS_GA_B1_SS = 0.75f;
- float HS_GA_B2_SS = 0.375f;
- float S_MA_NO_B_NO_SS = 6.0f;
- float S_MA_NO_B_SS = 9.0f;
- float S_MA_B_NO_SS = 7.0f;
- float S_MA_B_SS = 10.5f;
- float SS_MA_NO_B_NO_SS = 8.5f;
- float SS_MA_NO_B_SS = 12.75f;
- float SS_MA_B_NO_SS = 10.25f;
- float SS_MA_B_SS = 15.375f;
- float HS_MA_NO_B_NO_SS = 10.5f;
- float HS_MA_NO_B_SS = 15.75f;
- float HS_MA_B_NO_SS = 13.5f;
- float HS_MA_B_SS = 20.25f;
- float sonic_accel = 0.0f;
- float GD_NO_B = -0.06f;
- float S_GD_B = 0.098f;
- float SS_GD_B = 0.143f;
- float HS_GD_B = 0.193f;
- short oldcount;
- int BoostSFX[]{ 780, 781 };
- int BoostVoices[]{ 770, 773, 776 };
- int SonicTrick3Timer1 = 0;
- int SonicTrick3Timer2 = 0;
- int BoostVarGrd = 0;
- int BoostVarAir = 0;
- int stompvar = 0;
- int stompvar2 = 0;
- int bouncevar = 0;
- int boostvoice = 0;
- int animation = 0;
- int average_index = 0;//speedometer
- int current_length = 0;
- int transforming_time = 0;
- int transform_anim = 0;
- int firstanim_speedup = 0;
- int untransforming = 0;
- int SUPERSONICSpinballtextures[] = { 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127 };
- int HYPERSONICSpinballtextures[] = { 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159 };
- int SONICBBtextures[] = { 391, 392, 393, 394, 393, 392 };
- int SONICFRtextures[] = { 395, 396, 397, 398, 399, 400, 400, 400, 400, 400, 400, 399, 398, 397, 396, 395 };
- int testvar = 0;
- int super_rings_depletion = 0;
- int hyper_rings_depletion = 0;
- int testvar3 = 0;
- int LSA_var = 0;
- int fly_then_ground = 0;
- int flying_to_NOTflying = 0;
- short oldanim;
- //From SHADOW
- bool just_rolled = false;
- bool cant_punch_now = false;
- bool can_go_back_to_shadow = false;
- bool X_is_held = false;
- bool didnt_target = false;
- bool ready = false;
- bool cant_chaos_spear = false;
- bool cant_chaos_spear2 = false;
- bool is_CB = false;
- bool X_was_pressed = false;
- bool cant_chaos_spear_again = false;
- bool pressed_X_while_Gamma = false;
- bool DO_chaos_spear_again = false;
- bool cant_spindash = false;
- bool CS_launch_was_played = false;
- bool CS_charging_was_played = false;
- bool CS_empty_was_played = false;
- bool is_in_CS_state = false;
- bool X_was_released = false;
- bool has_homing_attacked = false;
- bool CB_lv1 = false;
- bool CB_lv2 = false;
- bool CB_lv3 = false;
- bool using_chaos_blast = false;
- bool transforming_CB = false;
- bool CHAOSBLAST_was_played = false;
- bool go_back_to_gameplay = false;
- bool do_multi_punch = false;
- bool has_punched_once = false;
- bool knuckles_teleport_to_sonic = false;
- bool knuckles_teleported_away = false;
- bool punching_1 = false;
- bool punching_2 = false;
- bool punching_3 = false;
- bool is_punching = false;
- bool can_run_again = false;
- bool shadow_sounds_back = false;
- bool stop_aim_everywhere = false;
- char jumpdashspeed1[] = { 0xC7, 0x47, 0x38, 0, 0, 0xE0, 0x40 };
- char jumpdashspeed1_orig[] = { 0xC7, 0x47, 0x38, 0, 0, 0xA0, 0x40 };
- char jumpdashspeed2[] = { 0xC7, 0x47, 0x38, 0, 0, 0xE0, 0x40 };
- char jumpdashspeed2_orig[] = { 0xC7, 0x47, 0x38, 0, 0, 0xA0, 0x40 };
- char knuxattackdata[] = { 0x66, 0x89, 0xB2, 0x24, 0x01, 0, 0 };
- char knuxobjectcrash_NOP[] = { 0xB8, 0, 0, 0, 0 };
- char knuxobjectcrash_unNOP[] = { 0xE8, 0x7B, 0x0F, 0xF9, 0xFF };
- char jump_cancel_unNOP[] = { 0xC6, 0x06, 0x0C };
- char shadow3rdpunchspeed[] = { 0xC7, 0x47, 0x38, 0, 0, 0x00, 0x41 };
- char enable_GAMMAflashing[] = { 0x66, 0x89, 0x43, 0x06 };
- char supersonic_homingspeed[] = { 0xC7, 0x47, 0x38, 0, 0, 0xE0, 0x40 };
- char CB_LV1_stuff1[] = { 0xC6, 0x45, 0, 0x0C };
- char CB_LV1_stuff2[] = { 0x80, 0x65, 0x05, 0xFA };
- char CB_LV1_stuff3[] = { 0xD9, 0x5F, 0x38 };
- float ChaosBoostLv1 = 7.0f;
- float UN_ChaosBoostLv1 = 5.0f;
- float CBHomingAttackStatic = 0.0f;
- float CBHomingAttackMoving = 7.0f;
- float missilespeed = 10.0f;
- float old_X_position;
- float old_Y_position;
- float old_Z_position;
- float OldBombRadius;
- float cbBLUEsize = 0.0f;
- float cbREDsize = 0.0f;
- int CBHomingAttackTimer = 0;
- int ShadowTrick1Timer1 = 0;
- int ShadowTrick1Timer2 = 0;
- int ShadowTrick2Timer1 = 0;
- int ShadowTrick2Timer2 = 0;
- int ShadowTrick3Timer1 = 0;
- int ShadowTrick3Timer2 = 0;
- int SpindashNOPingTimer = 0;
- int punchattack = 0;
- int justrolled = 0;
- int no_longer_punching = 0;
- int backtoshadow1 = 0;
- int backtoshadow2 = 0;
- int LD_punch = 0;
- int no_z_speed = 0;
- int chaos_spear_stop = 0;
- int stop_supersonic = 0;
- int didnt_target_OK = 0;
- int can_chaos_spear_again = 0;
- int gonna_chaos_spear_again = 0;
- int X_gonna_be_unheld = 0;
- int transforming_CB_time = 0;
- int chaos_blast_active_timer = 0;
- int X_was_released_int = 0;
- int cant_release_X = 0;
- int anim_84_was_played = 0;
- int can_multi_punch = 0;
- int chaos_blast_radius_timer = 0;
- int will_punch = 0;
- int stopped_punching = 0;
- int knuckles_really_is_away = 0;
- int stop_punching = 0;
- int X_press = 0;
- int can_X_press = 0;
- int aim_everywhere = 0;
- int SHADOWCBfurtextures[] = { 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, 316, 315, 314 };
- int SHADOWCBshoestextures[] = { 160, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, 377, 376 };
- int SHADOWCBSpinballtextures[] = { 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248 };
- int SUPERSHADOWSpinballtextures[] = { 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280 };
- int SUPERSHADOWCBSpinballtextures[] = { 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312 };
- int anim84speed = 0;
- int chaosblasttex = 0;
- int transforming_CB_redball_time = 0;
- //int chaosblastBOLT0[] = { 433, 432, 432, 372, 433, 372, 431, 432, 372, 431, 432, 433, 433, 432, 431, 432 };
- //int chaosblastBOLT1[] = { 432, 431, 433, 372, 433, 372, 432, 372, 372, 433, 433, 372, 432, 372, 432, 433 };
- //int chaosblastBOLT2[] = { 432, 372, 372, 372, 372, 433, 432, 372, 432, 372, 372, 432, 431, 372, 433, 431 };
- short oldcountSonic;
- short oldcountGamma;
- short oldcountKnux;
- //From METALSONIC
- bool MagneticBarrierTakenOFF = false;
- bool full_barrier = false;
- bool fully_charged = false;
- bool cant_blaze_homing = false;
- bool blaze_homing_attacking = false;
- bool is_hovering = false;
- bool A_was_pressed = false;
- bool Z_WHITE_was_pressed = false;
- bool anim_was_17 = false;
- bool cant_playsound = false;
- bool has_played = false;
- bool sound_was_played = false;
- bool first_sound_played = false;
- bool _1238_was_played = false;
- bool _1239_was_played = false;
- bool _1240_was_played = false;
- bool _1241_was_played = false;
- bool _1242_was_played = false;
- bool no_jumping_sound = false;
- bool play_metal_charge_sound = false;
- bool can_use_dash = false;
- bool is_on_ground = false;
- bool do_dash = false;
- bool BLUE_GEM_active = false;
- bool BLUE_GEM_used = false;
- bool RED_GEM_active = false;
- bool RED_GEM_used = false;
- bool GREEN_GEM_active = false;
- bool GREEN_GEM_used = false;
- bool WHITE_GEM_active = false;
- bool SKY_GEM_active = false;
- bool stop_white_gem = false;
- bool YELLOW_GEM_active = false;
- bool cant_hover = false;
- bool reduce_invulnerable_time = false;
- bool gauge_auto_fill_ON = false;
- bool gauge_is_filling = false;
- bool black_shield_used = false;
- bool can_attack = false;
- bool spiiin_sound_played = false;
- bool can_charge = false;
- bool can_prepare_shield_timer = false;
- bool BHA_launch = false;
- bool from_white_to_fall = false;
- bool cant_use_yellow_gem = false;
- bool use_blaze_bomb = false;
- bool can_use_blaze_bomb = false;
- bool NJB_active = false;
- bool NJB_loaded = false;
- char anim1data[] = { 0x66, 0xC7, 0x87, 0x24, 0x1, 0, 0, 0x40, 0 };
- char anim2data[] = { 0x66, 0xC7, 0x83, 0x24, 0x1, 0, 0, 0x14, 0 };
- char anim3data[] = { 0x66, 0xC7, 0x86, 0x24, 0x1, 0, 0, 0x09, 0 };
- char anim4data[] = { 0x66, 0xC7, 0x85, 0x24, 0x1, 0, 0, 0x12, 0 };
- char anim5data[] = { 0x66, 0xC7, 0x83, 0x24, 0x1, 0, 0, 0x01, 0 };
- char jumpdashdata1[] = { 0x80, 0x65, 0x5, 0xFA };
- char jumpdashdata2[] = { 0xC6, 0x45, 0, 0x08 };
- char jumpdashdata2_orig[] = { 0xC6, 0x45, 0, 0x0C };
- char jumpdashdata3[] = { 0x66, 0xC7, 0x83, 0x24, 0x1, 0, 0, 0x0E, 0 };
- char jumpdashdata3_orig[] = { 0x66, 0xC7, 0x83, 0x24, 0x1, 0, 0, 0x12, 0 };
- char blaze_lasting_time [] = { 0x66, 0x3D, 0xF0, 0x7F }; //orig 66 3D 68 01
- char amy_spinning_hammer_allow_stop[] = { 0x66, 0x89, 0xBB, 0x24, 0x01, 0, 0 };
- char amyobjectcrash_NOP[] = { 0xB8, 0, 0, 0, 0 };
- char amyobjectcrash_unNOP[] = { 0xE8, 0xF7, 0x0A, 0xF8, 0xFF };
- char Metal_HSpeed_data[] = { 0x89, 0x48, 0x3C };
- char Metal_VSpeed_data[] = { 0x89, 0x48, 0x38 };
- int charge_sound = 0;
- int backtometal = 0;
- int ObjCol = 0;
- int blaze_homing_timer = 0;
- int black_shield_timer = 0;
- int can_hover = 0;
- int MetalHoverStaticTimer = 0;
- int MetalHoverMovingTimer = 0;
- int can_hover_again = 0;
- int anim_can_be_32 = 0;
- int spinning_sound = 0;
- int SOUNDTEST = 0;
- int play_moving_sound = 0;
- int metal_dash_timer = 0;
- int do_dash_timer = 0;
- int metal_spinning_sound_timer = 0;
- int cant_hover_timer = 0;
- int tails_teleport_timer = 0;
- int tails_attack_timer = 0;
- int stop_supersonic_upgrade = 0;
- int gauge_auto_fill = 0;
- int can_use_spiiin_sound = 0;
- int white_to_NOTwhite = 0;
- int whiteON_then_ground = 0;
- int stop_LSA = 0;
- int use_fall_anim = 0;
- int stop_blaze_bomb = 0;
- int METALSONICFIRE_A_textures[] = { 346, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370 };
- int METALSONICFIRE_B_textures[] = { 347, 408, 409, 410, 411, 412, 413, 414 };
- int gemaura = 354;
- int blackshieldrotate = 0;
- int unload_NJB = 0;
- float MetalSuperDash = 100.0f;
- float MetalSuperTornado = 100.0f;
- float MetalLightAttackMoving = 16.0f;
- float oldspeedx;
- float MS_MA_NORMAL_NO_SS = 3.0f;
- float MS_MA_NORMAL_SS = 6.0f;
- float MS_MA_BLUE_NO_SS = 4.5f;
- float MS_MA_BLUE_SS = 9.0f;
- float MS_MA_GREEN_NO_SS = 4.5f;
- float MS_MA_GREEN_SS = 9.0f;
- float MS_GA_NORMAL_NO_SS = 0.05f;
- float MS_GA_NORMAL_SS = 0.05f;
- float MS_GA_BLUE_NO_SS = 0.05f;
- float MS_GA_BLUE_SS = 0.05f;
- float MS_GA_GREEN_NO_SS = 0.05f;
- float MS_GA_GREEN_SS = 0.05f;
- float MS_f68_NORMAL_NO_SS = 3.0f;
- float MS_f68_NORMAL_SS = 6.0f;
- float MS_f68_BLUE_NO_SS = -0.64125f;
- float MS_f68_BLUE_SS = -1.2825f;
- float MS_f68_GREEN_NO_SS = 4.5f;
- float MS_f68_GREEN_SS = 9.0f;
- float MS_JS_NORMAL = 2.0f;
- float MS_JS_GREEN = 2.0f;
- float MS_JAS_NORMAL = 0.05f;
- float MS_JAS_GREEN = 0.05f;
- float MS_AA_NORMAL_NO_SS = 0.05f;
- float MS_AA_NORMAL_SS = 0.05f;
- float MS_AA_GREEN_NO_SS = 0.05f;
- float MS_AA_GREEN_SS = 0.05f;
- float MS_AA_WHITE_NO_SS_NO_Y = 0.02375f;
- float MS_AA_WHITE_SS_NO_Y = 0.03375f;
- float MS_AA_WHITE_NO_SS_Y = 0.0475f;
- float MS_AA_WHITE_SS_Y = 0.0675f;
- float MS_AD_NORMAL = -0.005f;
- float MS_AD_GREEN = -0.005f;
- float MS_AD_WHITE = -0.0065f;
- //void __cdecl AddEnemyPoints(int points)
- //{
- // int v1; // eax@2
- //
- // if (EnemyComboTimer <= 0)
- // {
- // EnemyComboPoints = 0;
- // }
- // v1 = EnemyComboPoints + 1;
- // if (v1 > 10)
- // {
- // v1 = 10;
- // }
- // EnemyComboPoints = v1;
- // EnemyComboTimer = 120;
- // switch (EnemyComboPoints)
- // {
- // case 1:
- // points = 100;
- // break;
- // case 2:
- // points = 200;
- // break;
- // case 3:
- // points = 300;
- // break;
- // case 4:
- // points = 400;
- // break;
- // case 5:
- // points = 500;
- // break;
- // case 6:
- // points = 600;
- // break;
- // case 7:
- // points = 800;
- // break;
- // case 8:
- // points = 1000;
- // break;
- // case 9:
- // points = 1500;
- // break;
- // default:
- // points = 2000;
- // break;
- // }
- // EnemyBonus += points;
- //}
- //Timer bonus points
- float __cdecl GetTimeBonus_r()
- {
- double result; // st7@3
- if (GetCurrentCharacterID() == Characters_Gamma)
- {
- if (TimeMinutes < 3)
- {
- return (double)(TimeSeconds + 60 * TimeMinutes) * 25.0;
- }
- return 5000.0;
- }
- if (!TimeMinutes)
- {
- return 10000.0;
- }
- result = 10000.0 - (double)(TimeSeconds + 60 * (TimeMinutes - 1)) * 20.0;
- if (result < 0.0)
- {
- result = 0.0;
- }
- return result;
- }
- //For Metal's Yellow Shield
- ObjectMaster *magobj = nullptr;
- void __cdecl GiveMagneticBarrier_r(char character)
- {
- if (character >= 1 && character > 7 && !EntityData1Ptrs[character])
- character = 0;
- CharObj2 *co2 = CharObj2Ptrs[character];
- if (co2 && !(co2->Powerups & Powerups_MagneticBarrier))
- {
- if (shield_level == 1)
- {
- co2->Powerups &= ~Powerups_Barrier;
- co2->Powerups |= Powerups_MagneticBarrier;
- shield_level = 2;
- }
- else
- {
- magobj = LoadObject(LoadObj_Data1, 2, MagneticBarrier_Load);
- if (magobj)
- {
- magobj->Data1->CharIndex = character;
- co2->Powerups &= ~Powerups_Barrier;
- co2->Powerups |= Powerups_MagneticBarrier;
- }
- }
- }
- }
- //For Ingame Soundbanks Change
- SoundFileInfo SONSoundFiles[] = {
- { 0, "SON_COMMON_BANK00" },
- { 2, "SON_check_sheet_bank02" },
- { 3, "SON_P_SONICTAILS_BANK03" },
- { 6, "SON_V_SONICTAILS_E_BANK06" }
- };
- SoundFileInfo SHASoundFiles[] = {
- { 0, "SHA_COMMON_BANK00" },
- { 2, "SHA_check_sheet_bank02" },
- { 3, "SHA_P_SONICTAILS_BANK03" },
- { 6, "SHA_V_SONICTAILS_E_BANK06" }
- };
- SoundFileInfo MSSoundFiles[] = {
- { 0, "MS_COMMON_BANK00" },
- { 2, "MS_check_sheet_bank02" },
- { 3, "MS_P_SONICTAILS_BANK03" },
- { 6, "MS_V_SONICTAILS_E_BANK06" }
- };
- SoundList SONSoundList = { arraylengthandptrT(SONSoundFiles, int) };
- SoundList SHASoundList = { arraylengthandptrT(SHASoundFiles, int) };
- SoundList MSSoundList = { arraylengthandptrT(MSSoundFiles, int) };
- int SONSoundListID = -1;
- int SHASoundListID = -1;
- int MSSoundListID = -1;
- //SA2 jumpball //njRotateY(nullptr, rotation_variable); *********** for metal's black shield
- NJS_VECTOR Sonic_Previous_Positions[6];
- int Sonic_Position_Index;
- void SA2_jumpball(EntityData1 *a1, CharObj2 *a2)
- {
- if (GameState == 4/* || EntityData1Ptrs[0]->Action != 8*/)
- {
- for (int i = 0; i < LengthOfArray(Sonic_Previous_Positions); i++)
- Sonic_Previous_Positions[i] = a1->Position;
- Sonic_Position_Index = 0;
- }
- if (EntityData1Ptrs[0]->Action == 8 && (a2->AnimationThing.Index == 14 || a2->AnimationThing.Index == 32) && !is_boosting && !bounce_attacking && !bouncing/* && (GameState == 4 || GameState == 15)*/)
- {
- njSetTexture((NJS_TEXLIST*)0x927CB8);
- HMODULE moduleHandle = GetModuleHandle(L"CHRMODELS_orig");
- NJS_OBJECT **___SONIC_OBJECTS = (NJS_OBJECT**)GetProcAddress(moduleHandle, "___SONIC_OBJECTS");
- int pos_index = Sonic_Position_Index - 1;
- if (pos_index < 0) pos_index += LengthOfArray(Sonic_Previous_Positions);
- njPushMatrix(nullptr);
- njTranslateV(nullptr, &Sonic_Previous_Positions[pos_index]);
- njTranslate(nullptr, 0, 5, 0);
- njRotateX(nullptr, Camera_Data1->Rotation.x);
- njRotateY(nullptr, Camera_Data1->Rotation.y);
- njRotateZ(nullptr, Camera_Data1->Rotation.z);
- njScale(nullptr, 1.15f, 1.15f, 1.15f);
- ProcessModelNode_B(___SONIC_OBJECTS[56], 1);
- njPopMatrix(1);
- pos_index -= 1;
- if (pos_index < 0) pos_index += LengthOfArray(Sonic_Previous_Positions);
- njPushMatrix(nullptr);
- njTranslateV(nullptr, &Sonic_Previous_Positions[pos_index]);
- njTranslate(nullptr, 0, 5, 0);
- njRotateX(nullptr, Camera_Data1->Rotation.x);
- njRotateY(nullptr, Camera_Data1->Rotation.y);
- njRotateZ(nullptr, Camera_Data1->Rotation.z);
- njScale(nullptr, 0.8625f, 0.8625f, 0.8625f);
- ProcessModelNode_B(___SONIC_OBJECTS[56], 1);
- njPopMatrix(1);
- pos_index -= 1;
- if (pos_index < 0) pos_index += LengthOfArray(Sonic_Previous_Positions);
- njPushMatrix(nullptr);
- njTranslateV(nullptr, &Sonic_Previous_Positions[pos_index]);
- njTranslate(nullptr, 0, 5, 0);
- njRotateX(nullptr, Camera_Data1->Rotation.x);
- njRotateY(nullptr, Camera_Data1->Rotation.y);
- njRotateZ(nullptr, Camera_Data1->Rotation.z);
- njScale(nullptr, 0.575f, 0.575f, 0.575f);
- ProcessModelNode_B(___SONIC_OBJECTS[56], 1);
- njPopMatrix(1);
- }
- Sonic_Previous_Positions[Sonic_Position_Index++] = a1->Position;
- Sonic_Position_Index %= LengthOfArray(Sonic_Previous_Positions);
- }
- //ObjectFunc(sub_441D50, 0x441D50);
- void SetSpeedShoes(ObjectMaster *obj)
- {
- SpeedShoesCount++;
- sub_441D50(obj);
- }
- //ObjectFunc(sub_441D10, 0x441D10);
- void UnsetSpeedShoes(ObjectMaster *obj)
- {
- if (SpeedShoesCount > 0)
- SpeedShoesCount--;
- sub_441D10(obj);
- }
- void SetInvincible(ObjectMaster *obj)
- {
- was_invincible_before = true;
- RunObjectChildren(obj);
- }
- void UnsetInvincible(ObjectMaster *obj)
- {
- was_invincible_before = false;
- CheckThingButThenDeleteObject(obj);
- }
- void PlayHomingSound() { PlaySound(HomingSounds[rand() % 4], 0, 0, 0); }
- void MetalSonic_AfterImage_Display_r(ObjectMaster *obj)
- {
- njSetTexture((NJS_TEXLIST*)0x91CB58);
- MetalSonic_AfterImage_Display(obj);
- }
- //Variable Reset Function
- void VariablesReset()
- {
- EntityData1* co1 = EntityData1Ptrs[0];
- CharObj2 *co2 = GetCharObj2(0);
- ((AnimData_t*)0x3C56210)[0].Property = 3;
- ((AnimData_t*)0x3C56210)[0].AnimationSpeed = 0.5;
- ((AnimData_t*)0x3C56210)[1].Property = 4;
- ((AnimData_t*)0x3C56210)[1].AnimationSpeed = 0.25;
- ((AnimData_t*)0x3C56210)[1].TransitionSpeed = 0.25;
- ((AnimData_t*)0x3C56210)[2].Property = 3;
- ((AnimData_t*)0x3C56210)[2].AnimationSpeed = 0.25;
- ((AnimData_t*)0x3C56210)[2].TransitionSpeed = 0.25;
- ((AnimData_t*)0x3C56210)[3].Property = 4;
- ((AnimData_t*)0x3C56210)[3].AnimationSpeed = 1.0;
- ((AnimData_t*)0x3C56210)[4].Property = 4;
- ((AnimData_t*)0x3C56210)[4].AnimationSpeed = 0.25;
- ((AnimData_t*)0x3C56210)[5].Property = 4;
- ((AnimData_t*)0x3C56210)[5].AnimationSpeed = 0.25;
- ((AnimData_t*)0x3C56210)[6].Property = 6;
- ((AnimData_t*)0x3C56210)[6].AnimationSpeed = 0.25;
- ((AnimData_t*)0x3C56210)[9].Property = 10;
- ((AnimData_t*)0x3C56210)[9].AnimationSpeed = 3.4;
- ((AnimData_t*)0x3C56210)[10].Property = 10;
- ((AnimData_t*)0x3C56210)[10].AnimationSpeed = 1.4;
- ((AnimData_t*)0x3C56210)[11].Property = 10;
- ((AnimData_t*)0x3C56210)[11].AnimationSpeed = 0.8;
- ((AnimData_t*)0x3C56210)[12].Property = 10;
- ((AnimData_t*)0x3C56210)[12].AnimationSpeed = 0.5;
- ((AnimData_t*)0x3C56210)[13].Property = 9;
- ((AnimData_t*)0x3C56210)[13].AnimationSpeed = 0.5;
- ((AnimData_t*)0x3C56210)[14].Property = 10;
- ((AnimData_t*)0x3C56210)[14].AnimationSpeed = 0.2;
- ((AnimData_t*)0x3C49D90)[15].Property = 9;
- ((AnimData_t*)0x3C56210)[15].AnimationSpeed = 0.7;
- ((AnimData_t*)0x3C56210)[18].AnimationSpeed = 1;
- ((AnimData_t*)0x3C56210)[18].TransitionSpeed = 0.25;
- ((AnimData_t*)0x3C56210)[27].AnimationSpeed = 1.0;
- ((AnimData_t*)0x3C56210)[28].AnimationSpeed = 1.0;
- ((AnimData_t*)0x3C56210)[29].AnimationSpeed = 1.0;
- ((AnimData_t*)0x3C56210)[31].TransitionSpeed = 0.0625;
- ((AnimData_t*)0x3C56210)[34].Property = 3;
- ((AnimData_t*)0x3C56210)[34].AnimationSpeed = 1.0;
- ((AnimData_t*)0x3C56210)[38].Property = 3;
- ((AnimData_t*)0x3C56210)[38].AnimationSpeed = 1;
- ((AnimData_t*)0x3C56210)[40].AnimationSpeed = 1;
- ((AnimData_t*)0x3C56210)[42].AnimationSpeed = 1;
- ((AnimData_t*)0x3C56210)[54].AnimationSpeed = 0.5;
- ((AnimData_t*)0x3C56210)[64].TransitionSpeed = 1.0;
- ((AnimData_t*)0x3C56210)[64].AnimationSpeed = 1.0;
- ((AnimData_t*)0x3C56210)[75].AnimationSpeed = 1.0;
- ((AnimData_t*)0x3C56210)[84].AnimationSpeed = 0.25;
- ((AnimData_t*)0x3C56210)[85].AnimationSpeed = 0.5;
- ((AnimData_t*)0x3C56210)[116].AnimationSpeed = 0.85;
- ((AnimData_t*)0x3C56210)[117].AnimationSpeed = 0.85;
- ((AnimData_t*)0x3C56210)[119].AnimationSpeed = 0.85;
- ((AnimData_t*)0x3C56210)[135].AnimationSpeed = 0.5;
- //CHANGE ALL THOSE WITH THE ONES BELOW IN THE GAMEPLAY CPPS
- PhysicsArray[Characters_Sonic].Run1 = 2.3;
- PhysicsArray[Characters_Sonic].Run2 = 5.09;
- PhysicsArray[Characters_Sonic].HangTime = 60;
- PhysicsArray[Characters_Sonic].MaxAccel = 3.0;
- PhysicsArray[Characters_Sonic].field_68 = -0.2825;
- PhysicsArray[Characters_Sonic].GroundAccel = 0.05;
- PhysicsArray[Characters_Sonic].JumpSpeed = 1.66;
- PhysicsArray[Characters_Sonic].AirAccel = 0.031;
- PhysicsArray[Characters_Sonic].AirBrake = -0.17;
- co2->PhysicsData.MaxAccel = 3.0;
- co2->PhysicsData.HangTime = 60;
- co2->PhysicsData.Brake = -0.18;
- co2->PhysicsData.RollDecel = -0.008;
- co2->PhysicsData.RollCancel = 0.46;
- co2->PhysicsData.RollEnd = 1.39;
- co2->PhysicsData.Run1 = 2.3;
- co2->PhysicsData.Run2 = 5.09;
- co2->PhysicsData.AirDecel = -0.028;
- co2->PhysicsData.YOff = 5.4;
- co2->PhysicsData.JumpSpeed = 1.66;
- co2->PhysicsData.JumpAddSpeed = 0.076;
- co2->PhysicsData.AirAccel = 0.031;
- co2->PhysicsData.RippleSize = 4;
- co2->PhysicsData.Gravity = 0.08;
- co2->PhysicsData.field_68 = -0.2825;
- co2->PhysicsData.GroundAccel = 0.05;
- co2->PhysicsData.GroundDecel = -0.06;
- WriteData((float**)0x4B9D1E, &invinmult_orig);
- WriteData((void*)0x4BA276, invinsize_orig);
- WriteData((void*)0x4BA280, invin_stuff_unNOP);
- WriteData((void*)0x44AE9A, enable_dying);
- WriteData((void*)0x446FBB, enable_drowning);
- WriteData((void*)0x43CC72, gravity_orig);
- WriteData((void*)0x4951BE, rollingdata);
- WriteData((void*)0x49234D, homingoutspeed_orig);
- WriteData((void*)0x497CB5, homingstuff_orig);
- WriteData((void*)0x497CC2, homingaction_orig);
- WriteData((float*)0x496F23, (float)2.0f);
- WriteData((float*)0x7DCB34, (float)10.0f);
- WriteData((float*)0x7DD550, (float)0.4f);
- WriteData((void*)0x4C4DA9, enable_aiming);
- WriteData((void*)0x4C475B, enable_shooting);
- WriteData((void*)0x4C4643, shooting05_unNOP);
- WriteData((float**)0x4C41CD, &missilespeed_orig);
- WriteData((float**)0x4C41DC, &missilespeed_orig);
- WriteData((float**)0x4C41E8, &missilespeed_orig);
- WriteData((char*)Sonic_Display, (char)0x8B);
- WriteData((char*)Knuckles_Display, (char)0x83);
- WriteData((char*)0x4977AB, (char)0x74);//Allows homing attack
- WriteData((void*)0x4976FF, landing_NOattack1_unNOP);
- WriteData((void*)0x497741, landing_NOattack2_unNOP);
- WriteData((void*)0x497756, landing_NOattack3_unNOP);
- WriteData((void*)0x49777A, landing_NOattack4_unNOP);
- WriteData((void*)0x494AF9, balldata);
- WriteData((void*)0x4496E1, WalkOnWaterData);
- WriteData((void*)0x496EF8, SpindashData);
- WriteData((void*)0x43CBC9, gravity_underwater_orig);
- WriteData((void*)0x47419A, shadow3rdpunchspeed_orig);
- WriteData((char*)0x47824B, (char)0x74);
- WriteData((void*)0x497013, enable_SONIC_KNUXflashing);
- WriteData((void*)0x494C56, jumpdashspeed1_normal);
- WriteData((void*)0x494C2C, jumpdashspeed2_normal);
- WriteData((float**)0x0049265F, &NormalHomingSpeed);
- WriteData((short*)0x4C4E34, (short)180);//Gamma infinite aiming laser timer
- WriteData((void*)0x43C55D, HSpeed_data);
- WriteData((void*)0x43C560, VSpeed_data);
- WriteData((void*)0x4916DB, to_standing_data);
- WriteData((short*)0x497A88, (short)1);
- WriteData((short*)0x49773F, (short)2);
- WriteData((short*)0x4916FF, (short)4);
- WriteData((short*)0x495E46, (short)9);
- WriteData((short*)0x495E2C, (short)10);
- WriteData((short*)0x495BDA, (short)11);
- WriteData((short*)0x495B44, (short)12);
- WriteData((short*)0x495C27, (short)13);
- WriteData((void*)0x4950D9, SonicLSAcharged_RunSpeed_orig);
- WriteData((void*)0x44FABF, always_attract_rings_unNOP);
- WriteData((void*)0x493047, LightDash_unNOP);
- WriteData((void*)0x49308D, LSA_sound);
- WriteData((void*)0x49AF36, LightDashTrail_unNOP);
- WriteData((float**)0x492A3B, &LightAttackMoving_orig);
- WriteData((float**)0x492A4F, &LightAttackMoving_orig);
- WriteData((float**)0x492A6A, &LightAttackMoving_orig);
- WriteData((void*)0x43BFCB, HangTimeCheckData);
- WriteData((void*)0x4951D5, spindash_outspeed_orig);
- WriteData((void*)0x497B81, blaze_lasting_time_orig);
- WriteData((void*)0x4930F9, rollingweirdfix1);
- WriteData((void*)0x4916DB, rollingweirdfix2);
- WriteData((void*)0x49876D, unknown_49876D);
- WriteData((void*)0x492F73, unknown_492F73);
- WriteData((void*)0x55E95C, unknown_55E95C);
- WriteData((void*)0x444103, unknown_444103);
- WriteData((void*)0x493067, unknown_493067);
- WriteData((void*)0x492CAE, unknown_492CAE);
- WriteData((void*)0x4975AC, unknown_4975AC);
- WriteData((void*)0x49304C, unknown_49304C);
- WriteData((void*)0x460EA6, unknown_460EA6);
- WriteData((void*)0x4950A9, unknown_4950A9);
- //WriteData((void*)0x492F68, unknown_492F68);
- WriteData((char*)0x492F6A, (char)0x0C);
- WriteData((void*)0x4975BC, unknown_4975BC);
- WriteData((void*)0x494C19, unknown_494C19);
- WriteData((float*)0x44FBDD, ringmaxspeed_orig);
- WriteData((char*)0x496EF6, (char)0x74);
- WriteData((char*)0x4C09F9, (char)0x75);
- WriteData((char*)0x498763, (char)0x0C);
- WriteData((char*)0x4CEA60, (char)0x8B);
- WriteData((char*)0x4976AD, (char)0x75);
- WriteData((char*)0x49309C, (char)0x75);
- WriteData((char*)0x4975A2, (char)13);
- WriteData((short*)0x49305C, (short)10);
- WriteData((short*)0x4975B3, (short)20);
- WriteData((short*)0x495097, (short)210);
- WriteData((short*)0x495156, (short)300);
- WriteData((short*)0x494FDC, (short)18);
- WriteData((short*)0x497CC0, (short)18);
- WriteData((short*)0x4BA46D, (short)1380);//invincibility timer
- WriteData((short*)0x497754, (short)19);
- WriteData((short*)0x49691F, (short)0);
- WriteData((short*)0x4984A3, (short)74);
- WriteData((short*)0x49629E, (short)44);
- WriteData((short*)0x4962BF, (short)45);
- WriteData((short*)0x4951D3, (short)15);
- WriteData((float*)0x44FBBA, 50.0f);
- WriteData((float*)0x492FEB, (float)0.0f);
- WriteData((float**)0x44FAFF, (float*)0x7DD574);
- WriteData((float**)0x44FBC4, (float*)0x7E05C4);
- WriteData((float**)0x44FBCE, (float*)0x7DCCFC);
- WriteData((float**)0x44FC2A, (float*)0x7DCC98);
- WriteData((void*)0x55E6F5, SuperSplashAura);
- WriteData((void*)0x55E7A8, SuperSplashData);
- WriteData((void*)0x55EEBF, SuperSplashScale);
- //Shared variables
- r = false;
- fall_after_roll = false;
- homing = false;
- just_homing_attacked = false;
- in_air_after_homing = false;
- dashing = false;
- no_longer_dashing = false;
- was_on_trampoline = false;
- was_invincible_before = false;
- LightDash_SuperDash_ON = false;
- just_flipped = false;
- just_spindashed = false;
- no_light_attack = false;
- Z_was_pressed_on_ground = false;
- Z_was_pressed_in_air = false;
- was_on_ground = false;
- LSA_launch = false;
- LSA_used = false;
- ok = false;
- is_paused = false;
- LD_fix = false;
- GO_sound_played = false;
- //BLUE_GEM_ON = false;
- //RED_GEM_ON = false;
- //GREEN_GEM_ON = false;
- //PURPLE_GEM_ON = false;
- //SKY_GEM_ON = false;
- //WHITE_GEM_ON = false;
- //YELLOW_GEM_ON = false;
- //NO_GEM_ON = false;
- has_rings = false;
- has_shield = false;
- has_invincibility = false;
- was_hit = false;
- gauge_full = false;
- homing_attacking = false;
- cant_play_again = false;
- just_charged = false;
- CB_active = false;
- is_super = false;
- punching = false;
- PURPLE_GEM_used = false;
- stop_sky_gem = false;
- LightDash_SuperDash = -100.0f;
- Boost_SuperTornado = -100.0f;
- LightAttackStatic = 0.0f;
- LightAttackMoving = 8.0f;
- LightAttackMoving_orig = 10.0f;
- SuperLightAttackMoving = 12.0f;
- LDringdist = 0.0f;
- LightAttackTimer = 0;
- HangTimeLikeHeroes = 0;
- SpeedShoesCount = 0;
- homing_reattack_timer = 0;
- NOP_forced_out_speed = 0;
- paused = 0;
- rings_now_zero = 0;
- shield_now_zero = 0;
- invincibility_now_zero = 0;
- OldRings;
- OldLives;
- OldSpeedShoesCount;
- OldEnemyBonus2 = 0;
- OldEnemyBonus3;
- make_HA_false = 0;
- restore_oldenemybonus3 = 0;
- can_play_again = 0;
- shield_level = 0;
- FOV = 70;
- just_untransformed = false;
- gauge2_lv1 = false;
- gauge2_lv2 = false;
- gauge2_full = false;
- HUD_loaded = false;
- glow_down = false;
- lvl_glow_down = false;
- LV1_obtained = false;
- LV2_obtained = false;
- LV3_obtained = false;
- LV1_active = false;
- LV2_active = false;
- LV3_active = false;
- LV1_usable = false;
- LV2_usable = false;
- LV3_usable = false;
- sonic_lv1_glow_down = false;
- sonic_lv2_glow_down = false;
- sonic_lv3_glow_down = false;
- character_reset = false;
- is_sonic = false;
- is_tails = false;
- is_knuckles = false;
- is_shadow = false;
- is_amy = false;
- is_gamma = false;
- is_metalsonic = false;
- is_tailsdoll = false;
- is_metalknuckles = false;
- HUD_alpha_fix = false;
- sounds_reset = false;
- SONsounds_loaded = false;
- SHAsounds_loaded = false;
- MSsounds_loaded = false;
- PURPLE_GEM_active = false;
- black_shield_active = false;
- sonic_model_loaded = false;
- sonic_init_loaded = false;
- shadow_init_loaded = false;
- metalsonic_init_loaded = false;
- Gauge;
- OldGauge;
- Gauge2;
- OldGauge2;
- Gaugebis;
- OldGaugebis;
- Gauge2bis;
- OldGauge2bis;
- OldRingsHUD;
- can_animate_gain = 0;
- can_animate_loss = 0;
- zero_ring_alpha = 0;
- energy_glow;
- energy_lvl_glow;
- lv1_stretch;
- lv2_stretch;
- lv3_stretch;
- sonic_lv1_glow;
- sonic_lv2_glow;
- sonic_lv3_glow;
- star_glow = 0;
- circle_glow = 0;
- level3_glow = 0;
- sparkletimer = 0;
- sparkleCBbolttimer = 0;
- sparkleCBLV3timer = 0;
- LV3alpha = 0.0f;
- sparklegemstimer = 0;
- sparklegems_tiny_timer = 0;
- sparkleCBtimer = 0;
- sparkleCB_tiny_timer = 0;
- sparklechaosblasttimer = 0;
- sparklechaosblast_tiny_timer = 0;
- //From SONIC
- air_boost_used = false;
- stomp_was_used = false;
- bouncing = false;
- stomp_was_used_twice = false;
- can_use_twice = false;
- B_or_X_pressed = false;
- bounce_attacking = false;
- lightdashflag = false;
- NoBoost_OnWater = false;
- is_hyper = false;
- transforming = false;
- just_transformed = false;
- is_boosting = false;
- is_flying = false;
- up_was_pressed = false;
- down_was_pressed = false;
- spincharging = false;
- no_LSA_sound = false;
- lightattacking = false;
- stop_flying = false;
- LSA_charged = false;
- no_boost_aura = false;
- bouncebracelet_obtained = false;
- flamering_obtained = false;
- SonicTrick3Timer1 = 0;
- SonicTrick3Timer2 = 0;
- BoostVarGrd = 0;
- BoostVarAir = 0;
- stompvar = 0;
- stompvar2 = 0;
- bouncevar = 0;
- boostvoice = 0;
- animation = 0;
- transforming_time = 0;
- transform_anim = 0;
- firstanim_speedup = 0;
- untransforming = 0;
- testvar = 0;
- super_rings_depletion = 0;
- hyper_rings_depletion = 0;
- testvar3 = 0;
- LSA_var = 0;
- fly_then_ground = 0;
- flying_to_NOTflying = 0;
- //From SHADOW
- just_rolled = false;
- cant_punch_now = false;
- can_go_back_to_shadow = false;
- X_is_held = false;
- didnt_target = false;
- ready = false;
- cant_chaos_spear = false;
- cant_chaos_spear2 = false;
- is_CB = false;
- X_was_pressed = false;
- cant_chaos_spear_again = false;
- pressed_X_while_Gamma = false;
- DO_chaos_spear_again = false;
- cant_spindash = false;
- CS_launch_was_played = false;
- CS_charging_was_played = false;
- CS_empty_was_played = false;
- is_in_CS_state = false;
- X_was_released = false;
- has_homing_attacked = false;
- CB_lv1 = false;
- CB_lv2 = false;
- CB_lv3 = false;
- using_chaos_blast = false;
- transforming_CB = false;
- CHAOSBLAST_was_played = false;
- go_back_to_gameplay = false;
- do_multi_punch = false;
- has_punched_once = false;
- knuckles_teleport_to_sonic = false;
- knuckles_teleported_away = false;
- punching_1 = false;
- punching_2 = false;
- punching_3 = false;
- is_punching = false;
- can_run_again = false;
- shadow_sounds_back = false;
- stop_aim_everywhere = false;
- CBHomingAttackTimer = 0;
- ShadowTrick1Timer1 = 0;
- ShadowTrick1Timer2 = 0;
- ShadowTrick2Timer1 = 0;
- ShadowTrick2Timer2 = 0;
- ShadowTrick3Timer1 = 0;
- ShadowTrick3Timer2 = 0;
- SpindashNOPingTimer = 0;
- punchattack = 0;
- justrolled = 0;
- no_longer_punching = 0;
- backtoshadow1 = 0;
- backtoshadow2 = 0;
- LD_punch = 0;
- no_z_speed = 0;
- chaos_spear_stop = 0;
- stop_supersonic = 0;
- didnt_target_OK = 0;
- can_chaos_spear_again = 0;
- gonna_chaos_spear_again = 0;
- X_gonna_be_unheld = 0;
- transforming_CB_time = 0;
- chaos_blast_active_timer = 0;
- X_was_released_int = 0;
- cant_release_X = 0;
- anim_84_was_played = 0;
- can_multi_punch = 0;
- chaos_blast_radius_timer = 0;
- will_punch = 0;
- stopped_punching = 0;
- knuckles_really_is_away = 0;
- stop_punching = 0;
- X_press = 0;
- can_X_press = 0;
- aim_everywhere = 0;
- cbBLUEsize = 0.0;
- cbREDsize = 0.0;
- chaosblasttex = 0;
- transforming_CB_redball_time = 0;
- //From METALSONIC
- MagneticBarrierTakenOFF = false;
- full_barrier = false;
- fully_charged = false;
- cant_blaze_homing = false;
- blaze_homing_attacking = false;
- is_hovering = false;
- A_was_pressed = false;
- Z_WHITE_was_pressed = false;
- anim_was_17 = false;
- cant_playsound = false;
- has_played = false;
- sound_was_played = false;
- first_sound_played = false;
- _1238_was_played = false;
- _1239_was_played = false;
- _1240_was_played = false;
- _1241_was_played = false;
- _1242_was_played = false;
- no_jumping_sound = false;
- play_metal_charge_sound = false;
- can_use_dash = false;
- is_on_ground = false;
- do_dash = false;
- BLUE_GEM_active = false;
- BLUE_GEM_used = false;
- RED_GEM_active = false;
- RED_GEM_used = false;
- GREEN_GEM_active = false;
- GREEN_GEM_used = false;
- WHITE_GEM_active = false;
- SKY_GEM_active = false;
- stop_white_gem = false;
- YELLOW_GEM_active = false;
- cant_hover = false;
- reduce_invulnerable_time = false;
- gauge_auto_fill_ON = false;
- gauge_is_filling = false;
- black_shield_used = false;
- can_attack = false;
- spiiin_sound_played = false;
- can_charge = false;
- can_prepare_shield_timer = false;
- BHA_launch = false;
- from_white_to_fall = false;
- cant_use_yellow_gem = false;
- use_blaze_bomb = false;
- can_use_blaze_bomb = false;
- NJB_active = false;
- NJB_loaded = false;
- charge_sound = 0;
- backtometal = 0;
- ObjCol = 0;
- blaze_homing_timer = 0;
- black_shield_timer = 0;
- can_hover = 0;
- MetalHoverStaticTimer = 0;
- MetalHoverMovingTimer = 0;
- can_hover_again = 0;
- anim_can_be_32 = 0;
- spinning_sound = 0;
- SOUNDTEST = 0;
- play_moving_sound = 0;
- metal_dash_timer = 0;
- do_dash_timer = 0;
- metal_spinning_sound_timer = 0;
- cant_hover_timer = 0;
- tails_teleport_timer = 0;
- tails_attack_timer = 0;
- stop_supersonic_upgrade = 0;
- gauge_auto_fill = 0;
- can_use_spiiin_sound = 0;
- white_to_NOTwhite = 0;
- whiteON_then_ground = 0;
- stop_LSA = 0;
- use_fall_anim = 0;
- stop_blaze_bomb = 0;
- gemaura = 354;
- blackshieldrotate = 0;
- unload_NJB = 0;
- }
- ////////////////////// HUD //////////////////////////////////////////////////////////////////////////
- enum HUDTextureIndex
- {
- HUD_gauge, HUD_rings, HUD_lives, HUD_score, HUD_timer, HUD_sonic_life, HUD_tails_life, HUD_knuckles_life, HUD_shadow_life, HUD_amy_life, HUD_gamma_life,
- HUD_metalsonic_life, HUD_tailsdoll_life, HUD_metalknuckles_life, HUD_0, HUD_1, HUD_2, HUD_3, HUD_4, HUD_5, HUD_6, HUD_7, HUD_8, HUD_9, HUD_0s_red,
- HUD_0s_red_glow, HUD_ring_a, HUD_ring_b, HUD_ring_c, HUD_ring_d, HUD_ring_e, HUD_ring_f, HUD_ring_g, HUD_ring_h, HUD_energy_1, HUD_energy_2, HUD_energy_3, HUD_energy_4,
- HUD_energy_5, HUD_energy_6, HUD_energy_7, HUD_energy_8, HUD_energy_9, HUD_energy_10, HUD_energy_11, HUD_energy_12, HUD_energy_13, HUD_energy_14, HUD_energy_15, HUD_energy_16,
- HUD_energy_17, HUD_energy_18, HUD_energy_19, HUD_energy_20, HUD_energy_21, HUD_energy_22, HUD_energy_23, HUD_energy_24, HUD_energy_25, HUD_energy_26, HUD_energy_27, HUD_energy_28,
- HUD_energy_29, HUD_energy_30, HUD_energy_31, HUD_energy_32, HUD_energy_33, HUD_energy_34, HUD_energy_35, HUD_energy_36, HUD_energy_37, HUD_energy_38, HUD_energy_39, HUD_energy_40,
- HUD_energy_41, HUD_energy_42, HUD_energy_43, HUD_energy_44, HUD_energy_45, HUD_energy_46, HUD_energy_47, HUD_energy_48, HUD_energy_49, HUD_energy_50, HUD_energy_51, HUD_energy_52,
- HUD_energy_53, HUD_energy_54, HUD_energy_55, HUD_energy_56, HUD_energy_57, HUD_energy_58, HUD_energy_59, HUD_energy_60, HUD_energy_61, HUD_energy_62, HUD_energy_63, HUD_energy_64,
- HUD_energy_65, HUD_energy_66, HUD_energy_67, HUD_energy_68, HUD_energy_69, HUD_energy_70, HUD_energy_71, HUD_energy_72, HUD_energy_73, HUD_energy_74, HUD_energy_75, HUD_energy_76,
- HUD_energy_77, HUD_energy_78, HUD_energy_79, HUD_energy_80, HUD_energy_81, HUD_energy_82, HUD_energy_83, HUD_energy_84, HUD_energy_85, HUD_energy_86, HUD_energy_87, HUD_energy_88,
- HUD_energy_89, HUD_energy_90, HUD_energy_91, HUD_energy_92, HUD_energy_93, HUD_energy_94, HUD_energy_95, HUD_energy_96, HUD_energy_97, HUD_energy_98, HUD_energy_99, HUD_energy_100,
- HUD_energy_glow, HUD_sonic_lv1, HUD_sonic_lv2, HUD_sonic_lv3, HUD_shadow_lv1, HUD_shadow_lv2, HUD_shadow_lv3, HUD_metal_lv1, HUD_metal_lv2, HUD_metal_lv3, HUD_energy_lvl_1, HUD_energy_lvl_2,
- HUD_energy_lvl_3, HUD_energy_lvl_4, HUD_energy_lvl_5, HUD_energy_lvl_6, HUD_energy_lvl_7, HUD_energy_lvl_8, HUD_energy_lvl_9, HUD_energy_lvl_10, HUD_energy_lvl_11, HUD_energy_lvl_12,
- HUD_energy_lvl_13, HUD_energy_lvl_14, HUD_energy_lvl_15, HUD_energy_lvl_16, HUD_energy_lvl_17, HUD_energy_lvl_18, HUD_energy_lvl_19, HUD_energy_lvl_20, HUD_energy_lvl_21, HUD_energy_lvl_22,
- HUD_energy_lvl_23, HUD_energy_lvl_24, HUD_energy_lvl_25, HUD_energy_lvl_26, HUD_energy_lvl_27, HUD_energy_lvl_28, HUD_energy_lvl_29, HUD_energy_lvl_30, HUD_energy_lvl_31, HUD_energy_lvl_32,
- HUD_energy_lvl_33, HUD_energy_lvl_34, HUD_energy_lvl_35, HUD_energy_lvl_36, HUD_energy_lvl_37, HUD_energy_lvl_38, HUD_energy_lvl_39, HUD_energy_lvl_40, HUD_energy_lvl_41, HUD_energy_lvl_42,
- HUD_energy_lvl_43, HUD_energy_lvl_44, HUD_energy_lvl_45, HUD_energy_lvl_46, HUD_energy_lvl_47, HUD_energy_lvl_48, HUD_energy_lvl_49, HUD_energy_lvl_50, HUD_energy_lvl_51, HUD_energy_lvl_52,
- HUD_energy_lvl_53, HUD_energy_lvl_54, HUD_energy_lvl_55, HUD_energy_lvl_56, HUD_energy_lvl_57, HUD_energy_lvl_58, HUD_energy_lvl_59, HUD_energy_lvl_60, HUD_energy_lvl_61, HUD_energy_lvl_62,
- HUD_energy_lvl_63, HUD_energy_lvl_64, HUD_energy_lvl_65, HUD_energy_lvl_66, HUD_energy_lvl_67, HUD_energy_lvl_68, HUD_energy_lvl_69, HUD_energy_lvl_70, HUD_energy_lvl_71, HUD_energy_lvl_72,
- HUD_energy_lvl_73, HUD_energy_lvl_74, HUD_energy_lvl_75, HUD_energy_lvl_76, HUD_energy_lvl_77, HUD_energy_lvl_78, HUD_energy_lvl_79, HUD_energy_lvl_80, HUD_energy_lvl_81, HUD_energy_lvl_82,
- HUD_energy_lvl_83, HUD_energy_lvl_84, HUD_energy_lvl_85, HUD_energy_lvl_86, HUD_energy_lvl_87, HUD_energy_lvl_88, HUD_energy_lvl_89, HUD_energy_lvl_90, HUD_energy_lvl_91, HUD_energy_lvl_92,
- HUD_energy_lvl_93, HUD_energy_lvl_94, HUD_energy_lvl_95, HUD_energy_lvl_96, HUD_energy_lvl_97, HUD_energy_lvl_98, HUD_energy_lvl_99, HUD_energy_lvl_100, HUD_soniclvl_energy_glow,
- HUD_shadowlvl_energy_glow, HUD_metallvl_energy_glow, HUD_sonic_lv1_glow, HUD_sonic_lv2_glow, HUD_sonic_lv3_glow, HUD_shadow_lv1_glow, HUD_shadow_lv2_glow, HUD_shadow_lv3_glow, HUD_metal_lv1_glow,
- HUD_metal_lv2_glow, HUD_metal_lv3_glow, HUD_sonic_lv1_dark, HUD_sonic_lv2_dark, HUD_sonic_lv3_dark, HUD_shadow_lv1_dark, HUD_shadow_lv2_dark, HUD_shadow_lv3_dark, HUD_metal_lv1_dark,
- HUD_metal_lv2_dark, HUD_metal_lv3_dark, BLUE_GEM, RED_GEM, GREEN_GEM, PURPLE_GEM, SKY_GEM, WHITE_GEM, YELLOW_GEM
- };
- static NJS_TEXNAME HUD_TEXNAME[150];
- static NJS_TEXLIST HUD_TEXLIST = { arrayptrandlength(HUD_TEXNAME) }; //MY OWN HUD STUFF
- static NJS_TEXANIM HUD_TEXANIM[] = {
- // w, h, cx, cy, u1, v1, u2, v2, texid, attr
- // u2 and v2 must be 0xFF
- { 314, 55, 0, 0, 0, 0, 0xFF, 0xFF, HUD_rings, 0 },//cx and cy are the position on the screen cx => + or - to go left or right; cy => + or - to go up or down
- { 314, 55, 0, 0, 0, 0, 0xFF, 0xFF, HUD_lives, 0 },
- { 394, 55, 0, 0, 0, 0, 0xFF, 0xFF, HUD_score, 0 },
- { 394, 55, 0, 0, 0, 0, 0xFF, 0xFF, HUD_timer, 0 },
- { 75, 75, 0, 0, 0, 0, 0xFF, 0xFF, HUD_sonic_life, 0 },
- { 75, 75, 0, 0, 0, 0, 0xFF, 0xFF, HUD_tails_life, 0 },
- { 75, 75, 0, 0, 0, 0, 0xFF, 0xFF, HUD_knuckles_life, 0 },
- { 75, 75, 0, 0, 0, 0, 0xFF, 0xFF, HUD_shadow_life, 0 },
- { 75, 75, 0, 0, 0, 0, 0xFF, 0xFF, HUD_amy_life, 0 },
- { 75, 75, 0, 0, 0, 0, 0xFF, 0xFF, HUD_gamma_life, 0 },
- { 75, 75, 0, 0, 0, 0, 0xFF, 0xFF, HUD_metalsonic_life, 0 },
- { 75, 75, 0, 0, 0, 0, 0xFF, 0xFF, HUD_tailsdoll_life, 0 },
- { 75, 75, 0, 0, 0, 0, 0xFF, 0xFF, HUD_metalknuckles_life, 0 }
- };
- static NJS_TEXANIM HUD_TEXANIM_NUMBERS[] = {
- { 40, 40, 0, 0, 0, 0, 0xFF, 0xFF, HUD_0, 0 },
- { 40, 40, 0, 0, 0, 0, 0xFF, 0xFF, HUD_1, 0 },
- { 40, 40, 0, 0, 0, 0, 0xFF, 0xFF, HUD_2, 0 },
- { 40, 40, 0, 0, 0, 0, 0xFF, 0xFF, HUD_3, 0 },
- { 40, 40, 0, 0, 0, 0, 0xFF, 0xFF, HUD_4, 0 },
- { 40, 40, 0, 0, 0, 0, 0xFF, 0xFF, HUD_5, 0 },
- { 40, 40, 0, 0, 0, 0, 0xFF, 0xFF, HUD_6, 0 },
- { 40, 40, 0, 0, 0, 0, 0xFF, 0xFF, HUD_7, 0 },
- { 40, 40, 0, 0, 0, 0, 0xFF, 0xFF, HUD_8, 0 },
- { 40, 40, 0, 0, 0, 0, 0xFF, 0xFF, HUD_9, 0 }
- };
- static NJS_TEXANIM HUD_TEXANIM_NUMBERS_RING_ANIM[] = {
- { 50, 50, 0, 0, 0, 0, 0xFF, 0xFF, HUD_ring_a, 0 },
- { 50, 50, 0, 0, 0, 0, 0xFF, 0xFF, HUD_ring_b, 0 },
- { 50, 50, 0, 0, 0, 0, 0xFF, 0xFF, HUD_ring_c, 0 },
- { 50, 50, 0, 0, 0, 0, 0xFF, 0xFF, HUD_ring_d, 0 },
- { 50, 50, 0, 0, 0, 0, 0xFF, 0xFF, HUD_ring_e, 0 },
- { 50, 50, 0, 0, 0, 0, 0xFF, 0xFF, HUD_ring_f, 0 },
- { 50, 50, 0, 0, 0, 0, 0xFF, 0xFF, HUD_ring_g, 0 },
- { 50, 50, 0, 0, 0, 0, 0xFF, 0xFF, HUD_ring_h, 0 }
- };
- static NJS_TEXANIM HUD_TEXANIM_NUMBERS_RINGS_0_RED[] = {
- { 90, 75, 0, 0, 0, 0, 0xFF, 0xFF, HUD_0s_red, 0 }, //-212 -216 why ??
- { 90, 75, 0, 0, 0, 0, 0xFF, 0xFF, HUD_0s_red_glow, 0 }
- };
- static NJS_TEXANIM HUD_TEXANIM_ENERGY[] = {
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_gauge, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_1, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_2, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_3, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_4, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_5, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_6, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_7, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_8, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_9, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_10, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_11, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_12, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_13, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_14, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_15, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_16, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_17, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_18, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_19, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_20, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_21, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_22, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_23, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_24, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_25, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_26, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_27, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_28, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_29, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_30, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_31, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_32, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_33, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_34, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_35, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_36, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_37, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_38, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_39, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_40, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_41, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_42, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_43, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_44, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_45, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_46, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_47, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_48, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_49, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_50, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_51, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_52, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_53, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_54, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_55, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_56, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_57, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_58, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_59, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_60, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_61, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_62, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_63, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_64, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_65, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_66, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_67, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_68, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_69, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_70, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_71, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_72, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_73, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_74, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_75, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_76, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_77, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_78, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_79, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_80, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_81, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_82, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_83, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_84, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_85, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_86, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_87, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_88, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_89, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_90, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_91, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_92, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_93, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_94, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_95, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_96, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_97, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_98, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_99, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_100, 0 }
- };
- static NJS_TEXANIM HUD_TEXANIM_ENERGY_GLOW[] = {
- { 375, 85, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_glow, 0 }
- };
- static NJS_TEXANIM HUD_TEXANIM_ENERGYLVL[] = {
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_1, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_2, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_3, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_4, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_5, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_6, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_7, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_8, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_9, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_10, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_11, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_12, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_13, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_14, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_15, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_16, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_17, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_18, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_19, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_20, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_21, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_22, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_23, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_24, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_25, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_26, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_27, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_28, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_29, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_30, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_31, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_32, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_33, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_34, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_35, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_36, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_37, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_38, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_39, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_40, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_41, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_42, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_43, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_44, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_45, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_46, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_47, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_48, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_49, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_50, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_51, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_52, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_53, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_54, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_55, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_56, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_57, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_58, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_59, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_60, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_61, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_62, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_63, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_64, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_65, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_66, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_67, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_68, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_69, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_70, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_71, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_72, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_73, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_74, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_75, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_76, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_77, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_78, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_79, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_80, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_81, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_82, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_83, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_84, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_85, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_86, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_87, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_88, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_89, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_90, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_91, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_92, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_93, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_94, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_95, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_96, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_97, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_98, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_99, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_energy_lvl_100, 0 }
- };
- static NJS_TEXANIM HUD_TEXANIM_ENERGYLVL_GLOW[] = {
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_soniclvl_energy_glow, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_shadowlvl_energy_glow, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_metallvl_energy_glow, 0 }
- };
- static NJS_TEXANIM HUD_TEXANIM_LVLUPS[] = {
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_sonic_lv1, 0 }, //-1104, -700
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_sonic_lv2, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_sonic_lv3, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_shadow_lv1, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_shadow_lv2, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_shadow_lv3, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_metal_lv1, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_metal_lv2, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_metal_lv3, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_sonic_lv1_dark, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_sonic_lv2_dark, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_sonic_lv3_dark, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_shadow_lv1_dark, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_shadow_lv2_dark, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_shadow_lv3_dark, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_metal_lv1_dark, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_metal_lv2_dark, 0 },
- { 488, 112, 0, 0, 0, 0, 0xFF, 0xFF, HUD_metal_lv3_dark, 0 },
- };
- static NJS_TEXANIM HUD_TEXANIM_LVLUPS_GLOW[] = {
- { 100, 40, 0, 40, 0, 0, 0xFF, 0xFF, HUD_sonic_lv1_glow, 0 }, //-1104, -700
- { 100, 40, 0, 40, 0, 0, 0xFF, 0xFF, HUD_sonic_lv2_glow, 0 },
- { 100, 40, 0, 40, 0, 0, 0xFF, 0xFF, HUD_sonic_lv3_glow, 0 },
- { 100, 40, 0, 40, 0, 0, 0xFF, 0xFF, HUD_shadow_lv1_glow, 0 },
- { 100, 40, 0, 40, 0, 0, 0xFF, 0xFF, HUD_shadow_lv2_glow, 0 },
- { 100, 40, 0, 40, 0, 0, 0xFF, 0xFF, HUD_shadow_lv3_glow, 0 },
- { 100, 40, 0, 40, 0, 0, 0xFF, 0xFF, HUD_metal_lv1_glow, 0 },
- { 100, 40, 0, 40, 0, 0, 0xFF, 0xFF, HUD_metal_lv2_glow, 0 },
- { 100, 40, 0, 40, 0, 0, 0xFF, 0xFF, HUD_metal_lv3_glow, 0 }
- };
- NJS_SPRITE HUD_SPRITE = { { 0.0f, 0.0f, 0.0f }, 1.3f * HorizontalResolution / 1680.0f, 1.3f * VerticalResolution / 1050.0f, 0, &HUD_TEXLIST, HUD_TEXANIM };//the three numbers in the brackets are X, Y, and Z position, then X and Y scaling, rotation, texlist, and texanim
- NJS_SPRITE HUD_SPRITE_NUMBERS = { { 0.0f, 0.0f, 0.0f }, 1.3f * HorizontalResolution / 1680.0f, 1.3f * VerticalResolution / 1050.0f, 0, &HUD_TEXLIST, HUD_TEXANIM_NUMBERS };
- NJS_SPRITE HUD_SPRITE_RING_ANIM = { { 0.0f, 0.0f, 0.0f }, 1.0f * HorizontalResolution / 1680.0f, 1.0f * VerticalResolution / 1050.0f, 0, &HUD_TEXLIST, HUD_TEXANIM_NUMBERS_RING_ANIM };
- NJS_SPRITE HUD_SPRITE_RINGS_0_RED = { { 0.0f, 0.0f, 0.0f }, 1.0f * HorizontalResolution / 1680.0f, 1.0f * VerticalResolution / 1050.0f, 0, &HUD_TEXLIST, HUD_TEXANIM_NUMBERS_RINGS_0_RED };
- NJS_SPRITE HUD_SPRITE_ENERGY = { { 0.0f, 0.0f, 0.0f }, 1.0f * HorizontalResolution / 1680.0f, 1.0f * VerticalResolution / 1050.0f, 0, &HUD_TEXLIST, HUD_TEXANIM_ENERGY };
- NJS_SPRITE HUD_SPRITE_ENERGY_GLOW = { { 0.0f, 0.0f, 0.0f }, 1.3f * HorizontalResolution / 1680.0f, 1.3f * VerticalResolution / 1050.0f, 0, &HUD_TEXLIST, HUD_TEXANIM_ENERGY_GLOW };
- NJS_SPRITE HUD_SPRITE_ENERGYLVL = { { 0.0f, 0.0f, 0.0f }, 1.0f * HorizontalResolution / 1680.0f, 1.0f * VerticalResolution / 1050.0f, 0, &HUD_TEXLIST, HUD_TEXANIM_ENERGYLVL };
- NJS_SPRITE HUD_SPRITE_ENERGYLVL_GLOW = { { 0.0f, 0.0f, 0.0f }, 1.0f * HorizontalResolution / 1680.0f, 1.0f * VerticalResolution / 1050.0f, 0, &HUD_TEXLIST, HUD_TEXANIM_ENERGYLVL_GLOW };
- NJS_SPRITE HUD_SPRITE_LVLUPS = { { 0.0f, 0.0f, 0.0f }, 1.0f * HorizontalResolution / 1680.0f, 1.0f * VerticalResolution / 1050.0f, 0, &HUD_TEXLIST, HUD_TEXANIM_LVLUPS };
- NJS_SPRITE HUD_SPRITE_LVLUPS_GLOW = { { 0.0f, 0.0f, 0.0f }, 1.0f * HorizontalResolution / 1680.0f, 1.0f * VerticalResolution / 1050.0f, 0, &HUD_TEXLIST, HUD_TEXANIM_LVLUPS_GLOW };
- enum HUD3DTextureIndex
- {
- HUD3D_star, HUD3D_circle, HUD3D_sonic_vortex, HUD3D_shadow_vortex, HUD3D_metal_vortex, HUD3D_sparkles_0, HUD3D_sparkles_1, HUD3D_sparkles_2, HUD3D_sparkles_3, HUD3D_sparkles_4,
- HUD3D_sparkles_5, HUD3D_sparkles_6, HUD3D_sparkles_7
- };
- static NJS_TEXNAME HUD3D_TEXNAME[4];
- static NJS_TEXLIST HUD3D_TEXLIST = { arrayptrandlength(HUD3D_TEXNAME) }; //MY OWN HUD STUFF
- static NJS_TEXANIM HUD3D_TEXANIM[] = {
- { 16, 16, 8, 8, 0, 0, 0xFF, 0xFF, HUD3D_star, 0 },
- { 16, 16, 8, 8, 0, 0, 0xFF, 0xFF, HUD3D_circle, 0 },
- { 32, 32, 16, 16, 0, 0, 0xFF, 0xFF, HUD3D_sonic_vortex, 0 },
- { 32, 32, 16, 16, 0, 0, 0xFF, 0xFF, HUD3D_shadow_vortex, 0 },
- { 32, 32, 16, 16, 0, 0, 0xFF, 0xFF, HUD3D_metal_vortex, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, HUD3D_sparkles_0, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, HUD3D_sparkles_1, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, HUD3D_sparkles_2, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, HUD3D_sparkles_3, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, HUD3D_sparkles_4, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, HUD3D_sparkles_5, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, HUD3D_sparkles_6, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, HUD3D_sparkles_7, 0 }
- };
- NJS_SPRITE HUD3D_SPRITE_STAR = { { 0.0f, 0.0f, 0.0f }, 1.0f, 1.0f, 0, &HUD3D_TEXLIST, HUD3D_TEXANIM };
- NJS_SPRITE HUD3D_SPRITE_CIRCLE = { { 0.0f, 0.0f, 0.0f }, 1.0f, 1.0f, 0, &HUD3D_TEXLIST, HUD3D_TEXANIM };
- NJS_SPRITE HUD3D_SPRITE_LEVEL3 = { { 0.0f, 0.0f, 0.0f }, 1.0f, 1.0f, 0, &HUD3D_TEXLIST, HUD3D_TEXANIM };
- //Level 3 sparkles
- using std::vector;
- struct sparkledata { NJS_VECTOR pos; int frame; };
- vector<sparkledata> sparkles;
- NJS_SPRITE sparklesprite = { { 0.0f, 0.0f, 0.0f }, 1.0f, 1.0f, 0, &HUD3D_TEXLIST, HUD3D_TEXANIM };
- //Metal Sonic Gems Sparkles
- enum GEMSTextureIndex
- {
- gem_particle_blueB, gem_particle_blueS, gem_particle_redB, gem_particle_redS, gem_particle_greenB, gem_particle_greenS, gem_particle_purpleB, gem_particle_purpleS,
- gem_particle_skyB, gem_particle_skyS, gem_particle_whiteB, gem_particle_whiteS, gem_particle_yellowB, gem_particle_yellowS, chaosblastball0, chaosblastball1, sh_chaosblast_bolt0_a,
- sh_chaosblast_bolt0_b, sh_chaosblast_bolt1_a, sh_chaosblast_bolt1_b, sh_chaosblast_bolt2_a, sh_chaosblast_bolt2_b, sh_chaosblast_bolt3_a, sh_chaosblast_bolt3_b, sh_chaosblast_bolt4_a,
- sh_chaosblast_bolt4_b, chaosboostlvl3smoke
- };
- static NJS_TEXNAME GEMS_TEXNAME[4];
- static NJS_TEXLIST GEMS_TEXLIST = { arrayptrandlength(GEMS_TEXNAME) };
- static NJS_TEXANIM GEMS_TEXANIM[] = {
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, gem_particle_blueB, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, gem_particle_blueS, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, gem_particle_redB, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, gem_particle_redS, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, gem_particle_greenB, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, gem_particle_greenS, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, gem_particle_purpleB, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, gem_particle_purpleS, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, gem_particle_skyB, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, gem_particle_skyS, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, gem_particle_whiteB, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, gem_particle_whiteS, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, gem_particle_yellowB, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, gem_particle_yellowS, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, chaosblastball0, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, chaosblastball1, 0 },
- { 12, 12, 6, 6, 0, 0, 0xFF, 0xFF, sh_chaosblast_bolt0_a, 0 },
- { 12, 12, 6, 6, 0, 0, 0xFF, 0xFF, sh_chaosblast_bolt0_a, 0 },
- { 12, 12, 6, 6, 0, 0, 0xFF, 0xFF, sh_chaosblast_bolt1_a, 0 },
- { 12, 12, 6, 6, 0, 0, 0xFF, 0xFF, sh_chaosblast_bolt1_b, 0 },
- { 12, 12, 6, 6, 0, 0, 0xFF, 0xFF, sh_chaosblast_bolt2_a, 0 },
- { 12, 12, 6, 6, 0, 0, 0xFF, 0xFF, sh_chaosblast_bolt2_b, 0 },
- { 12, 12, 6, 6, 0, 0, 0xFF, 0xFF, sh_chaosblast_bolt3_a, 0 },
- { 12, 12, 6, 6, 0, 0, 0xFF, 0xFF, sh_chaosblast_bolt3_b, 0 },
- { 12, 12, 6, 6, 0, 0, 0xFF, 0xFF, sh_chaosblast_bolt4_a, 0 },
- { 12, 12, 6, 6, 0, 0, 0xFF, 0xFF, sh_chaosblast_bolt4_b, 0 },
- { 4, 4, 2, 2, 0, 0, 0xFF, 0xFF, chaosboostlvl3smoke, 0 }
- };
- struct sparklegemsdata
- {
- NJS_VECTOR pos_gems;
- int framegems;
- int framegems_tiny;
- Rotation3 rotation;
- Rotation3 speed;
- float radius;
- };
- vector<sparklegemsdata> sparklesgems;
- vector<sparklegemsdata> sparklesgems_tiny;
- struct sparkleCBdata
- {
- NJS_VECTOR pos_CB;
- int frameCB;
- int frameCB_tiny;
- Rotation3 rotation;
- Rotation3 speed;
- float radiusCB;
- };
- vector<sparkleCBdata> sparklesCB;
- vector<sparkleCBdata> sparklesCB_tiny;
- struct sparklechaosblastdata
- {
- NJS_VECTOR pos_chaosblast;
- int framechaosblast;
- int framechaosblast_tiny;
- Rotation3 rotation;
- Rotation3 speed;
- float radiuschaosblast;
- };
- vector<sparklechaosblastdata> sparkleschaosblast;
- vector<sparklechaosblastdata> sparkleschaosblast_tiny;
- struct sparkleCBboltdata { NJS_VECTOR pos_CBbolt; int frameCBbolt; };
- vector<sparkleCBboltdata> sparklesCBbolt;
- struct sparkleCBLV3data { NJS_VECTOR pos_CBLV3; int frameCBLV3; };
- vector<sparkleCBLV3data> sparklesCBLV3;
- NJS_SPRITE sparklegemssprite = { { 0.0f, 0.0f, 0.0f }, 1.0f, 1.0f, 0, &GEMS_TEXLIST, GEMS_TEXANIM };
- NJS_SPRITE sparkleShadowCBsprite = { { 0.0f, 0.0f, 0.0f }, 1.0f, 1.0f, 0, &GEMS_TEXLIST, GEMS_TEXANIM };
- NJS_SPRITE sparkleShadowChaosBlastsprite = { { 0.0f, 0.0f, 0.0f }, 1.0f, 1.0f, 0, &GEMS_TEXLIST, GEMS_TEXANIM };
- NJS_SPRITE sparkleShadowCBbolt = { { 0.0f, 0.0f, 0.0f }, 1.0f, 1.0f, 0, &GEMS_TEXLIST, GEMS_TEXANIM };
- NJS_SPRITE sparkleShadowCBLV3 = { { 0.0f, 0.0f, 0.0f }, 1.0f, 1.0f, 0, &GEMS_TEXLIST, GEMS_TEXANIM };
- //Metal Sonic Gems Gauge
- static NJS_TEXANIM GEMSGauge_TEXANIM[] = {
- { 100, 100, 50, 50, 0, 0, 0xFF, 0xFF, BLUE_GEM, 0 },
- { 100, 100, 50, 50, 0, 0, 0xFF, 0xFF, RED_GEM, 0 },
- { 100, 100, 50, 50, 0, 0, 0xFF, 0xFF, GREEN_GEM, 0 },
- { 100, 100, 50, 50, 0, 0, 0xFF, 0xFF, PURPLE_GEM, 0 },
- { 100, 100, 50, 50, 0, 0, 0xFF, 0xFF, SKY_GEM, 0 },
- { 100, 100, 50, 50, 0, 0, 0xFF, 0xFF, WHITE_GEM, 0 },
- { 100, 100, 50, 50, 0, 0, 0xFF, 0xFF, YELLOW_GEM, 0 }
- };
- NJS_SPRITE GEMSGauge_SPRITE = { { 0.0f, 0.0f, 0.0f }, 1.0f, 1.0f, 0, &HUD_TEXLIST, GEMSGauge_TEXANIM };
- //Counter Zeros
- void HudDisplayZerosSTH06(signed int ringCount, unsigned __int8 digits, NJS_SPRITE *hud_R)
- {
- int count_R; // edi
- int i_R; // ecx
- int max_R; // eax MAPDST
- count_R = ringCount;
- //if (HideHud >= 0)
- //{
- if (ringCount >= 100000)
- {
- count_R = 99999;
- }
- i_R = digits;
- max_R = 1;
- if ((signed int)digits > 0)
- {
- do
- {
- max_R *= 10;
- --i_R;
- } while (i_R);
- }
- if (count_R > --max_R)
- {
- count_R = max_R;
- }
- if (digits >= 5u)
- {
- njDrawSprite2D_Queue(
- hud_R,
- count_R / 10000,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- hud_R->p.x = hud_R->p.x + 23.4 * HorizontalResolution / 1680.0f;
- }
- if (digits >= 4u)
- {
- njDrawSprite2D_Queue(
- hud_R,
- count_R % 10000 / 1000,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- hud_R->p.x = hud_R->p.x + 23.4 * HorizontalResolution / 1680.0f;
- }
- if (digits >= 3u)
- {
- njDrawSprite2D_Queue(
- hud_R,
- count_R % 1000 / 100,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- hud_R->p.x = hud_R->p.x + 23.4 * HorizontalResolution / 1680.0f;
- }
- if (digits >= 2u)
- {
- njDrawSprite2D_Queue(
- hud_R,
- count_R % 100 / 10,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- hud_R->p.x = hud_R->p.x + 23.4 * HorizontalResolution / 1680.0f;
- }
- if (digits >= 1u)
- {
- njDrawSprite2D_Queue(
- hud_R,
- count_R % 10,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- }
- //}
- }
- //Counter No Zeros
- void HudDisplayNoZerosSTH06(signed int scoreCount, unsigned __int8 digits, NJS_SPRITE *hud_S)
- {
- int count_S; // edi
- int i_S; // ecx
- int max_S; // eax MAPDST
- count_S = scoreCount;
- //if (HideHud >= 0)
- //{
- if (scoreCount >= 1000000000)
- {
- count_S = 999999999;
- }
- i_S = digits;
- max_S = 1;
- if ((signed int)digits > 0)
- {
- do
- {
- max_S *= 10;
- --i_S;
- } while (i_S);
- }
- if (count_S > --max_S)
- {
- count_S = max_S;
- }
- if (digits >= 9u)
- {
- njDrawSprite2D_Queue(
- hud_S,
- count_S / 100000000,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- hud_S->p.x = hud_S->p.x + 23.4 * HorizontalResolution / 1680.0f;
- }
- if (digits >= 8u)
- {
- njDrawSprite2D_Queue(
- hud_S,
- count_S % 100000000 / 10000000,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- hud_S->p.x = hud_S->p.x + 23.4 * HorizontalResolution / 1680.0f;
- }
- if (digits >= 7u)
- {
- njDrawSprite2D_Queue(
- hud_S,
- count_S % 10000000 / 1000000,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- hud_S->p.x = hud_S->p.x + 23.4 * HorizontalResolution / 1680.0f;
- }
- if (digits >= 6u)
- {
- njDrawSprite2D_Queue(
- hud_S,
- count_S % 1000000 / 100000,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- hud_S->p.x = hud_S->p.x + 23.4 * HorizontalResolution / 1680.0f;
- }
- if (digits >= 5u)
- {
- njDrawSprite2D_Queue(
- hud_S,
- count_S % 100000 / 10000,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- hud_S->p.x = hud_S->p.x + 23.4 * HorizontalResolution / 1680.0f;
- }
- if (digits >= 4u)
- {
- njDrawSprite2D_Queue(
- hud_S,
- count_S % 10000 / 1000,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- hud_S->p.x = hud_S->p.x + 23.4 * HorizontalResolution / 1680.0f;
- }
- if (digits >= 3u)
- {
- njDrawSprite2D_Queue(
- hud_S,
- count_S % 1000 / 100,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- hud_S->p.x = hud_S->p.x + 23.4 * HorizontalResolution / 1680.0f;
- }
- if (digits >= 2u)
- {
- njDrawSprite2D_Queue(
- hud_S,
- count_S % 100 / 10,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- hud_S->p.x = hud_S->p.x + 23.4 * HorizontalResolution / 1680.0f;
- }
- if (digits >= 1u)
- {
- njDrawSprite2D_Queue(
- hud_S,
- count_S % 10,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- }
- //}
- }
- //Timer Frames counter HUD
- void HudDisplayFramesSTH06(signed int frameCount, unsigned __int8 digits, NJS_SPRITE *hud_TF)
- {
- int count_TF; // edi
- int i_TF; // ecx
- int max_TF; // eax MAPDST
- count_TF = 16.666 * frameCount;
- //if (HideHud >= 0)
- //{
- if (frameCount >= 10000)
- {
- count_TF = 9999;
- }
- i_TF = digits;
- max_TF = 1;
- if ((signed int)digits > 0)
- {
- do
- {
- max_TF *= 10;
- --i_TF;
- } while (i_TF);
- }
- if (count_TF > --max_TF)
- {
- count_TF = max_TF;
- }
- if (digits >= 3u)
- {
- njDrawSprite2D_Queue(
- hud_TF,
- count_TF / 100,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- hud_TF->p.x = hud_TF->p.x + 23.4 * HorizontalResolution / 1680.0f;
- }
- if (digits >= 2u)
- {
- njDrawSprite2D_Queue(
- hud_TF,
- count_TF % 100 / 10,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- hud_TF->p.x = hud_TF->p.x + 23.4 * HorizontalResolution / 1680.0f;
- }
- if (digits >= 1u)
- {
- njDrawSprite2D_Queue(
- hud_TF,
- count_TF % 10,
- -1,
- NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR,
- QueuedModelFlagsB_SomeTextureThing);
- }
- //}
- }
- //************************************ USE SPRITES FOR SA2 JUMP BALLLLLLLLLLLLLLLLLLLLS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- void CommonHUD(EntityData1 *a1, CharObj2 *a2)
- {
- if (GameState == 4)
- {
- can_animate_gain = 0;
- can_animate_loss = 0;
- energy_glow = 0;
- glow_down = false;
- energy_lvl_glow = 0;
- lvl_glow_down = false;
- lv1_stretch = 0;
- lv2_stretch = 0;
- lv3_stretch = 0;
- LV1_obtained = false;
- LV2_obtained = false;
- LV3_obtained = false;
- LV1_active = false;
- LV2_active = false;
- LV3_active = false;
- sparkles.clear();
- sparkletimer = 0;
- sparkleCBbolttimer = 0;
- sparkleCBLV3timer = 0;
- LV3alpha = 0.0f;
- sparklegemstimer = 0;
- sparklegems_tiny_timer = 0;
- sparkleCBtimer = 0;
- sparkleCB_tiny_timer = 0;
- sparklechaosblasttimer = 0;
- sparklechaosblast_tiny_timer = 0;
- LV1_usable = false;
- LV2_usable = false;
- LV3_usable = false;
- sonic_lv1_glow = 0;
- sonic_lv2_glow = 0;
- sonic_lv3_glow = 0;
- sonic_lv1_glow_down = false;
- sonic_lv2_glow_down = false;
- sonic_lv3_glow_down = false;
- star_glow = 0;
- circle_glow = 0;
- level3_glow = 0;
- }
- if (GameState != 21)
- {
- if (GetCharacterObject(0))
- {
- njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCALPHA);
- njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_INVSRCALPHA);
- njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- HUD_SPRITE.p.x = -44 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE.p.y = 70 * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite2D_Queue(&HUD_SPRITE, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- HUD_SPRITE.p.x = -44 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE.p.y = 120 * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite2D_Queue(&HUD_SPRITE, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- HUD_SPRITE.p.x = -44 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE.p.y = 170 * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite2D_Queue(&HUD_SPRITE, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- HUD_SPRITE.p.x = -44 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE.p.y = 220 * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite2D_Queue(&HUD_SPRITE, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- if ((GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0) || (is_shadow && GetCharacterID(0) == Characters_Knuckles) || (is_metalsonic && GetCharacterID(0) == Characters_Tails))
- {
- HUD_SPRITE.p.x = 110 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE.p.y = 205 * 1.3f * VerticalResolution / 1050.0f;
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE, 10, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- //Energy Gauge
- HUD_SPRITE_ENERGY.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_ENERGY.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGY, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0); //HUD_Gauge
- if (Gauge == 0)
- {
- energy_glow = 0;
- }
- if (Gauge > 0 && Gauge < 10000)
- {
- energy_glow = 0;
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGY, 1 + (Gauge/100), -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (Gauge >= 10000)
- {
- HUD_SPRITE_ENERGY.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_ENERGY.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGY, 100, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- if (!is_boosting)
- {
- HUD_SPRITE_ENERGY_GLOW.p.x = 785 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_ENERGY_GLOW.p.y = 657 * 1.3f * VerticalResolution / 1050.0f;
- if (energy_glow <= 20)
- {
- if (!glow_down)
- {
- if (energy_glow < 20)
- {
- ++energy_glow;
- SetMaterialAndSpriteColor_Float((0 + energy_glow) / 20.0f, 1, 1, 1);
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGY_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (energy_glow == 20)
- {
- energy_glow = 0;
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGY_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- glow_down = true;
- }
- }
- else if (glow_down)
- {
- if (energy_glow < 20)
- {
- ++energy_glow;
- SetMaterialAndSpriteColor_Float((20 - energy_glow) / 20.0f, 1, 1, 1);
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGY_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (energy_glow == 20)
- {
- energy_glow = 0;
- SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGY_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- glow_down = false;
- }
- }
- }
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- //LVL Energy Gauge
- if (GameState != 16)
- {
- if (LV2_usable && !LV3_usable)
- {
- if (ControllerPointers[0]->PressedButtons & Buttons_B)
- {
- PlaySound(1250, 0, 0, 0);
- LV1_obtained = false;
- LV2_obtained = false;
- LV1_usable = false;
- LV2_usable = false;
- LV2_active = true;
- Gauge2 = 9999;
- sonic_lv1_glow = 0;
- sonic_lv2_glow = 0;
- sonic_lv3_glow = 0;
- lvl_glow_down = false;
- sonic_lv1_glow_down = false;
- sonic_lv2_glow_down = false;
- sonic_lv3_glow_down = false;
- star_glow = 0;
- circle_glow = 0;
- level3_glow = 0;
- }
- }
- }
- if (LV2_active) //has to be there to avoid the weird color blinking issue
- {
- if (GameState != 16)
- {
- if (!RED_GEM_active)
- {
- Gauge2 -= 8;
- }
- else
- {
- Gauge2 -= 4;
- }
- if (Gauge2 <= 0)
- {
- LV2_active = false;
- PlaySound(1247, 0, 0, 0);
- }
- //3D HUD
- ParticleDepthOverride = 2000.0f;
- if (star_glow < 10)
- {
- ++star_glow;
- SetMaterialAndSpriteColor_Float((10 - star_glow) / 10.0f, 1, 1, 1);
- HUD3D_SPRITE_STAR.sx = ((3 + (star_glow / 2.0f)) / 10.0f) * 1.3f * HorizontalResolution / 1680.0f;
- HUD3D_SPRITE_STAR.sy = ((3 + (star_glow / 2.0f)) / 10.0f) * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite3D(&HUD3D_SPRITE_STAR, 0, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
- }
- else if (star_glow == 10)
- {
- star_glow = 0;
- SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
- HUD3D_SPRITE_STAR.sx = 1.3f * HorizontalResolution / 1680.0f;
- HUD3D_SPRITE_STAR.sy = 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite3D(&HUD3D_SPRITE_STAR, 0, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (circle_glow < 14)
- {
- ++circle_glow;
- SetMaterialAndSpriteColor_Float((14 - circle_glow) / 14.0f, 1, 1, 1);
- HUD3D_SPRITE_CIRCLE.sx = (circle_glow / 14.0f) * 1.3f * HorizontalResolution / 1680.0f;
- HUD3D_SPRITE_CIRCLE.sy = (circle_glow / 14.0f) * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite3D(&HUD3D_SPRITE_CIRCLE, 1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
- }
- else if (circle_glow == 14)
- {
- SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
- HUD3D_SPRITE_CIRCLE.sx = 1.3f * HorizontalResolution / 1680.0f;
- HUD3D_SPRITE_CIRCLE.sy = 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite3D(&HUD3D_SPRITE_CIRCLE, 1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
- ++circle_glow;
- }
- else if (circle_glow > 14)
- {
- if (++circle_glow == 20)
- {
- circle_glow = 0;
- }
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- ParticleDepthOverride = 0.0f;
- }
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 10, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 13, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 16, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- if (sonic_lv2_glow <= 2)
- {
- if (!sonic_lv2_glow_down)
- {
- if (sonic_lv2_glow < 2)
- {
- ++sonic_lv2_glow;
- SetMaterialAndSpriteColor_Float((0 + sonic_lv2_glow) / 2.0f, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (sonic_lv2_glow == 2)
- {
- sonic_lv2_glow = 0;
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- sonic_lv2_glow_down = true;
- }
- }
- else if (sonic_lv2_glow_down)
- {
- if (sonic_lv2_glow < 2)
- {
- ++sonic_lv2_glow;
- SetMaterialAndSpriteColor_Float((2 - sonic_lv2_glow) / 2.0f, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (sonic_lv2_glow == 2)
- {
- sonic_lv2_glow = 0;
- SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- sonic_lv2_glow_down = false;
- }
- }
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (is_sonic) SetMaterialAndSpriteColor_Float(0.35, 0.10588, 0.48235, 0.94902);
- else if (is_shadow) SetMaterialAndSpriteColor_Float(0.35, 0.92157, 0.19608, 0.13725);
- else if (is_metalsonic) SetMaterialAndSpriteColor_Float(0.35, 0, 0.11373, 0.54118);
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, (Gauge2 / 100), -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- HUD_SPRITE_ENERGYLVL.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_ENERGYLVL.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
- if (Gauge2 > 0 && Gauge2 < 10000)
- {
- energy_lvl_glow = 0;
- if (is_sonic) SetMaterialAndSpriteColor_Float(0.25, 0.10588, 0.48235, 0.94902);
- else if (is_shadow) SetMaterialAndSpriteColor_Float(0.25, 0.92157, 0.19608, 0.13725);
- else if (is_metalsonic) SetMaterialAndSpriteColor_Float(0.25, 0, 0.11373, 0.54118);
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, (Gauge2 / 100), -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- if (Gauge2 >= 10000 && Gauge2 < 20000)
- {
- if (is_sonic) SetMaterialAndSpriteColor_Float(0.25, 0.10588, 0.48235, 0.94902);
- else if (is_shadow) SetMaterialAndSpriteColor_Float(0.25, 0.92157, 0.19608, 0.13725);
- else if (is_metalsonic) SetMaterialAndSpriteColor_Float(0.25, 0, 0.11373, 0.54118);
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, 99, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- if (Gauge2 > 10000 && Gauge2 < 20000)
- {
- energy_lvl_glow = 0;
- if (is_sonic) SetMaterialAndSpriteColor_Float(0.35, 0.10588, 0.48235, 0.94902);
- else if (is_shadow) SetMaterialAndSpriteColor_Float(0.35, 0.92157, 0.19608, 0.13725);
- else if (is_metalsonic) SetMaterialAndSpriteColor_Float(0.35, 0, 0.11373, 0.54118);
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, ((Gauge2-10000) / 100), -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- if (Gauge2 >= 20000 && Gauge2 < 30000)
- {
- if (is_sonic) SetMaterialAndSpriteColor_Float(0.5, 0.10588, 0.48235, 0.94902);
- else if (is_shadow) SetMaterialAndSpriteColor_Float(0.5, 0.92157, 0.19608, 0.13725);
- else if (is_metalsonic) SetMaterialAndSpriteColor_Float(0.5, 0, 0.11373, 0.54118);
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, 99, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- if (Gauge2 > 20000 && Gauge2 < 30000)
- {
- energy_lvl_glow = 0;
- if (is_sonic) SetMaterialAndSpriteColor_Float(1, 0.10588, 0.48235, 0.94902);
- else if (is_shadow) SetMaterialAndSpriteColor_Float(1, 0.92157, 0.19608, 0.13725);
- else if (is_metalsonic) SetMaterialAndSpriteColor_Float(1, 0, 0.11373, 0.54118);
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, ((Gauge2 - 20000) / 100), -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- else if (Gauge2 >= 30000)
- {
- HUD_SPRITE_ENERGYLVL.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_ENERGYLVL.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
- if (is_sonic) SetMaterialAndSpriteColor_Float(1, 0.10588, 0.48235, 0.94902);
- else if (is_shadow) SetMaterialAndSpriteColor_Float(1, 0.92157, 0.19608, 0.13725);
- else if (is_metalsonic) SetMaterialAndSpriteColor_Float(1, 0, 0.11373, 0.54118);
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, 99, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- HUD_SPRITE_ENERGYLVL_GLOW.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_ENERGYLVL_GLOW.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
- if (Gauge >= 10000)
- {
- energy_lvl_glow = energy_glow;
- if (!glow_down && lvl_glow_down) lvl_glow_down = false;
- }
- if (energy_lvl_glow <= 20)
- {
- if (!lvl_glow_down)
- {
- if (energy_lvl_glow < 20)
- {
- ++energy_lvl_glow;
- SetMaterialAndSpriteColor_Float((0 + energy_lvl_glow) / 20.0f, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (energy_lvl_glow == 20)
- {
- energy_lvl_glow = 0;
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- lvl_glow_down = true;
- }
- }
- else if (lvl_glow_down)
- {
- if (energy_lvl_glow < 20)
- {
- ++energy_lvl_glow;
- SetMaterialAndSpriteColor_Float((20 - energy_lvl_glow) / 20.0f, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (energy_lvl_glow == 20)
- {
- energy_lvl_glow = 0;
- SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- lvl_glow_down = false;
- }
- }
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- //LVL UPS
- if (Gauge2 >= 0 && Gauge2 < 10000)
- {
- LV1_obtained = false;
- LV2_obtained = false;
- LV3_obtained = false;
- LV1_usable = false;
- LV2_usable = false;
- LV3_usable = false;
- lv1_stretch = 0;
- lv2_stretch = 0;
- lv3_stretch = 0;
- }
- else if (Gauge2 >= 10000 && Gauge2 < 20000)
- {
- HUD_SPRITE_LVLUPS.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_LVLUPS.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 9, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 12, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 15, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- if (Gauge >= 10000)
- {
- sonic_lv1_glow = energy_glow;
- if (!glow_down && sonic_lv1_glow_down) sonic_lv1_glow_down = false;
- }
- if (sonic_lv1_glow <= 20)
- {
- if (!sonic_lv1_glow_down)
- {
- if (sonic_lv1_glow < 20)
- {
- ++sonic_lv1_glow;
- SetMaterialAndSpriteColor_Float((0 + sonic_lv1_glow) / 20.0f, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (sonic_lv1_glow == 20)
- {
- sonic_lv1_glow = 0;
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- sonic_lv1_glow_down = true;
- }
- }
- else if (sonic_lv1_glow_down)
- {
- if (sonic_lv1_glow < 20)
- {
- ++sonic_lv1_glow;
- SetMaterialAndSpriteColor_Float((20 - sonic_lv1_glow) / 20.0f, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (sonic_lv1_glow == 20)
- {
- sonic_lv1_glow = 0;
- SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- sonic_lv1_glow_down = false;
- }
- }
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (!LV1_obtained)
- {
- HUD_SPRITE_LVLUPS_GLOW.p.x = 1104 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_LVLUPS_GLOW.p.y = 731 * 1.3f * VerticalResolution / 1050.0f;
- if (lv1_stretch < 60)
- {
- if (!LV1_active)
- {
- LV1_usable = true;
- }
- ++lv1_stretch;
- SetMaterialAndSpriteColor_Float((60 - lv1_stretch) / 60.0f, 1, 1, 1);
- HUD_SPRITE_LVLUPS_GLOW.sx = ((60 + (2.0f * lv1_stretch)) / 60.0f) * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_LVLUPS_GLOW.sy = ((60 + (2.0f * lv1_stretch)) / 60.0f) * 1.3f * VerticalResolution / 1050.0f;
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- else if (lv1_stretch == 60)
- {
- lv1_stretch = 0;
- LV1_obtained = true;
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- }
- else if (Gauge2 >= 20000 && Gauge2 < 30000)
- {
- lv1_stretch = 0;
- LV1_obtained = false;
- sonic_lv1_glow = 0;
- sonic_lv1_glow_down = false;
- HUD_SPRITE_LVLUPS.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_LVLUPS.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 10, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 13, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 16, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- if (Gauge >= 10000)
- {
- sonic_lv2_glow = energy_glow;
- if (!glow_down && sonic_lv2_glow_down) sonic_lv2_glow_down = false;
- }
- if (sonic_lv2_glow <= 20)
- {
- if (!sonic_lv2_glow_down)
- {
- if (sonic_lv2_glow < 20)
- {
- ++sonic_lv2_glow;
- SetMaterialAndSpriteColor_Float((0 + sonic_lv2_glow) / 20.0f, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (sonic_lv2_glow == 20)
- {
- sonic_lv2_glow = 0;
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- sonic_lv2_glow_down = true;
- }
- }
- else if (sonic_lv2_glow_down)
- {
- if (sonic_lv2_glow < 20)
- {
- ++sonic_lv2_glow;
- SetMaterialAndSpriteColor_Float((20 - sonic_lv2_glow) / 20.0f, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (sonic_lv2_glow == 20)
- {
- sonic_lv2_glow = 0;
- SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- sonic_lv2_glow_down = false;
- }
- }
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (!LV2_obtained)
- {
- HUD_SPRITE_LVLUPS_GLOW.p.x = 1119 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_LVLUPS_GLOW.p.y = 731 * 1.3f * VerticalResolution / 1050.0f;
- if (lv2_stretch < 60)
- {
- if (!LV2_active)
- {
- LV2_usable = true;
- }
- ++lv2_stretch;
- SetMaterialAndSpriteColor_Float((60 - lv2_stretch) / 60.0f, 1, 1, 1);
- HUD_SPRITE_LVLUPS_GLOW.sx = ((60 + (2.0f * lv2_stretch)) / 60.0f) * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_LVLUPS_GLOW.sy = ((60 + (2.0f * lv2_stretch)) / 60.0f) * 1.3f * VerticalResolution / 1050.0f;
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- else if (lv2_stretch == 60)
- {
- lv2_stretch = 0;
- LV2_obtained = true;
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- }
- else if (Gauge2 >= 30000)
- {
- lv1_stretch = 0;
- lv2_stretch = 0;
- LV1_obtained = false;
- LV2_obtained = false;
- LV1_usable = false;
- LV2_usable = false;
- sonic_lv1_glow = 0;
- sonic_lv1_glow_down = false;
- sonic_lv2_glow = 0;
- sonic_lv2_glow_down = false;
- HUD_SPRITE_LVLUPS.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_LVLUPS.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 11, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 14, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 17, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- if (Gauge >= 10000)
- {
- sonic_lv3_glow = energy_glow;
- if (!glow_down && sonic_lv3_glow_down) sonic_lv3_glow_down = false;
- }
- if (sonic_lv3_glow <= 20)
- {
- if (!sonic_lv3_glow_down)
- {
- if (sonic_lv3_glow < 20)
- {
- ++sonic_lv3_glow;
- SetMaterialAndSpriteColor_Float((0 + sonic_lv3_glow) / 20.0f, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (sonic_lv3_glow == 20)
- {
- sonic_lv3_glow = 0;
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- sonic_lv3_glow_down = true;
- }
- }
- else if (sonic_lv3_glow_down)
- {
- if (sonic_lv3_glow < 20)
- {
- ++sonic_lv3_glow;
- SetMaterialAndSpriteColor_Float((20 - sonic_lv3_glow) / 20.0f, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (sonic_lv3_glow == 20)
- {
- sonic_lv3_glow = 0;
- SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- sonic_lv3_glow_down = false;
- }
- }
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (!LV3_obtained)
- {
- HUD_SPRITE_LVLUPS_GLOW.p.x = 1134 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_LVLUPS_GLOW.p.y = 731 * 1.3f * VerticalResolution / 1050.0f;
- if (lv3_stretch < 60)
- {
- if (!LV3_active)
- {
- LV3_usable = true;
- }
- ++lv3_stretch;
- SetMaterialAndSpriteColor_Float((60 - lv3_stretch) / 60.0f, 1, 1, 1);
- HUD_SPRITE_LVLUPS_GLOW.sx = ((60 + (2.0f * lv3_stretch)) / 60.0f) * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_LVLUPS_GLOW.sy = ((60 + (2.0f * lv3_stretch)) / 60.0f) * 1.3f * VerticalResolution / 1050.0f;
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- else if (lv3_stretch == 60)
- {
- lv3_stretch = 0;
- LV3_obtained = true;
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- }
- //LEVEL ACTIVATION
- if (GameState != 16)
- {
- if (LV1_usable && !LV2_usable && !LV3_usable)
- {
- if (ControllerPointers[0]->PressedButtons & Buttons_B)
- {
- PlaySound(1250, 0, 0, 0);
- LV1_obtained = false;
- LV1_usable = false;
- LV1_active = true;
- Gauge2 = 9999;
- sonic_lv1_glow = 0;
- sonic_lv2_glow = 0;
- sonic_lv3_glow = 0;
- lvl_glow_down = false;
- sonic_lv1_glow_down = false;
- sonic_lv2_glow_down = false;
- sonic_lv3_glow_down = false;
- star_glow = 0;
- circle_glow = 0;
- level3_glow = 0;
- }
- }
- }
- if (LV1_active)
- {
- if (GameState != 16)
- {
- if (!RED_GEM_active)
- {
- Gauge2 -= 8;
- }
- else
- {
- Gauge2 -= 4;
- }
- if (Gauge2 <= 0)
- {
- LV1_active = false;
- PlaySound(1247, 0, 0, 0);
- }
- //3D HUD
- ParticleDepthOverride = 2000.0f;
- if (star_glow < 10)
- {
- ++star_glow;
- SetMaterialAndSpriteColor_Float((10 - star_glow) / 10.0f, 1, 1, 1);
- HUD3D_SPRITE_STAR.sx = ((3 + (star_glow / 2.0f)) / 10.0f) * 1.3f * HorizontalResolution / 1680.0f;
- HUD3D_SPRITE_STAR.sy = ((3 + (star_glow / 2.0f)) / 10.0f) * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite3D(&HUD3D_SPRITE_STAR, 0, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
- }
- else if (star_glow == 10)
- {
- star_glow = 0;
- SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
- HUD3D_SPRITE_STAR.sx = 1.3f * HorizontalResolution / 1680.0f;
- HUD3D_SPRITE_STAR.sy = 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite3D(&HUD3D_SPRITE_STAR, 0, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- ParticleDepthOverride = 0.0f;
- }
- //2D HUD
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 9, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 12, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 15, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- if (sonic_lv1_glow <= 2)
- {
- if (!sonic_lv1_glow_down)
- {
- if (sonic_lv1_glow < 2)
- {
- ++sonic_lv1_glow;
- SetMaterialAndSpriteColor_Float((0 + sonic_lv1_glow) / 2.0f, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (sonic_lv1_glow == 2)
- {
- sonic_lv1_glow = 0;
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- sonic_lv1_glow_down = true;
- }
- }
- else if (sonic_lv1_glow_down)
- {
- if (sonic_lv1_glow < 2)
- {
- ++sonic_lv1_glow;
- SetMaterialAndSpriteColor_Float((2 - sonic_lv1_glow) / 2.0f, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (sonic_lv1_glow == 2)
- {
- sonic_lv1_glow = 0;
- SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- sonic_lv1_glow_down = false;
- }
- }
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- if (GameState != 16)
- {
- if (LV3_usable)
- {
- if (ControllerPointers[0]->PressedButtons & Buttons_B)
- {
- PlaySound(1250, 0, 0, 0);
- LV1_obtained = false;
- LV2_obtained = false;
- LV3_obtained = false;
- LV1_usable = false;
- LV2_usable = false;
- LV3_usable = false;
- LV3_active = true;
- Gauge2 = 9999;
- sonic_lv1_glow = 0;
- sonic_lv2_glow = 0;
- sonic_lv3_glow = 0;
- lvl_glow_down = false;
- sonic_lv1_glow_down = false;
- sonic_lv2_glow_down = false;
- sonic_lv3_glow_down = false;
- star_glow = 0;
- circle_glow = 0;
- level3_glow = 0;
- }
- }
- }
- if (LV3_active)
- {
- if (GameState != 16)
- {
- if (is_sonic) Gauge += 8;
- if (is_shadow) Gauge += 4;
- if (!RED_GEM_active) Gauge2 -= 8;
- else Gauge2 -= 4;
- if (is_metalsonic && (!(Gauge <= 0 && is_hovering) && !just_charged)) Gauge += 16;
- if (Gauge2 <= 0)
- {
- LV3_active = false;
- sparkles.clear();
- sparkletimer = 0;
- PlaySound(1247, 0, 0, 0);
- }
- //3D HUD
- ParticleDepthOverride = 2000.0f;
- if (star_glow < 10)
- {
- ++star_glow;
- SetMaterialAndSpriteColor_Float((10 - star_glow) / 10.0f, 1, 1, 1);
- HUD3D_SPRITE_STAR.sx = ((3 + (star_glow / 2.0f)) / 10.0f) * 1.3f * HorizontalResolution / 1680.0f;
- HUD3D_SPRITE_STAR.sy = ((3 + (star_glow / 2.0f)) / 10.0f) * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite3D(&HUD3D_SPRITE_STAR, 0, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
- }
- else if (star_glow == 10)
- {
- star_glow = 0;
- SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
- HUD3D_SPRITE_STAR.sx = 1.3f * HorizontalResolution / 1680.0f;
- HUD3D_SPRITE_STAR.sy = 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite3D(&HUD3D_SPRITE_STAR, 0, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (circle_glow < 14)
- {
- ++circle_glow;
- SetMaterialAndSpriteColor_Float((14 - circle_glow) / 14.0f, 1, 1, 1);
- HUD3D_SPRITE_CIRCLE.sx = (circle_glow / 14.0f) * 1.3f * HorizontalResolution / 1680.0f;
- HUD3D_SPRITE_CIRCLE.sy = (circle_glow / 14.0f) * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite3D(&HUD3D_SPRITE_CIRCLE, 1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
- }
- else if (circle_glow == 14)
- {
- SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
- HUD3D_SPRITE_CIRCLE.sx = 1.3f * HorizontalResolution / 1680.0f;
- HUD3D_SPRITE_CIRCLE.sy = 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite3D(&HUD3D_SPRITE_CIRCLE, 1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
- ++circle_glow;
- }
- else if (circle_glow > 14)
- {
- if (++circle_glow == 20)
- {
- circle_glow = 0;
- }
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- //Level 3 sparkles
- ParticleDepthOverride = 0.0f;
- EntityData1 *co1 = EntityData1Ptrs[0];
- for (auto it = sparkles.begin(); it != sparkles.end(); )
- {
- sparklesprite.p = it->pos;
- njDrawSprite3D_Queue(&sparklesprite, 5 + (it->frame++ / 2), NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
- if (it->frame >= 16)
- it = sparkles.erase(it);
- else
- ++it;
- }
- if (++sparkletimer == 3)
- {
- sparkledata sp = {};
- NJS_VECTOR pos = { 0, ((float)rand() / RAND_MAX) * 8.0, 0 };
- njPushMatrix(nullptr);
- njRotateX(nullptr, rand() & 0xFFFF);
- njRotateY(nullptr, rand() & 0xFFFF);
- njRotateZ(nullptr, rand() & 0xFFFF);
- njCalcVector(nullptr, &pos, &sp.pos);
- njPopMatrix(1);
- sp.pos.x += co1->CollisionInfo->CollisionArray->origin.x;
- sp.pos.y += co1->CollisionInfo->CollisionArray->origin.y;
- sp.pos.z += co1->CollisionInfo->CollisionArray->origin.z;
- sparkles.push_back(sp);
- sparkletimer = 0;
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 11, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 14, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 17, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- if (sonic_lv3_glow <= 2)
- {
- if (!sonic_lv3_glow_down)
- {
- if (sonic_lv3_glow < 2)
- {
- ++sonic_lv3_glow;
- SetMaterialAndSpriteColor_Float((0 + sonic_lv3_glow) / 2.0f, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (sonic_lv3_glow == 2)
- {
- sonic_lv3_glow = 0;
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- sonic_lv3_glow_down = true;
- }
- }
- else if (sonic_lv3_glow_down)
- {
- if (sonic_lv3_glow < 2)
- {
- ++sonic_lv3_glow;
- SetMaterialAndSpriteColor_Float((2 - sonic_lv3_glow) / 2.0f, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (sonic_lv3_glow == 2)
- {
- sonic_lv3_glow = 0;
- SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
- if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- else if (is_metalsonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- sonic_lv3_glow_down = false;
- }
- }
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (is_sonic) SetMaterialAndSpriteColor_Float(0.75, 0.10588, 0.48235, 0.94902);
- else if (is_shadow) SetMaterialAndSpriteColor_Float(0.75, 0.92157, 0.19608, 0.13725);
- else if (is_metalsonic) SetMaterialAndSpriteColor_Float(0.75, 0, 0.11373, 0.54118);
- njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, (Gauge2 / 100), -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- }
- else if (GetCharacterID(0) == Characters_Tails)
- {
- HUD_SPRITE.p.x = 110 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE.p.y = 205 * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite2D_Queue(&HUD_SPRITE, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (GetCharacterID(0) == Characters_Knuckles)
- {
- HUD_SPRITE.p.x = 110 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE.p.y = 205 * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite2D_Queue(&HUD_SPRITE, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (GetCharacterID(0) == Characters_Amy)
- {
- HUD_SPRITE.p.x = 110 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE.p.y = 205 * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite2D_Queue(&HUD_SPRITE, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- else if (GetCharacterID(0) == Characters_Gamma)
- {
- HUD_SPRITE.p.x = 110 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE.p.y = 205 * 1.3f * VerticalResolution / 1050.0f;
- njDrawSprite2D_Queue(&HUD_SPRITE, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- //Ring Counter
- HUD_SPRITE_NUMBERS.p.x = 157 * 1.3f * HorizontalResolution / 1680.0f;
- HUD_SPRITE_NUMBERS.p.y = 174 * 1.3f * VerticalResolution / 1050.0f;
- HUD_SPRITE_RINGS_0_RED.p.x = (HUD_SPRITE_NUMBERS.p.x/1.3f) + (55 * HorizontalResolution / 1680.0f);
- HUD_SPRITE_RINGS_0_RED.p.y = (HUD_SPRITE_NUMBERS.p.y/1.3f) + (42 * VerticalResolution / 1050.0f);
- if (Rings == 0)
- {
- njDrawSprite2D_Queue(&HUD_SPRITE_RINGS_0_RED, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- ++zero_ring_alpha;
- SetMaterialAndSpriteColor_Float((9 - zero_ring_alpha) / 9.0f, 1, 1, 1);
- njDrawSprite2D_Queue(&HUD_SPRITE_RINGS_0_RED, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- if (zero_ring_alpha == 9)
- {
- zero_ring_alpha = 0;
- }
- }
- else if (Rings > 0 && Rings < 1000)
- {
- HudDisplayZerosSTH06(Rings, 3, &HUD_SPRITE_NUMBERS);
- zero_ring_alpha = 0;
- }
- else if (Rings >= 1000)
- {
- HudDisplayZerosSTH06(Rings, 4, &HUD_SPRITE_NUMBERS);
- zero_ring_alpha = 0;
- }
- HUD_SPRITE_RING_ANIM.p.x = 161 * HorizontalResolution / 1680.0f;
- HUD_SPRITE_RING_ANIM.p.y = 225 * VerticalResolution / 1050.0f;
- if (Rings - OldRingsHUD > 0)
- {
- can_animate_loss = 0;
- ++can_animate_gain;
- njDrawSprite2D_Queue(&HUD_SPRITE_RING_ANIM, can_animate_gain, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- if (can_animate_gain == 7)
- {
- OldRingsHUD = Rings;
- can_animate_gain = 0;
- }
- }
- else if (Rings - OldRingsHUD < 0)
- {
- can_animate_gain = 0;
- ++can_animate_loss;
- njDrawSprite2D_Queue(&HUD_SPRITE_RING_ANIM, 8 - can_animate_loss, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- if (can_animate_loss == 7)
- {
- OldRingsHUD = Rings;
- can_animate_loss = 0;
- }
- }
- else if (OldRingsHUD == Rings)
- {
- njDrawSprite2D_Queue(&HUD_SPRITE_RING_ANIM, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- }
- //Timer Minutes
- HUD_SPRITE_NUMBERS.p.x = (130.846 * 1.3f * HorizontalResolution / 1680.0f);
- HUD_SPRITE_NUMBERS.p.y = (124 * 1.3f * VerticalResolution / 1050.0f);
- HudDisplayZerosSTH06(TimeMinutes, 2, &HUD_SPRITE_NUMBERS);
- //Timer Seconds
- HUD_SPRITE_NUMBERS.p.x = HUD_SPRITE_NUMBERS.p.x + (35 *1.3f * HorizontalResolution / ( 1680.0f));
- HUD_SPRITE_NUMBERS.p.y = HUD_SPRITE_NUMBERS.p.y;
- HudDisplayZerosSTH06(TimeSeconds, 2, &HUD_SPRITE_NUMBERS);
- //Timer Frames
- HUD_SPRITE_NUMBERS.p.x = HUD_SPRITE_NUMBERS.p.x + (37 *1.3f * HorizontalResolution / ( 1680.0f));
- HUD_SPRITE_NUMBERS.p.y = HUD_SPRITE_NUMBERS.p.y;
- HudDisplayFramesSTH06(TimeFrames, 3, &HUD_SPRITE_NUMBERS);
- //Lives Counter
- HUD_SPRITE_NUMBERS.p.y = 224 * 1.3f * VerticalResolution / 1050.0f;
- if (Lives < 10)
- {
- HUD_SPRITE_NUMBERS.p.x = 194.538 * 1.3f * HorizontalResolution / 1680.0f;
- HudDisplayNoZerosSTH06(Lives, 1, &HUD_SPRITE_NUMBERS);
- }
- else if (Lives >= 10)
- {
- HUD_SPRITE_NUMBERS.p.x = 176.538 * 1.3f * HorizontalResolution / 1680.0f;
- HudDisplayNoZerosSTH06(Lives, 2, &HUD_SPRITE_NUMBERS);
- }
- //Score Counter
- HUD_SPRITE_NUMBERS.p.y = 71.692 * 1.3f * VerticalResolution / 1050.0f;
- if (EnemyBonus < 10)
- {
- HUD_SPRITE_NUMBERS.p.x = 274.692 * 1.3f * HorizontalResolution / 1680.0f;
- HudDisplayNoZerosSTH06(EnemyBonus, 1, &HUD_SPRITE_NUMBERS);
- }
- else if (EnemyBonus >= 10 && EnemyBonus < 100)
- {
- HUD_SPRITE_NUMBERS.p.x = 256.692 * 1.3f * HorizontalResolution / 1680.0f;
- HudDisplayNoZerosSTH06(EnemyBonus, 2, &HUD_SPRITE_NUMBERS);
- }
- else if (EnemyBonus >= 100 && EnemyBonus < 1000)
- {
- HUD_SPRITE_NUMBERS.p.x = 238.692 * 1.3f * HorizontalResolution / 1680.0f;
- HudDisplayNoZerosSTH06(EnemyBonus, 3, &HUD_SPRITE_NUMBERS);
- }
- else if (EnemyBonus >= 1000 && EnemyBonus < 10000)
- {
- HUD_SPRITE_NUMBERS.p.x = 220.692 * 1.3f * HorizontalResolution / 1680.0f;
- HudDisplayNoZerosSTH06(EnemyBonus, 4, &HUD_SPRITE_NUMBERS);
- }
- else if (EnemyBonus >= 10000 && EnemyBonus < 100000)
- {
- HUD_SPRITE_NUMBERS.p.x = 202.692 * 1.3f * HorizontalResolution / 1680.0f;
- HudDisplayNoZerosSTH06(EnemyBonus, 5, &HUD_SPRITE_NUMBERS);
- }
- else if (EnemyBonus >= 100000 && EnemyBonus < 1000000)
- {
- HUD_SPRITE_NUMBERS.p.x = 184.692 * 1.3f * HorizontalResolution / 1680.0f;
- HudDisplayNoZerosSTH06(EnemyBonus, 6, &HUD_SPRITE_NUMBERS);
- }
- else if (EnemyBonus >= 1000000 && EnemyBonus < 10000000)
- {
- HUD_SPRITE_NUMBERS.p.x = 166.692 * 1.3f * HorizontalResolution / 1680.0f;
- HudDisplayNoZerosSTH06(EnemyBonus, 7, &HUD_SPRITE_NUMBERS);
- }
- else if (EnemyBonus >= 10000000 && EnemyBonus < 100000000)
- {
- HUD_SPRITE_NUMBERS.p.x = 148.692 * 1.3f * HorizontalResolution / 1680.0f;
- HudDisplayNoZerosSTH06(EnemyBonus, 8, &HUD_SPRITE_NUMBERS);
- }
- else
- {
- HUD_SPRITE_NUMBERS.p.x = 130.692 * 1.3f * HorizontalResolution / 1680.0f;
- HudDisplayNoZerosSTH06(EnemyBonus, 9, &HUD_SPRITE_NUMBERS);
- }
- }
- }
- }
- void MetalSonicHUD(EntityData1 *a1, CharObj2 *a2)
- {
- if (GameState != 21 && is_metalsonic)
- {
- //Metal Sonic Gems Spakles
- //Value checks
- //if (NO_GEM_ON) draw = 0;
- if (BLUE_GEM_ON) draw = 0;
- else if (RED_GEM_ON) draw = 1;
- else if (GREEN_GEM_ON) draw = 2;
- else if (PURPLE_GEM_ON) draw = 3;
- else if (SKY_GEM_ON) draw = 4;
- else if (WHITE_GEM_ON) draw = 5;
- else if (YELLOW_GEM_ON) draw = 6;
- if (!NO_GEM_ON)
- {
- //Gems on Gauge
- GEMSGauge_SPRITE.p.x = 1490 * HorizontalResolution / 1680.0f;
- GEMSGauge_SPRITE.p.y = 872 * VerticalResolution / 1050.0f;
- njDrawSprite2D_Queue(&GEMSGauge_SPRITE, draw, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
- //Actual Sparkles
- njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_ONE);
- njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_ONE);
- //njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCALPHA);
- //njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_DESTALPHA);
- njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
- //Big ones
- ParticleDepthOverride = 0.0f;
- EntityData1 *co1 = EntityData1Ptrs[0];
- for (auto it = sparklesgems.begin(); it != sparklesgems.end(); )
- {
- NJS_VECTOR pos_gems = { 0, it->radius, 0 };
- njPushMatrix(nullptr);
- njRotateX(nullptr, it->rotation.x);
- njRotateY(nullptr, it->rotation.y);
- njRotateZ(nullptr, it->rotation.z);
- njCalcVector(nullptr, &pos_gems, &sparklegemssprite.p);
- njPopMatrix(1);
- sparklegemssprite.p.x += it->pos_gems.x;
- sparklegemssprite.p.y += it->pos_gems.y;
- sparklegemssprite.p.z += it->pos_gems.z;
- if (it->framegems < 11)
- {
- SetMaterialAndSpriteColor_Float((11 - it->framegems) / 11.0f, 1, 1, 1);
- sparklegemssprite.sx = ((22 - it->framegems) / 22.0f) * 0.6f * 1.3f * HorizontalResolution / 1680.0f;
- sparklegemssprite.sy = ((22 - it->framegems) / 22.0f) * 0.6f * 1.3f * VerticalResolution / 1050.0f;
- if (Gauge > 0 && a2->AnimationThing.Index != 87) njDrawSprite3D_Queue(&sparklegemssprite, (2 * draw), NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
- }
- it->framegems++;
- if (it->framegems >= 11)
- it = sparklesgems.erase(it);
- else
- {
- it->radius += 0.15f;
- ++it;
- }
- }
- if (++sparklegemstimer == 8)
- {
- sparklegemsdata sp = {};
- //sp.radius = ((float)rand() / RAND_MAX) * 8.0;//if I wanted them to spawn in the center
- sp.radius = (((float)rand() / RAND_MAX) * 3.0) + 4.0;//sp.radius = (((float)rand() / RAND_MAX) * max_radius) + min_radius; //if min_radius is 2, and max_radius is 3, then the sparkles will spawn between 2 and 5 (2+3) away
- sp.rotation.x = rand() & 0xFFFF;
- sp.rotation.y = rand() & 0xFFFF;
- sp.rotation.z = rand() & 0xFFFF;
- sp.pos_gems = co1->CollisionInfo->CollisionArray->origin;
- sparklesgems.push_back(sp);
- sparklegemstimer = 0;
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- //Small ones
- ParticleDepthOverride = 0.0f;
- for (auto it = sparklesgems_tiny.begin(); it != sparklesgems_tiny.end(); )
- {
- NJS_VECTOR pos_gems = { 0, it->radius, 0 };
- njPushMatrix(nullptr);
- njRotateX(nullptr, it->rotation.x);
- njRotateY(nullptr, it->rotation.y);
- njRotateZ(nullptr, it->rotation.z);
- njCalcVector(nullptr, &pos_gems, &sparklegemssprite.p);
- njPopMatrix(1);
- sparklegemssprite.p.x += it->pos_gems.x;
- sparklegemssprite.p.y += it->pos_gems.y;
- sparklegemssprite.p.z += it->pos_gems.z;
- if (it->framegems_tiny < 11)
- {
- SetMaterialAndSpriteColor_Float((11 - it->framegems_tiny) / 11.0f, 1, 1, 1);
- sparklegemssprite.sx = ((22 - it->framegems_tiny) / 22.0f) * 0.0375f * 1.3f * HorizontalResolution / 1680.0f;
- sparklegemssprite.sy = ((22 - it->framegems_tiny) / 22.0f) * 0.0375f * 1.3f * VerticalResolution / 1050.0f;
- if (Gauge > 0 && a2->AnimationThing.Index != 87) njDrawSprite3D_Queue(&sparklegemssprite, ((2 * draw) + 1), NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
- }
- it->framegems_tiny++;
- if (it->framegems_tiny >= 15)
- it = sparklesgems_tiny.erase(it);
- else
- {
- it->radius += 0.075f;
- ++it;
- }
- }
- if (++sparklegems_tiny_timer == 3)
- {
- sparklegemsdata sp = {};
- sp.radius = (((float)rand() / RAND_MAX) * 2.0) + 2.5;
- sp.rotation.x = rand() & 0xFFFF;
- sp.rotation.y = rand() & 0xFFFF;
- sp.rotation.z = rand() & 0xFFFF;
- sp.pos_gems = co1->CollisionInfo->CollisionArray->origin;
- sparklesgems_tiny.push_back(sp);
- sparklegems_tiny_timer = 0;
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCALPHA);
- njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_INVSRCALPHA);
- njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
- }
- }
- void ShadowCBparticles(EntityData1 *a1, CharObj2 *a2)
- {
- if (GameState != 21 && is_shadow)
- {
- if (!CB_lv1 && CB_active)
- {
- //Actual Sparkles
- njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_ONE);
- njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_ONE);
- //njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCALPHA);
- //njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_DESTALPHA);
- njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
- //Red ones
- ParticleDepthOverride = 0.0f;
- EntityData1 *co1 = EntityData1Ptrs[0];
- for (auto it = sparklesCB.begin(); it != sparklesCB.end(); )
- {
- NJS_VECTOR pos_CB = { 0, it->radiusCB, 0 };
- njPushMatrix(nullptr);
- njRotateX(nullptr, it->rotation.x);
- njRotateY(nullptr, it->rotation.y);
- njRotateZ(nullptr, it->rotation.z);
- ////njRotateX(nullptr, EntityData1Ptrs[0]->Rotation.x);
- ////njRotateY(nullptr, EntityData1Ptrs[0]->Rotation.y);
- ////njRotateZ(nullptr, EntityData1Ptrs[0]->Rotation.z);
- //njRotateX(nullptr, it->rotation.x + EntityData1Ptrs[0]->Rotation.x);
- //njRotateY(nullptr, it->rotation.y + EntityData1Ptrs[0]->Rotation.y);
- //njRotateZ(nullptr, it->rotation.z + EntityData1Ptrs[0]->Rotation.z);
- njCalcVector(nullptr, &pos_CB, &sparkleShadowCBsprite.p);
- njPopMatrix(1);
- sparkleShadowCBsprite.p.x += EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.x;
- sparkleShadowCBsprite.p.y += EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.y;
- sparkleShadowCBsprite.p.z += EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.z;
- if (it->frameCB < 11)
- {
- SetMaterialAndSpriteColor_Float((11 - it->frameCB) / 11.0f, 1, 1, 1);
- sparkleShadowCBsprite.sx = ((22 - it->frameCB) / 22.0f) * 0.6f * 1.3f * HorizontalResolution / 1680.0f;
- sparkleShadowCBsprite.sy = ((22 - it->frameCB) / 22.0f) * 0.6f * 1.3f * VerticalResolution / 1050.0f;
- if (a2->AnimationThing.Index != 87) njDrawSprite3D_Queue(&sparkleShadowCBsprite, 2, NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
- }
- it->frameCB++;
- if (it->frameCB >= 11)
- it = sparklesCB.erase(it);
- else
- {
- it->radiusCB += 0.15f;
- ++it;
- }
- }
- if (++sparkleCBtimer == 8)
- {
- sparkleCBdata sp = {};
- //sp.radius = ((float)rand() / RAND_MAX) * 8.0;//if I wanted them to spawn in the center
- sp.radiusCB = (((float)rand() / RAND_MAX) * 3.0) + 4.0;//sp.radius = (((float)rand() / RAND_MAX) * max_radius) + min_radius; //if min_radius is 2, and max_radius is 3, then the sparkles will spawn between 2 and 5 (2+3) away
- sp.rotation.x = rand() & 0xFFFF;
- sp.rotation.y = rand() & 0xFFFF;
- sp.rotation.z = rand() & 0xFFFF;
- sparklesCB.push_back(sp);
- sparkleCBtimer = 0;
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- //Purple ones
- ParticleDepthOverride = 0.0f;
- for (auto it = sparklesCB_tiny.begin(); it != sparklesCB_tiny.end(); )
- {
- NJS_VECTOR pos_CB = { 0, it->radiusCB, 0 };
- njPushMatrix(nullptr);
- njRotateX(nullptr, it->rotation.x);
- njRotateY(nullptr, it->rotation.y);
- njRotateZ(nullptr, it->rotation.z);
- ////njRotateX(nullptr, EntityData1Ptrs[0]->Rotation.x);
- ////njRotateY(nullptr, EntityData1Ptrs[0]->Rotation.y);
- ////njRotateZ(nullptr, EntityData1Ptrs[0]->Rotation.z);
- //njRotateX(nullptr, it->rotation.x + EntityData1Ptrs[0]->Rotation.x);
- //njRotateY(nullptr, it->rotation.y + EntityData1Ptrs[0]->Rotation.y);
- //njRotateZ(nullptr, it->rotation.z + EntityData1Ptrs[0]->Rotation.z);
- njCalcVector(nullptr, &pos_CB, &sparkleShadowCBsprite.p);
- njPopMatrix(1);
- sparkleShadowCBsprite.p.x += EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.x;
- sparkleShadowCBsprite.p.y += EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.y;
- sparkleShadowCBsprite.p.z += EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.z;
- if (it->frameCB_tiny < 11)
- {
- SetMaterialAndSpriteColor_Float((11 - it->frameCB_tiny) / 11.0f, 1, 1, 1);
- sparkleShadowCBsprite.sx = ((22 - it->frameCB_tiny) / 22.0f) * 0.0375f * 3.5f * 1.3f * HorizontalResolution / 1680.0f;
- sparkleShadowCBsprite.sy = ((22 - it->frameCB_tiny) / 22.0f) * 0.0375f * 3.5f * 1.3f * VerticalResolution / 1050.0f;
- if (a2->AnimationThing.Index != 87) njDrawSprite3D_Queue(&sparkleShadowCBsprite, 6, NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
- }
- it->frameCB_tiny++;
- if (it->frameCB_tiny >= 15)
- it = sparklesCB_tiny.erase(it);
- else
- {
- it->radiusCB += 0.075f;
- ++it;
- }
- }
- if (++sparkleCB_tiny_timer == 3)
- {
- sparkleCBdata sp = {};
- sp.radiusCB = (((float)rand() / RAND_MAX) * 2.0) + 2.5;
- sp.rotation.x = rand() & 0xFFFF;
- sp.rotation.y = rand() & 0xFFFF;
- sp.rotation.z = rand() & 0xFFFF;
- sparklesCB_tiny.push_back(sp);
- sparkleCB_tiny_timer = 0;
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCALPHA);
- njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_INVSRCALPHA);
- njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
- }
- }
- void ShadowChaosBlastparticles(EntityData1 *a1, CharObj2 *a2)
- {
- if (GameState != 21 && is_shadow)
- {
- if (chaos_blast_active_timer > 0 && chaos_blast_active_timer <= 110)
- {
- //Actual Sparkles
- njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_ONE);
- njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_ONE);
- //njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCALPHA);
- //njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_DESTALPHA);
- njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
- //White ones
- ParticleDepthOverride = 0.0f;
- EntityData1 *co1 = EntityData1Ptrs[0];
- for (auto it = sparkleschaosblast.begin(); it != sparkleschaosblast.end(); )
- {
- NJS_VECTOR pos_chaosblast = { 0, it->radiuschaosblast, 0 };
- njPushMatrix(nullptr);
- njRotateX(nullptr, it->rotation.x);
- njRotateY(nullptr, it->rotation.y);
- njRotateZ(nullptr, it->rotation.z);
- njCalcVector(nullptr, &pos_chaosblast, &sparkleShadowChaosBlastsprite.p);
- njPopMatrix(1);
- sparkleShadowChaosBlastsprite.p.x += EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.x;
- sparkleShadowChaosBlastsprite.p.y += EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.y;
- sparkleShadowChaosBlastsprite.p.z += EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.z;
- if (it->framechaosblast < 11)
- {
- SetMaterialAndSpriteColor_Float((11 - it->framechaosblast) / 11.0f, 1, 1, 1);
- sparkleShadowChaosBlastsprite.sx = ((22 - it->framechaosblast) / 22.0f) * 0.7f * HorizontalResolution / 1680.0f;
- sparkleShadowChaosBlastsprite.sy = ((22 - it->framechaosblast) / 22.0f) * 0.7f * VerticalResolution / 1050.0f;
- if (a2->AnimationThing.Index != 87) njDrawSprite3D_Queue(&sparkleShadowChaosBlastsprite, 14, NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
- }
- it->framechaosblast++;
- if (it->framechaosblast >= 11)
- it = sparkleschaosblast.erase(it);
- else
- {
- it->radiuschaosblast += 1.2f;
- ++it;
- }
- }
- if (++sparklechaosblasttimer == 1)
- {
- sparklechaosblastdata sp = {};
- //sp.radius = ((float)rand() / RAND_MAX) * 8.0;//if I wanted them to spawn in the center
- sp.radiuschaosblast = (((float)rand() / RAND_MAX) * 8.0) + 4.0;//sp.radius = (((float)rand() / RAND_MAX) * max_radius) + min_radius; //if min_radius is 2, and max_radius is 3, then the sparkles will spawn between 2 and 5 (2+3) away
- sp.rotation.x = rand() & 0xFFFF;
- sp.rotation.y = rand() & 0xFFFF;
- sp.rotation.z = rand() & 0xFFFF;
- sparkleschaosblast.push_back(sp);
- sparklechaosblasttimer = 0;
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- //Blue ones
- ParticleDepthOverride = 0.0f;
- for (auto it = sparkleschaosblast_tiny.begin(); it != sparkleschaosblast_tiny.end(); )
- {
- NJS_VECTOR pos_chaosblast = { 0, it->radiuschaosblast, 0 };
- njPushMatrix(nullptr);
- njRotateX(nullptr, it->rotation.x);
- njRotateY(nullptr, it->rotation.y);
- njRotateZ(nullptr, it->rotation.z);
- njCalcVector(nullptr, &pos_chaosblast, &sparkleShadowChaosBlastsprite.p);
- njPopMatrix(1);
- sparkleShadowChaosBlastsprite.p.x += EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.x;
- sparkleShadowChaosBlastsprite.p.y += EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.y;
- sparkleShadowChaosBlastsprite.p.z += EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.z;
- if (it->framechaosblast_tiny < 11)
- {
- SetMaterialAndSpriteColor_Float((11 - it->framechaosblast_tiny) / 11.0f, 1, 1, 1);
- sparkleShadowChaosBlastsprite.sx = ((22 - it->framechaosblast_tiny) / 22.0f) * 0.7f * HorizontalResolution / 1680.0f;
- sparkleShadowChaosBlastsprite.sy = ((22 - it->framechaosblast_tiny) / 22.0f) * 0.7f * VerticalResolution / 1050.0f;
- if (a2->AnimationThing.Index != 87) njDrawSprite3D_Queue(&sparkleShadowChaosBlastsprite, 15, NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
- }
- it->framechaosblast_tiny++;
- if (it->framechaosblast_tiny >= 15)
- it = sparkleschaosblast_tiny.erase(it);
- else
- {
- it->radiuschaosblast += 0.9f;
- ++it;
- }
- }
- if (++sparklechaosblast_tiny_timer == 3)
- {
- sparklechaosblastdata sp = {};
- sp.radiuschaosblast = (((float)rand() / RAND_MAX) * 6.0) + 3.0;
- sp.rotation.x = rand() & 0xFFFF;
- sp.rotation.y = rand() & 0xFFFF;
- sp.rotation.z = rand() & 0xFFFF;
- sparkleschaosblast_tiny.push_back(sp);
- sparklechaosblast_tiny_timer = 0;
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCALPHA);
- njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_INVSRCALPHA);
- njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
- }
- }
- void ShadowCBbolt(EntityData1 *a1, CharObj2 *a2)
- {
- if (GameState != 21 && is_shadow)
- {
- if (chaos_blast_active_timer > 42 && chaos_blast_active_timer <= 210)
- {
- njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_ONE);
- njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_ONE);
- //njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCALPHA);
- //njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_DESTALPHA);
- njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
- //Bolt sparkles
- ParticleDepthOverride = 0.0f;
- EntityData1 *co1 = EntityData1Ptrs[0];
- for (auto it = sparklesCBbolt.begin(); it != sparklesCBbolt.end(); )
- {
- sparkleShadowCBbolt.p = it->pos_CBbolt;
- njDrawSprite3D_Queue(&sparkleShadowCBbolt, 16 + (it->frameCBbolt++ / 3), NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
- if (it->frameCBbolt >= 27)
- it = sparklesCBbolt.erase(it);
- else
- ++it;
- }
- if (chaos_blast_active_timer <= 110)
- {
- if (++sparkleCBbolttimer == 4)
- {
- sparkleCBboltdata sp = {};
- NJS_VECTOR pos_CBbolt = { 0, (((float)rand() / RAND_MAX) * 0.0) + 17.0, 0 };
- njPushMatrix(nullptr);
- njRotateX(nullptr, rand() & 0xFFFF);
- njRotateY(nullptr, rand() & 0xFFFF);
- njRotateZ(nullptr, rand() & 0xFFFF);
- njCalcVector(nullptr, &pos_CBbolt, &sp.pos_CBbolt);
- njPopMatrix(1);
- sp.pos_CBbolt.x += co1->CollisionInfo->CollisionArray->origin.x;
- sp.pos_CBbolt.y += co1->CollisionInfo->CollisionArray->origin.y;
- sp.pos_CBbolt.z += co1->CollisionInfo->CollisionArray->origin.z;
- sparklesCBbolt.push_back(sp);
- sparkleCBbolttimer = 0;
- }
- }
- else
- {
- if (++sparkleCBbolttimer == 3)
- {
- sparkleCBboltdata sp = {};
- NJS_VECTOR pos_CBbolt = { 0, (((float)rand() / RAND_MAX) * ((10.0f*cbREDsize) - 34.0f)) + 17.0, 0 };
- njPushMatrix(nullptr);
- njRotateX(nullptr, rand() & 0xFFFF);
- njRotateY(nullptr, rand() & 0xFFFF);
- njRotateZ(nullptr, rand() & 0xFFFF);
- njCalcVector(nullptr, &pos_CBbolt, &sp.pos_CBbolt);
- njPopMatrix(1);
- sp.pos_CBbolt.x += co1->CollisionInfo->CollisionArray->origin.x;
- sp.pos_CBbolt.y += co1->CollisionInfo->CollisionArray->origin.y;
- sp.pos_CBbolt.z += co1->CollisionInfo->CollisionArray->origin.z;
- sparklesCBbolt.push_back(sp);
- sparkleCBbolttimer = 0;
- }
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- else
- {
- sparklesCBbolt.clear();
- sparkleCBbolttimer = 0;
- }
- njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCALPHA);
- njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_INVSRCALPHA);
- njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
- }
- }
- //For ShadowCBLV3 alpha thing
- float InverseLerp(0, 16, it->frameCBLV3)
- {
- return (value - low) / (high - low);
- }
- void ShadowCBLV3(EntityData1 *a1, CharObj2 *a2)
- {
- if (GameState != 21 && is_shadow)
- {
- if (CB_lv3)
- {
- njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_ONE);
- njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_ONE);
- njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
- njAlphaMode(1);
- LV3alpha += 0.0625f;
- ParticleDepthOverride = 0.0f;
- EntityData1 *co1 = EntityData1Ptrs[0];
- for (auto it = sparklesCBLV3.begin(); it != sparklesCBLV3.end(); )
- {
- sparkleShadowCBLV3.p = it->pos_CBLV3;
- SetMaterialAndSpriteColor_Float(1, (1 - LV3alpha), 0, 0);
- njDrawSprite3D_Queue(&sparkleShadowCBLV3, 26 + (it->frameCBLV3++ / 32), NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
- //njDrawSprite3D(&sparkleShadowCBLV3, 26 + (it->frameCBLV3++ / 32), NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
- if (it->frameCBLV3 >= 16)
- {
- it = sparklesCBLV3.erase(it);
- }
- else
- ++it;
- }
- if (LV3alpha > 1.0) LV3alpha = 0.0f;
- if (++sparkleCBLV3timer == 3)
- {
- sparkleCBLV3data sp = {};
- NJS_VECTOR pos_CBLV3 = { 0, ((float)rand() / RAND_MAX) * 3.5, 0 };
- njPushMatrix(nullptr);
- njRotateX(nullptr, rand() & 0xFFFF);
- njRotateY(nullptr, rand() & 0xFFFF);
- njRotateZ(nullptr, rand() & 0xFFFF);
- njCalcVector(nullptr, &pos_CBLV3, &sp.pos_CBLV3);
- njPopMatrix(1);
- sp.pos_CBLV3.x += co1->CollisionInfo->CollisionArray->origin.x;
- sp.pos_CBLV3.y += co1->CollisionInfo->CollisionArray->origin.y;
- sp.pos_CBLV3.z += co1->CollisionInfo->CollisionArray->origin.z;
- sparklesCBLV3.push_back(sp);
- sparkleCBLV3timer = 0;
- }
- SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
- }
- else
- {
- sparklesCBLV3.clear();
- sparkleCBLV3timer = 0;
- }
- njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCALPHA);
- njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_INVSRCALPHA);
- njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
- }
- }
- //To always have 2P CPU
- int CheckTailsAI_r()
- {
- return 1;
- }
- void __cdecl Load2PTails_r(ObjectMaster *player1)
- {
- if (is_sonic || is_shadow || is_metalsonic || game_start_done)
- {
- ObjectMaster *obj = LoadObject((LoadObj)(LoadObj_UnknownA | LoadObj_Data1 | LoadObj_Data2), 1, Gamma_Main);
- //obj->Data1->Position = player1->Data1->Position;
- //obj->Data1->Rotation = player1->Data1->Rotation;
- obj->Data1->CharIndex = 1;
- ObjectMaster *obj2 = LoadObject((LoadObj)(LoadObj_UnknownA | LoadObj_Data1 | LoadObj_Data2), 1, Knuckles_Main);
- //obj2->Data1->Position = player1->Data1->Position;
- //obj2->Data1->Rotation = player1->Data1->Rotation;
- obj2->Data1->CharIndex = 2;
- }
- //else if (is_metalsonic)
- //{
- // //Load2PTails(player1);//No longer useful since I remade the purple gem power without Tails
- // ObjectMaster *obj = LoadObject((LoadObj)(LoadObj_UnknownA | LoadObj_Data1 | LoadObj_Data2), 1, Tails_Main);
- // obj->Data1->Position = player1->Data1->Position;
- // obj->Data1->Rotation = player1->Data1->Rotation;
- // obj->Data1->CharIndex = 1;
- //}
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////
- extern "C"
- {
- __declspec(dllexport) ModInfo SADXModInfo = { ModLoaderVer };
- __declspec(dllexport) void Init(const char *path, const HelperFunctions &helperFunctions)
- {
- // Enables WriteAnalogs for controllers >= 2 (3)
- Uint8 patch[3] = { 0x83u, 0xFFu, 0x04u };
- WriteData((void*)0x0040F180, patch);
- //Sonic_Init(); is_sonic = true;
- //Shadow_Init(); is_shadow = true;
- //MetalSonic_Init(); is_metalsonic = true;
- WriteJump((void*)0x425F90, CommonHUD);
- WriteData((char*)0x427F50, (char)0xC3);
- sonic_model_loaded = false;
- //Disable Sonic Morphs
- WriteData<3>((void*)0x493711, 0x90);
- WriteData<3>((void*)0x49356D, 0x90);
- WriteData<3>((void*)0x4935E3, 0x90);
- WriteData<3>((void*)0x493722, 0x90);
- WriteData<3>((void*)0x4936EA, 0x90);
- WriteData<3>((void*)0x493657, 0x90);
- WriteData<3>((void*)0x4936CD, 0x90);
- WriteData<3>((void*)0x493C5D, 0x90);
- WriteData<3>((void*)0x4937A1, 0x90);
- //Disable Tails Morphs
- WriteData<3>((void*)0x4622E4, 0x90);
- WriteData<3>((void*)0x4622B4, 0x90);
- WriteData<3>((void*)0x4622FB, 0x90);
- WriteData<3>((void*)0x4622CB, 0x90);
- WriteData<3>((void*)0x45BB60, 0x90);
- WriteData<3>((void*)0x45B821, 0x90);
- WriteData<3>((void*)0x45BB74, 0x90);
- WriteData<3>((void*)0x45B835, 0x90);
- WriteData<3>((void*)0x45BED3, 0x90);
- WriteData<3>((void*)0x45DAB1, 0x90);
- WriteData<3>((void*)0x461389, 0x90);
- WriteData<3>((void*)0x461325, 0x90);
- WriteData<3>((void*)0x45BEE7, 0x90);
- WriteData<3>((void*)0x45DACA, 0x90);
- WriteData<3>((void*)0x4613A1, 0x90);
- WriteData<3>((void*)0x461339, 0x90);
- //Disable Knuckles Morphs
- WriteData<3>((void*)0x473FB2, 0x90);
- WriteData<3>((void*)0x473CC1, 0x90);
- WriteData<3>((void*)0x473FC7, 0x90);
- WriteData<3>((void*)0x473CD5, 0x90);
- WriteData<3>((void*)0x4726D3, 0x90);
- WriteData<3>((void*)0x4726EA, 0x90);
- WriteData<3>((void*)0x472701, 0x90);
- WriteData<3>((void*)0x472719, 0x90);
- WriteData<3>((void*)0x472730, 0x90);
- WriteData<3>((void*)0x472747, 0x90);
- WriteData<3>((void*)0x47275F, 0x90);
- WriteData<3>((void*)0x472776, 0x90);
- WriteData<3>((void*)0x472B4A, 0x90);
- WriteData<3>((void*)0x472B61, 0x90);
- WriteData<3>((void*)0x472B78, 0x90);
- WriteData<3>((void*)0x472B90, 0x90);
- WriteData<3>((void*)0x472BA7, 0x90);
- WriteData<3>((void*)0x472BBE, 0x90);
- WriteData<3>((void*)0x472BD6, 0x90);
- WriteData<3>((void*)0x472BED, 0x90);
- //For Metal's Yellow Shield
- WriteJump(GiveMagneticBarrier, GiveMagneticBarrier_r); //needed to have the shield not show up when at yellow gem's shield lvl 1
- //WriteData((void*)0x610113, 0x90, 3);
- //ResizeTextureList((NJS_TEXLIST *)0x2592E8C, 201); //For R101
- // Fixes the inverted water in Emerald Coast 2.
- LandTable* ec2mesh = (LandTable*)0x01039E9C;
- NJS_OBJECT *obj = ec2mesh->Col[1].Model;
- obj->ang[0] = 32768;
- obj->pos[1] = -3.0f;
- obj->pos[2] = -5850.0f;
- //SpeedShoes New timer
- WriteData((short*)0x441CEF, (short)780);
- //WriteData((short*)0x441CEF, (short)65534);
- //Water GroundAccel fix
- WriteData<6>((void*)0x43CBFB, 0x90);
- //Ground Acceleration Modification Enabler
- WriteData<6>((void*)0x43CC9E, 0x90);
- ////SA2 like combos
- //WriteJump((void*)0x425C70, AddEnemyPoints);
- //WriteJump((void*)0x004496E1, SuperWaterCheck);//for EC act1 hover on water
- //Timer bonus points
- WriteJump(GetTimeBonus, GetTimeBonus_r);
- //Always 20 rings itembox
- WriteData((void*)0x7E6FE4, values);
- //Enemy bonus points
- WriteData((char*)0x4CE077, (char)0x64);
- ////Maximum Heat Attack fix
- //WriteData((float**)0x47404B, &heat_float1);
- //WriteData((float**)0x474057, &heat_float2);
- //WriteJump((void*)0x004C1330, Knuckles_MaximumHeat_DrawX);
- //WriteJump((void*)0x004C1410, Knuckles_MaximumHeatSprite_Draw);
- if (helperFunctions.Version >= 8)
- SONSoundListID = helperFunctions.RegisterSoundList(SONSoundList);
- if (helperFunctions.Version >= 8)
- SHASoundListID = helperFunctions.RegisterSoundList(SHASoundList);
- if (helperFunctions.Version >= 8)
- MSSoundListID = helperFunctions.RegisterSoundList(MSSoundList);
- }
- __declspec(dllexport) void OnInput()
- {
- // Enables WriteAnalogs for controllers >= 2 (3)
- Uint8 patch[3] = { 0x83u, 0xFFu, 0x04u };
- WriteData((void*)0x0040F180, patch);
- //Sonic_OnInput();
- //Shadow_OnInput();
- //MetalSonic_OnInput();
- //if (GameState == 15)
- //{
- // if (ControllerPointers[0]->HeldButtons & Buttons_Y)
- // {
- // ControllerPointers[1]->PressedButtons = Buttons_X;
- // ControllerPointers[1]->HeldButtons = Buttons_X;
- // ControllerPointers[2]->PressedButtons = Buttons_X;
- // ControllerPointers[2]->HeldButtons = Buttons_X;
- // }
- //}
- //For Purple Gem (no Tails)
- if (GameState != 16)
- {
- if (!PURPLE_GEM_active && PURPLE_GEM_used)
- {
- if ((EntityData1Ptrs[0]->Status & Status_Ground) == Status_Ground)
- {
- ControllerPointers[0]->PressedButtons = Buttons_X;
- }
- }
- }
- if (stop_sky_gem)
- {
- ControllerPointers[0]->PressedButtons = Buttons_X;
- stop_sky_gem = false;
- }
- //For Chaos Spear
- if (GameState == 15)
- {
- if (is_in_CS_state)
- {
- if (!X_was_released)
- {
- if (ControllerPointers[0]->HeldButtons & Buttons_X)
- {
- ControllerPointers[1]->PressedButtons = Buttons_X;
- ControllerPointers[1]->HeldButtons = Buttons_X;
- }
- }
- if (++cant_release_X <= 8)
- {
- ControllerPointers[0]->HeldButtons = Buttons_X;
- ControllerPointers[1]->PressedButtons = Buttons_X;
- ControllerPointers[1]->HeldButtons = Buttons_X;
- }
- }
- }
- }
- __declspec(dllexport) void OnControl()
- {
- // Enables WriteAnalogs for controllers >= 2 (3)
- Uint8 patch[3] = { 0x83u, 0xFFu, 0x04u };
- WriteData((void*)0x0040F180, patch);
- for (int i = 2; i < 4; i++)
- {
- if (!IsControllerEnabled(i))
- {
- memset(&Controllers[i], 0, sizeof(ControllerData));
- continue;
- }
- memcpy(&Controllers[i], ControllerPointers[i], sizeof(ControllerData));
- }
- if (black_shield_active || PURPLE_GEM_active || transforming || punching || transforming_CB)
- {
- Controllers[0].HeldButtons &= ~(int)Buttons_A;
- Controllers[0].PressedButtons &= ~(int)Buttons_A;
- }
- }
- __declspec(dllexport) void OnFrame()
- {
- EntityData1* co1 = EntityData1Ptrs[0];
- CharObj2 *co2 = GetCharObj2(0);
- // Enables WriteAnalogs for controllers >= 2 (3)
- Uint8 patch[3] = { 0x83u, 0xFFu, 0x04u };
- WriteData((void*)0x0040F180, patch);
- WriteJump(CheckTailsAI, CheckTailsAI_r);
- WriteCall((void*)0x415948, Load2PTails_r);
- //Sonic_OnFrame();
- //Shadow_OnFrame();
- //MetalSonic_OnFrame();
- ////////////////*****************************************CHARACTER CHANGE INGAME **********************************************************************************
- if (co2 == NULL) return;
- MetalSonicHUD(co1, co2);
- ShadowCBparticles(co1, co2);
- ShadowChaosBlastparticles(co1, co2);
- ShadowCBbolt(co1, co2);
- ShadowCBLV3(co1, co2);
- if (GameState == 4)
- {
- if (!can_run_again)
- {
- oldcountSonic = EntityData1Ptrs[0]->CollisionInfo[0].Count;
- oldcountKnux = EntityData1Ptrs[2]->CollisionInfo[0].Count;
- can_run_again = true;
- }
- }
- if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
- {
- if (GameState == 21 && !game_start_done)
- {
- game_start_done = true;
- }
- if (GetCharacterObject(1) && GetCharacterID(1) == Characters_Gamma && !gamma_initialized)
- {
- oldcountGamma = EntityData1Ptrs[1]->CollisionInfo[0].Count;
- gamma_initialized = true;
- }
- if (GameState == 16 || GameState == 21)
- {
- if (ControllerPointers[0]->PressedButtons & Buttons_Y)
- {
- BLUE_GEM_ON = false;
- RED_GEM_ON = false;
- GREEN_GEM_ON = false;
- PURPLE_GEM_ON = false;
- SKY_GEM_ON = false;
- WHITE_GEM_ON = false;
- YELLOW_GEM_ON = false;
- NO_GEM_ON = false;
- EntityData1Ptrs[1]->CollisionInfo[0].Count = oldcountGamma;
- shield_level = 0;
- DeleteObject_(auraobj);
- auraobj = nullptr;
- FOV = 70;
- UnloadCharTextures(Characters_Sonic);
- WriteData((PVMEntry**)0x90ED54, SonicTextures);
- LoadCharTextures(Characters_Sonic);
- njReleaseTexture((NJS_TEXLIST*)0x927CB8);
- LoadPVM("SON_SON_EFF", (NJS_TEXLIST*)0x927CB8);
- njReleaseTexture((NJS_TEXLIST*)0x142272C);
- LoadPVM("SON_SUPERSONIC", (NJS_TEXLIST*)0x142272C);
- njReleaseTexture((NJS_TEXLIST*)0x94A2A8);
- LoadPVM("EFF_REGULAR", (NJS_TEXLIST*)0x94A2A8);
- LoadPVM("SON_AMY_EFF", (TexList *)0x91C808);
- ChangeToSonicModel();
- VariablesReset();
- is_sonic = true;
- is_shadow = false;
- shadow_init_loaded = false;
- is_metalsonic = false;
- metalsonic_init_loaded = false;
- }
- if (ControllerPointers[0]->PressedButtons & Buttons_X)
- {
- BLUE_GEM_ON = false;
- RED_GEM_ON = false;
- GREEN_GEM_ON = false;
- PURPLE_GEM_ON = false;
- SKY_GEM_ON = false;
- WHITE_GEM_ON = false;
- YELLOW_GEM_ON = false;
- NO_GEM_ON = false;
- shield_level = 0;
- EntityData1Ptrs[1]->CollisionInfo[0].Count = 0;
- DeleteObject_(auraobj);
- auraobj = nullptr;
- FOV = 70;
- WriteData((NJS_TEXLIST**)0x47224A, (NJS_TEXLIST*)0x91CB58);//to load sonic's textures over knux to set it back => WriteData((NJS_TEXLIST**)0x47224A, (NJS_TEXLIST*)0x91BD20);
- UnloadCharTextures(Characters_Sonic);
- WriteData((PVMEntry**)0x90ED54, ShadowTextures);
- LoadCharTextures(Characters_Sonic);
- //UnloadCharTextures(Characters_Knuckles);
- //WriteData((PVMEntry**)0x90ED60, ShadowKnuxTextures);
- //LoadCharTextures(Characters_Knuckles);
- njReleaseTexture((NJS_TEXLIST*)0x927CB8);
- LoadPVM("SHA_SON_EFF", (NJS_TEXLIST*)0x927CB8);
- //njReleaseTexture((NJS_TEXLIST*)0x91BD20);
- //LoadPVM("SHA_KNUCKLES", (NJS_TEXLIST*)0x91BD20);
- njReleaseTexture((NJS_TEXLIST*)0x91BD28);
- LoadPVM("SHA_KNU_EFF", (NJS_TEXLIST*)0x91BD28);
- //njReleaseTexture((NJS_TEXLIST*)0x91C568);
- //LoadPVM("SHA_E102BEAM", (NJS_TEXLIST*)0x91C568);
- //njReleaseTexture((NJS_TEXLIST*)0x91C570);
- //LoadPVM("SHA_E102EFFECT", (NJS_TEXLIST*)0x91C570);
- //njReleaseTexture((NJS_TEXLIST*)0x91D5E0);
- //LoadPVM("SHA_E102TIME", (NJS_TEXLIST*)0x91D5E0);
- //njReleaseTexture((NJS_TEXLIST*)0x91D15C);
- //LoadPVM("SHA_E102HIT", (NJS_TEXLIST*)0x91D15C);
- njReleaseTexture((NJS_TEXLIST*)0x142272C);
- LoadPVM("SHA_SUPERSONIC", (NJS_TEXLIST*)0x142272C);
- njReleaseTexture((NJS_TEXLIST*)0x94A2A8);
- LoadPVM("EFF_REGULAR", (NJS_TEXLIST*)0x94A2A8);
- ChangeToShadowModel();
- VariablesReset();
- is_sonic = false;
- sonic_init_loaded = false;
- is_shadow = true;
- is_metalsonic = false;
- metalsonic_init_loaded = false;
- }
- if (ControllerPointers[0]->PressedButtons & Buttons_Z)
- {
- BLUE_GEM_ON = false;
- RED_GEM_ON = false;
- GREEN_GEM_ON = false;
- PURPLE_GEM_ON = false;
- SKY_GEM_ON = false;
- WHITE_GEM_ON = false;
- YELLOW_GEM_ON = false;
- NO_GEM_ON = true;
- EntityData1Ptrs[1]->CollisionInfo[0].Count = oldcountGamma;
- shield_level = 0;
- DeleteObject_(auraobj);
- auraobj = nullptr;
- FOV = 70;
- UnloadCharTextures(Characters_Sonic);
- WriteData((PVMEntry**)0x90ED54, MetalSonicTextures);
- LoadCharTextures(Characters_Sonic);
- njReleaseTexture((NJS_TEXLIST*)0x927CB8);
- LoadPVM("MS_SON_EFF", (NJS_TEXLIST*)0x927CB8);
- njReleaseTexture((NJS_TEXLIST*)0x142272C);
- LoadPVM("MS_SUPERSONIC", (NJS_TEXLIST*)0x142272C);
- njReleaseTexture((NJS_TEXLIST*)0x94A2A8);
- LoadPVM("EFF_REGULAR", (NJS_TEXLIST*)0x94A2A8);
- ChangeToMetalSonicModel();
- VariablesReset();
- is_sonic = false;
- sonic_init_loaded = false;
- is_shadow = false;
- shadow_init_loaded = false;
- is_metalsonic = true;
- }
- }
- if (is_sonic)
- {
- if (!sonic_init_loaded)
- {
- Sonic_Init();
- sonic_init_loaded = true;
- sounds_reset = true;
- SONsounds_loaded = false;
- SHAsounds_loaded = false;
- MSsounds_loaded = false;
- SONSoundListID == -1;
- SHASoundListID == -1;
- MSSoundListID == -1;
- cant_play_again = true;
- }
- Sonic_OnInput();
- Sonic_OnFrame();
- }
- else if (is_shadow)
- {
- if (!shadow_init_loaded)
- {
- Shadow_Init();
- shadow_init_loaded = true;
- sounds_reset = true;
- SONsounds_loaded = false;
- SHAsounds_loaded = false;
- MSsounds_loaded = false;
- SONSoundListID == -1;
- SHASoundListID == -1;
- MSSoundListID == -1;
- cant_play_again = true;
- }
- Shadow_OnInput();
- Shadow_OnFrame();
- }
- else if (is_metalsonic)
- {
- if (!metalsonic_init_loaded)
- {
- MetalSonic_Init();
- metalsonic_init_loaded = true;
- sounds_reset = true;
- SONsounds_loaded = false;
- SHAsounds_loaded = false;
- MSsounds_loaded = false;
- SONSoundListID == -1;
- SHASoundListID == -1;
- MSSoundListID == -1;
- cant_play_again = true;
- }
- MetalSonic_OnInput();
- MetalSonic_OnFrame();
- }
- if (GameState == 4 && !sounds_reset)
- {
- sounds_reset = true;
- SONsounds_loaded = false;
- SHAsounds_loaded = false;
- MSsounds_loaded = false;
- SONSoundListID == -1;
- SHASoundListID == -1;
- MSSoundListID == -1;
- }
- if (GameState == 15)
- {
- if (is_sonic)
- {
- if (!SONsounds_loaded && SONSoundListID != -1)
- {
- sounds_reset = false;
- LoadSoundList(SONSoundListID);
- SONsounds_loaded = true;
- SHAsounds_loaded = false;
- MSsounds_loaded = false;
- }
- }
- else if (is_shadow)
- {
- if (!SHAsounds_loaded && SHASoundListID != -1)
- {
- sounds_reset = false;
- LoadSoundList(SHASoundListID);
- SONsounds_loaded = false;
- SHAsounds_loaded = true;
- MSsounds_loaded = false;
- }
- }
- else if (is_metalsonic)
- {
- if (!MSsounds_loaded && MSSoundListID != -1)
- {
- sounds_reset = false;
- LoadSoundList(MSSoundListID);
- SONsounds_loaded = false;
- SHAsounds_loaded = false;
- MSsounds_loaded = true;
- }
- }
- }
- }
- //////////////////////////////////***********************************END CHARACTER CHANGE INGAME ***********************************************************
- //Character Select HUD
- //if (GameState == 21)
- //{
- if (GetCharacterObject(0))
- {
- LoadPVM("HUD", &HUD_TEXLIST);// do better loading (not have it repeat)
- //njDrawSprite2D_Queue(&HUD_SPRITE2, char_sel_sonic, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
- LoadPVM("HUD3D", &HUD3D_TEXLIST);
- LoadPVM("GEMS_EFF", &GEMS_TEXLIST);
- if (GameState != 21)
- {
- if (!HUD_alpha_fix)
- {
- WriteData((char*)0x7919CD, (char)0);
- HUD_alpha_fix = true;
- }
- }
- else
- {
- if (HUD_alpha_fix)
- {
- WriteData((char*)0x7919CD, (char)0x10);
- HUD_alpha_fix = false;
- }
- }
- if (star_glow == 0)
- {
- HUD3D_SPRITE_STAR.p.x = EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.x;
- HUD3D_SPRITE_STAR.p.y = EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.y;
- HUD3D_SPRITE_STAR.p.z = EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.z;
- }
- HUD3D_SPRITE_CIRCLE.p.x = EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.x;
- HUD3D_SPRITE_CIRCLE.p.y = EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.y;
- HUD3D_SPRITE_CIRCLE.p.z = EntityData1Ptrs[0]->CollisionInfo->CollisionArray->origin.z;
- }
- //}
- //HUD *******************************************************************************************************************************************
- //if (GameState == 15)
- //{
- // if (CurrentLevel == 26 || CurrentLevel == 29 || CurrentLevel == 33)
- // {
- // Sonic_LightSpeedShoesObtained = 1;
- // Sonic_CrystalRingObtained = 1;
- // Sonic_AncientLightObtained = 1;
- // }
- // else if (EntityData1Ptrs[0]->Action != 4 && (co1->Status & Status_LightDash) != Status_LightDash)
- // {
- // Sonic_LightSpeedShoesObtained = 1;
- // Sonic_CrystalRingObtained = 0;
- // Sonic_AncientLightObtained = 0;
- // }
- // else
- // {
- Sonic_LightSpeedShoesObtained = 1;
- // Sonic_CrystalRingObtained = 0;
- Sonic_AncientLightObtained = 1;
- // }
- //}
- //Gameplay Enhancements
- if (GameState == 15 || GameState == 16)
- {
- //Floor Grip at high speed
- if (co2->Speed.x >= 25) co2->PhysicsData.FloorGrip = 5.0;
- else if (co2->Speed.x >= 22) co2->PhysicsData.FloorGrip = 4.0;
- else if (co2->Speed.x >= 19) co2->PhysicsData.FloorGrip = 3.5;
- else if (co2->Speed.x >= 16.5) co2->PhysicsData.FloorGrip = 3.0;
- else if (co2->Speed.x >= 11) co2->PhysicsData.FloorGrip = 2.5;
- else co2->PhysicsData.FloorGrip = 2.0;
- //Sideway speed at high speed fix
- if (!just_untransformed)
- {
- co2->PhysicsData.Run2 = max(co2->Speed.x - 12 + 4.85, 4.85);
- }
- //Speed Cap optimizer
- if (co2->Speed.x >= 15.9 || EntityData1Ptrs[0]->Action == 4)
- {
- co2->PhysicsData.HSpeedCap = 60000;
- co2->PhysicsData.VSpeedCap = 60000;
- }
- else
- {
- co2->PhysicsData.HSpeedCap = 16;
- co2->PhysicsData.VSpeedCap = 16;
- }
- }
- //1up only on first 100 rings + can happen only once until you restart the level/die
- if (Rings >= 100)
- {
- WriteData<5>((void*)0x425C28, 0x90);
- }
- else if (GameState == 4)
- {
- WriteData((void*)0x425C28, Can_get_1up);
- }
- //To change the character's position in the character select screen
- if (GameState == 21)
- {
- if (GetCharacterObject(0))
- {
- co2->field_A = 20;
- //if (CharacterSelection != 0) CharacterSelection = 0;
- EntityData1Ptrs[0]->Position.y = 100;
- }
- }
- if (GameState == 15 || GameState == 16)
- {
- if (co2 == NULL) return;
- if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
- {
- //To have B button do nothing
- WriteData((int*)0x0040FDE1, (int)Buttons_X);
- //Lose lvl energy when hit
- if (!LV1_active && !LV2_active && !LV3_active)
- {
- if (EntityData1Ptrs[0]->Action == 16)
- {
- if (Rings - OldRings < 0)
- {
- if (!LV1_obtained && !LV2_obtained && !LV3_obtained)
- {
- if (OldRings <= 20)
- {
- Gauge2 -= 100 * OldRings;
- }
- else
- {
- Gauge2 -= 2000;
- }
- }
- if (LV1_obtained && !LV2_obtained && !LV3_obtained)
- {
- if (OldRings <= 20)
- {
- Gauge2 -= 100 * OldRings;
- }
- else
- {
- Gauge2 -= 2000;
- }
- if (Gauge2 < 10000) Gauge2 = 10000;
- }
- if (LV2_obtained && !LV3_obtained)
- {
- if (OldRings <= 20)
- {
- Gauge2 -= 100 * OldRings;
- }
- else
- {
- Gauge2 -= 2000;
- }
- if (Gauge2 < 20000) Gauge2 = 20000;
- }
- }
- }
- }
- //Gauge2 filling while LVLS active
- if (LV1_active || LV2_active || LV3_active)
- {
- if (Rings - OldRings > 0)
- {
- if (!RED_GEM_active)
- {
- Gauge2bis = Gauge2bis + 100 * (Rings - OldRings);
- }
- else Gauge2bis = Gauge2bis + 300 * (Rings - OldRings);
- OldRings = Rings;
- }
- else if (Rings - OldRings < 0)
- {
- OldRings = Rings;
- }
- }
- //Gauge and Gauge2 sounds and more
- if (LV3_active)
- {
- if (Gauge >= 10000)
- {
- if (!cant_play_again)
- {
- if (!gauge_full)
- {
- if (!is_boosting && !CB_active)//or not chaos spear, or not chaos boost etc
- {
- PlaySound(1245, 0, 0, 0);
- }
- }
- cant_play_again = true;
- }
- else if (can_play_again < 599)
- {
- ++can_play_again;
- }
- gauge_full = true;
- Gauge = 10000;
- }
- else if (Gauge < 0) Gauge = 0;
- else if (Gauge != 10000)
- {
- if (cant_play_again)
- {
- if (++can_play_again == 600)
- {
- cant_play_again = false;
- can_play_again = 0;
- }
- }
- gauge_full = false;
- }
- }
- else
- {
- if (can_play_again > 120)
- {
- cant_play_again = false;
- can_play_again = 0;
- }
- if (Gauge >= 10000)
- {
- if (!cant_play_again)
- {
- if (!gauge_full)
- {
- if (!is_boosting)//or not chaos spear, or not chaos boost etc
- {
- PlaySound(1245, 0, 0, 0);
- }
- }
- cant_play_again = true;
- }
- else if (can_play_again < 120)
- {
- ++can_play_again;
- }
- gauge_full = true;
- Gauge = 10000;
- }
- else if (Gauge < 0) Gauge = 0;
- else if (Gauge != 10000)
- {
- if (cant_play_again)
- {
- if (++can_play_again == 120)
- {
- cant_play_again = false;
- can_play_again = 0;
- }
- }
- gauge_full = false;
- }
- }
- if (Gauge2 >= 10000)
- {
- if (!gauge2_lv1)
- {
- PlaySound(1246, 0, 0, 0);
- }
- gauge2_lv1 = true;
- }
- if (Gauge2 >= 20000)
- {
- if (!gauge2_lv2)
- {
- PlaySound(1246, 0, 0, 0);
- }
- gauge2_lv2 = true;
- }
- if (Gauge2 >= 30000)
- {
- if (!gauge2_full)
- {
- PlaySound(1246, 0, 0, 0); //can also use 1247 (B06_00_25)
- //CAN'T use : B06_00_21; B06_00_26; B06_00_27
- }
- gauge2_full = true;
- Gauge2 = 30000;
- }
- else if (Gauge2 < 0) Gauge2 = 0;
- else if (Gauge2 != 30000) gauge2_full = false;
- if (EnemyBonus - OldEnemyBonus2 > 0)
- {
- Gauge = Gauge + 75 * (EnemyBonus - OldEnemyBonus2) / 10;
- OldEnemyBonus2 = EnemyBonus;
- }
- else if (EnemyBonus - OldEnemyBonus2 < 0)
- {
- OldEnemyBonus2 = EnemyBonus;
- }
- if (LV3_active)
- {
- if (Rings - OldRings > 0)
- {
- Gauge = Gauge + 100 * (Rings - OldRings);
- OldRings = Rings;
- }
- else if (Rings - OldRings < 0)
- {
- OldRings = Rings;
- }
- }
- //if (Rings - OldRings > 0)
- //{
- // if (!LV1_active && !LV2_active && !LV3_active)
- // {
- // if (Gauge2bis != 0)
- // {
- // Gauge2 = Gauge2bis;
- // Gauge2bis = 0;
- // }
- // Gauge2 = Gauge2 + 100 * (Rings - OldRings);
- // }
- // OldRings = Rings;
- //}
- //else if (Rings - OldRings < 0)
- //{
- // OldRings = Rings;
- //}
- if (!LV1_active && !LV2_active && !LV3_active)
- {
- if (Gauge2bis != 0)
- {
- Gauge2 = Gauge2bis;
- Gauge2bis = 0;
- }
- if (Rings - OldRings > 0)
- {
- if (!RED_GEM_active)
- {
- Gauge2 = Gauge2 + 100 * (Rings - OldRings);
- }
- else Gauge2 = Gauge2 + 300 * (Rings - OldRings);
- OldRings = Rings;
- }
- else if (Rings - OldRings < 0)
- {
- OldRings = Rings;
- }
- }
- //if (Rings - OldRings > 0)
- //{
- // if (LV1_active || LV2_active || LV3_active)
- // {
- // Gauge2bis = Gauge2bis + 100 * (Rings - OldRings);
- // }
- // else Gauge2bis = 0;
- // OldRings = Rings;
- //}
- //else if (Rings - OldRings < 0)
- //{
- // OldRings = Rings;
- //}
- if (LV1_active)
- {
- gauge2_lv1 = false;
- }
- else if (LV2_active)
- {
- gauge2_lv1 = false;
- gauge2_lv2 = false;
- }
- else if (LV3_active)
- {
- gauge2_lv1 = false;
- gauge2_lv2 = false;
- gauge2_full = false;
- }
- }
- }
- //Increased Geometry and Skybox DrawDistance for Speed Highway
- //for (int i = 0; i < 3; i++) { SkyboxDrawDist_SpeedHighway1[i].Maximum = -45000.0f; DrawDist_SpeedHighway1[i].Maximum = -18500.0f; }
- ////Increased Geometry and Skybox DrawDistance for Windy Valley
- //for (int i = 0; i < 3; i++) { SkyboxDrawDist_WindyValley1[i].Maximum = -45000.0f; DrawDist_WindyValley1[i].Maximum = -18500.0f; }
- ////Increased Geometry and Skybox DrawDistance for Emerald Coast
- //for (int i = 0; i < 3; i++) { SkyboxDrawDist_EmeraldCoast1[i].Maximum = -45000.0f; DrawDist_EmeraldCoast1[i].Maximum = -18500.0f; }
- //Homing attack fix (to not go through air itemboxes)
- if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
- {
- if (GameState == 4)
- {
- homing_attacking = false;
- OldEnemyBonus3 = EnemyBonus;
- restore_oldenemybonus3 = 0;
- make_HA_false = 0;
- }
- if (GameState == 15)
- {
- if (EntityData1Ptrs[0]->Action == 14)
- {
- homing_attacking = true;
- }
- if (homing_attacking)
- {
- if (EnemyBonus - OldEnemyBonus3 == 0)
- {
- if (EntityData1Ptrs[0]->Action == 8)
- {
- co2->Speed.x = 0.0;
- co2->Speed.y = 2.0;
- co2->Speed.z = 0.0;
- homing_attacking = false;
- make_HA_false = 0;
- }
- }
- if ((co1->Status & Status_Ground) == Status_Ground)
- {
- homing_attacking = false;
- make_HA_false = 0;
- }
- if (++make_HA_false == 20)
- {
- homing_attacking = false;
- make_HA_false = 0;
- }
- }
- if (EnemyBonus > OldEnemyBonus3)
- {
- if (++restore_oldenemybonus3 == 20)
- {
- OldEnemyBonus3 = EnemyBonus;
- restore_oldenemybonus3 = 0;
- }
- }
- }
- }
- //Gauge
- if (GameState == 4)
- {
- //Rings = 0;
- Gauge2 = 0;
- Gauge2bis = 0;
- OldEnemyBonus2 = 0;
- OldRings = 0;
- gauge_full = false;
- gauge2_lv1 = false;
- gauge2_lv2 = false;
- gauge2_full = false;
- cant_play_again = true;
- can_play_again = 0;
- }
- //WriteData((char*)0x43CB90, (char)0xC3);//when we tried to remove the speed change when underwater
- //HUD !!!!
- // LoadPVM("name of your pvm without the extension", &some texlist);
- //Reload all itemboxes when restarting, => fix by setting act != 0 and find a way when dying to respawn stuff too properly
- //WriteData((void*)0x414637, 0x90, 7); //66 89 15 CC 2D B2 03
- //if (GameState == 7 && (ControllerPointers[0]->PressedButtons & Buttons_A || ControllerPointers[0]->PressedButtons & Buttons_Start))
- //{
- // GameState = 17;
- // CurrentAct = 0;
- //}
- //if (GameState == 7 && ControllerPointers[0]->PressedButtons & Buttons_Start)
- //{
- // GameState = 12;
- //}
- // DataPointer(type, name, address); used for some stuff
- //CHARACTER SELECT ONLY 1 2 OR 3
- //DataPointer(int, CharacterSelection, 0x03B2A2FD);
- //if (CharacterSelection == 3) CharacterSelection = 0;
- //if (CharacterSelection == 5) CharacterSelection = 2;
- //if (CharacterSelection == 6) CharacterSelection = 2;
- //Knuckles rolling to punching action swap
- // WriteData((short*)0x00473C80, (short)18);
- // if (co2 == NULL) return;
- // if (GetCharacterObject(2))
- // WriteData((float*)PhysicsData.MaxAccel, (float)18);
- // Max Run Speed Fix RACE ONLY - Will I even ever re-use this ?
- // if (GetCharacterObject(0))
- // {
- // if ((co1->Status & Status_OnPath) == 0)
- //
- // {
- // if (co2->Speed.x < 4.75) co2->PhysicsData.Run2 = 5.25;
- // else if (co2->Speed.x < 25.5) co2->PhysicsData.Run2 = co2->Speed.x + 0.5f;
- // else co2->PhysicsData.Run2 = 26;
- // }
- // if (co2->PhysicsData.MaxAccel < 10) PhysicsArray[Characters_Sonic].GroundAccel = 0.05;
- // if (co2->PhysicsData.MaxAccel >= 10) PhysicsArray[Characters_Sonic].GroundAccel = 0.059;
- // if (co2->PhysicsData.MaxAccel >= 16) PhysicsArray[Characters_Sonic].GroundAccel = 0.075;
- // if (co2->PhysicsData.MaxAccel >= 20) PhysicsArray[Characters_Sonic].GroundAccel = 0.1;
- // if (co2->PhysicsData.MaxAccel >= 26) PhysicsArray[Characters_Sonic].GroundAccel = 0.15;
- // }
- }
- }
- //if (ControllerPointers[0]->HeldButtons & Buttons_B) ++checkH;
- //if (ControllerPointers[0]->HeldButtons & Buttons_X) --checkH;
- //if (ControllerPointers[0]->HeldButtons & Buttons_A) ++checkV;
- //if (ControllerPointers[0]->HeldButtons & Buttons_Y) --checkV;
- ////////////////////////////////SetDebugFontSize(15);
- ////////////////////////////////DisplayDebugStringFormatted((80 << 16) | 60, "%5i", checkH);
- ////////////////////////////////SetDebugFontSize(12);
- ////////////////////////////////SetDebugFontSize(15);
- ////////////////////////////////DisplayDebugStringFormatted((81 << 16) | 61, "%5i", checkV);
- ////////////////////////////////SetDebugFontSize(12);
- //if (ControllerPointers[0]->PressedButtons & Buttons_Left)
- //{
- // draw = 0;
- //}
- //if (ControllerPointers[0]->PressedButtons & Buttons_Right)
- //{
- // draw = 1;
- //}
- //if (ControllerPointers[0]->PressedButtons & Buttons_Down)
- //{
- // draw = 2;
- //}
- //if (ControllerPointers[0]->PressedButtons & Buttons_Up)
- //{
- // draw = 3;
- //}
- //if (ControllerPointers[0]->PressedButtons & Buttons_C)
- //{
- // draw = 4;
- //}
- //if (ControllerPointers[0]->PressedButtons & Buttons_Z)
- //{
- // draw = 5;
- //}
- //if (ControllerPointers[0]->PressedButtons & Buttons_D)
- //{
- // draw = 6;
- //}
- //////////////////Hyper Sonic S3&K like Sparkles ??
- //////////////////ParticleDepthOverride = 0.0f;
- //////////////////EntityData1 *co1 = EntityData1Ptrs[0];
- //////////////////for (auto it = sparklesgems.begin(); it != sparklesgems.end(); )
- //////////////////{
- ////////////////// NJS_VECTOR pos = { 0, it->radius, 0 };
- ////////////////// njPushMatrix(nullptr);
- ////////////////// njRotateX(nullptr, it->rotation.x);
- ////////////////// njRotateY(nullptr, it->rotation.y);
- ////////////////// njRotateZ(nullptr, it->rotation.z);
- ////////////////// njCalcVector(nullptr, &pos, &sparklesprite.p);
- ////////////////// njPopMatrix(1);
- ////////////////// sparklesprite.p.x += co1->CollisionInfo->CollisionArray->origin.x;
- ////////////////// sparklesprite.p.y += co1->CollisionInfo->CollisionArray->origin.y;
- ////////////////// sparklesprite.p.z += co1->CollisionInfo->CollisionArray->origin.z;
- ////////////////// njDrawSprite3D_Queue(&sparklesprite, 5, NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
- ////////////////// it->frame++;
- ////////////////// if (it->frame >= 16)
- ////////////////// it = sparklesgems.erase(it);
- ////////////////// else
- ////////////////// {
- ////////////////// it->rotation.x = (it->rotation.x + it->speed.x) & 0xFFFF;
- ////////////////// it->rotation.y = (it->rotation.y + it->speed.y) & 0xFFFF;
- ////////////////// it->rotation.z = (it->rotation.z + it->speed.z) & 0xFFFF;
- ////////////////// ++it;
- ////////////////// }
- //////////////////}
- //////////////////if (++sparkletimer == 3)
- //////////////////{
- ////////////////// sparklegemsdata sp = {};
- ////////////////// sp.radius = ((float)rand() / RAND_MAX) * 8.0;
- ////////////////// sp.rotation.x = rand() & 0xFFFF;
- ////////////////// sp.rotation.y = rand() & 0xFFFF;
- ////////////////// sp.rotation.z = rand() & 0xFFFF;
- ////////////////// sp.speed.x = (rand() & 0xFFF) - 0x800;
- ////////////////// sp.speed.y = (rand() & 0xFFF) - 0x800;
- ////////////////// sp.speed.z = (rand() & 0xFFF) - 0x800;
- ////////////////// sparklesgems.push_back(sp);
- ////////////////// sparkletimer = 0;
- //////////////////}
- //////////////////SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement