// When hit by an lweapon with Misc[LWEAPON_MISC_SOURCE] set to // itemNo, change all target combos on screen to toCombo. If the combo // this FFC is placed on top of changes, this kills itself without // triggering anything. // // int target - What combos on the screen to change. If >= 0, it // changes every combo with that number on the screen. If < 0, it // changes every combo with the flag of the negative on the // screen. (So set to -16 to change the Secret 0 flag.) // int toCombo - the combo to change the target to. // int itemNo - the item number to respond to. ffc script Trigger { void run(int target, int toCombo, int itemNo) { int loc = ComboAt(this->X + 8, this->Y + 8); int underCombo = Screen->ComboD[loc]; // Wait until while (// We're hit by the right item type, or !CollisionAllLWeapon(this, LWEAPON_MISC_SOURCE, itemNo) && // The combo on layer 0 changes. Screen->ComboD[loc] == underCombo) { Waitframe();} // Cancel out if the underlying combo changed. if (Screen->ComboD[loc] != underCombo) { return;} //// Otherwise, we were hit by the item, so change the combos on screen. // Transform from a combo. if (target >= 0) { for (int i = 0; i < 176; i++) { if (Screen->ComboD[i] == target) { Screen->ComboD[i] = toCombo;}}} // Transform from a flag. else { for (int i = 0; i < 176; i++) { if (ComboFI(i, -target)) { Screen->ComboD[i] = toCombo;}}}}}