diff --git a/Movement_Speed_States/movement_speed_states.rb b/Movement_Speed_States/movement_speed_states.rb index 7c5a403..dbcc2b0 100644 --- a/Movement_Speed_States/movement_speed_states.rb +++ b/Movement_Speed_States/movement_speed_states.rb @@ -35,6 +35,8 @@ # # 2.: Setting up the states # +# This now also applies to weapons and armour parts. +# # Choose a state (or create a new one) # that you want to change your party's # movement speed. Note that the movement @@ -104,6 +106,16 @@ def movement_speed_modifier end end +class RPG::EquipItem < RPG::BaseItem + def movement_speed_increase + NoteReader.get_data(note, 'MSIncrease', :int) + end + + def movement_speed_modifier + NoteReader.get_data(note, 'MSModifier', :int) + end +end + class Game_Player < Game_Character alias real_move_speed_with_state_modifiers real_move_speed @@ -125,6 +137,12 @@ def total_movement_speed_increases states.each do |s| sum += s.movement_speed_increase || 0 end + weapons.each do |w| + sum += w.movement_speed_increase || 0 + end + armors.each do |a| + sum += a.movement_speed_increase || 0 + end return sum end @@ -134,6 +152,14 @@ def total_movement_speed_modifiers mod *= s.movement_speed_modifier || 100 mod /= 100 end + weapons.each do |w| + mod *= w.movement_speed_modifier || 100 + mod /= 100 + end + armors.each do |a| + mod *= a.movement_speed_modifier || 100 + mod /= 100 + end return mod end