mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 08:45:33 +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="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"]
|
||||
script = ExtResource("3_606tl")
|
||||
ModifierType = 0
|
||||
ModifierType = 1
|
||||
Easing = 0
|
||||
Invert = true
|
||||
MinimumSpeed = 10.0
|
||||
|
|
@ -42,6 +42,14 @@ _timeModifiers = Array[Resource]([])
|
|||
_targetPlayer = false
|
||||
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"]
|
||||
script = ExtResource("2_7268a")
|
||||
BulletScene = ExtResource("4_ruawj")
|
||||
|
|
@ -55,7 +63,7 @@ spread = 180.0
|
|||
owner = 2
|
||||
_damageType = 0
|
||||
_bulletDamage = 1.0
|
||||
_modifier = SubResource("Resource_80ngy")
|
||||
_modifier = SubResource("Resource_e6jj0")
|
||||
_timeModifiers = null
|
||||
_targetPlayer = false
|
||||
WaitForCompletion = true
|
||||
|
|
@ -67,7 +75,15 @@ WaitForCompletion = true
|
|||
|
||||
[sub_resource type="Resource" id="Resource_5fq8v"]
|
||||
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
|
||||
transitionType = 1
|
||||
easeType = 2
|
||||
|
|
@ -78,4 +94,4 @@ script = ExtResource("3_o6234")
|
|||
PhaseName = "Night Sign \"Night Bird\""
|
||||
Threshold = 900
|
||||
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"]
|
||||
script = ExtResource("1_xksf5")
|
||||
relativeTargetPosition = Vector2(-100, 20)
|
||||
moveDuration = 4.0
|
||||
relativeTargetPosition = Vector2(-50, 5)
|
||||
moveDuration = 2.0
|
||||
transitionType = 1
|
||||
easeType = 2
|
||||
WaitForCompletion = false
|
||||
|
|
@ -16,15 +16,15 @@ WaitForCompletion = false
|
|||
[sub_resource type="Resource" id="Resource_o8win"]
|
||||
script = ExtResource("1_xksf5")
|
||||
relativeTargetPosition = Vector2(0, 0)
|
||||
moveDuration = 4.0
|
||||
moveDuration = 2.0
|
||||
transitionType = 1
|
||||
easeType = 2
|
||||
WaitForCompletion = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_k77ig"]
|
||||
script = ExtResource("1_xksf5")
|
||||
relativeTargetPosition = Vector2(100, 20)
|
||||
moveDuration = 4.0
|
||||
relativeTargetPosition = Vector2(50, 5)
|
||||
moveDuration = 2.0
|
||||
transitionType = 1
|
||||
easeType = 2
|
||||
WaitForCompletion = false
|
||||
|
|
@ -32,13 +32,14 @@ WaitForCompletion = false
|
|||
[sub_resource type="Resource" id="Resource_5ocg5"]
|
||||
script = ExtResource("1_xksf5")
|
||||
relativeTargetPosition = Vector2(0, 0)
|
||||
moveDuration = 4.0
|
||||
moveDuration = 2.0
|
||||
transitionType = 1
|
||||
easeType = 2
|
||||
WaitForCompletion = false
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_0cgch")
|
||||
PhaseName = ""
|
||||
Threshold = 950
|
||||
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")])
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ bulletSpeed = 70.0
|
|||
bulletCount = 10
|
||||
rotationSpeed = 0.0
|
||||
_rotationOffset = 0.0
|
||||
duration = 4.0
|
||||
duration = 2.0
|
||||
burstInterval = 0.3
|
||||
spread = 0.0
|
||||
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;
|
||||
private BossPhase CurrentPhase => Phases[currentPhaseIndex];
|
||||
|
||||
private Marker2D _cameraMarker;
|
||||
|
||||
[Export]
|
||||
public Vector2 CameraOffset = Vector2.Zero;
|
||||
|
||||
// [Export]
|
||||
// private PackedScene _bossPhaseAnimationPrefab;
|
||||
|
||||
|
|
@ -37,12 +42,17 @@ public partial class Boss : Enemy, IActivable
|
|||
_gameManager = this.GetGameManager();
|
||||
|
||||
_homePosition = this.GlobalPosition;
|
||||
|
||||
_cameraMarker = new Marker2D();
|
||||
_gameManager.CallDeferred("add_child", _cameraMarker);
|
||||
_cameraMarker.GlobalPosition = _homePosition + CameraOffset;
|
||||
|
||||
if (BossHudPrefab is not null)
|
||||
{
|
||||
_bossHud = BossHudPrefab.Instantiate<BossHud>();
|
||||
_gameManager.CallDeferred("add_child", _bossHud);
|
||||
|
||||
|
||||
_bossHud.Visible = false;
|
||||
_bossHud.BossName = BossName;
|
||||
_bossHud.BossMaxHealth = this.Health;
|
||||
_bossHud.BossHealth = this._currentHealth;
|
||||
|
|
@ -117,6 +127,11 @@ public partial class Boss : Enemy, IActivable
|
|||
public void Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
{
|
||||
_started = true;
|
||||
if (_bossHud is not null)
|
||||
{
|
||||
_bossHud.Visible = true;
|
||||
}
|
||||
_gameManager.CameraTargetObject(_cameraMarker);
|
||||
StartPhase(CurrentPhase);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,11 +112,26 @@ public partial class GameManager : Node2D
|
|||
|
||||
_player.GlobalPosition = PlayerSpawnMarker.Position;
|
||||
|
||||
if (_cameraTarget != null)
|
||||
{
|
||||
_cameraTarget.Reparent(_player, true);
|
||||
_cameraTarget.GlobalPosition = _player.Position;
|
||||
}
|
||||
CameraTargetPlayer();
|
||||
//
|
||||
// if (_cameraTarget != null)
|
||||
// {
|
||||
// _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()
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public partial class SimpleMovementPattern : AttackPattern
|
|||
|
||||
Vector2 targetPosition = (Boss?.HomePosition ?? boss.GlobalPosition) + relativeTargetPosition;
|
||||
|
||||
tween.TweenProperty(Boss, "position", targetPosition, moveDuration)
|
||||
tween.TweenProperty(Boss, "global_position", targetPosition, moveDuration)
|
||||
.SetTrans(transitionType)
|
||||
.SetEase(easeType)
|
||||
.Finished += () => isComplete = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue