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

Project1

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

[已经解决] <人物仓库-chaos-修改>问题

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1611
在线时间
2205 小时
注册时间
2010-6-27
帖子
1299
跳转到指定楼层
1
发表于 2010-7-5 17:09:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 pigsss 于 2010-7-5 19:33 编辑

事件中怎么把多出来的人放进仓库…
顺便再带个问题…
改变画面色调后,FUKI对话框的头像图片 和 对象方动画的色调会跟着变,在哪里修改?

Lv3.寻梦者

宛若

梦石
0
星屑
1558
在线时间
526 小时
注册时间
2007-8-19
帖子
1493

极短24参与开拓者

2
发表于 2010-7-5 17:26:00 | 只看该作者
没见过此脚本,请提供
[url=http://rpg.blue/thread-219730-1-1.html]http://unhero.sinaapp.com/wi.php[/url]
[color=Red]如你所见这是个死坑,没错这就是打我的脸用的[/color]
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1611
在线时间
2205 小时
注册时间
2010-6-27
帖子
1299
3
 楼主| 发表于 2010-7-5 19:28:16 | 只看该作者
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. #==============================================================================
  5. # ■ chaochao的人物仓库ver1.02正式版
  6. # 修改了Game_Party
  7. # 功能:
  8. # 用来存放角色的仓库……
  9. # 召唤画面用$scene = Chaochao_Scene_Party.new
  10. # 其它使用说明在代码里已经备注。
  11. #------------------------------------------------------------------------------
  12. # 作者:chaochao
  13. # http://zhuchao.go1.icpcn.com
  14. #==============================================================================
  15. class Chaochao_Window_PartyLeft < Window_Selectable
  16.   def initialize
  17.     super(0, 0, 640, 320)
  18.     self.contents = Bitmap.new(width - 32, height - 32)
  19.     self.index = 0
  20.     refresh
  21.   end
  22.   def actor
  23.     return @actors[self.index]
  24.   end
  25.   def refresh
  26.     if self.contents != nil
  27.       self.contents.dispose
  28.       self.contents = nil
  29.     end
  30.     @actors = []
  31.     for i in 0...$game_party.actors.size
  32.       @actors.push($game_party.actors[i])
  33.     end
  34.    
  35.     @item_max = 4
  36.     if @item_max > 0
  37.       self.contents = Bitmap.new(width - 32, (row_max+1) * 32)
  38.       for i in 0...@item_max
  39.         draw_item(i)
  40.       end
  41.     end
  42.   end
  43.   def draw_item(index)
  44.     self.contents.draw_text(4, 1, 288, 32, "目前在队伍中:")
  45.     if @actors[index] != nil
  46.       actor = @actors[index]
  47.       text = @actors[index].name
  48.       lv = @actors[index].level.to_s + " "
  49.       if $game_party.chaochao.include?(actor.id) or $game_party.actors.size <= 1
  50.         self.contents.font.color = Color.new(255, 0, 0) #不能被移动的颜色
  51.       else
  52.         self.contents.font.color = Color.new(0, 255, 0) #可以被移动的颜色
  53.       end
  54.       self.contents.draw_text(4, index * 32 + 32, 288, 32, text)
  55.       self.contents.font.color = normal_color
  56.       self.contents.font.size = 16
  57.       self.contents.draw_text(4, index * 32 + 36, 288, 32,  "Level:   ", 2)
  58.       colorx = [255.0000 - 255.0000/60 * @actors[index].level,0].max
  59.       colory = [255.0000 / 60 * @actors[index].level,255].min
  60.       self.contents.font.color = Color.new(colorx, colory, 0)
  61.       self.contents.draw_text(4, index * 32 + 36, 288, 32,  lv, 2)
  62.       self.contents.font.color = normal_color
  63.       self.contents.font.size = 22
  64.     else
  65.       self.contents.draw_text(4, index * 32 + 32, 288, 32,  "米有人物!")
  66.     end
  67.   end
  68.   def update_cursor_rect
  69.     if @index < 0
  70.       self.cursor_rect.empty
  71.       return
  72.     end
  73.     row = @index / @column_max
  74.     if row < self.top_row
  75.       self.top_row = row
  76.     end
  77.     if row > self.top_row + (self.page_row_max - 1)
  78.       self.top_row = row - (self.page_row_max - 1)
  79.     end
  80.     cursor_width = self.width / @column_max - 32
  81.     x = @index % @column_max * (cursor_width + 32)
  82.     y = @index / @column_max * 32 - self.oy + 32
  83.     self.cursor_rect.set(x, y, cursor_width, 32)
  84.   end
  85.   def item_max
  86.     return @item_max
  87.   end
  88.   def actor?(index)
  89.     return @actors[index] == nil ? false : true
  90.   end
  91.   def set_index(x)
  92.     @index = x
  93.   end
  94. end

  95. #------------------------------------------------------------------------------

  96. class Chaochao_Window_PartyRight < Window_Selectable
  97.   def initialize
  98.     super(640, 0, 320, 224)
  99.     self.contents = Bitmap.new(width - 32, height - 32)
  100.     self.index = -1
  101.     refresh
  102.   end
  103.   def actor
  104.     return @actors[self.index]
  105.   end
  106.   def refresh
  107.     if self.contents != nil
  108.       self.contents.dispose
  109.       self.contents = nil
  110.     end
  111.     @actors = []
  112.     for i in 0...$game_party.actors2.size
  113.       @actors.push($game_party.actors2[i])
  114.     end
  115.    
  116.     @item_max = $game_party.actors2.size
  117.     if @item_max > 0
  118.       self.contents = Bitmap.new(width - 32, row_max * 32)
  119.       for i in 0...@item_max
  120.         draw_item(i)
  121.       end
  122.     elsif @item_max == 0
  123.       
  124.     end
  125.   end
  126.   def draw_item(index)
  127.     actor = @actors[index]
  128.     text = @actors[index].name
  129.     lv = @actors[index].level.to_s + " "
  130.     if $game_party.chaochao2.include?(actor.id) or $game_party.actors.size >= 4
  131.         self.contents.font.color = Color.new(255, 0, 0) #不能被移动的颜色
  132.       else
  133.         self.contents.font.color = Color.new(0, 255, 0) #可以被移动的颜色
  134.       end
  135.     self.contents.draw_text(80, 0, 288, 32, "待命中..")##
  136.     self.contents.font.color = normal_color#
  137.     self.contents.draw_text(4, index * 32, 288, 32, text)
  138.     self.contents.font.color = normal_color
  139.     self.contents.font.size = 16
  140.     self.contents.draw_text(4, index * 32 + 4, 288, 32,  "Level:   ", 2)
  141.     colorx = [255.0000 - 255.0000/60 * @actors[index].level,0].max
  142.     colory = [255.0000 / 60 * @actors[index].level,255].min
  143.     self.contents.font.color = Color.new(colorx, colory, 0)
  144.     self.contents.draw_text(4, index * 32 + 4, 288, 32,  lv, 2)
  145.     self.contents.font.color = normal_color
  146.     self.contents.font.size = 22
  147.   end
  148.   def update_cursor_rect
  149.     if @index < 0
  150.       self.cursor_rect.empty
  151.       return
  152.     end
  153.     row = @index / @column_max
  154.     if row < self.top_row
  155.       self.top_row = row
  156.     end
  157.     if row > self.top_row + (self.page_row_max - 1)
  158.       self.top_row = row - (self.page_row_max - 1)
  159.     end
  160.     cursor_width = self.width / @column_max - 32
  161.     x = @index % @column_max * (cursor_width + 32)
  162.     y = @index / @column_max * 32 - self.oy
  163.     self.cursor_rect.set(x, y, cursor_width, 32)
  164.   end
  165.   def item_max
  166.     return @item_max
  167.   end
  168.   def actor?(index)
  169.     return @actors[index] == nil ? false : true
  170.   end
  171.   def set_index(x)
  172.     @index = x
  173.   end
  174. end

  175. #------------------------------------------------------------------------------

  176. class Chaochao_Window_PartyData < Window_Base
  177.   
  178.   def initialize
  179.     super(0, 320, 640, 480)
  180.     self.contents = Bitmap.new(width - 32, height - 32)
  181.     @actor = nil
  182.   end
  183.   
  184.   def set_actor(actor)
  185.     self.contents.clear
  186.     draw_actor_name(actor, 4, 0)
  187.     draw_actor_class(actor, 4, 30)
  188.     draw_actor_state(actor, 200, 0)
  189.     draw_actor_hp(actor, 284, 0)
  190.     draw_actor_sp(actor, 460, 0)  
  191.     draw_actor_level(actor, 4, 60)
  192.     draw_actor_exp(actor, 4, 200)
  193.    
  194.     draw_actor_parameter(actor, 268, 112, 0)
  195.     draw_actor_parameter(actor, 268, 144, 1)
  196.     draw_actor_parameter(actor, 268, 176, 2)
  197.     draw_actor_parameter(actor, 268, 224, 3)
  198.     draw_actor_parameter(actor, 268, 256, 4)
  199.     #
  200.     draw_actor_parameter(actor, 268, 288, 5)
  201.     draw_actor_parameter(actor, 268, 320, 6)
  202.     draw_actor_parameter(actor, 268, 384, 7)

  203.     @actor = actor
  204.     self.visible = true
  205.   end
  206.   def clear
  207.     self.contents.clear
  208.   end
  209. end

  210. #------------------------------------------------------------------------------

  211. class Game_Party
  212.   attr_reader   :actors2
  213.   attr_reader   :chaochao#不能从队伍向备用角色移动的角色ID
  214.   attr_reader   :chaochao2#不能从备用角色向队伍移动的角色ID
  215.   def initialize
  216.     @actors = []
  217.     @gold = 0
  218.     @steps = 0
  219.     @items = {}
  220.     @weapons = {}
  221.     @armors = {}
  222.     @actors2 = []
  223.     @chaochao = []
  224.     @chaochao2 = []
  225.   end
  226.   def add_actor(actor_id,type=1)#type为1是向队伍中添加,为2则相反。
  227.     case type
  228.     when 1
  229.       if $game_actors[actor_id] != nil
  230.         actor = $game_actors[actor_id]
  231.         #如果队伍没有满和队伍中没有此角色
  232.         if @actors.size < 4 and not @actors.include?(actor) and not @actors2.include?(actor)
  233.           @actors.push(actor)
  234.           $game_player.refresh
  235.         end
  236.       end
  237.     when 2
  238.       if $game_actors[actor_id] != nil
  239.         actor = $game_actors[actor_id]
  240.         #如果角色不在队伍中和不在备用角色队伍中的情况下
  241.         #向备用角色中添加角色
  242.         if not @actors.include?(actor) and not @actors2.include?(actor)
  243.           @actors2.push(actor)
  244.           $game_player.refresh
  245.         end
  246.       end
  247.     end
  248.   end
  249.   
  250.   def huanren(index,type=1)#type为1是从备用角色向队伍中移动,为2则相反。
  251.     case type
  252.     when 1
  253.       id = @actors2[index].id
  254.       actor = $game_actors[id]
  255.       if @actors.size < 4  and not @chaochao2.include?(index) #and not @actors.include?(actor)
  256.         @actors.push(actor)
  257.         #@actors2.delete(actor)
  258.         @actors2.each do |i|
  259.           @actors2.delete(i) if i.id == actor.id
  260.         end
  261.         $game_system.se_play($data_system.decision_se)
  262.         $game_player.refresh
  263.       end
  264.     when 2
  265.       id = @actors[index].id
  266.       actor = $game_actors[id]
  267.       if actor != nil  and not @chaochao.include?(index)
  268.         @actors2.push(actor)
  269.         @actors.each do |i|
  270.           @actors.delete(i) if i.id == actor.id
  271.         end
  272.         $game_system.se_play($data_system.decision_se)
  273.         $game_player.refresh
  274.       end
  275.     end
  276.   end
  277.   
  278.   #type1,1是操作队伍中的角色能否向备用队伍移动,2则相反。
  279.   #type2,1是添加不能移动的,2是删除不能移动的。
  280.   def yidong(actor_id,type1,type2=1)
  281.     case type2
  282.     when 1
  283.       case type1
  284.       when 1
  285.         @chaochao.push(actor_id)
  286.       when 2
  287.         @chaochao2.push(actor_id)
  288.       end
  289.     when 2
  290.       case type1
  291.       when 1
  292.         @chaochao.delete(actor_id)
  293.       when 2
  294.         @chaochao2.delete(actor_id)
  295.       end
  296.     end
  297.   end
  298.   
  299.   #type,1从队伍中离开,2从备用角色中离开,3从队伍和备用角色中离开。
  300.   def remove_actor(actor_id,type=1)
  301.     actor = $game_actors[actor_id]
  302.     case type
  303.     when 1
  304.       @actors.delete(actor)
  305.       $game_player.refresh
  306.     when 2
  307.       @actors2.delete(actor)
  308.       $game_player.refresh
  309.     when 3
  310.       @actors.delete(actor)
  311.       @actors2.delete(actor)
  312.       $game_player.refresh
  313.     end
  314.   end
  315.   
  316.   def refresh
  317.     new_actors = []
  318.     new_actors2 = []
  319.     for i in [email protected]
  320.       if $game_actors[@actors[i].id] != nil
  321.         new_actors.push($game_actors[@actors[i].id])
  322.       end
  323.     end
  324.     @actors = new_actors
  325.     for i in [email protected]
  326.       if $game_actors[@actors2[i].id] != nil
  327.         new_actors2.push($game_actors[@actors2[i].id])
  328.       end
  329.     end
  330.     @actors2 = new_actors2
  331.   end
  332. end

  333. #------------------------------------------------------------------------------

  334. class Chaochao_Scene_Party
  335.   def main
  336.     @left_temp_command = 0
  337.     @right_temp_command = 0
  338.     @temp = 0
  339.     @left_window = Chaochao_Window_PartyLeft.new
  340.     @left_window.active = true
  341.     @right_window = Chaochao_Window_PartyRight.new
  342.     @right_window.active = false
  343.     @data_window = Chaochao_Window_PartyData.new
  344.     update_data
  345.     Graphics.transition
  346.     loop do
  347.       Graphics.update
  348.       Input.update
  349.       update
  350.       if $scene != self
  351.         break
  352.       end
  353.     end
  354.     Graphics.freeze
  355.     @left_window.dispose
  356.     @right_window.dispose
  357.     @data_window.dispose
  358.   end
  359.   
  360.   def update
  361.     @left_window.update
  362.     @right_window.update
  363.     @data_window.update
  364.     update_command
  365.     update_data
  366.   end
  367.   
  368.   def update_command
  369.     if Input.trigger?(Input::B)
  370.       $game_system.se_play($data_system.cancel_se)
  371.       #画面切换
  372.       $scene = Scene_Map.new
  373.       return
  374.     end
  375.     if @left_window.active
  376.       update_left
  377.       return
  378.     end
  379.     if @right_window.active
  380.       update_right
  381.       return
  382.     end
  383.   end
  384.   
  385.   def update_left
  386.     if Input.trigger?(Input::RIGHT)
  387.       if @right_window.item_max > 0
  388.         @left_temp_command = @left_window.index
  389.         @left_window.set_index(-1)
  390.         $game_system.se_play($data_system.cursor_se)
  391.         @left_window.active = false
  392.         @right_window.active = true
  393.         @left_window.refresh
  394.         @right_window.refresh
  395.         @right_window.set_index(@right_temp_command)
  396.         return
  397.       else
  398.         $game_system.se_play($data_system.buzzer_se)
  399.         return
  400.       end
  401.     end
  402.     if Input.trigger?(Input::C)
  403.       if @left_window.active and @left_window.actor?(@left_window.index) and $game_party.actors.size > 1 and not $game_party.chaochao.include?($game_party.actors[@left_window.index].id)
  404.         $game_party.huanren(@left_window.index,2)#type为1是从备用角色向队伍中移动,为2则相反。
  405.         @left_window.refresh
  406.         @right_window.refresh
  407.       else
  408.         $game_system.se_play($data_system.buzzer_se)
  409.       end
  410.     end
  411.     return
  412.   end
  413.   
  414.   def update_right
  415.     if Input.trigger?(Input::LEFT)
  416.       if @left_window.item_max > 0
  417.         @right_temp_command = @right_window.index
  418.         @right_window.set_index(-1)
  419.         $game_system.se_play($data_system.cursor_se)
  420.         @left_window.active = true
  421.         @right_window.active = false
  422.         @left_window.refresh
  423.         @right_window.refresh
  424.         @left_window.set_index(@left_temp_command)
  425.         return
  426.       else
  427.         $game_system.se_play($data_system.buzzer_se)
  428.         return
  429.       end
  430.     end
  431.     if Input.trigger?(Input::C)
  432.       if $game_party.actors.size >= 4
  433.         $game_system.se_play($data_system.buzzer_se)
  434.         return
  435.       end
  436.       if @right_window.active and @right_window.actor?(@right_window.index) and not $game_party.chaochao2.include?($game_party.actors2[@right_window.index].id)
  437.         $game_party.huanren(@right_window.index,1)#type为1是从备用角色向队伍中移动,为2则相反。
  438.         if $game_party.actors2.size == 0
  439.           @right_temp_command = @right_window.index
  440.           @right_window.set_index(-1)
  441.           $game_system.se_play($data_system.cursor_se)
  442.           @left_window.active = true
  443.           @right_window.active = false
  444.           @left_window.refresh
  445.           @right_window.refresh
  446.           @left_window.set_index(@left_temp_command)
  447.         end
  448.         if @right_window.index > 0
  449.           @right_window.set_index(@right_window.index-1)
  450.         end
  451.         @left_window.refresh
  452.         @right_window.refresh
  453.       else
  454.         $game_system.se_play($data_system.buzzer_se)
  455.       end
  456.     end
  457.     return
  458.   end
  459.   
  460.   def update_data
  461.     if @left_window.active
  462.       if $game_party.actors[@left_window.index] != nil
  463.         @data_window.set_actor($game_party.actors[@left_window.index])
  464.       else
  465.         @data_window.clear
  466.       end
  467.       return
  468.     end
  469.     if @right_window.active
  470.       if $game_party.actors2[@right_window.index] != nil
  471.         @data_window.set_actor($game_party.actors2[@right_window.index])
  472.       else
  473.         @data_window.clear
  474.       end
  475.       return
  476.     end
  477.   end
  478. end

  479. #==============================================================================
  480. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  481. #==============================================================================
复制代码
下面是附送的插件
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. #==============================================================================
  5. # ■ Interpreter (分割定义 4)
  6. #------------------------------------------------------------------------------
  7. #  执行事件命令的解释器。本类在 Game_System 类
  8. # 和 Game_Event 类的内部使用。
  9. #==============================================================================
  10. class Interpreter
  11.   #--------------------------------------------------------------------------
  12.   # ● 角色的替换
  13.   #--------------------------------------------------------------------------
  14.   def command_129
  15.     # 获取角色
  16.     actor = $game_actors[@parameters[0]]
  17.     # 角色有效的情况下
  18.     if actor != nil
  19.       # 操作分支
  20.       if @parameters[1] == 0
  21.         if @parameters[2] == 1
  22.           $game_actors[@parameters[0]].setup(@parameters[0])
  23.         end
  24.         if $game_party.actors.size == 4
  25.           $game_party.add_actor(@parameters[0],2)
  26.         else
  27.           $game_party.add_actor(@parameters[0])
  28.         end
  29.       else
  30.         $game_party.remove_actor(@parameters[0],3)
  31.       end
  32.     end
  33.     # 继续
  34.     return true
  35.   end
  36. end

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

于是我也广告下…
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
270 小时
注册时间
2010-2-4
帖子
1305
4
发表于 2010-7-5 20:16:19 | 只看该作者
$game_party.huanren(index,2)  
index改成0-3的数字。

点评

OKOK,可以了! 谢谢这位  发表于 2010-7-5 21:58
呃……用了之后往仓库里添加了一个没有在队里的角色……无语,搞不懂了  发表于 2010-7-5 21:52
能具体点么…在事件里用脚本? 我试了下会报错啊…  发表于 2010-7-5 21:31

评分

参与人数 1星屑 +200 收起 理由
「旅」 + 200 认可答案

查看全部评分

好歹当年也当过大魔王过,orz
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-28 20:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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