mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
reported bugfixes
This commit is contained in:
parent
70b4d51943
commit
ebd3f03e13
9 changed files with 47 additions and 9 deletions
|
|
@ -74,6 +74,7 @@ import src.InteriorObject;
|
||||||
import src.Console;
|
import src.Console;
|
||||||
import src.Gamepad;
|
import src.Gamepad;
|
||||||
import net.Move;
|
import net.Move;
|
||||||
|
import src.ProfilerUI;
|
||||||
|
|
||||||
enum Mode {
|
enum Mode {
|
||||||
Start;
|
Start;
|
||||||
|
|
@ -2128,6 +2129,11 @@ class Marble extends GameObject {
|
||||||
// Pad null move on client
|
// Pad null move on client
|
||||||
this.connection.moveManager.duplicateLastMove();
|
this.connection.moveManager.duplicateLastMove();
|
||||||
}
|
}
|
||||||
|
if (ProfilerUI.instance.fps < 30) {
|
||||||
|
this.connection.moveManager.stall = true; // Our fps fucked, stall pls
|
||||||
|
} else {
|
||||||
|
this.connection.moveManager.stall = false;
|
||||||
|
}
|
||||||
if (p.netFlags & MarbleNetFlags.UpdateTrapdoor > 0) {
|
if (p.netFlags & MarbleNetFlags.UpdateTrapdoor > 0) {
|
||||||
for (tId => tTime in p.trapdoorUpdates) {
|
for (tId => tTime in p.trapdoorUpdates) {
|
||||||
@:privateAccess level.trapdoorPredictions.acknowledgeTrapdoorUpdate(tId, tTime);
|
@:privateAccess level.trapdoorPredictions.acknowledgeTrapdoorUpdate(tId, tTime);
|
||||||
|
|
@ -2244,7 +2250,7 @@ class Marble extends GameObject {
|
||||||
var smooth = 1.0 / (newDt * (newDt * 0.235 * newDt) + newDt + 1.0 + 0.48 * newDt * newDt);
|
var smooth = 1.0 / (newDt * (newDt * 0.235 * newDt) + newDt + 1.0 + 0.48 * newDt * newDt);
|
||||||
this.netSmoothOffset.scale(smooth);
|
this.netSmoothOffset.scale(smooth);
|
||||||
var smoothScale = this.netSmoothOffset.lengthSq();
|
var smoothScale = this.netSmoothOffset.lengthSq();
|
||||||
if (smoothScale < 0.01 || smoothScale > 10.0)
|
if (smoothScale < 0.01 || smoothScale > 25.0)
|
||||||
this.netSmoothOffset.set(0, 0, 0);
|
this.netSmoothOffset.set(0, 0, 0);
|
||||||
|
|
||||||
if (oldPos != null && newPos != null) {
|
if (oldPos != null && newPos != null) {
|
||||||
|
|
|
||||||
|
|
@ -850,7 +850,10 @@ class MarbleWorld extends Scheduler {
|
||||||
|
|
||||||
var store = marble.heldPowerup;
|
var store = marble.heldPowerup;
|
||||||
marble.heldPowerup = null;
|
marble.heldPowerup = null;
|
||||||
haxe.Timer.delay(() -> marble.heldPowerup = store, 500); // This bs
|
haxe.Timer.delay(() -> {
|
||||||
|
if (marble.heldPowerup == null)
|
||||||
|
marble.heldPowerup = store;
|
||||||
|
}, 500); // This bs
|
||||||
|
|
||||||
if (marble == this.marble)
|
if (marble == this.marble)
|
||||||
this.playGui.setCenterText('none');
|
this.playGui.setCenterText('none');
|
||||||
|
|
@ -2274,9 +2277,12 @@ class MarbleWorld extends Scheduler {
|
||||||
|
|
||||||
if (prevGameplayClock > alarmStart && this.timeState.gameplayClock <= alarmStart) {
|
if (prevGameplayClock > alarmStart && this.timeState.gameplayClock <= alarmStart) {
|
||||||
// Start the alarm
|
// Start the alarm
|
||||||
this.alarmSound = AudioManager.playSound(ResourceLoader.getResource("data/sound/alarm.wav", ResourceLoader.getAudio, this.soundResources),
|
if (this.alarmSound == null) {
|
||||||
null, true); // AudioManager.createAudioSource('alarm.wav');
|
this.alarmSound = AudioManager.playSound(ResourceLoader.getResource("data/sound/alarm.wav", ResourceLoader.getAudio,
|
||||||
this.displayHelp('You have ${alarmStart} seconds remaining.');
|
this.soundResources), null,
|
||||||
|
true); // AudioManager.createAudioSource('alarm.wav');
|
||||||
|
this.displayHelp('You have ${alarmStart} seconds remaining.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (prevGameplayClock > 0 && this.timeState.gameplayClock <= 0) {
|
if (prevGameplayClock > 0 && this.timeState.gameplayClock <= 0) {
|
||||||
// Stop the alarm
|
// Stop the alarm
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@ class MPExitGameDlg extends GuiControl {
|
||||||
quickspawnBtn.vertSizing = Top;
|
quickspawnBtn.vertSizing = Top;
|
||||||
quickspawnBtn.pressedAction = (e) -> {
|
quickspawnBtn.pressedAction = (e) -> {
|
||||||
@:privateAccess Key.keyPressed[Settings.controlsSettings.respawn] = Key.getFrame() - 1; // jank
|
@:privateAccess Key.keyPressed[Settings.controlsSettings.respawn] = Key.getFrame() - 1; // jank
|
||||||
|
MarbleGame.canvas.popDialog(this);
|
||||||
}
|
}
|
||||||
dialogImg.addChild(quickspawnBtn);
|
dialogImg.addChild(quickspawnBtn);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -660,6 +660,9 @@ class MPPlayMissionGui extends GuiImage {
|
||||||
}
|
}
|
||||||
updateLobbyNames();
|
updateLobbyNames();
|
||||||
redrawChat();
|
redrawChat();
|
||||||
|
haxe.Timer.delay(() -> {
|
||||||
|
this.chatScroll.updateScrollVisual();
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override function render(scene2d:Scene, ?parent:h2d.Flow) {
|
public override function render(scene2d:Scene, ?parent:h2d.Flow) {
|
||||||
|
|
|
||||||
|
|
@ -255,6 +255,8 @@ class MPPreGameDlg extends GuiControl {
|
||||||
});
|
});
|
||||||
spectateBtn.anim.currentFrame = Net.clientSpectate ? 2 : 0;
|
spectateBtn.anim.currentFrame = Net.clientSpectate ? 2 : 0;
|
||||||
readyBtn.anim.currentFrame = Net.lobbyClientReady ? 2 : 0;
|
readyBtn.anim.currentFrame = Net.lobbyClientReady ? 2 : 0;
|
||||||
|
spectateBtn.pressed = Net.clientSpectate;
|
||||||
|
readyBtn.pressed = Net.lobbyClientReady;
|
||||||
}
|
}
|
||||||
if (Net.clientIdMap != null) {
|
if (Net.clientIdMap != null) {
|
||||||
for (c => v in Net.clientIdMap) {
|
for (c => v in Net.clientIdMap) {
|
||||||
|
|
|
||||||
|
|
@ -267,8 +267,15 @@ class MPSearchGui extends GuiImage {
|
||||||
searchRandom.position = new Vector(44, 45);
|
searchRandom.position = new Vector(44, 45);
|
||||||
searchRandom.extent = new Vector(44, 44);
|
searchRandom.extent = new Vector(44, 44);
|
||||||
searchRandom.pressedAction = (e) -> {
|
searchRandom.pressedAction = (e) -> {
|
||||||
var mis = missionList[Math.floor(Math.random() * missionList.length)];
|
var mis = retrieveMissionList[Math.floor(Math.random() * missionList.length)];
|
||||||
cast(this.parent, Canvas).marbleGame.playMission(mis.mis);
|
|
||||||
|
if (mis.difficulty == "custom") {
|
||||||
|
var idx = Marbleland.multiplayerMissions.indexOf(mis.mis);
|
||||||
|
NetCommands.setLobbyLevelIndex(mis.difficulty, idx);
|
||||||
|
} else {
|
||||||
|
var idx = MissionList.missionList["multiplayer"][mis.difficulty].indexOf(mis.mis);
|
||||||
|
NetCommands.setLobbyLevelIndex(mis.difficulty, idx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
optionsBg.addChild(searchRandom);
|
optionsBg.addChild(searchRandom);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -807,6 +807,9 @@ class PlayGui {
|
||||||
if (score == 10) {
|
if (score == 10) {
|
||||||
f[0].p += 1;
|
f[0].p += 1;
|
||||||
}
|
}
|
||||||
|
if (f[0].us && Net.isClient) {
|
||||||
|
@:privateAccess formatGemHuntCounter(f[0].score);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id == Net.clientId) {
|
if (id == Net.clientId) {
|
||||||
|
|
|
||||||
|
|
@ -527,6 +527,11 @@ class HuntMode extends NullMode {
|
||||||
@:privateAccess level.timeTravelSound = null;
|
@:privateAccess level.timeTravelSound = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (@:privateAccess level.alarmSound != null) {
|
||||||
|
@:privateAccess level.alarmSound.stop();
|
||||||
|
@:privateAccess level.alarmSound = null;
|
||||||
|
}
|
||||||
|
|
||||||
level.schedule(level.timeState.currentAttemptTime + 2, () -> {
|
level.schedule(level.timeState.currentAttemptTime + 2, () -> {
|
||||||
MarbleGame.canvas.pushDialog(new MPEndGameGui());
|
MarbleGame.canvas.pushDialog(new MPEndGameGui());
|
||||||
level.setCursorLock(false);
|
level.setCursorLock(false);
|
||||||
|
|
@ -548,7 +553,6 @@ class HuntMode extends NullMode {
|
||||||
|
|
||||||
if (expiredGems.exists(gem)) {
|
if (expiredGems.exists(gem)) {
|
||||||
wasExpiredGem = true;
|
wasExpiredGem = true;
|
||||||
expiredGems.remove(gem);
|
|
||||||
}
|
}
|
||||||
if (gemToBlackBeamMap.exists(gem)) {
|
if (gemToBlackBeamMap.exists(gem)) {
|
||||||
gemToBlackBeamMap.get(gem).setHide(true);
|
gemToBlackBeamMap.get(gem).setHide(true);
|
||||||
|
|
@ -585,7 +589,8 @@ class HuntMode extends NullMode {
|
||||||
points += 10;
|
points += 10;
|
||||||
@:privateAccess level.playGui.addMiddleMessage('+10', 0xdddddd);
|
@:privateAccess level.playGui.addMiddleMessage('+10', 0xdddddd);
|
||||||
}
|
}
|
||||||
@:privateAccess level.playGui.formatGemHuntCounter(points);
|
if (Net.isHost)
|
||||||
|
@:privateAccess level.playGui.formatGemHuntCounter(points);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -624,6 +629,7 @@ class HuntMode extends NullMode {
|
||||||
}
|
}
|
||||||
if (remaining == 0) {
|
if (remaining == 0) {
|
||||||
NetCommands.setCompetitiveTimerStartTicks(0);
|
NetCommands.setCompetitiveTimerStartTicks(0);
|
||||||
|
spawnNextGemCluster();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -641,6 +647,8 @@ class HuntMode extends NullMode {
|
||||||
|
|
||||||
@:privateAccess level.playGui.incrementPlayerScore(packet.clientId, packet.scoreIncr);
|
@:privateAccess level.playGui.incrementPlayerScore(packet.clientId, packet.scoreIncr);
|
||||||
}
|
}
|
||||||
|
if (wasExpiredGem)
|
||||||
|
expiredGems.remove(gem);
|
||||||
if (this.level.isMultiplayer && Net.isClient) {
|
if (this.level.isMultiplayer && Net.isClient) {
|
||||||
gem.pickUpClient = @:privateAccess marble.connection == null ? Net.clientId : @:privateAccess marble.connection.id;
|
gem.pickUpClient = @:privateAccess marble.connection == null ? Net.clientId : @:privateAccess marble.connection.id;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,10 @@ class Trapdoor extends DtsObject {
|
||||||
direction = -1;
|
direction = -1;
|
||||||
if (direction != 0 && direction != this.lastDirection) {
|
if (direction != 0 && direction != this.lastDirection) {
|
||||||
// If the direction has changed, play the sound
|
// If the direction has changed, play the sound
|
||||||
|
var distFromUs = @:privateAccess this.level.marble.lastRenderPos.distanceSq(this.getAbsPos().getPosition());
|
||||||
var ch = AudioManager.playSound(ResourceLoader.getResource("data/sound/trapdooropen.wav", ResourceLoader.getAudio, this.soundResources),
|
var ch = AudioManager.playSound(ResourceLoader.getResource("data/sound/trapdooropen.wav", ResourceLoader.getAudio, this.soundResources),
|
||||||
this.getAbsPos().getPosition());
|
this.getAbsPos().getPosition());
|
||||||
|
ch.volume *= (1 / Math.max(1, distFromUs));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.lastCompletion = currentCompletion;
|
this.lastCompletion = currentCompletion;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue