combat

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlignmentChange

func AlignmentChange(killerAlignment int8, killedAlignment int8) int

func ChanceToTame

func ChanceToTame(s *users.UserRecord, t *mobs.Mob) int

func Crits

func Crits(sourceChar characters.Character, targetChar characters.Character) bool

Whether they crit

func Hits

func Hits(attackSpd, defendSpd, hitModifier int) bool

Chance to hit

func PowerRanking

func PowerRanking(atkChar characters.Character, defChar characters.Character) float64

Types

type AttackResult

type AttackResult struct {
	Hit                     bool  // defaults false
	Crit                    bool  // defaults false
	BuffSource              []int // defaults 0
	BuffTarget              []int // defaults 0
	DamageToTarget          int   // defaults 0
	DamageToTargetReduction int   // defaults 0
	DamageToSource          int   // defaults 0
	DamageToSourceReduction int   // defaults 0
	MessagesToSource        []string
	MessagesToTarget        []string
	MessagesToSourceRoom    []string
	MessagesToTargetRoom    []string
	MessagesToRoomOld       []string
}

func AttackMobVsMob

func AttackMobVsMob(mobAtk *mobs.Mob, mobDef *mobs.Mob) AttackResult

Performs a combat round from a mob to a mob

func AttackMobVsPlayer

func AttackMobVsPlayer(mob *mobs.Mob, user *users.UserRecord) AttackResult

Performs a combat round from a mob to a player

func AttackPlayerVsMob

func AttackPlayerVsMob(user *users.UserRecord, mob *mobs.Mob) AttackResult

Performs a combat round from a player to a mob

func AttackPlayerVsPlayer

func AttackPlayerVsPlayer(userAtk *users.UserRecord, userDef *users.UserRecord) AttackResult

Performs a combat round from a player to a player

func GetWaitMessages

func GetWaitMessages(stepType items.Intensity, sourceChar *characters.Character, targetChar *characters.Character, sourceType SourceTarget, targetType SourceTarget) AttackResult

func (*AttackResult) SendToRoomOld

func (a *AttackResult) SendToRoomOld(msg string)

func (*AttackResult) SendToSource

func (a *AttackResult) SendToSource(msg string)

func (*AttackResult) SendToSourceRoom

func (a *AttackResult) SendToSourceRoom(msg string)

func (*AttackResult) SendToTarget

func (a *AttackResult) SendToTarget(msg string)

func (*AttackResult) SendToTargetRoom

func (a *AttackResult) SendToTargetRoom(msg string)

type SourceTarget

type SourceTarget string
const (
	User SourceTarget = "user"
	Mob  SourceTarget = "mob"
)

Jump to

Keyboard shortcuts

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