Copy to Clipboard Test

Combo Specific Effects Code

//Combo effect that renders Link is on specific combo.

//Find UpdateComboEffects() function and copy RenderComboEffect for each combo that should have effect to render with following params:
// cmb - leave as this
// targcmb - if Link is on that combo (from combo table), render effect.
// cmbeffect - combo to use for rendering animation
// cseteffect - Cset to use for rendering animation
// itm - item that cancels rendering this animation, for instace, when that item prevents speed penalty when walking on that combo.
// reverse - if true, item mentioned in "itm" will be instead REQUIRED to render combo effect, like protective aura on boots vs damage combos.
// drawover - if true, combo effect will render on top of link, instead of under.
// animatemoving - if true, then different combo effect is used (next in list), when Link is moving on that combo.

global script ComboEffects {
	void run(){		
		while(true){			
			Waitframe();			
			UpdateComboEffects();
		}
	}
}


void UpdateComboEffects(){
	if (Link->Z!=0)return;
	int cmb = ComboAt(Link->X+7,Link->Y+10);
	
	RenderComboEffect (cmb, 16, 1114, 2, 10, false, true, true);//Add call of this function for each combo and effect atttached.
	RenderComboEffect (cmb, 12, 1114, 2, 10, true, false, false);
}

void RenderComboEffect (int cmb, int targcmb, int cmbeffect, int cseteffect, int itm, bool reverse, bool drawover, bool animatemoving){
	if (Screen->ComboD[cmb]!= targcmb)return;
	if (itm>0){
		if (reverse != Link->Item[itm]) return;
	}
	if (animatemoving && LinkMoving())Screen->FastCombo	(Cond(drawover, 4, 1), Link->X, Link->Y, cmbeffect+1, cseteffect, OP_OPAQUE);
	Screen->FastCombo	(Cond(drawover, 4, 1), Link->X, Link->Y, cmbeffect, cseteffect, OP_OPAQUE);
}

global script SandStorm{
    void run(){
		StartGhostZH();
		LinkMovement_Init();

		while(true){
			UpdateGhostZH1();
			LinkMovement_Update1();//Not needed for Combo Effects rendering
			
			Waitdraw();
			
			UpdateGhostZH2();
			LinkMovement_Update2();//Not needed for Combo Effects rendering
						
			Waitframe();
			
			UpdateComboEffects();
		}
	}
}

bool LinkMoving(){
	if (CanWalk(Link->X, Link->Y, DIR_UP, 1, false) && Link->InputUp) return true;
	if (CanWalk(Link->X, Link->Y, DIR_DOWN, 1, false) && Link->InputDown) return true;
	if (CanWalk(Link->X, Link->Y, DIR_LEFT, 1, false) && Link->InputLeft) return true;
	if (CanWalk(Link->X, Link->Y, DIR_RIGHT, 1, false) && Link->InputRight) return true;
	return false;
}