Class: RPG::UsableItem

Inherits:
BaseItem show all
Defined in:
lib/R3EXS/RGSS3.rb

Direct Known Subclasses

Item, Skill

Defined Under Namespace

Classes: Damage, Effect

Instance Attribute Summary collapse

Attributes inherited from BaseItem

#description, #features, #icon_index, #id, #name, #note

Instance Method Summary collapse

Constructor Details

#initializeUsableItem

Returns a new instance of UsableItem.



726
727
728
729
730
731
732
733
734
735
736
737
738
# File 'lib/R3EXS/RGSS3.rb', line 726

def initialize
    super
    @scope        = 0
    @occasion     = 0
    @speed        = 0
    @success_rate = 100
    @repeats      = 1
    @tp_gain      = 0
    @hit_type     = 0
    @animation_id = 0
    @damage       = RPG::UsableItem::Damage.new
    @effects      = []
end

Instance Attribute Details

#animation_idObject

Returns the value of attribute animation_id.



799
800
801
# File 'lib/R3EXS/RGSS3.rb', line 799

def animation_id
  @animation_id
end

#damageObject

Returns the value of attribute damage.



804
805
806
# File 'lib/R3EXS/RGSS3.rb', line 804

def damage
  @damage
end

#effectsObject

Returns the value of attribute effects.



805
806
807
# File 'lib/R3EXS/RGSS3.rb', line 805

def effects
  @effects
end

#hit_typeObject

Returns the value of attribute hit_type.



803
804
805
# File 'lib/R3EXS/RGSS3.rb', line 803

def hit_type
  @hit_type
end

#occasionObject

Returns the value of attribute occasion.



797
798
799
# File 'lib/R3EXS/RGSS3.rb', line 797

def occasion
  @occasion
end

#repeatsObject

Returns the value of attribute repeats.



801
802
803
# File 'lib/R3EXS/RGSS3.rb', line 801

def repeats
  @repeats
end

#scopeObject

Returns the value of attribute scope.



796
797
798
# File 'lib/R3EXS/RGSS3.rb', line 796

def scope
  @scope
end

#speedObject

Returns the value of attribute speed.



798
799
800
# File 'lib/R3EXS/RGSS3.rb', line 798

def speed
  @speed
end

#success_rateObject

Returns the value of attribute success_rate.



800
801
802
# File 'lib/R3EXS/RGSS3.rb', line 800

def success_rate
  @success_rate
end

#tp_gainObject

Returns the value of attribute tp_gain.



802
803
804
# File 'lib/R3EXS/RGSS3.rb', line 802

def tp_gain
  @tp_gain
end

Instance Method Details

#battle_ok?Boolean

Returns:

  • (Boolean)


776
777
778
# File 'lib/R3EXS/RGSS3.rb', line 776

def battle_ok?
    [0, 1].include?(@occasion)
end

#certain?Boolean

Returns:

  • (Boolean)


784
785
786
# File 'lib/R3EXS/RGSS3.rb', line 784

def certain?
    @hit_type == 0
end

#for_all?Boolean

Returns:

  • (Boolean)


768
769
770
# File 'lib/R3EXS/RGSS3.rb', line 768

def for_all?
    [2, 8, 10].include?(@scope)
end

#for_dead_friend?Boolean

Returns:

  • (Boolean)


748
749
750
# File 'lib/R3EXS/RGSS3.rb', line 748

def for_dead_friend?
    [9, 10].include?(@scope)
end

#for_friend?Boolean

Returns:

  • (Boolean)


744
745
746
# File 'lib/R3EXS/RGSS3.rb', line 744

def for_friend?
    [7, 8, 9, 10, 11].include?(@scope)
end

#for_one?Boolean

Returns:

  • (Boolean)


756
757
758
# File 'lib/R3EXS/RGSS3.rb', line 756

def for_one?
    [1, 3, 7, 9, 11].include?(@scope)
end

#for_opponent?Boolean

Returns:

  • (Boolean)


740
741
742
# File 'lib/R3EXS/RGSS3.rb', line 740

def for_opponent?
    [1, 2, 3, 4, 5, 6].include?(@scope)
end

#for_random?Boolean

Returns:

  • (Boolean)


760
761
762
# File 'lib/R3EXS/RGSS3.rb', line 760

def for_random?
    [3, 4, 5, 6].include?(@scope)
end

#for_user?Boolean

Returns:

  • (Boolean)


752
753
754
# File 'lib/R3EXS/RGSS3.rb', line 752

def for_user?
    @scope == 11
end

#magical?Boolean

Returns:

  • (Boolean)


792
793
794
# File 'lib/R3EXS/RGSS3.rb', line 792

def magical?
    @hit_type == 2
end

Returns:

  • (Boolean)


780
781
782
# File 'lib/R3EXS/RGSS3.rb', line 780

def menu_ok?
    [0, 2].include?(@occasion)
end

#need_selection?Boolean

Returns:

  • (Boolean)


772
773
774
# File 'lib/R3EXS/RGSS3.rb', line 772

def need_selection?
    [1, 7, 9].include?(@scope)
end

#number_of_targetsObject



764
765
766
# File 'lib/R3EXS/RGSS3.rb', line 764

def number_of_targets
    for_random? ? @scope - 2 : 0
end

#physical?Boolean

Returns:

  • (Boolean)


788
789
790
# File 'lib/R3EXS/RGSS3.rb', line 788

def physical?
    @hit_type == 1
end