aloe balanced

This commit is contained in:
Rendo 2025-07-23 16:54:26 +05:00
commit 797fbfb4fe
3 changed files with 19 additions and 5 deletions

View file

@ -1,5 +1,7 @@
shader_type canvas_item; shader_type canvas_item;
void fragment() { void fragment() {
COLOR = vec4(1); //vec4 text = texture(TEXTURE,UV);
vec3 argg = vec3(distance(vec2(0.5),UV));
COLOR = vec4(argg,1);
} }

View file

@ -1,11 +1,19 @@
[gd_scene load_steps=21 format=3 uid="uid://bw1w8jp0yeypy"] [gd_scene load_steps=23 format=3 uid="uid://bw1w8jp0yeypy"]
[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_n25yi"] [ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_n25yi"]
[ext_resource type="Shader" uid="uid://cgc7spjkhsx7c" path="res://assets/shaders/generic_flash.gdshader" id="2_dm0tl"]
[ext_resource type="Texture2D" uid="uid://b6tyoa5htapir" path="res://assets/sprites/atlases/plants/aloe.png" id="2_iup5p"] [ext_resource type="Texture2D" uid="uid://b6tyoa5htapir" path="res://assets/sprites/atlases/plants/aloe.png" id="2_iup5p"]
[ext_resource type="AnimationLibrary" uid="uid://bgutjc3ruq27s" path="res://assets/animations/plants/aloe.res" id="3_3sp3b"] [ext_resource type="AnimationLibrary" uid="uid://bgutjc3ruq27s" path="res://assets/animations/plants/aloe.res" id="3_3sp3b"]
[ext_resource type="Script" uid="uid://cljytsmqac0w7" path="res://scripts/entities/plants/behaviours/AloeBehaviour.cs" id="4_55asm"] [ext_resource type="Script" uid="uid://cljytsmqac0w7" path="res://scripts/entities/plants/behaviours/AloeBehaviour.cs" id="4_55asm"]
[ext_resource type="Script" uid="uid://c4jy0cnbnx33h" path="res://scripts/TimeScalableTimer.cs" id="5_gfy6j"] [ext_resource type="Script" uid="uid://c4jy0cnbnx33h" path="res://scripts/TimeScalableTimer.cs" id="5_gfy6j"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_8fr1j"]
resource_local_to_scene = true
shader = ExtResource("2_dm0tl")
shader_parameter/FLASH_COLOR = Color(1, 0.709804, 0.439216, 0.5)
shader_parameter/selected = false
shader_parameter/blend = 0.0
[sub_resource type="Animation" id="Animation_vknky"] [sub_resource type="Animation" id="Animation_vknky"]
length = 0.001 length = 0.001
tracks/0/type = "value" tracks/0/type = "value"
@ -99,6 +107,7 @@ internal_id = "aloe"
MaxHP = 30.0 MaxHP = 30.0
[node name="Sprite2D" parent="." index="0"] [node name="Sprite2D" parent="." index="0"]
material = SubResource("ShaderMaterial_8fr1j")
position = Vector2(9, -14) position = Vector2(9, -14)
texture = ExtResource("2_iup5p") texture = ExtResource("2_iup5p")
hframes = 8 hframes = 8
@ -118,10 +127,10 @@ parameters/Tree/conditions/heal = false
[node name="Behaviour" type="Node" parent="." index="3"] [node name="Behaviour" type="Node" parent="." index="3"]
script = ExtResource("4_55asm") script = ExtResource("4_55asm")
_hpTreshold = 0.33 _hpTreshold = 0.5
[node name="Timer" type="Timer" parent="Behaviour" index="0" node_paths=PackedStringArray("entity")] [node name="Timer" type="Timer" parent="Behaviour" index="0" node_paths=PackedStringArray("entity")]
wait_time = 20.0 wait_time = 15.0
one_shot = true one_shot = true
script = ExtResource("5_gfy6j") script = ExtResource("5_gfy6j")
entity = NodePath("../..") entity = NodePath("../..")
@ -129,4 +138,7 @@ entity = NodePath("../..")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" index="0"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" index="0"]
shape = SubResource("RectangleShape2D_oe0dc") shape = SubResource("RectangleShape2D_oe0dc")
[node name="FlashController" parent="." index="5"]
shaderMaterial = SubResource("ShaderMaterial_8fr1j")
[connection signal="timeout" from="Behaviour/Timer" to="Behaviour" method="OnTimeout"] [connection signal="timeout" from="Behaviour/Timer" to="Behaviour" method="OnTimeout"]

View file

@ -36,7 +36,7 @@ public partial class AloeBehaviour : BaseBehaviour
var checkPos = GetParent<Node2D>().GlobalPosition + Vector2.Right * FieldParams.TileWidth; var checkPos = GetParent<Node2D>().GlobalPosition + Vector2.Right * FieldParams.TileWidth;
if (PoolContainer.Instance.TryGetEntity(checkPos, out RuntimePlantData plantData)) if (PoolContainer.Instance.TryGetEntity(checkPos, out RuntimePlantData plantData))
{ {
plantData.Heal(1200 + 0.5f * plantData.MaxHP, GetParent()); plantData.Heal(300, GetParent());
} }
} }