Weapos Rejiggered
Modified weapon scripts to eliminate specialized projectile behavior - allows charged weapons to have projectiles and modify weapon stats when charged Added machine gun weapon & VFX Moved third party code to Plugins folder to improve compile times
This commit is contained in:
parent
2a0fe34611
commit
dbc522a224
2105 changed files with 7033 additions and 1141 deletions
|
|
@ -6,30 +6,29 @@ public class GuidedProjectileManager : InstantWeaponEffectManager
|
|||
{
|
||||
public Prototype ProjectilePrototype;
|
||||
|
||||
public override void Fire(WeaponData data, EquippedItem item, EntityInstance source, EntityInstance target)
|
||||
public override void Fire(InstantWeapon weapon, EquippedItem item, EntityInstance source, EntityInstance target)
|
||||
{
|
||||
if(data is LauncherData launcher)
|
||||
if(weapon.Data is LauncherData launcher)
|
||||
{
|
||||
var p = ProjectilePrototype.Instantiate<GuidedProjectile>();
|
||||
p.Source = source.Transform;
|
||||
p.SourceEntity = source.Entity;
|
||||
p.Target = target.Transform;
|
||||
p.Frequency = launcher.DodgeFrequency;
|
||||
p.Thrust = source.Entity.ItemManager.Evaluate(launcher.Thrust, item.EquippableItem, source.Entity);
|
||||
var hp = source.Entity.Hardpoints[item.Position.x, item.Position.y];
|
||||
var barrel = source.GetBarrel(hp);
|
||||
p.StartPosition = p.transform.position = barrel.position;
|
||||
p.Range = source.Entity.ItemManager.Evaluate(data.Range, item.EquippableItem, source.Entity);
|
||||
p.Velocity = barrel.forward * source.Entity.ItemManager.Evaluate(launcher.LaunchSpeed, 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.Damage = weapon.Damage;
|
||||
p.Range = weapon.Range;
|
||||
p.Penetration = weapon.Penetration;
|
||||
p.Spread = weapon.DamageSpread;
|
||||
p.DamageType = weapon.WeaponData.DamageType;
|
||||
p.GuidanceCurve = launcher.GuidanceCurve.ToCurve();
|
||||
p.LiftCurve = launcher.LiftCurve.ToCurve();
|
||||
p.ThrustCurve = launcher.ThrustCurve.ToCurve();
|
||||
p.Velocity = barrel.forward * weapon.Velocity;
|
||||
p.Thrust = source.Entity.ItemManager.Evaluate(launcher.Thrust, item.EquippableItem, source.Entity);
|
||||
p.TopSpeed = source.Entity.ItemManager.Evaluate(launcher.Velocity, item.EquippableItem, source.Entity);
|
||||
p.TopSpeed = source.Entity.ItemManager.Evaluate(launcher.MissileVelocity, item.EquippableItem, source.Entity);
|
||||
}
|
||||
else Debug.LogError($"Weapon {item.EquippableItem.Name} linked to {name} effect, but is not a Launcher!");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue