module Gamefic::Scriptable::Hooks

def before_command(*verbs, &block)

Other tags:
    Yieldparam: -
    Yieldparam: -

Parameters:
  • verbs (Array) --

Other tags:
    Example: Cancel non-meta commands when the actor does not have a parent -
def before_command(*verbs, &block)
  before_commands.push(proc do |actor, command|
    instance_exec(actor, command, &block) if verbs.empty? || verbs.include?(command.verb)
  end)
end