Class: Scene_Skill

Inherits:
Scene_ItemBase show all
Defined in:
Scene_Skill.rb

Overview

** Scene_Skill


This class performs skill screen processing. Skills are handled as items for

the sake of process sharing.

Instance Method Summary (collapse)

Methods inherited from Scene_ItemBase

#activate_item_window, #check_common_event, #create_actor_window, #cursor_left?, #determine_item, #hide_sub_window, #item, #item_effects_valid?, #item_target_actors, #item_usable?, #on_actor_cancel, #on_actor_ok, #show_sub_window, #use_item_to_actors

Methods inherited from Scene_MenuBase

#create_background, #create_help_window, #dispose_background, #next_actor, #prev_actor, #terminate

Methods inherited from Scene_Base

#check_gameover, #create_main_viewport, #dispose_all_windows, #dispose_main_viewport, #fadeout_all, #main, #perform_transition, #post_start, #pre_terminate, #return_scene, #scene_changing?, #terminate, #transition_speed, #update, #update_all_windows, #update_basic

Instance Method Details

- (Object) command_skill


  • Skill

    Command




67
68
69
70
# File 'Scene_Skill.rb', line 67

def command_skill
  @item_window.activate
  @item_window.select_last
end

- (Object) create_command_window


  • Create Command Window




22
23
24
25
26
27
28
29
30
31
32
# File 'Scene_Skill.rb', line 22

def create_command_window
  wy = @help_window.height
  @command_window = Window_SkillCommand.new(0, wy)
  @command_window.viewport = @viewport
  @command_window.help_window = @help_window
  @command_window.actor = @actor
  @command_window.set_handler(:skill,    method(:command_skill))
  @command_window.set_handler(:cancel,   method(:return_scene))
  @command_window.set_handler(:pagedown, method(:next_actor))
  @command_window.set_handler(:pageup,   method(:prev_actor))
end

- (Object) create_item_window


  • Create Item Window




45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'Scene_Skill.rb', line 45

def create_item_window
  wx = 0
  wy = @status_window.y + @status_window.height
  ww = Graphics.width
  wh = Graphics.height - wy
  @item_window = Window_SkillList.new(wx, wy, ww, wh)
  @item_window.actor = @actor
  @item_window.viewport = @viewport
  @item_window.help_window = @help_window
  @item_window.set_handler(:ok,     method(:on_item_ok))
  @item_window.set_handler(:cancel, method(:on_item_cancel))
  @command_window.skill_window = @item_window
end

- (Object) create_status_window


  • Create Status Window




36
37
38
39
40
41
# File 'Scene_Skill.rb', line 36

def create_status_window
  y = @help_window.height
  @status_window = Window_SkillStatus.new(@command_window.width, y)
  @status_window.viewport = @viewport
  @status_window.actor = @actor
end

- (Object) on_actor_change


  • Change Actors




102
103
104
105
106
107
# File 'Scene_Skill.rb', line 102

def on_actor_change
  @command_window.actor = @actor
  @status_window.actor = @actor
  @item_window.actor = @actor
  @command_window.activate
end

- (Object) on_item_cancel


  • Item [Cancel]




81
82
83
84
# File 'Scene_Skill.rb', line 81

def on_item_cancel
  @item_window.unselect
  @command_window.activate
end

- (Object) on_item_ok


  • Item [OK]




74
75
76
77
# File 'Scene_Skill.rb', line 74

def on_item_ok
  @actor.last_skill.object = item
  determine_item
end

- (Object) play_se_for_item


  • Play SE When Using Item




88
89
90
# File 'Scene_Skill.rb', line 88

def play_se_for_item
  Sound.play_use_skill
end

- (Object) start


  • Start Processing




12
13
14
15
16
17
18
# File 'Scene_Skill.rb', line 12

def start
  super
  create_help_window
  create_command_window
  create_status_window
  create_item_window
end

- (Object) use_item


  • Use Item




94
95
96
97
98
# File 'Scene_Skill.rb', line 94

def use_item
  super
  @status_window.refresh
  @item_window.refresh
end

- (Object) user


  • Get Skill's User




61
62
63
# File 'Scene_Skill.rb', line 61

def user
  @actor
end