Prevent multiple pokeball throws: add throwing guard flag and block at 0 pokeballs
This commit is contained in:
1 parent
2c88aa2a5b
commit
ddf96d87ac
2 files changed
+6
-1
No files matched your search
@@ -1455,6 +1455,7 @@ class Game {
|
|||||||
showCatchScreen() {
|
showCatchScreen() {
|
||||||
const wild = this.state.currentWild;
|
const wild = this.state.currentWild;
|
||||||
if (!wild) return;
|
if (!wild) return;
|
||||||
|
this._throwing = false;
|
||||||
|
|
||||||
this.show('catch');
|
this.show('catch');
|
||||||
this._showController(true);
|
this._showController(true);
|
||||||
@@ -1496,6 +1497,9 @@ class Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
throwPokeball(wild, canCatch) {
|
throwPokeball(wild, canCatch) {
|
||||||
|
if (this._throwing) return;
|
||||||
|
if (this.state.pokeballs <= 0) return;
|
||||||
|
this._throwing = true;
|
||||||
this.state.pokeballs--;
|
this.state.pokeballs--;
|
||||||
SFX.pokeball();
|
SFX.pokeball();
|
||||||
|
|
||||||
@@ -1563,6 +1567,7 @@ class Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_showCatchResult(wild, canCatch) {
|
_showCatchResult(wild, canCatch) {
|
||||||
|
this._throwing = false;
|
||||||
this.show('catch-result');
|
this.show('catch-result');
|
||||||
this._showController(true);
|
this._showController(true);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
<meta name="theme-color" content="#0a0520">
|
<meta name="theme-color" content="#0a0520">
|
||||||
<title>PokéSQL — Learn SQL</title>
|
<title>PokéSQL — Lean SQL</title>
|
||||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
Reference in new issue
Block a user