add dialog
This commit is contained in:
45
libpike/dialog/dialog.odin
Normal file
45
libpike/dialog/dialog.odin
Normal file
@@ -0,0 +1,45 @@
|
||||
// SPDX-License-Identifer: MIT
|
||||
/* dialog.odin
|
||||
*
|
||||
* Contents for dialog of characters
|
||||
*
|
||||
* Written by vx-clutch
|
||||
*/
|
||||
package dialog
|
||||
|
||||
guy := [?]string{
|
||||
"So? Looking to enter this casino, eh?",
|
||||
"bitch",
|
||||
"That casino is pretty fishy",
|
||||
"Why do I have a fishy taste in my mouth",
|
||||
"Who shitted my pants? The fish?",
|
||||
}
|
||||
|
||||
blackjack := [?]string{
|
||||
"How’s everyone swimming tonight?",
|
||||
"Caught any luck yet?",
|
||||
"Welcome aboard!",
|
||||
"Good to see you back!",
|
||||
"Feeling fintastic tonight?",
|
||||
}
|
||||
|
||||
slots := [?]string{
|
||||
"Yeah im a talking slot machine, so what?",
|
||||
"Eyes up here asshole",
|
||||
"Blub blub, im a fish!",
|
||||
"Jackpot! oh wait nevermind.",
|
||||
}
|
||||
|
||||
videopoker := [?]string{
|
||||
"Yeah im a talking video poker machine, so what?",
|
||||
"You video, i'll poker, lets video poker",
|
||||
"You're playing a fish themed casino game instead of doing that thing you are putting off, arn't you?",
|
||||
}
|
||||
|
||||
poker := [?]string{
|
||||
"Looks like the big fish are hungry tonight.",
|
||||
"Hope you can swim, kid.",
|
||||
"Smells like someone’s bleeding in the water.",
|
||||
"Don’t flop now, the sharks are watchin’.",
|
||||
"Keep your fins steady, it’s about to get deep.",
|
||||
}
|
||||
44
libpike/dialog/dialog_handle.odin
Normal file
44
libpike/dialog/dialog_handle.odin
Normal file
@@ -0,0 +1,44 @@
|
||||
// SPDX-License-Identifer: MIT
|
||||
/* dialog_handle.odin
|
||||
*
|
||||
* Routines for handling dialog related features
|
||||
*
|
||||
* Written by vx-clutch
|
||||
*/
|
||||
package dialog
|
||||
|
||||
import "core:math/rand"
|
||||
|
||||
import "../log"
|
||||
|
||||
/*
|
||||
Type represeting all the characters
|
||||
*/
|
||||
Characters :: enum {
|
||||
GUY,
|
||||
BLACKJACK,
|
||||
SLOTS,
|
||||
VIDEOPOKER,
|
||||
POKER,
|
||||
}
|
||||
|
||||
/*
|
||||
Get random dialog string based on character
|
||||
*/
|
||||
get_random :: proc(character: Characters) -> string {
|
||||
msg := ""
|
||||
switch character {
|
||||
case .GUY:
|
||||
msg = rand.choice(guy[:])
|
||||
case .BLACKJACK:
|
||||
msg = rand.choice(blackjack[:])
|
||||
case .SLOTS:
|
||||
msg = rand.choice(slots[:])
|
||||
case .VIDEOPOKER:
|
||||
msg = rand.choice(videopoker[:])
|
||||
case .POKER:
|
||||
msg = rand.choice(poker[:])
|
||||
}
|
||||
log.printl(msg)
|
||||
return msg
|
||||
}
|
||||
17
main.odin
17
main.odin
@@ -16,6 +16,7 @@ package main
|
||||
|
||||
import "libpike/log"
|
||||
import "libpike/casino"
|
||||
import "libpike/dialog"
|
||||
|
||||
main :: proc() {
|
||||
log.printl("pike init")
|
||||
@@ -25,4 +26,20 @@ main :: proc() {
|
||||
casino.shuffle(&deck)
|
||||
|
||||
casino.print_deck(deck)
|
||||
|
||||
log.printl("=== guy ===")
|
||||
dialog.get_random(.GUY)
|
||||
dialog.get_random(.GUY)
|
||||
log.printl("=== blackjack ===")
|
||||
dialog.get_random(.BLACKJACK)
|
||||
dialog.get_random(.BLACKJACK)
|
||||
log.printl("=== slots ===")
|
||||
dialog.get_random(.SLOTS)
|
||||
dialog.get_random(.SLOTS)
|
||||
log.printl("=== video poker ===")
|
||||
dialog.get_random(.VIDEOPOKER)
|
||||
dialog.get_random(.VIDEOPOKER)
|
||||
log.printl("=== poker ===")
|
||||
dialog.get_random(.POKER)
|
||||
dialog.get_random(.POKER)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user