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

◆ GasTrapCheck()

static bool Terraria.Projectile.GasTrapCheck ( int x,
int y,
Player user )
inlinestatic

Definition at line 42261 of file Projectile.cs.

42262 {
42263 //IL_0119: Unknown result type (might be due to invalid IL or missing references)
42264 //IL_011b: Unknown result type (might be due to invalid IL or missing references)
42265 if (Main.netMode == 1)
42266 {
42267 return false;
42268 }
42269 int num = Chest.FindChest(x, y);
42270 if (num < 0)
42271 {
42272 return false;
42273 }
42274 Chest chest = Main.chest[num];
42275 int num2 = 16;
42276 int num3 = 16;
42277 bool flag = false;
42278 for (int i = 0; i < 40; i++)
42279 {
42280 ushort num4 = Main.tile[chest.x, chest.y].type;
42282 {
42284 if (tileData != null)
42285 {
42286 int num5 = (int)Math.Ceiling((float)tileData.Width / 2f);
42287 int num6 = (int)Math.Ceiling((float)tileData.Width / 2f);
42288 num2 = num5 * 16;
42289 num3 = num6 * 16;
42290 if (num5 % 2 != 0)
42291 {
42292 num2 += 8;
42293 }
42294 if (num6 % 2 != 0)
42295 {
42296 num3 += 8;
42297 }
42298 }
42299 }
42300 if (chest.item[i] != null && chest.item[i].type == 5346)
42301 {
42302 UseGasTrapInChest(num, chest, i, num2, num3);
42303 flag = true;
42304 break;
42305 }
42306 }
42307 if (flag)
42308 {
42309 num3 -= 8;
42310 Vector2 val = default(Vector2);
42311 ((Vector2)(ref val))._002Ector((float)(x * 16 + num2), (float)(y * 16 + num3));
42312 NewProjectile(user.GetProjectileSource_TileInteraction(x, y), val, Vector2.Zero, 1007, 10, 0f, Main.myPlayer);
42313 }
42314 return flag;
42315 }
static bool CustomPlace(int type, int style)
static TileObjectData GetTileData(int type, int style, int alternate=0)
static void UseGasTrapInChest(int chestIndex, Chest theChest, int gasTrapIndex, int gasOffsetX, int gasOffsetY)
static int NewProjectile(IEntitySource spawnSource, Vector2 position, Vector2 velocity, int Type, int Damage, float KnockBack, int Owner=-1, float ai0=0f, float ai1=0f, float ai2=0f)
This particular overload uses a Vector2 instead of X and Y to determine the actual spawn position and...

References Terraria.Main.chest, Terraria.ObjectData.TileObjectData.CustomPlace(), Terraria.Chest.FindChest(), Terraria.ObjectData.TileObjectData.GetTileData(), Terraria.Chest.item, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Main.tile, Terraria.Item.type, Terraria.Chest.x, and Terraria.Chest.y.

Referenced by Terraria.Player.Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: