mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
- new item: when planting tripwire roll (Item# 1640), a tripwire item is created, thereby making planting multiple wires much easier. Teipwires can be merged to create a roll
- new item tag: <buddyitem> connects items to other items. Connection specifics depend on items involved git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6455 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -5151,6 +5151,32 @@ BOOLEAN OBJECTTYPE::AttachObjectNAS( SOLDIERTYPE * pSoldier, OBJECTTYPE * pAttac
|
||||
}
|
||||
break;
|
||||
|
||||
case TRIPWIRE_ROLL:
|
||||
{
|
||||
// check if this can work
|
||||
if ( Item[ this->usItem ].tripwire && Item[pAttachment->usItem].tripwire && Item[ this->usItem ].usItemFlag == TRIPWIREROLL )
|
||||
{
|
||||
if ( (*this)[subObject]->data.objectStatus < 100 )
|
||||
(*this)[subObject]->data.objectStatus++;
|
||||
else
|
||||
{
|
||||
pSoldier->DoMercBattleSound( BATTLE_SOUND_CURSE1 );
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
pAttachment->RemoveObjectsFromStack(1);
|
||||
}
|
||||
|
||||
//UINT16 usOldItem = this->usItem;
|
||||
//this->usItem = usResult;
|
||||
|
||||
//WarmSteel - Replaced this with one that also checks default attachments, otherwise you could not replace built-in bonuses with default inseperable attachments.
|
||||
//RemoveProhibitedAttachments(pSoldier, this, usResult);
|
||||
//ReInitMergedItem(pSoldier, this, usOldItem, 0);
|
||||
}
|
||||
break;
|
||||
// fall through
|
||||
|
||||
case ELECTRONIC_MERGE:
|
||||
if ( pSoldier )
|
||||
{
|
||||
@@ -5312,6 +5338,12 @@ BOOLEAN OBJECTTYPE::AttachObjectNAS( SOLDIERTYPE * pSoldier, OBJECTTYPE * pAttac
|
||||
if ( ubType != TREAT_ARMOUR )
|
||||
{
|
||||
(*this)[subObject]->data.objectStatus = ((*this)[subObject]->data.objectStatus + (*pAttachment)[0]->data.objectStatus) / 2;
|
||||
|
||||
// Flugente: if the new item has the TRIPWIREROLL property, it only gets status 2 upon creation via merges
|
||||
if ( Item[ this->usItem ].usItemFlag == TRIPWIREROLL )
|
||||
{
|
||||
(*this)[subObject]->data.objectStatus = 2;
|
||||
}
|
||||
}
|
||||
|
||||
//ADB ubWeight has been removed, see comments in OBJECTTYPE
|
||||
|
||||
Reference in New Issue
Block a user