Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #----------------------------------------------------------------------------|
- # |
- # + HungrySnake's Attack Formula + |
- # |
- #----------------------------------------------------------------------------|
- # |
- # This Script allows you to change the 'hit_damage' of your actors. It's |
- # simple, but effective! You can change it to what you want! |
- # |
- #----------------------------------------------------------------------------|
- # |
- # + Start Customization + |
- # |
- #----------------------------------------------------------------------------|
- module CONFIG
- # Formule for Damage = CHARACTER_ATTACK x DAMAGE(SEE BELOW) - CHARACHTER_
- # DEFENCE x DEFENCE(SEE BELOW)
- DAMAGE = 40 # Normal damage value = 4
- DEFENCE = 10 # Normal defence value = 1
- BASE_DAMAGE = false # Turn true to enable BASE_DAMAGE_VALUE
- BASE_DAMAGE_VALUE = 10 # Value for a Base Damage (damage you set without
- # using a formule).
- ENABLE_RANDOM_FORMULES = true # Turn to false if you don't want to switch
- # the formules each time a turn ends.
- # FOR THE ADVANCED ONES:
- # The system works like this:
- # The abbreviations are just for the description
- # ATTACK_POINTS_ACTOR = APA
- # "TOKENATK" = TA (EDIT BENEATH)
- # DAMAGE = DMG (EDIT ABOVE)
- # "TOKENDEF" = TD (EDIT BENEATH)
- # DEFENCE_POINTS_ACTOR = DPA
- # "TOKENDEF2" = TD2 (EDIT BENEATH)
- # DEFENCE = DEF (EDIT ABOVE)
- # "DMG_FORMULA = APA TA DMG TD DPA TD2 DEF"
- # MANUAL:
- # You can change the tokens beneath this, but you must set the TOKEN_ENABLE
- # of your Formule you want to change to "true".
- # You can choose between: *, /, +, - or other math tokens.
- # Example:
- # TOKEN_ENABLE1 = true
- # I am here enabling to turn the switch on to change the tokens in
- # Formule 2,
- # TOKENATK1 = /
- # TOKENDEF2 = *
- # TOKENDEF3 = +
- # You will get different hits each time you change
- # the tokens.
- DAMAGE_PROC1 = Proc.new { |attacker, target| attacker.atk * DAMAGE * target.def * DEFENCE }
- DAMAGE_PROC2 = Proc.new { |attacker, target| attacker.atk * DAMAGE - target.def * DEFENCE }
- DAMAGE_PROC3 = Proc.new { |attacker, target| attacker.atk * DAMAGE / target.def * DEFENCE }
- TOKEN_ENABLE = true
- TOKEN_ENABLE1 = true
- TOKEN_ENABLE2 = true
- =begin
- # Formule 1 Tokens:
- TOKEN_ENABLE = false # Preferably don't change if you don't know what u're doing.
- TOKENATK = * # Token for attack
- TOKENDEF = * # Token for defence
- TOKENDEF1 = * # Token for defence 1
- # Formule 2 Tokens:
- TOKEN_ENABLE1 = false # Preferably don't change if you don't know what u're doing.
- TOKENATK1 = * # Token for attack 1
- TOKENDEF2 = * # Token for defence 2
- TOKENDEF3 = * # Token for defence 3
- # Formule 3 Tokens:
- TOKEN_ENABLE2 = false # Preferably don't change if you don't know what u're doing.
- TOKENATK2 = * # Token for attack 2
- TOKENDEF4 = * # Token for defence 4
- TOKENDEF5 = * # Token for defence 5
- =end
- end
- #----------------------------------------------------------------------------|
- # |
- # + End Customization + |
- # |
- #----------------------------------------------------------------------------|
- class Game_Battler
- #----------------------------------------------------------------------------|
- # |
- # + Cleavage of Types of Formules + |
- # |
- #----------------------------------------------------------------------------|
- def make_attack_damage_value(attacker)
- if CONFIG::BASE_DAMAGE == true
- command_basedamage(attacker)
- else
- command_formuledamage(attacker)
- end
- end
- #----------------------------------------------------------------------------|
- # |
- # + Formule Damage 1 + |
- # |
- #----------------------------------------------------------------------------|
- def command_formuledamage(attacker)
- if CONFIG::TOKEN_ENABLED == true
- cnf = CONFIG
- damage = cnf::DAMAGE_PROC1.call( attacker, user )
- damage = 0 if damage < 0
- damage *= elements_max_rate(attacker.element_set)
- damage /= 100
- if damage == 0
- damage = rand(2)
- elsif damage > 0
- @critical = (rand(100) < attacker.cri)
- @critical = false if prevent_critical
- damage *= 3 if @critical
- end
- damage = apply_variance(damage, 20)
- damage = apply_guard(damage)
- @hp_damage = damage
- else
- command_basedamage(attacker)
- end
- end
- #----------------------------------------------------------------------------|
- # |
- # + Formule Damage 2 + |
- # |
- #----------------------------------------------------------------------------|
- def command_formuledamage2(attacker)
- if CONFIG::TOKEN_ENABLED1 == true
- cnf = CONFIG
- damage = cnf::DAMAGE_PROC2.call( attacker, user )
- damage = 0 if damage < 0
- damage *= elements_max_rate(attacker.element_set)
- damage /= 100
- if damage == 0
- damage = rand(2)
- elsif damage > 0
- @critical = (rand(100) < attacker.cri)
- @critical = false if prevent_critical
- damage *= 3 if @critical
- end
- damage = apply_variance(damage, 20)
- damage = apply_guard(damage)
- @hp_damage = damage
- else
- command_basedamage(attacker)
- end
- end
- #----------------------------------------------------------------------------|
- # |
- # + Formule Damage 3 + |
- # |
- #----------------------------------------------------------------------------|
- def command_formuledamage3(attacker)
- if CONFIG::TOKEN_ENABLED2 == true
- cnf = CONFIG
- damage = cnf::DAMAGE_PROC3.call( attacker, user )
- damage = 0 if damage < 0
- damage *= elements_max_rate(attacker.element_set)
- damage /= 100
- if damage == 0
- damage = rand(2)
- elsif damage > 0
- @critical = (rand(100) < attacker.cri)
- @critical = false if prevent_critical
- damage *= 3 if @critical
- end
- damage = apply_variance(damage, 20)
- damage = apply_guard(damage)
- @hp_damage = damage
- else
- command_basedamage(attacker)
- end
- end
- #----------------------------------------------------------------------------|
- # |
- # + Base Damage + |
- # |
- #----------------------------------------------------------------------------|
- def command_basedamage(attacker)
- damage = CONFIG::BASE_DAMAGE_VALUE + rand(100)
- if damage == 0
- damage = rand(2)
- elsif damage > 0
- @critical = (rand(100) < attacker.cri)
- @critical = false if prevent_critical
- damage *= 3 if @critical
- damage = apply_variance(damage, 20)
- damage = apply_guard(damage)
- @hp_damage = damage
- end
- end
- end
- class Scene_Battle
- #----------------------------------------------------------------------------|
- # |
- # + Switch to another Formule @ the end of the round + |
- # |
- #----------------------------------------------------------------------------|
- def turn_end
- $game_troop.turn_ending = true
- $game_party.slip_damage_effect
- $game_troop.slip_damage_effect
- $game_party.do_auto_recovery
- $game_troop.preemptive = false
- $game_troop.surprise = false
- process_battle_event
- $game_troop.turn_ending = false
- start_party_command_selection
- if CONFIG::ENABLE_RANDOM_FORMULES == true
- case rand(2)
- when 0
- command_formuledamage(attacker)
- when 1
- command_formuledamage2(attacker)
- when 2
- command_formuledamage3(attacker)
- end
- end
- end
- end
- #----------------------------------------------------------------------------|
- # END//END//END//END//END//END//END//END//END//END//END//END//END//END//END |
- # END//END//END//END//END//END//END//END//END//END//END//END//END//END//END |
- # END//END//END//END//END//END//END//END//END//END//END//END//END//END//END | |
- #----------------------------------------------------------------------------|
Advertisement
Add Comment
Please, Sign In to add comment