Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Modified 'mutAMRiL' from MEvo
- class mutAutoTurretRb extends Mutator;
- var bool bReplaceAmmo;
- var string NewAmmoStrClass;
- var string OldAmmoStrClass;
- var class<Weapon> NewWeaponClass;
- var class<Weapon> OldWeaponClass;
- function string GetInventoryClassOverride(string InventoryClassName)
- {
- if ( InventoryClassName == String(OldWeaponClass) )
- InventoryClassName = String(NewWeaponClass);
- if ( NextMutator != None )
- return NextMutator.GetInventoryClassOverride(InventoryClassName);
- return InventoryClassName;
- }
- function bool AlwaysKeep(Actor Other)
- {
- if (Other.class == NewWeaponClass)
- return true;
- if ( NextMutator != None )
- return ( NextMutator.AlwaysKeep(Other) );
- return false;
- }
- function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
- {
- local int i;
- bSuperRelevant = 0;
- if ( xWeaponBase(Other) != None)
- {
- if (xWeaponBase(Other).WeaponType == OldWeaponClass)
- xWeaponBase(Other).WeaponType = NewWeaponClass;
- }
- else if ( WeaponLocker(other) != None)
- {
- for ( i=0; i < WeaponLocker(other).Weapons.Length; i++ )
- if (WeaponLocker(other).Weapons[i].WeaponClass == OldWeaponClass)
- {
- WeaponLocker(other).Weapons[i].WeaponClass = NewWeaponClass;
- }
- }
- else if ( WeaponPickup(Other) != None)
- {
- if (WeaponPickup(Other).class == OldWeaponClass.default.PickupClass)
- {
- ReplaceWith( Other, String(NewWeaponClass.default.PickupClass));
- return false;
- }
- }
- else if ( Ammo(Other) != None && bReplaceAmmo == true )
- {
- if(string(Other.Class) == OldAmmoStrClass)
- {
- ReplaceWith(Other, NewAmmoStrClass);
- return false;
- }
- }
- return true;
- }
- //same as Super.ReplaceWith but also sets the pickup's respawn time and ammo amount
- function bool ReplaceWith(actor Other, string aClassName)
- {
- local Actor A;
- local class<Actor> aClass;
- if ( aClassName == "" )
- return true;
- aClass = class<Actor>(DynamicLoadObject(aClassName, class'Class'));
- if ( aClass != None )
- A = Spawn(aClass,Other.Owner,Other.tag,Other.Location, Other.Rotation);
- if ( Other.IsA('Pickup') )
- {
- if ( Pickup(Other).MyMarker != None )
- {
- Pickup(Other).MyMarker.markedItem = Pickup(A);
- if ( Pickup(A) != None )
- {
- Pickup(A).MyMarker = Pickup(Other).MyMarker;
- A.SetLocation(A.Location
- + (A.CollisionHeight - Other.CollisionHeight) * vect(0,0,1));
- Pickup(A).RespawnTime = Pickup(Other).RespawnTime; //this is the added line
- }
- Pickup(Other).MyMarker = None;
- }
- else if ( A.IsA('Pickup') )
- Pickup(A).Respawntime = 0.0;
- }
- if ( A != None )
- {
- A.event = Other.event;
- A.tag = Other.tag;
- return true;
- }
- return false;
- }
- defaultproperties
- {
- bReplaceAmmo=false
- NewAmmoStrClass="AMRiLME.AMRiLAmmoPickup"
- OldAmmoStrClass="Onslaught.ONSAVRiLAmmoPickup"
- NewWeaponClass=Class'SillyRPG.AutoTurretDeployRb'
- OldWeaponClass=Class'DWU2Weapons.AutoTurretDeploy'
- FriendlyName="Auto Turret Rollback Mutator"
- Description="Replaces the new Auto Turret with the old Auto Turret"
- }
Advertisement
Add Comment
Please, Sign In to add comment