From 797fbfb4fedfe4f9bfe694d1a6b5dc404b88cb97 Mon Sep 17 00:00:00 2001 From: Rendo Date: Wed, 23 Jul 2025 16:54:26 +0500 Subject: [PATCH] aloe balanced --- assets/shaders/radial_progress.gdshader | 4 +++- scenes/entities/plants/aloe.tscn | 18 +++++++++++++++--- .../plants/behaviours/AloeBehaviour.cs | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/assets/shaders/radial_progress.gdshader b/assets/shaders/radial_progress.gdshader index 1840e61..ec7a2c6 100644 --- a/assets/shaders/radial_progress.gdshader +++ b/assets/shaders/radial_progress.gdshader @@ -1,5 +1,7 @@ shader_type canvas_item; void fragment() { - COLOR = vec4(1); + //vec4 text = texture(TEXTURE,UV); + vec3 argg = vec3(distance(vec2(0.5),UV)); + COLOR = vec4(argg,1); } diff --git a/scenes/entities/plants/aloe.tscn b/scenes/entities/plants/aloe.tscn index b158342..d08607d 100644 --- a/scenes/entities/plants/aloe.tscn +++ b/scenes/entities/plants/aloe.tscn @@ -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="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="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://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"] length = 0.001 tracks/0/type = "value" @@ -99,6 +107,7 @@ internal_id = "aloe" MaxHP = 30.0 [node name="Sprite2D" parent="." index="0"] +material = SubResource("ShaderMaterial_8fr1j") position = Vector2(9, -14) texture = ExtResource("2_iup5p") hframes = 8 @@ -118,10 +127,10 @@ parameters/Tree/conditions/heal = false [node name="Behaviour" type="Node" parent="." index="3"] script = ExtResource("4_55asm") -_hpTreshold = 0.33 +_hpTreshold = 0.5 [node name="Timer" type="Timer" parent="Behaviour" index="0" node_paths=PackedStringArray("entity")] -wait_time = 20.0 +wait_time = 15.0 one_shot = true script = ExtResource("5_gfy6j") entity = NodePath("../..") @@ -129,4 +138,7 @@ entity = NodePath("../..") [node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" index="0"] shape = SubResource("RectangleShape2D_oe0dc") +[node name="FlashController" parent="." index="5"] +shaderMaterial = SubResource("ShaderMaterial_8fr1j") + [connection signal="timeout" from="Behaviour/Timer" to="Behaviour" method="OnTimeout"] diff --git a/scripts/entities/plants/behaviours/AloeBehaviour.cs b/scripts/entities/plants/behaviours/AloeBehaviour.cs index c994365..420abf6 100644 --- a/scripts/entities/plants/behaviours/AloeBehaviour.cs +++ b/scripts/entities/plants/behaviours/AloeBehaviour.cs @@ -36,7 +36,7 @@ public partial class AloeBehaviour : BaseBehaviour var checkPos = GetParent().GlobalPosition + Vector2.Right * FieldParams.TileWidth; if (PoolContainer.Instance.TryGetEntity(checkPos, out RuntimePlantData plantData)) { - plantData.Heal(1200 + 0.5f * plantData.MaxHP, GetParent()); + plantData.Heal(300, GetParent()); } }