Skip to content

Commit 3643e13

Browse files
browser consistency, random damage
i think the website is fine on safari actually idk
1 parent 87ce766 commit 3643e13

File tree

3 files changed

+32
-9
lines changed

3 files changed

+32
-9
lines changed

index.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<head>
3-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js" defer></script>
3+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
44
<script src="index.js" defer></script>
55
<link rel="stylesheet" href="styles.css">
66
</head>
@@ -16,9 +16,10 @@ <h2>Enemy HP: <span id="enemy-hp">140</span></h2>
1616
<div id="actions">
1717
<button id="button-1" onclick="bonk.useMove('player')" disabled="true">Bonk</button>
1818
<button id="button-2" onclick="stronkify.useMove('player')" disabled="true">Stronkify</button>
19-
<button id="button-3" onclick="belittle.useMove('player')" disabled="true">Belittle</button>
19+
<button id="button-3" onclick="belittle.useMove('player')" disabled="true">Belittle haha vocab word</button>
2020
<button id="button-4" onclick="tickle.useMove('player')" disabled="true">Tickle</button>
2121
</div>
22+
<button class="debug" onclick="bonk.useMove('enemy')">bonk.useMove('enemy')</button>
2223
<br>
2324
<div id="difficulties">
2425
<a href="index.html?hp=120&boost=1">
@@ -27,13 +28,13 @@ <h2>Enemy HP: <span id="enemy-hp">140</span></h2>
2728
</button>
2829
</a>
2930
<br>
30-
<a href="index.html?hp=140&boost=1.1">
31+
<a href="index.html?hp=150&boost=1.1">
3132
<button class="difficulty" id="d-normal">
3233
Normal
3334
</button>
3435
</a>
3536
<br>
36-
<a href="index.html?hp=160&boost=1.2">
37+
<a href="index.html?hp=170&boost=1.25">
3738
<button class="difficulty" id="d-hard">
3839
Hard
3940
</button>
@@ -46,4 +47,4 @@ <h2>Enemy HP: <span id="enemy-hp">140</span></h2>
4647
</div>
4748
<p>You can make your own custom difficulty by changing the URL</p>
4849
<p>Change boost value for enemy attack multiplier and hp value for enemy HP</p>
49-
</body>
50+
</body>

index.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
$(".debug").hide();
12
let playerHp = 100;
23
let enemyHp = 140;
34
let playerExtraDmg = 1;
45
let enemyExtraDmg = 1.1;
56
let moveNames = []
7+
let isntFirefox = typeof InstallTrigger === 'undefined';
8+
if (isntFirefox) {
9+
alert("Please use Firefox or else the buttons commit die.")
10+
} else {
11+
console.log("^^ that is because feature checking")
12+
};
13+
console.log("yo hi snooper if somethings red tell me ok? also run playerHp = -2")
614

715
let params = window.location.search;
816
params = new URLSearchParams(params);
@@ -22,8 +30,12 @@ $('#button-2').prop("disabled", true);
2230
$('#button-3').prop("disabled", true);
2331
$('#button-4').prop("disabled", true);
2432

25-
function sleep(ms) {
26-
return new Promise(resolve => setTimeout(resolve, ms));
33+
function debug(key) {
34+
console.log('run')
35+
if (key.code === "F7") {
36+
console.log('yes');
37+
$(".debug").show();
38+
}
2739
}
2840

2941
function toggleButtons() {
@@ -103,6 +115,9 @@ class Move {
103115
switch (user) {
104116
case "player":
105117
let pDamageDealt = this.dmg * playerExtraDmg;
118+
let randomDamageBoost = Math.random() / 5
119+
randomDamageBoost += 0.9
120+
pDamageDealt *= randomDamageBoost
106121
enemyHp -= pDamageDealt;
107122
if (this.target === "user") {
108123
playerExtraDmg += this.effect;
@@ -122,6 +137,9 @@ class Move {
122137
break;
123138
case "enemy":
124139
let eDamageDealt = this.dmg * enemyExtraDmg;
140+
let eRandomDamageBoost = Math.random() / 5
141+
eRandomDamageBoost += 0.9
142+
eDamageDealt *= eRandomDamageBoost
125143
playerHp -= eDamageDealt;
126144
if (this.target === "user") {
127145
enemyExtraDmg += this.effect;
@@ -150,4 +168,5 @@ let belittle = new Move("Belittle", 0, "enemy", -0.15);
150168
let tickle = new Move("Tickle", 10, "$D", 0);
151169
// Kalob was a special child
152170

171+
document.addEventListener("keydown", debug)
153172
setTimeout(loop1, 1000)

styles.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ button:not(.difficulty) {
2828
height: 50px;
2929
}
3030

31-
button {padding: 0;}
31+
button {
32+
padding: 0;
33+
color: black;
34+
}
3235

3336
#button-1 {background-color: rgb(255, 120, 100); }
3437

@@ -64,4 +67,4 @@ button:disabled {
6467
#warning {color: darkred;}
6568
#d-easy {background-color: rgb(100, 255, 120)}
6669
#d-normal {background-color:rgb(255, 255, 120)}
67-
#d-hard {background-color:rgb(255, 120, 100)}
70+
#d-hard {background-color:rgb(255, 120, 100)}

0 commit comments

Comments
 (0)