diff --git a/Clinfinity.c4d/System.c4g/DoubleJump.c b/Clinfinity.c4d/System.c4g/DoubleJump.c index d34e01ab..bc4b2b77 100644 --- a/Clinfinity.c4d/System.c4g/DoubleJump.c +++ b/Clinfinity.c4d/System.c4g/DoubleJump.c @@ -1,6 +1,6 @@ #strict 2 -#appendto CLNK +#appendto AVTR local doubleJumpPossible; local jumpParticleColour; @@ -34,9 +34,9 @@ protected func ControlRight() { protected func ControlUp() { var result = _inherited(); if( result == 0 ) { - if( GetAction() == "Jump" ) { - if( doubleJumpPossible ) { - doubleJumpPossible = false; + if( doubleJumpPossible ) { + doubleJumpPossible = false; + if( GetAction() == "Jump" ) { if( GetDir() == DIR_Left ) { SetXDir( -1 * Abs( GetXDir() ) ); } else { @@ -53,6 +53,25 @@ protected func ControlUp() { } Sound("DoubleJump"); return true; + } else if(GetAction() == "Tumble") { + // Currently tumbling, do a directional jump! + var angle = [0, 10, 22, 40, 57, 90, 146, 157, 177, -169, -160, -145, -130, -90, -40, -20][GetPhase()]; + if(GetDir() == DIR_Right) + angle *= -1; + var xdir = +Sin(angle, doubleJumpAcceleration); + var ydir = -Cos(angle, doubleJumpAcceleration); + SetXDir(GetXDir() + xdir); + SetYDir(GetYDir() + ydir); + var hgt = 9; + for(var i = -3; i < 4; i++) { + var a = 8*i + angle; + CreateParticle("MSpark", -Sin(a, hgt - Random(3)), Cos(a, hgt - Random(3)), -xdir/2, -ydir/2, 40, jumpParticleColour); + } + Sound("DoubleJump"); + return true; + } else { + // We didn't do any jump, it's still possible! + doubleJumpPossible = true; } } } else { @@ -61,6 +80,13 @@ protected func ControlUp() { return 0; } +protected func ControlSpecial() { + if(GetAction() == "Jump") { + SetAction("Tumble"); + } + return _inherited(...); +} + protected func MakeDoubleJumpPossible() { doubleJumpPossible = true; } diff --git a/Clinfinity.c4d/System.c4g/FragileRock.c b/Clinfinity.c4d/System.c4g/FragileRock.c index 0e56741b..aad74d91 100644 --- a/Clinfinity.c4d/System.c4g/FragileRock.c +++ b/Clinfinity.c4d/System.c4g/FragileRock.c @@ -1,15 +1,15 @@ -#strict 2 - -#appendto ROCK - -protected func Hit() { - _inherited(...); - if(GetOCF() & OCF_HitSpeed4) { - var colourIndex = Random(3); - var red = GetMaterialColor(Material("Rock"), colourIndex, 0); - var green = GetMaterialColor(Material("Rock"), colourIndex, 1); - var blue = GetMaterialColor(Material("Rock"), colourIndex, 2); - CastParticles("MatSpark", RandomX(3, 6), RandomX(20, 30), 0, 0, 40, 60, RGBa(red, green, blue, 50), RGBa(red, green, blue, 50)); - RemoveObject(); - } +#strict 2 + +#appendto ROCK + +protected func Hit() { + _inherited(...); + if(GetOCF() & OCF_HitSpeed4) { + var colourIndex = Random(3); + var red = GetMaterialColor(Material("Rock"), colourIndex, 0); + var green = GetMaterialColor(Material("Rock"), colourIndex, 1); + var blue = GetMaterialColor(Material("Rock"), colourIndex, 2); + CastParticles("MatSpark", RandomX(3, 6), RandomX(20, 30), 0, 0, 40, 60, RGBa(red, green, blue, 50), RGBa(red, green, blue, 50)); + RemoveObject(); + } } \ No newline at end of file diff --git a/Clinfinity.c4f/RACE_Pilottraining.c4s/Script.c b/Clinfinity.c4f/RACE_Pilottraining.c4s/Script.c index 72cb61db..b97c6004 100644 --- a/Clinfinity.c4f/RACE_Pilottraining.c4s/Script.c +++ b/Clinfinity.c4f/RACE_Pilottraining.c4s/Script.c @@ -2,6 +2,8 @@ #strict 2 +static tumbleMode; + protected func Initialize() { // ozone SetGamma(RGB(0,0,8), RGB(115,125,125), RGB(255,255,255)); @@ -83,7 +85,32 @@ func GetRACEEndOffset() { return 100; } /* Spielerinitialisierung */ -protected func InitializePlayer(int plr) { return JoinPlayer(plr); } +protected func InitializePlayer(int plr) { + if(plr == 0) + SelectGamemode(); + return JoinPlayer(plr); +} + +private func SelectGamemode() { + var menu = CreateMenuTemplate(AVTR, "Options"); + AddEnumChoice(menu, 0, "Gamemode", 0, "Gamemode"); + AddEnumChoiceItem(menu, 0, "Gamemode", "Normal", "Normal", HAT9, false, true); + AddEnumChoiceItem(menu, 0, "Gamemode", "Tumble", "Tumble", HAT2, true, false); + + AddSubmenu(menu, 0, "TumbleSettings", MenuCond_Chosen(0, "Gamemode", "Tumble"), "Tumble Options", HAT6); + AddRangeChoice(menu, ["TumbleSettings"], "GameSpeed", 0, "Game Speed", BOMB, 10, 50, 1, 36); + CreateMenuByTemplate(GetCrew(), 0, "SetGameOptions", menu); +} + +public func SetGameOptions(array options) { + tumbleMode = HashGet(options, "Gamemode"); + if(tumbleMode) { + var tumbleSettings = HashGet(options, "TumbleSettings"); + var speed = HashGet(tumbleSettings, "GameSpeed"); + Message("Tumble mode @ %dfps \\o/", 0, speed); + SetGameSpeed(speed); + } +} private func JoinPlayer(int plr) { var clonk = GetCrew(plr); diff --git a/Clinfinity.c4f/RACE_Pilottraining.c4s/System.c4g/Aviator.c b/Clinfinity.c4f/RACE_Pilottraining.c4s/System.c4g/Aviator.c new file mode 100644 index 00000000..691f6f62 --- /dev/null +++ b/Clinfinity.c4f/RACE_Pilottraining.c4s/System.c4g/Aviator.c @@ -0,0 +1,24 @@ +/* Tumble mode hacks */ +#strict 2 + +#appendto AVTR + +protected func MakeDoubleJumpPossible() { + if(tumbleMode) + // No normal jumping + SetAction("Tumble"); + return inherited(...); +} + +protected func ControlUp() { + if(tumbleMode) + // Always possible \o/ + doubleJumpPossible = true; + return inherited(...); +} + +protected func ControlUpDouble() { + if(tumbleMode) + // Faster double jump + return ControlUp(...); +}