Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "std.zh"
- #include "classic.zh"
- ffc script goriyaItem
- {
- void run(int iid, int paddingTicks, int reg, int bit)
- {
- Waitframes(6);
- paddingTicks *= 60;
- while(goriyaAlive()) Waitframe();
- Waitframes(paddingTicks);
- if ( (Screen->D[reg] & (1<<bit)) ) Quit();
- item it = Screen->CreateItem(iid);
- it->X = this->X;
- it->Y = this->Y;
- it->Pickup |= IP_HOLDUP;
- while(it->isValid()) Waitframe(); //Wait until item is collected.
- Screen->D[reg] |= (1<<bit);
- }
- //Returns if there are enemy NPCs alive on the current screen.
- int goriyaAlive()
- {
- int count;
- for ( int q = Screen->NumNPCs(); q > 0; --q )
- {
- npc n = Screen->LoadNPC(q);
- if ( n->Type == NPCT_GUY && n->ID != NPC_FIRE )
- {
- ++count;
- }
- }
- return count;
- }
- }
- //this one, did not work, but I'm leaving it for the purpose of preservation
- ffc script guyRoomtoSpecialItem
- {
- void run(int paddingTicks, int reg, int bit)
- {
- Waitframes(6);
- paddingTicks *= 60;
- while(1)
- {
- if ( Link->PressL )
- {
- char32 s[]="NumNPCs: %d\n";
- printf(s, Screen->NumNPCs());
- }
- if ( (Screen->D[reg] & (1<<bit)) )
- {
- char32 bs[]="changing to special item room\n";
- TraceS(bs);
- Screen->RoomType = RT_SPECIALITEM;
- Screen->State[ST_SPECIALITEM] = false;
- Quit();
- }
- if ( goriyaAlive() < 1 )
- {
- Waitframes(paddingTicks);
- Screen->D[reg] |= (1<<bit);
- }
- Waitframe();
- }
- }
- int goriyaAlive()
- {
- int count;
- for ( int q = Screen->NumNPCs(); q > 0; --q )
- {
- npc n = Screen->LoadNPC(q);
- if ( n->Type == NPCT_GUY && n->ID != NPC_FIRE )
- {
- ++count;
- }
- }
- return count;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement