2using System.Collections.Generic;
3using Microsoft.Xna.Framework;
4using Microsoft.Xna.Framework.Graphics;
85 if (item.Value.lifeTime <= 0)
98 public static void DrawAll(SpriteBatch sb)
126 int whoAmI =
anch.entity.whoAmI;
129 whoAmI = projectile.identity;
130 item = (projectile.owner << 8) | item;
132 return Tuple.Create(item, whoAmI);
134 return Tuple.Create(0, 0);
165 throw new Exception(
"How did you end up getting this?");
240 for (
int i = 0; i < 200; i++)
245 int direction = (nPC.position.X < player.
position.X).ToDirectionInt();
249 nPC.direction = direction;
250 nPC.netUpdate =
true;
276 private void Draw(SpriteBatch sb)
337 SpriteEffects effect = (SpriteEffects)0;
339 position = position.Floor();
342 Vector2 origin =
default(Vector2);
347 effect = (SpriteEffects)(effect | 2);
353 position +=
new Vector2((
float)(((
Enum)effect).
HasFlag((
Enum)(
object)(SpriteEffects)1) ? 1 : (-1)), (float)(-
emoteFrame.Height + 3));
375 if ((
emote == 87 ||
emote == 89) && ((
Enum)effect).HasFlag((
Enum)(object)(SpriteEffects)1))
377 effect = (SpriteEffects)(effect & -2);
380 sb.Draw(value, position, (Rectangle?)
emoteFrame, Color.White, 0
f, origin, 1
f, effect, 0
f);
382 else if (
emote == -1)
386 if ((
float)value.Width / 22
f > 1
f)
388 num = 22
f / (float)value.Width;
390 if ((
float)value.Height / 16
f > 1
f /
num)
392 num = 16
f / (float)value.Height;
394 sb.Draw(value, position, (Rectangle?)
null, Color.White, 0
f,
new Vector2((
float)(value.Width / 2), 0
f),
num, effect, 0
f);
424 effect = (SpriteEffects)0;
427 effect = (SpriteEffects)0;
428 return anchor.pos - Main.screenPosition +
new Vector2(0
f, (0
f -
anchor.
size.Y) / 2
f);
430 effect = (SpriteEffects)0;
474 for (
int i = 0; i < 200; i++)
538 else if (list.Count > 0)
591 list.Add(
Utils.SelectRandom<
int>(
Main.
rand, 127, 128, 129, 126));
634 if (
plr.inventory[
plr.selectedItem].type == 215 ||
Main.
rand.Next(3) == 0)
648 if (
plr.statLife <
plr.statLifeMax2 / 2)
660 for (
int j = 0;
j < 200;
j++)
691 else if (
plr.ZoneHallow)
695 else if (
plr.ZoneCorrupt)
699 else if (
plr.ZoneCrimson)
703 else if (
plr.ZoneJungle)
707 else if (
plr.ZoneSnow)
715 else if (
plr.ZoneDesert)
719 else if (
plr.ZoneForest)
960 else if (
nPC.type == 18)
967 else if (
nPC.type == 19)
993 else if (
nPC.type == 20)
995 if (list.Contains(121))
1003 else if (
nPC.type == 22)
1026 else if (
nPC.type == 37)
1034 else if (
nPC.type == 38)
1054 else if (
nPC.type == 54)
1064 if (list.Contains(111))
1071 else if (
nPC.type == 107)
1087 if (list.Contains(111))
1099 else if (
nPC.type == 108)
1105 if (
nPC.type == 124)
1119 if (list.Contains(109))
1125 if (list.Contains(108))
1142 else if (
nPC.type == 142)
1150 else if (
nPC.type == 160)
1157 else if (
nPC.type == 178)
1162 else if (
nPC.type == 207)
1168 else if (
nPC.type == 208)
1175 else if (
nPC.type == 209)
1182 else if (
nPC.type == 227)
1187 else if (
nPC.type == 228)
1194 else if (
nPC.type == 229)
1202 else if (
nPC.type == 353)
1204 if (list.Contains(104))
1209 if (list.Contains(111))
1216 else if (
nPC.type == 368)
1222 else if (
nPC.type == 369)
1238 else if (
nPC.type == 453)
1245 else if (
nPC.type == 441)
1263 return byID.GetValueOrDefault(whoAmI);
static bool CanHitLine(Vector2 Position1, int Width1, int Height1, Vector2 Position2, int Width2, int Height2)
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
float Distance(Vector2 Other)
Vector2 position
The position of this Entity in world coordinates.
int width
The width of this Entity's hitbox, in pixels.
virtual Vector2 VisualPosition
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
static bool DownedInvasionAnyDifficulty
static Asset< Texture2D >[] Extra
static Asset< Texture2D >[] NpcHead
int WhoAmI
The whoAmI indicator that indicates this T:Terraria.GameContent.UI.EmoteBubble, can be used in M:Terr...
void ProbeEvents(List< int > list)
static int NewBubbleNPC(WorldUIAnchor bubbleAnchor, int time, WorldUIAnchor other=null)
Use this method to make NPCs use a random emote based on the pick emote table.
void ProbeExceptions(List< int > list, Player plr, WorldUIAnchor other)
static void MakeLocalPlayerEmote(int emoteId)
Send a emote from P:Terraria.Main.LocalPlayer. Should never be called on server.
static void CheckForNPCsToReactToEmoteBubble(int emoteID, Player player)
Try to find a NPC close enough (less than 200 pixels) to react to the emote sent by the player.
void ProbeWeather(List< int > list, Player plr)
static Dictionary< int, EmoteBubble > byID
void PickNPCEmote(WorldUIAnchor other=null)
static EmoteBubble GetExistingEmoteBubble(int whoAmI)
Gets the emote bubble that exists in the world by P:Terraria.GameContent.UI.EmoteBubble....
const int EMOTE_SHEET_EMOTES_PER_ROW
EmoteBubble(int emotion, WorldUIAnchor bubbleAnchor, int time=180)
void ProbeDebuffs(List< int > list, Player plr)
Vector2 GetPosition(out SpriteEffects effect)
static WorldUIAnchor DeserializeNetAnchor(int type, int meta)
void ProbeItems(List< int > list, Player plr)
void ProbeCritters(List< int > list)
const int EMOTE_SHEET_HORIZONTAL_FRAMES
static Tuple< int, int > SerializeNetAnchor(WorldUIAnchor anch)
static List< int > toClean
void ProbeTownNPCs(List< int > list)
void ProbeEmotions(List< int > list)
bool IsFullyDisplayed
Whether or not this emote is fully displayed The first and the last 6 frames are for bubble-popping ...
void Draw(SpriteBatch sb)
static void MakePlayerEmote(Player player, int emoteId, bool syncBetweenClients=true)
Send a emote from the player.
static int NewBubble(int emoticon, WorldUIAnchor bubbleAnchor, int time)
Use this method to spawn a emote bubble.
static void DrawAll(SpriteBatch sb)
static void OnBubbleChange(int bubbleID)
GlobalEmoteBubble[] _globals
void ProbeCombat(List< int > list)
RefReadOnlyArray< GlobalEmoteBubble > EntityGlobals
void ProbeBiomes(List< int > list, Player plr)
void ProbeBosses(List< int > list)
int emote
This is the internal ID of this EmoteBubble.
static readonly int EMOTE_SHEET_VERTICAL_FRAMES
static readonly int Count
static int[] FaceEmote
Associates a town NPC's NPC type (F:Terraria.NPC.type) with its corresponding T:Terraria....
static readonly short Count
static double time
The time that has passed since it last became day/night. Increased by F:Terraria....
static int maxTilesY
The height of the currently-loaded world in tiles.
static double worldSurface
The y-coordinate of the top of the dirt layer, in tile coordinates. Corresponds to 0' on the Depth Me...
static int myPlayer
The index in F:Terraria.Main.player of this client's Player. If this is 255, this client is the ser...
static Vector2 ReverseGravitySupport(Vector2 pos, float height=0f)
static int netMode
Denotes the current network mode: 0 for single player client, 1 for multiplayer client,...
static double rockLayer
The y-coordinate of the top of the caverns layer, in tile coordinates.
static readonly int maxProjectiles
static Vector2 screenPosition
The position of the top left corner of the screen in world coordinates. Modify in M:Terraria....
static int maxTilesX
The width of the currently-loaded world in tiles.
static Projectile[] projectile
static UnifiedRandom rand
static float cloudBGActive
static Player LocalPlayer
Retrieves the T:Terraria.Player object for the local user. Shorthand for F:Terraria....
static bool UpdateFrame(EmoteBubble emoteBubble)
static void PostDraw(EmoteBubble emoteBubble, SpriteBatch spriteBatch, Texture2D texture, Vector2 position, Rectangle frame, Vector2 origin, SpriteEffects spriteEffects)
static ? Rectangle GetFrame(EmoteBubble emoteBubble)
static void OnSpawn(EmoteBubble emoteBubble)
static bool PreDraw(EmoteBubble emoteBubble, SpriteBatch spriteBatch, Texture2D texture, Vector2 position, Rectangle frame, Vector2 origin, SpriteEffects spriteEffects)
Manages content added by mods. Liasons between mod content and Terraria's arrays and oversees the Loa...
virtual string Texture
The file name of this emote's texture file in the mod loader's file space.
Represents an emote. Emotes are typically used by players or NPC. Players can use the emotes menu or ...
static bool AllowVanillaClients
static ? int PickEmote(NPC npc, Player closestPlayer, List< int > emoteList, WorldUIAnchor anchor)
This serves as the central class from which NPC-related functions are carried out....
static bool downedChristmasSantank
Denotes whether or not at least one Santa-NK1 has been defeated in the current world.
static bool downedFrost
Denotes whether or not the Frost Legion has been defeated at least once in the current world.
static bool downedMechBoss2
Denotes whether or not the Twins have been defeated at least once in the current world.
static bool downedBoss2
Denotes whether or not the Eater of Worlds OR the Brain of Cthulhu have been defeated at least once i...
static bool downedMechBossAny
Denotes whether or not ANY Mechanical Boss has been defeated at least once in the current world.
static bool downedEmpressOfLight
Denotes whether or not the Empress of Light has been defeated at least once in the current world.
static bool downedHalloweenKing
Denotes whether or not at least one Pumpking has been defeated in the current world.
static bool downedBoss1
Denotes whether or not the Eye of Cthulhu has been defeated at least once in the current world.
static bool downedMechBoss3
Denotes whether or not Skeletron Prime has been defeated at least once in the current world.
static bool downedPirates
Denotes whether or not at least one Pirate Invasion has been defeated in the current world.
static bool downedMoonlord
Denotes whether or not the Moon Lord has been defeated at least once in the current world.
static bool downedQueenBee
Denotes whether or not at least one Queen Bee has been defeated in the current world.
static bool downedHalloweenTree
Denotes whether or not at least one Mourning Wood has been defeated in the current world.
static bool downedChristmasTree
Denotes whether or not at least one Everscream has been defeated in the current world.
static bool downedGoblins
Denotes whether or not at least one Goblin Army has been defeated in the current world.
static bool downedGolemBoss
Denotes whether or not Golem has been defeated at least once in the current world.
static bool downedMartians
Denotes whether or not at least one Martian Madness event has been cleared in the current world.
static bool downedChristmasIceQueen
Denotes whether or not at least one Ice Queen has been defeated in the current world.
static bool downedAncientCultist
Denotes whether or not the Lunatic Cultist has been defeated at least once in the current world.
static bool downedBoss3
Denotes whether or not Skeletron has been defeated at least once in the current world.
static bool downedPlantBoss
Denotes whether or not Plantera has been defeated at least once in the current world.
static bool downedMechBoss1
Denotes whether or not the Destroyer has been defeated at least once in the current world.
static bool downedDeerclops
Denotes whether or not the Deerclops has been defeated at least once in the current world.
static bool downedQueenSlime
Denotes whether or not Queen Slime has been defeated at least once in the current world.
static void SendData(int msgType, int remoteClient=-1, int ignoreClient=-1, NetworkText text=null, int number=0, float number2=0f, float number3=0f, float number4=0f, int number5=0, int number6=0, int number7=0)
static byte FindClosest(Vector2 Position, int Width, int Height)
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
int identity
The projectile's universal unique identifier, which is the same on all clients and the server....