1.1 release:
- Hexen compatibility (Combiner Patch will be updated soon). - Environment Map shader fixes from Doom Tournament. - Buffed Stunner so it's actually useful. This goes against what the Unreal Bible indicated but whatever, the weapon would be useless otherwise. - "Superweapons" now have +ALWAYSPICKUP for consistency. - Sneaky Strife stuff: - Dispersion Pistol and Stunner have reduced alert radius. - Rename Peacemaker sprites to avoid conflict with peasant sprites.
This commit is contained in:
parent
693933ebfb
commit
1207748311
16 changed files with 339 additions and 281 deletions
|
|
@ -1,90 +1,6 @@
|
|||
// Backpack that only gives ammo for valid weapons
|
||||
Class UnrealBackpack : BackpackItem replaces Backpack
|
||||
Class UnrealBackpack : UTBackpack
|
||||
{
|
||||
override Inventory CreateCopy( Actor other )
|
||||
{
|
||||
// Find every unique type of ammoitem. Give it to the player if
|
||||
// he doesn't have it already, and double its maximum capacity.
|
||||
for ( int i=0; i<AllActorClasses.Size(); i++ )
|
||||
{
|
||||
let type = (class<Ammo>)(AllActorClasses[i]);
|
||||
if ( !type || (type.GetParentClass() != 'Ammo') ) continue;
|
||||
// check that it's for a valid weapon
|
||||
bool isvalid = false;
|
||||
for ( int j=0; j<AllActorClasses.Size(); j++ )
|
||||
{
|
||||
let type2 = (class<Weapon>)(AllActorClasses[j]);
|
||||
if ( !type2 ) continue;
|
||||
let rep = GetReplacement(type2);
|
||||
if ( (rep != type2) && !(rep is "DehackedPickup") ) continue;
|
||||
readonly<Weapon> weap = GetDefaultByType(type2);
|
||||
if ( !other.player || !other.player.weapons.LocateWeapon(type2) || weap.bCheatNotWeapon ) continue;
|
||||
if ( (weap.AmmoType1 == type) || (weap.AmmoType2 == type) )
|
||||
{
|
||||
isvalid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( !isvalid ) continue;
|
||||
let ammoitem = Ammo(other.FindInventory(type));
|
||||
int amount = GetDefaultByType(type).BackpackAmount;
|
||||
// don't give these at all
|
||||
if ( (amount <= 0) && (GetDefaultByType(type).BackpackMaxAmount == GetDefaultByType(type).MaxAmount) ) continue;
|
||||
// extra ammo in baby mode and nightmare mode
|
||||
if ( !bIgnoreSkill ) amount = int(amount*G_SkillPropertyFloat(SKILLP_AmmoFactor));
|
||||
if ( amount < 0 ) amount = 0;
|
||||
if ( !ammoitem )
|
||||
{
|
||||
// The player did not have the ammoitem. Add it.
|
||||
ammoitem = Ammo(Spawn(type));
|
||||
ammoitem.Amount = bDepleted?0:amount;
|
||||
if ( ammoitem.BackpackMaxAmount > ammoitem.MaxAmount )
|
||||
ammoitem.MaxAmount = ammoitem.BackpackMaxAmount;
|
||||
if ( ammoitem.Amount > ammoitem.MaxAmount )
|
||||
ammoitem.Amount = ammoitem.MaxAmount;
|
||||
ammoitem.AttachToOwner(other);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The player had the ammoitem. Give some more.
|
||||
if ( ammoitem.MaxAmount < ammoitem.BackpackMaxAmount )
|
||||
ammoitem.MaxAmount = ammoitem.BackpackMaxAmount;
|
||||
if ( !bDepleted && (ammoitem.Amount < ammoitem.MaxAmount) )
|
||||
{
|
||||
ammoitem.Amount += amount;
|
||||
if ( ammoitem.Amount > ammoitem.MaxAmount )
|
||||
ammoitem.Amount = ammoitem.MaxAmount;
|
||||
}
|
||||
}
|
||||
}
|
||||
return Inventory.CreateCopy(other);
|
||||
}
|
||||
override bool HandlePickup( Inventory item )
|
||||
{
|
||||
// Since you already have a backpack, that means you already have every
|
||||
// kind of ammo in your inventory, so we don't need to look at the
|
||||
// entire PClass list to discover what kinds of ammo exist, and we don't
|
||||
// have to alter the MaxAmount either.
|
||||
if ( item is 'BackpackItem' )
|
||||
{
|
||||
for ( let probe = Owner.Inv; probe; probe = probe.Inv )
|
||||
{
|
||||
if ( probe.GetParentClass() != 'Ammo' ) continue;
|
||||
if ( probe.Amount >= probe.MaxAmount && !sv_unlimited_pickup ) continue;
|
||||
int amount = Ammo(probe).Default.BackpackAmount;
|
||||
// extra ammo in baby mode and nightmare mode
|
||||
if ( !bIgnoreSkill )
|
||||
amount = int(amount*G_SkillPropertyFloat(SKILLP_AmmoFactor));
|
||||
probe.Amount += amount;
|
||||
if ( (probe.Amount > probe.MaxAmount) && !sv_unlimited_pickup )
|
||||
probe.Amount = probe.MaxAmount;
|
||||
}
|
||||
// The pickup always succeeds, even if you didn't get anything
|
||||
item.bPickupGood = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
override void DoPickupSpecial( Actor toucher )
|
||||
{
|
||||
Super.DoPickupSpecial(toucher);
|
||||
|
|
@ -114,18 +30,6 @@ Class UnrealBackpack : BackpackItem replaces Backpack
|
|||
}
|
||||
}
|
||||
}
|
||||
Default
|
||||
{
|
||||
Tag "$T_BACKPACK";
|
||||
Inventory.PickupMessage "$I_BACKPACK";
|
||||
Inventory.RespawnTics 2100;
|
||||
}
|
||||
States
|
||||
{
|
||||
Spawn:
|
||||
BPAK A -1;
|
||||
Stop;
|
||||
}
|
||||
}
|
||||
|
||||
Class UTranslator : UnrealInventory
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue