Nimono
02-09-2007, 04:03 PM
Okay, I couldn't resist. I basically did the same thing back at PureZC. SUE ME. :tongue:
Okay, here you go. This is the Oracles Shovel!
// Shovel- Well, what do you THINK it does? :P It digs up the ground directly in front of you,
// provided it's not solid or a certain combo. The combos it can't dig up are yours to decide!
// However, I give you three solid combos it CAN dig up, so use them wisely.
// Variables:
// ComboDug- Combo that appears when you dig in a diggable spot.
// Combo1- First Combo you can't dig in.
// Combo2- 2nd Combo you can't dig in.
// Combo3- 3rd No-Dig Combo.
// Combo4- 4th No-Dig Combo.
// Combo5- 5th No-Dig Combo.
// ComboS1- First Solid Combo you can dig in.
// ComboS2- 2nd Solid Dig Combo.
// ComboS3- 3rd Solid Dig Combo.
import "std.zh"
item script Shovel
{
int ComboDug = 0;
int Combo1 = 0;
int Combo2 = 0;
int Combo3 = 0;
int Combo4 = 0;
int Combo5 = 0;
int ComboS1 = 0;
int ComboS2 = 0;
int ComboS3 = 0;
int ComboX = 0;
int ComboY = 0;
int ComboSDug = 0;
void run()
{
if (Link->Dir == 0)
{
int BlockCheckY = Link->Y - 16;
int BlockCheckX = Link->X;
float BlockRmndrX = BlockCheckX % 16;
if (BlockRmndrX <= 8)
{
BlockCheckX = BlockCheckX - BlockRmndrX;
}
else
{
BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
}
float BlockRmndrY = BlockCheckY % 16;
if (BlockRmndrY <= 8)
{
BlockCheckY = BlockCheckY - BlockRmndrY;
}
else
{
BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
}
int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
if ( (Screen->ComboD [BlockPosition] == Combo1 || Screen->ComboD [BlockPosition] == Combo2 || Screen->ComboD [BlockPosition] == Combo3 || Screen->ComboD [BlockPosition] == Combo4 || Screen->ComboD [BlockPosition] == Combo5 || Screen->ComboD [BlockPosition] ==ComboDug) || (Screen->ComboS [BlockPosition] == 15 && (Screen->ComboD [BlockPosition] != ComboS1 && Screen->ComboD [BlockPosition] != ComboS2 && Screen->ComboD [BlockPosition] != ComboS3)) )
{
Game->PlaySound(6);
Quit();
}
ComboY = Link->Y - 16;
ComboX = Link->X;
float remainder = ComboX % 16;
if (remainder <= 8)
{
ComboX = ComboX - remainder;
}
else
{
ComboX = ComboX + 16 - remainder;
}
float remainderY = ComboY % 16;
if (remainderY <= 8)
{
ComboY = ComboY - remainderY;
}
else
{
ComboY = ComboY + 16 - remainderY;
}
int ComboPosition = (ComboY & 240)+(ComboX>>4);
if (Screen->ComboD [BlockPosition] == ComboS1 || Screen->ComboD [BlockPosition] == ComboS2 || Screen->ComboD [BlockPosition] == ComboS3)
{
Screen->ComboD [ComboPosition] = ComboSDug;
}
else
{
Screen->ComboD [ComboPosition] = ComboDug;
}
}
else if (Link->Dir == 1)
{
int BlockCheckY = Link->Y + 16;
int BlockCheckX = Link->X;
float BlockRmndrX = BlockCheckX % 16;
if (BlockRmndrX <= 8)
{
BlockCheckX = BlockCheckX - BlockRmndrX;
}
else
{
BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
}
float BlockRmndrY = BlockCheckY % 16;
if (BlockRmndrY <= 8)
{
BlockCheckY = BlockCheckY - BlockRmndrY;
}
else
{
BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
}
int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
if ( (Screen->ComboD [BlockPosition] == Combo1 || Screen->ComboD [BlockPosition] == Combo2 || Screen->ComboD [BlockPosition] == Combo3 || Screen->ComboD [BlockPosition] == Combo4 || Screen->ComboD [BlockPosition] == Combo5 || Screen->ComboD [BlockPosition] == ComboDug) || (Screen->ComboS [BlockPosition] == 15 && (Screen->ComboD [BlockPosition] != ComboS1 && Screen->ComboD [BlockPosition] != ComboS2 && Screen->ComboD [BlockPosition] != ComboS3)) )
{
Game->PlaySound(6);
Quit();
}
ComboY = Link->Y + 16;
ComboX = Link->X;
float remainder = ComboX % 16;
if (remainder <= 8)
{
ComboX = ComboX - remainder;
}
else
{
ComboX = ComboX + 16 - remainder;
}
float remainderY = ComboY % 16;
if (remainderY <= 8)
{
ComboY = ComboY - remainderY;
}
else
{
ComboY = ComboY + 16 - remainderY;
}
int ComboPosition = (ComboY & 240)+(ComboX>>4);
if (Screen->ComboD [BlockPosition] == ComboS1 || Screen->ComboD [BlockPosition] == ComboS2 || Screen->ComboD [BlockPosition] == ComboS3)
{
Screen->ComboD [ComboPosition] = ComboSDug;
}
else
{
Screen->ComboD [ComboPosition] = ComboDug;
}
}
else if (Link->Dir == 2)
{
int BlockCheckY = Link->Y;
int BlockCheckX = Link->X - 16;
float BlockRmndrX = BlockCheckX % 16;
if (BlockRmndrX <= 8)
{
BlockCheckX = BlockCheckX - BlockRmndrX;
}
else
{
BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
}
float BlockRmndrY = BlockCheckY % 16;
if (BlockRmndrY <= 8)
{
BlockCheckY = BlockCheckY - BlockRmndrY;
}
else
{
BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
}
int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
if ( (Screen->ComboD [BlockPosition] == Combo1 || Screen->ComboD [BlockPosition] == Combo2 || Screen->ComboD [BlockPosition] == Combo3 || Screen->ComboD [BlockPosition] == Combo4 || Screen->ComboD [BlockPosition] == Combo5 || Screen->ComboD [BlockPosition] == ComboDug) || (Screen->ComboS [BlockPosition] == 15 && (Screen->ComboD [BlockPosition] != ComboS1 && Screen->ComboD [BlockPosition] != ComboS2 && Screen->ComboD [BlockPosition] != ComboS3)) )
{
Game->PlaySound(6);
Quit();
}
ComboY = Link->Y;
ComboX = Link->X - 16;
float remainder = ComboX % 16;
if (remainder <= 8)
{
ComboX = ComboX - remainder;
}
else
{
ComboX = ComboX + 16 - remainder;
}
float remainderY = ComboY % 16;
if (remainderY <= 8)
{
ComboY = ComboY - remainderY;
}
else
{
ComboY = ComboY + 16 - remainderY;
}
int ComboPosition = (ComboY & 240)+(ComboX>>4);
if (Screen->ComboD [BlockPosition] == ComboS1 || Screen->ComboD [BlockPosition] == ComboS2 || Screen->ComboD [BlockPosition] == ComboS3)
{
Screen->ComboD [ComboPosition] = ComboSDug;
}
else
{
Screen->ComboD [ComboPosition] = ComboDug;
}
}
else if (Link->Dir == 3)
{
int BlockCheckY = Link->Y;
int BlockCheckX = Link->X + 16;
float BlockRmndrX = BlockCheckX % 16;
if (BlockRmndrX <= 8)
{
BlockCheckX = BlockCheckX - BlockRmndrX;
}
else
{
BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
}
float BlockRmndrY = BlockCheckY % 16;
if ( BlockRmndrY <= 8 )
{
BlockCheckY = BlockCheckY - BlockRmndrY;
}
else
{
BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
}
int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
if ( (Screen->ComboD [BlockPosition] == Combo1 || Screen->ComboD [BlockPosition] == Combo2 || Screen->ComboD [BlockPosition] == Combo3 || Screen->ComboD [BlockPosition] == Combo4 || Screen->ComboD [BlockPosition] == Combo5 || Screen->ComboD [BlockPosition] == ComboDug) || (Screen->ComboS [BlockPosition] == 15 && (Screen->ComboD [BlockPosition] != ComboS1 && Screen->ComboD [BlockPosition] != ComboS2 && Screen->ComboD [BlockPosition] != ComboS3)) )
{
Game->PlaySound(6);
Quit();
}
ComboY = Link->Y;
ComboX = Link->X + 16;
float remainder = ComboX % 16;
if (remainder <= 8)
{
ComboX = ComboX - remainder;
}
else
{
ComboX = ComboX + 16 - remainder;
}
float remainderY = ComboY % 16;
if (remainderY <= 8)
{
ComboY = ComboY - remainderY;
}
else
{
ComboY = ComboY + 16 - remainderY;
}
int ComboPosition = (ComboY & 240)+(ComboX>>4);
if (Screen->ComboD [BlockPosition] == ComboS1 || Screen->ComboD [BlockPosition] == ComboS2 || Screen->ComboD [BlockPosition] == ComboS3)
{
Screen->ComboD [ComboPosition] = ComboSDug;
}
else
{
Screen->ComboD [ComboPosition] = ComboDug;
}
}
Game->PlaySound(61);
}
}
Yes, it's THAT big. Anyways, change these variables to the right values for the combos you want to use:
-ComboDug is the combo that appears when you dig in normal ground.
-Combo1-Combo5 are the 5 walkable combos you CAN'T dig in.
-ComboS1-S3 are 3 combos you CAN dig in. To save space, all other Solid combos are automatically given the "no-dig" flag. (An imaginary flag, by the way. ;))
-ComboSDug is the ground that appears when you dig up a solid diggable combo. In Oracles, digging up dirt or snow made normal ground appear. This combo can be anything, though.
And there you have it. Thanks to Koopa for helping me through all this. Without Koopa... This script would've ended a few days ago. :O Also, thanks to Beta Link for requesting this script. If you hadn't asked.... I wouldn't have made. XD Enjoy, guys.
Okay, here you go. This is the Oracles Shovel!
// Shovel- Well, what do you THINK it does? :P It digs up the ground directly in front of you,
// provided it's not solid or a certain combo. The combos it can't dig up are yours to decide!
// However, I give you three solid combos it CAN dig up, so use them wisely.
// Variables:
// ComboDug- Combo that appears when you dig in a diggable spot.
// Combo1- First Combo you can't dig in.
// Combo2- 2nd Combo you can't dig in.
// Combo3- 3rd No-Dig Combo.
// Combo4- 4th No-Dig Combo.
// Combo5- 5th No-Dig Combo.
// ComboS1- First Solid Combo you can dig in.
// ComboS2- 2nd Solid Dig Combo.
// ComboS3- 3rd Solid Dig Combo.
import "std.zh"
item script Shovel
{
int ComboDug = 0;
int Combo1 = 0;
int Combo2 = 0;
int Combo3 = 0;
int Combo4 = 0;
int Combo5 = 0;
int ComboS1 = 0;
int ComboS2 = 0;
int ComboS3 = 0;
int ComboX = 0;
int ComboY = 0;
int ComboSDug = 0;
void run()
{
if (Link->Dir == 0)
{
int BlockCheckY = Link->Y - 16;
int BlockCheckX = Link->X;
float BlockRmndrX = BlockCheckX % 16;
if (BlockRmndrX <= 8)
{
BlockCheckX = BlockCheckX - BlockRmndrX;
}
else
{
BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
}
float BlockRmndrY = BlockCheckY % 16;
if (BlockRmndrY <= 8)
{
BlockCheckY = BlockCheckY - BlockRmndrY;
}
else
{
BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
}
int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
if ( (Screen->ComboD [BlockPosition] == Combo1 || Screen->ComboD [BlockPosition] == Combo2 || Screen->ComboD [BlockPosition] == Combo3 || Screen->ComboD [BlockPosition] == Combo4 || Screen->ComboD [BlockPosition] == Combo5 || Screen->ComboD [BlockPosition] ==ComboDug) || (Screen->ComboS [BlockPosition] == 15 && (Screen->ComboD [BlockPosition] != ComboS1 && Screen->ComboD [BlockPosition] != ComboS2 && Screen->ComboD [BlockPosition] != ComboS3)) )
{
Game->PlaySound(6);
Quit();
}
ComboY = Link->Y - 16;
ComboX = Link->X;
float remainder = ComboX % 16;
if (remainder <= 8)
{
ComboX = ComboX - remainder;
}
else
{
ComboX = ComboX + 16 - remainder;
}
float remainderY = ComboY % 16;
if (remainderY <= 8)
{
ComboY = ComboY - remainderY;
}
else
{
ComboY = ComboY + 16 - remainderY;
}
int ComboPosition = (ComboY & 240)+(ComboX>>4);
if (Screen->ComboD [BlockPosition] == ComboS1 || Screen->ComboD [BlockPosition] == ComboS2 || Screen->ComboD [BlockPosition] == ComboS3)
{
Screen->ComboD [ComboPosition] = ComboSDug;
}
else
{
Screen->ComboD [ComboPosition] = ComboDug;
}
}
else if (Link->Dir == 1)
{
int BlockCheckY = Link->Y + 16;
int BlockCheckX = Link->X;
float BlockRmndrX = BlockCheckX % 16;
if (BlockRmndrX <= 8)
{
BlockCheckX = BlockCheckX - BlockRmndrX;
}
else
{
BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
}
float BlockRmndrY = BlockCheckY % 16;
if (BlockRmndrY <= 8)
{
BlockCheckY = BlockCheckY - BlockRmndrY;
}
else
{
BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
}
int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
if ( (Screen->ComboD [BlockPosition] == Combo1 || Screen->ComboD [BlockPosition] == Combo2 || Screen->ComboD [BlockPosition] == Combo3 || Screen->ComboD [BlockPosition] == Combo4 || Screen->ComboD [BlockPosition] == Combo5 || Screen->ComboD [BlockPosition] == ComboDug) || (Screen->ComboS [BlockPosition] == 15 && (Screen->ComboD [BlockPosition] != ComboS1 && Screen->ComboD [BlockPosition] != ComboS2 && Screen->ComboD [BlockPosition] != ComboS3)) )
{
Game->PlaySound(6);
Quit();
}
ComboY = Link->Y + 16;
ComboX = Link->X;
float remainder = ComboX % 16;
if (remainder <= 8)
{
ComboX = ComboX - remainder;
}
else
{
ComboX = ComboX + 16 - remainder;
}
float remainderY = ComboY % 16;
if (remainderY <= 8)
{
ComboY = ComboY - remainderY;
}
else
{
ComboY = ComboY + 16 - remainderY;
}
int ComboPosition = (ComboY & 240)+(ComboX>>4);
if (Screen->ComboD [BlockPosition] == ComboS1 || Screen->ComboD [BlockPosition] == ComboS2 || Screen->ComboD [BlockPosition] == ComboS3)
{
Screen->ComboD [ComboPosition] = ComboSDug;
}
else
{
Screen->ComboD [ComboPosition] = ComboDug;
}
}
else if (Link->Dir == 2)
{
int BlockCheckY = Link->Y;
int BlockCheckX = Link->X - 16;
float BlockRmndrX = BlockCheckX % 16;
if (BlockRmndrX <= 8)
{
BlockCheckX = BlockCheckX - BlockRmndrX;
}
else
{
BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
}
float BlockRmndrY = BlockCheckY % 16;
if (BlockRmndrY <= 8)
{
BlockCheckY = BlockCheckY - BlockRmndrY;
}
else
{
BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
}
int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
if ( (Screen->ComboD [BlockPosition] == Combo1 || Screen->ComboD [BlockPosition] == Combo2 || Screen->ComboD [BlockPosition] == Combo3 || Screen->ComboD [BlockPosition] == Combo4 || Screen->ComboD [BlockPosition] == Combo5 || Screen->ComboD [BlockPosition] == ComboDug) || (Screen->ComboS [BlockPosition] == 15 && (Screen->ComboD [BlockPosition] != ComboS1 && Screen->ComboD [BlockPosition] != ComboS2 && Screen->ComboD [BlockPosition] != ComboS3)) )
{
Game->PlaySound(6);
Quit();
}
ComboY = Link->Y;
ComboX = Link->X - 16;
float remainder = ComboX % 16;
if (remainder <= 8)
{
ComboX = ComboX - remainder;
}
else
{
ComboX = ComboX + 16 - remainder;
}
float remainderY = ComboY % 16;
if (remainderY <= 8)
{
ComboY = ComboY - remainderY;
}
else
{
ComboY = ComboY + 16 - remainderY;
}
int ComboPosition = (ComboY & 240)+(ComboX>>4);
if (Screen->ComboD [BlockPosition] == ComboS1 || Screen->ComboD [BlockPosition] == ComboS2 || Screen->ComboD [BlockPosition] == ComboS3)
{
Screen->ComboD [ComboPosition] = ComboSDug;
}
else
{
Screen->ComboD [ComboPosition] = ComboDug;
}
}
else if (Link->Dir == 3)
{
int BlockCheckY = Link->Y;
int BlockCheckX = Link->X + 16;
float BlockRmndrX = BlockCheckX % 16;
if (BlockRmndrX <= 8)
{
BlockCheckX = BlockCheckX - BlockRmndrX;
}
else
{
BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
}
float BlockRmndrY = BlockCheckY % 16;
if ( BlockRmndrY <= 8 )
{
BlockCheckY = BlockCheckY - BlockRmndrY;
}
else
{
BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
}
int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
if ( (Screen->ComboD [BlockPosition] == Combo1 || Screen->ComboD [BlockPosition] == Combo2 || Screen->ComboD [BlockPosition] == Combo3 || Screen->ComboD [BlockPosition] == Combo4 || Screen->ComboD [BlockPosition] == Combo5 || Screen->ComboD [BlockPosition] == ComboDug) || (Screen->ComboS [BlockPosition] == 15 && (Screen->ComboD [BlockPosition] != ComboS1 && Screen->ComboD [BlockPosition] != ComboS2 && Screen->ComboD [BlockPosition] != ComboS3)) )
{
Game->PlaySound(6);
Quit();
}
ComboY = Link->Y;
ComboX = Link->X + 16;
float remainder = ComboX % 16;
if (remainder <= 8)
{
ComboX = ComboX - remainder;
}
else
{
ComboX = ComboX + 16 - remainder;
}
float remainderY = ComboY % 16;
if (remainderY <= 8)
{
ComboY = ComboY - remainderY;
}
else
{
ComboY = ComboY + 16 - remainderY;
}
int ComboPosition = (ComboY & 240)+(ComboX>>4);
if (Screen->ComboD [BlockPosition] == ComboS1 || Screen->ComboD [BlockPosition] == ComboS2 || Screen->ComboD [BlockPosition] == ComboS3)
{
Screen->ComboD [ComboPosition] = ComboSDug;
}
else
{
Screen->ComboD [ComboPosition] = ComboDug;
}
}
Game->PlaySound(61);
}
}
Yes, it's THAT big. Anyways, change these variables to the right values for the combos you want to use:
-ComboDug is the combo that appears when you dig in normal ground.
-Combo1-Combo5 are the 5 walkable combos you CAN'T dig in.
-ComboS1-S3 are 3 combos you CAN dig in. To save space, all other Solid combos are automatically given the "no-dig" flag. (An imaginary flag, by the way. ;))
-ComboSDug is the ground that appears when you dig up a solid diggable combo. In Oracles, digging up dirt or snow made normal ground appear. This combo can be anything, though.
And there you have it. Thanks to Koopa for helping me through all this. Without Koopa... This script would've ended a few days ago. :O Also, thanks to Beta Link for requesting this script. If you hadn't asked.... I wouldn't have made. XD Enjoy, guys.