Documentation
¶
Overview ¶
hp is a package that provides a health point system with a maximum and current value.
Index ¶
- func Compute(level, base, constitution int) int
- type HP
- func (hp *HP) BeetwenPercent(percent float64) bool
- func (hp *HP) Compute(level, base, constitution int)
- func (hp *HP) Copy() HP
- func (hp *HP) Damage(amount int)
- func (hp *HP) Heal(amount int)
- func (hp *HP) IsAlive() bool
- func (hp *HP) IsDead() bool
- func (hp *HP) Percent() float64
- func (hp *HP) PercentString() string
- func (hp *HP) Reset()
- func (hp *HP) Set(amount int)
- func (hp *HP) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HP ¶
HP represents a health point system with a maximum and current value.
func (*HP) BeetwenPercent ¶
BeetwenPercent returns true if the current HP and previous HP are between the given percentages.
func (*HP) Compute ¶
Compute returns the computed Max value based on the given level and base value.
func (*HP) PercentString ¶
PercentString returns the current HP as a percentage string.
Click to show internal directories.
Click to hide internal directories.