Skip to content

Commit 171ca7f

Browse files
committed
rename ProjectileBase -> ProjectileDescriptor
RenameProjectileDescriptor migration
1 parent 83a4bd4 commit 171ca7f

32 files changed

+3699
-148
lines changed

Framework/Intersect.Framework.Core/Descriptors/GameObjectType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public enum GameObjectType
2323
[GameObjectInfo(typeof(NPCDescriptor), "npcs")]
2424
Npc,
2525

26-
[GameObjectInfo(typeof(ProjectileBase), "projectiles")]
26+
[GameObjectInfo(typeof(ProjectileDescriptor), "projectiles")]
2727
Projectile,
2828

2929
[GameObjectInfo(typeof(QuestBase), "quests")]

Framework/Intersect.Framework.Core/GameObjects/Items/ItemDescriptor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ public string JsonColor
205205

206206
[NotMapped]
207207
[JsonIgnore]
208-
public ProjectileBase Projectile
208+
public ProjectileDescriptor Projectile
209209
{
210-
get => ProjectileBase.Get(ProjectileId);
210+
get => ProjectileDescriptor.Get(ProjectileId);
211211
set => ProjectileId = value?.Id ?? Guid.Empty;
212212
}
213213

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace Intersect.GameObjects;
2+
3+
public partial class Location
4+
{
5+
public bool[] Directions = new bool[ProjectileDescriptor.MAX_PROJECTILE_DIRECTIONS];
6+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace Intersect.GameObjects;
2+
3+
public partial class ProjectileAnimation
4+
{
5+
public Guid AnimationId;
6+
7+
public bool AutoRotate;
8+
9+
public int SpawnRange = 1;
10+
11+
public ProjectileAnimation(Guid animationId, int spawnRange, bool autoRotate)
12+
{
13+
AnimationId = animationId;
14+
SpawnRange = spawnRange;
15+
AutoRotate = autoRotate;
16+
}
17+
}

Framework/Intersect.Framework.Core/GameObjects/ProjectileBase.cs renamed to Framework/Intersect.Framework.Core/GameObjects/Projectiles/ProjectileDescriptor.cs

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Intersect.GameObjects;
88

9-
public partial class ProjectileBase : DatabaseObject<ProjectileBase>, IFolderable
9+
public partial class ProjectileDescriptor : DatabaseObject<ProjectileDescriptor>, IFolderable
1010
{
1111
public const int MAX_PROJECTILE_DIRECTIONS = 8;
1212

@@ -37,7 +37,7 @@ public partial class ProjectileBase : DatabaseObject<ProjectileBase>, IFolderabl
3737

3838
//Init
3939
[JsonConstructor]
40-
public ProjectileBase(Guid id) : base(id)
40+
public ProjectileDescriptor(Guid id) : base(id)
4141
{
4242
Name = "New Projectile";
4343
for (var x = 0; x < SPAWN_LOCATIONS_WIDTH; x++)
@@ -50,7 +50,7 @@ public ProjectileBase(Guid id) : base(id)
5050
}
5151

5252
//Parameterless for EF
53-
public ProjectileBase()
53+
public ProjectileDescriptor()
5454
{
5555
Name = "New Projectile";
5656
for (var x = 0; x < SPAWN_LOCATIONS_WIDTH; x++)
@@ -145,25 +145,4 @@ public SpellBase Spell
145145

146146
/// <inheritdoc />
147147
public string Folder { get; set; } = string.Empty;
148-
}
149-
150-
public partial class Location
151-
{
152-
public bool[] Directions = new bool[ProjectileBase.MAX_PROJECTILE_DIRECTIONS];
153-
}
154-
155-
public partial class ProjectileAnimation
156-
{
157-
public Guid AnimationId;
158-
159-
public bool AutoRotate;
160-
161-
public int SpawnRange = 1;
162-
163-
public ProjectileAnimation(Guid animationId, int spawnRange, bool autoRotate)
164-
{
165-
AnimationId = animationId;
166-
SpawnRange = spawnRange;
167-
AutoRotate = autoRotate;
168-
}
169-
}
148+
}

Framework/Intersect.Framework.Core/GameObjects/SpellBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ public partial class SpellCombatData
190190

191191
[NotMapped]
192192
[JsonIgnore]
193-
public ProjectileBase Projectile
193+
public ProjectileDescriptor Projectile
194194
{
195-
get => ProjectileBase.Get(ProjectileId);
195+
get => ProjectileDescriptor.Get(ProjectileId);
196196
set => ProjectileId = value?.Id ?? Guid.Empty;
197197
}
198198

Intersect.Client.Core/Entities/Projectiles/Projectile.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public partial class Projectile : Entity
1818

1919
private readonly object _lock = new();
2020

21-
private ProjectileBase? _myBase;
21+
private ProjectileDescriptor? _myBase;
2222

2323
private Guid _owner;
2424

@@ -76,14 +76,14 @@ public override void Load(EntityPacket? packet)
7676
DirectionFacing = (Direction)pkt.ProjectileDirection;
7777
_targetId = pkt.TargetId;
7878
_owner = pkt.OwnerId;
79-
_myBase = ProjectileBase.Get(_projectileId);
79+
_myBase = ProjectileDescriptor.Get(_projectileId);
8080
if (_myBase != null)
8181
{
82-
for (var x = 0; x < ProjectileBase.SPAWN_LOCATIONS_WIDTH; x++)
82+
for (var x = 0; x < ProjectileDescriptor.SPAWN_LOCATIONS_WIDTH; x++)
8383
{
84-
for (var y = 0; y < ProjectileBase.SPAWN_LOCATIONS_HEIGHT; y++)
84+
for (var y = 0; y < ProjectileDescriptor.SPAWN_LOCATIONS_HEIGHT; y++)
8585
{
86-
for (var d = 0; d < ProjectileBase.MAX_PROJECTILE_DIRECTIONS; d++)
86+
for (var d = 0; d < ProjectileDescriptor.MAX_PROJECTILE_DIRECTIONS; d++)
8787
{
8888
if (_myBase.SpawnLocations[x, y].Directions[d] == true)
8989
{
@@ -182,11 +182,11 @@ private void AddProjectileSpawns()
182182
var spawn = FindSpawnAnimationData();
183183
var animBase = AnimationDescriptor.Get(_myBase.Animations[spawn].AnimationId);
184184

185-
for (var x = 0; x < ProjectileBase.SPAWN_LOCATIONS_WIDTH; x++)
185+
for (var x = 0; x < ProjectileDescriptor.SPAWN_LOCATIONS_WIDTH; x++)
186186
{
187-
for (var y = 0; y < ProjectileBase.SPAWN_LOCATIONS_HEIGHT; y++)
187+
for (var y = 0; y < ProjectileDescriptor.SPAWN_LOCATIONS_HEIGHT; y++)
188188
{
189-
for (var d = 0; d < ProjectileBase.MAX_PROJECTILE_DIRECTIONS; d++)
189+
for (var d = 0; d < ProjectileDescriptor.MAX_PROJECTILE_DIRECTIONS; d++)
190190
{
191191
// Check if the current direction is enabled for spawning at this location.
192192
if (_myBase.SpawnLocations[x, y].Directions[d] == true)
@@ -254,7 +254,7 @@ private static int FindProjectileRotation(Direction direction, int x, int y, boo
254254
}
255255

256256
private static Direction FindProjectileRotationDir(Direction entityDir, Direction projectionDir) =>
257-
(Direction)ProjectileBase.ProjectileRotationDir[(int)entityDir * ProjectileBase.MAX_PROJECTILE_DIRECTIONS + (int)projectionDir];
257+
(Direction)ProjectileDescriptor.ProjectileRotationDir[(int)entityDir * ProjectileDescriptor.MAX_PROJECTILE_DIRECTIONS + (int)projectionDir];
258258

259259
/// <summary>
260260
/// Calculates the projectile range based on the given direction, range, and axis.
@@ -729,8 +729,8 @@ private bool Collided(int i)
729729
z: Z,
730730
mapId: spawn.MapId,
731731
blockedBy: ref blockedBy,
732-
ignoreAliveResources: spawn.ProjectileBase.IgnoreActiveResources,
733-
ignoreDeadResources: spawn.ProjectileBase.IgnoreExhaustedResources,
732+
ignoreAliveResources: spawn.ProjectileDescriptor.IgnoreActiveResources,
733+
ignoreDeadResources: spawn.ProjectileDescriptor.IgnoreExhaustedResources,
734734
ignoreNpcAvoids: true,
735735
projectileTrigger: true
736736
);
@@ -750,14 +750,14 @@ private bool Collided(int i)
750750

751751
break;
752752
case -2: // Collision with a map block
753-
if (!spawn.ProjectileBase.IgnoreMapBlocks)
753+
if (!spawn.ProjectileDescriptor.IgnoreMapBlocks)
754754
{
755755
killSpawn = true;
756756
}
757757

758758
break;
759759
case -3: // Collision with a Z-dimension block
760-
if (!spawn.ProjectileBase.IgnoreZDimension)
760+
if (!spawn.ProjectileDescriptor.IgnoreZDimension)
761761
{
762762
killSpawn = true;
763763
}

Intersect.Client.Core/Entities/Projectiles/ProjectileSpawns.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public partial class ProjectileSpawns
2323

2424
public float OffsetY;
2525

26-
public ProjectileBase ProjectileBase;
26+
public ProjectileDescriptor ProjectileDescriptor;
2727

2828
public Guid SpawnMapId;
2929

@@ -49,7 +49,7 @@ public ProjectileSpawns(
4949
Guid mapId,
5050
AnimationDescriptor animationDescriptor,
5151
bool autoRotate,
52-
ProjectileBase projectileBase,
52+
ProjectileDescriptor projectileDescriptor,
5353
Entity parent
5454
)
5555
{
@@ -63,8 +63,8 @@ Entity parent
6363
Dir = dir;
6464
Anim = new Animation(animationDescriptor, true, autoRotate, Z, parent);
6565
AutoRotate = autoRotate;
66-
ProjectileBase = projectileBase;
67-
TransmissionTimer = Timing.Global.Milliseconds + (ProjectileBase.Speed / ProjectileBase.Range);
66+
ProjectileDescriptor = projectileDescriptor;
67+
TransmissionTimer = Timing.Global.Milliseconds + (ProjectileDescriptor.Speed / ProjectileDescriptor.Range);
6868
}
6969

7070
public void Dispose()

Intersect.Client.Core/Interface/Game/DescriptionWindows/SpellDescriptionWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected void SetupHeader()
9292
{
9393
if (mSpell.Combat.TargetType == SpellTargetType.Projectile)
9494
{
95-
var proj = ProjectileBase.Get(mSpell.Combat.ProjectileId);
95+
var proj = ProjectileDescriptor.Get(mSpell.Combat.ProjectileId);
9696
header.SetDescription(Strings.SpellDescription.TargetTypes[(int)mSpell.Combat.TargetType].ToString(proj?.Range ?? 0, mSpell.Combat.HitRadius), Color.White);
9797
}
9898
else

Intersect.Editor/Forms/Editors/Events/frmEvent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ public void InitEditor(bool disableNaming, bool disableTriggers, bool questEvent
10211021

10221022
cmbTriggerVal.Items.Clear();
10231023
cmbTriggerVal.Items.Add(Strings.General.None);
1024-
cmbTriggerVal.Items.AddRange(ProjectileBase.Names);
1024+
cmbTriggerVal.Items.AddRange(ProjectileDescriptor.Names);
10251025
}
10261026

10271027
chkIsGlobal.Checked = Convert.ToBoolean(MyEvent.Global);

0 commit comments

Comments
 (0)