float Samus[214747]; const int ETANKS = 500; const int ETANKS_FULL = 501; int Etanks()return Samus[ETANKS];} int ETanksFilled(){return Samus[ETANKS_FULL];} void FillETanks(){ Samus[ETANKS_FULL] = Samus[ETANKS];} void UseEtank(){ Samus[ETANKS_FULL]--;} //Returns if Samus still hyas energy, refillng from etanks in the process, as needed. bool HasEnergy(){ if ( Link->HP <= 0 ){ if ( ETanksFilled() ) { Link->HP = Link->MaxHP; UseEtank(); return true; } return false; } else return true; } //Pickup script item script Etank{ void run(){ Samus[ETANKS]++; Samus[ETANKS_FULL]++; } } const int HP_REFILL_RATE =30; const int SFX_ETANK_REFILL = 60; //Refills hp and etanks void RefillHealth() { Link->HP = Link->MaxHP; do { Game->PlaySound(SFX_ETANK_REFILL); Samus[ETANKS_FULL]++; Waitframes(HP_REFILL_RATE); } while ( ETanksFilled() < Etanks() ); } void ShowETanks(){ if ( Link->MP != EtanksFilled() *32 ) Link->MP = EtanksFilled() * 32; }