MisterSaturn
Member
Ok this is what Im looking for, When battling you know how it usually has just one long window across like this?
Well, im looking to get rid of all that empty space, and here is how. Its actually quite simple, just not for me cause im not a scripter. alright anyway, I want the empty space to turn into seperate windows for characters. The one you did *is talking to SephirothSpawn* is good, but I just dont like the fact that it looks like this.
I want it so that if you have one character it would like this.
with the window centered, then if you have two people in your party it looks like this.
and so in with three.
and four.
the only other I thing I want with this script is that for those player window boxes, is it possible to make it have a different windowskin than the rest of the battle windows? Heres an example.
the players window boxes would be the purple checkered while the rest of the battle windows would remain the black windowskin (action menu, skills menu, etc.)
Thats basically it other than the fact that the script should work with these two other battle related scripts I have.
and
Hopefully not to complicated. I would be eternally greatful for whoever does this for me :smile01: and I shall give credit to whom ever does so, in the credits of my game. Thanks in advance.
http://img242.imageshack.us/img242/4238/likethisls3.png[/IMG]
http://img249.imageshack.us/img249/1074/likethistp9.png[/IMG]
http://img171.imageshack.us/img171/7200/likethispt0.png[/IMG]
http://img172.imageshack.us/img172/4615/likethiszn3.png[/IMG]
http://img255.imageshack.us/img255/7641/likethisqu9.png[/IMG]
http://img401.imageshack.us/img401/7573/likethismj9.png[/IMG]
http://img264.imageshack.us/img264/5449/likethisbl5.png[/IMG]
Thats basically it other than the fact that the script should work with these two other battle related scripts I have.
Code:
#==============================================================================
# Battle Message --- RM2000
#------------------------------------------------------------------------------
# RM2000
# class Scene_Battle : text_hash, add_text, check_states, set_text
# class Spriteset_Battle : actor_sprites(attr_accessor)
#------------------------------------------------------------------------------
# ver 2.05 05/11/01 by Hako (http://aea.to/hako/)
# Tranlated and edited by Lockheart.
#==============================================================================
class Window_BattleMessage < Window_Base
#--------------------------------------------------------------------------
# â— Main Set up
#--------------------------------------------------------------------------
# Maxium number of lines (1..4)
WBM200_MAX_LINE = 4
# The width of the window
WBM200_WIDTH = 640
# The height of the window (0:自動調整)
WBM200_HEIGHT = 0
# Windows X and width
WBM200_X = (640 - WBM200_WIDTH) / 2 # ç”»é¢ã®ä¸å¿ƒã¸
# Windows Y axis
WBM200_Y = 0
# Windows pixel(0..10)
WBM200_LINE_SPACE = 3
# Border opactity (0..255)
WBM200_OPACITY = 255
# Back opactity (0..255)
WBM200_BACK_OPACITY = 255
# Font used and size.
WBM200_TEXT_FONT = Font.new("Orange Kid", 22)
# Font color
WBM200_TEXT_FONT.color = Color.new(255, 255, 255)
# Shadowed text, true or false.
WBM200_TEXT_SHADOW = true
end
class Scene_Battle
#--------------------------------------------------------------------------
# â— Set up
#--------------------------------------------------------------------------
# Show party battlers?
WBM200_ACTOR_VISIBLE = false
# Show animation over actor battlers?
WBM200_ACTOR_ANIMATION = true
# Show the damage appearing over the battlers?
WBM200_DAMAGE_POP = false
# Timer for how long the text remains on screen, in frames.
WBM200_TEXT_WAIT = 30
#--------------------------------------------------------------------------
# â— Has lines
#--------------------------------------------------------------------------
def text_hash
@wbm_set1 = {
# Do not modify this line
"**no" => "",
#--------------------------------------------------
# Base Text
#--------------------------------------------------
# Text shown when an enemy appears
"**start" => " wants to fight!",
# Victory text
"**win" => "You Win!",
# Successful escape
"**escape" => "Tried to get away, and did.",
# Failed Escape
"**no_escape" => "Tried to get away, but couldn't.",
#--------------------------------------------------
# These words go at the end of the lines, be sure to set them up correctly
# or else you'll end up with words like, ghost caused 100 attacks or something.
#--------------------------------------------------
# When an attack is made
"**attack" => " attacks",
# Actors Critical word
"**actor_critical" => " SMAAAAASH!",
# Enemys Critical word
"**enemy_critical" => " SMAAAAASH!",
# Actor/Enemy guarding text
"**guard" => " guards",
# Text for when an enemy flees
"**enemy_action1" => " fled",
# Text used for the 'do nothing' command, this could be, 'stands around'
# 'watchs the party', etc, etc,
"**enemy_action2" => " does nothing",
# Skill usage(For physical skills F >= 1)
"**skill1" => "!",
# Skill usage(For magical skills F == 0)
"**skill2" => "!",
# Item usage
"**item" => "!",
#--------------------------------------------------
# These words go at the end of the lines, be sure to set them up correctly
# or else you'll end up with words like, ghost caused HP 100 attacks or something
#--------------------------------------------------
# Enemy attack damage text
"**enemy_damage" => " Hp",
# Damage, no hit. failed hit text for enemy
"**enemy_no_damage" => " wasn't harmed",
# Actor attack damage text
"**actor_damage" => " Hp",
# Damage, no hit. failed hit text for actor
"**actor_no_damage" => " wasn't harmed",
# Damage, no hit. failed hit text
"**no_damage1" => " wasn't harmed",
# Miss
"**miss" => " dodged the attack.",
# Recovery text for healing HP and SP
"**cure" => "!",
# SP damage text
"**damage_sp" => " lost",
# Stats up text
"**up" => " Increased!",
# Stats down text
"**down" => " Decreased!"
}
#--------------------------------------------------
# Skill casting text
# * This area allows you to give custom text for skills and spells
# * Fro example, casting Heal would cause the text, Heal was used to recover the party.
# * If not spell/skill is listed here, then the default text is used, which was filled in above.
# To set up your own skills use copy the following samples and replace the names with your own.
# You can use $data_skills[x].name in place of the actual name and it will use the name from the database
# this command can also be used within the text itself.
#--------------------------------------------------
@wbm_set1["Heal"] = ": Heal was used to recover the party."
@wbm_set1[$data_skills[2].name] = " #{$data_skills[2].name} was cast"
#--------------------------------------------------
# State text
# * To show text for the states.
# * replace Statename with the name of your state from the database
# * You can also use the line $data_states[x].name + "_0" where x is the
# number of the state in th database.
# * 0, 1, 2, 3 meanings are as follows.
#--------------------------------------------------
# Statename_0 : When used on Actor
# Statename_1 : When used on enemy
# Statename_2 : When cancelled/removed
# Statename_3 : when used on yourself
#--------------------------------------------------
@wbm_set1[$data_states[2].name + "_0"] = " was stunned"
@wbm_set1[$data_states[2].name + "_1"] = " was stunned"
@wbm_set1[$data_states[2].name + "_2"] = " is no longer stunned"
#-----------------------------------------
@wbm_set1["Knockout_0"] = " was knocked out"
@wbm_set1["Knockout_1"] = " was knocked out"
@wbm_set1["Knockout_2"] = " was revived"
@wbm_set1["Knockout_3"] = " Dies"
#-----------------------------------------
@wbm_set1["Venom_0"] = " was posioned"
@wbm_set1["Venom_1"] = " was posioned"
@wbm_set1["Venom_2"] = " is no longer poisoned"
end
#--------------------------------------------------------------------------
# â— Add blank text
#--------------------------------------------------------------------------
def add_text(set0, key)
# Blank return
if key == nil or key == []
return ""
end
# Blank
if not @wbm_set1.include?(key)
set0 = ""
key = "**no"
end
text = set0 + @wbm_set1[key]
return text
end
#---------------------------------------------------------------------------
# â— This checks the states
#---------------------------------------------------------------------------
def check_states
@states0.clear
@live.clear
@target_sp.clear
for target in @target_battlers
st = [] # If state is
target.states.each_index do |i|
st << $data_states[target.states[i]].name
end
@states0[target] = st
# If actor/enemy lives
@live[target] = (target.hp > 0)
@target_sp[target] = target.sp
end
end
#---------------------------------------------------------------------------
# â— Sets up the command lines
# command : "**attack", "**skill", "**item"
#---------------------------------------------------------------------------
def set_text(command)
if command == "**item"
@text_0 = [@active_battler.name + " uses " + @item.name]
else
@text_0 = [@active_battler.name]
end
if command == "**skill"
@text_key = [@skill.name]
# Skill casting line
if not @wbm_set1.include?(@text_key[0])
@text_0 = [@active_battler.name + " casts " + @skill.name]
# If attack power is over 1
@text_key = @skill.atk_f > 0 ? ["**skill1"] : ["**skill2"]
end
else
@text_key = [command]
end
states1 = []
states_p = []
states_m = []
for target in @target_battlers
damage = target.damage
name = target.name
index = target.index
st = []
target.states.each_index do |i|
st << $data_states[target.states[i]].name.dup
end
states1 = st
states_p = states1 - @states0[target]
states_m = @states0[target] - states1
if damage.to_s != "Miss"
# HP damage
if damage.to_i > 0
if target.critical # Critical
@critical = true # if critical set
@text_0 << ""
if @active_battler.is_a?(Game_Actor)
@text_key << "**actor_critical"
else
@text_key << "**enemy_critical"
end
end
if target.is_a?(Game_Enemy)
@text_0 << "#{name} lost #{damage}"
@text_key << "**enemy_damage"
else
@text_0 << "#{name} lost #{damage}"
@text_key << "**actor_damage"
end
# HP Recovery
elsif damage.to_i < 0 and @live[target] == true
damage *= -1
@text_0 << "#{name} Recovered #{damage} #{$data_system.words.hp}"
@text_key << "**cure"
end
sp = target.sp - @target_sp[target] # SP
# SP Damage
if sp < 0
sp *= -1
@text_0 << "#{name} lost #{sp} #{$data_system.words.sp}"
@text_key << "**damage_sp"
# SP Recovery
elsif sp > 0
@text_0 << "#{name} #{sp} #{$data_system.words.sp}"
@text_key << "**cure"
end
if command == "**item"
# Parameter Set
if @item.parameter_type > 0 and @item.parameter_points != 0
points = @item.parameter_points
case @item.parameter_type
when 1 # MaxHP
words = "" + $data_system.words.hp
when 2 # MaxSP
words = "" + $data_system.words.sp
when 3 # Str
words = $data_system.words.str
when 4 # Dex
words = $data_system.words.dex
when 5 # Agi
words = $data_system.words.agi
when 6 # Int
words = $data_system.words.int
end
if points > 0 # If points go up
@text_0 << "#{name} #{words} #{points}"
@text_key << "**up"
else # If points go down
points *= -1
@text_0 << "#{name} #{words} #{points}"
@text_key << "**down"
end
end
end
# States
if states_p != []
states_p.each_index do |i|
@text_key << "_STATES_" if damage.to_i != 0
@text_0 << name
if target.is_a?(Game_Enemy)
@text_key << states_p[i] + "_1"
else
@text_key << states_p[i] + "_0"
end
end
# States 2
elsif states_m != [] and target.hp > 0
states_m.each_index do |i|
if damage.to_i != 0 and @live[target] == true
@text_key << "_STATES_"
end
@text_0 << name
@text_key << states_m[i] + "_2"
end
# Attack zero damage
elsif damage.to_i == 0 and command == "**attack"
@text_0 << name
if target.is_a?(Game_Enemy)
@text_key << "**enemy_no_damage"
else
@text_key << "**actor_no_damage"
end
elsif damage.to_i == 0 and command == "**skill"
@text_0 << name
@text_key << "**no_damage1"
end
# Miss
else
@text_0 << name
@text_key << "**miss"
end
@text_key << "NEXT_TARGET"
end # for target
end
end
#==============================================================================
# â– Window_BattleMessage
#==============================================================================
class Window_BattleMessage < Window_Base
#--------------------------------------------------------------------------
# â— initialize
#--------------------------------------------------------------------------
def initialize
h = WBM200_HEIGHT == 0 ?
(WBM200_TEXT_FONT.size + WBM200_LINE_SPACE) * WBM200_MAX_LINE + 32 :
WBM200_HEIGHT
#super(WBM200_X, WBM200_Y, WBM200_WIDTH, h)
super(0, 0, 640, 120)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = WBM200_OPACITY
self.back_opacity = WBM200_BACK_OPACITY
self.contents.font = WBM200_TEXT_FONT
self.z = 104
self.visible = false
end
#--------------------------------------------------------------------------
# â— Base of text
# text :
# line : Line (0: first row, 1: econd row, 2:third row, 3: fourth row)
# line_over : Lines going over (true: goes over, false: doesn't go over)
#--------------------------------------------------------------------------
def draw_text(text, line, line_over = false)
x = 4
y = 0
w = WBM200_WIDTH - 32
h = WBM200_TEXT_FONT.size + WBM200_LINE_SPACE
sx = sy = 2
# Max lines
if line > WBM200_MAX_LINE - 1
line = line_over ? line % WBM200_MAX_LINE : WBM200_MAX_LINE - 1
end
self.contents.clear
alpha = WBM200_TEXT_SHADOW ? 255 : 0
self.contents.font.color = Color.new(0, 0, 0, alpha)
color = WBM200_TEXT_FONT.color
case line
when 0 # Line 1
@text = [text, "", ""]
when 1 # Line 2
self.contents.draw_text(x+sx, y+sy, w, h, @text[0], 0)
self.contents.font.color = color
self.contents.draw_text(x, y, w, h, @text[0], 0)
@text[1] = text
when 2 # Line 3
self.contents.draw_text(x+sx, y+sy, w, h, @text[0], 0)
self.contents.draw_text(x+sx, y+h+sy, w, h, @text[1], 0)
self.contents.font.color = color
self.contents.draw_text(x, y, w, h, @text[0], 0)
self.contents.draw_text(x, y+h, w, h, @text[1], 0)
@text[2] = text
when 3 # Line 4
self.contents.draw_text(x+sx, y+sy, w, h, @text[0], 0)
self.contents.draw_text(x+sx, y+h+sy, w, h, @text[1], 0)
self.contents.draw_text(x+sx, y+h+h+sy, w, h, @text[2], 0)
self.contents.font.color = color
self.contents.draw_text(x, y, w, h, @text[0], 0)
self.contents.draw_text(x, y+h, w, h, @text[1], 0)
self.contents.draw_text(x, y+h+h, w, h, @text[2], 0)
end
self.contents.font.color = Color.new(0, 0, 0, alpha)
self.contents.draw_text(x + sx, line*h + sy, w, h, text, 0)
self.contents.font.color = color
self.contents.draw_text(x, line*h, w, h, text, 0)
self.visible = true
end
end
#==============================================================================
# â– Spriteset_Battle
#==============================================================================
class Spriteset_Battle
attr_accessor :actor_sprites # Sprite_Battler
end
#==============================================================================
# â– Scene_Battle 1
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# â— Main Processing
#--------------------------------------------------------------------------
alias window_battle_message_200_main main
def main
text_hash
@bwin_wbm = Window_BattleMessage.new
@critcal = false
@wbm_loop = 0
@wbm_loop1 = 0
@states0 = {}
@live = {}
@target_sp = {}
window_battle_message_200_main
@bwin_wbm.dispose
@bwin_wbm = nil
end
end
#==============================================================================
# â– Scene_Battle 2
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
alias window_battle_message_200_start_phase1 start_phase1
def start_phase1
if not WBM200_ACTOR_VISIBLE
for i in 0...$game_party.actors.size
@spriteset.actor_sprites[i].visible = false
end
end
window_battle_message_200_start_phase1
end
#--------------------------------------------------------------------------
# â— Frame Update (pre-battle phase)
#--------------------------------------------------------------------------
alias window_battle_message_200_update_phase1 update_phase1
def update_phase1
if $game_troop.enemies[@wbm_loop] != nil
unless $game_troop.enemies[@wbm_loop].hidden
text = add_text($game_troop.enemies[@wbm_loop].name, "**start")
@bwin_wbm.draw_text(text, @wbm_loop1, true)
@wbm_loop1 += 1 # Message Line +1
@wait_count = WBM200_TEXT_WAIT
end
@wbm_loop += 1 # Enemy Index +1
return
elsif @wbm_loop == $game_troop.enemies.size
@wbm_loop = @wbm_loop1 = 0
window_battle_message_200_update_phase1
end
end
#--------------------------------------------------------------------------
# â— Wait text
# Text wait before moving to next phase
#--------------------------------------------------------------------------
alias window_battle_message_200_start_phase2 start_phase2
def start_phase2
@wait_count = WBM200_TEXT_WAIT
@bwin_wbm.visible = false
window_battle_message_200_start_phase2
end
#--------------------------------------------------------------------------
# â— Escape
#--------------------------------------------------------------------------
alias window_battle_message_200_update_phase2 update_phase2
def update_phase2
# Escaping
if @success != nil
update_phase2_escape
end
window_battle_message_200_update_phase2
end
#--------------------------------------------------------------------------
# â— Frame Update (party command phase: escape)
#--------------------------------------------------------------------------
def update_phase2_escape
# Calculate enemy agility average
enemies_agi = 0
enemies_number = 0
for enemy in $game_troop.enemies
if enemy.exist?
enemies_agi += enemy.agi
enemies_number += 1
end
end
if enemies_number > 0
enemies_agi /= enemies_number
end
# Calculate actor agility average
actors_agi = 0
actors_number = 0
for actor in $game_party.actors
if actor.exist?
actors_agi += actor.agi
actors_number += 1
end
end
if actors_number > 0
actors_agi /= actors_number
end
# Determine if escape is successful
@success ||= rand(100) < 50 * actors_agi / enemies_agi
# If escape is successful
if @success
#--------------------------------------
# If successful escape
if @wbm_loop == 0
@party_command_window.active = false
@party_command_window.visible = false
text = add_text("", "**escape")
@bwin_wbm.draw_text(text, 0)
@wait_count = 20
@wbm_loop = 1
# Return call
return
end
@bwin_wbm.visible = false
#--------------------------------------
# Escaping SFX
$game_system.se_play($data_system.escape_se)
# Starts Map BGM
$game_system.bgm_play($game_temp.map_bgm)
# Ends battle
battle_end(1)
# Else
else
#--------------------------------------
# For failed escapse
@party_command_window.visible = false
text = add_text("", "**no_escape")
@bwin_wbm.draw_text(text, 0)
@text_0 = [""]
@text_key = ["**no"]
@success = nil
@wait_count = 20
#--------------------------------------
# Clearing actions
$game_party.clear_actions
# Starts Phase 4
start_phase4
end
end
#--------------------------------------------------------------------------
# â— Victory text
#--------------------------------------------------------------------------
alias window_battle_message_200_start_phase5 start_phase5
def start_phase5
# Victory text
text = add_text("", "**win")
@bwin_wbm.draw_text(text, 0)
window_battle_message_200_start_phase5
end
end
#==============================================================================
# â– Scene_Battle 4
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# â— Frame Update (main phase step 1 : action preparation)
#--------------------------------------------------------------------------
def update_phase4_step1
# Hide help window
@help_window.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
#------------------------------â–¼
# Active battler name
text_0 = @active_battler.name
st0 = []
st1 = []
@active_battler.states.each_index do |i|
st0 << $data_states[@active_battler.states[i]].name
end
# Slip damage
if @active_battler.hp > 0 and @active_battler.slip_damage?
for i in @active_battler.states
if $data_states[i].slip_damage
text_key = $data_states[i].name + "_3"
if @wbm_set1[text_key] != nil
text = text_0 + @wbm_set1[text_key]
@bwin_wbm.draw_text(text, 0)
@wait_count = WBM200_TEXT_WAIT
end
end
end
# Slip damage
@active_battler.slip_damage_effect
@active_battler.states.each_index do |i|
st1 << $data_states[@active_battler.states[i]].name
end
states_p = st1 - st0
# If battler dies
if @active_battler.hp <= 0
text_key = "**no"
for i in 1...$data_states.size
if $data_states[i].zero_hp
text_key = $data_states[i].name + "_0"
break
end
end
if @wbm_set1[text_key] != nil
text = text_0 + @wbm_set1[text_key]
@bwin_wbm.draw_text(text, 1)
@wait_count = WBM200_TEXT_WAIT
end
end
# If Damage pop available
if WBM200_DAMAGE_POP
@active_battler.damage_pop = true
else
@active_battler.damage_pop = false
@active_battler.damage = nil
@wait_count += WBM200_TEXT_WAIT
end
# Active battler
elsif @active_battler.hp > 0 and @active_battler.states[0] != nil
st1 = $data_states[@active_battler.states[0]].name
text_key = st1 + "_3"
if @wbm_set1[text_key] != nil
text = text_0 + @wbm_set1[text_key]
@bwin_wbm.draw_text(text, 0)
@wait_count = WBM200_TEXT_WAIT
end
end
# Natural removal of states
@active_battler.remove_states_auto
st1 = []
@active_battler.states.each_index do |i|
st1 << $data_states[@active_battler.states[i]].name
end
states_m = st0 - st1
if states_m[0] != nil and @active_battler.hp > 0
text_key = states_m[0] + "_2"
if @wbm_set1[text_key] != nil
text = text_0 + @wbm_set1[text_key]
@bwin_wbm.draw_text(text, 0)
@wait_count = WBM200_TEXT_WAIT
end
end
#------------------------------â–²
# efresh status window
@status_window.refresh
# Shift to step 2
@phase4_step = 2
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 # if attack enemy state
target = $game_troop.random_target_enemy
elsif @active_battler.restriction == 2 # If attack actor state
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]
check_states #Checks the states
# Apply normal attack results
for target in @target_battlers
target.attack_effect(@active_battler)
end
set_text("**attack") #Text call command
return
end
# If guard
if @active_battler.current_action.basic == 1
#-----------------------------------------------------------------
@text_0 = [@active_battler.name]
@text_key = ["**guard"]
#-----------------------------------------------------------------
# Display "Guard" in help window
#@help_window.set_text($data_system.words.guard, 1)
return
end
# If battler performing action is enemy
if @active_battler.is_a?(Game_Enemy) and
@active_battler.current_action.basic == 2
#-----------------------------------------------------------------
@text_0 = [@active_battler.name]
@text_key = ["**enemy_action1"]
#-----------------------------------------------------------------
# Display "Escape" in help window
#@help_window.set_text("Escape", 1)
# Escape
@active_battler.escape
return
end
# If doing nothing
if @active_battler.current_action.basic == 3
#-----------------------------------------------------------------
# If action battler is enemy
if @active_battler.is_a?(Game_Enemy) and ! @active_battler.hidden and
@active_battler.restriction != 4
@text_0 = [@active_battler.name]
@text_key = ["**enemy_action2"]
else
@text_0 = [""]
@text_key = ["**no"]
end
#★★-----------------------------------------------------------------
# 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
# 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_window.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)
check_states #Checks states
# Apply skill effect
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
set_text("**skill") #Text call command
end
#--------------------------------------------------------------------------
# â— Make Item Action Results
#--------------------------------------------------------------------------
def make_item_action_result
# 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_window.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 target battlers
set_target_battlers(@item.scope)
check_states #Checks states
# Apply item effect
for target in @target_battlers
target.item_effect(@item)
end
set_text("**item") #Text call command
end
#--------------------------------------------------------------------------
# â— Frame Update (main phase step 3 : animation for action performer)
#--------------------------------------------------------------------------
alias window_battle_message_200_update_phase4_step3 update_phase4_step3
def update_phase4_step3
if @text_0 == nil or @text_key == nil
@text_0 = [""]
@text_key = ["**no"]
end
text = add_text(@text_0[0], @text_key[0])
@bwin_wbm.draw_text(text, 0)
@text_0.delete_at 0
@text_key.delete_at 0
window_battle_message_200_update_phase4_step3
if not WBM200_ACTOR_ANIMATION and @active_battler.is_a?(Game_Actor)
@active_battler.animation_id = 0
end
@help_window.visible = false
end
#--------------------------------------------------------------------------
# â— Frame Update (main phase step 4 : animation for target)
#--------------------------------------------------------------------------
alias window_battle_message_200_update_phase4_step4 update_phase4_step4
def update_phase4_step4
if @critical
text = add_text(@text_0[0], @text_key[0])
@bwin_wbm.draw_text(text, 1)
@text_0.delete_at 0
@text_key.delete_at 0
end
window_battle_message_200_update_phase4_step4
for target in @target_battlers
if not WBM200_ACTOR_ANIMATION and target.is_a?(Game_Actor)
target.animation_id = 0
end
end
end
#--------------------------------------------------------------------------
# â— Frame Update (main phase step 5 : damage display)
#--------------------------------------------------------------------------
alias window_battle_message_200_update_phase4_step5 update_phase4_step5
def update_phase4_step5
#
line = @critical ? 2 : 1
if @text_key[@wbm_loop] == "_STATES_"
@text_key.delete_at @wbm_loop
text = add_text(@text_0[@wbm_loop], @text_key[@wbm_loop])
@bwin_wbm.draw_text(text, line + 1)
else
text = add_text(@text_0[@wbm_loop], @text_key[@wbm_loop])
@bwin_wbm.draw_text(text, line)
end
@wbm_loop += 1
if @text_key[@wbm_loop] == "NEXT_TARGET"
@text_key.delete_at @wbm_loop
if @target_battlers[@wbm_loop1].damage != nil
if WBM200_DAMAGE_POP
@target_battlers[@wbm_loop1].damage_pop = true
else
@target_battlers[@wbm_loop1].damage = nil
@wait_count = WBM200_TEXT_WAIT
end
end
@wbm_loop1 += 1
end
if @wbm_loop < @text_0.size
if @wbm_set1[@text_key[@wbm_loop - 1]] != nil
@wait_count = WBM200_TEXT_WAIT
return
end
end
@critical = false
@wbm_loop = @wbm_loop1 = 0
window_battle_message_200_update_phase4_step5
for target in @target_battlers
if target.damage != nil and not WBM200_DAMAGE_POP
@wait_count = WBM200_TEXT_WAIT
target.damage_pop = false
target.damage = nil
end
end
end
end
Code:
#==============================================================================
# ★ ドラムシステムvar 1.5 (06.11.22) by shun
#------------------------------------------------------------------------------
# 戦闘ä¸ã«ã€HPをアナãƒã‚°å¼ï¼ˆå°‘ã—ãšã¤é«˜é€Ÿã§ï¼‰æ¸›ã‚‰ã™ã‚¹ã‚¯ãƒªãƒ—トã§ã™ã€‚
#==============================================================================
module SIMP
#--------------------------------------------------------------------------
# â—‹ è¨å®š
#--------------------------------------------------------------------------
#
# HPãŒæ¸›ã‚‹ã‚¹ãƒ”ード(値ãŒå¤§ãã„æ–¹ãŒæ—©ã„)
#
BATTLE_DRUM_SPEED = 1
#
# HPãŒæ¸›ã‚Šãã‚‹ã¾ã§ã‚¦ã‚§ã‚¤ãƒˆã™ã‚‹ï¼ˆtrue)ã‹å¦ï¼ˆfalse)ã‹
#
BATTLE_DRUM_WAIT = false
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ◠公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :damage_remainder # 残りダメージ値
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias drum_initialize initialize
def initialize(actor_id)
drum_initialize(actor_id)
@damage_remainder = 0
end
#--------------------------------------------------------------------------
# ◠通常攻撃ã®åŠ¹æžœé©ç”¨
# attacker : 攻撃者 (ãƒãƒˆãƒ©ãƒ¼)
#--------------------------------------------------------------------------
def attack_effect(attacker)
# HP ã‚’ãƒãƒ¼ã‚«ãƒ«å¤‰æ•°ã«è¨˜æ†¶
last_hp = self.hp
super
# ダメージをå—ã‘ãŸå ´åˆã€HP を戻ã™
self.hp = last_hp if self.damage.is_a?(Integer)
end
#--------------------------------------------------------------------------
# ◠スã‚ルã®åŠ¹æžœé©ç”¨
# user : スã‚ルã®ä½¿ç”¨è€… (ãƒãƒˆãƒ©ãƒ¼)
# skill : スã‚ル
#--------------------------------------------------------------------------
def skill_effect(user, skill)
# HP ã‚’ãƒãƒ¼ã‚«ãƒ«å¤‰æ•°ã«è¨˜æ†¶
last_hp = self.hp
super
# ダメージをå—ã‘ãŸå ´åˆã€HP を戻ã™
self.hp = last_hp if self.damage.is_a?(Integer)
end
#--------------------------------------------------------------------------
# ◠アイテムã®åŠ¹æžœé©ç”¨
# item : アイテãƒ
#--------------------------------------------------------------------------
def drum_item_effect(item)
# HP ã‚’ãƒãƒ¼ã‚«ãƒ«å¤‰æ•°ã«è¨˜æ†¶
last_hp = self.hp
super
# ダメージをå—ã‘ãŸå ´åˆã€HP を戻ã™
self.hp = last_hp if self.damage.is_a?(Integer)
end
#--------------------------------------------------------------------------
# ◠スリップダメージã®åŠ¹æžœé©ç”¨
#--------------------------------------------------------------------------
def slip_damage_effect
last_hp = self.hp
# ダメージをå—ã‘ãŸå ´åˆ
if super
# HP を戻ã—ã¦æ®‹ã‚Šãƒ€ãƒ¡ãƒ¼ã‚¸å€¤ã«åŠ ç®—
self.hp = last_hp
self.damage_remainder += self.damage
end
end
end
#==============================================================================
# â–¡ Sprite_BattleStatus
#------------------------------------------------------------------------------
#  ãƒãƒˆãƒ«ç”»é¢ã§ãƒ‘ーティメンãƒãƒ¼ã® HP を表示ã™ã‚‹ã‚¹ãƒ—ライトã§ã™ã€‚
#==============================================================================
class Sprite_BattleStatus < Sprite
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
# viewport : ビューãƒãƒ¼ãƒˆ
#--------------------------------------------------------------------------
def initialize(viewport)
super(viewport)
self.bitmap = Bitmap.new(viewport.rect.width, viewport.rect.height)
update
end
#--------------------------------------------------------------------------
# ◠解放
#--------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
super
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
super
# HP ã‚’å†æç”»
self.bitmap.clear
for i in 0...$game_party.actors.size
draw_hp($game_party.actors[i], i * 160 + 20, 48, 120)
end
# メインフェーズã®ã¨ãã¯ä¸é€æ˜Žåº¦ã‚’やや下ã’ã‚‹
if $game_temp.battle_main_phase
self.opacity -= 4 if self.opacity > 191
else
self.opacity += 4 if self.opacity < 255
end
end
#--------------------------------------------------------------------------
# ◠通常文å—色ã®å–å¾—
#--------------------------------------------------------------------------
def normal_color
return Color.new(255, 255, 255, 255)
end
#--------------------------------------------------------------------------
# ◠ピンãƒæ–‡å—色ã®å–å¾—
#--------------------------------------------------------------------------
def crisis_color
return Color.new(255, 255, 64, 255)
end
#--------------------------------------------------------------------------
# ◠戦闘ä¸èƒ½æ–‡å—色ã®å–å¾—
#--------------------------------------------------------------------------
def knockout_color
return Color.new(255, 64, 0)
end
#--------------------------------------------------------------------------
# â— HP ã®æç”»
# actor : アクター
# x : æ画先 X 座標
# y : æ画先 Y 座標
# width : æ画先ã®å¹…
#--------------------------------------------------------------------------
def draw_hp(actor, x, y, width = 144)
# MaxHP ã‚’æç”»ã™ã‚‹ã‚¹ãƒšãƒ¼ã‚¹ãŒã‚ã‚‹ã‹è¨ˆç®—
if width - 32 >= 108
hp_x = x + width - 108
elsif width - 32 >= 48
hp_x = x + width - 48
end
# HP ã‚’æç”»
self.bitmap.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.bitmap.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
end
end
class Spriteset_Battle
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias drum_initialize initialize
def initialize
# ビューãƒãƒ¼ãƒˆã‚’作æˆ
@viewport5 = Viewport.new(0, 320, 640, 160)
@viewport5.z = 5001
# ãƒãƒˆãƒ«ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚¹ãƒ—ライトを作æˆ
@battle_status = Sprite_BattleStatus.new(@viewport5)
drum_initialize
end
#--------------------------------------------------------------------------
# ◠解放
#--------------------------------------------------------------------------
alias drum_dispose dispose
def dispose
drum_dispose
# ãƒãƒˆãƒ«ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚¹ãƒ—ライトを解放
@battle_status.dispose
# ビューãƒãƒ¼ãƒˆã‚’解放
@viewport5.dispose
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias drum_update update
def update
drum_update
# ãƒãƒˆãƒ«ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚¹ãƒ—ライトを更新
@battle_status.update
end
end
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# â— HP ã®æç”»
# actor : アクター
# x : æ画先 X 座標
# y : æ画先 Y 座標
# width : æ画先ã®å¹…
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
if $scene.is_a?(Scene_Battle)
# æ–‡å—列 "HP" ã‚’æç”»
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
else
super
end
end
end
class Scene_Battle
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias drum_update update
def update
drum_update
# 残りダメージ値ã‹ã‚‰ãƒ€ãƒ¡ãƒ¼ã‚¸ã‚’与ãˆã‚‹
damage
end
#--------------------------------------------------------------------------
# â— ãƒãƒˆãƒ«çµ‚了
# result : çµæžœ (0:å‹åˆ© 1:敗北 2:逃走)
#--------------------------------------------------------------------------
alias drum_battle_end battle_end
def battle_end(result)
# 残りダメージ値をåˆæœŸåŒ–
for actor in $game_party.actors
actor.damage_remainder = 0
end
drum_battle_end(result)
end
#--------------------------------------------------------------------------
# ◠アフターãƒãƒˆãƒ«ãƒ•ã‚§ãƒ¼ã‚ºé–‹å§‹
#--------------------------------------------------------------------------
alias drum_start_phase5 start_phase5
def start_phase5
# 残りダメージ値をåˆæœŸåŒ–
for actor in $game_party.actors
actor.damage_remainder = 0
end
drum_start_phase5
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
#--------------------------------------------------------------------------
alias drum_update_phase4_step5 update_phase4_step5
def update_phase4_step5
# 対象ãƒãƒˆãƒ©ãƒ¼ãŒã‚¢ã‚¯ã‚¿ãƒ¼ã®å ´åˆ
for target in @target_battlers
if target.is_a?(Game_Actor) and target.damage.is_a?(Integer)
# 残りダメージ値ã«ãƒ€ãƒ¡ãƒ¼ã‚¸å€¤ã‚’åŠ ç®—
target.damage_remainder += target.damage
end
end
drum_update_phase4_step5
end
#--------------------------------------------------------------------------
# â—‹ 残りダメージ値ã‹ã‚‰ãƒ€ãƒ¡ãƒ¼ã‚¸ã‚’与ãˆã‚‹
#--------------------------------------------------------------------------
def damage
waits = [] if SIMP::BATTLE_DRUM_WAIT
for actor in $game_party.actors
# 残りダメージ値ãŒç„¡ã„å ´åˆ
next if actor.damage_remainder == 0
# ダメージã‹å›žå¾©ã‹ã§åˆ†å²
if actor.damage_remainder > 0
n = [SIMP::BATTLE_DRUM_SPEED, actor.damage_remainder].min
else
n = [-SIMP::BATTLE_DRUM_SPEED, actor.damage_remainder].max
end
# HP ã¨æ®‹ã‚Šãƒ€ãƒ¡ãƒ¼ã‚¸å€¤ã‚’減算
actor.hp -= n
actor.damage_remainder -= n
# 戦闘ä¸èƒ½ã«ãªã£ãŸå ´åˆ
if actor.dead? and actor.damage_remainder > 0
actor.damage_remainder = 0
@status_window.refresh
end
waits.push(actor.damage_remainder) if SIMP::BATTLE_DRUM_WAIT
end
# ウェイトカウントã«æ®‹ã‚Šãƒ€ãƒ¡ãƒ¼ã‚¸å€¤ã‚’代入
if SIMP::BATTLE_DRUM_WAIT
@wait_count = waits.max if waits[0] != nil
waits.clear
end
end
end
#==============================================================================
# ★ æƒ…å ±
#------------------------------------------------------------------------------
# 製作
# shun
# HP : Simp (http://simp.nobody.jp)
#==============================================================================