alias oldinitialize initialize
def initialize
@cp = 0
@cp_total = false
@cp_turn = 0
@damage = nil
@damage_pop = false
@act_status = 0
@slip_damage = 0
@auto_damage = 0
@Battler_turn = 0
@turn_start = 0
oldinitialize
end
def maxcp
return 100
end
#--------------------------------------------------------------------------
# ● 应用连续伤害效果
#--------------------------------------------------------------------------
def slip_damage_effect
if slip_damage? and @hp > 0
@hp_damage = apply_variance(maxhp / 10, 10)
@hp_damage = @hp - 1 if @hp_damage >= @hp
@slip_damage = @hp_damage
self.hp -= @hp_damage
end
end
end #class
#===============================================
#★角色队伍类
#===============================================
class Game_Party < Game_Unit
attr_accessor :actor_battler
alias oldinitialize initialize
def initialize
oldinitialize
@actor_battler = []
end
end #class
#================================================
#★敌人队伍类
#================================================
class Game_Troop < Game_Unit
attr_accessor :enemy_battler
alias oldinitialize initialize
def initialize
oldinitialize
@enemy_battler = []
end
#--------------------------------------------------------------------------
# ● 判断是否符合战斗事件 (页) 条件
# page : 战斗事件页
#--------------------------------------------------------------------------
def conditions_met?(page)
c = page.condition
if not c.turn_ending and not c.turn_valid and not c.enemy_valid and
not c.actor_valid and not c.switch_valid
return false # 未设置条件…不执行
end
if @event_flags
return false # 已执行
end
if c.enemy_valid # 敌方角色
enemy = $game_troop.members[c.enemy_index]
return false if enemy == nil
if c.turn_ending == false #
return false if enemy.hp * 100.0 / enemy.maxhp > c.enemy_hp
elsif c.turn_ending and not c.turn_valid
return false if enemy.Battler_turn != c.enemy_hp or enemy.cp != 100
elsif c.turn_ending and c.turn_valid
a = c.turn_a
b = c.turn_b
if b>0
return false if (a==0 and ( c.enemy_hp < 1 or enemy.Battler_turn < c.enemy_hp or enemy.Battler_turn % b != c.enemy_hp % b or enemy.cp != 100 or enemy.turn_start != 1))
return false if (a==1 and ( c.enemy_hp < 1 or enemy.Battler_turn < c.enemy_hp or enemy.Battler_turn % b != c.enemy_hp % b or enemy.cp != 100 or enemy.turn_start != 0))
else
if a == 0 #回合开始时 等于
return false if ( enemy.Battler_turn != c.enemy_hp or enemy.cp != 100 or enemy.turn_start != 1)
elsif a == 1 # #回合开始时 回合数大于
return false if (enemy.Battler_turn <= c.enemy_hp or enemy.cp != 100 or enemy.turn_start != 1)
elsif a == 2 #回合开始时 回合数小于
return false if (enemy.Battler_turn >= c.enemy_hp or enemy.cp != 100 or enemy.turn_start != 1)
elsif a == 3 #回合结束时 回合数等于
return false if (enemy.Battler_turn != c.enemy_hp or enemy.cp != 100 or enemy.turn_start != 0)
elsif a == 4 #回合结束时 回合数大于
return false if (enemy.Battler_turn <= c.enemy_hp or enemy.cp != 100 or enemy.turn_start != 0)
elsif a == 5 # 回合结束时 回合数小于
return false if (enemy.Battler_turn >= c.enemy_hp or enemy.cp != 100 or enemy.turn_start != 0)
end
end
end
end
if c.actor_valid # 角色
actor = $game_actors[c.actor_id]
return false if actor == nil
if c.turn_ending == false #
return false if actor.hp * 100.0 / actor.maxhp > c.actor_hp
elsif c.turn_ending and not c.turn_valid
return false if actor.Battler_turn != c.actor_hp or actor.cp != 100
elsif c.turn_ending and c.turn_valid
a = c.turn_a
b = c.turn_b
if b > 0
return false if (a== 0 and ( c.actor_hp < 1 or actor.Battler_turn < c.actor_hp or actor.Battler_turn % b != c.actor_hp % b or actor.cp != 100 or actor.turn_start != 1))
return false if (a== 1 and ( c.actor_hp < 1 or actor.Battler_turn < c.actor_hp or actor.Battler_turn % b != c.actor_hp % b or actor.cp != 100 or actor.turn_start != 0))
else
if a == 0 # 等于
return false if (actor.Battler_turn != c.actor_hp or actor.cp != 100 or actor.turn_start != 1)
elsif a == 1 #回合开始时 回合数大于
return false if (actor.Battler_turn <= c.actor_hp or actor.cp != 100 or actor.turn_start != 1)
elsif a == 2 #回合开始时 回合数小于
return false if (actor.Battler_turn >= c.actor_hp or actor.cp != 100 or actor.turn_start != 1)
elsif a == 3 #回合结束时 回合数等于
return false if (actor.Battler_turn != c.actor_hp or actor.cp != 100 or actor.turn_start != 0)
elsif a == 4 #回合结束时 回合数大于
return false if (actor.Battler_turn <= c.actor_hp or actor.cp != 100 or actor.turn_start != 0)
elsif a == 5 #回合结束时 回合数小于
return false if (actor.Battler_turn >= c.actor_hp or actor.cp != 100 or actor.turn_start != 0)
end
end
end
end
if c.switch_valid # 开关
return false if $game_switches[c.switch_id] == false
end
return true # 符合条件
end
#--------------------------------------------------------------------------
# ● 增加回合
#--------------------------------------------------------------------------
def increase_turn
for page in troop.pages
if page.span == 1
@event_flags= false
end
end
#@turn_count += 1
end
end
n = battler.character_index
rect = Rect.new((n%4*3+1)*cw, (n/4*4+2)*ch, cw, ch)
@cp_battler[battler].bitmap = Bitmap.new(cw,ch)
end
@cp_battler[battler].bitmap.blt(0, 0,bitmap,rect)
else
name = battler.original_name + "_敌人cp"
if FileTest.exist?("Graphics/system/#{name}.jpg") or FileTest.exist?("Graphics/system/#{name}.png") or FileTest.exist?("Graphics/system/#{name}.bmp")
@cp_battler[battler].bitmap = Bitmap.new("Graphics/system/#{name}")
else
@cp_battler[battler].bitmap = Bitmap.new("Graphics/system/敌人cp")
end
@cp_battler[battler].bitmap.blt(80,60, @cp_battler[battler].bitmap, @cp_battler[battler].bitmap.rect)
end
@cp_battler[battler].z = 101
@cp_battler[battler].visible = false
end
end
#===========================================
#===========================================
def update
return if @stop
for battler in $game_party.members + $game_troop.members
if (@cp_battler[battler].disposed? or @cp_battler[battler].opacity == 0) and battler.dead?
@cp_battler.delete(@cp_battler[battler])
next
end
if battler.dead?
if @cp_battler.include?(battler)
@cp_battler[battler].collapse = true
end
battler.cp = 0
next
end
next if @cp_battler[battler].disposed?
battler.cp = [[battler.cp + BATTLE_SPEED*10*battler.agi / @all_agi,0].max,battler.maxcp].min if battler.movable?
battler.cp_turn = [[battler.cp_turn+BATTLE_SPEED*10*battler.agi / @all_agi, 0].max,battler.maxcp].min
if battler.cp == battler.maxcp
#============================
#☆设置战斗者处于回合准备状态
#============================
battler.turn_start = 3
#============================
if battler.is_a?(Game_Actor)
name = battler.id.to_s + "_a_cp"
if FileTest.exist?("Graphics/system/#{name}.jpg") or FileTest.exist?("Graphics/system/#{name}.png") or FileTest.exist?("Graphics/system/#{name}.bmp")
bitmap = Bitmap.new("Graphics/system/#{name}")
rect = bitmap.rect
@cp_battler[battler].bitmap = bitmap
else
bitmap = Bitmap.new("Graphics/Characters/#{battler.character_name}")
sign = battler.character_name[/^[\!\$]./]
if sign != nil and sign.include?('$')
cw = bitmap.width / 3
ch = bitmap.height / 4
else
cw = bitmap.width / 12
ch = bitmap.height / 8
end
n = battler.character_index
rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
@cp_battler[battler].bitmap = Bitmap.new(cw,ch)
end
@cp_battler[battler].bitmap.blt(0,0,bitmap,rect)
else
name = battler.original_name + "_a_cp"
if FileTest.exist?("Graphics/system/#{name}.jpg") or FileTest.exist?("Graphics/system/#{name}.png") or FileTest.exist?("Graphics/system/#{name}.bmp")
@cp_battler[battler].bitmap = Bitmap.new("Graphics/system/#{name}")
else
@cp_battler[battler].bitmap = Bitmap.new("Graphics/system/a_敌人cp")
end
@cp_battler[battler].bitmap.blt(80,60, @cp_battler[battler].bitmap, @cp_battler[battler].bitmap.rect)
end
@cp_battler[battler].z = 101
battler.cp_total = true
elsif battler.cp_total == true
if battler.is_a?(Game_Actor)
name = battler.id.to_s + "_cp"
if FileTest.exist?("Graphics/system/#{name}.jpg") or FileTest.exist?("Graphics/system/#{name}.png") or FileTest.exist?("Graphics/system/#{name}.bmp")
bitmap = Bitmap.new("Graphics/system/#{name}")
rect = bitmap.rect
@cp_battler[battler].bitmap = bitmap
else
bitmap = Bitmap.new("Graphics/Characters/#{battler.character_name}")
sign = battler.character_name[/^[\!\$]./]
if sign != nil and sign.include?('$')
cw = bitmap.width / 3
ch = bitmap.height / 4
else
cw = bitmap.width / 12
ch = bitmap.height / 8
end
n = battler.character_index
rect = Rect.new((n%4*3+1)*cw, (n/4*4+2)*ch, cw, ch)
@cp_battler[battler].bitmap = Bitmap.new(cw,ch)
end
@cp_battler[battler].bitmap.blt(0,0,bitmap,rect)
elsif
name = battler.original_name + "_敌人cp"
if FileTest.exist?("Graphics/system/#{name}.jpg") or FileTest.exist?("Graphics/system/#{name}.png") or FileTest.exist?("Graphics/system/#{name}.bmp")
@cp_battler[battler].bitmap = Bitmap.new("Graphics/system/#{name}")
@cp_battler[battler].bitmap.blt(80,60, @cp_battler[battler].bitmap, @cp_battler[battler].bitmap.rect)
end
battler.cp_total = false
@cp_battler[battler].z = 105
end
@cp_battler[battler].visible = true if @cp_battler[battler].visible == false
@cp_battler[battler].opacity = 255
@cp_battler[battler].y = 30
@cp_battler[battler].x = 95+300*battler.cp/battler.maxcp
if battler.cp_turn == battler.maxcp
battler.remove_states_auto unless battler.movable?
battler.slip_damage_effect
battler.do_auto_recovery if battler.is_a?(Game_Actor)
battler.damage_pop = true if battler.slip_damage != 0 or battler.auto_damage != 0
battler.cp_turn = 0
end
if battler.cp == battler.maxcp
if battler.is_a?(Game_Actor)
$game_party.actor_battler.push(battler)
else
battler.make_action
$game_troop.enemy_battler.push(battler)
battler.make_action
end
else
next
end
end
end
def dispose
for j in 0..25
@cpline.opacity -= 10
for i in @cp_battler.values
unless i.disposed?
i.opacity -= 10
end
end
Graphics.update
end
@v.dispose
@cpline.dispose
for i in @cp_battler.values
i.dispose unless i.disposed?
end
end
end
class Sprite_cpbattler < Sprite
attr_accessor :collapse
def initialize (viewport = nil)
super (viewport)
@effect_duration = 0
@collapse = false
end
def update
super
if self.collapse == true and self.opacity != 0
@effect_type = 5
@effect_duration = 48
self.color.set(255, 128, 128, 128)
for i in 0..48
self.opacity = 256 - (48 - @effect_duration) * 6
if self.opacity == 0
break
end
Graphics.update
@effect_duration -= 1
end
self.collapse = false
self.color.set(255,255,255,5)
end
end
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
super
end
end
#==========================================================================
#
#==========================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
def start
super
#======================
@select_input = true
#======================
$game_temp.in_battle = true
#=============================================
unless $BTEST
@battleback = nil
for area in $data_areas.values
if $game_player.in_area?(area)
name = area.name
unless B_B_CONFIG
@battleback = Cache.battleback("#{name}")if FileTest.exist?("Graphics/Battlebacks/#{name}.jpg") or FileTest.exist?("Graphics/Battlebacks/#{name}.jpg") or FileTest.exist?("Graphics/Battlebacks/#{name}.bmp")
break
else
if BATTLE_BACK[name] != nil
@battleback = Cache.battleback("#{BATTLE_BACK[name]}")if FileTest.exist?("Graphics/Battlebacks/#{BATTLE_BACK[name]}.jpg") or FileTest.exist?("Graphics/Battlebacks/#{BATTLE_BACK[name]}.jpg") or FileTest.exist?("Graphics/Battlebacks/#{BATTLE_BACK[name]}.bmp")
end
break
end
end
end
if @battleback == nil
name = $game_map.name
unless B_B_CONFIG
@battleback = Cache.battleback("#{name}")if FileTest.exist?("Graphics/Battlebacks/#{name}.jpg") or FileTest.exist?("Graphics/Battlebacks/#{name}.jpg") or FileTest.exist?("Graphics/Battlebacks/#{name}.bmp")
else
if BATTLE_BACK[name] != nil
@battleback = Cache.battleback("#{BATTLE_BACK[name]}")
else
@battleback = nil
end
end
end
$game_temp.background_bitmap = @battleback if @battleback != nil
end
#==================================================
@spriteset = Spriteset_Battle.new
@message_window = Window_BattleMessage.new
@message_window.visible = false
@action_battlers = []
@cp_battle = Scene_CP.new
@cp_battle.stop = false
create_info_viewport
end
#--------------------------------------------------------------------------
# ● 战斗事件处理
#--------------------------------------------------------------------------
def process_battle_event
#============================
if $game_message.texts != nil
@message_window.visible = true
end
#=============================
loop do
return if judge_win_loss
return if $game_temp.next_scene != nil
$game_troop.interpreter.update
$game_troop.setup_battle_event
# wait_for_message
process_action if $game_troop.forcing_battler != nil
#======================================
unless $game_troop.interpreter.running?
if $game_message.texts != nil
@message_window.clear
@message_window.visible = false
end
return
end
#=======================================
update_basic
end
end
@actor_index += 1
index = 0
for battler in $game_party.members
if battler == @actor_battler[@actor_index]
break
else
index += 1
end
end
@status_window.index = index
if @active_battler != nil and @active_battler != @actor_battler[@actor_index] and @active_battler.is_a?(Game_Actor)
@active_battler.act_status = -1
end
@active_battler = @actor_battler[@actor_index]
@active_battler.act_status = 1
#=================================
#★角色回合事件处理
#================================
@active_battler.Battler_turn += 1
@active_battler.turn_start = 1
$game_troop.increase_turn
process_battle_event
if @active_battler.auto_battle
@active_battler.make_action
next
end
break if @active_battler.inputable?
end
start_actor_command_selection
end
if @actor_command_window.index == 0
@actor_command_window.active = true
end
end
#=======================================================
#★敌人选择刷新
#=======================================================
def update_target_enemy_selection
@target_enemy_window.update
select_icon_update(true)
if Input.trigger?(Input::B)
Sound.play_cancel
if @skill_window != nil
@skill_window.visible = true
end
if @item_window != nil
@item_window.visible = true
end
end_target_enemy_selection
elsif Input.trigger?(Input::C)
Sound.play_decision
@active_battler.action.target_index = @target_enemy_window.enemy.index
end_target_enemy_selection
end_skill_selection
end_item_selection
next_actor
# @active_battler.cp = 0
end
end
end_target_actor_selection
end_skill_selection
end_item_selection
next_actor
# @active_battler.cp = 0
end
end
#============================================
#★特技使用决定 处理
#===========================================
def determine_skill
@active_battler.action.set_skill(@skill.id)
@skill_window.active = false
if @skill.need_selection?
if @skill.for_opponent?
start_target_enemy_selection
else
start_target_actor_selection
end
else
end_skill_selection
next_actor
# @active_battler.cp = 0
end
end
#=========================================
#★物品使用决定 处理
#=========================================
def determine_item
@active_battler.action.set_item(@item.id)
@item_window.active = false
if @item.need_selection?
if @item.for_opponent?
start_target_enemy_selection
else
start_target_actor_selection
end
else
end_item_selection
next_actor
# @active_battler.cp = 0
end
end
end
#================================================
#★视口释放
#================================================
def dispose_info_viewport
@status_window.dispose
@actor_command_window.dispose
@info_viewport.dispose
#========================
#☆减少头像刷新用
#========================
@now_face = -1
if @window_egi != nil
@window_egi.dispose
end
end
#======================================================
#★视口刷新
#======================================================
def update_info_viewport
@actor_command_window.update
if @active_battler != nil and @active_battler.is_a?(Game_Actor) and @active_battler.id != @now_face
@status_window.draw_actorface(@active_battler)
@now_face = @active_battler.id
end
@status_window.update
if @actor_command_window.active and @actor_command_window.y > 0
@actor_command_window.y -= 8
@status_window.y -= 8
if $game_troop.preemptive
success = true
else
success = (rand(100) < @escape_ratio)
end
Sound.play_escape
if success
#=============================
@cp_battle.dispose
#=============================
for battler in $game_party.members
battler.cp = 0
#=========================
battler.Battler_turn = 0
battler.turn_start = 0
#=========================
end
battle_end(1)
else
@escape_ratio += 10
#@active_battler.cp = 0
@active_battler.action.clear
next_actor
end
end
#========================================
#★胜利处理
#========================================
def process_victory
@message_window.visible = false
@info_viewport.visible = false
RPG::BGM.stop
$game_system.battle_end_me.play
for battler in $game_troop.members
if battler.dead?
if @cp_battle.cp_battler.include?(battler)
@cp_battle.cp_battler[battler].collapse = true
next
end
end
end
@cp_battle.cp_battler.each{|key,value|
if value.disposed?
@cp_battler.delete(key)
next
end
value.update}
#=============================
@cp_battle.dispose
#=============================
for battler in $game_party.members
#=========================
battler.Battler_turn = 0
battler.turn_start = 0
#=========================
battler.cp = 0
end
unless $BTEST
$game_temp.map_bgm.play
$game_temp.map_bgs.play
end
display_exp_and_gold
display_drop_items
display_level_up
battle_end(0)
end
#=================================
#★失败处理
#=================================
def process_defeat
@message_window.visible = false
@cp_battle.dispose
for battler in $game_party.members + $game_troop.members
#=========================
battler.Battler_turn = 0
battler.turn_start = 0
#=========================
battler.cp = 0
end
@info_viewport.visible = false
battle_end(2)
end
#=====================================
# ★ 执行画面转换
#=====================================
def update_scene_change
case $game_temp.next_scene
when "map"
dispose_cp_battle
call_map
when "gameover"
dispose_cp_battle
call_gameover
when "title"
dispose_cp_battle
call_title
else
$game_temp.next_scene = nil
end
end
#=============================================================================
#★CP战斗的主要刷新★
#=============================================================================
while @action_battlers.size != 0 and judge_win_loss == false
process_action
#process_battle_event
end
@cp_battle.stop = false
#=============================
end
#=====================================
#★行动顺序生成
#=====================================
def make_action_orders
@action_battlers = []
unless $game_troop.surprise
@action_battlers += @actor_battler if @actor_battler.size != 0
end
unless $game_troop.preemptive
@action_battlers += @enemy_battler if @enemy_battler.size != 0
end
for battler in @action_battlers
battler.action.make_speed
end
@action_battlers.sort! do |a,b|
b.action.speed - a.action.speed
end
end
#====================================
#★战斗行动处理
#====================================
def process_action
return if judge_win_loss
return if $game_temp.next_scene != nil
set_next_active_battler
return if @active_battler == nil
return if @active_battler.dead?
user = @active_battler.action.skill_user
if skill.animation2_id != 0
display_animation(user,skill.animation2_id)
end
display_animation(targets, skill.animation_id)
wait_for_animation
@active_battler.mp -= @active_battler.calc_mp_cost(skill)
$game_temp.common_event_id = skill.common_event_id
for target in targets
target.skill_effect(@active_battler, skill)
display_action_effects(target, skill)
end
#=====================
#@active_battler.cp = 0
#=====================
end
end
alias oldstart_item_selection start_item_selection
def start_item_selection
oldstart_item_selection
@item_window.z=3000
@item_window.help_window.z = 3000
end
#=================================
#★刷新
#=================================
def update
super
if @battler == nil
self.bitmap = nil
else
@use_sprite = @battler.use_sprite?
if @use_sprite
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
update_battler_bitmap
if @battler.act_status == 1
if self.opacity <280
self.opacity += 20
end
elsif @battler.act_status == -1
if self.opacity > 125
self.opacity -= 20
end
elsif (@battler.dead? or @battler.hidden) and @battler.collapse == false
else
self.opacity = 255
end
end
setup_new_effect
update_effect
end
end
#===============================
#
#===============================
def update_battler_bitmap
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue
@battler_name = @battler.battler_name
@battler_hue = @battler.battler_hue
self.bitmap = Cache.battler(@battler_name, @battler_hue)
@width = bitmap.width
@height = bitmap.height
self.ox = @width / 2
self.oy = @height
if (@battler.dead? or @battler.hidden) and @battler.collapse == false
end
end
if @battler.is_a?(Game_Actor)
count = 40
else
count = 44
end
if Graphics.frame_count%count <= 19
self.bitmap = Cache.battler(@battler_name,@battler_hue)
@width = bitmap.width
@height = bitmap.height
self.ox = @width / 2
self.oy = @height
else
b_name = @battler_name + "待"
if FileTest.exist?("Graphics/Battlers/#{b_name}.png") or FileTest.exist?("Graphics/Battlers/#{b_name}.jpg") or FileTest.exist?("Graphics/Battlers/#{b_name}.bmp")
self.bitmap = Cache.battler(b_name,@battler_hue)
@width = bitmap.width
@height = bitmap.height
self.ox = @width/2
self.oy = @height
end
end
end
#==================================
#
#==================================
def setup_new_effect
if @battler.white_flash
@effect_type = WHITEN
@effect_duration = 16
@battler.white_flash = false
end
if @battler.blink
@effect_type = BLINK
@effect_duration = 20
@battler.blink = false
end
if not @battler_visible and @battler.exist?
@effect_type = APPEAR
@effect_duration = 16
@battler_visible = true
end
if @battler.damage_pop and not (@battler.collapse or @battler.hidden)
if @battler.damage != nil
s_1 = @battler.damage > 0 ? 0 : 1
@battler.damage = @battler.damage > 0 ? [email protected] : @battler.damage
end
damage(@battler.damage,@battler.critical,s_1) if @battler.damage != 0 and @battler.damage != nil
damage(@battler.hp_damage,@battler.critical,0) if @battler.hp_damage != 0
damage(@battler.mp_damage,@battler.critical,1) if @battler.mp_damage != 0
damage("失误",@battler.critical) if @battler.missed
damage("MISS",@battler.critical) if @battler.evaded
damage(@battler.slip_damage - @battler.auto_damage,@battler.critical) if @battler.slip_damage != 0 or @battler.auto_damage != 0
@battler.slip_damage = 0
@battler.auto_damage = 0
@battler.damage = nil
@battler.damage_pop = false
end
if @battler_visible and @battler.hidden
@effect_type = DISAPPEAR
@effect_duration = 32
@battler_visible = false
end
if @battler.collapse and self.opacity != 0
@effect_type = COLLAPSE
@effect_duration = 48
@battler.collapse = false
@battler_visible = false
end
if @battler.animation_id != 0 and @battler.collapse == false
self.opacity = 255
animation = $data_animations[@battler.animation_id]
mirror = @battler.animation_mirror
start_animation(animation, mirror)
@battler.animation_id = 0
end
end
#=========================================
#
#=========================================
end #class
#=================================================
#★处理战斗行动的类
#=================================================
class Game_BattleAction
#==========================================================================
#==========================================================================
#==========================================================================
#★定义角色战斗图 X 坐标
#==========================================================================
def screen_x
if self.index != nil
case index
when 0
return 400
when 1
return 460
when 2
return 420
when 3
return 400
end
else
return 0
end
end
#========================================================================
#★定义角色战斗图 Y 坐标
#========================================================================
def screen_y
if self.index != nil
case index
when 0
return 290
when 1
return 240
when 2
return 185
when 3
return 155
end
else
return 230
end
end
#========================================================================
#★定义角色战斗图 Z 坐标
#========================================================================
def screen_z
if self.index != nil
return 4 - self.index
else
return 0
end
end
def use_sprite?
return true
end
end#class
#==========================================================
#★模块定义
#==========================================================
module RPG
class BaseItem
def animation2_id
return @note != nil ? @note.to_i : 0
end
end
class Enemy
def animation1_id
animation1_id = @note.split(/,/)[0]
return animation1_id != nil ? animation1_id.to_i : 0
end
def animation2_id
animation2_id = @note.split(/,/)[1]
return animation2_id != nil ? animation2_id.to_i : 0
end
end
if @item_name[itn.name]==nil
@item_name[itn.name]=[0,""]
@item_name[itn.name][1]=itn.icon_index
m+=1
end
@item_name[itn.name][0] += 1
end
end
if @gold>0
m+=1
end
super(200,100, 160,32*m+112 )
self.opacity = 150
class Game_Interpreter
#===========================================================================
#☆角色显示动画方法
#○range:动画影响范围,-1全体或相应角色id
#●anim_id:动画id
#===========================================================================
def add_aa(range,anim_id)
iterate_battler(1,range) do |battler|
next unless battler.exist?
battler.animation_id = anim_id
end