Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=============================================================================
- # *** Aleworks Input Module Compability Patch 1(AIM CP1)
- #=============================================================================
- # Created by Aleworks
- # Version: 1.00
- # Last Update: 29/03/2007 (day/month/year)
- #=============================================================================
- #==== Description ====
- # This patch, is for making AIM, compatible with the default interpreter script
- # of RPG Maker XP, when using the Conditional Branch and Button Input Processing
- # commands.
- #=============================================================================
- #==== Requeriments ====
- # * Aleworks Input Module
- # - Version: 1.00
- #=============================================================================
- #==== Classes & Methods ====
- # ** Class Interpreter
- # * Overwrite Methods: input_button; command_111
- #=============================================================================
- #=============================================================================
- # ** Interpreter
- #=============================================================================
- class Interpreter
- #---------------------------------------------------------------------------
- # * Input Button
- #---------------------------------------------------------------------------
- SDK.log_overwrite(:Interpreter, :input_button)
- def input_button
- n = 1 if Input.trigger?(Input::LOWER_LEFT)
- n = 3 if Input.trigger?(Input::LOWER_RIGHT)
- n = 7 if Input.trigger?(Input::UPPER_LEFT)
- n = 9 if Input.trigger?(Input::UPPER_RIGHT)
- n = 2 if Input.trigger?(Input::DOWN)
- n = 4 if Input.trigger?(Input::LEFT)
- n = 6 if Input.trigger?(Input::RIGHT)
- n = 8 if Input.trigger?(Input::UP)
- n = 11 if Input.trigger?(Input::A)
- n = 12 if Input.trigger?(Input::B)
- n = 13 if Input.trigger?(Input::C)
- n = 14 if Input.trigger?(Input::X)
- n = 15 if Input.trigger?(Input::Y)
- n = 16 if Input.trigger?(Input::Z)
- n = 17 if Input.trigger?(Input::L)
- n = 18 if Input.trigger?(Input::R)
- if !n.nil?
- $game_variables[@button_input_variable_id] = n
- $game_map.need_refresh = true
- @button_input_variable_id = 0
- end
- end
- #---------------------------------------------------------------------------
- # * Conditional Branch
- #---------------------------------------------------------------------------
- SDK.log_overwrite(:Interpreter, :command_111)
- def command_111
- result = false
- case @parameters[0]
- when 0
- result = ($game_switches[@parameters[1]] == (@parameters[2] == 0))
- when 1
- value1 = $game_variables[@parameters[1]]
- if @parameters[2] == 0
- value2 = @parameters[3]
- else
- value2 = $game_variables[@parameters[3]]
- end
- case @parameters[4]
- when 0
- result = (value1 == value2)
- when 1
- result = (value1 >= value2)
- when 2
- result = (value1 <= value2)
- when 3
- result = (value1 > value2)
- when 4
- result = (value1 < value2)
- when 5
- result = (value1 != value2)
- end
- when 2
- if @event_id > 0
- key = [$game_map.map_id, @event_id, @parameters[1]]
- if @parameters[2] == 0
- result = ($game_self_switches[key] == true)
- else
- result = ($game_self_switches[key] != true)
- end
- end
- when 3
- if $game_system.timer_working
- sec = $game_system.timer / Graphics.frame_rate
- if @parameters[2] == 0
- result = (sec >= @parameters[1])
- else
- result = (sec <= @parameters[1])
- end
- end
- when 4
- actor = $game_actors[@parameters[1]]
- if actor != nil
- case @parameters[2]
- when 0
- result = ($game_party.actors.include?(actor))
- when 1
- result = (actor.name == @parameters[3])
- when 2
- result = (actor.skill_learn?(@parameters[3]))
- when 3
- result = (actor.weapon_id == @parameters[3])
- when 4
- result = (actor.armor1_id == @parameters[3] or
- actor.armor2_id == @parameters[3] or
- actor.armor3_id == @parameters[3] or
- actor.armor4_id == @parameters[3])
- when 5
- result = (actor.state?(@parameters[3]))
- end
- end
- when 5
- enemy = $game_troop.enemies[@parameters[1]]
- if enemy != nil
- case @parameters[2]
- when 0
- result = (enemy.exist?)
- when 1
- result = (enemy.state?(@parameters[3]))
- end
- end
- when 6
- character = get_character(@parameters[1])
- if character != nil
- result = (character.direction == @parameters[2])
- end
- when 7
- if @parameters[2] == 0
- result = ($game_party.gold >= @parameters[1])
- else
- result = ($game_party.gold <= @parameters[1])
- end
- when 8
- result = ($game_party.item_number(@parameters[1]) > 0)
- when 9
- result = ($game_party.weapon_number(@parameters[1]) > 0)
- when 10
- result = ($game_party.armor_number(@parameters[1]) > 0)
- when 11
- n = Input::DOWN if @parameters[1] == 2
- n = Input::LEFT if @parameters[1] == 4
- n = Input::RIGHT if @parameters[1] == 6
- n = Input::UP if @parameters[1] == 8
- n = Input::A if @parameters[1] == 11
- n = Input::B if @parameters[1] == 12
- n = Input::C if @parameters[1] == 13
- n = Input::X if @parameters[1] == 14
- n = Input::Y if @parameters[1] == 15
- n = Input::Z if @parameters[1] == 16
- n = Input::L if @parameters[1] == 17
- n = Input::R if @parameters[1] == 18
- result = (Input.press?(n))
- when 12
- result = eval(@parameters[1])
- end
- @branch[@list[@index].indent] = result
- if @branch[@list[@index].indent] == true
- @branch.delete(@list[@index].indent)
- return true
- end
- return command_skip
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment