Jump to content

Photo

Can someone help me fix this script


  • Please log in to reply
5 replies to this topic

#1 Purplemandown

Purplemandown

    The Old Guard

  • Members
  • Real Name:Nathan
  • Location:Milwaukee, WI

Posted 01 April 2009 - 09:05 PM

I found this on AGN a while back (with some other scripts that worked) and I liked this one. I know it is for an older beta, and that is why I need help. If someone could figure out why this won't compile and help me get it to work, I'd be very gratefull.

CODE
//FFC Script CustomCombo
//Custom Combo Types
//0 - None
//1 - CustomDamage (Damage Amount, Prevention Item, NA, NA)
//2 - Status Tiles (Effect, NA, NA, NA)
//3 - One Way Conveyor (Direction, NA, NA, NA)
//4 - SpringTiles (Spring Force, NA, NA, NA)
//5 - Walk Near-Draw Tile (Tile Num, Tile Layer, Tile CSet, Tile Transparency)
//6 - Slippery Ice (NA, NA, NA, NA)
//7 - Modify Endurance (Amount, Bar Tiles, Bar Color, No Endure Damage)
//8 - Warp Tiles (DMap, Screen, NA, NA)
//9 - Button Tiles (New Tiles, Target FFC, NA, NA)
ffc script CustomCombo {
    void run(int replaceCombo, int customType, int ignoreZ, int varOne, int varTwo, int varThree, int varFour) {
        int comboPos = 0;
        int comboFlag = -1;
        int effectDelay = 0;
        while (true)
        {
            comboPos = ComboAt(Link->X + 8, Link->Y + 8);
            if (Screen->ComboD[comboPos] == replaceCombo && customType != 5)
            {
                if (customType == 1)
                {
                    int currLevel = Game->GetCurDMap();
                    bool causeDamage = true;
                    if (ignoreZ == 0 && Link->Z != 0)
                    {
                        causeDamage = false;
                    }
                    else if (varTwo == I_MAP)
                    {
                        if ((Game->LItems[currLevel] & 2) == 2)
                        {
                            causeDamage = false;
                        }
                    }
                    else if (varTwo ==  I_COMPASS)
                    {
                        if ((Game->LItems[currLevel] & 4) == 4)
                        {
                            causeDamage = false;
                        }
                    }
                    else if (varTwo ==  I_BOSSKEY)
                    {
                        if ((Game->LItems[currLevel] & 16) == 16)
                        {
                            causeDamage = false;
                        }
                    }
                    else if (Link->Item[varTwo])
                    {
                        causeDamage = false;
                    }
                    if (causeDamage && effectDelay == 0)
                    {
                        Link->HP-=varOne;
                        Link->Action = LA_GOTHURTLAND;
                        Game->PlaySound(SFX_OUCH);
                        effectDelay = 90;
                    }
                }
                else if (customType == 2)
                {
                    if (ignoreZ != 0 || Link->Z == 0)
                    {
                        //Status Effects
                        //0 = Temporary Sword Loss
                        //1 = Lose Sword
                        //2 = Regain Sword
                        //3 = Temporary Item Loss
                        //4 = Lose Items
                        //5 = Regain Items
                        //6 = Temporary All Loss
                        //7 = Lose All
                        //8 = Regain All
                        //9 = Become Drunk
                        //10 = Become Sober
                        if (varOne == 0 || varOne == 6)
                        {
                            Link->SwordJinx = 300;
                        }
                        else if (varOne == 1 || varOne == 7)
                        {
                            Link->SwordJinx = -1;
                        }
                        else if (varOne == 2 || varOne == 8)
                        {
                            Link->SwordJinx = 0;
                        }
                        if (varOne == 3 || varOne == 6)
                        {
                            Link->ItemJinx = 300;
                        }
                        else if (varOne == 4 || varOne == 7)
                        {
                            Link->ItemJinx = -1;
                        }
                        else if (varOne == 5 || varOne == 8)
                        {
                            Link->ItemJinx = 0;
                        }
                        if (varOne == 9 && Link->Drunk == 0)
                        {
                            Link->Drunk = 900;
                        }
                        else if (varOne == 10)
                        {
                            Link->Drunk = 0;
                        }
                    }
                }
                else if (customType == 3)
                {
                    if (ignoreZ != 0 || Link->Z == 0)
                    {
                        if (varOne == DIR_UP)
                        {
                            if (is_walkable(Link->X, Link->Y + 7) && is_walkable(Link->X + 15, Link->Y + 7))
                            {
                                Link->Y--;
                            }
                        }
                        else if (varOne == DIR_DOWN)
                        {
                            if (is_walkable(Link->X, Link->Y + 17) && is_walkable(Link->X + 15, Link->Y + 17))
                            {
                                Link->Y++;
                            }
                        }
                        else if (varOne == DIR_LEFT)
                        {
                            if (is_walkable(Link->X - 1, Link->Y + 8) && is_walkable(Link->X - 1, Link->Y + 15))
                            {
                                Link->X--;
                            }
                        }
                        else if (varOne == DIR_RIGHT)
                        {
                            if (is_walkable(Link->X + 17, Link->Y + 8) && is_walkable(Link->X + 17, Link->Y + 15))
                            {
                                Link->X++;
                            }
                        }
                    }
                }
                else if (customType == 4)
                {
                    if (ignoreZ != 0 || Link->Z == 0)
                    {
                        if (Link->Z == 0)
                        {
                            Link->Jump = varOne;
                            Game->PlaySound(SFX_JUMP);
                        }
                        else if (Link->Jump < 0)
                        {
                            Link->Jump = 1;
                        }
                    }
                }
                else if (customType == 6)
                {
                    if (ignoreZ != 0 || Link->Z == 0)
                    {
                        if (comboFlag == -1)
                        {
                            if (Link->Dir < 4)
                            {
                                comboFlag = Link->Dir;
                            }
                        }
                        else if (comboFlag < 4)
                        {
                            for (int loopIndex = 0; loopIndex < 2; loopIndex++)
                            {
                                if (comboFlag == DIR_UP)
                                {
                                    if (is_walkable(Link->X, Link->Y + 7) && is_walkable(Link->X + 15, Link->Y + 7))
                                        {
                                        Link->Y--;
                                    }
                                    else
                                    {
                                        comboFlag = 4;
                                    }
                                }
                                else if (comboFlag == DIR_DOWN)
                                {
                                    if (is_walkable(Link->X, Link->Y + 17) && is_walkable(Link->X + 15, Link->Y + 17))
                                    {
                                        Link->Y++;
                                    }
                                    else
                                    {
                                        comboFlag = 4;
                                    }
                                }
                                else if (comboFlag == DIR_LEFT)
                                {
                                    if (is_walkable(Link->X - 1, Link->Y + 8) && is_walkable(Link->X - 1, Link->Y + 15))
                                    {
                                        Link->X--;
                                    }
                                    else
                                    {
                                        comboFlag = 4;
                                    }
                                }
                                else if (comboFlag == DIR_RIGHT)
                                {
                                    if (is_walkable(Link->X + 17, Link->Y + 8) && is_walkable(Link->X + 17, Link->Y + 15))
                                    {
                                        Link->X++;
                                    }
                                    else
                                    {
                                        comboFlag = 4;
                                    }
                                }
                            }
                            if (Link->InputUp)
                            {
                                Link->Dir = DIR_UP;
                            }
                            else if (Link->InputDown)
                            {
                                Link->Dir = DIR_DOWN;
                            }
                            if (Link->InputLeft)
                            {
                                Link->Dir = DIR_LEFT;
                            }
                            else if (Link->InputRight)
                            {
                                Link->Dir = DIR_RIGHT;
                            }
                            Link->InputUp = false;
                            Link->InputDown = false;
                            Link->InputLeft = false;
                            Link->InputRight = false;
                        }
                        else
                        {
                            if (Link->InputUp)
                            {
                                comboFlag = DIR_UP;
                                if (Link->X % 8 != 0)
                                {
                                    if (Link->X % 8 < 4)
                                    {
                                        Link->X-=(Link->X % 8);
                                    }
                                    else
                                    {
                                        Link->X+=(8 - (Link->X % 8));
                                    }
                                }
                            }
                            else if (Link->InputDown)
                            {
                                comboFlag = DIR_DOWN;
                                if (Link->X % 8 != 0)
                                {
                                    if (Link->X % 8 < 4)
                                    {
                                        Link->X-=(Link->X % 8);
                                    }
                                    else
                                    {
                                        Link->X+=(8 - (Link->X % 8));
                                    }
                                }
                            }
                            if (Link->InputLeft)
                            {
                                comboFlag = DIR_LEFT;
                                if (Link->Y % 8 != 0)
                                {
                                    if (Link->Y % 8 < 4)
                                    {
                                        Link->Y-=(Link->Y % 8);
                                    }
                                    else
                                    {
                                        Link->Y+=(8 - (Link->Y % 8));
                                    }
                                }
                            }
                            else if (Link->InputRight)
                            {
                                comboFlag = DIR_RIGHT;
                                if (Link->Y % 8 != 0)
                                {
                                    if (Link->Y % 8 < 4)
                                    {
                                        Link->Y-=(Link->Y % 8);
                                    }
                                    else
                                    {
                                        Link->Y+=(8 - (Link->Y % 8));
                                    }
                                }
                            }
                        }
                    }
                }
                else if (customType == 7)
                {
                    if (effectDelay <= 0)
                    {
                        if (currEndurance == 0 && varOne < 0)
                        {
                            Link->HP-=varFour;
                            Link->Action = LA_GOTHURTLAND;
                            Game->PlaySound(SFX_OUCH);
                            effectDelay = 60;
                        }
                        currEndurance+=varOne;
                        if (currEndurance > maxEndurance)
                        {
                            currEndurance = maxEndurance;
                        }
                        if (currEndurance < 0)
                        {
                            currEndurance = 0;
                        }
                        effectDelay = 30;
                    }
                    else
                    {
                        effectDelay--;
                    }
                }
                else if (customType == 8)
                {
                    if (ignoreZ != 0 || Link->Z == 0)
                    {
                        Link->PitWarp(varOne, varTwo);
                    }
                }
                else if (customType == 9)
                {
                    if (ignoreZ != 0 || Link->Z == 0)
                    {
                        for (int loopIndex = 0; loopIndex < 176; loopIndex++)
                        {
                            if (Screen->ComboD[loopIndex] == replaceCombo)
                            {
                                Screen->ComboD[loopIndex] = varOne;
                            }
                        }
                        if (varTwo > 0 && varTwo < 32)
                        {
                            ffc targetFFC = Screen->LoadFFC(varTwo);
                            targetFFC->CSet = 0;
                        }
                        this->Data = 0;
                        Quit();
more below

Edited by Purplemandown, 01 April 2009 - 09:09 PM.


#2 Purplemandown

Purplemandown

    The Old Guard

  • Members
  • Real Name:Nathan
  • Location:Milwaukee, WI

Posted 01 April 2009 - 09:11 PM

CODE
                    }
                }
            }
            else
            {
                comboFlag = -1;
                effectDelay = 0;
            }
            if (customType == 1 && effectDelay > 0)
            {
                effectDelay--;
            }
            if (customType == 5)
            {
                int comboX = (comboPos % 16) * 16;
                int comboY = comboPos - (comboPos % 16);
                if (Screen->ComboD[comboPos] == replaceCombo)
                {
                    Screen->DrawTile(varTwo, comboX, comboY, varOne, 1, 1, varThree, 1, 0, 0, 0, 0, 1, varFour);
                }
                if (comboX > 0)
                {
                    if (Screen->ComboD[comboPos - 1] == replaceCombo)
                    {
                        Screen->DrawTile(varTwo, comboX - 16, comboY, varOne, 1, 1, varThree, 1, 0, 0, 0, 0, 1, varFour);
                    }
                    if (comboY > 0 && Screen->ComboD[comboPos - 17] == replaceCombo)
                    {
                        Screen->DrawTile(varTwo, comboX - 16, comboY - 16, varOne, 1, 1, varThree, 1, 0, 0, 0, 0, 1, varFour);
                    }
                    if (comboY < 160 && Screen->ComboD[comboPos + 15] == replaceCombo)
                    {
                        Screen->DrawTile(varTwo, comboX - 16, comboY + 16, varOne, 1, 1, varThree, 1, 0, 0, 0, 0, 1, varFour);
                    }
                }
                if (comboX < 240)
                {
                    if (Screen->ComboD[comboPos + 1] == replaceCombo)
                    {
                        Screen->DrawTile(varTwo, comboX + 16, comboY, varOne, 1, 1, varThree, 1, 0, 0, 0, 0, 1, varFour);
                    }
                    if (comboY > 0 && Screen->ComboD[comboPos - 15] == replaceCombo)
                    {
                        Screen->DrawTile(varTwo, comboX + 16, comboY - 16, varOne, 1, 1, varThree, 1, 0, 0, 0, 0, 1, varFour);
                    }
                    if (comboY < 160 && Screen->ComboD[comboPos + 17] == replaceCombo)
                    {
                        Screen->DrawTile(varTwo, comboX + 16, comboY + 16, varOne, 1, 1, varThree, 1, 0, 0, 0, 0, 1, varFour);
                    }
                }
                if (comboY > 0 && Screen->ComboD[comboPos - 16] == replaceCombo)
                {
                    Screen->DrawTile(varTwo, comboX, comboY - 16, varOne, 1, 1, varThree, 1, 0, 0, 0, 0, 1, varFour);
                }
                if (comboY < 160 && Screen->ComboD[comboPos + 16] == replaceCombo)
                {
                    Screen->DrawTile(varTwo, comboX, comboY + 16, varOne, 1, 1, varThree, 1, 0, 0, 0, 0, 1, varFour);
                }
            }
            else if (customType == 7 && varTwo > 0)
            {
                int drawOffset = ((currEndurance * 40) / maxEndurance) + 9;
                if (currEndurance > 0)
                {
                    Screen->Rectangle(5, 9, 3, drawOffset, 6, varThree, 1, 0, 0, 0, 1, 128);
                }
                Screen->DrawTile(5, 0, 0, varTwo, 4, 1, 2, 1, 0, 0, 0, 0, 1, 128);
            }
            Waitframe();
        }
    }
    bool is_walkable(int checkX, int checkY)
    {
        int targetLoc = 0;
        if(checkX < 0 || checkX > 240 || checkY < 0 || checkY > 160)
        {
            return false;
        }
        targetLoc = ((checkX - (checkX % 16)) / 16) + (checkY - (checkY % 16));
        return Screen->ComboS[targetLoc] == 0;
    }
}


Thanks Again!!! (heh heh...) icon_sweat.gif icon_unsettled.gif

#3 Plissken

Plissken

    What's with these homies dissing our girls?

  • Members

Posted 01 April 2009 - 09:13 PM

First off, I'm guessing there's more to this script, cause I'm missing variable declarations and functions all over the place. The main thing I can see is you need to more '}' at the end of the code and get rid of the &nbs I think, I don't know what that's doing there.

Posted that while you were posting second post, gimme another minute to look at all of it. Ok, yeah there's variables outside of the script, I'm guessing at the top of the .z file. Mind uploading the entire .z file?

Edited by Plissken, 01 April 2009 - 09:16 PM.


#4 Purplemandown

Purplemandown

    The Old Guard

  • Members
  • Real Name:Nathan
  • Location:Milwaukee, WI

Posted 01 April 2009 - 09:30 PM

CODE
import “std.zh”

item script Message{
    void run(int m){
        Screen->Message(m);
    }
}
const int bombchuflag = 98; //Flag the bombchu can pass through (even if solid)

bool bombchuattack;
bool isSolid(int x,int y){
if(x<0 || x>255 || y<0 || y>175) return false;
int mask=1111b;
if(x%16<8) mask&=0011b;
else mask&=1100b;
if(y%16<8) mask&=0101b;
else mask&=1010b;
return (!(Screen->ComboS[ComboAt(x,y)]&mask)==0);
}

bool bombchucheck(int x, int y){
    if((isSolid(x,y) && Screen->ComboF[ComboAt(x,y)] != bombchuflag && Screen->ComboI[ComboAt(x,y)] != bombchuflag)
     || (Screen->ComboF[ComboAt(x,y)] == 6 || Screen->ComboI[ComboAt(x,y)] == 6 ||Screen->ComboF[ComboAt(x,y)] == 11 || Screen->ComboI[ComboAt(x,y)] == 11)) return true;
}

void noaction(){
    Link->InputR = false;
    Link->InputL = false;
    Link->InputA = false;
    Link->InputB = false;
    Link->InputUp = false;
    Link->InputDown = false;
    Link->InputRight = false;
    Link->InputLeft = false;
}
global script slot_2{
    void run(){
    int lastDir;
    int bombchutile = 46762; //Set the tile for your weapon here. Up, Down, Left, Right it should be on the tilepage.
    int bombchuframes = 2; //Set the number of animation frames here.
    int bombchuaspeed = 10;//Set the animation speed here
    int bombchucset = 8; //Set the CSet here
    
    int bombchudmg = 2;  //Set the damage here
    int bombchuspeed = 1; //Set the speed of the bombchu here

    int HP;
    int bdir;
    int bombchux; int bombchuy;
    lweapon explosion;

        while(true){
            if(bombchuattack){
                if(Link->X > 15 && Link->X < 241 && Link->Y > 15 && Link->Y < 153){
                lweapon bombchu = Screen->CreateLWeapon(31);
                    bdir = Link->Dir;
                    bombchu->OriginalTile = bombchutile+(bdir*bombchuframes);
                    bombchu->Tile = bombchutile+(bdir*bombchuframes);
                    bombchu->NumFrames = bombchuframes;
                    bombchu->ASpeed = bombchuaspeed;
                    bombchu->CSet = bombchucset;
                    bombchux = 0; bombchuy = 0;
                    if(bdir>1) bombchux = (((bdir-2)*2)-1)*16;
                    if(bdir<2) bombchuy = ((bdir*2)-1)*16;
                    bombchu->X = Link->X+bombchux;
                    bombchu->Y = Link->Y+bombchuy;
                    bombchu->Step = bombchuspeed;
                    Link->Action = LA_ATTACKING;
                    Game->Counter[6]--;
                    Waitframe();

                    while(bombchu->isValid()){
                        HP = Link->HP;
                        if(Link->InputUp) bdir = 0;
                        if(Link->InputDown) bdir = 1;
                        if(Link->InputLeft) bdir = 2;
                        if(Link->InputRight) bdir = 3;
                        if(bdir == 0 && bombchucheck(bombchu->X+8,bombchu->Y+4)
                        || (bdir == 1 && bombchucheck(bombchu->X+8,bombchu->Y+12))
                        || (bdir == 2 && bombchucheck(bombchu->X+4,bombchu->Y+8))
                        || (bdir == 3 && bombchucheck(bombchu->X+12,bombchu->Y+8))) bombchu->DeadState = 0;
                        bombchu->Dir = bdir;
                        bombchu->Tile = bombchutile+(bdir*bombchuframes);
                        bombchu->OriginalTile = bombchutile+(bdir*bombchuframes);
                    bombchux = bombchu->X;
                    bombchuy = bombchu->Y;
                    noaction();
                    Waitframe();
                    if(Link->HP < HP) bombchu->DeadState = 0;
                    }
                
                    explosion = Screen->CreateLWeapon(LW_SBOMB);
                    explosion->Damage = bombchudmg;
                    explosion->X = bombchux;
                    explosion->Y = bombchuy;
                }else{
                    bdir = Link->Dir;
                    bombchux = 0; bombchuy = 0;
                    if(bdir>1) bombchux = (((bdir-2)*2)-1)*16;
                    if(bdir<2) bombchuy = ((bdir*2)-1)*16;
                    explosion = Screen->CreateLWeapon(LW_SBOMB);
                    explosion->X = Link->X+bombchux;
                    explosion->Y = Link->Y+bombchuy;
                    explosion->Damage = bombchudmg;
                }
            Link->Action = 0;
            bombchuattack = false;
            }
            lastDir = Link->Dir;
        Waitdraw();
        if(Link->InputL) Link->Dir = lastDir;
        Waitframe();
        }
    }
}

global script slot_3{
    void run(){
        bombchuattack = false;
    }
}

item script bombchu{
    void run(){
        if(Game->Counter[6] > 0) bombchuattack = true;
    }
}

//Ledge
//Link will jump off the ledge only when in the specified direction
//D0: All acceptable directions in a masked format:
//Up = 1;
//Down = 2;
//Left = 4;
//Right = 8;
//D1: Minimum direction hold time
//D2: Sound to be played when hopping the ledge
//All other properties are absorbed from the ffc, namely EffectHeight and EffectWidth
const float GRAV=.16; //Insert your game's gravity constant here. (.16 by default)

ffc script Ledge{

    void run(int dir, int hold, int SFX) {

        bool canJump;
        int counter=0;

        while(true) {

            if((dir & 0001b) != 0) {
                canJump = Link->InputUp && !Link->InputDown;
                canJump &&= (Link->X >= this->X-4) && (Link->X <= this->X+this->EffectWidth-12);
                canJump &&= (Link->Y <= this->Y+this->EffectHeight+8) && (Link->X >= this->X+this->EffectHeight+4);
                while(canJump && counter<hold) {
                    counter++;
                    Waitframe();
                    canJump &&= Link->InputUp && !Link->InputDown;
                }
                counter = 0;
                if(canJump) {
                    Link->Jump = ((this->EffectHeight+8)/2)*GRAV;
                    Game->PlaySound(SFX);
                    for(int i=0;i<this->EffectHeight+8;i++) {
                        Link->Y--;
                        Link->InputUp = false;
                        Link->InputDown = false;
                        Link->InputLeft = false;
                        Link->InputRight = false;
                        Link->InputA = false;
                        Link->InputB = false;
                        Link->InputR = false;
                        Link->InputL = false;
                        Waitframe();
                    }
                }
            } if((dir & 0010b) != 0) {
                canJump = Link->InputDown && !Link->InputUp;
                canJump &&= (Link->X >= this->X-4) && (Link->X <= this->X+this->EffectWidth-12);
                canJump &&= (Link->Y >= this->Y-16) && (Link->Y <= this->Y-12);
                while(canJump && counter<hold) {
                    counter++;
                    Waitframe();
                    canJump &&= Link->InputDown && !Link->InputUp;
                }
                counter = 0;
                if(canJump) {
                    Link->Jump = ((this->EffectHeight+8)/2)*GRAV;
                    Game->PlaySound(SFX);
                    for(int i=0;i<this->EffectHeight+8;i++) {
                        Link->Y++;
                        Link->InputUp = false;
                        Link->InputDown = false;
                        Link->InputLeft = false;
                        Link->InputRight = false;
                        Link->InputA = false;
                        Link->InputB = false;
                        Link->InputR = false;
                        Link->InputL = false;
                        Waitframe();
                    }
                }
            } if((dir & 0100b) != 0) {
                canJump = Link->InputLeft && !Link->InputRight;
                canJump &&= (Link->Y >= this->Y-4) && (Link->Y <= this->Y+this->EffectHeight-12);
                canJump &&= (Link->X <= this->X+this->EffectWidth+16) && (Link->X >= this->X+this->EffectWidth+12);
                while(canJump && counter<hold) {
                    counter++;
                    Waitframe();
                    canJump &&= Link->InputLeft && !Link->InputRight;
                }
                counter = 0;
                if(canJump) {
                    Link->Jump = ((this->EffectWidth+16)/2)*GRAV;
                    Game->PlaySound(SFX);
                    for(int i=0;i<this->EffectWidth+16;i++) {
                        Link->X--;
                        Link->InputUp = false;
                        Link->InputDown = false;
                        Link->InputLeft = false;
                        Link->InputRight = false;
                        Link->InputA = false;
                        Link->InputB = false;
                        Link->InputR = false;
                        Link->InputL = false;
                        Waitframe();
                    }
                }
            } if((dir & 1000b) != 0) {
                canJump = Link->InputRight && !Link->InputLeft;
                canJump &&= (Link->Y >= this->Y-4) && (Link->Y <= this->Y+this->EffectHeight-12);
                canJump &&= (Link->X >= this->X-16) && (Link->X <= this->X-12);
                while(canJump && counter<hold) {
                    counter++;
                    Waitframe();
                    canJump &&= Link->InputRight && !Link->InputLeft;
                }
                counter = 0;
                if(canJump) {
                    Link->Jump = ((this->EffectWidth+16)/2)*GRAV;
                    Game->PlaySound(SFX);
                    for(int i=0;i<this->EffectWidth+16;i++) {
                        Link->X++;
                        Link->InputUp = false;
                        Link->InputDown = false;
                        Link->InputLeft = false;
                        Link->InputRight = false;
                        Link->InputA = false;
                        Link->InputB = false;
                        Link->InputR = false;
                        Link->InputL = false;
                        Waitframe();
                    }
                }
            }
    
            Waitframe();
        }
    }
}
ffc script RealNPC{
    void run(int m, int s, int changedirection, int distance){
        int dx; int dy;
        int ax; int ay;
        int orig = this->Data;
        
        if(distance == 0) distance = 40;
        while(true){
            dx = this->X-Link->X; ax = Abs(dx);
            dy = this->Y-Link->Y; ay = Abs(dy);
            if(changedirection != 0){
                if(ax < distance && ay < distance){
                    if(ax <= ay){
                        if(dy >= 0) this->Data = orig;
                        else this->Data = orig+1;
                    }else{
                        if(dx >= 0) this->Data = orig+2;
                        else this->Data = orig+3;
                    }
                }else this->Data = orig+(changedirection-1);
            }
            if(Link->InputR && ax < 24 && ay < 24 && Link->Z == 0){
                if(s != 0) Game->PlaySound(s);
                Link->InputR = false;
                Screen->Message(m);
                do Waitframe();
                while(Link->InputR)
            }
        Waitframe();
        }
    }
}

const int T_CHAIN            = 196;        //Mace Chain
const int T_HEAD            = 197;        //Mace Head
//Gives an enemy a mace to swing at Link
ffc script MaceEnemy{
    void run(int num, int maxradius, int damage){
    int counter = Rand(360);
    int spintimer;
    int radius = maxradius;
    int x; int y;
    int ret;
        Waitframes(4);
        npc e = Screen->LoadNPC(num);
        while(e->isValid()){
            spintimer = 0;
            //spin the ball
            while(spintimer < 240+Rand(120) && e->isValid()){
                SpinBall(radius,counter,num,damage,false);
                spintimer++;
                counter = (counter+3)%360;
            Waitframe();
            }
            //pull the ball in
            while(radius > 20 && e->isValid()){
                SpinBall(radius,counter,num,damage,false);
                radius -= 2;
                counter = (counter+3)%360;
            Waitframe();
            }
            spintimer = 0;
            //spin very fast with small radius
            while(spintimer < 120 && e->isValid()){
                SpinBall(radius,counter,num,damage,false);
                spintimer++;
                counter = (counter+10)%360;
            Waitframe();
            }
            //throw at Link
            x = Link->X;
            y = Link->Y;
            counter = 4;
            ret = 1;
            while(e->isValid() && counter > 0){
                SpinBall(counter,ArcTan((x-e->X),(y-e->Y)),num,damage,true);
                if(Abs(x-(e->X + RadianCos(ArcTan((x-e->X),(y-e->Y)))*counter)) < 4
                && Abs(y-(e->Y + RadianSin(ArcTan((x-e->X),(y-e->Y)))*counter)) < 4){
                    if(ret == 1) Pause(counter,ArcTan((x-e->X),(y-e->Y)),num,damage);
                    //return
                    ret = -1;
                }
                counter += 4*ret;
            Waitframe();
            }
            Pause(0,0,num,damage);
            //bring back to main spin position
            counter = Floor(ArcTan((x-e->X),(y-e->Y))*180/PI);
            radius = 0;
            while(radius < maxradius && e->isValid()){
                SpinBall(radius,counter,num,damage,false);
                radius += 2;
                counter = (counter+3)%360;
            Waitframe();
            }
        }
        Screen->ClearSprites(SL_EWPNS);
    }
    void Pause(int r, int c, int n, int d){
        for(int i=0;i<10;i++){
            SpinBall(r,c,n,d,true);
        Waitframe();
        }
    }
    void SpinBall(int radius, int counter, int num, int damage, bool radians){
        npc e = Screen->LoadNPC(num);
        Screen->ClearSprites(SL_EWPNS);
        for(int i=0;i<5;i++){
            eweapon ball = Screen->CreateEWeapon(EW_SCRIPT1);
            if(i<4) ball->Tile = T_CHAIN;
            else ball->Tile = T_HEAD;
            ball->Damage = damage;
            if(radians){
                ball->X = e->X + RadianCos(counter)*(radius*(i+1)/5);
                ball->Y = e->Y + RadianSin(counter)*(radius*(i+1)/5);
            }else{
                ball->X = e->X + Cos(counter)*(radius*(i+1)/5);
                ball->Y = e->Y + Sin(counter)*(radius*(i+1)/5);
            }
        }
    }
}

// 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!
// Limtations are simply the fact that I can't use the D variables of any other FFCs besides the one this script is set on, thus only four items per shop,
// and the fact that you won't hold up the item when you buy it... But it's useful, regardless! The shop can be anywhere on the screen now! However, this
// means you'll need to waste a few combos to show the item and the price... But it's worth it. Also, think about this: This script means no more leaving and
// exiting a shop just to buy more than one item...;) Plus, there's more versatility with THIS script. No more wasting Shop Types. Now, one script does it
// all. Each FFC has its own per-screen D variable from 0 to 7. This script uses 0-3 for the items you buy, and 4-7 for their prices. The screen-specificness
// of the D variables adds to the versatility. For example, on one screen, you could set up a shop that sells the 3 Shields, while on another, the very same
// script sets you up a shop that sells Bombs. I made this because I didn't particularly like how Zelda Classic's Z1 shops are done.... Plus, my quest, Realm
// of Mirrors, needed Oracles-styled things... Anyways, have fun with this script! ~Matthew
// 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!"
// 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.

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 && Link->Y == buy1->Y) //continue only if Link is on the FFC
            {
                if(nobuy == 1) //checks if it shouldn't allow buying, "no-buy timer"
                {
                    while(wait > 0)
                    {            //this whole section prevents you from buying an item over and over again if you hold down A, AKA "no-buy timer"
                        wait -= 1; //take away from the timer
                        Waitframes(60); //wait one full second before continuing. 60 frames = 1 second....therefore, the value of "wait" is the amount of seconds on the no-buy timer... I wouldn't try 3, though. Too long, trust me.
                    }
                    nobuy = 0; //reset everything back to normal
                    wait = 1;
                }
                if(Link->InputA && nobuy == 0 && Game->Counter[1] >= price1 && Link->Dir == 0) //only allow buying if you press A, if the no-buy timer has expired, if you have enough Rupees, and if you're...y'know, FACING the item...
                {
                    Link->InputA = false; //stops Link from attacking....can't have that
                    nobuy = 1;        //helps start the no-buy timer
                    Screen->CreateItem(item1); //create the item that we're buying
                    int itemcount = Screen->NumItems(); //find out how many items are on-screen...just a simple precaution. Since the item you're buying is most likely going to be the last item in the list, NumItems will give you the item's ID all the time...but then, that's if no other script creates items...
                    item newitem = Screen->LoadItem(itemcount);
                    newitem->X = Link->X;            //this section places the item on Link...simply GIVING it to him isn't enough... After all, what will tell the player they bought it successfully?
                    newitem->Y = Link->Y;
                    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(Link->InputA && Game->Counter[1] < price1) //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();
            }
            while(Link->X == buy2->X && Link->Y == buy2->Y)
            {
                if(nobuy == 1)
                {
                    while(wait > 0)
                    {
                        wait -= 1;
                        Waitframes(60);
                    }
                    nobuy = 0;
                    wait = 1;
                }
                if(Link->InputA && nobuy == 0 && Game->Counter[1] >= price2 && Link->Dir == 0)
                {
                    Link->InputA = false;
                    nobuy = 1;
                    Screen->CreateItem(item2);
                    int itemcount = Screen->NumItems();
                    item newitem = Screen->LoadItem(itemcount);
                    newitem->X = Link->X;
                    newitem->Y = Link->Y;
                    int drainwait = price2;
                    while(drainwait > 0)
                    {
                        Game->Counter[1] -= 1;
                        drainwait -= 1;
                        Waitframe();
                    }
                }
                else if(Link->InputA && Game->Counter[1] < price2)
                {
                    Screen->Message(nerm);
                    nobuy = 1;
                }
                Waitframe();
            }
            while(Link->X == buy3->X && Link->Y == buy3->Y)
            {
                if(nobuy == 1)
                {
                    while(wait > 0)
                    {
                        wait -= 1;
                        Waitframes(60);
                    }
                    nobuy = 0;
                    wait = 1;
                }
                if(Link->InputA && nobuy == 0 && Game->Counter[1] >= price3 && Link->Dir == 0)
                {
                    Link->InputA = false;
                    nobuy = 1;
                    Screen->CreateItem(item3);
                    int itemcount = Screen->NumItems();
                    item newitem = Screen->LoadItem(itemcount);
                    newitem->X = Link->X;
                    newitem->Y = Link->Y;
                    int drainwait = price3;
                    while(drainwait > 0)
                    {
                        Game->Counter[1] -= 1;
                        drainwait -= 1;
                        Waitframe();
                    }
                }
                else if(Link->InputA && Game->Counter[1] < price3)
                {
                    Screen->Message(nerm);
                    nobuy = 1;
                }
                Waitframe();
            }
            while(Link->X == buy4->X && Link->Y == buy4->Y)
            {
                if(nobuy == 1)
                {
                    while(wait > 0)
                    {
                        wait -= 1;
                        Waitframes(60);
                    }
                    nobuy = 0;
                    wait = 1;
                }
                if(Link->InputA && nobuy == 0 && Game->Counter[1] >= price4 && Link->Dir == 0)
                {
                    Link->InputA = false;
                    nobuy = 1;
                    Screen->CreateItem(item4);
                    int itemcount = Screen->NumItems();
                    item newitem = Screen->LoadItem(itemcount);
                    newitem->X = Link->X;
                    newitem->Y = Link->Y;
                    int drainwait = price4;
                    while(drainwait > 0)
                    {
                        Game->Counter[1] -= 1;
                        drainwait -= 1;
                        Waitframe();
                    }
                }
                else if(Link->InputA && Game->Counter[1] < price4)
                {
                    Screen->Message(nerm);
                    nobuy = 1;
                }
                Waitframe();
            }
            Waitframe();
        }
    }
}

ffc script sign {
    void run(int m) {
        while(true) {
            while(Link->X < this->X - 8 || Link->X > this->X + 24 || Link->Y < this->Y || Link->Y > this->Y + 24 || Link->Dir != DIR_UP || !Link->InputR) {
                Waitframe();
            }
            Link->InputR = false;
            Screen->Message(m);

            while(Link->X >= this->X - 8 && Link->X <= this->X + 24 && Link->Y >= this->Y && Link->Y <= this->Y + 24 && Link->Dir == DIR_UP) {
                Waitframe();
            }
            
            Screen->Message(0);
        }
    }
}


Edited by Purplemandown, 01 April 2009 - 09:33 PM.


#5 Purplemandown

Purplemandown

    The Old Guard

  • Members
  • Real Name:Nathan
  • Location:Milwaukee, WI

Posted 01 April 2009 - 09:31 PM

CODE
//FFC Script ColorPath
//Dungeon Specific script based off of a puzzle in Oracle Of Ages
//Walk accross 3 different combos
//Combo 1 changes to combo 2 when stepped on.
//Combo 3 ends the script, testing to see how many combo 1's still exist
//If the number of combo 1's is low enough, another FFC is activated
//D0 = The first of 3 consecutive combos used for this script
//Combo 1 is used for the count and changes to combo 2 when stepped on.
//Combo 2 changes into combo 3 when Link steps on an adjacent combo 1
//Combo 3 ends the script, first testing to see how many combo 1's are left
//D1 = The maximum number of combo 1's left at the end of the script allowed that will activate another FFC
//D2 = The number of the FFC that will be activated
//D3 = Height Flag. If not 0, Link can only trigger combos when on the ground
//D4 = Tiles only flag. True if not 0. Once Link steps on the tiles, all other combos act as red tiles.
ffc script ColorPath {
    int countCombos(int tc) {
        int cTile;
        int tCount = 0;
        for (cTile = 0; cTile < 176; cTile++)
        {
            if (Screen->ComboD[cTile] == tc)
            {
                tCount++;
            }
            if (Screen->ComboD[cTile] == tc + 1)
            {
                Screen->ComboD[cTile] = tc + 2;
            }
        }
        return tCount;
    }
    void run(int firstCombo, int maxBlues, int targetFFC, int heightFlag, int tilesFlag) {
        int targetLoc = 0;
        int targetTile = 0;
        int onBlue = 0;
        while (true)
        {
            Waitframe();
            targetLoc = ComboAt(Link->X + 8, Link->Y + 8);
            if (Screen->ComboD[targetLoc] >= firstCombo && Screen->ComboD[targetLoc] <= firstCombo + 2 && (heightFlag == 0 || Link->Z < 1))
            {
                targetTile = Screen->ComboD[targetLoc];
                targetTile = targetTile - firstCombo;
                if (targetTile == 0)
                {
                    Screen->ComboD[targetLoc]++;
                    if (targetLoc > 15)
                    {
                        if (Screen->ComboD[targetLoc - 16] == firstCombo + 1)
                        {
                            Screen->ComboD[targetLoc - 16] = firstCombo + 2;
                        }
                    }
                    if (targetLoc < 160)
                    {
                        if (Screen->ComboD[targetLoc + 16] == firstCombo + 1)
                        {
                               Screen->ComboD[targetLoc + 16] = firstCombo + 2;
                        }
                             }
                    if (targetLoc % 16 > 0)
                    {
                        if (Screen->ComboD[targetLoc - 1] == firstCombo + 1)
                        {
                            Screen->ComboD[targetLoc - 1] = firstCombo + 2;
                        }
                    }
                    if (targetLoc % 16 < 15)
                    {
                        if (Screen->ComboD[targetLoc + 1] == firstCombo + 1)
                        {
                            Screen->ComboD[targetLoc + 1] = firstCombo + 2;
                        }
                    }
                    onBlue = 1;
                }
                else if (targetTile == 2)
                {
                    if (countCombos(firstCombo) <= maxBlues)
                    {
                        ffc this2 = Screen->LoadFFC(targetFFC);
                        this2->CSet = 0;
                    }
                    this->Data = 0;
                    Quit();
                }
            }
            else if (onBlue != 0 && (heightFlag == 0 || Link->Z < 1))
            {
                if (countCombos(firstCombo) <= maxBlues)
                {
                    ffc this2 = Screen->LoadFFC(targetFFC);
                    this2->CSet = 0;
                    this->Data = 0;
                    Quit();
                }
                if (tilesFlag != 0)
                {
                    this->Data = 0;
                    Quit();
                }
                onBlue = 0;
            }
        }
    }
}

//FFC Script SpawnItem
//Script that creates an item at the FFC's postion when activated
//Can be used to create common items infinetly or rare items once
//Not good to use with keys
//D0 = Number of the item to be spawned
//D1 = If 1, check Link's inventory to see if he already has the item (good for one-time spawning)
//D2 = The current level if checking a dungeon item
ffc script SpawnItem {
    void run(int itemSpawn, int checkInventory, int currLevel) {
        while (true)
        {
            if (this->CSet == 0)
            {
                if (checkInventory == 1)
                {
                    bool willSpawn = false;
                    if (itemSpawn == I_MAP)
                    {
                        if ((Game->LItems[currLevel] & 2) != 2)
                        {
                            willSpawn = true;
                        }
                    }
                    else if (itemSpawn == I_COMPASS)
                    {
                        if ((Game->LItems[currLevel] & 4) != 4)
                        {
                            willSpawn = true;
                        }
                    }
                    else if (itemSpawn ==  I_BOSSKEY)
                    {
                        if ((Game->LItems[currLevel] & 16) != 16)
                        {
                            willSpawn = true;
                        }
                    }
                    else if (Link->Item[itemSpawn] == false)
                    {
                        willSpawn = true;
                    }
                    if (willSpawn)
                    {
                        item iSpawn;
                        iSpawn = Screen->CreateItem(itemSpawn);
                        iSpawn->X = this->X;
                        iSpawn->Y = this->Y;
                    }
                }
                else
                {
                    item iSpawn;
                    iSpawn = Screen->CreateItem(itemSpawn);
                    iSpawn->X = this->X;
                    iSpawn->Y = this->Y;
                }
                this->Data = 0;
                Quit();
            }
            Waitframe();
        }
    }
}

//FFC Script ComboChanger
//D0 = Original Combo Data
//D1 = Replacement Combo Data
//D2 = Reversable Flag. If not 0, then after activation the FFC
//will change CSets and be available to activate again. If it is
//activated again, the combos used by the script will have their
//roles reversed.
//If this flag is set, the combos can be replaced an infinite
//number of times, with each activation swapping the roles of
//the combos.
//When activated, it replaces all of one combo with another combo
ffc script ComboChanger {
    void run(int targetCombo, int newCombo, int reversable) {
        int cTile;
        int replaceDir = 0;
        while (true)
        {
            if (this->CSet == 0)
            {
                for (cTile = 0; cTile < 176; cTile++)
                {
                    if (replaceDir == 0)
                    {
                        if (Screen->ComboD[cTile] == targetCombo)
                        {
                            Screen->ComboD[cTile] = newCombo;
                        }
                    }
                    else
                    {
                        if (Screen->ComboD[cTile] == newCombo)
                        {
                            Screen->ComboD[cTile] = targetCombo;
                        }
                    }
                }
                if (reversable != 0)
                {
                    replaceDir = 1 - replaceDir;
                    this->CSet = 2;
                }
                else
                {
                    this->Data = 0;
                    Quit();
                }
            }
            Waitframe();
        }
    }
}

//FFC Script CustomCombo
//Custom Combo Types
//0 - None
//1 - CustomDamage (Damage Amount, Prevention Item, NA, NA)
//2 - Status Tiles (Effect, NA, NA, NA)
//3 - One Way Conveyor (Direction, NA, NA, NA)
//4 - SpringTiles (Spring Force, NA, NA, NA)
//5 - Walk Near-Draw Tile (Tile Num, Tile Layer, Tile CSet, Tile Transparency)
//6 - Slippery Ice (NA, NA, NA, NA)
//7 - Modify Endurance (Amount, Bar Tiles, Bar Color, No Endure Damage)
//8 - Warp Tiles (DMap, Screen, NA, NA)
//9 - Button Tiles (New Tiles, Target FFC, NA, NA)
ffc script CustomCombo {
    void run(int replaceCombo, int customType, int ignoreZ, int varOne, int varTwo, int varThree, int varFour) {
        int comboPos = 0;
        int comboFlag = -1;
        int effectDelay = 0;
        while (true)
        {
            comboPos = ComboAt(Link->X + 8, Link->Y + 8);
            if (Screen->ComboD[comboPos] == replaceCombo && customType != 5)
            {
                if (customType == 1)
                {
                    int currLevel = Game->GetCurDMap();
                    bool causeDamage = true;
                    if (ignoreZ == 0 && Link->Z != 0)
                    {
                        causeDamage = false;
                    }
                    else if (varTwo == I_MAP)
                    {
                        if ((Game->LItems[currLevel] & 2) == 2)
                        {
                            causeDamage = false;
                        }
                    }
                    else if (varTwo ==  I_COMPASS)
                    {
                        if ((Game->LItems[currLevel] & 4) == 4)
                        {
                            causeDamage = false;
                        }
                    }
                    else if (varTwo ==  I_BOSSKEY)
                    {
                        if ((Game->LItems[currLevel] & 16) == 16)
                        {
                            causeDamage = false;
                        }
                    }
                    else if (Link->Item[varTwo])
                    {
                        causeDamage = false;
                    }
                    if (causeDamage && effectDelay == 0)
                    {
                        Link->HP-=varOne;
                        Link->Action = LA_GOTHURTLAND;
                        Game->PlaySound(SFX_OUCH);
                        effectDelay = 90;
                    }
                }
                else if (customType == 2)
                {
                    if (ignoreZ != 0 || Link->Z == 0)
                    {
                        //Status Effects
                        //0 = Temporary Sword Loss
                        //1 = Lose Sword
                        //2 = Regain Sword
                        //3 = Temporary Item Loss
                        //4 = Lose Items
                        //5 = Regain Items
                        //6 = Temporary All Loss
                        //7 = Lose All
                        //8 = Regain All
                        //9 = Become Drunk
                        //10 = Become Sober
                        if (varOne == 0 || varOne == 6)
                        {
                            Link->SwordJinx = 300;
                        }
                        else if (varOne == 1 || varOne == 7)
                        {
                            Link->SwordJinx = -1;
                        }
                        else if (varOne == 2 || varOne == 8)
                        {
                            Link->SwordJinx = 0;
                        }
                        if (varOne == 3 || varOne == 6)
                        {
                            Link->ItemJinx = 300;
                        }
                        else if (varOne == 4 || varOne == 7)
                        {
                            Link->ItemJinx = -1;
                        }
                        else if (varOne == 5 || varOne == 8)
                        {
                            Link->ItemJinx = 0;
                        }
                        if (varOne == 9 && Link->Drunk == 0)
                        {
                            Link->Drunk = 900;
                        }
                        else if (varOne == 10)
                        {
                            Link->Drunk = 0;
                        }
                    }
                }
                else if (customType == 3)
                {
                    if (ignoreZ != 0 || Link->Z == 0)
                    {
                        if (varOne == DIR_UP)
                        {
                            if (is_walkable(Link->X, Link->Y + 7) && is_walkable(Link->X + 15, Link->Y + 7))
                            {
                                Link->Y--;
                            }
                        }
                        else if (varOne == DIR_DOWN)
                        {
                            if (is_walkable(Link->X, Link->Y + 17) && is_walkable(Link->X + 15, Link->Y + 17))
                            {
                                Link->Y++;
                            }
                        }
                        else if (varOne == DIR_LEFT)
                        {
                            if (is_walkable(Link->X - 1, Link->Y + 8) && is_walkable(Link->X - 1, Link->Y + 15))
                            {
                                Link->X--;
                            }
                        }
                        else if (varOne == DIR_RIGHT)
                        {
                            if (is_walkable(Link->X + 17, Link->Y + 8) && is_walkable(Link->X + 17, Link->Y + 15))
                            {
                                Link->X++;
                            }
                        }
                    }
                }
                else if (customType == 4)
                {
                    if (ignoreZ != 0 || Link->Z == 0)
                    {
                        if (Link->Z == 0)
                        {
                            Link->Jump = varOne;
                            Game->PlaySound(SFX_JUMP);
                        }
                        else if (Link->Jump < 0)
                        {
                            Link->Jump = 1;
                        }
                    }
                }
                else if (customType == 6)
                {
                    if (ignoreZ != 0 || Link->Z == 0)
                    {
                        if (comboFlag == -1)
                        {
                            if (Link->Dir < 4)
                            {
                                comboFlag = Link->Dir;
                            }
                        }
                        else if (comboFlag < 4)
                        {
                            for (int loopIndex = 0; loopIndex < 2; loopIndex++)
                            {
                                if (comboFlag == DIR_UP)
                                {
                                    if (is_walkable(Link->X, Link->Y + 7) && is_walkable(Link->X + 15, Link->Y + 7))
                                        {
                                        Link->Y--;
                                    }
                                    else
                                    {
                                        comboFlag = 4;
                                    }
                                }
                                else if (comboFlag == DIR_DOWN)
                                {
                                    if (is_walkable(Link->X, Link->Y + 17) && is_walkable(Link->X + 15, Link->Y + 17))
                                    {
                                        Link->Y++;
                                    }
                                    else
                                    {
                                        comboFlag = 4;
                                    }
                                }
                                else if (comboFlag == DIR_LEFT)
                                {
                                    if (is_walkable(Link->X - 1, Link->Y + 8) && is_walkable(Link->X - 1, Link->Y + 15))
                                    {
                                        Link->X--;
                                    }
                                    else
                                    {
                                        comboFlag = 4;
                                    }
                                }
                                else if (comboFlag == DIR_RIGHT)
                                {
                                    if (is_walkable(Link->X + 17, Link->Y + 8) && is_walkable(Link->X + 17, Link->Y + 15))
                                    {
                                        Link->X++;
                                    }
                                    else
                                    {
                                        comboFlag = 4;
                                    }
                                }
                            }
                            if (Link->InputUp)
                            {
                                Link->Dir = DIR_UP;
                            }
                            else if (Link->InputDown)
                            {
                               

Edited by Purplemandown, 01 April 2009 - 09:34 PM.


#6 Plissken

Plissken

    What's with these homies dissing our girls?

  • Members

Posted 01 April 2009 - 09:42 PM

I meant just upload the .z file to 2shared.com or something, this works too I guess...


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users