In order to prevent an over abundance of Shield Guns and Assault Rifles in the weapons lists for Denial folks (particularly D3 folks), I'd like to have the following put in:
In the "ModifyPawn", inside the foreach OldWeaponHolder:
Code:
if (instr(caps(Holder.Weapon.ItemName), "SHIELD GUN") > -1 || instr(caps(Holder.Weapon.ItemName), "ASSAULT RIFLE") > -1)
{
// Go ahead and find them both in the Other's inventory. This way if we end up
// having to do them both, we'll only have to do the loop once. However, we use
// a bool instead of the double check (see DruidLoaded) as we'd end up making
// SG or AR None again when we destroy the first one and doing the loop again.
for (OInv=Other.Inventory ; OInv != None && !bok ; OInv=OInv.Inventory)
{
if(instr(caps(OInv.ItemName), "SHIELD GUN") > -1)
SG=OInv;
if(instr(caps(OInv.ItemName), "ASSAULT RIFLE") > -1)
AR=OInv;
if (SG != None && AR != None)
bok = true;
}
if (instr(caps(Holder.Weapon.ItemName), "SHIELD GUN") > -1 && SG != None)
Other.DeleteInventory(SG);
if (instr(caps(Holder.Weapon.ItemName), "ASSAULT RIFLE") > -1 && AR != None)
Other.DeleteInventory(AR);
}
Testing (with some logging lines here and there) didn't reveal any bugs in this code, but did reveal some other interesting tidbits:
If Denial is purchased before Ghost, when someone "ghosts", Denial's ModifyPawn (and I'd assume others but I don't know for sure) appears to run after the Ghosting is done. The player sees something akin to getting all of their weapons all of sudden, and even possibly a weapon change.
This is not an issue if Denial shows up after Ghost in the skills list (because Denial's PD didn't do anything since it didn't have to and since Holder is empty, it has nothing to do during this run of MP). This I think is related to our other discussion about PD and MP orders. We might want to keep an eye on this potential behavior to ensure that other oddness doesn't pop up. During the middle of the week I'll do some playing around to see what else might be going on that I haven't payed attention to and that perhaps no one else has yet noticed.
Not that I've tested this yet but I'd theorize that LW's that have Denial might just get their LW generated weapon, and then also get their Denial kept weapon (note that they can only get D2) as well. This I think is a minor issue because:
They're more likely to be able to throw the extra (you can't throw the SG).
It's only one weapon.
It's not easy to figure out where a weapon in the Holder will go because you can't do a straight class comparison (all weapons come up with the class "RPGWeapon" when the mod is in play). So other than these two cases, it just doesn't seem worth trying to track down what is less of an issue for weapons beyond the SG and AR.
Hey, I'll admit I'm selfish: I'm tired of my D3 non-Ghost AM ending up with 3 or 4 shield guns (and possibly assault rifles) by wave 14.