Skip to content

Commit 330c1cd

Browse files
author
cecil john tantay
committed
last commit
1 parent d411e3e commit 330c1cd

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

assignments/prototypes.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,16 @@ class Villain extends Humanoid {
5454
// increases field goal attempts in play by play
5555
this.fga++;
5656
document.getElementById("beardfga").innerHTML = this.fga;
57-
} else {
57+
} else if (chefCurry.score <21 && (Math.random() * 10) + 1 >= 6) {
5858
document.getElementById(
5959
"playbyplay"
6060
).innerHTML = `<p style="color: red;">Harden just did not sell his flop very well.</p>`;
6161

6262
// increases field goal attempts in play by play
6363
this.fga++;
6464
document.getElementById("beardfga").innerHTML = this.fga;
65+
} else {
66+
return;
6567
}
6668
if (this.score >=21 && this.score <=23) {
6769
document.getElementById(
@@ -86,14 +88,16 @@ class Villain extends Humanoid {
8688
this.fga++;
8789
document.getElementById("beardfga").innerHTML = this.fga;
8890

89-
} else {
91+
} else if (chefCurry.score <21 && (Math.random() * 10) + 1 >= 6) {
9092
document.getElementById(
9193
"playbyplay"
9294
).innerHTML = `<p style="color: red;">Harden turns the ball over! </p>`;
9395

9496
// increases field goal attempts in play by play
9597
this.fga++;
9698
document.getElementById("beardfga").innerHTML = this.fga;
99+
} else {
100+
return;
97101
}
98102

99103
if (this.score >=21 && this.score <=23) {
@@ -117,7 +121,7 @@ class Villain extends Humanoid {
117121
// increases field goal attempts in play by play
118122
this.fga++;
119123
document.getElementById("beardfga").innerHTML = this.fga;
120-
} else {
124+
} else if (chefCurry.score <21 && (Math.random() * 10) + 1 >= 6) {
121125
document.getElementById(
122126
"playbyplay"
123127
).innerHTML = `<p style="color: red;">Harden gets BLOCKED!</p>`;
@@ -155,14 +159,16 @@ class Hero extends Humanoid {
155159
// increases field goal attempts in play by play
156160
this.fga++;
157161
document.getElementById("stephfga").innerHTML = this.fga;
158-
} else {
162+
} else if (theBeard.score <21 && (Math.random() * 10) + 1 >= 6){
159163
document.getElementById(
160164
"playbyplay"
161165
).innerHTML = `<p style="color: red;">Not a good look, it was a bad shot.</p>`;
162166

163167
// increases field goal attempts in play by play
164168
this.fga++;
165169
document.getElementById("stephfga").innerHTML = this.fga;
170+
} else {
171+
return;
166172
}
167173
if (this.score >=21 && this.score <=23) {
168174
document.getElementById(
@@ -185,14 +191,16 @@ class Hero extends Humanoid {
185191
// increases field goal attempts in play by play
186192
this.fga++;
187193
document.getElementById("stephfga").innerHTML = this.fga;
188-
} else {
194+
} else if (theBeard.score <21 && (Math.random() * 10) + 1 >= 6){
189195
document.getElementById(
190196
"playbyplay"
191197
).innerHTML = `<p style="color: red;">Curry shoots, and no good. </p>`;
192198

193199
// increases field goal attempts in play by play
194200
this.fga++;
195201
document.getElementById("stephfga").innerHTML = this.fga;
202+
} else {
203+
return;
196204
}
197205
if (this.score >=21 && this.score <=23) {
198206
document.getElementById(
@@ -216,14 +224,16 @@ class Hero extends Humanoid {
216224
// increases field goal attempts in play by play
217225
this.fga++;
218226
document.getElementById("stephfga").innerHTML = this.fga;
219-
} else {
227+
} else if (theBeard.score <21 && (Math.random() * 10) + 1 >= 6){
220228
document.getElementById(
221229
"playbyplay"
222230
).innerHTML = `<p style="color: red;">Curry gets blocked!</p>`;
223231

224232
// increases field goal attempts in play by play
225233
this.fga++;
226234
document.getElementById("stephfga").innerHTML = this.fga;
235+
} else {
236+
return;
227237
}
228238
if (this.score >=21 && this.score <=23) {
229239
document.getElementById(

0 commit comments

Comments
 (0)