Jump to content

Photo

Bomb Arrows.


  • Please log in to reply
20 replies to this topic

#16 Da Masta Sord

Da Masta Sord

    The Official Masta Sord of ZC.

  • Members
  • Location:In a pedastal in the lost woods.

Posted 29 April 2013 - 07:06 PM

I tried that old bomb arrows script and got this.

Encrypting...okay.
Pass 1: Parsing
Pass 2: Preprocessing
Pass 3: Building symbol tables
tmp, line 16: Error S04: Function ComboFI was already declared with that type signature.


//Input constants
const int ArrowDamage    = 2;	    //Damage for Arrow to deal. Wooden sword deals 2 damage
const int BombDamage	 = 8;	    //Damage for explosion to deal
const int ArrowSpeed    = 300;	    //Speed arrow moves at, in hundredths of pixels per frame
const int T_BOMBARROW    = 205;	    //Arrange tiles in the order 'Up,Down,Left,Right' on the tilesheet. Set up-facing bomb arrow tile here
//Variables
int UseBombArrow;
int ArrowX; int ArrowY;
//Functions
//Check inherent and regular flags at the same time
bool ComboFI(int loc,int combotype){
if(Screen->ComboF[loc] == combotype
|| Screen->ComboI[loc] == combotype) return true;
}
//Solidity Check, by Saffith
bool isSolid(int x,int y){
if(x<0 || x>255 || y<0 || y>175) return false;
int mask = 1111b;
if(x%16<<img src='http://www.purezc.com/forums/public/style_emoticons/<#EMO_DIR#>/icon_cool.gif' class='bbc_emoticon' alt='8)' /> mask &= 0011b;
else mask &= 1100b;
if(y%16<<img src='http://www.purezc.com/forums/public/style_emoticons/<#EMO_DIR#>/icon_cool.gif' class='bbc_emoticon' alt='8)' /> mask &= 0101b;
else mask &= 1010b;
int ret = Screen->ComboS[ComboAt(x,y)]&mask;
return ret != 0;
}
global script Slot_2{
    void run(){
	    while(true){
		    //Call bomb arrow functions
		    if(UseBombArrow > 0) BombArrow();
		   
	    Waitframe();
	    }
    }
    //bomb arrow functions
    void BombArrow(){
	    if(UseBombArrow == 1){
		    lweapon Arrow = Screen->CreateLWeapon(LW_ARROW);
		    int x; int y;
		    if(Link->Dir > 1) x = (Link->Dir-2)*16-8;
		    else y = Link->Dir*16-8;
		    Arrow->X = Link->X+x;
		    Arrow->Y = Link->Y+y;
		    Arrow->Dir = Link->Dir;
		    Arrow->Tile = T_BOMBARROW;
		    Arrow->Tile += Link->Dir;
		   
		    Arrow->Damage = ArrowDamage;
		    Arrow->Step = ArrowSpeed;
		    Game->PlaySound(SFX_ARROW);
		    Link->Action = LA_ATTACKING;
		    UseBombArrow++;
	    }else{
		    lweapon Arrow;
		    bool Found;
		    for(int i=1;i<=Screen->NumLWeapons();i++){
			    Arrow = Screen->LoadLWeapon(i);
			    if(Arrow->ID != LW_ARROW) continue;
			    Found = true;
		    }
		    if(Found){
			    ArrowX = Arrow->X;
			    ArrowY = Arrow->Y;
			    for(int j=-4;j<=4;j+=4){
				    for(int k=-4;k<=4;k+=4){
					    if(isSolid(Arrow->X+8+j,Arrow->Y+8+k)
					    || ComboFI(ComboAt(Arrow->X+8+j,Arrow->Y+8+k),CF_BOMB)) Arrow->DeadState = 0;
				    }
			    }
		    }else{
			    lweapon Exp = Screen->CreateLWeapon(LW_BOMBBLAST);
			    Exp->Damage = BombDamage;
			    Exp->X = ArrowX;
			    Exp->Y = ArrowY;
			    UseBombArrow = 0;
		    }
	    }
    }
}
item script BombArrows{
    void run(){
	    if(Game->Counter[CR_BOMBS] > 0 && Game->Counter[CR_ARROWS] > 0 && UseBombArrow == 0){
		    UseBombArrow++;
		    Game->Counter[CR_BOMBS]--;
		    Game->Counter[CR_ARROWS]--;
	    }
    }
}



#17 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 29 April 2013 - 07:11 PM

Delete this part:

//Check inherent and regular flags at the same time

bool ComboFI(int loc,int combotype){

if(Screen->ComboF[loc] == combotype

|| Screen->ComboI[loc] == combotype) return true;

}



#18 Da Masta Sord

Da Masta Sord

    The Official Masta Sord of ZC.

  • Members
  • Location:In a pedastal in the lost woods.

Posted 29 April 2013 - 08:59 PM

I did everything it said but Link drops a bomb and just shoots normal arrows.

#19 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 29 April 2013 - 10:06 PM

What item class is your bomb arrow item? It should be a Custom Item ## or z### class.

#20 Da Masta Sord

Da Masta Sord

    The Official Masta Sord of ZC.

  • Members
  • Location:In a pedastal in the lost woods.

Posted 30 April 2013 - 05:01 PM

Custom item class 1

#21 Da Masta Sord

Da Masta Sord

    The Official Masta Sord of ZC.

  • Members
  • Location:In a pedastal in the lost woods.

Posted 05 May 2013 - 03:56 PM

I put them on the subscreen and they work!


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users