А зачем ты создаешь объект, через созданный ранее этот же объект класса?
Попробуй $Game_Time заменить на другую константу($Time_Game, например).
+ скинул бы сам метод инициализации, у меня на созданном классе ошибок нет.
А зачем ты создаешь объект, через созданный ранее этот же объект класса?
Попробуй $Game_Time заменить на другую константу($Time_Game, например).
+ скинул бы сам метод инициализации, у меня на созданном классе ошибок нет.
Последний раз редактировалось strelokhalfer; 16.10.2015 в 09:50.
Привет всем. Подскажите пожалуйста - можно ли переписать скрипт освещения Khas Awesome Light Effects под более высокое разрешение экрана?
У меня игра в нестандартном разрешении Мейкера, в связи с чем данный скрипт работает лишь в маленькой части экрана.
ищи в скрипте числа 544 и 416
это ширина и высота окна дефолтного окна мукера, исправь их на свои размеры
как-то можно выпилить стрелку из окна помощи?
Спойлер :
чутка отредактировал его под себяPHP код:
#==============================================================================
# XaiL System - Journal
# Author: Nicke
# Created: 05/01/2013
# Edited: 30/01/2013
# Version: 1.0a
#==============================================================================
# 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.
#
# A journal system which can be as an actual journal or setup as an
# quest system.
#
# There are 3 predefined journals (categories) which will act as the following:
#
# Unfinished. Each entry added will automatically be added to this category.
# Completed. When a journal is completed or done it should be moved to this.
# Failed. Same as completed but the entry will be marked as failed instead.
#
# Use the following script to call the scene in an event:
# SceneManager.call(Scene_Journal)
# Scene_Journal is the name to add for any custom menu script.
#
# To setup a journal entry do one of the following script call:
# journal(symbol)
#
# Examples:
# journal(:investigation) # Add investigation to the journal.
# set_journal(:investigation, :completed) # Set investigation entry to completed.
# set_journal(:investigation, :failed) # Set investigation entry to failed.
#
# You can use the journal as you want and if you decide to use it as a quest
# system you can enable certain rewards. Those rewards won't be added
# automatically and it is only there to show the player what type of rewards
# that would be given if a quest is completed.
#
# See more below how you can customize that and how you add more journal
# entries.
#
# *** Only for RPG Maker VX Ace. ***
#==============================================================================
($imported ||= {})["XAIL-JOURNAL-SYSTEM"] = true
module XAIL
module JOURNAL
#--------------------------------------------------------------------------#
# * Settings
#--------------------------------------------------------------------------#
# FONT = [name, size, color, bold, shadow ]
FONT = [["GOTHIC"], 20, Color.new(255,255,255), true, false]
# LIST:
# LIST = {
# :journal_name => [icon_index, "entry 1", "entry 2"... etc,
# item_id = The id you want as the item, set it to nil when using
# the :exp/:gold types.
# type = :exp, :gold, :items, :weapons, :armors or :fame.
# The type fame should only be used if XS - Fame System is installed.
# [[item_id (set to nil if gold or exp), item_amount, type]]
# }
LIST = {
:ruby_madness =>
[358, "1. Get the Ruby.\n2. Return the Ruby.",
[[1, 5, :items],
[2, 1, :weapons],
[1, 1, :armors],
[nil, 5000, :exp],
[nil, 2500, :gold],
[nil, 500, :fame]
]],
:fetching_of_doom =>
[350, "1. Gather 1000 rocks. \n2. Return the rocks to Mr Negaul in the town Brafoul.\n3. Profit!!!"],
:investigation =>
[3, "I need to investigate the the murder in town.\nSome clues ought to be laying around. Hopefully!\n\n I probably need to use some stealth so the guards\n won't notice me. That should be a piece of cake.",
[[nil, 25000, :exp],
[nil, 25000, :gold],
[nil, 50000, :fame]
]],
} # Don't remove this line!
# Default reward icons for gold and experience.
# Not in used unless there is a reward.
# Fame is only used if XS - Fame System is installed.
# REWARD_ICONS = [gold, exp, fame]
REWARD_ICONS = [262, 121, 125]
# The windowskin to use for the windows.
# nil to disable.
# SKIN = string
SKIN = nil
end
end
# *** Don't edit below unless you know what you are doing. ***
#==============================================================================#
# ** Error Handler
#==============================================================================#
unless $imported["XAIL-XS-CORE"]
# // Error handler when XS - Core is not installed.
msg = "The script %s requires the latest version of XS - Core in order to function properly."
name = "XS - Journal"
msgbox(sprintf(msg, name))
exit
end
#==============================================================================#
# ** Game_System
#==============================================================================#
class Game_System
attr_accessor :journal_unfinished, :journal_completed, :journal_failed
alias xail_journal_sys_gm_sys_initialize initialize
def initialize(*args, &block)
# // Method to initialize game system.
xail_journal_sys_gm_sys_initialize(*args, &block)
@journal_unfinished = {}
@journal_completed = {}
@journal_failed = {}
end
def get_journal(journal)
# // Method to get journal.
case journal
when :Незаконченны ; return $game_system.journal_unfinished
when :Завершены ; return $game_system.journal_completed
when :Провалены ; return $game_system.journal_failed
end
end
end
#==============================================================================#
# ** Game_Interpreter
#==============================================================================#
class Game_Interpreter
def journal(key, type = :add)
# // Method to add/remove a menu item to the list.
journal = $game_system.get_journal(:Незаконченны)
case type
# // Add menu id.
when :add
unless journal.include?(XAIL::JOURNAL::LIST[key])
journal[key] = XAIL::JOURNAL::LIST[key]
end unless XAIL::JOURNAL::LIST[key].nil?
# // Remove menu id.
when :del
unless XAIL::JOURNAL::LIST[key].nil?
journal.delete(key)
end
end
end
def set_journal(key, type)
# // Method to set journal to unfinished, completed etc.
journals = [:Незаконченны, :Завершены, :Провалены]
journals.each {|i|
next if $game_system.get_journal(i)[key].nil?
$game_system.get_journal(type)[key] = $game_system.get_journal(i)[key]
$game_system.get_journal(i).delete(key) unless i == type
}
end
end
#==============================================================================
# ** Window_JournalCommand
#==============================================================================
class Window_JournalCommand < Window_Command
attr_accessor :journal
def initialize(x, y)
# // Method to initialize.
@journal = :Незаконченны
super(x, y)
end
def window_width
# // Method to return the width.
return 177
end
def window_height
# // Method to return the height.
return 48
end
def visible_line_number
return 1
end
def draw_item(index)
# // Method to draw the command item.
rect = item_rect_for_text(index)
# // Line.
draw_line_ex(rect.x + 20, rect.y + 8, Color.new(255,255,255,128), Color.new(0,0,0,64))
# // Item.
draw_font_text(command_name(index), rect.x + 22, rect.y, contents_width, alignment, XAIL::JOURNAL::FONT[0], 18, XAIL::JOURNAL::FONT[2])
# // Setup icons.
icons = []
$game_system.get_journal(@journal).each_value {|i| icons << i[0] unless icons.include?(i[0]) }
# // Cancel icon.
icons << 184 unless icons.include?(184)
# // Draw icon(s).
icon = icons[index].nil? ? nil : icons[index]
draw_icon(icon, rect.x - 4, rect.y) unless icon.nil?
end
def make_command_list
# // Method to add the commands.
$game_system.get_journal(@journal).each {|i| add_command(i[0].to_s.slice_char("_").cap_words, i[0]) }
end
end
#==============================================================================#
# ** Window_JournalHelp
#==============================================================================#
class Window_JournalHelp < Window_Help
def refresh
# // Refresh help contents.
contents.clear
draw_journal_help
end
def draw_journal_help
# // Method to draw the help text.
# // Current journal.
draw_font_text(@text, 0, 0, contents_width, 1, XAIL::JOURNAL::FONT[0], 18, XAIL::JOURNAL::FONT[2])
end
end
#==============================================================================#
# ** Window_JournalDetails
#==============================================================================#
class Window_JournalDetails < Window_Base
attr_accessor :journal
attr_accessor :key
def initialize(x, y, width, height)
# // Method to initialize.
super(x, y, width, height)
@journal = :Незаконченны
@key = :none
end
def refresh
# // Method to refresh window.
contents.clear
return if $game_system.get_journal(@journal)[@key].nil?
draw_details
end
def draw_details
# // Method to draw details.
h = 18
# // Icon.
icon_id = $game_system.get_journal(@journal)[@key][0]
draw_icon(icon_id, 0, 0)
# // Name.
name = @key.to_s.slice_char("_").cap_words
draw_font_text(name, 0, 0, contents_width, 1, XAIL::JOURNAL::FONT[0], 30, XAIL::JOURNAL::FONT[2])
# // Line.
draw_line_ex(0, 18, Color.new(255,255,255,128), Color.new(0,0,0,64))
# // Journal text.
journal = $game_system.get_journal(@journal)[@key][1]
draw_font_text_ex(journal, 4, 40, XAIL::JOURNAL::FONT[0], 18, XAIL::JOURNAL::FONT[2])
# // Reward Title.
unless $game_system.get_journal(@journal)[@key][2].nil?
reward_title = "Награда"
draw_font_text(reward_title, 0, contents_height - h * 5, contents_width, 1, XAIL::JOURNAL::FONT[0], 30, XAIL::JOURNAL::FONT[2])
# // Line.
draw_line_ex(0, contents_height - h * 4, Color.new(255,255,255,128), Color.new(0,0,0,64))
# // Rewards.
items_x = 0
$game_system.get_journal(@journal)[@key][2].each {|i|
# // Reward icon.
reward = $game_party.check_item?(i[0], i[2])
amount = i[0].nil? ? "#{i[1]}" : "#{i[1]}x"
case i[2]
when :gold
h = 14
draw_icon(XAIL::JOURNAL::REWARD_ICONS[0], contents_width - 24, contents_height - h * 2)
draw_font_text(amount + Vocab::currency_unit, -26, (contents_height - h * 2) + 4, contents_width, 2, XAIL::JOURNAL::FONT[0], 16, XAIL::JOURNAL::FONT[2])
when :exp
h = 14
draw_icon(XAIL::JOURNAL::REWARD_ICONS[1], 0, contents_height - h * 2)
draw_font_text(amount + "XP", 26, (contents_height - h * 2) + 4, contents_width, 0, XAIL::JOURNAL::FONT[0], 16, XAIL::JOURNAL::FONT[2])
when :fame
h = 14
draw_icon(XAIL::JOURNAL::REWARD_ICONS[2], (contents_width / 2) - (amount.length + 22), contents_height - h * 2)
draw_font_text(amount + "Fame", 26, (contents_height - h * 2) + 4, contents_width, 1, XAIL::JOURNAL::FONT[0], 16, XAIL::JOURNAL::FONT[2])
else
reward_icon = reward.icon_index
draw_icon(reward_icon, items_x, contents_height - h * 3)
# // Reward item amount.
draw_font_text(amount, items_x + 6, (contents_height - h * 3) + 10, contents_width, 0, XAIL::JOURNAL::FONT[0], 16, XAIL::JOURNAL::FONT[2])
items_x += line_height
end
}
end
end
end
#==============================================================================#
# ** Scene_Journal
#==============================================================================#
class Scene_Journal < Scene_Base
def start
# // Method to start the scene.
super
# // Define journals.
@journals = [:Незаконченны, :Завершены, :Провалены]
@journal_pos = 0
# // Create windows.
create_background
create_journal_command
create_journal_help
create_journal_details
# // Set default journal/details.
set_journal(0)
set_details(@journal_command_window.current_symbol)
end
def create_background
# // Method to create a background.
@background_sprite = Sprite.new
source = SceneManager.background_bitmap
bitmap = Bitmap.new(Graphics.width, Graphics.height)
bitmap.stretch_blt(bitmap.rect, source, source.rect)
bitmap.radial_blur(10, 10)
@background_sprite.opacity = 150
@background_sprite.bitmap = bitmap
end
def create_journal_command
# // Method to create journal command window.
@journal_command_window = Window_JournalCommand.new(423, 125)
@journal_command_window.windowskin = Cache.system(XAIL::JOURNAL::SKIN) unless XAIL::JOURNAL::SKIN.nil?
@journal_command_window.set_handler(:pageright, method(:next_journal))
@journal_command_window.set_handler(:pageleft, method(:prev_journal))
@journal_command_window.set_handler(:cancel, method(:return_scene))
@journal_command_window.help_window = @journal_help_window
end
def create_journal_help
# // Method to create journal help window.
@journal_help_window = Window_JournalHelp.new(1)
@journal_help_window.x = 423
@journal_help_window.y = 367
@journal_help_window.width = 177
@journal_help_window.windowskin = Cache.system(XAIL::JOURNAL::SKIN) unless XAIL::JOURNAL::SKIN.nil?
end
def create_journal_details
# // Method to create journal details window.
x = 423
y = 171
width = 177
height = 198
@journal_details_window = Window_JournalDetails.new(x, y, width, height)
end
alias xail_journal_sys_upd update
def update(*args, &block)
# // Method for updating the scene.
old_symbol = @journal_command_window.current_symbol
xail_journal_sys_upd(*args, &block)
set_details(@journal_command_window.current_symbol) if old_symbol != @journal_command_window.current_symbol
end
def next_journal
# // Method to determine next journal.
unless @journal_pos == @journals.size - 1
@journal_pos += 1
else
@journal_pos = 0
end
@journal_command_window.activate
set_journal(@journal_pos)
end
def prev_journal
# // Method to determine previous journal.
unless @journal_pos == 0
@journal_pos -= 1
else
@journal_pos = @journals.size - 1
end
@journal_command_window.activate
set_journal(@journal_pos)
end
def set_journal(pos)
# // Method to set journal based on position.
j = @journals[pos].to_s.capitalize
@journal_help_window.set_text(j)
@journal_command_window.journal = @journals[pos]
@journal_command_window.refresh
@journal_command_window.select(0)
end
def set_details(key)
# // Method to set details based on key.
@journal_details_window.journal = @journals[@journal_pos]
@journal_details_window.key = key
@journal_details_window.refresh
end
end # END OF FILE
#=*==========================================================================*=#
# ** END OF FILE
#=*==========================================================================*=#
Убери боковую стрелку из виндоус-скина.
Лицензионный VX Ace. Спасибо Петр.
2 года мукеризма в пустую.
было бы все так просто
хотя, в скрипте можно указать скин окна другой, тогда если только так, но забивать проект лишней графикой, которой там и так не мало из-за паралакса, плохая идея
Последний раз редактировалось HopeBree; 22.10.2015 в 17:35.
Попробую сюда запостить свой трабл, вдруг случится чудо )
Это скрипт боевой системы от Ccoa (очень редкий и очень большой), мейкер ХР.
Я выкладываю только одну из частей, всё выложить сюда не реал.
Вопрос такой. Есть анимация чара, когда он использует ITEM, но по необъяснимой причине анимация работает только если ITEM используется на другом персонаже а не на том который этот ITEM выбирает.
Надо что бы анимация включалась ВСЕГДА.
Скорее всего начинать поиск стоит со строчки @active_battler.set_pose($ITEM, false)PHP код:
class Scene_Battle #--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Initialize each kind of temporary battle data
$game_temp.in_battle = true
$game_temp.battle_turn = 0
$game_temp.battle_event_flags.clear
$game_temp.battle_abort = false
$game_temp.battle_main_phase = false
$game_temp.battleback_name = $game_map.battleback_name
$game_temp.forcing_battler = nil
# Initialize battle event interpreter
$game_system.battle_interpreter.setup(nil, 0)
# Prepare troop
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
# Make other windows
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help.new
@help_window.back_opacity = 160
@help_window.visible = false
@help_window2 = Win_Help.new
@help_window2.visible = false
@help_window2.contents_opacity = 0
@help_time = 0
@status_window = Window_BattleStatus.new
@message_window = Window_Message.new
# Make actor command windows
@actor_command_windows = []
setup_actor_command_windows
# Make sprite set
@spriteset = Spriteset_Battle.new
# Make active cursor
@cursor_bitmap = Sprite.new
@cursor_bitmap.bitmap = RPG::Cache.windowskin($game_system.windowskin_name)
@cursor_bitmap.src_rect.set(128, 96, 32, 32)
@cursor_bitmap.visible = false
@blink_count = 0
# Initialize wait count
@wait_count = 0
# Execute transition
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(100, "Graphics/Transitions/" +
$data_system.battle_transition)
end
# Start pre-battle phase
start_phase1
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Refresh map
$game_map.refresh
# Prepare for transition
Graphics.freeze
# Dispose of windows
for window in @actor_command_windows
window.dispose
end
@party_command_window.dispose
@help_window.dispose
@help_window2.dispose
@status_window.dispose
@message_window.dispose
if @skill_window != nil
@skill_window.dispose
end
if @skill_window2 != nil
@skill_window2.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
# Dispose of sprite set
@spriteset.dispose
@cursor_bitmap.dispose
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
# If switching from battle test to any screen other than game over screen
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# If battle event is running
if $game_system.battle_interpreter.running?
# Update interpreter
$game_system.battle_interpreter.update
# If a battler which is forcing actions doesn't exist
if $game_temp.forcing_battler == nil
# If battle event has finished running
unless $game_system.battle_interpreter.running?
# Rerun battle event set up if battle continues
unless judge
setup_battle_event
end
end
# If not after battle phase
if @phase != 5
# Refresh status window
@status_window.refresh
end
end
end
# Update system (timer) and screen
$game_system.update
$game_screen.update
# If timer has reached 0
if $game_system.timer_working and $game_system.timer == 0
# Abort battle
$game_temp.battle_abort = true
end
@help_window2.contents_opacity += 3
if @help_window2.y <= 0
@help_window2.y += 8
end
if @skill_window2 != nil
@skill_window2.update
if @skill_window2.x > 520
@skill_window2.x -= 15
@skill_window2.contents_opacity += 5
elsif @skill_window2.x <= 520
@skill_window2.x = 520
@skill_window2.contents_opacity = 255
end
end
if @skill_window3 != nil
if @skill_window3.x > 440
@skill_window3.x -= 15
@skill_window3.contents_opacity += 5
@skill_window3.opacity += 5
elsif @skill_window3.x <= 440
@skill_window3.x = 440
@skill_window3.contents_opacity = 255
@skill_window3.opacity = 255
end
end
if @skill_window != nil
if @skill_window.y > 347
@skill_window.y -= 15
@skill_window.contents_opacity += 5
@skill_window.opacity += 5
elsif @skill_window.y <= 347
@skill_window.y = 347
@skill_window.opacity = 255
@skill_window.contents_opacity = 255
end
end
if @item_window != nil
if @item_window.y > 347
@item_window.y -= 15
@item_window.contents_opacity += 5
@item_window.opacity += 5
elsif @item_window.y <= 347
@item_window.y = 347
@item_window.opacity = 255
@item_window.contents_opacity = 255
end
end
if @help_window.y < 0
@help_window.y += 15
elsif @help_window.y >= 0
@help_window.y = 0
end
if Input.press?(Input.dir4) and @skill_window2 != nil
@skill_window2.refresh
end
@help_time -= 1
if @help_time <= 0
@help_time = 0
end
# Update windows
@help_window.update
@help_window2.update
@party_command_window.update
for i in 0..$game_party.actors.size - 1
member = $game_party.actors[i]
if member.battle_commands != @actor_command_windows[i].commands
setup_actor_command_windows
end
if member != nil
@actor_command_windows[i].update
if @actor_command_windows[i].x < 0
@actor_command_windows[i].x += 15
@actor_command_windows[i].contents_opacity += 12
elsif @actor_command_windows[i].x >= 0
@actor_command_windows[i].x = 0
@actor_command_windows[i].contents_opacity = 255
end
end
end
if @cursor_bitmap.visible
@blink_count = (@blink_count + 1) % 8
if @blink_count < 4
@cursor_bitmap.src_rect.set(128, 96, 32, 32)
else
@cursor_bitmap.src_rect.set(160, 96, 32, 32)
end
end
@status_window.update
@message_window.update
# Update sprite set
@spriteset.update
# If transition is processing
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# If message window is showing
if $game_temp.message_window_showing
return
end
# If effect is showing
if @spriteset.effect?
return
end
# If game over
if $game_temp.gameover
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If returning to title screen
if $game_temp.to_title
# Switch to title screen
$scene = Scene_Title.new
return
end
# If battle is aborted
if $game_temp.battle_abort
# Return to BGM used before battle started
$game_system.bgm_play($game_temp.map_bgm)
# Battle ends
battle_end(1)
return
end
# If waiting
if @wait_count > 0
# Decrease wait count
@wait_count -= 1
return
end
# If battler forcing an action doesn't exist,
# and battle event is running
if $game_temp.forcing_battler == nil and
$game_system.battle_interpreter.running?
return
end
# Branch according to phase
case @phase
when 1 # pre-battle phase
update_phase1
when 2 # party command phase
update_phase2
when 3 # actor command phase
update_phase3
when 4 # main phase
update_phase4
when 5 # after battle phase
update_phase5
end
end
#--------------------------------------------------------------------------
# * Start Party Command Phase
#--------------------------------------------------------------------------
def start_phase2
# reset poses
for actor in $game_party.actors
reset_pose(actor)
end
# Shift to phase 2
@phase = 2
# Set actor to non-selecting
@actor_index = -1
@active_battler = nil
# Enable party command window
@party_command_window.active = true
@party_command_window.visible = true
# Disable actor command window
for i in 0..3
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
@cursor_bitmap.visible = false
# Clear main phase flag
$game_temp.battle_main_phase = false
# Clear all party member actions
$game_party.clear_actions
# If impossible to input command
unless $game_party.inputable?
# Start main phase
start_phase4
end
end
#--------------------------------------------------------------------------
# * Actor Command Window Setup
#--------------------------------------------------------------------------
def phase3_setup_command_window
# Disable party command window
@party_command_window.active = false
@party_command_window.visible = false
# Enable actor command window
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
@actor_command_windows[i].x = -200
@actor_command_windows[i].contents_opacity = 0
@actor_command_windows[i].index = 0
end
end
@actor_command_windows[@actor_index].active = true
@actor_command_windows[@actor_index].visible = true
@cursor_bitmap.x = @active_battler.actual_x - @active_battler.width / 3
@cursor_bitmap.y = @active_battler.actual_y - @active_battler.height * 1.5
@cursor_bitmap.visible = true
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase)
#--------------------------------------------------------------------------
def update_phase3
# If enemy arrow is enabled
if @enemy_arrow != nil
update_phase3_enemy_select
return
# If actor arrow is enabled
elsif @actor_arrow != nil
update_phase3_actor_select
return
# If skill window is enabled
elsif @skill_window != nil
update_phase3_skill_select
return
# If item window is enabled
elsif @item_window != nil
update_phase3_item_select
return
end
# If actor command window is enabled
for i in 0..$game_party.actors.size - 1
if @actor_command_windows[i].active
update_phase3_basic_command
return
end
end
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase : basic command)
#--------------------------------------------------------------------------
def update_phase3_basic_command
#--------------------------------------------------------------------------
#Permite fugir da batalha apertando o botão Z(Tecla D)
#--------------------------------------------------------------------------
if @help_time <= 0
@help_window.visible = false
end
if Input.trigger?(CCOA_CBS::FUGABOTAO) and $game_temp.battle_can_escape == true
$game_temp.battle_abort = true
$game_system.se_play($data_system.escape_se)
elsif Input.trigger?(CCOA_CBS::FUGABOTAO) and $game_temp.battle_can_escape == false
@help_window.visible = true
@help_window.set_text(CCOA_CBS::FUGATEXTO,1)
@help_window.y = -200
$game_system.se_play($data_system.cancel_se)
@help_time = 40
end
#--------------------------------------------------------------------------
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by actor command window cursor position
case @active_battler.battle_commands[@actor_command_windows[@actor_index].index]
when "Attack" # attack
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Set action
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
# Start enemy selection
start_enemy_select
return
when "Skill" # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Set action
@active_battler.current_action.kind = 1
# Start skill selection
start_skill_select
return
when "Defend" # guard
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Set action
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 1
# Go to command input for next actor
phase3_next_actor
when "Item" # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Set action
@active_battler.current_action.kind = 2
# Start item selection
start_item_select
return
when $SKILL_KINDS[0]
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 1
@active_battler.skill_kind = $SKILL_KINDS[0]
start_skill_select(0 + $SKILL_OFFSET)
return
when $SKILL_KINDS[1]
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 1
@active_battler.skill_kind = $SKILL_KINDS[1]
start_skill_select(1 + $SKILL_OFFSET)
return
when $SKILL_KINDS[2]
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 1
@active_battler.skill_kind = $SKILL_KINDS[2]
start_skill_select(2 + $SKILL_OFFSET)
return
when $SKILL_KINDS[3]
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 1
@active_battler.skill_kind = $SKILL_KINDS[3]
start_skill_select(3 + $SKILL_OFFSET)
return
when $SKILL_KINDS[4]
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 1
@active_battler.skill_kind = $SKILL_KINDS[4]
start_skill_select(4 + $SKILL_OFFSET)
return
# copy and paste to add more skill kinds
end
return
end
end
#--------------------------------------------------------------------------
# * Start Enemy Selection
#--------------------------------------------------------------------------
def start_enemy_select
# Make enemy arrow
@enemy_arrow = Arrow_Enemy.new(@spriteset.viewport2)
# Associate help window
@enemy_arrow.help_window = @help_window
@help_window.y = -200
# Disable actor command window
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
@cursor_bitmap.visible = false
end
#--------------------------------------------------------------------------
# * End Enemy Selection
#--------------------------------------------------------------------------
def end_enemy_select
@enemy_arrow.dispose
@enemy_arrow = nil
y = @active_battler.battle_commands
x = y[@actor_command_windows[@actor_index].index]
if x == "Attack"
@actor_command_windows[@actor_index].active = true
@actor_command_windows[@actor_index].visible = true
@actor_command_windows[@actor_index].x = - 200
@actor_command_windows[@actor_index].contents_opacity = 0
@cursor_bitmap.x = @active_battler.actual_x - @active_battler.width / 3
@cursor_bitmap.y = @active_battler.actual_y - @active_battler.height * 1.5
@cursor_bitmap.visible = true
@help_window.visible = false
@help_window2.visible = false
@help_window.y = -200
end
end
#--------------------------------------------------------------------------
# * Start Actor Selection
#--------------------------------------------------------------------------
def start_actor_select
# Make actor arrow
@actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
@actor_arrow.index = @actor_index
# Associate help window
@actor_arrow.help_window = @help_window
@help_window.y = -200
# Disable actor command window
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
@cursor_bitmap.visible = false
end
#--------------------------------------------------------------------------
# * Start Skill Selection
#--------------------------------------------------------------------------
def start_skill_select(skill_kind = -1)
# Make skill window
@skill_window = Win_Skill.new(@active_battler, skill_kind)
@skill_window2 = Win_Skill2.new(@active_battler, skill_kind)
@skill_window3 = Win_Skill3.new(@active_battler)
@skill_window.y = 550
@skill_window2.x = 730
@skill_window3.x = 650
@skill_window.opacity = 0
@skill_window2.opacity = 0
@skill_window3.opacity = 0
@skill_window.contents_opacity = 0
@skill_window2.contents_opacity = 0
@skill_window3.contents_opacity = 0
@skill_window2.refresh
# Associate help window
@skill_window.help_window = @help_window
@help_window.y = -200
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
@cursor_bitmap.visible = false
end
#--------------------------------------------------------------------------
# * End Skill Selection
#--------------------------------------------------------------------------
def end_skill_select
# Dispose of skill window
@skill_window.dispose
@skill_window = nil
@skill_window2.dispose
@skill_window2 = nil
@skill_window3.dispose
@skill_window3 = nil
# Hide help window
@help_window.visible = false
# Enable actor command window
@actor_command_windows[@actor_index].active = true
@actor_command_windows[@actor_index].visible = true
@actor_command_windows[@actor_index].x = - 200
@actor_command_windows[@actor_index].contents_opacity = 0
@cursor_bitmap.x = @active_battler.actual_x - @active_battler.width / 3
@cursor_bitmap.y = @active_battler.actual_y - @active_battler.height * 1.5
@cursor_bitmap.visible = true
end
#--------------------------------------------------------------------------
# * Start Item Selection
#--------------------------------------------------------------------------
def start_item_select
# Make item window
@item_window = Win_Item.new
@item_window.y = 550
@item_window.contents_opacity = 0
@item_window.opacity = 0
# Associate help window
@item_window.help_window = @help_window
@help_window.y = -200
# Disable actor command window
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
@cursor_bitmap.visible = false
end
#--------------------------------------------------------------------------
# * End Item Selection
#--------------------------------------------------------------------------
def end_item_select
# Dispose of item window
@item_window.dispose
@item_window = nil
# Hide help window
@help_window.visible = false
@help_window2.visible = false
# Enable actor command window
@actor_command_windows[@actor_index].active = true
@actor_command_windows[@actor_index].visible = true
@actor_command_windows[@actor_index].x = - 200
@actor_command_windows[@actor_index].contents_opacity = 0
@cursor_bitmap.x = @active_battler.actual_x - @active_battler.width / 3
@cursor_bitmap.y = @active_battler.actual_y - @active_battler.height * 1.5
@cursor_bitmap.visible = true
end
#--------------------------------------------------------------------------
# * Start Main Phase
#--------------------------------------------------------------------------
def start_phase4
# Shift to phase 4
@phase = 4
# Turn count
$game_temp.battle_turn += 1
# Search all battle event pages
for index in 0...$data_troops[@troop_id].pages.size
# Get event page
page = $data_troops[@troop_id].pages[index]
# If this page span is [turn]
if page.span == 1
# Clear action completed flags
$game_temp.battle_event_flags[index] = false
end
end
# Set actor as unselectable
@actor_index = -1
@active_battler = nil
# Enable party command window
@party_command_window.active = false
@party_command_window.visible = false
# Disable actor command window
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
@cursor_bitmap.visible = false
# Set main phase flag
$game_temp.battle_main_phase = true
# Make enemy action
for enemy in $game_troop.enemies
reset_pose(enemy)
enemy.make_action
end
# Make action orders
make_action_orders
# Shift to step 1
@phase4_step = 1
end
#--------------------------------------------------------------------------
# * Frame Update (main phase)
#--------------------------------------------------------------------------
def update_phase4
case @phase4_step
when 1
update_phase4_step1
when 2
update_phase4_step2
when 3
update_phase4_step3
when 4
update_phase4_step4
when 5
update_phase4_step5
when 6
update_phase4_step6
when 7
update_phase4_step7
when 8
update_phase4_step8
end
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 1 : action preparation)
#--------------------------------------------------------------------------
def update_phase4_step1
# Hide help window
@help_window.visible = false
@help_window2.visible = false
# Determine win/loss
if judge
# If won, or if lost : end method
return
end
# If an action forcing battler doesn't exist
if $game_temp.forcing_battler == nil
# Set up battle event
setup_battle_event
# If battle event is running
if $game_system.battle_interpreter.running?
return
end
end
# If an action forcing battler exists
if $game_temp.forcing_battler != nil
# Add to head, or move
@action_battlers.delete($game_temp.forcing_battler)
@action_battlers.unshift($game_temp.forcing_battler)
end
# If no actionless battlers exist (all have performed an action)
if @action_battlers.size == 0
# Start party command phase
start_phase2
return
end
# Initialize animation ID and common event ID
@animation1_id = 0
@animation2_id = 0
@common_event_id = 0
# Shift from head of actionless battlers
@active_battler = @action_battlers.shift
# If already removed from battle
if @active_battler.index == nil
return
end
# Slip damage
if @active_battler.hp > 0 and @active_battler.slip_damage?
@active_battler.slip_damage_effect
@active_battler.damage_pop = true
@active_battler.set_pose($HIT, false)
end
# Natural removal of states
@active_battler.remove_states_auto
reset_pose(@active_battler)
# Refresh status window
@status_window.refresh
# Shift to step 2
@phase4_step = 2
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 2 : start action)
#--------------------------------------------------------------------------
def update_phase4_step2
# If not a forcing action
unless @active_battler.current_action.forcing
# If restriction is [normal attack enemy] or [normal attack ally]
if @active_battler.restriction == 2 or @active_battler.restriction == 3
# Set attack as an action
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
end
# If restriction is [cannot perform action]
if @active_battler.restriction == 4
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# Shift to step 1
@phase4_step = 1
return
end
end
# Clear target battlers
@target_battlers = []
# Branch according to each action
case @active_battler.current_action.kind
when 0 # basic
if @active_battler.current_action.basic == 0
if @active_battler.is_a?(Game_Actor)
weapon = $data_weapons[@active_battler.weapon_id]
# if we have a ranged weapon, just move forward a bit
if (weapon != nil and weapon.element_set.include?($RANGED_ELEMENT)) or !@active_battler.moves
make_basic_action_result
else
@active_battler.set_pose($MOVE_TO)
# move to
@phase4_step = 7
return
end
else
if @active_battler.moves
@active_battler.set_pose($MOVE_TO)
# move to
@phase4_step = 7
return
else
make_basic_action_result
end
end
else
make_basic_action_result
end
when 1 # skill
skill = $data_skills[@active_battler.current_action.skill_id]
if skill.element_set.include?($RANGED_ELEMENT) or !@active_battler.moves
make_skill_action_result
else
@active_battler.set_pose($MOVE_TO)
@phase4_step = 7
return
end
when 2 # item
make_item_action_result
end
# Shift to step 3
if @phase4_step == 2
@phase4_step = 3
end
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 3 : animation for action performer)
#--------------------------------------------------------------------------
def update_phase4_step3
# Animation for action performer (if ID is 0, then white flash)
if @animation1_id == 0
@active_battler.white_flash = true
if @active_battler.animated
@wait_count = [@active_battler.attack_frames * 10 - 10, 8].max
else
@wait_count = 8
end
else
@active_battler.animation_id = @animation1_id
@active_battler.animation_hit = true
end
if @active_battler.current_action.kind == 0 and @active_battler.current_action.basic == 0
@active_battler.set_pose($ATTACK, false)
end
# Shift to step 4
@phase4_step = 4
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 4 : animation for target)
#--------------------------------------------------------------------------
def update_phase4_step4
# Animation for target
for target in @target_battlers
target.animation_id = @animation2_id
target.animation_hit = (target.damage != "Miss")
if target.damage.is_a?(String)
if target.damage == "Miss"
target.set_pose($MISS, false)
end
elsif target.damage > 0
target.set_pose($HIT, false)
end
end
# Animation has at least 8 frames, regardless of its length
@wait_count = 8
# Shift to step 5
@phase4_step = 5
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 6 : refresh)
#--------------------------------------------------------------------------
def update_phase4_step6
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# If common event ID is valid
if @common_event_id > 0
# Set up event
common_event = $data_common_events[@common_event_id]
$game_system.battle_interpreter.setup(common_event.list, 0)
end
# if the battler moved to attack
if (@active_battler.current_action.kind == 0 and @active_battler.current_action.basic == 0) or @active_battler.current_action.kind == 1
# move the battler back to its base
@phase4_step = 8
@active_battler.set_pose($MOVE_FROM)
else
# Shift to step 1
@phase4_step = 1
end
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 7 : move to)
#--------------------------------------------------------------------------
def update_phase4_step7
if @active_battler.is_a?(Game_Actor)
target = $game_troop.smooth_target_enemy(@active_battler.current_action.target_index)
@active_battler.target_y = target.actual_y
@active_battler.target_x = target.actual_x + target.width / 2
else
target = $game_party.smooth_target_actor(@active_battler.current_action.target_index)
@active_battler.target_x = target.actual_x - target.width / 2
@active_battler.target_y = target.actual_y
end
if @active_battler.actual_x == @active_battler.target_x and @active_battler.actual_y == @active_battler.target_y
@active_battler.set_pose($READY)
if @active_battler.current_action.basic == 0
make_basic_action_result
else
make_skill_action_result
end
@phase4_step = 3
end
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 8 : move from)
#--------------------------------------------------------------------------
def update_phase4_step8
@active_battler.target_x = @active_battler.base_x
@active_battler.target_y = @active_battler.base_y
if @active_battler.actual_x == @active_battler.target_x and @active_battler.actual_y == @active_battler.target_y
# reset pose
reset_pose(@active_battler)
@phase4_step = 1
end
end
#--------------------------------------------------------------------------
# * Start After Battle Phase
#--------------------------------------------------------------------------
alias old_start_phase5 start_phase5
def start_phase5
for actor in $game_party.actors
actor.set_pose($VICTORY)
end
old_start_phase5
end
#--------------------------------------------------------------------------
# * Make Basic Action Results
#--------------------------------------------------------------------------
def make_basic_action_result
# If attack
if @active_battler.current_action.basic == 0
# Set anaimation ID
@animation1_id = @active_battler.animation1_id
@animation2_id = @active_battler.animation2_id
# If action battler is enemy
if @active_battler.is_a?(Game_Enemy)
if @active_battler.restriction == 3
target = $game_troop.random_target_enemy
elsif @active_battler.restriction == 2
target = $game_party.random_target_actor
else
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
end
end
# If action battler is actor
if @active_battler.is_a?(Game_Actor)
if @active_battler.restriction == 3
target = $game_party.random_target_actor
elsif @active_battler.restriction == 2
target = $game_troop.random_target_enemy
else
index = @active_battler.current_action.target_index
target = $game_troop.smooth_target_enemy(index)
end
end
# Set array of targeted battlers
@target_battlers = [target]
# Apply normal attack results
for target in @target_battlers
target.attack_effect(@active_battler)
reset_pose(target)
end
return
end
# If guard
if @active_battler.current_action.basic == 1
# Display "Guard" in help window
@help_window2.contents_opacity = 0
@help_window2.y = -150
$name_help = CCOA_CBS::NAME_GUARD
@help_window2.set_text($data_system.words.guard, 1)
@active_battler.set_pose($GUARD)
return
end
# If escape
if @active_battler.is_a?(Game_Enemy) and
@active_battler.current_action.basic == 2
# Display "Escape" in help window
@help_window2.contents_opacity = 0
@help_window2.y = -150
$name_help = CCOA_CBS::NAME_ESCAPE
@help_window2.set_text("Escape", 1)
# Escape
@active_battler.escape
return
end
# If doing nothing
if @active_battler.current_action.basic == 3
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# Shift to step 1
@phase4_step = 1
return
end
end
#--------------------------------------------------------------------------
# * Make Skill Action Results
#--------------------------------------------------------------------------
def make_skill_action_result
if @active_battler.is_a?(Game_Actor)
if $USING_INDIV_SKILL_ANIM
@active_battler.set_pose(@active_battler.skill_hash[$data_skills[@active_battler.current_action.skill_id].name], false)
else # get animation by skill type
@active_battler.set_pose(@active_battler.skill_type_hash[@active_battler.skill_kind], false)
end
else
@active_battler.set_pose($SKILL, false)
end
# Get skill
@skill = $data_skills[@active_battler.current_action.skill_id]
# If not a forcing action
unless @active_battler.current_action.forcing
# If unable to use due to SP running out
unless @active_battler.skill_can_use?(@skill.id)
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# Shift to step 1
@phase4_step = 1
return
end
end
# Use up SP
@active_battler.sp -= @skill.sp_cost
# Refresh status window
@status_window.refresh
# Show skill name on help window
@help_window2.contents_opacity = 0
@help_window2.y = -200
$name_help = CCOA_CBS::NAME_SKILL
@help_window2.set_text(@skill.name, 1)
# Set animation ID
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
# Set command event ID
@common_event_id = @skill.common_event_id
# Set target battlers
set_target_battlers(@skill.scope)
# Apply skill effect
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
unless target == @active_battler
reset_pose(target)
end
end
end
#--------------------------------------------------------------------------
# * Make Item Action Results
#--------------------------------------------------------------------------
def make_item_action_result
@active_battler.set_pose($ITEM, false)
# Get item
@item = $data_items[@active_battler.current_action.item_id]
# If unable to use due to items running out
unless $game_party.item_can_use?(@item.id)
# Shift to step 1
@phase4_step = 1
return
end
# If consumable
if @item.consumable
# Decrease used item by 1
$game_party.lose_item(@item.id, 1)
end
# Display item name on help window
@help_window2.contents_opacity = 0
@help_window2.y = -200
$name_help = CCOA_CBS::NAME_ITEM
@help_window2.set_text(@item.name, 1)
# Set animation ID
@animation1_id = @item.animation1_id
@animation2_id = @item.animation2_id
# Set common event ID
@common_event_id = @item.common_event_id
# Decide on target
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
# Set targeted battlers
set_target_battlers(@item.scope)
# Apply item effect
for target in @target_battlers
target.item_effect(@item)
reset_pose(target)
end
end
def setup_actor_command_windows
if @actor_command_windows != []
for i in 0..@actor_command_windows.size - 1
@actor_command_windows[i].dispose
end
end
@actor_command_windows = []
for i in 0..$game_party.actors.size - 1
member = $game_party.actors[i]
if member != nil
@actor_command_windows[i] = Window_BattleCommand.new(member, 160)
if $game_switches[5] == true
@actor_command_windows[i].x = 0
@actor_command_windows[i].y = 680 - @status_window.height - @actor_command_windows[i].height
@actor_command_windows[i].back_opacity = 160
else
@actor_command_windows[i].x = 0
@actor_command_windows[i].y = 480 - @status_window.height - @actor_command_windows[i].height
@actor_command_windows[i].back_opacity = 160
end
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
end
# reset the current pose
def reset_pose(actor)
if actor == nil
return
end
# highest priority is dead
if actor.is_a?(Game_Actor) and actor.dead?
actor.set_pose($DEAD)
return
end
#guarding
if actor.guarding?
actor.set_pose($GUARD)
return
end
# next is low hp
if actor.is_a?(Game_Actor)
if actor.low_hp?
actor.set_pose($LOW_HP)
return
end
# satus effects
rating = 0
pose = -1
j = 0
for i in $STATES_ANIMATED
if actor.states.include?(i)
if $data_states[i].rating >= rating
pose = j
rating = $data_states[i].rating
end
end
j += 1
end
if pose != -1
actor.set_pose($VICTORY + pose + 1)
return
end
end
actor.set_pose($READY)
end
end
Сразу скажу, что изменение false на true приводит просто к лупу анимации не более, и это не нужно совсем...
Спойлер Проекты Dark Rise INC.:
Кто объяснит, что здесь происходит:
UPD. Кажется это для наследования)Код:function Window_Base() { this.initialize.apply(this, arguments); } Window_Base.prototype = Object.create(Window.prototype); Window_Base.prototype.constructor = Window_Base;
Последний раз редактировалось DK; 25.10.2015 в 14:31.
Эту тему просматривают: 4 (пользователей: 0 , гостей: 4)
Социальные закладки