Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // IzarianCarcass.
- //=============================================================================
- class IzarianCarcass extends CreatureCarcass;
- function ForceMeshToExist()
- {
- //never called
- Spawn(class 'SkCampClasses.Izarian');
- }
- function TakeDamage( int Damage, Pawn InstigatedBy, Vector Hitlocation,
- Vector Momentum, name DamageType)
- {
- local BloodSpurtBlue b;
- //local BloodSpray2Blue BB; //UnrealBlood
- //local int I;
- //local int RadNum;
- local vector Momentum2;
- local String DmgCompare;
- if ( bDeleteMe)
- return;
- b = Spawn(class'BloodSpurtBlue',,,HitLocation,rot(16384,0,0));
- if ( bGreenBlood)
- b.GreenBlood();
- if (!bDeleteMe)
- {
- DmgCompare=Caps(String(DamageType));
- Momentum2=(Momentum/mass)*3.0;
- if (DmgCompare == "SHREDDED")
- Momentum2 = vect(0,0,0);
- if (DmgCompare == "SHOT")
- Momentum2 = Momentum2*2;
- /*RadNum = Rand(4);
- for (i = 0; i< RadNum; i++)
- {
- BB=Spawn(Class'BloodSpray2Blue',Self,'',hitlocation,rotator(location-hitlocation));
- if (BB != none)
- {
- if ( bGreenBlood)
- BB.Green();
- BB.Velocity=momentum2+Vrand()*100;
- }
- BB=none;
- }*/
- }
- if ( !bPermanent )
- {
- if ( (DamageType == 'Corroded') && (CumulativeDamage >= 100) && Region.Zone.bWaterZone && (Region.Zone.bDestructive || Region.Zone.bPainZone) && region.zone.DamageType==DamageType)
- { /*-C go to previously unused state */
- bCorroding = true;
- GotoState('Corroding');
- }
- else
- {
- //Super.TakeDamage(Damage, instigatedBy, HitLocation, Momentum, DamageType);
- if ( !bDecorative )
- {
- bBobbing = false;
- SetPhysics(PHYS_Falling);
- }
- if ( (Physics == PHYS_None) && (Momentum.Z < 0) )
- Momentum.Z *= -1;
- Velocity += 3 * momentum/(Mass + 200);
- if ( DamageType == 'shot' )
- Damage *= 0.4;
- CumulativeDamage += Damage;
- if ( (((Damage > 30) || !IsAnimating()) && (CumulativeDamage > 0.8 * Mass)) || (Damage > 0.4 * Mass)
- || ((Velocity.Z > 150) && !IsAnimating()) )
- ChunkUp(Damage);
- if ( bDecorative )
- Velocity = vect(0,0,0);
- }
- }
- }
- function CreateReplacement()
- {
- local IzarianChunks carc;
- if (bHidden)
- return;
- if ( bodyparts[0] != None )
- carc = Spawn(class 'IzarianChunks');//,,, Location + ZOffset[0] * CollisionHeight * vect(0,0,1));,IzarianMasterChunk
- if (carc != None)
- {
- carc.TrailSize = Trails[0];
- carc.Mesh = bodyparts[0];
- carc.bMasterChunk = true;
- carc.Initfor(self);
- carc.Bugs = Bugs;
- if ( Bugs != None )
- Bugs.SetBase(carc);
- Bugs = None;
- }
- else if ( Bugs != None )
- Bugs.Destroy();
- }
- function ChunkUp(int Damage)
- {
- if ( bPermanent )
- return;
- if ( Region.Zone.bPainZone && (Region.Zone.DamagePerSec > 0) )
- {
- if ( Bugs != None )
- Bugs.Destroy();
- }
- else
- CreateReplacement();
- SetPhysics(PHYS_None);
- bHidden = true;
- SetCollision(false,false,false);
- bProjTarget = false;
- GotoState('Gibbing');
- }
- function Landed(vector HitNormal)
- {
- local rotator finalRot;
- if ( (Velocity.Z < -1000) && !bPermanent )
- {
- ChunkUp(200);
- return;
- }
- finalRot = Rotation;
- finalRot.Roll = 0;
- finalRot.Pitch = 0;
- setRotation(finalRot);
- SetPhysics(PHYS_None);
- SetCollision(bCollideActors, false, false);
- if ( HitNormal.Z < 0.99 )
- ReducedHeightFactor = 0.1;
- if ( HitNormal.Z < 0.93 )
- ReducedHeightFactor = 0.0;
- if ( !IsAnimating() )
- LieStill();
- }
- function AnimEnd()
- {
- if ( Physics == PHYS_None )
- LieStill();
- else if ( Region.Zone.bWaterZone )
- {
- bThumped = true;
- LieStill();
- }
- }
- function LieStill()
- {
- SimAnim.X = 10000 * AnimFrame;
- SimAnim.Y = 5000 * AnimRate;
- if ( !bThumped && !bDecorative )
- LandThump();
- if ( !bReducedHeight )
- ReduceCylinder();
- }
- function ThrowOthers()
- {
- local float dist, shake;
- local pawn Thrown;
- local PlayerPawn aPlayer;
- local vector Momentum;
- Thrown = Level.PawnList;
- While ( Thrown != None )
- {
- aPlayer = PlayerPawn(Thrown);
- if ( aPlayer != None )
- {
- dist = VSize(Location - aPlayer.Location);
- shake = FMax(500, 1500 - dist);
- aPlayer.ShakeView( FMax(0, 0.35 - dist/20000),shake, 0.015 * shake );
- if ( (aPlayer.Physics == PHYS_Walking) && (dist < 1500) )
- {
- Momentum = -0.5 * aPlayer.Velocity + 100 * VRand();
- Momentum.Z = 7000000.0/((0.4 * dist + 350) * aPlayer.Mass);
- aPlayer.AddVelocity(Momentum);
- }
- }
- Thrown = Thrown.nextPawn;
- }
- }
- function LandThump()
- {
- local float impact;
- //local UnrealBlood BP;
- if ( Physics == PHYS_None)
- {
- bThumped = true;
- if ( Role == ROLE_Authority )
- {
- impact = 0.75 + Velocity.Z * 0.004;
- impact = Mass * impact * impact * 0.015;
- PlaySound(LandedSound,, impact);
- if ( Mass >= 500 )
- ThrowOthers();
- }
- /*if (!bGreenBlood)
- Spawn(Class'BloodPoolSpawnerBlue',Self,'',Location);
- else
- {
- BP=spawn(Class'BloodPoolSpawnerBlue',self,'',Location);
- if (BP != none)
- BP.Green();
- }*/
- }
- }
- simulated function HitWall(vector HitNormal, actor Wall)
- {
- local BloodSpurtBlue b;
- b = Spawn(class 'BloodSpurtBlue',,,,Rotator(HitNormal));
- if ( bGreenBlood )
- b.GreenBlood();
- b.RemoteRole = ROLE_None;
- Velocity = 0.7 * (Velocity - 2 * HitNormal * (Velocity Dot HitNormal));
- Velocity.Z *= 0.9;
- if ( Abs(Velocity.Z) < 120 )
- {
- bBounce = false;
- Disable('HitWall');
- }
- }
- state Corroding
- {
- ignores Landed, HitWall, AnimEnd, TakeDamage, ZoneChange;
- function Tick( float DeltaTime )
- {
- local int NewFatness;
- local float splashSize;
- local actor splash;
- NewFatness = fatness - 80 * DeltaTime;
- if ( NewFatness < 85 )
- {
- if ( Region.Zone.bWaterZone && Region.Zone.bDestructive )
- {
- splashSize = FClamp(0.0002 * Mass * (250 - 0.5 * FMax(-600,Velocity.Z)), 1.0, 4.0 );
- if ( Region.Zone.ExitSound != None )
- PlaySound(Region.Zone.ExitSound, SLOT_Interact, splashSize);
- if ( Region.Zone.ExitActor != None )
- {
- splash = Spawn(Region.Zone.ExitActor);
- if ( splash != None )
- splash.DrawScale = splashSize;
- }
- }
- Destroy();
- }
- fatness = Clamp(NewFatness, 0, 255);
- }
- function BeginState()
- {
- Disable('Tick');
- }
- Begin:
- Sleep(0.5);
- Enable('Tick');
- }
- function ReduceCylinder()
- {
- local float OldHeight;
- RemoteRole=ROLE_DumbProxy;
- bReducedHeight = true;
- SetCollision(bCollideActors,False,False);
- OldHeight = CollisionHeight;
- if ( ReducedHeightFactor < Default.ReducedHeightFactor )
- SetCollisionSize(CollisionRadius, CollisionHeight * ReducedHeightFactor);
- else
- SetCollisionSize(CollisionRadius + 4, CollisionHeight * ReducedHeightFactor);
- //PrePivot = vect(0,0,1) * (OldHeight - CollisionHeight);
- if ( !SetLocation(Location - PrePivot) )
- {
- SetCollisionSize(CollisionRadius - 4, CollisionHeight);
- if ( !SetLocation(Location - PrePivot) )
- {
- SetCollisionSize(CollisionRadius, OldHeight);
- SetCollision(false, false, false);
- PrePivot = vect(0,0,0);
- }
- }
- //PrePivot = PrePivot + vect(0,0,2);
- Mass = Mass * 0.8;
- Buoyancy = Buoyancy * 0.8;
- }
- defaultproperties
- {
- Mesh=SkeletalMesh'SkCampMeshes.IzarianMesh'
- AnimSequence=DeathMidHitDieF01
- CollisionHeight=20
- CollisionRadius=35
- PrePivot=(Z=30.000000)
- bodyparts(0)=LodMesh'SkCampMeshes.IzarianGib1M'
- bodyparts(1)=LodMesh'SkCampMeshes.IzarianGib2M'
- bodyparts(2)=LodMesh'SkCampMeshes.IzarianGib3M'
- bodyparts(3)=LodMesh'SkCampMeshes.IzarianGib4M'
- bodyparts(4)=LodMesh'SkCampMeshes.IzarianGib5M'
- bodyparts(5)=LodMesh'SkCampMeshes.IzarianGib6M'
- bodyparts(6)=LodMesh'SkCampMeshes.IzarianGib7M'
- bodyparts(7)=LodMesh'SkCampMeshes.IzarianGib8M'
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement