mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-27 13:11:42 +00:00
remove the mbp stuff
This commit is contained in:
parent
67b17c98b2
commit
ec36c07810
3 changed files with 24 additions and 149 deletions
|
|
@ -82,24 +82,16 @@ class MarbleWorldMacros {
|
||||||
shape = new TriangleBumper();
|
shape = new TriangleBumper();
|
||||||
else if (dataBlockLowerCase == "helicopteritem" || dataBlockLowerCase == "helicopteritem_mbu")
|
else if (dataBlockLowerCase == "helicopteritem" || dataBlockLowerCase == "helicopteritem_mbu")
|
||||||
shape = new Helicopter(cast element);
|
shape = new Helicopter(cast element);
|
||||||
else if (dataBlockLowerCase == "easteregg" || dataBlockLowerCase == "easteregg_mbu")
|
|
||||||
shape = new EasterEgg(cast element);
|
|
||||||
else if (dataBlockLowerCase == "checkpoint" || dataBlockLowerCase == "checkpoint_mbu")
|
|
||||||
shape = new Checkpoint(cast element);
|
|
||||||
else if (dataBlockLowerCase == "ductfan" || dataBlockLowerCase == "ductfan_mbu" || dataBlockLowerCase == "ductfan_mbm")
|
else if (dataBlockLowerCase == "ductfan" || dataBlockLowerCase == "ductfan_mbu" || dataBlockLowerCase == "ductfan_mbm")
|
||||||
shape = new DuctFan();
|
shape = new DuctFan();
|
||||||
else if (dataBlockLowerCase == "smallductfan" || dataBlockLowerCase == "smallductfan_mbm")
|
else if (dataBlockLowerCase == "smallductfan" || dataBlockLowerCase == "smallductfan_mbm")
|
||||||
shape = new SmallDuctFan();
|
shape = new SmallDuctFan();
|
||||||
else if (dataBlockLowerCase == "magnet")
|
|
||||||
shape = new Magnet();
|
|
||||||
else if (dataBlockLowerCase == "antigravityitem" || dataBlockLowerCase == "antigravityitem_mbu")
|
else if (dataBlockLowerCase == "antigravityitem" || dataBlockLowerCase == "antigravityitem_mbu")
|
||||||
shape = new AntiGravity(cast element);
|
shape = new AntiGravity(cast element);
|
||||||
else if (dataBlockLowerCase == "norespawnantigravityitem")
|
else if (dataBlockLowerCase == "norespawnantigravityitem")
|
||||||
shape = new AntiGravity(cast element, true);
|
shape = new AntiGravity(cast element, true);
|
||||||
else if (dataBlockLowerCase == "landmine" || dataBlockLowerCase == "landmine_mbm")
|
else if (dataBlockLowerCase == "landmine" || dataBlockLowerCase == "landmine_mbm")
|
||||||
shape = new LandMine();
|
shape = new LandMine();
|
||||||
else if (dataBlockLowerCase == "nuke")
|
|
||||||
shape = new Nuke();
|
|
||||||
else if (dataBlockLowerCase == "shockabsorberitem")
|
else if (dataBlockLowerCase == "shockabsorberitem")
|
||||||
shape = new ShockAbsorber(cast element);
|
shape = new ShockAbsorber(cast element);
|
||||||
else if (dataBlockLowerCase == "superspeeditem" || dataBlockLowerCase == "superspeeditem_mbu")
|
else if (dataBlockLowerCase == "superspeeditem" || dataBlockLowerCase == "superspeeditem_mbu")
|
||||||
|
|
@ -110,10 +102,6 @@ class MarbleWorldMacros {
|
||||||
shape = new TimeTravel(cast element);
|
shape = new TimeTravel(cast element);
|
||||||
else if (dataBlockLowerCase == "randompowerupitem")
|
else if (dataBlockLowerCase == "randompowerupitem")
|
||||||
shape = new RandomPowerup(cast element);
|
shape = new RandomPowerup(cast element);
|
||||||
else if (dataBlockLowerCase == "blastitem" || dataBlockLowerCase == "blastitem_mbu")
|
|
||||||
shape = new Blast(cast element);
|
|
||||||
else if (dataBlockLowerCase == "megamarbleitem" || dataBlockLowerCase == "megamarbleitem_mbu")
|
|
||||||
shape = new MegaMarble(cast element);
|
|
||||||
else if (dataBlockLowerCase == "tornado" || dataBlockLowerCase == "tornado_mbm")
|
else if (dataBlockLowerCase == "tornado" || dataBlockLowerCase == "tornado_mbm")
|
||||||
shape = new Tornado();
|
shape = new Tornado();
|
||||||
else if (dataBlockLowerCase == "trapdoor" || dataBlockLowerCase == "trapdoor_mbu")
|
else if (dataBlockLowerCase == "trapdoor" || dataBlockLowerCase == "trapdoor_mbu")
|
||||||
|
|
@ -124,17 +112,6 @@ class MarbleWorldMacros {
|
||||||
shape = new Oilslick();
|
shape = new Oilslick();
|
||||||
else if (dataBlockLowerCase == "arrow" || StringTools.startsWith(dataBlockLowerCase, "sign"))
|
else if (dataBlockLowerCase == "arrow" || StringTools.startsWith(dataBlockLowerCase, "sign"))
|
||||||
shape = new Sign(cast element);
|
shape = new Sign(cast element);
|
||||||
else if ([
|
|
||||||
"glass_3shape",
|
|
||||||
"glass_6shape",
|
|
||||||
"glass_9shape",
|
|
||||||
"glass_12shape",
|
|
||||||
"glass_15shape",
|
|
||||||
"glass_18shape"
|
|
||||||
].contains(dataBlockLowerCase))
|
|
||||||
shape = new Glass(cast element);
|
|
||||||
else if (["clear", "cloudy", "dusk", "wintry"].contains(dataBlockLowerCase))
|
|
||||||
shape = new shapes.Sky(dataBlockLowerCase);
|
|
||||||
else {
|
else {
|
||||||
Console.error("Unknown item: " + element.datablock);
|
Console.error("Unknown item: " + element.datablock);
|
||||||
onFinish();
|
onFinish();
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,6 @@ class MarbleWorld extends Scheduler {
|
||||||
public var cursorLock:Bool = true;
|
public var cursorLock:Bool = true;
|
||||||
|
|
||||||
var timeTravelSound:Channel;
|
var timeTravelSound:Channel;
|
||||||
var alarmSound:Channel;
|
|
||||||
|
|
||||||
var helpTextTimeState:Float = -1e8;
|
var helpTextTimeState:Float = -1e8;
|
||||||
var alertTextTimeState:Float = -1e8;
|
var alertTextTimeState:Float = -1e8;
|
||||||
|
|
@ -646,10 +645,6 @@ class MarbleWorld extends Scheduler {
|
||||||
this.marble.blastAmount = 0;
|
this.marble.blastAmount = 0;
|
||||||
this.marble.outOfBoundsTime = null;
|
this.marble.outOfBoundsTime = null;
|
||||||
this.finishTime = null;
|
this.finishTime = null;
|
||||||
if (this.alarmSound != null) {
|
|
||||||
this.alarmSound.stop();
|
|
||||||
this.alarmSound = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.currentCheckpoint = null;
|
this.currentCheckpoint = null;
|
||||||
this.currentCheckpointTrigger = null;
|
this.currentCheckpointTrigger = null;
|
||||||
|
|
@ -1004,12 +999,6 @@ class MarbleWorld extends Scheduler {
|
||||||
trigger = new InBoundsTrigger(element, cast this);
|
trigger = new InBoundsTrigger(element, cast this);
|
||||||
} else if (datablockLowercase == "helptrigger") {
|
} else if (datablockLowercase == "helptrigger") {
|
||||||
trigger = new HelpTrigger(element, cast this);
|
trigger = new HelpTrigger(element, cast this);
|
||||||
} else if (datablockLowercase == "teleporttrigger") {
|
|
||||||
trigger = new TeleportTrigger(element, cast this);
|
|
||||||
} else if (datablockLowercase == "destinationtrigger") {
|
|
||||||
trigger = new DestinationTrigger(element, cast this);
|
|
||||||
} else if (datablockLowercase == "checkpointtrigger") {
|
|
||||||
trigger = new CheckpointTrigger(element, cast this);
|
|
||||||
} else {
|
} else {
|
||||||
Console.error("Unknown trigger: " + element.datablock);
|
Console.error("Unknown trigger: " + element.datablock);
|
||||||
onFinish();
|
onFinish();
|
||||||
|
|
@ -2015,16 +2004,11 @@ class MarbleWorld extends Scheduler {
|
||||||
if (timeTravelSound == null) {
|
if (timeTravelSound == null) {
|
||||||
var ttsnd = ResourceLoader.getResource("data/sound/timetravelactive.wav", ResourceLoader.getAudio, this.soundResources);
|
var ttsnd = ResourceLoader.getResource("data/sound/timetravelactive.wav", ResourceLoader.getAudio, this.soundResources);
|
||||||
timeTravelSound = AudioManager.playSound(ttsnd, null, true);
|
timeTravelSound = AudioManager.playSound(ttsnd, null, true);
|
||||||
|
|
||||||
if (alarmSound != null)
|
|
||||||
alarmSound.pause = true;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (timeTravelSound != null) {
|
if (timeTravelSound != null) {
|
||||||
timeTravelSound.stop();
|
timeTravelSound.stop();
|
||||||
timeTravelSound = null;
|
timeTravelSound = null;
|
||||||
if (alarmSound != null)
|
|
||||||
alarmSound.pause = false;
|
|
||||||
}
|
}
|
||||||
if (!this.isMultiplayer) {
|
if (!this.isMultiplayer) {
|
||||||
if (this.timeState.currentAttemptTime >= 3.5) {
|
if (this.timeState.currentAttemptTime >= 3.5) {
|
||||||
|
|
@ -2075,49 +2059,6 @@ class MarbleWorld extends Scheduler {
|
||||||
}
|
}
|
||||||
this.timeState.timeSinceLoad += dt;
|
this.timeState.timeSinceLoad += dt;
|
||||||
|
|
||||||
// Handle alarm warnings (that the user is about to exceed the par time)
|
|
||||||
if (!Net.isMP) {
|
|
||||||
if (this.timeState.currentAttemptTime >= 3.5) {
|
|
||||||
var alarmStart = this.mission.computeAlarmStartTime();
|
|
||||||
|
|
||||||
if (prevGameplayClock < alarmStart && this.timeState.gameplayClock >= alarmStart) {
|
|
||||||
// Start the alarm
|
|
||||||
this.alarmSound = AudioManager.playSound(ResourceLoader.getResource("data/sound/alarm.wav", ResourceLoader.getAudio, this.soundResources),
|
|
||||||
null, true); // AudioManager.createAudioSource('alarm.wav');
|
|
||||||
this.displayHelp('You have ${(this.mission.qualifyTime - alarmStart)} seconds remaining.');
|
|
||||||
}
|
|
||||||
if (prevGameplayClock < this.mission.qualifyTime && this.timeState.gameplayClock >= this.mission.qualifyTime) {
|
|
||||||
// Stop the alarm
|
|
||||||
if (this.alarmSound != null) {
|
|
||||||
this.alarmSound.stop();
|
|
||||||
this.alarmSound = null;
|
|
||||||
}
|
|
||||||
this.displayHelp("The clock has passed the Par Time.");
|
|
||||||
AudioManager.playSound(ResourceLoader.getResource("data/sound/alarm_timeout.wav", ResourceLoader.getAudio, this.soundResources));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (this.multiplayerStarted) {
|
|
||||||
var alarmStart = this.mission.computeAlarmStartTime();
|
|
||||||
|
|
||||||
if (prevGameplayClock > alarmStart && this.timeState.gameplayClock <= alarmStart) {
|
|
||||||
// Start the alarm
|
|
||||||
if (this.alarmSound == null) {
|
|
||||||
this.alarmSound = AudioManager.playSound(ResourceLoader.getResource("data/sound/alarm.wav", ResourceLoader.getAudio,
|
|
||||||
this.soundResources), null,
|
|
||||||
true); // AudioManager.createAudioSource('alarm.wav');
|
|
||||||
this.displayHelp('You have ${alarmStart} seconds remaining.');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (prevGameplayClock > 0 && this.timeState.gameplayClock <= 0) {
|
|
||||||
// Stop the alarm
|
|
||||||
if (this.alarmSound != null) {
|
|
||||||
this.alarmSound.stop();
|
|
||||||
this.alarmSound = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (finishTime != null)
|
if (finishTime != null)
|
||||||
this.timeState.gameplayClock = finishTime.gameplayClock;
|
this.timeState.gameplayClock = finishTime.gameplayClock;
|
||||||
playGui.formatTimer(this.timeState.gameplayClock);
|
playGui.formatTimer(this.timeState.gameplayClock);
|
||||||
|
|
@ -2232,10 +2173,6 @@ class MarbleWorld extends Scheduler {
|
||||||
timeTravelSound.stop();
|
timeTravelSound.stop();
|
||||||
timeTravelSound = null;
|
timeTravelSound = null;
|
||||||
}
|
}
|
||||||
if (alarmSound != null) {
|
|
||||||
alarmSound.stop();
|
|
||||||
alarmSound = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.cancel(marble.oobSchedule);
|
this.cancel(marble.oobSchedule);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -158,38 +158,6 @@ class ResourceLoader {
|
||||||
toloadfiles.push(file);
|
toloadfiles.push(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
filestats = fileSystem.dir("missions_mbg");
|
|
||||||
for (file in filestats) {
|
|
||||||
if (file.isDirectory) {
|
|
||||||
toloaddirs.push(file);
|
|
||||||
} else {
|
|
||||||
toloadfiles.push(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
filestats = fileSystem.dir("missions_mbp");
|
|
||||||
for (file in filestats) {
|
|
||||||
if (file.isDirectory) {
|
|
||||||
toloaddirs.push(file);
|
|
||||||
} else {
|
|
||||||
toloadfiles.push(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
filestats = fileSystem.dir("missions_mbu");
|
|
||||||
for (file in filestats) {
|
|
||||||
if (file.isDirectory) {
|
|
||||||
toloaddirs.push(file);
|
|
||||||
} else {
|
|
||||||
toloadfiles.push(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
filestats = fileSystem.dir("multiplayer/hunt");
|
|
||||||
for (file in filestats) {
|
|
||||||
if (file.isDirectory) {
|
|
||||||
toloaddirs.push(file);
|
|
||||||
} else {
|
|
||||||
toloadfiles.push(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while (toloaddirs.length > 0) {
|
while (toloaddirs.length > 0) {
|
||||||
var nextdir = toloaddirs.pop();
|
var nextdir = toloaddirs.pop();
|
||||||
var pathToSearch = nextdir.path;
|
var pathToSearch = nextdir.path;
|
||||||
|
|
@ -214,7 +182,9 @@ class ResourceLoader {
|
||||||
static function preloadMusic(onFinish:Void->Void) {
|
static function preloadMusic(onFinish:Void->Void) {
|
||||||
var worker = new ResourceLoaderWorker(onFinish);
|
var worker = new ResourceLoaderWorker(onFinish);
|
||||||
worker.loadFile("sound/music/shell.ogg");
|
worker.loadFile("sound/music/shell.ogg");
|
||||||
worker.loadFile("sound/music/pianoforte.ogg");
|
worker.loadFile("sound/groovepolice.ogg");
|
||||||
|
worker.loadFile("sound/classic vibe.ogg");
|
||||||
|
worker.loadFile("sound/beach party.ogg");
|
||||||
worker.run();
|
worker.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -227,38 +197,29 @@ class ResourceLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
static function preloadShapes(onFinish:Void->Void) {
|
static function preloadShapes(onFinish:Void->Void) {
|
||||||
var toloadfiles = [
|
var toloadfiles = [];
|
||||||
StringTools.replace(Settings.optionsSettings.marbleModel, "data/", ""),
|
var toloaddirs = [];
|
||||||
(Settings.optionsSettings.marbleCategoryIndex == 0)
|
var filestats = fileSystem.dir("shapes");
|
||||||
? "shapes/balls/" + Settings.optionsSettings.marbleSkin + ".marble.png" : "shapes/balls/pack1/" + Settings.optionsSettings.marbleSkin +
|
for (file in filestats) {
|
||||||
".marble.png"
|
if (file.isDirectory) {
|
||||||
];
|
toloaddirs.push(file);
|
||||||
// var toloaddirs = [];
|
} else {
|
||||||
// var filestats = fileSystem.dir("shapes");
|
toloadfiles.push(file);
|
||||||
// for (file in filestats) {
|
}
|
||||||
// if (file.isDirectory) {
|
}
|
||||||
// toloaddirs.push(file);
|
while (toloaddirs.length > 0) {
|
||||||
// } else {
|
var nextdir = toloaddirs.pop();
|
||||||
// toloadfiles.push(file);
|
for (file in fileSystem.dir(nextdir.path.substring(2))) {
|
||||||
// }
|
if (file.isDirectory) {
|
||||||
// }
|
toloaddirs.push(file);
|
||||||
// while (toloaddirs.length > 0) {
|
} else {
|
||||||
// var nextdir = toloaddirs.pop();
|
toloadfiles.push(file);
|
||||||
// for (file in fileSystem.dir(nextdir.path.substring(2))) {
|
}
|
||||||
// if (file.isDirectory) {
|
}
|
||||||
// toloaddirs.push(file);
|
}
|
||||||
// } else {
|
|
||||||
// toloadfiles.push(file);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// var teleportPad = fileSystem.get("interiors_mbp/teleportpad.dts");
|
|
||||||
// var teleportTexture = fileSystem.get("interiors_mbp/repairbay.jpg");
|
|
||||||
// toloadfiles.push(teleportPad); // Because its not in the shapes folder like wtf
|
|
||||||
// toloadfiles.push(teleportTexture);
|
|
||||||
var worker = new ResourceLoaderWorker(onFinish);
|
var worker = new ResourceLoaderWorker(onFinish);
|
||||||
for (file in toloadfiles) {
|
for (file in toloadfiles) {
|
||||||
worker.loadFile(file);
|
worker.addTaskParallel((fwd) -> file.load(fwd));
|
||||||
}
|
}
|
||||||
worker.run();
|
worker.run();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue