Mahogany gym trainers now notice player when standing next to them + adds referee that sends back the puck

This commit is contained in:
chardub
2025-02-17 15:01:14 -05:00
parent 4fa7292bdd
commit 1ddb9ba24a
6 changed files with 77 additions and 4 deletions

View File

@@ -411,10 +411,23 @@ def pbFacingTileRegular(direction = nil, event = nil)
return [$game_map.map_id, x + x_offset, y + y_offset]
end
def pbEventNextToPlayer?(event,player)
return false if !event || !player
return false if $PokemonGlobal.sliding
if event.x == player.x
return event.y == player.y+1 || event.y == player.y-1
elsif event.y == player.y
return event.x == player.x-1 || event.x == player.x+1
end
return false
end
# Returns whether event is in line with the player, is facing the player and is
# within distance tiles of the player.
def pbEventFacesPlayer?(event, player, distance)
return false if !event || !player || distance <= 0
return pbEventNextToPlayer?(event,player) if distance == 0
return false if !event || !player || distance < 0
x_min = x_max = y_min = y_max = -1
case event.direction
when 2 # Down
@@ -473,6 +486,7 @@ def pbFacingEachOther(event1, event2)
return pbEventFacesPlayer?(event1, event2, 1) && pbEventFacesPlayer?(event2, event1, 1)
end
#===============================================================================
# Audio playing
#===============================================================================