basegame

package
v0.0.0-...-5f9da39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Bronx = District{
	Name:           "Bronx",
	DrugsAvailable: make(Drugs, 6),
	ID:             3,
	Properties: DistrictProperties{
		Hospital:     true,
		Bank:         false,
		LoanShark:    true,
		NeighbourIDs: []int{0, 2},
		Wealth:       1,
	},
}
View Source
var Crook = Enemy{"Crook", 100, Knuckle, Knife, 1.2, 1.0, 0.4, true, false} //print only that he's armed with a Knife
View Source
var Districts = []District{manhattan, brooklyn, queens, Bronx, statenIsland}
View Source
var GangLeader = Enemy{"Gang Leader", 100, machineGun, pistol, 1.7, 2.5, 0.05, true, false}
View Source
var Gangster = Enemy{"Gangster", 100, pistol, machete, 1.5, 2.0, 0.08, true, false}
View Source
var Gangster2 = Enemy{"Gangster", 100, SMG, baseballBat, 1.3, 1.9, 0.1, true, false}

TODO: weapon randomization

View Source
var Gangster3 = Enemy{"Gangster", 100, shotgun, Knuckle, 2.0, 2.1, 0.07, true, false}
View Source
var Junkie = Enemy{"Junkie", 70, Knuckle, Knife, 1.0, 1.75, 0.6, true, false} //TODO: random junkie health, changes depending on which drug the player is selling the most
View Source
var Knife = Weapon{"Knife", 100, 10, 100, 1.0, false, true, 0, true, 5, 50, 5, false}
View Source
var Knuckle = Weapon{"Knuckle", 0, 3, 100, 1.0, true, true, 1, false, 0, 0, 1, true}
View Source
var PoliceCar = Enemy{"Police Officer in a car", 100, pistol, baton, 2.5, 1.5, 0.33, false, true} //TODO: add cars for the player
View Source
var PoliceHeli = Enemy{"Police Officer in a helicopter", 100, machineGun, shotgun, 5.0, 3.0, 0.1, false, true} //TODO: fights escalation
View Source
var PolicePed = Enemy{"Police Officer on foot", 100, pistol, baton, 1.0, 1.0, 0.5, false, true} //TODO: likelihood will depend on WantedLevel. If the c has a very high reputation, it will be possible to visit the police station and bribe the police to decrease the WantedLevel and the likelihood of encounter.
View Source
var SMG = Weapon{"SMG", 3000, 20, 50, 3, false, false, 0, false, 0, 0, 1, false}

Functions

This section is empty.

Types

type Character

type Character struct {
	Name                    string
	Health                  int
	Reputation, WantedLevel int
	Cash                    int
	Days                    int
	Bank                    int
	Debt                    int
	CurrentDistrict         District

	Weapons WeaponUnits
	// contains filtered or unexported fields
}

func InitPlayer

func InitPlayer() *Character

func Loadsave

func Loadsave() *Character

parse the ../savegame.json file and pass the data to the character struct. If any fields are missing, use the default values

type District

type District struct {
	Name           string
	DrugsAvailable Drugs
	ID             int
	Properties     DistrictProperties
}

func (District) PrintNeighbours

func (d District) PrintNeighbours()

print a numbered list of the Districts the player can travel with their Names to according to their IDs. The length of the list will change depending on the length of the player's current District's NeighbourIDs slice. A switch case will be used, where the cases are currentDistrict.ID and the cases are the IDs of the Districts in the NeighbourIDs slice. The player will be able to travel to any of the Districts in the NeighbourIDs slice.

type DistrictProperties

type DistrictProperties struct {
	Hospital     bool
	Bank         bool
	LoanShark    bool
	NeighbourIDs []int
	Wealth       int
}

type Drug

type Drug struct {
	Name        string
	Price       int
	RaiseWanted int
	Stock       int
}

type Drugs

type Drugs []Drug

type Enemy

type Enemy struct {
	Name         string
	HP           int
	Weapon       Weapon
	Weapon2      Weapon
	Speed        float64
	Perseverance float32
	// contains filtered or unexported fields
}

type FightFlight

type FightFlight interface {
	MeleeAttack()
	RangedAttack()
	Throw()
	Dodge()
	Bribe()
	Submit()
	Run()
}

type Save

type Save struct {
	Name                    string
	Health                  int
	Reputation, WantedLevel int
	Cash                    int
	Days                    int
	Bank                    int
	Debt                    int
	CurrentDistrict         District
	Drugs                   Drugs
	Weapons                 WeaponUnits
	WeaponsAvailable        []Weapon
}

using the following doc: https://docs.rocketnine.space/code.rocketnine.space/tslocum/messeji/ create a new text field at the bottom of the screen window will be 1152x648 text field will be 1152x200 set the font.Face to assets/VT323_Regular.17.ttf set the font size to 32 var textField = messeji.NewTextField(image.Rect(0, 448, 1152, 648), font.Face("assets/VT323_Regular.ttf"))

type Weapon

type Weapon struct {
	Name             string
	Price            int
	Damage, Accuracy int
	FiringRate       float32
	Melee            bool
	MeleeOnly        bool
	MeleeDmg         int
	Throwable        bool
	ThrowingDamage   int
	ThrowingAccuracy int
	MaxStock         int
	Default          bool
}

type WeaponUnits

type WeaponUnits map[Weapon]int

change WeaponUnits to a map of Weapon to int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL