Skip to content

Commit 669ed1b

Browse files
committed
Bugfixes
1 parent e9b3f31 commit 669ed1b

13 files changed

+250
-77
lines changed

default.htm

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969
<div id="pnlTeam1Keys" class="team1Keys"></div>
7070
<div id="pnlTeam2Keys" class="team2Keys"></div>
7171
<div id="pnlMenu" class="menu">
72-
<br /><input type="checkbox" id="chkPracticeMode" onchange="debug_.setPracticeMode(this.checked);" /><label for="chkPracticeMode">No Damage</label>
72+
<br /><input type="checkbox" id="chkPracticeMode" onchange="debug_.setPracticeMode(this.checked);" /><label for="chkPracticeMode">No damage</label>
73+
<br /><input type="checkbox" id="chkFallDamageMode" onchange="__noFallDamage = !this.checked;" /><label for="chkFallDamageMode">High fall causes damage</label>
7374
<br /><input checked type="checkbox" id="chkTeamMode" onchange="game_.setTeamMode(this.checked);" /><label for="chkTeamMode">Team Mode</label>
7475
<!--<br /><input style="display:none" id="cmdGo" type="button" onclick="StartBattle()" value="practice mode" />-->
7576
</div>
@@ -85,9 +86,12 @@
8586
<br />Sy:<input id="txtShadowOffsetY" />
8687
<input type="button" onclick="debug_.setFrameData()" value="Set"/>
8788
</div>
89+
-->
8890
<div id="pnlProjectiles" class="projectile-editor" style="display:none;">
89-
<button onclick="debug_.LoadProjectiles()">Load Projectiles</button>
91+
<hr style="clear:both" />
92+
<button onclick="debug_.loadProjectiles()">Load Projectiles</button>
9093
<select id="selProjectile"></select>
94+
<br style="clear:both" />
9195
<div id="pnlSelectedProjectile" class="selected-projectile">
9296
<div class="item">
9397
<div class="label">Name:</div>
@@ -102,31 +106,31 @@
102106
<div class="input"><input id="txtProjectileMaxHits" /></div>
103107
</div>
104108
<div class="item">
105-
<div class="label">Hit delay:</div>
109+
<div class="label">Delay:</div>
106110
<div class="input"><input id="txtProjectileHitDelay"></span></div>
107111
</div>
108112
<div class="item">
109-
<div class="label">Combo flags:</div>
113+
<div class="label">Flags:</div>
110114
<div class="input"><input id="txtProjectileComboFlags"></span></div>
111115
</div>
112116
<div class="item">
113-
<div class="label">vy:</div>
117+
<div class="label">Vx:</div>
114118
<div class="input"><input id="txtProjectileXSpeed"></span></div>
115119
</div>
116120
<div class="item">
117-
<div class="label">vy:</div>
121+
<div class="label">Vy:</div>
118122
<div class="input"><input id="txtProjectileYSpeed"></span></div>
119123
</div>
120124
<div class="item">
121125
<div class="label">&nbsp;</div>
122-
<div class="input"><button onclick="debug_.SaveProjectileData()">Save</button></div>
126+
<div class="input"><button onclick="debug_.saveProjectileData()">Save</button></div>
123127
</div>
124128
</div>
125129
</div>
126-
-->
127130
<script type="text/javascript">
128131
var __debugMode = false;
129132
var __noDamage = false;
133+
var __noFallDamage = true;
130134

131135
/*
132136
if(!__debugMode)

script/debug.js

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ function GetDebugInstance(game)
232232
debug_.p1().CurrentFrame.ShadowOffset.Y = +sy;
233233
}
234234

235+
var pnlProjectiles = window.document.getElementById("pnlProjectiles");
235236
var selProjectile = window.document.getElementById("selProjectile");
236237
var spnProjectileName = window.document.getElementById("spnProjectileName");
237238
var chkCanJuggle = window.document.getElementById("chkCanJuggle");
@@ -240,14 +241,21 @@ function GetDebugInstance(game)
240241
var txtProjectileComboFlags = window.document.getElementById("txtProjectileComboFlags");
241242

242243

243-
Debug.prototype.LoadProjectiles = function()
244+
Debug.prototype.debugProjectiles = function(hide)
245+
{
246+
pnlProjectiles.style.display = !hide
247+
? ""
248+
: "none";
249+
}
250+
251+
Debug.prototype.loadProjectiles = function()
244252
{
245253
if(!debug_.p1())
246254
return;
247255

248256
while(!!selProjectile.children[0])
249257
selProjectile.removeChild(selProjectile.children[0]);
250-
selProjectile.onchange = this.LoadProjectileData;
258+
selProjectile.onchange = this.loadProjectileData;
251259

252260
var o = window.document.createElement("option");
253261
o.value = 0;
@@ -266,7 +274,7 @@ function GetDebugInstance(game)
266274
}
267275
}
268276

269-
Debug.prototype.LoadProjectileData = function()
277+
Debug.prototype.loadProjectileData = function()
270278
{
271279
var projectileIndex = selProjectile.options[selProjectile.selectedIndex].value;
272280
if(!isNaN(projectileIndex))
@@ -275,38 +283,43 @@ function GetDebugInstance(game)
275283
chkCanJuggle.checked = debug_.p1().Projectiles[projectileIndex].CanJuggle;
276284
txtProjectileMaxHits.value = debug_.p1().Projectiles[projectileIndex].MaxHits;
277285
txtProjectileHitDelay.value = debug_.p1().Projectiles[projectileIndex].DefaultLocalHitStop;
278-
txtProjectileComboFlags.value = debug_.p1().Projectiles[projectileIndex].Params.Combo;
286+
txtProjectileComboFlags.value = debug_.p1().Projectiles[projectileIndex].Params.Combo || "";
279287
txtProjectileYSpeed.value = debug_.p1().Projectiles[projectileIndex].YSpeed;
280288
txtProjectileXSpeed.value = debug_.p1().Projectiles[projectileIndex].XSpeed;
281289
}
282290
}
283291

284-
Debug.prototype.SaveProjectileData = function()
292+
Debug.prototype.saveProjectileData = function()
285293
{
294+
if(isNaN(selProjectile.selectedIndex) || selProjectile.selectedIndex < 0)
295+
{
296+
return;
297+
}
298+
286299
var projectileIndex = selProjectile.options[selProjectile.selectedIndex].value;
287300
if(!isNaN(projectileIndex))
288301
{
289302
//can juggle
290303
debug_.p1().Projectiles[projectileIndex].CanJuggle = chkCanJuggle.checked;
291304
//xSpeed
292305
var xSpeed = +txtProjectileXSpeed.value;
293-
if(!!+xSpeed)
306+
if(!!+xSpeed || xSpeed === 0)
294307
debug_.p1().Projectiles[projectileIndex].XSpeed = xSpeed;
295308
//ySpeed
296309
var ySpeed = +txtProjectileYSpeed.value;
297-
if(!!+ySpeed)
310+
if(!!+ySpeed || ySpeed === 0)
298311
debug_.p1().Projectiles[projectileIndex].YSpeed = ySpeed;
299312
//combo flags
300313
var combo = +txtProjectileComboFlags.value;
301-
if(!!+combo)
314+
if(!!+combo || combo === 0)
302315
debug_.p1().Projectiles[projectileIndex].Params.Combo = combo;
303316
//maxhits
304317
var maxHits = +txtProjectileMaxHits.value;
305-
if(!!+maxHits)
318+
if(!!+maxHits || maxHits === 0)
306319
debug_.p1().Projectiles[projectileIndex].MaxHits = maxHits;
307320
//hit delay
308321
var hitDelay = +txtProjectileHitDelay.value;
309-
if(!!+hitDelay)
322+
if(!!+hitDelay || hitDelay === 0)
310323
{
311324
for(var i in debug_.p1().Projectiles[projectileIndex].LocalHitStopData)
312325
debug_.p1().Projectiles[projectileIndex].LocalHitStopData[i] = hitDelay;

script/flags.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ var PlayerFlags = function(owner)
4242
this.HitSound = new Flags();
4343
this.BlockSound = new Flags();
4444
this.MotionSound = new Flags();
45+
this.HitReact = new Flags();
4546
}
4647

4748
PlayerFlags.prototype.clear = function()
@@ -55,6 +56,7 @@ PlayerFlags.prototype.clear = function()
5556
this.HitSound.clear();
5657
this.BlockSound.clear();
5758
this.MotionSound.clear();
59+
this.HitReact.clear();
5860
}
5961
PlayerFlags.prototype.release = function()
6062
{
@@ -68,6 +70,7 @@ PlayerFlags.prototype.release = function()
6870
this.HitSound.release();
6971
this.BlockSound.release();
7072
this.MotionSound.release();
73+
this.HitReact.release();
7174
}
7275

7376
var FrameFlags = function()

script/match.js

Lines changed: 76 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ var CreateMatch = function(team1,team2,stage)
3434
var forceQuit_ = false;
3535
var forceQuitReason_ = 0;
3636
var isAIMatch_ = false;
37+
var roundOverFrame_ = CONSTANTS.NO_FRAME;
3738

3839
var nbAirborne_ = 0;
3940
game_.resetFrame();
@@ -78,7 +79,6 @@ var CreateMatch = function(team1,team2,stage)
7879
Match.prototype.getTeamB = function() { return teamB_; }
7980
Match.prototype.getDefeatedTeam = function() { return defeatedTeam_; }
8081
Match.prototype.setDefeatedTeam = function(value) { defeatedTeam_ = value; }
81-
Match.prototype.isRoundOver = function() { return isRoundOver_; }
8282
Match.prototype.setRoundOver = function(value) { isRoundOver_ = value; }
8383
Match.prototype.getGotoNewRoundFrame = function() { return gotoNewRoundFrame_; }
8484
Match.prototype.setGotoNewRoundFrame = function(value) { gotoNewRoundFrame_ = value; }
@@ -94,6 +94,12 @@ var CreateMatch = function(team1,team2,stage)
9494
Match.prototype.setAllowInput = function(value) { allowInput_ = value; }
9595

9696
Match.prototype.getStage = function() { return stage_; }
97+
98+
Match.prototype.isRoundOver = function()
99+
{
100+
return isRoundOver_;
101+
}
102+
97103
Match.prototype.resetKeys = function()
98104
{
99105
for(var i = 0; i < teamA_.getPlayers().length; ++i)
@@ -206,7 +212,7 @@ var CreateMatch = function(team1,team2,stage)
206212
if(teamA_.getPlayer(i).Id != loseIgnoreId)
207213
teamA_.getPlayer(i).forceLose(attackDirection);
208214
for(var i = 0; i < teamB_.getPlayers().length; ++i)
209-
teamB_.getPlayer(i).justWon(frame);
215+
teamB_.getPlayer(i).onOtherTeamDead(frame);
210216
break;
211217
}
212218
case CONSTANTS.TEAM2:
@@ -215,41 +221,80 @@ var CreateMatch = function(team1,team2,stage)
215221
if(teamB_.getPlayer(i).Id != loseIgnoreId)
216222
teamB_.getPlayer(i).forceLose(attackDirection);
217223
for(var i = 0; i < teamA_.getPlayers().length; ++i)
218-
teamA_.getPlayer(i).justWon(frame);
224+
teamA_.getPlayer(i).onOtherTeamDead(frame);
219225
break;
220226
}
221227
}
222228
}
223-
/*Should be called after the player who was defeated hits the ground*/
224-
Match.prototype.deadAnimationComplete = function(player,frame)
229+
230+
Match.prototype.onCanEndRound = function(teamThatLost)
225231
{
226-
if(!this.isRoundOver())
232+
if(roundOverFrame_ == CONSTANTS.NO_FRAME && this.canEndRound())
227233
{
228-
this.setRoundOver(true);
229-
game_.resetSpeed();
230-
this.setGotoNewRoundFrame(frame);
231-
232-
announcer_.endRound();
233-
234-
var t1Dead = teamA_.getHealthbar().getAmount() == 0;
235-
var t2Dead = teamB_.getHealthbar().getAmount() == 0;
234+
roundOverFrame_ = game_.getCurrentFrame() + CONSTANTS.ROUND_OVER_DELAY;
235+
}
236236

237-
if(t1Dead && t2Dead)
238-
{
239-
teamA_.onDrawRound();
240-
teamB_.onDrawRound();
241-
}
242-
else if(t1Dead)
237+
//reset the game speed if all of the dead players have completed their "dead animation"
238+
switch(teamThatLost)
239+
{
240+
case CONSTANTS.TEAM1:
243241
{
244-
teamA_.onLostRound();
245-
teamB_.onWonRound();
242+
for(var i = 0; i < teamA_.getPlayers().length; ++i)
243+
if(!teamA_.getPlayer(i).CanEndRound)
244+
return;
245+
game_.resetSpeed();
246+
break;
246247
}
247-
else if(t2Dead)
248+
case CONSTANTS.TEAM2:
248249
{
249-
teamA_.onWonRound();
250-
teamB_.onLostRound();
250+
for(var i = 0; i < teamB_.getPlayers().length; ++i)
251+
if(!teamB_.getPlayer(i).CanEndRound)
252+
return;
253+
game_.resetSpeed();
254+
break;
251255
}
256+
}
257+
}
252258

259+
//this function should be used to ensure the round winner isnt computed prematurely!
260+
Match.prototype.canEndRound = function()
261+
{
262+
for(var i = 0; i < teamA_.getPlayers().length; ++i)
263+
if(!teamA_.getPlayer(i).CanEndRound)
264+
return false;
265+
for(var i = 0; i < teamB_.getPlayers().length; ++i)
266+
if(!teamB_.getPlayer(i).CanEndRound)
267+
return false;
268+
269+
return true;
270+
}
271+
272+
/*Should be called after the player who was defeated hits the ground*/
273+
Match.prototype.onEndRound = function(frame)
274+
{
275+
this.setRoundOver(true);
276+
game_.resetSpeed();
277+
this.setGotoNewRoundFrame(frame);
278+
279+
announcer_.endRound();
280+
281+
var t1Dead = teamA_.getHealthbar().getAmount() == 0;
282+
var t2Dead = teamB_.getHealthbar().getAmount() == 0;
283+
284+
if(t1Dead && t2Dead)
285+
{
286+
teamA_.onDrawRound();
287+
teamB_.onDrawRound();
288+
}
289+
else if(t1Dead)
290+
{
291+
teamA_.onLostRound();
292+
teamB_.onWonRound(frame);
293+
}
294+
else if(t2Dead)
295+
{
296+
teamA_.onWonRound(frame);
297+
teamB_.onLostRound();
253298
}
254299
}
255300
/*Registers an action*/
@@ -638,6 +683,12 @@ var CreateMatch = function(team1,team2,stage)
638683
teamA_.frameMove(frame,stage_.X, stage_.getGroundY(), this.getAllowInput());
639684
teamB_.frameMove(frame,stage_.X, stage_.getGroundY(), this.getAllowInput());
640685

686+
if((roundOverFrame_ != CONSTANTS.NO_FRAME) && (frame > roundOverFrame_))
687+
{
688+
roundOverFrame_ = CONSTANTS.NO_FRAME;
689+
this.onEndRound(frame);
690+
}
691+
641692
if(round_ != 1)
642693
{
643694
this.handleOtherRounds(frame);

script/player-akuma.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1705,7 +1705,7 @@ Player.prototype.createAkumaSuperFireball = function(player)
17051705
for(var x = 0; x < 3; ++x)
17061706
{
17071707
xSpeed = 12;
1708-
var projectile = player.addProjectile("red projectile",160,140,xSpeed);
1708+
var projectile = player.addProjectile("super projectile",160,140,xSpeed);
17091709
projectile.OverrideFlags = new MoveOverrideFlags(OVERRIDE_FLAGS.ALL,OVERRIDE_FLAGS.PROJECTILE);
17101710
projectile.HitSound = HITSOUND.HP3;
17111711
projectile.MaxHits = x == 2 ? 8 : 4;

script/player-ryu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,8 +870,8 @@ Player.prototype.createRyu = function(user)
870870
b_jump.Vy = (jumpY);
871871

872872
b_jump.addRepeatingFrame(player,0,"",folder + "/x-crouch-0.png",4);
873-
b_jump.addRepeatingFrame(player,0,"",folder + "/x-b-jump-2.png",1,{Pose: POSE_FLAGS.AIRBORNE_FB},MISC_FLAGS.NONE,0,-1);
874-
b_jump.addRepeatingFrame(player,0,"",folder + "/x-b-jump-2.png",2,MISC_FLAGS.NONE,MISC_FLAGS.NONE,0,-1);
873+
b_jump.addRepeatingFrame(player,0,"",folder + "/x-jump-1.png",1,{Pose: POSE_FLAGS.AIRBORNE_FB},MISC_FLAGS.NONE,0,-1);
874+
b_jump.addRepeatingFrame(player,0,"",folder + "/x-jump-1.png",2,MISC_FLAGS.NONE,MISC_FLAGS.NONE,0,-1);
875875
b_jump.addRepeatingFrame(player,0,"",folder + "/x-f-jump-6.png",1,MISC_FLAGS.NONE,MISC_FLAGS.NONE,0,0);
876876
b_jump.addRepeatingFrame(player,0,"",folder + "/x-f-jump-6.png",8,MISC_FLAGS.NONE,MISC_FLAGS.NONE,0,0).clip({Bottom:125});
877877
b_jump.addRepeatingFrame(player,0,"",folder + "/x-f-jump-5.png",1,MISC_FLAGS.NONE,MISC_FLAGS.NONE,0,74);

script/player-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ var CreateFrameAdapter = function(frameArray,nbFrames)
11561156
/*Is the projectile still visible?*/
11571157
Projectile.prototype.isVisible = function(stageX,stageY)
11581158
{
1159-
return (this.X < STAGE.MAX_STAGEX && this.X > -100) && (this.Y > 0 && this.Y < 1000);
1159+
return (this.X < STAGE.MAX_STAGEX && this.X > -100) && (this.Y > 0 && this.Y < 5000);
11601160
}
11611161

11621162
/*Did the projectile hit the floor?*/

0 commit comments

Comments
 (0)