more bugfixes

This commit is contained in:
RandomityGuy 2024-07-16 21:48:15 +05:30
parent b6679f7b87
commit 203916bfae
5 changed files with 26 additions and 16 deletions

View file

@ -1134,9 +1134,10 @@ class Marble extends GameObject {
// else // else
// gain = (contactVel - minVelocityBounceSoft) / (hardBounceSpeed - minVelocityBounceSoft) * (1.0 - gain) + gain; // gain = (contactVel - minVelocityBounceSoft) / (hardBounceSpeed - minVelocityBounceSoft) * (1.0 - gain) + gain;
if (this.connection != null) if (this.connection != null) {
AudioManager.playSound(snd, this.getAbsPos().getPosition()); var distFromUs = @:privateAccess this.level.marble.lastRenderPos.distanceSq(this.lastRenderPos);
else snd.play(false, Settings.optionsSettings.soundVolume * gain / Math.max(1, distFromUs));
} else
snd.play(false, Settings.optionsSettings.soundVolume * gain); snd.play(false, Settings.optionsSettings.soundVolume * gain);
} }
} }
@ -2546,7 +2547,7 @@ class Marble extends GameObject {
if (this.blastTicks < 156) if (this.blastTicks < 156)
return; return;
var blastAmt = this.blastTicks / (25000 >> 5); var blastAmt = this.blastTicks / (25000 >> 5);
var impulse = this.currentUp.multiply(Math.max(Math.sqrt(blastAmt), blastAmt) * 10); var impulse = this.currentUp.multiply((blastAmt > 1.0 ? blastAmt : Math.sqrt(blastAmt)) * 10);
this.applyImpulse(impulse); this.applyImpulse(impulse);
if (!isNetUpdate && this.controllable) if (!isNetUpdate && this.controllable)
AudioManager.playSound(ResourceLoader.getResource('data/sound/blast.wav', ResourceLoader.getAudio, this.soundResources)); AudioManager.playSound(ResourceLoader.getResource('data/sound/blast.wav', ResourceLoader.getAudio, this.soundResources));
@ -2583,7 +2584,7 @@ class Marble extends GameObject {
} else { } else {
if (this.blastAmount < 0.2 || this.level.game != "ultra") if (this.blastAmount < 0.2 || this.level.game != "ultra")
return; return;
var impulse = this.currentUp.multiply(Math.max(Math.sqrt(this.blastAmount), this.blastAmount) * 10); var impulse = this.currentUp.multiply((this.blastAmount > 1.0 ? this.blastAmount : Math.sqrt(this.blastAmount)) * 10);
this.applyImpulse(impulse); this.applyImpulse(impulse);
AudioManager.playSound(ResourceLoader.getResource('data/sound/blast.wav', ResourceLoader.getAudio, this.soundResources)); AudioManager.playSound(ResourceLoader.getResource('data/sound/blast.wav', ResourceLoader.getAudio, this.soundResources));
this.level.particleManager.createEmitter(this.blastAmount > 1 ? blastMaxParticleOptions : blastParticleOptions, this.level.particleManager.createEmitter(this.blastAmount > 1 ? blastMaxParticleOptions : blastParticleOptions,

View file

@ -42,7 +42,7 @@ class MarbleGame {
static var instance:MarbleGame; static var instance:MarbleGame;
static var currentVersion = "1.5.4"; static var currentVersion = "1.6.0";
var world:MarbleWorld; var world:MarbleWorld;

View file

@ -70,8 +70,8 @@ class MPPlayMissionGui extends GuiImage {
currentSelectionStatic = 0; currentSelectionStatic = 0;
} }
currentSelection = currentSelectionStatic; // currentSelection = currentSelectionStatic;
currentCategory = currentCategoryStatic; // currentCategory = currentCategoryStatic;
MarbleGame.instance.toRecord = false; MarbleGame.instance.toRecord = false;
@ -416,11 +416,19 @@ class MPPlayMissionGui extends GuiImage {
chatInput = new GuiTextInput(markerFelt18); chatInput = new GuiTextInput(markerFelt18);
chatInput.text.textColor = 0x000000; chatInput.text.textColor = 0x000000;
chatInput.horizSizing = Width; chatInput.horizSizing = Width;
chatInput.position = new Vector(0, 0); chatInput.position = new Vector(50, 0);
chatInput.extent = new Vector(402, 30); chatInput.extent = new Vector(352, 30);
chatInputContainer.addChild(chatInput); chatInputContainer.addChild(chatInput);
@:privateAccess chatInput.text.interactive.forceAnywherefocus = true; @:privateAccess chatInput.text.interactive.forceAnywherefocus = true;
var chatInputFocusTxt = new GuiText(markerFelt18);
chatInputFocusTxt.position = new Vector(0, 0);
chatInputFocusTxt.extent = new Vector(50, 30);
chatInputFocusTxt.text.text = "Chat:";
chatInputFocusTxt.text.textColor = 0x000000;
chatInputFocusTxt.justify = Center;
chatInputContainer.addChild(chatInputFocusTxt);
chatInput.text.onKeyDown = (e) -> { chatInput.text.onKeyDown = (e) -> {
if (e.keyCode == Key.ENTER) { if (e.keyCode == Key.ENTER) {
if (StringTools.trim(chatInput.text.text) != "") { if (StringTools.trim(chatInput.text.text) != "") {

View file

@ -68,13 +68,13 @@ class MisParser {
startText = marbleAttributesRegEx.matchedRight(); startText = marbleAttributesRegEx.matchedRight();
} }
var activatedPackages = []; // var activatedPackages = [];
startText = outsideText; startText = outsideText;
while (activatePackageRegEx.match(startText)) { // while (activatePackageRegEx.match(startText)) {
activatedPackages.push(this.resolveExpression(activatePackageRegEx.matched(1))); // activatedPackages.push(this.resolveExpression(activatePackageRegEx.matched(1)));
startText = marbleAttributesRegEx.matchedRight(); // startText = marbleAttributesRegEx.matchedRight();
} // }
if (objectWriteBeginIndex != -1 && objectWriteEndIndex != -1) { if (objectWriteBeginIndex != -1 && objectWriteEndIndex != -1) {
this.text = this.text.substring(objectWriteBeginIndex, objectWriteEndIndex); this.text = this.text.substring(objectWriteBeginIndex, objectWriteEndIndex);
@ -127,7 +127,6 @@ class MisParser {
var mf = new MisFile(); var mf = new MisFile();
mf.root = cast elements[0]; mf.root = cast elements[0];
mf.marbleAttributes = marbleAttributes; mf.marbleAttributes = marbleAttributes;
mf.activatedPackages = activatedPackages;
return mf; return mf;
} }

View file

@ -28,6 +28,8 @@ class NetCommands {
MPPlayMissionGui.currentCategoryStatic = category; MPPlayMissionGui.currentCategoryStatic = category;
MPPlayMissionGui.currentSelectionStatic = i; MPPlayMissionGui.currentSelectionStatic = i;
} else { } else {
MPPlayMissionGui.currentCategoryStatic = category;
MPPlayMissionGui.currentSelectionStatic = i;
MPPlayMissionGui.setLevelFn(category, i); MPPlayMissionGui.setLevelFn(category, i);
} }
} }