ajout du déblocage/évolutions des plantes (#89) et fix divers

This commit is contained in:
2025-11-07 13:26:04 +01:00
parent 11ae967845
commit ed675ed532
54 changed files with 901 additions and 483 deletions

View File

@@ -18,9 +18,10 @@ func get_description() -> String:
return "Loot " + str(seeds_number) + " random seeds."
func reward(objective : Objective):
for i in range(seeds_number):
objective.terrain.drop_item(
Seed.new(GameInfo.game_data.unlocked_plant_types.pick_random()),
objective.global_position,
REWARD_SEED_RANDOM_DISPLACEMENT_FACTOR
)
if len(GameInfo.game_data.unlocked_plant_types):
for i in range(seeds_number):
objective.terrain.drop_item(
Seed.new(GameInfo.game_data.unlocked_plant_types.pick_random()),
objective.global_position,
REWARD_SEED_RANDOM_DISPLACEMENT_FACTOR
)

View File

@@ -24,5 +24,5 @@ default_growing_time = 3
seed_texture = SubResource("AtlasTexture_my6by")
growing_texture = ExtResource("2_l2hi3")
mature_texture = ExtResource("3_y8qve")
default_mature_effects = Array[ExtResource("1_l2hi3")]([SubResource("Resource_cf34j")])
mature_effects = Array[ExtResource("1_l2hi3")]([SubResource("Resource_cf34j")])
metadata/_custom_type_script = "uid://jnye5pe1bgqw"

View File

@@ -13,7 +13,7 @@ script = ExtResource("2_prk5s")
level = 2
metadata/_custom_type_script = "uid://ceqx5va1ormau"
[sub_resource type="Resource" id="Resource_k7yib"]
[sub_resource type="Resource" id="Resource_ajihu"]
script = ExtResource("3_ajihu")
level = 1
metadata/_custom_type_script = "uid://cgscbuxe4dawb"
@@ -29,6 +29,6 @@ description = "This fern use the bas component of the ground to grow."
seed_texture = SubResource("AtlasTexture_qt76e")
growing_texture = ExtResource("1_prk5s")
mature_texture = ExtResource("3_40c3e")
default_harvest_effects = Array[ExtResource("1_40c3e")]([SubResource("Resource_40c3e")])
default_mature_effects = Array[ExtResource("1_40c3e")]([SubResource("Resource_k7yib")])
harvest_effects = Array[ExtResource("1_40c3e")]([SubResource("Resource_40c3e")])
mature_effects = Array[ExtResource("1_40c3e")]([SubResource("Resource_ajihu")])
metadata/_custom_type_script = "uid://jnye5pe1bgqw"

View File

@@ -8,12 +8,12 @@
[ext_resource type="Texture2D" uid="uid://bfj6wji21amgk" path="res://entities/plants/assets/sprites/ferno/mature.png" id="5_er4cp"]
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="7_0y7r8"]
[sub_resource type="Resource" id="Resource_0ofiq"]
[sub_resource type="Resource" id="Resource_rb4mq"]
script = ExtResource("2_rb4mq")
level = 2
metadata/_custom_type_script = "uid://ceqx5va1ormau"
[sub_resource type="Resource" id="Resource_7wddl"]
[sub_resource type="Resource" id="Resource_s6g12"]
script = ExtResource("3_s6g12")
level = 1
metadata/_custom_type_script = "uid://cgscbuxe4dawb"
@@ -29,5 +29,5 @@ description = "This mysterious flower emmit a strong signal in the ground when h
seed_texture = SubResource("AtlasTexture_g1td4")
growing_texture = ExtResource("4_5qaoo")
mature_texture = ExtResource("5_er4cp")
default_harvest_effects = Array[ExtResource("1_srjq6")]([SubResource("Resource_0ofiq"), SubResource("Resource_7wddl")])
harvest_effects = Array[ExtResource("1_srjq6")]([SubResource("Resource_rb4mq"), SubResource("Resource_s6g12")])
metadata/_custom_type_script = "uid://jnye5pe1bgqw"

View File

@@ -7,7 +7,7 @@
[ext_resource type="Texture2D" uid="uid://d3apfwbqsg5ha" path="res://entities/plants/assets/sprites/maias/mature.png" id="3_pi4ie"]
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="6_mwrj8"]
[sub_resource type="Resource" id="Resource_1llfc"]
[sub_resource type="Resource" id="Resource_740j2"]
script = ExtResource("2_740j2")
level = 3
metadata/_custom_type_script = "uid://ceqx5va1ormau"
@@ -23,5 +23,5 @@ description = "This gorgeous flower produce a lot of seeds when harvested."
seed_texture = SubResource("AtlasTexture_sri3b")
growing_texture = ExtResource("1_vyplc")
mature_texture = ExtResource("3_pi4ie")
default_harvest_effects = Array[ExtResource("1_740j2")]([SubResource("Resource_1llfc")])
harvest_effects = Array[ExtResource("1_740j2")]([SubResource("Resource_740j2")])
metadata/_custom_type_script = "uid://jnye5pe1bgqw"

View File

@@ -7,7 +7,7 @@
[ext_resource type="Texture2D" uid="uid://bj801geprrhfu" path="res://entities/plants/assets/sprites/philea/mature.png" id="4_cafy4"]
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="6_oaspo"]
[sub_resource type="Resource" id="Resource_0x8ki"]
[sub_resource type="Resource" id="Resource_jyjjp"]
script = ExtResource("2_jyjjp")
level = 1
metadata/_custom_type_script = "uid://ceqx5va1ormau"
@@ -25,5 +25,5 @@ default_plant_score = 3
seed_texture = SubResource("AtlasTexture_ogrgq")
growing_texture = ExtResource("3_n0hvm")
mature_texture = ExtResource("4_cafy4")
default_mature_effects = Array[ExtResource("1_mi4ef")]([SubResource("Resource_0x8ki")])
mature_effects = Array[ExtResource("1_mi4ef")]([SubResource("Resource_jyjjp")])
metadata/_custom_type_script = "uid://jnye5pe1bgqw"

View File

@@ -8,12 +8,12 @@
[ext_resource type="Script" uid="uid://ceqx5va1ormau" path="res://entities/plants/scripts/plant_effects/produce_seeds.gd" id="3_26e4l"]
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="5_26e4l"]
[sub_resource type="Resource" id="Resource_kidty"]
[sub_resource type="Resource" id="Resource_8fstu"]
script = ExtResource("3_26e4l")
level = 2
metadata/_custom_type_script = "uid://ceqx5va1ormau"
[sub_resource type="Resource" id="Resource_8fstu"]
[sub_resource type="Resource" id="Resource_26e4l"]
script = ExtResource("2_8fstu")
level = 2
metadata/_custom_type_script = "uid://cgscbuxe4dawb"
@@ -30,6 +30,6 @@ default_growing_time = 3
seed_texture = SubResource("AtlasTexture_kidty")
growing_texture = ExtResource("2_k4b1k")
mature_texture = ExtResource("3_8fstu")
default_harvest_effects = Array[ExtResource("1_8fstu")]([SubResource("Resource_kidty")])
default_mature_effects = Array[ExtResource("1_8fstu")]([SubResource("Resource_8fstu")])
harvest_effects = Array[ExtResource("1_8fstu")]([SubResource("Resource_8fstu")])
mature_effects = Array[ExtResource("1_8fstu")]([SubResource("Resource_26e4l")])
metadata/_custom_type_script = "uid://jnye5pe1bgqw"

View File

@@ -7,7 +7,7 @@
[ext_resource type="Texture2D" uid="uid://b3wom2xu26g43" path="res://entities/plants/assets/sprites/solita/mature.png" id="4_njidq"]
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="6_yn0yu"]
[sub_resource type="Resource" id="Resource_3fdsj"]
[sub_resource type="Resource" id="Resource_j4n5p"]
script = ExtResource("2_1q5bp")
level = 2
metadata/_custom_type_script = "uid://ceqx5va1ormau"
@@ -25,5 +25,5 @@ default_plant_score = 2
seed_texture = SubResource("AtlasTexture_auuc2")
growing_texture = ExtResource("3_j4n5p")
mature_texture = ExtResource("4_njidq")
default_harvest_effects = Array[ExtResource("1_mksys")]([SubResource("Resource_3fdsj")])
harvest_effects = Array[ExtResource("1_mksys")]([SubResource("Resource_j4n5p")])
metadata/_custom_type_script = "uid://jnye5pe1bgqw"

View File

@@ -15,10 +15,6 @@ const LIFETIME_ICON = preload("res://common/icons/calendar-week.svg")
const SHOVEL_ICON = preload("res://common/icons/shovel.svg")
const GROWING_ICON = preload("res://common/icons/chevrons-up.svg")
const HARVEST_EFFECT_ICON = preload("res://common/icons/shovel.svg")
const MATURE_EFFECT_ICON = preload("res://common/icons/chevrons-up.svg")
const CYCLIC_EFFECT_ICON = preload("res://common/icons/rotate-rectangle.svg")
const SPRITE_SCENE : PackedScene = preload("res://entities/plants/plant_sprite.tscn")
enum State {PLANTED, GROWING, MATURE}
@@ -32,9 +28,6 @@ var state: State = State.PLANTED
@onready var collision_shape: CollisionShape2D
@onready var influence_zone : PlantInfluenceZone
var harvest_effects = []
var mature_effects = []
var cyclic_effects = []
var plant_score = 0
var plant_mutations : Array[PlantMutation] = []
@@ -44,9 +37,6 @@ func _init(
_day = 0,
):
plant_type = _plant_type
harvest_effects = plant_type.default_harvest_effects.duplicate_deep()
mature_effects = plant_type.default_mature_effects.duplicate_deep()
cyclic_effects = plant_type.default_cyclic_effects.duplicate_deep()
day = _day
@@ -96,8 +86,8 @@ func generate_influence_zone() -> PlantInfluenceZone:
func _pass_day():
await get_tree().create_timer(randf_range(0., RANDOM_MAX_GROW_INTERVAL)).timeout
if state == State.MATURE and len(cyclic_effects):
for effect in cyclic_effects:
if state == State.MATURE and len(plant_type.cyclic_effects):
for effect in plant_type.cyclic_effects:
effect.effect(self)
var old_state = state
@@ -106,9 +96,9 @@ func _pass_day():
update_plant()
if old_state != state and state == State.MATURE:
for effect in mature_effects:
for effect in plant_type.mature_effects:
if effect : effect.effect(self)
for effect in cyclic_effects:
for effect in plant_type.cyclic_effects:
if effect : effect.effect(self)
func update_plant(with_animation : bool = true):
@@ -137,7 +127,7 @@ func calculate_grow_time() -> int:
for m in plant_mutations:
mutated_grow_time = m.mutate_grow_time(self, mutated_grow_time)
return mutated_grow_time
return max(1, mutated_grow_time)
func change_state(_state: State, with_animation : bool = true):
if state != _state:
@@ -148,7 +138,7 @@ func change_state(_state: State, with_animation : bool = true):
func harvest():
if state == State.MATURE:
for effect in harvest_effects:
for effect in plant_type.harvest_effects:
if effect : effect.effect(self)
plant_sprite.start_harvest_animation()
@@ -203,39 +193,10 @@ func card_info() -> CardInfo:
for m in plant_mutations:
info.sections.append(m.card_section())
info.sections.append_array(card_effect_sections())
info.sections.append_array(PlantEffect.card_effect_sections(
plant_type.mature_effects,
plant_type.harvest_effects,
plant_type.cyclic_effects,
))
return info
func card_effect_sections() -> Array[CardSectionInfo]:
var sections : Array[CardSectionInfo] = []
var effects_category = [
mature_effects,
harvest_effects,
cyclic_effects
]
var effects_category_labels : Array[String] = [
"On mature",
"When harvested",
"Each day when mature",
]
var effects_category_icon : Array[Texture] = [
MATURE_EFFECT_ICON,
HARVEST_EFFECT_ICON,
CYCLIC_EFFECT_ICON,
]
for i in range(len(effects_category)):
var effects = effects_category[i]
if len(effects):
var section = CardSectionInfo.new(
effects_category_labels[i]
)
section.title_icon = effects_category_icon[i]
var effects_text : Array = effects.map(
func (e : PlantEffect): return "[b]%s[/b] %s" % [e.get_styled_effect_name() , e.get_effect_description()]
)
section.text = "\n".join(effects_text)
sections.append(section)
return sections
return info

View File

@@ -2,6 +2,10 @@
extends Resource
class_name PlantEffect
const HARVEST_EFFECT_ICON = preload("res://common/icons/shovel.svg")
const MATURE_EFFECT_ICON = preload("res://common/icons/chevrons-up.svg")
const CYCLIC_EFFECT_ICON = preload("res://common/icons/rotate-rectangle.svg")
@export var level : int
func _init(_level : int = 1):
@@ -15,7 +19,7 @@ func get_effect_description() -> String:
printerr("Classe abstraite PlantEffect appelée")
return ""
func effect(plant):
func effect(_plant):
printerr("Classe abstraite PlantEffect appelée")
func get_styled_effect_name():
@@ -31,4 +35,42 @@ func get_styled_effect_name():
if level == 1:
return levels_bbcode[0] % get_effect_name()
else :
return levels_bbcode[min(level - 1, len(levels_bbcode) - 1)] % [get_effect_name(), level]
return levels_bbcode[min(level - 1, len(levels_bbcode) - 1)] % [get_effect_name(), level]
static func card_effect_sections(
mature_effects : Array[PlantEffect],
harvest_effects : Array[PlantEffect],
cyclic_effects : Array[PlantEffect]
) -> Array[CardSectionInfo]:
var sections : Array[CardSectionInfo] = []
var effects_category = [
mature_effects,
harvest_effects,
cyclic_effects
]
var effects_category_labels : Array[String] = [
"On mature",
"When harvested",
"Each day when mature",
]
var effects_category_icon : Array[Texture] = [
MATURE_EFFECT_ICON,
HARVEST_EFFECT_ICON,
CYCLIC_EFFECT_ICON,
]
for i in range(len(effects_category)):
var effects = effects_category[i]
if len(effects) > 0:
var section = CardSectionInfo.new(
effects_category_labels[i]
)
section.title_icon = effects_category_icon[i]
var effects_text : Array = effects.map(
func (e : PlantEffect): return "[b]%s[/b] %s" % [e.get_styled_effect_name() , e.get_effect_description()]
)
section.text = "\n".join(effects_text)
sections.append(section)
return sections

View File

@@ -1,13 +1,6 @@
extends Resource
class_name PlantMutation
const BASE_RARITY_CHANCE : Array[float] = [
0.75,
0.9,
1,
1,
]
@export var level : int = 1
func _init(_level : int = 1):
@@ -78,21 +71,15 @@ static func get_rarity_color(rarity : int) -> Color:
return rarity_colors[min(rarity, len(rarity_colors) - 1)]
static func random_rarity() -> int:
var random_float = randf()
for i in range(len(BASE_RARITY_CHANCE) - 1):
if random_float < BASE_RARITY_CHANCE[i]:
return i
return len(BASE_RARITY_CHANCE) - 1
static func random_mutation(rarity = PlantMutation.random_rarity()) -> PlantMutation:
static func random_mutation(except_mutations : Array[PlantMutation] = []) -> PlantMutation:
var all_mutations = GameInfo.game_data.unlocked_plant_mutations.duplicate_deep()
all_mutations.shuffle()
for new_mutation in all_mutations:
var level_for_rarity = new_mutation.get_level_for_rarity(rarity)
if level_for_rarity >= 1:
new_mutation.level = level_for_rarity
return new_mutation
return null
all_mutations = all_mutations.filter(
func (f1 : PlantMutation):
return except_mutations.find_custom(
func (f2 : PlantMutation): return f2.get_mutation_name() == f1.get_mutation_name()
) == -1
)
if len(all_mutations):
return all_mutations.pick_random()
else :
return null

View File

@@ -11,6 +11,118 @@ class_name PlantType
@export var growing_texture : Texture
@export var mature_texture : Texture
@export var default_harvest_effects : Array[PlantEffect] = []
@export var default_mature_effects : Array[PlantEffect] = []
@export var default_cyclic_effects : Array[PlantEffect] = []
@export var harvest_effects : Array[PlantEffect] = []
@export var mature_effects : Array[PlantEffect] = []
@export var cyclic_effects : Array[PlantEffect] = []
func card_info() -> CardInfo:
var info = CardInfo.new(
name
)
info.important_stat_icon = Plant.PLANT_POINT_ICON
info.important_stat_text = "%d" % default_plant_score
info.texture = mature_texture
info.type_icon = Plant.PLANT_TYPE_ICON
info.stats.append(CardStatInfo.new(
"Grow in [b]%d[/b]" % default_growing_time,
Plant.GROWING_ICON
))
info.stats.append(CardStatInfo.new(
"[b]%d[/b] score when mature" % default_plant_score,
Plant.PLANT_POINT_ICON
))
info.sections.append_array(PlantEffect.card_effect_sections(
mature_effects,
harvest_effects,
cyclic_effects,
))
return info
func get_available_evolution() -> Array[Evolution]:
var evolutions : Array[Evolution] = [
ScoreEvolution.new(self)
]
if len(mature_effects) > 0:
evolutions.append(MatureEffectEvolution.new(self))
if len(harvest_effects) > 0:
evolutions.append(HarvestEffectEvolution.new(self))
if len(cyclic_effects) > 0:
evolutions.append(CyclicEffectEvolution.new(self))
return evolutions
class Evolution:
var level : int
var plant_type : PlantType
func _init(_type : PlantType, _l : int = 1):
plant_type = _type
level = _l
func get_title():
return ""
func get_description():
return ""
func evolve(_pt : PlantType = plant_type):
pass
class ScoreEvolution extends Evolution:
func get_title():
return "%s score evolution" % plant_type.name
func get_description():
return "Add [b]%s[/b] to the default score of the plant" % level
func evolve(pt : PlantType = plant_type):
pt.default_plant_score += level
class MatureEffectEvolution extends Evolution:
var effect_index : int
func _init(_type : PlantType, _l : int = 1):
plant_type = _type
level = _l
pick_effect()
func pick_effect():
effect_index = randi() % len(plant_type.mature_effects)
func get_effect(pt : PlantType = plant_type) -> PlantEffect:
return pt.mature_effects[effect_index]
func get_title():
return "%s %s evolution" % [plant_type.name, get_effect().get_effect_name()]
func get_description():
return "Upgrade the level of %s of %d" % [get_effect().get_effect_name(), level]
func evolve(pt : PlantType = plant_type):
get_effect(pt).level += level
class HarvestEffectEvolution extends MatureEffectEvolution:
func pick_effect():
effect_index = randi() % len(plant_type.harvest_effects)
func get_effect(pt : PlantType = plant_type) -> PlantEffect:
return pt.harvest_effects[effect_index]
class CyclicEffectEvolution extends MatureEffectEvolution:
func pick_effect():
effect_index = randi() % len(plant_type.harvest_effects)
func get_effect(pt : PlantType = plant_type) -> PlantEffect:
return pt.harvest_effects[effect_index]

View File

@@ -5,9 +5,15 @@ signal updated(inventory: Inventory)
@export var items: Array[Item] = []
@export var current_item_ind: int = 0
@export var size = 0 :
set(s):
size = s
items.resize(size)
updated.emit(self)
func _init(inventory_size: int = 1):
items.resize(inventory_size)
size = inventory_size
func get_best_available_slot_ind():
if items[current_item_ind] == null:

View File

@@ -33,13 +33,13 @@ func get_usage_object_affected(_i : InspectableEntity) -> bool:
func is_one_time_use():
return false
func can_use(_player : Player, zone: Player.ActionZone) -> bool:
func can_use(_player : Player, _zone: Player.ActionZone) -> bool:
return false
func use_text() -> String:
return ""
func use(_player : Player, zone: Player.ActionZone):
func use(_player : Player, _zone: Player.ActionZone):
return false
func card_info() -> CardInfo:

View File

@@ -29,7 +29,7 @@ func use_text() -> String:
func is_one_time_use():
return true
func can_use(player : Player, zone : Player.ActionZone) -> bool:
func can_use(player : Player, _zone : Player.ActionZone) -> bool:
return player.terrain is Planet
func use(player : Player, zone : Player.ActionZone) -> bool:

View File

@@ -24,7 +24,7 @@ func use_text() -> String:
func is_one_time_use():
return true
func can_use(player : Player, zone : Player.ActionZone) -> bool:
func can_use(player : Player, _zone : Player.ActionZone) -> bool:
return player.planet != null
func use(player : Player, zone : Player.ActionZone) -> bool:

View File

@@ -23,7 +23,7 @@ func get_energy_used() -> int:
return 1
func get_usage_zone_radius() -> int:
return 30
return 40
func get_usage_object_affected(i : InspectableEntity) -> bool:
return i is Plant
@@ -137,11 +137,19 @@ static func mutate(parent_mutation : Array[PlantMutation] = []) -> Array[PlantMu
AddMutation.new()
]
if len(parent_mutation):
possible_mutations.append_array( [
if (
len(parent_mutation) > 2
):
possible_mutations = [
UpgradeMutation.new(),
RemoveMutation.new(),
])
]
elif len(parent_mutation) > 0:
possible_mutations = [
AddMutation.new(),
UpgradeMutation.new(),
RemoveMutation.new(),
]
var chosen_mutation = possible_mutations.pick_random()
@@ -159,10 +167,10 @@ class DontMutate extends MutationPossibility:
class AddMutation extends MutationPossibility:
func mutate(parent_mutation : Array[PlantMutation] = [])-> Array[PlantMutation]:
var new_mutations = parent_mutation.duplicate_deep()
var mut = PlantMutation.random_mutation()
var mut = PlantMutation.random_mutation(parent_mutation)
if mut:
var existing_mut_id = new_mutations.find_custom(func(m:PlantMutation): m.get_mutation_name() == mut.get_mutation_name())
var existing_mut_id = new_mutations.find_custom(func(m:PlantMutation): return m.get_mutation_name() == mut.get_mutation_name())
if existing_mut_id >= 0:
new_mutations[existing_mut_id].level += 1

View File

@@ -187,7 +187,7 @@ func upgrade_max_energy(amount = 1):
player_updated.emit(self)
func upgrade_inventory_size(amount = 1):
data.inventory.items.resize(data.inventory.items.size() + amount)
data.inventory.size += 1
upgraded.emit()
player_updated.emit(self)

View File

@@ -4,28 +4,11 @@ class_name UndergroundLoot
const AREA_WIDTH = 20
const LOOTED_ITEM_RANDOM_RANGE = 50
const SPRITE_SCENE : PackedScene = preload("res://entities/underground_loot/underground_loot_sprite.tscn")
@export var loot : Array[Item]
@onready var sprite_object: Node2D = generate_sprite()
@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]"
@export var item_number : int = 1
func pointer_text() -> String:
return "Buried Loot"
func generate_sprite() -> Node2D:
var object = SPRITE_SCENE.instantiate()
add_child(object)
return object
func generate_collision_shape() -> CollisionShape2D:
var collision = CollisionShape2D.new()
var shape = CircleShape2D.new()
@@ -36,8 +19,19 @@ func generate_collision_shape() -> CollisionShape2D:
return collision
func generate_loot() -> Array[Item]:
var seeds : Array[Item] = []
if len(GameInfo.game_data.unlocked_plant_types):
seeds.append(
Seed.new(
GameInfo.game_data.unlocked_plant_types.pick_random()
)
)
return seeds
func dig():
for item in loot:
for item in generate_loot():
planet.drop_item(item, global_position, LOOTED_ITEM_RANDOM_RANGE)
queue_free()

View File

@@ -1,11 +1,15 @@
extends EntityData
class_name UndergroundLootData
@export var loot : Array[Item]
const SCENE = preload("res://entities/underground_loot/underground_loot.tscn")
@export var item_number : int
func _init(e : UndergroundLoot):
position = e.global_position
loot = e.loot
position = e.global_position
item_number = e.item_number
func load() -> Entity:
return UndergroundLoot.new(loot)
var loot : UndergroundLoot = (SCENE.instantiate() as UndergroundLoot)
loot.item_number = item_number
return loot

View File

@@ -0,0 +1,21 @@
[gd_scene load_steps=4 format=3 uid="uid://dxjud7bti0na0"]
[ext_resource type="Script" uid="uid://dfd2hh12155lo" path="res://entities/underground_loot/scripts/underground_loot.gd" id="1_knus5"]
[ext_resource type="Texture2D" uid="uid://bu26h0iqutnky" path="res://entities/underground_loot/assets/sprites/underground_loot.svg" id="2_jfggo"]
[sub_resource type="CircleShape2D" id="CircleShape2D_knus5"]
radius = 20.09975
[node name="UndergroundLootSprites" type="Area2D"]
script = ExtResource("1_knus5")
default_info_title = "Buried Seeds"
default_info_desc = "Contain some random seeds. [b]Dig it with a shovel.[/b]"
metadata/_custom_type_script = "uid://d3bk52402ylvl"
[node name="Sprite2D" type="Sprite2D" parent="."]
modulate = Color(0.286275, 0.219608, 0.313726, 1)
scale = Vector2(0.0806452, 0.0806452)
texture = ExtResource("2_jfggo")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_knus5")

View File

@@ -1,10 +0,0 @@
[gd_scene load_steps=2 format=3 uid="uid://dxjud7bti0na0"]
[ext_resource type="Texture2D" uid="uid://bu26h0iqutnky" path="res://entities/underground_loot/assets/sprites/underground_loot.svg" id="1_t1xxm"]
[node name="UndergroundLootSprites" type="Node2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
modulate = Color(0.286275, 0.219608, 0.313726, 1)
scale = Vector2(0.0806452, 0.0806452)
texture = ExtResource("1_t1xxm")