赞 | 0 |
VIP | 1 |
好人卡 | 5 |
积分 | 1 |
经验 | 47515 |
最后登录 | 2024-9-13 |
在线时间 | 216 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 90
- 在线时间
- 216 小时
- 注册时间
- 2007-9-5
- 帖子
- 370
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 typhon_524 于 2009-12-4 14:52 编辑
下面这段脚本是加在 Scene_Map 里的,在地图上会用事件随时调用 $scene.attack,参照了这个链接里紫苏的优化改法,但是发现变量31没有累加,始终是0,为什么?- def attack
- $game_variables[31] = 0 # 火属性伤害归零
- $game_variables[32] = 0 # 冰属性伤害归零
- $game_variables[33] = 0 # 雷属性伤害归零
- $game_variables[34] = 0 # 水属性伤害归零
- $game_variables[35] = 0 # 土属性伤害归零
- $game_variables[36] = 0 # 风属性伤害归零
- $game_variables[37] = 0 # 光属性伤害归零
- $game_variables[38] = 0 # 暗属性伤害归零
-
- actor = $game_party.actors[0]
- weapon_id = actor.weapon_id
-
- weaped = weapon_id != 0
-
- weapon = $data_weapons[weapon_id]
-
- es = weapon.element_set
-
- # 主角的火属性武器的伤害累加
- $game_variables[31] += 10 if weaped and es.include?(1)
- for i in [31,35,39]
- $game_variables[31] += 2 if weaped and es.include?(i)
- end
- for i in [32,36,40]
- $game_variables[31] += 4 if weaped and es.include?(i)
- end
- for i in [33,37,41]
- $game_variables[31] += 6 if weaped and es.include?(i)
- end
- for i in [34,38,42]
- $game_variables[31] += 8 if weaped and es.include?(i)
- end
- ....................
- ..........
- .....
- ..........
- ..............
- ............
- .................
复制代码 |
|