Skip to content

Commit 61c9ab1

Browse files
committed
add "Splash combo" feature
1 parent a9ceb1a commit 61c9ab1

File tree

4 files changed

+99
-64
lines changed

4 files changed

+99
-64
lines changed

changelog.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
+ add "Splash combo" feature
12
+ add "Timer over Spider's Den bones" feature
2-
= fix "Chicken Head Timer"
3-
= fix Bingo Party incoming message formatter
3+
= fix Chicken Head Timer not hiding properly
4+
= fix incoming party message formatter again

features/other/splashCombo.js

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import settings from "../../settings"
2+
import Skyblock from "../../utils/Skyblock"
3+
4+
const colours = ["§8", "§c", "§6", "§e", "§2", "§a", "§b"]
5+
const thresholds = [5, 10, 15, 20, 25, 30, 35]
6+
7+
// BUFF! You were splashed by BingoSplasher with Mushed Glowy Tonic I! Press TAB or type /effects to view your active effects!
8+
const regex =
9+
/^BUFF! (?:You splashed yourself|You were splashed by (\w{1,16})) with (.*)! Press TAB or type \/effects to view your active effects!$/
10+
11+
let splashedPotions = {}
12+
let messageID = 5967
13+
14+
// splash combo!
15+
register("chat", (user = Player.getName(), potion, event) => {
16+
if (!Skyblock.inSkyblock) return
17+
if (!settings().splashCombo) return
18+
19+
// create user
20+
if (!splashedPotions[user]) {
21+
messageID += 1
22+
splashedPotions[user] = {
23+
displayName:
24+
World.getAllPlayers()
25+
?.find((player) => player?.getName() === user)
26+
?.getDisplayName()?.text || user,
27+
id: messageID,
28+
combo: 0,
29+
potions: []
30+
}
31+
}
32+
33+
let currentUser = splashedPotions[user]
34+
35+
// return if the same potion type is already splashed
36+
// TODO: disregard potion level (roman numerals)
37+
if (currentUser.potions.includes(potion)) return
38+
39+
currentUser.potions.push(potion)
40+
currentUser.combo += 1
41+
42+
let combo = currentUser.combo
43+
44+
// chat message
45+
/*
46+
ChatLib.clearChat(currentUser.id)
47+
new Message(`Combo: ${currentUser.combo}`)
48+
.setChatLineId(currentUser.id)
49+
.chat()
50+
*/
51+
52+
// title
53+
let colour = colours[thresholds.findIndex((threshold) => combo < threshold)]
54+
if (colour === undefined) colour = "&b"
55+
Client.showTitle(
56+
`${colour}${combo} combo!`,
57+
"", // TODO: fix the splasher not showing
58+
// `&7Splasher: ${currentUser.displayName}`
59+
0,
60+
60,
61+
20
62+
)
63+
64+
// sounds
65+
const pitch = 0.5 + combo / 20
66+
World.playSound("note.pling", 100, pitch)
67+
if (combo <= 10) return
68+
new Thread(() => {
69+
Thread.sleep(30)
70+
World.playSound("random.successful_hit", 100, pitch - 0.5)
71+
if (combo <= 15) return
72+
Thread.sleep(5)
73+
World.playSound("random.orb", 100, pitch - 1)
74+
}).start()
75+
}).setCriteria(regex)
76+
77+
register("worldLoad", init)
78+
79+
function init() {
80+
splashedPotions = {}
81+
messageID = 5967
82+
}

index.js

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import "./features/party/messageFormatter"
2929

3030
import "./features/chat/oringoCost"
3131

32+
import "./features/other/splashCombo"
33+
3234
import "./features/splasher/brewingUtils"
3335
import "./features/splasher/brewingStandUtils"
3436
import "./features/splasher/splasherDisplay"
@@ -43,6 +45,8 @@ import "./features/world/windCompass"
4345

4446

4547
/* TODO
48+
* - fix feature file structure !!!
49+
4650
* - reminder to do bingo stuff like cakes, experiments, fetchur, puzzler, bednom
4751
* - hotm tree unlock reminders
4852
* - king talisman helper!

settings.js

+10-62
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ const config = new DefaultConfig("BingoPlus", "data/settings.json")
180180

181181
// Other
182182

183+
.addSwitch({
184+
category: "Other",
185+
configName: "splashCombo",
186+
title: "Splash combo",
187+
description: "Shows a fun combo counter during a splash",
188+
subcategory: "Splashes"
189+
})
190+
183191
.addSwitch({
184192
category: "Other",
185193
configName: "chickenHeadTimer",
@@ -690,7 +698,7 @@ const config = new DefaultConfig("BingoPlus", "data/settings.json")
690698
title: "Oringo Abiphone Cost",
691699
description: "Convert Oringo's Abiphone message to include the rarity and cost of each pet.",
692700
subcategory: "Oringo",
693-
value: true
701+
value: false
694702
})
695703
.addSwitch({
696704
category: "Chat",
@@ -699,7 +707,7 @@ const config = new DefaultConfig("BingoPlus", "data/settings.json")
699707
description: "Also automatically copy this message to send in Discord.",
700708
subcategory: "Oringo",
701709
shouldShow: data => data.oringoAbiphoneCost,
702-
value: true
710+
value: false
703711
})
704712

705713
// Commands
@@ -733,66 +741,6 @@ const config = new DefaultConfig("BingoPlus", "data/settings.json")
733741
value: true
734742
})
735743

736-
// i'll leave it in, i got tired of moving it in and out
737-
.addTextInput({
738-
configName: "devAddTextInput",
739-
title: "Text Input",
740-
description: "Example of text input that does not wrap the text",
741-
category: "Dev",
742-
subcategory: "All elements",
743-
value: "",
744-
placeHolder: "Empty... :("
745-
})
746-
.addColorPicker({
747-
configName: "devAddColorPicker",
748-
title: "Color Picker",
749-
description: "Pick a color! (hopefully...)",
750-
category: "Dev",
751-
subcategory: "All elements",
752-
value: [0, 0, 255, 255]
753-
})
754-
.addSwitch({
755-
configName: "devAddSwitch",
756-
title: "Switch",
757-
description: "toggle the checkbox in Not general! tab!",
758-
category: "Dev",
759-
subcategory: "All elements"
760-
})
761-
.addToggle({
762-
configName: "devAddToggle",
763-
title: "Checkbox/Toggle",
764-
description: "Check this box",
765-
category: "Dev",
766-
subcategory: "All elements"
767-
})
768-
.addDropDown({
769-
configName: "devAddDropDown",
770-
title: "DropDown",
771-
description: "Select an option",
772-
category: "Dev",
773-
subcategory: "All elements",
774-
options: ["one", "two", "three"],
775-
value: 0
776-
})
777-
.addSlider({
778-
configName: "devAddSlider",
779-
title: "Slider",
780-
description: "Select a value",
781-
category: "Dev",
782-
subcategory: "All elements",
783-
options: [0, 100],
784-
value: 0
785-
})
786-
.addButton({
787-
configName: "devAddButton",
788-
title: "Button",
789-
description: "yay",
790-
category: "Dev",
791-
subcategory: "All elements",
792-
onClick() {
793-
ChatLib.chat("hi :P")
794-
}
795-
})
796744

797745
const settings = new FuckYouIWantToUseThatName("BingoPlus", config, "data/vigilanceScheme.json", `${constants.PREFIX}&bv${version} &aby &dooffyy`)
798746
.setSize(80, 80)

0 commit comments

Comments
 (0)