Skip to content

Commit

Permalink
thanks dino
Browse files Browse the repository at this point in the history
  • Loading branch information
JMM889901 committed Feb 3, 2022
1 parent d1ac024 commit 539a29b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions PeePee.MutatorPack/mod/scripts/vscripts/stealing.gnut
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ void function SwapWeapons(entity victim, entity attacker){
}
}
void function SwapAbilities(entity victim, entity attacker){
foreach(entity offhand in attacker.GetOffhandWeapons()){
if(attacker.GetOffhandWeapons().find(offhand) != OFFHAND_INVENTORY){
attacker.TakeWeaponNow(offhand.GetWeaponClassName())}
foreach(entity offhand in victim.GetOffhandWeapons()){
int index = victim.GetOffhandWeapons().find(offhand)
if(index != OFFHAND_INVENTORY){
attacker.GiveOffhandWeapon(offhand.GetWeaponClassName(), index)}
for ( int i = 0; i <= OFFHAND_MELEE; i++ ) // OFFHAND_MELEE is the largest
{
if ( i != OFFHAND_INVENTORY )
{
if ( IsValid( attacker.GetOffhandWeapon( i ) ))
attacker.TakeWeaponNow( attacker.GetOffhandWeapon(i).GetWeaponClassName() )
if ( IsValid( victim.GetOffhandWeapon( i ) ))
attacker.GiveOffhandWeapon( victim.GetOffhandWeapon( i ).GetWeaponClassName(), i)
}
}
}
}
bool function ValidSteal(entity victim, entity attacker){
if ( !victim.IsPlayer() || !attacker.IsPlayer() || GetGameState() != eGameState.Playing )
return false
Expand Down

0 comments on commit 539a29b

Please sign in to comment.