Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// Global Constants, Arrays, and Variables
- int FrozenLink = 0; //Increase this variable when Link is hit by something that would freeze him.
- void FreezeLinkUpdate(){ //The function handling the freezing of Link.
- if(FrozenLink > 0){ //Should Link be frozen?
- NoAction(); //Kill his inputs
- FrozenLink --; //Decrement the counter
- }
- }
- //Arrays
- float PitsLava[256]; //Array for Holelava. Set to an arbitrarily large size. Min [2]
- float GB_Shield[256]; //Array to hold shield values. Set to an arbitrarily large size. Min [3]
- bool isScrolling;
- bool onice;
- float Ice_X;
- float Ice_Y;
- //Common Constant, only need to define once per script file.
- const int BIG_LINK = 0; //Set this constant to 1 if using the Large Link Hit Box feature.
- //Constants used by Bottomless Pits & Lava.
- const int CT_HOLELAVA = 128; //Combo type to use for pit holes and lava."No Ground Enemies by default"
- const int CF_PIT = 101; //The combo flag to register combos as pits.
- const int CF_LAVA = 102; //The combo flag to register combos as lava.
- const int WPS_LINK_FALL = 88; //The weapon sprite to display when Link falls into a pit. "Sprite 88 by default"
- const int WPS_LINK_LAVA = 92; //The weapon sprite to display when Link drowns in lava. "Sprite 89 by default"
- const int SFX_LINK_FALL = 61; //The sound to play when Link falls into a pit. "SFX_FALL by default"
- const int SFX_LINK_LAVA = 55; //The sound to play when Link drowns in Lava. "SFX_SPLASH by default.
- const int CMB_AUTOWARP = 44; //The first of your four transparent autowarp combos.
- const int HOLELAVA_DAMAGE = 8; //Damage in hit points to inflict on link. "One Heart Container is worth 16 hit points"
- //Constants for Mitsukara's Code
- const int SFX_FALL = 38;
- const int SPRITE_ENEMY_FALL = 98;
- const int SPRITE_ENEMY_LAVA = 91;
- //Shield Sound Effects
- //Constants for Array Accessors
- //Array Indices of PitsLava[]
- const int HL_FALLING = 0;
- const int HL_WARPING = 1;
- const int HL_OLDDMAP = 2;
- const int HL_OLDSCREEN = 3;
- const int HL_STARTX = 4;
- const int HL_STARTY = 5;
- const int HL_STARTDIR = 6;
- float GlobalRAM[214747];
- //GlobalRAM[] Indices:
- const int STORE_LINK_X = 1000;
- const int STORE_LINK_Y = 1001;
- const int STORE_LINK_Z = 1002;
- const int STORE_LINK_JUMP = 1003;
- const int MAP_OPEN = 1004;
- const int MAP_DISPLAY_TIMER = 1005;
- const int TRACE_FIRST_MAP_USE = 4000;
- //common variables
- //////////////////////
- /// Global Scripts ///
- //////////////////////
- global script active{
- void run(){
- //Setup variables for ice combos.
- Setup_IceCombos();
- //Variable that stores Game->GetCurScreen() the previous frame.
- int oldscreen = Game->GetCurScreen();
- int s_version_id[]="Script Version 8.2, 28th feb, 2016 GMT";
- TraceNL();
- TraceS(s_version_id);
- TraceNL();
- Is(MAP_OPEN,0);
- StartGhostZH(); //! Enable if using ghost.zh
- InitHoleLava(); //Inits Tamamo's holes and lava.
- npc e;
- int q;
- bool Blocking;
- Game->LKeys[400] = 0;
- while(true){
- ScrollFix();
- PegasusBoots();
- UpdateGhostZH1();//! Enable if using ghost.z
- FreezeLinkUpdate();
- GLB_Sideview_Ladder();
- if ( Link->PressEx4 && Link->Action != LA_SCROLLING ) Map();
- if ( Link->PressEx4 && !Is(MAP_OPEN) ) {
- Is(MAP_OPEN,1);
- Is(MAP_DISPLAY_TIMER,1);
- }
- if ( Is(MAP_OPEN) ) {
- if ( !Is(MAP_DISPLAY_TIMER) ) Map(); //Run a one frame timer to ensure that we save Link's coordinates.
- else if ( Is(MAP_DISPLAY_TIMER) ) Is(MAP_DISPLAY_TIMER,0);
- }
- Secret_Medicine();
- //Mitsukara Things
- MitsukaraNPCs();
- MitsukaraShieldPush();
- Waitdraw();
- Update_IceCombos(oldscreen);
- oldscreen = Game->GetCurScreen();
- Update_HoleLava2();
- if (Link->Action != LA_SCROLLING){
- RunHoleLava(); //Main Tamamo Holes and Lava function.
- }
- UpdateGhostZH2(); //! Enable if using ghost.zh
- //LREx1Ex2ItemSwitch(); //! Enable if you want to allow A+B item switchign with Ex1/Ex2
- if ( Link->PressEx4 ){
- Link->PressEx4 = false;
- freezeScreen();
- showMap();
- Link->Jump=0;
- unfreezeScreen();
- }
- if(Link->Item[LTM_HOLDING]){
- if(CountFFCsRunning(SCRIPT_POWERBRACELET)==0 && holding_block>0){
- holding_block = 0;
- Link->Item[LTM_HOLDING] = false;
- Link->Item[LTM_CATCHING] = false;
- Link->Item[LTM_PULLING] = false;
- if (onLadder) Link->Dir = DIR_UP;
- }
- }
- Waitframe();
- }//end whileloop
- }//end run
- }//end global active script (slot2)(); //Main Tamamo Holes and Lava function.
- void MitsukaraNPCs(){
- //!NPCs Loop
- for(q = Screen->NumNPCs(); q > 0; q-- ){
- e = Screen->LoadNPC(q);
- if(!e->isValid()) continue;
- if (e->isValid()){
- // Enemy falls in pits and water
- if (Screen->ComboI[ComboAt(e->X+2,e->Y+2)] == CF_PIT && Screen->ComboI[ComboAt(e->X+14,e->Y+14)] == CF_PIT){
- if (e->Type == NPCT_WALK || e->Type == NPCT_LEEVER){
- lweapon EFall = CreateLWeaponAt(LW_SPARKLE,e->X+((e->TileWidth - 1) * 8),e->Y+4+((e->TileHeight - 1) * 16));
- if (EFall->isValid()) EFall->UseSprite(SPRITE_ENEMY_FALL);
- Remove(e);
- Game->PlaySound(SFX_FALL); // Default falling noise
- }
- }
- if (e->Type == NPCT_WALK || e->Type == NPCT_LEEVER){
- if (Screen->ComboI[ComboAt(e->X+2,e->Y+2)] == CF_LAVA && Screen->ComboI[ComboAt(e->X+14,e->Y+14)] == CF_LAVA || Screen->ComboT[ComboAt(e->X+2,e->Y+2)] == CT_WATER && Screen->ComboT[ComboAt(e->X+14,e->Y+14)] == CT_WATER){
- lweapon ESploosh = CreateLWeaponAt(LW_SPARKLE,e->X,e->Y+4);
- if (IsSideview()) ESploosh->Y = e->Y+8+(e->HitHeight-16);
- if (ESploosh->isValid()) ESploosh->UseSprite(SPRITE_ENEMY_LAVA);
- Remove(e);
- Game->PlaySound(SFX_FALL);
- }
- }
- //Shield pushes an enemy
- // Attributes[10] means:
- // 1 - Push Link and enemy
- // 2 - Push only Link
- // 3 - Push only enemy
- // 4 - Magic shield to push both
- // 5 - Urchin
- // 6 - Magic Shield urchin
- // 7 - Killed by shield
- if (e->isValid() && Blocking == true && LinkCollision(e) && e->CollDetection != 0){
- if (e->Attributes[10] == 5 || e->Attributes[10] == 6 && Link->Item[8] == true || e->Attributes[10] == 6 && Link->Item[159] == true){
- if (Link->Dir == DIR_UP && e->Y < Link->Y){
- e->Y --;
- Link->Y = Link->Y +2;
- }
- if (Link->Dir == DIR_DOWN && e->Y > Link->Y + 12){
- e->Y ++;
- Link->Y = Link->Y -2;
- }
- if (Link->Dir == DIR_LEFT && e->X < Link->X){
- e->X --;
- Link->X = Link->X +2;
- }
- if (Link->Dir == DIR_RIGHT && e->X > Link->X + 12){
- e->X ++;
- Link->X = Link->X -2;
- }
- }
- if (e->Attributes[10] == 1 || e->Attributes[10] == 2 || e->Attributes[10] == 3 || e->Attributes[10] == 4 || e->Attributes[10] == 11 || e->Attributes[10] == 7 || e->Attributes[10] == 12 || e->Hunger == 3){
- if (e->Attributes[10] != 4 || Link->Item[174] == true || Link->Item[175] == true || e->Hunger == 3){
- if (Link->Dir == DIR_UP && e->Y < Link->Y){
- if (e->Attributes[10] == 7) e->HP = 0;
- if (e->Attributes[10] != 7 && Game->LKeys[400] < 16 && e->Hunger != 3) Game->LKeys[400] = Game->LKeys[400] + 8;
- if (e->Attributes[10] != 2 && e->Attributes[10] != 12){
- e->Dir = DIR_DOWN;
- if (e->Stun == 0) e->Stun = 16;
- e->Misc[1] = 8;
- }
- Game->PlaySound(21);
- }
- if (Link->Dir == DIR_DOWN && e->Y > Link->Y+4){
- if (e->Attributes[10] == 7) e->HP = 0;
- if (e->Attributes[10] != 7 && Game->LKeys[400] < 16) Game->LKeys[400] = Game->LKeys[400] + 8;
- if (e->Attributes[10] != 2 && e->Attributes[10] != 12){
- e->Dir = DIR_UP;
- if (e->Stun == 0) e->Stun = 16;
- e->Misc[1] = 8;
- }
- Game->PlaySound(21);
- }
- if (Link->Dir == DIR_LEFT && e->X < Link->X){
- if (e->Attributes[10] == 7) e->HP = 0;
- if (e->Attributes[10] != 7 && Game->LKeys[400] < 16) Game->LKeys[400] = Game->LKeys[400] + 8;
- if (e->Attributes[10] != 2 && e->Attributes[10] != 12){
- e->Dir = DIR_RIGHT;
- if (e->Stun == 0) e->Stun = 16;
- e->Misc[1] = 8;
- }
- Game->PlaySound(21);
- }
- if (Link->Dir == DIR_RIGHT && e->X > Link->X + 4){
- if (e->Attributes[10] == 7) e->HP = 0;
- if (e->Attributes[10] != 7 && Game->LKeys[400] < 16) Game->LKeys[400] = Game->LKeys[400] + 8;
- if (e->Attributes[10] != 2 && e->Attributes[10] != 12){
- e->Dir = DIR_LEFT;
- if (e->Stun == 0) e->Stun = 16;
- e->Misc[1] = 8;
- }
- Game->PlaySound(21);
- }
- if (e->Attributes[10] == 3) e->Stun = 240;
- }
- }
- }
- // Enemy gets recoiled
- if (e->Misc[1] > 0){ //! !Z! No idea what this is supposed to do.
- e->Misc[1] --;
- if (e->OriginalTile == 2616) e->Misc[1] = 0;
- else if (e->HP > 0){
- if (e->Dir == DIR_DOWN && e->Y > 3){
- if (Screen->ComboS[ComboAt(e->X+8, e->Y-4)] == 0 || Screen->ComboT[ComboAt(e->X+8, e->Y-4)] == CT_WATER || e->Type == NPCT_KEESE) e->Y = e->Y -4;
- }
- if (e->Dir == DIR_UP && e->Y < 159){
- if (Screen->ComboS[ComboAt(e->X+8, e->Y+20)] == 0 || Screen->ComboT[ComboAt(e->X+8, e->Y+20)] == CT_WATER || e->Type == NPCT_KEESE) e->Y = e->Y +4;
- }
- if (e->Dir == DIR_LEFT && e->X < 253){
- if (Screen->ComboS[ComboAt(e->X+20, e->Y+8)] == 0 || Screen->ComboT[ComboAt(e->X+20, e->Y+8)] == CT_WATER || e->Type == NPCT_KEESE) e->X = e->X +4;
- }
- if (e->Dir == DIR_RIGHT && e->X > 3){
- if (Screen->ComboS[ComboAt(e->X-4, e->Y+8)] == 0 || Screen->ComboT[ComboAt(e->X-4, e->Y+8)] == CT_WATER || e->Type == NPCT_KEESE) e->X = e->X -4;
- }
- }
- }
- }
- }
- }
- // ----- Shield pushing
- // (see also: for loop of NPCs)
- void MitsukaraShieldPush(){
- //I have no idea what these hardcoded item values are.
- if (Link->Item[173] == true){
- if (Link->Item[8] == true || Link->Item[37] == true || Link->Item[93] == false){
- Link->Item[173] = false;
- Blocking = false;
- }
- }
- if (Link->Item[174] == true){
- if (Link->Item[37] == true || Link->Item[8] == false){
- Link->Item[174] = false;
- Blocking = false;
- }
- }
- if (Link->Item[175] == true && Link->Item[37] == false){
- Link->Item[175] = false;
- Blocking = false;
- }
- if (GetEquipmentA() == 93 && Link->PressA || GetEquipmentB() == 93 && Link->PressB || GetEquipmentA() == 8 && Link->PressA || GetEquipmentB() == 8 && Link->PressB || GetEquipmentA() == 37 && Link->PressA || GetEquipmentB() == 37 && Link->PressB || Game->LItems[401] == LI_MAP && Link->PressR && Link->Item[93] == true) Game->PlaySound(91);
- if (Link->Action < 2 || Link->Action == LA_CHARGING){
- if (GetEquipmentA() == 93 && Link->InputA || GetEquipmentB() == 93 && Link->InputB || Game->LItems[401] == LI_MAP && Link->InputR && Link->Item[93] == true && Link->Item[37] == false && Link->Item[8] == false){
- if (Link->Item[173] == false){
- Link->Item[173] = true;
- Blocking = true;
- }
- }
- if (GetEquipmentA() == 8 && Link->InputA || GetEquipmentB() == 8 && Link->InputB || Game->LItems[401] == LI_MAP && Link->InputR && Link->Item[8] == true && Link->Item[37] == false){
- if (Link->Item[174] == false){
- Link->Item[174] = true;
- Blocking = true;
- }
- }
- if (GetEquipmentA() == 37 && Link->InputA || GetEquipmentB() == 37 && Link->InputB || Game->LItems[401] == LI_MAP && Link->InputR && Link->Item[37] == true){
- if (Link->Item[175] == false){
- Link->Item[175] = true;
- Blocking = true;
- }
- }
- }
- if (GetEquipmentA() == 93 && Link->InputA == false || GetEquipmentB() == 93 && Link->InputB == false || GetEquipmentA() == 8 && Link->InputA == false || GetEquipmentB() == 8 && Link->InputB == false || GetEquipmentA() == 37 && Link->InputA == false || GetEquipmentB() == 37 && Link->InputB == false || GetEquipmentA() != 93 && GetEquipmentB() != 93 && GetEquipmentA() != 8 && GetEquipmentB() != 8 && GetEquipmentA() != 37 && GetEquipmentB() != 37 || Link->Action > 2 && Link->Action != LA_CHARGING){
- if (Game->LItems[401] != LI_MAP || !Link->InputR || Link->Action > 2 && Link->Action != LA_CHARGING){
- if (Link->Item[173] == true) Link->Item[173] = false;
- if (Link->Item[174] == true) Link->Item[174] = false;
- if (Link->Item[175] == true) Link->Item[175] = false;
- if (Blocking == true) Blocking = false;
- }
- }
- }
- ////////////////////////
- /// GLOBAL FUNCTIONS ///
- ////////////////////////
- void FixLinkOnLaddersForMap(){
- if ( Is(MAP_OPEN) && !Is(MAP_DISPLAY_TIMER) ){
- MaintainLinkCoordinates();
- }
- }
- //Used to determine if Link is on a Pit or Lava combo.
- int OnPitCombo()
- {
- int comboLoc = ComboAt(Link->X+8, Link->Y + Cond(BIG_LINK==0, 12, 8));
- if(Screen->ComboT[comboLoc] != CT_HOLELAVA)
- return 0;
- else if(Screen->ComboI[comboLoc] == CF_PIT || Screen->ComboI[comboLoc] == CF_LAVA)
- return Screen->ComboI[comboLoc];
- else if(Screen->ComboF[comboLoc] == CF_PIT || Screen->ComboF[comboLoc] == CF_LAVA)
- return Screen->ComboF[comboLoc];
- else
- return 0;
- }
- //Snaps Link to the combo so he appears completely over pit and lava combos.
- void SnaptoGrid()
- {
- int x = Link->X;
- int y = Link->Y + Cond(BIG_LINK==0, 8, 0);
- int comboLoc = ComboAt(x, y);
- //X Axis
- if(Screen->ComboT[comboLoc] == CT_HOLELAVA && Cond(x % 16 == 0, true, Screen->ComboT[comboLoc+1] != CT_HOLELAVA))
- Link->X = ComboX(comboLoc);
- else if(Screen->ComboT[comboLoc+1] == CT_HOLELAVA && Cond(x % 16 == 0, true, Screen->ComboT[comboLoc] != CT_HOLELAVA))
- Link->X = ComboX(comboLoc+1);
- if(Cond(y % 16 == 0, false, Screen->ComboT[comboLoc+16] == CT_HOLELAVA) && Cond(x % 16 == 0, true, Screen->ComboT[comboLoc+17] != CT_HOLELAVA))
- Link->X = ComboX(comboLoc+16);
- else if(Cond(y % 16 == 0, false, Screen->ComboT[comboLoc+17] == CT_HOLELAVA) && Cond(x % 16 == 0, true, Screen->ComboT[comboLoc+16] != CT_HOLELAVA))
- Link->X = ComboX(comboLoc+17);
- //Y Axis
- if(Screen->ComboT[comboLoc] == CT_HOLELAVA && Cond(y % 16 == 0, true, Screen->ComboT[comboLoc+16] != CT_HOLELAVA))
- Link->Y = ComboY(comboLoc);
- else if(Screen->ComboT[comboLoc+16] == CT_HOLELAVA && Cond(y % 16 == 0, true, Screen->ComboT[comboLoc] != CT_HOLELAVA))
- Link->Y = ComboY(comboLoc+16);
- if(Cond(x % 16 == 0, false, Screen->ComboT[comboLoc+1] == CT_HOLELAVA) && Cond(y % 16 == 0, true, Screen->ComboT[comboLoc+17] != CT_HOLELAVA))
- Link->Y = ComboY(comboLoc+1);
- else if(Cond(x % 16 == 0, false, Screen->ComboT[comboLoc+17] == CT_HOLELAVA) && Cond(y % 16 == 0, true, Screen->ComboT[comboLoc+1] != CT_HOLELAVA))
- Link->Y = ComboY(comboLoc+17);
- }
- //Used to make Ex1/Ex2 switch items like L&R for A+B subscreens.
- void LREx1Ex2ItemSwitch()
- {
- if (Link->PressL && Link->Action != LA_SCROLLING)
- {
- Link->SelectBWeapon(DIR_LEFT);
- }
- if (Link->PressR && Link->Action != LA_SCROLLING)
- {
- Link->SelectBWeapon(DIR_RIGHT);
- }
- if (Link->PressEx1 && Link->Action != LA_SCROLLING)
- {
- Link->SelectAWeapon(DIR_LEFT);
- }
- if (Link->PressEx2 && Link->Action != LA_SCROLLING)
- {
- Link->SelectAWeapon(DIR_RIGHT);
- }
- }
- //Hole_Lava Init. Call before Waitdraw().
- void InitHoleLava(){
- //Initialize variables used to store Link's strating position on Screen Init.
- PitsLava[HL_OLDDMAP] = Game->GetCurDMap();
- PitsLava[HL_OLDSCREEN] = Game->GetCurDMapScreen();
- PitsLava[HL_STARTX] = Link->X;
- PitsLava[HL_STARTY] = Link->Y;
- PitsLava[HL_STARTDIR] = Link->Dir;
- //Clear global variables used by Bottomless pits.
- PitsLava[HL_FALLING] = 0;
- PitsLava[HL_WARPING] = 0;
- }
- //Main Hole_Lava Rountine. Call after Waitdraw().
- void RunHoleLava(){
- Update_HoleLava(PitsLava[HL_STARTX], PitsLava[HL_STARTY], PitsLava[HL_OLDDMAP], PitsLava[HL_OLDSCREEN], PitsLava[HL_STARTDIR]);
- if(Link->Z==0 && !PitsLava[HL_FALLING] && ( PitsLava[HL_OLDSCREEN] != Game->GetCurDMapScreen() || PitsLava[HL_OLDDMAP] != Game->GetCurDMap() ) && !OnPitCombo() )
- {
- PitsLava[HL_OLDDMAP] = Game->GetCurDMap();
- PitsLava[HL_OLDSCREEN] = Game->GetCurDMapScreen();
- PitsLava[HL_STARTX] = Link->X;
- PitsLava[HL_STARTY] = Link->Y;
- PitsLava[HL_STARTDIR] = Link->Dir;
- }
- }
- //Handles Pit Combo Functionality.
- void Update_HoleLava2(){
- if(PitsLava[HL_FALLING])
- NoAction();
- }
- void Update_HoleLava(int x, int y, int dmap, int scr, int dir)
- {
- lweapon hookshot = LoadLWeaponOf(LW_HOOKSHOT);
- if(hookshot->isValid()) return;
- if(PitsLava[HL_FALLING])
- {
- if(IsSideview()) Link->Jump=0;
- PitsLava[HL_FALLING]--;
- if(PitsLava[HL_FALLING] == 1)
- {
- int buffer[] = "Holelava";
- if(CountFFCsRunning(Game->GetFFCScript(buffer)))
- {
- ffc f = Screen->LoadFFC(FindFFCRunning(Game->GetFFCScript(buffer)));
- PitsLava[HL_WARPING] = 1;
- if(f->InitD[1]==0)
- {
- f->InitD[6] = x;
- f->InitD[7] = y;
- }
- }
- else
- {
- Link->X = x;
- Link->Y = y;
- Link->Dir = dir;
- Link->DrawXOffset -= Cond(Link->DrawXOffset < 0, -1000, 1000);
- Link->HitXOffset -= Cond(Link->HitXOffset < 0, -1000, 1000);
- Link->HP -= HOLELAVA_DAMAGE;
- Link->Action = LA_GOTHURTLAND;
- Link->HitDir = -1;
- Game->PlaySound(SFX_OUCH);
- if(Game->GetCurDMap()!=dmap || Game->GetCurDMapScreen()!=scr)
- Link->PitWarp(dmap, scr);
- }
- NoAction();
- Link->Action = LA_NONE;
- }
- }
- else if(Link->Z==0 && OnPitCombo() && !PitsLava[HL_WARPING])
- {
- Link->DrawXOffset += Cond(Link->DrawXOffset < 0, -1000, 1000);
- Link->HitXOffset += Cond(Link->HitXOffset < 0, -1000, 1000);
- int comboflag = OnPitCombo();
- SnaptoGrid();
- Game->PlaySound(Cond(comboflag == CF_PIT, SFX_LINK_FALL, SFX_LINK_LAVA));
- lweapon dummy = CreateLWeaponAt(LW_SCRIPT10, Link->X, Link->Y);
- dummy->UseSprite(Cond(comboflag == CF_PIT, WPS_LINK_FALL, WPS_LINK_LAVA));
- dummy->DeadState = dummy->NumFrames*dummy->ASpeed;
- dummy->DrawXOffset = 0;
- dummy->DrawYOffset = 0;
- PitsLava[HL_FALLING] = dummy->DeadState;
- NoAction();
- Link->Action = LA_NONE;
- }
- }
- /////////////////////////////////////
- /// Global Accessors ///////////////
- /// Setter and Getters for Arrays ///
- /////////////////////////////////////
- int Ice_XStep;
- int Ice_YStep;
- //GlobalRAM Array
- void Is(int index, int val){
- GlobalRAM[index] = val;
- }
- void Mod(int index, int val){
- GlobalRAM[index] += val;
- }
- int Is(int index){
- return GlobalRAM[index];
- }
- void Inc(int index){
- GlobalRAM[index]++;
- }
- void Dec(int index){
- GlobalRAM[index]--;
- }
- //Global setter/getter functions for shield script.
- ///////////////////////////
- // Misc Global Functions //
- ///////////////////////////
- //Preserves Link's coordinates for map/ladder issues..
- void StoreLinkCoordinates(){
- Is(STORE_LINK_X, Link->X);
- Is(STORE_LINK_Y, Link->Y);
- Is(STORE_LINK_Z, Link->Z);
- Is(STORE_LINK_JUMP, Link->Jump);
- }
- //Maintains Link's coordinates in Map()
- void MaintainLinkCoordinates(){
- if ( Link->X != Is(STORE_LINK_X) ) Link->X = Is(STORE_LINK_X);
- if ( Link->Y != Is(STORE_LINK_Y) ) Link->Y = Is(STORE_LINK_Y);
- if ( Link->Z != Is(STORE_LINK_Z) ) Link->Z = Is(STORE_LINK_Z);
- Link->Jump = 0;
- Trace(Link->X);
- Trace(Link->Y);
- Trace(Link->Z);
- Trace(Link->Jump);
- TraceNL();
- }
- ////////////////////
- /// Item Scripts ///
- ////////////////////
- ///////////////////
- /// FFC Scripts ///
- ///////////////////
- //Holes and Lava Main ffc
- ffc script Holelava
- {
- void run(int warp, bool position, int damage)
- {
- while(true)
- {
- while(!PitsLava[HL_WARPING]) Waitframe();
- if(warp > 0)
- {
- this->Data = CMB_AUTOWARP+warp-1;
- this->Flags[FFCF_CARRYOVER] = true;
- Waitframe();
- this->Data = FFCS_INVISIBLE_COMBO;
- this->Flags[FFCF_CARRYOVER] = false;
- Link->Z = Link->Y;
- PitsLava[HL_WARPING] = 0;
- Link->DrawXOffset -= Cond(Link->DrawXOffset < 0, -1000, 1000);
- Link->HitXOffset -= Cond(Link->HitXOffset < 0, -1000, 1000);
- Quit();
- }
- if(position)
- {
- Link->X = this->X;
- Link->Y = this->Y;
- }
- else
- {
- Link->X = this->InitD[6];
- Link->Y = this->InitD[7];
- }
- if(damage)
- {
- Link->HP -= damage;
- Link->Action = LA_GOTHURTLAND;
- Link->HitDir = -1;
- Game->PlaySound(SFX_OUCH);
- }
- Link->DrawXOffset -= Cond(Link->DrawXOffset < 0, -1000, 1000);
- Link->HitXOffset -= Cond(Link->HitXOffset < 0, -1000, 1000);
- PitsLava[HL_WARPING] = 0;
- Waitframe();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement