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.
704
705
706
707
708
709
710
711
712
713
714
715
716
|
# File 'lib/R3EXS/RGSS3.rb', line 704
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.
777
778
779
|
# File 'lib/R3EXS/RGSS3.rb', line 777
def animation_id
@animation_id
end
|
#damage ⇒ Object
Returns the value of attribute damage.
782
783
784
|
# File 'lib/R3EXS/RGSS3.rb', line 782
def damage
@damage
end
|
#effects ⇒ Object
Returns the value of attribute effects.
783
784
785
|
# File 'lib/R3EXS/RGSS3.rb', line 783
def effects
@effects
end
|
#hit_type ⇒ Object
Returns the value of attribute hit_type.
781
782
783
|
# File 'lib/R3EXS/RGSS3.rb', line 781
def hit_type
@hit_type
end
|
#occasion ⇒ Object
Returns the value of attribute occasion.
775
776
777
|
# File 'lib/R3EXS/RGSS3.rb', line 775
def occasion
@occasion
end
|
#repeats ⇒ Object
Returns the value of attribute repeats.
779
780
781
|
# File 'lib/R3EXS/RGSS3.rb', line 779
def repeats
@repeats
end
|
#scope ⇒ Object
Returns the value of attribute scope.
774
775
776
|
# File 'lib/R3EXS/RGSS3.rb', line 774
def scope
@scope
end
|
#speed ⇒ Object
Returns the value of attribute speed.
776
777
778
|
# File 'lib/R3EXS/RGSS3.rb', line 776
def speed
@speed
end
|
#success_rate ⇒ Object
Returns the value of attribute success_rate.
778
779
780
|
# File 'lib/R3EXS/RGSS3.rb', line 778
def success_rate
@success_rate
end
|
#tp_gain ⇒ Object
Returns the value of attribute tp_gain.
780
781
782
|
# File 'lib/R3EXS/RGSS3.rb', line 780
def tp_gain
@tp_gain
end
|
Instance Method Details
#battle_ok? ⇒ Boolean
754
755
756
|
# File 'lib/R3EXS/RGSS3.rb', line 754
def battle_ok?
[0, 1].include?(@occasion)
end
|
#certain? ⇒ Boolean
762
763
764
|
# File 'lib/R3EXS/RGSS3.rb', line 762
def certain?
@hit_type == 0
end
|
#for_all? ⇒ Boolean
746
747
748
|
# File 'lib/R3EXS/RGSS3.rb', line 746
def for_all?
[2, 8, 10].include?(@scope)
end
|
#for_dead_friend? ⇒ Boolean
726
727
728
|
# File 'lib/R3EXS/RGSS3.rb', line 726
def for_dead_friend?
[9, 10].include?(@scope)
end
|
#for_friend? ⇒ Boolean
722
723
724
|
# File 'lib/R3EXS/RGSS3.rb', line 722
def for_friend?
[7, 8, 9, 10, 11].include?(@scope)
end
|
#for_one? ⇒ Boolean
734
735
736
|
# File 'lib/R3EXS/RGSS3.rb', line 734
def for_one?
[1, 3, 7, 9, 11].include?(@scope)
end
|
#for_opponent? ⇒ Boolean
718
719
720
|
# File 'lib/R3EXS/RGSS3.rb', line 718
def for_opponent?
[1, 2, 3, 4, 5, 6].include?(@scope)
end
|
#for_random? ⇒ Boolean
738
739
740
|
# File 'lib/R3EXS/RGSS3.rb', line 738
def for_random?
[3, 4, 5, 6].include?(@scope)
end
|
#for_user? ⇒ Boolean
730
731
732
|
# File 'lib/R3EXS/RGSS3.rb', line 730
def for_user?
@scope == 11
end
|
#magical? ⇒ Boolean
770
771
772
|
# File 'lib/R3EXS/RGSS3.rb', line 770
def magical?
@hit_type == 2
end
|
758
759
760
|
# File 'lib/R3EXS/RGSS3.rb', line 758
def
[0, 2].include?(@occasion)
end
|
#need_selection? ⇒ Boolean
750
751
752
|
# File 'lib/R3EXS/RGSS3.rb', line 750
def need_selection?
[1, 7, 9].include?(@scope)
end
|
#number_of_targets ⇒ Object
742
743
744
|
# File 'lib/R3EXS/RGSS3.rb', line 742
def number_of_targets
for_random? ? @scope - 2 : 0
end
|
#physical? ⇒ Boolean
766
767
768
|
# File 'lib/R3EXS/RGSS3.rb', line 766
def physical?
@hit_type == 1
end
|