oppwars/main.go
2025-08-07 09:06:29 +00:00

449 lines
11 KiB
Go

package main
import (
"bufio"
_ "embed"
"fmt"
"math/rand/v2"
"os"
"strconv"
"strings"
"github.com/mgutz/ansi"
"github.com/muesli/reflow/wordwrap"
)
var PlayerName string
var TransphobiaToggle bool
var rank = "Volunteer"
var isRMSdead bool
var isLXOdead bool
var isESRdead bool
var isRMShigh bool
var isLXOhigh bool
var isESRhigh bool
var score int
var pink = ansi.ColorFunc("magenta")
var green = ansi.ColorFunc("green")
var cyan = ansi.ColorFunc("cyan")
var red = ansi.ColorFunc("red")
var mashkey = ansi.ColorFunc("white+h:blue")
//go:embed data/intro.txt
var intro string
//go:embed data/levels/lildick/lildickOffice.txt
var lildickOffice string
//go:embed data/levels/lildick/choice1.txt
var lildickChoice1 string
//go:embed data/levels/lildick/choice2.txt
var lildickChoice2 string
//go:embed data/genderSelection.txt
var genderSelection string
//go:embed data/levels/heroine/heroine.txt
var heroine string
//go:embed data/levels/heroine/heroineChoice1.txt
var heroineChoice1 string
//go:embed data/levels/heroine/heroineChoice2.txt
var heroineChoice2 string
//go:embed data/levels/heroine/heroineChoice3.txt
var heroineChoice3 string
//go:embed data/levels/cocaine/cocaine.txt
var cocaine string
//go:embed data/levels/cocaine/cocaineChoice1.txt
var cocaineChoice1 string
//go:embed data/levels/cocaine/cocaineChoice2.txt
var cocaineChoice2 string
//go:embed data/levels/cocaine/cocaineChoice3.txt
var cocaineChoice3 string
//go:embed data/levels/punchnazi/nazi.txt
var nazi string
//go:embed data/levels/punchnazi/naziMissed.txt
var naziMissed string
//go:embed data/levels/punchnazi/naziPunched.txt
var naziPunched string
//go:embed data/levels/groundZero/groundZero.txt
var groundZero string
//go:embed data/levels/groundZero/groundZeroChoice1.txt
var groundZeroChoice1 string
//go:embed data/levels/groundZero/groundZeroChoice2.txt
var groundzeroChoice2 string
//go:embed data/levels/groundZero/groundZeroChoice2A.txt
var groundZeroChoice2A string
//go:embed data/levels/groundZero/groundZeroChoice2B1.txt
var groundZeroChoice2B1 string
//go:embed data/levels/groundZero/groundZeroChoice2B2.txt
var groundZeroChoice2B2 string
//go:embed data/levels/groundZero/groundZeroChoice3.txt
var groundZeroChoice3 string
//go:embed data/levels/groundZero/groundZeroChoice4A.txt
var groundZeroChoice4A string
//go:embed data/levels/groundZero/groundZeroChoice4B.txt
var groundZeroChoice4B string
func ClearScreen() {
fmt.Print("\033[H\033[2J")
}
func MashEnterKey() {
fmt.Println(mashkey("Mash the 'Enter' key!"))
bufio.NewReader(os.Stdin).ReadBytes('\n')
}
func CheckStaff() {
if isRMSdead {
fmt.Println("Richard... Stallman... is dead. Our glorious leader is dead...")
} else {
fmt.Println("Richard Stallman is doing a silly dance with his favourite parrot.")
}
if isLXOdead {
fmt.Println("Alexandre Oliva is baking cookies and muffins without an oven. Because he is in hell. Ding dong, Oliva is dead.")
} else {
fmt.Println("Alexandre Oliva is currently hanging out on Techrights IRC with nazis and hate speech activists.")
}
if isESRdead {
fmt.Println("Eric S. Raymond has died, and a team of government agents have absconded with his body.\nPerhaps he was right about the Illuminti?")
} else {
fmt.Println("Eric S.Raymond is hoarding guns and working on his latest manifesto. \nThis one ain't too much about software.")
}
if TransphobiaToggle {
fmt.Println("Bryan Lunduke wants to fuck you, but hes too busy masterbating to femboys.")
} else {
}
}
func StatusScreen() {
fmt.Println("Your name is ", pink(PlayerName))
fmt.Println("Your rank is ", cyan(rank))
s := strconv.Itoa(score)
fmt.Println("Your score is", green(s))
}
func GenderSheet() {
ClearScreen()
gender := 0
i := 0
x := 0
for i < 1 {
fmt.Println(genderSelection)
fmt.Print(red(PlayerName), ">")
fmt.Scan(&gender)
switch x {
case 1, 2:
TransphobiaToggle = false
i = 1
case 3, 4, 5:
TransphobiaToggle = true
i = 1
case 6:
fmt.Print("Enter your gender: ")
reader := bufio.NewReader(os.Stdin)
prompt, _ := reader.ReadString('\n')
prompt2 := strings.TrimRight(prompt, "\n")
fmt.Println("You are a", prompt2)
TransphobiaToggle = true
i = 1
default:
i = 0
}
}
}
func BryansOffice() {
ClearScreen()
choice := 0
for choice < 1 {
fmt.Println(lildickOffice)
fmt.Println("Your choice,")
fmt.Print(red(PlayerName), ">")
fmt.Scan(&choice)
if choice == 1 {
ClearScreen()
fmt.Println(lildickChoice1)
score = score + 100
MashEnterKey()
} else if choice == 2 {
ClearScreen()
fmt.Println(lildickChoice2)
score = score + 75
MashEnterKey()
} else {
choice = 0
}
}
}
func Heroine() {
ClearScreen()
choice := 0
for choice < 1 {
fmt.Println(heroine)
fmt.Println("Your choice,")
fmt.Print(red(PlayerName), ">")
fmt.Scan(&choice)
if choice == 1 {
if isRMSdead {
fmt.Println("Richard Stallman, our glorious leader, is dead. Heroine won't be effective.")
MashEnterKey()
} else {
chance := rand.IntN(100)
if chance < 20 {
fmt.Println(heroineChoice1)
MashEnterKey()
isRMShigh = true
score = score + 500
} else {
fmt.Println("Richard Stallman dodges your attempt and starts to scream and cry. \nHe runs into a closet and cuddles with his parrot.")
MashEnterKey()
}
}
} else if choice == 2 {
if isLXOdead {
fmt.Println("Alexandre Oliva is fucking dead. Heroine won't be effective.")
MashEnterKey()
} else {
chance := rand.IntN(100)
if chance < 50 {
fmt.Println(heroineChoice2)
MashEnterKey()
isLXOhigh = true
score = score + 100
} else {
fmt.Println("Alexandre Oliva dodges your attempt to give him a dose of heroine.")
MashEnterKey()
}
}
} else if choice == 3 {
if isESRdead {
fmt.Println("ESR is fucking dead. Heroine won't be effective.")
MashEnterKey()
} else {
chance := rand.IntN(100)
if chance < 50 {
fmt.Println(heroineChoice3)
MashEnterKey()
isESRhigh = true
score = score + 100
} else {
fmt.Println("ESR slaps the needle out of your hand.")
MashEnterKey()
}
}
} else {
choice = 0
}
}
}
func Cocaine() {
ClearScreen()
choice := 0
for choice < 1 {
fmt.Println(cocaine)
fmt.Println("Your choice,")
fmt.Print(red(PlayerName), ">")
fmt.Scan(&choice)
if choice == 1 {
if isRMSdead {
fmt.Println("Richard Stallman, our glorious leader, is dead. \nNot even cocaine can restart his heart at this point.")
MashEnterKey()
choice = 0
} else {
chance := rand.IntN(100)
if chance < 20 {
fmt.Println(cocaineChoice1)
MashEnterKey()
isRMShigh = true
score = score + 100
choice = 1
} else {
fmt.Println("Richard Stallman tells you that drugs are bad. \nNot because they are harmful to your body, but because the recipes are not GPLv3.")
MashEnterKey()
}
}
} else if choice == 2 {
if isLXOdead {
fmt.Println("Alexandre Oliva is fucking dead. \nYou sprinkle some of the cocaine on his corpse... It does nothing.")
MashEnterKey()
choice = 0
} else {
chance := rand.IntN(100)
if chance < 50 {
fmt.Println(cocaineChoice2)
MashEnterKey()
isLXOhigh = true
score = score + 50
choice = 1
} else {
fmt.Println("Alexandre Oliva casually avoids you when you pull out the bag. Shit!")
MashEnterKey()
choice = 1
}
}
} else if choice == 3 {
if isESRdead {
fmt.Println("ESR is fucking dead. Cocaine won't be effective.")
MashEnterKey()
choice = 0
} else {
chance := rand.IntN(100)
if chance < 40 {
fmt.Println(cocaineChoice3)
MashEnterKey()
isESRhigh = true
score = score + 75
} else {
fmt.Println("ESR slaps the bag of coke out of your hand, picks it up and throws it into the trash.")
fmt.Println("'You know that stuff was invented by the CIA right?'")
MashEnterKey()
}
}
} else {
choice = 0
}
}
}
func PunchNazi() {
choice := 0
ClearScreen()
for choice < 1 {
fmt.Println(nazi)
fmt.Println("Your choice,")
fmt.Print(red(PlayerName), ">")
fmt.Scan(&choice)
if choice == 1 {
chance := rand.IntN(100)
if chance < 50 {
fmt.Println(naziPunched)
score = score + 100
MashEnterKey()
} else {
fmt.Println(naziMissed)
MashEnterKey()
}
} else if choice == 2 {
fmt.Println("You don't have time for that piece of shit. You simply walk away.")
MashEnterKey()
} else {
choice = 0
}
}
}
func GroundZero() {
choice1 := 0
for choice1 < 1 {
ClearScreen()
fmt.Println(groundZero)
fmt.Println("Your choice,")
fmt.Print(red(PlayerName), ">")
fmt.Scan(&choice1)
if choice1 == 1 {
ClearScreen()
fmt.Println(groundZeroChoice1)
score = score + 100
fmt.Println()
} else if choice1 == 2 {
ClearScreen()
fmt.Println(groundzeroChoice2)
MashEnterKey()
ClearScreen()
chance := rand.IntN(100)
if chance < 50 {
fmt.Println(groundZeroChoice2A)
MashEnterKey()
} else {
fmt.Println(groundZeroChoice2B1)
MashEnterKey()
ClearScreen()
fmt.Println(groundZeroChoice2B2)
isLXOdead = true
MashEnterKey()
score = score + 200
ClearScreen()
}
} else if choice1 == 3 {
ClearScreen()
fmt.Println(groundZeroChoice3)
MashEnterKey()
score = score + 50
} else if choice1 == 4 {
ClearScreen()
fmt.Println(groundZeroChoice4A)
MashEnterKey()
ClearScreen()
fmt.Println(groundZeroChoice4B)
MashEnterKey()
score = score + 75
} else {
choice1 = 0
}
}
}
func main() {
p := fmt.Println
ClearScreen()
fmt.Println(green(intro))
fmt.Println()
fmt.Println("Richard Stallman walks over to you. He starts doing a weird dance while he molests a parrot.")
fmt.Println()
fmt.Println("'Who the fuck are you? A Microsoft Spy?' he demands.")
fmt.Println()
fmt.Print("Enter your damned name: ")
reader := bufio.NewReader(os.Stdin)
prompt, _ := reader.ReadString('\n')
playerNameMaker := strings.Clone(prompt)
PlayerName = strings.TrimRight(playerNameMaker, "\n") // removes a trailing "Return" key that fucks everything up (i dont want the enter key IN the variable)
ClearScreen()
fmt.Println("Welcome to the ", red("Free Software Foundation!"))
fmt.Println()
p(wordwrap.String("The year is 2028, our glorious leader, Dr. Richard Stallman, saved the Free Software Foundation from the brink of financial collapse.\n\nThe invention of a new form of nutritional yeast was discovered in his toes, and it is so powerful it can cure some forms of cancer.", 80))
fmt.Println()
fmt.Println("You are the latest recruit to enter the brand new FSF HQ.")
fmt.Println()
fmt.Println("You actually are a spy for Microsoft. Your mission is to take over the organization by any means necessary.")
fmt.Println()
StatusScreen()
fmt.Println()
fmt.Println("Are you ready for a GNU Dawn?")
fmt.Println()
MashEnterKey()
GenderSheet()
if TransphobiaToggle {
BryansOffice()
} else {
}
GroundZero()
Cocaine()
Heroine()
CheckStaff()
fmt.Println()
StatusScreen()
}