Replaced get_character(0) with get_self

This commit is contained in:
Maruno17
2021-12-15 22:10:53 +00:00
parent eec29709ac
commit b5ee1b211d
5 changed files with 14 additions and 12 deletions

View File

@@ -277,7 +277,7 @@ class Game_System
def update def update
@timer -= 1 if @timer_working && @timer>0 @timer -= 1 if @timer_working && @timer>0
if Input.trigger?(Input::SPECIAL) && pbCurrentEventCommentInput(1,"Cut Scene") if Input.trigger?(Input::SPECIAL) && pbCurrentEventCommentInput(1,"Cut Scene")
event = @map_interpreter.get_character(0) event = @map_interpreter.get_self
@map_interpreter.pbSetSelfSwitch(event.id,"A",true) @map_interpreter.pbSetSelfSwitch(event.id,"A",true)
@map_interpreter.command_end @map_interpreter.command_end
event.start event.start

View File

@@ -45,7 +45,7 @@ end
def pbCurrentEventCommentInput(elements,trigger) def pbCurrentEventCommentInput(elements,trigger)
return nil if !pbMapInterpreterRunning? return nil if !pbMapInterpreterRunning?
event = pbMapInterpreter.get_character(0) event = pbMapInterpreter.get_self
return nil if !event return nil if !event
return pbEventCommentInput(event,elements,trigger) return pbEventCommentInput(event,elements,trigger)
end end

View File

@@ -478,7 +478,7 @@ def pbTrainerBattle(trainerID, trainerName, endSpeech=nil,
if !$game_temp.waiting_trainer && pbMapInterpreterRunning? && if !$game_temp.waiting_trainer && pbMapInterpreterRunning? &&
($player.able_pokemon_count > 1 || ($player.able_pokemon_count > 1 ||
($player.able_pokemon_count > 0 && $PokemonGlobal.partner)) ($player.able_pokemon_count > 0 && $PokemonGlobal.partner))
thisEvent = pbMapInterpreter.get_character(0) thisEvent = pbMapInterpreter.get_self
# Find all other triggered trainer events # Find all other triggered trainer events
triggeredEvents = $game_player.pbTriggeredTrainerEvents([2],false) triggeredEvents = $game_player.pbTriggeredTrainerEvents([2],false)
otherEvent = [] otherEvent = []

View File

@@ -309,7 +309,7 @@ Events.onSpritesetCreate += proc { |_sender, e|
#=============================================================================== #===============================================================================
def pbBerryPlant def pbBerryPlant
interp = pbMapInterpreter interp = pbMapInterpreter
this_event = interp.get_character(0) this_event = interp.get_self
berry_plant = interp.getVariable berry_plant = interp.getVariable
if !berry_plant if !berry_plant
berry_plant = BerryPlantData.new berry_plant = BerryPlantData.new
@@ -460,7 +460,7 @@ def pbPickBerry(berry, qty = 1)
else else
pbMessage(_INTL("The soil returned to its soft and loamy state.")) pbMessage(_INTL("The soil returned to its soft and loamy state."))
end end
this_event = pbMapInterpreter.get_character(0) this_event = pbMapInterpreter.get_self
pbSetSelfSwitch(this_event.id, "A", true) pbSetSelfSwitch(this_event.id, "A", true)
return true return true
end end

View File

@@ -29,7 +29,9 @@ module Compiler
['pbDayCareChoose', 'DayCare.choose'], ['pbDayCareChoose', 'DayCare.choose'],
['pbDayCareGetCompatibility', 'DayCare.get_compatibility'], ['pbDayCareGetCompatibility', 'DayCare.get_compatibility'],
['pbEggGenerated?', 'DayCare.egg_generated?'], ['pbEggGenerated?', 'DayCare.egg_generated?'],
['pbDayCareGenerateEgg', 'DayCare.collect_egg'] ['pbDayCareGenerateEgg', 'DayCare.collect_egg'],
['get_character(0)', 'get_self'],
['get_character(-1)', 'get_player']
] ]
module_function module_function
@@ -216,7 +218,7 @@ module Compiler
page.trigger = 3 # Autorun page.trigger = 3 # Autorun
page.list.clear page.list.clear
list = page.list list = page.list
push_branch(list,"get_character(0).onEvent?") push_branch(list,"get_self.onEvent?")
push_event(list,208,[0],1) # Change Transparent Flag push_event(list,208,[0],1) # Change Transparent Flag
push_wait(list,6,1) # Wait push_wait(list,6,1) # Wait
push_event(list,208,[1],1) # Change Transparent Flag push_event(list,208,[1],1) # Change Transparent Flag
@@ -560,7 +562,7 @@ module Compiler
introplay = sprintf("pbTrainerIntro(:%s)",trtype) introplay = sprintf("pbTrainerIntro(:%s)",trtype)
# Write first page # Write first page
push_script(firstpage.list,introplay) # pbTrainerIntro push_script(firstpage.list,introplay) # pbTrainerIntro
push_script(firstpage.list,"pbNoticePlayer(get_character(0))") push_script(firstpage.list,"pbNoticePlayer(get_self)")
push_text(firstpage.list,battles[0]) push_text(firstpage.list,battles[0])
if battles.length>1 # Has rematches if battles.length>1 # Has rematches
push_script(firstpage.list,sprintf("pbTrainerCheck(%s,%d,%d)",safetrcombo,battles.length,battleid)) push_script(firstpage.list,sprintf("pbTrainerCheck(%s,%d,%d)",safetrcombo,battles.length,battleid))
@@ -580,7 +582,7 @@ module Compiler
push_branch(firstpage.list,battleString) push_branch(firstpage.list,battleString)
if battles.length>1 # Has rematches if battles.length>1 # Has rematches
push_script(firstpage.list, push_script(firstpage.list,
sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_character(0),%s,%d)", sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)",
regspeech,safetrcombo,battles.length),1) regspeech,safetrcombo,battles.length),1)
end end
push_self_switch(firstpage.list,"A",true,1) push_self_switch(firstpage.list,"A",true,1)
@@ -638,7 +640,7 @@ module Compiler
push_text(lastpage.list,ebattle,1) push_text(lastpage.list,ebattle,1)
end end
push_script(lastpage.list, push_script(lastpage.list,
sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_character(0),%s,%d)", sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)",
regspeech,safetrcombo,battles.length),1) regspeech,safetrcombo,battles.length),1)
push_exit(lastpage.list,1) # Exit Event Processing push_exit(lastpage.list,1) # Exit Event Processing
push_branch_end(lastpage.list,1) push_branch_end(lastpage.list,1)
@@ -650,7 +652,7 @@ module Compiler
push_text(lastpage.list,ebattle) push_text(lastpage.list,ebattle)
if battles.length>1 if battles.length>1
push_script(lastpage.list, push_script(lastpage.list,
sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_character(0),%s,%d)", sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)",
regspeech,safetrcombo,battles.length)) regspeech,safetrcombo,battles.length))
end end
push_end(lastpage.list) push_end(lastpage.list)
@@ -803,7 +805,7 @@ module Compiler
# Rewrite last page # Rewrite last page
list = lastPage.list list = lastPage.list
list.clear list.clear
push_branch(list,"get_character(0).onEvent?") # Conditional Branch push_branch(list,"get_self.onEvent?") # Conditional Branch
push_event(list,208,[0],1) # Change Transparent Flag (invisible) push_event(list,208,[0],1) # Change Transparent Flag (invisible)
push_script(list, "Followers.hide_followers", 1) push_script(list, "Followers.hide_followers", 1)
push_move_route_and_wait(list,0,[ # Move Route for setting door to open push_move_route_and_wait(list,0,[ # Move Route for setting door to open