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

Method HandsRequired

internal/characters/character.go:779–803  ·  view source on GitHub ↗
(i items.Item)

Source from the content-addressed store, hash-verified

777}
778
779func (c *Character) HandsRequired(i items.Item) int {
780
781 if i.ItemId < 1 {
782 return 0
783 }
784
785 iSpec := i.GetSpec()
786
787 // Shooting weapnos don't benefit from creature size
788 // when determining how many hands they require
789 if iSpec.Subtype == items.Shooting {
790 return iSpec.Hands
791 }
792
793 raceInfo := races.GetRace(c.GetRaceId())
794 if raceInfo.Size == races.Large {
795 return 1
796 }
797
798 if raceInfo.Size == races.Small {
799 return iSpec.Hands + 1
800 }
801
802 return iSpec.Hands
803}
804
805// Copies over an existing item with a new item
806// Returns true if successfully replaces an item

Callers 3

ValidateMethod · 0.95
BestUpgradesMethod · 0.95
WearMethod · 0.95

Calls 3

GetRaceIdMethod · 0.95
GetRaceFunction · 0.92
GetSpecMethod · 0.45

Tested by

no test coverage detected