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AC
BTO5WE4OEK64DZQVNYLOESM74KKQNE7KSNMQVF5UDB26OBKP7ORQC
LZBHBSCXDX2JKU2BSO5QP3WDHFIGHPXK4CKUZV6FWYDRFWLQK26QC
IXVKL2SINZN4DMJSZSYFVK5YLGSBGV4KCN7GKYQL7SZQDCM3S7YQC
S3RNWZ2RPHNTLEPNYRJPQ3PIAP5PW5S3YAQAYQQ5INWLKDKS7XNAC
int percent_done = ((you.skill_points[x] - (prev_needed * spec_abil) / 100) * 100) / (((needed - prev_needed) * spec_abil) / 100);
int percent_done = ((you.skill_points[x] -
(prev_needed * spec_abil) / 100) * 100) /
(((needed - prev_needed) * spec_abil) / 100);
const int get_thing = getch();
if (get_thing == '!' && (!player_genus(GENPC_DRACONIAN) ||
you.max_level >= 7))
const int keyin = getch();
if (keyin == '!' && player_knows_aptitudes())
menu_letter lcount = 'a'; // toggle skill practise
int x;
for (int i = 0; i < ndisplayed_skills; i++)
const skill_type x = skill_display_order[i];
if (x == SK_BLANK_LINE || x == SK_COLUMN_BREAK)
continue;
if (you.skills[x] == 0)
continue;
if (keyin == lcount)
x = skill_display_order[i];
if (x == SK_BLANK_LINE || x == SK_COLUMN_BREAK)
continue;
if (you.skills[x] == 0)
continue;
if (get_thing == lcount)
{
you.practise_skill[x] = !you.practise_skill[x];
break;
}
++lcount;
}
continue;
you.practise_skill[x] = !you.practise_skill[x];
break;
}
++lcount;
skill_rank = ((skill_lev <= 7) ? 1 :
(skill_lev <= 14) ? 2 :
(skill_lev <= 20) ? 3 :
(skill_lev <= 26) ? 4
/* level 27 */ : 5);
const int skill_rank = ((skill_lev <= 7) ? 1 :
(skill_lev <= 14) ? 2 :
(skill_lev <= 20) ? 3 :
(skill_lev <= 26) ? 4
/* level 27 */ : 5);
std::string result;
// need species name
snprintf( title_buff, sizeof(title_buff), tempstr,
species_name(static_cast<species_type>(species), 0, true,
(ptr == tempstr
&& best_skill != SK_NECROMANCY)).c_str() );
// The above code only capitalises start-of-string racenames
tempstr = title_buff;
const bool need_cap = (where == 0 && best_skill != SK_NECROMANCY);
const std::string sp = species_name(static_cast<species_type>(species),
0, true, need_cap);
result.replace(where, 2, sp);
case 0:
return 0; // old: 0
case 1:
return 200; // old: 20
case 2:
return 300; // old: 30
case 3:
return 500; // old: 50
case 4:
return 750; // old: 75
case 5:
return 1050; // old: 105
case 6:
return 1350; // old: 145
case 7:
return 1700; // old: 200
case 8:
return 2100; // old: 275
case 9:
return 2550; // old: 355
case 10:
return 3150; // old: 440
case 11:
return 3750; // old: 560
case 12:
return 4400; // old: 680
case 13:
return 5250; // old: 850
default:
return 6200 + 1800 * (lev - 14);
// old: 1100 + 300 * (lev - 14)
// older: 1200 * (lev - 11) + ((lev - 11) * (lev - 11));// * (lev - 11))
case 0: return 0;
case 1: return 200;
case 2: return 300;
case 3: return 500;
case 4: return 750;
case 5: return 1050;
case 6: return 1350;
case 7: return 1700;
case 8: return 2100;
case 9: return 2550;
case 10: return 3150;
case 11: return 3750;
case 12: return 4400;
case 13: return 5250;
default: return 6200 + 1800 * (lev - 14);
const item_def& wep = you.inv[you.equip[EQ_WEAPON]];
// early out - don't warn for non-weapons
if (wep.base_type != OBJ_WEAPONS)
// early out - don't warn for non-weapons or launchers
if (wep.base_type != OBJ_WEAPONS || is_range_weapon(wep))
// put the standard wep name in.
strcat(wepstr, item_base_name(wep).c_str());
// only warn about str/dex for non-launcher weapons
if (!is_range_weapon( wep ))
{
#ifdef USE_NEW_COMBAT_STATS
const int stat_bonus = effective_stat_bonus();
if (stat_bonus <= -4)
{
if (you.strength < you.dex)
{
if (you.strength < 11)
mprf(MSGCH_WARN, "You have %strouble swinging %s.",
(you.strength < 7)?"":"a little ", wepstr);
else
mprf(MSGCH_WARN, "You'd be more effective with "
"%s if you were stronger.", wepstr);
}
else
{
if (you.dex < 11)
mprf(MSGCH_WARN, "Wielding %s is %s awkward.",
wepstr, (you.dex < 7) ? "fairly" : "a little" );
else
mprf(MSGCH_WARN, "You'd be more effective with "
"%s if you were nimbler.", wepstr );
}
}
#endif
// don't warn if the weapon is OK, of course
if ( effective_stat_bonus() > -4 )
// [dshaligram] No more annoying throwing skill warnings.
#ifdef OBSOLETE_THROW_SKILL_WARNING
// must be a launcher
int effSkill = you.skills[SK_THROWING] * 2 + 1;
int shoot_skill = 0;
std::string msg = (newWeapon ? "this " : "your ") + wep.name(DESC_BASENAME);
const char* mstr = msg.c_str();
case WPN_SLING:
shoot_skill = you.skills[SK_SLINGS];
break;
case WPN_BOW:
shoot_skill = you.skills[SK_BOWS];
break;
case WPN_CROSSBOW:
case WPN_HAND_CROSSBOW:
shoot_skill = you.skills[SK_CROSSBOWS];
break;
case WPN_BLOWGUN:
shoot_skill = you.skills[SK_DARTS];
break;
default:
shoot_skill = 0;
break;
if (you.strength < 11)
mprf(MSGCH_WARN, "You have %strouble swinging %s.",
(you.strength < 7) ? "" : "a little ", mstr);
else
mprf(MSGCH_WARN, "You'd be more effective with "
"%s if you were stronger.", mstr);
mprf(MSGCH_WARN,
"Your low throwing skill limits the effectiveness of %s.",
wepstr);
if (you.dex < 11)
mprf(MSGCH_WARN, "Wielding %s is %s awkward.",
mstr, (you.dex < 7) ? "fairly" : "a little" );
else
mprf(MSGCH_WARN, "You'd be more effective with "
"%s if you were nimbler.", mstr);
}
}
#define known_proprt(prop) (proprt[(prop)] && known[(prop)])
struct property_descriptors
{
const char* name;
randart_prop_type prop;
int spell_out; // 0: "+3", 1: "+++", 2: value doesn't matter
};
static std::string randart_auto_inscription( const item_def& item )
{
randart_properties_t proprt;
randart_known_props_t known;
randart_desc_properties( item, proprt, known );
std::vector<std::string> propnames;
const property_descriptors propdescs[] = {
{ "AC", RAP_AC, 0 },
{ "EV", RAP_EVASION, 0 },
{ "Str", RAP_STRENGTH, 0 },
{ "Dex", RAP_DEXTERITY, 0 },
{ "Int", RAP_INTELLIGENCE, 0 },
{ "Acc", RAP_ACCURACY, 0 },
{ "Dam", RAP_DAMAGE, 0 },
{ "RF", RAP_FIRE, 1 },
{ "RC", RAP_COLD, 1 },
{ "RE", RAP_ELECTRICITY, 1 },
{ "RP", RAP_POISON, 1 },
{ "RN", RAP_NEGATIVE_ENERGY, 1 },
{ "MP", RAP_MAGICAL_POWER, 1 },
{ "MR", RAP_MAGIC, 2 },
{ "SInv", RAP_EYESIGHT, 2 },
{ "Stl", RAP_STEALTH, 2 },
{ "Ang", RAP_BERSERK, 2 },
{ "Noi", RAP_NOISES, 2 },
{ "-Spl", RAP_PREVENT_SPELLCASTING, 2 },
{ "-Tp", RAP_PREVENT_TELEPORTATION, 2 },
{ "+Tp", RAP_CAUSE_TELEPORTATION, 2 },
{ "Hun", RAP_METABOLISM, 1 },
{ "Mut", RAP_MUTAGENIC, 2 },
{ "Inv", RAP_INVISIBLE, 2 },
{ "Lev", RAP_LEVITATE, 2 },
{ "Blk", RAP_BLINK, 2 },
{ "?Tp", RAP_CAN_TELEPORT, 2 },
{ "Map", RAP_MAPPING, 2 },
};
for ( unsigned i = 0; i < ARRAYSIZE(propdescs); ++i )
{
if (known_proprt(propdescs[i].prop))
{
const int val = proprt[propdescs[i].prop];
std::ostringstream work;
switch ( propdescs[i].spell_out )
{
case 0:
work << std::ios::showpos << val << ' ' << propdescs[i].name;
break;
case 1:
{
const int sval = std::min(std::abs(val), 3);
work << std::string(sval, (val > 0 ? '+' : '-'))
<< propdescs[i].name;
break;
}
case 2:
work << propdescs[i].name;
break;
}
propnames.push_back(work.str());
}
if (toupper(getch()) == 'Y')
// OK, technically inefficient to call randart_auto_inscription
// when we don't need to.
const bool allow_autoinscribe =
is_random_artefact(item) &&
item_ident(item, ISFLAG_KNOW_PROPERTIES) &&
(item.inscription != randart_auto_inscription(item));
if ( allow_autoinscribe )
{
formatted_string::parse_string(
"<cyan>Do you wish to inscribe this item? "
"('a' to autoinscribe) ").display();
}
else
{
formatted_string::parse_string(
"<cyan>Do you wish to inscribe this item? ").display();
}
const int keyin = getch();
if (toupper(keyin) == 'Y')