Compare commits
No commits in common. "feec74fa6533e020de16b9517885790130769cab" and "cfb8527a42687d3a9a65c8b35f80bc71e0b5e87a" have entirely different histories.
feec74fa65
...
cfb8527a42
|
@ -3,9 +3,7 @@
|
|||
[ext_resource type="Script" path="res://BoundingBoxes/Hitbox.cs" id="1_44i8j"]
|
||||
|
||||
[node name="Hitbox" type="Area2D"]
|
||||
collision_layer = 256
|
||||
collision_mask = 769
|
||||
priority = 5
|
||||
priority = 5.0
|
||||
script = ExtResource("1_44i8j")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
[ext_resource type="Script" path="res://BoundingBoxes/Hurtbox.cs" id="1_ov1ss"]
|
||||
|
||||
[node name="Hurtbox" type="Area2D"]
|
||||
collision_layer = 512
|
||||
collision_mask = 769
|
||||
script = ExtResource("1_ov1ss")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
|
|
|
@ -10,6 +10,9 @@ public partial class Doc : Boss
|
|||
|
||||
public AnimationPlayer MiscAnimation { get; set; }
|
||||
|
||||
[Export]
|
||||
public Items.Weapons.Sword Lance { get; set; }
|
||||
|
||||
[Export]
|
||||
public override bool IsActive
|
||||
{
|
||||
|
@ -106,7 +109,7 @@ public partial class Doc : Boss
|
|||
if (name == "Doc")
|
||||
{
|
||||
IsActive = true;
|
||||
Inventory.SelectedItem = GetNode<Items.Item>("%DocLance");
|
||||
Inventory.SelectedItem = Lance;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -119,7 +122,7 @@ public partial class Doc : Boss
|
|||
if (this.GetWorld().CurrentPlayer.IsAlive && !IsActive)
|
||||
{
|
||||
IsActive = true;
|
||||
Inventory.SelectedItem = GetNode<Items.Item>("%DocLance");
|
||||
Inventory.SelectedItem = Lance;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=72 format=3 uid="uid://d2skjvvx6fal0"]
|
||||
[gd_scene load_steps=71 format=3 uid="uid://d2skjvvx6fal0"]
|
||||
|
||||
[ext_resource type="Script" path="res://Characters/Doc.cs" id="2_3elet"]
|
||||
[ext_resource type="Shader" path="res://Shaders/Flash.gdshader" id="2_5jxom"]
|
||||
|
@ -568,16 +568,14 @@ size = Vector2(16, 19)
|
|||
[sub_resource type="CircleShape2D" id="CircleShape2D_8hwat"]
|
||||
radius = 16.0
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_kap5k"]
|
||||
radius = 48.0
|
||||
|
||||
[node name="Doc" type="CharacterBody2D" node_paths=PackedStringArray("BossStateMachine", "DefaultSelectedItem", "ThinkerStateMachine", "Stats", "Sprite", "Inventory", "StateMachine", "Hurtbox")]
|
||||
[node name="Doc" type="CharacterBody2D" node_paths=PackedStringArray("Lance", "BossStateMachine", "DefaultSelectedItem", "ThinkerStateMachine", "Stats", "Sprite", "Inventory", "StateMachine", "Hurtbox")]
|
||||
y_sort_enabled = true
|
||||
texture_filter = 3
|
||||
material = SubResource("ShaderMaterial_7n7iy")
|
||||
collision_layer = 10
|
||||
collision_mask = 17
|
||||
script = ExtResource("2_3elet")
|
||||
Lance = NodePath("Inventory/DocLance")
|
||||
BossStateMachine = NodePath("BossStateMachine")
|
||||
BossName = "Doc, The Two-Time"
|
||||
Music = ExtResource("3_qnxmu")
|
||||
|
@ -700,9 +698,8 @@ InitialState = NodePath("Attack")
|
|||
script = ExtResource("21_ij3bp")
|
||||
NPC = NodePath("../..")
|
||||
|
||||
[node name="DashDefensive" type="Node" parent="ThinkerStateMachine" node_paths=PackedStringArray("ProjectileDetection", "NPC")]
|
||||
[node name="DashDefensive" type="Node" parent="ThinkerStateMachine" node_paths=PackedStringArray("NPC")]
|
||||
script = ExtResource("20_12htp")
|
||||
ProjectileDetection = NodePath("../../ProjectileDetection")
|
||||
MaxDistanceToTarget = 256.0
|
||||
UseItemDistance = 64.0
|
||||
NPC = NodePath("../..")
|
||||
|
@ -823,13 +820,5 @@ offset_bottom = -14.0
|
|||
[node name="Label" parent="InteractionTrigger/Popup" index="0"]
|
||||
text = "Duel"
|
||||
|
||||
[node name="ProjectileDetection" type="Area2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
collision_layer = 0
|
||||
collision_mask = 256
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="ProjectileDetection"]
|
||||
shape = SubResource("CircleShape2D_kap5k")
|
||||
|
||||
[editable path="Hurtbox"]
|
||||
[editable path="InteractionTrigger"]
|
||||
|
|
|
@ -838,6 +838,11 @@ y_sort_enabled = true
|
|||
script = ExtResource("30_y2wmw")
|
||||
Hotbar = [null, null, null]
|
||||
Items = Array[Object]([ExtResource("33_3qyfl"), ExtResource("34_70ron"), ExtResource("35_4pap1")])
|
||||
InventoryMap = {
|
||||
"equip_1": 0,
|
||||
"equip_2": 1,
|
||||
"equip_3": 2
|
||||
}
|
||||
|
||||
[node name="Hurtbox" parent="." node_paths=PackedStringArray("InvincibilityTimer") instance=ExtResource("9_avyu4")]
|
||||
visible = false
|
||||
|
|
|
@ -39,6 +39,7 @@ texture = ExtResource("1_0im1r")
|
|||
centered = false
|
||||
|
||||
[node name="Hitbox" parent="." instance=ExtResource("3_f4lib")]
|
||||
priority = 5
|
||||
|
||||
[node name="CollisionShape2D" parent="Hitbox" index="0"]
|
||||
position = Vector2(0, -0.5)
|
||||
|
|
|
@ -9,49 +9,14 @@ public partial class DashDefensive : AttackState
|
|||
protected bool _dashedAway = false;
|
||||
protected State.Character.CharacterDashState _dashState;
|
||||
protected float _originalDashModifier;
|
||||
private Callable _dodgeCallable;
|
||||
|
||||
[Export]
|
||||
public Area2D ProjectileDetection { get; set; }
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_dashState = NPC.StateMachine.FindChildOfType<CharacterDashState>();
|
||||
_originalDashModifier = _dashState.VelocityModifier;
|
||||
_dodgeCallable = new Callable(this, MethodName.DodgeProjectile);
|
||||
|
||||
base._Ready();
|
||||
}
|
||||
|
||||
public override IState<ThinkerState> Enter(IState<ThinkerState> prev)
|
||||
{
|
||||
ProjectileDetection?.Connect(Area2D.SignalName.AreaEntered,
|
||||
_dodgeCallable);
|
||||
|
||||
return base.Enter(prev);
|
||||
}
|
||||
|
||||
public override void Exit(IState<ThinkerState> prev)
|
||||
{
|
||||
ProjectileDetection?.Disconnect(Area2D.SignalName.AreaEntered,
|
||||
_dodgeCallable);
|
||||
|
||||
base.Exit(prev);
|
||||
}
|
||||
|
||||
private void DodgeProjectile(Area2D area)
|
||||
{
|
||||
if (area is BoundingBoxes.Hitbox hitbox)
|
||||
{
|
||||
if (hitbox.GetOwner() is Entities.Projectile projectile)
|
||||
{
|
||||
GD.Print("changing direction");
|
||||
var direction = projectile.Direction;
|
||||
DashTo(direction.Rotated(Mathf.Pi / 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override ThinkerState Think()
|
||||
{
|
||||
Characters.Character bestTarget = NPC.FindBestTarget();
|
||||
|
|
Loading…
Reference in New Issue