CODE
//Constants//
const int F_PICKUP = 0; //flag to set when you pick up a rock or bush
const int CMB_POTS = 0; //Combo of a rock
const int CMB_BUSH = 0; //Combo of a bush
const int T_PICKUP = 0; // First tile of your link pick up graphics in the order of up;down;left,and right
const int SFX_PICKUP = 0; //SFX to use when you pick up a pot
const int SFX_THROW = 0; //SFX to use when you throw an object
const int Pickupframes = 0;//number of frames link uses to use when rock is picked up
const int CMB_UNDERBUSH = 0;//undercombo of the bush
const int CMB_UNDERPOT = 0;//under combo of the pot
//checks for both flags and inherent flags
bool ComboFI(int x,int y,int combotype){
if(Screen->ComboF[ComboAt(x,y)] == combotype
|| Screen->ComboI[COmboAt(x,y)] == combotype) return true;
}
//Global Variables//
bool hit;
bool hold;
global script Slot_2{
void run(){
while(true){
//call the pickup functions
if(hit && hold) Pickup();
Waitframe();
}
}
}
//Pickup Functions
void Pickup(){
int xx = 0;
int yy = 0;
int this_dam = 0;
int under;
int dam_1;
int dam_2;
int dam_3;
int x = Link->X;
int y = Link->Y;
if(Link->Dir == 0){
xx = Link->X;
yy = Link->Y-8;
}
if(Link->Dir == 1){
xx == Link->X;
yy == Link->Y+16;
}
if(Link->Dir == 2){
xx == Link->X-16;
yy == Link->Y;
}
if(Link->Dir == 3){
xx == Link->X+16;
yy == Link->Y;
}
if(Link->InputR && ComboFI(Link->X+8,Link->Y+8,F_PICKUP
&& can_lift(xx,yy) > 0 && hold == false)){
Game->PlaySound(SFX_PICKUP);
Screen->DrawTile(3,x,y,T_PICKUP+(Floor(Pickupframes),1,1,6,1,0,0,0,0,true,128);
Link->Action = LA_DROWNING;
Link->HP=Link->MaxHP;
Waitdraw();
if (can_lift(xx,yy) == 1) {this_dam = dam_1;}
if (can_lift(xx,yy) == 2) {this_dam = dam_2;}
if (can_lift(xx,yy) == 3) {this_dam = dam_3;}
//shape of the pot or bush
Screen->ComboD[ComboAt(xx,yy)] + 20;
Screen->ComboC[ComboAt(xx,yy)];
//Changes pot or bush to undercombo
Screen->ComboD[ComboAt(xx,yy)] = CMB_UNDERPOT;
//Changes Rock to undercombo
Screen->ComboD[ComboAt(xx,yy)] = CMB_UNDERBUSH;
//Sets flag to tell Link is holding rock
hold = true;
while(Link->InputR) { Waitframe(); }
}
if (hold == true) {
//moves pot to above Link's head
CMB_POTs = Link->X;
CMB_POTS = Link->Y-12;
}
if(hold == true){
//moves bush to above Link's head
CMB_BUSH = Link->X;
CMB_BUSH = Link->Y-12;
}
}
}
}
}
const int F_PICKUP = 0; //flag to set when you pick up a rock or bush
const int CMB_POTS = 0; //Combo of a rock
const int CMB_BUSH = 0; //Combo of a bush
const int T_PICKUP = 0; // First tile of your link pick up graphics in the order of up;down;left,and right
const int SFX_PICKUP = 0; //SFX to use when you pick up a pot
const int SFX_THROW = 0; //SFX to use when you throw an object
const int Pickupframes = 0;//number of frames link uses to use when rock is picked up
const int CMB_UNDERBUSH = 0;//undercombo of the bush
const int CMB_UNDERPOT = 0;//under combo of the pot
//checks for both flags and inherent flags
bool ComboFI(int x,int y,int combotype){
if(Screen->ComboF[ComboAt(x,y)] == combotype
|| Screen->ComboI[COmboAt(x,y)] == combotype) return true;
}
//Global Variables//
bool hit;
bool hold;
global script Slot_2{
void run(){
while(true){
//call the pickup functions
if(hit && hold) Pickup();
Waitframe();
}
}
}
//Pickup Functions
void Pickup(){
int xx = 0;
int yy = 0;
int this_dam = 0;
int under;
int dam_1;
int dam_2;
int dam_3;
int x = Link->X;
int y = Link->Y;
if(Link->Dir == 0){
xx = Link->X;
yy = Link->Y-8;
}
if(Link->Dir == 1){
xx == Link->X;
yy == Link->Y+16;
}
if(Link->Dir == 2){
xx == Link->X-16;
yy == Link->Y;
}
if(Link->Dir == 3){
xx == Link->X+16;
yy == Link->Y;
}
if(Link->InputR && ComboFI(Link->X+8,Link->Y+8,F_PICKUP
&& can_lift(xx,yy) > 0 && hold == false)){
Game->PlaySound(SFX_PICKUP);
Screen->DrawTile(3,x,y,T_PICKUP+(Floor(Pickupframes),1,1,6,1,0,0,0,0,true,128);
Link->Action = LA_DROWNING;
Link->HP=Link->MaxHP;
Waitdraw();
if (can_lift(xx,yy) == 1) {this_dam = dam_1;}
if (can_lift(xx,yy) == 2) {this_dam = dam_2;}
if (can_lift(xx,yy) == 3) {this_dam = dam_3;}
//shape of the pot or bush
Screen->ComboD[ComboAt(xx,yy)] + 20;
Screen->ComboC[ComboAt(xx,yy)];
//Changes pot or bush to undercombo
Screen->ComboD[ComboAt(xx,yy)] = CMB_UNDERPOT;
//Changes Rock to undercombo
Screen->ComboD[ComboAt(xx,yy)] = CMB_UNDERBUSH;
//Sets flag to tell Link is holding rock
hold = true;
while(Link->InputR) { Waitframe(); }
}
if (hold == true) {
//moves pot to above Link's head
CMB_POTs = Link->X;
CMB_POTS = Link->Y-12;
}
if(hold == true){
//moves bush to above Link's head
CMB_BUSH = Link->X;
CMB_BUSH = Link->Y-12;
}
}
}
}
}
this is what i have right now..im having trouble adding the throwing though
can someone help out to do the math when you throw the object at the enemies???
i failed all 4 years of math in high school it'll be awesome if someone can help