RPG::UsableItem

Superclass of Skill and Item.

Superclass

Attributes

scope

Scope of the effects.

0: None
1: One Enemy
2: All Enemies
3: One Enemy Dual
4: One Random Enemy
5: 2 Random Enemies
6: 3 Random Enemies
7: One Ally
8: All Allies
9: One Ally (Dead)
10: All Allies (Dead)
11: The User
occasion

When the item/skill may be used.

0: Always
1: Only in Battle
2: Only from the Menu
3: Never
speed

The speed correction.

animation_id

The animation ID.

common_event_id

The Common Event ID.

base_damage

The base damage.

variance

The degree of variance.

atk_f

The factor of attack power.

spi_f

The factor of spirit.

physical_attack

Truth value of the [Physical Attack] option.

damage_to_mp

Truth value of the [Damage to MP] option.

absorb_damage

Truth value of the [Absorb Damage] option.

ignore_defense

Truth value of the [Ignore Defense] option.

element_set

Elements of the item. An Element ID array.

plus_state_set

States to add. A State ID array.

minus_state_set

States to cancel. A Stae ID array.

Methods

for_opponent?

Determines whether or not the area of effect is enemies. Returns true if the value of scope is 1, 2, 3, 4, 5, or 6.

for_friend?

Determines whether or not the area of effect is allies. Returns true if the value of scope is 7, 8, 9, 10, or 11.

for_dead_friend?

Determines whether or not the area of effect is downed allies. Returns true if the value of scope is 9 or 10.

for_user?

Determines whether or not the area of effect is the user. Returns true if the value of scope is 11.

for_one?

Determines whether or not the area of effect is one character. Returns true if the value of scope is 1, 3, 4, 7, 9, or 11.

for_two?

Determines whether or not the area of effect is two characters. Returns true if the value of scope is 5.

for_three?

Determines whether or not the area of effect is three characters. Returns true if the value of scope is 6.

for_random?

Determines whether or not the area of effect is random. Returns true if the value of scope is 4, 5, or 6.

for_all?

Determines whether or not the area of effect is everyone. Returns true if the value of scope is 2, 8, or 10.

dual?

Determines whether or not the area of effect is "One Enemy Dual." Returns true if the value of scope is 3.

need_selection?

Determines whether or not selection of the target is required. Returns true if the value of scope is 1, 3, 7, or 9.

battle_ok?

Determines if it may be used on the battle screen. Returns true if the value of occasion is 0 or 1.

menu_ok?

Determines if it may be used on the menu screen. Returns true if the value of occasion is 0 or 2.

Definition

module RPG
  class UsableItem < BaseItem
    def initialize
      super
      @scope = 0
      @occasion = 0
      @speed = 0
      @animation_id = 0
      @common_event_id = 0
      @base_damage = 0
      @variance = 20
      @atk_f = 0
      @spi_f = 0
      @physical_attack = false
      @damage_to_mp = false
      @absorb_damage = false
      @ignore_defense = false
      @element_set = []
      @plus_state_set = []
      @minus_state_set = []
    end
    def for_opponent?
      return [1, 2, 3, 4, 5, 6].include?(@scope)
    end
    def for_friend?
      return [7, 8, 9, 10, 11].include?(@scope)
    end
    def for_dead_friend?
      return [9, 10].include?(@scope)
    end
    def for_user?
      return [11].include?(@scope)
    end
    def for_one?
      return [1, 3, 4, 7, 9, 11].include?(@scope)
    end
    def for_two?
      return [5].include?(@scope)
    end
    def for_three?
      return [6].include?(@scope)
    end
    def for_random?
      return [4, 5, 6].include?(@scope)
    end
    def for_all?
      return [2, 8, 10].include?(@scope)
    end
    def dual?
      return [3].include?(@scope)
    end
    def need_selection?
      return [1, 3, 7, 9].include?(@scope)
    end
    def battle_ok?
      return [0, 1].include?(@occasion)
    end
    def menu_ok?
      return [0, 2].include?(@occasion)
    end
    attr_accessor :scope
    attr_accessor :occasion
    attr_accessor :speed
    attr_accessor :animation_id
    attr_accessor :common_event_id
    attr_accessor :base_damage
    attr_accessor :variance
    attr_accessor :atk_f
    attr_accessor :spi_f
    attr_accessor :physical_attack
    attr_accessor :damage_to_mp
    attr_accessor :absorb_damage
    attr_accessor :ignore_defense
    attr_accessor :element_set
    attr_accessor :plus_state_set
    attr_accessor :minus_state_set
  end
end
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)