Use bitwise and.
In case you didn't know yet, each bit is a flag. Back in the 7.x days, you could fit all flags in 8 bits (1 byte), like so:
Code:
00000001 Poisoned
00000010 Burning
00000100 Energized
00001000 Drunk
00010000 Manashielded
00100000 Paralyzed
01000000 Hasted
10000000 Battle
You then compare the player's current flag to the flag want to check, like so:
Code:
11010001 & (battle, hasted, manashielded, poisoned)
00010000 =
00010000
Naturally more flags have been added since.
Protip: when making your flags enum (or whichever type), use bit-shifting, like so:
Code:
public enum Flags
{
Poisoned = 1,
Burning = 1 << 1, // 2^1
Energized = 1 << 2, // 2^2
Drunken = 1 << 3, // 2^3 etc
Manashielded = 1 << 4,
Paralyzed = 1 << 5,
Hasted = 1 << 6,
Battle = 1 << 7
}