Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds slot machines. #4022

Merged
merged 1 commit into from Jul 3, 2014
Merged

Adds slot machines. #4022

merged 1 commit into from Jul 3, 2014

Conversation

theOperand
Copy link
Contributor

What it says on the tin.
It works with coins and shit.

emagging it is top lyl and shoots the coins at you.

Probabilities and values are currently completely arbitrary, feel free to suggest changes.

This does not place them on the map.

slotmachinebetter gif

@theOperand
Copy link
Contributor Author

oh wait
this needs a few things done (like actually being added to the dme)

@RemieRichards
Copy link
Contributor

Can you replace the window with one of the Black popups? (Not Nano) it's easy to add and looks a LOT nicer.

@inorix
Copy link
Contributor

inorix commented Jun 28, 2014

From someone who happened to code actual slot machines, some ideas:

  • Never give away all the money put in. The machine needs profit made, perhaps make it a configurable option for an overseer to this machine, which is often the bartender in a real-world scenario. Common values are 5 to 25 percent being set aside for profit. Making it configurable would also allow the overseer to set it to a low value and then set it to a higher one once it has a great deal of money inside (then start playing himself), this often happens in the real world. Of course, the overseer would also be able to see how much money is inside currently.
  • As the money grows higher than a prize tier, make that prize tier more probable to happen, even going as far as to guarantee a payout when a lot more than the required amount is in the machine, with your current numbers that would be 20 times the payout amount (so we leave room for higher tier prize to happen still). Instead of paying out partial prizes, just prevent the prize from happening if there's insufficient funds.
  • Make the jackpot pay always in total, regardless of money stored. Jackpot can span an entire casino or even multiple casinos already in the 21st century, we can assume there's always enough money to pay for a jackpot. And it's not like it happens often ;]
  • What if, god forbid, the payout mechanics would jam every now and then requiring some sort of repair before the payout resumes.
  • Coin detectors can be picky. Make them refuse a coin sometimes forcing the player a retry to put the coin in.
  • Emagged slot machine spills all stored money and never pay again while still happily accepting coins?

@Rockdtben
Copy link
Contributor

@Miauw62 you should definitely consider all of the above.

If you don't want to then I will do it after this gets merged.

@theOperand
Copy link
Contributor Author

I am, rock.

@Rockdtben
Copy link
Contributor

Machine doesn't have an icon.

@theOperand
Copy link
Contributor Author

Yeah, I noticed.
The files were ready and working but things got a bit jumbled up when I got a new computer.
I'll go and fix that now.

@theOperand
Copy link
Contributor Author

I'm probably not going to do random "lol it's broken no money 4 u m8" stuff, though, doesn't seem very fun to me.

@theOperand
Copy link
Contributor Author

I won the "big winner" tier 3 times in a row but I'm not sure if that's just BYOND RNG or something wrong with my formulas

@theOperand
Copy link
Contributor Author

Should I add the last three things on that list or not?
Adding repair mechanics would be a quite some work for relatively little gain imho

@Rockdtben
Copy link
Contributor

Skip the last three. 👍 I'll look at this now.

@theOperand
Copy link
Contributor Author

whoops infinite loop

they also deny coins sometimes now.

var/initial_chance = chance
while(steps > 0)
if(prob(chance))
step(AM, pick(1, 2, 4, 5, 6, 8, 9, 10))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace the pick() with ALLDIRS (or was it ALL_DIRS)

@Giacom
Copy link
Contributor

Giacom commented Jul 1, 2014

Ok enough code reviewing. I cannot believe this is not a slot machine with the three rolling wheels that you have to land in a row to win; this is so lame you just click and hope you win with what seems like hardly any feedback other than "u lost" or "u win". There needs to be more to the actual UI.

return amount

/obj/machinery/slot_machine/attack_hand(mob/user)
user.set_machine(src)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call and check the return result of ..(). If it is true return out of the proc, otherwise continue.

Then remove set_machine and add_fingerprint, ..() will handle that.

@theOperand
Copy link
Contributor Author

I'll try my best to make this a "proper" slot machine, but that's going to take a little time.
For now the code is tested and merge-ready I guess, if you want to have a basic slot machine in the game.

@Rockdtben
Copy link
Contributor

@Miauw62 Let us get it right. I've gotten way too many jackpots last time I tested.

playsound(src.loc, "sparks", 50, 1)

/obj/machinery/slot_machine/process()
money++ //SPESSH MAJICKS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a new line after this line so there's a space between the procs

@theOperand
Copy link
Contributor Author

making it use actual reels is a MOTHERFUCKING PAIN IN THE ASS:

  1. I have to use fucking images and I can't sprite
  2. Putting it in Process() is slow but putting it in a spawned loop in Topic() CRASHES THE MOTHERFUCKING SERVER
  3. Using text alongside images instead of just text LOOKS LIKE FUCKING SHIT

@Giacom
Copy link
Contributor

Giacom commented Jul 1, 2014

Use text with just letters then. You can use X, O, #, 7, !

@theOperand theOperand changed the title Adds slot machines to the game. Adds slot machines. Jul 1, 2014
@theOperand
Copy link
Contributor Author

Slot machines have 5 reels. The symbols on the top of the reels are pushed down and new symbols are pick()ed to fill the slots on top. Normal prizes are valid on any horizontal line, jackpot is only the centre.
I changed the font to be Courier New so it has proper spacing.

I also included a reference to one of my all-time favorite movies. I doubt the reference will be seen EVER but oh well.

var/list/coinvalues = list()
var/list/reels = list(list("", "", ""), list("", "", ""), list("", "", ""), list("", "", ""), list("", "", ""))
var/list/spinning_reels = list(0, 0, 0, 0, 0) //Faster than an associative list.
//THE FONT ISNT WORKING ;-;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useless comment.

@Glloyd
Copy link
Contributor

Glloyd commented Jul 2, 2014

I like the UI better than mine, I may do that for the original at some point if you don't mind. Also 👍 for giving coins a purpose besides flipping them, nice implementation considering /tg/ doesn't have an economy system like Urist.

@theOperand
Copy link
Contributor Author

It's not just an UI, btw. The reels actually determine the result.

var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
spark_system.set_up(4, 0, src.loc)
spark_system.start()
playsound(src.loc, "sparks", 50, 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put an

else
    ...()

at the end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@theOperand
Copy link
Contributor Author

ALRITE READY 2 MERGE

Giacom added a commit that referenced this pull request Jul 3, 2014
@Giacom Giacom merged commit 88a99f4 into tgstation:master Jul 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants