mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
- removed the CLOTHES_CIVILIAN-flag, as it is not needed anymore
- the Strip function now removes the covert tags, or takes off custom clothes if already not covert - fix: XML_Clothes.cpp was not included git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5567 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -15073,56 +15073,76 @@ void SOLDIERTYPE::LooseDisguise( void )
|
||||
this->bSoldierFlagMask &= ~(SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER);
|
||||
}
|
||||
|
||||
// take off any clothes item and switch back to original clothes
|
||||
// undisguise or take off any clothes item and switch back to original clothes
|
||||
// no - this function does not want you think it does. Leave Fox alone, you perv.
|
||||
void SOLDIERTYPE::Strip()
|
||||
{
|
||||
// loose any covert and clothes flags
|
||||
this->bSoldierFlagMask &= ~(SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER|SOLDIER_NEW_VEST|SOLDIER_NEW_PANTS);
|
||||
|
||||
UINT16 vestitem = 0;
|
||||
if ( GetFirstClothesItemWithSpecificData(&vestitem, this->VestPal, "blank") )
|
||||
// if covert, loose that ability
|
||||
if ( this->bSoldierFlagMask & (SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER) )
|
||||
{
|
||||
CreateItem( vestitem, 100, &gTempObject );
|
||||
if ( !AutoPlaceObject( this, &gTempObject, FALSE ) )
|
||||
AddItemToPool( this->sGridNo, &gTempObject, 1, 0, 0, -1 );
|
||||
// loose any covert flags
|
||||
this->bSoldierFlagMask &= ~(SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER);
|
||||
}
|
||||
// if already not covert, take off clothes
|
||||
else if ( this->bSoldierFlagMask & (SOLDIER_NEW_VEST|SOLDIER_NEW_PANTS) )
|
||||
{
|
||||
// loose any clothes flags
|
||||
this->bSoldierFlagMask &= ~(SOLDIER_NEW_VEST|SOLDIER_NEW_PANTS);
|
||||
|
||||
UINT16 vestitem = 0;
|
||||
if ( GetFirstClothesItemWithSpecificData(&vestitem, this->VestPal, "blank") )
|
||||
{
|
||||
CreateItem( vestitem, 100, &gTempObject );
|
||||
if ( !AutoPlaceObject( this, &gTempObject, FALSE ) )
|
||||
AddItemToPool( this->sGridNo, &gTempObject, 1, 0, 0, -1 );
|
||||
}
|
||||
else
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_NO_CLOTHES_ITEM] );
|
||||
|
||||
UINT16 pantsitem = 0;
|
||||
if ( GetFirstClothesItemWithSpecificData(&pantsitem, "blank", this->PantsPal) )
|
||||
{
|
||||
CreateItem( pantsitem, 100, &gTempObject );
|
||||
if ( !AutoPlaceObject( this, &gTempObject, FALSE ) )
|
||||
AddItemToPool( this->sGridNo, &gTempObject, 1, 0, 0, -1 );
|
||||
}
|
||||
else
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_NO_CLOTHES_ITEM] );
|
||||
|
||||
// show our true colours
|
||||
UINT16 usPaletteAnimSurface = LoadSoldierAnimationSurface( this, this->usAnimState );
|
||||
|
||||
if ( usPaletteAnimSurface != INVALID_ANIMATION_SURFACE )
|
||||
{
|
||||
UINT8 ubProfileIndex;
|
||||
MERCPROFILESTRUCT * pProfile;
|
||||
|
||||
ubProfileIndex = this->ubProfile;
|
||||
pProfile = &(gMercProfiles[ubProfileIndex]);
|
||||
|
||||
SET_PALETTEREP_ID ( this->VestPal, pProfile->VEST );
|
||||
SET_PALETTEREP_ID ( this->PantsPal, pProfile->PANTS );
|
||||
|
||||
// Use palette from HVOBJECT, then use substitution for pants, etc
|
||||
memcpy( this->p8BPPPalette, gAnimSurfaceDatabase[ usPaletteAnimSurface ].hVideoObject->pPaletteEntry, sizeof( this->p8BPPPalette ) * 256 );
|
||||
|
||||
SetPaletteReplacement( this->p8BPPPalette, this->HeadPal );
|
||||
SetPaletteReplacement( this->p8BPPPalette, this->VestPal );
|
||||
SetPaletteReplacement( this->p8BPPPalette, this->PantsPal );
|
||||
SetPaletteReplacement( this->p8BPPPalette, this->SkinPal );
|
||||
|
||||
this->CreateSoldierPalettes();
|
||||
}
|
||||
}
|
||||
else
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_NO_CLOTHES_ITEM] );
|
||||
|
||||
UINT16 pantsitem = 0;
|
||||
if ( GetFirstClothesItemWithSpecificData(&pantsitem, "blank", this->PantsPal) )
|
||||
{
|
||||
CreateItem( pantsitem, 100, &gTempObject );
|
||||
if ( !AutoPlaceObject( this, &gTempObject, FALSE ) )
|
||||
AddItemToPool( this->sGridNo, &gTempObject, 1, 0, 0, -1 );
|
||||
}
|
||||
else
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_NO_CLOTHES_ITEM] );
|
||||
|
||||
// show our true colours
|
||||
UINT16 usPaletteAnimSurface = LoadSoldierAnimationSurface( this, this->usAnimState );
|
||||
|
||||
if ( usPaletteAnimSurface != INVALID_ANIMATION_SURFACE )
|
||||
{
|
||||
UINT8 ubProfileIndex;
|
||||
MERCPROFILESTRUCT * pProfile;
|
||||
|
||||
ubProfileIndex = this->ubProfile;
|
||||
pProfile = &(gMercProfiles[ubProfileIndex]);
|
||||
|
||||
SET_PALETTEREP_ID ( this->VestPal, pProfile->VEST );
|
||||
SET_PALETTEREP_ID ( this->PantsPal, pProfile->PANTS );
|
||||
|
||||
// Use palette from HVOBJECT, then use substitution for pants, etc
|
||||
memcpy( this->p8BPPPalette, gAnimSurfaceDatabase[ usPaletteAnimSurface ].hVideoObject->pPaletteEntry, sizeof( this->p8BPPPalette ) * 256 );
|
||||
|
||||
SetPaletteReplacement( this->p8BPPPalette, this->HeadPal );
|
||||
SetPaletteReplacement( this->p8BPPPalette, this->VestPal );
|
||||
SetPaletteReplacement( this->p8BPPPalette, this->PantsPal );
|
||||
SetPaletteReplacement( this->p8BPPPalette, this->SkinPal );
|
||||
|
||||
this->CreateSoldierPalettes();
|
||||
// if the player is an annoying little perv, tell them so, girls!
|
||||
if ( this->ubBodyType == REGFEMALE )
|
||||
{
|
||||
// sigh. We were hired by an idiot.
|
||||
TacticalCharacterDialogue( this, QUOTE_IMPATIENT_QUOTE );
|
||||
this->aiData.bMorale = max(0, this->aiData.bMorale - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user