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

Project1

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

[已经解决] VA有人物仓库脚本吗?求链接

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3298
在线时间
1120 小时
注册时间
2009-4-15
帖子
815
跳转到指定楼层
1
发表于 2013-9-9 10:22:30 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
如题,在弄个类似去酒馆招英雄的游戏,可是没找到VA的任务仓库,有人有这东西或见过吗?求个链接或脚本,不胜感激。

Lv2.观梦者

梦石
0
星屑
362
在线时间
1292 小时
注册时间
2013-1-12
帖子
3590

贵宾

2
发表于 2013-9-9 11:07:47 | 只看该作者
Galv是神.... 他寫的腳本都不錯  不过要翻牆...
http://galvs-scripts.com/2013/06/15/army-manager/
這个剛剛好就是你需要的...  英文沒問題就行了....
RUBY 代码复制
  1. #------------------------------------------------------------------------------#
  2. #  Galv's Army Manager
  3. #------------------------------------------------------------------------------#
  4. #  For: RPGMAKER VX ACE
  5. #  Version 1.0
  6. #  Requested by Rue
  7. #-------------------------------------------------------------------------------
  8. #  This script was designed for tactical battle system games to manager party
  9. #  members (your army). You can arrange, dismiss, equip, etc. your units from
  10. #  this scene as well as display some army and game related information.
  11. #-------------------------------------------------------------------------------
  12.  
  13. #-------------------------------------------------------------------------------
  14. #  NOTE TAG - ACTORS OR CLASSES
  15. #-------------------------------------------------------------------------------
  16. #  <a_icon: x>    # icon displayed left of actor in the army manager. This icon
  17. #                 # will only appear if you set the ICONTYPES accordingly
  18. #-------------------------------------------------------------------------------
  19.  
  20. #-------------------------------------------------------------------------------
  21. #  SCRIPT CALLS
  22. #-------------------------------------------------------------------------------
  23. #  manage_army         # Calls the army manager scene
  24. #
  25. #  a_icon(id,icon_id)  # Change an actor's icon during game.
  26. #  a_access(id,x)      # if x is false cannot access actor at all. Default true
  27. #  a_cmd(id,:cmd,x)    # used to enable/disable commands for certain actors
  28. #                      # :cmd is the CMD ID of the command (further down)
  29. #                      # x can be true or false to disable/enable commands
  30. #
  31. #  armyname("Name")    # Changes the name of your army
  32. #-------------------------------------------------------------------------------
  33. #  EXAMPLES
  34. #  a_cmd(1,:dismiss,false) # Disable the "DISMISS" command for actor 1
  35. #  a_cmd(4,:order,true)    # Enable the "ORDER" command for actor 4.
  36. #                          # All commands are true (enabled) by default
  37. #-------------------------------------------------------------------------------
  38.  
  39. ($imported ||= {})["Galv_ArmyManager"] = true
  40. module GARMY
  41.  
  42. #-------------------------------------------------------------------------------
  43. #
  44. #  * SETTINGS
  45. #
  46. #-------------------------------------------------------------------------------
  47.  
  48.   # Some Default Settings
  49.  
  50.   NO_ACTOR_ICON = 186   # Icon ID used if you don't tag actor with <a_icon: x>
  51.   NO_CLASS_ICON = 162   # Icon ID used if you don't tag class with <a_icon: x>
  52.   NO_WEAPON_ICON = 186  # Icon ID used if nothing is equipped
  53.  
  54.   ICONTYPE1 = :actor    # these ICONTYPES can be :actor, :class or :weapon
  55.   ICONTYPE2 = :weapon   # This will show either the class icon, actor icon (if
  56.                         # ou note tagged them) or the equipped weapon icon to
  57.                         # the left of the actor's sprite.
  58.  
  59.   SPRITE_X_POS = 1.6    # width of box divided by this number to position the
  60.                         # character sprite. (2 is central). Default 1.6
  61.  
  62.   B_MEMBERS = false     # highlight members in party that are 'battle members'
  63.                         # true or false
  64.   B_MEMBER_COLOR = 16   # windowskin color for battle member highlight box that
  65.                         # appears if B_MEMBERS = true
  66.  
  67.   # Army Info
  68.  
  69.   UNIT_COUNT = "Units: "           # Party member count text
  70.   HIGH_LEVEL = "Highest Level: "   # Highest level text
  71.   TIME = "Time: "                  # Time text
  72.   FUNDS = "Funds: "                # Gold amount text
  73.   INFOVAR1 = 1                     # Variable id used to display in info window
  74.   INFOVAR2 = 2                     # Variable id used to display in info window
  75.                                    # Displays the variable name beside these.
  76.  
  77.   # Sounds
  78.  
  79.   DISMISS_SE = ["Blow8",100,100]     # ["SE_Name",volume,pitch] for dimiss SE
  80.   ORDER_SE = ["Wind7",100,100]       # ["SE_Name",volume,pitch] for order SE
  81.  
  82.  
  83.   #  Command Setup
  84.   #  (Command list appears when you select a unit from your army)
  85.  
  86.   CMDS = {
  87.  
  88. # CMD ID => ["NAME",    :Scene_Class, switch, icon],
  89.   :equip   => ["EQUIP",   :Scene_Equip, 1,      161],
  90.   :status  => ["STATUS",  :Scene_Status,0,      236],
  91.   :order   => ["ORDER",   :order,       0,      12],  # Change only "NAME"
  92.   :dismiss => ["DISMISS", :dismiss,     0,      187], # Change only "NAME"
  93.  
  94.   #:class   => ["JOB",     :Scene_Class, 0,      121],  # Example yanfly class  
  95.   #:item    => ["USE ITEM", :Scene_Item, 0,      261],
  96.  
  97.   } # don't touch
  98.  
  99. #-------------------------------------------------------------------------------
  100. #  EXPLANATION:
  101. #-------------------------------------------------------------------------------
  102. #  CMD ID = unique identifier for the menu command (scripting purposes). Use
  103. #           anything here but do not change :order or :dismiss or those options
  104. #           will no longer function. You can, however, remove them.
  105. #  "NAME" = Menu command text
  106. #  :Scene_Class = The name of the scene class as a symbol
  107. #  switch = a swith ID. Turn this switch ON to disable the menu command
  108. #  icon = the icon ID to go with the menu command
  109. #-------------------------------------------------------------------------------
  110.  
  111. #-------------------------------------------------------------------------------
  112. #
  113. #  * END OF SETTINGS
  114. #
  115. #-------------------------------------------------------------------------------
  116.  
  117. end # GARMY
  118.  
  119.  
  120.     #----------------------#
  121. #---|   Game_Interpreter   |----------------------------------------------------
  122.     #----------------------#
  123.  
  124. class Game_Interpreter
  125.   def manage_army; SceneManager.call(Scene_Army); end
  126.   def a_access(id,status); $game_actors[id].a_accessible = status; end
  127.   def a_cmd(id,cmd_name,status)
  128.     $game_actors[id].a_cmds[cmd_name] = status
  129.   end
  130.   def a_icon(id,icon_id); $game_actor[id].a_icon = icon_id; end
  131.   def armyname(name); $game_party.armyname = name; end
  132. end # Game_Interpreter
  133.  
  134.  
  135.     #----------------#
  136. #---|   Game_Party   |----------------------------------------------------------
  137.     #----------------#
  138.  
  139. class Game_Party
  140.   attr_accessor :last_atroop
  141.   attr_accessor :armyname
  142.  
  143.   alias galv_garmy_gp_initialize initialize
  144.   def initialize
  145.     @armyname = "Unnamed Army"
  146.     galv_garmy_gp_initialize
  147.   end
  148. end # Game_Party
  149.  
  150.  
  151.     #------------------#
  152. #---|   SceneManager   |--------------------------------------------------------
  153.     #------------------#
  154.  
  155. module SceneManager
  156.   def self.gcall(scene_class)
  157.     @stack.push(@scene)
  158.     [url=home.php?mod=space&uid=420706]@Scene[/url] = Kernel.const_get(scene_class).new
  159.   end
  160. end # SceneManager
  161.  
  162.  
  163.     #----------------------#
  164. #---|   RPG::CLASS/ACTOR   |----------------------------------------------------
  165.     #----------------------#
  166.  
  167. class RPG::Class
  168.   def a_icon
  169.     if @a_icon.nil?
  170.       if @note =~ /<a_icon: (.*)>/i
  171.         @a_icon = $1.to_i
  172.       else
  173.         @a_icon = GARMY::NO_CLASS_ICON
  174.       end
  175.     end
  176.     @a_icon
  177.   end
  178. end # RPG::Class
  179. class RPG::Actor
  180.   def a_icon
  181.     if @a_icon.nil?
  182.       if @note =~ /<a_icon: (.*)>/i
  183.         @a_icon = $1.to_i
  184.       else
  185.         @a_icon = GARMY::NO_ACTOR_ICON
  186.       end
  187.     end
  188.     @a_icon
  189.   end
  190. end # RPG::Class
  191.  
  192.  
  193.     #----------------#
  194. #---|   Game_Actor   |----------------------------------------------------------
  195.     #----------------#
  196.  
  197. class Game_Actor
  198.   attr_accessor :a_accessible
  199.   attr_accessor :a_cmds
  200.   attr_accessor :a_icon
  201.  
  202.   alias galv_garmy_ga_setup setup
  203.   def setup(actor_id)
  204.     @a_accessible = true
  205.     @a_icon = $data_actors[actor_id].a_icon
  206.     @a_cmds = {}
  207.     GARMY::CMDS.each { |cmd| @a_cmds[cmd[0]] = true }
  208.     galv_garmy_ga_setup(actor_id)
  209.   end
  210. end # Game_Actor
  211.  
  212.  
  213.     #-----------------#
  214. #---|   Scene_Army    |---------------------------------------------------------
  215.     #-----------------#
  216.  
  217. class Scene_Army < Scene_MenuBase
  218.   def start
  219.     super
  220.     create_help_window
  221.     create_info_window
  222.     create_troop_window
  223.     create_command_window
  224.     create_face_window
  225.   end
  226.  
  227. #-----| CREATE STUFF |
  228.  
  229.   def create_help_window
  230.     @help_window = Window_ArmyHelp.new
  231.     @help_window.viewport = @viewport
  232.   end
  233.  
  234.   def create_info_window
  235.     @info_window = Window_ArmyInfo.new
  236.     @info_window.viewport = @viewport
  237.   end
  238.  
  239.   def create_troop_window
  240.     wy = @help_window.height
  241.     ww = Graphics.width
  242.     wh = Graphics.height - @help_window.height - @info_window.height
  243.     @troop_window = Window_Troops.new(0,wy,ww,wh)
  244.     @troop_window.help_window = @help_window
  245.     @troop_window.viewport = @viewport
  246.     @troop_window.activate
  247.     @troop_window.set_handler(:ok, method(:on_troop_ok))
  248.     @troop_window.set_handler(:cancel, method(:return_scene))
  249.   end
  250.  
  251.   def create_command_window
  252.     wx = Graphics.width / 2
  253.     wy = (Graphics.height - @info_window.height - @help_window.height) / 2
  254.     @command_window = Window_ArmyCommand.new(wx,wy)
  255.     @command_window.viewport = @viewport
  256.     GARMY::CMDS.each { |cmd|
  257.       handle = cmd[1][0].delete(' ').downcase.to_sym
  258.       @command_window.set_handler(handle, method(:cmd))
  259.     }
  260.     @command_window.set_handler(:cancel, method(:back_to_troop))
  261.     @command_window.y -= @command_window.height / 2 - @help_window.height
  262.     @command_window.hide.deactivate
  263.   end
  264.  
  265.   def create_face_window
  266.     ww = @command_window.width
  267.     wh = @command_window.height
  268.     wx = @command_window.x
  269.     wy = @command_window.y
  270.     @face_window = Window_ArmyFace.new(wx,wy,ww,wh)
  271.     @face_window.viewport = @viewport
  272.     @face_window.hide
  273.   end
  274.  
  275. #-----| HANDLERS |
  276.  
  277.   def cmd
  278.     list = GARMY::CMDS.to_a
  279.     cmd = @command_window.index
  280.     symbol = list[cmd][1][1]
  281.     if custom_action(symbol)
  282.       custom_on_command_ok(symbol)
  283.     else
  284.       SceneManager.gcall(list[cmd][1][1])
  285.     end
  286.   end
  287.  
  288.   def custom_action(symbol)
  289.     case symbol
  290.     when :dismiss, :order
  291.       return true
  292.     else
  293.       return false
  294.     end
  295.   end
  296.  
  297.   def custom_on_command_ok(symbol)
  298.     case symbol
  299.     when :dismiss
  300.       do_dismiss
  301.     when :order
  302.       start_ordering
  303.     end
  304.   end
  305.  
  306.   def start_ordering
  307.     if $game_party.last_atroop.a_cmds[:order]
  308.       @troop_window.order_on
  309.       @ordering = true
  310.       @troop_window.psound = GARMY::ORDER_SE
  311.     else
  312.       Sound.play_buzzer
  313.     end
  314.     back_to_troop
  315.   end
  316.  
  317.   def do_dismiss
  318.     @troop_window.dismiss
  319.     back_to_troop
  320.   end
  321.  
  322.   def on_troop_ok
  323.     if @ordering
  324.       @troop_window.swap_actor
  325.       @ordering = false
  326.       back_to_troop
  327.     else
  328.       $game_party.last_atroop = actor
  329.       $game_party.menu_actor = actor
  330.       @command_window.refresh
  331.       @face_window.refresh
  332.       @command_window.show.activate
  333.       @face_window.show.activate
  334.     end
  335.   end
  336.  
  337.   def back_to_troop
  338.     @command_window.hide.deactivate
  339.     @face_window.hide
  340.     @troop_window.activate
  341.   end
  342.  
  343.   def return_scene
  344.     if @troop_window.ordering_on
  345.       @ordering = false
  346.       @troop_window.cancel_ordering
  347.       @troop_window.activate
  348.     else
  349.       $game_party.last_atroop = nil
  350.       SceneManager.return
  351.     end
  352.   end
  353.  
  354. #-----| OTHER STUFF |
  355.  
  356.   def actor; @troop_window.actor; end
  357.  
  358.   def terminate
  359.     super
  360.   end
  361.  
  362.   def update
  363.     super
  364.   end
  365. end # Scene_Army < Scene_MenuBase
  366.  
  367.  
  368.     #----------------------#
  369. #---|   Window_ArmyHelp    |----------------------------------------------------
  370.     #----------------------#
  371.  
  372. class Window_ArmyHelp < Window_Help
  373.   def initialize
  374.     super(1)
  375.     @icons = []
  376.   end
  377.  
  378.   def set_text(text)
  379.     if text != @text
  380.       @text = text
  381.       refresh
  382.     end
  383.   end
  384.  
  385.   def clear
  386.     set_text("")
  387.     @icons = []
  388.     [url=home.php?mod=space&uid=95897]@actor[/url] = nil
  389.   end
  390.  
  391.   def set_item(actor)
  392.     @actor = actor
  393.     @icons = [get_icon(GARMY::ICONTYPE1,actor),get_icon(GARMY::ICONTYPE2,actor)]
  394.     set_text(actor ? create_text(actor) : "")
  395.   end
  396.  
  397.   def create_text(actor)
  398.     n = actor.name
  399.     c = actor.class.name
  400.     l = Vocab::level_a + actor.level.to_s
  401.     text = n + " - " + l + " " + c
  402.     return text
  403.   end
  404.  
  405.   def get_icon(icontype,actor)
  406.     return 0 if !actor
  407.     case icontype
  408.     when :actor
  409.       return actor.a_icon
  410.     when :class
  411.       return $data_classes[actor.class_id].a_icon
  412.     when :weapon
  413.       if actor.equips[0].nil?
  414.         return GARMY::NO_WEAPON_ICON
  415.       else
  416.         return actor.equips[0].icon_index
  417.       end
  418.     else
  419.       return 0
  420.     end
  421.   end
  422.  
  423.   def refresh
  424.     contents.clear
  425.     contents.font.size = 21 if Graphics.height < 480
  426.     if !@icons.empty?
  427.       draw_icon(@icons[0], 0, 0)
  428.       draw_icon(@icons[1], 28, 0)
  429.     end
  430.     if @actor
  431.       offset = Graphics.width >= 640 ? 0 : -100
  432.       draw_actor_hp(@actor, 355 + offset, 0)
  433.       draw_actor_mp(@actor, 490 + offset, 0)
  434.       draw_text(62, 0, 280 + offset, line_height, @text)
  435.     end
  436.   end
  437. end # Window_ArmyHelp < Window_Help
  438.  
  439.  
  440.     #--------------------#
  441. #---|   Window_Troops    |------------------------------------------------------
  442.     #--------------------#
  443.  
  444. class Window_Troops < Window_Selectable
  445.   attr_accessor :pending_index
  446.   attr_accessor :ordering_on
  447.   attr_accessor :psound
  448.  
  449.   def initialize(x, y, width, height)
  450.     super
  451.     @data = []
  452.     @last_index ||= 0
  453.     @animtime = 0
  454.     [url=home.php?mod=space&uid=348285]@walk[/url] = 0
  455.     @pending_index = -1
  456.     refresh
  457.     select_last
  458.   end
  459.  
  460. #------| Sizes and Stuff |
  461.  
  462.   def item_width
  463.     (width - standard_padding * 2 + spacing) / col_max - spacing
  464.   end
  465.   def item_height; item_width; end
  466.   def spacing; return 10; end
  467.   def col_max; return 6; end
  468.   def item_max; @data ? @data.size : 1; end
  469.   def actor; @data && index >= 0 ? @data[index] : nil; end
  470.  
  471.   def current_item_enabled?
  472.     enable?(@data[index])
  473.   end
  474.  
  475.   def include?(actor)
  476.     return false if actor.nil?
  477.     return true
  478.   end
  479.  
  480.   def enable?(actor)
  481.     return false if !actor
  482.     return false if !actor.a_accessible
  483.     return false if @ordering_on && !actor.a_cmds[:order]
  484.     return true
  485.   end
  486.  
  487.   def make_item_list
  488.     @data = $game_party.members.select {|actor| include?(actor) }
  489.     @data.push(nil) if include?(nil)
  490.   end
  491.  
  492.   def select_last
  493.     select(@data.index($game_party.last_atroop) || 0)
  494.   end
  495.  
  496.   def swap_actor
  497.     $game_party.swap_order($game_party.last_atroop.index,index)
  498.     @pending_index = -1
  499.     @ordering_on = nil
  500.     refresh
  501.   end
  502.  
  503.   def actor_rect(index)
  504.     rect = Rect.new
  505.     rect.width = item_width
  506.     rect.height = item_height
  507.     rect.x = index % col_max * (item_width + spacing)
  508.     rect.y = index / col_max * item_height
  509.     rect
  510.   end
  511.  
  512.   def offset
  513.     Graphics.height < 480 ? 0 : 10
  514.   end
  515.  
  516.   def draw_item(index)
  517.     actor = @data[index]
  518.     if actor
  519.       rect = actor_rect(index)
  520.       rect.width -= 4
  521.       draw_in_battle_party(index) if GARMY::B_MEMBERS
  522.       draw_selected(index)
  523.       draw_actor_text(actor,rect.x + 2,rect.y + 38 + offset, enable?(actor),
  524.         rect.width)
  525.       draw_character(actor.character_name, actor.character_index,
  526.         rect.x + item_width / GARMY::SPRITE_X_POS - 1, rect.y + 38 + offset,
  527.         enable?(actor),index)
  528.     end
  529.   end
  530.  
  531.   def draw_selected(index)
  532.     if index == @pending_index
  533.       pendrect = item_rect(index)
  534.       pendrect.x += 1
  535.       pendrect.y += 1
  536.       pendrect.width -= 2
  537.       pendrect.height -= 2
  538.       contents.fill_rect(pendrect, pending_color)
  539.     end
  540.   end
  541.  
  542.   def draw_in_battle_party(index)
  543.     if index < $game_party.max_battle_members
  544.       rect = item_rect(index)
  545.       w = 1
  546.       c = text_color(GARMY::B_MEMBER_COLOR)
  547.       trect = Rect.new(rect.x,rect.y,rect.width,w)
  548.       lrect = Rect.new(rect.x,rect.y,w,rect.height)
  549.       rrect = Rect.new(rect.x + rect.width - w,rect.y,w,rect.height)
  550.       brect = Rect.new(rect.x,rect.y + rect.height - w,rect.width,w)
  551.       contents.fill_rect(trect,c)
  552.       contents.fill_rect(lrect,c)
  553.       contents.fill_rect(rrect,c)
  554.       contents.fill_rect(brect,c)
  555.     end
  556.   end
  557.  
  558.   def square_color
  559.  
  560.   end
  561.  
  562.   def draw_actor_text(actor, x, y, enabled = true, w)
  563.     return unless actor
  564.     icon1 = get_icon(GARMY::ICONTYPE1,actor)
  565.     icon2 = get_icon(GARMY::ICONTYPE2,actor)
  566.     draw_icon(icon1, x + 6, y - 20, enabled)
  567.     draw_icon(icon2, x + 18, y - 20, enabled)
  568.     change_color(normal_color, enabled)
  569.     contents.font.size = 18
  570.     draw_text(x, y, w, line_height, actor.name,1)
  571.     contents.font.size = 16
  572.     lvl = Vocab::level_a + actor.level.to_s
  573.     cname = actor.class.name
  574.     draw_text(x + 10, y - 40, w, line_height, lvl,0)
  575.     draw_text(x, y + 16, w, line_height, cname,1)
  576.   end
  577.  
  578.   def get_icon(icontype,actor)
  579.     case icontype
  580.     when :actor
  581.       return actor.a_icon
  582.     when :class
  583.       return $data_classes[actor.class_id].a_icon
  584.     when :weapon
  585.       if actor.equips[0].nil?
  586.         return GARMY::NO_WEAPON_ICON
  587.       else
  588.         return actor.equips[0].icon_index
  589.       end
  590.     else
  591.       return 0
  592.     end
  593.   end
  594.  
  595.   def draw_character(character_name, character_index, x, y,enabled,i)
  596.     return unless character_name
  597.     bitmap = Cache.character(character_name)
  598.     sign = character_name[/^[\!\$]./]
  599.     if sign && sign.include?('$')
  600.       cw = bitmap.width / 3
  601.       ch = bitmap.height / 4
  602.     else
  603.       cw = bitmap.width / 12
  604.       ch = bitmap.height / 8
  605.     end
  606.     n = character_index
  607.     step = 0
  608.     step = @walk if enabled && i == index
  609.     src_rect = Rect.new((n%4*3+1+step)*cw, (n/4*4)*ch, cw, ch)
  610.     contents.blt(x - cw / 2, y - ch, bitmap, src_rect, enabled ? 255 : 150)
  611.   end
  612.  
  613.   def update_help
  614.     @help_window.set_item(actor)
  615.   end
  616.  
  617.   def refresh
  618.     make_item_list
  619.     create_contents
  620.     draw_all_items
  621.   end
  622.  
  623.   def order_on
  624.     @ordering_on = true
  625.     @pending_index = index
  626.     refresh
  627.   end
  628.  
  629.   def cancel_ordering
  630.     @ordering_on = nil
  631.     @pending_index = -1
  632.     refresh
  633.   end
  634.  
  635.   def dismiss
  636.     $game_party.remove_actor(actor.id)
  637.     refresh
  638.   end
  639.  
  640.   def update
  641.     super
  642.     update_walk
  643.     redraw_item(index)
  644.   end
  645.  
  646.   def update_walk
  647.     @animtime += 1
  648.     if @animtime == 10
  649.       case @walk
  650.       when 1; @walk -= 1
  651.       when -1; @walk += 1
  652.       when 0
  653.         if @step == 1
  654.           @walk = -1; @step = 0
  655.         else
  656.           @walk = 1; @step = 1
  657.         end
  658.       end
  659.       @animtime = 0
  660.     end
  661.   end
  662.  
  663.   def cursor_down(wrap = false); super; cursor_move_extras; end
  664.   def cursor_up(wrap = false); super; cursor_move_extras; end
  665.   def cursor_left(wrap = false); super; cursor_move_extras; end
  666.   def cursor_right(wrap = false); super; cursor_move_extras; end
  667.  
  668.   def cursor_move_extras
  669.     @walk = 0
  670.     @animtime = 0
  671.     redraw_item(@last_index)
  672.     @last_index = index
  673.   end
  674.  
  675.   def process_ok
  676.     if current_item_enabled?
  677.       psound
  678.       Input.update
  679.       deactivate
  680.       call_ok_handler
  681.     else
  682.       Sound.play_buzzer
  683.     end
  684.   end
  685.  
  686.   def psound
  687.     if @psound.nil?
  688.       Sound.play_ok
  689.     else
  690.       name,vol,pitch = @psound
  691.       RPG::SE.new(name,vol,pitch).play
  692.       @psound = nil
  693.     end
  694.   end
  695. end # Window_Troops < Window_Selectable
  696.  
  697.  
  698.     #------------------------#
  699. #---|   Window_ArmyCommand   |--------------------------------------------------
  700.     #------------------------#
  701.  
  702. class Window_ArmyCommand < Window_Command
  703.   def initialize(x,y)
  704.     super(x,y)
  705.     self.opacity = 255
  706.     self.back_opacity = 255
  707.   end
  708.  
  709.   def window_width; return 160; end
  710.   def visible_line_number; item_max; end
  711.  
  712.   def make_command_list
  713.     @cmd_index = []
  714.     GARMY::CMDS.each { |cmd|
  715.       text = cmd[1][0]
  716.       handle = text.delete(' ').downcase.to_sym
  717.       add_command(text,handle,check_enabled($game_switches[cmd[1][2]],cmd[0],text))
  718.       @cmd_index << cmd[0]
  719.     }
  720.   end
  721.  
  722.   def check_enabled(switch,cmd,text)
  723.     return false if switch
  724.     return false if cmd == :dismiss && $game_party.members.count <= 1
  725.     if $game_party.last_atroop
  726.       return false if !$game_party.last_atroop.a_cmds[cmd]
  727.     end
  728.     return true
  729.   end
  730.  
  731.   def draw_item(index)
  732.     change_color(normal_color, command_enabled?(index))
  733.     recti = item_rect_for_text(index)
  734.     recti.x += 26
  735.     draw_text(recti, command_name(index), alignment)
  736.     draw_icon(GARMY::CMDS[@cmd_index[index]][3],0,recti.y)
  737.   end
  738.  
  739.   def process_ok
  740.     if current_item_enabled?
  741.       psound
  742.       Input.update
  743.       deactivate
  744.       call_ok_handler
  745.     else
  746.       Sound.play_buzzer
  747.     end
  748.   end
  749.  
  750.   def psound
  751.     if current_symbol == :dismiss
  752.       name,vol,pitch = GARMY::DISMISS_SE
  753.       RPG::SE.new(name,vol,pitch).play
  754.       @psound = nil
  755.     else
  756.       Sound.play_ok
  757.     end
  758.   end
  759. end # Window_ArmyCommand < Window_Command
  760.  
  761.  
  762.     #---------------------#
  763. #---|   Window_ArmyInfo   |-----------------------------------------------------
  764.     #---------------------#
  765.  
  766. class Window_ArmyInfo < Window_Base
  767.   def initialize(line_number = 2)
  768.     super(0, Graphics.height - window_height, Graphics.width, window_height)
  769.     refresh
  770.   end
  771.  
  772.   def window_height
  773.     h = h480? ? 30 : 0
  774.     fitting_height(3) + h
  775.   end
  776.  
  777.   def h480?; Graphics.height >= 480; end
  778.  
  779.   def setup_info
  780.     w = contents.width
  781.     o = h480? ? 18 : 0
  782.     h = line_height
  783.     y = line_height + o
  784.     y2 = h * 2 + o * 1.4
  785.     contents.font.size = 21 if !h480?
  786.     change_color(system_color)
  787.     draw_text(0,0,contents.width,line_height,$game_party.armyname,1)
  788.     change_color(normal_color)
  789.     draw_horz_line(h - 4) if h480?
  790.     draw_text(0,y,w,h,GARMY::UNIT_COUNT + $game_party.members.count.to_s,0)
  791.     draw_text(0,y,w,h,GARMY::HIGH_LEVEL + highlevel,1)
  792.     draw_text(0,y,w,h,GARMY::TIME + time_text,2)
  793.     draw_text(0,y2,w,h,GARMY::FUNDS + $game_party.gold.to_s + currency,0)
  794.     if GARMY::INFOVAR1 > 0
  795.       v = GARMY::INFOVAR1
  796.       n = $data_system.variables[v]
  797.       draw_text(0,y2,w,h,n + $game_variables[v].to_s,1)
  798.     end
  799.     if GARMY::INFOVAR2 > 0
  800.       v = GARMY::INFOVAR2
  801.       n = $data_system.variables[v]
  802.       draw_text(0,y2,w,h,n + $game_variables[v].to_s,2)
  803.     end
  804.   end
  805.  
  806.   def currency; Vocab::currency_unit; end
  807.  
  808.   def highlevel
  809.     ($game_party.members.max_by { |k,v| k.level }).level.to_s
  810.   end
  811.  
  812.   def time_text
  813.     sprintf("%02d:%02d:%02d", (Graphics.frame_count / 60**2) / 60,
  814.       Graphics.frame_count / 60**2 % 60,
  815.       Graphics.frame_count / 60 % 60)
  816.   end
  817.  
  818.   def draw_horz_line(y)
  819.     line_y = y + line_height / 2 - 1
  820.     contents.fill_rect(0, line_y, contents_width, 2, line_color)
  821.   end
  822.  
  823.   def line_color
  824.     color = normal_color
  825.     color.alpha = 48
  826.     color
  827.   end
  828.  
  829.   def update
  830.     refresh
  831.   end
  832.  
  833.   def refresh
  834.     contents.clear
  835.     setup_info
  836.   end
  837. end # Window_ArmyInfo < Window_Base
  838.  
  839.  
  840.     #---------------------#
  841. #---|   Window_ArmyFace   |-----------------------------------------------------
  842.     #---------------------#
  843.  
  844. class Window_ArmyFace < Window_Base
  845.   def initialize(x,y,w,h)
  846.     super(x - w,y,w,h)
  847.     self.opacity = 255
  848.     self.back_opacity = 255
  849.   end
  850.  
  851.   def draw_cont
  852.     fy = (contents.height - 96) / 2
  853.     fx = (contents.width - 96) / 2
  854.     draw_actor_face($game_party.last_atroop, fx, fy)
  855.   end
  856.  
  857.   def refresh
  858.     contents.clear
  859.     draw_cont
  860.   end
  861. end # Window_ArmyFace < Window_Base

改一下vocab為中文就行了  然後他也有Demo的...(範例)

点评

求下范例下载地址,那个地址上我没看到范例连接,只看到了脚本连接  发表于 2013-9-9 16:19

评分

参与人数 1梦石 +1 收起 理由
Sion + 1 认可答案

查看全部评分


回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3298
在线时间
1120 小时
注册时间
2009-4-15
帖子
815
3
 楼主| 发表于 2013-9-9 16:17:53 | 只看该作者
76213585 发表于 2013-9-9 11:07
Galv是神.... 他寫的腳本都不錯  不过要翻牆...
http://galvs-scripts.com/2013/06/15/army-manager/
這个 ...

如何认可你这个楼为认可答案?

点评

Demo下載 http://www.mediafire.com/?6mczyzwm8dye9sx (是英文的)  发表于 2013-9-10 06:44
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-17 19:18

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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