Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Zol_Combine(ffc this, npc ghost, int height, int trans, bool changeGuyCount)
- {
- int new_npc = trans; //Get the ID of the enemy that this will become, from it's 'Death Attribute 3'
- //npc gel1 = combine[0]; //Variable to hold the first base enemy
- //npc gel 2 = combine[1]; //Variable to hold the second base enemy
- //npc zol = combine[2]; //Variable to hold the replacement enemy
- int loops[3]; //Array for three loop vars.
- npc combine[3]; //Array for the three npcs.
- if (Ghost_GotHit())
- {
- //Read the npcs on the screen
- for (loops[0] = Screen->NumNPCs(); loops[0] > 0; loops[0] -- )
- {
- //Load index1th enemy into a pointer..
- combine[0] = Screen->LoadNPC(index1);
- //if it is the correct ID, check for a second instance of this enemy.
- if ( combine[0]->ID == ghost->ID )
- loops[1] = loops[0]+1; loops[2] = Screen->NumNPCs();
- for ( ; loops[1] <= loops[2]; loops[1]++ )
- //use the same sarting index for loops[1], plus one, so that we do not
- //read the same npc twice; set loops[2] to the number of npcs so that we do
- //not need to call Screen->NumNPCs() multiple times.
- {
- //Load index2th enemy into a pointer..
- combine[1] = Screen->LoadNPC(loops[1]);
- //Load each npc after the first one that we found, into a pointer.
- if ( combine[1]->ID == ghost->ID )
- if ( combine[2]_DistXY(combine[0], combine[1], Z4combine[2]_COMBINE_DISTANCE ) )
- {
- //Create a new npc using the 'Death Attribute 3' value of the npc running this ghost script.
- combine[2] = Screen->CreateNPC(new_npc);
- combine[2]->X = Min(combine[0]->X, combine[1]->X) - Max(combine[0]->X, combine[1]->X) / 2;
- combine[2]->Y = Max(combine[0]->Y, combine[1]->Y);
- //Check if there is a sound to be played, if so then play it
- if ( Z4combine[2]_SOUND2_INDEX > 0 ) Game->PlaySound(Z4combine[2]_SOUND2_INDEX);
- // !!!
- //! What the flidd is this!? THis shouldn't compile at all!!!
- //! Did you mean ' Z4combine[SOUND2_INDEX] ' ? -Z
- //Then, remove the two old npcs that it replaces.
- Remove(combine[0]);
- Remove(combine[1]);
- //Check if we are changing guy count, if so then correct GuyCount so that we spawn the correct number of npcs on returning.
- if ( changeGuyCount ) Game->GuyCount[Game->GetCurScreen()] -= 1; //If we're changing GuyCount[]...
- }
- }
- }
- combine[2]->Jump = height/10;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement