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

Method RemoveFromBody

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

Source from the content-addressed store, hash-verified

2106}
2107
2108func (c *Character) RemoveFromBody(i items.Item) bool {
2109
2110 for _, slot := range AllSlots() {
2111 if i.Equals(*c.Equipment.Get(slot)) {
2112 if i.IsRemoveLocked() && c.Health > 0 {
2113 return false
2114 }
2115 c.Equipment.Set(slot, items.Item{})
2116 c.reapplyPermabuffs(i)
2117 return true
2118 }
2119 }
2120
2121 return false
2122}
2123
2124// Used with SpawnInfo to gift spawning mobs with permabuffs
2125func (c *Character) SetPermaBuffs(buffIds []int) {

Callers 7

takeItemFromUserFunction · 0.80
RemoveFunction · 0.80
handlePlayerCombatFunction · 0.80
handleMobCombatFunction · 0.80
RemoveFunction · 0.80
DisarmFunction · 0.80
GetFunction · 0.80

Calls 6

reapplyPermabuffsMethod · 0.95
AllSlotsFunction · 0.85
EqualsMethod · 0.80
IsRemoveLockedMethod · 0.80
SetMethod · 0.65
GetMethod · 0.45

Tested by

no test coverage detected