Tools - Script Editor - Sopra Main dovrete creare 1 nuova voce di nome New Battle
dopodiche scrivete questo:
#========================================================= =====================
# New_Battle
#------------------------------------------------------------------------------
# Compiled By : MakirouAru
#========================================================= =====================
# ������ XRXS_BP 3. ����HP�� ver.1.01 ������
# by fukuyama, ��� �ݓy
# Battle_End_Recovery
#
# �퓬��̉��������W���[��
#
# Request: stay
# Script: fukuyama
# Test: �m�R�mq
#
# URL: http://www4.big.or.jp/~fukuyama/rgss...d_Recovery.txt
#
module Battle_End_Recovery
module Scene_Battle_Module
# ��������ID
@@recovery_rate_variable_id = nil
# ����擾
def battle_end_recovery_rate
if @@recovery_rate_variable_id.nil?
@@recovery_rate_variable_id =
$data_system.variables.index '�퓬��̉�'
if @@recovery_rate_variable_id.nil?
@@recovery_rate_variable_id = false
end
end
return 0 unless @@recovery_rate_variable_id
return $game_variables[@@recovery_rate_variable_id]
end
# �퓬��̉�����
def battle_end_recovery
# ��
recovery_rate = battle_end_recovery_rate
# ���������O�ȊO���A�N�^�[���������Ă��������A�퓬��̉��������s��
if recovery_rate != 0 and not actor.dead?
# �p�[�e�B�̃A�N�^�[���Ƀ��[�v
$game_party.actors.each do |actor|
# �ʌvZ
recovery_hp = (actor.maxhp / 100.0 * recovery_rate).truncate
recovery_sp = (actor.maxsp / 100.0 * recovery_rate).truncate
# ��ۂɉ�
actor.hp += recovery_hp
actor.sp += recovery_sp
# �A�j���[�V�����ݒ�
actor.damage = - recovery_hp
actor.damage_pop = true
end
# �X�e�[�^�X�E�B���h�E���X�V
@status_window.refresh
end
end
end # module Scene_Battle_Module
end # module Battle_End_Recovery
#------------------------------
# �퓬�V�[�����Ē�
#------------------------------
class Scene_Battle
# Scene_Battle�p���W���[����C���N���[�h
include Battle_End_Recovery::Scene_Battle_Module
# ���̃t�F�[�Y�T�Jn�ɕʖ������
alias battle_end_recovery_original_start_phase5 start_phase5
# �t�F�[�Y�T�Jn���Ē�
def start_phase5
# �퓬��̉�������Ă��o��
battle_end_recovery
# ���̃t�F�[�Y�T�Jn��Ă��o��
battle_end_recovery_original_start_phase5
end
end
# Battle_End_Recovery
# ������ XRXS_BP10. LEVEL UP!�E�B���h�E ������
# by ��� �ݓy
$data_system_level_up_se = "" # ���x���A�b�vSE�B""�Ŗ����B
$data_system_level_up_me = "Audio/ME/007-Fanfare01" # ���x���A�b�vME
#========================================================= =====================
# �� Window_LevelUpWindow
#------------------------------------------------------------------------------
# �@�o�g���I���A���x���A�b�v���������ɃX�e�[�^�X��\�����E�B���h�E�ł��B
#========================================================= =====================
class Window_LevelUpWindow < Window_Base
#--------------------------------------------------------------------------
# �� �I�u�W�F�N�g����
#--------------------------------------------------------------------------
def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
super(0, 128, 160, 192)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
end
#--------------------------------------------------------------------------
# �� ���t���b�V��
#--------------------------------------------------------------------------
def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
self.contents.clear
self.contents.font.color = system_color
self.contents.font.name = "Arial"
self.contents.font.size = 14
self.contents.draw_text( 0, 0, 160, 24, "LEVEL UP!!")
self.contents.font.size = 18
self.contents.draw_text( 0, 28, 160, 24, $data_system.words.hp)
self.contents.draw_text( 0, 50, 160, 24, $data_system.words.sp)
self.contents.font.size = 14
self.contents.draw_text( 0, 72, 80, 24, $data_system.words.str)
self.contents.draw_text( 0, 94, 80, 24, $data_system.words.dex)
self.contents.draw_text( 0, 116, 80, 24, $data_system.words.agi)
self.contents.draw_text( 0, 138, 80, 24, $data_system.words.int)
self.contents.draw_text(92, 0, 128, 24, "��")
self.contents.draw_text(76, 28, 128, 24, "=")
self.contents.draw_text(76, 50, 128, 24, "=")
self.contents.draw_text(76, 72, 128, 24, "=")
self.contents.draw_text(76, 94, 128, 24, "=")
self.contents.draw_text(76, 116, 128, 24, "=")
self.contents.draw_text(76, 138, 128, 24, "=")
self.contents.font.color = normal_color
self.contents.draw_text( 0, 0, 88, 24, last_lv.to_s, 2)
self.contents.draw_text( 0, 28, 72, 24, "+" + up_hp.to_s, 2)
self.contents.draw_text( 0, 50, 72, 24, "+" + up_sp.to_s, 2)
self.contents.draw_text( 0, 72, 72, 24, "+" + up_str.to_s, 2)
self.contents.draw_text( 0, 94, 72, 24, "+" + up_dex.to_s, 2)
self.contents.draw_text( 0, 116, 72, 24, "+" + up_agi.to_s, 2)
self.contents.draw_text( 0, 138, 72, 24, "+" + up_int.to_s, 2)
self.contents.font.size = 20
self.contents.draw_text( 0, 0, 128, 24, actor.level.to_s, 2)
self.contents.draw_text( 0, 26, 128, 24, actor.maxhp.to_s, 2)
self.contents.draw_text( 0, 48, 128, 24, actor.maxsp.to_s, 2)
self.contents.draw_text( 0, 70, 128, 24, actor.str.to_s, 2)
self.contents.draw_text( 0, 92, 128, 24, actor.dex.to_s, 2)
self.contents.draw_text( 0, 114, 128, 24, actor.agi.to_s, 2)
self.contents.draw_text( 0, 136, 128, 24, actor.int.to_s, 2)
end
end
#========================================================= =====================
# �� Window_BattleStatus
#========================================================= =====================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# �� �lj��E��J�C���X�^���X����
#--------------------------------------------------------------------------
attr_accessor :level_up_flags # LEVEL UP!�\�
end
#========================================================= =====================
# �� Game_Battler
#========================================================= =====================
class Game_Battler
#--------------------------------------------------------------------------
# �� �lj��E��J�C���X�^���X����
#--------------------------------------------------------------------------
attr_accessor :exp_gain_ban # EXP擾����~
#--------------------------------------------------------------------------
# �� �I�u�W�F�N�g����
#--------------------------------------------------------------------------
alias xrxs_bp10_initialize initialize
def initialize
@exp_gain_ban = false
xrxs_bp10_initialize
end
#--------------------------------------------------------------------------
# �� �X�e�[�g [EXP ��l���ł��Ȃ�] ����
#--------------------------------------------------------------------------
alias xrxs_bp10_cant_get_exp? cant_get_exp?
def cant_get_exp?
if @exp_gain_ban == true
return true
else
return xrxs_bp10_cant_get_exp?
end
end
end
#========================================================= =====================
# �� Scene_Battle
#========================================================= =====================
class Scene_Battle
#--------------------------------------------------------------------------
# �� �A�t�^�[�o�g���t�F�[�Y�Jn
#--------------------------------------------------------------------------
alias xrxs_bp10_start_phase5 start_phase5
def start_phase5
# EXP �l����~
for i in 0...$game_party.actors.size
$game_party.actors[i].exp_gain_ban = true
end
xrxs_bp10_start_phase5
# EXP �l����~�̉���
for i in 0...$game_party.actors.size
$game_party.actors[i].exp_gain_ban = false
end
# EXP������
@exp_gained = 0
for enemy in $game_troop.enemies
# �l�� EXP��lj� # �G�l�~�[���B����ԂłȂ�����
@exp_gained += enemy.exp if not enemy.hidden
end
# �ݒ�
@phase5_step = 0
@exp_gain_actor = -1
# ���U���g�E�B���h�E��\�
@result_window.y -= 64
@result_window.visible = true
# ���x���A�b�v�����
phase5_next_levelup
end
#--------------------------------------------------------------------------
# �� �t���[���X�V (�A�t�^�[�o�g���t�F�[�Y)
#--------------------------------------------------------------------------
alias xrxs_bp10_update_phase5 update_phase5
def update_phase5
case @phase5_step
when 1
update_phase5_step1
else
xrxs_bp10_update_phase5
# ���x���A�b�v���Ă��������͋����o�g���I��
battle_end(0) if @levelup_window != nil and @phase5_wait_count <= 0
end
end
#--------------------------------------------------------------------------
# �� �t���[���X�V (�A�t�^�[�o�g���t�F�[�Y 1 : ���x���A�b�v)
#--------------------------------------------------------------------------
def update_phase5_step1
# C �{�^���������ꂽ����
if Input.trigger?(Input::C)
# �E�B���h�E�������̃A�N�^�[��
@levelup_window.visible = false if @levelup_window != nil
@status_window.level_up_flags[@exp_gain_actor] = false
phase5_next_levelup
end
end
#--------------------------------------------------------------------------
# �� ��̃A�N�^�[�̃��x���A�b�v�\���
#--------------------------------------------------------------------------
def phase5_next_levelup
begin
# ��̃A�N�^�[��
@exp_gain_actor += 1
# �Ō�̃A�N�^�[������
if @exp_gain_actor >= $game_party.actors.size
# �A�t�^�[�o�g���t�F�[�Y�Jn
@phase5_step = 0
return
end
actor = $game_party.actors[@exp_gain_actor]
if actor.cant_get_exp? == false
# ���݂̔\�͒l����
last_level = actor.level
last_maxhp = actor.maxhp
last_maxsp = actor.maxsp
last_str = actor.str
last_dex = actor.dex
last_agi = actor.agi
last_int = actor.int
# �o���l擾�̌���I�u��(��
actor.exp += @exp_gained
# ����
if actor.level > last_level
# ���x���A�b�v��������
@status_window.level_up(@exp_gain_actor)
if $data_system_level_up_se != ""
Audio.se_stop
Audio.se_play($data_system_level_up_se)
end
if $data_system_level_up_me != ""
Audio.me_stop
Audio.me_play($data_system_level_up_me)
end
@levelup_window = Window_LevelUpWindow.new(actor, last_level,
actor.maxhp - last_maxhp, actor.maxsp - last_maxsp, actor.str - last_str,
actor.dex - last_dex, actor.agi - last_agi, actor.int - last_int)
@levelup_window.x = 160 * @exp_gain_actor
@levelup_window.visible = true
@phase5_wait_count = 40
@phase5_step = 1
# �X�e�[�^�X�E�B���h�E��t���b�V��
@status_window.refresh
return
end
end
end until false
end
end
# ������ XRXS_17. �X���b�v�_���[�W�h���^��ʗ����� ver.1.51 ������
# by ��� �ݓy, fukuyama
#========================================================= =====================
# �� Game_Battler
#========================================================= =====================
class Game_Battler
#--------------------------------------------------------------------------
# �� �X���b�v�_���[�W�̌�ʓK�p
#--------------------------------------------------------------------------
alias xrxs_bp7_slip_damage_effect slip_damage_effect
def slip_damage_effect
# ���l������
slip_damage_percent = 0
slip_damage_plus = 0
# ���ݕt�����Ă���X�e�[�g�̒�����X���b�v�_���[�W�L��̃��m��T��
for i in @states
if $data_states[i].slip_damage
# ���̃X�e�[�g�����Ă���X���b�v�_���[�W��
# Lv�v���X�X�e�[�g�܂���Lv�}�C�i�X�X�e�[�g���B
for j in $data_states[i].plus_state_set
if $data_states[j] != nil
if $data_states[j].name =~ /^�X���b�v([0-9]+)(%|��)/
slip_damage_percent += $1.to_i
elsif $data_states[j].name =~ /^�X���b�v([0-9]+)$/
slip_damage_plus += $1.to_i
end
end
end
for j in $data_states[i].minus_state_set
if $data_states[j] != nil
if $data_states[j].name =~ /^�X���b�v([0-9]+)(%|��)/
slip_damage_percent -= $1.to_i
elsif $data_states[j].name =~ /^�X���b�v([0-9]+)$/
slip_damage_plus -= $1.to_i
end
end
end
end
end
if slip_damage_percent == 0 and slip_damage_plus == 0
xrxs_bp7_slip_damage_effect
else
# �h��X���b�v�h�䂪� ��������
for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
armor = $data_armors[i]
next if armor == nil
for j in armor.guard_state_set
if $data_states[j] != nil
if $data_states[j].name =~ /^�X���b�v([0-9]+)(%|��)/
if slip_damage_percent > 0
slip_damage_percent = [slip_damage_percent - $1.to_i, 0].max
end
end
if $data_states[j].name =~ /^�X���b�v([0-9]+)$/
if slip_damage_percent > 0
slip_damage_plus = [slip_damage_plus - $1.to_i, 0].max
end
end
end
end
end
# �_���[�W���ݒ�
self.damage = self.maxhp * slip_damage_percent / 100 + slip_damage_plus
# ��U
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# HP ����_���[�W��Z
self.hp -= self.damage
# ���\�b�h�I��
return true
end
end
end
# ������ XRXS_BP 1. CP������ ver.15 ������
# by ��� �ݓy, �a��, Jack-R
#========================================================= =====================
# �� Scene_Battle_CP
#========================================================= =====================
class Scene_Battle_CP
#--------------------------------------------------------------------------
# �� ��J�C���X�^���X����
#--------------------------------------------------------------------------
attr_accessor :stop # CP��Z�X�g�b�v
#----------------------------------------------------------------------------
# �� �I�u�W�F�N�g������
#----------------------------------------------------------------------------
def initialize
@battlers = []
@cancel = false
@agi_total = 0
# �z�� @count_battlers ������
@count_battlers = []
# �G�l�~�[��z�� @count_battlers �ɒlj�
for enemy in $game_troop.enemies
@count_battlers.push(enemy)
end
# �A�N�^�[��z�� @count_battlers �ɒlj�
for actor in $game_party.actors
@count_battlers.push(actor)
end
for battler in @count_battlers
@agi_total += battler.agi
end
for battler in @count_battlers
battler.cp = [[65535 * (rand(15) + 85) / 100 * battler.agi / @agi_total * 4, 0].max, 65535].min
end
end
#----------------------------------------------------------------------------
# �� CP�J�E���g�̊Jn
#----------------------------------------------------------------------------
def start
if @cp_thread != nil then
return
end
@cancel = false
@stop = false
# ��������X���b�h
@cp_thread = Thread.new do
while @cancel != true
if @stop != true
self.update # �X�V
sleep(0.05)
end
end
end
# �����܂ŃX���b�h
end
#----------------------------------------------------------------------------
# �� CP�J�E���g�A�b�v
#----------------------------------------------------------------------------
def update
if @count_battlers != nil then
for battler in @count_battlers
# �s���o���Ȃ���Ζ��
if battler.dead? == true #or battler.movable? == false then
battler.cp = 0
next
end
# ������ 1.3��ς��邱�Ƃ����X�s�[�h����X�\�B�����������_��g�p���邱���B
battler.cp = [[battler.cp + 1.3 * 4096 * battler.agi / @agi_total, 0].max, 65535].min
end
end
end
#----------------------------------------------------------------------------
# �� CP�J�E���g�̊Jn
#----------------------------------------------------------------------------
def stop
@cancel = true
if @cp_thread != nil then
@cp_thread.join
@cp_thread = nil
end
end
end
#========================================================= =====================
# �� Game_Battler
#========================================================= =====================
class Game_Battler
attr_accessor :now_guarding # ���ݖh�䒆�t���O
attr_accessor :cp # ����CP
attr_accessor :slip_state_update_ban # �X���b�v�E�X�e�[�g��������̋�~
#--------------------------------------------------------------------------
# �� �R�}���h��͉\����
#--------------------------------------------------------------------------
def inputable?
return (not @hidden and restriction <= 1 and @cp >=65535)
end
#--------------------------------------------------------------------------
# �� �X�e�[�g [�X���b�v�_���[�W] ����
#--------------------------------------------------------------------------
alias xrxs_bp1_slip_damage? slip_damage?
def slip_damage?
return false if @slip_state_update_ban
return xrxs_bp1_slip_damage?
end
#--------------------------------------------------------------------------
# �� �X�e�[�g��R���� (�^�[�����ƂɌĂ��o��)
#--------------------------------------------------------------------------
alias xrxs_bp1_remove_states_auto remove_states_auto
def remove_states_auto
return if @slip_state_update_ban
xrxs_bp1_remove_states_auto
end
end
#========================================================= =====================
# �� Game_Actor
#========================================================= =====================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# �� �Z�b�g�A�b�v
#--------------------------------------------------------------------------
alias xrxs_bp1_setup setup
def setup(actor_id)
xrxs_bp1_setup(actor_id)
@hate = 100 # init-value is 100
@cp = 0
@now_guarding = false
@slip_state_update_ban = false
end
end
#========================================================= =====================
# �� Game_Enemy
#========================================================= =====================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# �� �I�u�W�F�N�g����
#--------------------------------------------------------------------------
alias xrxs_bp1_initialize initialize
def initialize(troop_id, member_index)
xrxs_bp1_initialize(troop_id, member_index)
@hate = 100 # init-value is 100
@cp = 0
@now_guarding = false
@slip_state_update_ban = false
end
end