Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FEATURE_EQUIP_WTYPE = 51 # Tipos de Armas
- FEATURE_EQUIP_ATYPE = 52 # Tipos de Armaduras
- def get_class
- $data_classes[@class_id]
- end
- def feature_objects
- [get_class]
- end
- def all_features
- feature_objects.inject([]) {|r, obj| r + obj.features }
- end
- # * Aquisição da lista de objetos (Limitado pelo código)
- def features(code)
- all_features.select {|ft| ft.code == code }
- end
- def features_set(code)
- features(code).inject([]) {|r, ft| r |= [ft.data_id] }
- end
- def equip_wtype_ok?(wtype_id)
- features_set(FEATURE_EQUIP_WTYPE).include?(wtype_id)
- end
- def equip_atype_ok?(atype_id)
- features_set(FEATURE_EQUIP_ATYPE).include?(atype_id)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement