added project with nerabochie cows

This commit is contained in:
arrrtemida
2025-08-22 17:16:22 +05:00
commit 0d3f195aff
147 changed files with 5060 additions and 0 deletions

View File

@ -0,0 +1,9 @@
class_name CollectableComponent
extends Area2D
@export var collectable_name : String
func _on_body_entered(body: Node2D) -> void:
if body is Player:
print("Collected")
get_parent().queue_free()

View File

@ -0,0 +1 @@
uid://dwlg7rbe070vb

View File

@ -0,0 +1,10 @@
[gd_scene load_steps=2 format=3 uid="uid://dk2en4pak8e6f"]
[ext_resource type="Script" uid="uid://dwlg7rbe070vb" path="res://scenes/components/collectable_component.gd" id="1_14mdg"]
[node name="CollectableComponent" type="Area2D"]
collision_layer = 32
collision_mask = 2
script = ExtResource("1_14mdg")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@ -0,0 +1,13 @@
class_name DamageComponent
extends Node2D
@export var max_damage = 1
@export var current_damage = 0
signal max_damaged_reached
func apply_damage(damage: int) -> void:
current_damage = clamp(current_damage + damage, 0, max_damage)
if current_damage == max_damage:
max_damaged_reached.emit()

View File

@ -0,0 +1 @@
uid://dabtkv831n7fm

View File

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://cd3awkrirej8q"]
[ext_resource type="Script" uid="uid://dabtkv831n7fm" path="res://scenes/components/damage_component.gd" id="1_am71n"]
[node name="DamageComponent" type="Node2D"]
script = ExtResource("1_am71n")

View File

@ -0,0 +1,5 @@
class_name HitComponent
extends Area2D
@export var current_tool : DataTypes.Tools = DataTypes.Tools.None
@export var hit_damage : int = 1

View File

@ -0,0 +1 @@
uid://tetr72as3jkf

View File

@ -0,0 +1,8 @@
[gd_scene load_steps=2 format=3 uid="uid://04bcami5g18j"]
[ext_resource type="Script" uid="uid://tetr72as3jkf" path="res://scenes/components/hit_component.gd" id="1_t7wh5"]
[node name="HitComponent" type="Area2D"]
collision_layer = 8
collision_mask = 16
script = ExtResource("1_t7wh5")

View File

@ -0,0 +1,12 @@
class_name HurtComponent
extends Area2D
@export var tool : DataTypes.Tools = DataTypes.Tools.None
signal hurt
func _on_area_entered(area: Area2D) -> void:
var hit_component = area as HitComponent
if tool == hit_component.current_tool:
hurt.emit(hit_component.hit_damage)

View File

@ -0,0 +1 @@
uid://b24ulc41sykw5

View File

@ -0,0 +1,10 @@
[gd_scene load_steps=2 format=3 uid="uid://c82ghkmm1uxfp"]
[ext_resource type="Script" uid="uid://b24ulc41sykw5" path="res://scenes/components/hurt_component.gd" id="1_d1uqi"]
[node name="HurtComponent" type="Area2D"]
collision_layer = 16
collision_mask = 8
script = ExtResource("1_d1uqi")
[connection signal="area_entered" from="." to="." method="_on_area_entered"]

View File

@ -0,0 +1,15 @@
class_name InteractableComponent
extends Area2D
signal interactable_activated
signal interactable_deactivated
func _on_body_entered(body: Node2D) -> void:
interactable_activated.emit()
func _on_body_exited(body: Node2D) -> void:
interactable_deactivated.emit()

View File

@ -0,0 +1 @@
uid://clqjplcd1qock

View File

@ -0,0 +1,11 @@
[gd_scene load_steps=2 format=3 uid="uid://d3iqdpvqhfyf5"]
[ext_resource type="Script" uid="uid://clqjplcd1qock" path="res://scenes/components/interactable_component.gd" id="1_onphe"]
[node name="InteractableComponent" type="Area2D"]
collision_layer = 4
collision_mask = 2
script = ExtResource("1_onphe")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="body_exited" from="." to="." method="_on_body_exited"]