diff options
| author | Jan <> | 2015-02-02 17:58:18 +0100 |
|---|---|---|
| committer | Jan <_> | 2015-07-10 17:51:43 +0200 |
| commit | ca61c54b9bd69af897e4cc9d4385137fb56fd11a (patch) | |
| tree | a4363f466cea6de48ca81fadc08273d58698d2ff /TemplePushing.c4s/Rules.c4d/OutFader.c4d/Script.c | |
| parent | 32a9632fbca3dd7a88bd3154b84a3773af39c276 (diff) | |
| download | tempelschubsen-ca61c54b9bd69af897e4cc9d4385137fb56fd11a.tar.gz tempelschubsen-ca61c54b9bd69af897e4cc9d4385137fb56fd11a.zip | |
TemplePushingBeta.c4s
Diffstat (limited to 'TemplePushing.c4s/Rules.c4d/OutFader.c4d/Script.c')
| -rw-r--r-- | TemplePushing.c4s/Rules.c4d/OutFader.c4d/Script.c | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/TemplePushing.c4s/Rules.c4d/OutFader.c4d/Script.c b/TemplePushing.c4s/Rules.c4d/OutFader.c4d/Script.c new file mode 100644 index 0000000..9bd1dea --- /dev/null +++ b/TemplePushing.c4s/Rules.c4d/OutFader.c4d/Script.c @@ -0,0 +1,78 @@ +/*-- Out-Fader --*/ + +#strict 2 + +protected func Activate(iByPlayer) +{ + MessageWindow(GetDesc(), iByPlayer); + return(1); +} + +func Fading(iPlr) +{ + for (var obj in FindObjects(Find_OCF(OCF_InFree | OCF_InSolid | OCF_InLiquid),Find_Category(C4D_Object | C4D_Living))) + if (!ImportantID(GetID(obj))) + { + if (GetAction(obj)=="Idle") + { + // Object owned by anyone? + if (GetOwner(obj)==-1) FadeOut(obj,2); + else FadeOut(obj,3); + } + else if (GetAction(obj)=="Dead" && !GetAlive()) + { + if (GetOwner(obj)==-1) FadeOut(obj,1); + else FadeOut(obj,5); + } + else if (GetAction(obj)=="Be") + { + if (GetOwner(obj)==-1) FadeOut(obj,2); + else FadeOut(obj,3); + } + else if (GetAction(obj)=="None") + { + if (GetOwner(obj)==-1) FadeOut(obj,1); + else FadeOut(obj,1); + } + else if (GetAction(obj)=="Exist") + { + if (GetOwner(obj)==-1) FadeOut(obj,2); + else FadeOut(obj,3); + } + } + return(1); +} + + +global func FadeOut(pObj,iTime) +{ + if (!iTime) iTime=2; + if (!pObj) pObj=this; + if (GetEffect("FadeOut",pObj)) return(0); + AddEffect("FadeOut",pObj,200,iTime,0,OFDR); + return(1); +} + +func FxFadeOutStart(pTarget,iEffectNumber) +{ + EffectVar(0,pTarget,iEffectNumber)=255; + return(1); +} + +func FxFadeOutStop(pTarget,iEffectNumber) +{ + SetClrModulation(RGBa(255,255,255),pTarget); + return(1); +} + +func FxFadeOutTimer(pTarget,iEffectNumber) +{ + if (!pTarget) return(-1); + if (Contained(pTarget)) return(-1); + EffectVar(0,pTarget,iEffectNumber)--; + if (!EffectVar(0,pTarget,iEffectNumber)) RemoveObject(pTarget); + SetClrModulation(RGBa(255,255,255,255-EffectVar(0,pTarget,iEffectNumber)),pTarget); + return(1); +} + +global func ImportantID(idObj) { return 0; }
\ No newline at end of file |
