mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 15:05:54 +00:00
Bullet data overhaul
This commit is contained in:
parent
3682de18d5
commit
76221ca7a6
9 changed files with 57 additions and 26 deletions
|
|
@ -1,3 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cirno.Scripts.Components;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
|
@ -33,11 +35,33 @@ public partial class WeaponResource : Resource
|
|||
[Export] public string AmmoKey;
|
||||
[Export] public float BulletSpeed = 100f;
|
||||
[Export] public float BulletDamage = 1;
|
||||
[Export] public float LifeTime = 10f;
|
||||
[Export] private float _rotationOffset = 0f;
|
||||
[Export] private BulletOwner owner = BulletOwner.None;
|
||||
[Export] private DamageType _damageType = DamageType.Neutral;
|
||||
[Export] private Resource _modifier;
|
||||
[Export] private Array<Resource> _timeModifiers;
|
||||
|
||||
#endregion
|
||||
|
||||
public BulletInfo MakeBullet(Vector2 position)
|
||||
{
|
||||
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,
|
||||
TimeModifiers = _timeModifiers?.Where(mod => mod is TimeModifier).Cast<TimeModifier>().ToList() ??
|
||||
new List<TimeModifier>()
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue