diff options
Diffstat (limited to 'TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d')
12 files changed, 142 insertions, 0 deletions
diff --git a/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/DefCore.txt b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/DefCore.txt new file mode 100644 index 0000000..76d56e6 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/DefCore.txt @@ -0,0 +1,8 @@ +[DefCore] +id=SPSR +Version=4,9,8 +Name=SpawnPointSpawner +Category=C4D_StaticBack +Width=1 +Height=1 +Picture=0,0,64,64 diff --git a/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/DescDE.txt b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/DescDE.txt new file mode 100644 index 0000000..960aedf --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/DescDE.txt @@ -0,0 +1 @@ +Im Spiel finden sich Spawn Points, die als sicherer Nachschub an Waffen und Tränken dienen.
\ No newline at end of file diff --git a/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/DescUS.txt b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/DescUS.txt new file mode 100644 index 0000000..6719be2 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/DescUS.txt @@ -0,0 +1 @@ +Creates some spawn points in the game which are creating weapons and potions.
\ No newline at end of file diff --git a/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/Graphics.png b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/Graphics.png Binary files differnew file mode 100644 index 0000000..1543a79 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/Graphics.png diff --git a/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/Names.txt b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/Names.txt new file mode 100644 index 0000000..f74bd88 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/Names.txt @@ -0,0 +1,2 @@ +DE:Spawn Point Spawner +US:Spawn Point Spawner
\ No newline at end of file diff --git a/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/Script.c b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/Script.c new file mode 100644 index 0000000..380ee86 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/Script.c @@ -0,0 +1,57 @@ +/*-- Spawn Point Spawner --*/ + +#strict 2 + +local locations, definitions, spawnInterval; +local sumProbability; +local gamma; + +public func CreateSpawnPoints() +{ + for (var pos in locations) + { + var spawnpoint = CreateObject(SNPT, pos[0], pos[1], NO_OWNER); + if (gamma) spawnpoint->SetGamma(gamma[0], gamma[1], gamma[2]); + spawnpoint->Enable(this); + } +} + +// [[x1, y1], [x2, y2], ...] +public func SetLocations(array locations) +{ + LocalN("locations") = locations; +} + +// [[FLNT, 50], [SFLN, 20], ...] +public func SetDefinitions(array definitions) +{ + LocalN("definitions") = definitions; + + sumProbability = 0; + for (var def in definitions) + { + sumProbability += def[1]; + } +} + +public func SetSpawnpointGamma(int color1, int color2, int color3) +{ + gamma = [color1, color2, color3]; +} + +public func GetSpawnInterval() { return spawnInterval; } + +public func SetSpawnInterval(int spawnInterval) +{ + LocalN("spawnInterval") = spawnInterval; +} + +public func GetRandomDefinition() +{ + var rnd = Random(sumProbability); + for (var def in definitions) + { + rnd -= def[1]; + if (rnd < 0) return def[0]; + } +} diff --git a/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/DefCore.txt b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/DefCore.txt new file mode 100644 index 0000000..b977367 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/DefCore.txt @@ -0,0 +1,12 @@ +[DefCore] +id=SNPT +Name=SpawnPoint +Version=4,9,5 +Category=C4D_StaticBack|C4D_Foreground|C4D_MouseIgnore +Width=10 +Height=10 +Offset=-5,-5 +Picture=0,0,10,10 +Timer=5 +TimerCall=Timer +Collectible=1 diff --git a/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/DescDE.txt b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/DescDE.txt new file mode 100644 index 0000000..b469ce9 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/DescDE.txt @@ -0,0 +1 @@ +Lässt Gegenstände als Nachschub erscheinen.
\ No newline at end of file diff --git a/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/DescUS.txt b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/DescUS.txt new file mode 100644 index 0000000..3308b95 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/DescUS.txt @@ -0,0 +1 @@ +Spawns objects.
\ No newline at end of file diff --git a/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/Graphics.png b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/Graphics.png Binary files differnew file mode 100644 index 0000000..4f75bf2 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/Graphics.png diff --git a/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/Names.txt b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/Names.txt new file mode 100644 index 0000000..1315255 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/Names.txt @@ -0,0 +1,2 @@ +DE:Spawn Point +US:Spawn Point
\ No newline at end of file diff --git a/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/Script.c b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/Script.c new file mode 100644 index 0000000..def8ef0 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SpawnPointSpawner.c4d/SpawnPoint.c4d/Script.c @@ -0,0 +1,57 @@ +/*-- Spawnpoint --*/ + +#strict 2 + +local spawner; +local framesUntilRespawn; +local angle; + +public func Enable(object spawner) +{ + LocalN("spawner") = spawner; +} + +private func SpawnObject() +{ + CreateContents(spawner->GetRandomDefinition()); + SetGraphics(0, 0, Contents()->GetID(), GFX_Overlay, GFXOV_MODE_Base); + SetObjDrawTransform(1000, 0, 0, 0, 1000, -5000, 0, 1); +} + +private func Timer() +{ + if (!Contents()) + { + framesUntilRespawn -= 5; + if (framesUntilRespawn <= 0) SpawnObject(); + } + + angle = (angle + 10) % 360; + 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)); +} + +protected func RejectEntrance(object container) +{ + // Still in countdown? + if (!gameStarted) return true; + + // Container has to be a crew member + if (!(container->GetOCF() & OCF_CrewMember)) return true; + + // Ready? + if (!Contents()) return true; + + // Try to let container collect the object + container->Collect(Contents()); + + // Object still there? Then something went wrong + if (Contents()) return true; + + container->Sound("Grab", false, 0, 0, GetOwner(container) + 1); + + SetGraphics(0, 0, 0, GFX_Overlay, GFXOV_MODE_Base); + framesUntilRespawn = spawner->GetSpawnInterval(); + + return true; +} |
