Class: BattleUI::PokemonSprite

Overview

Sprite of a Pokemon in the battle

Direct Known Subclasses

PokemonSprite3D, UI::ContestCreatureSprite

Constant Summary collapse

DELTA_DEATH_Y =

Constant giving the deat Delta Y (you need to adjust that so your screen animation are OK when Pokemon are KO)

32
STATUS_SE =

Sound effect corresponding to the status

{poison: 'moves/poison', toxic: 'moves/poison', confusion: 'moves/confusion', sleep: 'moves/asleep', freeze: 'moves/freeze', paralysis: 'moves/paralysis', burn: 'moves/burn', attract: 'moves/attract'}
STATUS_TONE =

Tone according to the status

{neutral: [0, 0, 0, 0, 0], poison: [0.4, 0, 0.49, 0.6, 0], toxic: [0.4, 0, 0.49, 0.6, 0], freeze: [0.23, 0.56, 1, 0.6, 0.6], paralysis: [0.39, 0.47, 0, 0.6, 0], burn: [0.45, 0, 0, 0.8, 0], confusion: [0, 0, 0, 0, 0], sleep: [0, 0, 0, 0, 0], ko: [0, 0, 0, 0, 0], flinch: [0, 0, 0, 0, 0], attract: [0, 0, 0, 0, 0]}

Instance Attribute Summary collapse

Attributes inherited from LiteRGSS::ShaderedSprite

#blendmode, #shader

Attributes inherited from LiteRGSS::Sprite

#__index__, #angle, #bitmap, #height, #mirror, #opacity, #ox, #oy, #src_rect, #viewport, #visible, #width, #x, #y, #z, #zoom, #zoom_x, #zoom_y

Instance Method Summary collapse

Methods included from Shader::CreatureShaderLoader

#find_shader_id, #load_shader, #load_shader_properties

Methods included from MultiplePosition

#enemy?

Methods included from GoingInOut

#go_in, #go_out, #in?, #out?

Methods inherited from Sprite

#load, #mouse_in?, #set_origin_div, #set_rect, #set_rect_div, #set_z, #simple_mouse_in?, #translate_mouse_coords

Methods inherited from LiteRGSS::Disposable

#dispose, #disposed?

Constructor Details

#initialize(viewport, scene) ⇒ PokemonSprite

Create a new PokemonSprite

Parameters:



713
714
# File 'docs/5_Battle_01_Scene.rb', line 713

def initialize(viewport, scene)
end

Instance Attribute Details

#animation_handler ⇒ Yuki::Animation::Handler{ Symbol => Yuki::AnimationMixin} (readonly)

Get the animation handler



691
692
693
# File 'docs/5_Battle_01_Scene.rb', line 691

def animation_handler
  @animation_handler
end

#animation_tone ⇒ Yuki::TimedLoopAnimation

Get the animation linked to a status tone

Returns:

  • (Yuki::TimedLoopAnimation)


703
704
705
# File 'docs/5_Battle_01_Scene.rb', line 703

def animation_tone
  @animation_tone
end

#bank ⇒ Integer (readonly)

Get the bank of the pokemon shown by the sprite

Returns:

  • (Integer)


697
698
699
# File 'docs/5_Battle_01_Scene.rb', line 697

def bank
  @bank
end

#pokemon ⇒ PFM::PokemonBattler

Get the Pokemon shown by the sprite

Returns:



688
689
690
# File 'docs/5_Battle_01_Scene.rb', line 688

def pokemon
  @pokemon
end

#position ⇒ Integer (readonly)

Get the position of the pokemon shown by the sprite

Returns:

  • (Integer)


694
695
696
# File 'docs/5_Battle_01_Scene.rb', line 694

def position
  @position
end

#scene ⇒ Battle::Scene (readonly)

Get the scene linked to this object

Returns:



700
701
702
# File 'docs/5_Battle_01_Scene.rb', line 700

def scene
  @scene
end

#selected ⇒ Boolean

Tell if the sprite is currently selected

Returns:

  • (Boolean)


682
683
684
# File 'docs/5_Battle_01_Scene.rb', line 682

def selected
  @selected
end

#stop_gif_animation ⇒ Boolean

Stop the gif animation

Returns:

  • (Boolean)


709
710
711
# File 'docs/5_Battle_01_Scene.rb', line 709

def stop_gif_animation
  @stop_gif_animation
end

#stop_status_tone ⇒ Boolean

Stop the animation linked to the status tone

Returns:

  • (Boolean)


706
707
708
# File 'docs/5_Battle_01_Scene.rb', line 706

def stop_status_tone
  @stop_status_tone
end

#temporary_substitute_overwrite ⇒ Boolean

Tell if the sprite is temporary showed while in the Substitute state

Returns:

  • (Boolean)


685
686
687
# File 'docs/5_Battle_01_Scene.rb', line 685

def temporary_substitute_overwrite
  @temporary_substitute_overwrite
end

Instance Method Details

#bitmap=(bitmap)

Set the bitmap of the sprite

Parameters:



771
772
# File 'docs/5_Battle_01_Scene.rb', line 771

def bitmap=(bitmap)
end

#center_camera(use_position = true)

Note:

can't send resolved parameter through Visual so PokemonSprite is used as an intermediary

Move the camera to the battler sprite

Parameters:

  • use_position (Boolean) (defaults to: true) —

    if the position should be used



837
838
# File 'docs/5_Battle_01_Scene.rb', line 837

def center_camera(use_position = true)
end

#change_stat_animation(amount)

Create a stat change animation



800
801
# File 'docs/5_Battle_01_Scene.rb', line 800

def change_stat_animation(amount)
end

#create_animation

Create the animation



716
717
# File 'docs/5_Battle_01_Scene.rb', line 716

def create_animation
end

#cry(dying = false)

Play the cry of the Pokemon

Parameters:

  • dying (Boolean) (defaults to: false) —

    if the Pokemon is dying



731
732
# File 'docs/5_Battle_01_Scene.rb', line 731

def cry(dying = false)
end

#done? ⇒ Boolean

Tell if the sprite animations are done

Returns:

  • (Boolean)


723
724
# File 'docs/5_Battle_01_Scene.rb', line 723

def done?
end

#flee_animation ⇒ Yuki::AnimationMixin

Creates the flee animation



779
780
# File 'docs/5_Battle_01_Scene.rb', line 779

def flee_animation
end

#opacity=(opacity)

Set the opacity of the sprite

Parameters:

  • opacity (Integer)


767
768
# File 'docs/5_Battle_01_Scene.rb', line 767

def opacity=(opacity)
end

#remove_tone_animation

remove tone animation



803
804
# File 'docs/5_Battle_01_Scene.rb', line 803

def remove_tone_animation
end

#reset_tone_status

Reset the tone inflicted by the animation



813
814
# File 'docs/5_Battle_01_Scene.rb', line 813

def reset_tone_status
end

#set_origin(ox, oy) ⇒ self

Set the origin of the sprite & the shadow

Parameters:

  • ox (Numeric)
  • oy (Numeric)

Returns:

  • (self)


737
738
# File 'docs/5_Battle_01_Scene.rb', line 737

def set_origin(ox, oy)
end

#set_position(x, y) ⇒ self

Set the position of the sprite

Parameters:

  • x (Numeric)
  • y (Numeric)

Returns:

  • (self)


755
756
# File 'docs/5_Battle_01_Scene.rb', line 755

def set_position(x, y)
end

#set_tone_status(status, switch = false)

Create a tone status animation

Parameters:

  • status (Symbol, Integer) —

    corresponding to the status of the sprite

  • switch (Boolean) (defaults to: false) —

    tell if the method is called from a switch



797
798
# File 'docs/5_Battle_01_Scene.rb', line 797

def set_tone_status(status, switch = false)
end

#set_tone_to(red, green, blue, alpha)

Set a tone on the PokemonSprite

Parameters:

  • red (Float)
  • green (Float)
  • blue (Float)
  • alpha (Float)


810
811
# File 'docs/5_Battle_01_Scene.rb', line 810

def set_tone_to(red, green, blue, alpha)
end

#shiny_animation

Create a shiny animation



788
789
# File 'docs/5_Battle_01_Scene.rb', line 788

def shiny_animation
end

#sprite_zoom ⇒ Integer

Pokemon sprite zoom

Returns:

  • (Integer)


828
829
# File 'docs/5_Battle_01_Scene.rb', line 828

def sprite_zoom
end

#sprite_zoom_battle_animation ⇒ Integer

Pokemon sprite zoom used in battle animations

Returns:

  • (Integer)


832
833
# File 'docs/5_Battle_01_Scene.rb', line 832

def sprite_zoom_battle_animation
end

#status_animation(status)

Create a status animation

Parameters:

  • status (Symbol)


792
793
# File 'docs/5_Battle_01_Scene.rb', line 792

def status_animation(status)
end

#substitute_animations_speed ⇒ Float

Return the Substitute animations speed

Returns:

  • (Float)


824
825
# File 'docs/5_Battle_01_Scene.rb', line 824

def substitute_animations_speed
end

#switch_from_substitute_animation

Creates the switch from substitute animation



785
786
# File 'docs/5_Battle_01_Scene.rb', line 785

def switch_from_substitute_animation
end

#switch_to_substitute_animation

Creates the switch to substitute animation



782
783
# File 'docs/5_Battle_01_Scene.rb', line 782

def switch_to_substitute_animation
end

#switch_to_substitute_sprite

Directly switch the PokemonSprite appearance to the substitute appearance



820
821
# File 'docs/5_Battle_01_Scene.rb', line 820

def switch_to_substitute_sprite
end

#under_substitute_effect? ⇒ Boolean

Tell if the Pokemon represented by this sprite is under the effect of Substitute

Returns:

  • (Boolean)


817
818
# File 'docs/5_Battle_01_Scene.rb', line 817

def under_substitute_effect?
end

#update

Update the sprite



719
720
# File 'docs/5_Battle_01_Scene.rb', line 719

def update
end

#visible=(visible)

Set the visibility of the sprite

Parameters:

  • visible (Boolean)


775
776
# File 'docs/5_Battle_01_Scene.rb', line 775

def visible=(visible)
end

#x=(x)

Set the x position of the sprite

Parameters:

  • x (Numeric)


763
764
# File 'docs/5_Battle_01_Scene.rb', line 763

def x=(x)
end

#y=(y)

Set the y position of the sprite

Parameters:

  • y (Numeric)


759
760
# File 'docs/5_Battle_01_Scene.rb', line 759

def y=(y)
end

#zoom=(zoom)

Set the zoom of the sprite

Parameters:

  • zoom (Float)


741
742
# File 'docs/5_Battle_01_Scene.rb', line 741

def zoom=(zoom)
end

#zoom_x=(zoom)

Set the zoom_x of the sprite

Parameters:

  • zoom (Float)


745
746
# File 'docs/5_Battle_01_Scene.rb', line 745

def zoom_x=(zoom)
end

#zoom_y=(zoom)

Set the zoom_y of the sprite

Parameters:

  • zoom (Float)


749
750
# File 'docs/5_Battle_01_Scene.rb', line 749

def zoom_y=(zoom)
end