Tile getSpecialCreature(const ViewObject& obj, bool humanoid) { RandomGen r; r.init(hash<string>()(obj.getBareDescription())); string let = humanoid ? "WETUIPLKJHFAXBM" : "qwetyupkfaxbnm"; char c; if (contains(let, obj.getBareDescription()[0])) c = obj.getBareDescription()[0]; else if (contains(let, tolower(obj.getBareDescription()[0]))) c = tolower(obj.getBareDescription()[0]); else c = let[r.get(let.size())]; return Tile::unicode(c, ColorId(Random.get(EnumInfo<ColorId>::getSize()))); }
Tile getSpecialCreature(const ViewObject& obj, bool humanoid) { RandomGen r; r.init(hash<string>()(obj.getBareDescription())); string let = humanoid ? "WETUIPLKJHFAXBM" : "qwetyupkfaxbnm"; char c; if (contains(let, obj.getBareDescription()[0])) c = obj.getBareDescription()[0]; else if (contains(let, tolower(obj.getBareDescription()[0]))) c = tolower(obj.getBareDescription()[0]); else c = let[r.getRandom(let.size())]; Color col(r.getRandom(80, 250), r.getRandom(80, 250), 0); return Tile(c, col); }
Tile getSpecialCreatureSprite(const ViewObject& obj, bool humanoid) { RandomGen r; r.init(hash<string>()(obj.getBareDescription())); if (humanoid) return Tile::byCoord(r.get(7), 10); else return Tile::byCoord(r.get(7, 10), 10); }