mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 07:45:55 +00:00
Weapon evolution
This commit is contained in:
parent
8492c3644b
commit
f58b9646df
10 changed files with 209 additions and 68 deletions
|
|
@ -8,44 +8,47 @@ namespace Cirno.Scripts.Resources;
|
|||
|
||||
[GlobalClass]
|
||||
[Tool]
|
||||
public partial class WeaponResource : Resource
|
||||
public partial class WeaponResource : Resource
|
||||
{
|
||||
[Export]
|
||||
public StringName Name { get; set; }
|
||||
|
||||
[Export] public StringName Name { get; set; }
|
||||
|
||||
[Export] public BulletResource BulletData { get; private set; }
|
||||
|
||||
|
||||
//[Export]
|
||||
//public PackedScene BulletScene { get; set; }
|
||||
|
||||
//[Export] public PackedScene DestructionParticlesScene { get; set; }
|
||||
[Export] public int Priority { get; set; } = 0;
|
||||
[Export] public int AmmoPerShot { get; set; } = 1;
|
||||
//public PackedScene BulletScene { get; set; }
|
||||
|
||||
//[Export] public PackedScene DestructionParticlesScene { get; set; }
|
||||
[Export] public int Priority { get; set; } = 0;
|
||||
[Export] public int AmmoPerShot { get; set; } = 1;
|
||||
|
||||
[Export] public double RateOfFire = 0.4f;
|
||||
|
||||
[Export] public int BulletCapacity = 20;
|
||||
|
||||
[Export] public double ReloadTime = 1.0f;
|
||||
|
||||
[Export] public bool AutoReload = true;
|
||||
|
||||
[Export] public bool InfiniteAmmo = true;
|
||||
|
||||
|
||||
[Export] public int BulletCapacity = 20;
|
||||
|
||||
[Export] public double ReloadTime = 1.0f;
|
||||
|
||||
[Export] public bool AutoReload = true;
|
||||
|
||||
[Export] public bool InfiniteAmmo = true;
|
||||
|
||||
[Export] public StringName ItemKey;
|
||||
[Export] public StringName AmmoKey;
|
||||
|
||||
[ExportCategory("Battery Recharge")]
|
||||
[Export] public double RechargeTime = 0.5d;
|
||||
[Export]public int RechargeAmount = 1;
|
||||
[Export] public bool StopToShoot = false;
|
||||
|
||||
#region Bullet spawn data
|
||||
[ExportCategory("Bullet Spawn Data")]
|
||||
[Export] public int BulletsPerShot = 1;
|
||||
[ExportCategory("Battery Recharge")] [Export]
|
||||
public double RechargeTime = 0.5d;
|
||||
|
||||
[Export] public int RechargeAmount = 1;
|
||||
[Export] public bool StopToShoot = false;
|
||||
|
||||
#region Bullet spawn data
|
||||
|
||||
[ExportCategory("Bullet Spawn Data")] [Export]
|
||||
public int BulletsPerShot = 1;
|
||||
|
||||
[Export] public float SpreadAngle = 0f;
|
||||
|
||||
[Export] public float RandomSpread = 0f;
|
||||
|
||||
[Export] public float SpreadAngle = 0f;
|
||||
[Export] public float RandomSpread = 0f;
|
||||
//[Export] public float BulletSpeed = 100f;
|
||||
//[Export] public float BulletDamage = 1;
|
||||
//[Export] public float LifeTime = 10f;
|
||||
|
|
@ -56,33 +59,43 @@ public partial class WeaponResource : Resource
|
|||
//[Export] private Array<Resource> _timeModifiers;
|
||||
|
||||
#endregion
|
||||
|
||||
[ExportCategory("Sounds")]
|
||||
[Export] public AudioStream ReloadSound { get; set; }
|
||||
|
||||
[ExportCategory("Sounds")] [Export] public AudioStream ReloadSound { get; set; }
|
||||
[Export] public AudioStream ShootSound { get; set; }
|
||||
[Export] public AudioStream EmptySound { get; set; }
|
||||
|
||||
// --------------------------------------------------
|
||||
// Upgrade / progression blueprint data
|
||||
// Resources must remain blueprint-only; these fields describe
|
||||
// how this weapon progresses to the next tier.
|
||||
// --------------------------------------------------
|
||||
|
||||
[Export]
|
||||
public int ExperienceToNextLevel { get; set; } = 0; // XP required to evolve to NextLevelWeapon (0 = no progression)
|
||||
|
||||
[Export] public WeaponResource NextLevelWeapon { get; set; } // Reference to the next-tier weapon resource
|
||||
|
||||
public BulletInfo MakeBullet(Vector2 position)
|
||||
{
|
||||
return BulletData.MakeBullet(position, BulletsPerShot, SpreadAngle, _rotationOffset);
|
||||
|
||||
// return new BulletInfo()
|
||||
// {
|
||||
// Position = position,
|
||||
// Direction = Vector2.Right,
|
||||
// Speed = BulletSpeed,
|
||||
// Owner = owner,
|
||||
// DamageType = _damageType,
|
||||
// Damage = BulletDamage,
|
||||
// BulletCount = BulletsPerShot,
|
||||
// Spread = SpreadAngle,
|
||||
// BulletScene = BulletScene,
|
||||
// RotationOffset = _rotationOffset,
|
||||
// Modifier = _modifier as IBulletModifier,
|
||||
// LifeTime = LifeTime,
|
||||
// DestructionParticlesScene = DestructionParticlesScene,
|
||||
// TimeModifiers = _timeModifiers?.Where(mod => mod is TimeModifier).Cast<TimeModifier>().ToList() ??
|
||||
// new List<TimeModifier>()
|
||||
// };
|
||||
return BulletData.MakeBullet(position, BulletsPerShot, SpreadAngle, _rotationOffset);
|
||||
|
||||
// return new BulletInfo()
|
||||
// {
|
||||
// Position = position,
|
||||
// Direction = Vector2.Right,
|
||||
// Speed = BulletSpeed,
|
||||
// Owner = owner,
|
||||
// DamageType = _damageType,
|
||||
// Damage = BulletDamage,
|
||||
// BulletCount = BulletsPerShot,
|
||||
// Spread = SpreadAngle,
|
||||
// BulletScene = BulletScene,
|
||||
// RotationOffset = _rotationOffset,
|
||||
// Modifier = _modifier as IBulletModifier,
|
||||
// LifeTime = LifeTime,
|
||||
// DestructionParticlesScene = DestructionParticlesScene,
|
||||
// TimeModifiers = _timeModifiers?.Where(mod => mod is TimeModifier).Cast<TimeModifier>().ToList() ??
|
||||
// new List<TimeModifier>()
|
||||
// };
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue