I'm working on a new Monty Hall-themed room for my Monstrous mod, and want to have some method of taking money from the player when he/she pulls a lever. This is also a dry run to see whether I can use the same principle to create a potential slot machine dungeon object for a future mod project. The only method I know of to remove money from the player involves using zorkmidUpkeep. Unfortunately, I've tested it a few times and it seems to have a number of drawbacks. If the player doesn't have sufficient funds, it doesn't trigger the spell at all. If time="1" the buff hangs around for two turns and removes your money twice, and if I set time="0" it only triggers once, but doesn't seem to remove any money either. Is there a more reliable method of draining cash from the player? The one nice thing about zorkmidUpkeep is that it auto-scales based on what floor you're on, which works well given that the potential value of the artifacts you can win as prizes also increases the deeper into the dungeon you descend. Here's the spell I'm currently using, triggered by pulling the lever that sets the room in motion. <spell name="Pay to Play" type="self" > <buff useTimer="1" time="0" stackable="0" stacksize="1" bad="1" icon="sprites/spells/pay_to_play64.png" smallicon="sprites/spells/pay_to_play32.png" zorkmidUpkeep="75"> </buff> <description text="You pays yer money, and you take yer chances." /> </spell> Any ideas?
I had forgotten about that one. XML validator accepted it as valid, but unfortunately, it doesn't appear to work in this instance. Probably because it's a room triggered spell, rather than a player skill. I tested it both with enough money to cover the cost and without, and in both instances I didn't lose any cash at all, though the room still successfully created the levers.
What about inflicting a buff on the player that drains their zorkmids? It's suboptimal because the effect will trigger if they don't have enough zorkmids, but it's close enough.
Is there a drainCasterZorkmids effect? I've given up on using a buff with zorkmidUpkeep because it's an all or nothing effect, but I could make a percentage drain work. As of right now, I've given up on having the Hall of Monty room cost money at all, pulling the lever just drains you of 50% of your current mana, which is an appropriate enough trade considering making a losing choice means you have to fight 5 randomly summoned monsters... with only half your mana.
Oh derp, I just realized now I didn't fully read your OP. At least take it as when I thought about it, I couldn't think of another way either. So it is maybe impossible. But hey, how about this! Apply the buff on the player, in one turn check if the player still has the buff on, if so, replace it with a "Paid in Full" buff. This buff lasts long enough to go to the lever. requirebuffontrigger ALWAYS checks the player regardless of any other circumstances, so the levels could be made to only operate while Paid in Full is active.