赞 | 0 |
VIP | 1 |
好人卡 | 5 |
积分 | 1 |
经验 | 47515 |
最后登录 | 2024-9-13 |
在线时间 | 216 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 90
- 在线时间
- 216 小时
- 注册时间
- 2007-9-5
- 帖子
- 370
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 typhon_524 于 2009-12-2 15:12 编辑
下面这段脚本是加在 Scene_Map 里的,在地图上会用事件随时调用 $scene.defence ,但是写得很长,对游戏速度有一些影响,求教有没有提高游戏速度的脚本写法- def defence
- $game_variables[41] = 0 # 抗火属性归零
- $game_variables[42] = 0 # 抗冰属性归零
- $game_variables[43] = 0 # 抗雷属性归零
- $game_variables[44] = 0 # 抗水属性归零
- $game_variables[45] = 0 # 抗土属性归零
- $game_variables[46] = 0 # 抗风属性归零
- $game_variables[47] = 0 # 抗光属性归零
- $game_variables[48] = 0 # 抗暗属性归零
- for i in [32,36,40]
- $game_variables[41] += 4 if $game_party.actors[0].armor1_id != 0 and $data_armors[$game_party.actors[0].armor1_id].guard_element_set.include?(i)
- $game_variables[41] += 4 if $game_party.actors[0].armor2_id != 0 and $data_armors[$game_party.actors[0].armor2_id].guard_element_set.include?(i)
- $game_variables[41] += 4 if $game_party.actors[0].armor3_id != 0 and $data_armors[$game_party.actors[0].armor3_id].guard_element_set.include?(i)
- end
- for i in [33,37,41]
- $game_variables[41] += 6 if $game_party.actors[0].armor1_id != 0 and $data_armors[$game_party.actors[0].armor1_id].guard_element_set.include?(i)
- $game_variables[41] += 6 if $game_party.actors[0].armor2_id != 0 and $data_armors[$game_party.actors[0].armor2_id].guard_element_set.include?(i)
- $game_variables[41] += 6 if $game_party.actors[0].armor3_id != 0 and $data_armors[$game_party.actors[0].armor3_id].guard_element_set.include?(i)
- end
- for i in [34,38,42]
- $game_variables[41] += 8 if $game_party.actors[0].armor1_id != 0 and $data_armors[$game_party.actors[0].armor1_id].guard_element_set.include?(i)
- $game_variables[41] += 8 if $game_party.actors[0].armor2_id != 0 and $data_armors[$game_party.actors[0].armor2_id].guard_element_set.include?(i)
- $game_variables[41] += 8 if $game_party.actors[0].armor3_id != 0 and $data_armors[$game_party.actors[0].armor3_id].guard_element_set.include?(i)
- end
- $game_variables[42] += 10 if $game_party.actors[0].armor1_id != 0 and $data_armors[$game_party.actors[0].armor1_id].guard_element_set.include?(2)
- $game_variables[42] += 10 if $game_party.actors[0].armor2_id != 0 and $data_armors[$game_party.actors[0].armor2_id].guard_element_set.include?(2)
- $game_variables[42] += 10 if $game_party.actors[0].armor3_id != 0 and $data_armors[$game_party.actors[0].armor3_id].guard_element_set.include?(2)
- $game_variables[42] += 10 if $game_party.actors[0].armor4_id != 0 and $data_armors[$game_party.actors[0].armor4_id].guard_element_set.include?(2)
- $game_variables[42] += 10 if $game_party.actors[0].armor5_id != 0 and $data_armors[$game_party.actors[0].armor5_id].guard_element_set.include?(2)
- $game_variables[42] += 10 if $game_party.actors[0].armor6_id != 0 and $data_armors[$game_party.actors[0].armor6_id].guard_element_set.include?(2)
- for i in [43,47,51]
- $game_variables[42] += 2 if $game_party.actors[0].armor1_id != 0 and $data_armors[$game_party.actors[0].armor1_id].guard_element_set.include?(i)
- $game_variables[42] += 2 if $game_party.actors[0].armor2_id != 0 and $data_armors[$game_party.actors[0].armor2_id].guard_element_set.include?(i)
- $game_variables[42] += 2 if $game_party.actors[0].armor3_id != 0 and $data_armors[$game_party.actors[0].armor3_id].guard_element_set.include?(i)
- end
- for i in [44,48,52]
- $game_variables[42] += 4 if $game_party.actors[0].armor1_id != 0 and $data_armors[$game_party.actors[0].armor1_id].guard_element_set.include?(i)
- $game_variables[42] += 4 if $game_party.actors[0].armor2_id != 0 and $data_armors[$game_party.actors[0].armor2_id].guard_element_set.include?(i)
- $game_variables[42] += 4 if $game_party.actors[0].armor3_id != 0 and $data_armors[$game_party.actors[0].armor3_id].guard_element_set.include?(i)
- .............................
- ....................................
- .................
- ............................
- ............
- .............................
复制代码 |
|