
const int NPC_MISC_DIGIVOLVED = 0; //Valid values 0-7
const int DIGIVOLVE = 164; //Set this to the item required to DigiVolve enemies.
const int DIGIVOLVE_TF = 1; //Set this to the TF Piece required to DigiVolve enemies. 
//Best to use DIGIVOLVE above and attach that item to a TF piece.


void digiVolveEnemies() {

    for(int i = 1; i < Screen->NumNPCs(); i++){ //Check every enemy on the screen.
        npc enemy1 = Screen->LoadNPC(i); //Set variable to all enemies.
            
            //Need to real all enemy editor numbers, and store them.
            //Need to change all enemies on a screen to +1 enemy editor number.
            
        int enemy1number = ( enemy1->ID );
        int enemy2number = ( enemy1number + 1 );
            
        if ( Link->Item[DIGIVOLVE] == true && enemy1->Misc[NPC_MISC_DIGIVOLVED] == 0 ){
        npc enemy2 = CreateNPCAt(enemy2number, enemy1->X, enemy1->Y); //Create enemyReplace at their position.
        enemy2->Misc[NPC_MISC_DIGIVOLVED] = 1;
            Remove(enemy1); //Remove enemyOriginal
        }
            
            
        else if ( Game->LItems[DIGIVOLVE_TF]&LI_TRIFORCE && enemy1->Misc[NPC_MISC_DIGIVOLVED] == 0 ){
        npc enemy2 = CreateNPCAt(enemy2number, enemy1->X, enemy1->Y); //Create enemyReplace at their position.
        enemy2->Misc[NPC_MISC_DIGIVOLVED] = 1;
            Remove(enemy1); //Remove enemyOriginal
        }
            
            
    }
}