Skip to content

Commit d499a97

Browse files
committed
Tidy the decompiler dust I didn't notice the first time around
Gotta SWEEP SWEEP SWEEP
1 parent 7a5ecf2 commit d499a97

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

Entities/GlassBerry.cs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class GlassBerry : Entity, IStrawberry, IStrawberrySeeded {
2424
// Requested implementations for using IStrawberrySeeded.
2525
// These are the most basic implementations thereof and there is likely no reason to change these.
2626
public List<GenericStrawberrySeed> Seeds { get; }
27-
public string gotSeedFlag { get { return "collected_seeds_of_" + ID.ToString(); } }
27+
public string gotSeedFlag => "collected_seeds_of_" + ID.ToString();
2828
public bool WaitingOnSeeds {
2929
get {
3030
if (Seeds != null)
@@ -70,15 +70,14 @@ public GlassBerry(EntityData data, Vector2 offset, EntityID gid) {
7070
isOwned = SaveData.Instance.CheckStrawberry(ID);
7171
Depth = -100;
7272
Collider = new Hitbox(14f, 14f, -7f, -7f);
73-
Add(new PlayerCollider(new Action<Player>(OnPlayer), null, null));
73+
Add(new PlayerCollider(OnPlayer));
7474
Add(new MirrorReflection());
75-
Add(Follower = new Follower(ID, null, new Action(OnLoseLeader)));
75+
Add(Follower = new Follower(ID, null, OnLoseLeader));
7676
Follower.FollowDelay = 0.3f;
7777

78-
// As part of the showcase, the Silver Berry is compatible with the GenericStrawberrySeed.
79-
// It doesn't make sense for a Silver Berry to have seeds, so this is purely for demonstration.
80-
bool flag = data.Nodes != null && data.Nodes.Length != 0;
81-
if (flag) {
78+
// It's unlikely, but there's no reason not to allow the Glass Berry to be a seeded berry.
79+
// We'll use standard GenericStrawberrySeeds; in the future, maybe a special fragile seed could be created.
80+
if (data.Nodes != null && data.Nodes.Length != 0) {
8281
Seeds = new List<GenericStrawberrySeed>();
8382
for (int i = 0; i < data.Nodes.Length; i++) {
8483
Seeds.Add(new GenericStrawberrySeed(this, offset + data.Nodes[i], i, isOwned));
@@ -100,7 +99,7 @@ public override void Added(Scene scene) {
10099

101100
// Strawberries have certain special effects during their animation sequence.
102101
// This adds a handler to enable this.
103-
sprite.OnFrameChange = new Action<string>(OnAnimate);
102+
sprite.OnFrameChange = OnAnimate;
104103

105104
// A Wiggler is capable of "shaking" and "pulsing" sprites.
106105
// This Wiggler adjusts the sprite's Scale when triggered.
@@ -146,7 +145,7 @@ public override void Added(Scene scene) {
146145

147146
// The Glass Berry's gimmick is that it breaks if the player dashes while carrying it.
148147
// So we need a generic DashListener.
149-
Add(new DashListener { OnDash = new Action<Vector2>(OnDash) });
148+
Add(new DashListener { OnDash = OnDash });
150149
}
151150

152151
// Every Entity needs an Update sequence. This is where we do the bulk of our checking for things.
@@ -257,7 +256,7 @@ private IEnumerator GlassBreakReturnRoutine() {
257256
// Add obvious "shard" lines
258257
for (int i = 0; i < 12; i++) {
259258
float dir = Calc.Random.NextFloat(6.2831855f);
260-
base.SceneAs<Level>().ParticlesFG.Emit(StrawberrySeed.P_Burst, 1, Position + Calc.AngleToVector(dir, 4f), Vector2.Zero, dir);
259+
SceneAs<Level>().ParticlesFG.Emit(StrawberrySeed.P_Burst, 1, Position + Calc.AngleToVector(dir, 4f), Vector2.Zero, dir);
261260
}
262261

263262
SceneAs<Level>().Displacement.AddBurst(Position, 0.2f, 8f, 28f, 0.2f, null, null);
@@ -308,9 +307,9 @@ public void OnCollect() {
308307
}
309308

310309
private IEnumerator CollectRoutine(int collectIndex) {
311-
Level level = base.Scene as Level;
312-
base.Tag = Tags.TransitionUpdate;
313-
base.Depth = -2000010;
310+
Level level = SceneAs<Level>();
311+
Tag = Tags.TransitionUpdate;
312+
Depth = -2000010;
314313

315314
// Use "yellow" text for a new berry, "blue" for an owned berry.
316315
// Plays the appropriate sounds, too.

0 commit comments

Comments
 (0)