équilibrages, fix et évolutions
* résolution du bug de disparition des items #94 * améliorations définitives dans le camion via compost #88 * ajout de plus d'aléatoire dans le zone de départ * suppression des récompenses de quota (pour l'instant) * équilibrage du gain en graine * ajout de la clarté dans les actions
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://cjo6ea86rfqbe"
|
||||
path="res://.godot/imported/compost_level_up.wav-4dc4368c9a44be31c1f804b5f6512a8a.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/interactables/truck/compost/assets/sounds/compost_level_up.wav"
|
||||
dest_files=["res://.godot/imported/compost_level_up.wav-4dc4368c9a44be31c1f804b5f6512a8a.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
BIN
entities/interactables/truck/compost/assets/sprites/compost.png
Normal file
BIN
entities/interactables/truck/compost/assets/sprites/compost.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 999 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://n7hhyqhhtx0q"
|
||||
path="res://.godot/imported/compost.png-e03e492b1de4adb6f23b4a9bd2caffe2.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/interactables/truck/compost/assets/sprites/compost.png"
|
||||
dest_files=["res://.godot/imported/compost.png-e03e492b1de4adb6f23b4a9bd2caffe2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="54.516888mm"
|
||||
height="71.574326mm"
|
||||
viewBox="0 0 54.516888 71.574326"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
inkscape:export-filename="compost.svg"
|
||||
inkscape:export-xdpi="51.66227"
|
||||
inkscape:export-ydpi="51.66227"
|
||||
xml:space="preserve"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#ffffff"
|
||||
borderopacity="1"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="1"
|
||||
inkscape:deskcolor="#505050"
|
||||
inkscape:document-units="mm" /><defs
|
||||
id="defs1" /><g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-20.067568,-29.766889)"><rect
|
||||
style="fill:#c9c9c9;fill-opacity:1;stroke-width:0.264583;stroke-linecap:square"
|
||||
id="rect5"
|
||||
width="10.702703"
|
||||
height="54.532818"
|
||||
x="25.418919"
|
||||
y="29.76689"
|
||||
ry="4.1948323" /><rect
|
||||
style="fill:#c9c9c9;fill-opacity:1;stroke-width:0.264583;stroke-linecap:square"
|
||||
id="rect8"
|
||||
width="43.814186"
|
||||
height="44.307919"
|
||||
x="25.418921"
|
||||
y="39.991791"
|
||||
ry="4.1948323" /><rect
|
||||
style="fill:#ffffff;fill-opacity:1;stroke-width:0.264583;stroke-linecap:square"
|
||||
id="rect3"
|
||||
width="10.702703"
|
||||
height="54.532818"
|
||||
x="20.067568"
|
||||
y="46.808395"
|
||||
ry="4.1948323" /><rect
|
||||
style="fill:#c9c9c9;fill-opacity:1;stroke-width:0.264583;stroke-linecap:square"
|
||||
id="rect6"
|
||||
width="10.702703"
|
||||
height="54.532818"
|
||||
x="58.530403"
|
||||
y="29.76689"
|
||||
ry="4.1948323" /><rect
|
||||
style="fill:#ffffff;fill-opacity:1;stroke-width:0.264583;stroke-linecap:square"
|
||||
id="rect4"
|
||||
width="10.702703"
|
||||
height="54.532818"
|
||||
x="63.881756"
|
||||
y="46.808395"
|
||||
ry="4.1948323" /><rect
|
||||
style="fill:#ffffff;fill-opacity:1;stroke-width:0.264583;stroke-linecap:square"
|
||||
id="rect7"
|
||||
width="43.814186"
|
||||
height="44.307919"
|
||||
x="25.418919"
|
||||
y="57.033298"
|
||||
ry="0" /></g></svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://f2rte5jc0psp"
|
||||
path="res://.godot/imported/compost.svg-db0462cb8633aba19a85cbdfc7ac658c.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/interactables/truck/compost/assets/sprites/compost.svg"
|
||||
dest_files=["res://.godot/imported/compost.svg-db0462cb8633aba19a85cbdfc7ac658c.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
147
entities/interactables/truck/compost/compost.tscn
Normal file
147
entities/interactables/truck/compost/compost.tscn
Normal file
@@ -0,0 +1,147 @@
|
||||
[gd_scene load_steps=16 format=3 uid="uid://p2dkmy6xs31c"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dw6jgsasb2fe1" path="res://entities/interactables/truck/compost/scripts/compost.gd" id="1_ux0j5"]
|
||||
[ext_resource type="Texture2D" uid="uid://n7hhyqhhtx0q" path="res://entities/interactables/truck/compost/assets/sprites/compost.png" id="2_grq07"]
|
||||
[ext_resource type="Shader" uid="uid://bqjwmomh851lc" path="res://common/vfx/materials/shaders/skew.gdshader" id="3_grq07"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="4_ux0j5"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="5_65b0j"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_65b0j"]
|
||||
radius = 57.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_grq07"]
|
||||
shader = ExtResource("3_grq07")
|
||||
shader_parameter/fov = 1.0
|
||||
shader_parameter/cull_back = true
|
||||
shader_parameter/y_rot = 73.4370120382575
|
||||
shader_parameter/x_rot = -57.169994165575005
|
||||
shader_parameter/inset = 0.0
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_4hdev"]
|
||||
viewport_path = NodePath("CountViewPort")
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_8nmxn"]
|
||||
shader = ExtResource("3_grq07")
|
||||
shader_parameter/fov = 1.0
|
||||
shader_parameter/cull_back = true
|
||||
shader_parameter/y_rot = -50.112993830367486
|
||||
shader_parameter/x_rot = -40.629993379925
|
||||
shader_parameter/inset = 0.0
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_24qh8"]
|
||||
viewport_path = NodePath("IconViewPort")
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_kgjd8"]
|
||||
font = ExtResource("4_ux0j5")
|
||||
font_size = 30
|
||||
|
||||
[sub_resource type="Animation" id="Animation_65b0j"]
|
||||
resource_name = "empty"
|
||||
|
||||
[sub_resource type="Animation" id="Animation_8nmxn"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("..:scale")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ux0j5"]
|
||||
resource_name = "bump"
|
||||
length = 0.3
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("..:scale")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.099999994, 0.16666669, 0.3),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(1, 1), Vector2(1.195, 0.915), Vector2(0.81, 1.195), Vector2(1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_8nmxn"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_8nmxn"),
|
||||
&"bump": SubResource("Animation_ux0j5"),
|
||||
&"empty": SubResource("Animation_65b0j")
|
||||
}
|
||||
|
||||
[node name="Compost" type="Area2D"]
|
||||
script = ExtResource("1_ux0j5")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, -3)
|
||||
shape = SubResource("CircleShape2D_65b0j")
|
||||
|
||||
[node name="SpriteGroup" type="Node2D" parent="."]
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="SpriteGroup"]
|
||||
unique_name_in_owner = true
|
||||
scale = Vector2(0.09, 0.09)
|
||||
texture = ExtResource("2_grq07")
|
||||
|
||||
[node name="CountTexture" type="Sprite2D" parent="SpriteGroup"]
|
||||
material = SubResource("ShaderMaterial_grq07")
|
||||
position = Vector2(34.000004, 18.000002)
|
||||
scale = Vector2(1.2352942, 1.2352942)
|
||||
texture = SubResource("ViewportTexture_4hdev")
|
||||
|
||||
[node name="IconTexture" type="Sprite2D" parent="SpriteGroup"]
|
||||
material = SubResource("ShaderMaterial_8nmxn")
|
||||
position = Vector2(-34.000004, 16.000002)
|
||||
scale = Vector2(0.50000006, 0.50000006)
|
||||
texture = SubResource("ViewportTexture_24qh8")
|
||||
|
||||
[node name="CountViewPort" type="SubViewport" parent="."]
|
||||
transparent_bg = true
|
||||
size = Vector2i(163, 34)
|
||||
|
||||
[node name="Count" type="Label" parent="CountViewPort"]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(0.0627451, 0.019607844, 0.22745098, 1)
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 6
|
||||
text = "5/3"
|
||||
label_settings = SubResource("LabelSettings_kgjd8")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="IconViewPort" type="SubViewport" parent="."]
|
||||
transparent_bg = true
|
||||
size = Vector2i(64, 64)
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="IconViewPort"]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(0.0627451, 0.019607844, 0.22745098, 1)
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 6
|
||||
texture = ExtResource("5_65b0j")
|
||||
expand_mode = 3
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
root_node = NodePath("../SpriteGroup/CountTexture")
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_8nmxn")
|
||||
}
|
||||
132
entities/interactables/truck/compost/scripts/compost.gd
Normal file
132
entities/interactables/truck/compost/scripts/compost.gd
Normal file
@@ -0,0 +1,132 @@
|
||||
extends Interactable
|
||||
class_name Compost
|
||||
|
||||
const FILLED_ICON = preload("res://common/icons/bucket.svg")
|
||||
|
||||
signal rewarded(c : Compost)
|
||||
|
||||
var reward : Reward = null :
|
||||
set(r):
|
||||
reward = r
|
||||
update_info()
|
||||
var containing_seed : int = 0 :
|
||||
set(c):
|
||||
containing_seed = c
|
||||
update_info()
|
||||
|
||||
func _ready():
|
||||
update_info()
|
||||
|
||||
func pointer_text() -> String:
|
||||
return "Compost"
|
||||
|
||||
func inspector_info() -> Inspector.Info:
|
||||
var info = Inspector.Info.new(
|
||||
pointer_text(),
|
||||
"Fill this machine with seeds to get an reward",
|
||||
%Sprite.texture,
|
||||
)
|
||||
|
||||
if reward != null:
|
||||
info.framed_infos.append(
|
||||
Inspector.FramedInfo.new(
|
||||
"On filled",
|
||||
reward.desc(),
|
||||
FILLED_ICON,
|
||||
)
|
||||
)
|
||||
|
||||
return info
|
||||
|
||||
func update_info():
|
||||
%Count.text = "" if reward == null else "%d/%d" % [containing_seed, reward.get_seed_needed()]
|
||||
%Icon.texture = null if reward == null else reward.icon()
|
||||
|
||||
func interact_text():
|
||||
if reward:
|
||||
return "Put a seed (%d left)" % (reward.get_seed_needed() - containing_seed)
|
||||
else:
|
||||
return ""
|
||||
|
||||
func can_interact(p : Player) -> bool:
|
||||
return reward and p.inventory.get_item() and p.inventory.get_item() is Seed
|
||||
|
||||
func interact(p : Player) -> bool:
|
||||
if not can_interact(p):
|
||||
return false
|
||||
|
||||
p.play_sfx("harvest")
|
||||
p.inventory.remove_current_item()
|
||||
containing_seed += 1
|
||||
if containing_seed >= reward.get_seed_needed():
|
||||
containing_seed = 0
|
||||
reward.reward(p)
|
||||
rewarded.emit(self)
|
||||
%AnimationPlayer.play("bump")
|
||||
|
||||
return true
|
||||
|
||||
func product(_player : Player):
|
||||
pass
|
||||
|
||||
class Reward:
|
||||
|
||||
var seed_needed : int = 1
|
||||
|
||||
func _init(_seed_needed : int):
|
||||
seed_needed = _seed_needed
|
||||
|
||||
func reward(_p: Player):
|
||||
pass
|
||||
|
||||
func get_seed_needed() -> int:
|
||||
return seed_needed
|
||||
|
||||
func desc() -> String:
|
||||
return ""
|
||||
|
||||
func icon() -> Texture:
|
||||
return null
|
||||
|
||||
class UpgradeMaxEnergyReward extends Reward:
|
||||
func reward(p: Player):
|
||||
p.upgrade_max_energy(1)
|
||||
|
||||
func desc() -> String:
|
||||
return "Upgrade max energy"
|
||||
|
||||
func icon() -> Texture:
|
||||
return preload("res://common/icons/bolt.svg")
|
||||
|
||||
class UpgradeMaxInventoryReward extends Reward:
|
||||
func reward(p: Player):
|
||||
p.upgrade_inventory_size()
|
||||
|
||||
func desc() -> String:
|
||||
return "Upgrade max inventory size"
|
||||
|
||||
func icon() -> Texture:
|
||||
return preload("res://common/icons/backpack.svg")
|
||||
|
||||
class GiveItemReward extends Reward:
|
||||
|
||||
var item : Item
|
||||
|
||||
func _init(_seed_needed : int, _item : Item):
|
||||
item = _item
|
||||
seed_needed = _seed_needed
|
||||
|
||||
func reward(p: Player):
|
||||
print(item)
|
||||
if p.inventory.is_full():
|
||||
print("drop")
|
||||
p.terrain.drop_item(item, p.global_position, 10)
|
||||
else:
|
||||
print("give")
|
||||
p.pick_item(item)
|
||||
|
||||
func desc() -> String:
|
||||
return "Give the item %s" % item.get_item_name()
|
||||
|
||||
func icon() -> Texture:
|
||||
return item.icon
|
||||
@@ -0,0 +1 @@
|
||||
uid://dw6jgsasb2fe1
|
||||
Reference in New Issue
Block a user