查看: 2047|回复: 2

[已经过期] 求一个脚本

[复制链接]
梦石
0
星屑
1333
在线时间
204 小时
注册时间
2014-3-26
回帖
36
发表于 2015-4-26 20:49:13 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
关于技能升级方面的,不需要多复杂,我只想知道在VX里面的预设里有没有读取 技能使用次数的变量。

评分

参与人数 1星屑 +1 收起 理由
喵呜喵5 + 1 至少在RMVA的预设里是没有的

查看全部评分

梦石
0
星屑
90
在线时间
357 小时
注册时间
2006-3-3
回帖
163
发表于 2015-4-27 14:02:37 | 显示全部楼层
[pre lang="ruby"]
=begin
在可以升级的技能的备注栏里写上
下等级技能编号
升级经验
每次增加经验
例
下等级技能编号2
升级经验10
每次增加经验2
=end
class Game_Actor
  MULTISKILLS = true#true时可以同时学会高等级技能和低等级技能,
                    #false时候学会高等级技能后会遗忘低等级技能
  alias supersetup setup
  def setup(*args)
    supersetup(*args)
    @skillexp = {}
  end
  def addskillexp
    return unless @action.skill.updatable?
    @skillexp[@action.skill.id] = 0 if @skillexp[@action.skill.id].nil?
    @skillexp[@action.skill.id] += @action.skill.eachexp
    if @skillexp[@action.skill.id] >= @action.skill.maxexp
      return if @skills.include?(@action.skill.nextskillid)
      learn_skill(@action.skill.nextskillid)
      forget_skill(@action.skill.id) unless MULTISKILLS
      $game_message.new_page
      text = "技能" + @action.skill.name + "升级"
      $game_message.texts.push(text)
      text = "学会" + $data_skills[@action.skill.nextskillid].name
      $game_message.texts.push(text)
    end
  end
end
class Game_Enemy
  def addskillexp
  end
end
module RPG
  class Skill
    def updatable?
      @note =~ /下等级技能编号(\d+)/
      return !$1.nil?
    end
    def nextskillid
      @note =~ /下等级技能编号(\d+)/
      return $1.to_i
    end
    def maxexp
      @note =~ /升级经验(\d+)/
      return $1.to_i
    end
    def eachexp
      @note =~ /每次增加经验(\d+)/
      return $1.to_i
    end
  end
end
class Scene_Battle
  alias superexecute_action_skill execute_action_skill
  def execute_action_skill
    superexecute_action_skill
    @active_battler.addskillexp
  end
end
[/pre]

原帖:
https://rpg.blue/forum.php?mod=viewthread&tid=107835
回复

使用道具 举报

梦石
0
星屑
782
在线时间
3431 小时
注册时间
2011-6-10
回帖
6325
发表于 2015-4-28 10:27:04 | 显示全部楼层
VX有完整的技能树系统
长名公主玩家群:372588926 攻略娱乐应有尽有
了解更多新RM游戏,游戏制作请加入RPGmaker支援群:113622890
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部