Compare commits
	
		
			3 Commits 
		
	
	
		
			cfb8527a42
			...
			feec74fa65
		
	
	| Author | SHA1 | Date | 
|---|---|---|
| 
							
							
								
									
								
								 | 
						feec74fa65 | |
| 
							
							
								
									
								
								 | 
						b54ce905ab | |
| 
							
							
								
									
								
								 | 
						ec5204c452 | 
| 
						 | 
				
			
			@ -3,7 +3,9 @@
 | 
			
		|||
[ext_resource type="Script" path="res://BoundingBoxes/Hitbox.cs" id="1_44i8j"]
 | 
			
		||||
 | 
			
		||||
[node name="Hitbox" type="Area2D"]
 | 
			
		||||
priority = 5.0
 | 
			
		||||
collision_layer = 256
 | 
			
		||||
collision_mask = 769
 | 
			
		||||
priority = 5
 | 
			
		||||
script = ExtResource("1_44i8j")
 | 
			
		||||
 | 
			
		||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,6 +3,8 @@
 | 
			
		|||
[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,9 +10,6 @@ public partial class Doc : Boss
 | 
			
		|||
 | 
			
		||||
    public AnimationPlayer MiscAnimation { get; set; }
 | 
			
		||||
 | 
			
		||||
    [Export]
 | 
			
		||||
    public Items.Weapons.Sword Lance { get; set; }
 | 
			
		||||
 | 
			
		||||
    [Export]
 | 
			
		||||
    public override bool IsActive
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -109,7 +106,7 @@ public partial class Doc : Boss
 | 
			
		|||
            if (name == "Doc")
 | 
			
		||||
            {
 | 
			
		||||
                IsActive = true;
 | 
			
		||||
                Inventory.SelectedItem = Lance;
 | 
			
		||||
                Inventory.SelectedItem = GetNode<Items.Item>("%DocLance");
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -122,7 +119,7 @@ public partial class Doc : Boss
 | 
			
		|||
            if (this.GetWorld().CurrentPlayer.IsAlive && !IsActive)
 | 
			
		||||
            {
 | 
			
		||||
                IsActive = true;
 | 
			
		||||
                Inventory.SelectedItem = Lance;
 | 
			
		||||
                Inventory.SelectedItem = GetNode<Items.Item>("%DocLance");
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
[gd_scene load_steps=71 format=3 uid="uid://d2skjvvx6fal0"]
 | 
			
		||||
[gd_scene load_steps=72 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,14 +568,16 @@ size = Vector2(16, 19)
 | 
			
		|||
[sub_resource type="CircleShape2D" id="CircleShape2D_8hwat"]
 | 
			
		||||
radius = 16.0
 | 
			
		||||
 | 
			
		||||
[node name="Doc" type="CharacterBody2D" node_paths=PackedStringArray("Lance", "BossStateMachine", "DefaultSelectedItem", "ThinkerStateMachine", "Stats", "Sprite", "Inventory", "StateMachine", "Hurtbox")]
 | 
			
		||||
[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")]
 | 
			
		||||
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")
 | 
			
		||||
| 
						 | 
				
			
			@ -698,8 +700,9 @@ InitialState = NodePath("Attack")
 | 
			
		|||
script = ExtResource("21_ij3bp")
 | 
			
		||||
NPC = NodePath("../..")
 | 
			
		||||
 | 
			
		||||
[node name="DashDefensive" type="Node" parent="ThinkerStateMachine" node_paths=PackedStringArray("NPC")]
 | 
			
		||||
[node name="DashDefensive" type="Node" parent="ThinkerStateMachine" node_paths=PackedStringArray("ProjectileDetection", "NPC")]
 | 
			
		||||
script = ExtResource("20_12htp")
 | 
			
		||||
ProjectileDetection = NodePath("../../ProjectileDetection")
 | 
			
		||||
MaxDistanceToTarget = 256.0
 | 
			
		||||
UseItemDistance = 64.0
 | 
			
		||||
NPC = NodePath("../..")
 | 
			
		||||
| 
						 | 
				
			
			@ -820,5 +823,13 @@ 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,11 +838,6 @@ 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,7 +39,6 @@ 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,14 +9,49 @@ 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