added friendly and neutral peg, added disposition

This commit is contained in:
2026-06-29 18:11:28 -04:00
parent ebdff1b200
commit 982c3e6786
16 changed files with 171 additions and 25 deletions
+3 -1
View File
@@ -7,6 +7,7 @@ public partial class BasicMovement : PegAction
public override void _Ready()
{
base._Ready();
_priority = 0;
_healthChange = 0;
_cost = 1;
_range = 2^32;
@@ -24,11 +25,12 @@ public partial class BasicMovement : PegAction
return null;
}
Vector2I cell = path[0];
map.SetCellPeg(cell, PEG);
PEG._path.Add(cell);
Tween subtween = CreateTween();
subtween.TweenProperty(this, "global_position", map.GetCellPositionFromAddress(cell), 0.25f);
subtween.TweenProperty(PEG, "global_position", map.GetCellPositionFromAddress(cell), 0.25f);
return subtween;
}
+1
View File
@@ -7,6 +7,7 @@ public partial class Shortbow : PegAction
public override void _Ready()
{
base._Ready();
_priority = 1;
_healthChange = -1;
_cost = 2;
_range = 1;
+3 -1
View File
@@ -7,6 +7,7 @@ public partial class Shortsword : PegAction
public override void _Ready()
{
base._Ready();
_priority = 1;
_healthChange = -2;
_cost = 2;
_range = 0;
@@ -16,7 +17,8 @@ public partial class Shortsword : PegAction
public override Tween CreateAnimation(Peg PEG)
{
Vector2 target = Vector2.Up * PEG._pegController._playArea._map._cellSize;
Vector2 target = PEG._disposition * Vector2.Up * PEG._pegController._playArea._map._cellSize;
GD.Print(target);
Tween subtween = CreateTween();
subtween.TweenProperty(_image, "visible", true, 0.0f);
subtween.TweenProperty(_image, "position", target, 0.5f);
+13
View File
@@ -0,0 +1,13 @@
using Godot;
using System;
public partial class FriendlyPeg : Peg
{
public override void _Ready()
{
base._Ready();
_disposition = 1;
}
}
+1
View File
@@ -0,0 +1 @@
uid://fxx1mrrxxqip
+1
View File
@@ -10,6 +10,7 @@ public partial class HostilePeg : Peg
public override void _Ready()
{
base._Ready();
_disposition = -1;
}
}
+3 -3
View File
@@ -28,12 +28,12 @@ texture_filter = 1
scale = Vector2(0.5, 0.5)
texture = ExtResource("2_j7but")
[node name="Actions" type="Node" parent="." unique_id=614093526]
[node name="BasicMovement" parent="Actions" unique_id=460007250 instance=ExtResource("3_j7but")]
[node name="Actions" type="Node2D" parent="." unique_id=96111050]
[node name="Shortbow" parent="Actions" unique_id=518048625 instance=ExtResource("3_c81uf")]
[node name="BasicMovement" parent="Actions" unique_id=460007250 instance=ExtResource("3_j7but")]
[node name="HoverBounds" type="Area2D" parent="." unique_id=937525982]
[node name="CollisionShape2D" type="CollisionShape2D" parent="HoverBounds" unique_id=2142666816]
+1 -1
View File
@@ -28,7 +28,7 @@ texture_filter = 1
scale = Vector2(0.5, 0.5)
texture = ExtResource("2_b77ka")
[node name="Actions" type="Node" parent="." unique_id=2081138574]
[node name="Actions" type="Node2D" parent="." unique_id=1442443799]
[node name="Shortsword" parent="Actions" unique_id=518048625 instance=ExtResource("3_lwlv5")]
+13
View File
@@ -0,0 +1,13 @@
using Godot;
using System;
public partial class NeutralPeg : Peg
{
public override void _Ready()
{
base._Ready();
_disposition = 0;
}
}
+1
View File
@@ -0,0 +1 @@
uid://hcna8x41gtkq
+36
View File
@@ -0,0 +1,36 @@
[gd_scene format=3 uid="uid://tym3gfecxnhf"]
[ext_resource type="Script" uid="uid://fxx1mrrxxqip" path="res://Pegs/FriendlyPeg.cs" id="1_d26yj"]
[ext_resource type="Texture2D" uid="uid://nwj4n7if8kqd" path="res://Art/circle25r.png" id="1_q81kk"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_7k104"]
bounce = 0.5
[sub_resource type="CircleShape2D" id="CircleShape2D_4gyqm"]
radius = 12.5
[sub_resource type="CircleShape2D" id="CircleShape2D_6w6fg"]
radius = 12.5
[node name="FriendlyPeg" type="StaticBody2D" unique_id=1417697759]
input_pickable = true
physics_material_override = SubResource("PhysicsMaterial_7k104")
script = ExtResource("1_d26yj")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1762191899]
shape = SubResource("CircleShape2D_4gyqm")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1941012605]
texture_filter = 1
scale = Vector2(0.5, 0.5)
texture = ExtResource("1_q81kk")
[node name="Actions" type="Node2D" parent="." unique_id=2023031702]
[node name="HoverBounds" type="Area2D" parent="." unique_id=937525982]
[node name="CollisionShape2D" type="CollisionShape2D" parent="HoverBounds" unique_id=2142666816]
shape = SubResource("CircleShape2D_6w6fg")
[connection signal="mouse_entered" from="." to="." method="OnMouseEntered"]
[connection signal="mouse_exited" from="." to="." method="OnMouseExited"]
+1 -1
View File
@@ -25,7 +25,7 @@ texture_filter = 1
scale = Vector2(0.5, 0.5)
texture = ExtResource("2_0icqg")
[node name="Actions" type="Node" parent="." unique_id=218609326]
[node name="Actions" type="Node2D" parent="." unique_id=2023031702]
[node name="HoverBounds" type="Area2D" parent="." unique_id=937525982]
+36
View File
@@ -0,0 +1,36 @@
[gd_scene format=3 uid="uid://d3jw2bvkr8ahq"]
[ext_resource type="Texture2D" uid="uid://nwj4n7if8kqd" path="res://Art/circle25r.png" id="1_bdrbe"]
[ext_resource type="Script" uid="uid://hcna8x41gtkq" path="res://Pegs/NeutralPeg.cs" id="1_vrgbl"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_7k104"]
bounce = 0.5
[sub_resource type="CircleShape2D" id="CircleShape2D_4gyqm"]
radius = 12.5
[sub_resource type="CircleShape2D" id="CircleShape2D_6w6fg"]
radius = 12.5
[node name="NeutralPeg" type="StaticBody2D" unique_id=1417697759]
input_pickable = true
physics_material_override = SubResource("PhysicsMaterial_7k104")
script = ExtResource("1_vrgbl")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1762191899]
shape = SubResource("CircleShape2D_4gyqm")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1941012605]
texture_filter = 1
scale = Vector2(0.5, 0.5)
texture = ExtResource("1_bdrbe")
[node name="Actions" type="Node2D" parent="." unique_id=2023031702]
[node name="HoverBounds" type="Area2D" parent="." unique_id=937525982]
[node name="CollisionShape2D" type="CollisionShape2D" parent="HoverBounds" unique_id=2142666816]
shape = SubResource("CircleShape2D_6w6fg")
[connection signal="mouse_entered" from="." to="." method="OnMouseEntered"]
[connection signal="mouse_exited" from="." to="." method="OnMouseExited"]