Documentation ¶
Index ¶
- Constants
- func AttributesOperation(receiver *api.Attributes, booster *api.Attributes, skipped map[string]struct{}, ...) error
- func AttributesValue(playerAttributes *api.Attributes, a *api.Attributes) (float64, error)
- func CalculateDistanceAndLineOfSight(currentMap *api.Level, currentPosition *api.Position) map[PlainPos]MapCellExt
- func CoordinatesToPosition(coordinates *api.Coordinates) *api.Position
- func EvaluateDamage(power float64, t api.DamageType, a *api.Attributes) float32
- func EvaluateSkillAttributes(sa *api.SkillAttributes, casterAttributes *api.Attributes) (*api.Attributes, error)
- func FilterEffect(e *api.Effect)
- func GetLoS(currentLevel *api.Level, resultMap map[PlainPos]MapCellExt, ...) bool
- func GetNewId() string
- func HideUnidentifiedFields(i *api.Item)
- func Knockback(s Skiller, from *api.Coordinates)
- func MaxAllAttributes(receiver *api.Attributes, booster *api.Attributes, mustBePresent bool) error
- func MergeAllAttributes(receiver *api.Attributes, booster *api.Attributes, mustBePresent bool) error
- func MergeAttributes(receiver *api.Attributes, booster *api.Attributes, skipped map[string]struct{}, ...) error
- func PositionToCoordinates(p *api.Position, l int32) *api.Coordinates
- func RoundRange(r float64) float64
- func RoundSkill(r float64) float64
- func SatisfyingAttributes(attributes *api.Attributes, requirements *api.Attributes) (bool, error)
- func SubtractAllAttributes(receiver *api.Attributes, booster *api.Attributes, mustBePresent bool) error
- func SumAttributes(attributes *api.Attributes) (float32, error)
- func TeleportMoveTo(s Skiller, c *api.Coordinates)
- type Alive
- type Ider
- type MapCellExt
- type Monster
- func (m *Monster) AddEffect(e *api.Effect)
- func (m *Monster) DamageTaken()
- func (m *Monster) GetAttributes() *api.Attributes
- func (m *Monster) GetId() string
- func (m *Monster) GetLastDamageTaken() int32
- func (m *Monster) GetMovingTo() *paths.Path
- func (m *Monster) GetName() string
- func (m *Monster) GetPosition() *api.Coordinates
- func (m *Monster) GetSkill(id string) (*api.Skill, bool)
- func (m *Monster) GetSkills() map[string]*api.Skill
- func (m *Monster) GetTeleportTo() *TeleportPosition
- func (m *Monster) IsStunned() bool
- func (m *Monster) ResetTeleportTo()
- func (m *Monster) SetMovingTo(p *paths.Path)
- func (m *Monster) SetPosition(c *api.Coordinates)
- func (m *Monster) Stun() *api.Stun
- func (m *Monster) Stunned()
- func (m *Monster) UpdateAttributes()
- type PlainPos
- type Player
- func (p *Player) AddEffect(e *api.Effect)
- func (p *Player) DamageTaken()
- func (p *Player) Equip(item *api.Item) error
- func (p *Player) GetAttributes() *api.Attributes
- func (p *Player) GetId() string
- func (p *Player) GetLastDamageTaken() int32
- func (p *Player) GetMovingTo() *paths.Path
- func (p *Player) GetName() string
- func (p *Player) GetPosition() *api.Coordinates
- func (p *Player) GetSkill(id string) (*api.Skill, bool)
- func (p *Player) GetSkills() map[string]*api.Skill
- func (p *Player) GetTeleportTo() *TeleportPosition
- func (p *Player) InitAttributes()
- func (p *Player) IsStunned() bool
- func (p *Player) ResetAttributes() error
- func (p *Player) ResetTeleportTo()
- func (p *Player) SetMovingTo(m *paths.Path)
- func (p *Player) SetPosition(c *api.Coordinates)
- func (p *Player) Stun() *api.Stun
- func (p *Player) Stunned()
- func (p *Player) UpdateAttributes() error
- type Positioner
- type Skiller
- type Stun
- type TeleportPosition
Constants ¶
View Source
const ZeroLevel int32 = 0
Variables ¶
This section is empty.
Functions ¶
func AttributesOperation ¶
func AttributesOperation(receiver *api.Attributes, booster *api.Attributes, skipped map[string]struct{}, mustBePresent bool, operation func(r, b *float32)) error
func AttributesValue ¶
func AttributesValue(playerAttributes *api.Attributes, a *api.Attributes) (float64, error)
func CoordinatesToPosition ¶
func CoordinatesToPosition(coordinates *api.Coordinates) *api.Position
func EvaluateDamage ¶
func EvaluateDamage(power float64, t api.DamageType, a *api.Attributes) float32
func EvaluateSkillAttributes ¶
func EvaluateSkillAttributes(sa *api.SkillAttributes, casterAttributes *api.Attributes) (*api.Attributes, error)
func FilterEffect ¶
func HideUnidentifiedFields ¶
func Knockback ¶
func Knockback(s Skiller, from *api.Coordinates)
func MaxAllAttributes ¶
func MaxAllAttributes(receiver *api.Attributes, booster *api.Attributes, mustBePresent bool) error
func MergeAllAttributes ¶
func MergeAllAttributes(receiver *api.Attributes, booster *api.Attributes, mustBePresent bool) error
func MergeAttributes ¶
func MergeAttributes(receiver *api.Attributes, booster *api.Attributes, skipped map[string]struct{}, mustBePresent bool) error
func PositionToCoordinates ¶
func PositionToCoordinates(p *api.Position, l int32) *api.Coordinates
func RoundRange ¶
func RoundSkill ¶
func SatisfyingAttributes ¶
func SatisfyingAttributes(attributes *api.Attributes, requirements *api.Attributes) (bool, error)
func SubtractAllAttributes ¶
func SubtractAllAttributes(receiver *api.Attributes, booster *api.Attributes, mustBePresent bool) error
func SumAttributes ¶
func SumAttributes(attributes *api.Attributes) (float32, error)
func TeleportMoveTo ¶
func TeleportMoveTo(s Skiller, c *api.Coordinates)
Types ¶
type Alive ¶
type Alive interface { Positioner IsStunned() bool DamageTaken() }
type MapCellExt ¶
type MapCellExt struct { MapObjects *api.MapObjects Distance int LineOfSight bool }
type Monster ¶
type Monster struct { Position *api.Coordinates `json:"position"` MovingTo *paths.Path `json:"-"` Monster *api.Monster `json:"-"` Skills map[string]*api.Skill `json:"-"` TeleportedTo TeleportPosition `json:"-"` KillCounter *int32 `json:"-"` }
func CreateMonster ¶
func CreateMonster(mon *api.Monster, p *api.Coordinates) *Monster
func (*Monster) DamageTaken ¶
func (m *Monster) DamageTaken()
func (*Monster) GetAttributes ¶
func (m *Monster) GetAttributes() *api.Attributes
func (*Monster) GetLastDamageTaken ¶
func (*Monster) GetMovingTo ¶
func (*Monster) GetPosition ¶
func (m *Monster) GetPosition() *api.Coordinates
func (*Monster) GetTeleportTo ¶
func (m *Monster) GetTeleportTo() *TeleportPosition
func (*Monster) ResetTeleportTo ¶
func (m *Monster) ResetTeleportTo()
func (*Monster) SetMovingTo ¶
func (*Monster) SetPosition ¶
func (m *Monster) SetPosition(c *api.Coordinates)
func (*Monster) UpdateAttributes ¶
func (m *Monster) UpdateAttributes()
type PlainPos ¶
func PlainPosFromApiPos ¶
type Player ¶
type Player struct { MovingTo *paths.Path `json:"-"` Equipped map[api.Item_Type]*api.Item `json:"-"` Character *api.Character `json:"character"` BaseAttributes *api.Attributes `json:"-"` ItemAttributes *api.Attributes `json:"-"` MaxStats *api.Attributes `json:"-"` Skills map[string]*api.Skill `json:"-"` IsAdmin bool `json:"admin"` TeleportedTo TeleportPosition `json:"-"` }
func CreatePlayer ¶
func (*Player) DamageTaken ¶
func (p *Player) DamageTaken()
func (*Player) GetAttributes ¶
func (p *Player) GetAttributes() *api.Attributes
func (*Player) GetLastDamageTaken ¶
func (*Player) GetMovingTo ¶
func (*Player) GetPosition ¶
func (p *Player) GetPosition() *api.Coordinates
func (*Player) GetTeleportTo ¶
func (p *Player) GetTeleportTo() *TeleportPosition
func (*Player) InitAttributes ¶
func (p *Player) InitAttributes()
func (*Player) ResetAttributes ¶
func (*Player) ResetTeleportTo ¶
func (p *Player) ResetTeleportTo()
func (*Player) SetMovingTo ¶
func (*Player) SetPosition ¶
func (p *Player) SetPosition(c *api.Coordinates)
func (*Player) UpdateAttributes ¶
type Positioner ¶
type Positioner interface { Ider GetPosition() *api.Coordinates SetPosition(c *api.Coordinates) GetMovingTo() *paths.Path SetMovingTo(m *paths.Path) }
type TeleportPosition ¶
type TeleportPosition struct { Move *api.Coordinates Knockback *utils.V }
Click to show internal directories.
Click to hide internal directories.