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

Project1

 找回密码
 注册会员
搜索
楼主: 雪流星
打印 上一主题 下一主题

[原创发布] 道具名称产生器(V2爆发完成)

 关闭 [复制链接]

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

21
 楼主| 发表于 2008-1-5 20:19:22 | 只看该作者
谢谢支持

Version 2 进度报告

新增自订尾字功能(也就是可以一次生产56个刀的名字或是剑的名字)
新增常用字词数组,减少怪名产生机率
新增西方名称产生
新增选项功能
新增产生名称数目功能
新增分隔号选项
新增物品名称分类变色(这样按「随机」产生时就能够分辨不同类型的物品了)

修改了一些算法

大致上是已经写好了,之所以还没发出是因为正在打(还有想)字词库

大家给一些意见吧
以前面已发出看似乱打的字词库看看还能再多加什麽字
还有复字的字词库(如:凤凰、蝙蝠…等)


发一张V2的截图:
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
95
在线时间
49 小时
注册时间
2006-5-7
帖子
526
22
发表于 2008-1-6 02:52:23 | 只看该作者
有些名字好有创意,,,,,,,,,,,
回复 支持 反对

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

23
 楼主| 发表于 2008-1-6 18:28:56 | 只看该作者
{/gg}{/tp}

………你们还没看过更劲爆的吧

他勃之刃
恨芽绿短之盾
忘粗赤笔
软狼功
阴帝窄紫棍

这都是些什麽名字阿~~~
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

24
 楼主| 发表于 2008-1-6 20:27:19 | 只看该作者
以下引用pkboy9999于2008-1-6 11:54:25的发言:
下载以后打开里面没有文字~
汗..

什么原因呢?


没有文字?什麽意思?是说有看到窗口但沒看到字吗?
如果是的话大概是字体的问题
用RMXP打开
把main和脚本里的SimHei改成「黑体」看看
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv1.梦旅人

狼女

梦石
0
星屑
64
在线时间
49 小时
注册时间
2007-7-12
帖子
579
25
发表于 2008-1-6 23:02:29 | 只看该作者
咦?这也行?
真是个好东东啊~~~话说某人对取名字是最头痛的拉~~~
回复 支持 反对

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

26
 楼主| 发表于 2008-1-8 08:21:34 | 只看该作者
进度报告:

修改了选字的机率,比较不会出现一些很 囧rz 的名字了
大家给点意见:


那些*号是我在测试机率用的,截图时忘了移除{/tp}
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
56
在线时间
190 小时
注册时间
2006-2-8
帖子
85
27
发表于 2008-1-8 09:39:31 | 只看该作者
太强。。。不错。。
正好我需要这个。。。我想说就是你太强悍!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

Poison·

梦石
0
星屑
50
在线时间
83 小时
注册时间
2007-8-30
帖子
2391
28
发表于 2008-1-8 11:29:09 | 只看该作者
生出的名字比较搞笑。。。。
回复 支持 反对

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

29
 楼主| 发表于 2008-1-10 20:40:49 | 只看该作者
{/cy}{/cy}{/cy}

Version 2爆发完成
虽然还是会出现 囧崮rz 的名称
毕竟只是乱数选出来的字

这个生产器的本意就是激发大加的灵感
所以大家还是把生产出来的名称作为灵感来源


道具名称产生器V2爆发

选尾字画面:


设定画面:


生产320个名称的画面:


VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

30
 楼主| 发表于 2008-1-10 20:52:29 | 只看该作者
主脚本

  1. class Scene_NameGen
  2.   def main
  3.     # 产生命令窗口
  4.     @command_window = Window_Command.new(250, ["输出为文本", "选择", "离开", "设定", "重新产生"])
  5.     @command_window.x = 320 - @command_window.width
  6.     @command_window.y = 240 - @command_window.height
  7.     @command_window.z = 300
  8.     @command_window.index = 0
  9.     @command_window.visible = false
  10.     @command_window.active = false
  11.    
  12.     # 产生询问窗口
  13.     @ask_window = Window_Base.new(120, 188, 400, 64)
  14.     @ask_window.contents = Bitmap.new(368, 32)
  15.     string = "要生产哪种名称:"
  16.     @ask_window.contents.font.name = "SimHei"
  17.     @ask_window.contents.font.size = 24
  18.     @ask_window.contents.draw_text(4, 0, 368, 32, string)
  19.     @ask_window.visible = true
  20.     @ask_window.z = 1500
  21.    
  22.     # 产生选择窗口
  23.     @select_window = Window_Command.new(200, ["随机", "武器/武功", "物品", "装备", "技能", "自定义尾字"])
  24.     @select_window.visible = true
  25.     @select_window.active = true
  26.     @select_window.index = 0
  27.     @select_window.x = 290
  28.     @select_window.y = 235
  29.     @select_window.z = 1500
  30.    
  31.     # 产生询问窗口
  32.     @check_window = Window_Base.new(120, 188, 400, 64)
  33.     @check_window.contents = Bitmap.new(368, 32)
  34.     string = "已选择名称, 是否要放弃?"
  35.     @check_window.contents.font.name = "SimHei"
  36.     @check_window.contents.font.size = 24
  37.     @check_window.contents.draw_text(4, 0, 368, 32, string)
  38.     @check_window.visible = false
  39.     @check_window.z = 1500
  40.    
  41.     # 产生选择窗口
  42.     @check_sel_window = Window_Command.new(200, ["放弃", "输出为文本"])
  43.     @check_sel_window.visible = false
  44.     @check_sel_window.active = false
  45.     @check_sel_window.index = 0
  46.     @check_sel_window.x = 290
  47.     @check_sel_window.y = 235
  48.     @check_sel_window.z = 1500

  49.     # 产生尾字选择窗口
  50.     @end_select_window = Window_EndSel.new
  51.     @end_select_window.index = 0
  52.     @end_select_window.visible = false
  53.     @end_select_window.active = false
  54.     @end_select_window.z = 300
  55.    
  56.     # 产生名称产生窗口
  57.     @name_window = Window_NameGen.new
  58.     @name_window.x = 0
  59.     @name_window.y = 0
  60.     @name_window.index = -5
  61.     @name_window.active = false
  62.    

  63.     # 执行过渡
  64.     Graphics.transition
  65.     # 主循环
  66.     loop do
  67.       # 刷新游戏画面
  68.       Graphics.update
  69.       # 刷新输入情报
  70.       Input.update
  71.       # 刷新画面
  72.       update
  73.       # 如果画面切换的话就中断循环
  74.       if $scene != self
  75.         break
  76.       end
  77.     end
  78.     # 准备过渡
  79.     Graphics.freeze
  80.     # 释放窗口
  81.     @command_window.dispose
  82.     @ask_window.dispose
  83.     @select_window.dispose
  84.     @name_window.dispose
  85.     @end_select_window.dispose
  86.     # 如果在标题画面切换中的情况下
  87.     if $scene.is_a?(Scene_Title)
  88.       # 淡入淡出画面
  89.       Graphics.transition
  90.       Graphics.freeze
  91.     end
  92.   end
  93.   
  94.   #--------------------------------------------------------------------------
  95.   # * 更新画面
  96.   #--------------------------------------------------------------------------
  97.   def update
  98.     # 更新窗口
  99.     @command_window.update
  100.     @ask_window.update
  101.     @select_window.update
  102.     @name_window.update
  103.     @end_select_window.update
  104.     @check_sel_window.update
  105.    
  106.     # 命令窗口被激活的情况下: 调用 update_command
  107.     if @command_window.active
  108.       update_command
  109.       return
  110.     end

  111.     # 选择窗口被激活的情况下: 调用 update_select
  112.     if @select_window.active
  113.       update_select
  114.       return
  115.     end
  116.    
  117.     # 尾字选择窗口被激活的情况下: 调用 update_select
  118.     if @end_select_window.active
  119.       update_end
  120.       return
  121.     end
  122.    
  123.     # 离开确认被激活的情况下: 调用 update_select
  124.     if @check_sel_window.active
  125.       update_check
  126.       return
  127.     end
  128.         
  129.     # 选择窗口被激活的情况下: 调用 update_name
  130.     if @name_window.active
  131.       update_name
  132.       return
  133.     end
  134.   end
  135.   
  136.   # 更新命令窗口
  137.   def update_command
  138.     # 按下 C 键的情况下
  139.     if Input.trigger?(Input::C)
  140.       # 演奏确定 SE
  141.       $game_system.se_play($data_system.decision_se)
  142.       case @command_window.index
  143.       when 0 # 输出为文本
  144.         @name_window.output_text
  145.         @command_window.visible = false
  146.         @command_window.active = false
  147.         @name_window.active = true
  148.       when 1 # 选择
  149.         @name_window.active = true
  150.         @name_window.index = 0
  151.         @command_window.visible = false
  152.         @command_window.active = false
  153.       when 2 # 离开
  154.         if @name_window.exit_program?
  155.           exit
  156.         else
  157.           @check_sel_window.active = true
  158.           @check_sel_window.visible = true
  159.           @check_window.visible = true
  160.           @command_window.active = false
  161.         end
  162.       when 3 # 设定
  163.         $scene = Scene_NameGen_Setup.new
  164.       when 4 # 重新产生
  165.         @ask_window.visible = true
  166.         @select_window.active = true
  167.         @select_window.visible = true
  168.         @command_window.visible = false
  169.         @command_window.active = false
  170.       end
  171.       return
  172.     end # end if Input.trigger?(Input::C)
  173.    
  174.     if Input.trigger?(Input::B)
  175.       # 演奏取消 SE
  176.       $game_system.se_play($data_system.cancel_se)
  177.       # 无效化命令窗口
  178.       @command_window.visible = false
  179.       @command_window.active = false
  180.       @name_window.active = true
  181.       return
  182.     end
  183.   end
  184.   
  185.   # 更新选择窗口
  186.   def update_select
  187.     # 按下 C 键的情况下
  188.     if Input.trigger?(Input::C)
  189.       # 演奏确定 SE
  190.       $game_system.se_play($data_system.decision_se)
  191.       # 產生名稱
  192.       unless @select_window.index == 5
  193.         @name_window.generate(@select_window.index)
  194.         @name_window.active = true
  195.       else
  196.         @end_select_window.active = true
  197.         @end_select_window.visible = true
  198.       end
  199.       
  200.       # 无效化选择窗口
  201.       @ask_window.visible = false
  202.       @select_window.active = false
  203.       @select_window.visible = false
  204.       return
  205.     end # end if Input.trigger?(Input::C)
  206.   end
  207.   
  208.   def update_end
  209.     # 按下 C 键的情况下
  210.     if Input.trigger?(Input::C)
  211.       # 演奏确定 SE
  212.       $game_system.se_play($data_system.decision_se)
  213.       # 获取尾字
  214.       end_word = @end_select_window.end_word
  215.       if  end_word != "武器/武功" and end_word != "物品" and
  216.         end_word != "裝備" and end_word != "技能"
  217.         $end_word = @end_select_window.end_word
  218.         # 产生名称
  219.         @name_window.generate(@end_select_window.type(@end_select_window.index))
  220.         @name_window.active = true
  221.         # 无效化尾字选择窗口
  222.         @end_select_window.active = false
  223.         @end_select_window.visible = false
  224.       else
  225.         # 演奏冻结 SE
  226.         $game_system.se_play($data_system.buzzer_se)
  227.       end
  228.       return
  229.     end
  230.    
  231.     # 按下 B 键的情况下
  232.     if Input.trigger?(Input::B)
  233.       # 演奏取消 SE
  234.       $game_system.se_play($data_system.cancel_se)
  235.       # 无效化尾字选择窗口
  236.       @end_select_window.active = false
  237.       @end_select_window.visible = false
  238.       # 有效化命令窗口
  239.       @ask_window.visible = true
  240.       @select_window.active = true
  241.       @select_window.visible = true
  242.       @select_window.index = 5
  243.       return
  244.     end
  245.   end
  246.   
  247.   def update_name
  248.     # 按下 C 键的情况下
  249.     if Input.trigger?(Input::C)
  250.       # 演奏确定 SE
  251.       $game_system.se_play($data_system.decision_se)
  252.       # 纪录文字
  253.       @name_window.input_text(@name_window.index)
  254.       return
  255.     end
  256.    
  257.     # 按下 B 键的情况下
  258.     if Input.trigger?(Input::B)
  259.       # 演奏取消 SE
  260.       $game_system.se_play($data_system.cancel_se)
  261.       # 有效化命令窗口
  262.       @command_window.active = true
  263.       @command_window.visible = true
  264.       # 无效化名称产生窗口
  265.       @name_window.active = false
  266.       @name_window.index = -5
  267.       return
  268.     end
  269.   end
  270.   
  271.   def update_check
  272.     # 按下 C 键的情况下
  273.     if Input.trigger?(Input::C)
  274.       # 演奏确定 SE
  275.       $game_system.se_play($data_system.decision_se)
  276.       case @check_sel_window.index
  277.       when 0 # 放弃
  278.         exit
  279.       when 1 # 输出为文本
  280.         @name_window.output_text
  281.         @command_window.visible = false
  282.         @command_window.visible = false
  283.         @name_window.active = false
  284.       end
  285.       return
  286.     end
  287.    
  288.     # 按下 B 键的情况下
  289.     if Input.trigger?(Input::B)
  290.       # 演奏取消 SE
  291.       $game_system.se_play($data_system.cancel_se)
  292.       # 有效化命令窗口
  293.       @command_window.active = true
  294.       @command_window.visible = true
  295.       # 无效化产生窗口
  296.       @check_sel_window.active = false
  297.       @check_sel_window.visible = false
  298.       @check_window.visible = false
  299.       return
  300.     end
  301.   end
  302. end

  303. class Window_NameGen < Window_Selectable
  304.   #--------------------------------------------------------------------------
  305.   # ● 初始化窗口
  306.   #--------------------------------------------------------------------------
  307.   def initialize
  308.     super(0, 0, 640, 480)
  309.     @column_max = 4
  310.     @item_max = $generator
  311.     @name_selected = ""
  312.     self.index = 0
  313.     self.contents = Bitmap.new(width - 32, $generator / 4 * 32)
  314.   end

  315.   # 生产
  316.   def generate(etype)
  317.     self.contents.font.color = system_color
  318.     self.contents.clear
  319.    
  320.     # 資料分析
  321.     i = 0
  322.     @name = []
  323.     type = etype
  324.     material_1_rand = $material_1.size
  325.     material_2_rand = $material_2.size
  326.     color_rand = $color_name.size
  327.     chara_rand = $chara_name.size
  328.     pattern_rand = $pattern_name.size
  329.     weapon_rand = $weapon_name.size
  330.     item_rand = $item_name.size
  331.     equip_rand = $equip_name.size
  332.     skill_rand = $skill_name.size
  333.     doubled_rand = $doubled_name.size
  334.     trans_rand = $trans_name.size
  335.     trans2_rand = $trans_name_2.size

  336.     while i < $generator
  337.       # 确认产生类型尾字
  338.       type = rand(4)+1 if etype == 0
  339.       case type
  340.       when 1
  341.         end_word = $weapon_name[rand(weapon_rand)]
  342.       when 2
  343.         end_word = $item_name[rand(item_rand)]
  344.       when 3
  345.         end_word = $equip_name[rand(equip_rand)]
  346.       when 4
  347.         end_word = $skill_name[rand(skill_rand)]
  348.       when 51, 52, 53, 54
  349.         end_word = $end_word
  350.       end
  351.       
  352.       # 设置颜色
  353.       case type
  354.       when 1, 51
  355.         self.contents.font.color = $weapon_color
  356.       when 2, 52
  357.         self.contents.font.color = $item_color
  358.       when 3, 53
  359.         self.contents.font.color = $equip_color
  360.       when 4, 54
  361.         self.contents.font.color = $skill_color
  362.       end
  363.       
  364.       # 随机数选择文字
  365.       mat_word_1a  = $material_1[rand(material_1_rand)]
  366.       mat_word_2a  = $material_2[rand(material_2_rand)]
  367.       mat_word_1b  = $material_1[rand(material_1_rand)]
  368.       mat_word_2b  = $material_2[rand(material_2_rand)]
  369.       color_word   = $color_name[rand(color_rand)]
  370.       chara_word   = $chara_name[rand(chara_rand)]
  371.       pattern_word = $pattern_name[rand(pattern_rand)]
  372.       trans_word   = $trans_name[rand(trans_rand)]

  373.       # 随机数排列
  374.       case rand(15)
  375.       when 0, 1, 2
  376.         case rand(4)
  377.         when 0
  378.           mat_word = mat_word_1a + mat_word_2a
  379.         when 1
  380.           mat_word = mat_word_1b + mat_word_2b
  381.         when 2
  382.           mat_word = mat_word_1a + mat_word_2b
  383.         else
  384.           mat_word = mat_word_1b + mat_word_2a
  385.         end
  386.       when 3, 4, 5
  387.         mat_word = mat_word_2a + mat_word_1a
  388.       when 6, 7
  389.         mat_word = mat_word_2a
  390.       when 8, 9
  391.         mat_word = mat_word_1a
  392.       when 10
  393.         mat_word = mat_word_1a + mat_word_2a + mat_word_1b
  394.       when 11, 12, 13, 14, 15
  395.         case rand(4)
  396.         when 0
  397.           mat_word = $doubled_name[rand(doubled_rand)]
  398.         when 1
  399.           mat_word = $doubled_name[rand(doubled_rand)] + $doubled_name[rand(doubled_rand)]
  400.         when 2
  401.           mat_word = $doubled_name[rand(doubled_rand)] + mat_word_1a
  402.         when 3
  403.           mat_word = $doubled_name[rand(doubled_rand)] + mat_word_2a
  404.         when 4
  405.           mat_word = $doubled_name[rand(doubled_rand)] + mat_word_1a + mat_word_2a
  406.         end
  407.       end
  408.       
  409.       case rand(9)
  410.       when 0, 1, 2, 3
  411.         trans_word += $trans_name[rand(trans_rand)]
  412.       when 4, 5, 6
  413.         trans_word += $trans_name[rand(trans_rand)] + $trans_name[rand(trans_rand)]
  414.       when 7, 8
  415.         trans_word += $trans_name[rand(trans_rand)] + $trans_name[rand(trans_rand)] + $trans_name[rand(trans_rand)]
  416.       end
  417.       
  418.       case rand(9)
  419.       when 0, 1, 2, 3
  420.         trans_word += $trans_name_2[rand(trans2_rand)]
  421.       when 4, 5, 6
  422.         trans_word += $trans_name_2[rand(trans2_rand)] + $trans_name[rand(trans2_rand)]
  423.       end
  424.       
  425.       case rand(25)
  426.       when 0, 1, 2, 3
  427.         name_gend = mat_word + color_word + chara_word
  428.       when 4, 5, 6, 7
  429.         name_gend = color_word + mat_word + chara_word
  430.       when 8, 9, 10
  431.         name_gend = chara_word + mat_word + color_word
  432.       when 11, 12
  433.         name_gend = mat_word + chara_word + color_word
  434.       when 13
  435.         case rand(2)
  436.         when 0
  437.           name_gend = mat_word + pattern_word
  438.         else
  439.           name_gend = pattern_word + mat_word
  440.         end
  441.       when 14
  442.         name_gend = color_word + pattern_word
  443.       when 15, 16
  444.         case rand(2)
  445.         when 0
  446.           name_gend = color_word + mat_word
  447.         else
  448.           name_gend = mat_word + color_word
  449.         end
  450.       when 17
  451.         case rand(2)
  452.         when 0
  453.           name_gend = pattern_word + chara_word
  454.         else
  455.           name_gend = chara_word + pattern_word
  456.         end
  457.       when 18
  458.         case rand(2)
  459.         when 0
  460.           name_gend = pattern_word + mat_word
  461.         else
  462.           name_gend = mat_word + pattern_word
  463.         end
  464.       when 19
  465.         case rand(2)
  466.         when 0
  467.           name_gend = chara_word + mat_word
  468.         else
  469.           name_gend = mat_word + chara_word
  470.         end
  471.       when 20
  472.         name_gend = mat_word
  473.       when 21, 22, 23, 24
  474.         name_gend = trans_word
  475.         case rand(10)
  476.         when 0, 1
  477.           name_gend += mat_word
  478.         when 2, 3
  479.           name_gend += chara_word
  480.         when 3, 4
  481.           name_gend += pattern_word
  482.         when 4, 5
  483.           name_gend += color_word
  484.         end
  485.       end
  486.       
  487.       case rand(16)
  488.       when 0, 1, 2
  489.         name_gend = end_word + "˙" + name_gend
  490.       when 3, 4, 5
  491.         name_gend += "之" + end_word
  492.       when 6, 7
  493.         if (type == 1  || type == 51) and (end_word != "法" and end_word != "心法"
  494.           name_gend += end_word + "法")
  495.         else
  496.           name_gend += end_word
  497.         end
  498.       else
  499.         name_gend += end_word
  500.       end

  501.       # 設置分隔符號
  502.       if $separator == "(空格)" or $separator == "(回车)"
  503.         separator = "\n"
  504.       else
  505.         separator = $separator
  506.       end
  507.       
  508.       # 显示文字
  509.       self.contents.draw_text(i%4*152, i/4*32, 132, 32, name_gend, 0)
  510.       self.contents.draw_text(i%4*152+132, i/4*32, 132, 32, separator, 0)
  511.       @name.push(name_gend)
  512.       # 产生下一个
  513.       i += 1
  514.     end
  515.   end
  516.   
  517.   # 纪录文字
  518.   def input_text(index)
  519.     # 纪录所选择的文字
  520.       if $separator == "(空格)"
  521.         separator = " "
  522.       elsif $separator == "(回车)"
  523.         separator = "\n"
  524.       else
  525.         separator = $separator
  526.       end
  527.     @name_selected += @name[index] + separator
  528.   end
  529.   
  530.   # 输出为文本
  531.   def output_text
  532.     # 输出
  533.     @namefile = File.open("./NameGen.txt","w")
  534.     @namefile.write(@name_selected)
  535.     #save_data(@name_selected,"NameGen.txt")
  536.     return
  537.   end
  538.   
  539.   # 確認是否已選字
  540.   def exit_program?
  541.     return @name_selected == ""? true : false
  542.   end
  543.   
  544.   alias name_update_cursor_rect update_cursor_rect   
  545.   def update_cursor_rect
  546.     name_update_cursor_rect
  547.     i = @index
  548.     # 更新图标矩形
  549.     self.cursor_rect.set(i%4*152, i/4*32 - self.oy, 132, 32)
  550.   end

  551. end

  552. class Window_EndSel < Window_Selectable
  553.   #--------------------------------------------------------------------------
  554.   # ● 初始化对像
  555.   #--------------------------------------------------------------------------
  556.   def initialize
  557.     super(144, 96, 352, 288)
  558.     @column_max = 10
  559.     refresh
  560.     self.index = 0
  561.   end
  562.   #--------------------------------------------------------------------------
  563.   # ● 获取尾字
  564.   #--------------------------------------------------------------------------
  565.   def end_word
  566.     return @data[self.index]
  567.   end
  568.   #--------------------------------------------------------------------------
  569.   # ● 获取类型
  570.   #--------------------------------------------------------------------------
  571.   def type(index)
  572.     if index < @item
  573.       return 51
  574.     elsif index < @equip
  575.       return 52
  576.     elsif index < @skill
  577.       return 53
  578.     else
  579.       return 54
  580.     end
  581.   end
  582.   #--------------------------------------------------------------------------
  583.   # ● 刷新
  584.   #--------------------------------------------------------------------------
  585.   def refresh
  586.     if self.contents != nil
  587.       self.contents.dispose
  588.       self.contents = nil
  589.     end
  590.     @data = []
  591.     # 添加报务
  592.     @data.push("武器/武功")
  593.     for i in $weapon_name # 添加武器/武功尾字
  594.       @data.push(i)
  595.     end
  596.     @data.push("物品")
  597.     for i in $item_name   # 添加物品尾字
  598.       @data.push(i)
  599.     end
  600.     @data.push("裝備")
  601.     for i in $equip_name  # 添加装备尾字
  602.       @data.push(i)
  603.     end
  604.     @data.push("技能")
  605.     for i in $skill_name  # 添加技能尾字
  606.       @data.push(i)
  607.     end
  608.    
  609.     @item_max = @data.size
  610.     self.contents = Bitmap.new(width - 32, row_max * 32)
  611.     for i in 0...@item_max
  612.       if @data[i] == "武器/武功"
  613.         self.contents.font.color = $weapon_color
  614.         self.contents.font.size = 11
  615.         self.contents.draw_text(i%10*32, i/10*32 - 3, 32, 32, "武器", 1)
  616.         self.contents.draw_text(i%10*32, i/10*32 + 9, 32, 32, "武功", 1)
  617.         self.contents.font.size = 22
  618.       elsif @data[i] == "物品"
  619.         self.contents.font.color = $item_color
  620.         self.contents.draw_text(i%10*32, i/10*32, 32, 32, @data[i], 1)
  621.         @item = i
  622.       elsif @data[i] == "裝備"
  623.         self.contents.font.color = $equip_color
  624.         self.contents.draw_text(i%10*32, i/10*32, 32, 32, @data[i], 1)
  625.         @equip = i
  626.       elsif @data[i] == "技能"
  627.         self.contents.font.color = $skill_color
  628.         self.contents.draw_text(i%10*32, i/10*32, 32, 32, @data[i], 1)
  629.         @skill = i
  630.       else
  631.         self.contents.draw_text(i%10*32, i/10*32, 32, 32, @data[i], 1)
  632.       end
  633.     end
  634.   end
  635.   #--------------------------------------------------------------------------
  636.   # ● 更新光标举行
  637.   #--------------------------------------------------------------------------
  638.   alias name_update_cursor_rect update_cursor_rect
  639.   def update_cursor_rect
  640.     name_update_cursor_rect
  641.     i = @index
  642.     # 更新图标矩形
  643.     self.cursor_rect.set(i%10*32, i/10*32 - self.oy, 32, 32)
  644.   end
  645. end
复制代码


设定

  1. #==============================================================================
  2. # ■ Scene_NameGen_Setup
  3. #------------------------------------------------------------------------------
  4. #  处理名称生产器选项画面的类。
  5. #==============================================================================

  6. class Scene_NameGen_Setup
  7.   #--------------------------------------------------------------------------
  8.   # ● 主处理
  9.   #--------------------------------------------------------------------------
  10.   def main
  11.     # 生成帮助窗口、物品窗口
  12.     @help_window = Window_Help.new
  13.     @help_window.contents = Bitmap.new(448, 32)
  14.     @setup_window = Window_NameGen_Setup.new
  15.     # 关联帮助窗口
  16.     @setup_window.help_window = @help_window
  17.    
  18.     @help_window.x = 80
  19.     @help_window.y = 58
  20.     @help_window.width = 480
  21.         
  22.     @separator = $separator_re
  23.     @generator = $generator
  24.    
  25.     # 执行过度
  26.     Graphics.transition
  27.     # 主循环
  28.     loop do
  29.       # 刷新游戏画面
  30.       Graphics.update
  31.       # 刷新输入信息
  32.       Input.update
  33.       # 刷新画面
  34.       update
  35.       # 如果画面切换就中断循环
  36.       if $scene != self
  37.         break
  38.       end
  39.     end
  40.     # 装备过渡
  41.     Graphics.freeze
  42.     # 释放窗口
  43.     @help_window.dispose
  44.     @setup_window.dispose
  45.   end
  46.   #--------------------------------------------------------------------------
  47.   # ● 刷新画面
  48.   #--------------------------------------------------------------------------
  49.   def update
  50.     # 刷新窗口
  51.     @help_window.update
  52.     @setup_window.update
  53.     # 物品窗口被激活的情况下: 调用 update_item
  54.     if @setup_window.active
  55.       update_setup
  56.       return
  57.     end
  58.   end
  59.   
  60.   # 更新命令窗口
  61.   def update_setup
  62.     # 按下 C 键的情况下
  63.     if Input.trigger?(Input::C)
  64.       # 演奏确定 SE
  65.       $game_system.se_play($data_system.decision_se)
  66.       case @setup_window.index
  67.       when 0 # 分隔号
  68.         @separator += 1
  69.         @separator %= 5
  70.         $separator_re = @separator
  71.         case @separator
  72.         when 0
  73.           $separator = "(空格)"
  74.         when 1
  75.           $separator = "(回车)"
  76.         when 2
  77.           $separator = "、"
  78.         when 3
  79.           $separator = ","
  80.         when 4
  81.           $separator = "。"
  82.         when 5
  83.           $separator = ";"
  84.         end
  85.       when 1 # 产生数
  86.         @generator += 1
  87.         @generator %= 5
  88.         case @generator
  89.         when 0
  90.           $generator = 56
  91.         when 1
  92.           $generator = 120
  93.         when 2
  94.           $generator = 180
  95.         when 3
  96.           $generator = 240
  97.         when 4
  98.           $generator = 320
  99.         end
  100.       when 2 # 回复默认
  101.         ini_sepgen
  102.       when 3 # 离开
  103.         $scene = Scene_NameGen.new
  104.       end
  105.       @setup_window.refresh
  106.       return
  107.     end # end if Input.trigger?(Input::C)
  108.    
  109.     if Input.trigger?(Input::B)
  110.       # 演奏取消 SE
  111.       $game_system.se_play($data_system.cancel_se)
  112.       $scene = Scene_NameGen.new
  113.       return
  114.     end
  115.   end
  116. end

  117. #==============================================================================
  118. # ■ Window_NameGen_Setup
  119. #------------------------------------------------------------------------------
  120. #  显示名称生产器选项的窗口。
  121. #==============================================================================

  122. class Window_NameGen_Setup < Window_Selectable
  123.   #--------------------------------------------------------------------------
  124.   # ● 初始化对像
  125.   #--------------------------------------------------------------------------
  126.   def initialize
  127.     super(80, 122, 480, 300)
  128.     refresh
  129.     self.index = 0
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # ● 刷新
  133.   #--------------------------------------------------------------------------
  134.   def refresh
  135.     @data = []
  136.     # 添加报务
  137.     @item_max = 4
  138.     self.contents = Bitmap.new(width - 32, height - 32)
  139.     self.contents.font.color = system_color
  140.     self.contents.draw_text(32, 32, 212, 32, "分隔号", 0)
  141.     self.contents.draw_text(32, 96, 212, 32, "产生数", 0)
  142.     self.contents.font.color = normal_color
  143.     self.contents.draw_text(212, 32, 212, 32, $separator, 0)
  144.     self.contents.draw_text(212, 96, 212, 32, $generator.to_s, 0)
  145.     self.contents.draw_text(212, 160, 212, 32, "回复默认", 0)
  146.     self.contents.draw_text(212, 224, 212, 32, "离开", 0)
  147.   end
  148.   
  149.   alias name_update_cursor_rect update_cursor_rect
  150.   def update_cursor_rect
  151.     name_update_cursor_rect
  152.     i = @index
  153.     # 更新图标矩形
  154.     self.cursor_rect.set(206, i*64+32, 224, 32)
  155.   end

  156.   
  157.   #--------------------------------------------------------------------------
  158.   # ● 刷新帮助文本
  159.   #--------------------------------------------------------------------------
  160.   def update_help
  161.     case self.index
  162.     when 0
  163.       string = "设定分隔名字的符号。"
  164.     when 1
  165.       string = "设定产生的名字数量。"
  166.     when 2
  167.       string = "回复到默认设定值。"
  168.     when 3
  169.       string = "离开,继续产生名字。"
  170.     end
  171.     @help_window.set_text(string)
  172.   end
  173. end

  174. $separator = "(空格)" if $separator == nil
  175. $generator = 56 if $generator == nil
  176. $separator_re = 0 if $separator_re == nil
复制代码

VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-15 15:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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