CODE
import "std.zh"
item script wshieldmsg
{
void run()
{
Screen->Message(13);
}
}
item script wshieldmsg
{
void run()
{
Screen->Message(13);
}
}
CODE
// Deep Water- When Link steps on a certain combo without a certain item in his inventory, the combo turns into a Damage Combo. If he does, it becomes normal
// water. Simple. as. that. 4 combos for Water, 4 combos for Dive Warp. No Swim Warp, though. Unless you feel like making more variables. Set this script to
// each screen with the desired combo(s). Best not to use it anywhere else. Why? Well, it wouldn't really make sense. A waste of FFCs.
// Constants/Variables:
// water1-water4- D0 through D3. Control what combos turn into water.
// dive1-dive4- D4 through D7. Will be used for Dive Warp instead of Water.
// level2flippers- What item ID will be used for the Level 2 Flippers. And please, remember to set the item in the Flippers Itemclass. It makes it better.
// damage- How much HP to take off Link if he touches the Deep Water without L-2 Flippers. Default is 8, 1/2 Heart.
// warp1-warp4- Which Dive Warp combo the 4 "dive" variables will turn into. They don't even need to be Dive Warp combos. In case you want more than one Dive
// Warp per screen, or if you've used some other warps. Hey, better safe than sorry. I need to make sure of your ideas! :(
import "std.zh"
const int level2flippers = 248;
const int damage = 8;
const int warp1 = 19;
const int warp2 = 19;
const int warp3 = 19;
const int warp4 = 19;
ffc script deepwater
{
void run(int water1, int water2, int water3, int water4, int dive1, int dive2, int dive3, int dive4)
{
while(true)
{
for (int cmbchk = 0; cmbchk < 176; cmbchk++)
{
if(Screen->ComboD[cmbchk] == water1 || Screen->ComboD[cmbchk] == water2 || Screen->ComboD[cmbchk] == water3 || Screen->ComboD[cmbchk] == water4)
{
if(!Link->Item[level2flippers])
{
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = 3;
Screen->ComboS[cmbchk] = 15;
}
}
if(Screen->ComboD[cmbchk] == dive1)
{
if(!Link->Item[level2flippers])
{
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = warp1;
Screen->ComboS[cmbchk] = 15;
}
}
if(Screen->ComboD[cmbchk] == dive2)
{
if(!Link->Item[level2flippers])
{
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = warp2;
Screen->ComboS[cmbchk] = 15;
}
}
if(Screen->ComboD[cmbchk] == dive3)
{
if(!Link->Item[level2flippers])
{
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = warp3;
Screen->ComboS[cmbchk] = 15;
}
}
if(Screen->ComboD[cmbchk] == dive4)
{
if(!Link->Item[level2flippers])
{
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = warp4;
Screen->ComboS[cmbchk] = 15;
}
}
int loc = ComboAt(Link->X, Link->Y);
if(Screen->ComboD[loc] == water1 || Screen->ComboD[loc] == water2 || Screen->ComboD[loc] == water3 || Screen->ComboD[loc] == water4 || Screen->ComboD[loc] == dive1 || Screen->ComboD[loc] == dive2 || Screen->ComboD[loc] == dive3 || Screen->ComboD[loc] == dive4)
{
Link->HP -= damage;
Game->PlaySound(19);
int stopYUP = Link->Y - 16;
int stopYDOWN = Link->Y + 16;
int stopXLEFT = Link->X - 16;
int stopXRIGHT = Link->X + 16;
if(Link->Dir == 1)
{
while(Link->Y > stopYUP)
{
Link->Y -= 4;
Waitframe();
}
}
else if(Link->Dir == 0)
{
while(Link->Y < stopYDOWN)
{
Link->Y += 4;
Waitframe();
}
}
else if(Link->Dir == 3)
{
while(Link->X > stopXLEFT)
{
Link->X -= 4;
Waitframe();
}
}
else if(Link->Dir == 2)
{
while(Link->X < stopXRIGHT)
{
Link->X += 4;
Waitframe();
}
}
}
}
Waitframe();
}
}
}
// water. Simple. as. that. 4 combos for Water, 4 combos for Dive Warp. No Swim Warp, though. Unless you feel like making more variables. Set this script to
// each screen with the desired combo(s). Best not to use it anywhere else. Why? Well, it wouldn't really make sense. A waste of FFCs.
// Constants/Variables:
// water1-water4- D0 through D3. Control what combos turn into water.
// dive1-dive4- D4 through D7. Will be used for Dive Warp instead of Water.
// level2flippers- What item ID will be used for the Level 2 Flippers. And please, remember to set the item in the Flippers Itemclass. It makes it better.
// damage- How much HP to take off Link if he touches the Deep Water without L-2 Flippers. Default is 8, 1/2 Heart.
// warp1-warp4- Which Dive Warp combo the 4 "dive" variables will turn into. They don't even need to be Dive Warp combos. In case you want more than one Dive
// Warp per screen, or if you've used some other warps. Hey, better safe than sorry. I need to make sure of your ideas! :(
import "std.zh"
const int level2flippers = 248;
const int damage = 8;
const int warp1 = 19;
const int warp2 = 19;
const int warp3 = 19;
const int warp4 = 19;
ffc script deepwater
{
void run(int water1, int water2, int water3, int water4, int dive1, int dive2, int dive3, int dive4)
{
while(true)
{
for (int cmbchk = 0; cmbchk < 176; cmbchk++)
{
if(Screen->ComboD[cmbchk] == water1 || Screen->ComboD[cmbchk] == water2 || Screen->ComboD[cmbchk] == water3 || Screen->ComboD[cmbchk] == water4)
{
if(!Link->Item[level2flippers])
{
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = 3;
Screen->ComboS[cmbchk] = 15;
}
}
if(Screen->ComboD[cmbchk] == dive1)
{
if(!Link->Item[level2flippers])
{
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = warp1;
Screen->ComboS[cmbchk] = 15;
}
}
if(Screen->ComboD[cmbchk] == dive2)
{
if(!Link->Item[level2flippers])
{
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = warp2;
Screen->ComboS[cmbchk] = 15;
}
}
if(Screen->ComboD[cmbchk] == dive3)
{
if(!Link->Item[level2flippers])
{
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = warp3;
Screen->ComboS[cmbchk] = 15;
}
}
if(Screen->ComboD[cmbchk] == dive4)
{
if(!Link->Item[level2flippers])
{
Screen->ComboS[cmbchk] = 0;
}
else if(Link->Item[level2flippers])
{
Screen->ComboT[cmbchk] = warp4;
Screen->ComboS[cmbchk] = 15;
}
}
int loc = ComboAt(Link->X, Link->Y);
if(Screen->ComboD[loc] == water1 || Screen->ComboD[loc] == water2 || Screen->ComboD[loc] == water3 || Screen->ComboD[loc] == water4 || Screen->ComboD[loc] == dive1 || Screen->ComboD[loc] == dive2 || Screen->ComboD[loc] == dive3 || Screen->ComboD[loc] == dive4)
{
Link->HP -= damage;
Game->PlaySound(19);
int stopYUP = Link->Y - 16;
int stopYDOWN = Link->Y + 16;
int stopXLEFT = Link->X - 16;
int stopXRIGHT = Link->X + 16;
if(Link->Dir == 1)
{
while(Link->Y > stopYUP)
{
Link->Y -= 4;
Waitframe();
}
}
else if(Link->Dir == 0)
{
while(Link->Y < stopYDOWN)
{
Link->Y += 4;
Waitframe();
}
}
else if(Link->Dir == 3)
{
while(Link->X > stopXLEFT)
{
Link->X -= 4;
Waitframe();
}
}
else if(Link->Dir == 2)
{
while(Link->X < stopXRIGHT)
{
Link->X += 4;
Waitframe();
}
}
}
}
Waitframe();
}
}
}
(continued next post)
(continued from previous post)
CODE
// Shop- Oracles-style shop, where you must press A to buy the item. There is no confirmation message, though, so only press A if you want the item!
// Constants:
// nerm- Weird name, yes, but... Message to use when you try to buy an item without the required amount of Rupees. "THAT AIN'T ENOUGH TO BUY!"
// boughtmsg- Message to use when you buy something.
// D variables:
// item1- Variable D0. First item you can buy.
// item2- Variable D1. Second item you can buy.
// item3- Variable D2. Third item you can buy.
// item4- Variable D3. Fourth item you can buy.
// price1- Variable D4. Price of item1.
// price2- Variable D5. Price of item2.
// price3- Variable D6. Price of item3.
// price4- Variable D7. Price of item4.
import "std.zh"
const int nerm = 12;
ffc script shop
{
void run(int item1, int item2, int item3, int item4, int price1, int price2, int price3, int price4) //load up the D variables
{
int nobuy = 0;
int wait = 1;
while(true) //as long as the script is active, it'll NEVER stop. Yay!
{
ffc buy1 = Screen->LoadFFC(31);
ffc buy2 = Screen->LoadFFC(30); //we load the 4 FFCs to be used for the shop here...
ffc buy3 = Screen->LoadFFC(29);
ffc buy4 = Screen->LoadFFC(28);
while((Link->X > buy1->X-4 && Link->X < buy1->X+4) && Link->Y == buy1->Y) //continue only if Link is on the FFC
{
while(Link->InputA) //only allow buying if you press A
{
if(nobuy == 0 && Game->Counter[1] >= price1 && Link->Dir == 0) //buy only if you're not constantly holding A, if you have enough Rupees, and if you are facing the item.
{
nobuy = 1; //helps start the no-buy timer
Link->Item[item1] = true; //gives Link the item
Game->PlaySound(25);
Screen->Message(71);
int drainwait = price1; //places the price of the item you just bought into a new variable to be deducted from...we can't deduct from the price variable, or else the price of the item might go down. XD
while(drainwait > 0)
{
Game->Counter[1] -= 1; //we take away Link's Rupees gradually here...just like with the normal shops.
drainwait -= 1; //take away 1 from the deduction variable so it knows how much more to take away
Waitframe(); //wait one frame...without this, the script would freeze the player...and that could be dangerous. VERY dangerous indeed...
}
}
else if(nobuy == 0 && Game->Counter[1] < price1 && Link->Dir == 0) //check if the player tries to buy an item without enough Rupees
{
Screen->Message(nerm); //bring up a message to tell the player that he/she needs more Rupees
nobuy = 1; //hey, without this, the message will keep repeating! :O
}
Waitframe();
}
if(!Link->InputA)
{
nobuy = 0;
}
Waitframe();
}
while((Link->X > buy2->X-4 && Link->X < buy2->X+4) && Link->Y == buy2->Y)
{
while(Link->InputA) //only allow buying if you press A
{
if(nobuy == 0 && Game->Counter[1] >= price2 && Link->Dir == 0) //buy only if you're not constantly holding A, if you have enough Rupees, and if you are facing the item.
{
nobuy = 1; //helps start the no-buy timer
Link->Item[item2] = true; //gives Link the item
Game->PlaySound(25);
Screen->Message(13);
int drainwait = price2; //places the price of the item you just bought into a new variable to be deducted from...we can't deduct from the price variable, or else the price of the item might go down. XD
while(drainwait > 0)
{
Game->Counter[1] -= 1; //we take away Link's Rupees gradually here...just like with the normal shops.
drainwait -= 1; //take away 1 from the deduction variable so it knows how much more to take away
Waitframe(); //wait one frame...without this, the script would freeze the player...and that could be dangerous. VERY dangerous indeed...
}
}
else if(nobuy == 0 && Game->Counter[1] < price2 && Link->Dir == 0) //check if the player tries to buy an item without enough Rupees
{
Screen->Message(nerm); //bring up a message to tell the player that he/she needs more Rupees
nobuy = 1; //hey, without this, the message will keep repeating! :O
}
Waitframe();
}
if(!Link->InputA)
{
nobuy = 0;
}
Waitframe();
}
while((Link->X > buy3->X-4 && Link->X < buy3->X+4) && Link->Y == buy3->Y)
{
while(Link->InputA) //only allow buying if you press A
{
if(nobuy == 0 && Game->Counter[1] >= price3 && Link->Dir == 0) //buy only if you're not constantly holding A, if you have enough Rupees, and if you are facing the item.
{
nobuy = 1; //helps start the no-buy timer
Link->Item[item3] = true; //gives Link the item
Game->PlaySound(25);
Screen->Message(14);
int drainwait = price3; //places the price of the item you just bought into a new variable to be deducted from...we can't deduct from the price variable, or else the price of the item might go down. XD
while(drainwait > 0)
{
Game->Counter[1] -= 1; //we take away Link's Rupees gradually here...just like with the normal shops.
drainwait -= 1; //take away 1 from the deduction variable so it knows how much more to take away
Waitframe(); //wait one frame...without this, the script would freeze the player...and that could be dangerous. VERY dangerous indeed...
}
}
else if(nobuy == 0 && Game->Counter[1] < price3 && Link->Dir == 0) //check if the player tries to buy an item without enough Rupees
{
Screen->Message(nerm); //bring up a message to tell the player that he/she needs more Rupees
nobuy = 1; //hey, without this, the message will keep repeating! :O
}
Waitframe();
}
if(!Link->InputA)
{
nobuy = 0;
}
Waitframe();
}
while((Link->X > buy4->X-4 && Link->X < buy4->X+4) && Link->Y == buy4->Y)
{
while(Link->InputA) //only allow buying if you press A
{
if(nobuy == 0 && Game->Counter[1] >= price4 && Link->Dir == 0) //buy only if you're not constantly holding A, if you have enough Rupees, and if you are facing the item.
{
nobuy = 1; //helps start the no-buy timer
Link->Item[item4] = true; //gives Link the item
Game->PlaySound(25);
Screen->Message(71);
int drainwait = price4; //places the price of the item you just bought into a new variable to be deducted from...we can't deduct from the price variable, or else the price of the item might go down. XD
while(drainwait > 0)
{
Game->Counter[1] -= 1; //we take away Link's Rupees gradually here...just like with the normal shops.
drainwait -= 1; //take away 1 from the deduction variable so it knows how much more to take away
Waitframe(); //wait one frame...without this, the script would freeze the player...and that could be dangerous. VERY dangerous indeed...
}
}
else if(nobuy == 0 && Game->Counter[1] < price4 && Link->Dir == 0) //check if the player tries to buy an item without enough Rupees
{
Screen->Message(nerm); //bring up a message to tell the player that he/she needs more Rupees
nobuy = 1; //hey, without this, the message will keep repeating! :O
}
Waitframe();
}
if(!Link->InputA)
{
nobuy = 0;
}
Waitframe();
}
Waitframe();
}
}
}
// Constants:
// nerm- Weird name, yes, but... Message to use when you try to buy an item without the required amount of Rupees. "THAT AIN'T ENOUGH TO BUY!"
// boughtmsg- Message to use when you buy something.
// D variables:
// item1- Variable D0. First item you can buy.
// item2- Variable D1. Second item you can buy.
// item3- Variable D2. Third item you can buy.
// item4- Variable D3. Fourth item you can buy.
// price1- Variable D4. Price of item1.
// price2- Variable D5. Price of item2.
// price3- Variable D6. Price of item3.
// price4- Variable D7. Price of item4.
import "std.zh"
const int nerm = 12;
ffc script shop
{
void run(int item1, int item2, int item3, int item4, int price1, int price2, int price3, int price4) //load up the D variables
{
int nobuy = 0;
int wait = 1;
while(true) //as long as the script is active, it'll NEVER stop. Yay!
{
ffc buy1 = Screen->LoadFFC(31);
ffc buy2 = Screen->LoadFFC(30); //we load the 4 FFCs to be used for the shop here...
ffc buy3 = Screen->LoadFFC(29);
ffc buy4 = Screen->LoadFFC(28);
while((Link->X > buy1->X-4 && Link->X < buy1->X+4) && Link->Y == buy1->Y) //continue only if Link is on the FFC
{
while(Link->InputA) //only allow buying if you press A
{
if(nobuy == 0 && Game->Counter[1] >= price1 && Link->Dir == 0) //buy only if you're not constantly holding A, if you have enough Rupees, and if you are facing the item.
{
nobuy = 1; //helps start the no-buy timer
Link->Item[item1] = true; //gives Link the item
Game->PlaySound(25);
Screen->Message(71);
int drainwait = price1; //places the price of the item you just bought into a new variable to be deducted from...we can't deduct from the price variable, or else the price of the item might go down. XD
while(drainwait > 0)
{
Game->Counter[1] -= 1; //we take away Link's Rupees gradually here...just like with the normal shops.
drainwait -= 1; //take away 1 from the deduction variable so it knows how much more to take away
Waitframe(); //wait one frame...without this, the script would freeze the player...and that could be dangerous. VERY dangerous indeed...
}
}
else if(nobuy == 0 && Game->Counter[1] < price1 && Link->Dir == 0) //check if the player tries to buy an item without enough Rupees
{
Screen->Message(nerm); //bring up a message to tell the player that he/she needs more Rupees
nobuy = 1; //hey, without this, the message will keep repeating! :O
}
Waitframe();
}
if(!Link->InputA)
{
nobuy = 0;
}
Waitframe();
}
while((Link->X > buy2->X-4 && Link->X < buy2->X+4) && Link->Y == buy2->Y)
{
while(Link->InputA) //only allow buying if you press A
{
if(nobuy == 0 && Game->Counter[1] >= price2 && Link->Dir == 0) //buy only if you're not constantly holding A, if you have enough Rupees, and if you are facing the item.
{
nobuy = 1; //helps start the no-buy timer
Link->Item[item2] = true; //gives Link the item
Game->PlaySound(25);
Screen->Message(13);
int drainwait = price2; //places the price of the item you just bought into a new variable to be deducted from...we can't deduct from the price variable, or else the price of the item might go down. XD
while(drainwait > 0)
{
Game->Counter[1] -= 1; //we take away Link's Rupees gradually here...just like with the normal shops.
drainwait -= 1; //take away 1 from the deduction variable so it knows how much more to take away
Waitframe(); //wait one frame...without this, the script would freeze the player...and that could be dangerous. VERY dangerous indeed...
}
}
else if(nobuy == 0 && Game->Counter[1] < price2 && Link->Dir == 0) //check if the player tries to buy an item without enough Rupees
{
Screen->Message(nerm); //bring up a message to tell the player that he/she needs more Rupees
nobuy = 1; //hey, without this, the message will keep repeating! :O
}
Waitframe();
}
if(!Link->InputA)
{
nobuy = 0;
}
Waitframe();
}
while((Link->X > buy3->X-4 && Link->X < buy3->X+4) && Link->Y == buy3->Y)
{
while(Link->InputA) //only allow buying if you press A
{
if(nobuy == 0 && Game->Counter[1] >= price3 && Link->Dir == 0) //buy only if you're not constantly holding A, if you have enough Rupees, and if you are facing the item.
{
nobuy = 1; //helps start the no-buy timer
Link->Item[item3] = true; //gives Link the item
Game->PlaySound(25);
Screen->Message(14);
int drainwait = price3; //places the price of the item you just bought into a new variable to be deducted from...we can't deduct from the price variable, or else the price of the item might go down. XD
while(drainwait > 0)
{
Game->Counter[1] -= 1; //we take away Link's Rupees gradually here...just like with the normal shops.
drainwait -= 1; //take away 1 from the deduction variable so it knows how much more to take away
Waitframe(); //wait one frame...without this, the script would freeze the player...and that could be dangerous. VERY dangerous indeed...
}
}
else if(nobuy == 0 && Game->Counter[1] < price3 && Link->Dir == 0) //check if the player tries to buy an item without enough Rupees
{
Screen->Message(nerm); //bring up a message to tell the player that he/she needs more Rupees
nobuy = 1; //hey, without this, the message will keep repeating! :O
}
Waitframe();
}
if(!Link->InputA)
{
nobuy = 0;
}
Waitframe();
}
while((Link->X > buy4->X-4 && Link->X < buy4->X+4) && Link->Y == buy4->Y)
{
while(Link->InputA) //only allow buying if you press A
{
if(nobuy == 0 && Game->Counter[1] >= price4 && Link->Dir == 0) //buy only if you're not constantly holding A, if you have enough Rupees, and if you are facing the item.
{
nobuy = 1; //helps start the no-buy timer
Link->Item[item4] = true; //gives Link the item
Game->PlaySound(25);
Screen->Message(71);
int drainwait = price4; //places the price of the item you just bought into a new variable to be deducted from...we can't deduct from the price variable, or else the price of the item might go down. XD
while(drainwait > 0)
{
Game->Counter[1] -= 1; //we take away Link's Rupees gradually here...just like with the normal shops.
drainwait -= 1; //take away 1 from the deduction variable so it knows how much more to take away
Waitframe(); //wait one frame...without this, the script would freeze the player...and that could be dangerous. VERY dangerous indeed...
}
}
else if(nobuy == 0 && Game->Counter[1] < price4 && Link->Dir == 0) //check if the player tries to buy an item without enough Rupees
{
Screen->Message(nerm); //bring up a message to tell the player that he/she needs more Rupees
nobuy = 1; //hey, without this, the message will keep repeating! :O
}
Waitframe();
}
if(!Link->InputA)
{
nobuy = 0;
}
Waitframe();
}
Waitframe();
}
}
}
CODE
// Locked Dungeon- Just what it says, a Locked Dungeon. Basically, a Lock Block that you can only unlock if you have a certain item...
// Variables:
// dgnlock- Combo ID for the Lock Block that opens the Dungeon. Set the Combo Type to Lock Block!
// key- Item ID for the Key you need to open the dungeon.
// msg- Message to display if you don't have the required Key when you push against the lock.
import "std.zh"
ffc script lockeddungeon
{
void run(int dgnlock, int key, int msg)
{
while(true)
{
int lock = Link->Y - 8;
int loc = ComboAt(Link->X, lock);
if(Screen->ComboD[loc] == dgnlock)
{
if(Link->Dir == 0 && Link->InputUp)
{
if(Link->Item[key] && Game->Counter[5] == 0)
{
Game->Counter[5] = 1;
}
else if(!Link->Item[key])
{
Screen->Message(msg);
}
}
}
if(Game->Counter[5] > 0 && Screen->ComboD[loc] != dgnlock)
{
Game->Counter[5] = 0;
}
Waitframe();
}
}
}
// Variables:
// dgnlock- Combo ID for the Lock Block that opens the Dungeon. Set the Combo Type to Lock Block!
// key- Item ID for the Key you need to open the dungeon.
// msg- Message to display if you don't have the required Key when you push against the lock.
import "std.zh"
ffc script lockeddungeon
{
void run(int dgnlock, int key, int msg)
{
while(true)
{
int lock = Link->Y - 8;
int loc = ComboAt(Link->X, lock);
if(Screen->ComboD[loc] == dgnlock)
{
if(Link->Dir == 0 && Link->InputUp)
{
if(Link->Item[key] && Game->Counter[5] == 0)
{
Game->Counter[5] = 1;
}
else if(!Link->Item[key])
{
Screen->Message(msg);
}
}
}
if(Game->Counter[5] > 0 && Screen->ComboD[loc] != dgnlock)
{
Game->Counter[5] = 0;
}
Waitframe();
}
}
}
There. Now be happy!