TFSagas/public_scripts/coinAndCups.tf
2024-10-12 22:03:12 -03:00

161 lines
4.2 KiB
HCL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# TFSagas: Public: Coin and Cups
# Testnet
# Files:
# ../assets/vikingPots_128.jpeg
# ../assets/vikingPots_256.jpeg
# Rune text:
#
# <h2>In the dim corner of the room,</h2>
# <h3>
# a shady figure with a braided beard and piercing blue eyes challenges you to a game of coin and cups, his sly grin hinting at mischief.<br>
# With a flick of his wrist, he deftly hides a coin beneath one of three weathered cups, declaring:
# </h3>
# - Choose wisely! Victory brings glory, but defeat will echo through these walls!
# <br>
# <h3>
# The air crackles with anticipation as onlookers lean in, eager to see if you can outsmart this mysterious contender<br>
# and claim your prize, or face their laughter.
# </h3>
script {
name "TFS: Coin and Cups"
description "Find the ball to win a prize -- 0.36-1"
icon "@raw:vikingPots_128.jpeg"
owner 18
public
# deployable
overrides {
1 "<h2>I challenge thee to a test of wit and sight!</h2><h3>Guess where the coin lies, and claim your reward.</h3>"
2 "By Odin's will, <strong>I accept!</strong>"
3 "<h2>The cups are shuffled by the winds of fate, hiding the coin's true location.</h2><h3>Keep your eyes sharp, for only the keenest Viking will uncover it!</h3>"
4 "Alas, I must <strong>decline</strong> the challenge this time."
5 "<h2>Understood!</h2><h3>Until our paths cross again, may your journeys be prosperous!</h3>"
6 "<h2>The moment of truth is upon us.</h2><h3>Choose your cup wisely and reveal the hidden coin!</h3>"
7 "<h2>The cup is being lifted...</h2><h3>Has your choice uncovered the hidden coin?</h3>"
8 "Perhaps we should gather our strength first."
9 "The <strong>left</strong> cup. Let fortune smile upon my choice!"
10 "The <strong>center</strong> cup. May the coin be where I seek!"
11 "The <strong>right</strong> cup. Heres hoping it holds the bounty!"
12 "@b64:vikingPots_256.jpeg"
local "pledge" 100000000
local "award" 200000000
}
precondition "Gold Reserve" gold >= local "pledge"
reserves { owner gold local "award" }
procedure "play" {
if (random 2 == local "chosen_cup") {
award gold local "award"
set local "gold_won" local "gold_won" + local "award"
} else {
pay gold local "pledge"
set local "gold_lost" local "gold_lost" + local "pledge"
}
}
state "init" {
text "
<center><img src=data:,${12}/></center>${1}<br>
...............................<br>
Gold pledge: <strong>${gold:pledge}</strong><br>
Chance of Win: <strong>1 in 3</strong><br>
Prize: <strong>${gold:award}</strong><br>
...............................<br>
Gold Won: <strong>${gold:gold_won}</strong><br>
Gold Lost: <strong>${gold:gold_lost}</strong><br>
"
choice {
text "${2}"
reserves {
player gold local "pledge"
owner gold local "award"
}
selected text "<center><img src=data:,${12}/></center>${3}<br>"
next state "play"
}
choice {
enabled gold >= local "pledge"
text "${4}"
selected text "
<center><img src=data:,${12}/></center>${5}<br>
...............................<br>
Gold Won: <strong>${gold:gold_won}</strong><br>
Gold Lost: <strong>${gold:gold_lost}</strong><br><br>
"
}
choice {
enabled gold < local "pledge"
text "${8}"
selected text "
<center><img src=data:,${12}/></center>${5}<br>
...............................<br>
Gold Won: <strong>${gold:gold_won}</strong><br>
Gold Lost: <strong>${gold:gold_lost}</strong><br><br>
"
}
}
state "play" {
text "<center><img src=data:,${12}/></center>${6}<br>"
choice {
text "${9}"
actions {
set local "chosen_cup" 0
call "play"
}
selected text "<center><img src=data:,${12}/></center>${7}<br>"
next state "init"
}
choice {
text "${10}"
actions {
set local "chosen_cup" 1
call "play"
}
selected text "<center><img src=data:,${12}/></center>${7}<br>"
next state "init"
}
choice {
text "${11}"
actions {
set local "chosen_cup" 2
call "play"
}
selected text "<center><img src=data:,${12}/></center>${7}<br>"
next state "init"
}
}
}