This commit is contained in:
infinitefusion
2024-06-30 15:19:09 -04:00
21 changed files with 72 additions and 52 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,8 @@
#[FRAME1 [x,y]],[FRAME2 [x,y], etc.]
#
# exact number of pixels that the sprite needs to be moved for each frame
# add 2 pixels on even frames
module Outfit_Offsets
BASE_OFFSET = [[0, 0], [0, 0], [0, 0], [0, 0]]
@@ -24,4 +27,8 @@ module Outfit_Offsets
BIKE_OFFSETS_RIGHT = [[4, -4], [2, -2], [4, -4], [6, -2]]
BIKE_OFFSETS_UP = [[0, -2], [-2, 0], [0, -2], [2, 0]]
FISH_OFFSETS_DOWN = [[0, -6], [0, -2], [0, -8], [2, -6]]
FISH_OFFSETS_LEFT = [[0, -8], [-6, -6], [0, -8], [2, -8]]
FISH_OFFSETS_RIGHT = [[0, -8], [6, -6], [0, -8], [-2, -8]]
FISH_OFFSETS_UP = [[0, -6], [0, -6], [0, -6], [2, -4]]
end

View File

@@ -72,6 +72,16 @@ class Sprite_Wearable < RPG::Sprite
elsif direction == DIRECTION_UP
apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_UP,current_frame)
end
when "fish"
if direction == DIRECTION_DOWN
apply_sprite_offset(Outfit_Offsets::FISH_OFFSETS_DOWN,current_frame)
elsif direction == DIRECTION_LEFT
apply_sprite_offset( Outfit_Offsets::FISH_OFFSETS_LEFT,current_frame)
elsif direction == DIRECTION_RIGHT
apply_sprite_offset( Outfit_Offsets::FISH_OFFSETS_RIGHT,current_frame)
elsif direction == DIRECTION_UP
apply_sprite_offset( Outfit_Offsets::FISH_OFFSETS_UP,current_frame)
end
else
@sprite.x = @player_sprite.x - @player_sprite.ox
@sprite.y = @player_sprite.y - @player_sprite.oy
@@ -79,9 +89,10 @@ class Sprite_Wearable < RPG::Sprite
@sprite.y -= 2 if current_frame % 2 == 1
end
def animate(action)
def animate(action, frame=nil)
@action = action
current_frame = @player_sprite.character.pattern
current_frame = @player_sprite.character.pattern if !frame
direction = @player_sprite.character.direction
crop_spritesheet(direction)
set_sprite_position(@action, direction, current_frame)

View File

@@ -6,56 +6,56 @@ class Sprite_Hat < Sprite_Wearable
end
def set_sprite_position(action, direction, current_frame)
@sprite.x = @player_sprite.x - @player_sprite.ox
@sprite.y = @player_sprite.y - @player_sprite.oy
case action
when "run"
if direction == DIRECTION_DOWN
apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_DOWN, current_frame)
elsif direction == DIRECTION_LEFT
apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_LEFT, current_frame)
elsif direction == DIRECTION_RIGHT
apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_RIGHT, current_frame)
elsif direction == DIRECTION_UP
apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_UP, current_frame)
end
when "surf"
if direction == DIRECTION_DOWN
apply_sprite_offset(Outfit_Offsets::SURF_OFFSETS_DOWN,current_frame)
elsif direction == DIRECTION_LEFT
apply_sprite_offset( Outfit_Offsets::SURF_OFFSETS_LEFT,current_frame)
elsif direction == DIRECTION_RIGHT
apply_sprite_offset( Outfit_Offsets::SURF_OFFSETS_RIGHT,current_frame)
elsif direction == DIRECTION_UP
apply_sprite_offset( Outfit_Offsets::SURF_OFFSETS_UP,current_frame)
end
when "dive"
if direction == DIRECTION_DOWN
apply_sprite_offset(Outfit_Offsets::DIVE_OFFSETS_DOWN,current_frame)
elsif direction == DIRECTION_LEFT
apply_sprite_offset( Outfit_Offsets::DIVE_OFFSETS_LEFT,current_frame)
elsif direction == DIRECTION_RIGHT
apply_sprite_offset( Outfit_Offsets::DIVE_OFFSETS_RIGHT,current_frame)
elsif direction == DIRECTION_UP
apply_sprite_offset( Outfit_Offsets::DIVE_OFFSETS_UP,current_frame)
end
when "bike"
if direction == DIRECTION_DOWN
apply_sprite_offset(Outfit_Offsets::BIKE_OFFSETS_DOWN,current_frame)
elsif direction == DIRECTION_LEFT
apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_LEFT,current_frame)
elsif direction == DIRECTION_RIGHT
apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_RIGHT,current_frame)
elsif direction == DIRECTION_UP
apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_UP,current_frame)
end
else
@sprite.x = @player_sprite.x - @player_sprite.ox
@sprite.y = @player_sprite.y - @player_sprite.oy
end
@sprite.y -= 2 if current_frame % 2 == 1
end
# def set_sprite_position(action, direction, current_frame)
# @sprite.x = @player_sprite.x - @player_sprite.ox
# @sprite.y = @player_sprite.y - @player_sprite.oy
# case action
# when "run"
# if direction == DIRECTION_DOWN
# apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_DOWN, current_frame)
# elsif direction == DIRECTION_LEFT
# apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_LEFT, current_frame)
# elsif direction == DIRECTION_RIGHT
# apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_RIGHT, current_frame)
# elsif direction == DIRECTION_UP
# apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_UP, current_frame)
# end
# when "surf"
# if direction == DIRECTION_DOWN
# apply_sprite_offset(Outfit_Offsets::SURF_OFFSETS_DOWN,current_frame)
# elsif direction == DIRECTION_LEFT
# apply_sprite_offset( Outfit_Offsets::SURF_OFFSETS_LEFT,current_frame)
# elsif direction == DIRECTION_RIGHT
# apply_sprite_offset( Outfit_Offsets::SURF_OFFSETS_RIGHT,current_frame)
# elsif direction == DIRECTION_UP
# apply_sprite_offset( Outfit_Offsets::SURF_OFFSETS_UP,current_frame)
# end
# when "dive"
# if direction == DIRECTION_DOWN
# apply_sprite_offset(Outfit_Offsets::DIVE_OFFSETS_DOWN,current_frame)
# elsif direction == DIRECTION_LEFT
# apply_sprite_offset( Outfit_Offsets::DIVE_OFFSETS_LEFT,current_frame)
# elsif direction == DIRECTION_RIGHT
# apply_sprite_offset( Outfit_Offsets::DIVE_OFFSETS_RIGHT,current_frame)
# elsif direction == DIRECTION_UP
# apply_sprite_offset( Outfit_Offsets::DIVE_OFFSETS_UP,current_frame)
# end
# when "bike"
# if direction == DIRECTION_DOWN
# apply_sprite_offset(Outfit_Offsets::BIKE_OFFSETS_DOWN,current_frame)
# elsif direction == DIRECTION_LEFT
# apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_LEFT,current_frame)
# elsif direction == DIRECTION_RIGHT
# apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_RIGHT,current_frame)
# elsif direction == DIRECTION_UP
# apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_UP,current_frame)
# end
# else
# @sprite.x = @player_sprite.x - @player_sprite.ox
# @sprite.y = @player_sprite.y - @player_sprite.oy
# end
# @sprite.y -= 2 if current_frame % 2 == 1
# end
end

View File

@@ -1075,6 +1075,8 @@ ItemHandlers::UseOnPokemon.add(:ABILITYCAPSULE, proc { |item, pkmn, scene|
if scene.pbConfirm(_INTL("Would you like to change {1}'s Ability to {2}?",
pkmn.name, newabilname))
pkmn.ability_index = newabil
pkmn.ability = GameData::Ability.get((newabil == 0) ? abil1 : abil2).id
#pkmn.ability = GameData::Ability.get((newabil == 0) ? abil1 : abil2).id
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1}'s Ability changed to {2}!", pkmn.name, newabilname))

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.