func Resize(iX,iY,iWidth,iHeight){
//Mittelpunkt bestimmen;
var iXMid = (iX+iX+iWidth)/2;
var iYMid = (iY+iY+iHeight)/2;
//Abweichung vom Mittelpunkt
var gX = GetX()-iXMid;
var gY = GetY()-iYMid;
//SetPosition(iXMid,iYMid);
SetObjDrawTransform(iWidth,,-gX*1000,,iHeight,-gY*1000);
SetSolidMask(,,iWidth,iHeight,iX,iY);
//Lokale Variablen im Objekt für den Effekt
iCX = iX;
iCY = iY;
iCWidth = iWidth;
iCHeight = iHeight;
}
func GrowToSize(iX,iY,iWidth,iHeight){
AddEffect("GrowToSize",this(),20,1,this(),,iX,iY,iWidth,iHeight);
}
func FxGrowToSizeStart(pTarget,iEffectNumber,iTemp,iX,iY,iWidth,iHeight){
EffectVar(0,pTarget,iEffectNumber) = iX;
EffectVar(1,pTarget,iEffectNumber) = iY;
EffectVar(2,pTarget,iEffectNumber) = iWidth;
EffectVar(3,pTarget,iEffectNumber) = iHeight;
}
func FxGrowToSizeTimer(pTarget,iEffectNumber){
var iXR = EffectVar(0,pTarget,iEffectNumber);
var iYR = EffectVar(1,pTarget,iEffectNumber);
var iWidthR = EffectVar(2,pTarget,iEffectNumber);
var iHeightR = EffectVar(3,pTarget,iEffectNumber);
var iX = iCX;
var iY = iCY;
var iWidth = iCWidth;
var iHeight = iCHeight;
//Die zu setzenden Werte aus den Momentanen (C) und zu Erreichenden (R) errechnen
if(iCX > iXR) iX = iCX-1;
if(iCY > iYR) iY = iCY-1;
if(iCWidth < iWidthR) iWidth = iCWidth+2;
if(iCHeight < iHeightR) iHeight = iCHeight+2;
//Log("iXR: %d iYR: %d iWidthR: %d iHeightR: %d",iXR,iYR,iWidthR,iHeightR);
//Log("iCX: %d iCY: %d iCWidth: %d iCHeight: %d",iCX,iCY,iCWidth,iCHeight);
//Log("iX: %d iY: %d iWidth: %d iHeight: %d",iX,iY,iWidth,iHeight);
Resize(iX,iY,iWidth,iHeight);
for(var pClonk in FindObjects(Find_Func("IsClonk"),Find_OCF(OCF_Alive),Find_InRect(AbsX(iX),AbsY(iY),iWidth,iHeight)))
SetPosition(GetX(pClonk),iY-10,pClonk);
if( (iCX == iXR) && (iCY == iYR) && (iCWidth == iWidthR) && (iCHeight == iHeightR) ){
GameCall("DoneResizing");
//Schedule("RemoveObject(this())",1,,this());
return -1;
}
}
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill