Add secondary attack options
This commit is contained in:
@@ -25,7 +25,7 @@ metadata/_custom_type_script = ExtResource("4_5eid5")
|
|||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_qbmfg"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_qbmfg"]
|
||||||
height = 1.5
|
height = 1.5
|
||||||
radius = 3.0
|
radius = 2.0
|
||||||
|
|
||||||
[node name="FilthEater" type="CharacterBody3D"]
|
[node name="FilthEater" type="CharacterBody3D"]
|
||||||
process_mode = 1
|
process_mode = 1
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using Chickensoft.AutoInject;
|
using Chickensoft.AutoInject;
|
||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Zennysoft.Game.Ma;
|
using Zennysoft.Game.Ma;
|
||||||
|
|
||||||
[Meta(typeof(IAutoNode))]
|
[Meta(typeof(IAutoNode))]
|
||||||
@@ -8,6 +10,10 @@ public partial class Sara : Enemy2D, IHavePatrolBehavior, IHaveEngagePlayerBehav
|
|||||||
{
|
{
|
||||||
public override void _Notification(int what) => this.Notify(what);
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
|
||||||
|
[Export] private float PrimaryAttackChance { get; set; } = 0.75f;
|
||||||
|
|
||||||
|
[Export] private float SecondaryAttackChance { get; set; } = 0.25f;
|
||||||
|
|
||||||
[Node] public NavigationAgent3D NavigationAgent { get; set; }
|
[Node] public NavigationAgent3D NavigationAgent { get; set; }
|
||||||
[Node] public PatrolBehavior PatrolBehavior { get; set; } = default!;
|
[Node] public PatrolBehavior PatrolBehavior { get; set; } = default!;
|
||||||
[Node] public FollowBehavior FollowBehavior { get; set; } = default!;
|
[Node] public FollowBehavior FollowBehavior { get; set; } = default!;
|
||||||
@@ -29,4 +35,12 @@ public partial class Sara : Enemy2D, IHavePatrolBehavior, IHaveEngagePlayerBehav
|
|||||||
PlayerDetector.BodyExited += PlayerDetector_BodyExited;
|
PlayerDetector.BodyExited += PlayerDetector_BodyExited;
|
||||||
SetPhysicsProcess(true);
|
SetPhysicsProcess(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void PerformAction()
|
||||||
|
{
|
||||||
|
var rng = new RandomNumberGenerator();
|
||||||
|
var options = new List<Action>() { EnemyModelView.PlayPrimaryAttackAnimation, EnemyModelView.PlaySecondaryAttackAnimation };
|
||||||
|
var selection = rng.RandWeighted([PrimaryAttackChance, SecondaryAttackChance]);
|
||||||
|
options[(int)selection].Invoke();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using Chickensoft.AutoInject;
|
using Chickensoft.AutoInject;
|
||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Zennysoft.Game.Ma;
|
using Zennysoft.Game.Ma;
|
||||||
|
|
||||||
[Meta(typeof(IAutoNode))]
|
[Meta(typeof(IAutoNode))]
|
||||||
@@ -8,6 +10,10 @@ public partial class Ballos : Enemy2D, IHavePatrolBehavior, IHaveEngagePlayerBeh
|
|||||||
{
|
{
|
||||||
public override void _Notification(int what) => this.Notify(what);
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
|
||||||
|
[Export] private float PrimaryAttackChance { get; set; } = 0.75f;
|
||||||
|
|
||||||
|
[Export] private float SecondaryAttackChance { get; set; } = 0.25f;
|
||||||
|
|
||||||
[Node] public NavigationAgent3D NavigationAgent { get; set; }
|
[Node] public NavigationAgent3D NavigationAgent { get; set; }
|
||||||
[Node] public PatrolBehavior PatrolBehavior { get; set; } = default!;
|
[Node] public PatrolBehavior PatrolBehavior { get; set; } = default!;
|
||||||
[Node] public FollowBehavior FollowBehavior { get; set; } = default!;
|
[Node] public FollowBehavior FollowBehavior { get; set; } = default!;
|
||||||
@@ -29,4 +35,12 @@ public partial class Ballos : Enemy2D, IHavePatrolBehavior, IHaveEngagePlayerBeh
|
|||||||
PlayerDetector.BodyExited += PlayerDetector_BodyExited;
|
PlayerDetector.BodyExited += PlayerDetector_BodyExited;
|
||||||
SetPhysicsProcess(true);
|
SetPhysicsProcess(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void PerformAction()
|
||||||
|
{
|
||||||
|
var rng = new RandomNumberGenerator();
|
||||||
|
var options = new List<Action>() { EnemyModelView.PlayPrimaryAttackAnimation, EnemyModelView.PlaySecondaryAttackAnimation };
|
||||||
|
var selection = rng.RandWeighted([PrimaryAttackChance, SecondaryAttackChance]);
|
||||||
|
options[(int)selection].Invoke();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
using Chickensoft.AutoInject;
|
using Chickensoft.AutoInject;
|
||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Zennysoft.Game.Ma;
|
using Zennysoft.Game.Ma;
|
||||||
|
|
||||||
[Meta(typeof(IAutoNode))]
|
[Meta(typeof(IAutoNode))]
|
||||||
@@ -8,6 +10,10 @@ public partial class Chariot : Enemy2D, IHavePatrolBehavior, IHaveEngagePlayerBe
|
|||||||
{
|
{
|
||||||
public override void _Notification(int what) => this.Notify(what);
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
|
||||||
|
[Export] private float PrimaryAttackChance { get; set; } = 0.75f;
|
||||||
|
|
||||||
|
[Export] private float SecondaryAttackChance { get; set; } = 0.25f;
|
||||||
|
|
||||||
[Node] public NavigationAgent3D NavigationAgent { get; set; }
|
[Node] public NavigationAgent3D NavigationAgent { get; set; }
|
||||||
[Node] public PatrolBehavior PatrolBehavior { get; set; } = default!;
|
[Node] public PatrolBehavior PatrolBehavior { get; set; } = default!;
|
||||||
[Node] public FollowBehavior FollowBehavior { get; set; } = default!;
|
[Node] public FollowBehavior FollowBehavior { get; set; } = default!;
|
||||||
@@ -34,4 +40,12 @@ public partial class Chariot : Enemy2D, IHavePatrolBehavior, IHaveEngagePlayerBe
|
|||||||
{
|
{
|
||||||
EnemyModelView.PlayActivateAnimation();
|
EnemyModelView.PlayActivateAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void PerformAction()
|
||||||
|
{
|
||||||
|
var rng = new RandomNumberGenerator();
|
||||||
|
var options = new List<Action>() { EnemyModelView.PlayPrimaryAttackAnimation, EnemyModelView.PlaySecondaryAttackAnimation };
|
||||||
|
var selection = rng.RandWeighted([PrimaryAttackChance, SecondaryAttackChance]);
|
||||||
|
options[(int)selection].Invoke();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@ public partial class Chinthe : Enemy2D, IHaveEngagePlayerBehavior, IHaveFollowBe
|
|||||||
{
|
{
|
||||||
public override void _Notification(int what) => this.Notify(what);
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
|
||||||
[Export] private float PrimaryAttackChance { get; set; } = 0.7f;
|
[Export] private float PrimaryAttackChance { get; set; } = 0.9f;
|
||||||
|
|
||||||
[Export] private float PrimarySkillChance { get; set; } = 0.1f;
|
[Export] private float PrimarySkillChance { get; set; } = 0.1f;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ metadata/_custom_type_script = "uid://dlsgyx4i1jmp3"
|
|||||||
radius = 1.20703
|
radius = 1.20703
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_q6h01"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_q6h01"]
|
||||||
radius = 1.26172
|
radius = 1.6
|
||||||
|
|
||||||
[node name="Chinthe" type="CharacterBody3D"]
|
[node name="Chinthe" type="CharacterBody3D"]
|
||||||
process_mode = 1
|
process_mode = 1
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
using Chickensoft.AutoInject;
|
using Chickensoft.AutoInject;
|
||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Zennysoft.Game.Ma;
|
using Zennysoft.Game.Ma;
|
||||||
|
|
||||||
[Meta(typeof(IAutoNode))]
|
[Meta(typeof(IAutoNode))]
|
||||||
public partial class Ambassador : Enemy2D, IHavePatrolBehavior, IHaveEngagePlayerBehavior, IHaveFollowBehavior
|
public partial class Ambassador : Enemy2D, IHavePatrolBehavior, IHaveEngagePlayerBehavior, IHaveFollowBehavior
|
||||||
{
|
{
|
||||||
public override void _Notification(int what) => this.Notify(what);
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
[Export] private float PrimaryAttackChance { get; set; } = 0.75f;
|
||||||
|
|
||||||
|
[Export] private float SecondaryAttackChance { get; set; } = 0.25f;
|
||||||
|
|
||||||
[Node] public NavigationAgent3D NavigationAgent { get; set; }
|
[Node] public NavigationAgent3D NavigationAgent { get; set; }
|
||||||
[Node] public PatrolBehavior PatrolBehavior { get; set; } = default!;
|
[Node] public PatrolBehavior PatrolBehavior { get; set; } = default!;
|
||||||
@@ -29,4 +34,12 @@ public partial class Ambassador : Enemy2D, IHavePatrolBehavior, IHaveEngagePlaye
|
|||||||
PlayerDetector.BodyExited += PlayerDetector_BodyExited;
|
PlayerDetector.BodyExited += PlayerDetector_BodyExited;
|
||||||
SetPhysicsProcess(true);
|
SetPhysicsProcess(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void PerformAction()
|
||||||
|
{
|
||||||
|
var rng = new RandomNumberGenerator();
|
||||||
|
var options = new List<Action>() { EnemyModelView.PlayPrimaryAttackAnimation, EnemyModelView.PlaySecondaryAttackAnimation };
|
||||||
|
var selection = rng.RandWeighted([PrimaryAttackChance, SecondaryAttackChance]);
|
||||||
|
options[(int)selection].Invoke();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
using Chickensoft.AutoInject;
|
using Chickensoft.AutoInject;
|
||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Zennysoft.Game.Ma;
|
using Zennysoft.Game.Ma;
|
||||||
|
|
||||||
[Meta(typeof(IAutoNode))]
|
[Meta(typeof(IAutoNode))]
|
||||||
@@ -8,6 +10,10 @@ public partial class AgniDemon : Enemy2D, IHavePatrolBehavior, IHaveEngagePlayer
|
|||||||
{
|
{
|
||||||
public override void _Notification(int what) => this.Notify(what);
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
|
||||||
|
[Export] private float PrimaryAttackChance { get; set; } = 0.75f;
|
||||||
|
|
||||||
|
[Export] private float SecondaryAttackChance { get; set; } = 0.25f;
|
||||||
|
|
||||||
[Node] public NavigationAgent3D NavigationAgent { get; set; }
|
[Node] public NavigationAgent3D NavigationAgent { get; set; }
|
||||||
[Node] public PatrolBehavior PatrolBehavior { get; set; } = default!;
|
[Node] public PatrolBehavior PatrolBehavior { get; set; } = default!;
|
||||||
[Node] public FollowBehavior FollowBehavior { get; set; } = default!;
|
[Node] public FollowBehavior FollowBehavior { get; set; } = default!;
|
||||||
@@ -29,4 +35,12 @@ public partial class AgniDemon : Enemy2D, IHavePatrolBehavior, IHaveEngagePlayer
|
|||||||
PlayerDetector.BodyExited += PlayerDetector_BodyExited;
|
PlayerDetector.BodyExited += PlayerDetector_BodyExited;
|
||||||
SetPhysicsProcess(true);
|
SetPhysicsProcess(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void PerformAction()
|
||||||
|
{
|
||||||
|
var rng = new RandomNumberGenerator();
|
||||||
|
var options = new List<Action>() { EnemyModelView.PlayPrimaryAttackAnimation, EnemyModelView.PlaySecondaryAttackAnimation };
|
||||||
|
var selection = rng.RandWeighted([PrimaryAttackChance, SecondaryAttackChance]);
|
||||||
|
options[(int)selection].Invoke();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2068,7 +2068,6 @@ _data = {
|
|||||||
[node name="EnemyModelView" type="Node3D"]
|
[node name="EnemyModelView" type="Node3D"]
|
||||||
script = ExtResource("1_wl7dh")
|
script = ExtResource("1_wl7dh")
|
||||||
EnemyLoreInfo = SubResource("Resource_f45wt")
|
EnemyLoreInfo = SubResource("Resource_f45wt")
|
||||||
_enemyDirection = 0
|
|
||||||
|
|
||||||
[node name="Sprite3D" type="Sprite3D" parent="."]
|
[node name="Sprite3D" type="Sprite3D" parent="."]
|
||||||
transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 0.530475, 0)
|
transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 0.530475, 0)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using Chickensoft.AutoInject;
|
using Chickensoft.AutoInject;
|
||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Zennysoft.Game.Ma;
|
using Zennysoft.Game.Ma;
|
||||||
|
|
||||||
[Meta(typeof(IAutoNode))]
|
[Meta(typeof(IAutoNode))]
|
||||||
@@ -8,6 +10,10 @@ public partial class Palan : Enemy2D, IHavePatrolBehavior, IHaveEngagePlayerBeha
|
|||||||
{
|
{
|
||||||
public override void _Notification(int what) => this.Notify(what);
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
|
||||||
|
[Export] private float PrimaryAttackChance { get; set; } = 0.75f;
|
||||||
|
|
||||||
|
[Export] private float SecondaryAttackChance { get; set; } = 0.25f;
|
||||||
|
|
||||||
[Node] public NavigationAgent3D NavigationAgent { get; set; }
|
[Node] public NavigationAgent3D NavigationAgent { get; set; }
|
||||||
[Node] public PatrolBehavior PatrolBehavior { get; set; } = default!;
|
[Node] public PatrolBehavior PatrolBehavior { get; set; } = default!;
|
||||||
[Node] public FollowBehavior FollowBehavior { get; set; } = default!;
|
[Node] public FollowBehavior FollowBehavior { get; set; } = default!;
|
||||||
@@ -29,4 +35,12 @@ public partial class Palan : Enemy2D, IHavePatrolBehavior, IHaveEngagePlayerBeha
|
|||||||
PlayerDetector.BodyExited += PlayerDetector_BodyExited;
|
PlayerDetector.BodyExited += PlayerDetector_BodyExited;
|
||||||
SetPhysicsProcess(true);
|
SetPhysicsProcess(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void PerformAction()
|
||||||
|
{
|
||||||
|
var rng = new RandomNumberGenerator();
|
||||||
|
var options = new List<Action>() { EnemyModelView.PlayPrimaryAttackAnimation, EnemyModelView.PlaySecondaryAttackAnimation };
|
||||||
|
var selection = rng.RandWeighted([PrimaryAttackChance, SecondaryAttackChance]);
|
||||||
|
options[(int)selection].Invoke();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1608,20 +1608,20 @@ states/Walking/position = Vector2(705, 100)
|
|||||||
transitions = ["Start", "Idle", SubResource("AnimationNodeStateMachineTransition_0yqqu"), "Primary Attack", "Idle", SubResource("AnimationNodeStateMachineTransition_r6aec"), "Secondary Attack", "Idle", SubResource("AnimationNodeStateMachineTransition_lid5r"), "Idle", "Walking", SubResource("AnimationNodeStateMachineTransition_au0i1"), "Walking", "Idle", SubResource("AnimationNodeStateMachineTransition_jbc40"), "Idle", "Primary Attack", SubResource("AnimationNodeStateMachineTransition_0qt6f"), "Idle", "Secondary Attack", SubResource("AnimationNodeStateMachineTransition_2bn25"), "Walking", "Secondary Attack", SubResource("AnimationNodeStateMachineTransition_h2ml5"), "Walking", "Primary Attack", SubResource("AnimationNodeStateMachineTransition_uma8i")]
|
transitions = ["Start", "Idle", SubResource("AnimationNodeStateMachineTransition_0yqqu"), "Primary Attack", "Idle", SubResource("AnimationNodeStateMachineTransition_r6aec"), "Secondary Attack", "Idle", SubResource("AnimationNodeStateMachineTransition_lid5r"), "Idle", "Walking", SubResource("AnimationNodeStateMachineTransition_au0i1"), "Walking", "Idle", SubResource("AnimationNodeStateMachineTransition_jbc40"), "Idle", "Primary Attack", SubResource("AnimationNodeStateMachineTransition_0qt6f"), "Idle", "Secondary Attack", SubResource("AnimationNodeStateMachineTransition_2bn25"), "Walking", "Secondary Attack", SubResource("AnimationNodeStateMachineTransition_h2ml5"), "Walking", "Primary Attack", SubResource("AnimationNodeStateMachineTransition_uma8i")]
|
||||||
graph_offset = Vector2(-15, 35)
|
graph_offset = Vector2(-15, 35)
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_0qt6f"]
|
[sub_resource type="Animation" id="Animation_h2ml5"]
|
||||||
resource_name = "Sunblast"
|
resource_name = "Primary Attack"
|
||||||
length = 0.500003
|
length = 1.03334
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
tracks/0/enabled = true
|
tracks/0/enabled = true
|
||||||
tracks/0/path = NodePath(".:frame")
|
tracks/0/path = NodePath("../Primary Attack:frame")
|
||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/keys = {
|
tracks/0/keys = {
|
||||||
"times": PackedFloat32Array(0, 0.5),
|
"times": PackedFloat32Array(0, 1),
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
"update": 0,
|
"update": 0,
|
||||||
"values": [0, 15]
|
"values": [0, 57]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_2bn25"]
|
[sub_resource type="Animation" id="Animation_2bn25"]
|
||||||
@@ -1651,20 +1651,20 @@ tracks/1/keys = {
|
|||||||
"values": [14]
|
"values": [14]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_h2ml5"]
|
[sub_resource type="Animation" id="Animation_0qt6f"]
|
||||||
resource_name = "Primary Attack"
|
resource_name = "Sunblast"
|
||||||
length = 1.03334
|
length = 0.500003
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
tracks/0/enabled = true
|
tracks/0/enabled = true
|
||||||
tracks/0/path = NodePath("../Primary Attack:frame")
|
tracks/0/path = NodePath(".:frame")
|
||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/keys = {
|
tracks/0/keys = {
|
||||||
"times": PackedFloat32Array(0, 1),
|
"times": PackedFloat32Array(0, 0.5),
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
"update": 0,
|
"update": 0,
|
||||||
"values": [0, 57]
|
"values": [0, 15]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_uma8i"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_uma8i"]
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using Chickensoft.AutoInject;
|
using Chickensoft.AutoInject;
|
||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Zennysoft.Game.Ma;
|
using Zennysoft.Game.Ma;
|
||||||
|
|
||||||
[Meta(typeof(IAutoNode))]
|
[Meta(typeof(IAutoNode))]
|
||||||
@@ -8,6 +10,10 @@ public partial class AqueousDemon : Enemy2D, IHavePatrolBehavior, IHaveEngagePla
|
|||||||
{
|
{
|
||||||
public override void _Notification(int what) => this.Notify(what);
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
|
||||||
|
[Export] private float PrimaryAttackChance { get; set; } = 0.75f;
|
||||||
|
|
||||||
|
[Export] private float SecondaryAttackChance { get; set; } = 0.25f;
|
||||||
|
|
||||||
[Node] public NavigationAgent3D NavigationAgent { get; set; }
|
[Node] public NavigationAgent3D NavigationAgent { get; set; }
|
||||||
[Node] public PatrolBehavior PatrolBehavior { get; set; } = default!;
|
[Node] public PatrolBehavior PatrolBehavior { get; set; } = default!;
|
||||||
[Node] public FollowBehavior FollowBehavior { get; set; } = default!;
|
[Node] public FollowBehavior FollowBehavior { get; set; } = default!;
|
||||||
@@ -29,4 +35,12 @@ public partial class AqueousDemon : Enemy2D, IHavePatrolBehavior, IHaveEngagePla
|
|||||||
PlayerDetector.BodyExited += PlayerDetector_BodyExited;
|
PlayerDetector.BodyExited += PlayerDetector_BodyExited;
|
||||||
SetPhysicsProcess(true);
|
SetPhysicsProcess(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void PerformAction()
|
||||||
|
{
|
||||||
|
var rng = new RandomNumberGenerator();
|
||||||
|
var options = new List<Action>() { EnemyModelView.PlayPrimaryAttackAnimation, EnemyModelView.PlaySecondaryAttackAnimation };
|
||||||
|
var selection = rng.RandWeighted([PrimaryAttackChance, SecondaryAttackChance]);
|
||||||
|
options[(int)selection].Invoke();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user