When handing out body armour via scroll acquirement, use a rough order of armour subtypes and assign weights according to Armour skill, i.e. robes are most likely at Armour skill 0 and crystal plate mail is most likely at Armour skill 27 (well, 24+, to be exact).
When handing out mundane items, consider the shield slot to be filled if the character is unarmed has a high UC skill, or is wielding a two-hander, a ranged weapon, or a rod. I don't know how much shields hamper spellcasting - that could be included as well.
In the creation of artefacts (also outside acquirement) make sure that those boring randarts that only have one stat property (AC, EV, Str, Dex, Int) get another one, and there's a chance of getting a third. Also, if the only property is Acc or Dam there's a 50% chance of getting one or two more. As before, the bonus properties are all stat properties, so this shouldn't be too powerful.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10501 c06c8d41-db1a-0410-9941-cceddc491573
6ZDCG4JTGE6VQO755P4COB2BW2STIBVL2LX7EPBGP4JE54AIJKYQC
HKPD4Y2U4A6IJLF6KSWEUT5WYHMQRYZPIOEVULCQLCZ5O6SQZPPQC
DCZMEKDHQWSQCQYQD6ZXB3XOMWLVLPSPVSBVVMPXMSZF7GO3BVCAC
HHHZGZT7QAERYSE26QGJPFAV6TQQXXECP6RTCLF6SZQ5L6GTXPWAC
OE3TD4J5FSIFAM37J2UPEV7QQNXLSZM6GDUMPI66LC5LW2OM2J4AC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
FAVME2A2U4OUKN2BTISAG5PCI5Y4BN6YVFKCSQQHHZLEVVVF4LKAC
TYRQMDB4PCK6K4WOC6XSMAGRR2FIEUIQSM7RQO7ZZ44MY37HEA3QC
KU5FY6KSLTGH44KEZT4SFANRKCTWCQC7VABCMNYJRZNJSYSOXAKQC
IXLNOTBJGHKESBCTME6QAR6XVWFNCHYGMS62V62ZJEA7VLQHXO2QC
7K5P2GRF6QUXTMERG2R3BB6DZFQYJQ6V2KNPMBPFDLOP36NQILPAC
ZQ55TG7UDO6QYKNZGYLETDPGZ7TEWMCCT5S4IU4XMQOLTM6DZYHQC
X3ZYEJMCHJC27L6YT2NRYB6EN2T3XFRJNUENVHGRPBUKMTVHAGVQC
5YMFMYMV3MRQOJQ6YTJRJL3WS7C4AFB74ZIFOFOEBU5B7YBMS2TAC
3XCAUQHISGMK5SBFEVCMFQTCXN3ECJZVMKHO7SCZ2YKAWG2OK3DAC
LDBTCT5WIPLJPZWXS2RUQ26QKISCUUTLO77M464WOE6VSYSNPKYAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
RDZRRV2H4QIV2X3F2FT5NOEWIX56LS3CYS3APOLXUHY6TYNT52LQC
7AWYHENXBDI4OLKU7JD56YAKT5RO6UZ67HEBNPOILXCIFW6BONRAC
46MRRHVYJ3BS74R2BEVUWEWJCI4FCRBSLZ3NWMQCE6FUCNE5P73QC
S34LKQDIQJLIWVIPASOJBBZ6ZCXDHP5KPS7TRBZJSCDRVNCLK6UAC
const armour_type armours[] = { ARM_ROBE, ARM_LEATHER_ARMOUR,
ARM_RING_MAIL, ARM_SCALE_MAIL,
ARM_CHAIN_MAIL, ARM_SPLINT_MAIL,
ARM_BANDED_MAIL, ARM_PLATE_MAIL };
if (okawaru)
{
const armour_type armours[] = { ARM_ROBE, ARM_LEATHER_ARMOUR,
ARM_RING_MAIL, ARM_SCALE_MAIL,
ARM_CHAIN_MAIL, ARM_SPLINT_MAIL,
ARM_BANDED_MAIL, ARM_PLATE_MAIL };
if (one_chance_in(10))
result = ARM_ANIMAL_SKIN;
if (one_chance_in(10))
result = ARM_ANIMAL_SKIN;
}
else
{
const armour_type armours[] =
{ ARM_ANIMAL_SKIN, ARM_ROBE, ARM_LEATHER_ARMOUR,
ARM_RING_MAIL, ARM_SCALE_MAIL, ARM_CHAIN_MAIL,
ARM_BANDED_MAIL, ARM_SPLINT_MAIL, ARM_PLATE_MAIL,
ARM_CRYSTAL_PLATE_MAIL };
const int num_arms = ARRAYSZ(armours);
// Weight sub types relative to (armour skill + 3).
// Actually, the AC improvement is not linear, and we might
// also want to take into account Dodging/Stealth and Strength,
// but this is definitely better than the random chance above.
const int skill = std::min(27, you.skills[SK_ARMOUR] + 3);
int total = 0;
for (int i = 0; i < num_arms; ++i)
{
const int weight = std::max(1, 27 - abs(skill - i*3));
total += weight;
if (x_chance_in_y(weight, total))
result = armours[i];
}
}
// Consider shield slot filled in some cases.
if (armour_slots[i] == EQ_SHIELD)
{
if (you.equip[EQ_WEAPON] == -1)
{
if (you.skills[SK_UNARMED_COMBAT] > random2(8))
continue;
}
else
{
const item_def weapon = you.inv[you.equip[EQ_WEAPON]];
const hands_reqd_type hand = hands_reqd(weapon, player_size());
if (hand == HANDS_TWO || item_is_rod(weapon)
|| is_range_weapon(weapon))
{
continue;
}
}
}
// Determine if we need to skip any of the above.
if (cl == OBJ_ARMOUR || cl == OBJ_JEWELLERY && ty == RING_PROTECTION)
skip = 0;
else if (cl == OBJ_JEWELLERY && ty == RING_EVASION)
skip = 1;
else if (cl == OBJ_JEWELLERY && ty == RING_STRENGTH)
skip = 2;
else if (cl == OBJ_JEWELLERY && ty == RING_INTELLIGENCE)
skip = 3;
else if (cl == OBJ_JEWELLERY && ty == RING_DEXTERITY)
skip = 4;
const artefact_prop_type artprops[] = { ARTP_AC, ARTP_EVASION,
ARTP_STRENGTH, ARTP_INTELLIGENCE,
ARTP_DEXTERITY };
prop = random2(4);
if (prop >= skip)
prop++;
}
else
{
prop = random2(5);
int prop = RANDOM_ELEMENT(artprops);
if (proprt[prop] != 0)
continue;
switch (prop)
{
case ARTP_AC:
if (cl == OBJ_ARMOUR
|| cl == OBJ_JEWELLERY && ty == RING_PROTECTION)
{
continue;
}
_randart_propset(proprt, ARTP_AC,
1 + random2(3) + random2(3) + random2(3),
negench);
break;
case ARTP_EVASION:
if (cl == OBJ_JEWELLERY && ty == RING_EVASION)
continue;
_randart_propset(proprt, ARTP_EVASION,
1 + random2(3) + random2(3) + random2(3),
negench);
break;
case ARTP_STRENGTH:
if (cl == OBJ_JEWELLERY && ty == RING_STRENGTH)
continue;
_randart_propset(proprt, ARTP_STRENGTH,
1 + random2(3) + random2(3),
negench);
break;
case ARTP_INTELLIGENCE:
if (cl == OBJ_JEWELLERY && ty == RING_INTELLIGENCE)
continue;
_randart_propset(proprt, ARTP_INTELLIGENCE,
1 + random2(3) + random2(3),
negench);
break;
case ARTP_DEXTERITY:
if (cl == OBJ_JEWELLERY && ty == RING_DEXTERITY)
continue;
_randart_propset(proprt, ARTP_DEXTERITY,
1 + random2(3) + random2(3),
negench);
break;
}
switch (prop)
// An artefact will pass this check if it has any non-stat properties, and
// also if it has enough stat (AC, EV, Str, Dex, Int, Acc, Dam) properties.
static bool _check_stat_props( const artefact_properties_t &proprt )
{
int num_stats = 0;
int num_acc_dam = 0;
for (int i = 0; i < ARTP_NUM_PROPERTIES; i++)
default:
case 0:
_randart_propset(proprt, ARTP_AC,
1 + random2(3) + random2(3) + random2(3),
negench);
break;
case 1:
_randart_propset(proprt, ARTP_EVASION,
1 + random2(3) + random2(3) + random2(3),
negench);
break;
case 2:
_randart_propset(proprt, ARTP_STRENGTH,
1 + random2(3) + random2(3),
negench);
break;
case 3:
_randart_propset(proprt, ARTP_INTELLIGENCE,
1 + random2(3) + random2(3),
negench);
break;
case 4:
_randart_propset(proprt, ARTP_DEXTERITY,
1 + random2(3) + random2(3),
negench);
break;
if (i == ARTP_CURSED)
continue;
if (proprt[i] == 0)
continue;
if (i >= ARTP_AC && i <= ARTP_DEXTERITY)
num_stats++;
else if (i >= ARTP_ACCURACY && i <= ARTP_DAMAGE)
num_acc_dam++;
else
return (true);
return (negench ? -1 : 1);
// If an artefact has no properties at all, something is wrong.
if (num_stats == 0)
return (false);
// Artefacts with two of more stat-only properties are fine.
if (num_stats >= 2)
return (true);
// If an artefact has exactly one stat property, we might want to add
// some more. (50% chance if it's Acc/Dam, else always.)
return (num_acc_dam > 0 || coinflip());
(tmp >= 14) ? SPWPN_PROTECTION :
(tmp >= 10) ? SPWPN_VENOM
: SPWPN_VORPAL + random2(3);
(tmp >= 14) ? SPWPN_PROTECTION :
(tmp >= 10) ? SPWPN_VENOM
: SPWPN_VORPAL + random2(3);
artefact_properties_t proprt;
artefact_wpn_properties( item, proprt );
return artefact_wpn_num_props( proprt );
}
int artefact_wpn_num_props( const artefact_properties_t &proprt )
{