mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
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:
+51
-7
@@ -11566,18 +11566,22 @@ INT8 FindCannon( SOLDIERTYPE * pSoldier )
|
||||
|
||||
INT8 FindUsableCrowbar( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
INT8 bLoop;
|
||||
//JMich_SkillModifiers: Adding a bonus check, to return the best crowbar, and modifying the return value.
|
||||
INT8 bLoop, bonus, FoundCrowbar;
|
||||
FoundCrowbar = NO_SLOT;
|
||||
bonus = -101;
|
||||
|
||||
for (bLoop = 0; bLoop < (INT8) pSoldier->inv.size(); bLoop++)
|
||||
{
|
||||
if (pSoldier->inv[bLoop].exists() == true) {
|
||||
if ( Item[pSoldier->inv[bLoop].usItem].crowbar && pSoldier->inv[bLoop][0]->data.objectStatus >= USABLE )
|
||||
if ( Item[pSoldier->inv[bLoop].usItem].crowbar && pSoldier->inv[bLoop][0]->data.objectStatus >= USABLE && Item[pSoldier->inv[bLoop].usItem].CrowbarModifier > bonus)
|
||||
{
|
||||
return( bLoop );
|
||||
bonus = Item[pSoldier->inv[bLoop].usItem].CrowbarModifier;
|
||||
FoundCrowbar = bLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
return( NO_SLOT );
|
||||
return( FoundCrowbar );
|
||||
}
|
||||
|
||||
OBJECTTYPE* FindAttachedBatteries( OBJECTTYPE * pObj )
|
||||
@@ -11652,20 +11656,60 @@ INT8 FindCamoKit( SOLDIERTYPE * pSoldier )
|
||||
}
|
||||
return( NO_SLOT );
|
||||
}
|
||||
//JMich_SkillModifiers: Adding a function to see if we have an item with disarm bonus
|
||||
INT8 FindDisarmKit( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
INT8 bLoop, bonus, FoundKit;
|
||||
FoundKit = NO_SLOT;
|
||||
bonus = 0;
|
||||
|
||||
for (bLoop = 0; bLoop < (INT8) pSoldier->inv.size(); bLoop++)
|
||||
{
|
||||
if (pSoldier->inv[bLoop].exists() == true) {
|
||||
if ( ( ( Item[pSoldier->inv[bLoop].usItem].DisarmModifier * pSoldier->inv[bLoop][0]->data.objectStatus ) / 100 ) > bonus )
|
||||
{
|
||||
bonus = Item[pSoldier->inv[bLoop].usItem].DisarmModifier * pSoldier->inv[bLoop][0]->data.objectStatus / 100;;
|
||||
FoundKit = bLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
return( FoundKit );
|
||||
}
|
||||
INT8 FindLocksmithKit( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
INT8 bLoop;
|
||||
//JMich_SkillModifiers: Adding a bonus check, to return the best LocksmithKit, and modifying the return value.
|
||||
INT8 bLoop, bonus, FoundKit;
|
||||
FoundKit = NO_SLOT;
|
||||
bonus = -101;
|
||||
|
||||
for (bLoop = 0; bLoop < (INT8) pSoldier->inv.size(); bLoop++)
|
||||
{
|
||||
if (pSoldier->inv[bLoop].exists() == true) {
|
||||
if (Item[pSoldier->inv[bLoop].usItem].locksmithkit )
|
||||
{
|
||||
return( bLoop );
|
||||
//JMich_SkillModifiers: If the locksmith kit has a bonus, reduce it based on the status, so we use the best bonus.
|
||||
if (Item[pSoldier->inv[bLoop].usItem].LockPickModifier > 0 )
|
||||
{
|
||||
if ( ( Item[pSoldier->inv[bLoop].usItem].LockPickModifier * pSoldier->inv[bLoop][0]->data.objectStatus / 100 ) > bonus )
|
||||
{
|
||||
bonus = ( Item[pSoldier->inv[bLoop].usItem].LockPickModifier * pSoldier->inv[bLoop][0]->data.objectStatus / 100 );
|
||||
FoundKit = bLoop;
|
||||
}
|
||||
|
||||
}
|
||||
//JMich_SkillModifiers: If on the other hand the locksmith is a shoddy one, keep that penalty regardless of status.
|
||||
else
|
||||
{
|
||||
if ( Item[pSoldier->inv[bLoop].usItem].LockPickModifier > bonus )
|
||||
{
|
||||
bonus = Item[pSoldier->inv[bLoop].usItem].LockPickModifier;
|
||||
FoundKit = bLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return( NO_SLOT );
|
||||
return( FoundKit );
|
||||
}
|
||||
INT8 FindWalkman( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user