wat

package
v0.0.0-...-062ba7d Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: 0BSD Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanNick

func CleanNick(nick string) string

func PrintTwo

func PrintTwo(nick string, value uint64) string

Types

type Action

type Action struct {
	PlayerId  uint       `gorm:"primary_key;auto_increment:false"`
	Type      ActionType `gorm:"primary_key;auto_increment:false"`
	Performed int64
}

type ActionType

type ActionType int
const (
	Action_Mine     ActionType = 1
	Action_Rest     ActionType = 2
	Action_Lift     ActionType = 3
	Action_Riot     ActionType = 4
	Action_Bankrupt ActionType = 5
)

type ParseIntError

type ParseIntError struct {
	// contains filtered or unexported fields
}

func (ParseIntError) Error

func (e ParseIntError) Error() string

type Player

type Player struct {
	gorm.Model
	Nick       string
	Host       string
	Watting    int64
	Anarchy    int64
	Trickery   int64
	Coins      uint64 `gorm:"default:'100'"`
	Health     int64
	LastMined  int64
	LastRested int64
	CoinsLost  uint64
	Bankrupcy  int64 // how many times someone has been bankrupt
}

func (*Player) Conscious

func (p *Player) Conscious() bool

func (*Player) Level

func (p *Player) Level(xp int64) int64

func (*Player) LoseCoins

func (p *Player) LoseCoins(coins uint64)

type PositiveError

type PositiveError struct{}

func (PositiveError) Error

func (e PositiveError) Error() string

type WatBot

type WatBot struct {
	Db   *WatDb
	Nick string
	// contains filtered or unexported fields
}

func NewWatBot

func NewWatBot(config *irc.ClientConfig, watConfig *WatConfig, serverConn *tls.Conn) *WatBot

func (*WatBot) Admin

func (w *WatBot) Admin(m *irc.Message) bool

func (*WatBot) Allowed

func (w *WatBot) Allowed(c string, r []string) bool

func (*WatBot) CanRespond

func (w *WatBot) CanRespond(m *irc.Message) bool

func (*WatBot) HandleIrcMsg

func (w *WatBot) HandleIrcMsg(c *irc.Client, m *irc.Message)

func (*WatBot) Msg

func (w *WatBot) Msg(m *irc.Message)

func (*WatBot) Run

func (w *WatBot) Run()

type WatConfig

type WatConfig struct {
	PermittedChannels []string
	IgnoredHosts      []string
}

type WatDb

type WatDb struct {
	// contains filtered or unexported fields
}

func NewWatDb

func NewWatDb() *WatDb

func (*WatDb) Act

func (w *WatDb) Act(player *Player, actionType ActionType)

func (*WatDb) Bankruptest

func (w *WatDb) Bankruptest() []Player

func (*WatDb) GetTopColumn

func (w *WatDb) GetTopColumn(tipe string) []Player

func (*WatDb) Healthiest

func (w *WatDb) Healthiest() []Player

func (*WatDb) LastActed

func (w *WatDb) LastActed(player *Player, actionType ActionType) int64

func (*WatDb) Strongest

func (w *WatDb) Strongest() []Player

func (*WatDb) TopLost

func (w *WatDb) TopLost() []Player

func (*WatDb) TopTen

func (w *WatDb) TopTen() []Player

func (*WatDb) Update

func (w *WatDb) Update(upd ...interface{})

func (*WatDb) User

func (w *WatDb) User(nick, host string, create bool) Player

type WatGame

type WatGame struct {
	// contains filtered or unexported fields
}

func NewWatGame

func NewWatGame(bot *WatBot, db *WatDb) *WatGame

func (*WatGame) Balance

func (g *WatGame) Balance(player *Player, fields []string) string

func (*WatGame) Bankrupest

func (g *WatGame) Bankrupest() string

func (*WatGame) Bankrupt

func (g *WatGame) Bankrupt(player *Player, fields []string) string

func (*WatGame) Bench

func (g *WatGame) Bench(player *Player, fields []string) string

func (*WatGame) CanAct

func (g *WatGame) CanAct(player *Player, action ActionType, minTime int64) bool

func (*WatGame) Dice

func (g *WatGame) Dice(player *Player, fields []string) string

func (*WatGame) Frame

func (g *WatGame) Frame(player *Player, fields []string) string

func (*WatGame) GetTarget

func (g *WatGame) GetTarget(player, target string) (*Player, string)

func (*WatGame) Heal

func (g *WatGame) Heal(player *Player, fields []string) string

func (*WatGame) Healthiest

func (g *WatGame) Healthiest() string

func (*WatGame) Int

func (g *WatGame) Int(str string) (uint64, error)

func (*WatGame) Leech

func (g *WatGame) Leech(player *Player, fields []string) string

func (*WatGame) Mine

func (g *WatGame) Mine(player *Player, _ []string) string

func (*WatGame) Msg

func (g *WatGame) Msg(m *irc.Message, player *Player, fields []string)

func (*WatGame) Punch

func (g *WatGame) Punch(player *Player, fields []string) string

func (*WatGame) RandInt

func (g *WatGame) RandInt(max int64) uint64

func (*WatGame) Rest

func (g *WatGame) Rest(player *Player, fields []string) string

func (*WatGame) Riot

func (g *WatGame) Riot(player *Player, fields []string) string

func (*WatGame) Roll

func (g *WatGame) Roll(player *Player, fields []string) string

func (*WatGame) Send

func (g *WatGame) Send(player *Player, fields []string) string

func (*WatGame) Steal

func (g *WatGame) Steal(player *Player, fields []string) string

func (*WatGame) Steroid

func (g *WatGame) Steroid(player *Player, fields []string) string

func (*WatGame) Strongest

func (g *WatGame) Strongest() string

func (*WatGame) TopLost

func (g *WatGame) TopLost() string

func (*WatGame) TopTen

func (g *WatGame) TopTen() string

func (*WatGame) Watch

func (g *WatGame) Watch(player *Player, fields []string) string

Jump to

Keyboard shortcuts

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