Initial commit

This commit is contained in:
2026-01-17 18:33:45 -06:00
commit 673bdc0396
45 changed files with 856 additions and 0 deletions

10
Abilities/Fireball.cs Normal file
View File

@@ -0,0 +1,10 @@
using Godot;
using System;
public partial class Fireball : ProjectileBase
{
public override void _PhysicsProcess(double delta)
{
Position += Transform.X * Speed * (float)delta;
}
}

View File

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

BIN
Abilities/Fireball.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://mesi0bfnca6y"
path="res://.godot/imported/Fireball.png-86123da5fd3d9a12514f31908427d9dd.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Abilities/Fireball.png"
dest_files=["res://.godot/imported/Fireball.png-86123da5fd3d9a12514f31908427d9dd.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

19
Abilities/Fireball.tscn Normal file
View File

@@ -0,0 +1,19 @@
[gd_scene load_steps=4 format=3 uid="uid://bc7omt6pay1lx"]
[ext_resource type="Script" uid="uid://tt0u7f0gemjo" path="res://Abilities/Fireball.cs" id="1_0kqim"]
[ext_resource type="Texture2D" uid="uid://mesi0bfnca6y" path="res://Abilities/Fireball.png" id="2_rf7by"]
[sub_resource type="CircleShape2D" id="CircleShape2D_nvq50"]
radius = 6.0
[node name="Fireball" type="Area2D"]
script = ExtResource("1_0kqim")
Speed = 700.0
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_rf7by")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_nvq50")
[connection signal="body_entered" from="." to="." method="OnBodyEntered"]

34
Abilities/Fireballv2.cs Normal file
View File

@@ -0,0 +1,34 @@
using Godot;
using System;
public partial class Fireballv2 : ProjectileBase
{
[Export] public float TurnRate { get; set; }
[Export] public float OrbitStrength { get; set; }
Vector2 _velocity;
public override void _Ready()
{
var direction = (GetGlobalMousePosition() - GlobalPosition).Normalized();
_velocity = direction * Speed;
Rotation = _velocity.Angle();
}
public override void _PhysicsProcess(double delta)
{
var targetDirection = (GetGlobalMousePosition() - GlobalPosition).Normalized();
var perp = targetDirection.Orthogonal();
targetDirection = (targetDirection + perp * OrbitStrength).Normalized();
var currentDirection = _velocity.Normalized();
var angle = currentDirection.AngleTo(targetDirection);
var maxTurn = TurnRate * (float)delta;
angle = Mathf.Clamp(angle, -maxTurn, maxTurn);
_velocity = _velocity.Rotated(angle);
GlobalPosition += _velocity * (float)delta;
Rotation = _velocity.Angle();
}
}

View File

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

20
Abilities/Fireballv2.tscn Normal file
View File

@@ -0,0 +1,20 @@
[gd_scene load_steps=4 format=3 uid="uid://dhobg02glafch"]
[ext_resource type="Script" uid="uid://c4cmav4r8i83e" path="res://Abilities/Fireballv2.cs" id="1_8mjwt"]
[ext_resource type="Texture2D" uid="uid://mesi0bfnca6y" path="res://Abilities/Fireball.png" id="2_0w1e3"]
[sub_resource type="CircleShape2D" id="CircleShape2D_nvq50"]
radius = 6.0
[node name="Fireballv2" type="Area2D"]
script = ExtResource("1_8mjwt")
TurnRate = 8.0
Speed = 500.0
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_0w1e3")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_nvq50")
[connection signal="body_entered" from="." to="." method="OnBodyEntered"]

29
Abilities/Fireballv3.cs Normal file
View File

@@ -0,0 +1,29 @@
using Godot;
using System;
public partial class Fireballv3 : ProjectileBase
{
[Export] public float TurnSpeed { get; set; }
Vector2 _velocity;
public override void _Ready()
{
base._Ready();
var direction = (GetGlobalMousePosition() - GlobalPosition).Normalized();
_velocity = direction * Speed;
Rotation = _velocity.Angle();
}
public override void _PhysicsProcess(double delta)
{
var targetDirection = (GetGlobalMousePosition() - GlobalPosition).Normalized();
var currentDirection = _velocity.Normalized();
var newDirection = currentDirection.Lerp(targetDirection, TurnSpeed * (float)delta).Normalized();
_velocity = newDirection * Speed;
GlobalPosition += _velocity * (float)delta;
Rotation = _velocity.Angle();
}
}

View File

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

20
Abilities/Fireballv3.tscn Normal file
View File

@@ -0,0 +1,20 @@
[gd_scene load_steps=4 format=3 uid="uid://b2u2xirxjo68h"]
[ext_resource type="Script" uid="uid://bwwxti5v178gx" path="res://Abilities/Fireballv3.cs" id="1_8c7o3"]
[ext_resource type="Texture2D" uid="uid://mesi0bfnca6y" path="res://Abilities/Fireball.png" id="2_aknci"]
[sub_resource type="CircleShape2D" id="CircleShape2D_nvq50"]
radius = 6.0
[node name="Fireballv3" type="Area2D"]
script = ExtResource("1_8c7o3")
TurnSpeed = 8.0
Speed = 500.0
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_aknci")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_nvq50")
[connection signal="body_entered" from="." to="." method="OnBodyEntered"]

20
Abilities/MeleeBase.cs Normal file
View File

@@ -0,0 +1,20 @@
using Godot;
public abstract partial class MeleeBase : Area2D
{
protected CharacterBase? Character;
public override void _Ready()
{
if (Character is null)
{
QueueFree();
}
}
public void Spawn(CharacterBase character)
{
Character = character;
Rotation = character.FacingRotation;
}
}

View File

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

View File

@@ -0,0 +1,35 @@
using Godot;
public partial class ProjectileBase : Area2D
{
[Export] public float Speed { get; set; }
protected CharacterBase? Character;
public override void _Ready()
{
if (Character is null)
{
QueueFree();
}
}
void OnBodyEntered(Node body)
{
if (body == Character)
{
// Ignore self
return;
}
QueueFree();
}
public void Spawn(CharacterBase character)
{
Character = character;
Position = character.GlobalPosition;
Rotation = character.FacingRotation;
TopLevel = false;
}
}

View File

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

34
Abilities/Sword/Sword.cs Normal file
View File

@@ -0,0 +1,34 @@
using Godot;
using System;
public partial class Sword : MeleeBase
{
[Export] public float SweepArcDegrees { get; set; } = 90f;
[Export] public float Lifetime { get; set; } = 0.25f;
float _elapsedTime = 0f;
float _startRotation, _endRotation;
public override void _Ready()
{
base._Ready();
_startRotation = Rotation + Mathf.DegToRad(-SweepArcDegrees * 0.5f);
_endRotation = Rotation + Mathf.DegToRad(SweepArcDegrees * 0.5f);
Rotation = _startRotation;
}
public override void _PhysicsProcess(double delta)
{
_elapsedTime += (float)delta;
var t = _elapsedTime / Lifetime;
Rotation = Mathf.Lerp(_startRotation, _endRotation, t);
if (_elapsedTime >= Lifetime)
{
QueueFree();
}
}
}

View File

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

BIN
Abilities/Sword/Sword.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 B

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://8iyfaq0a52a2"
path="res://.godot/imported/Sword.png-99830bfad10ffac3bbbde6d72e00388c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Abilities/Sword/Sword.png"
dest_files=["res://.godot/imported/Sword.png-99830bfad10ffac3bbbde6d72e00388c.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

View File

@@ -0,0 +1,16 @@
[gd_scene load_steps=3 format=3 uid="uid://bqiniro3w8jom"]
[ext_resource type="Texture2D" uid="uid://8iyfaq0a52a2" path="res://Abilities/Sword/Sword.png" id="1_0u6wf"]
[ext_resource type="Script" uid="uid://dgcyfw7bpt67q" path="res://Abilities/Sword/Sword.cs" id="1_aoixy"]
[node name="Sword" type="Area2D"]
script = ExtResource("1_aoixy")
[node name="Sprite" type="Sprite2D" parent="."]
position = Vector2(9, -4.7683716e-07)
rotation = 2.3561945
texture = ExtResource("1_0u6wf")
[node name="Collision" type="CollisionPolygon2D" parent="."]
position = Vector2(0, -7.5)
polygon = PackedVector2Array(21, 7.5, 18, 10.5, 6, 10.5, 6, 4.5, 18, 4.5)