Tienda Mejorada

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Tienda Mejorada as PDF for free.

More details

  • Words: 1,263
  • Pages: 10
1.substituye la classe scene_shop con esto: code #============================================================================== # � scene_shop #-----------------------------------------------------------------------------# ?????????????????? #============================================================================== class scene_shop #-------------------------------------------------------------------------# ? ????? #-------------------------------------------------------------------------def main @spriteset = spriteset_map.new # ??????????? @help_window = window_help.new # ???????????? @command_window = window_shopcommand.new # ???????????? @gold_window = window_gold.new @gold_window.x = 520 @gold_window.y = 64 @gold_window.width = 120 # ??????????? @playtime_window = window_base.new(0, 0, 0, 0) # ?????????? @buy_window = window_shopbuy.new($game_temp.shop_goods) @buy_window.active = false @buy_window.visible = false @buy_window.help_window = @help_window # ?????????? @sell_window = window_shopsell.new @sell_window.active = false @sell_window.visible = false @sell_window.help_window = @help_window # ???????????? @number_window = window_shopnumber.new @number_window.active = false @number_window.visible = false # ????????????? @status_window = window_shopstatus.new @status_window.visible = false # ????????? @spriteset = spriteset_map.new graphics.transition # ?????? loop do # ???????? graphics.update # ??????? input.update # ?????? update # ???????????????? if $scene != self break end end

# ????????? graphics.freeze # ???????? @spriteset.dispose @help_window.dispose @command_window.dispose @gold_window.dispose @playtime_window.dispose @buy_window.dispose @sell_window.dispose @number_window.dispose @status_window.dispose end #-------------------------------------------------------------------------# ? ?????? #-------------------------------------------------------------------------def update # ???????? @help_window.update @command_window.update @gold_window.update @playtime_window.update @buy_window.update @sell_window.update @number_window.update @status_window.update # ??????????????????: update_command ??? if @command_window.active update_command return end # ????????????????: update_buy ??? if @buy_window.active update_buy return end # ????????????????: update_sell ??? if @sell_window.active update_sell return end # ??????????????????: update_number ??? if @number_window.active update_number return end end #-------------------------------------------------------------------------# ? ?????? (??????????????????) #-------------------------------------------------------------------------def update_command # b ?????????? if input.trigger?(input::b) # ????? se ??? $game_system.se_play($data_system.cancel_se) # ?????????? $scene = scene_map.new return

end # c ?????????? if input.trigger?(input::c) # ??????????????????? case @command_window.index when 0 # ???? # ?? se ??? $game_system.se_play($data_system.decision_se) # ??????????????? @command_window.active = false @playtime_window.visible = false @buy_window.active = true @buy_window.visible = true @buy_window.refresh @status_window.visible = true when 1 # ???? # ?? se ??? $game_system.se_play($data_system.decision_se) # ??????????????? @command_window.active = false @playtime_window.visible = false @sell_window.active = true @sell_window.visible = true @sell_window.refresh when 2 # ??? # ?? se ??? $game_system.se_play($data_system.decision_se) # ?????????? $scene = scene_map.new end return end end #-------------------------------------------------------------------------# ? ?????? (????????????????) #-------------------------------------------------------------------------def update_buy # ?????????????????? @status_window.item = @buy_window.item # b ?????????? if input.trigger?(input::b) # ????? se ??? $game_system.se_play($data_system.cancel_se) # ??????????????? @command_window.active = true @playtime_window.visible = true @buy_window.active = false @buy_window.visible = false @status_window.visible = false @status_window.item = nil # ?????????? @help_window.set_text("") return end # c ?????????? if input.trigger?(input::c) # ??????? @item = @buy_window.item

# ?????????????????????????? if @item == nil or @item.price > $game_party.gold # ??? se ??? $game_system.se_play($data_system.buzzer_se) return end # ??????????? case @item when rpg::item number = $game_party.item_number(@item.id) when rpg::weapon number = $game_party.weapon_number(@item.id) when rpg::armor number = $game_party.armor_number(@item.id) end # ??? 99 ????????? if number == 99 # ??? se ??? $game_system.se_play($data_system.buzzer_se) return end # ?? se ??? $game_system.se_play($data_system.decision_se) # ??????????? max = @item.price == 0 ? 99 : $game_party.gold / @item.price max = [max, 99 - number].min # ????????????????? @buy_window.active = false @buy_window.visible = false @number_window.set(@item, max, @item.price) @number_window.active = true @number_window.visible = true end end #-------------------------------------------------------------------------# ? ?????? (????????????????) #-------------------------------------------------------------------------def update_sell # b ?????????? if input.trigger?(input::b) # ????? se ??? $game_system.se_play($data_system.cancel_se) # ??????????????? @command_window.active = true @playtime_window.visible = true @sell_window.active = false @sell_window.visible = false @status_window.item = nil # ?????????? @help_window.set_text("") return end # c ?????????? if input.trigger?(input::c) # ??????? @item = @sell_window.item # ?????????????????? @status_window.item = @item

# ????????????????? 0 (????) ??? if @item == nil or @item.price == 0 # ??? se ??? $game_system.se_play($data_system.buzzer_se) return end # ?? se ??? $game_system.se_play($data_system.decision_se) # ??????????? case @item when rpg::item number = $game_party.item_number(@item.id) when rpg::weapon number = $game_party.weapon_number(@item.id) when rpg::armor number = $game_party.armor_number(@item.id) end # ?????? = ???????? max = number # ????????????????? @sell_window.active = false @sell_window.visible = false @number_window.set(@item, max, @item.price / 2) @number_window.active = true @number_window.visible = true @status_window.visible = true end end #-------------------------------------------------------------------------# ? ?????? (??????????????????) #-------------------------------------------------------------------------def update_number # b ?????????? if input.trigger?(input::b) # ????? se ??? $game_system.se_play($data_system.cancel_se) # ????????????????�?????? @number_window.active = false @number_window.visible = false # ??????????????????? case @command_window.index when 0 # ???? # ??????????????? @buy_window.active = true @buy_window.visible = true when 1 # ???? # ??????????????? @sell_window.active = true @sell_window.visible = true @status_window.visible = false end return end # c ?????????? if input.trigger?(input::c) # ???? se ??? $game_system.se_play($data_system.shop_se) # ????????????????�??????

@number_window.active = false @number_window.visible = false # ??????????????????? case @command_window.index when 0 # ???? # ???? $game_party.lose_gold(@number_window.number * @item.price) case @item when rpg::item $game_party.gain_item(@item.id, @number_window.number) when rpg::weapon $game_party.gain_weapon(@item.id, @number_window.number) when rpg::armor $game_party.gain_armor(@item.id, @number_window.number) end # ????????????? @gold_window.refresh @buy_window.refresh @status_window.refresh # ??????????????? @buy_window.active = true @buy_window.visible = true when 1 # ???? # ???? $game_party.gain_gold(@number_window.number * (@item.price / 2)) case @item when rpg::item $game_party.lose_item(@item.id, @number_window.number) when rpg::weapon $game_party.lose_weapon(@item.id, @number_window.number) when rpg::armor $game_party.lose_armor(@item.id, @number_window.number) end # ????????????? @gold_window.refresh @sell_window.refresh @status_window.refresh # ??????????????? @sell_window.active = true @sell_window.visible = true @status_window.visible = false end return end end end luego substituye la classe window_shopnumber con esto: code#============================================================================= = # � window_shopnumber #-----------------------------------------------------------------------------# ????????????????????????????????????? #============================================================================== class window_shopnumber < window_base #--------------------------------------------------------------------------

# ? ????????? #-------------------------------------------------------------------------def initialize super(0, 64, 520, 254) self.contents = bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize @item = nil @max = 1 @price = 0 @number = 1 end #-------------------------------------------------------------------------# ? ??????????????? #-------------------------------------------------------------------------def set(item, max, price) @item = item @max = max @price = price @number = 1 refresh end #-------------------------------------------------------------------------# ? ?????????? #-------------------------------------------------------------------------def number return @number end #-------------------------------------------------------------------------# ? ?????? #-------------------------------------------------------------------------def refresh self.contents.clear draw_item_name(@item, 4, 96) self.contents.font.color = normal_color self.contents.draw_text(272, 96, 32, 32, "�") self.contents.draw_text(308, 96, 24, 32, @number.to_s, 2) self.cursor_rect.set(304, 96, 32, 32) # ???????????? domination = $data_system.words.gold cx = contents.text_size(domination).width total_price = @price * @number self.contents.font.color = normal_color self.contents.draw_text(4, 160, 328-cx-2, 32, total_price.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(332-cx, 160, cx, 32, domination, 2) end #-------------------------------------------------------------------------# ? ?????? #-------------------------------------------------------------------------def update super if self.active # ????? (+1) if input.repeat?(input::right) and @number < @max $game_system.se_play($data_system.cursor_se) @number += 1 refresh

end # ????? (-1) if input.repeat?(input::left) and @number > 1 $game_system.se_play($data_system.cursor_se) @number -= 1 refresh end # ????? (+98) if input.repeat?(input::up) and @number < @max $game_system.se_play($data_system.cursor_se) @number = [@number + 98, @max].min refresh end # ????? (-98) if input.repeat?(input::down) and @number > 1 $game_system.se_play($data_system.cursor_se) @number = [@number - 98, 1].max refresh end end end end ahora solo te falta crear una nueva classe encima de la classe main, y nombrala como quieras por ejemplo mas_comandos xd o algo asi, y dentro pega este codigo: code# ������ xrxs_mp12. �v���b�v���瑕��� ������ # by ��� �‫ݓ‬y #============================================================================== # � �萔 #============================================================================== module xrxs_mp12 scene_shop = 1 end #============================================================================== # �� window_shopcommand #============================================================================== class window_shopcommand < window_selectable #-------------------------------------------------------------------------# �� �i�u�w�f�n�g���� #-------------------------------------------------------------------------def initialize super(0, 64, 480, 64) self.contents = bitmap.new(width - 32, height - 32) @item_max = 4 @column_max = 4 @commands = ["comprar", "vender", "equipar", "salir"] refresh self.index = 0 end #-------------------------------------------------------------------------# �� ���̕‫��`ڂ‬ #-------------------------------------------------------------------------def draw_item(index)

x = 4 + index * 480/@column_max # ����160 self.contents.draw_text(x, 0, 128, 32, @commands[index]) end end #============================================================================== # �� scene_equip #============================================================================== class scene_equip #-------------------------------------------------------------------------# �� ��J�c���x�^���x�ϐ� #-------------------------------------------------------------------------attr_accessor :home_scene # ���v�[�� #-------------------------------------------------------------------------# �� �t���[���x�v (���c�g�e�b���h�e���a�n�e�b�u�̏ ) #-------------------------------------------------------------------------alias xrxs_mp12_update_right update_right def update_right # b �{�^��������� � if @home_scene != nil and input.trigger?(input::b) if @home_scene == xrxs_mp12::scene_shop # �l�����z�� se �鉑 t $game_system.se_play($data_system.cancel_se) # ���j���[��ʂɐ‫�؂‬ւ� $scene = scene_shop.new return end end # �Ăі � xrxs_mp12_update_right # r �{�^��������� � if @home_scene != nil and input.trigger?(input::r) $scene.home_scene = @home_scene return end # l �{�^��������� � if @home_scene != nil and input.trigger?(input::l) $scene.home_scene = @home_scene return end end end #============================================================================== # �� scene_shop #============================================================================== class scene_shop #-------------------------------------------------------------------------# �� �t���[���x�v (�r�}���h�e�b���h�e���a�n�e�b�u�̏ ) #-------------------------------------------------------------------------alias xrxs_mp12_update_command update_command def update_command

# c �{�^��������� � if input.trigger?(input::c) # �r�}���h�e�b���h�e�̃j�[�\���ʒu�ŕ��� case @command_window.index when 2 # ���� # ���� Se �鉑 t $game_system.se_play($data_system.decision_se) # �����ʂɐ‫�؂‬ւ� $scene = scene_equip.new $scene.home_scene = xrxs_mp12::scene_shop return when 3 # �� � # ���� Se �鉑 t $game_system.se_play($data_system.decision_se) # �}�b�v��ʂɐ‫�؂‬ւ� $scene = scene_map.new return end end # �Ăі � xrxs_mp12_update_command end end wno este script sirve para modificar el aspecto grafico d la tienda, (no mucho) pero a�ade la opci�n de equipar desde la misma tienda ^^ a disfrutarlo!

Related Documents

Tienda Mejorada
November 2019 16
Burbuja Mejorada
November 2019 18
La Tienda
October 2019 13
Tienda Adams.docx
October 2019 20
Tienda Incm
June 2020 1
Video Tienda
April 2020 2