本帖最后由 soulsaga 于 2019-10-23 12:20 编辑
class Game_Battler attr_accessor :skill_count # skill_count # 技能次数 alias 技能次数初始化 initialize def initialize 技能次数初始化 #@skill_count = {} end #-------------------------------------------------------------------------- # ● 返回技能次数哈希表 #-------------------------------------------------------------------------- def skill_count return @skill_count || {} end end #============================================================================== class Scene_Battle #-------------------------------------------------------------------------- alias 技能结果 make_skill_action_result def make_skill_action_result 技能结果 count = @active_battler.is_a?(Game_Actor) ? @active_battler.skill_usage_count(@skill.id) : 0 @active_battler.increase_skill_use_times(@skill.id) if @active_battler.is_a?(Game_Actor) #p @active_battler.skill_usage_count(@skill.id)*10 #p $game_actors[1].skill_usage_count(57) end end #============================================================================== class Game_Actor attr_accessor :skill_use_data# 技能次数 #-------------------------------------------------------------------------- def skill_use_data return @skill_use_data || {} end #-------------------------------------------------------------------------- def skill_usage_count(skill_id) return skill_use_data[skill_id] || 0 end #-------------------------------------------------------------------------- def increase_skill_use_times(skill_id, n=nil) @skill_use_data ||= {} count = skill_usage_count(skill_id) @skill_use_data[skill_id] = [count + (n || 1), 0].max end end #==============================================================================
class Game_Battler
attr_accessor :skill_count # skill_count # 技能次数
alias 技能次数初始化 initialize
def initialize
技能次数初始化
#@skill_count = {}
end
#--------------------------------------------------------------------------
# ● 返回技能次数哈希表
#--------------------------------------------------------------------------
def skill_count
return @skill_count || {}
end
end
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
alias 技能结果 make_skill_action_result
def make_skill_action_result
技能结果
count = @active_battler.is_a?(Game_Actor) ? @active_battler.skill_usage_count(@skill.id) : 0
@active_battler.increase_skill_use_times(@skill.id) if @active_battler.is_a?(Game_Actor)
#p @active_battler.skill_usage_count(@skill.id)*10
#p $game_actors[1].skill_usage_count(57)
end
end
#==============================================================================
class Game_Actor
attr_accessor :skill_use_data# 技能次数
#--------------------------------------------------------------------------
def skill_use_data
return @skill_use_data || {}
end
#--------------------------------------------------------------------------
def skill_usage_count(skill_id)
return skill_use_data[skill_id] || 0
end
#--------------------------------------------------------------------------
def increase_skill_use_times(skill_id, n=nil)
@skill_use_data ||= {}
count = skill_usage_count(skill_id)
@skill_use_data[skill_id] = [count + (n || 1), 0].max
end
end
#==============================================================================
我改了一下芯大的脚本..应该好使了吧..用群体攻击也只加1次 |