Skip to content

Commit

Permalink
Merge pull request #1090 from hackclub/add-bell-clicker-link
Browse files Browse the repository at this point in the history
Add bell clicker link
  • Loading branch information
maxwofford authored Jan 10, 2025
2 parents 124640e + cb9e5ae commit 23a8ca3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/flavor.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const shopIcons = {
cute: 'https://cloud-nfmmdwony-hack-club-bot.vercel.app/3003.png',
tinfoil: 'https://cloud-nfmmdwony-hack-club-bot.vercel.app/4004.png',
holdingEars: 'https://cloud-nfmmdwony-hack-club-bot.vercel.app/4004.png', // todo: draw this
notamused: 'https://cloud-nfmmdwony-hack-club-bot.vercel.app/4004.png', // todo: draw this
woah: 'https://cloud-e9zuzn0u0-hack-club-bot.vercel.app/3003.png',
thumbs: 'https://cloud-r04a8za6c-hack-club-bot.vercel.app/1001.png',
fluster:
Expand Down
4 changes: 4 additions & 0 deletions lib/transcript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ greetings:
- I have a feeling you're going to like what you see today.
- Hey there! You look like you could use some help.
- Oh, hello! How can I help you have a GARBAGE day?
lotsOfBells:
- icon:question|you... really like that bell, don't you?
- icon:holdingEars|ok, you can stop clicking that now...
tooManyBells:
- icon:freaking|Alright! |icon:threat|Enough with the |speed:4.1|BLOODY BELLS!~
- icon:holdingears|S-stop it! I got sensitive hear-holes over here!
Expand All @@ -116,6 +119,7 @@ tooManyBells:
- icon:threat|I didn't get |speed:4|MAROONED|speed:default| on this dog-forsaken island to listen to that!
- S-stop taunting me with those infernal bells!
- Go annoy some tanuki on another island with those bells!
bellClicker: icon:freaking|speed:3.5|you know what? |speed:4|just take the bell!|bellButton:true|speed:3.5| it's yours! go on! take it! take it and leave me be!
pirateyThings:
- bilge rat
- salty dog
Expand Down
27 changes: 26 additions & 1 deletion src/app/harbor/shop/shopkeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const ShopkeeperComponent = ({ balance, cursed }) => {
const [interactionBusy, setInteractionBusy] = useState(false)
const { on, off } = useEventEmitter()
const [buyButton, setBuyButton] = useState()
const [bellButton, setBellButton] = useState(false)

useEffect(() => {
const handleEvent = (event) => {
Expand Down Expand Up @@ -57,6 +58,7 @@ export const ShopkeeperComponent = ({ balance, cursed }) => {
setInteractionBusy(true)
setShopkeeperMsg('')
setBuyButton()
setBellButton(false)
let speed
console.log('handling interaction', interaction)
for (const action of interaction.split('|')) {
Expand All @@ -82,6 +84,12 @@ export const ShopkeeperComponent = ({ balance, cursed }) => {
} else {
await setBuyButton()
}
case 'bellButton':
if (arg[0]) {
await setBellButton(arg[0])
} else {
await setBellButton()
}
case 'pause':
if (arg[0]) {
await new Promise((resolve) =>
Expand Down Expand Up @@ -116,8 +124,14 @@ export const ShopkeeperComponent = ({ balance, cursed }) => {
bellSounds[bellIndex].play()
setAtCounter(true)
// await new Promise(r => setTimeout(r, 1000))
if (continuousBellClicks > 5) {
if (continuousBellClicks > 7) {
await handleInteraction(transcript('tooManyBells'))
} else if (continuousBellClicks == 7) {
await handleInteraction(transcript('bellClicker'))
} else if (continuousBellClicks > 5) {
await handleInteraction(transcript('tooManyBells'))
} else if (continuousBellClicks > 3) {
await handleInteraction(transcript('lotsOfBells'))
} else if (cursed) {
const greetingSliced = transcript('greetings')
.split(' ')
Expand Down Expand Up @@ -243,6 +257,7 @@ export const ShopkeeperComponent = ({ balance, cursed }) => {
<div id="shopkeeper-msg">
{shopkeeperMsg}
{buyButton && <BuyButton itemId={buyButton} />}
{bellButton && <BellButton />}
</div>
</div>
</div>
Expand All @@ -263,3 +278,13 @@ const BuyButton = ({ itemId }) => {
</form>
)
}

const BellButton = () => {
return (
<a href="https://maxwofford.com/clicker">
<Button className="bg-black hover:bg-gray-800 text-white font-semibold py-2 px-4 m-2 rounded transition-colors duration-200 text-3xl enchanted">
Take
</Button>
</a>
)
}

0 comments on commit 23a8ca3

Please sign in to comment.