赞 | 5 |
VIP | 620 |
好人卡 | 38 |
积分 | 69 |
经验 | 125468 |
最后登录 | 2015-7-27 |
在线时间 | 1666 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 6855
- 在线时间
- 1666 小时
- 注册时间
- 2008-10-29
- 帖子
- 6710
|
- module Hzhj
- module_function
- @@hzhj_one = {57=>4,58=>3,59=>2,60=>1}
- @@hzhj_all = {58=>4,59=>3}
- @@hzhj_all_count = {}
- def one
- return @@hzhj_one
- end
- def all
- return @@hzhj_all
- end
- def count
- return @@hzhj_all_count
- end
- end
- class Game_Actor < Game_Battler
- attr_reader :hzhj_skill_count
- alias hzhj_old_hzhj_skill_count_initialize initialize
- def initialize(*args)
- @hzhj_skill_count = {}
- hzhj_old_hzhj_skill_count_initialize(*args)
- end
- alias hzhj_old_hzhj_skill_count_skill_can_use? skill_can_use?
- def skill_can_use?(skill_id)
- if Hzhj.all[skill_id] != nil
- if Hzhj.count[skill_id] != nil
- if Hzhj.count[skill_id] >= Hzhj.all[skill_id]
- return false
- end
- end
- end
- if Hzhj.one[skill_id] != nil
- if @hzhj_skill_count[skill_id] != nil
- if @hzhj_skill_count[skill_id] >= Hzhj.one[skill_id]
- return false
- end
- end
- end
- return hzhj_old_hzhj_skill_count_skill_can_use?(skill_id)
- end
- end
- class Game_Battler
- alias hzhj_old_hzhj_skill_count_skill_effect skill_effect
- def skill_effect(*args)
- if $game_temp.in_battle
- user = args[0]
- if user.is_a?(Game_Actor)
- skill = args[1]
- if Hzhj.all[skill.id] != nil
- if Hzhj.count[skill.id].nil?
- Hzhj.count[skill.id] = 1
- else
- Hzhj.count[skill.id] += 1
- end
- end
- if Hzhj.one[skill.id] != nil
- if user.hzhj_skill_count[skill.id].nil?
- user.hzhj_skill_count[skill.id] = 1
- else
- user.hzhj_skill_count[skill.id] += 1
- end
- end
- end
- end
- return hzhj_old_hzhj_skill_count_skill_effect(*args)
- end
- end
- class Scene_Battle
- alias hzhj_old_hzhj_skill_count_main main
- def main
- Hzhj.count.clear
- for actor in $game_party.actors
- actor.hzhj_skill_count.clear
- end
- hzhj_old_hzhj_skill_count_main
- end
- end
复制代码 开头的这一行
@@hzhj_one = {57=>4,58=>3,59=>2,60=>1}
里面的57 58 59 60 是技能ID
里面的 4 3 2 1 是该技能在每场战斗中每个角色可以使用的次数.是针对某个角色.
再看下面的这一行.
@@hzhj_all = {58=>4,59=>3}
里面的58 59 是技能的ID
里面的 4 3 是该技能在每场战斗中所有角色加起来可以使用的次数.
自己照着格式改照着格式添吧.
这段脚本只对角色有效.默认战斗系统测试了下没发现问题.别的就不知道了. |
评分
-
查看全部评分
|