Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FindExplosiveTrapSpots()

void Terraria.GameContent.Biomes.DeadMansChestBiome.FindExplosiveTrapSpots ( Point position)
inlineprivate

Definition at line 330 of file DeadMansChestBiome.cs.

331 {
332 int x = position.X;
333 int y = position.Y + 3;
334 List<int> list = new List<int>();
335 if (IsGoodSpotsForExplosive(x, y))
336 {
337 list.Add(x);
338 }
339 x++;
340 if (IsGoodSpotsForExplosive(x, y))
341 {
342 list.Add(x);
343 }
344 int num = -1;
345 if (list.Count > 0)
346 {
347 num = list[GenBase._random.Next(list.Count)];
348 }
349 list.Clear();
350 x += GenBase._random.Next(2, 6);
351 int num2 = 4;
352 for (int i = x; i < x + num2; i++)
353 {
354 if (IsGoodSpotsForExplosive(i, y))
355 {
356 list.Add(i);
357 }
358 }
359 int num3 = -1;
360 if (list.Count > 0)
361 {
362 num3 = list[GenBase._random.Next(list.Count)];
363 }
364 x = position.X - num2 - GenBase._random.Next(2, 6);
365 for (int j = x; j < x + num2; j++)
366 {
368 {
369 list.Add(j);
370 }
371 }
372 int num4 = -1;
373 if (list.Count > 0)
374 {
375 num4 = list[GenBase._random.Next(list.Count)];
376 }
377 if (num4 != -1)
378 {
379 _explosivePlacementAttempt.Add(new ExplosivePlacementAttempt(new Point(num4, y)));
380 }
381 if (num != -1)
382 {
383 _explosivePlacementAttempt.Add(new ExplosivePlacementAttempt(new Point(num, y)));
384 }
385 if (num3 != -1)
386 {
387 _explosivePlacementAttempt.Add(new ExplosivePlacementAttempt(new Point(num3, y)));
388 }
389 }
void Add(TKey key, TValue value)
List< ExplosivePlacementAttempt > _explosivePlacementAttempt
static UnifiedRandom _random
Definition GenBase.cs:9

References Terraria.GameContent.Biomes.DeadMansChestBiome._explosivePlacementAttempt, Terraria.WorldBuilding.GenBase._random, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), Terraria.GameContent.Biomes.DeadMansChestBiome.IsGoodSpotsForExplosive(), and Microsoft.Xna.Framework.Point.X.

Referenced by Terraria.GameContent.Biomes.DeadMansChestBiome.Place().