I was completly disapointed in how the paralize skill worked on the engine (anyone affected can't move, instead of a chance of not moving which I prefer) so I started messing around with the code and I got something I'm pretty happy with, so if anyone wants to use it, here is it.
Code:
module Paralize
STATUS_ID = 7
CHANCE = 50
TEXT = " can't move!"
end
# Adding a method to show the "can't move" message
class Window_BattleLog < Window_Selectable
def display_cant_act(subject)
add_text(subject.name + Paralize::TEXT)
end
end
# We modify the process_action method to add a check for the paralize chance
class Scene_Battle < Scene_Base
alias process_action_consider_paralize process_action
def process_action
return if scene_changing?
if !@subject || !@subject.current_action
@subject = BattleManager.next_subject
end
return turn_end unless @subject
if @subject.current_action
@subject.current_action.prepare
if @subject.current_action.valid?
#Here we check the paralize chance
if @subject.state?(Paralize::STATUS_ID) && (rand(99) + 1 < Paralize::CHANCE)
@log_window.display_cant_act(@subject)
else
@status_window.open
execute_action
end
end
@subject.remove_current_action
end
process_action_end unless @subject.current_action
end
end
A couple of things: it will probably work badly with other code that modify the battle system, and you need to know beforehand the id of the state, by default the id is 7 (the number beside the name of the state).