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

Project1

 找回密码
 注册会员
搜索
查看: 1279|回复: 6
打印 上一主题 下一主题

只能买出和买入的脚本加什么才可以半透明?

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
8 小时
注册时间
2008-5-1
帖子
236
跳转到指定楼层
1
发表于 2008-5-19 03:02:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. # 只能购买的商店:
  5. # 在商店前面一行事件添加脚本:$game_temp.shop_type = 1
  6. # 只能卖出的商店:
  7. # 在商店前面一行事件添加脚本:$game_temp.shop_type = 2


  8. class Scene_Shop
  9.   # --------------------------
  10.   def main
  11.     @help_window = Window_Help.new
  12.     @command_window = Window_ShopCommand.new
  13.     @gold_window = Window_Gold.new
  14.     @gold_window.x = 480
  15.     @gold_window.y = 64
  16.     @dummy_window = Window_Base.new(0, 128, 640, 352)
  17.     @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
  18.     @buy_window.active = false
  19.     @buy_window.visible = false
  20.     @buy_window.help_window = @help_window
  21.     @sell_window = Window_ShopSell.new
  22.     @sell_window.active = false
  23.     @sell_window.visible = false
  24.     @sell_window.help_window = @help_window
  25.     @number_window = Window_ShopNumber.new
  26.     @number_window.active = false
  27.     @number_window.visible = false
  28.     @status_window = Window_ShopStatus.new
  29.     @status_window.visible = false
  30.     if $game_temp.shop_type == 1
  31.       @command_window.index = 0
  32.       @command_window.active = false
  33.       @dummy_window.visible = false
  34.       @buy_window.active = true
  35.       @buy_window.visible = true
  36.       @buy_window.refresh
  37.       @status_window.visible = true
  38.     end
  39.     if $game_temp.shop_type == 2
  40.       @command_window.index = 1
  41.       @command_window.active = false
  42.       @dummy_window.visible = false
  43.       @sell_window.active = true
  44.       @sell_window.visible = true
  45.       @sell_window.refresh
  46.     end
  47.     Graphics.transition
  48.     loop do
  49.       Graphics.update
  50.       Input.update
  51.       update
  52.       if $scene != self
  53.         break
  54.       end
  55.     end
  56.     Graphics.freeze
  57.     @status_window.item = nil
  58.     @status_window.refresh
  59.     @help_window.dispose
  60.     @command_window.dispose
  61.     @gold_window.dispose
  62.     @dummy_window.dispose
  63.     @buy_window.dispose
  64.     @sell_window.dispose
  65.     @number_window.dispose
  66.     @status_window.dispose
  67.     $game_temp.shop_type = 0
  68.   end
  69.   # --------------------------
  70.   def update
  71.     @help_window.update
  72.     @command_window.update
  73.     @gold_window.update
  74.     @dummy_window.update
  75.     @buy_window.update
  76.     @sell_window.update
  77.     @number_window.update
  78.     @status_window.update
  79.     if @command_window.active
  80.       update_command
  81.       return
  82.     end
  83.     if @buy_window.active
  84.       update_buy
  85.       return
  86.     end
  87.     if @sell_window.active
  88.       update_sell
  89.       return
  90.     end
  91.     if @number_window.active
  92.       update_number
  93.       return
  94.     end
  95.   end
  96.   # --------------------------
  97.   def update_command
  98.     if Input.trigger?(Input::B)
  99.       $game_system.se_play($data_system.cancel_se)
  100.       $scene = Scene_Map.new
  101.       return
  102.     end
  103.     if Input.trigger?(Input::C)
  104.       case @command_window.index
  105.       when 0
  106.         $game_system.se_play($data_system.decision_se)
  107.         @command_window.active = false
  108.         @dummy_window.visible = false
  109.         @buy_window.active = true
  110.         @buy_window.visible = true
  111.         @buy_window.refresh
  112.         @status_window.visible = true
  113.       when 1
  114.         $game_system.se_play($data_system.decision_se)
  115.         @command_window.active = false
  116.         @dummy_window.visible = false
  117.         @sell_window.active = true
  118.         @sell_window.visible = true
  119.         @sell_window.refresh
  120.       when 2
  121.         $game_system.se_play($data_system.decision_se)
  122.         $scene = Scene_Map.new
  123.       end
  124.       return
  125.     end
  126.   end
  127.   # --------------------------
  128.   def update_buy
  129.     @status_window.item = @buy_window.item
  130.     if Input.trigger?(Input::B)
  131.       if $game_temp.shop_type == 1
  132.          $game_system.se_play($data_system.cancel_se)
  133.          $scene = Scene_Map.new
  134.       else
  135.       $game_system.se_play($data_system.cancel_se)
  136.       @command_window.active = true
  137.       @dummy_window.visible = true
  138.       @buy_window.active = false
  139.       @buy_window.visible = false
  140.       @status_window.visible = false
  141.       @status_window.item = nil
  142.       @help_window.set_text("")
  143.       end
  144.       return
  145.     end
  146.     if Input.trigger?(Input::C)
  147.       @item = @buy_window.item
  148.       if @item == nil or @item.price > $game_party.gold
  149.         $game_system.se_play($data_system.buzzer_se)
  150.         return
  151.       end
  152.       case @item
  153.       when RPG::Item
  154.         number = $game_party.item_number(@item.id)
  155.       when RPG::Weapon
  156.         number = $game_party.weapon_number(@item.id)
  157.       when RPG::Armor
  158.         number = $game_party.armor_number(@item.id)
  159.       end
  160.       if number == 99
  161.         $game_system.se_play($data_system.buzzer_se)
  162.         return
  163.       end
  164.       $game_system.se_play($data_system.decision_se)
  165.       max = @item.price == 0 ? 99 : $game_party.gold / @item.price
  166.       max = [max, 99 - number].min
  167.       @buy_window.active = false
  168.       @buy_window.visible = false
  169.       @number_window.set(@item, max, @item.price)
  170.       @number_window.active = true
  171.       @number_window.visible = true
  172.     end
  173.   end
  174.   # --------------------------
  175.   def update_sell
  176.     if Input.trigger?(Input::B)
  177.       if $game_temp.shop_type == 2
  178.          $game_system.se_play($data_system.cancel_se)
  179.          $scene = Scene_Map.new
  180.       else
  181.       $game_system.se_play($data_system.cancel_se)
  182.       @command_window.active = true
  183.       @dummy_window.visible = true
  184.       @sell_window.active = false
  185.       @sell_window.visible = false
  186.       @status_window.item = nil
  187.       @help_window.set_text("")
  188.       return
  189.       end
  190.     end
  191.     if Input.trigger?(Input::C)
  192.       @item = @sell_window.item
  193.       @status_window.item = @item
  194.       if @item == nil or @item.price == 0
  195.         $game_system.se_play($data_system.buzzer_se)
  196.         return
  197.       end
  198.       $game_system.se_play($data_system.decision_se)
  199.       case @item
  200.       when RPG::Item
  201.         number = $game_party.item_number(@item.id)
  202.       when RPG::Weapon
  203.         number = $game_party.weapon_number(@item.id)
  204.       when RPG::Armor
  205.         number = $game_party.armor_number(@item.id)
  206.       end
  207.       max = number
  208.       @sell_window.active = false
  209.       @sell_window.visible = false
  210.       @number_window.set(@item, max, @item.price / 2)
  211.       @number_window.active = true
  212.       @number_window.visible = true
  213.       @status_window.visible = true
  214.     end
  215.   end
  216.   # --------------------------
  217.   def update_number
  218.     if Input.trigger?(Input::B)
  219.       $game_system.se_play($data_system.cancel_se)
  220.       @number_window.active = false
  221.       @number_window.visible = false
  222.       case @command_window.index
  223.       when 0
  224.         @buy_window.active = true
  225.         @buy_window.visible = true
  226.       when 1
  227.         @sell_window.active = true
  228.         @sell_window.visible = true
  229.         @status_window.visible = false
  230.       end
  231.       return
  232.     end
  233.     if Input.trigger?(Input::C)
  234.       $game_system.se_play($data_system.shop_se)
  235.       @number_window.active = false
  236.       @number_window.visible = false
  237.       case @command_window.index
  238.       when 0
  239.         $game_party.lose_gold(@number_window.number * @item.price)
  240.         case @item
  241.         when RPG::Item
  242.           $game_party.gain_item(@item.id, @number_window.number)
  243.         when RPG::Weapon
  244.           $game_party.gain_weapon(@item.id, @number_window.number)
  245.         when RPG::Armor
  246.           $game_party.gain_armor(@item.id, @number_window.number)
  247.         end
  248.         @gold_window.refresh
  249.         @buy_window.refresh
  250.         @status_window.refresh
  251.         @buy_window.active = true
  252.         @buy_window.visible = true
  253.       when 1
  254.         $game_party.gain_gold(@number_window.number * (@item.price / 2))
  255.         case @item
  256.         when RPG::Item
  257.           $game_party.lose_item(@item.id, @number_window.number)
  258.         when RPG::Weapon
  259.           $game_party.lose_weapon(@item.id, @number_window.number)
  260.         when RPG::Armor
  261.           $game_party.lose_armor(@item.id, @number_window.number)
  262.         end
  263.         @gold_window.refresh
  264.         @sell_window.refresh
  265.         @status_window.refresh
  266.         @sell_window.active = true
  267.         @sell_window.visible = true
  268.         @status_window.visible = false
  269.       end
  270.       return
  271.     end
  272.   end
  273. end




  274. class Window_ShopCommand < Window_Selectable
  275.   # ----------------------------------------
  276.   def initialize
  277.     super(0, 64, 480, 64)
  278.     self.contents = Bitmap.new(width - 32, height - 32)
  279.     @item_max = 3
  280.     @column_max = 3
  281.     @commands = ["购买", "卖出", "离开"]
  282.     self.contents.font.name = "黑体"
  283.     self.contents.font.size = 24
  284.     refresh
  285.     self.index = 0
  286.   end
  287.   # ----------------------------------------
  288.   def refresh
  289.     self.contents.clear
  290.     if $game_temp.shop_type == 0
  291.       for i in 0...@item_max
  292.       draw_item(i)
  293.       end
  294.     end
  295.     if $game_temp.shop_type == 1
  296.       self.contents.draw_text(4, 0, 324, 32, "这个商店里只能购买,不能卖出")
  297.       self.index = -1
  298.       update_cursor_rect
  299.     end
  300.     if $game_temp.shop_type == 2
  301.       self.contents.draw_text(4, 0, 324, 32, "这个商店里只能卖出,不能购买")
  302.       self.index = -1
  303.       update_cursor_rect
  304.     end
  305.   end
  306.   # ----------------------------------------
  307.   def draw_item(index)
  308.     x = 4 + index * 160
  309.     self.contents.draw_text(x, 0, 128, 32, @commands[index])
  310.   end
  311.   # ----------------------------------------
  312.   def update_cursor_rect
  313.     if $game_temp.shop_type == 0
  314.       super
  315.     end
  316.     if $game_temp.shop_type == 1 || $game_temp.shop_type == 2
  317.       self.cursor_rect.empty
  318.     end
  319.   end
  320. end
  321. class Game_Temp
  322.   # ----------------------------------------
  323.   attr_accessor :shop_type
  324.   alias ini initialize
  325.   def initialize
  326.     ini
  327.     @shop_type = 0
  328.   end
  329. end


  330. #==============================================================================
  331. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  332. #==============================================================================
复制代码


加什么才可以半透明?
加在哪?
版务信息:本贴由楼主自主结贴~

Lv1.梦旅人

梦石
0
星屑
50
在线时间
8 小时
注册时间
2008-5-1
帖子
236
2
 楼主| 发表于 2008-5-19 03:57:28 | 只看该作者
没人回答.....
回复 支持 反对

使用道具 举报

Lv1.梦旅人

辉瑞中国首席研究员<

梦石
0
星屑
50
在线时间
142 小时
注册时间
2008-1-18
帖子
2129
3
发表于 2008-5-19 04:07:09 | 只看该作者
先加下面两段

module XRXS_MP7_Module
  def create_spriteset
    @spriteset = Spriteset_Map.new
  end
  def dispose_spriteset
    @spriteset.dispose
  end
end


  include XRXS_MP7_Module
  alias xrxs_mp7_main main
  def main
   create_spriteset
    xrxs_mp7_main
    dispose_spriteset
  end



然后再在main中加@help_window.back_opacity = 100,其他窗口类似
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
来6r就是等某位仁兄的巨坑

褴褛着身行无端,囊中羞涩空心酸。
平生几无得意事,倒塔泡面宅寝室。
惟羡隔壁高帅富,雨露春风月夜声。
青丝无处觅其踪,只有硬盘苍井空。
莫云男儿空悲愁,鸿鹄岂不天际游。
坐断天下执鹿首,千百金帛万兜鍪。
夜深忽梦某年月,再见女神欲语迟。
吊丝终有逆袭日,木耳再无回粉时。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
8 小时
注册时间
2008-5-1
帖子
236
4
 楼主| 发表于 2008-5-19 04:08:33 | 只看该作者
  1. module XRXS_MP7_Module
  2. def create_spriteset
  3.    @spriteset = Spriteset_Map.new
  4. end
  5. def dispose_spriteset
  6.    @spriteset.dispose
  7. end
  8. end


  9. include XRXS_MP7_Module
  10. alias xrxs_mp7_main main
  11. def main
  12.   create_spriteset
  13.    xrxs_mp7_main
  14.    dispose_spriteset
  15. end

复制代码


加在哪
回复 支持 反对

使用道具 举报

Lv1.梦旅人

辉瑞中国首席研究员<

梦石
0
星屑
50
在线时间
142 小时
注册时间
2008-1-18
帖子
2129
5
发表于 2008-5-19 04:10:43 | 只看该作者
加在def main前
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
8 小时
注册时间
2008-5-1
帖子
236
6
 楼主| 发表于 2008-5-19 04:58:34 | 只看该作者
然后再在main中加@help_window.back_opacity = 100,其他窗口类似  

在哪加?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
8 小时
注册时间
2008-5-1
帖子
236
7
 楼主| 发表于 2008-5-19 05:01:59 | 只看该作者
可以了
谢谢
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-31 05:50

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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