Advanced - Rising Water / Triggered Water Zone

Source Code for TriggerWaterZone:

//===========================================================================
// TriggerWaterZone.
// This class allows you to change a zone from a Regular Zone to a Water Zone
// using the normal trigger method.
// Created by Scott 'Slasher IV' Kircher
//============================================================================

class TriggerWaterZone expands WaterZone;

function PostBeginPlay()
{
Super.PostBeginPlay();
if(!bWaterZone)
{
ViewFlash=vect(0,0,0);
ViewFog=vect(0,0,0);
}
}
function Trigger( actor Other, pawn EventInstigator )
{
local Actor A;
local Pawn P;
local Decoration D;
local TriggerWaterZone oldself;
oldself=self;
if(bWaterZone)
{
bWaterZone=false;
ViewFlash=vect(0,0,0);
ViewFog=vect(0,0,0);
ForEach AllActors(class 'Actor', A)
if(A.Region.Zone==oldself)
{
ActorEntered(A);
A.ZoneChange(self);
if(A.Buoyancy>0.0)
{
A.SetPhysics(PHYS_Falling);
}
}
ForEach AllActors(class 'Pawn', P)
{
if(P.HeadRegion.Zone==oldself)
{
P.HeadZoneChange(self);
P.PainTime=-1.0;
}
if(P.FootRegion.Zone==oldself)
{
P.FootZoneChange(self);
}
}
}
else
{
bWaterZone=true;
ViewFlash=Default.ViewFlash;
ViewFog=Default.ViewFog;
ForEach AllActors(class 'Actor', A)
if(A.Region.Zone==oldself)
{
ActorEntered(A);
A.ZoneChange(self);
if(A.Buoyancy>0.0)
{
A.Velocity.Z+=1;
A.SetPhysics(PHYS_Falling);
}
}
ForEach AllActors(class 'Decoration', D)
if(D.Region.Zone==oldself)
{
D.bBobbing=False;
D.Bump(self);
}
ForEach AllActors(class 'Pawn', P)
{
if(P.HeadRegion.Zone==oldself)
{
P.HeadZoneChange(self);
P.PainTime=P.UnderWaterTime;
P.SetPhysics(PHYS_Swimming);
}
if(P.FootRegion.Zone==oldself)
{
P.FootZoneChange(self);
}
}
}

}