Ejemplo n.º 1
0
        private static TCODColor GetRarityColour(RCell cell, TCODColor defaultColour)
        {
            if (cell.Is(RCell.Uncommon))
            {
                return(TCODColor.lightGreen);
            }

            if (cell.Is(RCell.Rare))
            {
                return(TCODColor.lighterBlue);
            }

            if (cell.Is(RCell.Epic))
            {
                return(TCODColor.lightMagenta);
            }

            if (cell.Is(RCell.Legendary))
            {
                return(TCODColor.lightYellow);
            }

            if (cell.Is(RCell.Artifact))
            {
                return(TCODColor.lightRed);
            }

            return(defaultColour);
        }
Ejemplo n.º 2
0
        public static Stat GetStatBonus(this RCell cell)
        {
            // lemme just take a moment to tell you C# is a PITA to work with flags...
            var       cellAsLong = (ulong)cell;
            const int offset     = (int)RCell.StatBonusOffset;

            return((Stat)(cellAsLong >> offset));
        }
Ejemplo n.º 3
0
        public static RCell InsertCombatBonus(this RCell cell, ulong combatBonus)
        {
            var       cellAsLong = (ulong)cell;
            const int offset     = (int)RCell.StatBonusOffset;
            var       shift      = combatBonus << offset;
            var       result     = cellAsLong | shift;

            return((RCell)result);
        }
Ejemplo n.º 4
0
 public static bool IsTransparent(this RCell cell)
 {
     return(!cell.Is(RCell.LightBlocking) || cell.Is(RCell.Transparent));
 }
Ejemplo n.º 5
0
 public static bool IsWalkable(this RCell cell)
 {
     return(cell.Is(RCell.Walkable));
 }
Ejemplo n.º 6
0
 public static bool Is(this RCell cell, RCell attribute)
 {
     return((cell & attribute) > 0);
 }