Character sounds, fixes to race position
Race position is still WIP, it screws up a lot around the finish line.
This commit is contained in:
1 parent
5f89b4518b
commit
a468a7b189
3 files changed
+72
-11
No files matched your search
@@ -31,13 +31,19 @@ window.IngameRes = function(rom) {
|
||||
"koura_w" /*blue shell item rep*/, "f_box", "killer" /*bullet bill*/
|
||||
]
|
||||
|
||||
//order
|
||||
//donkey, toad, bowser?, luigi, mario, peach, wario, yoshi, daisy, waluigi, dry bones (karon), robo, heyho
|
||||
var toSoundOff = [
|
||||
4, 0, 1, 2, 5, 6, 7, 3, 10, 8, 9, 11, 12
|
||||
];
|
||||
|
||||
var charNames = [
|
||||
"mario", "donkey", "kinopio", "koopa", "peach", "wario", "yoshi", "luigi", "karon", "daisy", "waluigi", "robo", "heyho"
|
||||
]
|
||||
];
|
||||
|
||||
var charAbbrv = [
|
||||
"MR", "DK", "KO", "KP", "PC", "WR", "YS", "LG", "KA", "DS", "WL", "RB", "HH"
|
||||
]
|
||||
];
|
||||
|
||||
var tireName = ["kart_tire_L", "kart_tire_M", "kart_tire_S"];
|
||||
|
||||
@@ -75,6 +81,7 @@ window.IngameRes = function(rom) {
|
||||
loseA: new nsbca(r.KartModelSub.getFile(base+"_lose.nsbca")),
|
||||
spinA: new nsbca(r.KartModelSub.getFile(base+"_spin.nsbca")),
|
||||
winA: new nsbca(r.KartModelSub.getFile(base+"_win.nsbca")),
|
||||
sndOff: toSoundOff[ind]*14,
|
||||
}
|
||||
characters[ind] = obj;
|
||||
return characters[ind];
|
||||
|
||||
@@ -165,6 +165,11 @@ window.courseScene = function(mainNarc, texNarc, music, chars, options, gameRes)
|
||||
vec3.scale(targ, targ, 1/1024);
|
||||
mat4.mul(scn.shadMat, mat4.ortho(mat4.create(), targ[0]-shadres, targ[0]+shadres, targ[1]-shadres, targ[1]+shadres, -targ[2]-2.5, -targ[2]+2.5), scn.lightMat);
|
||||
|
||||
var places = [];
|
||||
for (var i=0; i<scn.karts.length; i++) { places.push(scn.karts[i]); }
|
||||
places.sort(function(a, b) {return b.getPosition() - a.getPosition()});
|
||||
for (var i=0; i<places.length; i++) { places[i].placement = i+1; };
|
||||
|
||||
for (var i=0; i<scn.karts.length; i++) {
|
||||
var ent = scn.karts[i];
|
||||
if (ent.active) ent.update(scn);
|
||||
@@ -291,9 +296,9 @@ window.courseScene = function(mainNarc, texNarc, music, chars, options, gameRes)
|
||||
// the thresholds for different win sounds and music
|
||||
// thresh, goalsound, goalmusic, goalpostmusic
|
||||
var finishPercents = [
|
||||
[0, 66, 46, 58],
|
||||
[0.5, 66, 47, 56],
|
||||
[1.1, 67, 48, 57]
|
||||
[0, 66, 46, 58, 9],
|
||||
[0.5, 66, 47, 56, 10],
|
||||
[1.1, 67, 48, 57, 11]
|
||||
]
|
||||
|
||||
function lapAdvance(kart) {
|
||||
@@ -309,20 +314,21 @@ window.courseScene = function(mainNarc, texNarc, music, chars, options, gameRes)
|
||||
else if (kart.lapNumber == 4) {
|
||||
var finishTuple = [];
|
||||
for (var i=0; i<finishPercents.length; i++) {
|
||||
if (finishPercents[i][0] > winPercent) continue;
|
||||
finishTuple = finishPercents[i];
|
||||
if (finishPercents[i][0] >= winPercent) break;
|
||||
}
|
||||
|
||||
kart.controller = new controlRaceCPU(scn.nkm, {});
|
||||
kart.controller.setKart(kart);
|
||||
|
||||
kart.anim.setAnim(winPercent>0.5?kart.charRes.LoseA:kart.charRes.winA);
|
||||
kart.anim.setAnim(winPercent>0.5?kart.charRes.loseA:kart.charRes.winA);
|
||||
kart.animMode = "raceEnd";
|
||||
|
||||
scn.camera = (new cameraSpectator(kart, scn));
|
||||
nitroAudio.playSound(finishTuple[1], {volume:2}, 0);
|
||||
nitroAudio.playSound(finishTuple[2], {volume:2}, null);
|
||||
nitroAudio.instaKill(scn.musicPlayer);
|
||||
kart.playCharacterSound(finishTuple[4], 2);
|
||||
musicRestartTimer = 0;
|
||||
musicRestart = 7.5*60;
|
||||
musicRestartType = 1;
|
||||
|
||||
Reference in new issue
Block a user