设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
楼主: nanaka
打印 上一主题 下一主题

[RMVX发布] 简易的装备强化

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
543 小时
注册时间
2009-7-13
帖子
63
跳转到指定楼层
1
发表于 2011-9-9 00:53:52 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 nanaka 于 2011-9-16 22:00 编辑

超简易……
某养成SLG时用的东西,具体见注释和范例吧

OTL昨晚的好多BUG……
浏览如下


请不要吐槽背景图……

范例如下
装备强化.rar (523.34 KB, 下载次数: 3590)
补115……
http://115.com/file/bhyhgibe
7楼有另一个版本
代码如下
  1. #==============================================================================
  2.     # ● 简易装备强化 Ver 1.0
  3.     #-----------------------------------------------------------------------------
  4.     #可以强化武器和防具,但是强化的是一个类型。
  5.     #即强化时不分数量只分类型。
  6.     #-----------------------------------------------------------------------------
  7.     #最大支持8素材(显示窗口还可以看的状态)
  8.     #每次只能添加一种附加状态
  9.     #武器只能存在一种属性(防具不限)
  10.     #-----------------------------------------------------------------------------
  11.     #S键切换武器强化和防具强化
  12.     #-----------------------------------------------------------------------------
  13.     #调用请在脚本添加$scene = Scene_Equip_Strengthen.new
  14.     #在对话框后调用等设置等待5帧(否则对话框来不及消失)
  15.     #=============================================================================

  16.     #==============================================================================
  17.     # ■ Nanaka_Equip_Strengthen
  18.     #------------------------------------------------------------------------------
  19.     #  武器强化系统设定部分
  20.     #==============================================================================
  21.     module Nanaka_Equip_Strengthen
  22.       
  23.       #场景背景图的名称
  24.       #不需要时请填写为nil
  25.       Background_Picture_Name = "background"
  26.       #用来记录武器名称的数组
  27.       Equip_Name_List = []
  28.       #用来记录武器图标的数组
  29.       Equip_Icon_List = []
  30.       #用来记录武器编号的数组
  31.       Equip_Index_List = []
  32.       #用来记录武器强化素材的哈希表
  33.       Equip_Material_List = {
  34.       #--------------------------------------------------------------------------
  35.       #    哈希表对应的依次为
  36.       #    [ 每级强化的素材种类 ] (一维数组)
  37.       #    [ [ 每级对应的素材ID ] ] (二维数组)
  38.       #    [ [ 每级素材的需求数量 ] ] (二维数组)
  39.       #    最大强化次数 (数字)
  40.       #
  41.       #    例中棍子的含义为
  42.       #    最多强化3次,
  43.       #    每次分别需要8种、4种、3种素材
  44.       #    第一次强化各素材依次需要1、1、1、1、99、99、99、6个
  45.       #    第二次强化各素材依次需要1、1、1、1个
  46.       #    下略
  47.       #--------------------------------------------------------------------------
  48.         "棍子" => [   [8,4,3],
  49.                       [[1,2,3,4,5,6,7,8],[4,6,7,8],[9,10,11]],
  50.                       [[1,1,1,1,99,99,99,6],[1,1,1,1],[1,1,1]],
  51.                       3],
  52.                      
  53.         "皮盾" => [   [4,4,3],
  54.                       [[1,2,3,4],[4,6,7,8],[9,10,11]],
  55.                       [[1,1,1,1],[1,1,1,1],[1,1,1]],
  56.                       3],
  57.         "长剑" => [   [1],
  58.                       [[1,2,3,4]],
  59.                       [[1,1,1,1]],
  60.                       1]
  61.       }
  62.       #用来记录武器强化效果的哈希表
  63.       #--------------------------------------------------------------------------
  64.       #一维数组依次对应攻击、防御、敏捷、精神、附加状态、属性变更
  65.       #请对应强化次数来填写
  66.       #前四项正负均可,后两项请保证对应数据库,无附加状态和属性变更时请填0
  67.       #--------------------------------------------------------------------------
  68.       Strengthen_Effect_List = {
  69.       #             [攻击]   [防御]  [敏捷]    [精神]  [附加状态] [属性变更]
  70.         "棍子" => [[9,2,3], [9,2,3], [9,1,1], [-9,0,0],  [1,0,0],   [1,0,0]],
  71.       
  72.         "皮盾" => [[1,2,3], [1,2,3], [0,1,1], [0,0,0],  [1,0,0],   [1,0,0]],
  73.       
  74.         "长剑" => [[1],     [1],     [1],     [1],      [0],       [0]]
  75.       }
  76.       #帮助窗口提示文字
  77.       Msg_Weapon_Help = "请选择要强化的武器"
  78.       Msg_Armor_Help = "请选择要强化的防具"
  79.       #无法强化的武器提示文字
  80.       Msg_Weapon_Disable = "-该武器无法强化-"
  81.       Msg_Armor_Disable = "-该防具无法强化-"
  82.       #武器强化到满级的提示文字
  83.       Msg_Weapon_Max_Level = "-该武器已强化到极限-"
  84.       Msg_Armor_Max_Level = "-该防具已强化到极限-"
  85.       #强化素材说明文字
  86.       Msg_Material = "-强化素材-"
  87.       #强化效果说明文字
  88.       Msg_Effect = "-强化效果-"
  89.       #各个效果的名称
  90.       Msg_Weapon_Effect_Text = ["攻击:","防御:","敏捷:","精神:","附加:","属性:"]
  91.       Msg_Armor_Effect_Text = ["攻击:","防御:","敏捷:","精神:","无效:","抵抗:"]
  92.       #强化完成的确认文字
  93.       Msg_Strengthen_Complete = "★☆★☆★☆强化完成★☆★☆★☆"
  94.       #武器和防具的识别文字
  95.       Weapon_Type = "weapon"
  96.       Armor_Type = "armor"
  97.       
  98.       #--------------------------------------------------------------------------
  99.       #    ☆Nanaka_Equip_Strengthen★
  100.       #    初始化方法
  101.       #    原则上每次进入场景需要调用一次
  102.       #--------------------------------------------------------------------------
  103.       def self.init(type)
  104.         Equip_Name_List.clear
  105.         Equip_Icon_List.clear
  106.         Equip_Index_List.clear
  107.         if type == Weapon_Type
  108.           for weapon in $data_weapons
  109.             next if weapon == nil
  110.             if $game_party.has_item?(weapon, true)
  111.               Equip_Name_List.push(weapon.name)
  112.               Equip_Icon_List.push(weapon.icon_index)
  113.               Equip_Index_List.push(weapon.id)
  114.             end
  115.           end
  116.         else
  117.           for armor in $data_armors
  118.             next if armor == nil
  119.             if $game_party.has_item?(armor, true)
  120.               Equip_Name_List.push(armor.name)
  121.               Equip_Icon_List.push(armor.icon_index)
  122.               Equip_Index_List.push(armor.id)
  123.             end
  124.           end
  125.         end
  126.       end
  127.       
  128.     end
  129.    #==============================================================================
  130.     # ■ Scene_Equip_Strengthen
  131.     #------------------------------------------------------------------------------
  132.     #  处理武器强化的类
  133.     #==============================================================================
  134.     class Scene_Equip_Strengthen < Scene_Base
  135.       include Nanaka_Equip_Strengthen
  136.       #--------------------------------------------------------------------------
  137.       #    ☆Scene_Equip_Strengthen★
  138.       #    开始处理
  139.       #--------------------------------------------------------------------------  
  140.       def start
  141.       
  142.         #初始化武器强化模组
  143.         Nanaka_Equip_Strengthen.init(Weapon_Type)
  144.         #默认Type为武器强化
  145.         @now_type = Weapon_Type
  146.         if Background_Picture_Name != nil
  147.           @background_sprite = Sprite.new
  148.           @background_sprite.bitmap = Cache.picture(Background_Picture_Name)
  149.         end
  150.         create_weapon_strengthen_menu(@now_type)
  151.       end
  152.       
  153.       def create_weapon_strengthen_menu(type)
  154.         @help_window.dispose if @help_window != nil
  155.         @window_weapon_selecte.dispose if @window_weapon_selecte != nil
  156.         @window_strengthen_detail.dispose if @window_strengthen_detail != nil
  157.         #生成帮助条
  158.         @help_window = Window_Help.new
  159.         @help_window.set_text(Msg_Weapon_Help, 1) if type == Weapon_Type
  160.         @help_window.set_text(Msg_Armor_Help, 1) if type == Armor_Type
  161.       
  162.         #生成武器强化菜单栏
  163.         command = []
  164.         for i in Equip_Name_List
  165.           command.push(i)
  166.         end
  167.         @window_weapon_selecte = Window_Weapon_Selecte.new(160, command)
  168.         update_window_selecte
  169.         #设定y坐标
  170.         @window_weapon_selecte.y = @help_window.height
  171.         #计算显示区域
  172.         @window_weapon_selecte.height = Graphics.height - @help_window.height
  173.       
  174.         #生成武器强化细节
  175.         @window_strengthen_detail = Window_Strengthen_Detail.new(type)
  176.         @window_strengthen_detail.refresh(0)
  177.       end
  178.       #--------------------------------------------------------------------------
  179.       #    ☆Scene_Equip_Strengthen★
  180.       #    更新武器强化菜单栏
  181.       #--------------------------------------------------------------------------  
  182.       def update_window_selecte
  183.         for i in 0...Equip_Name_List.size
  184.           if !is_can_strengthen?(i, @now_type)
  185.             @window_weapon_selecte.draw_item(i, false)
  186.           end
  187.         end
  188.       end
  189.       #--------------------------------------------------------------------------
  190.       #    ☆Scene_Equip_Strengthen★
  191.       #    处理武器强化
  192.       #--------------------------------------------------------------------------  
  193.       def weapon_strengthen(index, type)
  194.         #获取装备及装备等级
  195.         if type == Weapon_Type
  196.           equip = $data_weapons[Equip_Index_List[index]]
  197.           equip_level = $weapons_level[equip.id]
  198.         else
  199.           equip = $data_armors[Equip_Index_List[index]]
  200.           equip_level = $armors_level[equip.id]
  201.         end
  202.         equip_level = 0 if equip_level == nil
  203.         #获取装备强化效果列表
  204.         equip_effect_hash = Strengthen_Effect_List[equip.name]
  205.         #获取本次装备强化效果
  206.         effect_value = []
  207.         for array in equip_effect_hash
  208.           effect_value.push(array[equip_level])
  209.         end
  210.         #装备强化效果处理
  211.         equip.atk += effect_value[0]
  212.         equip.def += effect_value[1]
  213.         equip.agi += effect_value[2]
  214.         equip.spi += effect_value[3]
  215.         equip.state_set.push(effect_value[4]) if effect_value[4] != 0
  216.         #武器只存在一种属性
  217.         if effect_value[5] != 0
  218.           equip.element_set.clear if type == Weapon_Type
  219.           equip.element_set.push(effect_value[5])
  220.         end
  221.         if type == Weapon_Type
  222.           $weapons_level[equip.id] = equip_level + 1
  223.         else
  224.           $armors_level[equip.id] = equip_level + 1
  225.         end
  226.         #获取武器强化素材列表
  227.         equip_material_hash = Equip_Material_List[equip.name]
  228.         material_list = []
  229.         amount_list = []
  230.         #获取本次强化素材
  231.         for material_index in equip_material_hash[1][equip_level]
  232.           material_list.push(material_index)
  233.         end
  234.         #获取本次强化素材所需数量
  235.         for amount in equip_material_hash[2][equip_level]
  236.           amount_list.push(amount)
  237.         end
  238.         #武器强化素材消费处理
  239.         for index in 0...material_list.size
  240.           material = $data_items[index]
  241.           $game_party.lose_item(material, amount_list[index])
  242.         end
  243.         call_determine_window
  244.       end
  245.       #--------------------------------------------------------------------------
  246.       #    ☆Scene_Equip_Strengthen★
  247.       #    判断强化武器的素材是否足够
  248.       #--------------------------------------------------------------------------   
  249.       def is_can_strengthen?(index, type)
  250.         #获取武器强化素材
  251.         equip_name = Equip_Name_List[index]
  252.         equip_hash = Equip_Material_List[equip_name]
  253.         if type == Weapon_Type
  254.           equip_level = $weapons_level[$data_weapons[Equip_Index_List[index]].id]
  255.         else
  256.           equip_level = $armors_level[$data_armors[Equip_Index_List[index]].id]
  257.         end
  258.         equip_level = 0 if equip_level == nil
  259.         return false if equip_hash == nil
  260.         return false if equip_level == equip_hash[3]
  261.         #获取素材总数,素材编号和素材数量
  262.         total_amount = equip_hash[0][equip_level]
  263.         equip_material_array = equip_hash[1][equip_level]
  264.         material_amount_array = equip_hash[2][equip_level]
  265.         #判断是否可以强化
  266.         for i in 0...total_amount
  267.           equip_material_index = equip_material_array[i]
  268.           material_amount = material_amount_array[i]
  269.           equip_material = $data_items[equip_material_index]
  270.           if $game_party.item_number(equip_material) < material_amount
  271.             return false
  272.           end
  273.         end
  274.         return true
  275.       end
  276.       #--------------------------------------------------------------------------
  277.       #    ☆Scene_Equip_Strengthen★
  278.       #    更新画面
  279.       #--------------------------------------------------------------------------   
  280.       def update
  281.         @window_weapon_selecte.update
  282.         @window_strengthen_detail.update
  283.         @help_window.update
  284.         @window_strengthen_detail.refresh(@window_weapon_selecte.index)
  285.         if Input.trigger?(Input::B)
  286.           Sound.play_cancel
  287.           $scene = Scene_Map.new
  288.         end
  289.         if Input.trigger?(Input::C)
  290.           if is_can_strengthen?(@window_weapon_selecte.index, @now_type)
  291.             Sound.play_decision
  292.             #强化武器
  293.             weapon_strengthen(@window_weapon_selecte.index, @now_type)
  294.             #更新窗口栏目
  295.             update_window_selecte
  296.             #更新武器强化素材需求和强化效果的窗口
  297.             @window_strengthen_detail.refresh(@window_weapon_selecte.index, true)      
  298.           else
  299.             Sound.play_buzzer
  300.           end
  301.         end
  302.         if Input.trigger?(Input::Y)
  303.           Sound.play_decision
  304.           if @now_type == Weapon_Type
  305.             @now_type = Armor_Type
  306.           else
  307.             @now_type = Weapon_Type
  308.           end
  309.           Nanaka_Equip_Strengthen.init(@now_type)
  310.           create_weapon_strengthen_menu(@now_type)
  311.         end
  312.       end
  313.       #--------------------------------------------------------------------------
  314.       #    ☆Scene_Equip_Strengthen★
  315.       #    确认强化完成的窗口
  316.       #--------------------------------------------------------------------------
  317.       def call_determine_window
  318.         @window_strengthen_success = Window_Base.new(0,0,384,56)
  319.         @window_strengthen_success.x = (544 - @window_strengthen_success.width) / 2
  320.         @window_strengthen_success.y = (416 - @window_strengthen_success.height) / 2
  321.         @window_strengthen_success.contents.clear
  322.         Audio.se_play("Audio/SE/获得物品",80)
  323.         @window_strengthen_success.contents.font.color = @window_strengthen_success.system_color
  324.         @window_strengthen_success.contents.draw_text(0,0,360,24,Nanaka_Equip_Strengthen::Msg_Strengthen_Complete,1)
  325.         Graphics.wait(120)
  326.         @window_strengthen_success.dispose
  327.       end
  328.       #--------------------------------------------------------------------------
  329.       #    ☆Scene_Equip_Strengthen★
  330.       #    结束处理
  331.       #--------------------------------------------------------------------------   
  332.       def terminate
  333.         @window_weapon_selecte.dispose
  334.         @window_strengthen_detail.dispose
  335.         @help_window.dispose
  336.         if @background_sprite != nil
  337.           @background_sprite.bitmap.dispose
  338.           @background_sprite.dispose
  339.         end
  340.       end
  341.       
  342.     end

  343.     #==============================================================================
  344.     # ■ Window_Weapon_Selecte
  345.     #------------------------------------------------------------------------------
  346.     #  武器强化菜单栏目的窗口
  347.     #==============================================================================
  348.     class Window_Weapon_Selecte < Window_Command
  349.       #--------------------------------------------------------------------------
  350.       #    ☆Window_Weapon_Selecte★
  351.       #    描画物品图标及说明
  352.       #--------------------------------------------------------------------------
  353.       def draw_item(index, enabled = true)
  354.         rect = item_rect(index)
  355.         rect.x += 4
  356.         rect.width -= 8
  357.         icon_index = 0
  358.         self.contents.clear_rect(rect)
  359.         if Nanaka_Equip_Strengthen::Equip_Icon_List[index] != nil
  360.           icon_index = Nanaka_Equip_Strengthen::Equip_Icon_List[index]
  361.         end
  362.       
  363.         if icon_index != 0
  364.           rect.x -= 4
  365.           draw_icon(icon_index, rect.x, rect.y, enabled)
  366.           rect.x += 26
  367.           rect.width -= 20
  368.         end
  369.         self.contents.clear_rect(rect)
  370.         self.contents.font.color = normal_color
  371.         self.contents.font.color.alpha = enabled ? 255 : 128
  372.         self.contents.draw_text(rect, @commands[index])
  373.       end
  374.       #--------------------------------------------------------------------------
  375.       #    ☆Window_Weapon_Selecte★
  376.       #    光标下移
  377.       #--------------------------------------------------------------------------
  378.       def cursor_down(wrap = false)
  379.         if @index < @item_max - 1 or wrap
  380.           @index = (@index + 1) % @item_max
  381.         end
  382.       end
  383.        #--------------------------------------------------------------------------
  384.       #    ☆Window_Weapon_Selecte★
  385.       #    光标上移
  386.       #--------------------------------------------------------------------------
  387.       def cursor_up(wrap = false)
  388.         if @index > 0 or wrap
  389.           @index = (@index - 1 + @item_max) % @item_max
  390.         end
  391.       end
  392.     end

  393.     #==============================================================================
  394.     # ■ Window_Strengthen_Detail
  395.     #------------------------------------------------------------------------------
  396.     #  武器强化素材需求和强化效果的显示窗口
  397.     #==============================================================================
  398.     class Window_Strengthen_Detail < Window_Base
  399.       include Nanaka_Equip_Strengthen
  400.       #--------------------------------------------------------------------------
  401.       #    ☆Window_Strengthen_Detail★
  402.       #    初始化
  403.       #--------------------------------------------------------------------------
  404.       def initialize(type)
  405.         super(160, 56, 384, 360)
  406.         @index = -1
  407.         @type = type
  408.       end
  409.       #--------------------------------------------------------------------------
  410.       #    ☆Window_Strengthen_Detail★
  411.       #    刷新
  412.       #--------------------------------------------------------------------------
  413.       def refresh(index, update_flag = false)
  414.         if @index != index or update_flag
  415.           equip_name = Equip_Name_List[index]
  416.           if @type == Weapon_Type
  417.             equip_level = $weapons_level[$data_weapons[Equip_Index_List[index]].id]
  418.           else
  419.             equip_level = $armors_level[$data_armors[Equip_Index_List[index]].id]
  420.           end
  421.           equip_level = 0 if equip_level == nil
  422.           draw_material_text(equip_name,equip_level, @type)
  423.           draw_strengthen_effect(equip_name, equip_level, @type)
  424.           @index = index
  425.         end
  426.       end
  427.       #--------------------------------------------------------------------------
  428.       #    ☆Window_Strengthen_Detail★
  429.       #    描画素材需求说明
  430.       #--------------------------------------------------------------------------
  431.       def draw_material_text(equip_name, equip_level, type)
  432.         equip_hash = Equip_Material_List[equip_name]
  433.         self.contents.clear

  434.         #当武器无法强化时的说明生成
  435.         if equip_hash == nil
  436.           width = self.width / 2 + self.x
  437.           height = self.height / 2 + 56
  438.           self.contents.font.color = system_color
  439.           self.contents.draw_text(96, 36, width , height, Msg_Weapon_Disable) if type == Weapon_Type
  440.           self.contents.draw_text(96, 36, width , height, Msg_Armor_Disable) if type == Armor_Type
  441.         #当武器已经强化到满级时
  442.         elsif equip_level == equip_hash[3]
  443.           width = self.width / 2 + self.x
  444.           height = self.height / 2 + 56
  445.           self.contents.font.color = system_color
  446.           self.contents.draw_text(72, 36, width , height, Msg_Weapon_Max_Level) if type == Weapon_Type
  447.           self.contents.draw_text(72, 36, width , height, Msg_Armor_Max_Level) if type == Armor_Type
  448.         #当武器可以强化时的说明生成
  449.         else
  450.           self.contents.font.color = system_color
  451.           self.contents.draw_text(132, 24, 120, 24, Msg_Material)
  452.           total_amount = equip_hash[0][equip_level]
  453.           equip_material_array = equip_hash[1][equip_level]
  454.           material_amount_array = equip_hash[2][equip_level]
  455.           @x_coordinate = 0
  456.           @y_coordinate = 56
  457.           for i in 0...total_amount
  458.             equip_material_index = equip_material_array[i]
  459.             equip_material = $data_items[equip_material_index]
  460.             material_amount = material_amount_array[i]
  461.             string = ":" + "#{material_amount}"
  462.             self.draw_item_name(equip_material, @x_coordinate, @y_coordinate)
  463.             self.contents.font.color = normal_color
  464.             self.contents.draw_text(140 + @x_coordinate, @y_coordinate, 120, 24, string, 0)
  465.             @x_coordinate += 180
  466.             @y_coordinate += 32 if @x_coordinate > 180
  467.             @x_coordinate = 0 if @x_coordinate > 180
  468.           end
  469.           @y_coordinate += 32 if total_amount % 2
  470.           @y_coordinate = 200 if @y_coordinate > 200
  471.         end
  472.       end
  473.       #--------------------------------------------------------------------------
  474.       #    ☆Window_Strengthen_Detail★
  475.       #    描画物品名称
  476.       #--------------------------------------------------------------------------
  477.       def draw_item_name(item, x, y, enabled = true)
  478.         if item != nil
  479.           draw_icon(item.icon_index, x, y, enabled)
  480.           self.contents.font.color = system_color
  481.           self.contents.font.color.alpha = enabled ? 255 : 128
  482.           self.contents.draw_text(x + 24, y, 120, WLH, item.name)
  483.         end
  484.       end
  485.       
  486.       #--------------------------------------------------------------------------
  487.       #    ☆Window_Strengthen_Detail★
  488.       #    描画强化效果说明
  489.       #--------------------------------------------------------------------------
  490.       def draw_strengthen_effect(equip_name, equip_level, type)
  491.         #获取素材强化列表
  492.         equip_hash = Strengthen_Effect_List[equip_name]
  493.         return if equip_hash == nil
  494.         #获取武器最大等级
  495.         equip_max_level = Equip_Material_List[equip_name][3]
  496.         return if equip_level == equip_max_level
  497.         self.contents.font.color = system_color
  498.         #绘制强化效果标题文字
  499.         self.contents.draw_text(132, @y_coordinate, 120, 24, Msg_Effect)
  500.         @y_coordinate += 32
  501.         @x_coordinate = 0
  502.         #获取强化效果数组
  503.         effect_value = []
  504.         for array in equip_hash
  505.           effect_value.push(array[equip_level])
  506.         end
  507.         #绘制强化效果说明
  508.         for index in 0...effect_value.size
  509.           value = effect_value[index]
  510.           value_text = "  0"
  511.           value_text = " +" + "#{value}" if value > 0
  512.           value_text = " " + "#{value}" if value < 0
  513.           if index == 4
  514.             state = $data_states[value]
  515.             value_text = " 无"
  516.             value_text = "#{state.name}" if state != nil
  517.           end
  518.           if index == 5
  519.             elem_text = $data_system.elements[value]
  520.             value_text = "不变"
  521.             value_text = elem_text if elem_text != ""
  522.           end
  523.           self.contents.font.color = system_color
  524.           if type == Weapon_Type
  525.             self.contents.draw_text(@x_coordinate + 24, @y_coordinate, 120, 24, Msg_Weapon_Effect_Text[index])
  526.           else
  527.             self.contents.draw_text(@x_coordinate + 24, @y_coordinate, 120, 24, Msg_Armor_Effect_Text[index])
  528.           end
  529.           self.contents.font.color = normal_color
  530.           self.contents.draw_text(@x_coordinate + 72, @y_coordinate, 120, 24, value_text)
  531.           @x_coordinate += 180
  532.           @y_coordinate += 32 if @x_coordinate > 180
  533.           @x_coordinate = 0 if @x_coordinate > 180
  534.         end
  535.       end
  536.     end

  537.     class Scene_Title < Scene_Base
  538.       alias nanaka_create_game_objects create_game_objects
  539.       def create_game_objects
  540.         nanaka_create_game_objects
  541.         $weapons_level = []
  542.         $armors_level = []
  543.       end
  544.     end

  545.     class Scene_File < Scene_Base
  546.       alias nanaka_read_save_data read_save_data
  547.       alias nanaka_write_save_data write_save_data
  548.       def write_save_data(file)
  549.         nanaka_write_save_data(file)
  550.         Marshal.dump($weapons_level,         file)
  551.         Marshal.dump($armors_level,         file)
  552.       end
  553.       def read_save_data(file)
  554.         nanaka_read_save_data(file)
  555.         $weapons_level = Marshal.load(file)
  556.         $armors_level = Marshal.load(file)
  557.         load_equip_strengthen_data
  558.       end
  559.       
  560.       def load_equip_strengthen_data
  561.         length = [$weapons_level.length,$armors_level.length].max
  562.         for index in 0...length
  563.           weapon_level = $weapons_level[index]
  564.           armor_level = $armors_level[index]
  565.           weapon_level = 0 if weapon_level == nil
  566.           armor_level = 0 if armor_level == nil
  567.           weapon = $data_weapons[index]
  568.           armor = $data_armors[index]
  569.           for level in 0...weapon_level
  570.             weapon_effect_hash = Nanaka_Equip_Strengthen::Strengthen_Effect_List[weapon.name]
  571.             effect_value = []
  572.             for array in weapon_effect_hash
  573.               effect_value.push(array[level])
  574.             end
  575.             weapon.atk += effect_value[0]
  576.             weapon.def += effect_value[1]
  577.             weapon.agi += effect_value[2]
  578.             weapon.spi += effect_value[3]
  579.             weapon.state_set.push(effect_value[4]) if effect_value[4] != 0
  580.             if effect_value[5] != 0
  581.               weapon.element_set.clear
  582.               weapon.element_set.push(effect_value[5])
  583.             end
  584.           end
  585.           for level in 0...armor_level
  586.             armor_effect_hash = Nanaka_Equip_Strengthen::Strengthen_Effect_List[armor.name]
  587.             effect_value = []
  588.             for array in armor_effect_hash
  589.               effect_value.push(array[level])
  590.             end
  591.             armor.atk += effect_value[0]
  592.             armor.def += effect_value[1]
  593.             armor.agi += effect_value[2]
  594.             armor.spi += effect_value[3]
  595.             armor.state_set.push(effect_value[4]) if effect_value[4] != 0
  596.             armor.element_set.push(effect_value[5]) if effect_value[5] != 0
  597.           end
  598.         end
  599.       end
  600.       
  601.     end
  602.     #======================================================================
  603.     # Equip_Strengthen by Nanaka
  604.     #======================================================================
复制代码
睡了……

评分

参与人数 2星屑 +20 收起 理由
MSQ + 10 会脚本的都是触~~而且还这么长~~=W=.
RPGmaster + 10 修复费

查看全部评分

退屈すぎ…

Lv1.梦旅人

梦石
0
星屑
50
在线时间
543 小时
注册时间
2009-7-13
帖子
63
2
 楼主| 发表于 2011-9-9 01:13:32 | 显示全部楼层
不太一样……
kgc那个可以同一类里一个一个来,这个直接把一类强化了
虽然是因为直接拿的$data_weapons和$data_armors搞的副作用……

评分

参与人数 1星屑 +10 收起 理由
RPGmaster + 10 求上传115= =+

查看全部评分

退屈すぎ…
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
543 小时
注册时间
2009-7-13
帖子
63
3
 楼主| 发表于 2011-9-16 16:48:05 | 显示全部楼层
本帖最后由 nanaka 于 2011-9-16 22:54 编辑

更新重发一下。
基本按照九夜神尊大的方法来了。不过有几个地方没有实现,有点缺陷……另外用到了沉影不器大的读取rmvx备注栏脚本

虽然在设定上变得比之前那个少了很多,不过不是很自由的感觉,所以旧版还是保留吧。
如果角色是全程只使用一种武器和防具只靠强化增强的情况下,还是旧版比较好。
要是武器和防具数量很多的话可以用这个试试。

代码不贴了,范例如下,说明写在注释里了。
装备强化.rar (557.27 KB, 下载次数: 3678)
退屈すぎ…
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
543 小时
注册时间
2009-7-13
帖子
63
4
 楼主| 发表于 2011-9-16 21:45:20 | 显示全部楼层
BUG的话,大概是S切换以后初次显示不正确吧,还没搞清怎么回事。
强化的以后的属性提高确实太傻了……
另外素材总是一样的也感觉怪怪的,不过没想到比较好的增加方法。

然后以我的能力,成功率那部分估计只能用武器的档次和当前等级来算了。

我会接着按您的建议改的(除了最后面那个……),非常感谢您能从头到尾看我的脚本,收获很大。
退屈すぎ…
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
543 小时
注册时间
2009-7-13
帖子
63
5
 楼主| 发表于 2011-9-16 22:41:57 | 显示全部楼层
嗯……称呼成习惯了。
关于强化素材,我之前理解的是按档次来决定的。这样按照主属性划分档次以后,强化素材就确定了,即使多次强化,素材也不会变,就是说+1,+2,+3,+4的素材都是一样的。这里感觉怪怪的。难道我理解错了?

多层迷宫确实使用,明天研究。

点评

材料上也可以加等级条件啊。  发表于 2011-9-16 23:04
退屈すぎ…
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-18 04:54

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表