All pastes #497953 Raw Edit

Untitled

public text v1 · immutable
·published 2007-05-20 03:59 UTC
rendered paste body
//-----------------------------------------------------------
// $DATETIME$
// Dead Awake code (c) 2007, Eric Blade
//-----------------------------------------------------------
class MutLOTDToDA extends Mutator;

#exec load file=dotzsindustrial.usx
#exec load file=dotzsbuildings.usx
#exec load file=dotzsobjects.usx
#exec load file=uzgmeshes.usx

function bool CheckReplacement(Actor Other, out byte bSuperRelevant) {
	local string zn;
	local Controller c;
	local Rotator r;
	local vector loc;
	local Pawn p;
	local ZombieFactory factory;
	local int x;

	//log(self@"CheckReplacement"@Other);
	if(Other.IsA('ZombieFactory')) {
		factory = ZombieFactory(Other);

		//factory.bStartActive=true;
		//factory.TriggerEx(self, None, factory.hStartSpawn);
		for(x = 0; x < factory.OpponentTypes.Length; x++) {
			//factory.OpponentTypes[x].ControllerType = class'DAZombieControllerNew';
			factory.OpponentTypes[x].ControllerType = class'DAZombieControllerNew';
			switch(Rand(6)) {
				case 0: zn = "DoctorBob"; break;
				case 1: zn = "FemalePunk"; break;
				case 2: zn = "MaleTeenager"; break;
				case 3: zn = "Otis"; break;
				case 4: zn = "DoctorMale"; break;
				case 5: zn = "CopMale"; break;
				default: break;
			}
			factory.OpponentTypes[x].PawnType = class<Pawn>(DynamicLoadObject("DAZombies.DAZ"$zn, class'Class'));
		}
	}

	if(Other.IsA('BBPPockMark'))
		return !ReplaceWith(Other, "UZG.DABulletMark");
	if(Other.IsA('SmallHealth'))
		return !ReplaceWith(Other, "UZG.DASmallHealthPack");
	if(Other.IsA('HealthPack'))
		return !ReplaceWith(Other, "UZG.DAHealthPack");
	if(Other.IsA('DAFleshImpact'))
		return true;
	if(Other.IsA('BBPImpactFlesh'))
		return !ReplaceWith(Other, "UZGEffects.DAFleshImpact");
	if(Other.IsA('BaseballBatPickup'))
		return !ReplaceWith(Other, "UZGWeapons.DABatPickup");
	if(Other.IsA('FireAxePickup'))
		return !ReplaceWith(Other, "UZGWeapons.DAChainsawPickup");
	if(Other.IsA('GlockPickup'))
		return !ReplaceWith(Other, "UZGWeapons.DADualGlockPickup");
	if(Other.IsA('GlockAmmoPickup'))
		return !ReplaceWith(Other, "UZGWeapons.DADualGlockAmmoPickup");
	if(Other.IsA('RevolverPickup'))
		return !ReplaceWith(Other, "UZGWeapons.DADualRevolverPickup");
	if(Other.IsA('M16Pickup'))
		return !ReplaceWith(Other, "UZGWeapons.DARocketLauncherPickup");
	if(Other.IsA('MolotovPickup'))
		return !ReplaceWith(Other, "UZGWeapons.FlameTPickup");
	if(Other.IsA('HammerPickup'))
		return !ReplaceWith(Other, "UZGWeapons.FlashlightPickup");
	if(Other.IsA('ShotgunPickup'))
		return !ReplaceWith(Other, "UZGWeapons.UZGShotgunPickup");
	if(Other.IsA('UZGShotgunAmmoPickup'))
		return true;
	if(Other.IsA('ShotgunAmmoPickup'))
		return !ReplaceWith(Other, "UZGWeapons.UZGShotgunAmmoPickup");
	if(Other.IsA('RevolverAmmoPickup'))
		return !ReplaceWith(Other, "UZGWeapons.DADualRevolverAmmoPickup");
	if(Other.IsA('BodyBag'))
		return !ReplaceWith(Other, "UZGItems.UZGBodyBag");
	if(Other.IsA('StaticMeshActor') && !Other.IsA('DAStaticMeshActor')) {
			if(Other.StaticMesh == StaticMesh'DOTZSIndustrial.Outdoor.GarbageCan')
				return !ReplaceWith(Other, "UZGItems.MetalTrashCan");

			if(Other.StaticMesh == StaticMesh'DOTZSBuildings.BuildingFacades.AwningA')
				return !ReplaceWith(Other, "UZGItems.Awning");
			if(Other.StaticMesh == StaticMesh'DOTZSObjects.Decoration.BeerBottle')
				return !ReplaceWith(Other, "UZGItems.BeerBottle");
			if(Other.StaticMesh == StaticMesh'DOTZSObjects.Decoration.BookA')
				return !ReplaceWith(Other, "UZGItems.BookBible");
			if(Other.StaticMesh == StaticMesh'DOTZSObjects.Decoration.BookB')
				Other.SetStaticMesh(StaticMesh'UZGMeshes.Decoration.DABookB');
			if(Other.StaticMesh == StaticMesh'DOTZSObjects.Decoration.BookC')
				Other.SetSTaticMesh(StaticMesh'UZGMeshes.Decoration.DABookC');
			if(Other.StaticMesh == StaticMesh'DOTZSObjects.Decoration.BookD')
				Other.SetSTaticMesh(StaticMesh'UZGMeshes.Decoration.DABookD');
			if(Other.StaticMesh == StaticMesh'DOTZSObjects.Decoration.BookPile')
				Other.SetSTaticMesh(StaticMesh'UZGMeshes.Decoration.DABookPile');
			if(Other.StaticMesh == StaticMesh'DOTZSObjects.Decoration.BookRow')
				Other.SetSTaticMesh(STaticMesh'UZGMeshes.Decoration.DABookRow');
			if(Other.StaticMesh == StaticMesh'DOTZSObjects.Furniture.CoffeeTable')
				return !ReplaceWith(Other, "UZGItems.CoffeeTable");

	}
	return true;
}

function Actor ReplaceWithActor(actor Other, string aClassName)
{
	local Actor A;
	local class<Actor> aClass;

	if ( aClassName == "" )
		return None;

	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(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 A;
	}
	return None;
}


DefaultProperties
{

}