Exemplo n.º 1
0
void add_damagetype(element* ele)
{
  if (!ele) {
    return;
  }
  std::vector<std::string> options;
  options.push_back("Cancel");
  for (int i = 1; i < DAMTYPE_MAX; i++) {
    options.push_back( get_damage_type_name( damage_type(i) ) );
  }

  int sel = menu_vec("Damage Type:", options);
  if (sel == 0) {
    return;
  }
  ele->damages.push_back( damage_type(sel) );
}
Exemplo n.º 2
0
variant equipment::get_value(const std::string& key) const
{
	if(key == "damage_type") {
		return variant(damage_type());
	} else {
		return variant(modify_stat(key));
	}
}
Exemplo n.º 3
0
void element::load_data(std::istream &datastream)
{
  name = load_to_character(datastream, ':', true);
  int tmpcolor, tmpsize;
  datastream >> id >> tmpcolor >> tmpsize;
  color = nc_color(tmpcolor);
  for (int i = 0; i < tmpsize; i++) {
    int tmptrans;
    datastream >> tmptrans;
    transformations.push_back( transform_type(tmptrans) );
  }
  datastream >> tmpsize;
  for (int i = 0; i < tmpsize; i++) {
    int tmpdam;
    datastream >> tmpdam;
    damages.push_back( damage_type(tmpdam) );
  }
}