34 lines
799 B
GDScript3
34 lines
799 B
GDScript3
|
tool
|
||
|
class_name Item
|
||
|
extends Data
|
||
|
#
|
||
|
|
||
|
#05. signals
|
||
|
#06. enums
|
||
|
#07. constants
|
||
|
#08. exported variables
|
||
|
#09. public variables
|
||
|
#10. private variables
|
||
|
#11. onready variables
|
||
|
#12. optional built-in virtual _init method
|
||
|
#13. built-in virtual _ready method
|
||
|
#14. remaining built-in virtual methods
|
||
|
#15. public methods
|
||
|
func _init( p_name = null ).( p_name ):
|
||
|
self.set_data( "model", null )
|
||
|
self.set_data( "label", "" )
|
||
|
self.set_data( "description", "" )
|
||
|
self.set_data( "icon", null )
|
||
|
self.set_data( "stack", 1 )
|
||
|
self.set_data( "default_num_given", 1 )
|
||
|
self.set_data( "pickable", true )
|
||
|
self.set_data( "dropable", true )
|
||
|
self.set_data( "hit_points", -1 )
|
||
|
|
||
|
func get_filename():
|
||
|
if not self.get_data( "name", null ):
|
||
|
return "unknow.item"
|
||
|
return self.get_data( "name" )+".item"
|
||
|
|
||
|
#16. private methods
|