MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / GetCurrentAbilityDisplay

Method GetCurrentAbilityDisplay

internal/pets/pets.go:332–355  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

330}
331
332func (p *Pet) GetCurrentAbilityDisplay() *AbilityDisplay {
333 ab := p.GetCurrentAbility()
334 if ab == nil {
335 return nil
336 }
337 d := &AbilityDisplay{
338 LevelGranted: ab.LevelGranted,
339 Active: true,
340 CombatChance: ab.CombatChance,
341 DiceRoll: ab.Damage.DiceRoll,
342 DiceCount: ab.Damage.DiceCount,
343 SideCount: ab.Damage.SideCount,
344 StatMods: map[string]int(ab.StatMods),
345 Capacity: ab.Capacity,
346 }
347 for _, bId := range ab.BuffIds {
348 name := fmt.Sprintf(`#%d`, bId)
349 if spec := buffs.GetBuffSpec(bId); spec != nil {
350 name = spec.Name
351 }
352 d.BuffNames = append(d.BuffNames, name)
353 }
354 return d
355}
356
357func GetPetCopy(petId string) Pet {
358 if petInfo, ok := petTypes[petId]; ok {

Callers 4

GetCharNodeMethod · 0.80
PetDailyTickFunction · 0.80
GrantFunction · 0.80
buildPetPanelFunction · 0.80

Calls 2

GetCurrentAbilityMethod · 0.95
GetBuffSpecFunction · 0.92

Tested by

no test coverage detected