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

Project1

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

[已经解决] 请教,如何清空怪物图鉴数据

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
41 小时
注册时间
2014-8-7
帖子
67
跳转到指定楼层
1
发表于 2015-1-4 23:25:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 RyanBern 于 2015-1-8 16:23 编辑

使用的是
RUBY 代码复制
  1. class Game_Party
  2.   attr_accessor :enemy_info               # 出会った敵情報(図鑑用)
  3.   #--------------------------------------------------------------------------
  4.   # ● オブジェクト初期化
  5.   #--------------------------------------------------------------------------
  6.   alias book_info_initialize initialize
  7.   def initialize
  8.     book_info_initialize
  9.     @enemy_info = {}
  10.   end
  11.   #--------------------------------------------------------------------------
  12.   # ● エネミー情報の追加(図鑑用)
  13.   #     type : 通常遭遇かアナライズか 0:通常 1:アナライズ -1:情報削除
  14.   #     0:無遭遇 1:遭遇済 2:アナライズ済
  15.   #--------------------------------------------------------------------------
  16.   def add_enemy_info(enemy_id, type = 0)
  17.     case type
  18.     when 0
  19.       if @enemy_info[enemy_id] == 2
  20.         return false
  21.       end
  22.       @enemy_info[enemy_id] = 1
  23.     when 1
  24.       @enemy_info[enemy_id] = 2
  25.     when -1
  26.       @enemy_info[enemy_id] = 0
  27.     end
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● 魔物図鑑の最大登録数を取得
  31.   #--------------------------------------------------------------------------
  32.   def enemy_book_max
  33.     return $game_temp.enemy_book_data.id_data.size - 1
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # ● 魔物図鑑の現在登録数を取得
  37.   #--------------------------------------------------------------------------
  38.   def enemy_book_now
  39.     now_enemy_info = @enemy_info.keys
  40.     # 登録無視の属性IDを取得
  41.     no_add = $game_temp.enemy_book_data.no_add_element
  42.     new_enemy_info = []
  43.     for i in now_enemy_info
  44.       enemy = $data_enemies[i]
  45.       next if enemy.name == ""
  46.       if enemy.element_ranks[no_add] == 1
  47.         next
  48.       end
  49.       new_enemy_info.push(enemy.id)
  50.     end
  51.     return new_enemy_info.size
  52.   end
  53.   #--------------------------------------------------------------------------
  54.   # ● 魔物図鑑の完成率を取得
  55.   #--------------------------------------------------------------------------
  56.   def enemy_book_complete_percentage
  57.     e_max = enemy_book_max.to_f
  58.     e_now = enemy_book_now.to_f
  59.     comp = e_now / e_max * 100
  60.     return comp.truncate
  61.   end
  62. end
  63.  
  64. class Interpreter
  65.   def enemy_book_max
  66.     return $game_party.enemy_book_max
  67.   end
  68.   def enemy_book_now
  69.     return $game_party.enemy_book_now
  70.   end
  71.   def enemy_book_comp
  72.     return $game_party.enemy_book_complete_percentage
  73.   end
  74. end
  75.  
  76. class Scene_Battle
  77.   alias add_enemy_info_start_phase5 start_phase5
  78.   def start_phase5
  79.     for enemy in $game_troop.enemies
  80.       # エネミーが隠れ状態でない場合
  81.       unless enemy.hidden
  82.         # 敵遭遇情報追加
  83.         $game_party.add_enemy_info(enemy.id, 0)
  84.       end
  85.     end
  86.     add_enemy_info_start_phase5
  87.   end
  88. end
  89.  
  90. class Window_Base < Window
  91.   #--------------------------------------------------------------------------
  92.   # ● エネミーの戦闘後獲得アイテムの描画
  93.   #--------------------------------------------------------------------------
  94.   def draw_enemy_drop_item(enemy, x, y)
  95.     self.contents.font.color = Color.new(79,39,0,255)
  96.     treasures = []
  97.     if enemy.item_id > 0
  98.       treasures.push($data_items[enemy.item_id])
  99.     end
  100.     if enemy.weapon_id > 0
  101.       treasures.push($data_weapons[enemy.weapon_id])
  102.     end
  103.     if enemy.armor_id > 0
  104.       treasures.push($data_armors[enemy.armor_id])
  105.     end
  106.     # 現状ではとりあえず1つのみ描画
  107.     if treasures.size > 0
  108.       item = treasures[0]
  109.       #bitmap = RPG::Cache.icon(item.icon_name)
  110.       opacity = 255
  111. #      self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  112.       name = treasures[0].name
  113.     else
  114.       self.contents.font.color = Color.new(79,39,0,255)
  115.       name = "无"
  116.     end
  117.     self.contents.draw_text(x-15, y+30, 212, 32, name)
  118.   end
  119.   #--------------------------------------------------------------------------
  120.   # ● エネミーの図鑑IDの描画
  121.   #--------------------------------------------------------------------------
  122.   def draw_enemy_book_id(enemy, x, y)
  123.     self.contents.font.color = normal_color
  124.     id = $game_temp.enemy_book_data.id_data.index(enemy.id)
  125.     self.contents.draw_text(x, y, 32, 32, id.to_s)
  126.   end
  127.   #--------------------------------------------------------------------------
  128.   # ● エネミーの名前の描画
  129.   #     enemy : エネミー
  130.   #     x     : 描画先 X 座標
  131.   #     y     : 描画先 Y 座標
  132.   #--------------------------------------------------------------------------
  133.   def draw_enemy_name(enemy, x, y)
  134.     if enemy.gold != 0
  135.       $enelv = enemy.gold
  136.       self.contents.font.color = Color.new(79,39,0,255)
  137.       self.contents.draw_text(x, y, 152, 32, enemy.name)
  138.     else
  139.       $enelv = 1
  140.       self.contents.font.color = Color.new(79,39,0,255)
  141.       self.contents.draw_text(x, y, 152, 32, enemy.name)
  142.     end
  143.  
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # ● エネミーグラフィックの描画(アナライズ)
  147.   #     enemy : エネミー
  148.   #     x     : 描画先 X 座標
  149.   #     y     : 描画先 Y 座標
  150.   #--------------------------------------------------------------------------
  151.   def draw_enemy_graphic(enemy, x, y, opacity = 255)
  152.     bitmap = RPG::Cache.battler(enemy.battler_name, enemy.battler_hue)
  153.     cw = bitmap.width
  154.     ch = bitmap.height
  155.     src_rect = Rect.new(0, 0, cw, ch)
  156.     x = x + (cw / 2 - x) if cw / 2 > x
  157.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # ● エネミーの獲得EXPの描画
  161.   #     enemy : エネミー
  162.   #     x     : 描画先 X 座標
  163.   #     y     : 描画先 Y 座標
  164.   #--------------------------------------------------------------------------
  165.   def draw_enemy_exp(enemy, x, y)
  166.     #self.contents.font.color = system_color
  167.     #self.contents.draw_text(x-120, y, 120, 32, "EXP")
  168.     self.contents.font.color = Color.new(79,39,0,255)
  169.     self.contents.draw_text(x-20, y-12, 36, 32, enemy.exp.to_s, 2)
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # ● エネミーの獲得GOLDの描画
  173.   #     enemy : エネミー
  174.   #     x     : 描画先 X 座標
  175.   #     y     : 描画先 Y 座標
  176.   #--------------------------------------------------------------------------
  177.   def draw_enemy_gold(enemy, x, y)
  178.     #self.contents.font.color = system_color
  179.     #self.contents.draw_text(x, y, 120, 32, $data_system.words.gold)
  180.     self.contents.font.color = Color.new(79,39,0,255)
  181.     if enemy.gold != 0
  182.       self.contents.draw_text(x-120, y+5, 36, 32, enemy.gold.to_s, 2)
  183.     else
  184.       self.contents.draw_text(x-120, y+5, 36, 32, "1", 2)
  185.     end
  186.   end
  187. end
  188. class Game_Enemy_Book < Game_Enemy
  189.   #--------------------------------------------------------------------------
  190.   # ● オブジェクト初期化
  191.   #--------------------------------------------------------------------------
  192.   def initialize(enemy_id)
  193.     super(2, 1)#ダミー
  194.     @enemy_id = enemy_id
  195.     enemy = $data_enemies[@enemy_id]
  196.     @battler_name = enemy.battler_name
  197.     @battler_hue = enemy.battler_hue
  198.     if enemy.gold != 0
  199.       $enelv = enemy.gold
  200.     else
  201.       $enelv = 1
  202.     end
  203.  
  204.     @hp = maxhp
  205.     @sp = maxsp
  206.  
  207.   end
  208. end
  209. #==============================================================================
  210. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  211. #==============================================================================
  212.  
  213. #——————————————————————————————————————
  214. #魔物图鉴
  215. #
  216. #战斗终了时自动添加敌人进入图鉴(class Scene_Battle start_phase5 追加。)
  217. #
  218. #Window_MonsterBook_Info 的 DROP_ITEM_NEED_ANALYZE 为 true
  219. #则会显示敌人携带的物品,通常为false
  220.  
  221. #图鉴完成度的表示功能追加
  222. #SHOW_COMPLETE_TYPE 的数值可以设定
  223. #当为1,显示现有个数/总数,当为2,显示完成百分比,当为3,全显示。
  224. #使用方法:$scene = Scene_MonsterBook.new
  225.  
  226. #特殊敌人ID指定:对于不想加入怪物图鉴的,首先设置一种属性名为“不加入图鉴”
  227. #然后让这个敌人对此属性为A即可。
  228.  
  229. #——————————————————————————————————————
  230. module Enemy_Book_Config
  231.   DROP_ITEM_NEED_ANALYZE = true  #显示物品
  232.   EVA_NAME = "闪躲"              #回避修正的名称(因为数据库中没有定义)
  233.   SHOW_COMPLETE_TYPE = 3         #图鉴完成率表示方法
  234. end
  235. class Data_MonsterBook
  236.   #--------------------------------------------------------------------------
  237.   # ● 图鉴用ID設定
  238.   #--------------------------------------------------------------------------
  239.   def enemy_book_id_set
  240.     data = [0]
  241.     data[1] = 2
  242.     data[2] = 1
  243.     data[3] = 15
  244.     data[4] = 25
  245.     data[5] = 18
  246.     data[6] = 30
  247.     return data
  248.   end
  249. end
  250. class Game_Temp
  251.   attr_accessor :enemy_book_data
  252.   alias temp_enemy_book_data_initialize initialize
  253.   def initialize
  254.     temp_enemy_book_data_initialize
  255.     @enemy_book_data = Data_MonsterBook.new
  256.   end
  257. end
  258. class Data_MonsterBook
  259.   attr_reader :id_data
  260.   #--------------------------------------------------------------------------
  261.   # ● オブジェクト初期化
  262.   #--------------------------------------------------------------------------
  263.   def initialize
  264.     @id_data = enemy_book_id_set
  265.   end
  266.   #--------------------------------------------------------------------------
  267.   # ● 図鑑用登録無視属性取得
  268.   #--------------------------------------------------------------------------
  269.   def no_add_element
  270.     no_add = 0
  271.     # 登録無視の属性IDを取得
  272.     for i in 1...$data_system.elements.size
  273.       if $data_system.elements[i] =~ /不加入图鉴/
  274.         no_add = i
  275.         break
  276.       end
  277.     end
  278.     return no_add
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # ● 図鑑用敵ID設定
  282.   #--------------------------------------------------------------------------
  283.   def enemy_book_id_set
  284.     data = [0]
  285.     no_add = no_add_element
  286.     # 登録無視の属性IDを取得
  287.     for i in 1...$data_enemies.size
  288.       enemy = $data_enemies[i]
  289.       next if enemy.name == ""
  290.       if enemy.element_ranks[no_add] == 1
  291.         next
  292.       end
  293.       data.push(enemy.id)
  294.     end
  295.     return data
  296.   end
  297. end
  298. class Window_MonsterBook < Window_Selectable
  299.   attr_reader   :data
  300.   #--------------------------------------------------------------------------
  301.   # ● オブジェクト初期化
  302.   #--------------------------------------------------------------------------
  303.   def initialize(index=0)
  304.     super(0, 5, 280, 215)
  305.     @column_max = 1
  306.     @book_data = $game_temp.enemy_book_data
  307.     @data = @book_data.id_data.dup
  308.     @data.shift
  309.     #@data.sort!
  310.     @item_max = @data.size
  311.     self.index = 0
  312.     refresh if @item_max > 0
  313.   end
  314.   #--------------------------------------------------------------------------
  315.   # ● 遭遇データを取得
  316.   #--------------------------------------------------------------------------
  317.   def data_set
  318.     data = $game_party.enemy_info.keys
  319.     data.sort!
  320.     newdata = []
  321.     for i in data
  322.       next if $game_party.enemy_info[i] == 0
  323.       # 図鑑登録無視を考慮
  324.       if book_id(i) != nil
  325.         newdata.push(i)
  326.       end
  327.     end
  328.     return newdata
  329.   end
  330.   #--------------------------------------------------------------------------
  331.   # ● 表示許可取得
  332.   #--------------------------------------------------------------------------
  333.   def show?(id)
  334.     if $game_party.enemy_info[id] == 0 or $game_party.enemy_info[id] == nil
  335.       return false
  336.     else
  337.       return true
  338.     end
  339.   end
  340.   #--------------------------------------------------------------------------
  341.   # ● 図鑑用ID取得
  342.   #--------------------------------------------------------------------------
  343.   def book_id(id)
  344.     return @book_data.index(id)
  345.   end
  346.   #--------------------------------------------------------------------------
  347.   # ● エネミー取得
  348.   #--------------------------------------------------------------------------
  349.   def item
  350.     return @data[self.index]
  351.   end
  352.   #--------------------------------------------------------------------------
  353.   # ● リフレッシュ
  354.   #--------------------------------------------------------------------------
  355.   def refresh
  356.     if self.contents != nil
  357.       self.contents.dispose
  358.       self.contents = nil
  359.     end
  360.     self.contents = Bitmap.new(width - 32, row_max * 32)
  361.     #項目数が 0 でなければビットマップを作成し、全項目を描画
  362.     if @item_max > 0
  363.       for i in 0...@item_max
  364.        draw_item(i)
  365.       end
  366.     end
  367.   end
  368.   #--------------------------------------------------------------------------
  369.   # ● 項目の描画
  370.   #     index : 項目番号
  371.   #--------------------------------------------------------------------------
  372.   def draw_item(index)
  373.     enemy = $data_enemies[@data[index]]
  374.     return if enemy == nil
  375.     x = 4 + index % 1 * (288)
  376.     y = index / 1 * 32
  377.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  378.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  379.     self.contents.font.color = normal_color
  380.     self.contents.font.size = 12
  381.     draw_enemy_book_id(enemy, x, y)
  382.     if show?(enemy.id)
  383.  
  384.       if enemy.gold != 0
  385.         $enelv = enemy.gold
  386.         self.contents.font.color = normal_color
  387.         self.contents.draw_text(x + 55, y, 212, 32, enemy.name, 0)
  388.       else
  389.         $enelv = 1
  390.         self.contents.font.color = normal_color
  391.         self.contents.draw_text(x + 55, y, 212, 32, enemy.name, 0)
  392.       end
  393.  
  394.  
  395.     else
  396.       self.contents.draw_text(x + 55, y, 212, 32, "-------", 0)
  397.       return
  398.     end
  399.     if analyze?(@data[index])
  400.       self.contents.font.color = text_color(3)
  401.       self.contents.draw_text(x + 256, y, 24, 32, "済", 2)
  402.     end
  403.   end
  404.   #--------------------------------------------------------------------------
  405.   # ● アナライズ済かどうか
  406.   #--------------------------------------------------------------------------
  407.   def analyze?(enemy_id)
  408.     if $game_party.enemy_info[enemy_id] == 2
  409.       return true
  410.     else
  411.       return false
  412.     end
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # ● 获取 1 页可以显示的项目数
  416.   #--------------------------------------------------------------------------
  417.   def page_item_max
  418.     # 将行数 page_row_max 乘上列数 @column_max
  419.     return page_row_max * @column_max
  420.   end
  421.   #--------------------------------------------------------------------------
  422.   # ● 帮助窗口的设置
  423.   #     help_window : 新的帮助窗口
  424.   #--------------------------------------------------------------------------
  425.   def help_window=(help_window)
  426.     @help_window = help_window
  427.     # 刷新帮助文本 (update_help 定义了继承目标)
  428.     if self.active and @help_window != nil
  429.       update_help
  430.     end
  431.   end
  432.   #--------------------------------------------------------------------------
  433.   # ● 更新光标举行
  434.   #--------------------------------------------------------------------------
  435.   def update_cursor_rect
  436.     # 光标位置不满 0 的情况下
  437.     if @index < 0
  438.       self.cursor_rect.empty
  439.       return
  440.     end
  441.     # 获取当前的行
  442.     row = @index / @column_max
  443.     # 当前行被显示开头行前面的情况下
  444.     if row < self.top_row
  445.       # 从当前行向开头行滚动
  446.       self.top_row = row
  447.     end
  448.     # 当前行被显示末尾行之后的情况下
  449.     if row > self.top_row + (self.page_row_max - 1)
  450.       # 从当前行向末尾滚动
  451.       self.top_row = row - (self.page_row_max - 1)
  452.     end
  453.     # 计算光标的宽
  454.     cursor_width = self.width / @column_max - 32
  455.     # 计算光标坐标
  456.     x = @index % @column_max * (cursor_width + 32)
  457.     y = @index / @column_max * 32 - self.oy + 7
  458.     # 更新国标矩形
  459.     self.cursor_rect.set(x, y, cursor_width - 46, 24)
  460.   end
  461. end
  462.  
  463. class Window_MonsterBook_Info < Window_Base
  464.   include Enemy_Book_Config
  465.   #--------------------------------------------------------------------------
  466.   # ● オブジェクト初期化
  467.   #--------------------------------------------------------------------------
  468.   def initialize
  469.     super(0, 0, 999, 999)
  470.     self.contents = Bitmap.new(width - 32, height - 32)
  471.   end
  472.   #--------------------------------------------------------------------------
  473.   # ● リフレッシュ
  474.   #--------------------------------------------------------------------------
  475.   def refresh(enemy_id)
  476.     self.contents.clear
  477.     self.contents.font.size = 13
  478.     enemy = Game_Enemy_Book.new(enemy_id)
  479.     draw_enemy_graphic(enemy, 163, 400, 200)
  480.     draw_enemy_name(enemy, 430, 44)
  481.  
  482.     draw_actor_hp(enemy,  402, 165)
  483.     draw_actor_sp(enemy,  402, 187)
  484.  
  485.  
  486.     draw_actor_parameter1(enemy, 300,  213, 0)
  487.     draw_actor_parameter1(enemy, 300    , 237, 1)
  488.     draw_actor_parameter1(enemy, 300, 261, 2)
  489.     #self.contents.font.color = Color.new(79,39,0,255)
  490.     #self.contents.draw_text(158+160, 52, 120, 32, EVA_NAME)
  491.     self.contents.font.color = Color.new(79,39,0,255)
  492.     self.contents.draw_text(319+100, 285, 36, 32, enemy.eva.to_s, 2)
  493.     draw_actor_parameter1(enemy, 270    ,  309, 3)
  494.     draw_actor_parameter1(enemy, 365,  309, 4)
  495.     draw_actor_parameter1(enemy, 270    ,  333, 5)
  496.     draw_actor_parameter1(enemy, 365,  333, 6)
  497.     draw_enemy_exp(enemy, 447, 109)
  498.     draw_enemy_gold(enemy, 387+160, 66)
  499.     if analyze?(enemy.id) or !DROP_ITEM_NEED_ANALYZE
  500.       #self.contents.draw_text(360, 246, 96, 32, "无")
  501.       draw_enemy_drop_item(enemy, 360+96+4, 329)
  502.       self.contents.font.color = Color.new(79,39,0,255)
  503.       #draw_element_guard(enemy, 320-32, 160-16+96)
  504.     end
  505.   end
  506.   #--------------------------------------------------------------------------
  507.   # ● アナライズ済かどうか
  508.   #--------------------------------------------------------------------------
  509.   def analyze?(enemy_id)
  510.     if $game_party.enemy_info[enemy_id] == 2
  511.       return false
  512.     else
  513.       return true
  514.     end
  515.   end
  516. end
  517.  
  518. class Scene_MonsterBook
  519.   include Enemy_Book_Config
  520.   #--------------------------------------------------------------------------
  521.   # ● メイン処理
  522.   #--------------------------------------------------------------------------
  523.  
  524.   def main
  525.  
  526.     $game_temp.enemy_book_data = Data_MonsterBook.new
  527.     # 生成图签背景
  528.     @a = Sprite.new
  529.     @a.bitmap = Bitmap.new("Graphics/Pictures/哈哈.png")
  530.     @a.opacity=255
  531.     # 生成图签背景
  532.     @b = Sprite.new
  533.     @b.bitmap = Bitmap.new("Graphics/Pictures/图签.png")
  534.     @b.opacity= 0
  535.     # ウィンドウを作成
  536.     @title_window = Window_Base.new(0, 0, 640, 64)
  537.     @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
  538.     if SHOW_COMPLETE_TYPE != 0
  539.       case SHOW_COMPLETE_TYPE
  540.       when 1
  541.         e_now = $game_party.enemy_book_now
  542.         e_max = $game_party.enemy_book_max
  543.         text = e_now.to_s + "/" + e_max.to_s
  544.       when 2
  545.         comp = $game_party.enemy_book_complete_percentage
  546.         text = comp.to_s + "%"
  547.       when 3
  548.         e_now = $game_party.enemy_book_now
  549.         e_max = $game_party.enemy_book_max
  550.         comp = $game_party.enemy_book_complete_percentage
  551.         text = e_now.to_s + "/" + e_max.to_s + " " + comp.to_s + "%"
  552.       end
  553.       if text != nil
  554.         @title_window.contents.font.size = 12
  555.         @title_window.contents.font.color = Color.new(79, 39, 0, 255)
  556.         @title_window.contents.draw_text(-90, -10, 288, 32,  text, 2)
  557.       end
  558.     end
  559.     @main_window = Window_MonsterBook.new
  560.     @main_window.active = true
  561.  
  562.     # インフォウィンドウを作成 (不可視・非アクティブに設定)
  563.     @info_window = Window_MonsterBook_Info.new
  564.     @info_window.z = 110
  565.     @info_window.visible = false
  566.     @info_window.active = false
  567.     @visible_index = 0
  568.     # トランジション実行
  569.     Graphics.transition
  570.     # メインループ
  571.     loop do
  572.       # ゲーム画面を更新
  573.       Graphics.update
  574.       # 入力情報を更新
  575.       Input.update
  576.       # フレーム更新
  577.       update
  578.       # 画面が切り替わったらループを中断
  579.       if $scene != self
  580.         break
  581.       end
  582.     end
  583.     # トランジション準備
  584.     Graphics.freeze
  585.     # ウィンドウを解放
  586.     @main_window.dispose
  587.     @info_window.dispose
  588.     @title_window.dispose
  589.     @a.dispose
  590.     @b.dispose
  591.   end
  592.   #--------------------------------------------------------------------------
  593.   # ● フレーム更新
  594.   #--------------------------------------------------------------------------
  595.   def update
  596.     # 刷新窗口
  597.     @a.update
  598.     @b.update
  599.     @main_window.update
  600.     @info_window.update
  601.     if @info_window.active
  602.       update_info
  603.       return
  604.     end
  605.     # メインウィンドウがアクティブの場合: update_target を呼ぶ
  606.     if @main_window.active
  607.       update_main
  608.       return
  609.     end
  610.   end
  611.   #--------------------------------------------------------------------------
  612.   # ● フレーム更新 (メインウィンドウがアクティブの場合)
  613.   #--------------------------------------------------------------------------
  614.   def update_main
  615.     # B ボタンが押された場合
  616.     if Input.trigger?(Input::B)
  617.       # キャンセル SE を演奏
  618.       $game_system.se_play($data_system.cancel_se)
  619.       $scene = Scene_Map.new
  620.       return
  621.     end
  622.     # C ボタンが押された場合
  623.     if Input.trigger?(Input::C)
  624.        @a.visible = true
  625.        @a.opacity=255
  626.        @b.visible = true
  627.        @b.opacity=255
  628.     @main_window.visible=false
  629.         @title_window.visible=false
  630.       if @main_window.item == nil or @main_window.show?(@main_window.item) == false
  631.         # ブザー SE を演奏
  632.         $game_system.se_play($data_system.buzzer_se)
  633.     @main_window.visible=true
  634.         @title_window.visible=true
  635.       @b.visible = false
  636.       @b.opacity=0
  637.         return
  638.       end
  639.       # 決定 SE を演奏
  640.       $game_system.se_play($data_system.decision_se)
  641.       @main_window.active = false
  642.       @info_window.active = true
  643.       @info_window.visible = true
  644.       @visible_index = @main_window.index
  645.       @info_window.refresh(@main_window.item)
  646.       return
  647.     end
  648.   end
  649.   #--------------------------------------------------------------------------
  650.   # ● フレーム更新 (インフォウィンドウがアクティブの場合)
  651.   #--------------------------------------------------------------------------
  652.   def update_info
  653.     # B ボタンが押された場合
  654.     if Input.trigger?(Input::B)
  655.       # キャンセル SE を演奏
  656.       $game_system.se_play($data_system.cancel_se)
  657.       @main_window.active = true
  658.       @info_window.active = false
  659.       @info_window.visible = false
  660.     @main_window.visible=true
  661.         @title_window.visible=true
  662.       @a.visible = true
  663.       @a.opacity=255
  664.       @b.visible = false
  665.       @b.opacity=0
  666.  
  667.       return
  668.     end
  669.     # C ボタンが押された場合
  670.     if Input.trigger?(Input::C)
  671.       # 決定 SE を演奏
  672.       #$game_system.se_play($data_system.decision_se)
  673.       return
  674.     end
  675.     if Input.trigger?(Input::L)
  676.       # 決定 SE を演奏
  677.       $game_system.se_play($data_system.decision_se)
  678.       loop_end = false
  679.       while loop_end == false
  680.         if @visible_index != 0
  681.           @visible_index -= 1
  682.         else
  683.           @visible_index = @main_window.data.size - 1
  684.         end
  685.         loop_end = true if @main_window.show?(@main_window.data[@visible_index])
  686.       end
  687.       id = @main_window.data[@visible_index]
  688.       @info_window.refresh(id)
  689.       return
  690.     end
  691.     if Input.trigger?(Input::R)
  692.       # 決定 SE を演奏
  693.       $game_system.se_play($data_system.decision_se)
  694.       loop_end = false
  695.       while loop_end == false
  696.         if @visible_index != @main_window.data.size - 1
  697.           @visible_index += 1
  698.         else
  699.           @visible_index = 0
  700.         end
  701.         loop_end = true if @main_window.show?(@main_window.data[@visible_index])
  702.       end
  703.       id = @main_window.data[@visible_index]
  704.       @info_window.refresh(id)
  705.       return
  706.     end
  707.   end
  708. end




用的是这个脚本额,想请问一下, 游戏进行到一定时候的时候,将已存有的怪物图鉴数据全部清空重新来过,这种怎么做呀?谢谢各位大了,阿门。

评分

参与人数 1星屑 +35 收起 理由
︶ㄣ牛排ぶ + 35 手动认可奖励

查看全部评分

Lv1.梦旅人

梦石
0
星屑
50
在线时间
41 小时
注册时间
2014-8-7
帖子
67
2
 楼主| 发表于 2015-1-6 01:11:58 | 只看该作者
呜呜。木有人么

点评

@RyanBern 大,已经编辑过了呢  发表于 2015-1-8 13:17
脚本不全呢,把完整脚本发上来看看  发表于 2015-1-6 11:42
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (版主)

梦石
0
星屑
9532
在线时间
5073 小时
注册时间
2013-6-21
帖子
3580

开拓者贵宾剧作品鉴家

3
发表于 2015-1-8 16:30:07 | 只看该作者
本帖最后由 RyanBern 于 2015-1-8 18:30 编辑
无敌啊鸡 发表于 2015-1-6 01:11
呜呜。木有人么


看了一下脚本,应该是这样(在事件里面使用脚本即可):
RUBY 代码复制
  1. (1...$data_enemies.size).each{|id| $game_party.add_enemy_info(id, -1)}

如果一行写不下可以用'\'符号连行。
RUBY 代码复制
  1. (1...$data_enemies.size).each\
  2. {|id| $game_party.add_enemy_info(id, -1)}


要不然这样试试看:
RUBY 代码复制
  1. $game_party.enemy_info = {}


PS下次发代码的时候用代码框把代码框起来,详见这个楼的点评。

点评

没问题了呢,谢谢大神。o(╯□╰)o  发表于 2015-1-8 21:07
谢谢大,可是图鉴虽然清0了,但是完成率和总数却变成上限了 就像: 247/247 100% 这样子了,可不可以让这2个变成0/247 0%呢?  发表于 2015-1-8 17:51
[pre lang="Ruby"]代码内容[/pre]  发表于 2015-1-8 16:33

评分

参与人数 1星屑 +200 收起 理由
︶ㄣ牛排ぶ + 200 手动认可奖励

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-21 08:32

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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