feat(gameplay): 实现空间掉落物品系统 - 在Space结构体中添加DropItemIds字段存储掉落物品配置 - 添加GetDrop方法用于随机获取掉落物品 - 将战斗怪物掉落逻辑从地图服务改为使用空间服务 - 修复屏幕会话中断信号配置为^C BREAKING CHANGE: 掉落物品逻辑从地图服务迁
This commit is contained in:
@@ -184,11 +184,9 @@ func (Controller) OnPlayerFightNpcMonster(data1 *fight.FightNpcMonsterInboundInf
|
||||
|
||||
}
|
||||
if p.CanGetItem() {
|
||||
mapinfo := service.NewMapService().GetData(p.Info.MapID)
|
||||
|
||||
if len(mapinfo.DropItemIds) > 0 {
|
||||
|
||||
item := int64(mapinfo.DropItemIds[grand.Intn(len(mapinfo.DropItemIds))])
|
||||
item := p.GetSpace().GetDrop()
|
||||
if item != 0 {
|
||||
count := int64(grand.Intn(2) + 1)
|
||||
ok := p.ItemAdd(item, count)
|
||||
if ok {
|
||||
|
||||
Reference in New Issue
Block a user