Counter attack and Magic Counter attack

Ultimacj

Cookie Knight
Veteran
Joined
Oct 15, 2013
Messages
414
Reaction score
64
First Language
Englist
Primarily Uses
N/A
Since RPG maker doesn't really give much detail just the chance rate of it happening, how does it calculate counter attacks and magic reflection attacks from the enemy?  Regardless of the spell ability upon play testing; I've seen a counter attack and/or magic reflection completely one shot my character.

Example:  Average damage the player swings against the enemy might be say around 140 damage.  If a counter attack is applied it ranges to below that to like one shoting the character (dealing way over 500 points of damage).  No critical are indicated, if there IS a critical there it's hitting harder than the crit would land (maybe an average of 250 damage?)

I'm just curious how this is calculated since the actual feature isn't detailed about it.

Magic reflection is similar dealing almost 3x the normal damage the player can cast.
 

Selchar

Veteran
Veteran
Joined
Dec 28, 2012
Messages
299
Reaction score
80
First Language
English
Primarily Uses
Here is the part of the code that handles counterattacks/magic reflection.

class Scene_Battle < Scene_Base def invoke_item(target, item) if rand < target.item_cnt(@subject, item) invoke_counter_attack(target, item) elsif rand < target.item_mrf(@subject, item) invoke_magic_reflection(target, item) else apply_item_effects(apply_substitute(target, item), item) end @subject.last_target_index = target.index end def invoke_counter_attack(target, item) @log_window.display_counter(target, item) attack_skill = $data_skills[target.attack_skill_id] @subject.item_apply(target, attack_skill) refresh_status @log_window.display_action_results(@subject, attack_skill) end def invoke_magic_reflection(target, item) @subject.magic_reflection = true @log_window.display_reflection(target, item) apply_item_effects(@subject, item) @subject.magic_reflection = false endend1: invoke_item determines if a counter/magic reflection happens.2: invoke_counter_attack indicates that no matter who is involved, counter attacks use the attack skill, which unless changed via scripts, is skill_id 1.

3: invoke_magic_reflection obviously uses the skill used on the target to strike back.

In testing using static numbers/no variation, counter attacks uses the target's stats against the attacker, so it's no different than them getting in a free hit.

Magic reflection on the other hand uses the caster's stats against themselves. Critical damage takes the normal damage done and multiplies it by 3.

Counters and reflections can become critical hits, by default "painful blow" is a critical against you, an "excellent hit" is a critical against your enemies.

Hope that answers your question.
 
Last edited by a moderator:

Ultimacj

Cookie Knight
Veteran
Joined
Oct 15, 2013
Messages
414
Reaction score
64
First Language
Englist
Primarily Uses
N/A
Kinda but is there a way to modify it to were the damage isn't nearly as devastating?
 

Selchar

Veteran
Veteran
Joined
Dec 28, 2012
Messages
299
Reaction score
80
First Language
English
Primarily Uses
Counters are determined by the stats of the battler that is performing the counter. If it's doing too much damage even without criticals, then either modify the battler's stats or the attack skill's damage formula.

Magic Reflection is like hitting yourself, so if you are hitting yourself too hard, then either raise the appropriate defense or modify the damage formula for your magic skills.

Critical damage in general(I'm assuming this is being applied to get those big numbers), this one is simple. It is controlled by the following code:

Code:
class Game_Battler < Game_BattlerBase  def apply_critical(damage)    damage * 3  endend
By default damage criticals dish out is 3X damage, simply add this to your project, and change the lone number to something you believe would be more respectable for your game(I go with 1.5-2 personally)
 

Ultimacj

Cookie Knight
Veteran
Joined
Oct 15, 2013
Messages
414
Reaction score
64
First Language
Englist
Primarily Uses
N/A
True but if I lower the ability itself, the damage done against the target is also lowered for the intended level.  I could lower defenses of the target(s) themselves but the same problem would occur and the player would have to grind more than they needed to.

Even when the players defense/HP out does the target the counter lands too hard even on a non-critical.  I appericate the point out on critical s I might adjust that but not sure if that'll solve the over damage upon critical s or magic attacks.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Who knew a adding menu commands would be so hard for something that should be a basic feature.
When you discover great tileset resources that you completely forgot that you had. :kaomad3::kaopride:
Just got a better look at the MZ RTP. I'm very happy with it, especially the sci-fi tiles and sprites. Glad I pre-ordered.
I've just checked the VisuStella Plugins for MZ and there are already 11 plugins. The Yanfly team(perhaps a big one?) really works so effectively and efficiently that some MZ users can likely use tons of Yanfly plugins right after MZ's released (still 13 days from now). I wonder if any other plugin developer(or team) will try to compete with Yanfly this time, no matter how slim the chance to win is :)
Hello! :kaopride:I am new to RPG Maker, though I have been lurking the forums for a while. :kaoswt: Hope to make some friends and learn some stuff here! :kaothx:

Forum statistics

Threads
100,597
Messages
977,608
Members
132,202
Latest member
gerreh
Top