Exemplo n.º 1
0
func (gigi *gameItemGen) GenItem(owner Activer) Itemer {
	var amount int = 1
	if gigi.item_kind.class == consts.ITEM_CLASS_CONSUMABLE || gigi.item_kind.itemType == consts.ITEM_T_EXPENDABLE {
		amount = utils.Randint0(150) + 1
	}
	return newItem(gigi.item_kind, owner, amount)
}
Exemplo n.º 2
0
func (m *Mob) createDrop(depth int64) {
	var (
		created_d     = 0
		number    int = m.Kind.CreateDropCount()
	)
	number = 4
	if gens, has_gens := gameObjectsBase.ItemGens(depth); has_gens {
		for _, gen := range *gens {
			r := utils.Randint0(100)
			if r >= gen.Probability() {
				continue
			}
			created_d++
			m.AddItem(gen.GenItem(m))
			if created_d == number {
				break
			}
		}
	}
}