Compare commits
3 Commits
bc9f2f83be
...
42de41c9a8
| Author | SHA1 | Date | |
|---|---|---|---|
| 42de41c9a8 | |||
| 32e17f9eae | |||
| bb716a392b |
@ -1,15 +1,5 @@
|
|||||||
extends Resource
|
extends Resource
|
||||||
class_name GameData
|
class_name GameData
|
||||||
|
|
||||||
@export var current_planet_data : PlanetData
|
@export var currentTerrainData : TerrainData
|
||||||
|
|
||||||
@export var unlocked_plant_types_path : Array[PlantType] = [
|
|
||||||
preload("res://entities/plants/resources/plant_types/champ.tres"),
|
|
||||||
preload("res://entities/plants/resources/plant_types/chardi.tres"),
|
|
||||||
preload("res://entities/plants/resources/plant_types/maias.tres"),
|
|
||||||
preload("res://entities/plants/resources/plant_types/pili.tres"),
|
|
||||||
]
|
|
||||||
|
|
||||||
@export var unlocked_machines : Array[MachineType] = [
|
|
||||||
preload("res://entities/interactables/machines/compost/compost.tres")
|
|
||||||
]
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
extends Resource
|
|
||||||
class_name PlanetData
|
|
||||||
|
|
||||||
const DEFAULT_CONTAMINATION_CENTRAL_ZONE_MAX_SIZE = 400.
|
|
||||||
const DEFAULT_CONTAMINATION_CENTRAL_ZONE_MIN_SIZE = 100.
|
|
||||||
const DEFAULT_BASE_SIZE = Vector2(2000,2000)
|
|
||||||
|
|
||||||
@export var base_size : Vector2 = Vector2(2000,2000)
|
|
||||||
@export var contamination : TerrainData
|
|
||||||
@export var quota_number : int = 0
|
|
||||||
|
|
||||||
func _init(_base_size : Vector2 = DEFAULT_BASE_SIZE):
|
|
||||||
base_size = _base_size
|
|
||||||
contamination = TerrainData.new(base_size)
|
|
||||||
contamination.draw_random_zone(
|
|
||||||
DEFAULT_CONTAMINATION_CENTRAL_ZONE_MAX_SIZE,
|
|
||||||
DEFAULT_CONTAMINATION_CENTRAL_ZONE_MIN_SIZE,
|
|
||||||
base_size/2
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
func impact_contamination(position : Vector2, impact_radius : float, to_value : float = 1.):
|
|
||||||
contamination.draw_circle(
|
|
||||||
position,
|
|
||||||
impact_radius,
|
|
||||||
to_value
|
|
||||||
)
|
|
||||||
|
|
||||||
func is_in_base(point):
|
|
||||||
return (
|
|
||||||
point.x > 0
|
|
||||||
and point.y > 0
|
|
||||||
and point.x < base_size.x
|
|
||||||
and point.y < base_size.y)
|
|
||||||
|
|
||||||
func get_contamination(point : Vector2) -> float:
|
|
||||||
return contamination.get_value(point)
|
|
||||||
|
|
||||||
func get_decontamination_coverage() -> float:
|
|
||||||
return contamination.get_value_coverage()
|
|
||||||
|
|
||||||
func get_decontamination_surface() -> float:
|
|
||||||
return contamination.get_value_surface() * 10
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region ------------------ Objectives ------------------
|
|
||||||
func generate_objective_rewards(level = 0) -> Array[ObjectiveReward]:
|
|
||||||
var amount = level + 1
|
|
||||||
|
|
||||||
var possible_objective_rewards_path : Array[ObjectiveReward] = [
|
|
||||||
UpgradePlayerMaxEnergyReward.new(),
|
|
||||||
RechargePlayerReward.new(randi_range(level + 1, (level + 1) * 2)),
|
|
||||||
LootRandomSeedsReward.new(randi_range(level + 1, (level + 1) * 2))
|
|
||||||
]
|
|
||||||
|
|
||||||
var objectives_reward : Array[ObjectiveReward] = []
|
|
||||||
|
|
||||||
var i = 0
|
|
||||||
while i < amount and len(possible_objective_rewards_path) > 0:
|
|
||||||
var r = possible_objective_rewards_path.pick_random()
|
|
||||||
possible_objective_rewards_path.erase(r)
|
|
||||||
objectives_reward.append(r)
|
|
||||||
i += 1
|
|
||||||
|
|
||||||
return objectives_reward
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region ------------------ Quotas ------------------
|
|
||||||
func get_quota(n = 0) -> int:
|
|
||||||
var first_quota = 100
|
|
||||||
var quota_adding = n * 150
|
|
||||||
|
|
||||||
if n == 0:
|
|
||||||
return first_quota
|
|
||||||
elif n < 0:
|
|
||||||
return 0
|
|
||||||
|
|
||||||
return get_quota(n - 1) + quota_adding
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://cx30nvq8b34lj
|
|
||||||
@ -1,98 +1,86 @@
|
|||||||
extends Resource
|
extends Resource
|
||||||
class_name TerrainData
|
class_name TerrainData
|
||||||
|
|
||||||
const UNIT_PER_PIXEL = 30
|
const TERRAIN_IMAGE_GAME_FACTOR = 40
|
||||||
|
const DEFAULT_CONTAMINATION_CENTRAL_ZONE_MAX_SIZE = 300
|
||||||
|
const DEFAULT_CONTAMINATION_CENTRAL_ZONE_MIN_SIZE = 50
|
||||||
|
|
||||||
@export var image : Image
|
@export var terrainSize : Vector2 = Vector2(1000,1000)
|
||||||
@export var image_size : Vector2i
|
|
||||||
|
|
||||||
func _init(terrain_size : Vector2):
|
@export var contamination : Image = null
|
||||||
image_size = terrain_size / UNIT_PER_PIXEL
|
|
||||||
image = Image.create(
|
|
||||||
image_size.x,
|
|
||||||
image_size.y,
|
|
||||||
false,
|
|
||||||
Image.Format.FORMAT_L8
|
|
||||||
)
|
|
||||||
|
|
||||||
func draw_random_zone(
|
func generate_default_contamination(
|
||||||
zone_max_size : float,
|
central_zone_max_size : int = DEFAULT_CONTAMINATION_CENTRAL_ZONE_MAX_SIZE,
|
||||||
zone_min_size : float,
|
central_zone_min_size : int = DEFAULT_CONTAMINATION_CENTRAL_ZONE_MIN_SIZE,
|
||||||
zone_position : Vector2i
|
|
||||||
):
|
):
|
||||||
var noise: Noise = FastNoiseLite.new()
|
var noise: Noise = FastNoiseLite.new()
|
||||||
noise.seed = randi()
|
noise.seed = randi()
|
||||||
noise.noise_type = FastNoiseLite.TYPE_CELLULAR
|
noise.noise_type = FastNoiseLite.TYPE_CELLULAR
|
||||||
noise.frequency = 0.001 / UNIT_PER_PIXEL
|
noise.frequency = 0.005 * TERRAIN_IMAGE_GAME_FACTOR
|
||||||
|
|
||||||
var noise_image_size : Vector2i = Vector2i.ONE * zone_max_size / UNIT_PER_PIXEL
|
var imageSize = terrainSize / TERRAIN_IMAGE_GAME_FACTOR;
|
||||||
var noise_image_center = noise_image_size / 2
|
|
||||||
|
|
||||||
var noise_image = noise.get_image(
|
var noise_image = noise.get_image(
|
||||||
noise_image_size.x,
|
imageSize.x,
|
||||||
noise_image_size.y,
|
imageSize.y,
|
||||||
1.0,
|
1.0
|
||||||
)
|
)
|
||||||
|
|
||||||
ImageTools.draw_gradient(
|
ImageTools.draw_gradient(
|
||||||
noise_image,
|
noise_image,
|
||||||
noise_image_center,
|
imageSize/2,
|
||||||
roundi(zone_min_size / UNIT_PER_PIXEL)
|
central_zone_min_size / TERRAIN_IMAGE_GAME_FACTOR
|
||||||
)
|
)
|
||||||
|
|
||||||
ImageTools.draw_gradient(
|
ImageTools.draw_gradient(
|
||||||
noise_image,
|
noise_image,
|
||||||
noise_image_center,
|
imageSize/2,
|
||||||
roundi(zone_max_size / UNIT_PER_PIXEL),
|
central_zone_max_size / TERRAIN_IMAGE_GAME_FACTOR,
|
||||||
Color.BLACK,
|
Color.BLACK,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
ImageTools.flatten(noise_image, 0.5)
|
ImageTools.flatten(noise_image, 0.5)
|
||||||
|
|
||||||
image.blit_rect(
|
contamination = Image.create(
|
||||||
noise_image,
|
imageSize.x,
|
||||||
Rect2i(
|
imageSize.y,
|
||||||
Vector2i.ZERO,
|
false,
|
||||||
noise_image_size
|
Image.Format.FORMAT_L8
|
||||||
),
|
|
||||||
Vector2i(zone_position / UNIT_PER_PIXEL) - noise_image_size/2
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func draw_circle(position : Vector2, impact_radius : float, to_value : float = 1.):
|
contamination.copy_from(noise_image)
|
||||||
|
|
||||||
|
func impact_contamination(position : Vector2, impact_radius : int, to_value : float = 1.):
|
||||||
ImageTools.draw_circle(
|
ImageTools.draw_circle(
|
||||||
image,
|
contamination,
|
||||||
position / UNIT_PER_PIXEL,
|
position / TERRAIN_IMAGE_GAME_FACTOR,
|
||||||
roundi(impact_radius / UNIT_PER_PIXEL),
|
impact_radius / TERRAIN_IMAGE_GAME_FACTOR,
|
||||||
Color(1., 1., 1., to_value)
|
Color(1., 1., 1., to_value)
|
||||||
)
|
)
|
||||||
|
|
||||||
func is_in_image(pixel_point : Vector2i):
|
func is_in_image(pixel_point : Vector2, image : Image):
|
||||||
return (
|
return (
|
||||||
pixel_point.x > 0
|
pixel_point.x > 0
|
||||||
and pixel_point.y > 0
|
and pixel_point.y > 0
|
||||||
and pixel_point.x < image.get_width()
|
and pixel_point.x < image.get_width()
|
||||||
and pixel_point.y < image.get_height())
|
and pixel_point.y < image.get_height())
|
||||||
|
|
||||||
func is_in_terrain(point : Vector2):
|
func get_contamination(point : Vector2) -> float:
|
||||||
return is_in_image(get_pixel_point(point))
|
var pixel_point : Vector2 = get_pixel_point(point)
|
||||||
|
if (is_in_image(pixel_point, contamination)):
|
||||||
func get_value(point : Vector2) -> float:
|
return contamination.get_pixel(
|
||||||
var pixel_point : Vector2i = get_pixel_point(point)
|
int(round(pixel_point.x)),
|
||||||
if (is_in_image(pixel_point)):
|
int(round(pixel_point.y))
|
||||||
return image.get_pixel(
|
|
||||||
pixel_point.x,
|
|
||||||
pixel_point.y
|
|
||||||
).r
|
).r
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
func get_value_coverage() -> float:
|
func get_decontamination_coverage() -> float:
|
||||||
return ImageTools.get_color_coverage(image)
|
return ImageTools.get_color_coverage(contamination)
|
||||||
|
|
||||||
func get_value_surface() -> float:
|
func get_pixel_point(point : Vector2) -> Vector2:
|
||||||
return float(ImageTools.get_color_pixel_count(image)) / UNIT_PER_PIXEL
|
return (
|
||||||
|
Vector2(point) / float(TERRAIN_IMAGE_GAME_FACTOR)
|
||||||
func get_pixel_point(point : Vector2) -> Vector2i:
|
- Vector2.ONE / 2
|
||||||
return Vector2i(
|
|
||||||
Vector2(point) / UNIT_PER_PIXEL
|
|
||||||
)
|
)
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
uid://we5pyyr1n06v
|
uid://cx30nvq8b34lj
|
||||||
|
|||||||
@ -1,7 +0,0 @@
|
|||||||
extends Node
|
|
||||||
|
|
||||||
var game_data : GameData
|
|
||||||
|
|
||||||
func _init():
|
|
||||||
if not game_data:
|
|
||||||
game_data = GameData.new()
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://dcamb3xjyfqm1
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-cube-3d-sphere"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 17.6l-2 -1.1v-2.5" /><path d="M4 10v-2.5l2 -1.1" /><path d="M10 4.1l2 -1.1l2 1.1" /><path d="M18 6.4l2 1.1v2.5" /><path d="M20 14v2.5l-2 1.12" /><path d="M14 19.9l-2 1.1l-2 -1.1" /><path d="M12 12l2 -1.1" /><path d="M18 8.6l2 -1.1" /><path d="M12 12l0 2.5" /><path d="M12 18.5l0 2.5" /><path d="M12 12l-2 -1.12" /><path d="M6 8.6l-2 -1.1" /></svg>
|
|
||||||
|
Before Width: | Height: | Size: 669 B |
@ -1,37 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bsvxhafoxwmw0"
|
|
||||||
path="res://.godot/imported/cube-3d-sphere.svg-f86899fe00f38af995e1752e193f1d54.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://common/icons/cube-3d-sphere.svg"
|
|
||||||
dest_files=["res://.godot/imported/cube-3d-sphere.svg-f86899fe00f38af995e1752e193f1d54.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
svg/scale=2.0
|
|
||||||
editor/scale_with_editor_scale=false
|
|
||||||
editor/convert_colors_with_editor_theme=false
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-hourglass-empty"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 20v-2a6 6 0 1 1 12 0v2a1 1 0 0 1 -1 1h-10a1 1 0 0 1 -1 -1z" /><path d="M6 4v2a6 6 0 1 0 12 0v-2a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1z" /></svg>
|
|
||||||
|
Before Width: | Height: | Size: 464 B |
@ -1,37 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://cxkmn71f8d2hy"
|
|
||||||
path="res://.godot/imported/hourglass-empty.svg-e7568d697204ad5aa1416ea495c59e73.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://common/icons/hourglass-empty.svg"
|
|
||||||
dest_files=["res://.godot/imported/hourglass-empty.svg-e7568d697204ad5aa1416ea495c59e73.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
svg/scale=2.0
|
|
||||||
editor/scale_with_editor_scale=false
|
|
||||||
editor/convert_colors_with_editor_theme=false
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#ffffff" class="icon icon-tabler icons-tabler-filled icon-tabler-seedling"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 3a7 7 0 0 1 6.95 6.155a6.97 6.97 0 0 1 5.05 -2.155h3a1 1 0 0 1 1 1v1a7 7 0 0 1 -7 7h-2v4a1 1 0 0 1 -2 0v-7h-2a7 7 0 0 1 -7 -7v-2a1 1 0 0 1 1 -1z" /></svg>
|
|
||||||
|
Before Width: | Height: | Size: 387 B |
@ -1,37 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://b0wy3dbpxbnt7"
|
|
||||||
path="res://.godot/imported/seedling.svg-86222438bce7bb2a4f266ea315728eb5.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://common/icons/seedling.svg"
|
|
||||||
dest_files=["res://.godot/imported/seedling.svg-86222438bce7bb2a4f266ea315728eb5.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
svg/scale=2.0
|
|
||||||
editor/scale_with_editor_scale=false
|
|
||||||
editor/convert_colors_with_editor_theme=false
|
|
||||||
|
Before Width: | Height: | Size: 468 B After Width: | Height: | Size: 468 B |
@ -3,15 +3,15 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://0xg54agef5gh"
|
uid="uid://0xg54agef5gh"
|
||||||
path="res://.godot/imported/package.svg-0d0e7de2f6c04b754487a1f6252ee2a1.ctex"
|
path="res://.godot/imported/package.svg-a9602fd424cfb199cd9405d02663e7df.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://common/icons/package.svg"
|
source_file="res://common/inventory/assets/icons/package.svg"
|
||||||
dest_files=["res://.godot/imported/package.svg-0d0e7de2f6c04b754487a1f6252ee2a1.ctex"]
|
dest_files=["res://.godot/imported/package.svg-a9602fd424cfb199cd9405d02663e7df.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
@ -32,6 +32,6 @@ process/hdr_as_srgb=false
|
|||||||
process/hdr_clamp_exposure=false
|
process/hdr_clamp_exposure=false
|
||||||
process/size_limit=0
|
process/size_limit=0
|
||||||
detect_3d/compress_to=1
|
detect_3d/compress_to=1
|
||||||
svg/scale=2.0
|
svg/scale=1.0
|
||||||
editor/scale_with_editor_scale=false
|
editor/scale_with_editor_scale=false
|
||||||
editor/convert_colors_with_editor_theme=false
|
editor/convert_colors_with_editor_theme=false
|
||||||
|
Before Width: | Height: | Size: 524 B After Width: | Height: | Size: 524 B |
@ -3,15 +3,15 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://bo3o2qf3i20ke"
|
uid="uid://bo3o2qf3i20ke"
|
||||||
path="res://.godot/imported/scuba-diving-tank.svg-2724f573f5956cc7af7dbc8616ac0aa4.ctex"
|
path="res://.godot/imported/scuba-diving-tank.svg-d6c94087bb8fe7a9f788baf1911a56a2.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://common/icons/scuba-diving-tank.svg"
|
source_file="res://common/inventory/assets/icons/scuba-diving-tank.svg"
|
||||||
dest_files=["res://.godot/imported/scuba-diving-tank.svg-2724f573f5956cc7af7dbc8616ac0aa4.ctex"]
|
dest_files=["res://.godot/imported/scuba-diving-tank.svg-d6c94087bb8fe7a9f788baf1911a56a2.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 498 B After Width: | Height: | Size: 498 B |
@ -3,15 +3,15 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://bf6nw4onkhavr"
|
uid="uid://bf6nw4onkhavr"
|
||||||
path="res://.godot/imported/shovel.svg-094c34e330000cc8ea425d6acf7556bd.ctex"
|
path="res://.godot/imported/shovel.svg-f17d484b3a88170abdf08077458176fb.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://common/icons/shovel.svg"
|
source_file="res://common/inventory/assets/icons/shovel.svg"
|
||||||
dest_files=["res://.godot/imported/shovel.svg-094c34e330000cc8ea425d6acf7556bd.ctex"]
|
dest_files=["res://.godot/imported/shovel.svg-f17d484b3a88170abdf08077458176fb.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
15
common/inventory/resources/items/compost.tres
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
[gd_resource type="Resource" script_class="Package" load_steps=4 format=3 uid="uid://bya8sm6rm6747"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://0xg54agef5gh" path="res://common/inventory/assets/icons/package.svg" id="1_lhhdv"]
|
||||||
|
[ext_resource type="Script" uid="uid://b6kubqgq0k7vj" path="res://common/inventory/scripts/items/package.gd" id="1_x02bb"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bkwh1ntvgkkrt" path="res://entities/interactables/machines/compost/compost.tscn" id="2_uulso"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_x02bb")
|
||||||
|
scene = ExtResource("2_uulso")
|
||||||
|
name = "Compost"
|
||||||
|
description = "Compost"
|
||||||
|
icon = ExtResource("1_lhhdv")
|
||||||
|
use_zone_radius = 5
|
||||||
|
use_energy = 1
|
||||||
|
metadata/_custom_type_script = "uid://b6kubqgq0k7vj"
|
||||||
13
common/inventory/resources/items/default_seed.tres
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[gd_resource type="Resource" script_class="Seed" load_steps=3 format=3 uid="uid://lrl2okkhyxmx"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://gui/game/assets/icons/bolt.svg" id="1_dy25s"]
|
||||||
|
[ext_resource type="Script" uid="uid://bypjcvlc15gsm" path="res://common/inventory/scripts/items/seed.gd" id="2_mgcdi"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("2_mgcdi")
|
||||||
|
name = "Boule"
|
||||||
|
description = ""
|
||||||
|
icon = ExtResource("1_dy25s")
|
||||||
|
use_zone_radius = 5
|
||||||
|
use_energy = 1
|
||||||
|
metadata/_custom_type_script = "uid://bypjcvlc15gsm"
|
||||||
13
common/inventory/resources/items/default_shovel.tres
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[gd_resource type="Resource" script_class="Shovel" load_steps=3 format=3 uid="uid://ddqalo1k30i5x"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bf6nw4onkhavr" path="res://common/inventory/assets/icons/shovel.svg" id="1_7g3xd"]
|
||||||
|
[ext_resource type="Script" uid="uid://dya38x1h1uiyg" path="res://common/inventory/scripts/items/shovel.gd" id="1_28h2r"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_28h2r")
|
||||||
|
name = "Shovel"
|
||||||
|
description = "Can dig burried seed, and transform mature plants to seeds."
|
||||||
|
icon = ExtResource("1_7g3xd")
|
||||||
|
use_zone_radius = 50
|
||||||
|
use_energy = 1
|
||||||
|
metadata/_custom_type_script = "uid://dya38x1h1uiyg"
|
||||||
11
common/inventory/resources/items/water_can.tres
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[gd_resource type="Resource" script_class="Item" load_steps=3 format=3 uid="uid://dbja8xm7ehw1v"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bo3o2qf3i20ke" path="res://common/inventory/assets/icons/scuba-diving-tank.svg" id="1_sy4rh"]
|
||||||
|
[ext_resource type="Script" uid="uid://bq7admu4ahs5r" path="res://common/inventory/scripts/item.gd" id="2_aikyk"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("2_aikyk")
|
||||||
|
name = "Water Can"
|
||||||
|
description = "Water all plants"
|
||||||
|
icon = ExtResource("1_sy4rh")
|
||||||
|
metadata/_custom_type_script = "uid://bq7admu4ahs5r"
|
||||||
@ -1,26 +1,11 @@
|
|||||||
extends Resource
|
extends Resource
|
||||||
class_name Item
|
class_name Item
|
||||||
|
|
||||||
var name: String : get = get_item_name
|
@export var name: String
|
||||||
var description: String : get = get_description
|
@export_multiline var description: String
|
||||||
var icon: Texture2D : get = get_icon
|
@export var icon: Texture2D
|
||||||
var usage_zone_radius: int = 5 : get = get_usage_zone_radius
|
@export var use_zone_radius: int = 5
|
||||||
var energy_usage : int = 1 : get = get_energy_used
|
@export var use_energy: int = 1
|
||||||
|
|
||||||
func get_item_name() -> String:
|
|
||||||
return name
|
|
||||||
|
|
||||||
func get_description() -> String:
|
|
||||||
return description
|
|
||||||
|
|
||||||
func get_icon() -> Texture2D:
|
|
||||||
return icon
|
|
||||||
|
|
||||||
func get_energy_used() -> int:
|
|
||||||
return energy_usage
|
|
||||||
|
|
||||||
func get_usage_zone_radius() -> int:
|
|
||||||
return usage_zone_radius
|
|
||||||
|
|
||||||
func is_one_time_use():
|
func is_one_time_use():
|
||||||
return false
|
return false
|
||||||
@ -31,5 +16,8 @@ func can_use(_player : Player, zone: Area2D) -> bool:
|
|||||||
func use_text() -> String:
|
func use_text() -> String:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
func use_requirement_text() -> String:
|
||||||
|
return ""
|
||||||
|
|
||||||
func use(_player : Player, zone: Area2D):
|
func use(_player : Player, zone: Area2D):
|
||||||
return false
|
return false
|
||||||
|
|||||||
@ -1,39 +0,0 @@
|
|||||||
extends Item
|
|
||||||
class_name Blueprint
|
|
||||||
|
|
||||||
@export var machine_type: MachineType
|
|
||||||
@export var machine_level: int = 1
|
|
||||||
|
|
||||||
func _init(_machine_type : MachineType = null, _machine_level : int = 1):
|
|
||||||
machine_type = _machine_type
|
|
||||||
machine_level = _machine_level
|
|
||||||
|
|
||||||
func get_item_name() -> String:
|
|
||||||
if machine_type:
|
|
||||||
return machine_type.name + " level " + str(machine_level)
|
|
||||||
return ""
|
|
||||||
|
|
||||||
func get_description() -> String:
|
|
||||||
if machine_type:
|
|
||||||
return machine_type.description
|
|
||||||
return ""
|
|
||||||
|
|
||||||
func get_icon() -> Texture2D:
|
|
||||||
return preload("res://common/icons/cube-3d-sphere.svg")
|
|
||||||
|
|
||||||
func use_text() -> String:
|
|
||||||
if machine_type:
|
|
||||||
return "Build " + machine_type.name
|
|
||||||
return ""
|
|
||||||
|
|
||||||
func is_one_time_use():
|
|
||||||
return true
|
|
||||||
|
|
||||||
func can_use(player : Player, zone : Area2D) -> bool:
|
|
||||||
return player.planet.is_in_base(zone.global_position)
|
|
||||||
|
|
||||||
func use(player : Player, zone : Area2D) -> bool:
|
|
||||||
if machine_type and machine_level:
|
|
||||||
player.planet.instantiate_machine(machine_type, machine_level, zone.global_position)
|
|
||||||
return true
|
|
||||||
return false
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://dcowcvjk2m7va
|
|
||||||
@ -2,30 +2,18 @@ extends Item
|
|||||||
class_name Package
|
class_name Package
|
||||||
|
|
||||||
@export var scene: PackedScene
|
@export var scene: PackedScene
|
||||||
@export var package_name : String
|
|
||||||
@export_multiline var package_description : String
|
|
||||||
|
|
||||||
|
|
||||||
func _init(_scene : PackedScene = null):
|
func _init(_scene : PackedScene = null):
|
||||||
scene = _scene
|
scene = _scene
|
||||||
|
|
||||||
func get_item_name() -> String:
|
|
||||||
return package_name
|
|
||||||
|
|
||||||
func get_description() -> String:
|
|
||||||
return package_description
|
|
||||||
|
|
||||||
func get_icon() -> Texture2D:
|
|
||||||
return preload("res://common/icons/package.svg")
|
|
||||||
|
|
||||||
func use_text() -> String:
|
func use_text() -> String:
|
||||||
return "Open"
|
return "Build " + name
|
||||||
|
|
||||||
func is_one_time_use():
|
func is_one_time_use():
|
||||||
return true
|
return true
|
||||||
|
|
||||||
func can_use(player : Player, zone : Area2D) -> bool:
|
func can_use(player : Player, zone : Area2D) -> bool:
|
||||||
return true
|
return player.planet.is_in_zone(zone.global_position)
|
||||||
|
|
||||||
func use(player : Player, zone : Area2D) -> bool:
|
func use(player : Player, zone : Area2D) -> bool:
|
||||||
player.planet.instantiate_entity(scene, zone.global_position)
|
player.planet.instantiate_entity(scene, zone.global_position)
|
||||||
|
|||||||
@ -1,19 +1,14 @@
|
|||||||
|
@tool
|
||||||
extends Item
|
extends Item
|
||||||
class_name Seed
|
class_name Seed
|
||||||
|
|
||||||
@export var plant_type: PlantType
|
@export var plant_type: PlantType :
|
||||||
|
set(v):
|
||||||
func get_item_name() -> String:
|
plant_type = v
|
||||||
return plant_type.name
|
if plant_type:
|
||||||
|
name = plant_type.name
|
||||||
func get_description() -> String:
|
description = plant_type.description
|
||||||
return plant_type.description
|
icon = plant_type.seed_texture
|
||||||
|
|
||||||
func get_icon() -> Texture2D:
|
|
||||||
return plant_type.seed_texture
|
|
||||||
|
|
||||||
func get_energy_used() -> int:
|
|
||||||
return 1
|
|
||||||
|
|
||||||
func _init(_plant_type : PlantType = null):
|
func _init(_plant_type : PlantType = null):
|
||||||
plant_type = _plant_type
|
plant_type = _plant_type
|
||||||
@ -25,12 +20,7 @@ func is_one_time_use():
|
|||||||
return true
|
return true
|
||||||
|
|
||||||
func can_use(player : Player, zone : Area2D) -> bool:
|
func can_use(player : Player, zone : Area2D) -> bool:
|
||||||
var is_there_a_plant_here = false
|
return not player.planet.is_there_contamination(zone.global_position)
|
||||||
for area in zone.get_overlapping_areas() :
|
|
||||||
if area is Plant:
|
|
||||||
is_there_a_plant_here = true
|
|
||||||
|
|
||||||
return not is_there_a_plant_here and not player.planet.is_there_contamination(zone.global_position)
|
|
||||||
|
|
||||||
func use(player : Player, zone : Area2D) -> bool:
|
func use(player : Player, zone : Area2D) -> bool:
|
||||||
player.play_sfx("dig")
|
player.play_sfx("dig")
|
||||||
|
|||||||
@ -2,22 +2,6 @@ extends Item
|
|||||||
class_name Shovel
|
class_name Shovel
|
||||||
|
|
||||||
const USE_INTERVAL = 0.15
|
const USE_INTERVAL = 0.15
|
||||||
const SHOVEL_ZONE_RADIUS = 50
|
|
||||||
|
|
||||||
func get_item_name() -> String:
|
|
||||||
return "Shovel"
|
|
||||||
|
|
||||||
func get_description() -> String:
|
|
||||||
return "Can dig up buried seeds and can be used to harvest mature plants."
|
|
||||||
|
|
||||||
func get_icon() -> Texture2D:
|
|
||||||
return preload("res://common/icons/shovel.svg")
|
|
||||||
|
|
||||||
func get_energy_used() -> int:
|
|
||||||
return 1
|
|
||||||
|
|
||||||
func get_usage_zone_radius() -> int:
|
|
||||||
return SHOVEL_ZONE_RADIUS
|
|
||||||
|
|
||||||
func use_text() -> String:
|
func use_text() -> String:
|
||||||
return "Dig"
|
return "Dig"
|
||||||
|
|||||||
@ -11,13 +11,11 @@ stream_0 = ExtResource("1_stre8")
|
|||||||
stream_1 = ExtResource("2_ji160")
|
stream_1 = ExtResource("2_ji160")
|
||||||
|
|
||||||
[node name="Music" type="Node"]
|
[node name="Music" type="Node"]
|
||||||
process_mode = 3
|
|
||||||
|
|
||||||
[node name="AudioStreamPlayer_music" type="AudioStreamPlayer" parent="."]
|
[node name="AudioStreamPlayer_music" type="AudioStreamPlayer" parent="."]
|
||||||
stream = SubResource("AudioStreamPlaylist_ei6w7")
|
stream = SubResource("AudioStreamPlaylist_ei6w7")
|
||||||
volume_db = -5.0
|
volume_db = -5.0
|
||||||
autoplay = true
|
autoplay = true
|
||||||
parameters/looping = false
|
|
||||||
|
|
||||||
[node name="AudioStreamPlayer2_ambient" type="AudioStreamPlayer" parent="."]
|
[node name="AudioStreamPlayer2_ambient" type="AudioStreamPlayer" parent="."]
|
||||||
stream = ExtResource("2_n52pk")
|
stream = ExtResource("2_n52pk")
|
||||||
|
|||||||
@ -1,63 +1,61 @@
|
|||||||
class_name ImageTools
|
class_name ImageTools
|
||||||
|
|
||||||
static func get_color_coverage(image: Image, color: Color = Color.WHITE) -> float:
|
static func get_color_coverage(image: Image, color: Color = Color.WHITE):
|
||||||
return float(get_color_pixel_count(image, color))/(image.get_width()*image.get_height())
|
var pixel_color_count = 0.
|
||||||
|
for x in range(image.get_width()):
|
||||||
|
for y in range(image.get_height()):
|
||||||
|
if image.get_pixel(x, y) == color:
|
||||||
|
pixel_color_count += 1.
|
||||||
|
return pixel_color_count/(image.get_width()*image.get_height())
|
||||||
|
|
||||||
static func get_color_pixel_count(image: Image, color: Color = Color.WHITE) -> int:
|
|
||||||
var pixel_color_count = 0.
|
|
||||||
for x in range(image.get_width()):
|
|
||||||
for y in range(image.get_height()):
|
|
||||||
if image.get_pixel(x, y) == color:
|
|
||||||
pixel_color_count += 1.
|
|
||||||
return pixel_color_count
|
|
||||||
|
|
||||||
static func draw_circle(image: Image, center: Vector2i, length: int, color: Color = Color.WHITE):
|
static func draw_circle(image: Image, center: Vector2i, length: int, color: Color = Color.WHITE):
|
||||||
for x in range(image.get_width()):
|
for x in range(image.get_width()):
|
||||||
for y in range(image.get_height()):
|
for y in range(image.get_height()):
|
||||||
var center_distance = Vector2i(x, y).distance_to(center)
|
var center_distance = Vector2i(x, y).distance_to(center)
|
||||||
|
|
||||||
if (center_distance <= length):
|
if (center_distance <= length):
|
||||||
image.set_pixel(x, y, color)
|
image.set_pixel(x, y, color)
|
||||||
|
|
||||||
|
|
||||||
static func draw_gradient(image: Image, center: Vector2i, length: int, color: Color = Color.WHITE, inverse := false):
|
static func draw_gradient(image: Image, center: Vector2i, length: int, color: Color = Color.WHITE, inverse := false):
|
||||||
for x in range(image.get_width()):
|
for x in range(image.get_width()):
|
||||||
for y in range(image.get_height()):
|
for y in range(image.get_height()):
|
||||||
var original_pixel_color = image.get_pixel(x, y)
|
var original_pixel_color = image.get_pixel(x, y)
|
||||||
var center_distance = Vector2i(x, y).distance_to(center)
|
var center_distance = Vector2i(x, y).distance_to(center)
|
||||||
|
|
||||||
if (center_distance == 0):
|
if (center_distance == 0):
|
||||||
if not inverse:
|
if not inverse:
|
||||||
image.set_pixel(x, y, original_pixel_color.blend(color))
|
image.set_pixel(x, y, original_pixel_color.blend(color))
|
||||||
else:
|
else:
|
||||||
var color_to_add = Color(color, 1 / (center_distance / length)) if not inverse else Color(color, center_distance / length)
|
var color_to_add = Color(color, 1 / (center_distance / length)) if not inverse else Color(color, center_distance / length)
|
||||||
image.set_pixel(
|
image.set_pixel(
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
original_pixel_color.blend(color_to_add)
|
original_pixel_color.blend(color_to_add)
|
||||||
)
|
)
|
||||||
|
|
||||||
static func flatten(image: Image, threshold := 0.5):
|
static func flatten(image: Image, threshold := 0.5):
|
||||||
for x in range(image.get_width()):
|
for x in range(image.get_width()):
|
||||||
for y in range(image.get_height()):
|
for y in range(image.get_height()):
|
||||||
var original_pixel_color = image.get_pixel(x, y)
|
var original_pixel_color = image.get_pixel(x, y)
|
||||||
|
|
||||||
if original_pixel_color.r > threshold:
|
if original_pixel_color.r > threshold:
|
||||||
image.set_pixel(
|
image.set_pixel(
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
Color.WHITE
|
Color.WHITE
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
image.set_pixel(
|
image.set_pixel(
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
Color.BLACK
|
Color.BLACK
|
||||||
)
|
)
|
||||||
|
|
||||||
static func copy(from: Image, to : Image):
|
static func copy(from: Image, to : Image):
|
||||||
for x in range(from.get_width()):
|
for x in range(from.get_width()):
|
||||||
for y in range(from.get_height()):
|
for y in range(from.get_height()):
|
||||||
to.set_pixel(x, y, from.get_pixel(x, y))
|
to.set_pixel(x, y, from.get_pixel(x, y))
|
||||||
|
|
||||||
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
[gd_scene load_steps=7 format=3 uid="uid://bcj812ox8xv2t"]
|
[gd_scene load_steps=7 format=3 uid="uid://bcj812ox8xv2t"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://reliyx2pg7kf" path="res://entities/interactables/item_object/script/item_object_sprite.gd" id="1_wing4"]
|
[ext_resource type="Script" uid="uid://reliyx2pg7kf" path="res://entities/interactables/item_object/script/item_object_sprite.gd" id="1_wing4"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bo3o2qf3i20ke" path="res://common/icons/scuba-diving-tank.svg" id="2_ng3e4"]
|
[ext_resource type="Texture2D" uid="uid://bo3o2qf3i20ke" path="res://common/inventory/assets/icons/scuba-diving-tank.svg" id="2_ng3e4"]
|
||||||
[ext_resource type="Texture2D" uid="uid://c1eiu5ag7lcp8" path="res://entities/interactables/item_object/assets/sprites/shadow.svg" id="2_ng201"]
|
[ext_resource type="Texture2D" uid="uid://c1eiu5ag7lcp8" path="res://entities/interactables/item_object/assets/sprites/shadow.svg" id="2_ng201"]
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_wing4"]
|
[sub_resource type="Animation" id="Animation_wing4"]
|
||||||
|
|||||||
@ -22,26 +22,13 @@ func _ready():
|
|||||||
if item and object_sprite:
|
if item and object_sprite:
|
||||||
object_sprite.apply_texture_to_sprite(item.icon, ITEM_SPRITE_SIZE)
|
object_sprite.apply_texture_to_sprite(item.icon, ITEM_SPRITE_SIZE)
|
||||||
|
|
||||||
func pointer_text():
|
|
||||||
var name_suffix = ""
|
|
||||||
|
|
||||||
if item is Seed:
|
func inspected_text():
|
||||||
name_suffix = "Seed"
|
return item.name + (" Seed" if item is Seed else "")
|
||||||
if item is Package:
|
|
||||||
name_suffix = "Package"
|
|
||||||
|
|
||||||
return item.name + (" " + name_suffix if name_suffix else "")
|
|
||||||
|
|
||||||
func interact_text():
|
func interact_text():
|
||||||
return "Take"
|
return "Take"
|
||||||
|
|
||||||
func inspector_info() -> Inspector.Info:
|
|
||||||
return Inspector.Info.new(
|
|
||||||
pointer_text(),
|
|
||||||
item.description,
|
|
||||||
item.icon
|
|
||||||
)
|
|
||||||
|
|
||||||
func interact(player : Player) -> bool:
|
func interact(player : Player) -> bool:
|
||||||
var swapped_item = player.inventory.get_item()
|
var swapped_item = player.inventory.get_item()
|
||||||
|
|
||||||
@ -68,10 +55,9 @@ func generate_sprite() -> ItemObjectSprite:
|
|||||||
var spriteNode = SPRITE_SCENE.instantiate() as ItemObjectSprite
|
var spriteNode = SPRITE_SCENE.instantiate() as ItemObjectSprite
|
||||||
add_child(spriteNode)
|
add_child(spriteNode)
|
||||||
|
|
||||||
if item:
|
spriteNode.apply_texture_to_sprite(
|
||||||
spriteNode.apply_texture_to_sprite(
|
item.icon,
|
||||||
item.icon,
|
ITEM_SPRITE_SIZE
|
||||||
ITEM_SPRITE_SIZE
|
)
|
||||||
)
|
|
||||||
|
|
||||||
return spriteNode
|
return spriteNode
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
[gd_resource type="Resource" script_class="MachineType" load_steps=3 format=3 uid="uid://cv2tf0tydqj5v"]
|
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bkwh1ntvgkkrt" path="res://entities/interactables/machines/compost/compost.tscn" id="1_8ajib"]
|
|
||||||
[ext_resource type="Script" uid="uid://bhncww816fjsb" path="res://entities/interactables/machines/scripts/machine_info.gd" id="1_vktn1"]
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
script = ExtResource("1_vktn1")
|
|
||||||
name = "Compost"
|
|
||||||
scene = ExtResource("1_8ajib")
|
|
||||||
description = "Can generate temporary energy in exchange of seeds."
|
|
||||||
@ -1,11 +1,7 @@
|
|||||||
[gd_scene load_steps=11 format=3 uid="uid://bkwh1ntvgkkrt"]
|
[gd_scene load_steps=10 format=3 uid="uid://bkwh1ntvgkkrt"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://dw6jgsasb2fe1" path="res://entities/interactables/machines/compost/scripts/compost.gd" id="1_c0pig"]
|
[ext_resource type="Script" uid="uid://dw6jgsasb2fe1" path="res://entities/interactables/machines/compost/scripts/compost.gd" id="1_c0pig"]
|
||||||
[ext_resource type="Texture2D" uid="uid://f2rte5jc0psp" path="res://entities/interactables/machines/compost/assets/sprites/compost.svg" id="2_r6435"]
|
[ext_resource type="Texture2D" uid="uid://f2rte5jc0psp" path="res://entities/interactables/machines/compost/assets/sprites/compost.svg" id="2_r6435"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_akkx7"]
|
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_akkx7"]
|
|
||||||
size = Vector2(66, 84)
|
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_etofw"]
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_etofw"]
|
||||||
bg_color = Color(0.260098, 0.11665, 0.0419712, 0.231373)
|
bg_color = Color(0.260098, 0.11665, 0.0419712, 0.231373)
|
||||||
@ -99,14 +95,14 @@ _data = {
|
|||||||
&"fill": SubResource("Animation_etofw")
|
&"fill": SubResource("Animation_etofw")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_akkx7"]
|
||||||
|
size = Vector2(66, 84)
|
||||||
|
|
||||||
[node name="Compost" type="Area2D"]
|
[node name="Compost" type="Area2D"]
|
||||||
script = ExtResource("1_c0pig")
|
script = ExtResource("1_c0pig")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
|
||||||
shape = SubResource("RectangleShape2D_akkx7")
|
|
||||||
|
|
||||||
[node name="Compost" type="Sprite2D" parent="."]
|
[node name="Compost" type="Sprite2D" parent="."]
|
||||||
self_modulate = Color(0.729698, 0.588265, 0.105405, 1)
|
modulate = Color(0.615686, 0.501961, 0.270588, 1)
|
||||||
scale = Vector2(0.291262, 0.291262)
|
scale = Vector2(0.291262, 0.291262)
|
||||||
texture = ExtResource("2_r6435")
|
texture = ExtResource("2_r6435")
|
||||||
|
|
||||||
@ -121,13 +117,10 @@ theme_override_styles/fill = SubResource("StyleBoxFlat_3ao1n")
|
|||||||
fill_mode = 3
|
fill_mode = 3
|
||||||
show_percentage = false
|
show_percentage = false
|
||||||
|
|
||||||
[node name="Bolt" type="Sprite2D" parent="Compost"]
|
|
||||||
z_index = 1
|
|
||||||
position = Vector2(0, 54.9334)
|
|
||||||
scale = Vector2(2.00278, 2.00278)
|
|
||||||
texture = ExtResource("3_akkx7")
|
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
libraries = {
|
libraries = {
|
||||||
&"": SubResource("AnimationLibrary_etofw")
|
&"": SubResource("AnimationLibrary_etofw")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource("RectangleShape2D_akkx7")
|
||||||
|
|||||||
@ -1,41 +1,36 @@
|
|||||||
extends Machine
|
extends Machine
|
||||||
class_name Compost
|
class_name Compost
|
||||||
|
|
||||||
var containing_seed : int = 0
|
var value_per_seed : float = 0.5
|
||||||
|
var fill_value : float = 0.
|
||||||
func get_seed_needed(l : int = level) -> int:
|
|
||||||
match l:
|
|
||||||
1: return 3
|
|
||||||
2: return 2
|
|
||||||
3: return 2
|
|
||||||
_: return 1
|
|
||||||
|
|
||||||
func get_energy_production(l : int = level) -> int:
|
|
||||||
match l:
|
|
||||||
1: return 1
|
|
||||||
2: return 1
|
|
||||||
_: return 2
|
|
||||||
|
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
%ProgressBar.value = lerp(%ProgressBar.value, float(containing_seed) / float(get_seed_needed()) * 100, 0.5)
|
%ProgressBar.value = lerp(%ProgressBar.value, fill_value * 100, 0.5)
|
||||||
|
|
||||||
|
func inspected_text():
|
||||||
|
return "Compost"
|
||||||
|
|
||||||
func interact_text():
|
func interact_text():
|
||||||
return "Put a seed ("+str(get_seed_needed() - containing_seed)+" left)"
|
return "Put a seed ("+str(roundi((1-fill_value)/value_per_seed))+" left)"
|
||||||
|
|
||||||
func can_interact(p : Player) -> bool:
|
func can_interact(p : Player) -> bool:
|
||||||
return p.inventory.get_item() and p.inventory.get_item() is Seed
|
return p.inventory.get_item() and p.inventory.get_item() is Seed
|
||||||
|
|
||||||
|
func requirement_text() -> String:
|
||||||
|
return "You must have a seed in hand"
|
||||||
|
|
||||||
func interact(p : Player) -> bool:
|
func interact(p : Player) -> bool:
|
||||||
if not can_interact(p):
|
if not can_interact(p):
|
||||||
return false
|
return false
|
||||||
|
|
||||||
p.play_sfx("harvest")
|
p.play_sfx("harvest")
|
||||||
p.delete_item(p.inventory.get_item())
|
p.delete_item(p.inventory.get_item())
|
||||||
containing_seed += 1
|
fill_value += value_per_seed
|
||||||
if containing_seed >= get_seed_needed():
|
if fill_value >= 1.:
|
||||||
$AnimationPlayer.play("empty")
|
$AnimationPlayer.play("empty")
|
||||||
containing_seed = 0
|
fill_value = 0
|
||||||
p.recharge(get_energy_production())
|
p.upgrade()
|
||||||
|
value_per_seed /= 1.5
|
||||||
else:
|
else:
|
||||||
$AnimationPlayer.play("fill")
|
$AnimationPlayer.play("fill")
|
||||||
return true
|
return true
|
||||||
|
|||||||
@ -1,29 +1,23 @@
|
|||||||
[gd_scene load_steps=5 format=3 uid="uid://d324mlmgls4fs"]
|
[gd_scene load_steps=4 format=3 uid="uid://d324mlmgls4fs"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/machines/recharge_station/scripts/recharge_station.gd" id="1_2ffjo"]
|
[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/machines/recharge_station/scripts/recharge_station.gd" id="1_2ffjo"]
|
||||||
[ext_resource type="Texture2D" uid="uid://c82ljr3in67am" path="res://entities/interactables/machines/recharge_station/assets/sprites/recharge_station.svg" id="2_58ax0"]
|
[ext_resource type="Texture2D" uid="uid://c82ljr3in67am" path="res://entities/interactables/machines/recharge_station/assets/sprites/recharge_station.svg" id="2_58ax0"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_3xua0"]
|
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bjhct"]
|
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bjhct"]
|
||||||
radius = 15.0
|
radius = 15.0
|
||||||
height = 72.0
|
height = 72.0
|
||||||
|
|
||||||
[node name="RechargeStation" type="Area2D"]
|
[node name="RechargeStation" type="Area2D"]
|
||||||
|
modulate = Color(0.615686, 0.501961, 0.270588, 1)
|
||||||
script = ExtResource("1_2ffjo")
|
script = ExtResource("1_2ffjo")
|
||||||
metadata/_custom_type_script = "uid://dyprcd68fjstf"
|
metadata/_custom_type_script = "uid://dyprcd68fjstf"
|
||||||
|
|
||||||
|
[node name="RechargeStation" type="Sprite2D" parent="."]
|
||||||
|
position = Vector2(0, -17)
|
||||||
|
scale = Vector2(0.3, 0.3)
|
||||||
|
texture = ExtResource("2_58ax0")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
position = Vector2(1, -1)
|
position = Vector2(1, -1)
|
||||||
rotation = -1.5708
|
rotation = -1.5708
|
||||||
shape = SubResource("CapsuleShape2D_bjhct")
|
shape = SubResource("CapsuleShape2D_bjhct")
|
||||||
|
|
||||||
[node name="RechargeStation" type="Sprite2D" parent="."]
|
|
||||||
self_modulate = Color(0.729412, 0.588235, 0.105882, 1)
|
|
||||||
position = Vector2(0, -17)
|
|
||||||
scale = Vector2(0.3, 0.3)
|
|
||||||
texture = ExtResource("2_58ax0")
|
|
||||||
|
|
||||||
[node name="Bolt" type="Sprite2D" parent="."]
|
|
||||||
position = Vector2(0, -40)
|
|
||||||
scale = Vector2(0.375, 0.375)
|
|
||||||
texture = ExtResource("3_3xua0")
|
|
||||||
|
|||||||
@ -11,12 +11,3 @@ func interact(_p: Player) -> bool:
|
|||||||
|
|
||||||
func interact_text():
|
func interact_text():
|
||||||
return "Recharge"
|
return "Recharge"
|
||||||
|
|
||||||
func pointer_text():
|
|
||||||
return "Recharge Station"
|
|
||||||
|
|
||||||
func inspector_info() -> Inspector.Info:
|
|
||||||
return Inspector.Info.new(
|
|
||||||
pointer_text(),
|
|
||||||
"You can recharge your robot here. When recharging, time will pass and plants may grow."
|
|
||||||
)
|
|
||||||
@ -1,22 +1,2 @@
|
|||||||
extends Interactable
|
extends Interactable
|
||||||
class_name Machine
|
class_name Machine
|
||||||
|
|
||||||
const MAX_MACHINE_LEVEL = 5
|
|
||||||
|
|
||||||
var level : int = 1
|
|
||||||
var machine_name : String = ""
|
|
||||||
var machine_desc : String = ""
|
|
||||||
|
|
||||||
func setup_machine_info(machine_type : MachineType, _level : int = 1):
|
|
||||||
level = _level
|
|
||||||
machine_name = machine_type.name
|
|
||||||
machine_desc = machine_type.description
|
|
||||||
|
|
||||||
func pointer_text():
|
|
||||||
return machine_name
|
|
||||||
|
|
||||||
func inspector_info() -> Inspector.Info:
|
|
||||||
return Inspector.Info.new(
|
|
||||||
pointer_text() + " level " + str(level),
|
|
||||||
machine_desc
|
|
||||||
)
|
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
extends Resource
|
|
||||||
class_name MachineType
|
|
||||||
|
|
||||||
@export var name : String
|
|
||||||
@export var scene : PackedScene
|
|
||||||
@export_multiline var description : String
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://bhncww816fjsb
|
|
||||||
@ -22,3 +22,6 @@ func generate_collision(area_width : float) -> CollisionShape2D:
|
|||||||
add_child(collision)
|
add_child(collision)
|
||||||
|
|
||||||
return collision
|
return collision
|
||||||
|
|
||||||
|
func interact_text():
|
||||||
|
return ""
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 127 KiB |
@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://dbednu7eygtrf"
|
|
||||||
path="res://.godot/imported/arbre_mort.png-eea217ee3fbf6520e6fbde71f18bbeef.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://entities/objectives/assets/sprites/arbre_mort.png"
|
|
||||||
dest_files=["res://.godot/imported/arbre_mort.png-eea217ee3fbf6520e6fbde71f18bbeef.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
|
Before Width: | Height: | Size: 24 KiB |
@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://c4pv2o7crchc0"
|
|
||||||
path="res://.godot/imported/little_plant.png-e9ed84e9420c629c3911ff755b194643.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://entities/objectives/assets/sprites/little_plant.png"
|
|
||||||
dest_files=["res://.godot/imported/little_plant.png-e9ed84e9420c629c3911ff755b194643.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
@ -1,281 +0,0 @@
|
|||||||
[gd_scene load_steps=11 format=3 uid="uid://djl2le58ckgdx"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://j8fpi8rd8eyy" path="res://entities/objectives/scripts/objective.gd" id="1_3hqw5"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://dbednu7eygtrf" path="res://entities/objectives/assets/sprites/arbre_mort.png" id="2_3hqw5"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://c4pv2o7crchc0" path="res://entities/objectives/assets/sprites/little_plant.png" id="3_dulsb"]
|
|
||||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="4_6uhem"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://bo3o2qf3i20ke" path="res://common/icons/scuba-diving-tank.svg" id="5_6uhem"]
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_v08i5"]
|
|
||||||
length = 0.001
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath("ArbreMort:modulate")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Color(0.443137, 0.443137, 0.443137, 1)]
|
|
||||||
}
|
|
||||||
tracks/1/type = "value"
|
|
||||||
tracks/1/imported = false
|
|
||||||
tracks/1/enabled = true
|
|
||||||
tracks/1/path = NodePath("LittlePlant:visible")
|
|
||||||
tracks/1/interp = 1
|
|
||||||
tracks/1/loop_wrap = true
|
|
||||||
tracks/1/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [false]
|
|
||||||
}
|
|
||||||
tracks/2/type = "value"
|
|
||||||
tracks/2/imported = false
|
|
||||||
tracks/2/enabled = true
|
|
||||||
tracks/2/path = NodePath("LittlePlant:scale")
|
|
||||||
tracks/2/interp = 1
|
|
||||||
tracks/2/loop_wrap = true
|
|
||||||
tracks/2/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Vector2(0.094358, 0.094358)]
|
|
||||||
}
|
|
||||||
tracks/3/type = "value"
|
|
||||||
tracks/3/imported = false
|
|
||||||
tracks/3/enabled = true
|
|
||||||
tracks/3/path = NodePath("LittlePlant2:visible")
|
|
||||||
tracks/3/interp = 1
|
|
||||||
tracks/3/loop_wrap = true
|
|
||||||
tracks/3/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [false]
|
|
||||||
}
|
|
||||||
tracks/4/type = "value"
|
|
||||||
tracks/4/imported = false
|
|
||||||
tracks/4/enabled = true
|
|
||||||
tracks/4/path = NodePath("LittlePlant2:scale")
|
|
||||||
tracks/4/interp = 1
|
|
||||||
tracks/4/loop_wrap = true
|
|
||||||
tracks/4/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Vector2(0.094358, 0.094358)]
|
|
||||||
}
|
|
||||||
tracks/5/type = "value"
|
|
||||||
tracks/5/imported = false
|
|
||||||
tracks/5/enabled = true
|
|
||||||
tracks/5/path = NodePath("LittlePlant3:visible")
|
|
||||||
tracks/5/interp = 1
|
|
||||||
tracks/5/loop_wrap = true
|
|
||||||
tracks/5/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [false]
|
|
||||||
}
|
|
||||||
tracks/6/type = "value"
|
|
||||||
tracks/6/imported = false
|
|
||||||
tracks/6/enabled = true
|
|
||||||
tracks/6/path = NodePath("LittlePlant3:scale")
|
|
||||||
tracks/6/interp = 1
|
|
||||||
tracks/6/loop_wrap = true
|
|
||||||
tracks/6/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Vector2(0.094358, 0.094358)]
|
|
||||||
}
|
|
||||||
tracks/7/type = "value"
|
|
||||||
tracks/7/imported = false
|
|
||||||
tracks/7/enabled = true
|
|
||||||
tracks/7/path = NodePath("ArbreMort:scale")
|
|
||||||
tracks/7/interp = 1
|
|
||||||
tracks/7/loop_wrap = true
|
|
||||||
tracks/7/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Vector2(0.162791, 0.162791)]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_6uhem"]
|
|
||||||
resource_name = "activate"
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath("ArbreMort:modulate")
|
|
||||||
tracks/0/interp = 2
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0, 0.266667),
|
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Color(0.443137, 0.443137, 0.443137, 1), Color(1, 1, 1, 1)]
|
|
||||||
}
|
|
||||||
tracks/1/type = "value"
|
|
||||||
tracks/1/imported = false
|
|
||||||
tracks/1/enabled = true
|
|
||||||
tracks/1/path = NodePath("LittlePlant:visible")
|
|
||||||
tracks/1/interp = 2
|
|
||||||
tracks/1/loop_wrap = true
|
|
||||||
tracks/1/keys = {
|
|
||||||
"times": PackedFloat32Array(0.0333333),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [true]
|
|
||||||
}
|
|
||||||
tracks/2/type = "value"
|
|
||||||
tracks/2/imported = false
|
|
||||||
tracks/2/enabled = true
|
|
||||||
tracks/2/path = NodePath("LittlePlant:scale")
|
|
||||||
tracks/2/interp = 2
|
|
||||||
tracks/2/loop_wrap = true
|
|
||||||
tracks/2/keys = {
|
|
||||||
"times": PackedFloat32Array(0.433333, 0.6),
|
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Vector2(0, 0), Vector2(0.094358, 0.094358)]
|
|
||||||
}
|
|
||||||
tracks/3/type = "value"
|
|
||||||
tracks/3/imported = false
|
|
||||||
tracks/3/enabled = true
|
|
||||||
tracks/3/path = NodePath("LittlePlant2:visible")
|
|
||||||
tracks/3/interp = 1
|
|
||||||
tracks/3/loop_wrap = true
|
|
||||||
tracks/3/keys = {
|
|
||||||
"times": PackedFloat32Array(0.0333333),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [true]
|
|
||||||
}
|
|
||||||
tracks/4/type = "value"
|
|
||||||
tracks/4/imported = false
|
|
||||||
tracks/4/enabled = true
|
|
||||||
tracks/4/path = NodePath("LittlePlant2:scale")
|
|
||||||
tracks/4/interp = 2
|
|
||||||
tracks/4/loop_wrap = true
|
|
||||||
tracks/4/keys = {
|
|
||||||
"times": PackedFloat32Array(0.6, 0.8),
|
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Vector2(0, 0), Vector2(0.094358, 0.094358)]
|
|
||||||
}
|
|
||||||
tracks/5/type = "value"
|
|
||||||
tracks/5/imported = false
|
|
||||||
tracks/5/enabled = true
|
|
||||||
tracks/5/path = NodePath("LittlePlant3:visible")
|
|
||||||
tracks/5/interp = 1
|
|
||||||
tracks/5/loop_wrap = true
|
|
||||||
tracks/5/keys = {
|
|
||||||
"times": PackedFloat32Array(0.0333333),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [true]
|
|
||||||
}
|
|
||||||
tracks/6/type = "value"
|
|
||||||
tracks/6/imported = false
|
|
||||||
tracks/6/enabled = true
|
|
||||||
tracks/6/path = NodePath("LittlePlant3:scale")
|
|
||||||
tracks/6/interp = 2
|
|
||||||
tracks/6/loop_wrap = true
|
|
||||||
tracks/6/keys = {
|
|
||||||
"times": PackedFloat32Array(0.4, 0.533333),
|
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Vector2(0, 0), Vector2(0.094358, 0.094358)]
|
|
||||||
}
|
|
||||||
tracks/7/type = "value"
|
|
||||||
tracks/7/imported = false
|
|
||||||
tracks/7/enabled = true
|
|
||||||
tracks/7/path = NodePath("ArbreMort:scale")
|
|
||||||
tracks/7/interp = 2
|
|
||||||
tracks/7/loop_wrap = true
|
|
||||||
tracks/7/keys = {
|
|
||||||
"times": PackedFloat32Array(0, 0.1, 0.266667, 0.4),
|
|
||||||
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Vector2(0.162791, 0.162791), Vector2(0.183, 0.093), Vector2(0.123, 0.178), Vector2(0.162791, 0.162791)]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_047qm"]
|
|
||||||
_data = {
|
|
||||||
&"RESET": SubResource("Animation_v08i5"),
|
|
||||||
&"activate": SubResource("Animation_6uhem")
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bvagy"]
|
|
||||||
radius = 24.0
|
|
||||||
height = 160.0
|
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_v08i5"]
|
|
||||||
font = ExtResource("4_6uhem")
|
|
||||||
font_size = 18
|
|
||||||
|
|
||||||
[node name="Objective" type="Area2D"]
|
|
||||||
script = ExtResource("1_3hqw5")
|
|
||||||
metadata/_custom_type_script = "uid://d3bk52402ylvl"
|
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
libraries = {
|
|
||||||
&"": SubResource("AnimationLibrary_047qm")
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
|
||||||
position = Vector2(0, -20)
|
|
||||||
rotation = 1.5708
|
|
||||||
shape = SubResource("CapsuleShape2D_bvagy")
|
|
||||||
|
|
||||||
[node name="ArbreMort" type="Sprite2D" parent="."]
|
|
||||||
modulate = Color(0.443137, 0.443137, 0.443137, 1)
|
|
||||||
position = Vector2(5, 4)
|
|
||||||
scale = Vector2(0.162791, 0.162791)
|
|
||||||
texture = ExtResource("2_3hqw5")
|
|
||||||
centered = false
|
|
||||||
offset = Vector2(-627.055, -607.11)
|
|
||||||
|
|
||||||
[node name="LittlePlant" type="Sprite2D" parent="."]
|
|
||||||
visible = false
|
|
||||||
position = Vector2(-22, -46)
|
|
||||||
scale = Vector2(0.094358, 0.094358)
|
|
||||||
texture = ExtResource("3_dulsb")
|
|
||||||
|
|
||||||
[node name="LittlePlant2" type="Sprite2D" parent="."]
|
|
||||||
visible = false
|
|
||||||
position = Vector2(39, -25)
|
|
||||||
scale = Vector2(0.094358, 0.094358)
|
|
||||||
texture = ExtResource("3_dulsb")
|
|
||||||
|
|
||||||
[node name="LittlePlant3" type="Sprite2D" parent="."]
|
|
||||||
visible = false
|
|
||||||
position = Vector2(-49, -14)
|
|
||||||
scale = Vector2(0.094358, 0.094358)
|
|
||||||
texture = ExtResource("3_dulsb")
|
|
||||||
|
|
||||||
[node name="RewardInfo" type="HBoxContainer" parent="."]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
offset_left = -67.0
|
|
||||||
offset_top = -34.0
|
|
||||||
offset_right = 51.0
|
|
||||||
offset_bottom = -15.0
|
|
||||||
theme_override_constants/separation = 2
|
|
||||||
alignment = 1
|
|
||||||
|
|
||||||
[node name="RewardText" type="Label" parent="RewardInfo"]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
layout_mode = 2
|
|
||||||
text = "bla"
|
|
||||||
label_settings = SubResource("LabelSettings_v08i5")
|
|
||||||
|
|
||||||
[node name="RewardIcon" type="TextureRect" parent="RewardInfo"]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
layout_mode = 2
|
|
||||||
texture = ExtResource("5_6uhem")
|
|
||||||
expand_mode = 2
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
extends InspectableEntity
|
|
||||||
class_name Objective
|
|
||||||
|
|
||||||
const RANDOM_MAX_OBJECTIVE_INTERVAL = 1.
|
|
||||||
|
|
||||||
var completed : bool = false
|
|
||||||
var planet : Planet
|
|
||||||
@export var reward : ObjectiveReward = null :
|
|
||||||
set(r):
|
|
||||||
reward = r
|
|
||||||
update_reward_info(r)
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
update_reward_info(reward)
|
|
||||||
|
|
||||||
func pointer_text():
|
|
||||||
return "Contamination Objective"
|
|
||||||
|
|
||||||
func inspector_info() -> Inspector.Info:
|
|
||||||
return Inspector.Info.new(
|
|
||||||
pointer_text(),
|
|
||||||
"If the zone around is decontaminated, give the following reward.\n\n" + reward.get_description(),
|
|
||||||
)
|
|
||||||
|
|
||||||
func _end_pass_day():
|
|
||||||
if planet and not completed:
|
|
||||||
if not planet.is_there_contamination(global_position):
|
|
||||||
reward.reward(self)
|
|
||||||
%AnimationPlayer.play("activate")
|
|
||||||
%RewardInfo.visible = false
|
|
||||||
completed = true
|
|
||||||
|
|
||||||
func update_reward_info(r : ObjectiveReward):
|
|
||||||
if r:
|
|
||||||
%RewardText.text = r.get_text()
|
|
||||||
%RewardIcon.texture = r.get_icon()
|
|
||||||
%RewardInfo.visible = r != null
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://j8fpi8rd8eyy
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
extends Resource
|
|
||||||
class_name ObjectiveReward
|
|
||||||
|
|
||||||
func reward(_objective : Objective):
|
|
||||||
pass
|
|
||||||
|
|
||||||
func get_icon() -> Texture:
|
|
||||||
return null
|
|
||||||
|
|
||||||
func get_text() -> String:
|
|
||||||
return ""
|
|
||||||
|
|
||||||
func get_description() -> String:
|
|
||||||
return ""
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://bsh4b8miag8w1
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
extends ObjectiveReward
|
|
||||||
class_name IncreaseDayLimitReward
|
|
||||||
|
|
||||||
@export var day_limit_increase = 5
|
|
||||||
|
|
||||||
func _init(_day_limit_increase : int):
|
|
||||||
day_limit_increase = _day_limit_increase
|
|
||||||
|
|
||||||
func reward(objective : Objective):
|
|
||||||
objective.planet.day_limit += day_limit_increase
|
|
||||||
|
|
||||||
func get_icon() -> Texture:
|
|
||||||
return preload("res://common/icons/hourglass-empty.svg")
|
|
||||||
|
|
||||||
func get_text() -> String:
|
|
||||||
return "+"+str(day_limit_increase)
|
|
||||||
|
|
||||||
func get_description() -> String:
|
|
||||||
return "Increase the day limitation by " + str(day_limit_increase) + "."
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://df6i1hivw4ymn
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
extends ObjectiveReward
|
|
||||||
class_name LootItemReward
|
|
||||||
|
|
||||||
const REWARD_ITEM_RANDOM_DISPLACEMENT_FACTOR = 100
|
|
||||||
|
|
||||||
@export var item : Item
|
|
||||||
|
|
||||||
func _init(i : Item):
|
|
||||||
item = i
|
|
||||||
|
|
||||||
func get_icon() -> Texture:
|
|
||||||
return preload("res://common/icons/package.svg")
|
|
||||||
|
|
||||||
func get_text() -> String:
|
|
||||||
return ""
|
|
||||||
|
|
||||||
func get_description() -> String:
|
|
||||||
return "Loot the following item: " + item.name + "."
|
|
||||||
|
|
||||||
func reward(objective : Objective):
|
|
||||||
objective.planet.drop_item(
|
|
||||||
item,
|
|
||||||
objective.global_position,
|
|
||||||
REWARD_ITEM_RANDOM_DISPLACEMENT_FACTOR
|
|
||||||
)
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://dva05p817w00f
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://dot5gfkbm7p6s
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
extends ObjectiveReward
|
|
||||||
class_name LootRandomSeedsReward
|
|
||||||
|
|
||||||
const REWARD_SEED_RANDOM_DISPLACEMENT_FACTOR = 100
|
|
||||||
|
|
||||||
@export var seeds_number : int
|
|
||||||
|
|
||||||
func _init(number : int):
|
|
||||||
seeds_number = number
|
|
||||||
|
|
||||||
func get_icon() -> Texture:
|
|
||||||
return preload("res://common/icons/seedling.svg")
|
|
||||||
|
|
||||||
func get_text() -> String:
|
|
||||||
return str(seeds_number)
|
|
||||||
|
|
||||||
func get_description() -> String:
|
|
||||||
return "Loot " + str(seeds_number) + " random seeds."
|
|
||||||
|
|
||||||
func reward(objective : Objective):
|
|
||||||
for i in range(seeds_number):
|
|
||||||
objective.planet.drop_item(
|
|
||||||
Seed.new(GameInfo.game_data.unlocked_plant_types_path.pick_random()),
|
|
||||||
objective.global_position,
|
|
||||||
REWARD_SEED_RANDOM_DISPLACEMENT_FACTOR
|
|
||||||
)
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://bcdilfb4j7f6d
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
extends ObjectiveReward
|
|
||||||
class_name RechargePlayerReward
|
|
||||||
|
|
||||||
@export var recharge_amount = 1
|
|
||||||
|
|
||||||
func _init(_recharge_amount : int = 1):
|
|
||||||
recharge_amount = _recharge_amount
|
|
||||||
|
|
||||||
func reward(objective : Objective):
|
|
||||||
objective.planet.player.recharge(recharge_amount)
|
|
||||||
|
|
||||||
func get_icon() -> Texture:
|
|
||||||
return preload("res://common/icons/bolt.svg")
|
|
||||||
|
|
||||||
func get_text() -> String:
|
|
||||||
return "+"+str(recharge_amount)+" "
|
|
||||||
|
|
||||||
func get_description() -> String:
|
|
||||||
return "Recharge player energy by " + str(recharge_amount) + "."
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://4ak4kre3emnd
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
extends ObjectiveReward
|
|
||||||
class_name UpgradePlayerMaxEnergyReward
|
|
||||||
|
|
||||||
@export var upgrade_amount = 1
|
|
||||||
|
|
||||||
func _init(_upgrade_amount : int = 1):
|
|
||||||
upgrade_amount = _upgrade_amount
|
|
||||||
|
|
||||||
func reward(objective : Objective):
|
|
||||||
objective.planet.player.upgrade_max_energy(upgrade_amount)
|
|
||||||
|
|
||||||
func get_icon() -> Texture:
|
|
||||||
return preload("res://common/icons/bolt.svg")
|
|
||||||
|
|
||||||
func get_text() -> String:
|
|
||||||
return "+"+str(upgrade_amount)+" max"
|
|
||||||
|
|
||||||
func get_description() -> String:
|
|
||||||
return "Increase player max energy by " + str(upgrade_amount) + "."
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://cflvw3bfcocnn
|
|
||||||
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
@ -3,15 +3,15 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://c7mp7tkkkk6o5"
|
uid="uid://c7mp7tkkkk6o5"
|
||||||
path="res://.godot/imported/growing.png-c0d45a498c8bfc90776eb09d341d1579.ctex"
|
path="res://.godot/imported/growing.png-3f6fb3171589f3a22ebfeda1a4575199.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://entities/plants/assets/sprites/chardi/growing.png"
|
source_file="res://entities/plants/assets/sprites/default/growing.png"
|
||||||
dest_files=["res://.godot/imported/growing.png-c0d45a498c8bfc90776eb09d341d1579.ctex"]
|
dest_files=["res://.godot/imported/growing.png-3f6fb3171589f3a22ebfeda1a4575199.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 149 KiB After Width: | Height: | Size: 149 KiB |
@ -3,15 +3,15 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://bupl1y0cfj21q"
|
uid="uid://bupl1y0cfj21q"
|
||||||
path="res://.godot/imported/mature.png-a98b30ab80fe074a42994ef9926caee8.ctex"
|
path="res://.godot/imported/mature.png-f8b2b72a84e90cfc6bf925d1d48f7f7e.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://entities/plants/assets/sprites/chardi/mature.png"
|
source_file="res://entities/plants/assets/sprites/default/mature.png"
|
||||||
dest_files=["res://.godot/imported/mature.png-a98b30ab80fe074a42994ef9926caee8.ctex"]
|
dest_files=["res://.godot/imported/mature.png-f8b2b72a84e90cfc6bf925d1d48f7f7e.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
BIN
entities/plants/assets/sprites/default/planted.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
@ -2,16 +2,16 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://crc4aop6ajiau"
|
uid="uid://ba413oun7ry78"
|
||||||
path="res://.godot/imported/mature.png-44f597dc7980e7657c7418444db3823d.ctex"
|
path="res://.godot/imported/planted.png-2c23372e71d0997d310374f47bb48594.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://entities/plants/assets/sprites/champ/mature.png"
|
source_file="res://entities/plants/assets/sprites/default/planted.png"
|
||||||
dest_files=["res://.godot/imported/mature.png-44f597dc7980e7657c7418444db3823d.ctex"]
|
dest_files=["res://.godot/imported/planted.png-2c23372e71d0997d310374f47bb48594.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
BIN
entities/plants/assets/sprites/maias/planted.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
@ -2,16 +2,16 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://dmsls8siudy1u"
|
uid="uid://cpx7bkrvttasr"
|
||||||
path="res://.godot/imported/growing.png-1974f3b5dd8b515f2458ee84afbec1aa.ctex"
|
path="res://.godot/imported/planted.png-4bf3c8ff7d8aae08d7e3691f7e49cab2.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://entities/plants/assets/sprites/champ/growing.png"
|
source_file="res://entities/plants/assets/sprites/maias/planted.png"
|
||||||
dest_files=["res://.godot/imported/growing.png-1974f3b5dd8b515f2458ee84afbec1aa.ctex"]
|
dest_files=["res://.godot/imported/planted.png-4bf3c8ff7d8aae08d7e3691f7e49cab2.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 124 KiB |
@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://xw47qw12d3dv"
|
|
||||||
path="res://.godot/imported/growing.png-7be6e2a77303b5664c0684cf483c0282.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://entities/plants/assets/sprites/pili/growing.png"
|
|
||||||
dest_files=["res://.godot/imported/growing.png-7be6e2a77303b5664c0684cf483c0282.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
|
Before Width: | Height: | Size: 142 KiB |
@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://4mh1w1f4q2sa"
|
|
||||||
path="res://.godot/imported/mature.png-3ebeca7244c928b51a02f8a43277f4d4.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://entities/plants/assets/sprites/pili/mature.png"
|
|
||||||
dest_files=["res://.godot/imported/mature.png-3ebeca7244c928b51a02f8a43277f4d4.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
@ -1,21 +1,14 @@
|
|||||||
[gd_scene load_steps=10 format=3 uid="uid://2hrg6yjk0yt0"]
|
[gd_scene load_steps=7 format=3 uid="uid://2hrg6yjk0yt0"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bmjjpk4lvijws" path="res://entities/plants/scripts/plant_sprite.gd" id="1_pq8o7"]
|
[ext_resource type="Script" uid="uid://bmjjpk4lvijws" path="res://entities/plants/scripts/plant_sprite.gd" id="1_pq8o7"]
|
||||||
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="3_j6jm5"]
|
[ext_resource type="Texture2D" uid="uid://b3wom2xu26g43" path="res://entities/plants/assets/sprites/default_plant_glowing.png" id="2_hyinx"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bu26h0iqutnky" path="res://entities/underground_loot/assets/sprites/underground_loot.svg" id="4_j6jm5"]
|
|
||||||
|
|
||||||
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_rbgiq"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wyuub"]
|
|
||||||
atlas = ExtResource("3_j6jm5")
|
|
||||||
region = Rect2(76, 75, 124, 135)
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_wyuub"]
|
[sub_resource type="Animation" id="Animation_wyuub"]
|
||||||
length = 0.001
|
length = 0.001
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
tracks/0/enabled = true
|
tracks/0/enabled = true
|
||||||
tracks/0/path = NodePath("Sprite:scale")
|
tracks/0/path = NodePath("Sprite2D:scale")
|
||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/keys = {
|
tracks/0/keys = {
|
||||||
@ -27,7 +20,7 @@ tracks/0/keys = {
|
|||||||
tracks/1/type = "value"
|
tracks/1/type = "value"
|
||||||
tracks/1/imported = false
|
tracks/1/imported = false
|
||||||
tracks/1/enabled = true
|
tracks/1/enabled = true
|
||||||
tracks/1/path = NodePath("Sprite:skew")
|
tracks/1/path = NodePath("Sprite2D:skew")
|
||||||
tracks/1/interp = 1
|
tracks/1/interp = 1
|
||||||
tracks/1/loop_wrap = true
|
tracks/1/loop_wrap = true
|
||||||
tracks/1/keys = {
|
tracks/1/keys = {
|
||||||
@ -39,7 +32,7 @@ tracks/1/keys = {
|
|||||||
tracks/2/type = "value"
|
tracks/2/type = "value"
|
||||||
tracks/2/imported = false
|
tracks/2/imported = false
|
||||||
tracks/2/enabled = true
|
tracks/2/enabled = true
|
||||||
tracks/2/path = NodePath("Sprite:modulate")
|
tracks/2/path = NodePath("Sprite2D:modulate")
|
||||||
tracks/2/interp = 1
|
tracks/2/interp = 1
|
||||||
tracks/2/loop_wrap = true
|
tracks/2/loop_wrap = true
|
||||||
tracks/2/keys = {
|
tracks/2/keys = {
|
||||||
@ -51,15 +44,15 @@ tracks/2/keys = {
|
|||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_j6jm5"]
|
[sub_resource type="Animation" id="Animation_j6jm5"]
|
||||||
resource_name = "bump"
|
resource_name = "bump"
|
||||||
length = 0.3
|
length = 0.5
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
tracks/0/enabled = true
|
tracks/0/enabled = true
|
||||||
tracks/0/path = NodePath("Sprite:scale")
|
tracks/0/path = NodePath("Sprite2D:scale")
|
||||||
tracks/0/interp = 2
|
tracks/0/interp = 2
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/keys = {
|
tracks/0/keys = {
|
||||||
"times": PackedFloat32Array(0, 0.1, 0.3),
|
"times": PackedFloat32Array(0, 0.2, 0.5),
|
||||||
"transitions": PackedFloat32Array(1, 1, 1),
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
"update": 0,
|
"update": 0,
|
||||||
"values": [Vector2(0.15, 0.15), Vector2(0.15, 0.075), Vector2(0.15, 0.15)]
|
"values": [Vector2(0.15, 0.15), Vector2(0.15, 0.075), Vector2(0.15, 0.15)]
|
||||||
@ -71,7 +64,7 @@ length = 0.2
|
|||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
tracks/0/enabled = true
|
tracks/0/enabled = true
|
||||||
tracks/0/path = NodePath("Sprite:skew")
|
tracks/0/path = NodePath("Sprite2D:skew")
|
||||||
tracks/0/interp = 2
|
tracks/0/interp = 2
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/keys = {
|
tracks/0/keys = {
|
||||||
@ -83,7 +76,7 @@ tracks/0/keys = {
|
|||||||
tracks/1/type = "value"
|
tracks/1/type = "value"
|
||||||
tracks/1/imported = false
|
tracks/1/imported = false
|
||||||
tracks/1/enabled = true
|
tracks/1/enabled = true
|
||||||
tracks/1/path = NodePath("Sprite:modulate")
|
tracks/1/path = NodePath("Sprite2D:modulate")
|
||||||
tracks/1/interp = 1
|
tracks/1/interp = 1
|
||||||
tracks/1/loop_wrap = true
|
tracks/1/loop_wrap = true
|
||||||
tracks/1/keys = {
|
tracks/1/keys = {
|
||||||
@ -103,24 +96,9 @@ _data = {
|
|||||||
[node name="PlantSprite" type="Node2D"]
|
[node name="PlantSprite" type="Node2D"]
|
||||||
script = ExtResource("1_pq8o7")
|
script = ExtResource("1_pq8o7")
|
||||||
|
|
||||||
[node name="Sprite" type="Sprite2D" parent="."]
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
unique_name_in_owner = true
|
|
||||||
scale = Vector2(0.15, 0.15)
|
scale = Vector2(0.15, 0.15)
|
||||||
texture = SubResource("CompressedTexture2D_rbgiq")
|
texture = ExtResource("2_hyinx")
|
||||||
|
|
||||||
[node name="PlantedSeed" type="Sprite2D" parent="Sprite"]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
scale = Vector2(1.5, 1.5)
|
|
||||||
texture = SubResource("AtlasTexture_wyuub")
|
|
||||||
region_enabled = true
|
|
||||||
region_rect = Rect2(0, -50, 124, 135)
|
|
||||||
region_filter_clip_enabled = true
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="Sprite/PlantedSeed"]
|
|
||||||
modulate = Color(0.14902, 0.172549, 0.270588, 1)
|
|
||||||
position = Vector2(0, 62.2222)
|
|
||||||
scale = Vector2(0.426047, 0.430108)
|
|
||||||
texture = ExtResource("4_j6jm5")
|
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
libraries = {
|
libraries = {
|
||||||
|
|||||||
8
entities/plants/resources/effects/decontaminate.tres
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[gd_resource type="Resource" script_class="DecontaminateTerrainEffect" load_steps=2 format=3 uid="uid://bdddlia6qxgf2"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://cgscbuxe4dawb" path="res://entities/plants/scripts/plant_effects/decontaminate_terrain_effect.gd" id="1_8l07v"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_8l07v")
|
||||||
|
impact_radius = 50
|
||||||
|
metadata/_custom_type_script = "uid://cgscbuxe4dawb"
|
||||||
@ -1,29 +0,0 @@
|
|||||||
[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://cxrc5wchpqm18"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://ceqx5va1ormau" path="res://entities/plants/scripts/plant_effects/produce_seeds.gd" id="1_cf34j"]
|
|
||||||
[ext_resource type="Script" uid="uid://jnye5pe1bgqw" path="res://entities/plants/scripts/plant_type.gd" id="1_ipcpv"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://dmsls8siudy1u" path="res://entities/plants/assets/sprites/champ/growing.png" id="2_l2hi3"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://crc4aop6ajiau" path="res://entities/plants/assets/sprites/champ/mature.png" id="3_y8qve"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="6_liopn"]
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_5hyy8"]
|
|
||||||
script = ExtResource("1_cf34j")
|
|
||||||
produce_types_path = Array[String](["uid://cxrc5wchpqm18", "uid://b04vho33bl52b", "uid://dsctivn1vrem2", "uid://b04vho33bl52b"])
|
|
||||||
produce_number = Array[int]([1, 2])
|
|
||||||
metadata/_custom_type_script = "uid://ceqx5va1ormau"
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_my6by"]
|
|
||||||
atlas = ExtResource("6_liopn")
|
|
||||||
region = Rect2(610, 315, 124, 180)
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
script = ExtResource("1_ipcpv")
|
|
||||||
name = "Champ"
|
|
||||||
description = "When mature, produce seeds every day."
|
|
||||||
growing_time = 1
|
|
||||||
seed_texture = SubResource("AtlasTexture_my6by")
|
|
||||||
growing_texture = ExtResource("2_l2hi3")
|
|
||||||
mature_texture = ExtResource("3_y8qve")
|
|
||||||
cyclic_effect = SubResource("Resource_5hyy8")
|
|
||||||
harvest_types_path = Array[String](["uid://cxrc5wchpqm18"])
|
|
||||||
metadata/_custom_type_script = "uid://jnye5pe1bgqw"
|
|
||||||
@ -1,15 +1,15 @@
|
|||||||
[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://b04vho33bl52b"]
|
[gd_resource type="Resource" script_class="PlantType" load_steps=9 format=3 uid="uid://b04vho33bl52b"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://c7mp7tkkkk6o5" path="res://entities/plants/assets/sprites/default/growing.png" id="1_fp5j6"]
|
||||||
[ext_resource type="Script" uid="uid://jnye5pe1bgqw" path="res://entities/plants/scripts/plant_type.gd" id="1_moyj3"]
|
[ext_resource type="Script" uid="uid://jnye5pe1bgqw" path="res://entities/plants/scripts/plant_type.gd" id="1_moyj3"]
|
||||||
[ext_resource type="Texture2D" uid="uid://c7mp7tkkkk6o5" path="res://entities/plants/assets/sprites/chardi/growing.png" id="1_prk5s"]
|
[ext_resource type="Script" path="res://entities/plants/scripts/plant_effects/decontaminate_terrain_effect.gd" id="2_cky1j"]
|
||||||
[ext_resource type="Script" uid="uid://cgscbuxe4dawb" path="res://entities/plants/scripts/plant_effects/decontaminate_terrain_effect.gd" id="2_cky1j"]
|
[ext_resource type="Texture2D" uid="uid://bupl1y0cfj21q" path="res://entities/plants/assets/sprites/default/mature.png" id="3_ffarr"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bupl1y0cfj21q" path="res://entities/plants/assets/sprites/chardi/mature.png" id="3_40c3e"]
|
[ext_resource type="Texture2D" uid="uid://ba413oun7ry78" path="res://entities/plants/assets/sprites/default/planted.png" id="4_2s6re"]
|
||||||
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="6_cky1j"]
|
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="6_cky1j"]
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_c76qk"]
|
[sub_resource type="Resource" id="Resource_q68uy"]
|
||||||
script = ExtResource("2_cky1j")
|
script = ExtResource("2_cky1j")
|
||||||
impact_radius = 150
|
impact_radius = 150
|
||||||
improve_by_lifetime_max = 300
|
|
||||||
metadata/_custom_type_script = "uid://cgscbuxe4dawb"
|
metadata/_custom_type_script = "uid://cgscbuxe4dawb"
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qt76e"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_qt76e"]
|
||||||
@ -22,9 +22,10 @@ name = "Chardi"
|
|||||||
description = "This plant remove a lot of contamination around when it becomes mature."
|
description = "This plant remove a lot of contamination around when it becomes mature."
|
||||||
growing_time = 1
|
growing_time = 1
|
||||||
seed_texture = SubResource("AtlasTexture_qt76e")
|
seed_texture = SubResource("AtlasTexture_qt76e")
|
||||||
growing_texture = ExtResource("1_prk5s")
|
planted_texture = ExtResource("4_2s6re")
|
||||||
mature_texture = ExtResource("3_40c3e")
|
growing_texture = ExtResource("1_fp5j6")
|
||||||
mature_effect = SubResource("Resource_c76qk")
|
mature_texture = ExtResource("3_ffarr")
|
||||||
harvest_types_path = Array[String](["uid://b04vho33bl52b"])
|
mature_effect = SubResource("Resource_q68uy")
|
||||||
|
harvest_types_path = Array[String]([])
|
||||||
harvest_number = Array[int]([1, 2, 1])
|
harvest_number = Array[int]([1, 2, 1])
|
||||||
metadata/_custom_type_script = "uid://jnye5pe1bgqw"
|
metadata/_custom_type_script = "uid://jnye5pe1bgqw"
|
||||||
@ -1,9 +1,10 @@
|
|||||||
[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://dsctivn1vrem2"]
|
[gd_resource type="Resource" script_class="PlantType" load_steps=9 format=3 uid="uid://dsctivn1vrem2"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://jnye5pe1bgqw" path="res://entities/plants/scripts/plant_type.gd" id="1_eqtut"]
|
[ext_resource type="Script" uid="uid://jnye5pe1bgqw" path="res://entities/plants/scripts/plant_type.gd" id="1_eqtut"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dwr3c6r6piwaa" path="res://entities/plants/assets/sprites/maias/growing.png" id="1_vyplc"]
|
[ext_resource type="Texture2D" uid="uid://dwr3c6r6piwaa" path="res://entities/plants/assets/sprites/maias/growing.png" id="1_vyplc"]
|
||||||
[ext_resource type="Script" uid="uid://cgscbuxe4dawb" path="res://entities/plants/scripts/plant_effects/decontaminate_terrain_effect.gd" id="2_vyplc"]
|
[ext_resource type="Script" path="res://entities/plants/scripts/plant_effects/decontaminate_terrain_effect.gd" id="2_vyplc"]
|
||||||
[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://d3apfwbqsg5ha" path="res://entities/plants/assets/sprites/maias/mature.png" id="3_pi4ie"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cpx7bkrvttasr" path="res://entities/plants/assets/sprites/maias/planted.png" id="4_iqcy2"]
|
||||||
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="6_mwrj8"]
|
[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_q4pje"]
|
[sub_resource type="Resource" id="Resource_q4pje"]
|
||||||
@ -18,9 +19,10 @@ region = Rect2(1697, 331, 125, 158)
|
|||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_eqtut")
|
script = ExtResource("1_eqtut")
|
||||||
name = "Maias"
|
name = "Maias"
|
||||||
description = "This gorgeous flower produce a lot of seeds of Maias and Chardi when harvested."
|
description = "This gorgeous flower produce a lot of seeds."
|
||||||
growing_time = 1
|
growing_time = 1
|
||||||
seed_texture = SubResource("AtlasTexture_sri3b")
|
seed_texture = SubResource("AtlasTexture_sri3b")
|
||||||
|
planted_texture = ExtResource("4_iqcy2")
|
||||||
growing_texture = ExtResource("1_vyplc")
|
growing_texture = ExtResource("1_vyplc")
|
||||||
mature_texture = ExtResource("3_pi4ie")
|
mature_texture = ExtResource("3_pi4ie")
|
||||||
mature_effect = SubResource("Resource_q4pje")
|
mature_effect = SubResource("Resource_q4pje")
|
||||||
|
|||||||
@ -1,31 +0,0 @@
|
|||||||
[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://c5oxxif3h5yxo"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://cgscbuxe4dawb" path="res://entities/plants/scripts/plant_effects/decontaminate_terrain_effect.gd" id="1_8wi4i"]
|
|
||||||
[ext_resource type="Script" uid="uid://jnye5pe1bgqw" path="res://entities/plants/scripts/plant_type.gd" id="1_vn146"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://xw47qw12d3dv" path="res://entities/plants/assets/sprites/pili/growing.png" id="2_k4b1k"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://4mh1w1f4q2sa" path="res://entities/plants/assets/sprites/pili/mature.png" id="3_8fstu"]
|
|
||||||
[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_eytxu"]
|
|
||||||
script = ExtResource("1_8wi4i")
|
|
||||||
impact_radius = 50
|
|
||||||
improve_by_lifetime = true
|
|
||||||
improve_by_lifetime_value = 50
|
|
||||||
improve_by_lifetime_max = 300
|
|
||||||
metadata/_custom_type_script = "uid://cgscbuxe4dawb"
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kidty"]
|
|
||||||
atlas = ExtResource("5_26e4l")
|
|
||||||
region = Rect2(1415, 91, 149, 102)
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
script = ExtResource("1_vn146")
|
|
||||||
name = "Pili"
|
|
||||||
description = "Pili slowly decontaminate each day when mature."
|
|
||||||
growing_time = 1
|
|
||||||
seed_texture = SubResource("AtlasTexture_kidty")
|
|
||||||
growing_texture = ExtResource("2_k4b1k")
|
|
||||||
mature_texture = ExtResource("3_8fstu")
|
|
||||||
cyclic_effect = SubResource("Resource_eytxu")
|
|
||||||
harvest_types_path = Array[String](["uid://c5oxxif3h5yxo"])
|
|
||||||
metadata/_custom_type_script = "uid://jnye5pe1bgqw"
|
|
||||||
@ -2,7 +2,7 @@ extends InspectableEntity
|
|||||||
class_name Plant
|
class_name Plant
|
||||||
|
|
||||||
const PLANT_AREA_WIDTH = 20
|
const PLANT_AREA_WIDTH = 20
|
||||||
const HARVESTED_SEED_DISPLACEMENT_FACTOR = 100
|
const HARVESTED_SEED_POSITION_RANGE = 100
|
||||||
|
|
||||||
const RANDOM_MAX_GROW_INTERVAL = Planet.PASS_DAY_ANIMATION_TIME/2. - 0.1
|
const RANDOM_MAX_GROW_INTERVAL = Planet.PASS_DAY_ANIMATION_TIME/2. - 0.1
|
||||||
|
|
||||||
@ -23,23 +23,19 @@ func _init(_plant_type = null, _planet = null):
|
|||||||
plant_type = _plant_type
|
plant_type = _plant_type
|
||||||
planet = _planet
|
planet = _planet
|
||||||
|
|
||||||
func pointer_text():
|
func inspected_text():
|
||||||
var state_text = "Growing"
|
var state_text = "Growing"
|
||||||
if state == State.MATURE: state_text = "Mature"
|
if state == State.MATURE: state_text = "Mature"
|
||||||
return state_text + " " + plant_type.name
|
return state_text + " " + plant_type.name
|
||||||
|
|
||||||
func inspector_info() -> Inspector.Info:
|
|
||||||
return Inspector.Info.new(
|
|
||||||
pointer_text(),
|
|
||||||
plant_type.description,
|
|
||||||
plant_type.mature_texture
|
|
||||||
)
|
|
||||||
|
|
||||||
func generate_sprite() -> PlantSprite:
|
func generate_sprite() -> PlantSprite:
|
||||||
var spriteObject : PlantSprite = SPRITE_SCENE.instantiate()
|
var spriteObject : PlantSprite = SPRITE_SCENE.instantiate()
|
||||||
|
|
||||||
add_child(spriteObject)
|
add_child(spriteObject)
|
||||||
spriteObject.update_plant_sprite(self)
|
spriteObject.apply_texture_to_sprite(
|
||||||
|
get_state_texture(state),
|
||||||
|
false
|
||||||
|
)
|
||||||
|
|
||||||
return spriteObject
|
return spriteObject
|
||||||
|
|
||||||
@ -56,10 +52,6 @@ func generate_collision_shape() -> CollisionShape2D:
|
|||||||
# Méthode déclenchée par la classe planet
|
# Méthode déclenchée par la classe planet
|
||||||
func _pass_day():
|
func _pass_day():
|
||||||
await get_tree().create_timer(randf_range(0., RANDOM_MAX_GROW_INTERVAL)).timeout
|
await get_tree().create_timer(randf_range(0., RANDOM_MAX_GROW_INTERVAL)).timeout
|
||||||
|
|
||||||
if state == State.MATURE and plant_type.cyclic_effect:
|
|
||||||
plant_type.cyclic_effect.effect(self)
|
|
||||||
|
|
||||||
day += 1
|
day += 1
|
||||||
|
|
||||||
func set_day(d):
|
func set_day(d):
|
||||||
@ -79,7 +71,19 @@ func change_state(_state: State):
|
|||||||
if state == State.MATURE and plant_type.mature_effect:
|
if state == State.MATURE and plant_type.mature_effect:
|
||||||
plant_type.mature_effect.effect(self)
|
plant_type.mature_effect.effect(self)
|
||||||
|
|
||||||
plant_sprite.update_plant_sprite(self, true)
|
plant_sprite.apply_texture_to_sprite(
|
||||||
|
get_state_texture(state)
|
||||||
|
)
|
||||||
|
|
||||||
|
func get_state_texture(s: State) -> Texture2D:
|
||||||
|
match s:
|
||||||
|
State.PLANTED:
|
||||||
|
return plant_type.planted_texture
|
||||||
|
State.GROWING:
|
||||||
|
return plant_type.growing_texture
|
||||||
|
State.MATURE:
|
||||||
|
return plant_type.mature_texture
|
||||||
|
return null
|
||||||
|
|
||||||
func harvest():
|
func harvest():
|
||||||
if state == State.MATURE:
|
if state == State.MATURE:
|
||||||
@ -88,11 +92,20 @@ func harvest():
|
|||||||
var seed_plant_type : PlantType = plant_type
|
var seed_plant_type : PlantType = plant_type
|
||||||
if len(plant_type.harvest_types_path):
|
if len(plant_type.harvest_types_path):
|
||||||
seed_plant_type = load(plant_type.harvest_types_path.pick_random())
|
seed_plant_type = load(plant_type.harvest_types_path.pick_random())
|
||||||
planet.drop_item(
|
var item_object = planet.drop_item(
|
||||||
Seed.new(seed_plant_type),
|
Seed.new(seed_plant_type),
|
||||||
global_position,
|
global_position
|
||||||
HARVESTED_SEED_DISPLACEMENT_FACTOR,
|
)
|
||||||
)
|
var tween : Tween = get_tree().create_tween()
|
||||||
|
tween.tween_property(
|
||||||
|
item_object,
|
||||||
|
"position",
|
||||||
|
Vector2(
|
||||||
|
item_object.position.x + randi()%HARVESTED_SEED_POSITION_RANGE,
|
||||||
|
item_object.position.y + randi()%HARVESTED_SEED_POSITION_RANGE
|
||||||
|
),
|
||||||
|
0.2
|
||||||
|
)
|
||||||
|
|
||||||
plant_sprite.start_harvest_animation()
|
plant_sprite.start_harvest_animation()
|
||||||
await plant_sprite.harvest_animation_finished
|
await plant_sprite.harvest_animation_finished
|
||||||
|
|||||||
@ -1,19 +1,10 @@
|
|||||||
extends PlantEffect
|
extends PlantEffect
|
||||||
class_name DecontaminateTerrainEffect
|
class_name DecontaminateTerrainEffect
|
||||||
|
|
||||||
@export var impact_radius = 100
|
@export var impact_radius = 50
|
||||||
@export var improve_by_lifetime := false
|
|
||||||
@export var improve_by_lifetime_value := 20
|
|
||||||
@export var improve_by_lifetime_max := 200
|
|
||||||
|
|
||||||
func effect(plant):
|
func effect(plant):
|
||||||
|
|
||||||
var radius = impact_radius
|
|
||||||
|
|
||||||
if improve_by_lifetime:
|
|
||||||
radius = min(radius + improve_by_lifetime_value * plant.day, improve_by_lifetime_max)
|
|
||||||
|
|
||||||
plant.planet.impact_contamination(
|
plant.planet.impact_contamination(
|
||||||
plant.global_position,
|
plant.global_position,
|
||||||
radius
|
impact_radius
|
||||||
)
|
)
|
||||||
@ -1,15 +0,0 @@
|
|||||||
extends PlantEffect
|
|
||||||
class_name ProduceSeedsEffect
|
|
||||||
|
|
||||||
@export_file var produce_types_path : Array[String] = []
|
|
||||||
@export var produce_number : Array[int] = [1]
|
|
||||||
|
|
||||||
func effect(plant):
|
|
||||||
for _i in range(produce_number.pick_random()):
|
|
||||||
if len(produce_types_path):
|
|
||||||
var seed_plant_type = load(produce_types_path.pick_random())
|
|
||||||
plant.planet.drop_item(
|
|
||||||
Seed.new(seed_plant_type),
|
|
||||||
plant.global_position,
|
|
||||||
plant.HARVESTED_SEED_DISPLACEMENT_FACTOR,
|
|
||||||
)
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://ceqx5va1ormau
|
|
||||||
@ -1,40 +1,16 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
class_name PlantSprite
|
class_name PlantSprite
|
||||||
|
|
||||||
const PLANTED_SEED_CROP_WIDTH = 50
|
|
||||||
const PLANTED_SEED_POS_Y = -50
|
|
||||||
|
|
||||||
signal harvest_animation_finished
|
signal harvest_animation_finished
|
||||||
|
|
||||||
func update_plant_sprite(plant : Plant, with_animation = false):
|
@onready var sprite = $Sprite2D
|
||||||
|
|
||||||
|
func apply_texture_to_sprite(texture, with_animation = true):
|
||||||
if with_animation:
|
if with_animation:
|
||||||
$AnimationPlayer.play("bump")
|
$AnimationPlayer.play("bump")
|
||||||
await $AnimationPlayer.animation_finished
|
await $AnimationPlayer.animation_finished
|
||||||
|
sprite.texture = texture
|
||||||
%Sprite.flip_h = true if randi()%2 == 0 else false
|
sprite.flip_h = true if randi()%2 == 0 else false
|
||||||
|
|
||||||
%Sprite.texture = get_state_texture(plant.state, plant.plant_type)
|
|
||||||
|
|
||||||
%PlantedSeed.visible = plant.state == Plant.State.PLANTED
|
|
||||||
%PlantedSeed.texture = plant.plant_type.seed_texture
|
|
||||||
|
|
||||||
%PlantedSeed.region_rect = Rect2(
|
|
||||||
0,
|
|
||||||
PLANTED_SEED_POS_Y,
|
|
||||||
plant.plant_type.seed_texture.get_width(),
|
|
||||||
plant.plant_type.seed_texture.get_height() - PLANTED_SEED_CROP_WIDTH + -1 * PLANTED_SEED_POS_Y,
|
|
||||||
)
|
|
||||||
|
|
||||||
func get_state_texture(s: Plant.State, plant_type : PlantType) -> Texture2D:
|
|
||||||
match s:
|
|
||||||
Plant.State.PLANTED:
|
|
||||||
return null
|
|
||||||
Plant.State.GROWING:
|
|
||||||
return plant_type.growing_texture
|
|
||||||
Plant.State.MATURE:
|
|
||||||
return plant_type.mature_texture
|
|
||||||
return null
|
|
||||||
|
|
||||||
|
|
||||||
func start_harvest_animation():
|
func start_harvest_animation():
|
||||||
$AnimationPlayer.play("harvest")
|
$AnimationPlayer.play("harvest")
|
||||||
|
|||||||
@ -7,11 +7,11 @@ class_name PlantType
|
|||||||
@export var growing_time : int
|
@export var growing_time : int
|
||||||
|
|
||||||
@export var seed_texture : Texture
|
@export var seed_texture : Texture
|
||||||
|
@export var planted_texture : Texture
|
||||||
@export var growing_texture : Texture
|
@export var growing_texture : Texture
|
||||||
@export var mature_texture : Texture
|
@export var mature_texture : Texture
|
||||||
|
|
||||||
@export var mature_effect : PlantEffect
|
@export var mature_effect : PlantEffect
|
||||||
@export var cyclic_effect : PlantEffect
|
|
||||||
|
|
||||||
@export_file var harvest_types_path : Array[String] = []
|
@export_file var harvest_types_path : Array[String] = []
|
||||||
@export var harvest_number : Array[int] = [1,2]
|
@export var harvest_number : Array[int] = [1,2]
|
||||||
@ -1,9 +1,9 @@
|
|||||||
[gd_scene load_steps=26 format=3 uid="uid://bgvbgeq46wee2"]
|
[gd_scene load_steps=24 format=3 uid="uid://bgvbgeq46wee2"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://das7twcy5153p" path="res://entities/player/scripts/player.gd" id="1_abrql"]
|
[ext_resource type="Script" uid="uid://das7twcy5153p" path="res://entities/player/scripts/player.gd" id="1_abrql"]
|
||||||
[ext_resource type="Texture2D" uid="uid://c7ff87jniga5m" path="res://entities/player/assets/sprites/robot.png" id="1_symyc"]
|
[ext_resource type="Texture2D" uid="uid://c7ff87jniga5m" path="res://entities/player/assets/sprites/robot.png" id="1_symyc"]
|
||||||
[ext_resource type="AudioStream" uid="uid://dfrp66a4isnt6" path="res://entities/player/sounds/dig/dig_1.wav" id="3_gx6sm"]
|
[ext_resource type="AudioStream" uid="uid://dfrp66a4isnt6" path="res://entities/player/sounds/dig/dig_1.wav" id="3_gx6sm"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bf6nw4onkhavr" path="res://common/icons/shovel.svg" id="3_yqrof"]
|
[ext_resource type="Texture2D" uid="uid://bf6nw4onkhavr" path="res://common/inventory/assets/icons/shovel.svg" id="3_yqrof"]
|
||||||
[ext_resource type="AudioStream" uid="uid://bdxkvaciw4mb3" path="res://entities/player/sounds/dig/dig_2.wav" id="4_yqrof"]
|
[ext_resource type="AudioStream" uid="uid://bdxkvaciw4mb3" path="res://entities/player/sounds/dig/dig_2.wav" id="4_yqrof"]
|
||||||
[ext_resource type="AudioStream" uid="uid://llxrlwfccywb" path="res://entities/player/sounds/dig/dig_3.wav" id="5_3wlsy"]
|
[ext_resource type="AudioStream" uid="uid://llxrlwfccywb" path="res://entities/player/sounds/dig/dig_3.wav" id="5_3wlsy"]
|
||||||
[ext_resource type="AudioStream" uid="uid://8nmr5vifkt1f" path="res://entities/player/sounds/harvest/harvest_1.wav" id="6_b2kln"]
|
[ext_resource type="AudioStream" uid="uid://8nmr5vifkt1f" path="res://entities/player/sounds/harvest/harvest_1.wav" id="6_b2kln"]
|
||||||
@ -23,15 +23,6 @@ radius = 27.0
|
|||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_abrql"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_abrql"]
|
||||||
radius = 40.0
|
radius = 40.0
|
||||||
|
|
||||||
[sub_resource type="Gradient" id="Gradient_yqrof"]
|
|
||||||
colors = PackedColorArray(0.145098, 0.423529, 0.635294, 1, 0.12549, 0.294118, 0.545098, 1)
|
|
||||||
|
|
||||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_3wlsy"]
|
|
||||||
gradient = SubResource("Gradient_yqrof")
|
|
||||||
fill = 1
|
|
||||||
fill_from = Vector2(0.5, 0.380342)
|
|
||||||
fill_to = Vector2(1, 0.0726496)
|
|
||||||
|
|
||||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_wq0jh"]
|
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_wq0jh"]
|
||||||
random_pitch = 1.5
|
random_pitch = 1.5
|
||||||
streams_count = 3
|
streams_count = 3
|
||||||
@ -68,6 +59,17 @@ stream_0/stream = ExtResource("15_gx6sm")
|
|||||||
[node name="Player" type="CharacterBody2D"]
|
[node name="Player" type="CharacterBody2D"]
|
||||||
script = ExtResource("1_abrql")
|
script = ExtResource("1_abrql")
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite2D" parent="."]
|
||||||
|
position = Vector2(2, -46)
|
||||||
|
scale = Vector2(0.08, 0.08)
|
||||||
|
texture = ExtResource("1_symyc")
|
||||||
|
|
||||||
|
[node name="ItemSprite" type="Sprite2D" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
visible = false
|
||||||
|
position = Vector2(0, 5)
|
||||||
|
texture = ExtResource("3_yqrof")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
position = Vector2(-2, -18)
|
position = Vector2(-2, -18)
|
||||||
shape = SubResource("CircleShape2D_sglur")
|
shape = SubResource("CircleShape2D_sglur")
|
||||||
@ -78,26 +80,6 @@ position = Vector2(0, -12)
|
|||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="InteractArea2D"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="InteractArea2D"]
|
||||||
shape = SubResource("CircleShape2D_abrql")
|
shape = SubResource("CircleShape2D_abrql")
|
||||||
|
|
||||||
[node name="Sprite" type="Sprite2D" parent="."]
|
|
||||||
position = Vector2(0, -46)
|
|
||||||
scale = Vector2(0.08, 0.08)
|
|
||||||
texture = ExtResource("1_symyc")
|
|
||||||
|
|
||||||
[node name="HideEyes" type="Sprite2D" parent="."]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
visible = false
|
|
||||||
position = Vector2(8.125, -26.195)
|
|
||||||
scale = Vector2(0.347656, 0.253906)
|
|
||||||
texture = SubResource("GradientTexture2D_3wlsy")
|
|
||||||
|
|
||||||
[node name="ItemSprite" type="Sprite2D" parent="."]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
visible = false
|
|
||||||
modulate = Color(0.164706, 0.898039, 0.984314, 1)
|
|
||||||
position = Vector2(8.25, -27.32)
|
|
||||||
scale = Vector2(0.403333, 0.403333)
|
|
||||||
texture = ExtResource("3_yqrof")
|
|
||||||
|
|
||||||
[node name="Audio" type="Node2D" parent="."]
|
[node name="Audio" type="Node2D" parent="."]
|
||||||
|
|
||||||
[node name="AudioStreamPlayer_dig" type="AudioStreamPlayer" parent="Audio"]
|
[node name="AudioStreamPlayer_dig" type="AudioStreamPlayer" parent="Audio"]
|
||||||
|
|||||||
@ -2,7 +2,7 @@ extends CharacterBody2D
|
|||||||
class_name Player
|
class_name Player
|
||||||
|
|
||||||
const MAX_REACH = 100
|
const MAX_REACH = 100
|
||||||
const HOLDING_ITEM_SPRITE_SIZE = 20.
|
const HOLDING_ITEM_SPRITE_SIZE = 40.
|
||||||
|
|
||||||
signal player_updated(player: Player)
|
signal player_updated(player: Player)
|
||||||
signal upgraded
|
signal upgraded
|
||||||
@ -41,7 +41,7 @@ func _start_pass_day():
|
|||||||
|
|
||||||
# Méthode déclenchée par la classe planet
|
# Méthode déclenchée par la classe planet
|
||||||
func _pass_day():
|
func _pass_day():
|
||||||
full_recharge()
|
recharge()
|
||||||
|
|
||||||
# Méthode déclenchée par la classe planet
|
# Méthode déclenchée par la classe planet
|
||||||
func _end_pass_day():
|
func _end_pass_day():
|
||||||
@ -68,14 +68,13 @@ func _process(_delta):
|
|||||||
|
|
||||||
func _on_inventory_updated(_inventory: Inventory):
|
func _on_inventory_updated(_inventory: Inventory):
|
||||||
if inventory.get_item():
|
if inventory.get_item():
|
||||||
setup_preview_zone(inventory.get_item().usage_zone_radius)
|
setup_preview_zone(inventory.get_item().use_zone_radius)
|
||||||
var item_texture = inventory.get_item().icon
|
var item_texture = inventory.get_item().icon
|
||||||
%ItemSprite.texture = item_texture
|
%ItemSprite.texture = item_texture
|
||||||
%ItemSprite.scale = Vector2(
|
%ItemSprite.scale = Vector2(
|
||||||
1./(item_texture.get_width()/HOLDING_ITEM_SPRITE_SIZE),
|
1./(item_texture.get_width()/HOLDING_ITEM_SPRITE_SIZE),
|
||||||
1./(item_texture.get_height()/HOLDING_ITEM_SPRITE_SIZE)
|
1./(item_texture.get_height()/HOLDING_ITEM_SPRITE_SIZE)
|
||||||
)
|
)
|
||||||
%HideEyes.visible = inventory.get_item() != null
|
|
||||||
%ItemSprite.visible = inventory.get_item() != null
|
%ItemSprite.visible = inventory.get_item() != null
|
||||||
emit_signal("player_updated", self)
|
emit_signal("player_updated", self)
|
||||||
|
|
||||||
@ -91,23 +90,17 @@ func calculate_direction():
|
|||||||
|
|
||||||
velocity = input_direction * speed
|
velocity = input_direction * speed
|
||||||
if input_direction.x:
|
if input_direction.x:
|
||||||
flip_character(input_direction.x > 0)
|
$Sprite.flip_h = (input_direction.x < 0)
|
||||||
|
|
||||||
|
|
||||||
func flip_character(face_right = true):
|
|
||||||
$Sprite.flip_h = not face_right
|
|
||||||
%ItemSprite.position.x = abs(%ItemSprite.position.x) * (1 if face_right else -1)
|
|
||||||
%HideEyes.position.x = abs(%ItemSprite.position.x) * (1 if face_right else -1)
|
|
||||||
|
|
||||||
func can_interact(interactable : Interactable):
|
func can_interact(interactable : Interactable):
|
||||||
return interactable.can_interact(self)
|
return interactable.can_interact(self)
|
||||||
|
|
||||||
func try_interact(interactable : Interactable):
|
func try_interact(interactable : Interactable):
|
||||||
if interactable:
|
has_just_received_instruction = true
|
||||||
has_just_received_instruction = true
|
instruction = InteractableInstruction.new(
|
||||||
instruction = InteractableInstruction.new(
|
interactable
|
||||||
interactable
|
)
|
||||||
)
|
|
||||||
|
|
||||||
func try_move(move_to : Vector2):
|
func try_move(move_to : Vector2):
|
||||||
instruction = MoveInstruction.new(move_to)
|
instruction = MoveInstruction.new(move_to)
|
||||||
@ -126,7 +119,7 @@ func delete_item(item: Item):
|
|||||||
|
|
||||||
func try_use_item(item : Item, use_position : Vector2):
|
func try_use_item(item : Item, use_position : Vector2):
|
||||||
has_just_received_instruction = true
|
has_just_received_instruction = true
|
||||||
setup_action_zone(use_position, item.usage_zone_radius)
|
setup_action_zone(use_position, item.use_zone_radius)
|
||||||
instruction = ItemActionInstruction.new(
|
instruction = ItemActionInstruction.new(
|
||||||
use_position,
|
use_position,
|
||||||
item
|
item
|
||||||
@ -138,7 +131,7 @@ func preview_can_use_item(item : Item) -> bool:
|
|||||||
func can_use_item_on_zone(item : Item, zone: Area2D) -> bool:
|
func can_use_item_on_zone(item : Item, zone: Area2D) -> bool:
|
||||||
return (
|
return (
|
||||||
inventory.has_item(item)
|
inventory.has_item(item)
|
||||||
and (energy - item.energy_usage) >= 0
|
and (energy - item.use_energy) >= 0
|
||||||
and item.can_use(self, zone)
|
and item.can_use(self, zone)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -146,23 +139,19 @@ func use_item(item : Item):
|
|||||||
if can_use_item_on_zone(item, action_zone):
|
if can_use_item_on_zone(item, action_zone):
|
||||||
var is_item_used = item.use(self, action_zone)
|
var is_item_used = item.use(self, action_zone)
|
||||||
if is_item_used:
|
if is_item_used:
|
||||||
energy -= item.energy_usage
|
energy -= item.use_energy
|
||||||
if item.is_one_time_use():
|
if item.is_one_time_use():
|
||||||
delete_item(item)
|
delete_item(item)
|
||||||
|
|
||||||
func upgrade_max_energy(amount = 1):
|
func upgrade():
|
||||||
max_energy += amount
|
max_energy += 1
|
||||||
|
energy += 1
|
||||||
upgraded.emit()
|
upgraded.emit()
|
||||||
player_updated.emit(self)
|
|
||||||
|
|
||||||
func recharge(amount : int = max_energy):
|
func recharge(amount : int = max_energy):
|
||||||
energy = energy + amount
|
energy = min(energy + amount, max_energy)
|
||||||
upgraded.emit()
|
|
||||||
|
|
||||||
func full_recharge():
|
func generate_action_area(radius : int = 0) -> Area2D:
|
||||||
energy = max(energy, max_energy)
|
|
||||||
|
|
||||||
func generate_action_zone(radius : int = 0) -> Area2D:
|
|
||||||
var area2D = Area2D.new()
|
var area2D = Area2D.new()
|
||||||
var collision_shape = CollisionShape2D.new()
|
var collision_shape = CollisionShape2D.new()
|
||||||
var circle_shape = CircleShape2D.new()
|
var circle_shape = CircleShape2D.new()
|
||||||
@ -178,13 +167,13 @@ func generate_action_zone(radius : int = 0) -> Area2D:
|
|||||||
func setup_preview_zone(zone_radius : int) -> Area2D:
|
func setup_preview_zone(zone_radius : int) -> Area2D:
|
||||||
if preview_zone:
|
if preview_zone:
|
||||||
preview_zone.queue_free()
|
preview_zone.queue_free()
|
||||||
preview_zone = generate_action_zone(zone_radius)
|
preview_zone = generate_action_area(zone_radius)
|
||||||
return preview_zone
|
return preview_zone
|
||||||
|
|
||||||
func setup_action_zone(zone_position : Vector2, zone_radius : int) -> Area2D:
|
func setup_action_zone(zone_position : Vector2, zone_radius : int) -> Area2D:
|
||||||
if action_zone:
|
if action_zone:
|
||||||
action_zone.queue_free()
|
action_zone.queue_free()
|
||||||
action_zone = generate_action_zone(zone_radius)
|
action_zone = generate_action_area(zone_radius)
|
||||||
action_zone.global_position = zone_position
|
action_zone.global_position = zone_position
|
||||||
return action_zone
|
return action_zone
|
||||||
|
|
||||||
|
|||||||
@ -22,10 +22,5 @@ func _on_mouse_entered():
|
|||||||
func _on_mouse_excited():
|
func _on_mouse_excited():
|
||||||
Pointer.stop_inspect_entity(self)
|
Pointer.stop_inspect_entity(self)
|
||||||
|
|
||||||
func pointer_text():
|
func inspected_text():
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
func inspector_info() -> Inspector.Info:
|
|
||||||
return Inspector.Info.new(
|
|
||||||
pointer_text()
|
|
||||||
)
|
|
||||||
|
|||||||
@ -15,15 +15,9 @@ var planet : Planet # mis à jour par la classe Planet
|
|||||||
func _init(_planet = null):
|
func _init(_planet = null):
|
||||||
planet = _planet
|
planet = _planet
|
||||||
|
|
||||||
func pointer_text():
|
func inspected_text():
|
||||||
return "Buried Loot"
|
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:
|
func generate_sprite() -> Node2D:
|
||||||
var object = SPRITE_SCENE.instantiate()
|
var object = SPRITE_SCENE.instantiate()
|
||||||
|
|
||||||
|
|||||||
BIN
forest_phase_1.ogg
Normal file
19
forest_phase_1.ogg.import
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="oggvorbisstr"
|
||||||
|
type="AudioStreamOggVorbis"
|
||||||
|
uid="uid://c8s11jtg8q0jb"
|
||||||
|
path="res://.godot/imported/forest_phase_1.ogg-f46344e5c0426c0baaba2143d1f9c958.oggvorbisstr"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://forest_phase_1.ogg"
|
||||||
|
dest_files=["res://.godot/imported/forest_phase_1.ogg-f46344e5c0426c0baaba2143d1f9c958.oggvorbisstr"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
loop=false
|
||||||
|
loop_offset=0
|
||||||
|
bpm=0
|
||||||
|
beat_count=0
|
||||||
|
bar_beats=4
|
||||||
106
game.tscn
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
[gd_scene load_steps=21 format=3 uid="uid://d28cp7a21kwou"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://12nak7amd1uq" path="res://gui/game/game_gui.tscn" id="1_iotsf"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://csiacsndm62ll" path="res://gui/game/pause/pause.tscn" id="2_215e1"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bgvbgeq46wee2" path="res://entities/player/player.tscn" id="2_lc2xo"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://v41hfc7haaye" path="res://gui/game/win/win.tscn" id="3_7sc4i"]
|
||||||
|
[ext_resource type="Script" uid="uid://dedg615xudpoq" path="res://entities/interactables/item_object/script/item_object.gd" id="3_215e1"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://tsi5j1uxppa4" path="res://stages/terrain/planet/planet.tscn" id="6_e8heu"]
|
||||||
|
[ext_resource type="Resource" uid="uid://ddqalo1k30i5x" path="res://common/inventory/resources/items/default_shovel.tres" id="6_lc2xo"]
|
||||||
|
[ext_resource type="Resource" uid="uid://bya8sm6rm6747" path="res://common/inventory/resources/items/compost.tres" id="7_215e1"]
|
||||||
|
[ext_resource type="Script" uid="uid://bq7admu4ahs5r" path="res://common/inventory/scripts/item.gd" id="7_rvswv"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://d324mlmgls4fs" path="res://entities/interactables/machines/recharge_station/recharge_station.tscn" id="8_7sc4i"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="8_boyg6"]
|
||||||
|
[ext_resource type="Resource" uid="uid://b04vho33bl52b" path="res://entities/plants/resources/plant_types/default.tres" id="9_e36ub"]
|
||||||
|
[ext_resource type="Script" uid="uid://bypjcvlc15gsm" path="res://common/inventory/scripts/items/seed.gd" id="10_hb5m1"]
|
||||||
|
[ext_resource type="Resource" uid="uid://dsctivn1vrem2" path="res://entities/plants/resources/plant_types/maias.tres" id="11_x5p1p"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dj7gp3crtg2yt" path="res://entities/camera/camera.tscn" id="12_qhcbd"]
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_qt76e"]
|
||||||
|
atlas = ExtResource("8_boyg6")
|
||||||
|
region = Rect2(1140, 345, 141, 128)
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_7sc4i"]
|
||||||
|
script = ExtResource("10_hb5m1")
|
||||||
|
plant_type = ExtResource("9_e36ub")
|
||||||
|
name = "Chardi"
|
||||||
|
description = "This plant remove a lot of contamination around when it becomes mature."
|
||||||
|
icon = SubResource("AtlasTexture_qt76e")
|
||||||
|
use_zone_radius = 5
|
||||||
|
use_energy = 1
|
||||||
|
metadata/_custom_type_script = "uid://bypjcvlc15gsm"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_80cx4"]
|
||||||
|
script = ExtResource("10_hb5m1")
|
||||||
|
plant_type = ExtResource("9_e36ub")
|
||||||
|
name = "Chardi"
|
||||||
|
description = "This plant remove a lot of contamination around when it becomes mature."
|
||||||
|
icon = SubResource("AtlasTexture_qt76e")
|
||||||
|
use_zone_radius = 5
|
||||||
|
use_energy = 1
|
||||||
|
metadata/_custom_type_script = "uid://bypjcvlc15gsm"
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_sri3b"]
|
||||||
|
atlas = ExtResource("8_boyg6")
|
||||||
|
region = Rect2(1697, 331, 125, 158)
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_e8heu"]
|
||||||
|
script = ExtResource("10_hb5m1")
|
||||||
|
plant_type = ExtResource("11_x5p1p")
|
||||||
|
name = "Maias"
|
||||||
|
description = "This gorgeous flower produce a lot of seeds."
|
||||||
|
icon = SubResource("AtlasTexture_sri3b")
|
||||||
|
use_zone_radius = 5
|
||||||
|
use_energy = 1
|
||||||
|
metadata/_custom_type_script = "uid://bypjcvlc15gsm"
|
||||||
|
|
||||||
|
[node name="Game" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||||
|
|
||||||
|
[node name="RootGui" parent="CanvasLayer" instance=ExtResource("1_iotsf")]
|
||||||
|
metadata/_edit_use_anchors_ = true
|
||||||
|
|
||||||
|
[node name="Pause" parent="CanvasLayer" instance=ExtResource("2_215e1")]
|
||||||
|
process_mode = 3
|
||||||
|
visible = false
|
||||||
|
z_index = 1000
|
||||||
|
|
||||||
|
[node name="Win" parent="CanvasLayer" instance=ExtResource("3_7sc4i")]
|
||||||
|
visible = false
|
||||||
|
|
||||||
|
[node name="Entities" type="Node2D" parent="."]
|
||||||
|
y_sort_enabled = true
|
||||||
|
|
||||||
|
[node name="Player" parent="Entities" instance=ExtResource("2_lc2xo")]
|
||||||
|
|
||||||
|
[node name="ItemObject" type="Area2D" parent="Entities"]
|
||||||
|
position = Vector2(0, 129)
|
||||||
|
script = ExtResource("3_215e1")
|
||||||
|
item = ExtResource("6_lc2xo")
|
||||||
|
metadata/_custom_type_script = "uid://dedg615xudpoq"
|
||||||
|
|
||||||
|
[node name="ItemObject2" type="Area2D" parent="Entities"]
|
||||||
|
position = Vector2(-162, 23)
|
||||||
|
script = ExtResource("3_215e1")
|
||||||
|
item = ExtResource("7_215e1")
|
||||||
|
metadata/_custom_type_script = "uid://dedg615xudpoq"
|
||||||
|
|
||||||
|
[node name="RechargeStation" parent="Entities" instance=ExtResource("8_7sc4i")]
|
||||||
|
position = Vector2(-1, -217)
|
||||||
|
|
||||||
|
[node name="Planet" parent="." node_paths=PackedStringArray("import_entities_from_node") instance=ExtResource("6_e8heu")]
|
||||||
|
loot_items = Array[ExtResource("7_rvswv")]([SubResource("Resource_7sc4i"), SubResource("Resource_80cx4"), SubResource("Resource_e8heu")])
|
||||||
|
import_entities_from_node = NodePath("../Entities")
|
||||||
|
|
||||||
|
[node name="Camera" parent="." node_paths=PackedStringArray("following") instance=ExtResource("12_qhcbd")]
|
||||||
|
position = Vector2(2.22, 0)
|
||||||
|
following = NodePath("../Entities/Player")
|
||||||
|
|
||||||
|
[connection signal="pause_asked" from="CanvasLayer/RootGui" to="CanvasLayer/Pause" method="_on_root_gui_pause_asked"]
|
||||||
|
[connection signal="player_updated" from="Entities/Player" to="CanvasLayer/RootGui" method="_on_player_updated"]
|
||||||
|
[connection signal="upgraded" from="Entities/Player" to="CanvasLayer/RootGui" method="_on_player_upgraded"]
|
||||||
|
[connection signal="day_limit_exceed" from="Planet" to="CanvasLayer/Win" method="_on_planet_day_limit_exceed"]
|
||||||
|
[connection signal="pass_day_ended" from="Planet" to="CanvasLayer/RootGui" method="_on_planet_pass_day_ended"]
|
||||||
|
[connection signal="pass_day_started" from="Planet" to="CanvasLayer/RootGui" method="_on_planet_pass_day_started"]
|
||||||
|
[connection signal="planet_updated" from="Planet" to="CanvasLayer/RootGui" method="_on_planet_updated"]
|
||||||
@ -1,159 +0,0 @@
|
|||||||
[gd_scene load_steps=11 format=3 uid="uid://fnv0qhkh40mv"]
|
|
||||||
|
|
||||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_0ssee"]
|
|
||||||
[ext_resource type="Script" uid="uid://bvb4v66bqteuc" path="res://gui/game/announce/scripts/announce.gd" id="1_4evne"]
|
|
||||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="2_yrhd4"]
|
|
||||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="3_7nrno"]
|
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_vbart"]
|
|
||||||
font = ExtResource("2_yrhd4")
|
|
||||||
font_size = 50
|
|
||||||
|
|
||||||
[sub_resource type="Gradient" id="Gradient_id0t5"]
|
|
||||||
interpolation_mode = 1
|
|
||||||
offsets = PackedFloat32Array(0, 0.115169, 0.41573, 0.620786, 0.924157)
|
|
||||||
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1)
|
|
||||||
|
|
||||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_mnweq"]
|
|
||||||
gradient = SubResource("Gradient_id0t5")
|
|
||||||
fill_to = Vector2(1, 1)
|
|
||||||
repeat = 1
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_ok3ge"]
|
|
||||||
length = 0.001
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath(".:visible")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [false]
|
|
||||||
}
|
|
||||||
tracks/1/type = "value"
|
|
||||||
tracks/1/imported = false
|
|
||||||
tracks/1/enabled = true
|
|
||||||
tracks/1/path = NodePath("VBoxContainer/AnnounceTexture:custom_minimum_size")
|
|
||||||
tracks/1/interp = 1
|
|
||||||
tracks/1/loop_wrap = true
|
|
||||||
tracks/1/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Vector2(0, 0)]
|
|
||||||
}
|
|
||||||
tracks/2/type = "value"
|
|
||||||
tracks/2/imported = false
|
|
||||||
tracks/2/enabled = true
|
|
||||||
tracks/2/path = NodePath("VBoxContainer:modulate")
|
|
||||||
tracks/2/interp = 1
|
|
||||||
tracks/2/loop_wrap = true
|
|
||||||
tracks/2/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Color(1, 1, 1, 0)]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_871vo"]
|
|
||||||
resource_name = "pass"
|
|
||||||
length = 3.0
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath(".:visible")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0, 0.0333333, 2.93334, 2.96667),
|
|
||||||
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [false, true, true, false]
|
|
||||||
}
|
|
||||||
tracks/1/type = "value"
|
|
||||||
tracks/1/imported = false
|
|
||||||
tracks/1/enabled = true
|
|
||||||
tracks/1/path = NodePath("VBoxContainer/AnnounceTexture:custom_minimum_size")
|
|
||||||
tracks/1/interp = 1
|
|
||||||
tracks/1/loop_wrap = true
|
|
||||||
tracks/1/keys = {
|
|
||||||
"times": PackedFloat32Array(0.0666667, 0.433333, 2.42651, 2.93334),
|
|
||||||
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Vector2(0, 0), Vector2(0, 65), Vector2(0, 65), Vector2(0, 0)]
|
|
||||||
}
|
|
||||||
tracks/2/type = "value"
|
|
||||||
tracks/2/imported = false
|
|
||||||
tracks/2/enabled = true
|
|
||||||
tracks/2/path = NodePath("VBoxContainer:modulate")
|
|
||||||
tracks/2/interp = 1
|
|
||||||
tracks/2/loop_wrap = true
|
|
||||||
tracks/2/keys = {
|
|
||||||
"times": PackedFloat32Array(0.0666667, 0.133333, 2.83334, 2.93334),
|
|
||||||
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_dvva5"]
|
|
||||||
_data = {
|
|
||||||
&"RESET": SubResource("Animation_ok3ge"),
|
|
||||||
&"pass": SubResource("Animation_871vo")
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="Announce" type="Control"]
|
|
||||||
visible = false
|
|
||||||
clip_contents = true
|
|
||||||
layout_mode = 3
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
script = ExtResource("1_4evne")
|
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
|
||||||
modulate = Color(1, 1, 1, 0)
|
|
||||||
clip_contents = true
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 14
|
|
||||||
anchor_top = 0.5
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 0.5
|
|
||||||
offset_top = -73.5
|
|
||||||
offset_bottom = 73.5
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
theme = ExtResource("1_0ssee")
|
|
||||||
alignment = 1
|
|
||||||
|
|
||||||
[node name="AnnounceTitle" type="Label" parent="VBoxContainer"]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
layout_mode = 2
|
|
||||||
text = "New Quota"
|
|
||||||
label_settings = SubResource("LabelSettings_vbart")
|
|
||||||
horizontal_alignment = 1
|
|
||||||
|
|
||||||
[node name="AnnounceTexture" type="TextureRect" parent="VBoxContainer"]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
modulate = Color(0.886275, 0.623529, 0.196078, 1)
|
|
||||||
layout_mode = 2
|
|
||||||
texture = SubResource("GradientTexture2D_mnweq")
|
|
||||||
expand_mode = 1
|
|
||||||
stretch_mode = 1
|
|
||||||
|
|
||||||
[node name="AnnounceText" type="Label" parent="VBoxContainer"]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Decontaminate 50 unit in 10 days"
|
|
||||||
label_settings = ExtResource("3_7nrno")
|
|
||||||
horizontal_alignment = 1
|
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
libraries = {
|
|
||||||
&"": SubResource("AnimationLibrary_dvva5")
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
extends Control
|
|
||||||
class_name Announce
|
|
||||||
|
|
||||||
const YELLOW_COLOR = Color("e29f32")
|
|
||||||
const RED_COLOR = Color("f20058")
|
|
||||||
|
|
||||||
func announce(title : String, text : String, band_color : Color = YELLOW_COLOR):
|
|
||||||
%AnnounceTitle.text = title
|
|
||||||
%AnnounceText.text = text
|
|
||||||
%AnnounceTexture.modulate = band_color
|
|
||||||
%AnimationPlayer.play("pass")
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://bvb4v66bqteuc
|
|
||||||
|
Before Width: | Height: | Size: 887 B After Width: | Height: | Size: 887 B |
@ -3,15 +3,15 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://dcgnamu7sb3ov"
|
uid="uid://dcgnamu7sb3ov"
|
||||||
path="res://.godot/imported/bolt.svg-a559d5e701996c7d105fc68102331434.ctex"
|
path="res://.godot/imported/bolt.svg-71cbe0c7c38f15f305dc23930d585037.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://common/icons/bolt.svg"
|
source_file="res://gui/game/assets/icons/bolt.svg"
|
||||||
dest_files=["res://.godot/imported/bolt.svg-a559d5e701996c7d105fc68102331434.ctex"]
|
dest_files=["res://.godot/imported/bolt.svg-71cbe0c7c38f15f305dc23930d585037.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
@ -32,6 +32,6 @@ process/hdr_as_srgb=false
|
|||||||
process/hdr_clamp_exposure=false
|
process/hdr_clamp_exposure=false
|
||||||
process/size_limit=0
|
process/size_limit=0
|
||||||
detect_3d/compress_to=1
|
detect_3d/compress_to=1
|
||||||
svg/scale=2.0
|
svg/scale=1.0
|
||||||
editor/scale_with_editor_scale=false
|
editor/scale_with_editor_scale=false
|
||||||
editor/convert_colors_with_editor_theme=false
|
editor/convert_colors_with_editor_theme=false
|
||||||