Weapon Scripting Overhaul
Weapons are now monolithic behaviors Various new weapon behavior types implemented All weapons have optional magazine and reload mechanic Visibility now decays globally
This commit is contained in:
parent
48abee4847
commit
357f9db329
95 changed files with 2571 additions and 754 deletions
|
|
@ -1,25 +0,0 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ProjectileManager : MonoBehaviour
|
||||
{
|
||||
public Prototype ProjectilePrototype;
|
||||
|
||||
public void Launch(ProjectileWeaponData data, EquippedItem item, EntityInstance source)
|
||||
{
|
||||
var p = ProjectilePrototype.Instantiate<Projectile>();
|
||||
p.SourceEntity = source.Entity;
|
||||
var hp = source.Entity.Hardpoints[item.Position.x, item.Position.y];
|
||||
var barrel = source.GetBarrel(hp);
|
||||
p.Range = source.Entity.ItemManager.Evaluate(data.Range, item.EquippableItem, source.Entity);
|
||||
p.StartPosition = p.transform.position = barrel.position;
|
||||
p.Velocity = barrel.forward * source.Entity.ItemManager.Evaluate(data.Velocity, 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.Trail.Clear();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue