So I basically figured out how to change the text for "Critical". I would like to have Text-Pop ups based on Element Efficiency.
Now by logic I think I need to set up new " attr_accessor" in Game_Battler 1 probably called (or similar):
My issue is that I can't find the source of the damage calculaton and how to link those together.
In Game_Enemy the calculation happens in the table:
How do I link the table to a new attr_accessor so I can call it on my class RPG::Sprite Class?
Code:
class RPG::Sprite
def damage(value, critical)
dispose_damage
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end
bitmap = Bitmap.new(160, 48)
bitmap.font.name = "Consolas"
bitmap.font.size = 32
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
if value.is_a?(Numeric) and value < 0
bitmap.font.color.set(176, 255, 144)
else
bitmap.font.color.set(255, 255, 255)
end
bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
if critical
bitmap.font.size = 20
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, -1, 160, 20, "GET SMACKED", 1)
bitmap.draw_text(+1, -1, 160, 20, "GET SMACKED", 1)
bitmap.draw_text(-1, +1, 160, 20, "GET SMACKED", 1)
bitmap.draw_text(+1, +1, 160, 20, "GET SMACKED", 1)
bitmap.font.color.set(255, 255, 255)
bitmap.draw_text(0, 0, 160, 20, "GET SMACKED", 1)
end
@_damage_sprite = ::Sprite.new(self.viewport)
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = 80
@_damage_sprite.oy = 20
@_damage_sprite.x = self.x
@_damage_sprite.y = self.y - self.oy / 2
@_damage_sprite.z = 3000
@_damage_duration = 40
end
end
Now by logic I think I need to set up new " attr_accessor" in Game_Battler 1 probably called (or similar):
Code:
attr_accessor :a_damage
attr_accessor :b_damage
attr_accessor :c_damage
attr_accessor :d_damage
attr_accessor :e_damage
attr_accessor :f_damage
My issue is that I can't find the source of the damage calculaton and how to link those together.
In Game_Enemy the calculation happens in the table:
Code:
def element_rate(element_id)
# Get a numerical value corresponding to element effectiveness
table = [0,200,150,100,50,0,-100]
result = table[$data_enemies[@enemy_id].element_ranks[element_id]]
# If protected by state, this element is reduced by half
for i in @states
if $data_states[i].guard_element_set.include?(element_id)
result /= 2
end
end
# End Method
return result
end
How do I link the table to a new attr_accessor so I can call it on my class RPG::Sprite Class?