summaryrefslogtreecommitdiffstats
path: root/TemplePushing.c4s/CliffPushing.c4d/Rules.c4d/Spawnpoints.c4d/Spawnpoint.c4d/Script.c
diff options
context:
space:
mode:
Diffstat (limited to 'TemplePushing.c4s/CliffPushing.c4d/Rules.c4d/Spawnpoints.c4d/Spawnpoint.c4d/Script.c')
-rw-r--r--TemplePushing.c4s/CliffPushing.c4d/Rules.c4d/Spawnpoints.c4d/Spawnpoint.c4d/Script.c176
1 files changed, 0 insertions, 176 deletions
diff --git a/TemplePushing.c4s/CliffPushing.c4d/Rules.c4d/Spawnpoints.c4d/Spawnpoint.c4d/Script.c b/TemplePushing.c4s/CliffPushing.c4d/Rules.c4d/Spawnpoints.c4d/Spawnpoint.c4d/Script.c
deleted file mode 100644
index c4ec93a..0000000
--- a/TemplePushing.c4s/CliffPushing.c4d/Rules.c4d/Spawnpoints.c4d/Spawnpoint.c4d/Script.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*-- Spawnpoint --*/
-
-#strict
-
-local initialized, angle, player, spawntimer,WpID;
-
-func IsWaypoint() { return(1); }
-
-global func PlaceSpawnpoint(id idObj, int iX, int iY, int timer)
-{
- var spwn = CreateObject(SPNP, iX, iY, -1);
- spwn->CreateContents(idObj);
- if(timer)
- spwn->LocalN("spawntimer") = timer;
- return(spwn);
-}
-
-protected func Initialize()
-{
- WpID = [FLNT,SCRL,AXE1,TFLN,COKI,SFLN,PMON,PSTO,EFLN,FBMP,SWOR];
- // Standardtimer = 600 Frames
- spawntimer = 600;
- SetClrModulation(RGBa(0,0,0,255));
-}
-
-protected func Timer()
-{
- if(!player) player = CreateArray();
- // Noch nicht initialisiert?
- if(!initialized)
- // Ein Inhaltsobjekt?
- if(Contents())
- // Initialisieren
- return(Initialized());
- // Kein Inhalt?
- if(!Contents())
- {
- return(CreateContents(WpID[Random(GetLength(WpID))]));
- }
- // Tolle Effekt starten
- angle += 10;
- if(angle >= 360) angle = 0;
- SetObjDrawTransform(1000, 0,0,0, 1000, Sin(angle, 8)*1000 - 2000,0, 1);
- if(Random(2)) CreateParticle("NoGravSpark", RandomX(-5,5), RandomX(5,10), 0, -5, 25, RGBa(210, 210, 255, 100));
- // Alle Timer runterzählen
- DecreaseTimer();
-}
-
-private func Initialized()
-{
- // Unsichtbar werden
- SetAction("Invis");
- // Objekt als Layer auflegen
- SetGraphics(0, 0, GetID(Contents()), 1, 1);
- // Transformation
- SetObjDrawTransform(1000, 0,0,0, 1000, -5000,0, 1);
- // Sammeleffekt starten
-// AddEffect("Collect", this(), 1, 3, this());
- // Objekt(e) erzeugen
- // Waffen-Bleiben-Regel
-//player = CreateArray();
- // Initialisiert
- initialized = true;
-}
-
-/* Timer runterzählen */
-
-private func DecreaseTimer()
-{
- // Waffen-Bleiben-Regel
- if(FindObject(WPST))
- {
- for(var i=0 ; i < GetPlayerCount() ; i++)
- // Spielertimer runterzählen
- {
- if(player[GetPlayerByIndex(i)])
- player[GetPlayerByIndex(i)] -= 5;
- if(player[GetPlayerByIndex(i)] <= 0 && !(Local() & 2**GetPlayerByIndex(i)))
- {
- // Spieler kann das Objekt wieder einsammeln
- player[GetPlayerByIndex(i)] = 0;
- Local() += 2**GetPlayerByIndex(i);
- }
- }
- }
- else
- {
- // Timer runterzählen
- player[0] -= 5;
- if(player[0] <= 0)
- {
- // Objekt ist wieder da
- player[0] = 0;
- Local() = true;
- SetVisibility(VIS_All());
- }
- }
-}
-
-/* Einsammel-Effekte */
-/*
-public func FxCollectTimer()
-{
- // Ist ein Clonk hier? -> Einsammeln lassen
- var pObj;
- for(var pClonk in FindObjects(Find_AtPoint(), Find_OCF(OCF_CrewMember()), Find_OCF(OCF_CrewMember()), Find_NoContainer()))
- if(CheckCollect(GetOwner(pClonk)))
- {
- pObj = FindContents();
- // Kann der Clonk einsammeln?
- Collect(pObj, pClonk);
- if(Contained(pObj) == this()) RemoveObject(pObj);
- else
- {
- Sound("Grab", 0, pClonk, 0, GetOwner(pClonk)+1);
- Collected(GetOwner(pClonk));
- }
- }
-}*/
-
-public func RejectEntrance(object pClonk)
-{
- // Objekt ist ein Clonk?
- if(!(GetOCF(pClonk) & OCF_CrewMember) && !(pClonk->~CanCollectFromSpawnpoints())) return(1);
- // Ich hab Contents?
- if(!Contents()) return(1);
- // Darf einsammeln
- if(CheckCollect(GetOwner(pClonk)))
- {
- var pObj = Contents();
- // Kann der Clonk einsammeln?
- if(ObjectCount(0, 0, 0, 0, 0, 0, 0, 0, pClonk) >= 1)
- return(1);
-
- Collect(pObj, pClonk);
- CreateContents(WpID[Random(GetLength(WpID))]);
- Initialized();
- if(Contained(pObj) == this()) RemoveObject(pObj);
- else
- {
- Sound("Grab", 0, pClonk, 0, GetOwner(pClonk)+1);
- Collected(GetOwner(pClonk));
- }
- }
- return(1);
-}
-
-private func CheckCollect(int iPlr) // Überprüft, ob ein Spieler das Objekt einsammeln darf
-{
- // Waffen-Bleiben-Regel
- if(FindObject(WPST))
- return(Local() & 2**iPlr);
- else
- return(Local());
-}
-
-private func Collected(int iPlr) // Regelt, dass ein Spieler das Objekt einsammelt
-{
- // Waffen-Bleiben-Regel
- if(FindObject(WPST))
- {
- // Spielertimer hochsetzen
- player[iPlr] = spawntimer;
- // Nicht mehr sichtbar für den Spieler
- Local() -= 2**iPlr;
- }
- else
- {
- // Timer hochsetzen
- player[0] = spawntimer;
- // Nicht mehr einsammelbar
- Local() = false;
- // Nicht mehr sichtbar
- SetVisibility(VIS_God());
- }
-}