mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 22:05:54 +00:00
Changed casting for timemodifiers
This commit is contained in:
parent
efd6283487
commit
c318bd8c13
7 changed files with 15 additions and 18 deletions
|
|
@ -98,8 +98,7 @@ public partial class SpiralPattern : AttackPattern
|
|||
BulletScene = BulletScene,
|
||||
RotationOffset = angleOffset,
|
||||
Modifier = _modifier,
|
||||
TimeModifiers = ((_timeModifiers?.Where(mod => mod != null)) ?? Array.Empty<TimeModifier>()).Select(m =>
|
||||
m.Wrap()).ToList()
|
||||
TimeModifiers = _timeModifiers?.Where(mod => mod != null).ToList() ?? new List<TimeModifier>()
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,11 +36,7 @@ public partial class Bullet : Area2D
|
|||
_gameManager = gameManager;
|
||||
|
||||
// Ugly hack to make instances unique
|
||||
_modifiers = _bulletInfo.TimeModifiers.Select(x => new ModifierWrapper()
|
||||
{
|
||||
TimeModifier = x.TimeModifier,
|
||||
Applied = x.Applied
|
||||
}).ToList();
|
||||
_modifiers = _bulletInfo.TimeModifiers.Select(x => x.Wrap()).ToList();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ public class BulletInfo
|
|||
public PackedScene BulletScene { get; set; }
|
||||
public PackedScene DestructionParticlesScene { get; set; }
|
||||
public IBulletModifier Modifier { get; set; }
|
||||
public List<ModifierWrapper> TimeModifiers { get; set; } = new List<ModifierWrapper>();
|
||||
public List<TimeModifier> TimeModifiers { get; set; } = new List<TimeModifier>();
|
||||
|
||||
#region Laser
|
||||
public bool IsLaser { get; set; }
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
|
|||
// {
|
||||
// _facingDirection = _movementDirection;
|
||||
// }
|
||||
Velocity = _movementDirection * (float)( MovementSpeed * delta);
|
||||
Velocity = _movementDirection * (float)( MovementSpeed/* * delta*/);
|
||||
|
||||
MoveAndSlide();
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public partial class BulletResource : Resource
|
|||
|
||||
[Export]
|
||||
public BulletCreationModifier Modifier;
|
||||
[Export] public Array<Resource> TimeModifiers;
|
||||
[Export] public Array<TimeModifier> TimeModifiers;
|
||||
|
||||
public BulletInfo MakeBullet(Vector2 position, int count = 1, float spread = 0f, float rotationOffset = 0f)
|
||||
{
|
||||
|
|
@ -39,11 +39,12 @@ public partial class BulletResource : Resource
|
|||
Modifier = Modifier,
|
||||
LifeTime = LifeTime,
|
||||
DestructionParticlesScene = DestructionParticlesScene,
|
||||
TimeModifiers = TimeModifiers?.Where(mod => mod is TimeModifier).Cast<TimeModifier>().Select(m => new ModifierWrapper()
|
||||
{
|
||||
TimeModifier = m,
|
||||
Applied = false
|
||||
}).ToList()
|
||||
TimeModifiers = TimeModifiers.ToList()
|
||||
// TimeModifiers = TimeModifiers?.Where(mod => mod is TimeModifier).Cast<TimeModifier>().Select(m => new ModifierWrapper()
|
||||
// {
|
||||
// TimeModifier = m,
|
||||
// Applied = false
|
||||
// }).ToList()
|
||||
// TimeModifiers = TimeModifiers?.Select(x => new ModifierWrapper()
|
||||
// {
|
||||
// Applied = false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue