Skip to content

Commit

Permalink
v1.013 - SM Obstacle - Prevent CP jumps
Browse files Browse the repository at this point in the history
In ShootMania Obstacle, you can jump to any CP you want. We cancel the quest if any jump is made during a quest.
  • Loading branch information
Harest committed Dec 2, 2019
1 parent ab72911 commit ff238c0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,23 @@
$startTimeVar = "RaceStartTime";
// Name of the RequireContext condition for the script to run in-game
$RequiredContext = "CTmMlScriptIngame";
// Additional script included for ShootMania, concerning Obstacle to prevent jumps from cp to cp
$scriptSMObstaclePreventJump = "";
if ($ShootManiaCall == true) {
$startTimeVar = "StartTime";
$RequiredContext = "CSmMlScriptIngame";
$scriptSMObstaclePreventJump = '
// Little check SM Obstacle specific to avoid any CP jump during a quest
if (LoadedTitle.TitleId == "obstacle@smokegun") {
declare LocalPlayer <=> InputPlayer;
declare netread Net_UsedJump for LocalPlayer = False;
if (Net_UsedJump) {
if (DebugMode) log("Jump used. Quest cancelled.");
clearPersistentData();
return;
}
}
';
}
// URL used in the few requests done in the script (to get the board, the tokens and register a completed quest)
$urlToRequest = ($_SERVER['HTTPS'] == "on") ? "https://" : "http://";
Expand Down Expand Up @@ -489,6 +503,8 @@
return;
}
'.$scriptSMObstaclePreventJump.'
declare Text RemoveToken = "'.htmlentities($Token, ENT_XML1).'";
// We set the right token state as collected (True)
for(i,0,Pe_LocalTokensIds[G_QuestId].count-1)
Expand Down

0 comments on commit ff238c0

Please sign in to comment.