TFSagas/public_scripts/runeRoll.tf
2024-10-12 22:04:50 -03:00

112 lines
3.2 KiB
HCL

# TFSagas: Public: Rune Roll
# Testnet
# Files:
# ../assets/thrallGamble_128.jpeg
# ../assets/thrallGamble_256.jpeg
# Rune text:
#
# <h2>A rugged Viking,</h2>
# <h3>
# his eyes gleaming with mischief, challenges the player to a high-stakes game of runes under flickering torchlight.<br>
# He lays out intricately carved stones, each one promising fortune or folly, and taunts that only the boldest can conquer fate.<br>
# As tension mounts, the player must navigate the mysteries of the runes and stake their honor against his relentless bravado, igniting a fierce rivalry...
# </h3>
script {
name "TFS: Rune Roll"
description "Roll a dice to multiply your pledge -- 0.36-1"
icon "@raw:thrallGamble_128.jpeg"
owner 18
public
# deployable
overrides {
1 "<h2>Ho there, %P! Fortune favor you this day?<br>Come, take a seat and let us cast the runes together!</h2>"
2 "<h3>Throw the runes and let fate decide!</h3>"
3 "<h2>Runes are rolling!</h2><h3>May the blessings of the Norns guide your fate<br>and Lady Luck smile upon you!</h3><br>"
4 "Not today, my friend. Farewell"
5 "<h2>May the gods watch over you, until we meet again.</h2>"
6 "<h3>Perhaps we should rest ourselves</h3>"
7 "@b64:thrallGamble_256.jpeg"
local "pledge" 100000000
local "1_chance_in" 5
local "award_multiplier" 2
}
precondition "Pledge Reserve" gold >= local "pledge" * local "award_multiplier"
reserves {
player gold local "pledge"
owner gold (local "pledge" * local "award_multiplier")
}
state "init" {
text "
<center><img src=data:,${7}/></center>${1}<br>
...............................<br>
Gold pledge: <strong>${gold:pledge}</strong><br>
Chance of Win: <strong>1 in ${1_chance_in}</strong><br>
Award Multiplier: <strong>${award_multiplier}</strong><br>
...............................<br>
Gold Won: <strong>${gold:gold_won}</strong><br>
Gold Lost: <strong>${gold:gold_lost}</strong><br>
"
choice {
text "${2}"
reserves {
owner gold (local "pledge" * local "award_multiplier")
player gold local "pledge"
}
actions {
if (random local "1_chance_in" - 1 == 0) {
award gold (local "pledge" * local "award_multiplier")
set local "win_counter" local "win_counter" + 1
set local "gold_won" local "pledge" * local "award_multiplier" * local "win_counter"
} else {
pay gold local "pledge"
set local "loss_counter" local "loss_counter" + 1
set local "gold_lost" local "pledge" * local "loss_counter"
}
}
selected text "<center><img src=data:,${7}/></center>${3}<br>"
next state "init"
}
choice {
enabled gold >= local "pledge"
text "${4}"
selected text "
<center><img src=data:,${7}/></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 "${6}"
selected text "
<center><img src=data:,${7}/></center>${5}<br>
...............................<br>
Gold Won: <strong>${gold:gold_won}</strong><br>
Gold Lost: <strong>${gold:gold_lost}</strong><br><br>
"
}
}
}