mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-17 19:03:47 +00:00
Patterns tweaks
This commit is contained in:
parent
4be64cf7ec
commit
a430554e27
7 changed files with 69 additions and 22 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_resource type="Resource" script_class="BossPhase" load_steps=14 format=3 uid="uid://ccj0cqbveey8c"]
|
[gd_resource type="Resource" script_class="BossPhase" load_steps=16 format=3 uid="uid://ccj0cqbveey8c"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://Scripts/Resources/SimpleMovementPattern.cs" id="1_lw82i"]
|
[ext_resource type="Script" path="res://Scripts/Resources/SimpleMovementPattern.cs" id="1_lw82i"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dohakkayqj4w2" path="res://Scenes/Weapons/Bullets/enemyBullet_green.tscn" id="1_o4um1"]
|
[ext_resource type="PackedScene" uid="uid://dohakkayqj4w2" path="res://Scenes/Weapons/Bullets/enemyBullet_green.tscn" id="1_o4um1"]
|
||||||
|
|
@ -18,7 +18,7 @@ WaitForCompletion = true
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_80ngy"]
|
[sub_resource type="Resource" id="Resource_80ngy"]
|
||||||
script = ExtResource("3_606tl")
|
script = ExtResource("3_606tl")
|
||||||
ModifierType = 0
|
ModifierType = 1
|
||||||
Easing = 0
|
Easing = 0
|
||||||
Invert = true
|
Invert = true
|
||||||
MinimumSpeed = 10.0
|
MinimumSpeed = 10.0
|
||||||
|
|
@ -42,6 +42,14 @@ _timeModifiers = Array[Resource]([])
|
||||||
_targetPlayer = false
|
_targetPlayer = false
|
||||||
WaitForCompletion = true
|
WaitForCompletion = true
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_e6jj0"]
|
||||||
|
script = ExtResource("3_606tl")
|
||||||
|
ModifierType = 1
|
||||||
|
Easing = 0
|
||||||
|
Invert = false
|
||||||
|
MinimumSpeed = 10.0
|
||||||
|
ScalingFactor = 10.0
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_7yi74"]
|
[sub_resource type="Resource" id="Resource_7yi74"]
|
||||||
script = ExtResource("2_7268a")
|
script = ExtResource("2_7268a")
|
||||||
BulletScene = ExtResource("4_ruawj")
|
BulletScene = ExtResource("4_ruawj")
|
||||||
|
|
@ -55,7 +63,7 @@ spread = 180.0
|
||||||
owner = 2
|
owner = 2
|
||||||
_damageType = 0
|
_damageType = 0
|
||||||
_bulletDamage = 1.0
|
_bulletDamage = 1.0
|
||||||
_modifier = SubResource("Resource_80ngy")
|
_modifier = SubResource("Resource_e6jj0")
|
||||||
_timeModifiers = null
|
_timeModifiers = null
|
||||||
_targetPlayer = false
|
_targetPlayer = false
|
||||||
WaitForCompletion = true
|
WaitForCompletion = true
|
||||||
|
|
@ -67,7 +75,15 @@ WaitForCompletion = true
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_5fq8v"]
|
[sub_resource type="Resource" id="Resource_5fq8v"]
|
||||||
script = ExtResource("1_lw82i")
|
script = ExtResource("1_lw82i")
|
||||||
relativeTargetPosition = Vector2(-50, 20)
|
relativeTargetPosition = Vector2(-50, 5)
|
||||||
|
moveDuration = 1.0
|
||||||
|
transitionType = 1
|
||||||
|
easeType = 2
|
||||||
|
WaitForCompletion = true
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_nl664"]
|
||||||
|
script = ExtResource("1_lw82i")
|
||||||
|
relativeTargetPosition = Vector2(50, 5)
|
||||||
moveDuration = 1.0
|
moveDuration = 1.0
|
||||||
transitionType = 1
|
transitionType = 1
|
||||||
easeType = 2
|
easeType = 2
|
||||||
|
|
@ -78,4 +94,4 @@ script = ExtResource("3_o6234")
|
||||||
PhaseName = "Night Sign \"Night Bird\""
|
PhaseName = "Night Sign \"Night Bird\""
|
||||||
Threshold = 900
|
Threshold = 900
|
||||||
PlayAnimation = true
|
PlayAnimation = true
|
||||||
Patterns = Array[Resource]([SubResource("Resource_upj22"), SubResource("Resource_gm1rv"), SubResource("Resource_5fq8v"), SubResource("Resource_gm1rv")])
|
Patterns = Array[Resource]([SubResource("Resource_upj22"), SubResource("Resource_gm1rv"), SubResource("Resource_5fq8v"), SubResource("Resource_gm1rv"), SubResource("Resource_upj22"), SubResource("Resource_gm1rv"), SubResource("Resource_nl664"), SubResource("Resource_gm1rv")])
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_acaax"]
|
[sub_resource type="Resource" id="Resource_acaax"]
|
||||||
script = ExtResource("1_xksf5")
|
script = ExtResource("1_xksf5")
|
||||||
relativeTargetPosition = Vector2(-100, 20)
|
relativeTargetPosition = Vector2(-50, 5)
|
||||||
moveDuration = 4.0
|
moveDuration = 2.0
|
||||||
transitionType = 1
|
transitionType = 1
|
||||||
easeType = 2
|
easeType = 2
|
||||||
WaitForCompletion = false
|
WaitForCompletion = false
|
||||||
|
|
@ -16,15 +16,15 @@ WaitForCompletion = false
|
||||||
[sub_resource type="Resource" id="Resource_o8win"]
|
[sub_resource type="Resource" id="Resource_o8win"]
|
||||||
script = ExtResource("1_xksf5")
|
script = ExtResource("1_xksf5")
|
||||||
relativeTargetPosition = Vector2(0, 0)
|
relativeTargetPosition = Vector2(0, 0)
|
||||||
moveDuration = 4.0
|
moveDuration = 2.0
|
||||||
transitionType = 1
|
transitionType = 1
|
||||||
easeType = 2
|
easeType = 2
|
||||||
WaitForCompletion = false
|
WaitForCompletion = false
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_k77ig"]
|
[sub_resource type="Resource" id="Resource_k77ig"]
|
||||||
script = ExtResource("1_xksf5")
|
script = ExtResource("1_xksf5")
|
||||||
relativeTargetPosition = Vector2(100, 20)
|
relativeTargetPosition = Vector2(50, 5)
|
||||||
moveDuration = 4.0
|
moveDuration = 2.0
|
||||||
transitionType = 1
|
transitionType = 1
|
||||||
easeType = 2
|
easeType = 2
|
||||||
WaitForCompletion = false
|
WaitForCompletion = false
|
||||||
|
|
@ -32,13 +32,14 @@ WaitForCompletion = false
|
||||||
[sub_resource type="Resource" id="Resource_5ocg5"]
|
[sub_resource type="Resource" id="Resource_5ocg5"]
|
||||||
script = ExtResource("1_xksf5")
|
script = ExtResource("1_xksf5")
|
||||||
relativeTargetPosition = Vector2(0, 0)
|
relativeTargetPosition = Vector2(0, 0)
|
||||||
moveDuration = 4.0
|
moveDuration = 2.0
|
||||||
transitionType = 1
|
transitionType = 1
|
||||||
easeType = 2
|
easeType = 2
|
||||||
WaitForCompletion = false
|
WaitForCompletion = false
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_0cgch")
|
script = ExtResource("1_0cgch")
|
||||||
|
PhaseName = ""
|
||||||
Threshold = 950
|
Threshold = 950
|
||||||
PlayAnimation = false
|
PlayAnimation = false
|
||||||
Patterns = Array[Resource]([SubResource("Resource_acaax"), ExtResource("2_7n56o"), ExtResource("3_mwcf3"), SubResource("Resource_o8win"), ExtResource("2_7n56o"), ExtResource("3_mwcf3"), SubResource("Resource_k77ig"), ExtResource("2_7n56o"), ExtResource("3_mwcf3"), SubResource("Resource_5ocg5"), ExtResource("2_7n56o"), ExtResource("3_mwcf3")])
|
Patterns = Array[Resource]([SubResource("Resource_acaax"), ExtResource("2_7n56o"), ExtResource("3_mwcf3"), SubResource("Resource_o8win"), ExtResource("2_7n56o"), ExtResource("3_mwcf3"), SubResource("Resource_k77ig"), ExtResource("2_7n56o"), ExtResource("3_mwcf3"), SubResource("Resource_5ocg5"), ExtResource("2_7n56o"), ExtResource("3_mwcf3")])
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ bulletSpeed = 70.0
|
||||||
bulletCount = 10
|
bulletCount = 10
|
||||||
rotationSpeed = 0.0
|
rotationSpeed = 0.0
|
||||||
_rotationOffset = 0.0
|
_rotationOffset = 0.0
|
||||||
duration = 4.0
|
duration = 2.0
|
||||||
burstInterval = 0.3
|
burstInterval = 0.3
|
||||||
spread = 0.0
|
spread = 0.0
|
||||||
owner = 2
|
owner = 2
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -21,6 +21,11 @@ public partial class Boss : Enemy, IActivable
|
||||||
public Vector2 HomePosition => _homePosition;
|
public Vector2 HomePosition => _homePosition;
|
||||||
private BossPhase CurrentPhase => Phases[currentPhaseIndex];
|
private BossPhase CurrentPhase => Phases[currentPhaseIndex];
|
||||||
|
|
||||||
|
private Marker2D _cameraMarker;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public Vector2 CameraOffset = Vector2.Zero;
|
||||||
|
|
||||||
// [Export]
|
// [Export]
|
||||||
// private PackedScene _bossPhaseAnimationPrefab;
|
// private PackedScene _bossPhaseAnimationPrefab;
|
||||||
|
|
||||||
|
|
@ -38,11 +43,16 @@ public partial class Boss : Enemy, IActivable
|
||||||
|
|
||||||
_homePosition = this.GlobalPosition;
|
_homePosition = this.GlobalPosition;
|
||||||
|
|
||||||
|
_cameraMarker = new Marker2D();
|
||||||
|
_gameManager.CallDeferred("add_child", _cameraMarker);
|
||||||
|
_cameraMarker.GlobalPosition = _homePosition + CameraOffset;
|
||||||
|
|
||||||
if (BossHudPrefab is not null)
|
if (BossHudPrefab is not null)
|
||||||
{
|
{
|
||||||
_bossHud = BossHudPrefab.Instantiate<BossHud>();
|
_bossHud = BossHudPrefab.Instantiate<BossHud>();
|
||||||
_gameManager.CallDeferred("add_child", _bossHud);
|
_gameManager.CallDeferred("add_child", _bossHud);
|
||||||
|
|
||||||
|
_bossHud.Visible = false;
|
||||||
_bossHud.BossName = BossName;
|
_bossHud.BossName = BossName;
|
||||||
_bossHud.BossMaxHealth = this.Health;
|
_bossHud.BossMaxHealth = this.Health;
|
||||||
_bossHud.BossHealth = this._currentHealth;
|
_bossHud.BossHealth = this._currentHealth;
|
||||||
|
|
@ -117,6 +127,11 @@ public partial class Boss : Enemy, IActivable
|
||||||
public void Activate(ActivationType activationType = ActivationType.Toggle)
|
public void Activate(ActivationType activationType = ActivationType.Toggle)
|
||||||
{
|
{
|
||||||
_started = true;
|
_started = true;
|
||||||
|
if (_bossHud is not null)
|
||||||
|
{
|
||||||
|
_bossHud.Visible = true;
|
||||||
|
}
|
||||||
|
_gameManager.CameraTargetObject(_cameraMarker);
|
||||||
StartPhase(CurrentPhase);
|
StartPhase(CurrentPhase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,11 +112,26 @@ public partial class GameManager : Node2D
|
||||||
|
|
||||||
_player.GlobalPosition = PlayerSpawnMarker.Position;
|
_player.GlobalPosition = PlayerSpawnMarker.Position;
|
||||||
|
|
||||||
if (_cameraTarget != null)
|
CameraTargetPlayer();
|
||||||
{
|
//
|
||||||
_cameraTarget.Reparent(_player, true);
|
// if (_cameraTarget != null)
|
||||||
_cameraTarget.GlobalPosition = _player.Position;
|
// {
|
||||||
}
|
// _cameraTarget.Reparent(_player, true);
|
||||||
|
// _cameraTarget.GlobalPosition = _player.Position;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CameraTargetPlayer()
|
||||||
|
{
|
||||||
|
if (_player is null) return;
|
||||||
|
CameraTargetObject(_player);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CameraTargetObject(Node2D target)
|
||||||
|
{
|
||||||
|
if (_cameraTarget is null) return;
|
||||||
|
_cameraTarget.Reparent(target, true);
|
||||||
|
_cameraTarget.GlobalPosition = target.GlobalPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SpawnWeapons()
|
private void SpawnWeapons()
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ public partial class SimpleMovementPattern : AttackPattern
|
||||||
|
|
||||||
Vector2 targetPosition = (Boss?.HomePosition ?? boss.GlobalPosition) + relativeTargetPosition;
|
Vector2 targetPosition = (Boss?.HomePosition ?? boss.GlobalPosition) + relativeTargetPosition;
|
||||||
|
|
||||||
tween.TweenProperty(Boss, "position", targetPosition, moveDuration)
|
tween.TweenProperty(Boss, "global_position", targetPosition, moveDuration)
|
||||||
.SetTrans(transitionType)
|
.SetTrans(transitionType)
|
||||||
.SetEase(easeType)
|
.SetEase(easeType)
|
||||||
.Finished += () => isComplete = true;
|
.Finished += () => isComplete = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue