Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ffc script tenrupee
- {
- void run(int item_id, sdd, imiscd)
- {
- int ten_rupees_x[10] = {120,112,128,96,112,128,144,112,128,120};
- int ten_rupees_y[10] = {49,65,65,81,81,81,81,97,97,113};
- item ten_rupees[10];
- if ( !Screen->D[sdd] )
- {
- Screen->D[sdd] = ( 1 << 11 );
- for ( int q = 0; q < 10; ++q ) //We've never collected any, so make all of them.
- {
- ten_rupees[q] = Screen->CreateItem(Cond((item_id > 0), item_id, I_RUPEE));
- ten_rupees[q]->X = ten_rupees_x[q];
- ten_rupees[q]->Y = ten_rupees_y[q];
- ten_rupees[q]->Misc[imiscd] = 101010+q; //the index of the item, out of ten, wso that we know what Screen->D bit it will use.
- ten_rupees[q]->InitD[0] = imiscd; //Pass-through.
- ten_rupees[q]->InitD[1] = sdd; //Pass-through.
- ten_rupees[q]->PScript = Game->GetItemScript("TenRupeePickup");
- }
- }
- else
- {
- for ( int q = 0; q < 10; ++q )
- {
- if ( !GetScreenDBit(sdd, ( 1 << q )) //Only create the item if Link did not pick up that particular rupee on a previous visit.
- {
- ten_rupees[q] = Screen->CreateItem(Cond((item_id > 0), item_id, I_RUPEE));
- ten_rupees[q]->X = ten_rupees_x[q];
- ten_rupees[q]->Y = ten_rupees_y[q];
- ten_rupees[q]->Misc[imiscd] = 101010+q; //We still mark which (n/10) it is.
- ten_rupees[q]->InitD[0] = imiscd;
- ten_rupees[q]->InitD[1] = sdd;
- ten_rupees[q]->PScript = Game->GetItemScript("TenRupeePickup");
- }
- }
- }
- }
- }
- item script TenRupeePickup
- {
- void run(int imiscd, int sdd) //set by the ffc. Do not manually assign!
- {
- int bit = this->Misc[imiscd]-101010; //Mark one bit of Screen D with the ID (n/10) of this rupee.
- //That way, if Link collects it, it won't respawn, because the bit is set, and we only create them
- //if this bit is false.
- SetScreenDBit(sdd, ( (1 << bit), true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement