Compare commits
1 Commits
main
...
dev/hard-h
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f361a27a1 |
@ -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:
|
||||||
|
|||||||
1491
Assets/Prefabs/Monsters/Hard_Head.prefab
Normal file
1491
Assets/Prefabs/Monsters/Hard_Head.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Prefabs/Monsters/Hard_Head.prefab.meta
Normal file
7
Assets/Prefabs/Monsters/Hard_Head.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6b05dbad92d83554da147a206ddb0582
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
1
Assets/Scripts/Opponent/HardHeadOpponent.cs
Normal file
1
Assets/Scripts/Opponent/HardHeadOpponent.cs
Normal file
@ -0,0 +1 @@
|
|||||||
|
public class HardHeadOpponent : Opponent { }
|
||||||
11
Assets/Scripts/Opponent/HardHeadOpponent.cs.meta
Normal file
11
Assets/Scripts/Opponent/HardHeadOpponent.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c2c627385f472134b99d2c32e8ee330c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -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;
|
||||||
}
|
}
|
||||||
@ -49,13 +49,24 @@ public class ArcProjectile : TargetedProjectile
|
|||||||
|
|
||||||
if (other.TryGetComponent(out Entity target))
|
if (other.TryGetComponent(out Entity target))
|
||||||
{
|
{
|
||||||
ApplyEffects(target);
|
if ((target is HardHeadOpponent))
|
||||||
target.Hit(Damage);
|
|
||||||
if (target.Hp <= 0)
|
|
||||||
{
|
{
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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 Entity Target { get => Origin.Enemy;}
|
public bool IsTracking { get => _isTracking; set => _isTracking = value; }
|
||||||
|
public Entity Target { get => Origin.Enemy; }
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user