gros dev pre proto
* Changement de l'UI, ajouts de l'inspecteur par carte et changement de police * Ajout d'un semblant d'exploration * Ajout de la sauvegarde des entités * Restructuration mineure de l'arborescence * Fix divers et réécriture des textes
This commit is contained in:
@@ -12,15 +12,13 @@ const SPRITE_SCENE : PackedScene = preload("res://entities/underground_loot/unde
|
||||
@onready var collision_shape: CollisionShape2D = generate_collision_shape()
|
||||
|
||||
|
||||
func _init(_loot : Array[Item] = []):
|
||||
loot = _loot
|
||||
default_info_desc = "Contain some random seeds. [b]Dig it with a shovel.[/b]"
|
||||
|
||||
func pointer_text() -> String:
|
||||
return "Buried Loot"
|
||||
|
||||
func inspector_info() -> Inspector.Info:
|
||||
return Inspector.Info.new(
|
||||
"Buried Loot",
|
||||
"Can contain some seeds from the past... Dig it with a shovel."
|
||||
)
|
||||
|
||||
func generate_sprite() -> Node2D:
|
||||
var object = SPRITE_SCENE.instantiate()
|
||||
|
||||
@@ -42,3 +40,6 @@ func dig():
|
||||
for item in loot:
|
||||
planet.drop_item(item, global_position, LOOTED_ITEM_RANDOM_RANGE)
|
||||
queue_free()
|
||||
|
||||
func save() -> UndergroundLootData:
|
||||
return UndergroundLootData.new(self)
|
||||
11
entities/underground_loot/scripts/underground_loot_data.gd
Normal file
11
entities/underground_loot/scripts/underground_loot_data.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends EntityData
|
||||
class_name UndergroundLootData
|
||||
|
||||
@export var loot : Array[Item]
|
||||
|
||||
func _init(e : UndergroundLoot):
|
||||
position = e.global_position
|
||||
loot = e.loot
|
||||
|
||||
func load() -> Entity:
|
||||
return UndergroundLoot.new(loot)
|
||||
@@ -0,0 +1 @@
|
||||
uid://68plwch6h4f7
|
||||
Reference in New Issue
Block a user