It's Cow Game! Version 2.04!
This commit is contained in:
commit
a9e1ed9ddd
3148 changed files with 95332 additions and 0 deletions
BIN
UI/Refilling/Droplet.png
Normal file
BIN
UI/Refilling/Droplet.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 107 B |
34
UI/Refilling/Droplet.png.import
Normal file
34
UI/Refilling/Droplet.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bb1q5ifwi3o1q"
|
||||
path="res://.godot/imported/Droplet.png-6fea4871ebf33a4eaecfb382609f9e1b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://UI/Refilling/Droplet.png"
|
||||
dest_files=["res://.godot/imported/Droplet.png-6fea4871ebf33a4eaecfb382609f9e1b.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
UI/Refilling/RefillingBG.png
Normal file
BIN
UI/Refilling/RefillingBG.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 833 B |
34
UI/Refilling/RefillingBG.png.import
Normal file
34
UI/Refilling/RefillingBG.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://chxnma7j2hml"
|
||||
path="res://.godot/imported/RefillingBG.png-61ffbb19dd8b6ce34b489ad3160dd860.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://UI/Refilling/RefillingBG.png"
|
||||
dest_files=["res://.godot/imported/RefillingBG.png-61ffbb19dd8b6ce34b489ad3160dd860.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
|
||||
104
UI/Refilling/RefillingMenu.gd
Normal file
104
UI/Refilling/RefillingMenu.gd
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
extends Window
|
||||
|
||||
@onready var inventoryItemDisplayer = %Inventory
|
||||
|
||||
var itemTransitionScene = preload("res://UI/Sugaring/ItemFadeTransition.tscn")
|
||||
|
||||
var lastRefilled = []
|
||||
|
||||
var refillableItemNames = []
|
||||
var refilledItemScripts = []
|
||||
var playerInventory:Inventory
|
||||
|
||||
func _ready():
|
||||
refillableItemNames = ["Empty Wustard Packet", "Empty Ketchup Packet", "Empty Relish Packet",
|
||||
"Empty Sugar Packet", "Green Soda Can", "Blue Soda Can", "Empty Key Packet",
|
||||
"Empty Silica Gel Packet"]
|
||||
refilledItemScripts = [preload("res://Items/Foods/Packaged/WustardPacket.gd"),
|
||||
preload("res://Items/Foods/Packaged/KetchupPacket.gd"),
|
||||
preload("res://Items/Foods/Packaged/RelishPacket.gd"),
|
||||
preload("res://Items/Foods/Packaged/SugarPacket.gd"),
|
||||
preload("res://Items/Foods/Liquids/GreenSoda.gd"),
|
||||
preload("res://Items/Foods/Liquids/BlueSoda.gd"),
|
||||
preload("res://Items/Artificial/Products/KeyPacket.gd"),
|
||||
preload("res://Items/Artificial/Products/SilicaGelPacket.gd")]
|
||||
inventoryItemDisplayer.buttonPressed.connect(refill_item)
|
||||
inventoryItemDisplayer.set_title("Empty Items")
|
||||
|
||||
func opened():
|
||||
get_tree().paused = true
|
||||
playerInventory = InventoryManager.get_inventory()
|
||||
inventoryItemDisplayer.inventory = filter_inventory(playerInventory)
|
||||
inventoryItemDisplayer.update_display()
|
||||
|
||||
lastRefilled = []
|
||||
|
||||
func refill_item(item:Item, quantity:int = 1):
|
||||
var itemsInInv = InventoryManager.get_item_count(item)
|
||||
if itemsInInv < quantity:
|
||||
quantity = itemsInInv
|
||||
|
||||
if item.get_name() in lastRefilled:
|
||||
lastRefilled = []
|
||||
lastRefilled.append(item.get_name())
|
||||
|
||||
if lastRefilled.size() >= 3:
|
||||
AchievementManager.complete_achievement("Reuse Reuse Reuse")
|
||||
|
||||
InventoryManager.remove_item_from_inventory(item, quantity)
|
||||
|
||||
var refilledItem = null
|
||||
for i in range(refillableItemNames.size()):
|
||||
var currentName = refillableItemNames[i]
|
||||
if item.get_name(false) == currentName:
|
||||
refilledItem = refilledItemScripts[i].new()
|
||||
|
||||
refilledItem.itemModifications = item.itemModifications
|
||||
InventoryManager.add_item_to_inventory(refilledItem, quantity)
|
||||
|
||||
spawn_refill_particles(refilledItem)
|
||||
spawn_item_transition(item, refilledItem)
|
||||
|
||||
inventoryItemDisplayer.inventory = filter_inventory(playerInventory)
|
||||
inventoryItemDisplayer.update_display()
|
||||
|
||||
func spawn_refill_particles(refilledItem:Item):
|
||||
var averageColor = refilledItem.get_average_color()
|
||||
var newParticles = preload("res://UI/Refilling/RefillingParticles.tscn").instantiate()
|
||||
newParticles.position = Vector2(442, 202)
|
||||
newParticles.set_color(averageColor)
|
||||
newParticles.emitting = true
|
||||
add_child(newParticles)
|
||||
|
||||
func spawn_item_transition(startItem, driedItem):
|
||||
var itemTransition = itemTransitionScene.instantiate()
|
||||
itemTransition.start_transition(startItem.get_sprite(), driedItem.get_sprite())
|
||||
|
||||
itemTransition.transDuration = 0.2
|
||||
itemTransition.finalMomentsDuration = 1.3
|
||||
|
||||
add_child(itemTransition)
|
||||
itemTransition.scale = Vector2(2, 2)
|
||||
itemTransition.position = Vector2(442, 295)
|
||||
|
||||
func filter_inventory(inventory):
|
||||
var filteredInv:Inventory = inventory.duplicate()
|
||||
|
||||
var i = filteredInv.items.size() - 1
|
||||
while i >= 0:
|
||||
var currentItem = filteredInv.items[i]
|
||||
var keepItem = false
|
||||
|
||||
if currentItem.get_name(false) in refillableItemNames:
|
||||
keepItem = true
|
||||
|
||||
if !keepItem:
|
||||
filteredInv.remove_item(currentItem, filteredInv.quantities[i])
|
||||
|
||||
i -= 1
|
||||
|
||||
return filteredInv
|
||||
|
||||
func _on_leave_button_pressed():
|
||||
get_tree().paused = false
|
||||
hide()
|
||||
93
UI/Refilling/RefillingMenu.tscn
Normal file
93
UI/Refilling/RefillingMenu.tscn
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://crynlveb561db"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://dkofjwlcf80gp" path="res://UI/Themes/InteractionPopupTheme.tres" id="1_acf04"]
|
||||
[ext_resource type="Script" path="res://UI/Refilling/RefillingMenu.gd" id="2_tvfn0"]
|
||||
[ext_resource type="Texture2D" uid="uid://ckvdi2mmghhbo" path="res://UI/Refilling/WoodgrainBG.png" id="3_4lk5o"]
|
||||
[ext_resource type="PackedScene" uid="uid://c3ku75p4ep3c7" path="res://UI/Inventory/InventoryDisplayer.tscn" id="3_c2h1g"]
|
||||
[ext_resource type="Texture2D" uid="uid://chxnma7j2hml" path="res://UI/Refilling/RefillingBG.png" id="4_hkc7i"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ih3cm"]
|
||||
bg_color = Color(0.219608, 0.117647, 0.0823529, 0)
|
||||
border_width_left = 4
|
||||
border_width_top = 4
|
||||
border_width_right = 19
|
||||
border_width_bottom = 4
|
||||
border_color = Color(0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ivvwg"]
|
||||
|
||||
[node name="RefillingMenu" type="Window"]
|
||||
process_mode = 3
|
||||
size = Vector2i(600, 500)
|
||||
unresizable = true
|
||||
borderless = true
|
||||
theme = ExtResource("1_acf04")
|
||||
script = ExtResource("2_tvfn0")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
offset_right = 590.0
|
||||
offset_bottom = 8.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_ih3cm")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("3_4lk5o")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
|
||||
custom_minimum_size = Vector2(590, 490)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 11
|
||||
|
||||
[node name="RefillingName" type="Label" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
theme_override_colors/font_color = Color(0.921569, 1, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 9
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Refill Machine"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Inventory" parent="PanelContainer/VBoxContainer/MarginContainer/HBoxContainer" instance=ExtResource("3_c2h1g")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Title" parent="PanelContainer/VBoxContainer/MarginContainer/HBoxContainer/Inventory" index="0"]
|
||||
theme_override_colors/font_color = Color(0.960784, 0.270588, 0.560784, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 8
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
mouse_filter = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_ivvwg")
|
||||
|
||||
[node name="MarginContainer2" type="MarginContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_bottom = 5
|
||||
|
||||
[node name="LeaveButton" type="Button" parent="PanelContainer/VBoxContainer/MarginContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "Leave"
|
||||
|
||||
[node name="RefillingBG" type="Sprite2D" parent="."]
|
||||
position = Vector2(444, 254)
|
||||
texture = ExtResource("4_hkc7i")
|
||||
|
||||
[connection signal="pressed" from="PanelContainer/VBoxContainer/MarginContainer2/LeaveButton" to="." method="_on_leave_button_pressed"]
|
||||
|
||||
[editable path="PanelContainer/VBoxContainer/MarginContainer/HBoxContainer/Inventory"]
|
||||
4
UI/Refilling/RefillingParticles.gd
Normal file
4
UI/Refilling/RefillingParticles.gd
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
extends CPUParticles2D
|
||||
|
||||
func _on_finished():
|
||||
queue_free()
|
||||
18
UI/Refilling/RefillingParticles.tscn
Normal file
18
UI/Refilling/RefillingParticles.tscn
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://byb0p1tx2u0ba"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bb1q5ifwi3o1q" path="res://UI/Refilling/Droplet.png" id="1_edecj"]
|
||||
[ext_resource type="Script" path="res://UI/Refilling/RefillingParticles.gd" id="2_bfar3"]
|
||||
|
||||
[node name="RefillingParticles" type="CPUParticles2D"]
|
||||
position = Vector2(442, 202)
|
||||
emitting = false
|
||||
amount = 60
|
||||
lifetime = 0.52
|
||||
one_shot = true
|
||||
texture = ExtResource("1_edecj")
|
||||
emission_shape = 3
|
||||
emission_rect_extents = Vector2(10, 1)
|
||||
scale_amount_max = 2.5
|
||||
script = ExtResource("2_bfar3")
|
||||
|
||||
[connection signal="finished" from="." to="." method="_on_finished"]
|
||||
BIN
UI/Refilling/WoodgrainBG.aseprite
Normal file
BIN
UI/Refilling/WoodgrainBG.aseprite
Normal file
Binary file not shown.
BIN
UI/Refilling/WoodgrainBG.png
Normal file
BIN
UI/Refilling/WoodgrainBG.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
34
UI/Refilling/WoodgrainBG.png.import
Normal file
34
UI/Refilling/WoodgrainBG.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ckvdi2mmghhbo"
|
||||
path="res://.godot/imported/WoodgrainBG.png-96dac4f74d9ff2bb0df50a7c2378b46a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://UI/Refilling/WoodgrainBG.png"
|
||||
dest_files=["res://.godot/imported/WoodgrainBG.png-96dac4f74d9ff2bb0df50a7c2378b46a.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
|
||||
Loading…
Add table
Add a link
Reference in a new issue