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

Project1

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

那个。。。魔法商店脚本。。哪里有啊?

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
85 小时
注册时间
2008-3-30
帖子
45
跳转到指定楼层
1
发表于 2008-7-31 19:32:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
找到一个 用不起来啊 怎么回事
此贴于 2008-9-1 21:01:51 被版主火鸡三毛老大提醒,请楼主看到后对本贴做出回应。
版务信息:版主帮忙结贴~

Lv1.梦旅人

梦石
0
星屑
55
在线时间
85 小时
注册时间
2008-3-30
帖子
45
2
 楼主| 发表于 2008-7-31 19:34:03 | 只看该作者
  1. $mShop_use_1 = "金钱"    #——这项是购买魔法特技的货币的名称,如“灵魄”、“金钱”

  2. $mShop_use_2 = "G"  #——这项是购买魔法特技的货币单位,如“点”、“¥”

  3. $mShop_use_variable = 0  #——这项是购买魔法特技时消耗的变量编号,如果=0 则是消耗金钱

  4. $mShop_Window_Opacity = 200  #——这项是窗口透明度


  5. class Window_MGold < Window_Base

  6.   def initialize
  7.     super(0, 0, 272, 64)
  8.     self.contents = Bitmap.new(width - 32, height - 32)
  9.     refresh
  10.   end

  11.   def refresh
  12.     self.contents.clear
  13.     self.contents.font.color = system_color
  14.     self.contents.draw_text(0, 0 , 240,32 ,$mShop_use_1)
  15.     self.contents.font.color = normal_color
  16.     self.contents.draw_text(0, 0, 240-contents.text_size($mShop_use_2).width-6, 32, $mShop_gold.to_s, 2)
  17.     self.contents.font.color = system_color
  18.     self.contents.draw_text(0, 0, 240, 32, $mShop_use_2, 2)
  19.   end
  20. end

  21. class Scene_MShop < Scene_Base

  22.   def initialize(id)
  23.     @id = id
  24.   end  

  25.   def start
  26.     super
  27.     create_menu_background
  28.     if $mShop_use_variable == 0
  29.       $mShop_gold = $game_party.gold
  30.     else
  31.       $mShop_gold = $game_variables[$mShop_use_variable]
  32.     end
  33.     @help_window = Window_Help.new
  34.     @help_window.opacity = $mShop_Window_Opacity
  35.     @gold_window = Window_MGold.new
  36.     @gold_window.x = 0
  37.     @gold_window.y = 352
  38.     @gold_window.opacity = $mShop_Window_Opacity
  39.     @buy_window = Window_MShopBuy.new(@id)
  40.     @buy_window.active = true
  41.     @buy_window.visible = true
  42.     @buy_window.help_window = @help_window
  43.     @buy_window.opacity = $mShop_Window_Opacity
  44.     @status_window = Window_MShopStatus.new
  45.     @status_window.visible = true
  46.     @status_window.active = false
  47.     @status_window.opacity = $mShop_Window_Opacity
  48. end

  49. def terminate
  50.     @help_window.dispose
  51.     @gold_window.dispose
  52.     @buy_window.dispose
  53.     @status_window.dispose
  54.     dispose_menu_background
  55.   end

  56.   def update
  57.     @help_window.update
  58.     @gold_window.update
  59.     @buy_window.update
  60.     @status_window.update
  61.     if @buy_window.active
  62.       update_buy
  63.       return
  64.     end
  65.     if @status_window.active
  66.       update_status
  67.       return
  68.     end
  69.   end

  70.   def update_buy
  71.     @status_window.skill = @buy_window.skill
  72.     if Input.trigger?(Input::B)
  73.       Sound.play_cancel
  74.       $scene = Scene_Map.new
  75.       return
  76.     end
  77.     if Input.trigger?(Input::C)
  78.       @skill = @buy_window.skill
  79.       if @skill == nil or @skill.price > $mShop_gold
  80.         Sound.play_buzzer
  81.         return
  82.       end
  83.       Sound.play_decision
  84.       @buy_window.active = false
  85.       @status_window.index = 0
  86.       @status_window.active = true
  87.     end
  88.   end

  89.   def update_status
  90.     if Input.trigger?(Input::B)
  91.       Sound.play_cancel
  92.       @status_window.active = false
  93.       @status_window.index = -1
  94.       @buy_window.active = true
  95.     end
  96.     if Input.trigger?(Input::C)
  97.       if $game_party.members[@status_window.index].skill_learn?(@skill.id)
  98.         Sound.play_cancel
  99.       else
  100.         Sound.play_decision
  101.         if $mShop_use_variable == 0
  102.           $game_party.gain_gold([email protected])
  103.           $mShop_gold -= @skill.price
  104.         else
  105.           $game_variables[$mShop_use_variable] -= @skill.price
  106.           $mShop_gold -= @skill.price
  107.         end
  108.         $game_party.members[@status_window.index].learn_skill(@skill.id)
  109.         @gold_window.refresh
  110.         @buy_window.refresh
  111.         @status_window.refresh
  112.         @status_window.active = false
  113.         @status_window.index = -1
  114.         @buy_window.active = true
  115.       end      
  116.     end   
  117.   end
  118. end

  119. class Window_MShopStatus < Window_Selectable

  120.   def initialize
  121.     super(272, 56, 272, 360)
  122.      @skill = nil
  123.     @top_row = 0
  124.     refresh
  125.   end

  126.   def refresh
  127.     create_contents
  128.     self.contents.clear
  129.     self.contents.font.size = 18
  130.     for i in 0...$game_party.members.size
  131.       actor = $game_party.members[i]
  132.       draw_actor_graphic(actor,12,80*i+64)
  133.       self.contents.font.color = system_color
  134.       self.contents.draw_text(44, 80*i, 240, 32, actor.name)
  135.       self.contents.draw_text(0, 80*i , 240-20,32,"等级",2)
  136.       self.contents.font.color = normal_color
  137.       self.contents.draw_text(0, 80*i, 240, 32, actor.level.to_s , 2)
  138.       self.contents.font.color = system_color
  139.       self.contents.draw_text(44, 80*i+22, 45, 32, Vocab::hp)
  140.       self.contents.font.color = normal_color
  141.       self.contents.draw_text(44, 80*i+22, 90, 32, actor.maxhp.to_s,2)
  142.       self.contents.font.color = system_color
  143.       self.contents.draw_text(150, 80*i+22, 45, 32, Vocab::mp)
  144.       self.contents.font.color = normal_color
  145.       self.contents.draw_text(150, 80*i+22, 90, 32, actor.maxmp.to_s,2)      
  146.       if actor.skill_learn?(@skill.id)
  147.         self.contents.font.color = Color.new(255,255,255,128)
  148.         self.contents.draw_text(44, 80*i+44, 196, 32, "⊙此项特技已经学习⊙",2)        
  149.       else
  150.         self.contents.font.color = Color.new(255,255,0,255)
  151.         self.contents.draw_text(44, 80*i+44, 240, 32, "★此项特技尚未学习★")
  152.       end
  153.     end
  154.     @item_max = $game_party.members.size
  155.   end

  156.   def skill=(skill)
  157.     if @skill != skill
  158.       @skill = skill
  159.       refresh
  160.     end
  161.   end
  162.   
  163.   def update_cursor
  164.     if @index < 0            
  165.       self.cursor_rect.empty
  166.     else
  167.       self.cursor_rect.set(0, @index * 80, contents.width, 80)
  168.     end
  169.     self.refresh
  170.   end
  171. end
  172. class Window_MShopBuy < Window_Selectable

  173.   def initialize(id)
  174.     super(0, 56, 272, 296)
  175.     @id = id
  176.     refresh
  177.     self.index = 0
  178.   end

  179.   def skill
  180.     return @data[self.index]
  181.   end

  182.   def refresh
  183.     self.contents.clear
  184.     @data = []
  185.     for skill_id in @id
  186.       skill = $data_skills[skill_id]
  187.       if skill != nil
  188.         @data.push(skill)
  189.       end
  190.     end
  191.     @item_max = @data.size
  192.     create_contents
  193.     if @item_max > 0
  194.       self.contents = Bitmap.new(width - 32, row_max * 32)
  195.       for i in 0...@item_max
  196.         draw_item(i)
  197.       end
  198.     end
  199.   end

  200.   def draw_item(index)
  201.     rect = item_rect(index)
  202.     self.contents.clear_rect(rect)
  203.     skill = @data[index]
  204.     if skill != nil
  205.       rect.width -= 4
  206.       if $mShop_gold < skill.price
  207.         enabled = false
  208.       else
  209.         enabled = true
  210.       end
  211.       draw_item_name(skill, rect.x, rect.y, enabled)
  212.       self.contents.draw_text(rect, skill.price.to_s , 2)
  213.     end
  214.   end

  215.   def update_help
  216.     @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  217.   end
  218. end

  219. module RPG
  220.   class Skill
  221.     def description
  222.       description = @description.split(/@/)[0]
  223.       return description != nil ? description : ''
  224.     end
  225.     def price
  226.       price = @description.split(/@/)[1]
  227.       return price != nil ? price.to_i : 0
  228.     end
  229.   end
  230. end
复制代码





这个用不起来啊 怎么用啊?
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-7-26
帖子
14
3
发表于 2008-7-31 23:58:26 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

名侦探小柯

梦石
0
星屑
3417
在线时间
3628 小时
注册时间
2006-9-6
帖子
37402

开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

4
发表于 2008-8-1 00:17:18 | 只看该作者
http://rpg.blue/viewthread.php?tid=80588&ntime=2008%2D7%2D31+16%3A17%3A03 [LINE]1,#dddddd[/LINE]系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-21 00:10

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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