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.Gamepad;
|
||||
import net.Move;
|
||||
import src.ProfilerUI;
|
||||
|
||||
enum Mode {
|
||||
Start;
|
||||
|
|
@ -2128,6 +2129,11 @@ class Marble extends GameObject {
|
|||
// Pad null move on client
|
||||
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) {
|
||||
for (tId => tTime in p.trapdoorUpdates) {
|
||||
@: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);
|
||||
this.netSmoothOffset.scale(smooth);
|
||||
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);
|
||||
|
||||
if (oldPos != null && newPos != null) {
|
||||
|
|
|
|||
|
|
@ -850,7 +850,10 @@ class MarbleWorld extends Scheduler {
|
|||
|
||||
var store = marble.heldPowerup;
|
||||
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)
|
||||
this.playGui.setCenterText('none');
|
||||
|
|
@ -2274,9 +2277,12 @@ class MarbleWorld extends Scheduler {
|
|||
|
||||
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 ${alarmStart} seconds remaining.');
|
||||
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
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ class MPExitGameDlg extends GuiControl {
|
|||
quickspawnBtn.vertSizing = Top;
|
||||
quickspawnBtn.pressedAction = (e) -> {
|
||||
@:privateAccess Key.keyPressed[Settings.controlsSettings.respawn] = Key.getFrame() - 1; // jank
|
||||
MarbleGame.canvas.popDialog(this);
|
||||
}
|
||||
dialogImg.addChild(quickspawnBtn);
|
||||
|
||||
|
|
|
|||
|
|
@ -660,6 +660,9 @@ class MPPlayMissionGui extends GuiImage {
|
|||
}
|
||||
updateLobbyNames();
|
||||
redrawChat();
|
||||
haxe.Timer.delay(() -> {
|
||||
this.chatScroll.updateScrollVisual();
|
||||
}, 50);
|
||||
}
|
||||
|
||||
public override function render(scene2d:Scene, ?parent:h2d.Flow) {
|
||||
|
|
|
|||
|
|
@ -255,6 +255,8 @@ class MPPreGameDlg extends GuiControl {
|
|||
});
|
||||
spectateBtn.anim.currentFrame = Net.clientSpectate ? 2 : 0;
|
||||
readyBtn.anim.currentFrame = Net.lobbyClientReady ? 2 : 0;
|
||||
spectateBtn.pressed = Net.clientSpectate;
|
||||
readyBtn.pressed = Net.lobbyClientReady;
|
||||
}
|
||||
if (Net.clientIdMap != null) {
|
||||
for (c => v in Net.clientIdMap) {
|
||||
|
|
|
|||
|
|
@ -267,8 +267,15 @@ class MPSearchGui extends GuiImage {
|
|||
searchRandom.position = new Vector(44, 45);
|
||||
searchRandom.extent = new Vector(44, 44);
|
||||
searchRandom.pressedAction = (e) -> {
|
||||
var mis = missionList[Math.floor(Math.random() * missionList.length)];
|
||||
cast(this.parent, Canvas).marbleGame.playMission(mis.mis);
|
||||
var mis = retrieveMissionList[Math.floor(Math.random() * missionList.length)];
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -807,6 +807,9 @@ class PlayGui {
|
|||
if (score == 10) {
|
||||
f[0].p += 1;
|
||||
}
|
||||
if (f[0].us && Net.isClient) {
|
||||
@:privateAccess formatGemHuntCounter(f[0].score);
|
||||
}
|
||||
}
|
||||
|
||||
if (id == Net.clientId) {
|
||||
|
|
|
|||
|
|
@ -527,6 +527,11 @@ class HuntMode extends NullMode {
|
|||
@:privateAccess level.timeTravelSound = null;
|
||||
}
|
||||
|
||||
if (@:privateAccess level.alarmSound != null) {
|
||||
@:privateAccess level.alarmSound.stop();
|
||||
@:privateAccess level.alarmSound = null;
|
||||
}
|
||||
|
||||
level.schedule(level.timeState.currentAttemptTime + 2, () -> {
|
||||
MarbleGame.canvas.pushDialog(new MPEndGameGui());
|
||||
level.setCursorLock(false);
|
||||
|
|
@ -548,7 +553,6 @@ class HuntMode extends NullMode {
|
|||
|
||||
if (expiredGems.exists(gem)) {
|
||||
wasExpiredGem = true;
|
||||
expiredGems.remove(gem);
|
||||
}
|
||||
if (gemToBlackBeamMap.exists(gem)) {
|
||||
gemToBlackBeamMap.get(gem).setHide(true);
|
||||
|
|
@ -585,7 +589,8 @@ class HuntMode extends NullMode {
|
|||
points += 10;
|
||||
@: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) {
|
||||
NetCommands.setCompetitiveTimerStartTicks(0);
|
||||
spawnNextGemCluster();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -641,6 +647,8 @@ class HuntMode extends NullMode {
|
|||
|
||||
@:privateAccess level.playGui.incrementPlayerScore(packet.clientId, packet.scoreIncr);
|
||||
}
|
||||
if (wasExpiredGem)
|
||||
expiredGems.remove(gem);
|
||||
if (this.level.isMultiplayer && Net.isClient) {
|
||||
gem.pickUpClient = @:privateAccess marble.connection == null ? Net.clientId : @:privateAccess marble.connection.id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,8 +53,10 @@ class Trapdoor extends DtsObject {
|
|||
direction = -1;
|
||||
if (direction != 0 && direction != this.lastDirection) {
|
||||
// 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),
|
||||
this.getAbsPos().getPosition());
|
||||
ch.volume *= (1 / Math.max(1, distFromUs));
|
||||
}
|
||||
|
||||
this.lastCompletion = currentCompletion;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue