Discover Packages
github.com/zwindler/gocastle
pkg
mp
package
Version:
v0.0.0-...-5198b88
Opens a new window with list of versions in this module.
Published: Oct 5, 2023
License: MPL-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
mp is a package that provides a mana point system with a maximum and current value.
func Compute(level, base, intelligence int ) int
Compute returns the computed Max value based on the given level and base value.
8 + 4 by level +
bonus point for every 3 constitution point above 10 every level.
MP represents a mana point system with a maximum and current value.
New returns a new MP struct with the given max and current values.
func (mp *MP ) Compute(level, base, intelligence int )
Compute returns the computed Max value based on the given level and base value.
Copy creates a new MP with copies of Max and Current points.
Percent returns the current MP as a percentage of the maximum MP.
PercentString returns the current MP as a percentage string.
Reset sets the current MP to the maximum MP.
func (mp *MP ) Set(value int )
Set sets the current MP to the given value.
String returns the current and maximum MP as a string.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.