RitoJS Ancien staffeux
Messages postés : 1925 Date d'inscription : 22/02/2012 Jauge LPC :
| Sujet: [VX] CC skill menu Mer 20 Fév 2013 - 22:02 | |
| Crédit: ClaimhUn de mes scripts favoris sur VX. Ce scripts vous permet d'avoir un menu de compétence plus détaillé (au niveau des compétences) et accessoirement change un peu l'interface du menu: Ce script existe aussi pour les combats ! (compatible avec le SBS): Script:Pour le menu: - Code:
-
#============================================================================== # ■ VX-RGSS-23 スキル画面-改 [Ver.1.0.0] by Claimh #------------------------------------------------------------------------------ # スキル画面(戦闘以外)を改変します。 #【変更点】 # ・スキル情報ウィンドウ追加 # ・アクターウィンドウの表示変更 # ・レイアウト変更 #==============================================================================
module SkillEx # 属性表示あり USE_ELE = true # 表示対象の属性 ELEMENTS = [9,10,11,12,13,14,15,16] # 属性のアイコン[ID:0,…] E_ICON = [0, 50, 2, 4, 14, 16, 12, 0, 0, 104, 105, 106, 107, 108, 109, 110, 111] end
#============================================================================== # ■ Window_SkillList #============================================================================== class Window_SkillList < Window_Selectable attr_accessor :info_window #-------------------------------------------------------------------------- # ● オブジェクト初期化 # actor : アクター #-------------------------------------------------------------------------- def initialize(actor, h=416-(WLH+32)) super(0, WLH+32, 280, h) @actor = actor @column_max = 1 self.index = 0 @info_window = nil data_refresh update_cursor end #-------------------------------------------------------------------------- # ● スキルの取得 #-------------------------------------------------------------------------- def skill return @data[self.index] end #-------------------------------------------------------------------------- # ● データリフレッシュ #-------------------------------------------------------------------------- def data_refresh @data = [] for skill in @actor.skills @data.push(skill) if skill.id == @actor.last_skill_id self.index = @data.size - 1 end end @item_max = @data.size create_contents refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max draw_item(i, false) end end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index, clear=true) rect = item_rect(index) self.contents.clear_rect(rect) if clear skill = @data[index] if skill != nil rect.width -= 4 enabled = @actor.skill_can_use?(skill) draw_item_name(skill, rect.x, rect.y, enabled) self.contents.draw_text(rect, @actor.calc_mp_cost(skill), 2) end end #-------------------------------------------------------------------------- # ● ヘルプテキスト更新 #-------------------------------------------------------------------------- def update_help @help_window.set_text(skill == nil ? "" : skill.description) @info_window.refresh(skill) unless @info_window.nil? end end
#============================================================================== # ■ Window_SkillUser #============================================================================== class Window_SkillUser < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 # actor : アクター #-------------------------------------------------------------------------- def initialize(actor) super(280, WLH+32, 264, WLH*4 + 32) @actor = actor refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_face(@actor, 0, 0) draw_actor_name(@actor, 100, 0) # draw_actor_level(@actor, 170, 0) draw_actor_hp(@actor, 110, WLH*1) draw_actor_mp(@actor, 110, WLH*2) draw_actor_state(@actor, 110, WLH*3) end end
#============================================================================== # ■ Window_SkillInfo #============================================================================== class Window_SkillInfo < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(y=WLH*5+64, h=416-(WLH*5+64)) super(280, y, 264, h) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- SCOPE = ["なし", "敵単体", "敵全体", "敵単体", "敵単体", "敵二体", "敵三体", "味方単体", "味方全体", "味方単体", "味方全体", "使用者"] def refresh(skill=nil) self.contents.clear return if skill.nil? self.contents.font.color = system_color self.contents.draw_text(0, WLH*0, 100, WLH, "種別") self.contents.draw_text(0, WLH*1, 100, WLH, "効果範囲") self.contents.draw_text(0, WLH*2, 100, WLH, "命中率") self.contents.draw_text(0, WLH*3, 100, WLH, "属性") if SkillEx::USE_ELE self.contents.font.color = normal_color if skill.base_damage > 0 txt = skill.physical_attack ? "物理攻撃" : "攻撃魔法" elsif skill.base_damage < 0 txt = skill.physical_attack ? "回復スキル" : "回復魔法" else # とりあえず… txt = skill.physical_attack ? "特殊スキル" : "補助魔法" end self.contents.draw_text(100, WLH*0, 160, WLH, txt) self.contents.draw_text(100, WLH*1, 200, WLH, SCOPE[skill.scope]) self.contents.draw_text(100, WLH*2, 60, WLH, skill.hit.to_s+" %", 2) if SkillEx::USE_ELE i = 0 for element_id in skill.element_set next unless SkillEx::ELEMENTS.include?(element_id) draw_element_icon(element_id, 100+i*24, WLH*3) i += 1 end end end #-------------------------------------------------------------------------- # ● 属性アイコンの描画 #-------------------------------------------------------------------------- def draw_element_icon(element_id, x, y, enabled = true) draw_icon(SkillEx::E_ICON[element_id], x, y, enabled) end end
#============================================================================== # ■ Scene_Skill #============================================================================== class Scene_Skill < Scene_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 # actor_index : アクターインデックス #-------------------------------------------------------------------------- def initialize(actor_index = 0, menu_index = 1) @actor_index = actor_index @menu_index = menu_index end #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_menu_background @actor = $game_party.members[@actor_index] @viewport = Viewport.new(0, 0, 544, 416) @help_window = Window_Help.new @help_window.viewport = @viewport @status_window = Window_SkillUser.new(@actor) @status_window.viewport = @viewport @info_window = Window_SkillInfo.new @info_window.viewport = @viewport @skill_window = Window_SkillList.new(@actor) @skill_window.viewport = @viewport @skill_window.info_window = @info_window @skill_window.help_window = @help_window @target_window = Window_MenuStatus.new(0, 0) hide_target_window end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate super dispose_menu_background @help_window.dispose @status_window.dispose @info_window.dispose @skill_window.dispose @target_window.dispose end #-------------------------------------------------------------------------- # ● 元の画面へ戻る #-------------------------------------------------------------------------- def return_scene $scene = Scene_Menu.new(@menu_index) end #-------------------------------------------------------------------------- # ● 次のアクターの画面に切り替え #-------------------------------------------------------------------------- def next_actor @actor_index += 1 @actor_index %= $game_party.members.size $scene = Scene_Skill.new(@actor_index, @menu_index) end #-------------------------------------------------------------------------- # ● 前のアクターの画面に切り替え #-------------------------------------------------------------------------- def prev_actor @actor_index += $game_party.members.size - 1 @actor_index %= $game_party.members.size $scene = Scene_Skill.new(@actor_index, @menu_index) end #-------------------------------------------------------------------------- # ● スキルの決定 #-------------------------------------------------------------------------- def determine_skill if @skill.for_friend? show_target_window(true) # 常に右 if @skill.for_all? @target_window.index = 99 elsif @skill.for_user? @target_window.index = @actor_index + 100 else if $game_party.last_target_index < @target_window.item_max @target_window.index = $game_party.last_target_index else @target_window.index = 0 end end else use_skill_nontarget end end end Pour les combats: - Code:
-
#============================================================================== # ■ VX-RGSS-23 スキル画面-改-battle [Ver.1.0.0] by Claimh #------------------------------------------------------------------------------ # 戦闘でのスキルリスト表示を改変します。 #【変更点】 # ・スキル情報ウィンドウ追加 # ・レイアウト変更 #==============================================================================
class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● スキル選択の開始 #-------------------------------------------------------------------------- def start_skill_selection @help_window = Window_Help.new @skill_window = Window_SkillList.new(@active_battler, 232) @sk_info_window = Window_SkillInfo.new(24+32, 232) @skill_window.info_window = @sk_info_window @skill_window.help_window = @help_window @actor_command_window.active = false end #-------------------------------------------------------------------------- # ● スキル選択の終了 #-------------------------------------------------------------------------- def end_skill_selection if @skill_window != nil @skill_window.dispose @sk_info_window.dispose @skill_window = @sk_info_window = nil @help_window.dispose @help_window = nil end @actor_command_window.active = true end end Bien évidement, si vous utilisez le script pour les combat vous devez avant tout posséder celui pour le menu. |
|
RitoJS Ancien staffeux
Messages postés : 1925 Date d'inscription : 22/02/2012 Jauge LPC :
| Sujet: Re: [VX] CC skill menu Mer 20 Fév 2013 - 22:04 | |
| Thanks ! (J'aurais préféré des Kitkat mais c'est pas grave.) |
|
Magicalichigo Ancienne staffeuse
Messages postés : 4252 Date d'inscription : 02/08/2011 Jauge LPC :
| Sujet: Re: [VX] CC skill menu Jeu 21 Fév 2013 - 0:05 | |
| Ouais vive le boulot que vous me filez vous deux xD |
|