Compare commits

..

No commits in common. "main" and "oppwars-windows" have entirely different histories.

2 changed files with 84 additions and 149 deletions

View file

@ -4,23 +4,15 @@ A satirical take on drug wars, except you are a police officer.
The irony is that you do the same stuff. The irony is that you do the same stuff.
## Features Features:
- Drugs: Increase XP gain, attack power or rewards from combat. - Buy Drugs.
- Whores: Fuck to regain health. Buy to earn an income. - Purchase Whores / Fuck Whores.
- Condoms: Protect your sexual health and prevent unwanted kids. - Buy Condoms.
- Combat: Beat up homeless people to earn cash and experience points. - Diseases.
- Beat up homeless people.
## Drug Manual
Cocaine: Boosts XP gain.
Fentanyl: Boosts Attack power.
LSD: Not implemented - Just costs money.
## Screenshots
![Screenshot Zero](screenshot0.avif) ![Screenshot Zero](screenshot0.avif)
![Screenshot One](screenshot1.avif) ![Screenshot One](screenshot1.avif)
![Screenshot Two](screenshot2.avif) ![Screenshot Two](screenshot2.avif)
## Special Thanks
Props go out to [Lipgloss](https://github.com/charmbracelet/lipgloss) Props go out to [Lipgloss](https://github.com/charmbracelet/lipgloss)

169
main.go
View file

@ -49,7 +49,7 @@ var stats string // variable for stats generation output
var statsCombat string // variable used for combat stats generation during fights var statsCombat string // variable used for combat stats generation during fights
var PlayerName string // player's name... var PlayerName string // player's name...
var condoms = 0 // its better to have them and not need them var condoms = 0 // its better to have them and not need them
var diseases = 0 // what happens if you have connies var std = false // what happens if you have connies
var money = 1800 // not specific currency var money = 1800 // not specific currency
var days = 30 // total number of days (default 30) var days = 30 // total number of days (default 30)
var experience = 0 // your experience from combat battle fights (starts at 0) var experience = 0 // your experience from combat battle fights (starts at 0)
@ -59,11 +59,9 @@ var cocaines = 0 // cocaine in 1/gram units
var fentanyl = 0 // fentanyl in 500 miligram units var fentanyl = 0 // fentanyl in 500 miligram units
var LSD = 0 // LSD in pills var LSD = 0 // LSD in pills
var bumfights = 25 // default number of homeless bum fights per day var bumfights = 25 // default number of homeless bum fights per day
const bumfightsTotal = 25 // total bumfights used to reset bum fights per day const bumfightsTotal = 25 // total bumfights
const taxes = 500 // skimming off the top const taxes = 500 // skimming off the top
var offspring = 0 // number of children you have by default var childsupport = 0 // if you get a hoe preggers
var childsupport = 0 // default 0 but changes if you get a hoe preggers
var playerHP = 200 // default hit points for the player
// Lipgloss - Props to // Lipgloss - Props to
var border = lipgloss.NewStyle(). var border = lipgloss.NewStyle().
@ -89,8 +87,8 @@ var slutStyle = lipgloss.NewStyle().
Width(75). Width(75).
BorderForeground(lipgloss.Color("228")). BorderForeground(lipgloss.Color("228")).
BorderBackground(lipgloss.Color("#ff00a2ff")). BorderBackground(lipgloss.Color("#ff00a2ff")).
Background(lipgloss.Color("#ffffffff ")). Foreground(lipgloss.Color("#ffffffff ")).
Foreground(lipgloss.Color("#ff00a2ff")) Background(lipgloss.Color("#ff00a2ff"))
var statsStyle = lipgloss.NewStyle(). var statsStyle = lipgloss.NewStyle().
BorderStyle(lipgloss.NormalBorder()). BorderStyle(lipgloss.NormalBorder()).
@ -105,7 +103,7 @@ var green = lipgloss.NewStyle().
// why the fuck does golang not do this - should work on win10/11 (yes it does support ansi escape codes *now*) // why the fuck does golang not do this - should work on win10/11 (yes it does support ansi escape codes *now*)
func ClearScreen() { func ClearScreen() {
fmt.Print("\033[H\033[2J") // this does appear to work on windows pe liveiso from win11 (tested in qemu) fmt.Print("\033[H\033[2J")
} }
// Cool stylized Enter key masher // Cool stylized Enter key masher
@ -121,11 +119,9 @@ func breakRoom() {
func HitTheStreets() { func HitTheStreets() {
ClearScreen() ClearScreen()
i := 0
choice := "" choice := ""
bumHP := 100 for i < 1 {
i := 1
for playerHP > 0 {
for i > 0 {
ClearScreen() ClearScreen()
CombatStats() CombatStats()
fmt.Println(storyStyle.Render(hitTheStreets)) fmt.Println(storyStyle.Render(hitTheStreets))
@ -134,82 +130,49 @@ func HitTheStreets() {
fmt.Print(green.Render(PlayerName), ">") fmt.Print(green.Render(PlayerName), ">")
fmt.Scan(&choice) fmt.Scan(&choice)
if strings.ToUpper(choice) == "B" { if strings.ToUpper(choice) == "B" {
bumHP = 100 * level
outerLoop:
for bumHP > 0 {
ClearScreen() ClearScreen()
fmt.Println(storyStyle.Render("Bum Fight!")) fmt.Println(storyStyle.Render("Bum Fight!"))
fmt.Println() fmt.Println()
fmt.Println("You are staring at a ", red.Render("homeless piece of shit!"), "with", bumHP, " HP") fmt.Println("You encounter a ", red.Render("homeless piece of shit!"))
fmt.Println("") fmt.Println("")
fmt.Println("What do you do?") fmt.Println("What do you do?")
fmt.Println("") fmt.Println("")
CombatStats() CombatStats()
fmt.Println(border.Render(statsCombat)) fmt.Println(border.Render(statsCombat))
fmt.Println("(F)ight") fmt.Println("(A)ttack")
fmt.Println("(G)o back to HQ") fmt.Println("(E)scape")
fmt.Println("Your choice,") homelessPunch := ""
fmt.Print(green.Render(PlayerName), ">") fmt.Scan(&homelessPunch)
homelessFight := "" if strings.ToUpper(homelessPunch) == "A" {
fmt.Scan(&homelessFight)
if strings.ToUpper(homelessFight) == "F" {
chance := rand.IntN(100) chance := rand.IntN(100)
if chance > 40 { if chance > 40 {
attack := 20 // default attack power
switch {
case fentanyl <= 0:
attack = 20
default:
modifier := attack * fentanyl // default attack power multiplied by amount of fentanyl
attack = attack + modifier
}
bumHP = bumHP - attack
ClearScreen() ClearScreen()
fmt.Println(red.Render("You smash the bum for "), attack, "hit points!") fmt.Println("You just hit the homeless bum with your police baton, it cracked his skull!")
fmt.Println("The bum has ", bumHP, " HP left") fmt.Println("You sprinkle some crack on him and move along.")
MashEnterKey() MashEnterKey()
experience = experience + 250
switch { money = money + 20
case bumHP <= 0:
money = money + 200
bumfights = bumfights - 1 bumfights = bumfights - 1
experienceGain := cocaines * 100 i = 0
levelGain := level * 100
experience = experience + levelGain + experienceGain + 100
break outerLoop
}
} else { } else {
ClearScreen() ClearScreen()
fmt.Println(red.Render("You missed, he dodged your attack!")) fmt.Println(red.Render("You missed, and he got away!"))
fmt.Println() fmt.Println()
homelessAttack := 20
playerHP = playerHP - homelessAttack
fmt.Println(red.Render("The homeless thug attacks you with a broken whiskey bottle for"), homelessAttack, " HP")
fmt.Println("Perhaps you should lay off the donuts...") fmt.Println("Perhaps you should lay off the donuts...")
if playerHP < 0 { bumfights = bumfights - 1
bumHP = 100
break outerLoop
}
MashEnterKey() MashEnterKey()
i = 0
} }
} else { } else {
fmt.Println("You go back to HQ.") fmt.Println("You escape successfully.")
bumfights = bumfights - 1 bumfights = bumfights - 1
bumHP = 0
MashEnterKey() MashEnterKey()
MainMachine() i = 0
}
} else {
i = 1
} }
} }
bumfights = bumfights - 1
} else if strings.ToUpper(choice) == "R" {
MainMachine()
}
}
}
MainMachine() MainMachine()
} }
@ -230,7 +193,6 @@ func RedRoom() {
fmt.Println("Your cash: $", strconv.Itoa(money)) fmt.Println("Your cash: $", strconv.Itoa(money))
fmt.Println("") fmt.Println("")
fmt.Println("Buy one sex slave (Y/N)?") fmt.Println("Buy one sex slave (Y/N)?")
fmt.Print(green.Render(PlayerName), ">")
slavePurchase := "" slavePurchase := ""
fmt.Scan(&slavePurchase) fmt.Scan(&slavePurchase)
if strings.ToUpper(slavePurchase) == "Y" { if strings.ToUpper(slavePurchase) == "Y" {
@ -257,7 +219,6 @@ func RedRoom() {
fmt.Println("Your cash: $", strconv.Itoa(money)) fmt.Println("Your cash: $", strconv.Itoa(money))
fmt.Println("") fmt.Println("")
fmt.Println("Buy connies (Y/N)?") fmt.Println("Buy connies (Y/N)?")
fmt.Print(green.Render(PlayerName), ">")
lapPurchase := "" lapPurchase := ""
fmt.Scan(&lapPurchase) fmt.Scan(&lapPurchase)
if strings.ToUpper(lapPurchase) == "Y" { if strings.ToUpper(lapPurchase) == "Y" {
@ -290,13 +251,12 @@ func RedRoom() {
lapPurchase := "" lapPurchase := ""
fmt.Scan(&lapPurchase) fmt.Scan(&lapPurchase)
if strings.ToUpper(lapPurchase) == "Y" { if strings.ToUpper(lapPurchase) == "Y" {
if money >= 20 { if money > 20 {
money = money - 20 money = money - 20
ClearScreen() ClearScreen()
fmt.Println(slutStyle.Render("That slut grinds on your dick to the song 'I like it that way' by Backstreet Boys.")) fmt.Println(slutStyle.Render("That slut grinds on your dick to the song 'I like it that way' by Backstreet Boys."))
fmt.Println() fmt.Println()
fmt.Println("That shit was so hot, you shot a hot load in your pants.") fmt.Println("That shit was so hot, you came in your pants.")
playerHP = playerHP + 100
MashEnterKey() MashEnterKey()
i = 0 i = 0
} else { } else {
@ -312,66 +272,50 @@ func RedRoom() {
} else if strings.ToUpper(choice) == "F" { } else if strings.ToUpper(choice) == "F" {
ClearScreen() ClearScreen()
fmt.Println(border.Render("Get your dick wet at OPP McDick's")) fmt.Println(border.Render("Get your Dick Wet at OPP McDick's"))
fmt.Println("Price: ", red.Render("$100 to fuck a dirty whore for an hour.")) fmt.Println("Price: ", red.Render("$100 to fuck a dirty whore for an hour."))
fmt.Println("Your cash: $", strconv.Itoa(money)) fmt.Println("Your cash: $", strconv.Itoa(money))
fmt.Println("") fmt.Println("")
fmt.Println("Buy an hour with a whore (Y/N)?") fmt.Println("Buy an hour with a whore (Y/N)?")
fmt.Print(green.Render(PlayerName), ">")
fuckPurchase := "" fuckPurchase := ""
fmt.Scan(&fuckPurchase) fmt.Scan(&fuckPurchase)
if strings.ToUpper(fuckPurchase) == "Y" { if strings.ToUpper(fuckPurchase) == "Y" {
if money >= 100 { if money > 100 {
money = money - 100 money = money - 100
if condoms == 0 { if condoms == 0 {
stdChance := rand.IntN(100) stdChance := rand.IntN(100)
preggoChance := rand.IntN(100) preggoChance := rand.IntN(100)
if stdChance > 25 {
std = true
} else {
ClearScreen()
fmt.Println(slutStyle.Render(wifeyFucked))
fmt.Println("You just fucked a dirty whore! Oh... shit, it's your cousin!")
MashEnterKey()
switch {
case stdChance <= 50:
diseases = diseases + 1
ClearScreen()
fmt.Println(red.Render("Uh oh!"))
fmt.Println(slutStyle.Render("You got a disease!"))
MashEnterKey()
} }
if preggoChance > 15 {
switch { fmt.Println(border.Render("You got the whore pregnant! Do you want to sell the kid to"))
case preggoChance <= 25: fmt.Println(border.Render("Pakistan for $500 up front to sew soccer balls?"))
ClearScreen()
fmt.Println(red.Render("Uh oh!"))
fmt.Println(slutStyle.Render("You got the whore pregnant! Do you want to sell the kid to Pakistan for $500?"))
fmt.Print(green.Render(PlayerName), "(Y/N) >")
soccerBalls := "" soccerBalls := ""
fmt.Scan(&soccerBalls) fmt.Scan(&soccerBalls)
if strings.ToUpper(soccerBalls) == "Y" { if strings.ToUpper(soccerBalls) == "Y" {
money = money + 500 money = money + 500
fmt.Println(red.Render("Bonus! You just made $500... The kid is great at sewing soccer balls!")) fmt.Println(border.Render("Bonus! You just made $500!"))
MashEnterKey()
} else { } else {
fmt.Println(red.Render("You have too much of a heart to sell your kid. Now you have to pay child support!"))
offspring = offspring + 1
fmt.Println("")
fmt.Println(red.Render("Fuck!"))
MashEnterKey()
}
}
}
}
} else { } else {
condoms = condoms - 1 condoms = condoms - 1
playerHP = playerHP + 200
} }
ClearScreen() ClearScreen()
fmt.Println(slutStyle.Render(wifeyFucked))
fmt.Println("You just fucked a dirty whore! Oh... shit, it's your cousin!")
MashEnterKey()
ClearScreen()
i = 0 i = 0
} else { } else {
ClearScreen() ClearScreen()
fmt.Println(red.Render("Get some money, broke-ass!")) fmt.Println(red.Render("Get some money, broke-ass!"))
MashEnterKey() MashEnterKey()
ClearScreen()
i = 0 i = 0
} }
} else { } else {
@ -413,14 +357,14 @@ func DoctorsOffice() {
if money > 100 { if money > 100 {
fmt.Println("You pay the doctor $100 and you and/or your 'friends' are cured.") fmt.Println("You pay the doctor $100 and you and/or your 'friends' are cured.")
money = money - 100 money = money - 100
diseases = 0 std = false
i = 1 i = 1
MashEnterKey() MashEnterKey()
} else { } else {
fmt.Println("You're too poor to cure your diseases.") fmt.Println("You're too poor to cure your disease.")
i = 1 i = 1
if diseases >= 1 { if std {
fmt.Println("But you still have a diseases.") fmt.Println("But you still have a disease.")
MashEnterKey() MashEnterKey()
} else { } else {
fmt.Println() fmt.Println()
@ -430,7 +374,7 @@ func DoctorsOffice() {
} else { } else {
ClearScreen() ClearScreen()
fmt.Println("No cure for you. I guess.") fmt.Println("No cure for you. I guess.")
if diseases >= 0 { if std {
fmt.Println("But you still have a disease.") fmt.Println("But you still have a disease.")
MashEnterKey() MashEnterKey()
} else { } else {
@ -549,7 +493,7 @@ func PropertyRoom() {
func ClockOut() { func ClockOut() {
choice := 0 choice := 0
ClearScreen() ClearScreen()
fmt.Println(slutStyle.Render(wifey)) fmt.Println(storyStyle.Render(wifey))
for choice < 1 { for choice < 1 {
fmt.Println("Your choice,") fmt.Println("Your choice,")
fmt.Print(green.Render(PlayerName), ">") fmt.Print(green.Render(PlayerName), ">")
@ -561,6 +505,7 @@ func ClockOut() {
ClearScreen() ClearScreen()
if cocaines > 1 { if cocaines > 1 {
fmt.Println(red.Render("You pull out 1kg of cocaine and smash it open all over your face")) fmt.Println(red.Render("You pull out 1kg of cocaine and smash it open all over your face"))
cocaines = cocaines - 1
fmt.Println(red.Render("You shout 'COKE SLAM!'")) fmt.Println(red.Render("You shout 'COKE SLAM!'"))
fmt.Println(red.Render("You bust your wife right in the fucking face!")) fmt.Println(red.Render("You bust your wife right in the fucking face!"))
fmt.Println(red.Render("YARRRRR! (You don't know why you're a pirate now)")) fmt.Println(red.Render("YARRRRR! (You don't know why you're a pirate now)"))
@ -568,7 +513,6 @@ func ClockOut() {
ClearScreen() ClearScreen()
} else { } else {
fmt.Println(red.Render("You bust your wife right in the fucking face!")) fmt.Println(red.Render("You bust your wife right in the fucking face!"))
MashEnterKey()
} }
} else { } else {
ClearScreen() ClearScreen()
@ -599,12 +543,11 @@ func ClockOut() {
GameOver() GameOver()
} else { } else {
days = days - 1 days = days - 1
if diseases >= 1 { if std {
bumfights = bumfightsTotal - 15 - diseases bumfights = bumfightsTotal - 15
} else { } else {
bumfights = bumfightsTotal bumfights = bumfightsTotal
} }
childsupport = offspring * 100
prostituteIncome := whores*500 - childsupport prostituteIncome := whores*500 - childsupport
money = money + taxes + prostituteIncome money = money + taxes + prostituteIncome
fmt.Println("Cha ching! You now have ", money) fmt.Println("Cha ching! You now have ", money)
@ -626,7 +569,7 @@ func GameOver() {
} }
func CheckStats() { func CheckStats() {
stats = "PLAYER STATS" + "\n\n" + "Name " + "\n" + PlayerName + "\n" + "Hit Points: " + strconv.Itoa(playerHP) + "\n" + "Condoms: " + strconv.Itoa(condoms) + "\n" + "Money: $" + strconv.Itoa(money) + "\n" + "Whores:" + strconv.Itoa(whores) + "\n" + "Cocaine (1 gram bags): " + strconv.Itoa(cocaines) + "\n" + "Fentanyl (100/mg bags): " + strconv.Itoa(fentanyl) + "\n" + "LSD (tabs): " + strconv.Itoa(LSD) + "\n" + "Days Left: " + strconv.Itoa(days) // builds the stats paragraph for the main screen stats = "PLAYER STATS" + "\n\n" + "Name " + "\n" + PlayerName + "\n" + "Condoms: " + strconv.Itoa(condoms) + "\n" + "Money: $" + strconv.Itoa(money) + "\n" + "Whores:" + strconv.Itoa(whores) + "\n" + "Cocaine (1 gram bags): " + strconv.Itoa(cocaines) + "\n" + "Fentanyl (100/mg bags): " + strconv.Itoa(fentanyl) + "\n" + "LSD (tabs): " + strconv.Itoa(LSD) + "\n" + "Days Left: " + strconv.Itoa(days) // builds the stats paragraph for the main screen
} }
func CombatStats() { func CombatStats() {
@ -651,7 +594,7 @@ func CombatStats() {
} else { } else {
fmt.Println() fmt.Println()
} }
statsCombat = "Name: " + PlayerName + "\n" + "Hit Points: " + strconv.Itoa(playerHP) + "\n" + "Level :" + strconv.Itoa(level) + "\n" + "Money: $" + strconv.Itoa(money) + "\n" + "Experience :" + strconv.Itoa(experience) + "\n" + "Bum Fights Left: " + strconv.Itoa(bumfights) // builds Combat Stats statsCombat = "Name: " + PlayerName + "\n" + "Level :" + strconv.Itoa(level) + "\n" + "Money: $" + strconv.Itoa(money) + "\n" + "Experience :" + strconv.Itoa(experience) + "\n" + "Bum Fights Left: " + strconv.Itoa(bumfights) // builds Combat Stats
} }
func MainMachine() { func MainMachine() {