implemented hard head

This commit is contained in:
Adam Salah 2025-09-15 16:24:52 -04:00
parent ecec445335
commit 7f361a27a1
9 changed files with 1534 additions and 8 deletions

View File

@ -13,7 +13,7 @@ MonoBehaviour:
m_Name: WaveConfig_1_1 m_Name: WaveConfig_1_1
m_EditorClassIdentifier: m_EditorClassIdentifier:
_constantSpawn: _constantSpawn:
- _enemy: {fileID: 80204295746100150, guid: 1be769d6ef642314b8846bed35e7297c, type: 3} - _enemy: {fileID: 80204295746100150, guid: 6b05dbad92d83554da147a206ddb0582, type: 3}
_count: 30 _count: 30
_nestedGroupSpawn: _nestedGroupSpawn:
- groupSpawn: - groupSpawn:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6b05dbad92d83554da147a206ddb0582
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1 @@
public class HardHeadOpponent : Opponent { }

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c2c627385f472134b99d2c32e8ee330c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -10,7 +10,7 @@ public class ArcProjectile : TargetedProjectile
protected override void ApplyMovement() protected override void ApplyMovement()
{ {
if (Target != null) if (Target != null && IsTracking)
{ {
EndPos = Target.Position; EndPos = Target.Position;
} }
@ -48,6 +48,16 @@ public class ArcProjectile : TargetedProjectile
if (other.gameObject != Target.gameObject) return; if (other.gameObject != Target.gameObject) return;
if (other.TryGetComponent(out Entity target)) if (other.TryGetComponent(out Entity target))
{
if ((target is HardHeadOpponent))
{
IsTracking = false;
StartPos = transform.position;
EndPos = Target.Position - new Vector3(1.0f, 0.0f, 0.0f);
Speed /= -5.0f;
_angle = Random.Range(30.0f, 80.0f);
}
else
{ {
ApplyEffects(target); ApplyEffects(target);
target.Hit(Damage); target.Hit(Damage);
@ -58,6 +68,7 @@ public class ArcProjectile : TargetedProjectile
Destroy(gameObject); Destroy(gameObject);
} }
} }
}
public float Angle { get => _angle; set => _angle = value; } public float Angle { get => _angle; set => _angle = value; }
} }

View File

@ -7,6 +7,7 @@ public abstract class Projectile : MonoBehaviour
{ {
[Header("Projectile")] [Header("Projectile")]
[SerializeField] [SerializeField]
[Tooltip("Speed modulates direction!")]
private float _speed = 5.0f; private float _speed = 5.0f;
[SerializeField] [SerializeField]
private DirectionEnum _direction; private DirectionEnum _direction;

View File

@ -5,13 +5,16 @@ using UnityEngine;
public abstract class TargetedProjectile : Projectile public abstract class TargetedProjectile : Projectile
{ {
private Vector2 _endPos; private Vector2 _endPos;
private bool _isTracking;
protected override void Start() protected override void Start()
{ {
base.Start(); base.Start();
_endPos = Target.Position; _endPos = Target.Position;
_isTracking = true;
} }
public Vector2 EndPos { get => _endPos; set => _endPos = value; } public Vector2 EndPos { get => _endPos; set => _endPos = value; }
public bool IsTracking { get => _isTracking; set => _isTracking = value; }
public Entity Target { get => Origin.Enemy; } public Entity Target { get => Origin.Enemy; }
} }

1
debug.log Normal file
View File

@ -0,0 +1 @@
[0915/152004.497:ERROR:third_party\crashpad\crashpad\util\win\registration_protocol_win.cc:108] CreateFile: The system cannot find the file specified. (0x2)