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

@@ -26,7 +26,7 @@ class Game_Character
attr_accessor :walk_anime
attr_writer :bob_height
def initialize(map=nil)
def initialize(map = nil)
@map = map
@id = 0
@original_x = 0
@@ -96,7 +96,7 @@ class Game_Character
end
def move_speed=(val)
return if val==@move_speed
return if val == @move_speed
@move_speed = val
# @move_speed_real is the number of quarter-pixels to move each frame. There
# are 128 quarter-pixels per tile. By default, it is calculated from
@@ -129,7 +129,7 @@ class Game_Character
end
def move_frequency=(val)
return if val==@move_frequency
return if val == @move_frequency
@move_frequency = val
# @move_frequency_real is the number of frames to wait between each action
# in a move route (not forced). Specifically, this is the number of frames
@@ -193,7 +193,7 @@ class Game_Character
end
def cancelMoveRoute()
@move_route=nil
@move_route = nil
@move_route_forcing = false
end
@@ -312,7 +312,7 @@ class Game_Character
else
jump_fraction = ((@jump_distance_left / @jump_distance) - 0.5).abs # 0.5 to 0 to 0.5
end
ret += @jump_peak * (4 * jump_fraction**2 - 1)
ret += @jump_peak * (4 * jump_fraction ** 2 - 1)
end
return ret
end
@@ -375,8 +375,8 @@ class Game_Character
def triggerLeaveTile
if @oldX && @oldY && @oldMap &&
(@oldX!=self.x || @oldY!=self.y || @oldMap!=self.map.map_id)
Events.onLeaveTile.trigger(self,self,@oldMap,@oldX,@oldY)
(@oldX != self.x || @oldY != self.y || @oldMap != self.map.map_id)
Events.onLeaveTile.trigger(self, self, @oldMap, @oldX, @oldY)
end
@oldX = self.x
@oldY = self.y
@@ -393,9 +393,12 @@ class Game_Character
#=============================================================================
def move_type_random
case rand(6)
when 0..3 then move_random
when 4 then move_forward
when 5 then @stop_count = 0
when 0..3 then
move_random
when 4 then
move_forward
when 5 then
@stop_count = 0
end
end
@@ -407,9 +410,12 @@ class Game_Character
return
end
case rand(6)
when 0..3 then move_toward_player
when 4 then move_random
when 5 then move_forward
when 0..3 then
move_toward_player
when 4 then
move_random
when 5 then
move_forward
end
end
@@ -433,20 +439,34 @@ class Game_Character
end
if command.code <= 14
case command.code
when 1 then move_down
when 2 then move_left
when 3 then move_right
when 4 then move_up
when 5 then move_lower_left
when 6 then move_lower_right
when 7 then 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])
when 1 then
move_down
when 2 then
move_left
when 3 then
move_right
when 4 then
move_up
when 5 then
move_lower_left
when 6 then
move_lower_right
when 7 then
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
@move_route_index += 1 if @move_route.skippable || moving? || jumping?
return
@@ -458,17 +478,28 @@ class Game_Character
end
if command.code >= 16 && command.code <= 26
case command.code
when 16 then turn_down
when 17 then turn_left
when 18 then turn_right
when 19 then turn_up
when 20 then turn_right_90
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
when 16 then
turn_down
when 17 then
turn_left
when 18 then
turn_right
when 19 then
turn_up
when 20 then
turn_right_90
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
@move_route_index += 1
return
@@ -481,16 +512,26 @@ class Game_Character
when 28
$game_switches[command.parameters[0]] = false
self.map.need_refresh = true
when 29 then self.move_speed = command.parameters[0]
when 30 then self.move_frequency = command.parameters[0]
when 31 then @walk_anime = true
when 32 then @walk_anime = false
when 33 then @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 29 then
self.move_speed = command.parameters[0]
when 30 then
self.move_frequency = command.parameters[0]
when 31 then
@walk_anime = true
when 32 then
@walk_anime = false
when 33 then
@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
old_always_on_top = @always_on_top
@always_on_top = true
@@ -514,10 +555,14 @@ class Game_Character
@original_pattern = @pattern
end
calculate_bush_depth if @tile_id != old_tile_id
when 42 then @opacity = command.parameters[0]
when 43 then @blend_type = command.parameters[0]
when 44 then pbSEPlay(command.parameters[0])
when 45 then eval(command.parameters[0])
when 42 then
@opacity = command.parameters[0]
when 43 then
@blend_type = command.parameters[0]
when 44 then
pbSEPlay(command.parameters[0])
when 45 then
eval(command.parameters[0])
end
@move_route_index += 1
end
@@ -552,114 +597,210 @@ class Game_Character
move_generic(8, turn_enabled)
end
def move_upper_left
@through=true
unless @direction_fix
@direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
end
if can_move_in_direction?(7)
@x -= 1
@y -= 1
increase_steps
end
@through=false
end
def move_upper_right
@through=true
unless @direction_fix
@direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
end
if can_move_in_direction?(9)
@x += 1
@y -= 1
increase_steps
end
@through=false
end
# def move_upper_left
# @through=true
# unless @direction_fix
# @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
# end
# if can_move_in_direction?(7)
# @x -= 1
# @y -= 1
# increase_steps
# end
# @through=false
# end
#
# def move_upper_right
# @through=true
# unless @direction_fix
# @direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
# end
# if can_move_in_direction?(9)
# @x += 1
# @y -= 1
# increase_steps
# end
# @through=false
# 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
@through=true
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
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
@y += 1
increase_steps
end
@through=false
end
end
def move_lower_right
@through=true
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
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
@y += 1
increase_steps
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
def moveLeft90 # anticlockwise
case self.direction
when 2 then move_right # down
when 4 then move_down # left
when 6 then move_up # right
when 8 then move_left # up
when 2 then
move_right # down
when 4 then
move_down # left
when 6 then
move_up # right
when 8 then
move_left # up
end
end
def moveRight90 # clockwise
case self.direction
when 2 then move_left # down
when 4 then move_up # left
when 6 then move_down # right
when 8 then move_right # up
when 2 then
move_left # down
when 4 then
move_up # left
when 6 then
move_down # right
when 8 then
move_right # up
end
end
def move_random
case rand(4)
when 0 then move_down(false)
when 1 then move_left(false)
when 2 then move_right(false)
when 3 then move_up(false)
when 0 then
move_down(false)
when 1 then
move_left(false)
when 2 then
move_right(false)
when 3 then
move_up(false)
end
end
def move_random_range(xrange=-1,yrange=-1)
def move_random_range(xrange = -1, yrange = -1)
dirs = [] # 0=down, 1=left, 2=right, 3=up
if xrange<0
if xrange < 0
dirs.push(1); dirs.push(2)
elsif xrange>0
elsif xrange > 0
dirs.push(1) if @x > @original_x - xrange
dirs.push(2) if @x < @original_x + xrange
end
if yrange<0
if yrange < 0
dirs.push(0); dirs.push(3)
elsif yrange>0
elsif yrange > 0
dirs.push(0) if @y < @original_y + yrange
dirs.push(3) if @y > @original_y - yrange
end
return if dirs.length==0
return if dirs.length == 0
case dirs[rand(dirs.length)]
when 0 then move_down(false)
when 1 then move_left(false)
when 2 then move_right(false)
when 3 then move_up(false)
when 0 then
move_down(false)
when 1 then
move_left(false)
when 2 then
move_right(false)
when 3 then
move_up(false)
end
end
def move_random_UD(range=-1)
move_random_range(0,range)
def move_random_UD(range = -1)
move_random_range(0, range)
end
def move_random_LR(range=-1)
move_random_range(range,0)
def move_random_LR(range = -1)
move_random_range(range, 0)
end
def move_toward_player
@@ -708,10 +849,14 @@ class Game_Character
def move_forward
case @direction
when 2 then move_down(false)
when 4 then move_left(false)
when 6 then move_right(false)
when 8 then move_up(false)
when 2 then
move_down(false)
when 4 then
move_left(false)
when 6 then
move_right(false)
when 8 then
move_up(false)
end
end
@@ -719,10 +864,14 @@ class Game_Character
last_direction_fix = @direction_fix
@direction_fix = true
case @direction
when 2 then move_up(false)
when 4 then move_right(false)
when 6 then move_left(false)
when 8 then move_down(false)
when 2 then
move_up(false)
when 4 then
move_right(false)
when 6 then
move_left(false)
when 8 then
move_down(false)
end
@direction_fix = last_direction_fix
end
@@ -745,7 +894,8 @@ class Game_Character
@jump_distance_left = 1 # Just needs to be non-zero
if real_distance > 0 # Jumping to somewhere else
@jump_count = 0
else # Jumping on the spot
else
# Jumping on the spot
@jump_speed_real = nil # Reset jump speed
@jump_count = Game_Map::REAL_RES_X / jump_speed_real # Number of frames to jump one tile
end
@@ -758,19 +908,27 @@ class Game_Character
def jumpForward
case self.direction
when 2 then jump(0,1) # down
when 4 then jump(-1,0) # left
when 6 then jump(1,0) # right
when 8 then jump(0,-1) # up
when 2 then
jump(0, 1) # down
when 4 then
jump(-1, 0) # left
when 6 then
jump(1, 0) # right
when 8 then
jump(0, -1) # up
end
end
def jumpBackward
case self.direction
when 2 then jump(0,-1) # down
when 4 then jump(1,0) # left
when 6 then jump(-1,0) # right
when 8 then jump(0,1) # up
when 2 then
jump(0, -1) # down
when 4 then
jump(1, 0) # left
when 6 then
jump(-1, 0) # right
when 8 then
jump(0, 1) # up
end
end
@@ -782,35 +940,58 @@ class Game_Character
pbCheckEventTriggerAfterTurning if dir != oldDirection
end
def turn_down; turn_generic(2); end
def turn_left; turn_generic(4); end
def turn_right; turn_generic(6); end
def turn_up; turn_generic(8); end
def turn_down
turn_generic(2);
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
case @direction
when 2 then turn_left
when 4 then turn_up
when 6 then turn_down
when 8 then turn_right
when 2 then
turn_left
when 4 then
turn_up
when 6 then
turn_down
when 8 then
turn_right
end
end
def turn_left_90
case @direction
when 2 then turn_right
when 4 then turn_down
when 6 then turn_up
when 8 then turn_left
when 2 then
turn_right
when 4 then
turn_down
when 6 then
turn_up
when 8 then
turn_left
end
end
def turn_180
case @direction
when 2 then turn_up
when 4 then turn_right
when 6 then turn_left
when 8 then turn_down
when 2 then
turn_up
when 4 then
turn_right
when 6 then
turn_left
when 8 then
turn_down
end
end
@@ -820,10 +1001,14 @@ class Game_Character
def turn_random
case rand(4)
when 0 then turn_up
when 1 then turn_right
when 2 then turn_left
when 3 then turn_down
when 0 then
turn_up
when 1 then
turn_right
when 2 then
turn_left
when 3 then
turn_down
end
end
@@ -886,9 +1071,12 @@ class Game_Character
# 6 => @stop_count > 0 # 0 seconds
if @stop_count >= self.move_frequency_real
case @move_type
when 1 then move_type_random
when 2 then move_type_toward_player
when 3 then move_type_custom
when 1 then
move_type_random
when 2 then
move_type_toward_player
when 3 then
move_type_custom
end
end
end
@@ -940,7 +1128,7 @@ class Game_Character
def update_pattern
return if @lock_pattern
# return if @jump_count > 0 # Don't animate if jumping on the spot
# return if @jump_count > 0 # Don't animate if jumping on the spot
# Character has stopped moving, return to original pattern
if @moved_last_frame && !@moved_this_frame && !@step_anime
@pattern = @original_pattern

View File

@@ -191,7 +191,7 @@ end
def pbCut
move = :CUT
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."))
return false
end
@@ -300,7 +300,7 @@ def pbDive
return false if !map_metadata || !map_metadata.dive_map_id
move = :DIVE
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."))
return false
end
@@ -657,7 +657,7 @@ def pbStrength
end
move = :STRENGTH
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."))
return false
end
@@ -704,7 +704,7 @@ def pbSurf
return false if $game_player.pbHasDependentEvents?
move = :SURF
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
end
if pbConfirmMessage(_INTL("The water is a deep blue...\nWould you like to surf on it?"))
@@ -944,7 +944,7 @@ end
def pbWaterfall
move = :WATERFALL
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."))
return false
end

View File

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

View File

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

Binary file not shown.