Beispiel #1
0
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);
}
Beispiel #2
0
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())));
}
Beispiel #3
0
Vec2 Rectangle::randomVec2() const {
  return Vec2(Random.get(px, kx), Random.get(py, ky));
}