コード例 #1
0
ファイル: GZE_HitMask.c プロジェクト: ev1313/Widening-III
func CatchBlow(int iLevel, object pObj) {
	if (GetCategory(pObj) & C4D_Object && GetOCF(pObj) & OCF_Collectible && ObjectDistance(pObj)*10 < 8*Sqrt(GetDefWidth(GetID())*GetDefHeight(GetID())) ) {
		pObj->~Hit();
		// Reduces object speed by 90%
		if (pObj) {
			pObj->SetXDir(GetXDir()*5, 0, 100);
			pObj->SetYDir(GetYDir()*5, 0, 100);
		}
	}
	return _inherited(iLevel, pObj);
}
コード例 #2
0
ファイル: Script.c プロジェクト: chrisweidya/openclonk
public func ControlUse(object clonk, int x, int y)
{
	x = LandscapeWidth() / 2 + 100;
	y = baseHeight - 20;	
	DrawParticleLine("Flash", 0,0,-GetX()+x,-GetY()+y, 3, 0, 0, 8, {Prototype = Particles_Flash(), Size = 20, R = 50, G = 50, B = 255});

	// Make sure the clonk loses the attach procedure.
	var action = clonk->GetAction();
	if (action && clonk.ActMap[action].Procedure == DFA_ATTACH)
		clonk->SetAction("Jump");
	clonk->SetPosition(x, y);
	clonk->SetXDir(0);
	clonk->SetYDir(-5);

	RemoveObject();	
	return 1;
}