Module: Battle::VisualMock

Defined in:
scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb

Overview

Module responsive of mocking the battle visual so nothing happen on the reality

Note: super inside this script might call the original function

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(mod)

Method called when a visual gets mocked (through extend)

Parameters:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb', line 9

def extended(mod)
  mod.instance_variable_set(:@screenshot, nil)
  mod.instance_variable_set(:@viewport, nil)
  mod.instance_variable_set(:@viewport_sub, nil)
  mod.instance_variable_set(:@battlers, {})
  mod.instance_variable_set(:@info_bars, {})
  mod.instance_variable_set(:@team_info, {})
  mod.instance_variable_set(:@ability_bars, {})
  mod.instance_variable_set(:@item_bars, {})
  mod.instance_variable_set(:@item_bars, {})
  mod.instance_variable_set(:@animations, [])
  mod.instance_variable_set(:@animatable, [])
  mod.instance_variable_set(:@parallel_animations, {})
  mod.instance_variable_set(:@to_dispose, [])
  mod.instance_variable_set(:@locking, false)
end

Instance Method Details

#hide_team_info

Hide team info



103
104
105
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb', line 103

def hide_team_info
  return
end

#lock

Lock the battle scene



28
29
30
31
32
33
34
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb', line 28

def lock
  if block_given?
    @locking = true
    yield
    return @locking = false
  end
end

#refresh_info_bar(pokemon)

Refresh a specific bar (when Pokemon loses HP or change state)

Parameters:



71
72
73
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb', line 71

def refresh_info_bar(pokemon)
  return
end

#set_info_state(state, pokemon = nil)

Set the state info

Parameters:

  • state (Symbol)

    kind of state (:choice, :move, :move_animation)

  • pokemon (Array<PFM::PokemonBattler>) (defaults to: nil)

    optional list of Pokemon to show (move)



93
94
95
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb', line 93

def set_info_state(state, pokemon = nil)
  return
end

#show_ability(target)

Show the ability animation

Parameters:



38
39
40
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb', line 38

def show_ability(target)
  return
end

#show_exp_distribution(exp_data)

Show the exp distribution

Parameters:



44
45
46
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb', line 44

def show_exp_distribution(exp_data)
  return
end

#show_hp_animations(targets, hps, effectiveness = [], &messages)

Show HP animations

Parameters:

  • targets (Array<PFM::PokemonBattler>)
  • hps (Array<Integer>)
  • effectiveness (Array<Integer, nil>) (defaults to: [])
  • messages (Proc)

    messages shown right before the post processing



80
81
82
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb', line 80

def show_hp_animations(targets, hps, effectiveness = [], &messages)
  return
end

#show_item(target)

Show the item user animation

Parameters:



65
66
67
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb', line 65

def show_item(target)
  return
end

#show_move_animation(user, targets, move)

Make a move animation

Parameters:



111
112
113
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb', line 111

def show_move_animation(user, targets, move)
  return
end

#show_pokemon_choice(forced = false) ⇒ PFM::PokemonBattler?

Method that show the pokemon choice

Parameters:

  • forced (Boolean) (defaults to: false)

Returns:



51
52
53
54
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb', line 51

def show_pokemon_choice(forced = false)
  log_error("show_pokemon_choice was called inside mock by #{caller[0]}")
  return
end

#show_rmxp_animation(target, id)

Show a dedicated animation

Parameters:



59
60
61
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb', line 59

def show_rmxp_animation(target, id)
  return
end

#show_switch_form_animation(target)

Show the pokemon switch form animation

Parameters:



86
87
88
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb', line 86

def show_switch_form_animation(target)
  return
end

#wait_for_animation

Wait for all animation to end (non parallel one)



98
99
100
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00002 BattleVisualMock.rb', line 98

def wait_for_animation
  return
end