Jump to content

Photo

oh gleeok =) about your flamethrower...


  • Please log in to reply
8 replies to this topic

#1 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 17 May 2008 - 07:19 PM

i got to thinking about it, and im probably going to use it in my quest, as a really powerful item, and probably one of the last.

so, i want to ask if you could add a part to it for me. i have changed my fire sprites to darkness and named this the "shadow wave" but i need it to take away a quarter heart every 5 seconds it is in use.

and also, could you make it to where link can still move, but he cant change direction while using it?

(if it helps, im not going to use the "can select B button item" rule)

could you do this for me?

#2 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 17 May 2008 - 07:32 PM

This is pretty close. Right now we can't write to Link->Dir, so that would require bitwise and walkability stuff, and I'm engaged in some other stuff atm, so this will have to hold you over.



CODE

int fire3;




global script global_2{

    void run(){

        int attack_delay;
int drain;
        while(true){

            Waitframe();

            int lx = Link->X; int ly = Link->Y;

            if(attack_delay>0)attack_delay--;
            if(Link->InputB && fire3>0 && Link->HP>1){

        Link->InputUp = false;
        Link->InputDown = false;
        Link->InputLeft = false;
        Link->InputRight = false;

                if(attack_delay==0){
                    attack_delay = 6;

                    lweapon laser = Screen->CreateLWeapon(WPN_FIRE);
                    
                    if(Link->Dir==0){laser->Dir=0;laser->X=lx;laser->Y=ly-16;}
                    else if(Link->Dir==1){laser->Dir=1;laser->X=lx;laser->Y=ly+16;}
                    else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly;}
                    else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly;}
                    laser->Step=2;
                    laser->Damage=2;
                    laser->CSet=8;
                    Game->PlaySound(13);
            if(drain>0)drain--;
else{Link->HP--;drain=7;}
                }
            }
            else fire3=0;
        }
    }
}

item script flamethrower_item{
    void run(){
        fire3=3;
    }
}



..fixd the hp thing.

Edited by Gleeok, 17 May 2008 - 07:36 PM.


#3 Joe123

Joe123

    Retired

  • Members

Posted 17 May 2008 - 07:35 PM

Since when can we not write to Link->Dir?

#4 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 17 May 2008 - 07:37 PM

Since;

int Dir
* The direction Link is facing. Use the DIR_ constants in std.zh to set
* or compare this variable. Note: even though Link can move diagonally if the
* quest allows it, his sprite doesn't ever use any of the diagonal directions,
* which are intended for enemies only.
* The effects of writing to this variable are undefined.

I guess.

#5 Joe123

Joe123

    Retired

  • Members

Posted 17 May 2008 - 07:42 PM

Eh, I just ignore those things and it usually works ok.

Try writing to it and see what happens, I'm sure I've done it before.

I think it works when you don't have diagonal movement on.

#6 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 17 May 2008 - 07:58 PM

QUOTE(Gleeok @ May 17 2008, 05:32 PM) View Post

This is pretty close. Right now we can't write to Link->Dir, so that would require bitwise and walkability stuff, and I'm engaged in some other stuff atm, so this will have to hold you over.
CODE

int fire3;int linkdir;
global script global_2{

    void run(){

        int attack_delay;
int drain;
        while(true){

            Waitframe();

            int lx = Link->X; int ly = Link->Y;

            if(attack_delay>0)attack_delay--;
            if(Link->InputB && fire3>0 && Link->HP>1){
Link->Dir=linkdir;
        //Link->InputUp = false;
        //Link->InputDown = false;
        //Link->InputLeft = false;
        //Link->InputRight = false;

                if(attack_delay==0){
                    attack_delay = 6;

                    lweapon laser = Screen->CreateLWeapon(WPN_FIRE);
                    
                    if(Link->Dir==0){laser->Dir=0;laser->X=lx;laser->Y=ly-16;}
                    else if(Link->Dir==1){laser->Dir=1;laser->X=lx;laser->Y=ly+16;}
                    else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly;}
                    else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly;}
                    laser->Step=2;
                    laser->Damage=2;
                    laser->CSet=8;
                    Game->PlaySound(13);
            if(drain>0)drain--;
else{Link->HP--;drain=7;}
                }
            }
            else fire3=0;
        }
    }
}

item script flamethrower_item{
    void run(){
        fire3=3;linkdir=Link->Dir;
    }
}



..fixd the hp thing.



alright if so, this might work.

#7 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 17 May 2008 - 08:10 PM

no, it doesn't work properly. link stays in the same spot, but he can turn while using the item. the fire doesn't change direction, and he still can't move. if you release a direction button, then he returns to facing the position he was when he started firing the beam.

#8 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 18 May 2008 - 01:57 PM

Just use the other one right now. You can always add in more stuff later.

Oh, alright...Whered it go.....
....
...

CODE

int fire3;




global script global_2{

    void run(){

        int attack_delay;
int drain;
        while(true){

            Waitframe();

            int lx = Link->X; int ly = Link->Y;

            if(attack_delay>0)attack_delay--;
            if(Link->InputB && fire3>0 && Link->HP>1){

        if((Link->InputUp)&&
        (canMove(Link->X, Link->Y-2))&&
        (canMove(Link->X+8, Link->Y-2))&&
        (canMove(Link->X+15, Link->Y-2))){
            Link->Y--;
        }
        else if((Link->InputDown)&&
        (canMove(Link->X, Link->Y+17))&&
        (canMove(Link->X+8, Link->Y+17))&&
        (canMove(Link->X+15, Link->Y+17))
        ){
            Link->Y++;
        }
        else if((Link->InputLeft)&&
        (canMove(Link->X-2, Link->Y+8))&&
        (canMove(Link->X-2, Link->Y+15))
        ){
            Link->X--;
        }
        else if((Link->InputRight)&&

        (canMove(Link->X+17, Link->Y+8))&&
        (canMove(Link->X+17, Link->Y+15))
        ){
            Link->X++;
        }



        Link->InputUp = false;
        Link->InputDown = false;
        Link->InputLeft = false;
        Link->InputRight = false;

                if(attack_delay==0){
                    attack_delay = 6;

                    lweapon laser = Screen->CreateLWeapon(WPN_FIRE);
                    
                    if(Link->Dir==0){laser->Dir=0;laser->X=lx;laser->Y=ly-16;}
                    else if(Link->Dir==1){laser->Dir=1;laser->X=lx;laser->Y=ly+16;}
                    else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly;}
                    else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly;}
                    laser->Step=2;
                    laser->Damage=2;
                    laser->CSet=8;
                    Game->PlaySound(13);
            if(drain>0)drain--;
else{Link->HP--;drain=7;}
                }
            }
            else fire3=0;
        }
    }
    bool canMove(int x, int y){

        // x=23, y=130
        // Obviously in range...
        if(x<0 || x>255 || y<0 || y>175)
            return false;
        int mask=1111b;
        
        // x % 16 = 7, so
        // mask = 1111 & 0011 = 0011
        if(x%16<8)
            mask&=0011b;
        else
            mask&=1100b;
        
        // y % 16 = 2, so
        // mask = 0011 & 0101 = 0001
        if(y%16<8)
            mask&=0101b;
        else
            mask&=1010b;
    
        // All but the top-right quarter of the combo is solid, so ComboS = 1011
        // mask & ComboS = 0001 & 1011 = 0001
        // The result wasn't 0, so return false
        return ((Screen->ComboS[ComboAt(x, y)]&mask)==0);
     }

}

item script flamethrower_item{
    void run(){
        fire3=3;
    }
}


Man you are needy. icon_razz.gif

Edited by Gleeok, 18 May 2008 - 01:58 PM.


#9 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 18 May 2008 - 08:46 PM

lol i'm sorry gleeok. i just thought it was a cool idea. thanks =) i owe you one lol


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users