Charged Weapons & Hitscan Weapons
Implemented two new weapon types and created the Railgun (which is both) and accompanying VFX
This commit is contained in:
parent
4c0038830b
commit
2a0fe34611
36 changed files with 49495 additions and 25 deletions
21
Assets/Scripts/Gameplay/Weapons/HitscanManager.cs
Normal file
21
Assets/Scripts/Gameplay/Weapons/HitscanManager.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
public class HitscanManager : InstantWeaponEffectManager
|
||||
{
|
||||
public Prototype Prototype;
|
||||
public override void Fire(WeaponData data, EquippedItem item, EntityInstance source, EntityInstance target)
|
||||
{
|
||||
var p = Prototype.Instantiate<HitscanEffect>();
|
||||
p.SourceEntity = source.Entity;
|
||||
var hp = source.Entity.Hardpoints[item.Position.x, item.Position.y];
|
||||
var barrel = source.GetBarrel(hp);
|
||||
var t = p.transform;
|
||||
t.position = barrel.position;
|
||||
t.forward = barrel.forward;
|
||||
p.Range = source.Entity.ItemManager.Evaluate(data.Range, item.EquippableItem, source.Entity);
|
||||
p.Damage = source.Entity.ItemManager.Evaluate(data.Damage, item.EquippableItem, source.Entity);
|
||||
p.Penetration = source.Entity.ItemManager.Evaluate(data.Penetration, item.EquippableItem, source.Entity);
|
||||
p.Spread = source.Entity.ItemManager.Evaluate(data.DamageSpread, item.EquippableItem, source.Entity);
|
||||
p.DamageType = data.DamageType;
|
||||
p.Zone = source.Entity.Zone;
|
||||
p.Fire();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue