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.
458
459
460
461
462
463
464
465
466
467
468
469
470
|
# File 'lib/rgss3/rpg.rb', line 458
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.
516
517
518
|
# File 'lib/rgss3/rpg.rb', line 516
def animation_id
@animation_id
end
|
#damage ⇒ Object
Returns the value of attribute damage.
521
522
523
|
# File 'lib/rgss3/rpg.rb', line 521
def damage
@damage
end
|
#effects ⇒ Object
Returns the value of attribute effects.
522
523
524
|
# File 'lib/rgss3/rpg.rb', line 522
def effects
@effects
end
|
#hit_type ⇒ Object
Returns the value of attribute hit_type.
520
521
522
|
# File 'lib/rgss3/rpg.rb', line 520
def hit_type
@hit_type
end
|
#occasion ⇒ Object
Returns the value of attribute occasion.
514
515
516
|
# File 'lib/rgss3/rpg.rb', line 514
def occasion
@occasion
end
|
#repeats ⇒ Object
Returns the value of attribute repeats.
518
519
520
|
# File 'lib/rgss3/rpg.rb', line 518
def repeats
@repeats
end
|
#scope ⇒ Object
Returns the value of attribute scope.
513
514
515
|
# File 'lib/rgss3/rpg.rb', line 513
def scope
@scope
end
|
#speed ⇒ Object
Returns the value of attribute speed.
515
516
517
|
# File 'lib/rgss3/rpg.rb', line 515
def speed
@speed
end
|
#success_rate ⇒ Object
Returns the value of attribute success_rate.
517
518
519
|
# File 'lib/rgss3/rpg.rb', line 517
def success_rate
@success_rate
end
|
#tp_gain ⇒ Object
Returns the value of attribute tp_gain.
519
520
521
|
# File 'lib/rgss3/rpg.rb', line 519
def tp_gain
@tp_gain
end
|
Instance Method Details
#battle_ok? ⇒ Boolean
498
499
500
|
# File 'lib/rgss3/rpg.rb', line 498
def battle_ok?
[0, 1].include?(@occasion)
end
|
#certain? ⇒ Boolean
504
505
506
|
# File 'lib/rgss3/rpg.rb', line 504
def certain?
@hit_type == 0
end
|
#for_all? ⇒ Boolean
492
493
494
|
# File 'lib/rgss3/rpg.rb', line 492
def for_all?
[2, 8, 10].include?(@scope)
end
|
#for_dead_friend? ⇒ Boolean
477
478
479
|
# File 'lib/rgss3/rpg.rb', line 477
def for_dead_friend?
[9, 10].include?(@scope)
end
|
#for_friend? ⇒ Boolean
474
475
476
|
# File 'lib/rgss3/rpg.rb', line 474
def for_friend?
[7, 8, 9, 10, 11].include?(@scope)
end
|
#for_one? ⇒ Boolean
483
484
485
|
# File 'lib/rgss3/rpg.rb', line 483
def for_one?
[1, 3, 7, 9, 11].include?(@scope)
end
|
#for_opponent? ⇒ Boolean
471
472
473
|
# File 'lib/rgss3/rpg.rb', line 471
def for_opponent?
[1, 2, 3, 4, 5, 6].include?(@scope)
end
|
#for_random? ⇒ Boolean
486
487
488
|
# File 'lib/rgss3/rpg.rb', line 486
def for_random?
[3, 4, 5, 6].include?(@scope)
end
|
#for_user? ⇒ Boolean
480
481
482
|
# File 'lib/rgss3/rpg.rb', line 480
def for_user?
@scope == 11
end
|
#magical? ⇒ Boolean
510
511
512
|
# File 'lib/rgss3/rpg.rb', line 510
def magical?
@hit_type == 2
end
|
501
502
503
|
# File 'lib/rgss3/rpg.rb', line 501
def
[0, 2].include?(@occasion)
end
|
#need_selection? ⇒ Boolean
495
496
497
|
# File 'lib/rgss3/rpg.rb', line 495
def need_selection?
[1, 7, 9].include?(@scope)
end
|
#number_of_targets ⇒ Object
489
490
491
|
# File 'lib/rgss3/rpg.rb', line 489
def number_of_targets
for_random? ? @scope - 2 : 0
end
|
#physical? ⇒ Boolean
507
508
509
|
# File 'lib/rgss3/rpg.rb', line 507
def physical?
@hit_type == 1
end
|