Status
Not open for further replies.
Joined
Mar 30, 2017
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Specifically, the section I want to change is this, line 591 to 600 in Scene_Battle:
Code:
#--------------------------------------------------------------------------
# * Invoke Skill/Item
#--------------------------------------------------------------------------
  def invoke_item(target, item)
    if rand < target.item_cnt(@subject, item) # <--- THIS LINE
      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

I want to change that "target.item_cnt" to be the target's cnt vs the atacker's cnt. (target cnt - attacker cnt.)

I'm pretty sure no rounding when the number is negative is necessary, as rand is positive, so even -100% results in no counter.

Any idea as to how I would go about doing this? How would I add the attacker's CNT into this?


If this involves an external script, it must be compatible with: Most Yanfly scripts, Fomar0153's ATB system, and Victor Core.

Not sure if this would help, but here's an example of an incompatible script of similar purpose (no battle animations play, which is vital for Galv's Timed Button Attacks): Hamedo: Improve Counter Attack
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,494
Reaction score
8,323
First Language
Indonesian
Primarily Uses
RMVXA
The one that needs to change is not that line, but the one in Game_Battler. This located in Game_Battler at line 458
Code:
class Game_Battler
 def item_cnt(user, item)
    return 0 unless item.physical?     
    return 0 unless opposite?(user)   
    return cnt - user.cnt # <-- changed this
  end
end
It should be compatible with most of scripts you mentioned above, unless.... when it's not
 
Joined
Mar 30, 2017
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
The one that needs to change is not that line, but the one in Game_Battler. This located in Game_Battler at line 458
Code:
class Game_Battler
 def item_cnt(user, item)
    return 0 unless item.physical?   
    return 0 unless opposite?(user) 
    return cnt - user.cnt # <-- changed this
  end
end
It should be compatible with most of scripts you mentioned above, unless.... when it's not
Thanks a lot! It works perfectly! :smile:

Issue has been resolved.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,974
Reaction score
14,825
First Language
English
Primarily Uses
RMVXA

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

since all my maps are hand drawn... I admit, I super envy those who can make the tileset's work. I'm garbage at mapping, but slightly less bad at just drawing my own areas. plus it's easier to draw my own sprites than edit others to look like my characters.
Guys, I made a trailer! And, I also launched the Steam page! If you would like to support the game, please Wishlist it :ahappy: ->
working on some tilesets _ノ乙(、ン、)_

CIBl8xT.png


Oq8WKHX.png
aww man, color hex code #C4C4C4 doesn't work for the tint value in this scene I need something darker, which stinks just because I liked that one it was my favorite plastic explosive three times...#696969 (nice) should work better (WHY IS MY BRAIN LIKE THIS)
Tell it to me straight, doc. If I've been trying to piece together a "shorter" game to learn stuff outside of game jams... am I just running away from my WIP? :v

Forum statistics

Threads
117,284
Messages
1,106,135
Members
153,470
Latest member
CPGPPC
Top