How to amplify floor damage?

Pretty much the title. I want floors to do roughly the same amount of damage, regardless of level.
How would I do this?
That's what it does already. By default, the floor does 10 HP damage, regardless of your level, DEF, MDF, etc. The only way it is affected is by the FDR stat.
That's what it does already. By default, the floor does 10 HP damage, regardless of your level, DEF, MDF, etc. The only way it is affected is by the FDR stat.

Is there no way to make it do damage based on a percentage?
Not without a script. I don't know of any right now that do this, though I doubt it would be too hard to implement.
Not without a script. I don't know of any right now that do this, though I doubt it would be too hard to implement.

Okay, thank you. That's all I needed to know.
NP. If you are curious, this script snippet should do it for you (untested, but should work as far as I can tell). Note this will overwrite anything else that computes the floor damage, so put it at the bottom of all of your scripts (but still about Main)


Game_Actor < Game_Battler

def execute_floor_damage
damage = (self.mhp * 0.01 * fdr).to_i
self.hp -= [damage, max_floor_damage].min
perform_map_damage_effect if damage > 0
end

end



Change 0.01 to whatever percentage of max HP you want floor damage to do.
NP. If you are curious, this script snippet should do it for you (untested, but should work as far as I can tell). Note this will overwrite anything else that computes the floor damage, so put it at the bottom of all of your scripts (but still about Main)



Game_Actor < Game_Battler

def execute_floor_damage
damage = (self.mhp * 0.01 * fdr).to_i
self.hp -= [damage, max_floor_damage].min
perform_map_damage_effect if damage > 0
end

end



Change 0.01 to whatever percentage of max HP you want floor damage to do.

Beautiful.
Greatly appreciated, bgillisp. Thanks.
Just let me know if it causes any problems. I'm home with a cold so there might be a silly error I made. Otherwise, if it works well, let us know and we can close this topic for you.
Just let me know if it causes any problems. I'm home with a cold so there might be a silly error I made. Otherwise, if it works well, let us know and we can close this topic for you.

This is what I get.

Edit:
Line 9, I added what it was expecting and it works.
Thank you!


Screenshot_191.png
That's because I made the dumbest mistake ever and left out one word. Try this one (which is also tested, and worked in a blank project for me):

Code:
class Game_Actor < Game_Battler
                         
    def execute_floor_damage
    	damage = (self.mhp * 0.01 * fdr).to_i
    	self.hp -= [damage, max_floor_damage].min
    	perform_map_damage_effect if damage > 0
  	end
  
end
That's because I made the dumbest mistake ever and left out one word. Try this one (which is also tested, and worked in a blank project for me):



class Game_Actor < Game_Battler

def execute_floor_damage
damage = (self.mhp * 0.01 * fdr).to_i
self.hp -= [damage, max_floor_damage].min
perform_map_damage_effect if damage > 0
end

end

It also works with this:
 


Game_Actor < Game_Battler

def execute_floor_damage
damage = (self.mhp * 0.80 * fdr).to_i
self.hp -= [damage, max_floor_damage].min
perform_map_damage_effect if damage > 0
end

$end


What does class do differently?
(I added '$end' because the error told me that's what it was expecting on line 9... I'm not sure if that's a good thing or bad thing, lol. I know nothing about scripting.
I'm kind a novice, but I think if you do it with the $end it might not work as we except? I'd use the original with the word class so that it is associated with the Actor like it should be, and therefore it should work with other scripts you might wish to use.
I'm kind a novice, but I think if you do it with the $end it might not work as we except? I'd use the original with the word class so that it is associated with the Actor like it should be, and therefore it should work with other scripts you might wish to use.

Okay, I'll use yours just to be safe, then.
Tested with all my scripts and it works.
Great. I'll close out this thread then.


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.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-amplify-floor-damage.71961/