查看: 11398|回复: 14

[RMVA发布] 称号震慑系统、

[复制链接]
梦石
0
星屑
2284
在线时间
744 小时
注册时间
2010-9-6
回帖
297
发表于 2014-7-11 14:49:01 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 804173948 于 2014-7-12 12:52 编辑

好像一直都没什么脚本关于称号这方面(如果有原谅我见识短浅、、、)
这是在做游戏时、、突然想到的系统-、
于是从“百忙”之中抽出了一段时间写了出来-、、、(由于某脚本的影响已经好久没接触过RM的默认界面了、、所以界面弄得不好额- -)

进入正题、、这系统作用就是通过更换称号来实现震慑的效果、、
简单地说就是增加了“震慑力”、“震慑抵抗力”这两个属性(角色与敌人都拥有)
所谓震慑效果就是向对方发起攻击时或被对方攻击时按一定比例减少对方属性
而震慑抵抗力能够减缓或者无视对方的震慑、之类的。

以下是称号更换界面(界面不好看请谅解- 、有时间再优化。。。有急需的联系QQ。。)、、
称号震慑系统 1.png

称号震慑系统 2.png

称号震慑系统 3.png

战斗界面还是默认的那个-、
称号震慑系统 4.png


脚本
[pre lang="ruby" line="1"]=begin
================================================
称号震慑系统 版本 1.0 By 804173948 QQ:同上
================================================
  更新:
    2014-7-11
      发布
   
  注意:
    本脚本编写时间仓促-、难免会有疏漏
   
  简介:
    顾名思义,本系统通过更换称号实现对敌人的震慑作用
    同时敌人也可以对角色产生震慑作用
    如果喜欢,你也可以使某角色一开始就拥有一定的震慑力
   
    所谓震慑作用,是在a对b发起攻击时,若他们(a对b或b对a)之间有震慑力,
    则会使对方在 发动攻击 或者 被攻击 的那一瞬间基本能力(mhp,mmp除外)降低一定百分比
   
    同时,角色与敌人也有震慑抵抗力这个属性,能够减弱或无视对方的震慑
   
  使用说明:
    1、角色/敌人备注填写:
   
      1、[SP 数值]
        说明:震慑力,取值为 -100~100(为负数就是起不到震慑作用反而使对方能力上升)
        默认为 0
        如:[SP 30]
            [SP -5]
            
      2、[SD 数值]
        说明:震慑抵抗力,取值为 -100~100(为负数就是起不到震慑抵抗作用反而使对方震慑力上升)
        默认为 0
        如:[SD 30]
            [SD -5]
            
    2、角色备注填写:
      
      1、[IN 数值]
        说明:角色的初始称号,后面数值表示 称号 id
        默认为 -1 (即无称号)
        如:[IN 0]
            [IN 3]
      
    3、其他(用于 事件-脚本 ):
      获得称号:
        $game_actors[id].add_nicknames(nickname_id)
        id => 角色 id
        nickname_id => 称号 id
        
      强制放弃称号:
        $game_actors[id].del_nicknames(nickname_id)
        id => 角色 id
        nickname_id => 称号 id
        
      强制装备称号:
        $game_actors[id].set_nickname(nickname_id)
        id => 角色 id
        nickname_id => 称号 id
        
      强制卸下称号:
        $game_actors[id].del_nickname
        id => 角色 id
        
      增加人物震慑力(理论上还可以在战斗中用此方法增加敌人震慑力,来营造士气上升的效果)
        $game_actors[id].add_shock_point(value)
        id => 角色 id
        value => 增加数值(负值为减少)
        PS:其实这里可以不用考虑震慑力范围的
        
      增加人物震慑抵抗力(理论上还可以在战斗中用此方法增加敌人震慑抵抗力,来营造士气上升的效果)
        $game_actors[id].add_shock_def(value)
        id => 角色 id
        value => 增加数值(负值为减少)
        PS:其实这里可以不用考虑震慑力范围的
        
      增加敌人震慑力(战斗中)
        $game_troop.members[id].add_shock_point(value)
        id => 群组中怪物 id
        value => 增加数值(负值为减少)
        PS:其实这里可以不用考虑震慑力范围的
        
      增加敌人震慑抵抗力(战斗中)
        $game_troop.members[id].add_shock_def(value)
        id => 群组中怪物 id
        value => 增加数值(负值为减少)
        PS:其实这里可以不用考虑震慑力范围的
        
      称号更换界面呼叫方法:
        
        SceneManager.call(Scene_Nicknames)

  冲突与BUG:
  
    本脚本编写时间仓促-、难免会有冲突与BUG
  
=end
#==============================================================================
# ■ ShockSystem
#------------------------------------------------------------------------------
#  常量设置
#==============================================================================
module ShockSystem
  # 人物称号设置
  NickNames = {
  # 称号名称
  :name => ["预言之子","预言之孙子","国家炼金术师","海贼王","一米六","铠之巨人","忍术之神","七武海","八武海"],
  # 称号描述
  :description => ["预言的儿子",
  "预言之子的儿子",
  "也被称为军队的走狗",
  "拥有世上一切财富、声望和权利的标志",
  "人类最强兵器",
  "不详",
  "就是会很多忍术lo-、",
  "王下七武海之一",
  "没八武海这个称号",
  ],
  # 称号颜色
  :color => [Color.new(255,128,128),
  Color.new(64,64,255),
  Color.new(255,0,0),
  Color.new(176,176,176),
  Color.new(128,128,255),
  Color.new(255,0,255),
  Color.new(128,255,128),
  Color.new(255,255,128),
  Color.new(128,128,128)],
  # 图标(ID)
  :icon => [14,12,501,523,387,121,143,523,99],
  # 震慑力(范围为 -100~100 )
  :shock => [20,2,15,70,50,15,60,30,-50],
  # 震慑抵抗力(范围为 -100~100 )
  :shock_def => [50,100,15,100,30,25,100,60,-10]
  }
  # 敌人/角色震慑力标志
  ShockPointFlag = "SP"

  # 敌人/角色震慑抵抗力标志
  ShockDefFlag = "SD"
  
  # 角色初始称号标志
  InitNickname = "IN"
end
#==============================================================================
# ■
#------------------------------------------------------------------------------
#  内部定义
#==============================================================================
class RPG::BaseItem
  def shock_point
    if /\[#{ShockSystem::ShockPointFlag} (\d+)\]/ =~ @note
      return $1.to_i
    elsif /\[#{ShockSystem::ShockPointFlag} (\d+)\]/ =~ @note
      return -($1.to_i)
    else
      return 0
    end
  end
  def shock_def
    if /\[#{ShockSystem::ShockDefFlag} (\d+)\]/ =~ @note
      return $1.to_i
    elsif /\[#{ShockSystem::ShockDefFlag} -(\d+)\]/ =~ @note
      return -($1.to_i)
    else
      return 0
    end
  end
end
class RPG::Actor < RPG::BaseItem
  def nickname
    if /\[#{ShockSystem::InitNickname} (\d+)\]/ =~ @note
      return $1.to_i
    else
      return -1
    end
  end
end
class Game_BattlerBase
  
  def shock_point               # 震慑力
    @shock_point = 0 unless @shock_point
    return [[@shock_point,100].min,-100].max
  end
  
  def shock_def                 # 震慑抵抗力
    @shock_def = 0 unless @shock_def
    return [[@shock_def,100].min,-100].max
  end
  
  def add_shock_point(value)
    @shock_point += value
  end
  def add_shock_def(value)
    @shock_def += value
  end
end
class Game_Battler
  #--------------------------------------------------------------------------
  # ● 计算最终震慑力
  #--------------------------------------------------------------------------
  def make_finally_shock_point(user)
    usp = user.shock_point
    usd = user.shock_def
    ssp = self.shock_point
    ssd = self.shock_def
    if ssp > 0
      ssp *= 1-(usd / 100.0)
    end
    if usp > 0
      usp *= 1-(ssd / 100.0)
    end
    us = usp
    ss = ssp
    return ss,us
  end
  #--------------------------------------------------------------------------
  # ● 更改能力值
  #--------------------------------------------------------------------------
  def change_param(user,shock_point,param_id)
    if user.is_a?(Game_Actor)
      user.class.params[param_id, user.level] *= 1-(shock_point / 100.0)
    elsif user.is_a?(Game_Enemy)
      user.enemy.params[param_id] *= 1-(shock_point / 100.0)
    end
  end
  #--------------------------------------------------------------------------
  # ● 重置能力值
  #--------------------------------------------------------------------------
  def reset_param(user,old_param,param_id)
    if user.is_a?(Game_Actor)
      user.class.params[param_id, user.level] = old_param
    elsif user.is_a?(Game_Enemy)
      user.enemy.params[param_id] = old_param
    end
  end
  #--------------------------------------------------------------------------
  # ● 计算伤害
  #--------------------------------------------------------------------------
  alias old_make_damage_value make_damage_value
  def make_damage_value(user, item)
    if !item.damage.recover?
      # ss => 被攻击者对攻击者的震慑力
      # us => 攻击者对被攻击者的震慑力
      ss,us = make_finally_shock_point(user)
      
      up = []
      sp = []
   
      6.times do |i|
        up.push(user.param(i+2))
        sp.push(self.param(i+2))
        change_param(user,ss,i+2)
        change_param(self,us,i+2)
      end
    end
   
    old_make_damage_value(user, item)
   
    if !item.damage.recover?
      6.times do |i|
        reset_param(user,up,i+2)
        reset_param(self,sp,i+2)
      end
    end
  end
end
class Game_Actor
  attr_reader :nicknames                 # 获得的称号
  #--------------------------------------------------------------------------
  # ● 设置
  #--------------------------------------------------------------------------
  alias old_setup setup
  def setup(actor_id)
    old_setup(actor_id)
    @nicknames = []
    @shock_point = actor.shock_point
    @shock_def = actor.shock_def
    set_nickname(@nickname)
  end
  def add_nicknames(id)
    @nicknames.push(id) if !@nicknames.include?(id)
  end
  def del_nicknames(id)
    del_nickname if @nickname == id
    @nicknames.delete(id) if @nicknames.include?(id)
  end
  def set_nickname(id)
    return unless id >= 0
    add_nicknames(id) unless @nicknames.include?(id)
    @nickname = id
    @shock_point += ShockSystem::NickNames[:shock][@nickname]
    @shock_def += ShockSystem::NickNames[:shock_def][@nickname]
  end
  def del_nickname
    return unless @nickname >= 0
    @shock_point -= ShockSystem::NickNames[:shock][@nickname]
    @shock_def -= ShockSystem::NickNames[:shock_def][@nickname]
    @nickname = -1
  end
end
class Game_Enemy
  alias old_initialize initialize
  def initialize(index, enemy_id)
    old_initialize(index, enemy_id)
    @shock_point = enemy.shock_point
    @shock_def = enemy.shock_def
  end
end
class Window_Base
  #--------------------------------------------------------------------------
  # ● 绘制称号
  #--------------------------------------------------------------------------
  def draw_actor_nickname(actor, x, y, width = 180)
    return unless actor
    draw_nickname(actor.nickname, x, y, width)
  end
  #--------------------------------------------------------------------------
  # ● 绘制称号
  #--------------------------------------------------------------------------
  def draw_nickname(id, x, y, width = 180)
    return unless id > -1
    draw_icon(ShockSystem::NickNames[:icon][id], x, y)
    change_color(ShockSystem::NickNames[:color][id])
    draw_text(x + 24, y, width, line_height, ShockSystem::NickNames[:name][id])
  end
  #--------------------------------------------------------------------------
  # ● 绘制填充矩形 (thick => Line 厚度)
  #--------------------------------------------------------------------------
  def draw_fill_rect(rect, fill_color, line_color = Color.new(255,255,255), thick = 1)
    contents.fill_rect(rect, fill_color)
    fill_out_line(rect,line_color, thick)
  end
  #--------------------------------------------------------------------------
  # ● 描绘边框
  #--------------------------------------------------------------------------
  def fill_out_line(rect,color = Color.new(255,255,255), thick = 1)
    x = rect.x
    y = rect.y
    width = rect.width
    height= rect.height
    for i in 1..thick
      contents.draw_line(x-i,y-i,x-i,y+height, color)
      contents.draw_line(x-i,y-i,x+width,y-i,  color)
      contents.draw_line(x+width,y-i,x+width,y+height, color)
      contents.draw_line(x-i,y+height,x+width,y+height,color)
    end
  end
end
class Window_Status
  #--------------------------------------------------------------------------
  # ● 绘制区域 1
  #--------------------------------------------------------------------------
  def draw_block1(y)
    draw_actor_name(@actor, 4, y)
    draw_actor_class(@actor, 128, y)
    draw_actor_nickname(@actor, 248, y)
  end
end
class Window_MenuCommand
  #--------------------------------------------------------------------------
  # ● 向指令列表添加主要的指令
  #--------------------------------------------------------------------------
  def add_main_commands
    add_command(Vocab::item,   :item,   main_commands_enabled)
    add_command(Vocab::skill,  :skill,  main_commands_enabled)
    add_command(Vocab::equip,  :equip,  main_commands_enabled)
    add_command(Vocab::status, :status, main_commands_enabled)
    add_command("更换称号",  :nicknames, main_commands_enabled)
  end
end
class Scene_Menu
  #--------------------------------------------------------------------------
  # ● 生成指令窗口
  #--------------------------------------------------------------------------
  alias old_create_command_window create_command_window
  def create_command_window
    old_create_command_window
    @command_window.set_handler(:nicknames, method(:command_nicknames))
  end
  #--------------------------------------------------------------------------
  # ● 指令“更换称号”
  #--------------------------------------------------------------------------
  def command_nicknames
    SceneManager.call(Scene_Nicknames)
  end
end
#==============================================================================
# ■ Window_NicknameSelect
#------------------------------------------------------------------------------
#  称号选择窗口
#==============================================================================
class Window_NicknameSelect < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height,actor)
    super(x, y, width, height)
    @actor = actor
    @data = []
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 设置角色
  #--------------------------------------------------------------------------
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 获取项目数
  #--------------------------------------------------------------------------
  def item_max
    @data ? @data.size : 0
  end
  #--------------------------------------------------------------------------
  # ● 获取物品
  #--------------------------------------------------------------------------
  def item
    @data && index >= 0 ? @data[index] : nil
  end
  #--------------------------------------------------------------------------
  # ● 生成物品列表
  #--------------------------------------------------------------------------
  def make_item_list
    @data = @actor.nicknames
  end
  #--------------------------------------------------------------------------
  # ● 返回上一个选择的位置
  #--------------------------------------------------------------------------
  def select_last
    select(@data.index($game_party.last_item.object) || 0)
  end
  #--------------------------------------------------------------------------
  # ● 绘制项目
  #--------------------------------------------------------------------------
  def draw_item(index)
    id = @data[index]
    if id
      rect = item_rect(index)
      rect.width -= 4
      draw_nickname(id, rect.x, rect.y,156)
    end
  end
  #--------------------------------------------------------------------------
  # ● 更新帮助内容
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_item(item)
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    make_item_list
    create_contents
    draw_all_items
    @index = 0
  end
end

#==============================================================================
# ■ Window_NicknameInfo
#------------------------------------------------------------------------------
#  显示称号信息窗口。
#==============================================================================

class Window_NicknameInfo < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(x,y,width,height,actor)
    super(x,y,width,height)
    @actor = actor
    refresh
    activate
  end
  #--------------------------------------------------------------------------
  # ● 设置角色
  #--------------------------------------------------------------------------
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 绘制水平线
  #--------------------------------------------------------------------------
  def draw_horz_line(y)
    line_y = y + line_height / 2 - 1
    contents.fill_rect(0, line_y, contents_width, 2, line_color)
  end
  #--------------------------------------------------------------------------
  # ● 获取水平线的颜色
  #--------------------------------------------------------------------------
  def line_color
    color = normal_color
    color.alpha = 48
    color
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_block1(0)
    draw_block2(2,line_height)
    draw_horz_line(line_height * 3)
  end
  #--------------------------------------------------------------------------
  # ● 绘制区域 1
  #--------------------------------------------------------------------------
  def draw_block1(y)
    draw_actor_name(@actor, 4, y)
    draw_actor_class(@actor, 128, y)
    draw_actor_nickname(@actor, 248, y)
  end
  #--------------------------------------------------------------------------
  # ● 绘制区域 2
  #--------------------------------------------------------------------------
  def draw_block2(x,y)
    change_color(system_color)
    draw_text(x, y, 160,line_height,"震慑力")
    draw_text(x, y+line_height, 160,line_height,"震慑抵抗力")
   
    change_color(normal_color)
    draw_text(x+132, y, 128,line_height,@actor.shock_point)
    draw_text(x+132, y+line_height, 128,line_height,@actor.shock_def)
   
    rect = Rect.new(x+176,y+1,width - 222,line_height-2)
    draw_fill_rect(rect, Color.new(0,0,0))
    color1 = Color.new(0,255,0)
    color2 = Color.new(0,0,255)
    value = @actor.shock_point
    if value < 0
      value = -value
      color1 = Color.new(255,0,0)
      color2 = Color.new(255,255,0)
    end
    rect.width = (rect.width*(value / 100.0)).to_i
    contents.gradient_fill_rect(rect,color1,color2)
   
    rect = Rect.new(x+176,y+line_height+1,width - 222,line_height-2)
    draw_fill_rect(rect, Color.new(0,0,0))
    color1 = Color.new(0,255,0)
    color2 = Color.new(128,128,128)
    value = @actor.shock_def
    if value < 0
      value = -value
      color1 = Color.new(255,0,0)
      color2 = Color.new(128,128,128)
    end
    rect.width = (rect.width*(value / 100.0)).to_i
    contents.gradient_fill_rect(rect,color1,color2)
  end
  #--------------------------------------------------------------------------
  # ● 绘制能力
  #--------------------------------------------------------------------------
  def draw_parameters(x, y, id)
    draw_nickname(id, x, y)

    change_color(system_color)
    draw_text(x, y+line_height, 160,line_height,"震慑力")
    draw_text(x, y+line_height*2, 160,line_height,"震慑抵抗力")
   
    change_color(normal_color)
    draw_text(x+132, y+line_height, 128,line_height,ShockSystem::NickNames[:shock][id])
    draw_text(x+132, y+line_height*2, 128,line_height,ShockSystem::NickNames[:shock_def][id])
   
    rect = Rect.new(x+176,y+line_height+1,width - 222,line_height-2)
    draw_fill_rect(rect, Color.new(0,0,0))
    color1 = Color.new(0,255,0)
    color2 = Color.new(0,0,255)
    value = ShockSystem::NickNames[:shock][id]
    if value < 0
      value = -value
      color1 = Color.new(255,0,0)
      color2 = Color.new(255,255,0)
    end
    rect.width = (rect.width*(value / 100.0)).to_i
    contents.gradient_fill_rect(rect,color1,color2)
   
    rect = Rect.new(x+176,y+line_height*2+1,width - 222,line_height-2)
    draw_fill_rect(rect, Color.new(0,0,0))
    color1 = Color.new(0,255,0)
    color2 = Color.new(128,128,128)
    value = ShockSystem::NickNames[:shock_def][id]
    if value < 0
      value = -value
      color1 = Color.new(255,0,0)
      color2 = Color.new(128,128,128)
    end
    rect.width = (rect.width*(value / 100.0)).to_i
    contents.gradient_fill_rect(rect,color1,color2)

  end
  #--------------------------------------------------------------------------
  # ● 绘制说明
  #--------------------------------------------------------------------------
  def draw_description(x, y, id)
    draw_text_ex(x, y, ShockSystem::NickNames[:description][id],contents_width - 2*x)
  end
  #--------------------------------------------------------------------------
  # ● 绘制说明
  #--------------------------------------------------------------------------
  def set_item(id)
    contents.clear
    refresh
    if id
      draw_parameters(2, line_height * 4, id)
      draw_horz_line(line_height * 8)
      draw_description(2, line_height * 9,id)
    end
  end
end

#==============================================================================
# ■ Window_NicknameCommand
#------------------------------------------------------------------------------
#  称号指令画面
#==============================================================================
class Window_NicknameCommand < Window_Command
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(x, y, width)
    @window_width = width
    super(x, y)
  end
  #--------------------------------------------------------------------------
  # ● 获取窗口的宽度
  #--------------------------------------------------------------------------
  def window_width
    @window_width
  end
  #--------------------------------------------------------------------------
  # ● 获取窗口的高度
  #--------------------------------------------------------------------------
  def window_height
    return 120
  end
  #--------------------------------------------------------------------------
  # ● 获取列数
  #--------------------------------------------------------------------------
  def col_max
    return 2
  end
  #--------------------------------------------------------------------------
  # ● 生成指令列表
  #--------------------------------------------------------------------------
  def make_command_list
    add_command("使用该称号",   :set)
    add_command("放弃该称号",   :del)
    add_command("卸下原称号",   :putoff)
    add_command("上一角色"  ,   :prev)
    add_command("下一角色"  ,   :next)
    add_command("返回"      ,   :back)
  end
end

#==============================================================================
# ■ Scene_Nicknames
#------------------------------------------------------------------------------
#  称号更换画面
#==============================================================================

class Scene_Nicknames < Scene_MenuBase
  #--------------------------------------------------------------------------
  # ● 开始处理
  #--------------------------------------------------------------------------
  def start
    super
    create_select_window
    create_info_window
  end
  #--------------------------------------------------------------------------
  # ● 生成称号选择窗口
  #--------------------------------------------------------------------------
  def create_select_window
    @select_window = Window_NicknameSelect.new(0, 0,156,Graphics.height,@actor)
    @select_window.set_handler(:ok,    method(:select_command))
    @select_window.set_handler(:cancel,   method(:return_scene))
    @select_window.set_handler(:pagedown, method(:next_actor))
    @select_window.set_handler(:pageup,   method(:prev_actor))
    @select_window.activate
  end
  #--------------------------------------------------------------------------
  # ● 生成称号信息窗口
  #--------------------------------------------------------------------------
  def create_info_window
    @info_window = Window_NicknameInfo.new(@select_window.width, 0,Graphics.width - @select_window.width,Graphics.height,@actor)
    @select_window.help_window = @info_window
  end
  #--------------------------------------------------------------------------
  # ● 生成指令窗口
  #--------------------------------------------------------------------------
  def create_command_window
    wx = @info_window.x
    wy = @info_window.height - 120
    ww = @info_window.width
    @command_window = Window_NicknameCommand.new(wx, wy, ww)
    @command_window.viewport = @viewport
    @command_window.help_window = @help_window
    @command_window.set_handler(:set,    method(:set_nickname))
    @command_window.set_handler(:del,    method(:delete_nickname))
    @command_window.set_handler(:putoff, method(:put_off_nickname))
    @command_window.set_handler(:prev,   method(:prev_actor))
    @command_window.set_handler(:next,   method(:next_actor))
    @command_window.set_handler(:back,   method(:back))
    @command_window.set_handler(:cancel, method(:back))
  end
  #--------------------------------------------------------------------------
  # ● 刷新窗口
  #--------------------------------------------------------------------------
  def refresh_windows
    @select_window.refresh
    @info_window.refresh
  end
  #--------------------------------------------------------------------------
  # ● 选项
  #--------------------------------------------------------------------------
  def select_command
    if @select_window.item
      create_command_window
      @command_window.activate
    else
      back
    end
  end
  #--------------------------------------------------------------------------
  # ● 指令“设置称号”
  #--------------------------------------------------------------------------
  def set_nickname
    @actor.del_nickname
    @actor.set_nickname(@select_window.item)
    back
  end
  #--------------------------------------------------------------------------
  # ● 指令“放弃称号”
  #--------------------------------------------------------------------------
  def delete_nickname
    @actor.del_nicknames(@select_window.item)
    back
  end
  #--------------------------------------------------------------------------
  # ● 指令“卸下称号”
  #--------------------------------------------------------------------------
  def put_off_nickname
    @actor.del_nickname
    back
  end
  #--------------------------------------------------------------------------
  # ● 指令“返回”
  #--------------------------------------------------------------------------
  def back
    if @command_window
      @command_window.close
      @command_window.deactivate
    end
    refresh_windows
    @select_window.activate
  end
  #--------------------------------------------------------------------------
  # ● 切换角色
  #--------------------------------------------------------------------------
  def on_actor_change
    @select_window.actor = @actor
    @info_window.actor = @actor
    back
  end
end[/pre]

注:本脚本需要用到
自动换行脚本 【 原作者:叶子 修改:wyongcan】
[pre lang="ruby" line="1"]class Window_Base < Window
#~ draw_text_ex的增强,使其可以自动换行  原作者:叶子 修改:wyongcan
  #--------------------------------------------------------------------------
  # ● 绘制带有控制符的文本内容
  #   如果传递了width参数的话,会自动换行
  #--------------------------------------------------------------------------
  def draw_text_ex(x, y, text, width = nil,textwidth = nil,normalfont = true)
    reset_font_settings if normalfont == true
    text = convert_escape_characters(text)
    pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
    if width != nil
      pos[:height] = contents.font.size
      pos[:width] = width
      pos[:textwidth] = textwidth
    end
    process_character(text.slice!(0, 1), text, pos) until text.empty?
  end
  #--------------------------------------------------------------------------
  # ● 文字的处理
  #     c    : 文字
  #     text : 绘制处理中的字符串缓存(字符串可能会被修改)
  #     pos  : 绘制位置 {:x, :y, :new_x, :height}
  #--------------------------------------------------------------------------
  def process_character(c, text, pos)
    case c
    when "\r"   # 回车
      return
    when "\n"   # 换行
      process_new_line(text, pos)
    when "\f"   # 翻页
      process_new_page(text, pos)
    when "\e"   # 控制符
      process_escape_character(obtain_escape_code(text), text, pos)
    else        # 普通文字
      pos[:textwidth] == nil ? text_width = text_size(c).width : text_width = pos[:textwidth]
      if pos[:width] != nil && pos[:x] - pos[:new_x] + text_width > pos[:width]
        process_new_line(text, pos)
      end
      process_normal_character(c, pos)
    end
  end
end
[/pre]

绘制线段脚本 【原作者:忘了。。。】
[pre lang="ruby" line="1"]class Bitmap
  def draw_line(x1, y1, x2, y2, color)
    if x1 == x2
      x = x1
      for y in (y1 < y2 ? y1..y2 : y2..y1)
        set_pixel(x, y, color)
      end
    else
      a = (y2-y1)/(x2-x1).to_f
      if -1 < a and a < 1
        for x in (x1 < x2 ? x1..x2 : x2..x1)
          y = a * (x - x1) + y1
          set_pixel(x, y, color)
        end
      else
        for y in (y1 < y2 ? y1..y2 : y2..y1)
          x = (y - y1) / a + x1
          set_pixel(x, y, color)
        end
      end
    end
  end
end[/pre]


范例:(已含DLL)
称号震慑系统.zip (1.44 MB, 下载次数: 802)

点评

看到“预言之孙子”,“国家炼金术师”和“八武海”这三个的时候莫名的笑了  发表于 2015-1-24 23:45

评分

参与人数 3星屑 +38 收起 理由
3106345123 + 18 塞糖
喵kano + 10 塞糖~
VIPArcher + 10 哎呦,不错哦

查看全部评分

undefined
梦石
0
星屑
50
在线时间
444 小时
注册时间
2011-1-3
回帖
150

开拓者

发表于 2014-7-11 18:13:30 | 显示全部楼层
{:2_278:}话说干嘛不直接仿造传说系列里,称号附加属性值。

点评

@804173948 南梦宫旗下的传说系列,达成条件获得称号,装备称号获得属性提升。  发表于 2014-7-12 16:05
传说系列?  发表于 2014-7-11 18:21
回复

使用道具 举报

石油鸡

梦石
0
星屑
179
在线时间
287 小时
注册时间
2014-1-27
回帖
211
发表于 2014-7-11 18:48:41 | 显示全部楼层
有木有XP的,跪求

点评

肯定没有  发表于 2014-7-11 19:05
唉
回复

使用道具 举报

梦石
0
星屑
50
在线时间
378 小时
注册时间
2013-10-14
回帖
213
发表于 2014-7-11 21:05:23 | 显示全部楼层
ARPG使用最好了~~!!

收藏先~~!!

最简单的学习方法就是努力回答别人的问题...
任何教程都没有实践来的重要...
XP小问题都能自己解决了,剩下的就是脚本了...
╰⋛⋋⊱⋋๑角⊱☠c色๑⋌⊰⋌⋚╯
回复

使用道具 举报

梦石
0
星屑
155
在线时间
129 小时
注册时间
2014-2-22
回帖
206
发表于 2014-7-13 14:55:48 | 显示全部楼层
啊!!!!为毛收费附件我都下载不了啊!!!!
很多年了呢,坑还是没填完…………(草
回复

使用道具 举报

梦石
0
星屑
50
在线时间
64 小时
注册时间
2014-2-5
回帖
19
发表于 2014-7-26 12:39:14 | 显示全部楼层
我只要6个怎么弄
回复

使用道具 举报

梦石
0
星屑
77
在线时间
61 小时
注册时间
2014-11-1
回帖
43
发表于 2015-1-24 23:20:34 | 显示全部楼层
这么晚了我才来学习..看得我一脸血.......
回复

使用道具 举报

梦石
0
星屑
65
在线时间
84 小时
注册时间
2015-1-29
回帖
42
发表于 2015-2-6 18:01:23 | 显示全部楼层
能不能弄个直接加属性的啊大神
回复

使用道具 举报

梦石
0
星屑
50
在线时间
16 小时
注册时间
2010-6-29
回帖
235
发表于 2015-3-23 08:48:05 | 显示全部楼层
这个太需要了!
[img]http://rpg.blue/data/attachment/forum/201008/11/105320eudv222d7jgvg24p.gif[img]
回复

使用道具 举报

梦石
0
星屑
50
在线时间
7 小时
注册时间
2015-10-6
回帖
6
发表于 2015-12-22 16:00:16 | 显示全部楼层
{:2_276:}看到预言之孙子的时候突然就笑了
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部