赞 | 6 |
VIP | 0 |
好人卡 | 0 |
积分 | 8 |
经验 | 0 |
最后登录 | 2024-4-2 |
在线时间 | 70 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 777
- 在线时间
- 70 小时
- 注册时间
- 2017-12-2
- 帖子
- 14
|
根据scope判断,在RPG::UsableItem中定义。
以下摘自F1:
- class RPG::UsableItem < RPG::BaseItem
- 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
- def for_opponent?
- [1, 2, 3, 4, 5, 6].include?(@scope)
- end
- def for_friend?
- [7, 8, 9, 10, 11].include?(@scope)
- end
- def for_dead_friend?
- [9, 10].include?(@scope)
- end
- def for_user?
- @scope == 11
- end
- def for_one?
- [1, 3, 7, 9, 11].include?(@scope)
- end
- def for_random?
- [3, 4, 5, 6].include?(@scope)
- end
- def number_of_targets
- for_random? ? @scope - 2 : 0
- end
- def for_all?
- [2, 8, 10].include?(@scope)
- end
- def need_selection?
- [1, 7, 9].include?(@scope)
- end
- def battle_ok?
- [0, 1].include?(@occasion)
- end
- def menu_ok?
- [0, 2].include?(@occasion)
- end
- def certain?
- @hit_type == 0
- end
- def physical?
- @hit_type == 1
- end
- def magical?
- @hit_type == 2
- end
- attr_accessor :scope
- attr_accessor :occasion
- attr_accessor :speed
- attr_accessor :animation_id
- attr_accessor :success_rate
- attr_accessor :repeats
- attr_accessor :tp_gain
- attr_accessor :hit_type
- attr_accessor :damage
- attr_accessor :effects
- end
复制代码 |
评分
-
查看全部评分
|