Here's my final version of the Quake trigger
...it's supposed to trigger 1x1(16x16), 1x2(16x32) or 2x2(32x32) Combo Blocks, and replace em by other variable combos.
Create and FFC with the Tile Width/Height and the Combo(Effect) Width/Height of the Combo(Block) that you want to trigger/replace.
Place it above the chosen Combo (Block) ...it has to be on grid(!!!)
The script checks Link's (center) distance, to the center of the FFC.
If he's close enough, the quake will trigger the script effects.
You can also decide if a "Super Quake" attack is required, to trigger the effects.
D0-D3 are the IDs of the "secret" combos, that should appear when hit by the quake
arranged like this:
cmb1 cmb3
cmb2 cmb4
If you want to trigger a 1x1(16x16) object, assign one "replace combo" ID to D0 (and leave D1-D3 = 0)
If you want to trigger a 1x2(16x32) object, assign two "replace combo" IDs to D0 and D1 (and leave D2 + D3 = 0)
...and if you want to trigger a 2x2(32x32) object, assign four "replace combo" IDs to D0, D1, D2 and D3.
D4 is the sound effect you want to play when it gets triggerd
D5 is the max distance (in pixel) that link may be away from the ffc center (and the center of the combo block you placed it on).
D6 is used to create Super Quake triggers
...if the object shall only be triggered by Super Quake effects, set D6 to "1", if you leave it "0" it will be an ordinary quake trigger.
ffc script QuakeHammerCMB
{
void run(int new_cmb1, int new_cmb2, int new_cmb3, int new_cmb4, int sfx, int dist, int sup_quake)
{
while(true){
if(sup_quake == 0){
if(Distance(CenterLinkX(), CenterLinkY(), CenterX(this), CenterY(this))<=dist){
if(Screen->Quake){
Audio->PlaySound(sfx);
if(new_cmb1 > 0){Screen->ComboD[ComboAt(this->X, this->Y)] = new_cmb1;}
if(new_cmb2 > 0){Screen->ComboD[ComboAt(this->X, this->Y+16)] = new_cmb2;}
if(new_cmb3 > 0){Screen->ComboD[ComboAt(this->X+16, this->Y)] = new_cmb3;}
if(new_cmb4 > 0){Screen->ComboD[ComboAt(this->X+16, this->Y+16)] = new_cmb4;}
Quit();
}
}
}
else if(sup_quake == 1){
if(Link->Item[I_QUAKESCROLL2] && Distance(CenterLinkX(), CenterLinkY(), CenterX(this), CenterY(this))<=dist){
if(Screen->Quake){
Audio->PlaySound(sfx);
if(new_cmb1 > 0){Screen->ComboD[ComboAt(this->X, this->Y)] = new_cmb1;}
if(new_cmb2 > 0){Screen->ComboD[ComboAt(this->X, this->Y+16)] = new_cmb2;}
if(new_cmb3 > 0){Screen->ComboD[ComboAt(this->X+16, this->Y)] = new_cmb3;}
if(new_cmb4 > 0){Screen->ComboD[ComboAt(this->X+16, this->Y+16)] = new_cmb4;}
Quit();
}
}
}
Waitframe();
}
}
}
Edited by Bagu, 12 December 2021 - 11:25 AM.