Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # data container for an item
- # read only
- extends SerializableData
- class_name ItemData
- var item_id: String = "item_unrefined_ore"
- var item_texture_path: String = "sprites/items/unloaded_item.png"
- var item_name: String = "Unrefined Ore"
- var item_description: String = "Unrefined material mined from asteroids and planetary bodies"
- var item_flavor_text: String = "It’s just a space rock now, but with a bit of work you can get some smaller, more valuable space rocks from it"
- var item_cargo_size: int = 1 # how much space this takes up in the inventory
- # item roles
- enum ITEM_ROLES {ITEM, WEAPON, HULLMOD, EQUIPMENT}
- var item_role: int = ITEM_ROLES.ITEM # determines how to handle the item
- var item_role_id = "" # the weapon, equipment, or hullmod id the item corresponds to if not a simple item
- # item costs
- var item_base_cost: int = 200
- var item_min_cost: int = 150 # the cheapest the item can get
- var item_max_cost: int = 250 # the most expensive the item can get
- # audio
- var item_audio_path: String = "" # sound when item is picked up in inventory
- ############ Serialization ############
- func get_serialized_property_names() -> Array:
- # Overrides base class
- return [
- "item_id",
- "item_texture_path",
- "item_name",
- "item_description",
- "item_flavor_text",
- "item_cargo_size",
- "item_role",
- "item_role_id",
- "item_base_cost",
- "item_min_cost",
- "item_max_cost",
- "item_audio_path",
- ]
- func get_id() -> String:
- return self.item_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement