赞 | 642 |
VIP | 62 |
好人卡 | 144 |
积分 | 321 |
经验 | 110435 |
最后登录 | 2024-5-20 |
在线时间 | 5083 小时 |
Lv5.捕梦者
- 梦石
- 0
- 星屑
- 32114
- 在线时间
- 5083 小时
- 注册时间
- 2012-11-19
- 帖子
- 4877
|
这样?
- #==============================================================================
- class Game_Temp
- #--------------------------------------------------------------------------
- def in_battle=(state)
- last_state = @in_battle
- @in_battle = state
- last_state != @in_battle && clear_actors_now_atk_times
- end
- #--------------------------------------------------------------------------
- # 清除角色当前战斗的普攻计数。
- def clear_actors_now_atk_times
- $game_party.actors.each{ |actor| actor.clear_now_normal_atk_times }
- end
- end
- #==============================================================================
- class Game_Battler
- #--------------------------------------------------------------------------
- def normal_atk_data
- return @normal_atk_data || {:now=>0,:total=>0}
- end
- #--------------------------------------------------------------------------
- # 获取战斗对象的普攻计数。
- # type :类型。包括当前战斗中普攻次数与所有战斗普攻次数总数。参数类型=>字符串。
- # 当前战斗中普攻次数: "now"
- # 所有战斗普攻次数总数: "total"
- # 获取: 某角色(actor)当前战斗中普攻次数 => actor.normal_atk_times("now")
- # 某角色(actor)所有战斗普攻次数总数 => actor.normal_atk_times("total")
- # 敌人同上。
- #--------------------------------------------------------------------------
- def normal_atk_times(type)
- return normal_atk_data[type.to_sym] || 0
- end
- #--------------------------------------------------------------------------
- def normal_atk_on_count
- @normal_atk_data ||= {:now=>0,:total=>0}
- @normal_atk_data.keys.each{ |key| @normal_atk_data[key] += 1 }
- end
- #--------------------------------------------------------------------------
- def clear_now_normal_atk_times
- @normal_atk_data[:now] = 0 if @normal_atk_data
- end
- #--------------------------------------------------------------------------
- alias normal_atk_attack_effect attack_effect
- def attack_effect(attacker)
- attacker.normal_atk_on_count
- return normal_atk_attack_effect(attacker)
- end
- end
- #==============================================================================
复制代码 |
评分
-
查看全部评分
|