From cd2e3cd04c21a2ccd0ab2cf1eb81b6ea5fa3e731 Mon Sep 17 00:00:00 2001 From: infinitefusion Date: Sat, 9 Oct 2021 18:46:55 -0400 Subject: [PATCH] side stairs + wonderguard --- Data/Map247.rxdata | Bin 7479 -> 7698 bytes Data/Map380.rxdata | Bin 50880 -> 50829 bytes Data/Map491.rxdata | Bin 72371 -> 72233 bytes Data/Map734.rxdata | Bin 27733 -> 27733 bytes Data/MapInfos.rxdata | Bin 36084 -> 36228 bytes .../004_Game classes/007_Game_Character.rb | 694 +++++++++++------- .../012_Overworld/004_Overworld_FieldMoves.rb | 10 +- Data/Scripts/014_Pokemon/001_Pokemon.rb | 6 +- Data/Scripts/049_Compatibility/Constants.rb | 8 +- Data/System.rxdata | Bin 27617 -> 27617 bytes 10 files changed, 457 insertions(+), 261 deletions(-) diff --git a/Data/Map247.rxdata b/Data/Map247.rxdata index b5fd202f290ef965f1937037dc09f27e3d37837f..235b59e207f2c2f876c98f3850e42f9136fc9fb9 100644 GIT binary patch delta 72 zcmdmPHOXc|3?u)>*cF0Inf#OgF^fxZXEJ0my=2N1&g25J7_5bWSU8jM+HHpRk{W!;q7ffXV121l)0` z^4t^Vc?}`BRb*gMvu))r4!0|cWnr;>D`bsM`x3Sh{dODMgl~2)7Fn9aSe#SkcR7OQ zXq2UV5st+93JXPhT8t=5X;c2CgL@PzUZ(H#lIkOihZPo-iBxA#`a_i^A=hQ&DJrZU zn_RLqqLa9kg6Zna(V7@^S(tv_te0Uv+PznW)4t{BW%v;l1NJCZgM#d75i4>&an=im zyNbP{gdtge>DlJBY@FUd%J*b6q-dC<%tcFH0-sVb*nCxNTj?~iYjEe0ew<(bh(8HI zcH=5s-mr%E&{Cvs{H*cY1`;7Ht1nF8_YIh`kE6XPmYP*t5{u!c448_;FqI#MqwW~~ z&LEq`-y7&~OLe5)u@-prozlGs)Rs8(JLND9jm0(|I!E6&CK5}#xNg_N3LD!@+)CU| zEF=~aJ;XA2y@y$~T;t8oB$QTI;V8ev+9-O4c$RpMc!7A4*rDgfi~SX)ob^iy>>2Sn z@g?y!@eT2VUI6THRN&)1wNZTOp@V5vn00~XEGn7 zZC5I)PO4&ZufwFb&oZN`IGj1k8^M^69}*mjI{*Lx delta 1213 zcmZvbT}TvB6vw+~X4ZAwbj)4NMM>RgQ?tz`P)a9xAN0?ptbuA9srCr39kWFrG^d-7 zH0YU#*>l)hID4P_ioO8*fL>3KO_J(2T~)@h&b0snO~ngZCJTFtOTjAOZC~=8l72Hh z5a@pJ>H1Oj4$qW#vG*EFRsV)>(eT7Xt+gz&puKAmJU4~!whKoqQ_)lwi;Y!@c%yR( z6ES!&32)Y0uyB(FtJ4$lku1SalYTOrgQ1-^20DR{3U?8WX*pK39BRf5RVkVkBn(zL zHJ$WgL&q|!!!k)Ao0vl~E?q{($+$js!h0FmVSMYi;YA-=ty%wIEyOlrJMjeG@;T7u zt6)9!eTCSoWk=XOTK5tAi37xk#3AB{zF)O(-v(@2?*cn^CFs_kp~ikuW6VsK%^5+U zfX>|sIGGiXeb!CjFzeR9>${r4WfbKaLDqvUyg$##73jrp(7j^`E<47nSNAx@NPdC^ z(R6CM5ggI<+cZb9JY)xKnq_q=IMDP_l5>^3K!TDVNKy&{3j?@c(MIHbQtLi z9iITkM6C8WH5b*wE0M-{BZfUv3SULtspm^hqUTg9=6A;8-cy@FjG+O;zGQYR?wWlH XIj6@~U@+5yrr|pLJ|wAa!!g2dbv==i diff --git a/Data/Map491.rxdata b/Data/Map491.rxdata index bf459022a3f2423e46e5d6445474f2290f1e59e6..09e30a45381ffca9c0f7726abd63e754811b0bab 100644 GIT binary patch delta 246 zcmdnIm1X4?mJPZpjt}pu;Y10Xa;Han5AJt)h(cCdY2I!{R{E$sF4RCdct{Z&ujW6vVWJ Ub@~zx#wkokShrhoGFA!#0JAw?rvLx| delta 364 zcmZ3vg=O2=OlONd0Dzj()%C}bHu;!2E%C}Z#w-$_MuolkLLSpkyPK+04 z)Sf(hi|XY0wVEt!4otR_C)SHH*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IH4L!95NY>4R>*aSga5}+8rFhD_Jr-iQ&fj{VHMvAPnR8fNE`K#wm>ku@q()} z%XH;P;;3!_y=;tVK^bl5X5%o6=2~Fn&A9`3nq7}Kpq#SEwPQ|euy^5bWDW`#IBy44 z;r6^ZuMXccAu1amh=Wm%z#g8M-;8TqxF84T_}qdkn8l{(AfAu0=gH_%e9gTJ+k}5W z`J!#u%j1iF!e#DX+$!7yH8Fj7hC?x}n9bDKEL!_Xc`~+2xDSRd>BFYA)5;lJf>WHc&J5qpzkulEZpKsCl`mz|9lx~7Roso=Oz1Q zT(nhVutVG)?~Z={lCTqxu=R-myv!p{9K$e6ml|<|mzM4TXiC&$GfyU}II={--xD+N zA(N8MVmDoqRoKC}4u+K^ zM^)RXCL?j3ca8q26@3b#fiGEX zD!_7%n3N#znfy>EDhfS;Dkc4n z<^%jmzlvN=%D3Z=3I+Vc6BT1*pYzs}3S6aAr5bk_TiFhO@#9JjaGsJXBkr=Ksv8pC zt5PC>0oA`^F=wqa;4fO%orY43Uf&Na;k6C9sN|xW+lZsC)(`P4s6Bnuv6UJ PF&ohHz?QRoCDq|y{cCCz diff --git a/Data/Scripts/004_Game classes/007_Game_Character.rb b/Data/Scripts/004_Game classes/007_Game_Character.rb index bd3aac3f7..d534dbc2b 100644 --- a/Data/Scripts/004_Game classes/007_Game_Character.rb +++ b/Data/Scripts/004_Game classes/007_Game_Character.rb @@ -1,90 +1,90 @@ class Game_Character - attr_reader :id - attr_reader :original_x - attr_reader :original_y - attr_reader :x - attr_reader :y - attr_reader :real_x - attr_reader :real_y + attr_reader :id + attr_reader :original_x + attr_reader :original_y + attr_reader :x + attr_reader :y + attr_reader :real_x + attr_reader :real_y attr_accessor :width attr_accessor :height attr_accessor :sprite_size - attr_reader :tile_id + attr_reader :tile_id attr_accessor :character_name attr_accessor :character_hue - attr_reader :opacity - attr_reader :blend_type + attr_reader :opacity + attr_reader :blend_type attr_accessor :direction attr_accessor :pattern attr_accessor :pattern_surf attr_accessor :lock_pattern - attr_reader :move_route_forcing + attr_reader :move_route_forcing attr_accessor :through attr_accessor :animation_id attr_accessor :transparent - attr_reader :move_speed + attr_reader :move_speed attr_accessor :walk_anime - attr_writer :bob_height + attr_writer :bob_height - def initialize(map=nil) - @map = map - @id = 0 - @original_x = 0 - @original_y = 0 - @x = 0 - @y = 0 - @real_x = 0 - @real_y = 0 - @width = 1 - @height = 1 - @sprite_size = [Game_Map::TILE_WIDTH, Game_Map::TILE_HEIGHT] - @tile_id = 0 - @character_name = "" - @character_hue = 0 - @opacity = 255 - @blend_type = 0 - @direction = 2 - @pattern = 0 - @pattern_surf = 0 - @lock_pattern = false - @move_route_forcing = false - @through = false - @animation_id = 0 - @transparent = false - @original_direction = 2 - @original_pattern = 0 - @move_type = 0 - self.move_speed = 3 - self.move_frequency = 6 - @move_route = nil - @move_route_index = 0 - @original_move_route = nil + def initialize(map = nil) + @map = map + @id = 0 + @original_x = 0 + @original_y = 0 + @x = 0 + @y = 0 + @real_x = 0 + @real_y = 0 + @width = 1 + @height = 1 + @sprite_size = [Game_Map::TILE_WIDTH, Game_Map::TILE_HEIGHT] + @tile_id = 0 + @character_name = "" + @character_hue = 0 + @opacity = 255 + @blend_type = 0 + @direction = 2 + @pattern = 0 + @pattern_surf = 0 + @lock_pattern = false + @move_route_forcing = false + @through = false + @animation_id = 0 + @transparent = false + @original_direction = 2 + @original_pattern = 0 + @move_type = 0 + self.move_speed = 3 + self.move_frequency = 6 + @move_route = nil + @move_route_index = 0 + @original_move_route = nil @original_move_route_index = 0 - @walk_anime = true # Whether character should animate while moving - @step_anime = false # Whether character should animate while still - @direction_fix = false - @always_on_top = false - @anime_count = 0 - @stop_count = 0 - @jump_peak = 0 # Max height while jumping - @jump_distance = 0 # Total distance of jump - @jump_distance_left = 0 # Distance left to travel - @jump_count = 0 # Frames left in a stationary jump - @bob_height = 0 - @wait_count = 0 - @moved_this_frame = false - @locked = false - @prelock_direction = 0 + @walk_anime = true # Whether character should animate while moving + @step_anime = false # Whether character should animate while still + @direction_fix = false + @always_on_top = false + @anime_count = 0 + @stop_count = 0 + @jump_peak = 0 # Max height while jumping + @jump_distance = 0 # Total distance of jump + @jump_distance_left = 0 # Distance left to travel + @jump_count = 0 # Frames left in a stationary jump + @bob_height = 0 + @wait_count = 0 + @moved_this_frame = false + @locked = false + @prelock_direction = 0 end def at_coordinate?(check_x, check_y) return check_x >= @x && check_x < @x + @width && - check_y > @y - @height && check_y <= @y + check_y > @y - @height && check_y <= @y end def in_line_with_coordinate?(check_x, check_y) return (check_x >= @x && check_x < @x + @width) || - (check_y > @y - @height && check_y <= @y) + (check_y > @y - @height && check_y <= @y) end def each_occupied_tile @@ -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 @@ -120,7 +120,7 @@ class Game_Character end def jump_speed_real - self.jump_speed_real = (2 ** (3 + 1)) * 0.8 if !@jump_speed_real # 3 is walking speed + self.jump_speed_real = (2 ** (3 + 1)) * 0.8 if !@jump_speed_real # 3 is walking speed return @jump_speed_real end @@ -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 @@ -161,13 +161,13 @@ class Game_Character def lock return if @locked - @prelock_direction = 0 # Was @direction but disabled + @prelock_direction = 0 # Was @direction but disabled turn_toward_player @locked = true end def minilock - @prelock_direction = 0 # Was @direction but disabled + @prelock_direction = 0 # Was @direction but disabled @locked = true end @@ -193,7 +193,7 @@ class Game_Character end def cancelMoveRoute() - @move_route=nil + @move_route = nil @move_route_forcing = false end @@ -246,19 +246,19 @@ class Game_Character def can_move_from_coordinate?(start_x, start_y, dir, strict = false) case dir - when 2, 8 # Down, up + when 2, 8 # Down, up y_diff = (dir == 8) ? @height - 1 : 0 for i in start_x...(start_x + @width) return false if !passable?(i, start_y - y_diff, dir, strict) end return true - when 4, 6 # Left, right + when 4, 6 # Left, right x_diff = (dir == 6) ? @width - 1 : 0 for i in (start_y - @height + 1)..start_y return false if !passable?(start_x + x_diff, i, dir, strict) end return true - when 1, 3 # Down diagonals + when 1, 3 # Down diagonals # Treated as moving down first and then horizontally, because that # describes which tiles the character's feet touch for i in start_x...(start_x + @width) @@ -269,7 +269,7 @@ class Game_Character return false if !passable?(start_x + x_diff, i + 1, dir + 3, strict) end return true - when 7, 9 # Up diagonals + when 7, 9 # Up diagonals # Treated as moving horizontally first and then up, because that describes # which tiles the character's feet touch x_diff = (dir == 9) ? @width - 1 : 0 @@ -308,11 +308,11 @@ class Game_Character ret = screen_y_ground if jumping? if @jump_count > 0 - jump_fraction = ((@jump_count * jump_speed_real / Game_Map::REAL_RES_X) - 0.5).abs # 0.5 to 0 to 0.5 + jump_fraction = ((@jump_count * jump_speed_real / Game_Map::REAL_RES_X) - 0.5).abs # 0.5 to 0 to 0.5 else - jump_fraction = ((@jump_distance_left / @jump_distance) - 0.5).abs # 0.5 to 0 to 0.5 + 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 @@ -337,7 +337,7 @@ class Game_Character #============================================================================= def moving? return @real_x != @x * Game_Map::REAL_RES_X || - @real_y != @y * Game_Map::REAL_RES_Y + @real_y != @y * Game_Map::REAL_RES_Y end def jumping? @@ -352,14 +352,14 @@ class Game_Character def force_move_route(move_route) if @original_move_route == nil - @original_move_route = @move_route + @original_move_route = @move_route @original_move_route_index = @move_route_index end - @move_route = move_route - @move_route_index = 0 + @move_route = move_route + @move_route_index = 0 @move_route_forcing = true - @prelock_direction = 0 - @wait_count = 0 + @prelock_direction = 0 + @wait_count = 0 move_type_custom 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 @@ -423,7 +429,7 @@ class Game_Character else if @move_route_forcing @move_route_forcing = false - @move_route = @original_move_route + @move_route = @original_move_route @move_route_index = @original_move_route_index @original_move_route = nil end @@ -433,42 +439,67 @@ 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 end - if command.code == 15 # Wait + if command.code == 15 # Wait @wait_count = (command.parameters[0] * Graphics.frame_rate / 20) - 1 @move_route_index += 1 return 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) - @x -= 1 - @y += 1 - increase_steps + 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 end - @through=false 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) - @x += 1 - @y += 1 - increase_steps - end - @through=false - 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 + 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 end end - def moveRight90 # clockwise + 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_left # down - when 4 then move_up # left - when 6 then move_down # right - when 8 then move_right # 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 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) - dirs = [] # 0=down, 1=left, 2=right, 3=up - if xrange<0 + def move_random_range(xrange = -1, yrange = -1) + dirs = [] # 0=down, 1=left, 2=right, 3=up + 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 @@ -740,14 +889,15 @@ class Game_Character @y = @y + y_plus real_distance = Math::sqrt(x_plus * x_plus + y_plus * y_plus) distance = [1, real_distance].max - @jump_peak = distance * Game_Map::TILE_HEIGHT * 3 / 8 # 3/4 of tile for ledge jumping + @jump_peak = distance * Game_Map::TILE_HEIGHT * 3 / 8 # 3/4 of tile for ledge jumping @jump_distance = [x_plus.abs * Game_Map::REAL_RES_X, y_plus.abs * Game_Map::REAL_RES_Y].max - @jump_distance_left = 1 # Just needs to be non-zero - if real_distance > 0 # Jumping to somewhere else + @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 - @jump_speed_real = nil # Reset jump speed - @jump_count = Game_Map::REAL_RES_X / jump_speed_real # Number of frames to jump one tile + 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 @stop_count = 0 if self.is_a?(Game_Player) @@ -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 @@ -914,7 +1102,7 @@ class Game_Character end # Refresh how far is left to travel in a jump if jumping? - @jump_count -= 1 if @jump_count > 0 # For stationary jumps only + @jump_count -= 1 if @jump_count > 0 # For stationary jumps only @jump_distance_left = [(dest_x - @real_x).abs, (dest_y - @real_y).abs].max end # End of a step, so perform events that happen at this time @@ -922,7 +1110,7 @@ class Game_Character Events.onStepTakenFieldMovement.trigger(self, self) calculate_bush_depth @stopped_this_frame = true - elsif !@moved_last_frame || @stopped_last_frame # Started a new step + elsif !@moved_last_frame || @stopped_last_frame # Started a new step calculate_bush_depth @stopped_this_frame = false end @@ -933,14 +1121,14 @@ class Game_Character def update_stop @anime_count += 1 if @step_anime - @stop_count += 1 if !@starting && !lock? + @stop_count += 1 if !@starting && !lock? @moved_this_frame = false @stopped_this_frame = false end 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 @@ -958,7 +1146,7 @@ class Game_Character # game uses square tiles. real_speed = (jumping?) ? jump_speed_real : move_speed_real frames_per_pattern = Game_Map::REAL_RES_X / (real_speed * 2.0) - frames_per_pattern *= 2 if move_speed >= 5 # Cycling speed or faster + frames_per_pattern *= 2 if move_speed >= 5 # Cycling speed or faster return if @anime_count < frames_per_pattern # Advance to the next animation frame @pattern = (@pattern + 1) % 4 diff --git a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb index 6adf99cfa..4380d037f 100644 --- a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb +++ b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb @@ -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 diff --git a/Data/Scripts/014_Pokemon/001_Pokemon.rb b/Data/Scripts/014_Pokemon/001_Pokemon.rb index e7c1ca560..fa9a7b395 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon.rb @@ -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] diff --git a/Data/Scripts/049_Compatibility/Constants.rb b/Data/Scripts/049_Compatibility/Constants.rb index 19573387f..8a1ba8149 100644 --- a/Data/Scripts/049_Compatibility/Constants.rb +++ b/Data/Scripts/049_Compatibility/Constants.rb @@ -18,4 +18,10 @@ EGGINITIALLEVEL=Settings::EGG_LEVEL #this is fucking stupid but apparently necessary FALSE = false -TRUE = true \ No newline at end of file +TRUE = true + + +DIRECTION_LEFT=4 +DIRECTION_RIGHT=6 +DIRECTION_DOWN=2 +DIRECTION_UP=8 \ No newline at end of file diff --git a/Data/System.rxdata b/Data/System.rxdata index 3524b4aed86b4de0618fd3523ab721c9425e7939..f934eef0e4fa26b4ca52245c8d23ef942887b248 100644 GIT binary patch delta 26 icmaEOo$=vy#tpB;nCH55Yy62$bHaWiw~JthFIzzdiF delta 26 icmaEOo$=vy#tpB;n4O=l+5A>aB#7xc(`M$(drSbd0SoW|