Example #1
0
func FxPointingTimer(object target, int index, int time) {
	if(time > PT0D_Duration) {
		RemoveObject(target);
		return -1;
	}

	var clonk = GetCursor(EffectVar(0, target, index));
	var obj = EffectVar(1, target, index);
	var msg = EffectVar(2, target, index);

	// Zeiger hat kein Ziel mehr? Löschen.
	if(!obj) {
		RemoveObject(target);
		return -1;
	}

	var ang = Angle(GetX(clonk), GetY(clonk), GetX(obj), GetY(obj)) - 90;
	var dst = Min(PT0D_Distance, Distance(GetX(clonk), GetY(clonk), GetX(obj), GetY(obj)) / 2);

	SetR(ang + 90, target);
	SetPosition(GetX(clonk) + Cos(ang, dst), GetY(clonk) + Sin(ang, dst), target);

	var r, g, b, a;
	SplitRGBaValue(GetClrModulation(target), r, g, b, a);

	a = EvalEase(alphaEase, Min(254, time));
	SetClrModulation(RGBa(r, g, b, a), target);
	Message("<c %x>%s</c>", target, RGBa(r, g, b, 255 - a), msg);

	return true;
}
Example #2
0
func Initialize() {
    //Ressource Buildings
    CreateConstruction(RFLN, 1040, 740, NO_OWNER, 100, 1, 0); //Flintfactory Middle
    CreateConstruction(RSMG, 810, 540, NO_OWNER, 100, 1, 0); //Steamgenerator Left
    CreateConstruction(RSMG, 1315, 545, NO_OWNER, 100, 1, 0); //Steamgenerator Left
    
    //Pipe to Steamgenerator
    CreateObject(PIPE, 1349, 1008, NO_OWNER);

    //Crumbling Islands (deco)
    var CIsleL = CreateObject(ISLE, 760, 810, NO_OWNER);
    CIsleL -> SetClrModulation(RGBa(200, 215, 255, 50));
    
    var CIsleM = CreateObject(ISLE,1100,1000, NO_OWNER);
    CIsleL -> SetClrModulation(RGBa(200, 215, 255, 80));
    
    var CIsleR = CreateObject(ISLE,1335,800, NO_OWNER);
    CIsleR -> SetClrModulation(RGBa(200, 215, 255, 30));
    

    CreateObject(WTFL, 814, 698, NO_OWNER); //Waterfall

    SetSkyParallax(1, 20, 0, 1, 0); //Sky move with Wind

    //Fog
    CreateObject(FOG_, 400, 1050, NO_OWNER);
    CreateObject(FOG_, 1200, 1050, NO_OWNER);
    CreateObject(FOG_, 2000, 1050, NO_OWNER);
    
    //static drafts
    var DraftWaterfall = CreateObject(DRFT, 760, 780, NO_OWNER);
	  DraftWaterfall -> SetPermanent();
	  DraftWaterfall -> SetR(-10);
	  
	  var MIsleL = CreateObject(DRFT, 992, 749, NO_OWNER);
	  MIsleL -> SetPermanent();
	  MIsleL -> SetR(-12);
	  
	  var MIsleR = CreateObject(DRFT, 1095, 780, NO_OWNER);
	  MIsleR -> SetPermanent();
	  MIsleR -> SetR(12);
	  
	  var IsleR = CreateObject(DRFT, 1310, 764, NO_OWNER);
	  IsleR -> SetPermanent();
	  IsleR -> SetR(-12);
	  
	  var IsleM = CreateObject(DRFT, 1060, 670, NO_OWNER);
	  IsleM -> SetPermanent();
	  
	  //thousands of vines!
	  PlaceVines();
	  
	  //mass epic wood
	  PlaceWood();
	  
	  // Island Respawn
  	PeriodicIslandRespawn(1993, 140, 750, 330, 250); // left 'home' island
  	PeriodicIslandRespawn(2007, 1620, 730, 310, 250); // right 'home' island
}
Example #3
0
func Timer()
{
	if(!Enabled) return();
	DrawParticleLine("MSpark", -10, 0, -10,LandscapeHeight(), 10, 100, RGBa(255,50,50,50), RGBa(255,255,50,100), -10);
	DrawParticleLine("MSpark", 10, 0, 10,LandscapeHeight(), 10, 100, RGBa(255,50,50,50), RGBa(255,255,50,100), -10);
	var pObj;
	for(pObj in FindObjects(Find_InRect(-10,-500,20,LandscapeHeight() + 1000)))
	{
		SetXDir(GetXDir(pObj) * -2,pObj);
		SetYDir(GetYDir(pObj) * -2,pObj);
	}
}
Example #4
0
protected func SmokeTrail() {
  Smoke(0, 0, 2);
  Smoke(0, -5, Random(3));
  var i = Random(20);
  while (i--) {
    var c = (20+Random(41))/2;
    CreateParticle("PxSpark", Random(11)-5, Random(11)-5, 0, 0, c,
      RGBa(255, Random(100), c*4, 128));
  }
  CreateParticle("PxSpark", 0, 0, 0, 0, 20,
    RGBa(255, 155, 0, 128));
  //Bitte hier Schaden für Wipfe setzen
  //*99/100 = Grenzwertig stark, *98/100=Meistens 0 Schaden
  SetYDir(GetYDir(this, 1000)*982/1000, this, 1000);
}
Example #5
0
func ChargeStop(proplist params)
{
	SetAction("Idle");
	var angle = params.new_angle;
	SetVelocity(angle, Speed-10, 10);
	
	Sound("sawblade_launch", false, 100);
	
	AddEffect("CheckEnemies", this, 1,1, this);
	
	SetLightRange(30, 70);
	SetLightColor(RGB(150, 150, 150));
	
	AddEffect("Life", this, 20, LifeTime, this);

	/*if(GetXDir() > 0)
		SetRDir(15);
	else
		SetRDir(-15);*/
	
	SetClrModulation(RGBa(255,255,255,255));
	Sound("sawloop", false, 20, nil, 1);
	
	AddEffect("Rotate", this, 1, 1, this);
}
Example #6
0
func SetIcon(number)
{
	markerindex = number;
	SetGraphics(Format("%d", number), Icon_Number, 1, GFXOV_MODE_Base);
	SetObjDrawTransform(350, 0, 2000, 0, 350, 2000, 1);
	SetClrModulation(RGBa(255, 255, 255, 160) , 1);
}
Example #7
0
global func SetObjAlpha(int byAlpha,object pObj) {
	var dwClrMod=GetClrModulation(pObj);
	if (dwClrMod == 0) dwClrMod = RGBa(255,255,255,0);

	dwClrMod = SetRGBaValue(dwClrMod,byAlpha,0);
 	return SetClrModulation(dwClrMod, pObj);
}
Example #8
0
func Initialize() {
  MarsSky();
  SetSkyAdjust(RGBa(255,255,255,160), RGB(70,30,15));
  //Hintergrund
  CreateObject(BG_1,-0,0,-1);
  CreateObject(DUSK,0,0,-1);
  ScriptGo(1);

  // Spielziel setzen
  var goal = FindObject(RCOB);
  goal->AddType(DBSE);
  goal->AddType(DLAB);
  goal->AddType(DSOL);
  
  //Forschungsstation
  PlaceObjects(DBSE,1,"Durolava",950,1200,150,150);
  PlaceObjects(DLAB,1,"Durolava",950,1200,150,150);
  PlaceObjects(BONE,9,"Durolava",950,1200,150,150);
  PlaceObjects(SKUL,3,"Durolava",950,1200,150,150);    
  PlaceObjects(DSOL,3,"Durolava",950,1200,150,150);   
  PlaceObjects(METL,2,"Durolava",950,1200,150,150);   
  PlaceObjects(CELL,1,"Durolava",950,1200,150,150);   
  PlaceObjects(SATD,1,"Durolava",950,1200,150,150);
  PlaceObjects(ORE1,8,"Durolava",950,1200,150,150);  
  
  // Spouter
  PlaceObjects(OILS, RandomX(1,3), "Oil", 0, 1300, LandscapeWidth(), 300);  
  
  // Kristalle
  PlaceCrystals(5, 20);
  
  return(1);
}
Example #9
0
global func InterpolateRGBa(RGBa_1,RGBa_2,x1,x2,x3)
{
  var r = Interpolate(GetRGBaValue(RGBa_1,1),GetRGBaValue (RGBa_2,1),x1,x2,x3);
  var g = Interpolate(GetRGBaValue(RGBa_1,2),GetRGBaValue (RGBa_2,2),x1,x2,x3);
  var b = Interpolate(GetRGBaValue(RGBa_1,3),GetRGBaValue (RGBa_2,3),x1,x2,x3);
  var a = Interpolate(GetRGBaValue(RGBa_1,0),GetRGBaValue (RGBa_2,0),x1,x2,x3);

  return(RGBa(r,g,b,a));
}
Example #10
0
func InitClouds()
{
	for(var i = 0; i < 8; i++)
	{
		var cloud = CreateObject(DecoCloud, Random(LandscapeWidth() + 400) - 200, Random(LandscapeHeight()), -1);
		cloud->SetClrModulation(RGBa(255, 128, 0, 40));
		cloud->SetXDir(RandomX(1, 3));
	}
}
Example #11
0
func FxShadowWalkStop(object target, proplist effect, int reason, bool temporary)
{
	if(temporary || !target)
		return;
	
	target.Visibility = VIS_All;
	target->SetClrModulation(RGBa(255, 255, 255, 255));
	target->Sound("reappear", false, 50);
	//target->CreateParticle("Smoke", PV_Random(-5,5), PV_Random(-10,10), PV_Random(-5,5), 0, 30, Particles_Smoke(), 20);
}
Example #12
0
func FxFadeAwayTimer(target, effect, time)
{
	if(time*2 > 250)
	{
		RemoveObject();
		return -1;
	}
	SetClrModulation(RGBa(255, 255, 255, 255 - time*2));
	SetObjDrawTransform(1000 - time * 3, 0, -(time * 2) * 700, 0, 1000 - time * 3);
}
Example #13
0
public func Activate(caster, real_caster) {
  // Zaubernden Clonk ermitteln
  var clonk = caster;
  if (real_caster) clonk = real_caster;
  // Kombiniert mit Beton -> Clonk in den Boden stecken
  var obj;
  if (!Contained(clonk) && (obj = FindContents(CNCR, clonk))) {
    var height = GetDefCoreVal("Height", "DefCore", GetID(clonk));
    var radius = RandomX(25, 35);
    var x = GetX(clonk);
    var y = GetY(clonk);
    // Unter dem Clonk freischütteln und buddeln
    DigFree(x, y+height+radius, height/2);
    ShakeFree(x, y+height+(radius/2), radius);
    // Tiefstes freigeschüttelte Y-Position ermitteln
    while (!GBackSolid(AbsX(x), AbsY(y++ + height))) {}
    // Effekte!
    DrawParticleLine("MSpark",
      0, 0, 0, AbsY(y),
      height*3/2, height*5/2,
      RGBa(255-Random(50),255-Random(50), 0,128),
      RGBa(155-Random(50),155-Random(50), 0,128),
      -10);
    // Zauberer an ermittelte Stelle versetzen
    SetPosition(x, y, clonk);
    // Objekt entfernen
    RemoveObject(obj);
  }
  // Sonst normale Wirkung (Gravitation erhöhen)
  else {
    // Gravitation bereits auf Maximum?
    if (GetGravity() >= 290)
      return(0, Message("$MsgAlreadyMaxed$", caster), RemoveObject());
    // Sonst erhöhen
    // Effekt global starten
    if (!AddEffect("GravChangeUSpell", 0, 150, 80, 0, MGDW, 20))
      return(0, RemoveObject());
    Message("$MsgRaised$", caster, GetGravity());
  }
  Sound("Magic1");
  RemoveObject();
  return(1);
}
Example #14
0
func Launch(object clonk, int x, int y)
{
	var params = {
		angle = Angle(0,0,x,y),
		cl = clonk
	};
	clonk->Charge(this, "ChargeStop", Charge_dur, params);
	SetAction("Travel");
	SetClrModulation(RGBa(255,255,255,0));
}
Example #15
0
func Launch(object clonk, int x, int y)
{
	CreateParticle("Smoke", PV_Random(-5,5), PV_Random(-10,10), PV_Random(-5,5), 0, 30, Particles_Smoke(), 20);
	clonk.Visibility = VIS_Owner;
	clonk->SetClrModulation(RGBa(255,255,255,50));
	clonk->Sound("vanish", false, 50);
	
	var fx = AddEffect("ShadowWalk", clonk, 20, 1, nil, GetID());
	fx.dur = Dur;
	RemoveObject();
}
Example #16
0
public func Activate(pCaller, pClonk)
{                            
  if(!pClonk) pClonk = pCaller;
  // Effekt prüfen
  var iChkEff;
  if (iChkEff = CheckEffect("CookPSpell", pCaller, 180)) return(iChkEff!=-1 && RemoveObject());
  // Inhalt untersuchen
  var obj = Contents(0, pClonk), obj2;
  var res;
  if(!obj) res = 0;
  else if(obj->~Cook()) res = 1; // Kochbar?
  else if(obj->~Bake()) res = 1; // Backbar?
  else if(GetAlive(obj)) { Kill(obj); res=1; } // Tötbar?
  
  if(!res) return(0, Message("$NoCook$", pCaller), RemoveObject());
  // Einmaliger Effekt pro Zauber
  Sound("Cook");
  CastParticles("Fire", 20, 30, 0, 0, 50, 70, RGBa(255, 100, 0, 50), RGBa(200, 100, 0, 75),pClonk);
  CastParticles("Fire2", 100, 50, 0, 0, 50, 70, RGBa(255, 100, 0, 50), RGBa(200, 100, 0, 75),pClonk);
  return(true);
}
Example #17
0
global func FxSmokeTrailTimer(object pTarget, int iEffectNumber, int iEffectTime)
{
  var iStrength = EffectVar(0, pTarget, iEffectNumber);
  var iAStr = EffectVar(1, pTarget, iEffectNumber);
  var iX = EffectVar(2, pTarget, iEffectNumber);
  var iY = EffectVar(3, pTarget, iEffectNumber);
  var iXDir = EffectVar(4, pTarget, iEffectNumber);
  var iYDir = EffectVar(5, pTarget, iEffectNumber);

  iAStr = Max(1,iAStr-iAStr/10+Random(2));
  iAStr--;
  iYDir += GetGravity()*2/3;
  iYDir += GetWind(iX,iY)/20;

  var xdir = iXDir*iAStr/iStrength;
  var ydir = iYDir*iAStr/iStrength;

  // Neu: Random
  iX += RandomX(-3,3);
  iY += RandomX(-3,3);
  
  // zuerst zeichnen
  CreateParticle("Smoke3",iX,iY,RandomX(-2,2),RandomX(-2,2)-3,20+iAStr*8,RGBa(128,128,128,55+35*iAStr/iStrength));
  CreateParticle("Blast",iX,iY,0,0,10+iAStr*8,RGBa(250,100+Random(100),100,160));

  // dann nächste position berechnen
  iX += xdir/100;
  iY += ydir/100;
  
  if(GBackSemiSolid(iX,iY))
    return -1;
  if(iAStr <= 1)
    return -1;
    
  EffectVar(1, pTarget, iEffectNumber) = iAStr;
  EffectVar(2, pTarget, iEffectNumber) = iX;
  EffectVar(3, pTarget, iEffectNumber) = iY;
  EffectVar(5, pTarget, iEffectNumber) = iYDir;
}
Example #18
0
func FxFadeAwayTimer(target, effect, time)
{
	var t2 = Max(0, time - 200);
	
	if(t2*2 > 250)
	{
		RemoveObject();
		return -1;
	}
	
	var x_pos = (t2 * 4) * 700;
	
	if(time < 100)
		x_pos = ((100 - time) * 1000);
	
	SetObjDrawTransform(1000 - t2, 0, x_pos, 0, 1000 - t2);
	SetObjDrawTransform(1000 - t2, 0, x_pos, 0, 1000 - t2, 0, 1);
	
	if(t2 == 0) return 1;
	SetClrModulation(RGBa(255, 255, 255, 255 - t2*2));
	SetClrModulation(RGBa(255, 255, 255, 255 - t2*2), 1);
	return 1;
}
Example #19
0
func FillCheck()
  {
  ++iTimer;
  if(!(iTimer%5))
    {
    var iX = Sin(GetR(), RandomX(-4,8) );
    var iY = -Cos(GetR(), RandomX(-4,4) );
    if(!Contained())
      CreateParticle("NoGravSpark", iX, iY,0,0,RandomX(25, 55),RGBa(255,255,0,120));
    iTimer=0;
    }
  if(GetMaterial() == Material("Water"))
    {
    if((iFill+=ExtractMaterialAmount(0,2, Material("Water"), 6))>=10 )
      ChangeDef(GBLT);
    }
  }
Example #20
0
func Initialize()
{
	this.Plane=301+Random(230);
	SetPosition(GetX(),GetY()+10);
	var graphic = Random(3);
	if(graphic)
		SetGraphics(Format("%d",graphic));
	size = 1;
	buriedtime = 0;
	waterpos = [0,0];
	SetObjDrawTransform(10,0,0,0,10);
	maxsize=150+Random(30);
	SetR(Random(360));
	SetClrModulation(RGBa(235+Random(20),235+Random(20),235+Random(20),255-Random(30)));
	AddEffect("MossGrow", this, 100, 20, this, this.ID);

}
Example #21
0
func FillCheck()
  {
  if(!Contained())
      if(Inside(GetR(), 20, 340))
        Hit();
    if(!(iTimer%5))
    {
    var iX = Sin(GetR(), RandomX(-4,4) );
    var iY = -Cos(GetR(), RandomX(-4,1) );
    if(!Contained())
      CreateParticle("NoGravSpark", iX, iY,0,0,RandomX(25, 55),RGBa(255,255,0,120));
    }
  iTimer++;
  if(iTimer>=17)
    {
    if(GetOCF(Contained()) & OCF_CrewMember())
      DoEnergy(+1, Contained());
    iTimer=0;
    }
  return(1);
  }
Example #22
0
func FrameDecorationBackClr() { return RGBa(0,0,0,128); }
Example #23
0
global func CreateBurnMark(int iX, int iY, int iLevel, int Count) 
{
  var boom;
  if(!ObjectCount(BOOM)) boom = CreateObject(BOOM,0,0,-1);
  else boom = FindObject(BOOM);
  
  var angle=Random(360/Count); //variablen für die überprüfung
  var type;
  for(var z; z < Count; z++)
	{
    angle += Max(1,360/Count);

    // Check: Sky or Solid/Liquid
    var x = iX+Cos(angle,iLevel);
    var y = iY+Sin(angle,iLevel);
    if((GetMaterialVal("Density","Material",GetMaterial(x,y)) != 0) || (GetMaterial(x,y) == -1))
      continue;

    type = 1+Random(3);
    var size = BurnMarkCheck(angle,RandomX(iLevel/2,iLevel*2),iX,iY);
    var sin = Sin(angle,(size-iLevel)/2+iLevel+Random(3));
    var cos = Cos(angle,(size-iLevel)/2+iLevel+Random(3));

    CreateParticle("BurnMark",iX+cos,iY+sin,Cos(angle+RandomX(-5,5),50),Sin(angle+RandomX(-5,5),50),size*5+Random(25),RGBa(0,0,0,64),boom,1); 
  }
}
Example #24
0
global func Explode(int iLevel, object pObj, id idEffect, string szEffect)
{
  if(!pObj)
    if(!(pObj=this))
      return;
  
  var x = AbsX(pObj->GetX()),
  	  y = AbsY(pObj->GetY());
			
  var boom = FindObject(BOOM);
  if(!boom) boom = CreateObject(BOOM,0,0,-1);
			
	var xdir = GetXDir(pObj) + GetWind(GetX(pObj),GetY(pObj))/20;
	var ydir = GetYDir(pObj);
	
	var opt_angle = Angle(xdir,ydir);
	var speed = BoundBy(Distance(xdir,ydir),0,60);
  
	
	///Feuer-, Funken- und Dirt-Effekte...
  var i=0, count = 3+iLevel/8, angle = Random(360);
  while((count > 0) && (++i < count*10))
  {
    angle += RandomX(40,80);
    
    angle = Interpolate4K(angle,opt_angle,0,60,speed);
    angle -= 180;
        
    //Rauch
    var smokex = +Sin(angle,RandomX(iLevel/4,iLevel/2));
    var smokey = -Cos(angle,RandomX(iLevel/4,iLevel/2));
    if(GBackSolid(x+smokex,y+smokey))
      continue;
     var level = iLevel + Random(iLevel/5);

		var a = angle+RandomX(-15,+15);
		for(var i = 7; i > 0; i--)
		  CreateParticle("BlastSpark1", smokex, smokey, +Sin(a,level+RandomX(-5,+5)), -Cos(a,level+RandomX(-5,+5)), 25+Random(50)); 
    CreateParticle("BlastFlame", smokex, smokey, +Sin(angle,level/2), -Cos(angle,level/2), level*5);
    for(var i = Random(3)+1; i > 0; i--)
		{
		  a = angle+RandomX(-30,+30);
		  CreateParticle("BlastDirt", smokex, smokey, +Sin(a,level+RandomX(-20,+20)), -Cos(a,level+RandomX(-20,+20)), level*RandomX(7,12));
		}
		//CreateSmokeTrail(level,angle,smokex,smokey,pObj);
    count--;
  }

	///Brandspuren...
  // Wir haben keine Effekteinstellungen oä., daher immer an
  //if(EffectLevel() > EM4K_Low)
    CreateBurnMark(x,y,iLevel,20+iLevel/2);

  ///Lichteffekte bei Dunkelheit...
  if(IsDark())
  {
    var iSize = iLevel*100;
    if(iLevel < 20)
      iSize /= 2;
    AddLightFlash(iSize/3, x, y, RGBa(255,220,64,15));
  }
	
	///Feuer-Effekt..
	/*angle = Interpolate4K(0,opt_angle,0,120,speed);
	angle -= 180;
	CreateParticle("BlastBg",0,0,+Sin(angle,100),-Cos(angle,100),iLevel*20);
	//CreateParticle("BlastBg",0,0,0,-1,iLevel*20);
	*/
	
	///Der eigentliche Blast-Partikel...
	CreateParticle("Blast",x,y,0,0,iLevel*11);

	///Standart-Verhalten...
  return inherited(iLevel, pObj, idEffect, szEffect);
}
Example #25
0
func Initialize() {
  SetSkyAdjust(RGBa(117,103,116,127), RGB(244,181,184));
  SetGamma(RGB(50,0,0), RGB(140,100,100), RGB(255,220,220));
  DigBuildingsFree();
  return(1);
}
Example #26
0
protected func FrameDecorationBackClr()
{
	return RGBa(50, 50, 50, 128);
}
global func LightColorCandle(){ return RGBa(255,216,132,70);}
Example #28
0
/* Langsam verschwinden */
func FadeMeOut() {
  SetClrModulation(RGBa(255,255,255,alpha++));
	if(alpha==255) return(RemoveObject());
	return(1);
}
Example #29
0
func PlacementEffects(x, y, color1, color2) 
{
  CastParticles("PxSpark", 50, 100, x, y, 5*8, 5*50, RGB(196, 196, 196), RGB(255, 255, 255));

  for (var i = 0; i < 5; i++)
    DrawParticleLine("PSpark", x-Random(400)+200,0, x,y, 8, 150 + 100 * (Random(3) == 0), RGBa(255,50+Random(100),50+Random(100),50), RGBa(50+Random(100),255,50+Random(100),100));
  
  return(1);
}
Example #30
0
{
	Attach = 
	{
		Prototype = Action,
		Name="Attach",
		Procedure=DFA_ATTACH,
		NextAction="Be",
		Length=1,
		FacetBase=1,
		AbortCall = "AttachTargetLost"
	}
};

func Init(to, max, cur, timeout, offset, visibility, data)
{
	data.color = data.color ?? RGBa(255, 255, 255,200);
	data.back_color = data.back_color ?? RGBa(50, 50, 50, 50);
	
	size = data.size ?? 1000;
	color = data.color;
	back_color = data.back_color;

	maximum = max;
	current = cur;
	timeout_time = timeout;
	
	ring = [];
	
	if(timeout_time)
	{
		var e = AddEffect("TimeOut", this, 1, BoundBy(timeout_time/2, 5, 35), this);