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.


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_idObject

Returns the value of attribute animation_id.


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

def animation_id
  @animation_id
end

#damageObject

Returns the value of attribute damage.


782
783
784
# File 'lib/R3EXS/RGSS3.rb', line 782

def damage
  @damage
end

#effectsObject

Returns the value of attribute effects.


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

def effects
  @effects
end

#hit_typeObject

Returns the value of attribute hit_type.


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

def hit_type
  @hit_type
end

#occasionObject

Returns the value of attribute occasion.


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

def occasion
  @occasion
end

#repeatsObject

Returns the value of attribute repeats.


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

def repeats
  @repeats
end

#scopeObject

Returns the value of attribute scope.


774
775
776
# File 'lib/R3EXS/RGSS3.rb', line 774

def scope
  @scope
end

#speedObject

Returns the value of attribute speed.


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

def speed
  @speed
end

#success_rateObject

Returns the value of attribute success_rate.


778
779
780
# File 'lib/R3EXS/RGSS3.rb', line 778

def success_rate
  @success_rate
end

#tp_gainObject

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

Returns:

  • (Boolean)

754
755
756
# File 'lib/R3EXS/RGSS3.rb', line 754

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

#certain?Boolean

Returns:

  • (Boolean)

762
763
764
# File 'lib/R3EXS/RGSS3.rb', line 762

def certain?
    @hit_type == 0
end

#for_all?Boolean

Returns:

  • (Boolean)

746
747
748
# File 'lib/R3EXS/RGSS3.rb', line 746

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

#for_dead_friend?Boolean

Returns:

  • (Boolean)

726
727
728
# File 'lib/R3EXS/RGSS3.rb', line 726

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

#for_friend?Boolean

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (Boolean)

738
739
740
# File 'lib/R3EXS/RGSS3.rb', line 738

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

#for_user?Boolean

Returns:

  • (Boolean)

730
731
732
# File 'lib/R3EXS/RGSS3.rb', line 730

def for_user?
    @scope == 11
end

#magical?Boolean

Returns:

  • (Boolean)

770
771
772
# File 'lib/R3EXS/RGSS3.rb', line 770

def magical?
    @hit_type == 2
end

Returns:

  • (Boolean)

758
759
760
# File 'lib/R3EXS/RGSS3.rb', line 758

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

#need_selection?Boolean

Returns:

  • (Boolean)

750
751
752
# File 'lib/R3EXS/RGSS3.rb', line 750

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

#number_of_targetsObject


742
743
744
# File 'lib/R3EXS/RGSS3.rb', line 742

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

#physical?Boolean

Returns:

  • (Boolean)

766
767
768
# File 'lib/R3EXS/RGSS3.rb', line 766

def physical?
    @hit_type == 1
end