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

Project1

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

[已经解决] 怎么制作魔法商店求教QAQ

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-12-22
帖子
78
跳转到指定楼层
1
发表于 2013-12-24 22:11:40 | 只看该作者 |只看大图 回帖奖励 |正序浏览 |阅读模式

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

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

x
有脚本但是要怎么用啊,百度上都没有制作教程QAQ求好心人路过教教我

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

9
发表于 2013-12-28 20:18:03 | 只看该作者
你是说购买技能书还是直接买技能?两种不是一个概念···
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

8
发表于 2013-12-28 20:17:19 | 只看该作者
你是说购买技能书还是直接买技能?两种不是一个概念···
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-12-22
帖子
78
7
 楼主| 发表于 2013-12-26 23:56:46 | 只看该作者
美丽晨露 发表于 2013-12-25 22:22
以上是脚本
$mShop_use_1 = "游戏币"    #——这项是购买魔法特技的货币的名称,如“灵魄”、“金钱”
$mS ...

谢谢!!!!!
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (版主)

梦石
20
星屑
1840
在线时间
6925 小时
注册时间
2012-12-14
帖子
11485

短篇十战斗者组别冠军开拓者贵宾短篇九勇士组亚军

6
发表于 2013-12-25 22:22:29 | 只看该作者
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================
  4. #==============================================================================
  5. #——以下是一些自定义的内容
  6. $mShop_use_1 = "游戏币"    #——这项是购买魔法特技的货币的名称,如“灵魄”、“金钱”
  7. $mShop_use_2 = "点"  #——这项是购买魔法特技的货币单位,如“点”、“¥”
  8. $mShop_use_variable = 1  #——这项是购买魔法特技时消耗的变量编号,如果=0 则是消耗金钱
  9. $mShop_Window_Opacity = 200  #——这项是窗口透明度
  10. #==============================================================================
  11. # ■ Window_MGold
  12. #------------------------------------------------------------------------------
  13. #  显示金钱的窗口。
  14. #==============================================================================
  15. class Window_MGold < Window_Base
  16.   #--------------------------------------------------------------------------
  17.   # ● 初始化窗口
  18.   #--------------------------------------------------------------------------
  19.   def initialize
  20.     super(0, 0, 272, 64)
  21.     self.contents = Bitmap.new(width - 32, height - 32)  
  22.     refresh
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ● 刷新
  26.   #--------------------------------------------------------------------------
  27.   def refresh
  28.     self.contents.clear
  29.     self.contents.font.color = system_color
  30.     self.contents.draw_text(4, 0, 120, 32 ,$mShop_use_1)
  31.     self.contents.font.color = normal_color
  32.     self.contents.draw_text(0, 0, 240-contents.text_size($mShop_use_2).width-6, 32, $mShop_gold.to_s, 2)
  33.     self.contents.font.color = system_color
  34.     self.contents.draw_text(4, 32, 120, 32, $mShop_use_2, 2)
  35.   end
  36. end
  37. #==============================================================================
  38. # ■ Scene_MShop
  39. #------------------------------------------------------------------------------
  40. #  处理特技商店画面的类。
  41. #==============================================================================
  42. class Scene_MShop
  43.   #--------------------------------------------------------------------------
  44.   # ● 初始化
  45.   #--------------------------------------------------------------------------
  46.   def initialize(id)
  47.     @id = id
  48.   end   
  49.   #--------------------------------------------------------------------------
  50.   # ● 主处理
  51.   #--------------------------------------------------------------------------
  52.   def main
  53.     screen = Spriteset_Map.new
  54.     if $mShop_use_variable == 0
  55.       $mShop_gold = $game_party.gold
  56.     else
  57.       $mShop_gold = $game_variables[$mShop_use_variable]
  58.     end
  59.     # 生成帮助窗口
  60.     @help_window = Window_Help.new
  61.     @help_window.opacity = $mShop_Window_Opacity
  62.     # 生成金钱窗口
  63.     @gold_window = Window_MGold.new
  64.     @gold_window.x = 368
  65.     @gold_window.y = 416
  66.     @gold_window.opacity = $mShop_Window_Opacity
  67.     # 生成购买窗口
  68.     @buy_window = Window_MShopBuy.new(@id)
  69.     @buy_window.active = true
  70.     @buy_window.visible = true
  71.     @buy_window.help_window = @help_window
  72.     @buy_window.opacity = $mShop_Window_Opacity
  73.     # 生成状态窗口
  74.     @status_window = Window_MShopStatus.new
  75.     @status_window.visible = true
  76.     @status_window.active = false
  77.     @status_window.opacity = $mShop_Window_Opacity
  78.     # 执行过渡
  79.     Graphics.transition
  80.     # 主循环
  81.     loop do
  82.       # 刷新游戏画面
  83.       Graphics.update
  84.       # 刷新输入信息
  85.       Input.update
  86.       # 刷新画面
  87.       update
  88.       # 如果画面切换的话就中断循环
  89.       if $scene != self
  90.         break
  91.       end
  92.     end
  93.     # 准备过渡
  94.     Graphics.freeze
  95.     # 释放窗口
  96.     @help_window.dispose
  97.     #@mhelp_window.dispose
  98.     @gold_window.dispose
  99.     @buy_window.dispose
  100.     @status_window.dispose
  101.     screen.dispose
  102.   end
  103.   #--------------------------------------------------------------------------
  104.   # ● 刷新画面
  105.   #--------------------------------------------------------------------------
  106.   def update
  107.     # 刷新窗口
  108.     @help_window.update
  109.     #@mhelp_window.update
  110.     @gold_window.update
  111.     @buy_window.update
  112.     @status_window.update
  113.     # 购买窗口激活的情况下: 调用 update_buy
  114.     if @buy_window.active
  115.       update_buy
  116.       return
  117.     end
  118.     if @status_window.active
  119.       update_status
  120.       return
  121.     end
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # ● 刷新画面 (购买窗口激活的情况下)
  125.   #--------------------------------------------------------------------------
  126.   def update_buy
  127.     @status_window.skill = @buy_window.skill
  128.     if Input.trigger?(Input::B)
  129.       $game_system.se_play($data_system.cancel_se)
  130.       $scene = Scene_Map.new
  131.       return
  132.     end
  133.     if Input.trigger?(Input::C)
  134.       [url=home.php?mod=space&uid=260100]@skill[/url] = @buy_window.skill
  135.       if [url=home.php?mod=space&uid=260100]@skill[/url] == nil or @skill.price > $mShop_gold
  136.         $game_system.se_play($data_system.buzzer_se)
  137.         return
  138.       end
  139.       $game_system.se_play($data_system.decision_se)
  140.       @buy_window.active = false
  141.       @status_window.index = 0
  142.       @status_window.active = true
  143.     end
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # ● 刷新画面 (状态窗口激活的情况下)
  147.   #--------------------------------------------------------------------------
  148.   def update_status
  149.     if Input.trigger?(Input::B)
  150.       $game_system.se_play($data_system.cancel_se)
  151.       @status_window.active = false
  152.       @status_window.index = -1
  153.       @buy_window.active = true
  154.     end
  155.     if Input.trigger?(Input::C)
  156.       if $game_party.actors[@status_window.index].skill_learn?(@skill.id)
  157.         $game_system.se_play($data_system.cancel_se)
  158.         return
  159.       else
  160.         $game_system.se_play($data_system.decision_se)
  161.         if $mShop_use_variable == 0
  162.           $game_party.gain_gold([email protected])
  163.           $mShop_gold -= @skill.price
  164.         else
  165.           $game_variables[$mShop_use_variable] -= @skill.price
  166.           $mShop_gold -= @skill.price
  167.         end
  168.         $game_party.actors[@status_window.index].learn_skill(@skill.id)
  169.         @gold_window.refresh
  170.         @buy_window.refresh
  171.         @status_window.refresh
  172.         @status_window.active = false
  173.         @status_window.index = -1
  174.         @buy_window.active = true
  175.       end      
  176.     end     
  177.   end
  178. end
  179. #==============================================================================
  180. # ■ Window_MShopStatus
  181. #------------------------------------------------------------------------------
  182. #  特技商店画面、显示物品所持数与角色装备的窗口。
  183. #==============================================================================
  184. class Window_MShopStatus < Window_Selectable
  185.   #--------------------------------------------------------------------------
  186.   # ● 初始化对像
  187.   #--------------------------------------------------------------------------
  188.   def initialize
  189.     super(368, 64, 272, 352)
  190.     self.contents = Bitmap.new(width - 32, height - 32)
  191.     self.contents.font.size = 18
  192.     @skill = nil
  193.     refresh
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ● 刷新
  197.   #--------------------------------------------------------------------------
  198.   def refresh
  199.     self.contents.clear
  200.     for i in 0...$game_party.actors.size
  201.       actor = $game_party.actors[i]
  202.       draw_actor_graphic(actor,12,80*i+64)
  203.       self.contents.font.color = system_color
  204.       self.contents.draw_text(44, 80*i, 240, 32, actor.name)
  205.       self.contents.draw_text(0, 80*i , 240-20,32,"等级",2)
  206.       self.contents.font.color = normal_color
  207.       self.contents.draw_text(0, 80*i, 240, 32, actor.level.to_s , 2)
  208.       self.contents.font.color = system_color
  209.       self.contents.draw_text(44, 80*i+22, 45, 32, $data_system.words.hp)
  210.       self.contents.font.color = normal_color
  211.       self.contents.draw_text(44, 80*i+22, 90, 32, actor.maxhp.to_s,2)
  212.       self.contents.font.color = system_color
  213.       self.contents.draw_text(150, 80*i+22, 45, 32, $data_system.words.sp)
  214.       self.contents.font.color = normal_color
  215.       self.contents.draw_text(150, 80*i+22, 90, 32, actor.maxsp.to_s,2)      
  216.       if actor.skill_learn?(@skill.id)
  217.         self.contents.font.color = Color.new(255,255,255,128)
  218.         self.contents.draw_text(44, 80*i+44, 196, 32, "⊙此项魔法已经学习⊙",2)         
  219.       else
  220.         self.contents.font.color = Color.new(255,255,0,255)
  221.         self.contents.draw_text(44, 80*i+44, 240, 32, "★此项魔法尚未学习★")
  222.       end
  223.     end
  224.     @item_max = $game_party.actors.size
  225.   end
  226.   #--------------------------------------------------------------------------
  227.   # ● 设置物品
  228.   #     item : 新的物品
  229.   #--------------------------------------------------------------------------
  230.   def skill=(skill)
  231.     if @skill != skill
  232.       @skill = skill
  233.       refresh
  234.     end
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ● 刷新光标矩形
  238.   #--------------------------------------------------------------------------
  239.   def update_cursor_rect
  240.     if [url=home.php?mod=space&uid=370741]@Index[/url] < 0
  241.       self.cursor_rect.empty
  242.     else
  243.       self.cursor_rect.set(0, [url=home.php?mod=space&uid=370741]@Index[/url] * 80, self.width - 32, 80)
  244.     end
  245.   end
  246. end
  247. #==============================================================================
  248. # ■ Window_MShopBuy
  249. #------------------------------------------------------------------------------
  250. #  特技商店画面、浏览显示可以购买的商品的窗口。
  251. #==============================================================================
  252. class Window_MShopBuy < Window_Selectable
  253.   #--------------------------------------------------------------------------
  254.   # ● 初始化对像
  255.   #     shop_goods : 商品
  256.   #--------------------------------------------------------------------------
  257.   def initialize(id)
  258.     super(0, 64, 368, 416)
  259.     @id = id
  260.     refresh
  261.     self.index = 0
  262.   end
  263.   #--------------------------------------------------------------------------
  264.   # ● 获取物品
  265.   #--------------------------------------------------------------------------
  266.   def skill
  267.     return @data[self.index]
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # ● 刷新
  271.   #--------------------------------------------------------------------------
  272.   def refresh
  273.     if self.contents != nil
  274.       self.contents.dispose
  275.       self.contents = nil
  276.     end
  277.     @data = []
  278.     for skill_id in @id
  279.       skill = $data_skills[skill_id]
  280.       if skill != nil
  281.         @data.push(skill)
  282.       end
  283.     end
  284.     @item_max = @data.size
  285.     if @item_max > 0
  286.       self.contents = Bitmap.new(width - 32, row_max * 32)
  287.       for i in 0...@item_max
  288.         draw_item(i)
  289.       end
  290.     end
  291.   end
  292.   #--------------------------------------------------------------------------
  293.   # ● 描绘羡慕
  294.   #     index : 项目编号
  295.   #--------------------------------------------------------------------------
  296.   def draw_item(index)
  297.     skill = @data[index]
  298.     # 除此之外的情况设置为无效文字色
  299.     if skill.price <= $mShop_gold
  300.       self.contents.font.color = normal_color
  301.     else
  302.       self.contents.font.color = disabled_color
  303.     end
  304.     x = 4
  305.     y = index * 32
  306.     rect = Rect.new(x, y, self.width - 32, 32)
  307.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  308.     bitmap = RPG::Cache.icon(skill.icon_name)
  309.     opacity = self.contents.font.color == normal_color ? 255 : 128
  310.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  311.     self.contents.draw_text(x + 28, y, 212, 32, skill.name, 0)
  312.     self.contents.draw_text(x + 240, y, 88, 32, skill.price.to_s, 2)
  313.   end
  314.   #--------------------------------------------------------------------------
  315.   # ● 刷新帮助文本
  316.   #--------------------------------------------------------------------------
  317.   def update_help
  318.     @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  319.   end
  320. end
  321. #==============================================================================
  322. # ■ RPG原装定义
  323. #==============================================================================
  324. module RPG
  325.   class Skill
  326.     def description
  327.       description = @description.split(/@/)[0]
  328.       return description != nil ? description : ''
  329.     end
  330.     def price
  331.       price = @description.split(/@/)[1]
  332.       return price != nil ? price.to_i : 0
  333.     end
  334.   end
  335. end
  336. #==============================================================================
  337. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  338. #==============================================================================
复制代码
以上是脚本
$mShop_use_1 = "游戏币"    #——这项是购买魔法特技的货币的名称,如“灵魄”、“金钱”
$mShop_use_2 = "点"  #——这项是购买魔法特技的货币单位,如“点”、“¥”
$mShop_use_variable = 1  #——这项是购买魔法特技时消耗的变量编号,如果=0 则是消耗金钱  设置魔法商店使用货币的变量
$mShop_Window_Opacity = 200  #——这项是窗口透明度

设定价格:

在物品说明后面写入@+价格

呼出商店
$scene = Scene_MShop.new([技能序号,技能序号]) #既是卖出的魔法种类
比如:$scene = Scene_MShop.new([81,82,101,102,
103,104,105,106,107,108,109,110])   

评分

参与人数 1星屑 +150 收起 理由
myownroc + 150 认可答案

查看全部评分

大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-12-22
帖子
78
5
 楼主| 发表于 2013-12-25 21:12:17 | 只看该作者
恋′挂机 发表于 2013-12-25 05:24
柳柳好像有篇教程可以看下
下载黑暗圣剑传说

我去看了下,我有那个脚本,但不知道怎么用啊,你能教下我吗?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

薄凉看客

梦石
0
星屑
50
在线时间
1269 小时
注册时间
2010-6-20
帖子
1316
4
发表于 2013-12-25 05:24:34 | 只看该作者
柳柳好像有篇教程可以看下
下载黑暗圣剑传说
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-12-22
帖子
78
3
 楼主| 发表于 2013-12-24 22:35:43 | 只看该作者
xp版本的QAQ求教啊啊啊啊 啊啊啊啊啊

评分

参与人数 1星屑 -10 收起 理由
myownroc -10 连帖

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-12-22
帖子
78
2
 楼主| 发表于 2013-12-24 22:29:31 | 只看该作者
求好心人经过教教我QAQ求求求
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-30 10:18

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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