//Checks for collision with trigger flags and triggers screen secrets if a collision occurs. void TriggerUpdate (lweapon l, int flag, int sound, bool perm){ bool Alltriggered = false; while (!Alltriggered){ int loc = ComboAnyFlagCollision (flag, l); if (loc < 0) Alltriggered = true; else{ Game->PlaySound(sound); l->DeadState=0; if (ComboFI(loc, CF_SINGLE)) Screen->ComboD[loc] = Screen->UnderCombo; else { Screen->TriggerSecrets(); for (int i=0; i<=176; i++){ if (ComboFI(i, flag)) { Screen->ComboD[i] = Screen->UnderCombo; Screen->ComboF[i] = 0; } } if (perm) Screen->State[ST_SECRET] = true; } } } } //Detects if lweapon hits blocker combo type bool BlockedByCombo (lweapon l, int type, bool NP){ int block = ComboTypeCollision (type, l); if (block>=0){ if (NP) Remove(l); else l->DeadState=0; return true; } return false; } //Replaces any combos of specific type when touched by Lweapon void ReplaceCombosOnCollision( lweapon l, int type, int newcombo, int sound){ int cmb = ComboTypeCollision(type, l); if (cmb >= 0) { Screen->ComboD[cmb] = newcombo; Game->PlaySound(sound); } } //Same as above but with flags. if "retainflag" is false, the flag that triggered collision will be removed. void ReplaceFlaggedCombos( lweapon l, int flag, int newcombo,int sound, bool retainflag){ int cmb = ComboAnyFlagCollision(flag, l); if (cmb >= 0) {Screen->ComboD[cmb] = newcombo; if (retainflag) Screen->ComboF[cmb] = 0; Game->PlaySound(sound); } } //Destroys combos on collision by replacing them with screen`s undercombo. void DestroyCombosOnCollision( lweapon l, int type, int sound){ int cmb = Screen->UnderCombo; ReplaceCombosOnCollision( l, type, cmb, sound); }