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VMAOOGF36I4KEOPZMNMWBMQSGHL5GMQC
QVVC7AYGVA6U64PTNA7L27422NLMO327P22BQKXEVIMPZHIHO7MQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
std::string prop = propnames[i] + ",";
item.inscription = replace_all(item.inscription, prop, "");
prop = propnames[i];
item.inscription = replace_all(item.inscription, prop, "");
item.inscription = replace_all(item.inscription, propnames[i]+",", "");
item.inscription = replace_all(item.inscription, propnames[i], "");
if (known_proprt( RAP_AC ))
{
description += "$It affects your AC (";
append_value(description, proprt[ RAP_AC ], true);
description += ").";
}
const property_descriptor propdescs[] = {
{ RAP_AC, "It affects your AC (%d).", false },
{ RAP_EVASION, "It affects your evasion (%d).", false},
{ RAP_STRENGTH, "It affects your strength (%d).", false},
{ RAP_INTELLIGENCE, "It affects your intelligence (%d).", false},
{ RAP_DEXTERITY, "It affects your dexterity (%d).", false},
{ RAP_ACCURACY, "It affects your accuracy (%d).", false},
{ RAP_DAMAGE, "It affects your damage-dealing abilities (%d).", false},
{ RAP_FIRE, "fire", true},
{ RAP_COLD, "cold", true},
{ RAP_ELECTRICITY, "It insulates you from electricity.", false},
{ RAP_POISON, "It protects you from poison.", false},
{ RAP_NEGATIVE_ENERGY, "negative energy", true},
{ RAP_MAGIC, "It increases your resistance to enchantments.", false},
{ RAP_MAGICAL_POWER, "It affects your mana capacity (%d).", false},
{ RAP_EYESIGHT, "It enhances your eyesight.", false},
{ RAP_INVISIBLE, "It lets you turn invisible.", false},
{ RAP_LEVITATE, "It lets you levitate.", false},
{ RAP_BLINK, "It lets you blink.", false},
{ RAP_CAN_TELEPORT, "It lets you teleport.", false},
{ RAP_BERSERK, "It lets you go berserk.", false},
{ RAP_MAPPING, "It lets you sense your surroundings.", false},
{ RAP_NOISES, "It makes noises.", false},
{ RAP_PREVENT_SPELLCASTING, "It prevents spellcasting.", false},
{ RAP_CAUSE_TELEPORTATION, "It causes teleportation.", false},
{ RAP_PREVENT_TELEPORTATION, "It prevents most forms of teleportation.",
false},
{ RAP_ANGRY, "It makes you angry.", false}
};
if (known_proprt( RAP_STRENGTH ))
{
description += "$It affects your strength (";
append_value(description, proprt[ RAP_STRENGTH ], true);
description += ").";
}
// FIXME Not the nicest hack.
char buf[80];
snprintf(buf, sizeof buf, "%+d", proprt[propdescs[i].property]);
sdesc = replace_all(sdesc, "%d", buf);
if (known_proprt( RAP_INTELLIGENCE ))
{
description += "$It affects your intelligence (";
append_value(description, proprt[ RAP_INTELLIGENCE ], true);
description += ").";
}
if (known_proprt( RAP_DEXTERITY ))
{
description += "$It affects your dexterity (";
append_value(description, proprt[ RAP_DEXTERITY ], true);
description += ").";
}
if (known_proprt( RAP_ACCURACY ))
{
description += "$It affects your accuracy (";
append_value(description, proprt[ RAP_ACCURACY ], true);
description += ").";
}
if (known_proprt( RAP_DAMAGE ))
{
description += "$It affects your damage-dealing abilities (";
append_value(description, proprt[ RAP_DAMAGE ], true);
description += ").";
}
if (known_proprt( RAP_FIRE ))
{
if (proprt[ RAP_FIRE ] < -2)
description += "$It makes you extremely vulnerable to fire. ";
else if (proprt[ RAP_FIRE ] == -2)
description += "$It makes you very vulnerable to fire. ";
else if (proprt[ RAP_FIRE ] == -1)
description += "$It makes you vulnerable to fire. ";
else if (proprt[ RAP_FIRE ] == 1)
description += "$It protects you from fire. ";
else if (proprt[ RAP_FIRE ] == 2)
description += "$It greatly protects you from fire. ";
else if (proprt[ RAP_FIRE ] > 2)
description += "$It renders you almost immune to fire. ";
}
if (known_proprt( RAP_COLD ))
{
if (proprt[ RAP_COLD ] < -2)
description += "$It makes you extremely vulnerable to cold. ";
else if (proprt[ RAP_COLD ] == -2)
description += "$It makes you very vulnerable to cold. ";
else if (proprt[ RAP_COLD ] == -1)
description += "$It makes you vulnerable to cold. ";
else if (proprt[ RAP_COLD ] == 1)
description += "$It protects you from cold. ";
else if (proprt[ RAP_COLD ] == 2)
description += "$It greatly protects you from cold. ";
else if (proprt[ RAP_COLD ] > 2)
description += "$It renders you almost immune to cold. ";
}
if (known_proprt( RAP_ELECTRICITY ))
description += "$It insulates you from electricity. ";
if (known_proprt( RAP_POISON ))
description += "$It protects you from poison. ";
if ( propdescs[i].is_graded_resist )
{
int idx = proprt[propdescs[i].property] + 3;
if ( idx < 0 )
idx = 0;
if ( idx > 6 )
idx = 6;
const char* prefixes[] = {
"It makes you extremely vulnerable to ",
"It makes you very vulnerable to ",
"It makes you vulnerable to ",
"Buggy descriptor!",
"It protects you from ",
"It greatly protects you from ",
"It renders you almost immune to "
};
sdesc = prefixes[idx] + sdesc + '.';
}
if (known_proprt( RAP_NEGATIVE_ENERGY ))
{
if (proprt[ RAP_NEGATIVE_ENERGY ] == 1)
description += "$It partially protects you from negative energy. ";
else if (proprt[ RAP_NEGATIVE_ENERGY ] == 2)
description += "$It protects you from negative energy. ";
else if (proprt[ RAP_NEGATIVE_ENERGY ] > 2)
description += "$It renders you almost immune to "
"negative energy. ";
}
if (known_proprt( RAP_MAGIC ))
description += "$It increases your resistance to enchantments. ";
if (known_proprt( RAP_STEALTH ))
{
if (proprt[ RAP_STEALTH ] < 0)
{
if (proprt[ RAP_STEALTH ] < -20)
description += "$It makes you much less stealthy. ";
else
description += "$It makes you less stealthy. ";
description += '$';
description += sdesc;
if (known_proprt( RAP_MAGICAL_POWER ))
{
description += "$It affects your mana capacity (";
append_value(description, proprt[ RAP_MAGICAL_POWER ], true);
description += ").";
}
if (known_proprt( RAP_EYESIGHT ))
description += "$It enhances your eyesight. ";
if (known_proprt( RAP_INVISIBLE ))
description += "$It lets you turn invisible. ";
if (known_proprt( RAP_LEVITATE ))
description += "$It lets you levitate. ";
if (known_proprt( RAP_BLINK ))
description += "$It lets you blink. ";
if (known_proprt( RAP_CAN_TELEPORT ))
description += "$It lets you teleport. ";
if (known_proprt( RAP_BERSERK ))
description += "$It lets you go berserk. ";
if (known_proprt( RAP_MAPPING ))
description += "$It lets you sense your surroundings. ";
if (known_proprt( RAP_NOISES ))
description += "$It makes noises. ";
if (known_proprt( RAP_PREVENT_SPELLCASTING ))
description += "$It prevents spellcasting. ";
if (known_proprt( RAP_CAUSE_TELEPORTATION ))
description += "$It causes teleportation. ";
if (known_proprt( RAP_PREVENT_TELEPORTATION ))
description += "$It prevents most forms of teleportation. ";
if (known_proprt( RAP_ANGRY ))
description += "$It makes you angry. ";
// Some special cases which don't fit into the above.
description += "$It glows with mutagenic radiation. ";
else if (proprt[ RAP_MUTAGENIC ])
description += "$It emits mutagenic radiation. ";
description += "$It glows with mutagenic radiation.";
else
description += "$It emits mutagenic radiation.";
for (unsigned i = 0; i < ghost.name.length(); i++)
globby += ghost.name[i];
globby *= ghost.name.length();
const long seed =
std::accumulate(ghost.name.begin(), ghost.name.end(), 0L) *
ghost.name.length();
std::string description = "A powerful demon, ";
const char* body_descs[] = {
" huge, barrel-shaped ",
" wispy, insubstantial ",
" spindly ",
" skeletal ",
" horribly deformed ",
" spiny ",
" waif-like ",
" scaly ",
" sickeningly deformed ",
" bruised and bleeding ",
" sickly ",
" mass of writhing tentacles for a ",
" mass of ropey tendrils for a ",
" tree trunk-like ",
" hairy ",
" furry ",
" fuzzy ",
"n obese ",
" fat ",
" slimy ",
" wrinkled ",
" metallic ",
" glassy ",
" crystalline ",
" muscular ",
"n icky ",
" swollen ",
" lumpy ",
"n armoured ",
" carapaced ",
" slender "
};
description += ghost.name;
description += " has a";
const char* wing_names[] = {
" with small insectoid wings",
" with large insectoid wings",
" with moth-like wings",
" with butterfly wings",
" with huge, bat-like wings",
" with fleshy wings",
" with small, bat-like wings",
" with hairy wings",
" with great feathered wings",
" with shiny metal wings"
};
switch (random2(31))
{
case 0:
description += " huge, barrel-shaped ";
break;
case 1:
description += " wispy, insubstantial ";
break;
case 2:
description += " spindly ";
break;
case 3:
description += " skeletal ";
break;
case 4:
description += " horribly deformed ";
break;
case 5:
description += " spiny ";
break;
case 6:
description += " waif-like ";
break;
case 7:
description += " scaly ";
break;
case 8:
description += " sickeningly deformed ";
break;
case 9:
description += " bruised and bleeding ";
break;
case 10:
description += " sickly ";
break;
case 11:
description += " mass of writhing tentacles for a ";
break;
case 12:
description += " mass of ropey tendrils for a ";
break;
case 13:
description += " tree trunk-like ";
break;
case 14:
description += " hairy ";
break;
case 15:
description += " furry ";
break;
case 16:
description += " fuzzy ";
break;
case 17:
description += "n obese ";
break;
case 18:
description += " fat ";
break;
case 19:
description += " slimy ";
break;
case 20:
description += " wrinkled ";
break;
case 21:
description += " metallic ";
break;
case 22:
description += " glassy ";
break;
case 23:
description += " crystalline ";
break;
case 24:
description += " muscular ";
break;
case 25:
description += "n icky ";
break;
case 26:
description += " swollen ";
break;
case 27:
description += " lumpy ";
break;
case 28:
description += "n armoured ";
break;
case 29:
description += " carapaced ";
break;
case 30:
description += " slender ";
break;
}
const char* lev_names[] = {
" which hovers in mid-air",
" with sacs of gas hanging from its back"
};
const char* nonfly_names[] = {
" covered in tiny crawling spiders",
" covered in tiny crawling insects",
" and the head of a crocodile",
" and the head of a hippopotamus",
" and a cruel curved beak for a mouth",
" and a straight sharp beak for a mouth",
" and no head at all",
" and a hideous tangle of tentacles for a mouth",
" and an elephantine trunk",
" and an evil-looking proboscis",
" and dozens of eyes",
" and two ugly heads",
" and a long serpentine tail",
" and a pair of huge tusks growing from its jaw",
" and a single huge eye, in the centre of its forehead",
" and spikes of black metal for teeth",
" and a disc-shaped sucker for a head",
" and huge, flapping ears",
" and a huge, toothy maw in the centre of its chest",
" and a giant snail shell on its back",
" and a dozen heads",
" and the head of a jackal",
" and the head of a baboon",
" and a huge, slobbery tongue",
" which is covered in oozing lacerations",
" and the head of a frog",
" and the head of a yak",
" and eyes out on stalks",
};
description += "body";
const char* misc_descs[] = {
" It seethes with hatred of the living.",
" Tiny orange flames dance around it.",
" Tiny purple flames dance around it.",
" It is surrounded by a weird haze.",
" It glows with a malevolent light.",
" It looks incredibly angry.",
" It oozes with slime.",
" It dribbles constantly.",
" Mould grows all over it.",
" It looks diseased.",
" It looks as frightened of you as you are of it.",
" It moves in a series of hideous convulsions.",
" It moves with an unearthly grace.",
" It hungers for your soul!",
" It leaves a glistening oily trail.",
" It shimmers before your eyes.",
" It is surrounded by a brilliant glow.",
" It radiates an aura of extreme power.",
};
case 1: // proper flight
switch (random2(10))
{
case 0:
description += " with small insectoid wings";
break;
case 1:
description += " with large insectoid wings";
break;
case 2:
description += " with moth-like wings";
break;
case 3:
description += " with butterfly wings";
break;
case 4:
description += " with huge, bat-like wings";
break;
case 5:
description += " with fleshy wings";
break;
case 6:
description += " with small, bat-like wings";
break;
case 7:
description += " with hairy wings";
break;
case 8:
description += " with great feathered wings";
break;
case 9:
description += " with shiny metal wings";
break;
default:
break;
}
case 1:
description << RANDOM_ELEMENT(wing_names);
switch (random2(40))
{
default:
break;
case 12:
description += " covered in tiny crawling spiders";
break;
case 13:
description += " covered in tiny crawling insects";
break;
case 14:
description += " and the head of a crocodile";
break;
case 15:
description += " and the head of a hippopotamus";
break;
case 16:
description += " and a cruel curved beak for a mouth";
break;
case 17:
description += " and a straight sharp beak for a mouth";
break;
case 18:
description += " and no head at all";
break;
case 19:
description += " and a hideous tangle of tentacles for a mouth";
break;
case 20:
description += " and an elephantine trunk";
break;
case 21:
description += " and an evil-looking proboscis";
break;
case 22:
description += " and dozens of eyes";
break;
case 23:
description += " and two ugly heads";
break;
case 24:
description += " and a long serpentine tail";
break;
case 25:
description += " and a pair of huge tusks growing from its jaw";
break;
case 26:
description +=
" and a single huge eye, in the centre of its forehead";
break;
case 27:
description += " and spikes of black metal for teeth";
break;
case 28:
description += " and a disc-shaped sucker for a head";
break;
case 29:
description += " and huge, flapping ears";
break;
case 30:
description += " and a huge, toothy maw in the centre of its chest";
break;
case 31:
description += " and a giant snail shell on its back";
break;
case 32:
description += " and a dozen heads";
break;
case 33:
description += " and the head of a jackal";
break;
case 34:
description += " and the head of a baboon";
break;
case 35:
description += " and a huge, slobbery tongue";
break;
case 36:
description += " which is covered in oozing lacerations";
break;
case 37:
description += " and the head of a frog";
break;
case 38:
description += " and the head of a yak";
break;
case 39:
description += " and eyes out on stalks";
break;
}
if ( !one_chance_in(4) )
description << RANDOM_ELEMENT(nonfly_names);
case 0:
description += " It stinks of brimstone.";
break;
case 1:
description += " It smells like rotting flesh";
if (you.mutation[MUT_SAPROVOROUS] == 3)
description += " - yum!";
else
description += ".";
break;
case 2:
description += " It is surrounded by a sickening stench.";
break;
case 3:
description += " It seethes with hatred of the living.";
break;
case 4:
description += " Tiny orange flames dance around it.";
break;
case 5:
description += " Tiny purple flames dance around it.";
break;
case 6:
description += " It is surrounded by a weird haze.";
break;
case 7:
description += " It glows with a malevolent light.";
break;
case 8:
description += " It looks incredibly angry.";
break;
case 9:
description += " It oozes with slime.";
break;
case 10:
description += " It dribbles constantly.";
break;
case 11:
description += " Mould grows all over it.";
break;
case 12:
description += " It looks diseased.";
break;
case 13:
description += " It looks as frightened of you as you are of it.";
break;
case 14:
description += " It moves in a series of hideous convulsions.";
break;
case 15:
description += " It moves with an unearthly grace.";
break;
case 16:
description += " It hungers for your soul!";
break;
case 17:
description += " It leaves a glistening oily trail.";
break;
case 18:
description += " It shimmers before your eyes.";
break;
case 19:
description += " It is surrounded by a brilliant glow.";
break;
case 20:
description += " It radiates an aura of extreme power.";
break;
default:
break;
if ( player_can_smell() )
{
switch ( random2(3) )
{
case 0:
description << " It stinks of brimstone.";
break;
case 1:
description << " It is surrounded by a sickening stench.";
break;
case 2:
description << " It smells like rotting flesh"
<< (you.mutation[MUT_SAPROVOROUS] == 3 ?
" - yum!" : ".");
break;
}
}
if (ego != SPARM_NORMAL
&& item_type_known(item)
&& verbose)
if (ego != SPARM_NORMAL && item_type_known(item) && verbose)