side stairs + wonderguard

This commit is contained in:
infinitefusion
2021-10-09 18:46:55 -04:00
parent 5f9e03726c
commit cd2e3cd04c
10 changed files with 457 additions and 261 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -393,9 +393,12 @@ class Game_Character
#============================================================================= #=============================================================================
def move_type_random def move_type_random
case rand(6) case rand(6)
when 0..3 then move_random when 0..3 then
when 4 then move_forward move_random
when 5 then @stop_count = 0 when 4 then
move_forward
when 5 then
@stop_count = 0
end end
end end
@@ -407,9 +410,12 @@ class Game_Character
return return
end end
case rand(6) case rand(6)
when 0..3 then move_toward_player when 0..3 then
when 4 then move_random move_toward_player
when 5 then move_forward when 4 then
move_random
when 5 then
move_forward
end end
end end
@@ -433,20 +439,34 @@ class Game_Character
end end
if command.code <= 14 if command.code <= 14
case command.code case command.code
when 1 then move_down when 1 then
when 2 then move_left move_down
when 3 then move_right when 2 then
when 4 then move_up move_left
when 5 then move_lower_left when 3 then
when 6 then move_lower_right move_right
when 7 then move_upper_left when 4 then
when 8 then move_upper_right move_up
when 9 then move_random when 5 then
when 10 then move_toward_player move_lower_left
when 11 then move_away_from_player when 6 then
when 12 then move_forward move_lower_right
when 13 then move_backward when 7 then
when 14 then jump(command.parameters[0], command.parameters[1]) move_upper_left
when 8 then
move_upper_right
when 9 then
move_random
when 10 then
move_toward_player
when 11 then
move_away_from_player
when 12 then
move_forward
when 13 then
move_backward
when 14 then
jump(command.parameters[0], command.parameters[1])
end end
@move_route_index += 1 if @move_route.skippable || moving? || jumping? @move_route_index += 1 if @move_route.skippable || moving? || jumping?
return return
@@ -458,17 +478,28 @@ class Game_Character
end end
if command.code >= 16 && command.code <= 26 if command.code >= 16 && command.code <= 26
case command.code case command.code
when 16 then turn_down when 16 then
when 17 then turn_left turn_down
when 18 then turn_right when 17 then
when 19 then turn_up turn_left
when 20 then turn_right_90 when 18 then
when 21 then turn_left_90 turn_right
when 22 then turn_180 when 19 then
when 23 then turn_right_or_left_90 turn_up
when 24 then turn_random when 20 then
when 25 then turn_toward_player turn_right_90
when 26 then turn_away_from_player when 21 then
turn_left_90
when 22 then
turn_180
when 23 then
turn_right_or_left_90
when 24 then
turn_random
when 25 then
turn_toward_player
when 26 then
turn_away_from_player
end end
@move_route_index += 1 @move_route_index += 1
return return
@@ -481,16 +512,26 @@ class Game_Character
when 28 when 28
$game_switches[command.parameters[0]] = false $game_switches[command.parameters[0]] = false
self.map.need_refresh = true self.map.need_refresh = true
when 29 then self.move_speed = command.parameters[0] when 29 then
when 30 then self.move_frequency = command.parameters[0] self.move_speed = command.parameters[0]
when 31 then @walk_anime = true when 30 then
when 32 then @walk_anime = false self.move_frequency = command.parameters[0]
when 33 then @step_anime = true when 31 then
when 34 then @step_anime = false @walk_anime = true
when 35 then @direction_fix = true when 32 then
when 36 then @direction_fix = false @walk_anime = false
when 37 then @through = true when 33 then
when 38 then @through = false @step_anime = true
when 34 then
@step_anime = false
when 35 then
@direction_fix = true
when 36 then
@direction_fix = false
when 37 then
@through = true
when 38 then
@through = false
when 39 when 39
old_always_on_top = @always_on_top old_always_on_top = @always_on_top
@always_on_top = true @always_on_top = true
@@ -514,10 +555,14 @@ class Game_Character
@original_pattern = @pattern @original_pattern = @pattern
end end
calculate_bush_depth if @tile_id != old_tile_id calculate_bush_depth if @tile_id != old_tile_id
when 42 then @opacity = command.parameters[0] when 42 then
when 43 then @blend_type = command.parameters[0] @opacity = command.parameters[0]
when 44 then pbSEPlay(command.parameters[0]) when 43 then
when 45 then eval(command.parameters[0]) @blend_type = command.parameters[0]
when 44 then
pbSEPlay(command.parameters[0])
when 45 then
eval(command.parameters[0])
end end
@move_route_index += 1 @move_route_index += 1
end end
@@ -552,82 +597,174 @@ class Game_Character
move_generic(8, turn_enabled) move_generic(8, turn_enabled)
end end
def move_upper_left # def move_upper_left
@through=true # @through=true
unless @direction_fix # unless @direction_fix
@direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction) # @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
end # end
if can_move_in_direction?(7) # if can_move_in_direction?(7)
@x -= 1 # @x -= 1
@y -= 1 # @y -= 1
increase_steps # increase_steps
end # end
@through=false # @through=false
end # end
#
def move_upper_right # def move_upper_right
@through=true # @through=true
unless @direction_fix # unless @direction_fix
@direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction) # @direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
end # end
if can_move_in_direction?(9) # if can_move_in_direction?(9)
@x += 1 # @x += 1
@y -= 1 # @y -= 1
increase_steps # increase_steps
end # end
@through=false # @through=false
end # end
#
# def move_lower_left
# @through=true
# unless @direction_fix
# @direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
# end
# if can_move_in_direction?(1)
# @x -= 1
# @y += 1
# increase_steps
# end
# @through=false
# end
#
# def move_lower_right
# @through=true
# unless @direction_fix
# @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
# end
# if can_move_in_direction?(3)
# @x += 1
# @y += 1
# increase_steps
# end
# @through=false
# end
def move_lower_left def move_lower_left
@through=true
unless @direction_fix unless @direction_fix
@direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction) @direction = (
if @direction == DIRECTION_RIGHT
DIRECTION_LEFT
else
@direction == DIRECTION_UP ? DIRECTION_DOWN : @direction
end)
end end
if can_move_in_direction?(1) if (passable?(@x, @y, DIRECTION_DOWN) and passable?(@x, @y + 1, DIRECTION_LEFT)) or
(passable?(@x, @y, DIRECTION_LEFT) and passable?(@x - 1, @y, DIRECTION_DOWN))
if destination_is_passable(@x - 1, @y + 1)
@x -= 1 @x -= 1
@y += 1 @y += 1
increase_steps increase_steps
end end
@through=false end
end end
def move_lower_right def move_lower_right
@through=true
unless @direction_fix unless @direction_fix
@direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction) @direction = (
if @direction == DIRECTION_LEFT
DIRECTION_RIGHT
else
@direction == DIRECTION_UP ? DIRECTION_DOWN : @direction
end)
end end
if can_move_in_direction?(3) if (passable?(@x, @y, DIRECTION_DOWN) and passable?(@x, @y + 1, DIRECTION_RIGHT)) or
(passable?(@x, @y, DIRECTION_RIGHT) and passable?(@x + 1, @y, DIRECTION_DOWN))
if destination_is_passable(@x + 1, @y + 1)
@x += 1 @x += 1
@y += 1 @y += 1
increase_steps increase_steps
end end
@through=false end
end
def move_upper_left
unless @direction_fix
@direction = (
if @direction == DIRECTION_RIGHT
DIRECTION_LEFT
else
@direction == DIRECTION_DOWN ? DIRECTION_UP : @direction
end)
end
if (passable?(@x, @y, DIRECTION_UP) and passable?(@x, @y - 1, DIRECTION_LEFT)) or
(passable?(@x, @y, DIRECTION_LEFT) and passable?(@x - 1, @y, DIRECTION_UP))
if destination_is_passable(@x - 1, @y - 1)
@x -= 1
@y -= 1
increase_steps
end
end
end
def move_upper_right
unless @direction_fix
@direction = (
if @direction == DIRECTION_LEFT
DIRECTION_RIGHT
else
@direction == DIRECTION_DOWN ? DIRECTION_UP : @direction
end)
end
if (passable?(@x, @y, DIRECTION_UP) and passable?(@x, @y - 1, DIRECTION_RIGHT)) or
(passable?(@x, @y, DIRECTION_RIGHT) and passable?(@x + 1, @y, DIRECTION_UP))
if destination_is_passable(@x + 1, @y - 1)
@x += 1
@y -= 1
increase_steps
end
end
end
def destination_is_passable(x_dest, y_dest)
return passable?(x_dest, y_dest, 0)
end end
def moveLeft90 # anticlockwise def moveLeft90 # anticlockwise
case self.direction case self.direction
when 2 then move_right # down when 2 then
when 4 then move_down # left move_right # down
when 6 then move_up # right when 4 then
when 8 then move_left # up move_down # left
when 6 then
move_up # right
when 8 then
move_left # up
end end
end end
def moveRight90 # clockwise def moveRight90 # clockwise
case self.direction case self.direction
when 2 then move_left # down when 2 then
when 4 then move_up # left move_left # down
when 6 then move_down # right when 4 then
when 8 then move_right # up move_up # left
when 6 then
move_down # right
when 8 then
move_right # up
end end
end end
def move_random def move_random
case rand(4) case rand(4)
when 0 then move_down(false) when 0 then
when 1 then move_left(false) move_down(false)
when 2 then move_right(false) when 1 then
when 3 then move_up(false) move_left(false)
when 2 then
move_right(false)
when 3 then
move_up(false)
end end
end end
@@ -647,10 +784,14 @@ class Game_Character
end end
return if dirs.length == 0 return if dirs.length == 0
case dirs[rand(dirs.length)] case dirs[rand(dirs.length)]
when 0 then move_down(false) when 0 then
when 1 then move_left(false) move_down(false)
when 2 then move_right(false) when 1 then
when 3 then move_up(false) move_left(false)
when 2 then
move_right(false)
when 3 then
move_up(false)
end end
end end
@@ -708,10 +849,14 @@ class Game_Character
def move_forward def move_forward
case @direction case @direction
when 2 then move_down(false) when 2 then
when 4 then move_left(false) move_down(false)
when 6 then move_right(false) when 4 then
when 8 then move_up(false) move_left(false)
when 6 then
move_right(false)
when 8 then
move_up(false)
end end
end end
@@ -719,10 +864,14 @@ class Game_Character
last_direction_fix = @direction_fix last_direction_fix = @direction_fix
@direction_fix = true @direction_fix = true
case @direction case @direction
when 2 then move_up(false) when 2 then
when 4 then move_right(false) move_up(false)
when 6 then move_left(false) when 4 then
when 8 then move_down(false) move_right(false)
when 6 then
move_left(false)
when 8 then
move_down(false)
end end
@direction_fix = last_direction_fix @direction_fix = last_direction_fix
end end
@@ -745,7 +894,8 @@ class Game_Character
@jump_distance_left = 1 # Just needs to be non-zero @jump_distance_left = 1 # Just needs to be non-zero
if real_distance > 0 # Jumping to somewhere else if real_distance > 0 # Jumping to somewhere else
@jump_count = 0 @jump_count = 0
else # Jumping on the spot else
# Jumping on the spot
@jump_speed_real = nil # Reset jump speed @jump_speed_real = nil # Reset jump speed
@jump_count = Game_Map::REAL_RES_X / jump_speed_real # Number of frames to jump one tile @jump_count = Game_Map::REAL_RES_X / jump_speed_real # Number of frames to jump one tile
end end
@@ -758,19 +908,27 @@ class Game_Character
def jumpForward def jumpForward
case self.direction case self.direction
when 2 then jump(0,1) # down when 2 then
when 4 then jump(-1,0) # left jump(0, 1) # down
when 6 then jump(1,0) # right when 4 then
when 8 then jump(0,-1) # up jump(-1, 0) # left
when 6 then
jump(1, 0) # right
when 8 then
jump(0, -1) # up
end end
end end
def jumpBackward def jumpBackward
case self.direction case self.direction
when 2 then jump(0,-1) # down when 2 then
when 4 then jump(1,0) # left jump(0, -1) # down
when 6 then jump(-1,0) # right when 4 then
when 8 then jump(0,1) # up jump(1, 0) # left
when 6 then
jump(-1, 0) # right
when 8 then
jump(0, 1) # up
end end
end end
@@ -782,35 +940,58 @@ class Game_Character
pbCheckEventTriggerAfterTurning if dir != oldDirection pbCheckEventTriggerAfterTurning if dir != oldDirection
end end
def turn_down; turn_generic(2); end def turn_down
def turn_left; turn_generic(4); end turn_generic(2);
def turn_right; turn_generic(6); end end
def turn_up; turn_generic(8); end
def turn_left
turn_generic(4);
end
def turn_right
turn_generic(6);
end
def turn_up
turn_generic(8);
end
def turn_right_90 def turn_right_90
case @direction case @direction
when 2 then turn_left when 2 then
when 4 then turn_up turn_left
when 6 then turn_down when 4 then
when 8 then turn_right turn_up
when 6 then
turn_down
when 8 then
turn_right
end end
end end
def turn_left_90 def turn_left_90
case @direction case @direction
when 2 then turn_right when 2 then
when 4 then turn_down turn_right
when 6 then turn_up when 4 then
when 8 then turn_left turn_down
when 6 then
turn_up
when 8 then
turn_left
end end
end end
def turn_180 def turn_180
case @direction case @direction
when 2 then turn_up when 2 then
when 4 then turn_right turn_up
when 6 then turn_left when 4 then
when 8 then turn_down turn_right
when 6 then
turn_left
when 8 then
turn_down
end end
end end
@@ -820,10 +1001,14 @@ class Game_Character
def turn_random def turn_random
case rand(4) case rand(4)
when 0 then turn_up when 0 then
when 1 then turn_right turn_up
when 2 then turn_left when 1 then
when 3 then turn_down turn_right
when 2 then
turn_left
when 3 then
turn_down
end end
end end
@@ -886,9 +1071,12 @@ class Game_Character
# 6 => @stop_count > 0 # 0 seconds # 6 => @stop_count > 0 # 0 seconds
if @stop_count >= self.move_frequency_real if @stop_count >= self.move_frequency_real
case @move_type case @move_type
when 1 then move_type_random when 1 then
when 2 then move_type_toward_player move_type_random
when 3 then move_type_custom when 2 then
move_type_toward_player
when 3 then
move_type_custom
end end
end end
end end

View File

@@ -191,7 +191,7 @@ end
def pbCut def pbCut
move = :CUT move = :CUT
movefinder = $Trainer.get_pokemon_with_move(move) movefinder = $Trainer.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_CUT, false) || (!$DEBUG && !movefinder) if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_CUT, false) || (!$DEBUG && !movefinder) || $PokemonBag.pbQuantity(:MACHETE)>0
pbMessage(_INTL("This tree looks like it can be cut down.")) pbMessage(_INTL("This tree looks like it can be cut down."))
return false return false
end end
@@ -300,7 +300,7 @@ def pbDive
return false if !map_metadata || !map_metadata.dive_map_id return false if !map_metadata || !map_metadata.dive_map_id
move = :DIVE move = :DIVE
movefinder = $Trainer.get_pokemon_with_move(move) movefinder = $Trainer.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE, false) || (!$DEBUG && !movefinder) if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE, false) || (!$DEBUG && !movefinder) || $PokemonBag.pbQuantity(:SCUBAGEAR)>0
pbMessage(_INTL("The sea is deep here. A Pokémon may be able to go underwater.")) pbMessage(_INTL("The sea is deep here. A Pokémon may be able to go underwater."))
return false return false
end end
@@ -657,7 +657,7 @@ def pbStrength
end end
move = :STRENGTH move = :STRENGTH
movefinder = $Trainer.get_pokemon_with_move(move) movefinder = $Trainer.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_STRENGTH, false) || (!$DEBUG && !movefinder) if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_STRENGTH, false) || (!$DEBUG && !movefinder) || $PokemonBag.pbQuantity(:LEVER)>0
pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside.")) pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside."))
return false return false
end end
@@ -704,7 +704,7 @@ def pbSurf
return false if $game_player.pbHasDependentEvents? return false if $game_player.pbHasDependentEvents?
move = :SURF move = :SURF
movefinder = $Trainer.get_pokemon_with_move(move) movefinder = $Trainer.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF, false) || (!$DEBUG && !movefinder) if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF, false) || (!$DEBUG && !movefinder) || $PokemonBag.pbQuantity(:SURFBOARD)>0
return false return false
end end
if pbConfirmMessage(_INTL("The water is a deep blue...\nWould you like to surf on it?")) if pbConfirmMessage(_INTL("The water is a deep blue...\nWould you like to surf on it?"))
@@ -944,7 +944,7 @@ end
def pbWaterfall def pbWaterfall
move = :WATERFALL move = :WATERFALL
movefinder = $Trainer.get_pokemon_with_move(move) movefinder = $Trainer.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_WATERFALL, false) || (!$DEBUG && !movefinder) if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_WATERFALL, false) || (!$DEBUG && !movefinder) || $PokemonBag.pbQuantity(:JETPACK)>0
pbMessage(_INTL("A wall of water is crashing down with a mighty roar.")) pbMessage(_INTL("A wall of water is crashing down with a mighty roar."))
return false return false
end end

View File

@@ -1060,8 +1060,10 @@ class Pokemon
end end
end end
hpDiff = @totalhp - @hp hpDiff = @totalhp - @hp
@totalhp = stats[:HP] #@totalhp = stats[:HP]
@hp = @totalhp - hpDiff @totalhp= self.ability == :WONDERGUARD ? 1 : stats[:HP]
calculated_hp = @totalhp - hpDiff
@hp = calculated_hp > 0 ? calculated_hp: 0
@attack = stats[:ATTACK] @attack = stats[:ATTACK]
@defense = stats[:DEFENSE] @defense = stats[:DEFENSE]
@spatk = stats[:SPECIAL_ATTACK] @spatk = stats[:SPECIAL_ATTACK]

View File

@@ -19,3 +19,9 @@ EGGINITIALLEVEL=Settings::EGG_LEVEL
#this is fucking stupid but apparently necessary #this is fucking stupid but apparently necessary
FALSE = false FALSE = false
TRUE = true TRUE = true
DIRECTION_LEFT=4
DIRECTION_RIGHT=6
DIRECTION_DOWN=2
DIRECTION_UP=8

Binary file not shown.