all that we can do with this emotion
This commit is contained in:
@@ -1,26 +1,6 @@
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
using System.Linq;
|
||||
|
||||
public partial class GodCircuitAttacks : Timer
|
||||
{
|
||||
[Export]
|
||||
public Array<PackedScene> _attacks;
|
||||
|
||||
private int _currentAttack = 0;
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (GetTree().GetFirstNodeInGroup("Player") != null)
|
||||
Paused = false;
|
||||
else
|
||||
Paused = true;
|
||||
}
|
||||
|
||||
public void OnTimeout()
|
||||
{
|
||||
_currentAttack = GD.RandRange(0, _attacks.Count - 1);
|
||||
var attack = _attacks.ElementAt(_currentAttack).Instantiate();
|
||||
AddChild(attack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,47 +1,37 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://uwia12i7yykb"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://uwia12i7yykb"]
|
||||
|
||||
[ext_resource type="Script" path="res://Player/Base/Projectile.cs" id="1_4wsx3"]
|
||||
[ext_resource type="Texture2D" uid="uid://blhihtd4vmbrg" path="res://Textures/Projectiles/Layer 7.png" id="1_odish"]
|
||||
[ext_resource type="Texture2D" uid="uid://bunon01jmxhbx" path="res://Textures/Projectiles/Layer 2.png" id="1_a70u8"]
|
||||
|
||||
[sub_resource type="Curve3D" id="Curve3D_5bny4"]
|
||||
[sub_resource type="Curve3D" id="Curve3D_n05rs"]
|
||||
_data = {
|
||||
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -8),
|
||||
"tilts": PackedFloat32Array(0, 0)
|
||||
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, -2, 1, 2, 0, 0, 0, 0, 0, 0, -2, 1, 4, 0, 0, 0, 0, 0, 0, 2, 1, 4, 0, 0, 0, 0, 0, 0, 2, 1, 6),
|
||||
"tilts": PackedFloat32Array(0, 0, 0, 0, 0, 0)
|
||||
}
|
||||
point_count = 2
|
||||
point_count = 6
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_54g6d"]
|
||||
size = Vector3(1, 4.3194, 1.42031)
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_g5fdd"]
|
||||
size = Vector3(0.553759, 1.22067, 1.58866)
|
||||
|
||||
[node name="Laser Attack" type="Path3D"]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -3, 0, 1.5)
|
||||
curve = SubResource("Curve3D_5bny4")
|
||||
script = ExtResource("1_4wsx3")
|
||||
_projectileSpeed = 3.0
|
||||
[node name="Path3D" type="Path3D"]
|
||||
curve = SubResource("Curve3D_n05rs")
|
||||
|
||||
[node name="PathFollow3D" type="PathFollow3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
rotation_mode = 0
|
||||
loop = false
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 1, 0)
|
||||
|
||||
[node name="RigidBody3D" type="RigidBody3D" parent="PathFollow3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.944978)
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
gravity_scale = 0.0
|
||||
continuous_cd = true
|
||||
max_contacts_reported = 5
|
||||
contact_monitor = true
|
||||
can_sleep = false
|
||||
freeze = true
|
||||
freeze_mode = 1
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="PathFollow3D/RigidBody3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.38419e-07, 0, 1.78244)
|
||||
shape = SubResource("BoxShape3D_54g6d")
|
||||
shape = SubResource("BoxShape3D_g5fdd")
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="PathFollow3D/RigidBody3D/CollisionShape3D"]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
|
||||
transform = Transform3D(-2.18557e-08, 0, 0.5, 0, 0.5, 0, -0.5, 0, -2.18557e-08, 0, 0, 0)
|
||||
axis = 1
|
||||
texture = ExtResource("1_odish")
|
||||
|
||||
[connection signal="body_entered" from="PathFollow3D/RigidBody3D" to="." method="OnPlayerHit"]
|
||||
texture = ExtResource("1_a70u8")
|
||||
|
||||
29
Enemies/Attacks/GodCircuitAttacks/PyramidAttack.cs
Normal file
29
Enemies/Attacks/GodCircuitAttacks/PyramidAttack.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Godot;
|
||||
|
||||
public partial class PyramidAttack : Node3D
|
||||
{
|
||||
[Export]
|
||||
private AnimationPlayer _animationPlayer;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_animationPlayer.AnimationFinished += Delete;
|
||||
}
|
||||
public void OnPlayerHit(Node node)
|
||||
{
|
||||
SetPhysicsProcess(false);
|
||||
|
||||
if (node is Character character && character.HasMethod(Character.MethodName.OnHit))
|
||||
{
|
||||
GD.Print("Player hit: " + character.Name);
|
||||
character.Call(Character.MethodName.OnHit, this);
|
||||
}
|
||||
|
||||
QueueFree();
|
||||
}
|
||||
|
||||
public void Delete(StringName name)
|
||||
{
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user