Group: Member
Posts: 29
Type: Scripter
RM Skill: Intermediate
Break Gauge
Version 1.1 Author DrDhoom Release Date 04/03/2012
Introduction Based on a request by Raisuki, add battle advantage system that can increasing/decreasing the player or enemy by state.
Features * Different amount of bar to add for Player and Enemy * Give state to the advantage battler, so you can set it to have positive or negative effect and element ressistance
Script
Script
CODE
#=============================================================================== #-----------------------=�€� Break Gauge Chaos Ring �€�=---------------------------- #---------------------------=�€� by: DrDhoom �€�=----------------------------------- # Version: 1.1 # Date Published: 04 - 03 - 2012 # Battle Addon # RRR Community (Requested by Raisuki) #------------------------------------------------------------------------------- # Changelog: # v1.1 04/03/2012 # �€� Player Party or Enemy Troop not taking damage doesn't added bar, FIXED #------------------------------------------------------------------------------- # How to use: # - Insert this script above Main #===============================================================================
#-Player- #1. The player attacks first at the start of the battle, gauge changes from "Even" to "Player" #2. The player's first strike is a critical hit, gauge changes from "Even" to "Player" #3. Player's first strike is a critical hit and defeats the enemy, gauge changes from "Even" to "Player" #4. Player defeats an enemy on any other turn #5. Player makes it through the enemy's turn without taking damage #6. Player is attacked by an enemy while the gauge is at "Player" #7. A party member is defeated by an enemy while the gauge is at "Player"
#~Enemy- #1. The enemy attacks first at the start of the battle, gauge changes from "Even" to "Enemy" #2. The enemy's first strike is a critical hit, gauge changes from "Even" to "Enemy" #3. Enemy's first strike is a critical hit and defeats the enemy, gauge changes from "Even" to "Enemy" #4. Enemy defeats an party member on any other turn #5. Enemies makes it through the player's turn without taking damage #6. Enemy is attacked by an party member while the gauge is at "Enemy" #7. An enemy is defeated by an party member while the gauge is at "Enemy"
#-Other- #1. All bars are depleted from either "Player" or "Enemy", added to the opposing side #2. A skill is used that specifically drains bars from the opposing favor but normal damage otherwise (E.G. Player uses skill during a time when the gauge is displayed as "Enemy"), added to the opposing favor
#How much amount added to bar based on specified actions CALC_BAR_PLAYER = [4,5,7,1,1,-1,-4] CALC_BAR_ENEMY = [4,5,7,1,1,-1,-4] CALC_BAR_OTHER = [4,-2]
#State ID to added to Player or Enemy states based on Gauge Side STAT_ID = 17
#Display Setting CIRCLE_COOR = [6, 6] BREAK_COOR = [0,0] BREAK_ME = "Victory1" end end
def update_graphics if @bar != 0 @barspr.bitmap = Cache.system("chaos_"+@bar.to_s) else @barspr.bitmap = Bitmap.new(74,74) end case @way when 0 @text.bitmap = Cache.system("chaos_even") when 1 @text.bitmap = Cache.system("chaos_player") when 2 @text.bitmap = Cache.system("chaos_enemy") end @barspr.x = @x @barspr.y = @y @circle.x = @x @circle.y = @y @text.x = @x @text.y = @y @tmp_x = @x @tmp_y = @y @tmp_bar = @bar @tmp_way = @way end end
class Scene_Battle < Scene_Base
include Dhoom::BreakGaugeChaos
alias dhoom_battle_update_break update alias dhoom_battle_crt_inf_viewport create_info_viewport alias dhoom_battle_disp_inf_viewport dispose_info_viewport alias dhoom_battle_turn_end turn_end
def update super if @break_gauge.break? @break_gauge.update_break update_basic(true) update_info_viewport return else @break_gauge.update end for actor in $game_party.members if @break_gauge.way == 1 actor.add_state(STAT_ID) else actor.remove_state(STAT_ID) end end for enemy in $game_troop.members if @break_gauge.way == 2 enemy.add_state(STAT_ID) else enemy.remove_state(STAT_ID) end end dhoom_battle_update_break end
def dispose_info_viewport dhoom_battle_disp_inf_viewport @break_gauge.dispose end
def turn_end @turn += 1 check_battler if @no_dmg_player >= @troop_size @break_gauge.bar += CALC_BAR_PLAYER[4] end if @no_dmg_enemy >= @party_size @break_gauge.bar -= CALC_BAR_ENEMY[4] end @no_dmg_player = 0 @no_dmg_enemy = 0 dhoom_battle_turn_end end
def check_battler @troop_size = 0 @party_size = 0 for actor in $game_party.members if !actor.dead? @party_size += 1 end end for enemy in $game_troop.members if !enemy.dead? @troop_size += 1 end end end
def execute_action_attack text = sprintf(Vocab::DoAttack, @active_battler.name) @message_window.add_instant_text(text) targets = @active_battler.action.make_targets display_attack_animation(targets) wait(20) for target in targets target.attack_effect(@active_battler) display_action_effects(target) end for target in targets if target.actor? if target.hp_damage == 0 || target.missed || target.evaded @no_dmg_player += 1 end else if target.hp_damage == 0 || target.missed || target.evaded @no_dmg_enemy += 1 end end return if target.missed return if target.evaded return if target.hp_damage == 0 if @first_strike if @active_battler.actor? @break_gauge.way = 1 @first_strike = false if target.critical and target.dead? @break_gauge.bar += CALC_BAR_PLAYER[2] elsif target.critical @break_gauge.bar += CALC_BAR_PLAYER[1] else @break_gauge.bar += CALC_BAR_PLAYER[0] end else @break_gauge.way = 2 @first_strike = false if target.critical and target.dead? @break_gauge.bar -= CALC_BAR_PLAYER[2] elsif target.critical @break_gauge.bar -= CALC_BAR_PLAYER[1] else @break_gauge.bar -= CALC_BAR_PLAYER[0] end end else if @active_battler.actor? if target.dead? if @break_gauge.way == 1 @break_gauge.bar += CALC_BAR_PLAYER[3] elsif @break_gauge.way == 2 @break_gauge.bar -= CALC_BAR_ENEMY[6] end else if @break_gauge.way == 2 @break_gauge.bar -= CALC_BAR_PLAYER[5] end end else if target.dead? if @break_gauge.way == 2 @break_gauge.bar -= CALC_BAR_ENEMY[3] elsif @break_gauge.way == 1 @break_gauge.bar += CALC_BAR_PLAYER[6] end else if @break_gauge.way == 1 @break_gauge.bar += CALC_BAR_ENEMY[5] end end end end end end
def execute_action_skill skill = @active_battler.action.skill text = @active_battler.name + skill.message1 @message_window.add_instant_text(text) unless skill.message2.empty? wait(10) @message_window.add_instant_text(skill.message2) end targets = @active_battler.action.make_targets display_animation(targets, skill.animation_id) @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 targets = @active_battler.action.make_targets for target in targets return if target.missed return if target.evaded end if @active_battler.actor? and @break_gauge.way == 2 @break_gauge.bar += CALC_BAR_OTHER[1] elsif @break_gauge.way == 1 @break_gauge.bar -= CALC_BAR_OTHER[1] end end end
Tankentai Version (Thanks to Raisuki )
Script
CODE
#=============================================================================== #-----------------------=�€� Break Gauge Chaos Ring �€�=---------------------------- #---------------------------=�€� by: DrDhoom �€�=----------------------------------- # Version: 1.1 (Tankentai Ver.) # Date Published: 04 - 03 - 2012 # Battle Addon # RRR Community (Requested by Raisuki) #------------------------------------------------------------------------------- # Changelog: # v1.1 04/03/2012 # �€� Player Party or Enemy Troop not taking damage doesn't added bar, FIXED #------------------------------------------------------------------------------- # How to use: # - Insert this script above Main #===============================================================================
#-Player- #1. The player attacks first at the start of the battle, gauge changes from "Even" to "Player" #2. The player's first strike is a critical hit, gauge changes from "Even" to "Player" #3. Player's first strike is a critical hit and defeats the enemy, gauge changes from "Even" to "Player" #4. Player defeats an enemy on any other turn #5. Player makes it through the enemy's turn without taking damage #6. Player is attacked by an enemy while the gauge is at "Player" #7. A party member is defeated by an enemy while the gauge is at "Player"
#~Enemy- #1. The enemy attacks first at the start of the battle, gauge changes from "Even" to "Enemy" #2. The enemy's first strike is a critical hit, gauge changes from "Even" to "Enemy" #3. Enemy's first strike is a critical hit and defeats the enemy, gauge changes from "Even" to "Enemy" #4. Enemy defeats an party member on any other turn #5. Enemies makes it through the player's turn without taking damage #6. Enemy is attacked by an party member while the gauge is at "Enemy" #7. An enemy is defeated by an party member while the gauge is at "Enemy"
#-Other- #1. All bars are depleted from either "Player" or "Enemy", added to the opposing side #2. A skill is used that specifically drains bars from the opposing favor but normal damage otherwise (E.G. Player uses skill during a time when the gauge is displayed as "Enemy"), added to the opposing favor
#How much amount added to bar based on specified actions CALC_BAR_PLAYER = [4,5,7,1,1,-1,-4] CALC_BAR_ENEMY = [4,5,7,1,1,-1,-4] CALC_BAR_OTHER = [4,-2]
#State ID to added to Player or Enemy states based on Gauge Side STAT_ID = 17
#Display Setting CIRCLE_COOR = [6, 6] BREAK_COOR = [0,0] BREAK_ME = "Victory1" end end
def update_graphics if @bar != 0 @barspr.bitmap = Cache.system("chaos_"+@bar.to_s) else @barspr.bitmap = Bitmap.new(74,74) end case @way when 0 @text.bitmap = Cache.system("chaos_even") when 1 @text.bitmap = Cache.system("chaos_player") when 2 @text.bitmap = Cache.system("chaos_enemy") end @barspr.x = @x @barspr.y = @y @circle.x = @x @circle.y = @y @text.x = @x @text.y = @y @tmp_x = @x @tmp_y = @y @tmp_bar = @bar @tmp_way = @way end end
class Scene_Battle < Scene_Base
include Dhoom::BreakGaugeChaos
alias dhoom_battle_update_break update alias dhoom_battle_crt_inf_viewport create_info_viewport alias dhoom_battle_disp_inf_viewport dispose_info_viewport alias dhoom_battle_turn_end turn_end
def update super if @break_gauge.break? @break_gauge.update_break update_basic(true) update_info_viewport return else @break_gauge.update end for actor in $game_party.members if @break_gauge.way == 1 actor.add_state(STAT_ID) else actor.remove_state(STAT_ID) end end for enemy in $game_troop.members if @break_gauge.way == 2 enemy.add_state(STAT_ID) else enemy.remove_state(STAT_ID) end end dhoom_battle_update_break end
def dispose_info_viewport dhoom_battle_disp_inf_viewport @break_gauge.dispose end
def turn_end @turn += 1 check_battler if @no_dmg_player >= @troop_size @break_gauge.bar += CALC_BAR_PLAYER[4] end if @no_dmg_enemy >= @party_size @break_gauge.bar -= CALC_BAR_ENEMY[4] end @no_dmg_player = 0 @no_dmg_enemy = 0 dhoom_battle_turn_end end
def check_battler @troop_size = 0 @party_size = 0 for actor in $game_party.members if !actor.dead? @party_size += 1 end end for enemy in $game_troop.members if !enemy.dead? @troop_size += 1 end end end
def execute_action_attack targets = @active_battler.action.make_targets if @active_battler.actor? if @active_battler.weapon_id == 0 action = @active_battler.non_weapon # ��Œ�‹•中に死なな��„�‚ˆ��†�ƒ��ƒ��ƒ �ƒ��…��“��‚’不死身�Œ– immortaling else action = $data_weapons[@active_battler.weapon_id].base_action # �ˆ��—˜不�ƒ���˜��Žの武�™�で不死身設�� �‚’�ˆ†岐 if $data_weapons[@active_battler.weapon_id].state_set.include?(1) for member in $game_party.members + $game_troop.members next if member.immortal next if member.dead? member.dying = true end else immortaling end end else if @active_battler.weapon == 0 action = @active_battler.base_action immortaling else action = $data_weapons[@active_battler.weapon].base_action if $data_weapons[@active_battler.weapon].state_set.include?(1) for member in $game_party.members + $game_troop.members next if member.immortal next if member.dead? member.dying = true end else immortaling end end end target_decision @spriteset.set_action(@active_battler.actor?, @active_battler.index, action) playing_action for target in targets if target.actor? if target.hp_damage == 0 || target.missed || target.evaded @no_dmg_player += 1 end else if target.hp_damage == 0 || target.missed || target.evaded @no_dmg_enemy += 1 end end return if target.missed return if target.evaded return if target.hp_damage == 0 if @first_strike if @active_battler.actor? @break_gauge.way = 1 @first_strike = false if target.critical and target.dead? @break_gauge.bar += CALC_BAR_PLAYER[2] elsif target.critical @break_gauge.bar += CALC_BAR_PLAYER[1] else @break_gauge.bar += CALC_BAR_PLAYER[0] end else @break_gauge.way = 2 @first_strike = false if target.critical and target.dead? @break_gauge.bar -= CALC_BAR_PLAYER[2] elsif target.critical @break_gauge.bar -= CALC_BAR_PLAYER[1] else @break_gauge.bar -= CALC_BAR_PLAYER[0] end end else if @active_battler.actor? if target.dead? if @break_gauge.way == 1 @break_gauge.bar += CALC_BAR_PLAYER[3] elsif @break_gauge.way == 2 @break_gauge.bar -= CALC_BAR_ENEMY[6] end else if @break_gauge.way == 2 @break_gauge.bar -= CALC_BAR_PLAYER[5] end end else if target.dead? if @break_gauge.way == 2 @break_gauge.bar -= CALC_BAR_ENEMY[3] elsif @break_gauge.way == 1 @break_gauge.bar += CALC_BAR_PLAYER[6] end else if @break_gauge.way == 1 @break_gauge.bar += CALC_BAR_ENEMY[5] end end end end end end
def execute_action_skill skill = @active_battler.action.skill return unless @active_battler.action.valid? # 3.3d, Force action bug fix # �ˆ��—˜不�ƒ���˜��Žの�‚��‚��ƒ�で不 身設��š�‚’�ˆ†岐 if skill.plus_state_set.include?(1) for member in $game_party.members + $game_troop.members next if member.immortal next if member.dead? member.dying = true end else # ��Œ�‹•中に死なな��„�‚ˆ��†�ƒ��ƒ��ƒ �ƒ��…��“��‚’不死身�Œ– immortaling end # �‚��ƒ��‚��ƒƒ�ƒˆ決��š target_decision(skill) # �‚��‚��‚��ƒ��ƒ��–‹��‹ @spriteset.set_action(@active_battler.actor?, @active_battler.index, skill.base_action) # �ƒ˜�ƒ��ƒ—�‚��‚��ƒ��ƒ‰�‚�に�‚� ‚��ƒ�名表示 pop_help(skill) # �‚��‚��‚��ƒ��ƒ�中 playing_action # �‚��‚��ƒ��‚��‚��ƒˆ��ˆ費 @active_battler.consum_skill_cost(skill) # �‚��ƒ†�ƒ��‚��‚��‚��‚��ƒ��ƒ‰� ‚��‚’�ƒ��ƒ•�ƒ��ƒƒ�‚��ƒ� @status_window.refresh # �‚��ƒ��ƒ��‚��ƒ™�ƒ��ƒˆ��–��— $game_temp.common_event_id = skill.common_event_id targets = @active_battler.action.make_targets for target in targets return if target.missed return if target.evaded end if @active_battler.actor? and @break_gauge.way == 2 @break_gauge.bar += CALC_BAR_OTHER[1] elsif @break_gauge.way == 1 @break_gauge.bar -= CALC_BAR_OTHER[1] end end end
Customization Just see in the demo
Compatibility Created for VX default battle system, dont know if this is compatible for other Battle System
Group: Member
Posts: 6
Type: Event Designer
RM Skill: Intermediate
Wow, this is pretty cool. Just like one of my favorite iPhone games "Chaos Rings". I had actually been looking for the Chaos Rings Break Gauge system for a while, but I had given up until I found this. Thanks
Group: Member
Posts: 14
Type: Artist
RM Skill: Skilled
Through dumb luck (couldn't script to save my life), I seem to of made this work with the sideview battle system Tankentai 3.3d without messing up the animations.
If anyone wanted to know how. I changed this part of the Break Gauge script:
Break Gauge
CODE
def execute_action_attack text = sprintf(Vocab::DoAttack, @active_battler.name) @message_window.add_instant_text(text) targets = @active_battler.action.make_targets display_attack_animation(targets) wait(20) for target in targets target.attack_effect(@active_battler) display_action_effects(target) end for target in targets if target.actor? if target.hp_damage == 0 || target.missed || target.evaded @no_dmg_player += 1 end else if target.hp_damage == 0 || target.missed || target.evaded @no_dmg_enemy += 1 end end return if target.missed return if target.evaded return if target.hp_damage == 0 if @first_strike if @active_battler.actor? @break_gauge.way = 1 @first_strike = false if target.critical and target.dead? @break_gauge.bar += CALC_BAR_PLAYER[2] elsif target.critical @break_gauge.bar += CALC_BAR_PLAYER[1] else @break_gauge.bar += CALC_BAR_PLAYER[0] end else @break_gauge.way = 2 @first_strike = false if target.critical and target.dead? @break_gauge.bar -= CALC_BAR_PLAYER[2] elsif target.critical @break_gauge.bar -= CALC_BAR_PLAYER[1] else @break_gauge.bar -= CALC_BAR_PLAYER[0] end end else if @active_battler.actor? if target.dead? if @break_gauge.way == 1 @break_gauge.bar += CALC_BAR_PLAYER[3] elsif @break_gauge.way == 2 @break_gauge.bar -= CALC_BAR_ENEMY[6] end else if @break_gauge.way == 2 @break_gauge.bar -= CALC_BAR_PLAYER[5] end end else if target.dead? if @break_gauge.way == 2 @break_gauge.bar -= CALC_BAR_ENEMY[3] elsif @break_gauge.way == 1 @break_gauge.bar += CALC_BAR_PLAYER[6] end else if @break_gauge.way == 1 @break_gauge.bar += CALC_BAR_ENEMY[5] end end end end end end
def execute_action_skill skill = @active_battler.action.skill text = @active_battler.name + skill.message1 @message_window.add_instant_text(text) unless skill.message2.empty? wait(10) @message_window.add_instant_text(skill.message2) end targets = @active_battler.action.make_targets display_animation(targets, skill.animation_id) @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 targets = @active_battler.action.make_targets for target in targets return if target.missed return if target.evaded end if @active_battler.actor? and @break_gauge.way == 2 @break_gauge.bar += CALC_BAR_OTHER[1] elsif @break_gauge.way == 1 @break_gauge.bar -= CALC_BAR_OTHER[1] end end end
To:
Break Gauge
CODE
def execute_action_attack targets = @active_battler.action.make_targets if @active_battler.actor? if @active_battler.weapon_id == 0 action = @active_battler.non_weapon # 行動中に死なないようメンバー全員を不死身化 immortaling else action = $data_weapons[@active_battler.weapon_id].base_action # 戦闘不能付与の武器で不死身設定を分岐 if $data_weapons[@active_battler.weapon_id].state_set.include?(1) for member in $game_party.members + $game_troop.members next if member.immortal next if member.dead? member.dying = true end else immortaling end end else if @active_battler.weapon == 0 action = @active_battler.base_action immortaling else action = $data_weapons[@active_battler.weapon].base_action if $data_weapons[@active_battler.weapon].state_set.include?(1) for member in $game_party.members + $game_troop.members next if member.immortal next if member.dead? member.dying = true end else immortaling end end end target_decision @spriteset.set_action(@active_battler.actor?, @active_battler.index, action) playing_action for target in targets if target.actor? if target.hp_damage == 0 || target.missed || target.evaded @no_dmg_player += 1 end else if target.hp_damage == 0 || target.missed || target.evaded @no_dmg_enemy += 1 end end return if target.missed return if target.evaded return if target.hp_damage == 0 if @first_strike if @active_battler.actor? @break_gauge.way = 1 @first_strike = false if target.critical and target.dead? @break_gauge.bar += CALC_BAR_PLAYER[2] elsif target.critical @break_gauge.bar += CALC_BAR_PLAYER[1] else @break_gauge.bar += CALC_BAR_PLAYER[0] end else @break_gauge.way = 2 @first_strike = false if target.critical and target.dead? @break_gauge.bar -= CALC_BAR_PLAYER[2] elsif target.critical @break_gauge.bar -= CALC_BAR_PLAYER[1] else @break_gauge.bar -= CALC_BAR_PLAYER[0] end end else if @active_battler.actor? if target.dead? if @break_gauge.way == 1 @break_gauge.bar += CALC_BAR_PLAYER[3] elsif @break_gauge.way == 2 @break_gauge.bar -= CALC_BAR_ENEMY[6] end else if @break_gauge.way == 2 @break_gauge.bar -= CALC_BAR_PLAYER[5] end end else if target.dead? if @break_gauge.way == 2 @break_gauge.bar -= CALC_BAR_ENEMY[3] elsif @break_gauge.way == 1 @break_gauge.bar += CALC_BAR_PLAYER[6] end else if @break_gauge.way == 1 @break_gauge.bar += CALC_BAR_ENEMY[5] end end end end end end
def execute_action_skill skill = @active_battler.action.skill return unless @active_battler.action.valid? # 3.3d, Force action bug fix # 戦闘不能付与のスキルで不死身設定を分岐 if skill.plus_state_set.include?(1) for member in $game_party.members + $game_troop.members next if member.immortal next if member.dead? member.dying = true end else # 行動中に死なないようメンバー全員を不死身化 immortaling end # ターゲット決定 target_decision(skill) # アクション開始 @spriteset.set_action(@active_battler.actor?, @active_battler.index, skill.base_action) # ヘルプウインドウにスキル名表示 pop_help(skill) # アクション中 playing_action # スキルコスト消費 @active_battler.consum_skill_cost(skill) # ステータスウインドウをリフレッシュ @status_window.refresh # コモンイベント取得 $game_temp.common_event_id = skill.common_event_id targets = @active_battler.action.make_targets for target in targets return if target.missed return if target.evaded end if @active_battler.actor? and @break_gauge.way == 2 @break_gauge.bar += CALC_BAR_OTHER[1] elsif @break_gauge.way == 1 @break_gauge.bar -= CALC_BAR_OTHER[1] end end end
And have the Break Gauge script under the Tankentai 3.3d scripts.