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
@timer -= 1 if @timer_working && @timer>0
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.command_end
event.start

View File

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

View File

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

View File

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

View File

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