赞 | 0 |
VIP | 298 |
好人卡 | 70 |
积分 | 8 |
经验 | 135648 |
最后登录 | 2018-10-11 |
在线时间 | 6267 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 799
- 在线时间
- 6267 小时
- 注册时间
- 2006-6-7
- 帖子
- 8462
|
- class Game_Party
-
- def gain_weapon(weapon_id, n)
- if weapon_id > 0
- # 商店购买 或 装备栏中卸下的武器不进行随机处理~
-
-
- if $scene.is_a?(Scene_Map) or $scene.is_a?(Scene_Shop)
- @weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, 99].min
- else
- # 随机浮动范围~★★★★★★★
- add_atk = rand(200)-60
- if add_atk == 0
- @weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, 99].min
- else
- now = 0
- # 判断数据库中是否已经有 相同属性的武器~
- for i in weapon_id...$data_weapons.size
- if $data_weapons[i].atk == $data_weapons[weapon_id].atk+add_atk and
- ($data_weapons[i].name.split('+')[0] == $data_weapons[weapon_id].name or $data_weapons[i].name.split('-')[0] == $data_weapons[weapon_id].name)
- now = i
- break
- end end
- if now == 0
- # 无相同属性时则 重新生成~
- new_weapon = $data_weapons[weapon_id].clone
- new_weapon.id = $data_weapons.size
- if add_atk<0
- new_weapon.name = $data_weapons[weapon_id].name+"-"+add_atk.abs.to_s
- else
- new_weapon.name = $data_weapons[weapon_id].name+"+"+add_atk.abs.to_s
- end
- new_weapon.atk = $data_weapons[weapon_id].atk+add_atk
- $data_weapons.push(new_weapon)
- # 职业可装备武器数组更新~
- for i in 1...$data_classes.size
- if $data_classes[i].weapon_set.include?(weapon_id)
- $data_classes[i].weapon_set.push(new_weapon.id)
- end
- end
- # 增加武器~
- @weapons[new_weapon.id] = [[weapon_number(new_weapon.id) + n, 0].max, 99].min
- else
- # 有相同属性则直接 增加武器~
- @weapons[now] = [[weapon_number(now) + n, 0].max, 99].min
- end
- end
- end
- end
- end
-
- def lose_weapon(weapon_id, n)
- if weapon_id > 0
- @weapons[weapon_id] = [[weapon_number(weapon_id) - n, 0].max, 99].min
- end
- end
-
- end
复制代码 夏娜姐姐写的,这是仅仅是add_atk 你可以自己试着摸索 |
评分
-
查看全部评分
|