func ShroomCaveCheck() { var intruder = FindObject(Find_InRect(1252,1342,320,138), Find_OCF(OCF_CrewMember)); if (!intruder) return true; ClearScheduleCall(nil, Scenario.ShroomCaveCheck); return true; }
func Activate() { SetComDir(COMD_Stop(),Contained()); CreateMenu(NANO,Contained(),0,0,0,0,1); AddMenuItem("Selbst Injekzieren","Inject",GetID(Contained()),Contained()); if(FindObject2(Find_Distance(15),Find_Exclude(Contained()),Find_OCF(OCF_Alive()))) { for(next in FindObjects(Find_Distance(15),Find_Exclude(Contained()),Find_OCF(OCF_Alive()))) { AddMenuItem(Format("%s von %s Injekzieren",GetName(next),GetPlayerName(GetOwner(next))),"OtherInject",GetID(next),Contained(),0,next,"Naniten Injekzieren"); } return(1); } return(1); }
func ShroomCaveCheck() { var intruder = FindObject(Find_InRect(1252,1342,320,138), Find_OCF(OCF_CrewMember)); if (!intruder) return true; Dialogue->MessageBoxAll("$MsgEncounterShrooms$", intruder, true); ClearScheduleCall(nil, Scenario.ShroomCaveCheck); return true; }
public func GetDescription(int plr) { // Count active enemy clonks. var hostile_count = ObjectCount(Find_OCF(OCF_CrewMember), Find_NoContainer(), Find_Hostile(plr)); var message; if (!hostile_count) message = "$MsgGoalFulfilled$"; else message = Format("$MsgGoalUnfulfilled$", hostile_count); // Also report the remaining rounds. message = Format("%s|%s", message, CurrentRoundStr()); return message; }
private func CheckStuck() { var pClonk,iYChange,iX,iY; // Alle feststeckenden Clonks in der Nähe suchen for (pClonk in FindObjects(Find_InRect(-20,-20,40,40), Find_OCF(OCF_CrewMember),Find_NoContainer())) { iX=GetX(pClonk); iY=GetY(pClonk); while(Stuck(pClonk) && Inside(GetY(pClonk)-GetY(),-20,20)) { if(!(iYChange=BoundBy(GetY(pClonk)-GetY(),-1,1))) iYChange=1; // Zur Sicherheit... if(!Inside(GetY(pClonk)+iYChange,-100,LandscapeHeight())) break; SetPosition(GetX(pClonk),GetY(pClonk)+iYChange,pClonk); } // verschieben fehlgeschlagen: rückgängig machen if(Stuck(pClonk)) SetPosition(iX,iY,pClonk); } }
func Timer() { var pDead2, pNewTarget; if(!pTarget) { for(var pDead in FindObjects(Find_Action("Dead"), Find_Distance(100))) { if(GetPhase(pDead) < 4) if(PathFree(GetX(), GetY(), pDead->GetX(), pDead->GetY())) { pDead2 = pDead; break; } } pDead = pDead2; if(pDead) { for(pNewTarget in FindObjects(Find_OCF(OCF_Alive), Find_Distance(100), Find_Hostile(GetOwner(pDead)))) { if(PathFree(GetX(), GetY(), pNewTarget->GetX(), pNewTarget->GetY())) { iTimer = 0; pTarget = pNewTarget; } } } } if(pTarget) { iTimer++; if(iTimer%10 != 0) return; if(iTimer > 100) pTarget = 0; else if(!PathFree(GetX(), GetY(), pTarget->GetX(), pTarget->GetY()) && !pTarget->Contained()) pTarget = 0; if(!pTarget) return; Message("Töte niemanden an diesem heiligen Ort!", this); DrawLightning(GetX(),GetY(),pTarget->GetX(), pTarget->GetY()); Punch(pTarget, 5); } }
func Timer() { for(obj in FindObjects(Find_OCF(OCF_Construct()))) { obj -> DoCon(1); }
global func CyclopsFindTarget(fx) { // Consider hostile clonks, or all clonks if the AI does not have an owner. var hostile_criteria = Find_Hostile(fx.cyclops->GetOwner()); if (fx.cyclops->GetOwner() == NO_OWNER) hostile_criteria = Find_Not(Find_Owner(fx.cyclops->GetOwner())); for (var target in FindObjects(Find_InRect(fx.guard_range.x,fx.guard_range.y,fx.guard_range.wdt,fx.guard_range.hgt), Find_OCF(OCF_CrewMember), hostile_criteria, Find_NoContainer(), Sort_Random())) if (PathFree(fx.cyclops->GetX(),fx.cyclops->GetY(),target->GetX(),target->GetY())) return target; // Nothing found. return; }
// Lava hurts a lot. global func FxDangerousLavaTimer() { for (var burning in FindObjects(Find_ID(Clonk),Find_OCF(OCF_OnFire))) burning->DoEnergy(-3); }
func Initialize() { SetSolidMask(); if(GBackSolid()) { RemoveObject(); return 0; } SetSolidMask(0,0,10,10); var random = Random(5); if(random) { SetGraphics(Format("%d", random)); } SetR(Random(360)); SetRDir(2); SetAction("Travel"); AddEffect("Particles", this, 20, 1, this); for(var o in FindObjects(Find_OCF(OCF_Alive), Find_Distance(10))) { o->Unstuck(); } var smoke = { ForceX = PV_Wind(200 - 180), DampingX = 900, DampingY = 900, Alpha = PV_Linear(255, 0), R = 100, G = 100, B = 100, Size = PV_Linear(PV_Random(4, 10), PV_Random(20, 30)), Phase = PV_Random(0, 15) }; CreateParticle("Smoke", PV_Random(-5,5), PV_Random(-5,5), PV_Random(-15, 15), PV_Random(-15, 15), 30, smoke, 15); sharpflame = { Size = 10, R = 50, G = 255, B = 50, Alpha = 20, Rotation = PV_Random(0, 360), Phase = PV_Random(0, 5), OnCollision = 0, BlitMode = GFX_BLIT_Additive, }; lightning = { Prototype = Particles_ElectroSpark2(), Size = PV_Linear(PV_Random(2,5),0), BlitMode = GFX_BLIT_Additive, Rotation = PV_Random(0,360), R = 50, G = 255, B = 50, }; }
public func Place(int amount, proplist rectangle) { // No calls to objects, only definitions if (GetType(this) == C4V_C4Object) return; // Default parameters if (!amount) amount = 1; if (!rectangle) rectangle = Rectangle(0,0, LandscapeWidth(), LandscapeHeight()); var trees = FindObjects(Find_InRect(rectangle.x, rectangle.y, rectangle.w, rectangle.h), Find_OCF(OCF_Fullcon), Find_Func("IsTree"), Find_Func("IsStanding")); var hives = CreateArray(), hive; while (amount) { hive = nil; ShuffleArray(trees); for (var tree in trees) { hive = tree->CreateObjectInTreetop(this); if (hive) break; } if (hive) hives[GetLength(hives)] = hive; amount--; }