Skip to content

Commit a912462

Browse files
committed
Update LylyraHelper integration to use Melvin custom fill colors
1 parent c1d046a commit a912462

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/Entities/Misc/Melvin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class Melvin : Solid
1212
private readonly ParticleType P_Activate;
1313
private readonly ParticleType P_Attack;
1414

15-
private readonly Color fill;
15+
internal readonly Color fill;
1616

1717
#region Tiles
1818
// yeah.

src/Imports/LylyraHelper.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static void Load()
4949
RegisterSimpleSolidSlicerAction(typeof(DreamFloatySpaceBlock), GetDreamEntityData, "000000", 8, 8, null);
5050
RegisterSimpleSolidSlicerAction(typeof(DreamMoveBlock), GetDreamEntityData, "000000", 8, 8, null);
5151
RegisterSimpleSolidSlicerAction(typeof(LoopBlock), (Entity data, DynamicData slicer) => {return (data as LoopBlock).creatingData;}, null, 24, 24, null); //color is overridden via a custom function so it matches the loop block being cut
52-
RegisterSimpleSolidSlicerAction(typeof(Melvin), (Entity data, DynamicData slicer) => { return (data as Melvin).creationData; }, "62222b", 24, 24, null); // color taken from fillColor in Melvin.cs
52+
RegisterSimpleSolidSlicerAction(typeof(Melvin), (Entity data, DynamicData slicer) => { return (data as Melvin).creationData; }, null, 24, 24, null); //color is overridden via a custom function so it matches the melvin being cut
5353

5454
//vanity function registration for LoopBlocks
5555
Dictionary<string, Delegate> loopBlockDict = new() {
@@ -60,7 +60,7 @@ public static void Load()
6060
}
6161
}
6262
};
63-
RegisterSlicerActionSet(typeof(DreamFallingBlock), loopBlockDict);
63+
RegisterSlicerActionSet(typeof(LoopBlock), loopBlockDict);
6464
//these methods are needed to fix small things in the DreamMoveBlocks and DreamFallingBlocks
6565

6666
//This method activates the DreamFallingBlock after being sliced
@@ -123,10 +123,16 @@ public static void Load()
123123
(created as Melvin).crushDir = -slicer.Get<Vector2>("Direction");
124124
(created as Melvin).Attack(true); //slicer hit it counts as a dash right?
125125
};
126+
Func<Entity, DynamicData, Color> melvinParticleColor = (Entity created, DynamicData _) =>
127+
{
128+
return (created as Melvin).fill;
129+
};
130+
126131
Dictionary<string, Delegate> melvinDict = new Dictionary<string, Delegate>()
127132
{
128133
{ "activate", melvinActivate },
129-
{ "postslice", melvinReturn}
134+
{ "postslice", melvinReturn },
135+
{ "getparticlecolor", melvinParticleColor }
130136
};
131137

132138
RegisterSlicerActionSet(typeof(Melvin), melvinDict);

0 commit comments

Comments
 (0)