Partagez
Aller en bas
Yasan
Yasan
Membre

Nombre de messages : 149
Age : 34
Distinction : aucune
Date d'inscription : 18/01/2011

[Résolu] Accéder au menu Statut en combat Empty [Résolu] Accéder au menu Statut en combat

le Jeu 5 Juil 2012 - 16:41
Tout est dans le titre, j'aimerais pouvoir accéder au menu Statut dans un combat. Ca m'a pas l'air compliqué mais je sais pas comment je dois procéder :/

Quelqu'un peut m'aider ?

Merci d'avance !
Ti-Max
Ti-Max
Membre

Nombre de messages : 1096
Localisation : Canada/Québec
Distinction : Poisson 2018 [Amal']
Date d'inscription : 02/09/2009

[Résolu] Accéder au menu Statut en combat Empty Re: [Résolu] Accéder au menu Statut en combat

le Jeu 5 Juil 2012 - 17:24
Si tu possède le système de base de VX Ace, c'est sur que c'est une modification de script.

Cependant, le système affiche des icônes quand le héros est attend d'un statut, à moins que ça ne te suffit pas, mais c'est beaucoup demandé (Pour moi en tout cas) sauf si un scripteur est capable de le faire.

TI-MAX
XakuX
XakuX
Membre

Nombre de messages : 1263
Age : 24
Localisation : là où tu n'auras jamais l'idée de chercher !
Distinction : * Bougre d'âne


Le bizu' à son Coco' [Résolu] Accéder au menu Statut en combat 344805
[Coco' Smile]

Membre aux désirs inassouvis de domination mondiale. [Maître du destin]
Date d'inscription : 13/12/2008

[Résolu] Accéder au menu Statut en combat Empty Re: [Résolu] Accéder au menu Statut en combat

le Jeu 5 Juil 2012 - 19:14
Voila pour toi:

Code:

###############################################################
###                        Par Xakux                      ###
### Permet d'afficher le menu status dans le menu de combat ###
###############################################################

class Window_PartyCommand < Window_Command
 
  def make_command_list
    add_command(Vocab::fight,  :fight)
    add_command(Vocab::escape, :escape, BattleManager.can_escape?)
    add_command(Vocab::status,  :status)
  end
 
end

class Scene_Battle < Scene_Base
 
  def create_party_command_window
    @party_command_window = Window_PartyCommand.new
    @party_command_window.viewport = @info_viewport
    @party_command_window.set_handler(:fight,  method(:command_fight))
    @party_command_window.set_handler(:escape, method(:command_escape))
    @party_command_window.set_handler(:status, method(:command_status))
    @party_command_window.unselect
  end
 
  def command_status
      SceneManager.call(Scene_Status)
  end

end
 

Tu a sde la chance, tu as été mon acte de générosité de la journée Smile
Bon par contre y a le message du début de combat qui apparait quand tu quittes le menu status, et je crois pas que tu puisse choisir le héros, j'te ferais des modif's sous peu Wink
En attendant les scripts de RMVX ace sont vachement bien foutu putain, c'est encore plus facile que RMVX, j'ai halluciné :O

Bonne continuation Wink
Yasan
Yasan
Membre

Nombre de messages : 149
Age : 34
Distinction : aucune
Date d'inscription : 18/01/2011

[Résolu] Accéder au menu Statut en combat Empty Re: [Résolu] Accéder au menu Statut en combat

le Ven 6 Juil 2012 - 9:19
Merci ^^

J'utilise des scripts de Yanfly, ce qui complique un peu la chose et je sais que tu as autre chose à faire que de regarder ça en détail. La Scene Status ne modifie rien dans le jeu, vu qu'on ne consulte que des informations, donc ça "devrait"' être plus facile que d'autres scenes.

J'utilise en particulier celui-ci :

Spoiler:
#==============================================================================
#
# ▼ Yanfly Engine Ace - Battle Command List v1.08
# -- Last Updated: 2012.01.10
# -- Level: Normal
# -- Requires: n/a
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-BattleCommandList"] = true

#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.10 - Compatibility Update: Battle System FTB
# 2011.12.30 - Bug Fixed: Disappearing windows when no confirm window is used.
# 2011.12.26 - Bug Fixed: Actor Command Window disappears without Battle Engine
# Ace installed.
# 2011.12.19 - Compatibility Update: Class System
# - New Actor Command: Subclass List
# 2011.12.17 - Bug Fixed: Item command from Actor Command Window fixed.
# 2011.12.15 - Bug Fixed: Prevented multiple actions per battler.
# 2011.12.13 - Compatibility Update: Command Equip
# Compatibility Update: Add-On: Command Party
# 2011.12.12 - Compatibility Update: Command Autobattle
# 2011.12.10 - Started Script and Finished.
# - Compatibility Update: Combat Log Display
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script allows you to change the order to commands that appear in battle
# for the Party Command Window and Actor Command Window. In addition to the
# ability to change the order commands appear, you may also add commands to the
# Actor Command Window that can trigger the usage of skills and/or items. The
# Confirm Command Window is also a new addition that appears at the end of the
# action select phase (after the last actor has made a choice) before entering
# the battle phase.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Actor Notetags - These notetags go in the actors notebox in the database.
# -----------------------------------------------------------------------------
#
# string
# string
#

# These lines go inside of an actor's notebox to adjust the battle commands
# that appear in the actor's Actor Command Window. Refer to the module as to
# what to use for the strings. If a custom command list is used for an actor,
# it will take priority over its class's custom command list, which takes place
# over the default command list.
#
# -----------------------------------------------------------------------------
# Class Notetags - These notetags go in the class notebox in the database.
# -----------------------------------------------------------------------------
#
# string
# string
#

# These lines go inside of a class's notebox to adjust the battle commands
# that appear in the actor's Actor Command Window. Refer to the module as to
# what to use for the strings. A custom command list for a class does not take
# priority over an actor's custom command list, but it does take priority over
# the default command list.
#
# -----------------------------------------------------------------------------
# Skill Notetags - These notetags go in the skill notebox in the database.
# -----------------------------------------------------------------------------
#
# If this skill is being used as a command, it will use "string" to replace the
# skill's name in the command list window.
#
#
# This hides the command until the actor has learned the respective skill for
# the command to appear in the actor's command list.
#
#
# This hides the command until the actor is capable of using the command by
# meeting TP costs or MP costs.
#
#
# This switch x is OFF, then the command remains hidden. If the switch is ON,
# then the command becomes enabled and appears in the command list.
#
# -----------------------------------------------------------------------------
# Item Notetags - These notetags go in the item notebox in the database.
# -----------------------------------------------------------------------------
#
# If this item is being used as a command, it will use "string" to replace the
# item's name in the command list window.
#
#
# This hides the command until the actor is capable of using the command as
# long as that item is usable normally.
#
#
# This switch x is OFF, then the command remains hidden. If the switch is ON,
# then the command becomes enabled and appears in the command list.
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
# For maximum compatibility with Yanfly Engine Ace - Ace Battle Engine, place
# this script under Ace Battle Engine.
#
#==============================================================================

module YEA
module BATTLE_COMMANDS

#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Party Command Window Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This section adjusts the commands for the Party Command Window. Rearrange
# commands as you see fit or add in new ones. Here's a list of which
# command does what:
#
# -------------------------------------------------------------------------
# :command Description
# -------------------------------------------------------------------------
# :fight Enters the command selection phase for actors. Default.
# :escape Party attempts to escape from battle. Default.
#
# :combatlog Requires YEA - Combat Log Display.
# :autobattle Requires YEA - Command Autobattle.
# :party Requires YEA - Party System Add-On: Command Party.
#
# And that's all of the currently available commands. This list will be
# updated as more scripts become available.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This array arranges the order of which the commands appear in the Party
# Command window.
PARTY_COMMANDS =[
:fight,
:autobattle,
:party,
# :custom1,
# :custom2,
:escape,
] # Do not remove this.

#--------------------------------------------------------------------------
# - Party Command Custom Commands -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# For those who use scripts to that may produce unique effects in battle,
# use this hash to manage the custom commands for the Party Command Window.
# You can disable certain commands or prevent them from appearing by using
# switches. If you don't wish to bind them to a switch, set the proper
# switch to 0 for it to have no impact.
#--------------------------------------------------------------------------
CUSTOM_PARTY_COMMANDS ={
# :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
:custom1 => [ "Custom Name", 0, 0, :command_name1],
:custom2 => [ "Custom Name", 13, 0, :command_name2],
} # Do not remove this.

#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Actor Command Window Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This section only adjusts the default commands for actors. If you wish
# for an actor to have a unique command list, use the notetags listed in
# the instructions to apply them. The custom command lists for actors will
# override this command list.
#
# Here's a list of which command does what:
#
# -------------------------------------------------------------------------
# :command Description
# -------------------------------------------------------------------------
# "ATTACK" Normal attack for actor. Default.
# "SKILL LIST" All of the skill types the actor can use. Default.
# "DEFEND" Set defend action for actor. Default.
# "ITEMS" Opens up the item menu for the actor. Default.
#
# "SKILL TYPE X" Specifically puts in skill type X if actor has it.
# "SKILL X" Uses Skill X in that slot.
# "ITEM X" Uses Item X in that slot.
#
# "AUTOBATTLE" Requires YEA - Command Autobattle.
# "EQUIP" Requires YEA - Command Equip
# "SUBCLASS LIST" Requires YEA - Class System. Adds subclass skill types.
#
# And that's all of the currently available commands. This list will be
# updated as more scripts become available.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This array arranges the order of which the commands appear in the Actor
# Command window if the actor does not have a custom command list.
DEFAULT_ACTOR_COMMANDS =[
# "AUTOBATTLE",
"ATTACK",
"SKILL LIST",
"SUBCLASS LIST",
"DEFEND",
"ITEMS",
"EQUIP",
] # Do not remove this.

#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Confirm Command Window Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# The confirm window is something new that's been added. It shows after the
# last actor has made a decision as to what actions the player wishes to
# take for the turn Here's a list of which command does what:
#
# -------------------------------------------------------------------------
# :command Description
# -------------------------------------------------------------------------
# :execute Start the battle turn. Comes with this script.
#
# :combatlog Requires YEA - Combat Log Display.
#
# And that's all of the currently available commands. This list will be
# updated as more scripts become available.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
USE_CONFIRM_WINDOW = true # Set to false if you don't wish to use it.

# This array arranges the order of which the commands appear in the Party
# Command window.
CONFIRM_COMMANDS =[
:execute,
:combatlog,
# :custom1,
# :custom2,
] # Do not remove this.

# This sets what text appears for the execute command.
EXECUTE_VOCAB = "Execute"

#--------------------------------------------------------------------------
# - Confirm Command Custom Commands -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# For those who use scripts to that may produce unique effects in battle,
# use this hash to manage the custom commands for the Confirm Command
# Window. You can disable certain commands or prevent them from appearing
# by using switches. If you don't wish to bind them to a switch, set the
# proper switch to 0 for it to have no impact.
#--------------------------------------------------------------------------
CUSTOM_CONFIRM_COMMANDS ={
# :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
:custom1 => [ "Custom Name", 0, 0, :command_name1],
:custom2 => [ "Custom Text", 13, 0, :command_name2],
} # Do not remove this.

end # BATTLE_COMMANDS
end # YEA

#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

module YEA
module REGEXP
module BASEITEM

COMMAND_LIST_ON = /<(?:COMMAND_LIST|command list)>/i
COMMAND_LIST_OFF = /<\/(?:COMMAND_LIST|command list)>/i

end # BASEITEM
module USABLEITEM

COMMAND_NAME = /<(?:COMMAND NAME|command name):[ ](.*)>/i
COMMAND_HIDE_LEARN =
/<(?:COMMAND_HIDE_UNTIL_LEARN|command hide until learn)>/i
COMMAND_HIDE_USABLE =
/<(?:COMMAND_HIDE_UNTIL_USABLE|command hide until usable)>/i
COMMAND_HIDE_SWITCH =
/<(?:COMMAND_HIDE_UNTIL_SWITCH|command hide until switch):[ ](\d+)>/i

end # USABLEITEM
end # REGEXP
end # YEA

#==============================================================================
# ■ DataManager
#==============================================================================

module DataManager

#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class < def self.load_database
load_database_bcl
load_notetags_bcl
end

#--------------------------------------------------------------------------
# new method: load_notetags_bcl
#--------------------------------------------------------------------------
def self.load_notetags_bcl
groups = [$data_actors, $data_classes, $data_skills, $data_items]
for group in groups
for obj in group
next if obj.nil?
obj.load_notetags_bcl
end
end
end

end # DataManager

#==============================================================================
# ■ RPG::BaseItem
#==============================================================================

class RPG::BaseItem

#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :battle_commands

#--------------------------------------------------------------------------
# common cache: load_notetags_bcl
#--------------------------------------------------------------------------
def load_notetags_bcl
@battle_commands = []
@command_list = false
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::BASEITEM::COMMAND_LIST_ON
@command_list = true
when YEA::REGEXP::BASEITEM::COMMAND_LIST_OFF
@command_list = false
else
next unless @command_list
@battle_commands.push(line.to_s.upcase)
#---
end
} # self.note.split
#---
if @battle_commands == [] and self.is_a?(RPG::Class)
@battle_commands = YEA::BATTLE_COMMANDS::DEFAULT_ACTOR_COMMANDS
end
end

end # RPG::BaseItem

#==============================================================================
# ■ RPG::UsableItem
#==============================================================================

class RPG::UsableItem < RPG::BaseItem

#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :command_name
attr_accessor :command_hide_until_learn
attr_accessor :command_hide_until_usable
attr_accessor :command_hide_until_switch

#--------------------------------------------------------------------------
# common cache: load_notetags_bcl
#--------------------------------------------------------------------------
def load_notetags_bcl
@command_name = @name.clone
@command_hide_until_switch = 0
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::USABLEITEM::COMMAND_NAME
@command_name = $1.to_s
when YEA::REGEXP::USABLEITEM::COMMAND_HIDE_LEARN
@command_hide_until_learn = true
when YEA::REGEXP::USABLEITEM::COMMAND_HIDE_USABLE
@command_hide_until_usable = true
when YEA::REGEXP::USABLEITEM::COMMAND_HIDE_USABLE
command_hide_until_switch = $1.to_i
#---
end
} # self.note.split
#---
end

end # RPG::UsableItem

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler

#--------------------------------------------------------------------------
# new method: battle_commands
#--------------------------------------------------------------------------
def battle_commands
return self.actor.battle_commands unless actor.battle_commands == []
return self.class.battle_commands
end

#--------------------------------------------------------------------------
# new method: next_command_valid?
#--------------------------------------------------------------------------
def next_command_valid?
if $imported["YEA-BattleSystem-FTB"] && BattleManager.btype?(:ftb)
return false
end
return false if @action_input_index >= @actions.size - 1
return true
end

end # Game_Actor

#==============================================================================
# ■ Window_PartyCommand
#==============================================================================

class Window_PartyCommand < Window_Command

#--------------------------------------------------------------------------
# overwrite method: make_command_list
#--------------------------------------------------------------------------
def make_command_list
for command in YEA::BATTLE_COMMANDS::PARTY_COMMANDS
case command
when :fight
add_command(Vocab::fight, :fight)
when :escape
add_command(Vocab::escape, :escape, BattleManager.can_escape?)
when :combatlog
next unless $imported["YEA-CombatLogDisplay"]
add_command(YEA::COMBAT_LOG::COMMAND_NAME, :combatlog)
when :autobattle
next unless $imported["YEA-CommandAutobattle"]
add_autobattle_command
when :party
next unless $imported["YEA-PartySystem"]
next unless $imported["YEA-CommandParty"]
add_party_command
else
process_custom_command(command)
end
end
end

#--------------------------------------------------------------------------
# new method: process_custom_command
#--------------------------------------------------------------------------
def process_custom_command(command)
return unless YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS.include?(command)
show = YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS[command][2]
continue = show <= 0 ? true : $game_switches[show]
return unless continue
text = YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS[command][0]
switch = YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS[command][1]
enabled = switch <= 0 ? true : $game_switches[switch]
add_command(text, command, enabled)
end

end # Window_PartyCommand

#==============================================================================
# ■ Window_ConfirmCommand
#==============================================================================

class Window_ConfirmCommand < Window_Command

#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
super(0, 0)
deactivate
hide
end

#--------------------------------------------------------------------------
# window_width
#--------------------------------------------------------------------------
def window_width; return 128; end

#--------------------------------------------------------------------------
# visible_line_number
#--------------------------------------------------------------------------
def visible_line_number; return 4; end

#--------------------------------------------------------------------------
# overwrite method: make_command_list
#--------------------------------------------------------------------------
def make_command_list
for command in YEA::BATTLE_COMMANDS::CONFIRM_COMMANDS
case command
when :execute
text = YEA::BATTLE_COMMANDS::EXECUTE_VOCAB
add_command(text, :execute)
when :combatlog
next unless $imported["YEA-CombatLogDisplay"]
add_command(YEA::COMBAT_LOG::COMMAND_NAME, :combatlog)
else
process_custom_command(command)
end
end
end

#--------------------------------------------------------------------------
# new method: process_custom_command
#--------------------------------------------------------------------------
def process_custom_command(command)
return unless YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS.include?(command)
show = YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS[command][2]
continue = show <= 0 ? true : $game_switches[show]
return unless continue
text = YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS[command][0]
switch = YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS[command][1]
enabled = switch <= 0 ? true : $game_switches[switch]
add_command(text, command, enabled)
end

#--------------------------------------------------------------------------
# setup
#--------------------------------------------------------------------------
def setup
clear_command_list
make_command_list
refresh
select(0)
activate
self.openness = 255
show
end

#--------------------------------------------------------------------------
# process_handling
#--------------------------------------------------------------------------
if $imported["YEA-BattleEngine"]
def process_handling
return unless open? && active
return process_dir4 if Input.repeat?(:LEFT)
return super
end

#--------------------------------------------------------------------------
# process_dir4
#--------------------------------------------------------------------------
def process_dir4
Sound.play_cursor
Input.update
deactivate
call_handler(:dir4)
end
end # $imported["YEA-BattleEngine"]

end # Window_ConfirmCommand

#==============================================================================
# ■ Window_ActorCommand
#==============================================================================

class Window_ActorCommand < Window_Command

#--------------------------------------------------------------------------
# alias method: setup
#--------------------------------------------------------------------------
alias window_actorcommand_setup_bcl setup
def setup(actor)
window_actorcommand_setup_bcl(actor)
show
end

#--------------------------------------------------------------------------
# overwrite method: make_command_list
#--------------------------------------------------------------------------
def make_command_list
return if @actor.nil?
@stype_list = []
for command in @actor.battle_commands
case command.upcase
#---
when /ATTACK/i
add_attack_command
when /SKILL LIST/i
add_skill_commands
when /DEFEND/i
add_guard_command
when /ITEMS/i
add_item_command
#---
when /SKILL TYPE[ ](\d+)/i
add_skill_type_command($1.to_i)
when /SKILL[ ](\d+)/i
add_skill_id_command($1.to_i)
when /ITEM[ ](\d+)/i
add_item_id_command($1.to_i)
#---
when /AUTOBATTLE/i
next unless $imported["YEA-CommandAutobattle"]
add_autobattle_command
when /EQUIP/i
next unless $imported["YEA-CommandEquip"]
add_equip_command
when /SUBCLASS LIST/i
add_subclass_skill_types
#---
else; next
end
end
end

#--------------------------------------------------------------------------
# overwrite method: add_skill_commands
#--------------------------------------------------------------------------
def add_skill_commands
@actor.added_skill_types.each do |stype_id|
next if @stype_list.include?(stype_id)
next if include_subclass_type?(stype_id)
add_skill_type_command(stype_id)
end
end

#--------------------------------------------------------------------------
# new method: include_subclass_type?
#--------------------------------------------------------------------------
def include_subclass_type?(stype_id)
return false unless $imported["YEA-ClassSystem"]
return @actor.subclass_skill_types.include?(stype_id)
end

#--------------------------------------------------------------------------
# new method: add_subclass_skill_types
#--------------------------------------------------------------------------
def add_subclass_skill_types
return unless $imported["YEA-ClassSystem"]
return if @actor.subclass.nil?
@actor.subclass_skill_types.sort.each do |stype_id|
next if @stype_list.include?(stype_id)
add_skill_type_command(stype_id)
end
end

#--------------------------------------------------------------------------
# new method: add_skill_type_command
#--------------------------------------------------------------------------
def add_skill_type_command(stype_id)
return unless @actor.added_skill_types.include?(stype_id)
return if @stype_list.include?(stype_id)
@stype_list.push(stype_id)
name = $data_system.skill_types[stype_id]
add_command(name, :skill, true, stype_id)
end

#--------------------------------------------------------------------------
# new method: add_skill_id_command
#--------------------------------------------------------------------------
def add_skill_id_command(skill_id)
return if $data_skills[skill_id].nil?
return unless add_use_skill?(skill_id)
name = $data_skills[skill_id].command_name
add_command(name, :use_skill, use_skill_valid?(skill_id), skill_id)
end

#--------------------------------------------------------------------------
# new method: add_use_skill?
#--------------------------------------------------------------------------
def add_use_skill?(skill_id)
skill = $data_skills[skill_id]
return false if hide_until_learn?(skill)
return false if hide_until_usable?(skill)
return false if hide_until_switch?(skill)
return true
end

#--------------------------------------------------------------------------
# new method: hide_until_learn?
#--------------------------------------------------------------------------
def hide_until_learn?(skill)
return false unless skill.command_hide_until_learn
return false if @actor.skill_learn?(skill)
return false if @actor.added_skills.include?(skill.id)
return true
end

#--------------------------------------------------------------------------
# new method: hide_until_usable?
#--------------------------------------------------------------------------
def hide_until_usable?(skill)
return false unless skill.command_hide_until_usable
return false if @actor.usable?(skill)
return true
end

#--------------------------------------------------------------------------
# new method: hide_until_switch?
#--------------------------------------------------------------------------
def hide_until_switch?(skill)
return false unless skill.command_hide_until_switch > 0
return false if $game_switches[skill.command_hide_until_switch]
return true
end

#--------------------------------------------------------------------------
# new method: use_skill_valid?
#--------------------------------------------------------------------------
def use_skill_valid?(skill_id)
skill = $data_skills[skill_id]
return false unless @actor.skill_conditions_met?(skill)
return true
end

#--------------------------------------------------------------------------
# new method: add_item_id_command
#--------------------------------------------------------------------------
def add_item_id_command(item_id)
return if $data_items[item_id].nil?
return unless add_use_item?(item_id)
name = $data_items[item_id].command_name
add_command(name, :use_item, use_item_valid?(item_id), item_id)
end

#--------------------------------------------------------------------------
# new method: add_use_item?
#--------------------------------------------------------------------------
def add_use_item?(item_id)
item = $data_items[item_id]
return false if hide_until_usable?(item)
return false if hide_until_switch?(item)
return true
end

#--------------------------------------------------------------------------
# new method: use_item_valid?
#--------------------------------------------------------------------------
def use_item_valid?(item_id)
item = $data_items[item_id]
return false unless @actor.item_conditions_met?(item)
return true
end

end # Window_ActorCommand

#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base

#--------------------------------------------------------------------------
# alias method: create_all_windows
#--------------------------------------------------------------------------
alias scene_battle_create_all_windows_bcl create_all_windows
def create_all_windows
scene_battle_create_all_windows_bcl
create_confirm_command_window
end

#--------------------------------------------------------------------------
# alias method: create_party_command_window
#--------------------------------------------------------------------------
alias create_party_command_window_bcl create_party_command_window
def create_party_command_window
create_party_command_window_bcl
process_custom_party_commands
end

#--------------------------------------------------------------------------
# new method: process_custom_party_commands
#--------------------------------------------------------------------------
def process_custom_party_commands
for command in YEA::BATTLE_COMMANDS::PARTY_COMMANDS
next unless YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS.include?(command)
called_method = YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS[command][3]
@party_command_window.set_handler(command, method(called_method))
end
end

#--------------------------------------------------------------------------
# alias method: create_actor_command_window
#--------------------------------------------------------------------------
alias create_actor_command_window_bcl create_actor_command_window
def create_actor_command_window
create_actor_command_window_bcl
@actor_command_window.set_handler(:use_skill, method(:command_use_skill))
@actor_command_window.set_handler(:use_item, method(:command_use_item))
end

#--------------------------------------------------------------------------
# alias method: start_actor_command_selection
#--------------------------------------------------------------------------
alias start_actor_command_selection_bcl start_actor_command_selection
def start_actor_command_selection
@confirm_command_window.hide unless @confirm_command_window.nil?
start_actor_command_selection_bcl
@actor_command_window.show
end

#--------------------------------------------------------------------------
# new method: command_use_skill
#--------------------------------------------------------------------------
def command_use_skill
@skill = $data_skills[@actor_command_window.current_ext]
BattleManager.actor.input.set_skill(@skill.id)
BattleManager.actor.last_skill.object = @skill
status_redraw_target(BattleManager.actor)
if $imported["YEA-BattleEngine"]
$game_temp.battle_aid = @skill
if @skill.for_opponent?
select_enemy_selection
elsif @skill.for_friend?
select_actor_selection
else
next_command
$game_temp.battle_aid = nil
end
else
if !@skill.need_selection?
next_command
elsif @skill.for_opponent?
select_enemy_selection
else
select_actor_selection
end
end
end

#--------------------------------------------------------------------------
# new method: command_use_item
#--------------------------------------------------------------------------
def command_use_item
@item = $data_items[@actor_command_window.current_ext]
BattleManager.actor.input.set_item(@item.id)
status_redraw_target(BattleManager.actor)
if $imported["YEA-BattleEngine"]
$game_temp.battle_aid = @item
if @item.for_opponent?
select_enemy_selection
elsif @item.for_friend?
select_actor_selection
else
next_command
$game_temp.battle_aid = nil
end
else
if !@item.need_selection?
next_command
elsif @item.for_opponent?
select_enemy_selection
else
select_actor_selection
end
end
end

#--------------------------------------------------------------------------
# alias method: on_actor_ok
#--------------------------------------------------------------------------
alias scene_battle_on_actor_ok_bcl on_actor_ok
def on_actor_ok
scene_battle_on_actor_ok_bcl
return if !@confirm_command_window.nil? && @confirm_command_window.visible
@actor_command_window.show
end

#--------------------------------------------------------------------------
# alias method: on_actor_cancel
#--------------------------------------------------------------------------
alias scene_battle_on_actor_cancel_bcl on_actor_cancel
def on_actor_cancel
scene_battle_on_actor_cancel_bcl
case @actor_command_window.current_symbol
when :use_skill, :use_item
@help_window.hide
@status_window.show
@actor_command_window.activate
status_redraw_target(BattleManager.actor)
end
end

#--------------------------------------------------------------------------
# alias method: on_enemy_ok
#--------------------------------------------------------------------------
alias scene_battle_on_enemy_ok_bcl on_enemy_ok
def on_enemy_ok
scene_battle_on_enemy_ok_bcl
return if !@confirm_command_window.nil? && @confirm_command_window.visible
@actor_command_window.show
end

#--------------------------------------------------------------------------
# alias method: on_enemy_cancel
#--------------------------------------------------------------------------
alias scene_battle_on_enemy_cancel_bcl on_enemy_cancel
def on_enemy_cancel
scene_battle_on_enemy_cancel_bcl
case @actor_command_window.current_symbol
when :use_skill, :use_item
@help_window.hide
@status_window.show
@actor_command_window.activate
status_redraw_target(BattleManager.actor)
end
end

#--------------------------------------------------------------------------
# new method: status_redraw_target
#--------------------------------------------------------------------------
def status_redraw_target(target)
return unless target.actor?
@status_window.draw_item($game_party.battle_members.index(target))
end

#--------------------------------------------------------------------------
# new method: create_confirm_command_window
#--------------------------------------------------------------------------
def create_confirm_command_window
return unless YEA::BATTLE_COMMANDS::USE_CONFIRM_WINDOW
@confirm_command_window = Window_ConfirmCommand.new
@confirm_command_window.viewport = @info_viewport
@confirm_command_window.set_handler(:execute, method(:command_execute))
@confirm_command_window.set_handler(:cancel, method(:on_confirm_cancel))
@confirm_command_window.set_handler(:dir4, method(:on_confirm_cancel))
@confirm_command_window.unselect
@confirm_command_window.x = Graphics.width
process_custom_confirm_commands
process_confirm_compatibility_commands
end

#--------------------------------------------------------------------------
# new method: process_custom_confirm_commands
#--------------------------------------------------------------------------
def process_custom_confirm_commands
for command in YEA::BATTLE_COMMANDS::CONFIRM_COMMANDS
next unless YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS.include?(command)
called_method = YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS[command][3]
@party_command_window.set_handler(command, method(called_method))
end
end

#--------------------------------------------------------------------------
# new method: process_confirm_compatibility_commands
#--------------------------------------------------------------------------
def process_confirm_compatibility_commands
#---
if $imported["YEA-CombatLogDisplay"]
@confirm_command_window.set_handler(:combatlog, method(:open_combatlog))
end
#---
end

#--------------------------------------------------------------------------
# new method: start_confirm_command_selection
#--------------------------------------------------------------------------
def start_confirm_command_selection
if $imported["YEA-BattleEngine"]
@status_window.show
redraw_current_status
@status_aid_window.hide
end
@status_window.unselect
@actor_command_window.hide
@confirm_command_window.setup
end

#--------------------------------------------------------------------------
# new method: on_confirm_cancel
#--------------------------------------------------------------------------
def on_confirm_cancel
@confirm_command_window.hide unless @confirm_command_window.nil?
@actor_command_window.show
@actor_command_window.setup(BattleManager.actor)
@status_window.select(BattleManager.actor.index)
prior_command unless BattleManager.actor.inputable?
end

#--------------------------------------------------------------------------
# alias method: next_command
#--------------------------------------------------------------------------
alias scene_battle_next_command_bcl next_command
def next_command
if prompt_next_actor?
scene_battle_next_command_bcl
elsif YEA::BATTLE_COMMANDS::USE_CONFIRM_WINDOW
start_confirm_command_selection
else
turn_start
end
end

#--------------------------------------------------------------------------
# new method: prompt_next_actor?
#--------------------------------------------------------------------------
def prompt_next_actor?
index = @status_window.index
last_index = $game_party.battle_members.size - 1
for member in $game_party.battle_members.reverse
break if member.inputable?
last_index -= 1
end
if index >= last_index
actor = $game_party.battle_members[index]
return true if prompt_ftb_action?(actor)
return true if actor.next_command_valid?
return false if YEA::BATTLE_COMMANDS::USE_CONFIRM_WINDOW
end
return true
end

#--------------------------------------------------------------------------
# new method: prompt_ftb_action?
#--------------------------------------------------------------------------
def prompt_ftb_action?(actor)
return false unless $imported["YEA-BattleEngine"]
return false unless $imported["YEA-BattleSystem-FTB"]
return false unless BattleManager.btype?(:ftb)
return actor.current_action.valid?
end

#--------------------------------------------------------------------------
# new method: command_execute
#--------------------------------------------------------------------------
def command_execute
@confirm_command_window.close
turn_start
end

#--------------------------------------------------------------------------
# new method: command_name1
#--------------------------------------------------------------------------
def command_name1
# Do nothing.
end

#--------------------------------------------------------------------------
# new method: command_name2
#--------------------------------------------------------------------------
def command_name2
# Do nothing.
end

end # Scene_Battle

#==============================================================================
#
# ▼ End of File
#
#==============================================================================

Mais comme je suis une bille, je n'arrive pas à comprendre comment ajouter Status dans une commande custom, comme il est permis de le faire. J'essaye de décortiquer ton script pour voir quoi ajouter mais c'est d'un autre niveau -_-. L'autre soucis possible à avoir, c'est quand je quitte le menu Status, il faut que les autres scripts qui bidouillent la scene Battle s'update pour fonctionner -_- A ton avis, il faut ajouter les updates dans ton script à chaque fois ?
Chaos17
Chaos17
Membre

Nombre de messages : 222
Localisation : France
Distinction : aucune
Date d'inscription : 11/04/2012
http://blogofchaos17.wordpress.com/

[Résolu] Accéder au menu Statut en combat Empty Re: [Résolu] Accéder au menu Statut en combat

le Ven 6 Juil 2012 - 12:19
Yanfly a créé un script nommer Scan je crois, il te permet de voir les statut, si je ne me trompe pas.
Yasan
Yasan
Membre

Nombre de messages : 149
Age : 34
Distinction : aucune
Date d'inscription : 18/01/2011

[Résolu] Accéder au menu Statut en combat Empty Re: [Résolu] Accéder au menu Statut en combat

le Ven 6 Juil 2012 - 12:33
Oui mais il permet en fait de voir les caractéristiques des adversaires.

Mon gameplay est basé sur les statuts (comme brûlé, gelé etc.) mais on ne peut en voir que 4 maximum dans la fenêtre pour des raisons d'interface.

J'ai donc ajouté un script de modern algebra qui permet de voir une liste défilante des statuts et de leur description, pour permettre au joueur de bien repérer quels statuts sont infligés.

L'objectif serait d'avoir accès pendant le combat à la fenêtre de statut (qui contient une nouvelle option, celle de modern algebra), purement consultative et qui permet de savoir où on en est des buffs, debuff et compagnie.

Mais ça me semble plus compliqué qu'autre chose, hélas -_-
XakuX
XakuX
Membre

Nombre de messages : 1263
Age : 24
Localisation : là où tu n'auras jamais l'idée de chercher !
Distinction : * Bougre d'âne


Le bizu' à son Coco' [Résolu] Accéder au menu Statut en combat 344805
[Coco' Smile]

Membre aux désirs inassouvis de domination mondiale. [Maître du destin]
Date d'inscription : 13/12/2008

[Résolu] Accéder au menu Statut en combat Empty Re: [Résolu] Accéder au menu Statut en combat

le Ven 6 Juil 2012 - 14:20
Nié, et pourquoi tu le dis pas plus tot que t'utilise un autre script triple andouille farçi :P
Bon, je te regarde ça une autre fois, j'ai une aprem' chargé x)
rohlalala, je suis vraiment pas tombé sur le problème le plus simple encore une fois x)
Yasan
Yasan
Membre

Nombre de messages : 149
Age : 34
Distinction : aucune
Date d'inscription : 18/01/2011

[Résolu] Accéder au menu Statut en combat Empty Re: [Résolu] Accéder au menu Statut en combat

le Ven 6 Juil 2012 - 15:50
Maaaaais parce que souvent, quand il y a un autre script dans le lot, les scripteurs ne viennent pas voir XD Donc j'escomptais tenter de bidouiller en fonction :P

XakuX
XakuX
Membre

Nombre de messages : 1263
Age : 24
Localisation : là où tu n'auras jamais l'idée de chercher !
Distinction : * Bougre d'âne


Le bizu' à son Coco' [Résolu] Accéder au menu Statut en combat 344805
[Coco' Smile]

Membre aux désirs inassouvis de domination mondiale. [Maître du destin]
Date d'inscription : 13/12/2008

[Résolu] Accéder au menu Statut en combat Empty Re: [Résolu] Accéder au menu Statut en combat

le Ven 6 Juil 2012 - 19:53
C'est vrai que je regarde jamais quand ça cause de script que j'utilise pas x) Pas con le mec x)
Bon je regarde ça j'ai 30 minutes avant que d'autres gens viennent à la maison ^^

PS: Le script marche pas tout seul, il en faut pas un autre avec par hasard ? Smile

PS2: Ah mais d'accord, je viens de comprendre, le script que tu m'as fais passé c'est juste pour personaliser les commandes, bon, donc j'dois pouvoir te faire ça sans faire de test, Yanfly a bien foutu son script:
ligne 147 tu changes:
Code:
# :custom1,
Par
Code:
:status
et ligne 163:
Code:
:custom1 => [ "Custom Name", 0, 0, :command_name1],
par
Code:
:status => [ "Status", 0, 0, SceneManager.call(Scene_Status)]

Je suis pas sur pour la dernière ligne, parce que j'aurais bien rajouté une méthode dans le script, seulement il dit de rien rajouter après la limite, bizarre :/
Yasan
Yasan
Membre

Nombre de messages : 149
Age : 34
Distinction : aucune
Date d'inscription : 18/01/2011

[Résolu] Accéder au menu Statut en combat Empty Re: [Résolu] Accéder au menu Statut en combat

le Ven 6 Juil 2012 - 20:23
Si si il fonctionne, c'est un stand alone ! Simplement tu ne vois pas ce qu'il fait vu qu'il faut ajouter d'autres scripts qui débloquent des fonctions en plus (et qui seront affichées comme il faut) ou alors il faut rajouter les notetags aux actors pour leur donner une command list spécifique. Bref en mettant juste le script, ça fait rien de spécial Very Happy

EDIT :

Ca ne marche pas, parce que SceneManager.call(Scene_Status), c'est pas une méthode appelée comme les autres avec les :

J'arrive pas à piger ce qui pourrait marcher, j'ai tenté plusieurs trucs mais à chaque fois bing ! Il veut pas la méthode de la custom command.
XakuX
XakuX
Membre

Nombre de messages : 1263
Age : 24
Localisation : là où tu n'auras jamais l'idée de chercher !
Distinction : * Bougre d'âne


Le bizu' à son Coco' [Résolu] Accéder au menu Statut en combat 344805
[Coco' Smile]

Membre aux désirs inassouvis de domination mondiale. [Maître du destin]
Date d'inscription : 13/12/2008

[Résolu] Accéder au menu Statut en combat Empty Re: [Résolu] Accéder au menu Statut en combat

le Sam 7 Juil 2012 - 13:26
Bah quand je le mets tout seul dans un projet vierge il me met une erreur sur la ligne 294, d'ailleurs je comprends pas trop c'te ligne x)
bref, à mon avis il faut mettre un nom de command genre: :command_status et rajouter cette méthode dans le Scene_Battle, seulement il dit de pas toucher au Scene_Battle :/
Yasan
Yasan
Membre

Nombre de messages : 149
Age : 34
Distinction : aucune
Date d'inscription : 18/01/2011

[Résolu] Accéder au menu Statut en combat Empty Re: [Résolu] Accéder au menu Statut en combat

le Sam 7 Juil 2012 - 13:49
Moi j'ai aucune erreur -_-

En fait, quand il dit que faut pas toucher, c'est pas exactement vrai. Pour les fonctions nouvelles comme l'autobattle, qu'il a lui même créé, il y a un script à part et il a intégré ce script qui rajoute la fonctionnalité nouvelle dans son script Command. Donc en gros, il est possible de faire un script à part qui autorise de rentrer dans le menu Status et de l'autoriser de la même manière. Reste à savoir comment.

J'ai pris le script le plus court qui ajoute une fonction prise en compte par le script Command.
Spoiler:
#==============================================================================
#
# ▼ Yanfly Engine Ace - Combat Log Display v1.02
# -- Last Updated: 2012.01.24
# -- Level: Easy
# -- Requires: n/a
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-CombatLogDisplay"] = true

#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.24 - Bug Fixed: Confirm window crash with Battle Command List.
# 2012.01.16 - Prevented subsequent line inserts.
# 2011.12.10 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Sometimes text appears way too fast in the battle system or sometimes players
# may miss what kind of information was delivered on-screen. For times like
# that, being able to access the combat log would be important. The combat log
# records all of the text that appears in the battle log window at the top.
# The player can access the combat log display any time during action selection
# phase. Sometimes, players can even review over the combat log to try and
# figure out any kinds of patterns enemies may even have.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================

module YEA
module COMBAT_LOG

#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Combat Log Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Adjust the settings here to modify how the combat log works for your
# game. You can change the command name and extra text that gets fitted
# into the combat log over time. If you don't want specific text to appear,
# just set the text to "" and nothing will show.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
COMMAND_NAME = "CombatLog" # Command list name.
LINE_COLOUR = 0 # Line colour for separators.
LINE_COLOUR_ALPHA = 48 # Opacity of the line colour.
TEXT_BATTLE_START = "\\c[4]Battle Start!" # Battle start text.
TEXT_TURN_NUMBER = "\\c[4]Turn Number: \\c[6]%d" # Turn number text.

end # COMBAT_LOG
end # YEA

#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

#==============================================================================
# ■ Window_BattleLog
#==============================================================================

class Window_BattleLog < Window_Selectable

#--------------------------------------------------------------------------
# new method: combatlog_window=
#--------------------------------------------------------------------------
def combatlog_window=(window)
@combatlog_window = window
end

#--------------------------------------------------------------------------
# new method: combatlog
#--------------------------------------------------------------------------
def combatlog(text)
return if @combatlog_window.nil?
return if text == ""
@combatlog_window.add_line(text)
end

#--------------------------------------------------------------------------
# alias method: add_text
#--------------------------------------------------------------------------
alias window_battlelog_add_text_cld add_text
def add_text(text)
combatlog(text)
window_battlelog_add_text_cld(text)
end

#--------------------------------------------------------------------------
# alias method: replace_text
#--------------------------------------------------------------------------
alias window_battlelog_replace_text_cld replace_text
def replace_text(text)
combatlog(text)
window_battlelog_replace_text_cld(text)
end

#--------------------------------------------------------------------------
# Start Ace Battle Engine Compatibility
#--------------------------------------------------------------------------
if $imported["YEA-BattleEngine"]

#--------------------------------------------------------------------------
# alias method: display_current_state
#--------------------------------------------------------------------------
alias window_battlelog_display_current_state_cld display_current_state
def display_current_state(subject)
window_battlelog_display_current_state_cld(subject)
return if YEA::BATTLE::MSG_CURRENT_STATE
return if subject.most_important_state_text.empty?
combatlog(subject.name + subject.most_important_state_text)
end

#--------------------------------------------------------------------------
# alias method: display_use_item
#--------------------------------------------------------------------------
alias window_battlelog_display_use_item_cld display_use_item
def display_use_item(subject, item)
window_battlelog_display_use_item_cld(subject, item)
return if YEA::BATTLE::MSG_CURRENT_ACTION
if item.is_a?(RPG::Skill)
combatlog(subject.name + item.message1)
unless item.message2.empty?
combatlog(item.message2)
end
else
combatlog(sprintf(Vocab::UseItem, subject.name, item.name))
end
end

#--------------------------------------------------------------------------
# alias method: display_counter
#--------------------------------------------------------------------------
alias window_battlelog_display_counter_cld display_counter
def display_counter(target, item)
window_battlelog_display_counter_cld(target, item)
return if YEA::BATTLE::MSG_COUNTERATTACK
combatlog(sprintf(Vocab::CounterAttack, target.name))
end

#--------------------------------------------------------------------------
# alias method: display_reflection
#--------------------------------------------------------------------------
alias window_battlelog_display_reflection_cld display_reflection
def display_reflection(target, item)
window_battlelog_display_reflection_cld(target, item)
return if YEA::BATTLE::MSG_REFLECT_MAGIC
combatlog(sprintf(Vocab::MagicReflection, target.name))
end

#--------------------------------------------------------------------------
# alias method: display_substitute
#--------------------------------------------------------------------------
alias window_battlelog_display_substitute_cld display_substitute
def display_substitute(substitute, target)
window_battlelog_display_substitute_cld(substitute, target)
return if YEA::BATTLE::MSG_SUBSTITUTE_HIT
combatlog(sprintf(Vocab::Substitute, substitute.name, target.name))
end

#--------------------------------------------------------------------------
# alias method: display_failure
#--------------------------------------------------------------------------
alias window_battlelog_display_failure_cld display_failure
def display_failure(target, item)
window_battlelog_display_failure_cld(target, item)
return if YEA::BATTLE::MSG_FAILURE_HIT
if target.result.hit? && !target.result.success
combatlog(sprintf(Vocab::ActionFailure, target.name))
end
end

#--------------------------------------------------------------------------
# alias method: display_critical
#--------------------------------------------------------------------------
alias window_battlelog_display_critical_cld display_critical
def display_critical(target, item)
window_battlelog_display_critical_cld(target, item)
return if YEA::BATTLE::MSG_CRITICAL_HIT
if target.result.critical
text = target.actor? ? Vocab::CriticalToActor : Vocab::CriticalToEnemy
combatlog(text)
end
end

#--------------------------------------------------------------------------
# alias method: display_miss
#--------------------------------------------------------------------------
alias window_battlelog_display_miss_cld display_miss
def display_miss(target, item)
window_battlelog_display_miss_cld(target, item)
return if YEA::BATTLE::MSG_HIT_MISSED
if !item || item.physical?
fmt = target.actor? ? Vocab::ActorNoHit : Vocab::EnemyNoHit
else
fmt = Vocab::ActionFailure
end
combatlog(sprintf(fmt, target.name))
end

#--------------------------------------------------------------------------
# alias method: display_evasion
#--------------------------------------------------------------------------
alias window_battlelog_display_evasion_cld display_evasion
def display_evasion(target, item)
window_battlelog_display_evasion_cld(target, item)
return if YEA::BATTLE::MSG_EVASION
if !item || item.physical?
fmt = Vocab::Evasion
else
fmt = Vocab::MagicEvasion
end
combatlog(sprintf(fmt, target.name))
end

#--------------------------------------------------------------------------
# alias method: display_hp_damage
#--------------------------------------------------------------------------
alias window_battlelog_display_hp_damage_cld display_hp_damage
def display_hp_damage(target, item)
window_battlelog_display_hp_damage_cld(target, item)
return if YEA::BATTLE::MSG_HP_DAMAGE
return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
combatlog(target.result.hp_damage_text)
end

#--------------------------------------------------------------------------
# alias method: display_mp_damage
#--------------------------------------------------------------------------
alias window_battlelog_display_mp_damage_cld display_mp_damage
def display_mp_damage(target, item)
window_battlelog_display_mp_damage_cld(target, item)
return if YEA::BATTLE::MSG_MP_DAMAGE
combatlog(target.result.mp_damage_text)
end

#--------------------------------------------------------------------------
# alias method: display_tp_damage
#--------------------------------------------------------------------------
alias window_battlelog_display_tp_damage_cld display_tp_damage
def display_tp_damage(target, item)
window_battlelog_display_tp_damage_cld(target, item)
return if YEA::BATTLE::MSG_TP_DAMAGE
combatlog(target.result.tp_damage_text)
end

#--------------------------------------------------------------------------
# alias method: display_added_states
#--------------------------------------------------------------------------
alias window_battlelog_display_added_states_cld display_added_states
def display_added_states(target)
window_battlelog_display_added_states_cld(target)
return if YEA::BATTLE::MSG_ADDED_STATES
target.result.added_state_objects.each do |state|
state_msg = target.actor? ? state.message1 : state.message2
next if state_msg.empty?
combatlog(target.name + state_msg)
end
end

#--------------------------------------------------------------------------
# alias method: display_removed_states
#--------------------------------------------------------------------------
alias window_battlelog_display_removed_states_cld display_removed_states
def display_removed_states(target)
window_battlelog_display_removed_states_cld(target)
return if YEA::BATTLE::MSG_REMOVED_STATES
target.result.removed_state_objects.each do |state|
next if state.message4.empty?
combatlog(target.name + state.message4)
end
end

#--------------------------------------------------------------------------
# alias method: display_buffs
#--------------------------------------------------------------------------
alias window_battlelog_display_buffs_cld display_buffs
def display_buffs(target, buffs, fmt)
window_battlelog_display_buffs_cld(target, buffs, fmt)
return if YEA::BATTLE::MSG_CHANGED_BUFFS
buffs.each do |param_id|
combatlog(sprintf(fmt, target.name, Vocab::param(param_id)))
end
end

#--------------------------------------------------------------------------
# End Ace Battle Engine Compatibility
#--------------------------------------------------------------------------
end # $imported["YEA-BattleEngine"]

end # Window_BattleLog

#==============================================================================
# ■ Window_CombatLog
#==============================================================================

class Window_CombatLog < Window_Selectable

#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
@data = []
super(0, 0, Graphics.width, Graphics.height-120)
deactivate
hide
end

#--------------------------------------------------------------------------
# add_line
#--------------------------------------------------------------------------
def add_line(text)
return if text == "-" && @data[@data.size - 1] == "-"
@data.push(text)
end

#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
create_contents
draw_all_items
end

#--------------------------------------------------------------------------
# item_max
#--------------------------------------------------------------------------
def item_max; return @data.size; end

#--------------------------------------------------------------------------
# draw_item
#--------------------------------------------------------------------------
def draw_item(index)
text = @data[index]
return if text.nil?
rect = item_rect_for_text(index)
if text == "-"
draw_horz_line(rect.y)
else
draw_text_ex(rect.x, rect.y, text)
end
end

#--------------------------------------------------------------------------
# draw_horz_line
#--------------------------------------------------------------------------
def draw_horz_line(y)
line_y = y + line_height / 2 - 1
contents.fill_rect(4, line_y, contents_width-8, 2, line_colour)
end

#--------------------------------------------------------------------------
# line_colour
#--------------------------------------------------------------------------
def line_colour
colour = text_color(YEA::COMBAT_LOG::LINE_COLOUR)
colour.alpha = YEA::COMBAT_LOG::LINE_COLOUR_ALPHA
return colour
end

#--------------------------------------------------------------------------
# show
#--------------------------------------------------------------------------
def show
super
refresh
activate
select([item_max-1, 0].max)
end

#--------------------------------------------------------------------------
# hide
#--------------------------------------------------------------------------
def hide
deactivate
super
end

end # Window_CombatLog

#==============================================================================
# ■ Window_PartyCommand
#==============================================================================

class Window_PartyCommand < Window_Command

#--------------------------------------------------------------------------
# alias method: make_command_list
#--------------------------------------------------------------------------
alias window_partycommand_make_command_list_cld make_command_list
def make_command_list
window_partycommand_make_command_list_cld
return if $imported["YEA-BattleCommandList"]
add_command(YEA::COMBAT_LOG::COMMAND_NAME, :combatlog)
end

end # Window_PartyCommand

#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base

#--------------------------------------------------------------------------
# alias method: create_log_window
#--------------------------------------------------------------------------
alias scene_battle_create_log_window_cld create_log_window
def create_log_window
scene_battle_create_log_window_cld
create_combatlog_window
end

#--------------------------------------------------------------------------
# new method: create_combatlog_window
#--------------------------------------------------------------------------
def create_combatlog_window
@combatlog_window = Window_CombatLog.new
@log_window.combatlog_window = @combatlog_window
@combatlog_window.set_handler(:cancel, method(:close_combatlog))
@combatlog_window.add_line("-")
@combatlog_window.add_line(YEA::COMBAT_LOG::TEXT_BATTLE_START)
@combatlog_window.add_line("-")
end

#--------------------------------------------------------------------------
# new method: open_combatlog
#--------------------------------------------------------------------------
def open_combatlog
@combatlog_window.show
end

#--------------------------------------------------------------------------
# new method: close_combatlog
#--------------------------------------------------------------------------
def close_combatlog
@combatlog_window.hide
if $imported["YEA-BattleCommandList"]
if !@confirm_command_window.nil? && @confirm_command_window.visible
@confirm_command_window.activate
else
@party_command_window.activate
end
else
@party_command_window.activate
end
end

#--------------------------------------------------------------------------
# alias method: create_party_command_window
#--------------------------------------------------------------------------
alias create_party_command_window_cld create_party_command_window
def create_party_command_window
create_party_command_window_cld
@party_command_window.set_handler(:combatlog, method(:open_combatlog))
end

#--------------------------------------------------------------------------
# alias method: turn_start
#--------------------------------------------------------------------------
alias scene_battle_turn_start_cld turn_start
def turn_start
scene_battle_turn_start_cld
@combatlog_window.add_line("-")
text = sprintf(YEA::COMBAT_LOG::TEXT_TURN_NUMBER, $game_troop.turn_count)
@combatlog_window.add_line(text)
@combatlog_window.add_line("-")
end

#--------------------------------------------------------------------------
# alias method: execute_action
#--------------------------------------------------------------------------
alias scene_battle_execute_action_cld execute_action
def execute_action
@combatlog_window.add_line("-")
scene_battle_execute_action_cld
@combatlog_window.add_line("-")
end

#--------------------------------------------------------------------------
# alias method: turn_end
#--------------------------------------------------------------------------
alias scene_battle_turn_end_cld turn_end
def turn_end
scene_battle_turn_end_cld
@combatlog_window.add_line("-")
end

end # Scene_Battle

#==============================================================================
#
# ▼ End of File
#
#==============================================================================

C'est le Log. Dans le script command, on a :

#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Confirm Command Window Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# The confirm window is something new that's been added. It shows after the
# last actor has made a decision as to what actions the player wishes to
# take for the turn Here's a list of which command does what:
#
# -------------------------------------------------------------------------
# :command Description
# -------------------------------------------------------------------------
# :execute Start the battle turn. Comes with this script.
#
# :combatlog Requires YEA - Combat Log Display.
#
# And that's all of the currently available commands. This list will be
# updated as more scripts become available.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


#==============================================================================
# ■ Window_PartyCommand
#==============================================================================

class Window_PartyCommand < Window_Command

#--------------------------------------------------------------------------
# overwrite method: make_command_list
#--------------------------------------------------------------------------
def make_command_list
for command in YEA::BATTLE_COMMANDS::PARTY_COMMANDS
case command
when :fight
add_command(Vocab::fight, :fight)
when :escape
add_command(Vocab::escape, :escape, BattleManager.can_escape?)
when :combatlog
next unless $imported["YEA-CombatLogDisplay"]
add_command(YEA::COMBAT_LOG::COMMAND_NAME, :combatlog)

when :autobattle
next unless $imported["YEA-CommandAutobattle"]
add_autobattle_command
when :party
next unless $imported["YEA-PartySystem"]
next unless $imported["YEA-CommandParty"]
add_party_command
else
process_custom_command(command)
end
end
end

#==============================================================================
# ■ Window_ConfirmCommand
#==============================================================================

class Window_ConfirmCommand < Window_Command

#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
super(0, 0)
deactivate
hide
end

#--------------------------------------------------------------------------
# window_width
#--------------------------------------------------------------------------
def window_width; return 128; end

#--------------------------------------------------------------------------
# visible_line_number
#--------------------------------------------------------------------------
def visible_line_number; return 4; end

#--------------------------------------------------------------------------
# overwrite method: make_command_list
#--------------------------------------------------------------------------
def make_command_list
for command in YEA::BATTLE_COMMANDS::CONFIRM_COMMANDS
case command
when :execute
text = YEA::BATTLE_COMMANDS::EXECUTE_VOCAB
add_command(text, :execute)
when :combatlog
next unless $imported["YEA-CombatLogDisplay"]
add_command(YEA::COMBAT_LOG::COMMAND_NAME, :combatlog)

else
process_custom_command(command)
end
end
end



#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base

[...] J'ai passé tout le reste.

#--------------------------------------------------------------------------
# new method: process_confirm_compatibility_commands
#--------------------------------------------------------------------------
def process_confirm_compatibility_commands
#---
if $imported["YEA-CombatLogDisplay"]
@confirm_command_window.set_handler(:combatlog, method(:open_combatlog))
end
#---
end
XakuX
XakuX
Membre

Nombre de messages : 1263
Age : 24
Localisation : là où tu n'auras jamais l'idée de chercher !
Distinction : * Bougre d'âne


Le bizu' à son Coco' [Résolu] Accéder au menu Statut en combat 344805
[Coco' Smile]

Membre aux désirs inassouvis de domination mondiale. [Maître du destin]
Date d'inscription : 13/12/2008

[Résolu] Accéder au menu Statut en combat Empty Re: [Résolu] Accéder au menu Statut en combat

le Sam 7 Juil 2012 - 21:36
Bon bah ce que j'aurais fait alors, après avoir remplacé dans le script:
ligne 163:
Code:
:custom1 => [ "Custom Name", 0, 0, :command_name1],
par
Code:
:status => [ "Status", 0, 0, :command_status]

j'aurais juste rajouté dans le scene_battle (donc soit dans un nouveau script, soit dans le même à la suite de la class)
Code:
 def command_status
      SceneManager.call(Scene_Status)
  end

Bwala :/
Pharazon
Pharazon
Staffeux retraité

Nombre de messages : 1700
Age : 33
Localisation : Au Pays des Bisounours
Distinction : Super distinction!
[Coco' [Résolu] Accéder au menu Statut en combat 522164]
Date d'inscription : 14/04/2010

[Résolu] Accéder au menu Statut en combat Empty Re: [Résolu] Accéder au menu Statut en combat

le Dim 25 Nov 2012 - 12:03
Incatif, je déplace et je lock.
Pour réouvrir le post, demander à un modérateur.
Contenu sponsorisé

[Résolu] Accéder au menu Statut en combat Empty Re: [Résolu] Accéder au menu Statut en combat

Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum