Bonus Content
Spoiler
Same script on Pastebin.
item script Bullet { void run() { lweapon l = Screen->CreateLWeapon(Cond((this->Attributes[1] > 0), this->Attributes[1], LW_ARROW)); //Attributes[1] is the weapon type. Defaults to arrow. int x; int y; int canrunffc = 0; switch(Link->Dir) { case DIR_UP: { x = Link->X -1; y = Link->Y+8; break; } case DIR_DOWN: { x = Link->X +16; y = Link->Y+8; break; } case DIR_LEFT: { x = Link->X +8; y = Link->Y-1; break; } case DIR_RIGHT: { x = Link->X +8; y = Link->Y+16; break; } default: { x = Link->X; y = Link->Y; TraceNL(); TraceS("Invalid Link->Dir for item script Bullet"); TraceNL(); break; } } l->X = x; l->Y = y; l->Dir = Link->Dir; l->UseSprite(this->Sprites[0]); Game->PlaySound(this->UseSound); l->Step = this->Attributes[0]; l->Damage = this->Level; //Upgrade canon by level. ffc f; for ( int q = 1; q < 33; ++q ) { f = Screen->LoadFFC(q); if ( f->Flags&FFCF_ETHEREAL ) continue; //ethereal cannot run scripts. if ( f->Data == 0 ) break; //find one with no running script. } if ( f->ID > 31 ) { if ( f->Data > 0 ) { f->InitD[1] = f->Data; } if ( f->Script > 0 ) { TraceNL(); TraceS("Item script Bullet could not grab a free ffc.."); TraceNL(); } else canrunffc = 1; } else canrunffc = 1; if ( canrunffc ) { if ( f->Data <= 0 ) { f->Data = CMB_INVIS; } f->Script = Game->GetFFCScript("Autofire_Bullets"); } if ( GetEquipmentA() == this->ID ) { f->InitD[0] = CB_A; } else if ( GetEquipmentB() == this->ID ) { f->InitD[0] = CB_B; } else { f->InitD[0] =-1; } //error finding button match ?! } //end run() } // end item script ffc script Autofire_Bullets { void run(int controller_button, int olddata) //olddata is used if this ffc already had a combo set, but no script. { Input->Held[controller_button] = false; if ( olddata <= 0 ) { this->Data = 0; } Quit(); /* We run out of scope here anyway, but it's safer, and clearer, to call Quit(). */ } //end run() } //end scriptThis is a dandy example of both how this autofire thing would work, and some new syntax.
Same script on Pastebin.