4 new tags in Items.xml that modify skill checks. (by JMich)

- LockPickModifier modifies the lockpick chance by a specific number. If the number is positive, it is proportional to the locksmith kit's status, if the number is negative, it will always be the same. Tag is ignored if the item isn't a LocksmithKit. FindLocksmithKit should return the one that gives the biggest bonus, but it may have trouble with stacked lockpicks. Hovering over the "Locksmith Kit" icon in UDB should tell you how much of a bonus (or penalty) that item gives you.

- CrowbarModifier increases your chances to force open by using a crowbar by the number indicated. Default vanilla crowbar has a bonus of 20, so an item with a bonus of 10 will be worse than a crowbar (but possibly smaller). FindUsableCrowbar should return the item with the biggest bonus. Tag is ignored if the item isn't a Crowbar. Hovering over the "Crowbar" Icon in UDB should tell you by how much your chances are improved, though if the item is also a weapon, the icon isn't visible.

- RepairModifier modifies a toolkit's effectiveness by that percentage. If you try to repair with a shoddy toolkit that has a RepairModifier of -20, you'll be 80% as effective, while repairing with an excellent toolkit that has a RepairModifier of 20 means you are 120% as effective. When checking if you have a toolkit at hand, it should select the one with the biggest bonus. Tag is ignored if item isn't also a Toolkit. Hovering over the "Toolkit" icon in UDB should tell you how effective the repair kit is.

- DisarmModifier increases your chances to disarm a trap by the indicated amount, modified by the Diffusal Kit's status. The FindDisarmKit should return the item with the biggest bonus, though it uses the top item in a stack. Currently using the "Wirecutters" icon in UDB, hovering over it should tell you by how much your trap disarm chance is improved.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5472 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-08-14 15:04:02 +00:00
parent 21dd880240
commit cde4ce4229
17 changed files with 275 additions and 120 deletions
+33 -4
View File
@@ -256,7 +256,6 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
INT32 iSkill;
INT32 iChance, iReportChance;
INT32 iRoll, iMadeItBy;
INT8 bSlot;
INT32 iLoop;
SOLDIERTYPE * pTeamSoldier;
INT8 bBuddyIndex;
@@ -268,6 +267,7 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
{
case LOCKPICKING_CHECK:
case ELECTRONIC_LOCKPICKING_CHECK:
INT8 bSlot;
fForceDamnSound = TRUE;
@@ -321,7 +321,16 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
// this should never happen, but might as well check...
iSkill = 0;
}
iSkill = iSkill * pSoldier->inv[bSlot][0]->data.objectStatus / 100;
else
{
//JMich_SkillsModifiers: Modifying the skill by the bonus from the lockpick, then reducing due to status
iSkill += Item[pSoldier->inv[bSlot].usItem].LockPickModifier;
}
//JMich_SkillsModifiers: If skill goes negative due to crappy lockpicks, the status of them doesn't matter.
if (iSkill > 0)
{
iSkill = (iSkill * pSoldier->inv[bSlot][0]->data.objectStatus) / 100;
}
break;
case ATTACHING_DETONATOR_CHECK:
case ATTACHING_REMOTE_DETONATOR_CHECK:
@@ -420,10 +429,15 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
break;
}
}
iSkill += EffectiveDexterity( pSoldier, FALSE ) * 2;
iSkill += EffectiveExpLevel( pSoldier ) * 10;
iSkill = iSkill / 10; // bring the value down to a percentage
//JMich_SkillModifiers: Adding a Disarm Trap bonus
bSlot = FindDisarmKit( pSoldier);
if (bSlot != NO_SLOT)
{
iSkill += Item[pSoldier->inv[bSlot].usItem].DisarmModifier * pSoldier->inv[bSlot][0]->data.objectStatus / 100;
}
// SANDRO - STOMP traits - Demolitions trait removing traps bonus
if ( gGameOptions.fNewTraitSystem )
@@ -468,6 +482,12 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
iSkill += EffectiveDexterity( pSoldier, FALSE ) * 2;
iSkill += EffectiveExpLevel( pSoldier ) * 10;
iSkill = iSkill / 10; // bring the value down to a percentage
//JMich_SkillModifiers: Adding a Disarm Trap bonus
bSlot = FindDisarmKit( pSoldier);
if (bSlot != NO_SLOT)
{
iSkill += Item[pSoldier->inv[bSlot].usItem].DisarmModifier * pSoldier->inv[bSlot][0]->data.objectStatus / 100;
}
// penalty based on poor wisdom
iSkill -= (100 - EffectiveWisdom( pSoldier ) ) / 5;
@@ -495,7 +515,16 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod )
case OPEN_WITH_CROWBAR:
// Add for crowbar...
iSkill = EffectiveStrength( pSoldier, FALSE ) + 20;
//JMich_SkillModifiers: Changing the +20 to the crowbar's bonus.
bSlot = FindUsableCrowbar( pSoldier );
if (bSlot != NO_SLOT)
{
iSkill = EffectiveStrength( pSoldier, FALSE ) + Item[pSoldier->inv[bSlot].usItem].CrowbarModifier;
}
else //how are we trying to force with a crowbar, without having one??
{
iSkill = 0;
}
fForceDamnSound = TRUE;
break;