Shielding
Shield behavior now provides protection from damage at the expense of heat and energy usage Weapon scripts check for the presence of a shield when detecting collisions (TODO: TEST ALL WEAPON TYPES) Shields can be toggled on/off (G key) Database cache now included in repo (saves some confusion)
This commit is contained in:
parent
273095afec
commit
8920b48977
19 changed files with 377 additions and 95 deletions
|
|
@ -106,10 +106,16 @@ public class Mine : MonoBehaviour
|
|||
Time.time - _startTime > Lifetime ||
|
||||
_blastCountdown && Time.time > _blastTime)
|
||||
{
|
||||
foreach (var collider in Physics.OverlapSphere(t.position, BlastRange, 1))
|
||||
foreach (var collider in Physics.OverlapSphere(t.position, BlastRange, 1 | (1 << 17)))
|
||||
{
|
||||
var shield = collider.GetComponent<ShieldManager>();
|
||||
if (shield && (shield.Entity.Shield != null && shield.Entity.Shield.Item.Active && shield.Entity.Shield.CanTakeHit(DamageType, Damage)))
|
||||
{
|
||||
shield.Entity.Shield.TakeHit(DamageType, Damage);
|
||||
shield.ShowHit(t.position, sqrt(Damage));
|
||||
}
|
||||
var hull = collider.GetComponent<HullCollider>();
|
||||
if (hull)
|
||||
if (hull && !(hull.Entity.Shield != null && hull.Entity.Shield.Item.Active && hull.Entity.Shield.CanTakeHit(DamageType, Damage)))
|
||||
{
|
||||
hull.SendSplash(Damage, DamageType, Source.Entity, (collider.transform.position - t.position).normalized);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue