agent

package
v0.0.0-...-cec0596 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CLASS = struct {
	Warrior int
	Mage    int
	Archer  int
	Paladin int
}{
	Warrior: 1,
	Mage:    2,
	Archer:  3,
	Paladin: 4,
}
View Source
var CLASS_TEXT = map[int]string{
	CLASS.Warrior: "Warrior",
	CLASS.Mage:    "Mage",
	CLASS.Archer:  "Archer",
	CLASS.Paladin: "Paladin",
}
View Source
var GENESIS_AGENT = New("PoKGod", CLASS.Mage, WEAPON.TwilightStaff)
View Source
var WEAPON = struct {
	TwohandedSword    int
	BucklerAxe        int
	TwilightStaff     int
	WandOfDarkWarlock int
	Longbow           int
	Spitfire          int
	HammerOfJudgement int
	BoneCrusher       int
}{
	TwohandedSword:    1,
	BucklerAxe:        2,
	TwilightStaff:     3,
	WandOfDarkWarlock: 4,
	Longbow:           5,
	Spitfire:          6,
	HammerOfJudgement: 7,
	BoneCrusher:       8,
}
View Source
var WEAPON_TEXT = map[int]string{
	WEAPON.TwohandedSword:    "Two-handed Sword",
	WEAPON.BucklerAxe:        "Buckler & Axe",
	WEAPON.TwilightStaff:     "Twilight Staff",
	WEAPON.WandOfDarkWarlock: "Wand Of Dark Warlock",
	WEAPON.Longbow:           "Longbow",
	WEAPON.Spitfire:          "Spitfire",
	WEAPON.HammerOfJudgement: "Hammer Of Judgement",
	WEAPON.BoneCrusher:       "Bone Crusher",
}

Functions

func IsAgentExist

func IsAgentExist() bool

func Remove

func Remove()

Types

type Agent

type Agent struct {
	Name   string
	Class  string
	Weapon string
	Health int
	Attack int
	Luck   int //-20~20
}

func Load

func Load() *Agent

func New

func New(name string, class int, weapon int) *Agent

func (*Agent) DealDamage

func (a *Agent) DealDamage(rand int) int

deal a.Attak + rand damage

func (*Agent) Deserialize

func (a *Agent) Deserialize(b []byte)

func (*Agent) Introduce

func (a *Agent) Introduce()

func (*Agent) IsDied

func (a *Agent) IsDied() bool

func (*Agent) Save

func (a *Agent) Save()

func (*Agent) Serliazle

func (a *Agent) Serliazle() []byte

func (*Agent) TakeDamage

func (a *Agent) TakeDamage(damage int)

Jump to

Keyboard shortcuts

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