From 8e90caa4137c6be116812d292db3772d070643bb Mon Sep 17 00:00:00 2001 From: Charles Spurrill Date: Wed, 24 Nov 2010 12:28:56 -0800 Subject: [PATCH] moon cleanup --- .../Time.c4d/Moon.c4d/Script.c | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) 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 d24251e3c..5c21b43d2 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 @@ -5,42 +5,42 @@ local phase; protected func Initialize() { var alpha=0; - if(GetTime()<300 || GetTime()>1140) alpha=255; + if(GetTime() < 300 || GetTime() > 1140) alpha=255; SetClrModulation(RGBa(255,255,255,alpha)); - phase=1; + phase = 1; Phase(true); - this["Parallaxity"] = [40,100]; + this["Parallaxity"] = [40,40]; } 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(); - if(phase>1) SetGraphics(Format("%d",LocalN("phase")-1)); - if(phase==1) SetPosition(LandscapeWidth()/4,LandscapeHeight()/4); - if(phase==2) SetPosition(LandscapeWidth()/3,LandscapeHeight()/5); - if(phase==3) SetPosition(LandscapeWidth()/2,LandscapeHeight()/6); - if(phase==4) SetPosition(LandscapeWidth()-LandscapeWidth()/3,LandscapeHeight()/5); - if(phase==5) SetPosition(LandscapeWidth()-LandscapeWidth()/4,LandscapeHeight()/4); + if(phase == 1) SetGraphics(); + if(phase > 1) SetGraphics(Format("%d",phase - 1)); + if(phase == 1) SetPosition(LandscapeWidth() / 4,LandscapeHeight() / 4); + if(phase == 2) SetPosition(LandscapeWidth() / 3,LandscapeHeight() / 5); + if(phase == 3) SetPosition(LandscapeWidth() / 2,LandscapeHeight() / 6); + if(phase == 4) SetPosition(LandscapeWidth() - LandscapeWidth() / 3, LandscapeHeight() / 5); + if(phase == 5) SetPosition(LandscapeWidth() - LandscapeWidth() / 4, LandscapeHeight() / 4); } //Get phase can also be used to modify the phase... ie: QueryPhase(3) would set //the phase of the moon to phase 3. QueryPhase() will simply return the current moon phase. -global func GetPhase(int iphase) +public func GetPhase(int iphase) { - var moonphase=FindObject(Find_ID(Moon))->LocalN("phase"); - if(iphase!=nil && iphase<6) FindObject(Find_ID(Moon))->SetPhase(iphase); + var moonphase = phase; + if(iphase != nil && iphase < 6) SetPhase(iphase); return moonphase; } //ties global to local func public func SetPhase(int iphase) { - phase=iphase; + phase = iphase; Phase(true); }