# ▽△▽ XRXSv30. MeLT_Status. SY2. パワーグロウ! ▽△▽ # # publish 2010/ 4/10 # update - # #============================================================================== # カスタマイズポイント #============================================================================== module XRXSV30 # # コマンドに表示する文字 # Captions[2] = "パワーアップ" # # グロウに利用・消費するアイテムのID #   (ランク6まで上げられるアイテム #   ランク7〜限界なしのアイテム2) # SY2ItemID = 26 SY2ItemID2 = 27 # # ↑の境目(二つ目のアイテムの開始ランク)となるランク # SY2Rank2 = 7 # # MPも表示する? # SY2MPEnabled = false # # パラメーターグロウのランク、上昇量配列(HP,MP,その他4) # SY2HP = [50, 50, 50, 50, 60, 60, 100, 100, 100, 100, 120, 120] SY2MP = [10, 10, 10, 10, 10, 10, 20, 20, 25, 25, 30, 30] SY2PR = [ 3, 3, 3, 3, 3, 3, 5, 5, 8, 8, 10, 10] # # スキン(Graphics/System) # SY2Skin = "MenuPowerGrowth" end #============================================================================== # 設定 #============================================================================== XRXSV30::CommandIDs.push(2) class Game_Actor < Game_Battler attr_writer :sy2_ranks def sy2_ranks @sy2_ranks = [] if @sy2_ranks == nil return @sy2_ranks end end #============================================================================== # ステータス画面 #============================================================================== class Scene_Status < Scene_Base #-------------------------------------------------------------------------- # クラス選択の決定 #-------------------------------------------------------------------------- alias xrxsv30sy2_class_decision class_decision def class_decision case @class_window.type when 2 if @class_window.enable? Sound.play_recovery @class_window.lose_item! @class_window.effect_powerup(@actor) @actorstatus_window.refresh @equipstatus_window.refresh @class_window.refresh @class_window.active = true else Sound.play_buzzer end end else xrxsv30sy2_class_decision end end #============================================================================== # クラスリストウィンドウへのセット #============================================================================== class Window_Classes < Window_Selectable alias xrxsv30sy2_set set def set(index) @set_type = index case @set_type when 2 @item_max = (XRXSV30::SY2MPEnabled ? 6 : 5) @enable = [] refresh else xrxsv30sy2_set(index) end end alias xrxsv30sy2_new_parameter_actor new_parameter_actor def new_parameter_actor if @set_type == 2 temp_actor = @actor.clone temp_actor.sy2_ranks = temp_actor.sy2_ranks.dup effect_powerup(temp_actor) return temp_actor else return xrxsv30sy2_new_parameter_actor end end def enable? return @enable[self.index] end #-------------------------------------------------------------------------- # パワーアップの適用(一時/実際 両方に使用) #-------------------------------------------------------------------------- def effect_powerup(actor) n = self.index n += 1 if !XRXSV30::SY2MPEnabled and self.index >= 1 case n when 0 set = XRXSV30::SY2HP when 1 set = XRXSV30::SY2MP else set = XRXSV30::SY2PR end now_rank = actor.sy2_ranks[n].to_i powerup_amount = set[now_rank].to_i case n when 0 actor.maxhp += powerup_amount when 1 actor.maxmp += powerup_amount when 2 actor.atk += powerup_amount when 3 actor.def += powerup_amount when 4 actor.spi += powerup_amount when 5 actor.agi += powerup_amount end actor.sy2_ranks[n] = now_rank + 1 end def lose_item! n = self.index n += 1 if !XRXSV30::SY2MPEnabled and self.index >= 1 now_rank = @actor.sy2_ranks[n].to_i $game_party.lose_item(self.get_need_item(now_rank), 1) end def get_need_item(now_rank) item_id = (XRXSV30::SY2Rank2 > now_rank + 1 ? XRXSV30::SY2ItemID : XRXSV30::SY2ItemID2) return $data_items[item_id] end #-------------------------------------------------------------------------- # 項目の描画 #-------------------------------------------------------------------------- alias xrxsv30sy2_draw_item draw_item def draw_item(index) return xrxsv30sy2_draw_item(index) if @set_type != 2 skin = Cache.system(XRXSV30::SY2Skin) n = index n += 1 if !XRXSV30::SY2MPEnabled and index >= 1 now_rank = @actor.sy2_ranks[n].to_i str = [ Vocab.hp_a, Vocab.mp_a, Vocab.atk, Vocab.def, Vocab.spi, Vocab.agi ][n] case n when 0 set = XRXSV30::SY2HP when 1 set = XRXSV30::SY2MP else set = XRXSV30::SY2PR end rect = item_rect(index) x = 0 y = rect.y w = 64 needed_item = get_need_item(now_rank) @enable[index] = ($game_party.has_item?(needed_item) and now_rank < set.size) self.contents.font.color = system_color self.contents.font.color.alpha = (@enable[index] ? 255 : 128) self.contents.font.size = 20 self.contents.draw_text(4, y, w, WLH, str) gw = skin.width / 4 blt_rect = Rect.new(0, 0, gw, 22) for i in 0...set.size gx = w + gw * i blt_rect.x = (now_rank == set.size ? 3 : now_rank <= i ? 0 : i + 1 >= XRXSV30::SY2Rank2 ? 2 : 1) * gw self.contents.blt(gx, y+1, skin, blt_rect) end x2 = self.contents.width - 64 self.draw_icon(needed_item.icon_index, x2, y, @enable[index]) x2 = self.contents.width - 48 self.contents.font.size = 14 self.contents.draw_number_s(x2 + 28, y, 24, WLH, $game_party.item_number(needed_item)) end end