Make arrows remain on fire if bow was set on fire
parent
c8e21d3642
commit
fad5370c20
|
@ -16,7 +16,14 @@ public partial class Bow : ProjectileSpawner
|
|||
|
||||
if (_isOnFire)
|
||||
{
|
||||
GetNode<AnimatedSprite2D>("%Flame").Visible = false;
|
||||
var flame = GetNode<AnimatedSprite2D>("%Flame");
|
||||
|
||||
var newFlame = flame.Duplicate() as Node2D;
|
||||
projectile.AddChild(newFlame);
|
||||
|
||||
newFlame.Position = Vector2.Zero;
|
||||
|
||||
flame.Visible = false;
|
||||
// TODO: instead of doing 1.5x damage, create an "On Fire" debuff
|
||||
projectile.Hitbox.Damage *= 1.5f;
|
||||
_isOnFire = false;
|
||||
|
@ -30,6 +37,8 @@ public partial class Bow : ProjectileSpawner
|
|||
base._Ready();
|
||||
_ignitionArea = GetNode<Area2D>("IgnitionArea");
|
||||
var onAreaEntered = (Area2D area) =>
|
||||
{
|
||||
if (!_isOnFire)
|
||||
{
|
||||
var flame = GetNode<AnimatedSprite2D>("%Flame");
|
||||
flame.Visible = true;
|
||||
|
@ -37,6 +46,7 @@ public partial class Bow : ProjectileSpawner
|
|||
.OnWorld()
|
||||
.PlayOneShot();
|
||||
_isOnFire = true;
|
||||
}
|
||||
};
|
||||
_ignitionArea.Connect(
|
||||
Area2D.SignalName.AreaEntered,
|
||||
|
|
|
@ -95,7 +95,7 @@ tracks/1/keys = {
|
|||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(15, -8)]
|
||||
"values": [Vector2(15, -4)]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
|
@ -166,7 +166,7 @@ tracks/2/keys = {
|
|||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(15, -8)]
|
||||
"values": [Vector2(15, -4)]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
|
@ -221,7 +221,7 @@ tracks/2/keys = {
|
|||
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [Vector2(15, -8), Vector2(14, -8), Vector2(13, -8), Vector2(12, -8), Vector2(11, -8), Vector2(9, -8)]
|
||||
"values": [Vector2(15, -4), Vector2(14, -4), Vector2(13, -4), Vector2(12, -4), Vector2(11, -4), Vector2(9, -4)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_j5qtq"]
|
||||
|
@ -263,7 +263,7 @@ tracks/2/keys = {
|
|||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(15, -8)]
|
||||
"values": [Vector2(15, -4)]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
|
@ -372,9 +372,11 @@ hframes = 8
|
|||
unique_name_in_owner = true
|
||||
visible = false
|
||||
modulate = Color(3, 3, 3, 1)
|
||||
position = Vector2(15, -8)
|
||||
position = Vector2(15, -4)
|
||||
sprite_frames = SubResource("SpriteFrames_b2khh")
|
||||
autoplay = "default"
|
||||
frame_progress = 0.1652
|
||||
offset = Vector2(0, -4)
|
||||
|
||||
[node name="PointLight2D" type="PointLight2D" parent="Anchor/Flame"]
|
||||
color = Color(1, 0.8, 0.701961, 1)
|
||||
|
|
Loading…
Reference in New Issue