ajouts d'objectifs sur la carte, déplacements des icônes et divers changements
This commit is contained in:
BIN
entities/objectives/assets/sprites/arbre_mort.png
Normal file
BIN
entities/objectives/assets/sprites/arbre_mort.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 127 KiB |
34
entities/objectives/assets/sprites/arbre_mort.png.import
Normal file
34
entities/objectives/assets/sprites/arbre_mort.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[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
|
||||
BIN
entities/objectives/assets/sprites/little_plant.png
Normal file
BIN
entities/objectives/assets/sprites/little_plant.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
34
entities/objectives/assets/sprites/little_plant.png.import
Normal file
34
entities/objectives/assets/sprites/little_plant.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[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
|
||||
281
entities/objectives/objective.tscn
Normal file
281
entities/objectives/objective.tscn
Normal file
@@ -0,0 +1,281 @@
|
||||
[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
|
||||
@@ -0,0 +1,8 @@
|
||||
[gd_resource type="Resource" script_class="IncreaseDayLimitReward" load_steps=2 format=3 uid="uid://b11qyyi8k0mua"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://df6i1hivw4ymn" path="res://entities/objectives/scripts/rewards/increase_day_limit_reward.gd" id="1_gt31s"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_gt31s")
|
||||
day_limit_increase = 5
|
||||
metadata/_custom_type_script = "uid://df6i1hivw4ymn"
|
||||
@@ -0,0 +1,8 @@
|
||||
[gd_resource type="Resource" script_class="LootRandomSeedsReward" load_steps=2 format=3 uid="uid://ca62vcsijbxgc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bcdilfb4j7f6d" path="res://entities/objectives/scripts/rewards/loot_random_seeds_reward.gd" id="1_yjhoy"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_yjhoy")
|
||||
seeds_number = 5
|
||||
metadata/_custom_type_script = "uid://bcdilfb4j7f6d"
|
||||
21
entities/objectives/resources/loot_compost_reward.tres
Normal file
21
entities/objectives/resources/loot_compost_reward.tres
Normal file
@@ -0,0 +1,21 @@
|
||||
[gd_resource type="Resource" script_class="LootItemReward" load_steps=6 format=3 uid="uid://clmsn7r2shw6j"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dva05p817w00f" path="res://entities/objectives/scripts/rewards/loot_item_reward.gd" id="1_dyn78"]
|
||||
[ext_resource type="Texture2D" uid="uid://0xg54agef5gh" path="res://common/icons/package.svg" id="1_gvg4i"]
|
||||
[ext_resource type="PackedScene" uid="uid://bkwh1ntvgkkrt" path="res://entities/interactables/machines/compost/compost.tscn" id="2_22dgr"]
|
||||
[ext_resource type="Script" uid="uid://b6kubqgq0k7vj" path="res://common/inventory/scripts/items/package.gd" id="3_0bwtl"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_00nan"]
|
||||
script = ExtResource("3_0bwtl")
|
||||
scene = ExtResource("2_22dgr")
|
||||
name = "Compost"
|
||||
description = "The compost allow you to upgrade your max energy when putting in it a certain amount of seeds."
|
||||
icon = ExtResource("1_gvg4i")
|
||||
use_zone_radius = 5
|
||||
use_energy = 1
|
||||
metadata/_custom_type_script = "uid://b6kubqgq0k7vj"
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_dyn78")
|
||||
item = SubResource("Resource_00nan")
|
||||
metadata/_custom_type_script = "uid://dva05p817w00f"
|
||||
37
entities/objectives/scripts/objective.gd
Normal file
37
entities/objectives/scripts/objective.gd
Normal file
@@ -0,0 +1,37 @@
|
||||
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
entities/objectives/scripts/objective.gd.uid
Normal file
1
entities/objectives/scripts/objective.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://j8fpi8rd8eyy
|
||||
14
entities/objectives/scripts/objective_reward.gd
Normal file
14
entities/objectives/scripts/objective_reward.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
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
entities/objectives/scripts/objective_reward.gd.uid
Normal file
1
entities/objectives/scripts/objective_reward.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bsh4b8miag8w1
|
||||
@@ -0,0 +1,19 @@
|
||||
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)
|
||||
@@ -0,0 +1 @@
|
||||
uid://df6i1hivw4ymn
|
||||
25
entities/objectives/scripts/rewards/loot_item_reward.gd
Normal file
25
entities/objectives/scripts/rewards/loot_item_reward.gd
Normal file
@@ -0,0 +1,25 @@
|
||||
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
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
uid://dva05p817w00f
|
||||
@@ -0,0 +1 @@
|
||||
uid://dot5gfkbm7p6s
|
||||
@@ -0,0 +1,26 @@
|
||||
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
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
uid://bcdilfb4j7f6d
|
||||
@@ -0,0 +1,19 @@
|
||||
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)
|
||||
@@ -0,0 +1 @@
|
||||
uid://cflvw3bfcocnn
|
||||
Reference in New Issue
Block a user