lord_steak

Veteran
Veteran
Joined
Nov 4, 2013
Messages
72
Reaction score
21
First Language
English
Primarily Uses
Still getting a handle on Ruby, and trying to not be a cargo cultist.

I'm planning on having some skills that can sidestep a target's evasion, mag. evade, or damage reflection, but still be subject to PDR or MDR (as such, cannot use certain hit), and have these flagged by notetags.  Didn't find anything of the like on the master script list.

First trouble is that I don't know how to set it up to read notetags, and since I'm trying to avoid the cargo cultist route, I'd like to learn how to do that properly and why it works.

I was thinking that the best way to go about this was to have the thing outright skip the checking for these things.  Found the damage reflection without much issue, but for the evasion and mag. evade, I might have to temporarily set the those to zero and then put the value back afterwards, so as to not leave the target without evasion period (though that might make an interesting debilitating skill).  Anyways, for the damage reflection, here's what I've got:

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Invoke Magic Reflection
  #--------------------------------------------------------------------------

  alias :steak_bypass_mrf_go_ohio_beat_fiami :invoke_magic_reflection
  def invoke_magic_reflection(target, item)
    steak_bypass_mrf_go_ohio_beat_fiami(target, item)

    unless <bypass_mrf>
      @subject.magic_reflection = true
      @log_window.display_reflection(target, item)
      apply_item_effects(@subject, item)
      @subject.magic_reflection = false
  end
end

I left what I intend to put in the notetags in the angle brackets, since I don't know the syntax for notetags just yet.
Without knowing how to implement notetags, I cannot test this.  Thoughts, please?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,909
Reaction score
15,002
First Language
English
Primarily Uses
RMMV
You need to get at the note via actor.actor or enemy.enemy, since Game_Actor and Game_Enemy don't give you direct access to the note field. And since target could be either an actor OR an enemy, you can't really say target.actor or target.enemy - so I'd set up a couple of methods in those classes to give you access to the note field without having to figure out whether it's one or the other.

The line you're after in the code snippet above would be something like this:

unless target.note.include?('<bypass_mrf>')But you'd have to add this to make target.note a valid method:
Code:
class Game_Actor  def note    actor.note  endendclass Game_Enemy  def note    enemy.note  endend
This is untested. Let me know if you get any errors.
 

Selchar

Veteran
Veteran
Joined
Dec 28, 2012
Messages
299
Reaction score
82
First Language
English
Primarily Uses
I first learned how to use notetags through Fomar's tutorial here, and looking at some other short yet simple scripts.  There are other guides here and there that would be of interest.  I have also learned that there is more often than not more than 1 way to do something.  For example I handled a multi part request for another person on the other forums which had a similar them to what you want(avoid certain hit hit type while getting the effects).  I originally intended to overwrite invoke_item instead of the individual invoke magic reflection/counterattack methods, then I discovered something that I overlooked.
 
The following script does exactly what you want and a little more.

Code:
#===============================================================================# Script: Never Miss Skills# Author: Selchar# Requestor: Animebryan#================================================================================beginThis script allows for the creation of skills that always hit their target,without using the Certain Hit Hit Type.#-------------------------------------------------------------------------------# Item/skill Notetag#-------------------------------------------------------------------------------Bypasses counter/magic reflect with: <no reaction> Bypass miss/eva with: <always hit> =end#===============================================================================# Script is beow#===============================================================================class Game_Battler < Game_BattlerBase  alias :no_reaction_item_cnt :item_cnt  def item_cnt(user, item)    return 0 if item.no_reaction    no_reaction_item_cnt(user, item)  end  alias :no_reaction_item_mrf :item_mrf  def item_mrf(user, item)    return 0 if item.no_reaction    no_reaction_item_mrf(user, item)  end  alias :always_hit_item_hit :item_hit  def item_hit(user, item)    return 1 if item.always_hit    always_hit_item_hit(user, item)  end  alias :always_hit_item_eva :item_eva  def item_eva(user, item)    return 0 if item.always_hit    always_hit_item_eva(user, item)  endend class RPG::UsableItem  def no_reaction    @note =~ /<no[-_ ]?reaction>/i ? @no_reaction = true : @no_reaction = false if @no_reaction.nil?    @no_reaction  end  def always_hit    @note =~ /<always[-_ ]?hit>/i ? @always_hit = true : @always_hit = false if @always_hit.nil?    @always_hit  endend
Now on to the code you presented. First things first, you're missing an end statement, tho I'll assume for the moment that was a result of your copying.  Next, you're calling your alias, and performing a check(or intend to, for a notetag).  The code that is run, looks like it's exactly what is in the original method, so you would be doing damage reflection twice if I'm not mistaken.  There's only one way to find out tho*sees Shaz post*.  Let's see what happens when you test what Shaz has given you first.
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,909
Reaction score
15,002
First Language
English
Primarily Uses
RMMV
Oh - I didn't even consider that the note might be on something other than the actor or enemy! Sorry - I should have read it more carefully to start with - I see it now that you're talking about the note on a skill. In that case, my solution won't work - it SHOULD be a usable item that the note is on, which is exactly what Selchar provided (though I didn't look too closely through that either).


Sorry for the confusion.
 

Crimson Dragon Inc.

Crimson Dragon
Veteran
Joined
Aug 8, 2012
Messages
921
Reaction score
134
First Language
english
Primarily Uses
RMMV
i'm about to sound stupid (probaly) but i thought certain hit only negated the target's eva/meva/ceva(only if skill can crit)/reflect..... i dont think it allows the skills to ignore damage reduction..........

from the descript in the maker 

"certain hit: treats the successful use of a skill as a hit, counter attack, evasion, magic evasion, and reflection are disabled"

hit types only decerns how the accuracy of the skill takes effect so a new script isnt needed
 
Last edited by a moderator:

Selchar

Veteran
Veteran
Joined
Dec 28, 2012
Messages
299
Reaction score
82
First Language
English
Primarily Uses
That is the main purpose of the Certain Hit hit type, however if you look at the make_damage_value method.

def make_damage_value(user, item) value = item.damage.eval(user, self, $game_variables) value *= item_element_rate(user, item) value *= pdr if item.physical? value *= mdr if item.magical? value *= rec if item.damage.recover? value = apply_critical(value) if @result.critical value = apply_variance(value, item.damage.variance) value = apply_guard(value) @result.make_damage(value.to_i, item)endSee the lines:

value *= pdr if item.physical?
value *= mdr if item.magical?

These are ignored if the skill/item is labeled Certain Hit, since a Certain Hit hit type means it's not "magical" or "physical".
 

Crimson Dragon Inc.

Crimson Dragon
Veteran
Joined
Aug 8, 2012
Messages
921
Reaction score
134
First Language
english
Primarily Uses
RMMV
ahhh i see ok that explains it....... but there is another way with out scripting then..... make magic and element and use elemental resistances..... same thing really
 

lord_steak

Veteran
Veteran
Joined
Nov 4, 2013
Messages
72
Reaction score
21
First Language
English
Primarily Uses
Thanks, on both the script and the tutorial link.  I can't check on if this works now; I'll have to get that when I get home from work.

Seems to me this sort of thing ought to be on the master script list; how often does that get updated?

EDIT: checked, and perfect.  Many thanks.
 
Last edited by a moderator:

Ultima01

Unhinged
Veteran
Joined
Mar 13, 2013
Messages
69
Reaction score
11
First Language
English
Primarily Uses
N/A
Or you could manually multiply by the target's PDR or MDR in the damage formula bar.
Example:

(800 + a.mat * 7 - b.mdf * 2) * b.mdrCrap.  I just necro posted, didn't I?
 
Last edited by a moderator:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,259
Reaction score
7,670
First Language
Indonesian
Primarily Uses
RMVXA
Code:
#===============================================================================
# Script: Never Miss Skills
# Author: Selchar
# Requestor: Animebryan
#===============================================================================
=begin
This script allows for the creation of skills that always hit their target,
without using the Certain Hit Hit Type.
#-------------------------------------------------------------------------------
# Item/skill Notetag
#-------------------------------------------------------------------------------
Bypasses counter/magic reflect with: <no reaction> 
Bypass miss/eva with: <always hit> 
=end
#===============================================================================
# Script is beow
#===============================================================================
class Game_Battler < Game_BattlerBase  
  alias :no_reaction_item_cnt :item_cnt  
  def item_cnt(user, item)    
    return 0 if item.no_reaction    
    no_reaction_item_cnt(user, item)  
  end  
  alias :no_reaction_item_mrf :item_mrf  
  def item_mrf(user, item)    
    return 0 if item.no_reaction    
    no_reaction_item_mrf(user, item)  
  end  
  alias :always_hit_item_hit :item_hit  
  def item_hit(user, item)    
    return 1 if item.always_hit    
    always_hit_item_hit(user, item)  
  end  
  alias :always_hit_item_eva :item_eva  
  def item_eva(user, item)    
    return 0 if item.always_hit    
    always_hit_item_eva(user, item)  
  end
end 

class RPG::UsableItem  
  def no_reaction    
    @note =~ /<no[-_ ]?reaction>/i ? @no_reaction = true : @no_reaction = false if @no_reaction.nil?    
    @no_reaction  
  end  
  def always_hit    
    @note =~ /<always[-_ ]?hit>/i ? @always_hit = true : @always_hit = false if @always_hit.nil?    
    @always_hit  
  end
end
Fixed the script format
 
  • Like
Reactions: BCj

Latest Threads

Latest Profile Posts

Fire-Emblem Style Level Up System, Boost on Class Change, And Animated Arrows | RPG Maker News #115

Why keyboards don't sleep? Because they have two shifts.
I realized a while ago my game was toooo big in scope. even now I wonder am I trying to do too much by myself. and that's after completely changing the format of the game.
Last week at SLC. Cali awaits. TBH I love SLC more than SF.
Back home now. I had a good time, but I had a checkup this morning so I had to come home for that. Now I'm just waiting for my therapist meeting tomorrow...
Decided to work on Wishful Wanda today. Since it's a BFB spinoff game, I decided to make the Huang brothers
Easter eggs! I'm actually pitching this to the BFDI team, btw.

Forum statistics

Threads
113,934
Messages
1,078,522
Members
148,044
Latest member
Sernyx
Top