Class: RPG::UsableItem
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
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_id ⇒ Object
Returns the value of attribute animation_id.
799
800
801
|
# File 'lib/R3EXS/RGSS3.rb', line 799
def animation_id
@animation_id
end
|
#damage ⇒ Object
Returns the value of attribute damage.
804
805
806
|
# File 'lib/R3EXS/RGSS3.rb', line 804
def damage
@damage
end
|
#effects ⇒ Object
Returns the value of attribute effects.
805
806
807
|
# File 'lib/R3EXS/RGSS3.rb', line 805
def effects
@effects
end
|
#hit_type ⇒ Object
Returns the value of attribute hit_type.
803
804
805
|
# File 'lib/R3EXS/RGSS3.rb', line 803
def hit_type
@hit_type
end
|
#occasion ⇒ Object
Returns the value of attribute occasion.
797
798
799
|
# File 'lib/R3EXS/RGSS3.rb', line 797
def occasion
@occasion
end
|
#repeats ⇒ Object
Returns the value of attribute repeats.
801
802
803
|
# File 'lib/R3EXS/RGSS3.rb', line 801
def repeats
@repeats
end
|
#scope ⇒ Object
Returns the value of attribute scope.
796
797
798
|
# File 'lib/R3EXS/RGSS3.rb', line 796
def scope
@scope
end
|
#speed ⇒ Object
Returns the value of attribute speed.
798
799
800
|
# File 'lib/R3EXS/RGSS3.rb', line 798
def speed
@speed
end
|
#success_rate ⇒ Object
Returns the value of attribute success_rate.
800
801
802
|
# File 'lib/R3EXS/RGSS3.rb', line 800
def success_rate
@success_rate
end
|
#tp_gain ⇒ Object
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
776
777
778
|
# File 'lib/R3EXS/RGSS3.rb', line 776
def battle_ok?
[0, 1].include?(@occasion)
end
|
#certain? ⇒ Boolean
784
785
786
|
# File 'lib/R3EXS/RGSS3.rb', line 784
def certain?
@hit_type == 0
end
|
#for_all? ⇒ Boolean
768
769
770
|
# File 'lib/R3EXS/RGSS3.rb', line 768
def for_all?
[2, 8, 10].include?(@scope)
end
|
#for_dead_friend? ⇒ Boolean
748
749
750
|
# File 'lib/R3EXS/RGSS3.rb', line 748
def for_dead_friend?
[9, 10].include?(@scope)
end
|
#for_friend? ⇒ 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
756
757
758
|
# File 'lib/R3EXS/RGSS3.rb', line 756
def for_one?
[1, 3, 7, 9, 11].include?(@scope)
end
|
#for_opponent? ⇒ 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
760
761
762
|
# File 'lib/R3EXS/RGSS3.rb', line 760
def for_random?
[3, 4, 5, 6].include?(@scope)
end
|
#for_user? ⇒ Boolean
752
753
754
|
# File 'lib/R3EXS/RGSS3.rb', line 752
def for_user?
@scope == 11
end
|
#magical? ⇒ Boolean
792
793
794
|
# File 'lib/R3EXS/RGSS3.rb', line 792
def magical?
@hit_type == 2
end
|
780
781
782
|
# File 'lib/R3EXS/RGSS3.rb', line 780
def
[0, 2].include?(@occasion)
end
|
#need_selection? ⇒ Boolean
772
773
774
|
# File 'lib/R3EXS/RGSS3.rb', line 772
def need_selection?
[1, 7, 9].include?(@scope)
end
|
#number_of_targets ⇒ Object
764
765
766
|
# File 'lib/R3EXS/RGSS3.rb', line 764
def number_of_targets
for_random? ? @scope - 2 : 0
end
|
#physical? ⇒ Boolean
788
789
790
|
# File 'lib/R3EXS/RGSS3.rb', line 788
def physical?
@hit_type == 1
end
|