# ▽△▽ XRXSv15. 宝箱サポート ▽△▽ # # publish 2010/ 3/ 9 # update - # #============================================================================== # カスタマイズポイント #============================================================================== module XEventChestizer # # 宝箱オープンSE # SE = RPG::SE.new("Open2", 70, 150) # # 中身入手ME # ME = RPG::ME.new("", 70, 150) # # 適用条件文字列(正規表現) # NAME = /^[!Chest].*/ # # 宝箱からアイテムを入手したとき # VocabGet1 = " を" VocabGet2 = "個" VocabGet3 = "手に入れた!\\info" # # 使用するセルフスイッチ # SelfSwitchName = "A" # # 空テキスト # EmptyText = "宝箱はからっぽだ。\\info" end #============================================================================== # --- イベントサポート機能 --- #============================================================================== module XEventChestizer def initial_chestize_get_item_name(command) item_name = "" text2 = "" param = command.parameters case command.code when 125 value = operate_value(param[0], param[1], param[2]) item_name = value.to_s + Vocab.gold else value = operate_value(param[1], param[2], param[3]) case command.code when 126 item = $data_items[param[0]] when 127 item = $data_weapons[param[0]] when 128 item = $data_armors[param[0]] end item_name = item.name if value >= 2 text2 = " " + value.to_s + " " + VocabGet2 end end return item_name + VocabGet1 + text2 + VocabGet3 end def operate_value(operation, operand_type, operand) if operand_type == 0 value = operand else value = $game_variables[operand] end if operation == 1 value = -value end return value end def make_new_page(base_page) new_page = base_page.dup new_page.condition = base_page.condition.dup new_page.graphic = base_page.graphic.dup new_page.move_route = base_page.move_route.dup new_page.list = [] return new_page end def initial_chestize if not @initial_chestized first_page = @event.pages[0] first_command = first_page.list[0] if [125,126,127,128].include?(first_command.code) and first_page.graphic.character_name =~ XEventChestizer::NAME # text = self.initial_chestize_get_item_name(first_command) # 専用リストの生成 commands1 = [] commands1.push(RPG::MoveCommand.new(17, [])) commands1.push(RPG::MoveCommand.new(15, [2])) commands1.push(RPG::MoveCommand.new(18, [])) commands1.push(RPG::MoveCommand.new(15, [2])) commands1.push(RPG::MoveCommand.new(19, [])) commands1.push(RPG::MoveCommand.new(0, [])) move_route1 = RPG::MoveRoute.new move_route1.repeat = false move_route1.wait = true move_route1.list = commands1 list = [] list.push(RPG::EventCommand.new(250, 0, [XEventChestizer::SE])) list.push(RPG::EventCommand.new(205, 0, [ 0, move_route1])) list.push(RPG::EventCommand.new(249, 0, [XEventChestizer::ME])) list.push(RPG::EventCommand.new(101, 0, ["", 0, 0, 0])) list.push(RPG::EventCommand.new(401, 0, [text])) list.push(RPG::EventCommand.new(123, 0, [SelfSwitchName, 0])) # 宝箱化! first_page.list[0,0] = list # ページを追加 list2 = [] list2.push(RPG::EventCommand.new(101, 0, ["", 0, 0, 0])) list2.push(RPG::EventCommand.new(401, 0, [EmptyText])) list2.push(RPG::EventCommand.new(0, 0, [])) new_page = make_new_page(first_page) new_page.condition.self_switch_valid = true new_page.condition.self_switch_ch = SelfSwitchName new_page.graphic.direction = 8 new_page.direction_fix = true new_page.list = list2 @event.pages[1, 0] = new_page end end @initial_chestized = true end end class Game_Event < Game_Character include XEventChestizer alias xrxsv15_refresh refresh def refresh initial_chestize xrxsv15_refresh end end