[XP] seeing the damage affinities

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
187
Reaction score
6
First Language
English
Primarily Uses
RMXP
i just need to figure out how to see effectiveness of an attack that effective or not

Examples:
If the enemy is weak to Fire: WEAK [150] = (B)/[200] = (A)
If the enemy is neutral to Fire: [100] = (C)
If the enemy is resistant to Fire: RESIST [50] = (D)
If the enemy is null to Fire: BLOCK = (E)
If the enemy is drain to Fire: *Heals the enemy* = (F) < (but you already knew that)

is there something or some code that can do it like this?
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
287
Reaction score
71
First Language
English
Primarily Uses
RMXP
In the default implementation you'll find the following values
[0,200,150,100,50,0,-100]
Where the first zero will be ignored automatically.
Both heroes and enemies own the element_rate(element_id) method so the result might help you make conditions to make it display a string that tells you if they're weak or strong or don't care about that specific element, etc.
$game_actors for all actors
$game_party.actors for actors that joined your party already
$game_troop.enemies or $game_troop.members depending on the version of your engine or anybody else's for an existing enemy troop and this one might fail if there's no call to the battle scene.
$data_enemies doesn't own that element_rate method for it's just a data structure...
That would mean that for enemies you'd need to create a new Game_Enemy instance per monster you'd need to review. That won't be necessary if the battle has begun already.
 
Last edited:

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
187
Reaction score
6
First Language
English
Primarily Uses
RMXP
@kyonides
i think it has something to do about this piece of code
Ruby:
if result && elements_correct(skill.element_set) <= 0
  self.damage = "BLOCK"
and this line of code in Game_Battler 3
Ruby:
  #--------------------------------------------------------------------------
  # * Calculating Element Correction
  #     element_set : element
  #--------------------------------------------------------------------------
  def elements_correct(element_set)
    # If not an element
    if element_set == []
      # Return 100
      return 100
    end
    # Return the weakest object among the elements given
    # * "element_rate" method is defined by Game_Actor and Game_Enemy classes,
    #    which inherit from this class.
    weakest = -100
    for i in element_set
      weakest = [weakest, self.element_rate(i)].max
    end
    return weakest
  end
end
but i don't know how it works exactly...
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
287
Reaction score
71
First Language
English
Primarily Uses
RMXP
I think it's important to ask you this: when exactly, during gameplay, do you want to know this?
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
187
Reaction score
6
First Language
English
Primarily Uses
RMXP
@kyonides
i think the numbers will have color when affected from curtain affinities
for example:
Yellow or Orange = Weakness
White = Normal (obviously)
Gray = Resist

[Extras]
The word "BLOCK" = Null
Green = Heal

like the Cool Damage Script, where the damage color becomes Red when a CRIT happens.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,090
Members
137,586
Latest member
Usagiis
Top