diff --git a/planet/Melees.c4f/Melee.c4s/Script.c b/planet/Melees.c4f/Melee.c4s/Script.c index 1913e5fc0..db188c371 100644 --- a/planet/Melees.c4f/Melee.c4s/Script.c +++ b/planet/Melees.c4f/Melee.c4s/Script.c @@ -55,7 +55,7 @@ global func CreateChestContents(id obj_id) if (obj_id == Musket) obj->CreateContents(LeadShot); obj->Enter(this); - return; + return; } // GameCall from MicroMelee_Relaunch diff --git a/planet/Melees.c4f/MeleeMountain.c4s/Script.c b/planet/Melees.c4f/MeleeMountain.c4s/Script.c index 203a30e39..8ba4fe609 100644 --- a/planet/Melees.c4f/MeleeMountain.c4s/Script.c +++ b/planet/Melees.c4f/MeleeMountain.c4s/Script.c @@ -47,7 +47,7 @@ global func CreateChestContents(id obj_id) if (obj_id == Musket) obj->CreateContents(LeadShot); obj->Enter(this); - return; + return; } // The weapons available to the players. Needed by MicroMelee_Relaunch diff --git a/planet/Melees.c4f/Pyramid.c4s/Script.c b/planet/Melees.c4f/Pyramid.c4s/Script.c index 645dc5d65..11976e81a 100644 --- a/planet/Melees.c4f/Pyramid.c4s/Script.c +++ b/planet/Melees.c4f/Pyramid.c4s/Script.c @@ -1,4 +1,4 @@ -/*-- +/*-- Pyramid Author: Maikel @@ -19,7 +19,7 @@ protected func Initialize() CreateObject(Chest, 200, 760, NO_OWNER); CreateObject(Chest, 970, 760, NO_OWNER); CreateObject(Chest, 860, 560, NO_OWNER); - CreateObject(Chest, 670, 610, NO_OWNER); + CreateObject(Chest, 670, 610, NO_OWNER); AddEffect("IntFillChests", nil, 100, 70, this); // Brick edges. @@ -65,7 +65,7 @@ protected func JoinPlayer(int plr) { var clonk = GetCrew(plr); clonk->DoEnergy(100000); - var x = Random(LandscapeWidth()), y = 590; + var x = Random(LandscapeWidth()), y = 590; clonk->SetPosition(x, y); return; } @@ -101,5 +101,5 @@ global func CreateChestContents(id obj_id) if (obj_id == Musket) obj->CreateContents(LeadShot); obj->Enter(this); - return; + return; } diff --git a/planet/Melees.c4f/Ruins.c4s/ObjectFade.c4d/Script.c b/planet/Melees.c4f/Ruins.c4s/ObjectFade.c4d/Script.c index efc819ef3..a78a23c01 100644 --- a/planet/Melees.c4f/Ruins.c4s/ObjectFade.c4d/Script.c +++ b/planet/Melees.c4f/Ruins.c4s/ObjectFade.c4d/Script.c @@ -35,7 +35,7 @@ public func FxIntFadeOutStart(object target, int num) { public func FxIntFadeOutTimer(object target, int num, int time) { if(time < fade_time * 2/3) return; //Log("%d,%d,%08x,%08x => %08x", fade_time, time, EffectVar(4, target, num), EffectVar(3, target, num), ((fade_time - time) * EffectVar(4, target, num) / (fade_time/3))); - if(!(target->Contained()) + if(!(target->Contained()) && EffectVar(0, target, num) == target->GetX() && EffectVar(1, target, num) == target->GetY() ) { diff --git a/planet/Melees.c4f/Ruins.c4s/Script.c b/planet/Melees.c4f/Ruins.c4s/Script.c index 2d14a46c6..485b9337f 100644 --- a/planet/Melees.c4f/Ruins.c4s/Script.c +++ b/planet/Melees.c4f/Ruins.c4s/Script.c @@ -11,11 +11,11 @@ protected func Initialize() CreateObject(Chest, 570, 220, NO_OWNER); CreateObject(Chest, 70, 80, NO_OWNER); CreateObject(Chest, 340, 200, NO_OWNER); - CreateObject(Rule_ObjectFade); - CreateObject(Rule_ObjectFade); - CreateObject(Rule_ObjectFade); - CreateObject(Rule_ObjectFade); - CreateObject(Rule_ObjectFade); + CreateObject(Rule_ObjectFade); + CreateObject(Rule_ObjectFade); + CreateObject(Rule_ObjectFade); + CreateObject(Rule_ObjectFade); + CreateObject(Rule_ObjectFade); AddEffect("IntFillChests", nil, 200, 70, this); Edges(); @@ -79,7 +79,7 @@ global func CreateChestContents(id obj_id) if (obj_id == Musket) obj->CreateContents(LeadShot); obj->Enter(this); - return; + return; } // GameCall from MicroMelee_Relaunch diff --git a/planet/Objects.c4d/Animals.c4d/Wolf.c4d/Script.c b/planet/Objects.c4d/Animals.c4d/Wolf.c4d/Script.c index 8d53eac00..ca8626511 100644 --- a/planet/Objects.c4d/Animals.c4d/Wolf.c4d/Script.c +++ b/planet/Objects.c4d/Animals.c4d/Wolf.c4d/Script.c @@ -29,7 +29,7 @@ protected func Activity() if (Random(2)) return; // Reproduction - if (!Random(ReproductionRate())) + if (!Random(ReproductionRate())) Reproduction(); // Jump @@ -76,7 +76,7 @@ public func TurnLeft() if (Stuck() || (GetAction() != "Walk" && GetAction() != "Swim")) return; if (GetXDir() > 0) SetXDir(0); SetDir(DIR_Left); - SetComDir(COMD_Left); + SetComDir(COMD_Left); return 1; } @@ -96,7 +96,7 @@ protected func CatchBlow() return 1; } -protected func Death() +protected func Death() { Sound("WolfDead"); // TODO Get Sound SetDir(0); diff --git a/planet/Objects.c4d/Clonk.c4d/Script.c b/planet/Objects.c4d/Clonk.c4d/Script.c index 1920fda67..6f32b61f4 100644 --- a/planet/Objects.c4d/Clonk.c4d/Script.c +++ b/planet/Objects.c4d/Clonk.c4d/Script.c @@ -224,7 +224,7 @@ protected func Death(int killed_by) GameCallEx("OnClonkDeath", this, killed_by); // The broadcast could have revived the clonk. - if (GetAlive()) + if (GetAlive()) return; Sound("Die"); @@ -237,7 +237,7 @@ protected func Death(int killed_by) protected func Destruction() { - // If the clonk wasn't dead yet, he will be now. + // If the clonk wasn't dead yet, he will be now. if (GetAlive()) GameCallEx("OnClonkDeath", this, GetKiller()); // If this is the last crewmember, do broadcast. @@ -312,7 +312,7 @@ func AttachHandItem(bool secondary) { if(!iHandMesh) iHandMesh = [0,0]; DetachHandItem(secondary); - UpdateAttach(); + UpdateAttach(); } func UpdateAttach() @@ -988,7 +988,7 @@ func FxIntWalkTimer(pTarget, iNumber, iTime) // Play animations AnimationSetState("StandTurn", EffectVar(18, pTarget, iNumber)*100, nil); AnimationSetState("RunTurn", EffectVar(18, pTarget, iNumber)*100, nil); - // + // if( ( EffectVar(17, pTarget, iNumber) == COMD_Left && GetDir() ) || ( EffectVar(17, pTarget, iNumber) == COMD_Right && !GetDir() ) ) { @@ -1281,7 +1281,7 @@ func FxIntHangleStart(pTarget, iNumber, fTmp) // EffectVars: // 0: whether the clonk is currently moving or not (<=> current animation is Hangle or HangleStand) // 1: Current animation number - // 6: Player requested the clonk to stop + // 6: Player requested the clonk to stop // 7: Whether the HangleStand animation is shown front-facing or back-facing // 10: Previous Hangle physical @@ -1636,7 +1636,7 @@ func FxIntThrowTimer(target, number, time) if(time == iThrowTime*8/15) DoThrow(EffectVar(0, target, number), EffectVar(1, target, number)); if(time >= iThrowTime) - return -1; + return -1; } func FxIntThrowStop(target, number, reason, tmp) diff --git a/planet/Objects.c4d/Effects.c4d/Bubble.c4d/Script.c b/planet/Objects.c4d/Effects.c4d/Bubble.c4d/Script.c index f9fffee11..26d6dd9d3 100644 --- a/planet/Objects.c4d/Effects.c4d/Bubble.c4d/Script.c +++ b/planet/Objects.c4d/Effects.c4d/Bubble.c4d/Script.c @@ -12,7 +12,7 @@ global func Bubble(int iamount, int x, int y) { CreateObject(Bubble1, x, y); ++i; - } + } } protected func Initialize() diff --git a/planet/Objects.c4d/Effects.c4d/Trajectory.c4d/Script.c b/planet/Objects.c4d/Effects.c4d/Trajectory.c4d/Script.c index 23fb84730..75a2ed99e 100644 --- a/planet/Objects.c4d/Effects.c4d/Trajectory.c4d/Script.c +++ b/planet/Objects.c4d/Effects.c4d/Trajectory.c4d/Script.c @@ -4,14 +4,14 @@ static const g_CrosshairID = Trajectory; protected func Initialize() { - SetProperty("Visibility",VIS_Owner); + SetProperty("Visibility",VIS_Owner); } global func RemoveTrajectory(object pObj) { - // Find and remove - var pTrajectory = FindObject(Find_ID(Trajectory), Find_ActionTarget(pObj)); - if(pTrajectory) pTrajectory->RemoveObject(); + // Find and remove + var pTrajectory = FindObject(Find_ID(Trajectory), Find_ActionTarget(pObj)); + if(pTrajectory) pTrajectory->RemoveObject(); } //pObj = Object which has the trajectory. pObj must be owned by a player for the player to see the trajectory. @@ -22,41 +22,41 @@ global func RemoveTrajectory(object pObj) //int spacing = distance of pixels between each trajectory particle global func AddTrajectory(object pObj, int iX, int iY, int iXDir, int iYDir, int iColor, int spacing) { - // Delete old trajectory - RemoveTrajectory(pObj); - // Create new helper object - var pTrajectory = CreateObject(Trajectory, pObj->GetX() - GetX(), pObj->GetY() - GetY(), pObj->GetOwner()); - pTrajectory->SetAction("Attach", pObj); - // Set starting values - var i = -1, iXOld, iYOld; - var iFaktor = 100; - iX *= iFaktor; iY *= iFaktor; - iYDir *= 5; iXDir *= 5; - iY -= 4*iFaktor; - iXOld = iX; iYOld = iY; - // Trajectory simulation - while(++i < 500) - { - // Speed and gravity offset - iX += iXDir; - iY += iYDir + GetGravity() * i / 20; - // If we are far enough away insert a new point + // Delete old trajectory + RemoveTrajectory(pObj); + // Create new helper object + var pTrajectory = CreateObject(Trajectory, pObj->GetX() - GetX(), pObj->GetY() - GetY(), pObj->GetOwner()); + pTrajectory->SetAction("Attach", pObj); + // Set starting values + var i = -1, iXOld, iYOld; + var iFaktor = 100; + iX *= iFaktor; iY *= iFaktor; + iYDir *= 5; iXDir *= 5; + iY -= 4*iFaktor; + iXOld = iX; iYOld = iY; + // Trajectory simulation + while(++i < 500) + { + // Speed and gravity offset + iX += iXDir; + iY += iYDir + GetGravity() * i / 20; + // If we are far enough away insert a new point if(!spacing) spacing = 10; - if(Distance((iXOld - iX) / iFaktor, (iYOld - iY) / iFaktor) >= spacing) - { - CreateParticle("Trajectory", iX/iFaktor - pTrajectory->GetX(), iY/iFaktor - pTrajectory->GetY(), iXDir/500, iYDir/500, 15, iColor, pTrajectory); - iXOld = iX; iYOld = iY; - } - // Or is it here already? - if(GBackSolid(iX / iFaktor - GetX(), iY / iFaktor - GetY())) break; - } - // So, ready - return pTrajectory; + if(Distance((iXOld - iX) / iFaktor, (iYOld - iY) / iFaktor) >= spacing) + { + CreateParticle("Trajectory", iX/iFaktor - pTrajectory->GetX(), iY/iFaktor - pTrajectory->GetY(), iXDir/500, iYDir/500, 15, iColor, pTrajectory); + iXOld = iX; iYOld = iY; + } + // Or is it here already? + if(GBackSolid(iX / iFaktor - GetX(), iY / iFaktor - GetY())) break; + } + // So, ready + return pTrajectory; } public func AttachTargetLost() { - RemoveObject(); + RemoveObject(); } local ActMap = { diff --git a/planet/Objects.c4d/Environment.c4d/Clouds.c4d/Cloud.c4d/Script.c b/planet/Objects.c4d/Environment.c4d/Clouds.c4d/Cloud.c4d/Script.c index 6a782b681..1aea3c3b6 100644 --- a/planet/Objects.c4d/Environment.c4d/Clouds.c4d/Cloud.c4d/Script.c +++ b/planet/Objects.c4d/Environment.c4d/Clouds.c4d/Cloud.c4d/Script.c @@ -23,7 +23,7 @@ protected func Initialize() SetPhase(RandomX(1,16)); //Push low flying clouds up to proper height - while(MaterialDepthCheck(GetX(),GetY(),"Sky",150)!=true) + while(MaterialDepthCheck(GetX(),GetY(),"Sky",150)!=true) { SetPosition(GetX(),GetY()-1); } @@ -53,7 +53,7 @@ public func Precipitation() } //acid precipitation - if(iWaitTime == 0 && szMat == "Acid") + if(iWaitTime == 0 && szMat == "Acid") { RainDrop(); iAcidity = --iAcidity; @@ -84,7 +84,7 @@ protected func Evaporation() //Creates a search line every x-amount(currently fi var iSearchX = GetX(); var iPrecision = 5; - if(iSize >= 700 || iAcidity >= 100) + if(iSize >= 700 || iAcidity >= 100) { iCondensing = 0; iSearchY = 0; @@ -92,7 +92,7 @@ protected func Evaporation() //Creates a search line every x-amount(currently fi } //line below prevents clouds evaporating through solids if(GetMaterial(0, iSearchY) != Material("Water") && GetMaterial(0, iSearchY) != Material("Acid") && GetMaterial(0, iSearchY) != Material("Sky")) return(iSearchY=0); - if(GetMaterial(0, iSearchY) == Material("Water")) + if(GetMaterial(0, iSearchY) == Material("Water")) { ExtractMaterialAmount(0, iSearchY,Material("Water"), 3); iSize = iSize+3; @@ -129,7 +129,7 @@ public func RainDrop() } //For use as scenario setting. Can work after initialize, if you really want to. -global func AdjustLightningFrequency(int iFreq) +global func AdjustLightningFrequency(int iFreq) { for(var Cloud in FindObjects(Find_ID(Cloud))) Cloud->SetLightningFrequency(iFreq); diff --git a/planet/Objects.c4d/Environment.c4d/Earthquake.c4d/Script.c b/planet/Objects.c4d/Environment.c4d/Earthquake.c4d/Script.c index 93f485343..aaa498b85 100644 --- a/planet/Objects.c4d/Environment.c4d/Earthquake.c4d/Script.c +++ b/planet/Objects.c4d/Environment.c4d/Earthquake.c4d/Script.c @@ -1,11 +1,11 @@ -/*-- +/*-- Earthquake Author: Maikel This is the earthquake control object, earthquakes are realized through a global effect. Earthquakes can be activated in Scenario.txt under [Environment], Earthquake=x will result - in a 10*x % earthquake level. You can also just create the control object and modify the - chance with Get/Set/DoChance. The third option is to directly launch an earthquake with + in a 10*x % earthquake level. You can also just create the control object and modify the + chance with Get/Set/DoChance. The third option is to directly launch an earthquake with LaunchEarthquake(int x, int y, int strength) at the global coordinates (x,y). --*/ @@ -35,14 +35,14 @@ public func GetChance() return EffectVar(0, this, effect); } -public func SetChance(int chance) +public func SetChance(int chance) { var effect = GetEffect("IntEarthquakeControl", this); EffectVar(0, this, effect) = BoundBy(chance, 0, 100); return; } -public func DoChance(int chance) +public func DoChance(int chance) { SetChance(GetChance() + chance); return; @@ -57,14 +57,14 @@ protected func FxIntEarthquakeControlTimer(object target, int fxnum, int time) return FX_OK; } -// Launches an earthquake with epicenter (x,y). +// Launches an earthquake with epicenter (x,y). global func LaunchEarthquake(int x, int y, int strength) -{ +{ // Earthquake should start in solid. if (!GBackSemiSolid(x, y)) return false; // Minimum strength is 15, maximum strength is 100. - strength = BoundBy(strength, 15, 100); + strength = BoundBy(strength, 15, 100); // The earthquake is handled by a global effect. var effect = AddEffect("IntEarthquake", 0, 100, 1, nil, Earthquake); EffectVar(0, 0, effect) = x; // Epicentre x coordinate. @@ -111,10 +111,10 @@ protected func FxIntEarthquakeTimer(object target, int fxnum, int time) ShakeObjects(x, y, 4 * str); // Move the quake around a little. var dx, dy, cnt = 0; - do + do { // Try ten times to find a nearby in material location. dx = Random(str * 4 + 1) - str * 2; - dy = Random(str * 4 + 1) - str * 2; + dy = Random(str * 4 + 1) - str * 2; cnt++; } while (!GBackSemiSolid(x + dx, y + dy) && cnt < 10) // No continuation. @@ -123,7 +123,7 @@ protected func FxIntEarthquakeTimer(object target, int fxnum, int time) // Set new position. EffectVar(0, 0, fxnum) += dx; EffectVar(1, 0, fxnum) += dy; - // Done. + // Done. return FX_OK; } diff --git a/planet/Objects.c4d/Environment.c4d/Edge.c4d/Script.c b/planet/Objects.c4d/Environment.c4d/Edge.c4d/Script.c index cb51a5d80..b4963af2d 100644 --- a/planet/Objects.c4d/Environment.c4d/Edge.c4d/Script.c +++ b/planet/Objects.c4d/Environment.c4d/Edge.c4d/Script.c @@ -1,14 +1,14 @@ -/*-- - Ecke +/*-- + Ecke Originally from Sven2 - Modified by Mimmo + Modified by Mimmo --*/ local dir; protected func Initialize() { - Snap(); - AutoP(); - return true; + Snap(); + AutoP(); + return true; } func PermaEdge() @@ -33,18 +33,18 @@ protected func AutoP() if(dir[0] && dir[3]) SetP(1); if(dir[2] && dir[3]) SetP(0); } - - + + public func Snap(int o,int p) - { - SetPosition((GetX()+5)/10*10-5+o, (GetY()+5)/10*10-5+p); - } +{ + SetPosition((GetX()+5)/10*10-5+o, (GetY()+5)/10*10-5+p); +} public func SetP(int p) - { - SetObjDrawTransform(1000-((p%2)*2000),0,0,0,1000-((p/2)*2000)); - SetAction("Edge"); SetPhase(p); - SetSolidMask(p*10,0,10,10); - dir=p; - } +{ + SetObjDrawTransform(1000-((p%2)*2000),0,0,0,1000-((p/2)*2000)); + SetAction("Edge"); SetPhase(p); + SetSolidMask(p*10,0,10,10); + dir=p; +} \ No newline at end of file diff --git a/planet/Objects.c4d/Environment.c4d/Time.c4d/Moon.c4d/Script.c b/planet/Objects.c4d/Environment.c4d/Time.c4d/Moon.c4d/Script.c index efcd424ab..d24251e3c 100644 --- a/planet/Objects.c4d/Environment.c4d/Time.c4d/Moon.c4d/Script.c +++ b/planet/Objects.c4d/Environment.c4d/Time.c4d/Moon.c4d/Script.c @@ -15,9 +15,9 @@ protected func Initialize() public func Phase(bool noAdvance) { if(noAdvance!=true) - { - if(phase<=5) phase=phase+1; - if(phase>=6) phase=1; + { + if(phase<=5) phase=phase+1; + if(phase>=6) phase=1; } if(phase==1) SetGraphics(); diff --git a/planet/Objects.c4d/Environment.c4d/Time.c4d/Script.c b/planet/Objects.c4d/Environment.c4d/Time.c4d/Script.c index 19559524c..9e76f4920 100644 --- a/planet/Objects.c4d/Environment.c4d/Time.c4d/Script.c +++ b/planet/Objects.c4d/Environment.c4d/Time.c4d/Script.c @@ -1,9 +1,9 @@ -/*-- +/*-- Time Controller Author:Ringwall Creates time based on the 24-hour time scheme. - Time is computed in minutes, which are by default + Time is computed in minutes, which are by default 1/2 a second in real life (18 frames). This will make each complete day/night cycle last 12 minutes in real life. @@ -24,14 +24,14 @@ global func SetTime(int iTime) //Sets the current time using a 1440-minute clock AddEffect("IntSunset",0,1,1); } - if(IsDay()==false && IsDay(iTime)==true) + if(IsDay()==false && IsDay(iTime)==true) { AddEffect("IntSunrise",0,1,1); } timeobject["itime"]=iTime; if(timeobject!=nil) return 1; - else + else return 0; } @@ -150,7 +150,7 @@ global func UpdateTime(bool advance) SetSkyAdjust(RGB(skyshade,skyshade,skyshade)); //time advancement - if(advance != true) + if(advance != true) return 1; if(GetTime()>=1439) SetTime(0); if(GetTime()<1439) SetTime(GetTime()+1); diff --git a/planet/Objects.c4d/Goals.c4d/KingOfTheHill.c4d/KingOfTheHillLocation.c4d/Script.c b/planet/Objects.c4d/Goals.c4d/KingOfTheHill.c4d/KingOfTheHillLocation.c4d/Script.c index 00c0e2113..4849c3f22 100644 --- a/planet/Objects.c4d/Goals.c4d/KingOfTheHill.c4d/KingOfTheHillLocation.c4d/Script.c +++ b/planet/Objects.c4d/Goals.c4d/KingOfTheHill.c4d/KingOfTheHillLocation.c4d/Script.c @@ -14,7 +14,7 @@ local timer; func Initialize() { - ScheduleCall(this, "PostInitialize", 1, 0); + ScheduleCall(this, "PostInitialize", 1, 0); timer=0; return(1); } @@ -120,8 +120,8 @@ func AdjustStarColor() { var percent=(king->GetEnergy() * 100) / (king->GetPhysical("Energy") / 1000); var red=255; if(percent > 50) red=(255*(100-2*(percent-50))) / 100; - var green=255; if(percent < 50) green=(255*(2*percent)) / 100; - color=RGB(red/2, green/2, 0); + var green=255; if(percent < 50) green=(255*(2*percent)) / 100; + color=RGB(red/2, green/2, 0); } else { diff --git a/planet/Objects.c4d/Goals.c4d/KingOfTheHill.c4d/Script.c b/planet/Objects.c4d/Goals.c4d/KingOfTheHill.c4d/Script.c index 32f4732fa..79756bcb8 100644 --- a/planet/Objects.c4d/Goals.c4d/KingOfTheHill.c4d/Script.c +++ b/planet/Objects.c4d/Goals.c4d/KingOfTheHill.c4d/Script.c @@ -162,9 +162,9 @@ private func CheckForWinner() if (check_plr == plr) continue; if (GetPlayerTeam(check_plr) != 0 && GetPlayerTeam(check_plr) == GetPlayerTeam(plr)) - continue; + continue; EliminatePlayer(check_plr); - } + } break; } } @@ -180,7 +180,7 @@ public func Activate(int byplr) for(var i=0;iGetPointLimit()); for(var i=0;i= time) - { + { RelaunchClonk(); return -1; } @@ -66,7 +66,7 @@ func FxIntTimeLimitTimer(target, num, fxtime) public func Selected(object menu, object selector) { - if (!selector) + if (!selector) return false; for (var i = 0; i < selector->GetAmount(); i++) @@ -88,7 +88,7 @@ private func RelaunchClonk() var clonk = Contents(); clonk->Exit(); GameCall("OnClonkLeftRelaunch", clonk); - if (menu) + if (menu) menu->Close(); PlayerMessage(clonk->GetOwner(), ""); RemoveObject(); diff --git a/planet/Objects.c4d/Goals.c4d/LastManStanding.c4d/Script.c b/planet/Objects.c4d/Goals.c4d/LastManStanding.c4d/Script.c index c525fd2a3..22bbdc6f0 100644 --- a/planet/Objects.c4d/Goals.c4d/LastManStanding.c4d/Script.c +++ b/planet/Objects.c4d/Goals.c4d/LastManStanding.c4d/Script.c @@ -38,7 +38,7 @@ private func RelaunchCount() { var relaunch_cnt = GameCall("RelaunchCount"); if (relaunch_cnt != nil) - return relaunch_cnt; + return relaunch_cnt; return MIME_RelaunchCount; } @@ -46,7 +46,7 @@ private func KillsToRelaunch() { var kills_to_relaunch = GameCall("KillsToRelaunch"); if (kills_to_relaunch != nil) - return kills_to_relaunch; + return kills_to_relaunch; return MIME_KillsToRelaunch; } @@ -88,7 +88,7 @@ protected func RelaunchPlayer(int plr, int killer) // Scenario script callback. GameCall("OnPlayerRelaunch", plr); // Show scoreboard for a while. - DoScoreboardShow(1, plr + 1); + DoScoreboardShow(1, plr + 1); Schedule(Format("DoScoreboardShow(-1, %d)", plr + 1), 35 * MIME_ShowBoardTime); return; // _inherited(plr, killer, ...); } diff --git a/planet/Objects.c4d/Goals.c4d/Melee.c4d/Script.c b/planet/Objects.c4d/Goals.c4d/Melee.c4d/Script.c index 6e32b8001..6e7eead9d 100644 --- a/planet/Objects.c4d/Goals.c4d/Melee.c4d/Script.c +++ b/planet/Objects.c4d/Goals.c4d/Melee.c4d/Script.c @@ -22,9 +22,9 @@ protected func InitializePlayer(int newplr, int x, int y, object base, int team) private func CheckTeamHostile(int plr1, int plr2) { var team1 = GetPlayerTeam(plr1); - if (team1 != GetPlayerTeam(plr2)) + if (team1 != GetPlayerTeam(plr2)) return true; - if (team1) + if (team1) return false; return Hostile(plr1, plr2); } @@ -40,7 +40,7 @@ public func IsFulfilled() // Compare with other players. for (var j = i + 1; j < GetPlayerCount(); j++) { - var plr2cmp = GetPlayerByIndex(j); + var plr2cmp = GetPlayerByIndex(j); // Still enemy players out there? if (CheckTeamHostile(plr, plr2cmp) ) return false; } @@ -59,7 +59,7 @@ public func Activate(int byplr) var plr = GetPlayerByIndex(i); if (plr == byplr) continue; - if (Hostile(plr, byplr) ) + if (Hostile(plr, byplr) ) hostile_count++; } diff --git a/planet/Objects.c4d/Goals.c4d/Parkour.c4d/Arrow.c4d/Script.c b/planet/Objects.c4d/Goals.c4d/Parkour.c4d/Arrow.c4d/Script.c index 2a7adfdbb..5b33e8d5c 100644 --- a/planet/Objects.c4d/Goals.c4d/Parkour.c4d/Arrow.c4d/Script.c +++ b/planet/Objects.c4d/Goals.c4d/Parkour.c4d/Arrow.c4d/Script.c @@ -1,7 +1,7 @@ /*-- Parkour arrow --*/ protected func Initialize() -{ +{ this["Visibility"] = VIS_Owner; return; } @@ -20,6 +20,6 @@ local ActMap = { Wdt = 40, Hgt = 20, NextAction = "Show", - }, + }, }; local Name = "$Name$"; diff --git a/planet/Objects.c4d/Goals.c4d/Parkour.c4d/CheckPoint.c4d/Script.c b/planet/Objects.c4d/Goals.c4d/Parkour.c4d/CheckPoint.c4d/Script.c index 179f38cef..ff071ebaa 100644 --- a/planet/Objects.c4d/Goals.c4d/Parkour.c4d/CheckPoint.c4d/Script.c +++ b/planet/Objects.c4d/Goals.c4d/Parkour.c4d/CheckPoint.c4d/Script.c @@ -1,4 +1,4 @@ -/*-- +/*-- CheckPoint Author: Maikel @@ -24,7 +24,7 @@ static const PARKOUR_CP_Check = 8; static const PARKOUR_CP_Ordered = 16; static const PARKOUR_CP_Bonus = 32; -public func SetCPMode(int mode) +public func SetCPMode(int mode) { if (mode & PARKOUR_CP_Start) // Start always occurs alone. mode = PARKOUR_CP_Start; @@ -36,7 +36,7 @@ public func SetCPMode(int mode) // Set CP number. SetCPNumber(ObjectCount(Find_ID(GetID()), Find_Func("GetCPNumber")) + 1); } - cp_mode = mode; + cp_mode = mode; DoGraphics(); return; } @@ -48,19 +48,19 @@ public func FindCPMode(int mode) { return cp_mode & mode; } /*-- Checkpoint controller --*/ local cp_con; -public func SetCPController(object con) -{ - cp_con = con; - return; +public func SetCPController(object con) +{ + cp_con = con; + return; } /*-- Checkpoint number --*/ local cp_num; -public func SetCPNumber(int num) -{ - cp_num = num; - return; +public func SetCPNumber(int num) +{ + cp_num = num; + return; } public func GetCPNumber() { return cp_num; } @@ -78,7 +78,7 @@ protected func Initialize() UpdateGraphics(); AddEffect("IntCheckpoint", this, 100, 1, this); return; -} +} /*-- Checkpoint status --*/ @@ -103,7 +103,7 @@ public func IsActiveForPlr(int plr) return false; return true; } - if (cp_mode & PARKOUR_CP_Ordered) + if (cp_mode & PARKOUR_CP_Ordered) { if (GetCPNumber() == 1) // First ordered checkpoint is always active. return true; @@ -137,7 +137,7 @@ public func ResetCleared() // reset progress done by players /*-- Checkpoint activity --*/ protected func FxIntCheckpointTimer(object target, int fxnum, int fxtime) -{ +{ if (!(fxtime % 5)) CheckForClonks(); UpdateGraphics(fxtime); @@ -148,7 +148,7 @@ protected func CheckForClonks() { // Loop through all clonks inside the checkpoint. for (var pClonk in FindObjects(Find_OCF(OCF_CrewMember), Find_Distance(20))) - { + { var plr = pClonk->GetOwner(); var team = GetPlayerTeam(plr); var plrid = GetPlayerID(plr); @@ -156,7 +156,7 @@ protected func CheckForClonks() if (!IsActiveForPlr(plr) && !IsActiveForTeam(team)) continue; // Check respawn status. - if (cp_mode & PARKOUR_CP_Respawn) + if (cp_mode & PARKOUR_CP_Respawn) if (cp_con) cp_con->SetPlrRespawnCP(plr, this); // Notify race goal. // If already done by player -> continue. @@ -178,7 +178,7 @@ protected func CheckForClonks() } } // Check finish status. - if (cp_mode & PARKOUR_CP_Finish) + if (cp_mode & PARKOUR_CP_Finish) { Sound("Cleared", false, nil, plr); aDoneByPlr[plrid] = true; @@ -198,10 +198,10 @@ protected func CheckForClonks() public func SetBaseGraphics(id gfx, int mod) { - // Update base graphics in overlay layer 1 - SetGraphics("", gfx, 1, GFXOV_MODE_Base); - SetClrModulation(mod , 1); - return true; + // Update base graphics in overlay layer 1 + SetGraphics("", gfx, 1, GFXOV_MODE_Base); + SetClrModulation(mod , 1); + return true; } // Mode graphics. @@ -255,7 +255,7 @@ protected func GetColorByAngle(int angle) for (var i = 0; i < GetPlayerCount(); i++) if (ClearedByPlr(GetPlayerByIndex(i)) || (cp_mode & PARKOUR_CP_Start)) cnt++; - if (!cnt) + if (!cnt) return RGBa(255, 255, 255, 192); var prt = 360 / cnt; diff --git a/planet/Objects.c4d/Goals.c4d/Parkour.c4d/Script.c b/planet/Objects.c4d/Goals.c4d/Parkour.c4d/Script.c index 47289e546..c94d855f1 100644 --- a/planet/Objects.c4d/Goals.c4d/Parkour.c4d/Script.c +++ b/planet/Objects.c4d/Goals.c4d/Parkour.c4d/Script.c @@ -1,5 +1,5 @@ -/*-- - Parkour +/*-- + Parkour Authors: Maikel The goal is to be the first to reach the finish, the team or player to do so wins the round. @@ -10,7 +10,7 @@ * Ordered: On/Off - The checkpoints mussed be passed in the order specified. * The start and finish are also checkpoints. - TODO: + TODO: * Update CP Graphics -> looks satisfactory atm but cpu intensive. * Add significant message under goal, done. --*/ @@ -190,7 +190,7 @@ public func GetShortDescription(int plr) if (pos == 1) msg = "$MsgDescTeamFirst$"; if (pos == 2) - msg = "$MsgDescTeamSecond$"; + msg = "$MsgDescTeamSecond$"; if (pos == 3) msg = "$MsgDescTeamThird$"; if (pos >= 4) @@ -202,19 +202,19 @@ public func GetShortDescription(int plr) if (pos == 1) msg = "$MsgDescFirst$"; if (pos == 2) - msg = "$MsgDescSecond$"; + msg = "$MsgDescSecond$"; if (pos == 3) msg = "$MsgDescThird$"; if (pos >= 4) - msg = Format("$MsgDescNth$", pos); - } + msg = Format("$MsgDescNth$", pos); + } return msg; } private func GetPlayerPosition(int plr) { var pos = 1; - var plrid = GetPlayerID(plr); + var plrid = GetPlayerID(plr); for (var i = 0; i < GetPlayerCount(); i++) if (plr_list[plrid] < plr_list[GetPlayerID(GetPlayerByIndex(i))]) pos++; @@ -375,12 +375,12 @@ protected func FxIntDirNextCPTimer(object target, int fxnum) { nextcp = cp; break; - } + } if (!nextcp) return EffectVar(0, target, fxnum)->SetClrModulation(RGBa(0, 0, 0, 0)); // Calculate parameters. var angle = Angle(target->GetX(), target->GetY(), nextcp->GetX(), nextcp->GetY()); - var dist = Min(510 * ObjectDistance(GetCrew(plr), nextcp) / 400, 510); + var dist = Min(510 * ObjectDistance(GetCrew(plr), nextcp) / 400, 510); var red = BoundBy(dist, 0, 255); var green = BoundBy(510 - dist, 0, 255); var color = RGBa(red, green, 0, 128); @@ -449,7 +449,7 @@ private func SetEvalData(int winner) for (var i = 0; i < GetPlayerCount(); i++) AddEvalData(GetPlayerByIndex(i)); // Obviously get rid of settlement score. - HideSettlementScoreInEvaluation(true); + HideSettlementScoreInEvaluation(true); return; } diff --git a/planet/Objects.c4d/Goals.c4d/ScriptGoal.c4d/Script.c b/planet/Objects.c4d/Goals.c4d/ScriptGoal.c4d/Script.c index 1b8838167..eb0c2cdb4 100644 --- a/planet/Objects.c4d/Goals.c4d/ScriptGoal.c4d/Script.c +++ b/planet/Objects.c4d/Goals.c4d/ScriptGoal.c4d/Script.c @@ -1,4 +1,4 @@ -/*-- +/*-- Script goal Author: Maikel @@ -16,9 +16,9 @@ protected func Initialize() return inherited(...); } -public func IsFulfilled() -{ - return fulfilled; +public func IsFulfilled() +{ + return fulfilled; } public func Fulfill() diff --git a/planet/Objects.c4d/HUD.c4d/Controller.c4d/Script.c b/planet/Objects.c4d/HUD.c4d/Controller.c4d/Script.c index 2ddb568f4..2fa250681 100644 --- a/planet/Objects.c4d/HUD.c4d/Controller.c4d/Script.c +++ b/planet/Objects.c4d/HUD.c4d/Controller.c4d/Script.c @@ -153,14 +153,14 @@ public func OnCrewSelection(object clonk, bool deselect) { // selected if(!deselect) - { + { // fill actionbar // inventory var i; for(i = 0; i < Min(2,clonk->HandObjects()); ++i) { ActionButton(clonk,i,clonk->GetItem(i),ACTIONTYPE_INVENTORY); - } + } ClearButtons(i); // and start effect to monitor vehicles and structures... @@ -175,7 +175,7 @@ public func OnCrewSelection(object clonk, bool deselect) } public func FxIntSearchInteractionObjectsEffect(string newname, object target, int num, int new_num) -{ +{ if(newname == "IntSearchInteractionObjects") return -1; } diff --git a/planet/Objects.c4d/HUD.c4d/Elements.c4d/Goal.c4d/Script.c b/planet/Objects.c4d/HUD.c4d/Elements.c4d/Goal.c4d/Script.c index 78e6d9cde..a0d3fd646 100644 --- a/planet/Objects.c4d/HUD.c4d/Elements.c4d/Goal.c4d/Script.c +++ b/planet/Objects.c4d/HUD.c4d/Elements.c4d/Goal.c4d/Script.c @@ -22,7 +22,7 @@ public func Update() var hudinfo = goal->~GetShortDescription(GetOwner()); if(hudinfo) CustomMessage(Format("@%s",hudinfo), this, GetOwner(), 0, 90); - else + else CustomMessage("", this, GetOwner(), 0, 90); SetGraphics(nil,goal->GetID(),1,GFXOV_MODE_IngamePicture); diff --git a/planet/Objects.c4d/HUD.c4d/Elements.c4d/ObjectSelector.c4d/ExtraSlot.c4d/Script.c b/planet/Objects.c4d/HUD.c4d/Elements.c4d/ObjectSelector.c4d/ExtraSlot.c4d/Script.c index 8048680cf..8d24d2f78 100644 --- a/planet/Objects.c4d/HUD.c4d/Elements.c4d/ObjectSelector.c4d/ExtraSlot.c4d/Script.c +++ b/planet/Objects.c4d/HUD.c4d/Elements.c4d/ObjectSelector.c4d/ExtraSlot.c4d/Script.c @@ -101,8 +101,8 @@ public func SetObject(object obj) RemoveEffect("IntRemoveGuard",myobject); - if(!myobject) - { + if(!myobject) + { SetGraphics(nil,nil,1); SetName("$TxtEmpty$"); this["MouseDragImage"] = nil; diff --git a/planet/Objects.c4d/HUD.c4d/Elements.c4d/ObjectSelector.c4d/Script.c b/planet/Objects.c4d/HUD.c4d/Elements.c4d/ObjectSelector.c4d/Script.c index cf48b1b5c..95b0c0890 100644 --- a/planet/Objects.c4d/HUD.c4d/Elements.c4d/ObjectSelector.c4d/Script.c +++ b/planet/Objects.c4d/HUD.c4d/Elements.c4d/ObjectSelector.c4d/Script.c @@ -137,7 +137,7 @@ public func MouseSelection(int plr) { myobject->Interact(crew); return true; - } + } } } @@ -280,8 +280,8 @@ public func SetObject(object obj, int type, int pos, int hot) myobject = obj; hotkey = hot; - if(!myobject) - { + if(!myobject) + { SetGraphics(nil,nil,1); SetName(Format("$TxtSlot$",pos+1)); this["MouseDragImage"] = nil; @@ -392,7 +392,7 @@ public func UpdateSelectionStatus() } else if(actiontype == ACTIONTYPE_VEHICLE) if(crew->GetProcedure() == "PUSH" && crew->GetActionTarget() == myobject) - sel = 1; + sel = 1; else if(actiontype == ACTIONTYPE_STRUCTURE) if(crew->Contained() == myobject) sel = 1; diff --git a/planet/Objects.c4d/HUD.c4d/Ringmenu.c4d/Menupoint.c4d/Script.c b/planet/Objects.c4d/HUD.c4d/Ringmenu.c4d/Menupoint.c4d/Script.c index c007921a0..a730242ae 100644 --- a/planet/Objects.c4d/HUD.c4d/Ringmenu.c4d/Menupoint.c4d/Script.c +++ b/planet/Objects.c4d/HUD.c4d/Ringmenu.c4d/Menupoint.c4d/Script.c @@ -5,7 +5,7 @@ 0=Grey Circle 1=Icon of the Object 2,3=Extraslot - 10,11,12= Amount + 10,11,12= Amount */ @@ -41,8 +41,8 @@ public func SetSymbol(obj) this["Visibility"] = VIS_Owner; - if(!obj) - { + if(!obj) + { SetGraphics(nil, nil, 1); SetGraphics(nil, nil, 2); SetGraphics(nil, nil, 3); @@ -122,7 +122,7 @@ public func SetAmount(Amount) if(hun > 0) { SetGraphics(Format("%d",hun),Icon_SlimNumber,10,GFXOV_MODE_IngamePicture); - SetObjDrawTransform(s,0,xoffs-spacing*3-500,0,s,yoffs+300, 9); + SetObjDrawTransform(s,0,xoffs-spacing*3-500,0,s,yoffs+300, 9); SetObjDrawTransform(s,0,xoffs-spacing*2,0,s,yoffs, 10); } diff --git a/planet/Objects.c4d/HUD.c4d/Ringmenu.c4d/Script.c b/planet/Objects.c4d/HUD.c4d/Ringmenu.c4d/Script.c index 1ece807c8..700572122 100644 --- a/planet/Objects.c4d/HUD.c4d/Ringmenu.c4d/Script.c +++ b/planet/Objects.c4d/HUD.c4d/Ringmenu.c4d/Script.c @@ -52,7 +52,7 @@ global func CreateRingMenu(id symbol, object commander) menu->SetMenu(this,commander); menu->SetMenuIcon(symbol); menu->Hide(); - return menu; + return menu; } @@ -65,19 +65,19 @@ public func GetMenuObject() public func SetMenu(object menuobject, object commandobject) { if(menuobject->GetOCF() & OCF_CrewMember) - menu_object=menuobject; + menu_object=menuobject; command_object=commandobject; menuobject->~SetMenu(this); -} +} //re-set icon func SetMenuIcon(id symbol) { - this["Visibility"] = VIS_Owner; - if(!symbol) - { + this["Visibility"] = VIS_Owner; + if(!symbol) + { SetGraphics(nil,nil,0); SetGraphics(nil,nil,1); } @@ -90,17 +90,17 @@ func SetMenuIcon(id symbol) } //adds an item, icon, amount, extra (the item can be an object too) -public func AddItem(new_item, int amount, extra) -{ +public func AddItem(new_item, int amount, extra) +{ var index = GetLength(menu_icons); menu_icons[index] = CreateObject(GUI_RingMenu_Icon,0,0,menu_object->GetOwner()); menu_icons[index]->SetSymbol(new_item); - menu_icons[index]->SetExtraData(extra); + menu_icons[index]->SetExtraData(extra); if(amount == nil) { menu_icons[index]->SetAmount(1); } - else + else { menu_icons[index]->SetAmount(amount); } @@ -111,7 +111,7 @@ public func AddItem(new_item, int amount, extra) //selects by dx,dy and alt=alternative selection public func Select(int dx, int dy, bool alt) { - var item_count=GetLength(menu_icons); + var item_count=GetLength(menu_icons); if(!item_count) if(command_object->Selected(this,nil,alt)) Close(); @@ -134,17 +134,17 @@ public func Select(int dx, int dy, bool alt) func IsVisible() { return shown; } //makes me visible/updates me -func Show() +func Show() { - var item_count = GetLength(menu_icons); + var item_count = GetLength(menu_icons); if(!item_count) return; var segment=360/item_count; var x = GetX(); var y = GetY(); - for(var i=0; i~MenuClosed(this); - RemoveObject(); + RemoveObject(); } local Name = "$Name$"; diff --git a/planet/Objects.c4d/Items.c4d/Resources.c4d/Loam.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Resources.c4d/Loam.c4d/Script.c index 314fd0b1b..63bc502a6 100644 --- a/planet/Objects.c4d/Items.c4d/Resources.c4d/Loam.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Resources.c4d/Loam.c4d/Script.c @@ -124,7 +124,7 @@ public func ControlUseCancel(object clonk, int x, int y) } private func LoamDone(object clonk) -{ +{ // Get out of animation if(clonk->GetAction() == "Bridge") { diff --git a/planet/Objects.c4d/Items.c4d/Tools.c4d/Axe.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Tools.c4d/Axe.c4d/Script.c index 9e26c85f9..263d978ad 100644 --- a/planet/Objects.c4d/Items.c4d/Tools.c4d/Axe.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Tools.c4d/Axe.c4d/Script.c @@ -7,7 +7,7 @@ private func Hit() } public func ControlUse(object pByClonk, int iX, int iY) -{ +{ var pTree; if( pTree = FindObject(Find_AtPoint(iX, iY), Find_Func("IsTree") && Find_Func("IsStanding")) ) { diff --git a/planet/Objects.c4d/Items.c4d/Tools.c4d/Barrel.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Tools.c4d/Barrel.c4d/Script.c index afdabd7f2..952fb658d 100644 --- a/planet/Objects.c4d/Items.c4d/Tools.c4d/Barrel.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Tools.c4d/Barrel.c4d/Script.c @@ -1,8 +1,8 @@ -/*-- +/*-- Wooden Barrel Author: Ringwaul - The barrel is used to transport liquids + The barrel is used to transport liquids --*/ local szLiquid; @@ -62,7 +62,7 @@ private func FillBarrel(string szMat) var iCapacity = 300; if(iVolume >= 1 && szMat != szLiquid) return 0; - while(iVolume != iCapacity && GetMaterial(0,iDrain) == Material(szMat)) + while(iVolume != iCapacity && GetMaterial(0,iDrain) == Material(szMat)) { ExtractLiquid(0,iDrain); iVolume = ++iVolume; diff --git a/planet/Objects.c4d/Items.c4d/Tools.c4d/Boompack.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Tools.c4d/Boompack.c4d/Script.c index 5ae6d889b..90cd5f7dc 100644 --- a/planet/Objects.c4d/Items.c4d/Tools.c4d/Boompack.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Tools.c4d/Boompack.c4d/Script.c @@ -8,7 +8,7 @@ he is attached, he has more control over it than if it were just in his inventory: The ControlLeft/Right/Up/Down callbacks are issued to the boom- pack too. Here, they are used to slightly steer the boompack to the left - or right plus to jump off the rocket. + or right plus to jump off the rocket. --*/ local fuel; @@ -31,7 +31,7 @@ protected func Destruction() } func ControlRight() -{ +{ SetRDir(+3); return true; } @@ -61,7 +61,7 @@ func ControlUseStart(object clonk, int x, int y) } func ControlUse(object clonk, int x, int y) -{ +{ // forward control to item if(clonk->GetProcedure()=="ATTACH") return false; diff --git a/planet/Objects.c4d/Items.c4d/Tools.c4d/CableReel.c4d/PowerLine.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Tools.c4d/CableReel.c4d/PowerLine.c4d/Script.c index 3877a115f..8a99cd2fe 100644 --- a/planet/Objects.c4d/Items.c4d/Tools.c4d/CableReel.c4d/PowerLine.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Tools.c4d/CableReel.c4d/PowerLine.c4d/Script.c @@ -25,8 +25,8 @@ public func GetConnectedObject(object pObject) { if(GetActionTarget(0) == pObject) return GetActionTarget(1); - if(GetActionTarget(1) == pObject) - return GetActionTarget(0); + if(GetActionTarget(1) == pObject) + return GetActionTarget(0); return; } diff --git a/planet/Objects.c4d/Items.c4d/Tools.c4d/CableReel.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Tools.c4d/CableReel.c4d/Script.c index 18f3669c3..772ff7f5f 100644 --- a/planet/Objects.c4d/Items.c4d/Tools.c4d/CableReel.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Tools.c4d/CableReel.c4d/Script.c @@ -19,7 +19,7 @@ protected func Activate(object pClonk) // Is there an object which accepts power lines? var pObj = FindObject(Find_AtPoint(), Find_Func("CanPowerConnect")); // No such object -> message. - if(!pObj) + if(!pObj) return pClonk->Message("$TxtNoNewLine$"); // Is there a power line connected to this wire roll? var pLine = FindObject(Find_PowerLine()); @@ -32,7 +32,7 @@ protected func Activate(object pClonk) Sound("Connect"); pClonk->Message("$TxtLineRemoval$"); return true; - } + } else // Connect existing power line to pObj. { if(pLine->GetActionTarget(0) == this) diff --git a/planet/Objects.c4d/Items.c4d/Tools.c4d/Dynamite.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Tools.c4d/Dynamite.c4d/Script.c index 684762e8c..bb3aa70cc 100644 --- a/planet/Objects.c4d/Items.c4d/Tools.c4d/Dynamite.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Tools.c4d/Dynamite.c4d/Script.c @@ -2,7 +2,7 @@ Dynamite Author: Newton - A volatile tool that can be pressed into walls + A volatile tool that can be pressed into walls for accurate mining, burning a short fuse before exploding. */ @@ -99,7 +99,7 @@ protected func Incineration() { Extinguish(); Fuse(); } protected func RejectEntrance() { - return GetAction() == "Fuse" || GetAction() == "Ready"; + return GetAction() == "Fuse" || GetAction() == "Ready"; } // Controle of the Dynamite box @@ -118,7 +118,7 @@ public func Reset() SetAction("Idle"); } -private func Fusing() +private func Fusing() { var sin=Sin(180-GetR(),5); var cos=Cos(180-GetR(),5); diff --git a/planet/Objects.c4d/Items.c4d/Tools.c4d/DynamiteBox.c4d/Fuse.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Tools.c4d/DynamiteBox.c4d/Fuse.c4d/Script.c index 16dd0b61a..86ea3867a 100644 --- a/planet/Objects.c4d/Items.c4d/Tools.c4d/DynamiteBox.c4d/Fuse.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Tools.c4d/DynamiteBox.c4d/Fuse.c4d/Script.c @@ -21,7 +21,7 @@ public func SetColorWarning(fOn) public func Connect(pTarget1, pTarget2) { - SetAction("Connect", pTarget1, pTarget2); + SetAction("Connect", pTarget1, pTarget2); } private func GetLineLength() diff --git a/planet/Objects.c4d/Items.c4d/Tools.c4d/DynamiteBox.c4d/Igniter.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Tools.c4d/DynamiteBox.c4d/Igniter.c4d/Script.c index ad7e0c4ea..58fd01d0a 100644 --- a/planet/Objects.c4d/Items.c4d/Tools.c4d/DynamiteBox.c4d/Igniter.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Tools.c4d/DynamiteBox.c4d/Igniter.c4d/Script.c @@ -48,7 +48,7 @@ public func Ignite(clonk) pIgniteClonk = clonk; if (aWires[iIgniteNumber]) aWires[iIgniteNumber]->StartFusing(this); - else + else for (var obj in FindObjects(Find_Category(C4D_StaticBack), Find_Func("IsFuse"), Find_ActionTargets(this))) obj->~StartFusing(this); diff --git a/planet/Objects.c4d/Items.c4d/Tools.c4d/GrappleBow.c4d/Hook.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Tools.c4d/GrappleBow.c4d/Hook.c4d/Script.c index 17920c7bc..6bb2cd298 100644 --- a/planet/Objects.c4d/Items.c4d/Tools.c4d/GrappleBow.c4d/Hook.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Tools.c4d/GrappleBow.c4d/Hook.c4d/Script.c @@ -2,7 +2,7 @@ Grapple Hook Author: Randrian - The hook can be shot with the grappling bow. + The hook can be shot with the grappling bow. On impact the hook will stick to the ground The hook also controls the swinging controls for the clonk */ diff --git a/planet/Objects.c4d/Items.c4d/Tools.c4d/Hammer.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Tools.c4d/Hammer.c4d/Script.c index 29eedf53d..d3b12ab78 100644 --- a/planet/Objects.c4d/Items.c4d/Tools.c4d/Hammer.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Tools.c4d/Hammer.c4d/Script.c @@ -11,16 +11,16 @@ public func GetCarryBone() { return "main"; } public func GetCarryTransform() { return Trans_Rotate(90,0,1,0); } public func ControlUse(object clonk, int ix, int iy) -{ +{ clonk->Message("Using hammer"); // Stop clonk clonk->SetComDir(COMD_Stop); // Is the clonk able to build? if (clonk && !clonk->GetPhysical("CanConstruct", PHYS_Current) && CheckCanUse(clonk)==true) - { - PlayerMessage(clonk->GetController(), "$TxtCantConstruct$", clonk->GetName()); - return 1; + { + PlayerMessage(clonk->GetController(), "$TxtCantConstruct$", clonk->GetName()); + return 1; } if(clonk->GetAction()=="Build") //Stop building diff --git a/planet/Objects.c4d/Items.c4d/Tools.c4d/JarOfWinds.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Tools.c4d/JarOfWinds.c4d/Script.c index d05e12ea0..5511f06d6 100644 --- a/planet/Objects.c4d/Items.c4d/Tools.c4d/JarOfWinds.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Tools.c4d/JarOfWinds.c4d/Script.c @@ -14,7 +14,7 @@ public func GetCarryPhase() { return 600; } public func FxJarReloadTimer(object target, int effect, int time) { - target->Load(); + target->Load(); } protected func Initialize() @@ -29,7 +29,7 @@ protected func ControlUse(object pClonk, iX, iY) if(!GetEffect("JarReload",this)) { if(!GBackLiquid()) - { + { FireWeapon(pClonk, iX, iY); Amount=0; AddEffect("JarReload",this,100,1,this); @@ -42,7 +42,7 @@ protected func ControlUse(object pClonk, iX, iY) { pClonk->Message("Reloading!"); return true; - } + } ChargeSoundStop(); } @@ -103,7 +103,7 @@ private func FireWeapon(object pClonk,iX,iY) Sin(180 - Angle(0,0,iX,iY) + (R),(Amount / 2) + 25), Cos(180 - Angle(0,0,iX,iY) + (R),(Amount / 2) + 25), Max(i + 30, 90), - ); + ); } } @@ -115,7 +115,7 @@ private func FireWeapon(object pClonk,iX,iY) var x = pClonk->GetXDir(); var y = pClonk->GetYDir(); pClonk->SetXDir((x) - (sinspeed / 3)); - pClonk->SetYDir((y) - (cosspeed / 3)); + pClonk->SetYDir((y) - (cosspeed / 3)); } for( var obj in FindObjects( @@ -126,7 +126,7 @@ private func FireWeapon(object pClonk,iX,iY) ), Find_Not(Find_Category(C4D_Structure)) ) - ) + ) { if(obj != pClonk && PathFree(pClonk->GetX(),pClonk->GetY(),obj->GetX(),obj->GetY())) { diff --git a/planet/Objects.c4d/Items.c4d/Tools.c4d/OrbOfTelekinesis.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Tools.c4d/OrbOfTelekinesis.c4d/Script.c index d7fbcf700..721b2d216 100644 --- a/planet/Objects.c4d/Items.c4d/Tools.c4d/OrbOfTelekinesis.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Tools.c4d/OrbOfTelekinesis.c4d/Script.c @@ -29,13 +29,13 @@ public func ControlUseHolding(object pClonk, ix, iy) if(target!=nil && pClonk->GetProcedure()== "WALK") - { + { //Magical particle effect if(Distance(GetX(),GetY(),GetX()+ix,GetY()+iy)<150) - { - var partx=-(Sin(180-Angle(0,0,ix,iy), 100)/10); - var party=-(Cos(180-Angle(0,0,ix,iy), 100)/10); - if(Random(3)==1)CreateParticle("Magic",ix,iy,partx,party,magic/10+50,RGB(0,220,250)); + { + var partx=-(Sin(180-Angle(0,0,ix,iy), 100)/10); + var party=-(Cos(180-Angle(0,0,ix,iy), 100)/10); + if(Random(3)==1) CreateParticle("Magic",ix,iy,partx,party,magic/10+50,RGB(0,220,250)); } //Don't mess around with underground objects. This stops you from triggering flints underground by pulling on them. diff --git a/planet/Objects.c4d/Items.c4d/Tools.c4d/PowderKeg.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Tools.c4d/PowderKeg.c4d/Script.c index 485e49571..7d2947e92 100644 --- a/planet/Objects.c4d/Items.c4d/Tools.c4d/PowderKeg.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Tools.c4d/PowderKeg.c4d/Script.c @@ -1,4 +1,4 @@ -/*-- +/*-- Powder Keg Author: Ringwaul diff --git a/planet/Objects.c4d/Items.c4d/Weapons.c4d/Javelin.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Weapons.c4d/Javelin.c4d/Script.c index 404d6ace5..94a34ffed 100644 --- a/planet/Objects.c4d/Items.c4d/Weapons.c4d/Javelin.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Weapons.c4d/Javelin.c4d/Script.c @@ -1,4 +1,4 @@ -/*-- +/*-- Javelin Author: Ringwaul @@ -147,13 +147,13 @@ public func OnStrike(object obj) } protected func Hit() -{ +{ if(GetEffect("Flight",this)) { Stick(); Sound("JavelinHitGround.ogg"); } - else + else Sound("WoodHit"); } diff --git a/planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/Ammo.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/Ammo.c4d/Script.c index 4b1aeb898..41af938e4 100644 --- a/planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/Ammo.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/Ammo.c4d/Script.c @@ -28,7 +28,7 @@ public func Launch(object shooter, int angle, int dist, int speed) SetController(shooter->GetController()); AddEffect("HitCheck", this, 1,1, nil,nil, shooter); - LaunchProjectile(angle, dist, speed); + LaunchProjectile(angle, dist, speed); // remove after some time SetAction("Travel"); diff --git a/planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/BulletTrail.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/BulletTrail.c4d/Script.c index 7e51c6541..9d206e302 100644 --- a/planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/BulletTrail.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/BulletTrail.c4d/Script.c @@ -18,7 +18,7 @@ local fRemove, iSpeed, pShot, w, l, r, x, y; public func Set(int iWidth, int iLength, object pSht) { - pShot = pSht; + pShot = pSht; w = 1000*iWidth/this["ActMap"]["Travel"]["Wdt"]; l = 1000*iLength/this["ActMap"]["Travel"]["Hgt"]; @@ -61,7 +61,7 @@ private func Traveling() // Display DrawTransform(); - if(pShot) + if(pShot) if(pShot->~TrailColor(GetActTime()) != nil) SetClrModulation(pShot->~TrailColor(GetActTime())); @@ -90,7 +90,7 @@ public func DrawTransform() { if(!fRemove && l < relative_length) return; // stretch >-< - if(fRemove) l = Max(0,l-iSpeed); + if(fRemove) l = Max(0,l-iSpeed); // stretch <-> var h = Min(l,relative_length); diff --git a/planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/Script.c index e8d75f634..3fa55301c 100644 --- a/planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/Script.c @@ -15,7 +15,7 @@ public func GetCarryMode(clonk) { if(fAiming >= 0) return CARRY_Musket; } public func GetCarrySpecial(clonk) { if(fAiming > 0) return "pos_hand2"; } public func GetCarryBone() { return "main"; } public func GetCarryTransform() -{ +{ return Trans_Rotate(-90, 0, 1, 0); } diff --git a/planet/Objects.c4d/Items.c4d/Weapons.c4d/Shield.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Weapons.c4d/Shield.c4d/Script.c index 9b251d692..ab9d54d60 100644 --- a/planet/Objects.c4d/Items.c4d/Weapons.c4d/Shield.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Weapons.c4d/Shield.c4d/Script.c @@ -60,24 +60,24 @@ func AdjustSolidMaskHelper() solid_mask_helper->SetAction("Attach", Contained()); } } - else + else { if(solid_mask_helper) return solid_mask_helper->RemoveObject(); else return; - } + } - var angle=BoundBy(iAngle, 0, 115); + var angle=BoundBy(iAngle, 0, 115); if(iAngle > 180) angle=BoundBy(iAngle, 180+65, 360); solid_mask_helper->SetR(angle - 90); var distance=10; var y_adjust=-5; var x_adjust=1; - if(Contained()->GetDir() == DIR_Left) x_adjust=-1; + if(Contained()->GetDir() == DIR_Left) x_adjust=-1; var x=Sin(angle, distance) + x_adjust; var y=-Cos(angle, distance) + y_adjust; - solid_mask_helper->SetVertexXY(0, -x, -y); + solid_mask_helper->SetVertexXY(0, -x, -y); } func ControlUseHolding(clonk, x, y) @@ -144,7 +144,7 @@ func CheckStrike(iTime) if(obj->GetOCF() & OCF_Alive) { if(push_livings) - { + { found_alive=true; obj->SetXDir((obj->GetXDir() + Contained()->GetXDir() * 3) / 4); obj->SetYDir((obj->GetYDir() + Contained()->GetYDir() * 3) / 4); @@ -159,7 +159,7 @@ func CheckStrike(iTime) //if(speed > 5000) continue; speed=Max(150, speed/2); obj->SetXDir(+Sin(a, speed), 100); - obj->SetYDir(-Cos(a, speed), 100); + obj->SetYDir(-Cos(a, speed), 100); found=true; } diff --git a/planet/Objects.c4d/Items.c4d/Weapons.c4d/Shield.c4d/ShieldSolidMask.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Weapons.c4d/Shield.c4d/ShieldSolidMask.c4d/Script.c index e94a8c000..e1d3b477c 100644 --- a/planet/Objects.c4d/Items.c4d/Weapons.c4d/Shield.c4d/ShieldSolidMask.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Weapons.c4d/Shield.c4d/ShieldSolidMask.c4d/Script.c @@ -1,8 +1,8 @@ /*--Helper --*/ -func Initialize() { - - return(1); +func Initialize() +{ + return(1); } func Definition(def) { diff --git a/planet/Objects.c4d/Items.c4d/Weapons.c4d/Sword.c4d/Script.c b/planet/Objects.c4d/Items.c4d/Weapons.c4d/Sword.c4d/Script.c index fa5dd00ce..918891291 100644 --- a/planet/Objects.c4d/Items.c4d/Weapons.c4d/Sword.c4d/Script.c +++ b/planet/Objects.c4d/Items.c4d/Weapons.c4d/Sword.c4d/Script.c @@ -93,7 +93,7 @@ func OnWeaponHitCheckStop(clonk) if(GetEffect("SwordStrikeSpeedUp", clonk)) RemoveEffect("SwordStrikeSpeedUp", clonk); //if(GetEffect("DelayTranslateVelocity", clonk)) - // RemoveEffect("DelayTranslateVelocity", clonk); + // RemoveEffect("DelayTranslateVelocity", clonk); return; } diff --git a/planet/Objects.c4d/Libraries.c4d/AutoProduction.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/AutoProduction.c4d/Script.c index 56746a721..86e527fff 100644 --- a/planet/Objects.c4d/Libraries.c4d/AutoProduction.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/AutoProduction.c4d/Script.c @@ -11,7 +11,7 @@ public func ControlCommandAcquire(target, x, y, target2, def) AddCommand ("Get", obj, 0, 0, 0, 40); return 1; } - // Search for a building to produce the object + // Search for a building to produce the object if (obj = GetProducerOf (def)) { AddCommand ( "Call", this, 0, 0, 0, 0, "AutoProduction", 0, 1); obj -> HowToProduce (this, def); @@ -23,13 +23,13 @@ public func ControlCommandAcquire(target, x, y, target2, def) public func AutoProduction() { return 1; } -public func AutoProductionFailed() +public func AutoProductionFailed() { var def = GetCommand (5, 1); - if (!FindContents(def)) + if (!FindContents(def)) { var obj = GetAvailableObject (def, GetCommand ( 4, 1)); - if (obj) + if (obj) { AddEffect("IntNotAvailable", obj, 1, 5, this); AddCommand ("Get", obj,0,0,0,40); @@ -49,7 +49,7 @@ public func FxIntNotAvailableTimer(target, number) { var clonk = EffectVar(0, target, number); // Check wether the clonk still wants to get the object - for (var i = 0; clonk->GetCommand(0,i); ++i) + for (var i = 0; clonk->GetCommand(0,i); ++i) { if (clonk->GetCommand(0, i) == "Get" && clonk->GetCommand(1, i) == target) return; diff --git a/planet/Objects.c4d/Libraries.c4d/Base.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/Base.c4d/Script.c index 38149c571..eb919845d 100644 --- a/planet/Objects.c4d/Libraries.c4d/Base.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/Base.c4d/Script.c @@ -267,7 +267,7 @@ func DoBuy(id idDef, int iForPlr, int iPayPlr, object pClonk, bool bRight, bool if(pObj->GetOCF() & OCF_CrewMember) pObj->MakeCrewMember(iForPlr); if(pObj->GetOCF() & OCF_Collectible) pClonk->Collect(pObj); // is right clicked? then buy another object - if(bRight) + if(bRight) DoBuy(idDef, iForPlr, iPayPlr, pClonk, bRight, iValue, 1); return pObj; } @@ -396,7 +396,7 @@ func DoSell(object pObj, int iPlr, bool bRight) if(CanStack(pObj, pNewObj) && pObj != pNewObj) { bFound = 1; - break; + break; } } // And remove the object diff --git a/planet/Objects.c4d/Libraries.c4d/ClonkControl.c4d/Crosshair.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/ClonkControl.c4d/Crosshair.c4d/Script.c index f78c4da3f..d3f68e3c7 100644 --- a/planet/Objects.c4d/Libraries.c4d/ClonkControl.c4d/Crosshair.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/ClonkControl.c4d/Crosshair.c4d/Script.c @@ -155,7 +155,7 @@ public func Aim(int ctrl, object clonk, int strength, int repeat, int release) // aiming with analog pad if (ctrl == CON_AimAxisUp || ctrl == CON_AimAxisDown || ctrl == CON_AimAxisLeft || ctrl == CON_AimAxisRight) - { + { dirx = diry = 0; if(ctrl == CON_AimAxisUp) ypos = -strength; diff --git a/planet/Objects.c4d/Libraries.c4d/ClonkControl.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/ClonkControl.c4d/Script.c index a1471ee09..156a07fd4 100644 --- a/planet/Objects.c4d/Libraries.c4d/ClonkControl.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/ClonkControl.c4d/Script.c @@ -25,7 +25,7 @@ *Left, *Right, *Up, *Down *Use, *UseStop, *UseStart, *UseHolding, *UseCancel wheras * is 'Contained' if the clonk is contained and otherwise (riding, - pushing, to self) it is 'Control'. The item in the inventory only gets + pushing, to self) it is 'Control'. The item in the inventory only gets the Use*-calls. If the callback is handled, you should return true. Currently, this is explained more in detail here: http://forum.openclonk.org/topic_show.pl?tid=337 @@ -226,7 +226,7 @@ protected func Ejection(object obj) var success = false; for(var item in inventory) { - if (obj == item) + if (obj == item) { inventory[i] = nil; indexed_inventory--; @@ -315,7 +315,7 @@ protected func AttachTargetLost() { CancelUse(); return _inherited(...); } // ...aaand the same for when the clonk is deselected protected func CrewSelection(bool unselect) { - if (unselect) + if (unselect) { // cancel usage on unselect first... CancelUse(); @@ -520,10 +520,10 @@ public func ObjectControl(int plr, int ctrl, int x, int y, int strength, bool re { /* objects to which clonks are attached (like horses, mechs,...) have a special handling: - movement controls are forwarded normally to the horse as if it is a + movement controls are forwarded normally to the horse as if it is a pushed vehicle. Use controls however are, too, forwarded to the - horse but if the control is considered unhandled (return false) on - the start of the usage, the control is forwarded further to the + horse but if the control is considered unhandled (return false) on + the start of the usage, the control is forwarded further to the item. If the item then returns true on the call, that item is regarded as the used item for the subsequent ControlUse* calls. BUT the horse always gets the ControlUse*-calls that'd go to the used @@ -606,10 +606,10 @@ public func ObjectControl(int plr, int ctrl, int x, int y, int strength, bool re // throw if (ctrl == CON_ThrowAlt) { - if (proc == "SCALE" || proc == "HANGLE") - return ObjectCommand("Drop", contents2); - else - return ObjectCommand("Throw", contents2, x, y); + if (proc == "SCALE" || proc == "HANGLE") + return ObjectCommand("Drop", contents2); + else + return ObjectCommand("Throw", contents2, x, y); } // throw delayed if (ctrl == CON_ThrowAltDelayed) @@ -877,7 +877,7 @@ private func Control2Menu(int ctrl, int x, int y, int strength, bool repeat, boo /* all this stuff is already done on a higher layer - in playercontrol.c now this is just the same for gamepad control */ - + if (!PlayerHasVirtualCursor(GetOwner())) return false; @@ -888,7 +888,7 @@ private func Control2Menu(int ctrl, int x, int y, int strength, bool repeat, boo // update angle for visual effect on the menu if (repeat) - { + { if (ctrl == CON_UseDelayed || ctrl == CON_UseAltDelayed) this->GetMenu()->~UpdateCursor(mex,mey); } @@ -905,7 +905,7 @@ private func Control2Menu(int ctrl, int x, int y, int strength, bool repeat, boo // Control use redirected to script private func ControlUse2Script(int ctrl, int x, int y, int strength, bool repeat, bool release, string control, object obj) -{ +{ // click on secondary cancels primary and the other way round if (using) { @@ -1136,7 +1136,7 @@ private func ShiftVehicle(int plr, bool back) ObjectCommand("Grab", objs[index]); return true; -} +} /* Virtual cursor stuff */ @@ -1215,7 +1215,7 @@ func SetMenu(object m) // new one menu = m; if (menu) - { + { CancelUse(); // stop clonk SetComDir(COMD_Stop); @@ -1284,7 +1284,7 @@ func Selected(object mnu, object mnu_item, bool alt) var show_new_item = GetItem(hands_index); mnu_item->SetSymbol(show_new_item); // swap index with backpack index - Switch2Items(hands_index, backpack_index); + Switch2Items(hands_index, backpack_index); return false; } @@ -1313,7 +1313,7 @@ private func DoThrow(object obj, int angle) iYDir += GetYDir(1000)/2; // throw - obj->Exit(iX, iY, iR, 0, 0, iRDir); + obj->Exit(iX, iY, iR, 0, 0, iRDir); obj->SetXDir(iXDir,1000); obj->SetYDir(iYDir,1000); diff --git a/planet/Objects.c4d/Libraries.c4d/ContextMenu.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/ContextMenu.c4d/Script.c index ca1182f29..2cf58a82e 100644 --- a/planet/Objects.c4d/Libraries.c4d/ContextMenu.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/ContextMenu.c4d/Script.c @@ -31,7 +31,7 @@ protected func ControlSpecial2() /* Context menu entries */ -/*public func ContextRelease(pCaller) +/*public func ContextRelease(pCaller) { [$CtxRelease$|Image=CXRL|Condition=ReleaseAllowed] FindObject(REAC)->Activate(GetOwner()); @@ -41,7 +41,7 @@ protected func ControlSpecial2() public func ContextEnergy(pCaller) { [$TxtEnergysupply$|Image=CXEC|Condition=AtEnergySite] - var pSite; + var pSite; if (pSite = FindEnergySite()) SetCommand("Energy", pSite); return 1; @@ -50,7 +50,7 @@ public func ContextEnergy(pCaller) public func ContextConstructionSite(pCaller) { [$CtxConstructionMaterial$|Image=CXCM|Condition=AtConstructionSite] - var pSite; + var pSite; if (pSite = FindConstructionSite()) pSite->PlayerMessage(GetOwner(), pSite->GetNeededMatStr()); return 1; @@ -59,7 +59,7 @@ public func ContextConstructionSite(pCaller) public func ContextChop(pCaller) { [$CtxChop$|Image=CXCP|Condition=AtTreeToChop] - var pTree; + var pTree; if (pTree = FindTree()) SetCommand("Chop", pTree); return 1; @@ -80,7 +80,7 @@ public func ContextHome(pCaller) return 1; } -public func ContextDescend(pCaller) +public func ContextDescend(pCaller) { [$TxtDescend$|Image=DSCN|Condition=IsRiding] DescendVehicle(); @@ -162,5 +162,5 @@ public func DescendVehicle() // Vehicle is stuck as well? Back to the roots. SetPosition(x,y); } - } + } } diff --git a/planet/Objects.c4d/Libraries.c4d/Goal.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/Goal.c4d/Script.c index 6b04fcbf5..2e3aea86a 100644 --- a/planet/Objects.c4d/Libraries.c4d/Goal.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/Goal.c4d/Script.c @@ -1,5 +1,5 @@ -/*-- - Goal control +/*-- + Goal control Author: Sven2 Include this to all C4D_Goal objects @@ -38,7 +38,7 @@ func RecheckGoalTimer() if (!GetEffect("IntGoalCheck", 0)) { var timer_interval = 35; - if (GetLeague()) + if (GetLeague()) timer_interval = 2; // league has more frequent checks var num = AddEffect("IntGoalCheck", 0, 1, timer_interval, 0); FxIntGoalCheckTimer(nil, num); @@ -52,7 +52,7 @@ public func NotifyHUD() { var plr = GetPlayerByIndex(i); var HUD = FindObject(Find_ID(GUI_Controller), Find_Owner(plr)); - if (HUD) + if (HUD) HUD->OnGoalUpdate(this); } } @@ -60,7 +60,7 @@ public func NotifyHUD() protected func InitializePlayer(int plr) { var HUD = FindObject(Find_ID(GUI_Controller), Find_Owner(plr)); - if (HUD) + if (HUD) HUD->OnGoalUpdate(this); } @@ -73,7 +73,7 @@ global func FxIntGoalCheckTimer(object trg, int num, int time) if (curr_goal && (curr_goal->GetCategory() & C4D_Goal)) { curr_goal->NotifyHUD(); - if (!curr_goal->~IsFulfilled()) + if (!curr_goal->~IsFulfilled()) return true; } // Current goal is fulfilled/destroyed - check all others @@ -89,7 +89,7 @@ global func FxIntGoalCheckTimer(object trg, int num, int time) } } // No goal object? Kill timer - if (!goal_count) + if (!goal_count) return FX_Execute_Kill; // Game over :( AllGoalsFulfilled(); @@ -126,7 +126,7 @@ public func IsFulfilled() { return true; } protected func Activate(plr) { - if (IsFulfilled()) + if (IsFulfilled()) return(MessageWindow("$MsgGoalFulfilled$", plr)); return MessageWindow(GetProperty("Description"), plr); } diff --git a/planet/Objects.c4d/Libraries.c4d/HUDAdapter.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/HUDAdapter.c4d/Script.c index 5d717c0c5..07929a622 100644 --- a/planet/Objects.c4d/Libraries.c4d/HUDAdapter.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/HUDAdapter.c4d/Script.c @@ -23,7 +23,7 @@ public func HUDAdapter() // hotkey control public func ControlHotkey(int hotindex) { - if (HUDcontroller) + if (HUDcontroller) return HUDcontroller->ControlHotkey(hotindex); } @@ -35,7 +35,7 @@ protected func Recruitment(int plr) HUDcontroller = FindObject(Find_ID(GUI_Controller), Find_Owner(plr)); if (!HUDcontroller) HUDcontroller = CreateObject(GUI_Controller, 10, 10, plr); - return _inherited(plr, ...); + return _inherited(plr, ...); } public func OnDisplayInfoMessage() @@ -65,30 +65,30 @@ protected func OnPhysicalChange(string physical, int change, int mode) else if (physical == "Breath") HUDselector->UpdateBreathBar(); else if (physical == "Magic") HUDselector->UpdateMagicBar(); } - return _inherited(physical, change, mode, ...); + return _inherited(physical, change, mode, ...); } // calls to both crew selector and controller protected func CrewSelection(bool unselect) { - if (HUDselector) + if (HUDselector) HUDselector->UpdateSelectionStatus(); - if (HUDcontroller) + if (HUDcontroller) HUDcontroller->OnCrewSelection(this,unselect); - return _inherited(unselect, ...); + return _inherited(unselect, ...); } // calls to controller protected func OnCrewEnabled() { - if (HUDcontroller) + if (HUDcontroller) HUDcontroller->OnCrewEnabled(this); return _inherited(...); } protected func OnCrewDisabled() { - if (HUDcontroller) + if (HUDcontroller) HUDcontroller->OnCrewDisabled(this); return _inherited(...); } diff --git a/planet/Objects.c4d/Libraries.c4d/ItemContainer.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/ItemContainer.c4d/Script.c index ff4a13d71..887a99340 100644 --- a/planet/Objects.c4d/Libraries.c4d/ItemContainer.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/ItemContainer.c4d/Script.c @@ -1,4 +1,4 @@ -/*-- +/*-- Item container Author: Maikel @@ -65,7 +65,7 @@ public func OpenMenu(object clonk) { //var proc = clonk->GetProcedure(); // not opened yet v- why is this check here? - it belongs in the object script - Newton - if (!content_menu /* && (proc == "WALK" || proc == "PUSH")*/) + if (!content_menu /* && (proc == "WALK" || proc == "PUSH")*/) { content_menu = clonk->CreateRingMenu(GetID(), this); // all contents into the menu diff --git a/planet/Objects.c4d/Libraries.c4d/LadderClimb.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/LadderClimb.c4d/Script.c index 23b28a0bb..6162dc0f7 100644 --- a/planet/Objects.c4d/Libraries.c4d/LadderClimb.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/LadderClimb.c4d/Script.c @@ -73,7 +73,7 @@ func FxIntSearchLadderTimer(target, number, time) } if(ladder && ladder->~CanNotBeClimbed()) ladder = nil; } - else + else no_ladder_counter--; // Found ladder? if (ladder != nil) @@ -89,14 +89,14 @@ func FxIntSearchLadderTimer(target, number, time) func FxIntSearchLadderStop(target, number, reason, tmp) { if (tmp) return; - no_ladder_counter = 0; + no_ladder_counter = 0; } func FxIntClimbControlStart(target, number, tmp, ladder) { if (tmp) return; EffectVar(0, target, number) = ladder; - SetXDir(0); + SetXDir(0); SetYDir(0); SetComDir(COMD_Stop); EffectVar(2, target, number) = 0; // odd or even segment? diff --git a/planet/Objects.c4d/Libraries.c4d/MeleeWeapons.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/MeleeWeapons.c4d/Script.c index b7fe57e08..6b74a6605 100644 --- a/planet/Objects.c4d/Libraries.c4d/MeleeWeapons.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/MeleeWeapons.c4d/Script.c @@ -1,8 +1,8 @@ -/*-- +/*-- Melee weapons Author: Zapper - Generic weapon template + Generic weapon template --*/ @@ -75,7 +75,7 @@ func FxIntWeaponChargeTimer(pTarget, iEffectNumber, iEffectTime) { if(!pTarget->IsWalking()) return -1; - } + } else if(!pTarget->IsJumping()) { return -1; @@ -324,7 +324,7 @@ func GetJumpLength(pClonk) } func ApplyShieldFactor(pFrom, pTo, damage) -{ +{ // totally prevent the strike? if(pTo->~QueryCatchBlow(pFrom)) return 100; diff --git a/planet/Objects.c4d/Libraries.c4d/Plant.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/Plant.c4d/Script.c index a060ff29f..fd53301a9 100644 --- a/planet/Objects.c4d/Libraries.c4d/Plant.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/Plant.c4d/Script.c @@ -1,6 +1,6 @@ /*-- Plant Library --*/ -private func SeedChance() { return 500; } +private func SeedChance() { return 500; } private func SeedAreaSize() { return 300; } //The distance seeds may travel private func SeedAmount() { return 10; } //The amount of plants possible within a diameter of 500px. diff --git a/planet/Objects.c4d/Libraries.c4d/PowerConsumer.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/PowerConsumer.c4d/Script.c index 4302fd2da..50c6104ac 100644 --- a/planet/Objects.c4d/Libraries.c4d/PowerConsumer.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/PowerConsumer.c4d/Script.c @@ -2,10 +2,10 @@ Power consumer Author: Maikel - To be included by all objects that need a supply of energy. + To be included by all objects that need a supply of energy. The object then can check and consume power by calling it's function CheckPower(int power_check, bool no_substract), - see below for an explanation. + see below for an explanation. --*/ @@ -13,7 +13,7 @@ // Functions that specify object properties, should be overloaded by the consumer. // Returns whether the object is a power consumer. -public func IsPowerConsumer() +public func IsPowerConsumer() { return true; } @@ -31,12 +31,12 @@ public func CanPowerConnect() // Other name? // fSubstract determines whether the check substracts powerNeed. // If false it starts showing the power need object. // If true it stops showing the power need object. -public func CheckPower(int power_check, bool no_substract) +public func CheckPower(int power_check, bool no_substract) { if (!FindObject(Find_ID(Rule_NeedEnergy))) // Rule: Consumers do not need power. return true; // Check all power generators connected to this consumer and sort them according to priority. - for (var generator in FindObjects(Find_PowerGenerator(), Sort_GeneratorPriority())) + for (var generator in FindObjects(Find_PowerGenerator(), Sort_GeneratorPriority())) { var power = generator->GetPower(); if (power > power_check) @@ -97,9 +97,9 @@ private func FxEnergyNeedTimer(object trg, int fxnum, int time) // Do not show symbol. trg->SetGraphics(nil, nil, GFX_Overlay, GFXOV_MODE_Base); EffectVar(0, trg, fxnum) = false; - } + } else // Effect was not showing symbol. - { + { // Do show symbol. trg->SetGraphics(nil, Library_PowerConsumer, GFX_Overlay, GFXOV_MODE_Base); trg->SetObjDrawTransform(1000, 0, 0, 0, 1000, -500 * GetID()->GetDefCoreVal("Height", "DefCore"), GFX_Overlay); diff --git a/planet/Objects.c4d/Libraries.c4d/PowerGenerator.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/PowerGenerator.c4d/Script.c index 3f95056ab..aa4e41967 100644 --- a/planet/Objects.c4d/Libraries.c4d/PowerGenerator.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/PowerGenerator.c4d/Script.c @@ -14,7 +14,7 @@ local power; // Functions that specify object properties, should be overloaded by the generator. // Maximum amount of power that can be stored in this power generator. -public func GetCapacity() +public func GetCapacity() { return 0; } @@ -71,7 +71,7 @@ public func IsPowerGeneratorFor(object consumer, object next, object old_line, a // Finds all power lines connected to pObject (can be nil in local calls). private func Find_PowerLine(object line) { - if (!line) + if (!line) line = this; return [C4FO_Func, "IsConnectedTo", line]; } @@ -101,7 +101,7 @@ public func DoPower(int do_power) /*-- Debug --*/ -protected func Initialize() +protected func Initialize() { //AddEffect("ShowPower",this,100,10,this); return _inherited(...); diff --git a/planet/Objects.c4d/Libraries.c4d/RopePhysics.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/RopePhysics.c4d/Script.c index 491fc51b3..2f504b7ec 100644 --- a/planet/Objects.c4d/Libraries.c4d/RopePhysics.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/RopePhysics.c4d/Script.c @@ -441,7 +441,7 @@ public func ConstraintObjects() public func ConstraintLength() { - // Satisfy all stick constraints (move the particles to fit the length) + // Satisfy all stick constraints (move the particles to fit the length) var normal_restlength = Rope_SegmentLength*Rope_Precision; var normal_restlength2 = normal_restlength*normal_restlength; var restlength, restlength2; diff --git a/planet/Objects.c4d/Libraries.c4d/Scoreboard.c4d/Relaunch.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/Scoreboard.c4d/Relaunch.c4d/Script.c index 8e82bfa8f..d03f3b88a 100644 --- a/planet/Objects.c4d/Libraries.c4d/Scoreboard.c4d/Relaunch.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/Scoreboard.c4d/Relaunch.c4d/Script.c @@ -28,7 +28,7 @@ protected func InitializePlayer(int plr) { var plrid = GetPlayerID(plr); // Create scoreboard relaunch count entry for this player. - score_relaunch_list[plrid] = RelaunchCount(); + score_relaunch_list[plrid] = RelaunchCount(); SetScoreboardData(plrid, GetRelaunchCol(), Format("%d", score_relaunch_list[plrid]), score_relaunch_list[plrid]); return _inherited(plr, ...); } diff --git a/planet/Objects.c4d/Libraries.c4d/Stackable.c4d/Script.c b/planet/Objects.c4d/Libraries.c4d/Stackable.c4d/Script.c index a855a2d2b..1198a8f56 100644 --- a/planet/Objects.c4d/Libraries.c4d/Stackable.c4d/Script.c +++ b/planet/Objects.c4d/Libraries.c4d/Stackable.c4d/Script.c @@ -5,7 +5,7 @@ Including this object means, the object is stackable. Other objects of the same type will be added automatically to the object. This functionality is similar to the Pack-functionality of the arrows in old clonk titles only - more general. + more general. The count of how many objects are stacked together (into a single one, this one) is shown in the picture of the object and can be queried and set via GetStackCount()/SetStackCount(). @@ -169,7 +169,7 @@ private func TryPutInto(object into) // first check if stackable can be put into object with extra slot for (var content in contents) { - if (!content) + if (!content) continue; if (content->~HasExtraSlot()) if (TryPutInto(content)) @@ -180,7 +180,7 @@ private func TryPutInto(object into) for (var content in contents) { var howmany = 0; - if (!content) + if (!content) continue; if (content->~IsStackable()) if (content->GetID() == GetID()) @@ -195,6 +195,6 @@ private func TryPutInto(object into) } } - Update(); + Update(); return false; } diff --git a/planet/Objects.c4d/Rules.c4d/Restart.c4d/Script.c b/planet/Objects.c4d/Rules.c4d/Restart.c4d/Script.c index 29c1424dd..a02a6cd07 100644 --- a/planet/Objects.c4d/Rules.c4d/Restart.c4d/Script.c +++ b/planet/Objects.c4d/Rules.c4d/Restart.c4d/Script.c @@ -3,11 +3,11 @@ func Activate(int plr) { // Notify scenario. - if (GameCall("OnRestart", plr)) + if (GameCall("OnRestart", plr)) return; // Remove the player's clonk, including contents. var clonk = GetCrew(plr); - if (clonk) + if (clonk) clonk->RemoveObject(); } diff --git a/planet/Objects.c4d/Structures.c4d/Chest.c4d/Script.c b/planet/Objects.c4d/Structures.c4d/Chest.c4d/Script.c index 362971241..c13122654 100644 --- a/planet/Objects.c4d/Structures.c4d/Chest.c4d/Script.c +++ b/planet/Objects.c4d/Structures.c4d/Chest.c4d/Script.c @@ -50,7 +50,7 @@ private func Close() Sound("Close.ogg"); } -protected func Definition(def) +protected func Definition(def) { SetProperty("PictureTransformation", Trans_Mul(Trans_Translate(0,-3000,-5000), Trans_Rotate(-30,1,0,0), Trans_Rotate(30,0,1,0), Trans_Translate(1000,1,0)),def); } diff --git a/planet/Objects.c4d/Structures.c4d/ToolsWorkshop.c4d/Script.c b/planet/Objects.c4d/Structures.c4d/ToolsWorkshop.c4d/Script.c index df657abd9..a905ff850 100644 --- a/planet/Objects.c4d/Structures.c4d/ToolsWorkshop.c4d/Script.c +++ b/planet/Objects.c4d/Structures.c4d/ToolsWorkshop.c4d/Script.c @@ -6,7 +6,7 @@ func ProductType() { return C4D_Vehicle | C4D_Object; } func ProductCondition() { return "IsToolProduct"; } -public func Construction() +public func Construction() { SetProperty("MeshTransformation",Trans_Rotate(RandomX(-30,30),0,1,0)); } @@ -25,7 +25,7 @@ public func NeedsEnergy() /* Production */ -public func IsProducerOf(caller, def) +public func IsProducerOf(caller, def) { if (!(def->GetCategory () & ProductType())) return 0; if (!IsBuilt ()) return 0; @@ -53,7 +53,7 @@ func FindSuppliedObjectCloseTo (obj, def) public func HowToProduce (clonk, def) { if(NeedsEnergy()) - { + { clonk->AddCommand ("Call", this, def, 0, 0, 0, "HowToProduce"); clonk->AddCommand ("Energy", this); return 1; @@ -109,7 +109,7 @@ public func StartProduction(pWorker,idType,bSpecial2) } public func ProductionCompleteFailed(pWorker,idType,bSpecial2) -{ +{ // Action "Build" can't be executed (resources are missing) // To recieve the Message "x needs y" execute one more the command "Build" // so that it fails and puts out the message. @@ -142,7 +142,7 @@ protected func IsBuilt() /* Control */ -protected func ContainedUp(pCaller) +protected func ContainedUp(pCaller) { [$Production$|Image=CXCN] return MenuProduction(pCaller); @@ -151,7 +151,7 @@ protected func ContainedUp(pCaller) /* Activity */ private func CheckBuild() -{ +{ // TimerCall: The workshop starts its own Build-Action, when // someone works in the workshop. The work in a building only proceeds // when the building supports this with an own build-action. @@ -174,7 +174,7 @@ private func IsWorking() } private func Smoking() -{ +{ if (GetPhase()%3) return 1; if (Random(6)) Smoke(+16,-14,16); if (Random(8)) Smoke(10,-14,15+Random(3)); diff --git a/planet/Objects.c4d/Vehicles.c4d/Airplane.c4d/Reticle.c4d/Script.c b/planet/Objects.c4d/Vehicles.c4d/Airplane.c4d/Reticle.c4d/Script.c index 02ca4449e..632290abe 100644 --- a/planet/Objects.c4d/Vehicles.c4d/Airplane.c4d/Reticle.c4d/Script.c +++ b/planet/Objects.c4d/Vehicles.c4d/Airplane.c4d/Reticle.c4d/Script.c @@ -1,7 +1,7 @@ /*-- Airplane Reticle --*/ protected func Initialize() -{ +{ this["Visibility"] = VIS_Owner; AddEffect("IntRotate",this,1,1,this); return; @@ -15,7 +15,7 @@ public func FxIntRotateTimer(object target, int num, int timer) /*-- Proplist --*/ -protected func Definition(def) +protected func Definition(def) { SetProperty("Name", "$Name$", def); SetProperty("ActMap", { @@ -30,6 +30,6 @@ protected func Definition(def) Wdt = 40, Hgt = 20, NextAction = "Show", - }, + }, }, def); } \ No newline at end of file diff --git a/planet/Objects.c4d/Vehicles.c4d/Airplane.c4d/Script.c b/planet/Objects.c4d/Vehicles.c4d/Airplane.c4d/Script.c index b903e3216..979011ca8 100644 --- a/planet/Objects.c4d/Vehicles.c4d/Airplane.c4d/Script.c +++ b/planet/Objects.c4d/Vehicles.c4d/Airplane.c4d/Script.c @@ -1,4 +1,4 @@ -/*-- +/*-- Airplane Author: Ringwaul @@ -20,7 +20,7 @@ protected func Construction(object byobj) } protected func Initialize() -{ +{ propanim = PlayAnimation("Propellor", 15, Anim_Const(0),Anim_Const(1000)); AddEffect("IntPlane",this,1,1,this); SetAction("Land"); @@ -67,7 +67,7 @@ public func ContainedUseStop(object clonk, int ix, int iy) CreateParticle("MuzzleFlash",IX,IY,+Sin(angle,500),-Cos(angle,500),600,RGB(255,255,255),this); CreateParticle("Flash",0,0,GetXDir(),GetYDir(),800,RGBa(255,255,64,150)); - AddEffect("IntCooldown", this,1,1,this); + AddEffect("IntCooldown", this,1,1,this); } return 1; } @@ -327,7 +327,7 @@ Fly = { Wdt = 40, Hgt = 56, NextAction = "Fly", -}, +}, Land = { Prototype = Action, Name = "Land", @@ -341,7 +341,7 @@ Land = { Wdt = 40, Hgt = 56, NextAction = "Land", -}, +}, }, def); SetProperty("Name", "$Name$", def); SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(90,0,0,1), Trans_Translate(-10000,-3375,0), Trans_Rotate(25,0,1,0))); diff --git a/planet/Objects.c4d/Vehicles.c4d/Cannon.c4d/Script.c b/planet/Objects.c4d/Vehicles.c4d/Cannon.c4d/Script.c index 201f2af47..56efb9406 100644 --- a/planet/Objects.c4d/Vehicles.c4d/Cannon.c4d/Script.c +++ b/planet/Objects.c4d/Vehicles.c4d/Cannon.c4d/Script.c @@ -1,4 +1,4 @@ -/*-- +/*-- Cannon Author: Ringwaul @@ -96,13 +96,13 @@ private func CheckForKeg(object clonk) if (keg) // If there is a keg, put into cannon. { keg->Exit(); - keg->Enter(this); - Sound("WoodHit*"); - } + keg->Enter(this); + Sound("WoodHit*"); + } else // No keg, stop using cannon. { PlayerMessage(clonk->GetOwner(),"$TxtNeedsGunp$"); - return false; + return false; } } return true; @@ -256,7 +256,7 @@ func ControlLeft(object clonk) SetDir(); } -func ControlRight(object clonk) +func ControlRight(object clonk) { SetDir(1); } @@ -298,7 +298,7 @@ protected func DoFire(object iammo, object clonk, int angle) } func Timer() -{ +{ //Turning if(olddir != GetDir()) { diff --git a/planet/Objects.c4d/Vehicles.c4d/Lorry.c4d/Script.c b/planet/Objects.c4d/Vehicles.c4d/Lorry.c4d/Script.c index 3759b0287..3d5c577b7 100644 --- a/planet/Objects.c4d/Vehicles.c4d/Lorry.c4d/Script.c +++ b/planet/Objects.c4d/Vehicles.c4d/Lorry.c4d/Script.c @@ -36,7 +36,7 @@ protected func ContactLeft() protected func ContactRight() { - if (Stuck() && !Random(5)) + if (Stuck() && !Random(5)) SetRDir(RandomX(-7, +7)); } @@ -109,7 +109,7 @@ local ActMap = { Hgt = 16, NextAction = "Drive", //Animation = "Drive", - }, + }, }; func Definition(def) diff --git a/planet/Parkour.c4f/Boomrace.c4s/Script.c b/planet/Parkour.c4f/Boomrace.c4s/Script.c index 71a48a394..f3a1b94a6 100644 --- a/planet/Parkour.c4f/Boomrace.c4s/Script.c +++ b/planet/Parkour.c4f/Boomrace.c4s/Script.c @@ -13,7 +13,7 @@ func Initialize() pGoal->AddCheckpoint(3830, 710, 28); pGoal->SetFinishpoint(3650, 180); - SetSkyAdjust (RGB(255,128,0), RGB(0,0,0)); + SetSkyAdjust (RGB(255,128,0), RGB(0,0,0)); } // Gamecall from Race-goal, on respawning. diff --git a/planet/Parkour.c4f/Cavern.c4s/Script.c b/planet/Parkour.c4f/Cavern.c4s/Script.c index d7be937ea..6f0b6ab3d 100644 --- a/planet/Parkour.c4f/Cavern.c4s/Script.c +++ b/planet/Parkour.c4f/Cavern.c4s/Script.c @@ -32,7 +32,7 @@ protected func Initialize() x = pos[0]; y = pos[1]; goal->SetFinishpoint(x, y); // Place chests. - d = 300; + d = 300; while (d < LandscapeHeight() - 300) { var i = 0; @@ -40,7 +40,7 @@ protected func Initialize() i++; // Max 25 attempts. x = pos[0]; y = pos[1]; CreateObject(Chest, x, y + 8, NO_OWNER); - d += RandomX(250, 300); + d += RandomX(250, 300); } // Fill chests. var content_list = [GrappleBow, DynamiteBox, Ropeladder, Boompack, Loam]; diff --git a/planet/System.c4g/C4.c b/planet/System.c4g/C4.c index 0e4164084..52e3037c2 100644 --- a/planet/System.c4g/C4.c +++ b/planet/System.c4g/C4.c @@ -1,4 +1,4 @@ -/*-- +/*-- C4.c Authors: @@ -17,7 +17,7 @@ static const DFA_DIG = 5; static const DFA_SWIM = 6; static const DFA_THROW = 7; static const DFA_BRIDGE = 8; -static const DFA_BUILD = 9; +static const DFA_BUILD = 9; static const DFA_PUSH = 10; static const DFA_CHOP = 11; static const DFA_LIFT = 12; @@ -35,9 +35,9 @@ static const Action = { global func GetActMapVal(string entry, string action, id def, int num) { - if (!def) + if (!def) def = GetID(); - if (entry == "Facet") + if (entry == "Facet") entry = ["X", "Y", "Wdt", "Hgt", "OffX", "OffY"][num]; return GetProperty(entry, GetProperty(action, def)); } @@ -55,9 +55,9 @@ global func ShowNeededMaterial(object of_obj) global func FlameConsumeMaterial(int x, int y) { var mat = GetMaterial(x, y); - if (mat == -1) + if (mat == -1) return false; - if (!GetMaterialVal("Inflammable", "Material", mat)) + if (!GetMaterialVal("Inflammable", "Material", mat)) return false; return !!ExtractMaterialAmount(x, y, mat, 1); } @@ -70,7 +70,7 @@ global func ExtractLiquid(int x, int y) { var mat = GetMaterial(x, y); var density = GetMaterialVal("Density", "Material", mat); - if (density < C4M_Liquid || density >= C4M_Solid) + if (density < C4M_Liquid || density >= C4M_Solid) return -1; ExtractMaterialAmount(x, y, mat, 1); return mat; @@ -86,7 +86,7 @@ global func LaunchEffect(id type, int x, int y) // Splits the calling object into its components. global func Split2Components() { - if (!this) + if (!this) return false; var ctr = Contained(); // Transfer all contents to container. diff --git a/planet/System.c4g/Colors.c b/planet/System.c4g/Colors.c index c9b63be46..227cf7f84 100644 --- a/planet/System.c4g/Colors.c +++ b/planet/System.c4g/Colors.c @@ -1,4 +1,4 @@ -/*-- +/*-- Colors.c Authors: Tyron @@ -19,7 +19,7 @@ global func RGBa (int r, int g, int b, int a) { return (a & 255) << 24 | (r & 25 global func GetRGBaValue(int val, int sel) { return val >> ((3 - sel) * 8) & 255; } global func DoRGBaValue(int val, int chng, int sel) { return val + (chng << ((3 - sel) * 8)); } -global func SetRGBaValue(int val, int newval, int sel) +global func SetRGBaValue(int val, int newval, int sel) { // 'delete' old color val = val & ~(255 << ((3 - sel) * 8)); @@ -40,10 +40,10 @@ global func HSL2RGB(int hsl) if (sat == 0) { red = green = blue = lightness; - } + } else { - if (lightness < 128) + if (lightness < 128) var2 = lightness * (255 + sat) / 255; else var2 = lightness + sat - lightness * sat / 255; @@ -64,9 +64,9 @@ global func Hue_2_RGB(int var1, int var2, int hue) hue += 255; if (hue > 255) hue -= 255; - if (6 * hue < 255) + if (6 * hue < 255) return var1 + (var2 - var1) * 6 * hue / 255; - if (2 * hue < 255) + if (2 * hue < 255) return var2; if (3 * hue < 510) return var1 + (var2 - var1) * ( 510 / 3 - hue ) * 6 / 255; @@ -85,28 +85,28 @@ global func RGB2HSL(int rgb) { hue = 0; sat = 0; - } + } else { - if (lightness < 128) + if (lightness < 128) sat = 255 * diff_val / (max_val + min_val); - else + else sat = 255 * diff_val / (510 - (max_val + min_val)); diff_red = ((255 * (max_val - red)) / 6 + (255 * diff_val) / 2) / diff_val; diff_green = ((255 * (max_val - green)) / 6 + (255 * diff_val) / 2) / diff_val; diff_blue = ((255 * (max_val - blue )) / 6 + (255 * diff_val) / 2) / diff_val; - if (red == max_val) + if (red == max_val) hue = diff_blue -diff_green; - else if (green == max_val) + else if (green == max_val) hue = 255 / 3 + diff_red - diff_blue; else if (blue == max_val) hue = 510 / 3 + diff_green - diff_red; - if (hue < 0) + if (hue < 0) hue += 255; - if (hue > 255) + if (hue > 255) hue -= 255; } diff --git a/planet/System.c4g/Commits.c b/planet/System.c4g/Commits.c index fbbce23b4..fe9bf4dee 100644 --- a/planet/System.c4g/Commits.c +++ b/planet/System.c4g/Commits.c @@ -7,27 +7,27 @@ // Returns the offset to x. -global func AbsX(int x) +global func AbsX(int x) { - return x - GetX(); + return x - GetX(); } // Returns the offset to y. -global func AbsY(int y) +global func AbsY(int y) { - return y - GetY(); + return y - GetY(); } // Supports negative values, and can deliver random values between two bounds. -global func RandomX(int start, int end) +global func RandomX(int start, int end) { var swap; // Values swapped: reswap them. - if (start > end) - { + if (start > end) + { swap = start; start = end; - end = swap; + end = swap; } // Return random factor. return Random(end - start + 1) + start; @@ -41,13 +41,13 @@ global func Tan(int angle, int radius, int prec) global func Normalize(int angle, int start, int precision) { - if (!precision) + if (!precision) precision = 1; var end = precision * 360 + start; while (angle < start) angle += precision * 360; - while (angle >= end) + while (angle >= end) angle -= precision * 360; return angle; @@ -72,7 +72,7 @@ global func SetVelocity(int angle, int speed) return; } -// Sets the completion of this to new_con. +// Sets the completion of this to new_con. global func SetCon(int new_con) { return DoCon(new_con - GetCon()); @@ -93,7 +93,7 @@ global func SetVertexXY(int index, int x, int y) return; } -// Returns the number of stuck vertices. (of this) +// Returns the number of stuck vertices. (of this) global func VerticesStuck() { var vertices = 0; @@ -106,7 +106,7 @@ global func VerticesStuck() return vertices; } -// Creates amount objects of type id inside the indicated rectangle(optional) in the indicated material. +// Creates amount objects of type id inside the indicated rectangle(optional) in the indicated material. // Returns the number of iterations needed, or -1 when the placement failed. global func PlaceObjects(id id, int amount, string mat_str, int x, int y, int wdt, int hgt, bool onsf, bool nostuck) { @@ -122,17 +122,17 @@ global func PlaceObjects(id id, int amount, string mat_str, int x, int y, int wd return -1; // Optional parameters wdt and hgt. - if (!wdt) + if (!wdt) wdt = LandscapeWidth() - x - GetX(); - if (!hgt) + if (!hgt) hgt = LandscapeHeight() - y - GetY(); // Cycle-saving method. - if (mat != -1) - while (i < amount) + if (mat != -1) + while (i < amount) { // If there's isn't any or not enough of the given material, break before it gets an endless loop. - if (j++ > 20000) + if (j++ > 20000) return -1; // Destinated rectangle. rndx = x + Random(wdt); @@ -141,22 +141,22 @@ global func PlaceObjects(id id, int amount, string mat_str, int x, int y, int wd if (GetMaterial(rndx, rndy) == mat) { // On-surface option. - if (onsf) - while (GBackSemiSolid(rndx, rndy) && rndy >= y) + if (onsf) + while (GBackSemiSolid(rndx, rndy) && rndy >= y) rndy--; - if (rndy < y) + if (rndy < y) continue; // Create and verify stuckness. obj = CreateObject(id, rndx, rndy + objhgt / 2, NO_OWNER); obj->SetR(Random(360)); - if (obj->Stuck() || nostuck) + if (obj->Stuck() || nostuck) i++; - else + else obj->RemoveObject(); } } - if (mat == -1) + if (mat == -1) while (i < amount) { // If there's isn't any or not enough of the given material, break before it gets an endless loop. @@ -169,8 +169,8 @@ global func PlaceObjects(id id, int amount, string mat_str, int x, int y, int wd if (eval(Format("%s(%d,%d)", mat_str, rndx, rndy))) { // On-surface Option. - if (onsf) - while (GBackSemiSolid(rndx, rndy) && rndy >= y) + if (onsf) + while (GBackSemiSolid(rndx, rndy) && rndy >= y) rndy--; if (rndy < y) continue; @@ -189,7 +189,7 @@ global func PlaceObjects(id id, int amount, string mat_str, int x, int y, int wd global func CastObjects(id def, int am, int lev, int x, int y, int angs, int angw) { - if (!angw) + if (!angw) angw = 360; for (var i = 0; i < am; i++) { @@ -208,7 +208,7 @@ global func CastObjects(id def, int am, int lev, int x, int y, int angs, int ang global func CastPXS(string mat, int am, int lev, int x, int y, int angs, int angw) { - if (!angw) + if (!angw) angw = 360; for (var i = 0; i < am; i++) { @@ -221,21 +221,21 @@ global func CastPXS(string mat, int am, int lev, int x, int y, int angs, int ang global func CheckVisibility(int plr) { var visible = this["Visibility"]; - if (GetType(visible) == C4V_Array) + if (GetType(visible) == C4V_Array) visible = visible[0]; // Not visible at all. - if (visible == VIS_None) + if (visible == VIS_None) return false; // Visible for all. - if (visible == VIS_All) + if (visible == VIS_All) return true; // Object is owned by the indicated player. if (GetOwner() == plr) - { - if (visible & VIS_Owner) - return true; + { + if (visible & VIS_Owner) + return true; } // Object belongs to a player, hostile to plr. else if (Hostile(GetOwner(), plr)) @@ -245,7 +245,7 @@ global func CheckVisibility(int plr) } // Object belongs to a player, friendly to plr. else - { + { if (visible & VIS_Allies) return true; } @@ -270,12 +270,12 @@ global func MaterialDepthCheck(int x, int y, string mat, int depth) if (depth == nil) depth = LandscapeHeight(); - while (travelled != depth) + while (travelled != depth) { - if (GetMaterial(xval, yval) == Material(mat)) + if (GetMaterial(xval, yval) == Material(mat)) { travelled++; - yval++; + yval++; } if (GetMaterial(xval, yval) != Material(mat)) return travelled; // Returns depth of material. @@ -297,8 +297,8 @@ global func LaunchProjectile(int angle, int dist, int speed, int x, int y, bool var x_offset = Sin(angle, dist); var y_offset = -Cos(angle, dist); - if (Contained() != nil && rel_x == true) - if (Contained()->GetDir() == 0) + if (Contained() != nil && rel_x == true) + if (Contained()->GetDir() == 0) x = -x; if (Contained() != nil) @@ -308,7 +308,7 @@ global func LaunchProjectile(int angle, int dist, int speed, int x, int y, bool return true; } - if (Contained() == nil) + if (Contained() == nil) { SetPosition(GetX() + x_offset + x, GetY() + y_offset + y); SetR(angle); @@ -320,30 +320,30 @@ global func LaunchProjectile(int angle, int dist, int speed, int x, int y, bool global func ComDirTransform(int comdir, int tocomdir) { - if (comdir == tocomdir) + if (comdir == tocomdir) return comdir; - if (comdir == COMD_Stop) + if (comdir == COMD_Stop) return tocomdir; - if (comdir == (tocomdir + 3) % 8 + 1) + if (comdir == (tocomdir + 3) % 8 + 1) return COMD_Stop; - if (Inside(comdir, tocomdir + 1, tocomdir + 3)) + if (Inside(comdir, tocomdir + 1, tocomdir + 3)) return comdir - 1; - if (Inside(comdir, tocomdir - 1, tocomdir - 3)) + if (Inside(comdir, tocomdir - 1, tocomdir - 3)) return comdir + 1; - if (Inside(comdir, tocomdir - 7, tocomdir - 5)) + if (Inside(comdir, tocomdir - 7, tocomdir - 5)) return (comdir + 6) % 8 + 1; return comdir % 8 + 1; } global func ComDirLike(int comdir1, int comdir2) { - if (comdir1 == comdir2) + if (comdir1 == comdir2) return true; if (comdir1 == COMD_Stop || comdir2 == COMD_Stop) return false; if (comdir1 % 8 + 1 == comdir2) return true; - if (comdir1 == comdir2 % 8 + 1) + if (comdir1 == comdir2 % 8 + 1) return true; return false; } @@ -352,9 +352,9 @@ global func SetObjAlpha(int by_alpha) { var clr_mod = GetClrModulation(); - if (!clr_mod) - clr_mod = by_alpha << 24; - else + if (!clr_mod) + clr_mod = by_alpha << 24; + else clr_mod = clr_mod & 16777215 | by_alpha << 24; return SetClrModulation(clr_mod); } diff --git a/planet/System.c4g/Explode.c b/planet/System.c4g/Explode.c index e1ce9db47..69f131ca2 100644 --- a/planet/System.c4g/Explode.c +++ b/planet/System.c4g/Explode.c @@ -9,7 +9,7 @@ /*-- Explosion --*/ -global func Explode(int level) +global func Explode(int level) { // Shake the viewport. ShakeViewPort(level, nil, GetX(), GetY()); @@ -41,9 +41,9 @@ global func DoExplosion(int x, int y, int level, object inobj, int cause_plr, ob var container = inobj; while (container) { - if (container->GetID()->GetDefContainBlast()) + if (container->GetID()->GetDefContainBlast()) break; - else + else container = container->Contained(); } @@ -60,7 +60,7 @@ global func DoExplosion(int x, int y, int level, object inobj, int cause_plr, ob } // Damage in the objects, and outside. BlastObjects(x + GetX(), y + GetY(), level, inobj, cause_plr, layer); - if (inobj != container) + if (inobj != container) BlastObjects(x + GetX(), y + GetY(), level, container, cause_plr, layer); // Landschaft zerstören. Nach BlastObjects, damit neu freigesprengte Materialien nicht betroffen sind @@ -110,10 +110,10 @@ global func BlastObjects(int x, int y, int level, object container, int cause_pl if (container->GetObjectLayer() == layer) { container->BlastObject(level, cause_plr); - if (!container) + if (!container) return true; // Container could be removed in the meanwhile. for (obj in FindObjects(Find_Container(container), Find_Layer(layer))) - if (obj) + if (obj) obj->BlastObject(level, cause_plr); } } @@ -132,14 +132,14 @@ global func BlastObjects(int x, int y, int level, object container, int cause_pl var cnt = GetLength(shockwave_objs); if (cnt) { - // The hurl energy is distributed over the objects. + // The hurl energy is distributed over the objects. //Log("Shockwave objs %v (%d)", shockwave_objs, cnt); var shock_speed = Sqrt(2 * level * level / BoundBy(cnt, 2, 12)); - for (var obj in shockwave_objs) + for (var obj in shockwave_objs) if (obj) // Test obj, cause OnShockwaveHit could have removed objects. { // Object has special reaction on shockwave? - if (obj->~OnShockwaveHit(level, x, y)) + if (obj->~OnShockwaveHit(level, x, y)) continue; // Living beings are hurt more. var cat = obj->GetCategory(); @@ -149,14 +149,14 @@ global func BlastObjects(int x, int y, int level, object container, int cause_pl obj->DoDamage(level / 2, FX_Call_DmgBlast, cause_plr); } // Killtracing for projectiles. - if (cat & C4D_Object) + if (cat & C4D_Object) obj->SetController(cause_plr); // Shockwave. - var mass_fact = 20, mass_mul = 100; + var mass_fact = 20, mass_mul = 100; if (cat & C4D_Living) { - mass_fact = 8; - mass_mul = 80; + mass_fact = 8; + mass_mul = 80; } mass_fact = BoundBy(obj->GetMass() * mass_mul / 1000, 4, mass_fact); var dx = 100 * (obj->GetX() - x) + Random(51) - 25; @@ -169,9 +169,9 @@ global func BlastObjects(int x, int y, int level, object container, int cause_pl { // Objects shouldn't move too fast. var ovx = obj->GetXDir(100), ovy = obj->GetYDir(100); - if (ovx * vx > 0) + if (ovx * vx > 0) vx = (Sqrt(vx * vx + ovx * ovx) - Abs(vx)) * Abs(vx) / vx; - if (ovy * vy > 0) + if (ovy * vy > 0) vy = (Sqrt(vy * vy + ovy * ovy) - Abs(vy)) * Abs(vy) / vy; } //Log("%v v(%v %v) d(%v %v) m=%v l=%v s=%v", obj, vx,vy, dx,dy, mass_fact, level, shock_speed); @@ -186,14 +186,14 @@ global func BlastObjects(int x, int y, int level, object container, int cause_pl global func BlastObjectsShockwaveCheck(int x, int y) { var def = GetID(); - // Some special cases, which won't go into FindObjects. - if (def->GetDefHorizontalFix()) + // Some special cases, which won't go into FindObjects. + if (def->GetDefHorizontalFix()) return false; if (def->GetDefGrab() != 1) { - if (GetCategory() & C4D_Vehicle) + if (GetCategory() & C4D_Vehicle) return false; - if (GetProcedure() == "FLOAT") + if (GetProcedure() == "FLOAT") return false; } // Projectiles not when they fly downwards or are exactly in the explosion point. @@ -204,7 +204,7 @@ global func BlastObjectsShockwaveCheck(int x, int y) if (GetYDir() > 5) return false; } // No stuck objects. - if (Stuck()) + if (Stuck()) return false; return true; } @@ -214,7 +214,7 @@ global func BlastObjectsShockwaveCheck(int x, int y) global func ShakeViewPort(int level, int x_off, int y_off) { - if (level <= 0) + if (level <= 0) return false; var eff = GetEffect("ShakeEffect", this); @@ -300,7 +300,7 @@ global func CreateSmokeTrail(int strength, int angle, int x, int y, int color, b x += GetX(); y += GetY(); var num = AddEffect("SmokeTrail", nil, 300, 1, nil, nil, strength, angle, x, y); - if (!color) + if (!color) color = RGBa(130, 130, 130, 70); EffectVar(6, nil, num) = color; EffectVar(7, nil, num) = noblast; @@ -321,7 +321,7 @@ global func FxSmokeTrailStart(object target, int fxnum, int temp, strength, angl if (temp) return; - if (angle % 90 == 1) + if (angle % 90 == 1) angle += 1; strength = Max(strength, 5); @@ -401,7 +401,7 @@ global func Fireworks(int color, int x, int y) global func FxFireworkStart(object target, int num, int tmp, speed, angle, x, y, color) { - if (tmp) + if (tmp) return; EffectVar(0, target, num) = speed * 100; @@ -419,7 +419,7 @@ global func FxFireworkTimer(object target, int num, int time) if (time > 65) return -1; - if (GBackSemiSolid(x / 100, y / 100)) + if (GBackSemiSolid(x / 100, y / 100)) return -1; // loose speed diff --git a/planet/System.c4g/FindObject.c b/planet/System.c4g/FindObject.c index 57bc5674b..ac0f307e8 100644 --- a/planet/System.c4g/FindObject.c +++ b/planet/System.c4g/FindObject.c @@ -1,9 +1,9 @@ -/*-- +/*-- FindObject.c - Authors: + Authors: Wrappers for convenient calls to the FindObject family. ---*/ +--*/ /*-- Find functions --*/ @@ -16,7 +16,7 @@ global func Find_Not(cond) global func Find_And() { var result = [C4FO_And]; - for (var i = 0; Par(i); i++) + for (var i = 0; Par(i); i++) result[i + 1] = Par(i); return result; } @@ -31,9 +31,9 @@ global func Find_Or() global func Find_Exclude(object obj) { - if (!obj) + if (!obj) obj = this; - if (!obj) + if (!obj) return; return [C4FO_Exclude, obj]; } @@ -158,7 +158,7 @@ global func Find_Layer(object layer) global func Find_PathFree(object to_obj) { - if (!to_obj) + if (!to_obj) to_obj = this; return [C4FO_Func, "Find_PathFreeCheck", to_obj]; } diff --git a/planet/System.c4g/GetXVal.c b/planet/System.c4g/GetXVal.c index 77410ed2f..05a17c79c 100644 --- a/planet/System.c4g/GetXVal.c +++ b/planet/System.c4g/GetXVal.c @@ -1,11 +1,11 @@ /*-- GetXVal.c - Authors: + Authors: Some functions which request information from the GetXVal family. - Attention: These functions directly access internal values of the engine. + Attention: These functions directly access internal values of the engine. The usage might, under certain circumstances, lead to desynchronisation in - either network games or save games. The most dangerous functions are marked + either network games or save games. The most dangerous functions are marked with //(!). --*/ diff --git a/planet/System.c4g/Helpers.c b/planet/System.c4g/Helpers.c index 3e326464e..5b5807c94 100644 --- a/planet/System.c4g/Helpers.c +++ b/planet/System.c4g/Helpers.c @@ -1,4 +1,4 @@ -/*-- +/*-- Helpers.c Authors: @@ -9,10 +9,10 @@ global func MessageWindow(string msg, int for_plr, id icon, string caption) { // Get icon. - if (!icon) + if (!icon) icon = GetID(); // Get caption. - if (!caption) + if (!caption) caption = GetName(); // Create msg window (menu). var cursor = GetCursor(for_plr); @@ -28,7 +28,7 @@ global func RemoveAll(p) if (GetType(p) == C4V_PropList) p = Find_ID(p); // RemoveAll(ID) shortcut for (var obj in FindObjects(p, ...)) { - if (obj) + if (obj) { obj->RemoveObject(); cnt++; @@ -39,7 +39,7 @@ global func RemoveAll(p) global func SetBit(int old_val, int bit_nr, bool bit) { - if (GetBit(old_val, bit_nr) != (bit != 0)) + if (GetBit(old_val, bit_nr) != (bit != 0)) return ToggleBit(old_val, bit_nr); return old_val; } @@ -57,7 +57,7 @@ global func ToggleBit(int old_val, int bit_nr) global func DrawParticleLine (string particle, int x0, int y0, int x1, int y1, int prtdist, int a, int b0, int b1, int ydir) { // Right parameters? - if (!prtdist) + if (!prtdist) return 0; // Calculate required number of particles. var prtnum = Max(Distance(x0, y0, x1, y1) / prtdist, 2); @@ -71,7 +71,7 @@ global func DrawParticleLine (string particle, int x0, int y0, int x1, int y1, i b = ((b0 & 16711935) * i1 + (b1 & 16711935) * i2) >> 8 & 16711935 | ((b0 >> 8 & 16711935) * i1 + (b1 >> 8 & 16711935) * i2) & -16711936; - if (!b && (b0 | b1)) + if (!b && (b0 | b1)) b++; CreateParticle(particle, x0 + (x1 - x0) * i / prtnum, y0 + (y1 - y0) * i-- / prtnum, 0, ydir, a, b); } @@ -89,7 +89,7 @@ global func GetAvailableObject (id def, object obj) Find_Not(Find_OCF(OCF_OnFire)), Find_Func("GetAvailableObjectCheck", GetOwner()), Find_Not(Find_Container(obj))); - if (!obj) + if (!obj) SetLength(crit, GetLength(crit) - 1); return FindObject(crit, Sort_Distance()); } @@ -97,10 +97,10 @@ global func GetAvailableObject (id def, object obj) global func GetAvailableObjectCheck(int plr) { // Object is not connected to anything (for line construction kits) - if (FindObject (Find_ActionTarget(this), Find_Procedure(DFA_CONNECT))) + if (FindObject (Find_ActionTarget(this), Find_Procedure(DFA_CONNECT))) return false; // Not chosen by another friendly clonk - if (GetEffect("IntNotAvailable", this) && !Hostile(plr, EffectVar(0, this, GetEffect("IntNotAvailable", this))->GetOwner())) + if (GetEffect("IntNotAvailable", this) && !Hostile(plr, EffectVar(0, this, GetEffect("IntNotAvailable", this))->GetOwner())) return false; return true; } diff --git a/planet/System.c4g/HitChecks.c b/planet/System.c4g/HitChecks.c index e63557e96..72092ff54 100644 --- a/planet/System.c4g/HitChecks.c +++ b/planet/System.c4g/HitChecks.c @@ -19,7 +19,7 @@ global func FxHitCheckStart(object target, int effect, int temp, object by_obj, bool never_shooter) { - if (temp) + if (temp) return; EffectVar(0, target, effect) = target->GetX(); EffectVar(1, target, effect) = target->GetY(); @@ -35,11 +35,11 @@ global func FxHitCheckStart(object target, int effect, int temp, object by_obj, if (target->GetCategory() & C4D_Object) target->SetCategory((target->GetCategory() - C4D_Object) | C4D_Vehicle); return; -} +} global func FxHitCheckStop(object target, int effect, int reason, bool temp) { - if (temp) + if (temp) return; target->SetCategory(target->GetID()->GetCategory()); @@ -50,7 +50,7 @@ global func FxHitCheckDoCheck(object target, int effect) { var obj; // rather search in front of the projectile, since a hit might delete the effect, - // and clonks can effectively hide in front of walls. + // and clonks can effectively hide in front of walls. var oldx = target->GetX(); var oldy = target->GetY(); var newx = target->GetX() + target->GetXDir() / 10; @@ -84,17 +84,17 @@ global func FxHitCheckDoCheck(object target, int effect) if (obj->~IsProjectileTarget(target, shooter) || obj->GetOCF() & OCF_Alive) { target->~HitObject(obj); - if (!target) + if (!target) return; } } } - return; + return; } global func FxHitCheckEffect(string newname) { - if (newname == "HitCheck") + if (newname == "HitCheck") return -2; return; } @@ -118,7 +118,7 @@ global func FxHitCheckTimer(object target, int effect, int time) EffectCall(target, effect, "DoCheck"); // It could be that it hit something and removed itself. thus check if target is still there. // The effect will be deleted right after this. - if (!target) + if (!target) return -1; EffectVar(0, target, effect) = target->GetX(); @@ -129,9 +129,9 @@ global func FxHitCheckTimer(object target, int effect, int time) // The projectile will be only switched to "live", meaning that it can hit the // shooter himself when the shot exited the shape of the shooter one time. - if (!never_shooter) + if (!never_shooter) { - if (!live) + if (!live) { var ready = true; // We search for all objects with the id of our shooter. @@ -152,17 +152,17 @@ global func FxHitCheckTimer(object target, int effect, int time) global func ProjectileHit(object obj, int dmg, bool tumble) { - if (!this || !obj) + if (!this || !obj) return; if (obj->GetAlive()) if (obj->~QueryCatchBlow(this)) return; - if (!this || !obj) + if (!this || !obj) return; obj->~OnProjectileHit(this); - if (!this || !obj) + if (!this || !obj) return; this->~OnStrike(obj); @@ -176,7 +176,7 @@ global func ProjectileHit(object obj, int dmg, bool tumble) obj->DoDamage(dmg, FX_Call_EngObjHit, GetController()); } // Target could have done something with this projectile. - if (!this || !obj) + if (!this || !obj) return; // Tumble target. @@ -190,5 +190,5 @@ global func ProjectileHit(object obj, int dmg, bool tumble) obj->SetXDir((obj->GetXDir() * obj_mass + GetXDir() * mass * unrealism) / (mass + obj_mass)); obj->SetYDir((obj->GetYDir() * obj_mass + GetYDir() * mass * unrealism) / (mass + obj_mass)); } - return; + return; } diff --git a/planet/System.c4g/MeshAnimation.c b/planet/System.c4g/MeshAnimation.c index 348c4bf57..8dd801859 100644 --- a/planet/System.c4g/MeshAnimation.c +++ b/planet/System.c4g/MeshAnimation.c @@ -38,49 +38,49 @@ global func Anim_AbsY(int position, int begin, int end, int length) global func Anim_XDir(int begin, int end, int max_xdir, int prec) { - if (prec == nil) + if (prec == nil) prec = 10; return [C4AVP_XDir, begin, end, max_xdir, prec]; } global func Anim_YDir(int begin, int end, int max_ydir, int prec) { - if (prec == nil) + if (prec == nil) prec = 10; return [C4AVP_YDir, begin, end, max_ydir, prec]; } global func Anim_RDir(int begin, int end, int max_rdir, int prec) { - if (prec == nil) + if (prec == nil) prec = 10; return [C4AVP_RDir, begin, end, max_rdir, prec]; } global func Anim_CosR(int begin, int end, int offset, int prec) { - if (prec == nil) + if (prec == nil) prec = 1; return [C4AVP_CosR, begin, end, offset, prec]; } global func Anim_SinR(int begin, int end, int offset, int prec) { - if (prec == nil) + if (prec == nil) prec = 1; return [C4AVP_SinR, begin, end, offset, prec]; } global func Anim_CosV(int begin, int end, int offset, int prec) { - if (prec == nil) + if (prec == nil) prec = 1; return [C4AVP_CosV, begin, end, offset, prec]; } global func Anim_SinV(int begin, int end, int offset, int prec) { - if (prec == nil) + if (prec == nil) prec = 1; return [C4AVP_SinV, begin, end, offset, prec]; } diff --git a/planet/System.c4g/Player.c b/planet/System.c4g/Player.c index aa5cfb510..946c79dee 100644 --- a/planet/System.c4g/Player.c +++ b/planet/System.c4g/Player.c @@ -1,4 +1,4 @@ -/*-- +/*-- Player.c Authors: timi, Maikel @@ -15,7 +15,7 @@ global func GetPlayerByName(string plr_name) // Does the player's name match the one searched for? if (WildcardMatch(GetPlayerName(GetPlayerByIndex(i)), plr_name)) // It does -> return player number. - return GetPlayerByIndex(i); + return GetPlayerByIndex(i); // There is no player with that name. return NO_OWNER; } @@ -29,7 +29,7 @@ global func GetTeamByName(string team_name) // Does the team's name match the one searched for? if (WildcardMatch(GetTeamName(GetTeamByIndex(i)), team_name)) // It does -> return team number. - return GetTeamByIndex(i); + return GetTeamByIndex(i); // There is no team with that name. return NO_OWNER; } @@ -38,7 +38,7 @@ global func GetTeamByName(string team_name) global func GetTaggedPlayerName(int plr) { var plr_name = GetPlayerName(plr); - if (!plr_name) + if (!plr_name) return; var plr_color = MakeColorReadable(GetPlayerColor(plr)); var tagged_plr_name = Format("%s", plr_color, plr_name); @@ -49,7 +49,7 @@ global func GetTaggedPlayerName(int plr) global func GetTaggedTeamName(int team) { var team_name = GetTeamName(team); - if (!team_name) + if (!team_name) return; var team_color = MakeColorReadable(GetTeamColor(team)); var tagged_team_name = Format("%s", team_color, team_name); @@ -67,7 +67,7 @@ global func MakeColorReadable(int color) var r = (color >> 16 & 255), g = (color >> 8 & 255), b = (color & 255); var lightness = r * 50 + g * 87 + b * 27; // Above 55 / 164 (*255) is okay. - if (lightness < 14025) + if (lightness < 14025) { // Brighten up. var inc = (14025 - lightness) / 164; diff --git a/planet/System.c4g/PlayerControl.c b/planet/System.c4g/PlayerControl.c index b62a4ace2..29f1d8e79 100644 --- a/planet/System.c4g/PlayerControl.c +++ b/planet/System.c4g/PlayerControl.c @@ -25,7 +25,7 @@ global func PlayerControl(int plr, int ctrl, id spec_id, int x, int y, int stren // Forward control to cursor var cursor = GetCursor(plr); - if (cursor) + if (cursor) { // Object controlled by plr cursor->SetController(plr); diff --git a/planet/System.c4g/Schedule.c b/planet/System.c4g/Schedule.c index 203a7f56a..1c4b8cbb9 100644 --- a/planet/System.c4g/Schedule.c +++ b/planet/System.c4g/Schedule.c @@ -2,20 +2,20 @@ Schedule.c Authors: - Schedule can be used to execute scripts or functions repetitively with delay. + Schedule can be used to execute scripts or functions repetitively with delay. --*/ // Executes a script repetitively with delay. global func Schedule(string script, int interval, int repeats, object obj) { // Defaults. - if (!repeats) + if (!repeats) repeats = 1; - if (!obj) + if (!obj) obj = this; // Create effect. var effect = AddEffect("IntSchedule", obj, 1, interval, obj); - if (effect <= 0) + if (effect <= 0) return false; // Set variables. EffectVar(0, obj, effect) = script; @@ -36,19 +36,19 @@ global func FxIntScheduleTimer(object obj, int effect) global func ScheduleCall(object obj, string function, int interval, int repeats, par0, par1, par2, par3, par4) { // Defaults. - if (!repeats) + if (!repeats) repeats = 1; - if (!obj) + if (!obj) obj = this; // Create effect. var effect = AddEffect("IntScheduleCall", obj, 1, interval, obj); - if (effect <= 0) + if (effect <= 0) return false; // Set variables. EffectVar(0, obj, effect) = function; EffectVar(1, obj, effect) = repeats; // EffectVar(2): Just there for backwards compatibility. - EffectVar(2, obj, effect) = obj; + EffectVar(2, obj, effect) = obj; for (var i = 0; i < 5; i++) EffectVar(i + 3, obj, effect) = Par(i + 4); return true; diff --git a/planet/Tests.c4f/Clonk50.c4s/FireGlobe.c4d/Script.c b/planet/Tests.c4f/Clonk50.c4s/FireGlobe.c4d/Script.c index 240e3725c..91ac7ebfa 100644 --- a/planet/Tests.c4f/Clonk50.c4s/FireGlobe.c4d/Script.c +++ b/planet/Tests.c4f/Clonk50.c4s/FireGlobe.c4d/Script.c @@ -166,7 +166,7 @@ global func Intersect(int Ax, int Ay, int Bx, int By, int Px, int Py, int Qx, in // parallel! if(denominator == 0) { - if(numerator != 0) return false; + if(numerator != 0) return false; // on same line somewhere else { diff --git a/planet/Tests.c4f/Lines.c4s/FireGlobe.c4d/Script.c b/planet/Tests.c4f/Lines.c4s/FireGlobe.c4d/Script.c index f7f75aa9c..1689c449a 100644 --- a/planet/Tests.c4f/Lines.c4s/FireGlobe.c4d/Script.c +++ b/planet/Tests.c4f/Lines.c4s/FireGlobe.c4d/Script.c @@ -166,7 +166,7 @@ global func Intersect(int Ax, int Ay, int Bx, int By, int Px, int Py, int Qx, in // parallel! if(denominator == 0) { - if(numerator != 0) return false; + if(numerator != 0) return false; // on same line somewhere else { diff --git a/planet/Tests.c4f/RingmenuTest.c4s/FireGlobe.c4d/Script.c b/planet/Tests.c4f/RingmenuTest.c4s/FireGlobe.c4d/Script.c index f7f75aa9c..1689c449a 100644 --- a/planet/Tests.c4f/RingmenuTest.c4s/FireGlobe.c4d/Script.c +++ b/planet/Tests.c4f/RingmenuTest.c4s/FireGlobe.c4d/Script.c @@ -166,7 +166,7 @@ global func Intersect(int Ax, int Ay, int Bx, int By, int Px, int Py, int Qx, in // parallel! if(denominator == 0) { - if(numerator != 0) return false; + if(numerator != 0) return false; // on same line somewhere else { diff --git a/planet/Tests.c4f/RingmenuTest.c4s/ObjectFade.c4d/Script.c b/planet/Tests.c4f/RingmenuTest.c4s/ObjectFade.c4d/Script.c index 945e22771..5bafd33da 100644 --- a/planet/Tests.c4f/RingmenuTest.c4s/ObjectFade.c4d/Script.c +++ b/planet/Tests.c4f/RingmenuTest.c4s/ObjectFade.c4d/Script.c @@ -35,7 +35,7 @@ public func FxIntFadeOutStart(object target, int num) { public func FxIntFadeOutTimer(object target, int num, int time) { if(time < fade_time * 2/3) return; //Log("%d,%d,%08x,%08x => %08x", fade_time, time, EffectVar(4, target, num), EffectVar(3, target, num), ((fade_time - time) * EffectVar(4, target, num) / (fade_time/3))); - if(!(target->Contained()) + if(!(target->Contained()) && EffectVar(0, target, num) == target->GetX() && EffectVar(1, target, num) == target->GetY() ) { diff --git a/planet/Tests.c4f/RingmenuTest.c4s/Relaunch.c4d/Script.c b/planet/Tests.c4f/RingmenuTest.c4s/Relaunch.c4d/Script.c index a8c40d43c..6d84ae6e8 100644 --- a/planet/Tests.c4f/RingmenuTest.c4s/Relaunch.c4d/Script.c +++ b/planet/Tests.c4f/RingmenuTest.c4s/Relaunch.c4d/Script.c @@ -22,7 +22,7 @@ func ChooseMenu(object clonk) menuitem->AddItem(Loam,3); menuitem->AddItem(Firestone,5); menuitem->AddItem(Fireglobe,3); - menuitem->AddItem(Blackpowder,3); + menuitem->AddItem(Blackpowder,3); menuitem->Show(); } return true; diff --git a/planet/Tests.c4f/RingmenuTest.c4s/Script.c b/planet/Tests.c4f/RingmenuTest.c4s/Script.c index 269de5338..b21e53c3a 100644 --- a/planet/Tests.c4f/RingmenuTest.c4s/Script.c +++ b/planet/Tests.c4f/RingmenuTest.c4s/Script.c @@ -9,7 +9,7 @@ func Initialize() CreateObject(WindGenerator,68,188)->SetR(95); CreateObject(WindGenerator,LandscapeWidth()-68,188)->SetR(-95); SetSkyAdjust (RGB(230,210,150), RGB(150,100,0)); - for(var i=0; i<30; i++) CreateObject(Rule_ObjectFade); + for(var i=0; i<30; i++) CreateObject(Rule_ObjectFade); var b=LandscapeWidth(); DrawMaterialQuad("Vehicle",0,110,22,120,27,255,0,255); diff --git a/planet/Tests.c4f/Windmill.c4s/SaveTheWindmills.c4d/Script.c b/planet/Tests.c4f/Windmill.c4s/SaveTheWindmills.c4d/Script.c index 87c9829cf..d1d3a0a04 100644 --- a/planet/Tests.c4f/Windmill.c4s/SaveTheWindmills.c4d/Script.c +++ b/planet/Tests.c4f/Windmill.c4s/SaveTheWindmills.c4d/Script.c @@ -14,7 +14,7 @@ func Initialize() SetScoreboardData(SBRD_Caption, SBRD_Caption, "$ScoreCaption$", SBRD_Caption); SetScoreboardData(SBRD_Caption, SBRD_Rockets, "{{Goal_SaveTheWindmills}}", SBRD_Caption); // Remove settlement eval data. - HideSettlementScoreInEvaluation(true); + HideSettlementScoreInEvaluation(true); inherited(...); } @@ -93,7 +93,7 @@ protected func RemovePlayer(int plr) return _inherited(plr, ...); } -public func DoEvaluationData() +public func DoEvaluationData() { for (var i = 0; i < GetPlayerCount(); i++) { diff --git a/planet/Tests.c4f/Windmill.c4s/Script.c b/planet/Tests.c4f/Windmill.c4s/Script.c index 67fd1ae1f..0c6ac0d8b 100644 --- a/planet/Tests.c4f/Windmill.c4s/Script.c +++ b/planet/Tests.c4f/Windmill.c4s/Script.c @@ -38,7 +38,7 @@ global func FxBoomAttackTimer(object target, int effect, int time) if(time/35 % Boomattack_wave_delay == 1) { var gol = FindObject(Find_ID(Goal_SaveTheWindmills)); - if(gol) + if(gol) gol->SetWave(wave); if (wave < 13) { @@ -68,7 +68,7 @@ global func CreateAttackWave(int angle, int rockets, int anglespread) rocket_id = BigBoomattack; } - for(var i=0; iExit(); + to_restore->Exit(); if (to_container) to_restore->Enter(to_container); else @@ -140,12 +140,12 @@ global func AddRestoreMode(object to_container, int to_x, int to_y) { if (!this) return; - var effect = AddEffect("RestoreMode", this, 100); + var effect = AddEffect("RestoreMode", this, 100); EffectVar(0, this, effect) = to_container; EffectVar(1, this, effect) = to_x; EffectVar(2, this, effect) = to_y; return; -} +} // Destruction check, uses Fx*Stop to detect item removal. // Effectvar 0: Container to which must be restored. @@ -163,7 +163,7 @@ global func FxRestoreModeStop(object target, int num, int reason, bool temporar var to_x = EffectVar(1, target, num); var to_y = EffectVar(2, target, num); var restored = CreateObject(target->GetID(), 0, 0, target->GetOwner()); - restorer->SetRestoreObject(restored, to_container, to_x, to_y); + restorer->SetRestoreObject(restored, to_container, to_x, to_y); } return 1; } diff --git a/planet/Tutorial.c4f/Tutorial.c4d/TutGuide.c4d/Script.c b/planet/Tutorial.c4f/Tutorial.c4d/TutGuide.c4d/Script.c index 964aaa26d..7e0d05e0a 100644 --- a/planet/Tutorial.c4f/Tutorial.c4d/TutGuide.c4d/Script.c +++ b/planet/Tutorial.c4f/Tutorial.c4d/TutGuide.c4d/Script.c @@ -1,4 +1,4 @@ -/*-- +/*-- Tutorial Guide Author: Maikel @@ -37,7 +37,7 @@ public func SetGuideIndex(int to_index) { index = BoundBy(to_index, 0, GetLength(messages)); return; -} +} // Add a message to the guide, the index is set to this message. public func AddGuideMessage(string msg) @@ -55,12 +55,12 @@ public func AddGuideMessage(string msg) public func ShowGuideMessage(int show_index) { index = Max(0, show_index); - if (!messages[index]) + if (!messages[index]) return; if (GetEffect("NotifyPlayer", this)) RemoveEffect("NotifyPlayer", this); GuideMessage(index); - if (messages[index + 1]) + if (messages[index + 1]) index++; return; } @@ -86,10 +86,10 @@ public func MouseSelection(int plr) if (effect && EffectVar(0, this, effect) == index) return ClearGuideMessage(); // Show guide message if there is a new one, and increase index if possible. - if (!messages[index]) + if (!messages[index]) return; GuideMessage(index); - if (messages[index + 1]) + if (messages[index + 1]) index++; return; } @@ -149,7 +149,7 @@ protected func FxNotifyPlayerTimer(object target, int num, int time) { // Delete effect if time has passed. if (time) - return -1; + return -1; return 1; } diff --git a/planet/Tutorial.c4f/Tutorial.c4d/TutorialArrow.c4d/Script.c b/planet/Tutorial.c4f/Tutorial.c4d/TutorialArrow.c4d/Script.c index aa6fe4a12..8a8619201 100644 --- a/planet/Tutorial.c4f/Tutorial.c4d/TutorialArrow.c4d/Script.c +++ b/planet/Tutorial.c4f/Tutorial.c4d/TutorialArrow.c4d/Script.c @@ -56,7 +56,7 @@ local ActMap = { Hgt = 20, NextAction = "Attach", Animation = "Spin", - }, + }, Show = { Prototype = Action, Name = "Show", @@ -69,5 +69,5 @@ local ActMap = { Hgt = 20, NextAction = "Show", Animation = "Bounce", - }, + }, }; diff --git a/planet/Tutorial.c4f/Tutorial02.c4s/Script.c b/planet/Tutorial.c4f/Tutorial02.c4s/Script.c index 4f7841f78..499808757 100644 --- a/planet/Tutorial.c4f/Tutorial02.c4s/Script.c +++ b/planet/Tutorial.c4f/Tutorial02.c4s/Script.c @@ -1,4 +1,4 @@ -/*-- +/*-- Tutorial 02 Author: Maikel @@ -57,7 +57,7 @@ protected func Initialize() lorry->SetObjectLayer(lorry); // Cannon to blast through rock & chest with powderkeg and firestones. - var cannon = CreateObject(Cannon, 700, 420, NO_OWNER); + var cannon = CreateObject(Cannon, 700, 420, NO_OWNER); //effect = AddEffect("CannonRestore", cannon, 100, 10); //EffectVar(1, cannon, effect) = 180; //EffectVar(2, cannon, effect) = 450; @@ -100,7 +100,7 @@ protected func Initialize() // Chest with boompack for fast players. chest = CreateObject(Chest, 1800, 660, NO_OWNER); - chest->CreateContents(Boompack, 2); + chest->CreateContents(Boompack, 2); // Set the mood. SetGamma(RGB(30, 25, 20), RGB(135, 130, 125), RGB(255, 250, 245)); @@ -503,7 +503,7 @@ global func FxClonkTwoRestoreStop(object target, int num, int reason, bool temp } /*-- Item restoring --*/ -// All done through global effects, which use ObjectRestorer. +// All done through global effects, which use ObjectRestorer. // In all cases the effects have: // Timer interval: 10 frames. // Effectvar 0: Container to which must be restored. @@ -521,7 +521,7 @@ global func FxDynamiteRestoreStop(object target, int num, int reason, bool temp restorer->SetPosition(x, y); var to_container = EffectVar(0, target, num); var restored = CreateObject(DynamiteBox, 0, 0, target->GetOwner()); - restorer->SetRestoreObject(restored, to_container, nil, nil, "DynamiteRestore"); + restorer->SetRestoreObject(restored, to_container, nil, nil, "DynamiteRestore"); } return 1; } @@ -609,7 +609,7 @@ global func FxRopeladderRestoreStop(object target, int num, int reason, bool te restorer->SetPosition(x, y); var to_container = EffectVar(0, target, num); var restored = CreateObject(Ropeladder, 0, 0, target->GetOwner()); - restorer->SetRestoreObject(restored, to_container, nil, nil, "RopeladderRestore"); + restorer->SetRestoreObject(restored, to_container, nil, nil, "RopeladderRestore"); } return 1; } @@ -635,7 +635,7 @@ global func FxClonkContentRestoreStop(object target, int num, int reason, bool restorer->SetPosition(x, y); var to_container = EffectVar(0, target, num); var restored = CreateObject(target->GetID(), 0, 0, target->GetOwner()); - restorer->SetRestoreObject(restored, to_container, nil, nil, "ClonkContentRestore"); + restorer->SetRestoreObject(restored, to_container, nil, nil, "ClonkContentRestore"); } return 1; } diff --git a/planet/Tutorial.c4f/Tutorial03.c4s/Script.c b/planet/Tutorial.c4f/Tutorial03.c4s/Script.c index b59a8ca71..5bdf25540 100644 --- a/planet/Tutorial.c4f/Tutorial03.c4s/Script.c +++ b/planet/Tutorial.c4f/Tutorial03.c4s/Script.c @@ -1,4 +1,4 @@ -/*-- +/*-- Tutorial 03 Author: Ringwall @@ -15,7 +15,7 @@ protected func Initialize() PlaceGrass(85); CreateObject(Butterfly, 10, 10); - ScriptGo(true); + ScriptGo(true); // Goal: flag goal also checks if all targets are destroyed. var goal = CreateObject(Goal_ReachFlag, 0, 0, NO_OWNER); @@ -75,7 +75,7 @@ protected func OnGoalsFulfilled() { // Dialogue options -> next round. // Uncomment if there is a 4th tutorial. - // SetNextMission("Tutorial.c4f\\Tutorial04.c4s", "$MsgNextTutorial$", "$MsgNextTutorialDesc$"); + // SetNextMission("Tutorial.c4f\\Tutorial04.c4s", "$MsgNextTutorial$", "$MsgNextTutorialDesc$"); // Normal scenario ending by goal library. return false; } @@ -173,7 +173,7 @@ protected func OnGuideMessageRemoved(int plr, int index) private func MakeTarget(int x, int y, bool flying) { - if (flying == nil) + if (flying == nil) balloon = false; var target = CreateObject(PracticeTarget, x, y, NO_OWNER); diff --git a/planet/Tutorial.c4f/Tutorial03.c4s/System.c4g/FlagGoal.c b/planet/Tutorial.c4f/Tutorial03.c4s/System.c4g/FlagGoal.c index 2e260b1d8..12bf02b52 100644 --- a/planet/Tutorial.c4f/Tutorial03.c4s/System.c4g/FlagGoal.c +++ b/planet/Tutorial.c4f/Tutorial03.c4s/System.c4g/FlagGoal.c @@ -9,8 +9,8 @@ protected func Initialize() return _inherited(...); } -public func IsFulfilled() -{ +public func IsFulfilled() +{ // No flag, goal fulfilled. if (!flag) return true; diff --git a/planet/Tutorial.c4f/Tutorial03.c4s/System.c4g/WeaponFade.c b/planet/Tutorial.c4f/Tutorial03.c4s/System.c4g/WeaponFade.c index e1e5b58dd..54ed17cf5 100644 --- a/planet/Tutorial.c4f/Tutorial03.c4s/System.c4g/WeaponFade.c +++ b/planet/Tutorial.c4f/Tutorial03.c4s/System.c4g/WeaponFade.c @@ -9,7 +9,7 @@ protected func Departure(object container) if (container->GetOCF() & OCF_CrewMember) AddEffect("Fade", this, 100, 1, this); return _inherited(container, ...); -} +} protected func Hit() { @@ -19,7 +19,7 @@ protected func Hit() public func HitObject(object obj) { - if(obj->GetOCF() & OCF_CrewMember) + if(obj->GetOCF() & OCF_CrewMember) return; return _inherited(obj, ...); }