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_EditorClassIdentifier:
_constantSpawn:
- _enemy: {fileID: 80204295746100150, guid: 1be769d6ef642314b8846bed35e7297c, type: 3}
- _enemy: {fileID: 80204295746100150, guid: 6b05dbad92d83554da147a206ddb0582, type: 3}
_count: 30
_nestedGroupSpawn:
- 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()
{
if (Target != null)
if (Target != null && IsTracking)
{
EndPos = Target.Position;
}
@ -49,13 +49,24 @@ public class ArcProjectile : TargetedProjectile
if (other.TryGetComponent(out Entity target))
{
ApplyEffects(target);
target.Hit(Damage);
if (target.Hp <= 0)
if ((target is HardHeadOpponent))
{
target.Death();
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);
target.Hit(Damage);
if (target.Hp <= 0)
{
target.Death();
}
Destroy(gameObject);
}
Destroy(gameObject);
}
}

View File

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

View File

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