Exemplo n.º 1
0
func newItem(ik *ItemKind, owner Activer, amount ...interface{}) Itemer {
	var i Itemer = nil
	switch ik.class {
	case consts.ITEM_CLASS_CONSUMABLE:
		i = newConsumableItem(ik, owner, amount[0].(int))
	case consts.ITEM_CLASS_GARMENT:
		if ik.itemType == consts.ITEM_T_EXPENDABLE {
			i = &ExpandableItem{newStackItem(ik, owner, amount[0].(int)), false}
		} else {
			garment := GarmentItem{newBaseItem(ik, owner), false}
			if ik.itemType == consts.ITEM_T_WEAPON {
				i = &WeaponItem{garment, fightBase.CreateDmgDescription(ik.power)}
			} else {
				i = &garment
			}
		}
	}
	return i
}
Exemplo n.º 2
0
func InitWeapons() {
	weapons[consts.FIST_WEAP] = &FistWeap{BaseWeap{fightBase.NewBaseBlow(fightBase.BM_HIT, 1.0, "hit"), fightBase.CreateDmgDescription("25d4")}}
}