Prepare fixtures

This commit is contained in:
dkanus 2026-07-14 20:27:09 +07:00
commit 9c94356263
6021 changed files with 722805 additions and 22 deletions

View file

@ -0,0 +1,18 @@
class ACTION_KillZEDs extends ScriptedAction;
function bool InitActionFor(ScriptedController C)
{
local KFMonster A ;
ForEach C.DynamicActors(class'KFMonster', A)
{
A.Died(C,class'DamageType', A.Location) ;
}
return false;
}
defaultproperties
{
ActionString="Kill ZEDs"
}

View file

@ -0,0 +1,36 @@
class BloatKillVolume extends PhysicsVolume;
var() const name NotABloatEvent;
var bool bShouldTriggerEvents;
simulated event PawnEnteredVolume(Pawn Other)
{
if ( Role == ROLE_Authority && Other.Health > 0)
{
if(bShouldTriggerEvents)
{
if(Other.IsA('ZombieBloat'))
{
TriggerEvent(Event,self, Other);
}
else
{
TriggerEvent(NotABloatEvent,self,Other);
}
}
Other.Died(Other.Controller,DamageType,Other.Location);
}
}
event Trigger( Actor Other, Pawn EventInstigator )
{
bShouldTriggerEvents = !bShouldTriggerEvents;
}
defaultproperties
{
bShouldTriggerEvents = true
bStatic = false
}

View file

@ -0,0 +1,179 @@
/*
--------------------------------------------------------------
Container Crane
--------------------------------------------------------------
An Animated Container Crane mesh whos animation is controlled by the
the progress state of an Objective condition.
Animation is played only on the client.
Author : Alex Quick
--------------------------------------------------------------
*/
class ContainerCrane extends Actor
placeable;
// Tag of the condition which control's this Crane's animation.
var () const name AssociatedConditionTag;
// Object reference to the condition which controls this Crane's animation
var private KF_ObjectiveCondition AssociatedCondition;
// Name of the animation the Crane plays when its lowering / raising its winch.
var () const name WinchLoweringAnim;
// The Current frame the animation is playing (used for interpolation)
var float CurrentAnimFramePct;
// The last position in the animation expressed as a percent.
var float LastAnimFramePct;
// True if the animation is not playing in reverse.
var bool bPlayingForward;
// Struct representing a sound effect we should play at some time during the animation.
struct SAnimSoundEffect
{
// reference to the actual sound in the package.
var () sound SoundToPlay;
// The frame %age to start playing the sound at. (i.e In a 600 frame animation if you want to play at frame 300, this value should be 0.5 )
var () float StartFramePct;
// the frame %age to stop playing the sound at.
var () float EndFramePct;
// Is this a looping sound or not. If not, 'EndFramePct' has no actual relevance.
var () bool bLooping;
// Has this sound been played already? Only has real relevance to non-looping sounds.
var bool bPlayed;
};
var () array<SAnimSoundEffect> AnimSounds;
var float ConditionCompletionPct;
replication
{
unreliable if(Role == Role_Authority && bNetDirty)
ConditionCompletionPct;
}
function PostbeginPlay()
{
local KF_ObjectiveCondition Condition;
foreach AllObjects(class 'KF_ObjectiveCondition', Condition)
{
if(Condition.Tag == AssociatedConditionTag)
{
AssociatedCondition = Condition;
NetupdateFrequency = 1.f / Condition.ConditionRepInterval; // Sync net update rates.
break;
}
}
}
simulated function Tick(float DeltaTime)
{
local bool bOldDirection;
local int i;
if(Role == Role_Authority && AssociatedCondition != none && AssociatedCondition.bActive)
{
ConditionCompletionPct = AssociatedCondition.GetCompletionPct();
}
LastAnimFramePct = CurrentAnimFramePct;
CurrentAnimFramePct = Lerp(DeltaTime,CurrentAnimFramePct,ConditionCompletionPct);
bOldDirection = bPlayingForward;
bPlayingForward = CurrentAnimFramePct >= LastAnimFramePct;
// Animation is reversing , reset sounds.
if(Role == Role_Authority && bOldDirection != bPlayingForward)
{
for(i = 0 ; i < AnimSounds.length ; i ++)
{
AnimSounds[i].bPlayed = false;
}
}
if(Level.NetMode != NM_DedicatedServer &&
ConditionCompletionPct != CurrentAnimFramePct &&
ConditionCompletionPct < 1.f)
{
SetAnimFramePct(CurrentAnimFramePct);
}
if(CurrentAnimFramePct > 0.f)
{
PlayAnimSounds(CurrentAnimFramePct);
}
}
function PlayAnimSounds(float CurrentPct)
{
local int i;
local Sound AmbSoundToPlay;
local bool bShouldPlaySound;
local bool bReversing;
if(Role < Role_Authority)
{
return;
}
for(i = 0 ; i < AnimSounds.length ; i ++)
{
if(AnimSounds[i].SoundToPlay != none)
{
bReversing = !bPlayingForward;
// Play Looped sounds. There can only be one of these at a time.
if(AnimSounds[i].bLooping)
{
bShouldPlaySound = CurrentPct >= AnimSounds[i].StartFramePct && (AnimSounds[i].EndFramePct == 0.f || CurrentPct <= AnimSounds[i].EndFramePct) ;
if(bShouldPlaySound)
{
AnimSounds[i].bPlayed = true;
AmbSoundToPlay = AnimSounds[i].SoundToPlay;
}
}
else // Play one-off sounds. These can overlap.
{
bShouldPlaySound = !AnimSounds[i].bPlayed && CurrentPct >= AnimSounds[i].StartFramePct ;
if(bShouldPlaySound)
{
AnimSounds[i].bPlayed = true;
PlaySound(AnimSounds[i].SoundToPlay,SLOT_None,((SoundVolume/255) * 2.0),true,SoundRadius,,!bFullVolume);
}
}
}
}
if(AmbSoundToPlay != AmbientSound)
{
AmbientSound = AmbSoundToPlay;
}
}
simulated function SetAnimFramePct( float NewPct)
{
PlayAnim( WinchLoweringAnim, 1.0f,0.f);
SetAnimFrame(NewPct,0);
}
defaultproperties
{
bAlwaysRelevant = true
bNoDelete = true
RemoteRole = Role_SimulatedProxy
SoundRadius = 2000
SoundVolume = 255
bFullVolume = true
DrawType = DT_Mesh
Mesh = Mesh 'FrightYard_SKM.SKM_DockCrane'
WinchLoweringAnim="LowerCrane"
}

View file

@ -0,0 +1,205 @@
// a really creepy camera that is always looking in your direction.
// it can be destroyed if you shoot it
// Author: Alex Quick
class CreepyCamera extends Actor
placeable;
var () bool DebugCamera;
// the player this camera is focusing on.
var protected Pawn CameraTarget;
// the rotation of the camera at level startup
var protected Rotator InitialRotation;
// limits on the rotation of the camera
var () const float PitchLimit,YawLimit;
// effect to spawn when this camera is destroyed
var protected class<Emitter> DestructionEffect;
simulated function PostBeginPlay()
{
InitialRotation = Rotation;
DesiredRotation = InitialRotation;
}
simulated function Tick(float DeltaTime)
{
OrientCameraToLocalPlayer();
if(DebugCamera)
{
PrintDebugLogs();
}
}
simulated function PrintDebugLogs()
{
log("======= CAMERA DEBUG ================");
log(" -->"@Self@" TARGET : "@CameraTarget@"InitialRotation :"@InitialRotation@" DesiredRotation :"@DesiredRotation);
}
// turn the camera so its looking at the local player
simulated function OrientCameraToLocalPlayer()
{
local rotator NewRotation;
local byte LockYaw,LockPitch;
if(CameraTarget == none)
{
FindCameraTarget();
}
else
{
NewRotation = Rotator((CameraTarget.Location + (Vect(0,0,1)* CameraTarget.EyeHeight)) - Location) ;
// If the desired rotation goes beyond the camera's limit, stop turning it.
if(CameraTarget.Health <= 0 ||
CameraTarget.bDeleteMe)
{
StopTracking();
return;
}
if(IsOutSideViewFrustrum(CameraTarget,LockYaw,LockPitch))
{
StopTracking();
}
else
{
if(LockPitch == 0)
{
DesiredRotation.Pitch = NewRotation.Pitch;
}
if(LockYaw == 0)
{
DesiredRotation.Yaw = NewRotation.Yaw;
}
}
}
}
simulated function StopTracking()
{
CameraTarget = none;
NetUpdateFrequency = 0.1; // camera isn't really do anything at the moment, so it doesn't need frequent replication updates.
}
simulated function bool IsOutsideViewFrustrum(Pawn TestTarget, optional out byte LockYaw, optional out byte LockPitch)
{
local Rotator RotExtent,IntendedRotation;
IntendedRotation = Rotator((TestTarget.Location + (Vect(0,0,1)* TestTarget.EyeHeight)) - Location) ;
RotExtent = IntendedRotation - InitialRotation;
RotExtent.Yaw = RotExtent.Yaw & 65535;
if( RotExtent.Yaw > YawLimit &&
RotExtent.Yaw < (65535+ (-YawLimit)) )
{
LockYaw = 1;
}
RotExtent.Pitch = RotExtent.Pitch & 65535;
if( RotExtent.Pitch > PitchLimit &&
RotExtent.Pitch < (65535+ (-PitchLimit)) )
{
LockPitch = 1;
}
return LockPitch == 1 && LockYaw == 1;
}
simulated function FindCameraTarget()
{
// do this separately on each client so the camera is looking at them.
if(Level.NetMode == NM_DedicatedServer)
{
return;
}
if(Level.GetLocalPlayerController().Pawn != none &&
Level.GetLocalPlayerController().Pawn.Health > 0)
{
CameraTarget = Level.GetLocalPlayerController().Pawn;
NetUpdateTime = Level.TimeSeconds - 1;
NetUpdateFrequency = default.NetUpdateFrequency;
}
}
simulated function TakeDamage(int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional int HitIndex)
{
DestroyCamera(EventInstigator);
}
function DestroyCamera(Pawn Killer)
{
TriggerEvent(Event,self,Killer);
bHidden = true;
SetCollision(false,false);
bSkipActorPropertyReplication = false;
NetUpdateTime = Level.TimeSeconds - 1;
if(Level.NetMode != NM_DedicatedServer)
{
SpawnDestructionEffect();
}
}
simulated function SpawnDestructionEffect()
{
Spawn(DestructionEffect);
}
simulated event PostNetReceive()
{
if ( bHidden )
{
SpawnDestructionEffect();
bNetNotify = false; // finished
}
}
defaultproperties
{
bDirectional = true
CollisionRadius = 15
Collisionheight = 15
bCollideActors = true
bBlockActors = true
bUseCylinderCollision=true
bBlockZeroExtentTraces=true
bCanBeDamaged=true
DestructionEffect = class 'Emitter_BreakerExplosion'
DrawType = DT_StaticMesh
StaticMesh = StaticMesh'FrightYard_SM.Camera.Trader_Security_Cam'
PitchLimit = 10000
YawLimit = 16000
RotationRate=(Pitch=10000,Yaw=10000,Roll=0)
bFixedRotationDir = false
bRotateToDesired = true
Physics = PHYS_Rotating
// network
bOnlyDirtyReplication=true
bNoDelete=true
bReplicateMovement=false
bAlwaysRelevant=true
bSkipActorPropertyReplication=true
bNetNotify=true
RemoteRole=Role_SimulatedProxy
NetUpdateFrequency=0.1
}

View file

@ -0,0 +1,313 @@
// A ship mounted gun turret that shoots bloat bile at random players.
class DeckGun extends Actor
placeable;
// is the deck gun actively looking for targets?
var () protected bool bActive;
// Number of seconds between shots
var () const float FireInterval;
// Number of seconds between bursts of projectiles.
var () const float BurstInterval;
// The time the burst last finished.
var protected float LastBurstEndTime;
// The number of projectiles fired in the current burst
var protected int NumFired;
// Amount of time the Projectiles stay up in the air for before hitting.
var () const float ProjectileHangTime;
// Number of projectiles to spawn in each burst before 'cooling down'.
var() const int NumProjectilesPerBurst;
// Type of projectile to fire
var () const class<Projectile> ProjectileType;
// The last time the gun was fired
var protected float LastFireTime;
// amount of spread / aim error when Firing
var () const float AimError;
// The player who we're currently aiming at.
var protected Pawn TargetPlayer;
// the guy we were last aiming at.
var protected Pawn LastTarget;
// Jack looks for a new enemy every this amount of seconds.
var () const float FindNewEnemyInterval;
// Time at which we last found a new enemy to throw stuff at.
var protected float LastAcquiredTargetTime;
// Rotation of the gun in the map.
var protected Rotator InitialRotation;
// Animation we want to play on the client.
var protected name PendingClientAnim;
// name of the firing animation for the deck gun.
var () const name FireAnimName;
// Rate to play the firing animation at. 1.f == Normal speed.
var () const float FireAnimRate;
// Maximum range at which the gun will acquire targets
var () const float MaxAggroRange;
// Sound the gun makes every time it fires.
var() const Sound FiringSound;
// The volume of the shoot sound.
var() const float FiringSoundVolume;
// The radius of the shoot sound.
var() const float FiringSoundRadius;
var protected bool PendingClientStopAnim;
replication
{
unreliable if(Role == Role_Authority)
PendingClientAnim,PendingClientStopAnim;
}
simulated function PostNetReceive()
{
if(PendingClientAnim != '')
{
LoopAnim(PendingClientAnim,FireAnimRate,0.1,0);
PendingClientAnim = '';
}
if(PendingClientStopAnim)
{
PendingClientStopAnim = false;
StopAnimating();
}
}
simulated function PostBeginPlay()
{
InitialRotation = Rotation;
DesiredRotation = InitialRotation;
}
/**
* Randomly picks a living player to shoot at from the controller list.
*
* @network All.
*/
simulated function Tick(float DeltaTime)
{
if(bActive)
{
FindTarget();
TrackTarget(DeltaTime);
CheckFire();
}
}
/**
* Orients the gun so that it's facing what it's about to shoot at.
*
* @network All.
*/
simulated function TrackTarget(float DeltaTime)
{
local Rotator TargetDir;
if(TargetPlayer != none)
{
TargetDir = Rotator(TargetPlayer.Location - Location) ;
DesiredRotation = TargetDir;
}
}
/**
* Randomly picks a living player to shoot at from the controller list.
*
* @network Server.
*/
function FindTarget()
{
local Controller C;
local array<Pawn> ValidTargets;
if(level.TimeSeconds - LastAcquiredTargetTime >
FindNewEnemyInterval || TargetPlayer == none ||
TargetPlayer.health <= 0)
{
for (C = Level.ControllerList; C != None; C = C.NextController)
{
if(C.bIsPlayer && C.Pawn != none && C.Pawn.health > 0 &&
C.Pawn != LastTarget && (MaxAggroRange == 0 || VSize(C.Pawn.Location - Location) <= MaxAggroRange))
{
ValidTargets[ValidTargets.length] = C.Pawn;
}
}
// Nothing to aim at. Check to see if maybe the only guy who's left is our previous target.
if(ValidTargets.length == 0)
{
if(LastTarget != none &&
LastTarget.Health > 0)
{
SetTarget(LastTarget);
}
}
else
{
// Randomly pick from the available players.
SetTarget(ValidTargets[Rand(ValidTargets.length)]);
}
}
}
/**
* Set the specified pawn to be our currently active target.
*
* @param NewTarget The guy we want to start shooting at.
* @network Server.
*/
function SetTarget( Pawn NewTarget)
{
LastAcquiredTargetTime = Level.TimeSeconds;
LastTarget = TargetPlayer;
TargetPlayer = NewTarget;
}
/**
* Decide if it's time to shoot again.
*
* @network All.
*/
simulated function CheckFire()
{
if(TargetPlayer != none &&
Level.TimeSeconds - LastFireTime > FireInterval)
{
if(BarrelsAreFacingTarget())
{
if(NumFired < NumProjectilesPerBurst)
{
LastFireTime = Level.TimeSeconds;
DoFire();
}
else
{
if(Level.TimeSeconds - LastBurstEndTime > BurstInterval)
{
NumFired = 0;
}
}
}
}
}
simulated function bool BarrelsAreFacingTarget()
{
return true;
}
/**
* Actually fire the gun.
*
* @network Server.
*/
function DoFire()
{
local Projectile NewProj;
local vector SpawnLocation;
local vector AimErrorVect;
local float GravityZ;
local vector TargetLocation;
local float fTimeEnd;
local vector NewVelocity;
if(Role < Role_Authority ||
ProjectileType == none)
{
return;
}
SpawnLocation = Location;
AimErrorVect = VRand() * AimError;
TargetLocation = TargetPlayer.Location + AimErrorVect;
NewProj = Spawn(ProjectileType ,,,SpawnLocation, Rotation);
if(NewProj == none)
{
return;
}
fTimeEnd = ProjectileHangTime * ( 1.1/Level.TimeDilation );
GravityZ = PhysicsVolume.Gravity.Z;
fTimeEnd = FMax( 0.0001f, fTimeEnd );
NewVelocity = ( TargetLocation - SpawnLocation ) / fTimeEnd;
NewVelocity.z = ( ( TargetLocation.z - SpawnLocation.z ) - ( 0.5f * GravityZ * ( fTimeEnd*fTimeEnd ) ) ) / fTimeEnd;
NewProj.Velocity = NewVelocity;
NumFired ++ ;
if(FiringSound != none)
{
PlaySound(FiringSound,SLOT_Misc,FiringSoundVolume,false,FiringSoundRadius,,false);
}
if(NumFired == NumProjectilesPerBurst)
{
LastBurstEndTime = Level.TimeSeconds;
PendingClientStopAnim = true;
PendingClientAnim = '' ;
StopAnimating();
}
else
{
// Play firing animation.
PendingClientStopAnim = false;
PendingClientAnim = FireAnimName;
if(Level.NetMode != NM_DedicatedServer)
{
LoopAnim(PendingClientAnim,FireAnimRate,0.1,0);
}
}
}
// Triggering the Deck-gun actives it.
function Trigger( Actor Other, Pawn EventInstigator )
{
bActive = !bActive;
if(!bActive)
{
DesiredRotation = InitialRotation;
}
}
defaultproperties
{
MaxAggroRange = 5000
FireAnimName="Fire"
FireAnimRate = 2.f
FiringSoundVolume=2.0
FiringSoundRadius=1000.0
NumProjectilesPerBurst = 9
BurstInterval = 3.0
ProjectileHangTime = 3
bDirectional = true
bBlockActors = false
bCollideActors = false
bFixedRotationDir = false
Physics = PHYS_Rotating
RotationRate=(Pitch=0,Yaw=15000,Roll=0)
DrawType = DT_Mesh
Mesh = Mesh'Frightyard_SKM.DeckGunSKM'
bNoDelete = true
RemoteRole = Role_SimulatedProxy
bAlwaysRelevant = true
NetUpdateFrequency = 8
bNetNotify=true
bRotateToDesired = true
ProjectileType = class 'DeckGunProjectile'
}

View file

@ -0,0 +1,106 @@
// The projectiles fired by the Deck Gun in the 2013 Halloween map.
class DeckGunProjectile extends ROBallisticProjectile;
var Emitter Trail;
var Sound ExplosionSound;
var float ExplosionSoundVolume;
simulated function PostBeginPlay()
{
Super.PostBeginPlay();
if(Level.NetMode != NM_DedicatedServer)
{
Trail = Spawn(class 'DeckGunProjectile_Trail');
Trail.LifeSpan = LifeSpan;
Trail.SetBase(self);
}
}
simulated function Explode(vector HitLocation, vector HitNormal)
{
local ProjectedDecal VomitDecal ;
if(Trail != none)
{
Trail.Kill();
}
if(Level.NetMode != NM_DedicatedServer)
{
Spawn(class'FrightScript.DeckGunProjectile_Explosion');
}
if(Role == Role_Authority && ExplosionSound != none)
{
PlaySound(ExplosionSound,SlOT_Misc,ExplosionSoundVolume,true,TransientSoundRadius,,false);
}
VomitDecal = Spawn(class'KFMod.VomitDecalGlow',,,, rotator(-HitNormal));
// VomitDecal = Spawn(class'KFMod.VomitDecalGlow',,,, rotator(-HitNormal));
// VomitDecal = Spawn(class'KFMod.VomitDecalGlow',,,, rotator(-HitNormal));
bHidden = true;
BlowUp(HitLocation);
Super.Explode(HitLocation,HitNormal);
}
simulated function Tick(float DeltaTime)
{
SetRotation(Rotator(Normal(Velocity)));
}
simulated event Landed( vector HitNormal )
{
Super.Landed(HitNormal);
Explode(Location,HitNormal);
}
function TakeDamage( int Damage, Pawn InstigatedBy, Vector Hitlocation, Vector Momentum, class<DamageType> damageType, optional int HitIndex)
{
if(InstigatedBy != none && InstigatedBy.GetTeamNum() == 0)
{
Explode(HitLocation, vect(0,0,1));
}
}
defaultproperties
{
bCollideActors=true
bCollideWorld=true
Skins(0)=Shader'kf_fx_trip_t.Gore.Intestines_Glow_SHDR'
bProjTarget=true
Physics=PHYS_Falling
DrawType=DT_StaticMesh
StaticMesh = StaticMesh 'kf_gore_trip_sm.bloat_explode'//StaticMesh'DebugObjects.Arrows.debugarrow1'
AmbientSound = Sound 'Vehicle_Weapons.projectile_whistle01'
ExplosionSound = sound'KF_EnemiesFinalSnd.Bloat_DeathPop'
AmbientVolumeScale = 3.5f
DrawScale=1.0
Damage=5.000000
DamageRadius=320.000000
MaxSpeed=0
CollisionRadius=30
CollisionHeight=30
SoundRadius = 250
SoundVolume = 255
ExplosionSoundVolume=2.0
bTrueBallistics=false
bInitialAcceleration=false
MyDamageType=Class'KFMod.DamTypeBileDeckGun'
}

View file

@ -0,0 +1,174 @@
class DeckGunProjectile_Explosion extends Emitter;
defaultproperties
{
Begin Object Class=SpriteEmitter Name=SpriteEmitter51
FadeOut=True
RespawnDeadParticles=False
UseSizeScale=True
UseRegularSizeScale=False
UniformSize=True
AutomaticInitialSpawning=False
Acceleration=(Z=-500.000000)
ColorScale(0)=(Color=(B=255,G=255,R=255,A=255))
ColorScale(1)=(RelativeTime=1.000000,Color=(B=255,G=255,R=255,A=255))
FadeOutStartTime=0.200000
MaxParticles=2
Name="SpriteEmitter51"
SizeScale(1)=(RelativeTime=0.070000,RelativeSize=1.000000)
SizeScale(2)=(RelativeTime=1.000000,RelativeSize=2.000000)
InitialParticlesPerSecond=1000.000000
DrawStyle=PTDS_AlphaBlend
Texture=Texture'kf_fx_trip_t.Gore.bloat_explode_blood'
LifetimeRange=(Min=1.000000,Max=1.000000)
StartVelocityRange=(X=(Min=-50.000000,Max=50.000000),Y=(Min=-50.000000,Max=50.000000),Z=(Min=150.000000,Max=300.000000))
End Object
Emitters(0)=SpriteEmitter'SpriteEmitter51'
Begin Object Class=MeshEmitter Name=MeshEmitter12
StaticMesh=StaticMesh'EffectsSM.PlayerGibbs.Chunk1_Gibb'
UseCollision=True
RespawnDeadParticles=False
SpinParticles=True
DampRotation=True
AutomaticInitialSpawning=False
Acceleration=(Z=-1000.000000)
DampingFactorRange=(X=(Min=0.200000,Max=0.500000),Y=(Min=0.200000,Max=0.500000),Z=(Min=0.200000,Max=0.500000))
ColorScale(0)=(Color=(B=255,G=255,R=255,A=255))
ColorScale(1)=(RelativeTime=1.000000,Color=(B=255,G=255,R=255,A=255))
MaxParticles=8
Name="MeshEmitter12"
SpinsPerSecondRange=(X=(Min=-1.000000,Max=1.000000),Y=(Min=-1.000000,Max=1.000000),Z=(Min=-1.000000,Max=1.000000))
StartSpinRange=(X=(Min=-1.000000,Max=1.000000),Y=(Min=-1.000000,Max=1.000000),Z=(Min=-1.000000,Max=1.000000))
StartSizeRange=(X=(Min=0.500000,Max=2.000000),Y=(Min=0.500000,Max=2.000000),Z=(Min=0.500000,Max=2.000000))
InitialParticlesPerSecond=1000.000000
DrawStyle=PTDS_Regular
LifetimeRange=(Min=10.000000,Max=10.000000)
StartVelocityRange=(X=(Min=-200.000000,Max=200.000000),Y=(Min=-200.000000,Max=200.000000),Z=(Min=1000.000000))
VelocityLossRange=(Z=(Min=1.000000,Max=1.000000))
End Object
Emitters(1)=MeshEmitter'MeshEmitter12'
Begin Object Class=SpriteEmitter Name=SpriteEmitter52
RespawnDeadParticles=False
SpawnOnlyInDirectionOfNormal=True
SpinParticles=True
UseSizeScale=True
UseRegularSizeScale=False
UniformSize=True
ScaleSizeYByVelocity=True
ScaleSizeZByVelocity=True
AutomaticInitialSpawning=False
BlendBetweenSubdivisions=True
Acceleration=(Z=-200.000000)
ColorScale(1)=(RelativeTime=0.300000,Color=(B=255,G=255,R=255))
ColorScale(2)=(RelativeTime=0.750000,Color=(B=96,G=160,R=255))
ColorScale(3)=(RelativeTime=1.000000)
FadeOutStartTime=1.000000
MaxParticles=8
Name="SpriteEmitter52"
StartLocationShape=PTLS_Sphere
SphereRadiusRange=(Max=5.000000)
StartMassRange=(Min=11.000000,Max=11.000000)
UseRotationFrom=PTRS_Normal
SpinsPerSecondRange=(X=(Min=-0.300000,Max=0.300000))
StartSpinRange=(X=(Min=-0.500000,Max=0.500000))
SizeScale(0)=(RelativeSize=1.000000)
SizeScale(1)=(RelativeTime=1.000000,RelativeSize=2.500000)
StartSizeRange=(X=(Min=30.000000,Max=30.000000),Y=(Min=0.000000,Max=0.000000),Z=(Min=0.000000,Max=0.000000))
ScaleSizeByVelocityMultiplier=(X=0.000000,Y=0.000000,Z=0.000000)
ScaleSizeByVelocityMax=3.000000
InitialParticlesPerSecond=500.000000
DrawStyle=PTDS_Modulated
Texture=Texture'kf_fx_trip_t.Gore.kf_bloodspray_b_diff'
TextureUSubdivisions=4
TextureVSubdivisions=4
LifetimeRange=(Min=0.500000,Max=0.500000)
StartVelocityRange=(X=(Min=-150.000000,Max=150.000000),Y=(Min=-150.000000,Max=150.000000),Z=(Min=100.000000,Max=100.000000))
End Object
Emitters(2)=SpriteEmitter'SpriteEmitter52'
Begin Object Class=SpriteEmitter Name=SpriteEmitter53
RespawnDeadParticles=False
SpinParticles=True
UseSizeScale=True
UseRegularSizeScale=False
UniformSize=True
AutomaticInitialSpawning=False
BlendBetweenSubdivisions=True
ColorScale(1)=(RelativeTime=0.300000,Color=(B=255,G=255,R=255))
ColorScale(2)=(RelativeTime=0.750000,Color=(B=255,G=255,R=255))
ColorScale(3)=(RelativeTime=1.000000)
ColorMultiplierRange=(X=(Min=0.250000,Max=0.250000),Z=(Min=0.000000,Max=0.000000))
FadeOutStartTime=0.850000
MaxParticles=60
Name="SpriteEmitter53"
AddLocationFromOtherEmitter=2
StartLocationShape=PTLS_Sphere
SphereRadiusRange=(Max=1.000000)
SpinsPerSecondRange=(X=(Max=0.070000))
StartSpinRange=(X=(Max=1.000000))
SizeScale(0)=(RelativeTime=1.000000,RelativeSize=1.250000)
StartSizeRange=(X=(Min=20.000000,Max=30.000000),Y=(Min=0.000000,Max=0.000000),Z=(Min=0.000000,Max=0.000000))
ScaleSizeByVelocityMultiplier=(X=0.000000,Y=0.000000,Z=0.000000)
ScaleSizeByVelocityMax=0.000000
InitialParticlesPerSecond=60.000000
DrawStyle=PTDS_Brighten
Texture=Texture'kf_fx_trip_t.Gore.bloat_vomit_spray_anim'
TextureUSubdivisions=8
TextureVSubdivisions=4
SecondsBeforeInactive=30.000000
LifetimeRange=(Min=0.450000,Max=0.850000)
StartVelocityRange=(X=(Min=-10.000000,Max=10.000000),Y=(Min=-10.000000,Max=10.000000),Z=(Min=2.000000,Max=25.000000))
MaxAbsVelocity=(X=100.000000,Y=100.000000,Z=100.000000)
End Object
Emitters(3)=SpriteEmitter'SpriteEmitter53'
Begin Object Class=SpriteEmitter Name=SpriteEmitter54
RespawnDeadParticles=False
SpinParticles=True
UseSizeScale=True
UseRegularSizeScale=False
UniformSize=True
AutomaticInitialSpawning=False
BlendBetweenSubdivisions=True
ColorScale(1)=(RelativeTime=0.300000,Color=(B=255,G=255,R=255))
ColorScale(2)=(RelativeTime=0.750000,Color=(B=255,G=255,R=255))
ColorScale(3)=(RelativeTime=1.000000)
ColorMultiplierRange=(X=(Min=0.250000,Max=0.250000),Z=(Min=0.000000,Max=0.000000))
FadeOutStartTime=0.850000
MaxParticles=90
Name="SpriteEmitter54"
AddLocationFromOtherEmitter=1
StartLocationShape=PTLS_Sphere
SphereRadiusRange=(Max=1.000000)
SpinsPerSecondRange=(X=(Max=0.070000))
StartSpinRange=(X=(Max=1.000000))
SizeScale(0)=(RelativeTime=1.000000,RelativeSize=1.250000)
StartSizeRange=(X=(Min=20.000000,Max=30.000000),Y=(Min=0.000000,Max=0.000000),Z=(Min=0.000000,Max=0.000000))
ScaleSizeByVelocityMultiplier=(X=0.000000,Y=0.000000,Z=0.000000)
ScaleSizeByVelocityMax=0.000000
InitialParticlesPerSecond=60.000000
DrawStyle=PTDS_Brighten
Texture=Texture'kf_fx_trip_t.Gore.bloat_vomit_spray_anim'
TextureUSubdivisions=8
TextureVSubdivisions=4
SecondsBeforeInactive=30.000000
LifetimeRange=(Min=0.450000,Max=0.850000)
StartVelocityRange=(X=(Min=-10.000000,Max=10.000000),Y=(Min=-10.000000,Max=10.000000),Z=(Min=2.000000,Max=25.000000))
MaxAbsVelocity=(X=100.000000,Y=100.000000,Z=100.000000)
End Object
Emitters(4)=SpriteEmitter'SpriteEmitter54'
AutoDestroy=False
// Style=STY_Masked
bUnlit=false
bDirectional=True
bNoDelete=false
RemoteRole=ROLE_None
// bNetTemporary=true
LifeSpan = 10
}

View file

@ -0,0 +1,42 @@
class DeckGunProjectile_Trail extends Emitter;
defaultproperties
{
Begin Object Class=SpriteEmitter Name=SpriteEmitter49
SpinParticles=True
UseSizeScale=True
UseRegularSizeScale=False
UniformSize=True
BlendBetweenSubdivisions=True
ColorScale(1)=(RelativeTime=0.300000,Color=(B=255,G=255,R=255))
ColorScale(2)=(RelativeTime=0.750000,Color=(B=255,G=255,R=255))
ColorScale(3)=(RelativeTime=1.000000)
ColorMultiplierRange=(X=(Min=0.250000,Max=0.250000),Z=(Min=0.000000,Max=0.000000))
FadeOutStartTime=0.850000
MaxParticles=15
Name="SpriteEmitter49"
StartLocationShape=PTLS_Sphere
SphereRadiusRange=(Max=1.000000)
SpinsPerSecondRange=(X=(Max=0.070000))
StartSpinRange=(X=(Max=1.000000))
SizeScale(0)=(RelativeTime=1.000000,RelativeSize=1.250000)
StartSizeRange=(X=(Min=25.000000,Max=25.000000),Y=(Min=0.000000,Max=0.000000),Z=(Min=0.000000,Max=0.000000))
ScaleSizeByVelocityMultiplier=(X=0.000000,Y=0.000000,Z=0.000000)
ScaleSizeByVelocityMax=0.000000
DrawStyle=PTDS_Brighten
Texture=Texture'kf_fx_trip_t.Gore.bloat_vomit_spray_anim'
TextureUSubdivisions=8
TextureVSubdivisions=4
SecondsBeforeInactive=30.000000
LifetimeRange=(Min=0.450000,Max=0.850000)
StartVelocityRange=(X=(Min=-10.000000,Max=10.000000),Y=(Min=-10.000000,Max=10.000000),Z=(Min=2.000000,Max=25.000000))
MaxAbsVelocity=(X=100.000000,Y=100.000000,Z=100.000000)
End Object
Emitters(0)=SpriteEmitter'SpriteEmitter49'
bNoDelete=false
RemoteRole=ROLE_None
bNetTemporary=true
}

View file

@ -0,0 +1,114 @@
// Halliday's yaycht. It goes boom.
// Author: Alex Quick
class HallidaysYacht extends Decoration
placeable;
#exec OBJ LOAD FILE=Yahct_Anim.ukx
var () name ExplosionAnim;
var () sound ExplosionSound;
// The volume of the explosion sound.
var() float ExplosionSoundVolume;
// The radius of the shoot sound.
var() float ExplosionSoundRadius;
// The volume of the explosion sound.
var() float SecondaryExplosionSoundVolume;
// The radius of the shoot sound.
var() float SecondaryExplosionSoundRadius;
// When the explosion happened.
var float ExplosionTime;
// Secondary Explosion Sound Interval.
var() float ExtraExplosionSoundInterval;
var bool bDidSecondaryExplosionSound, bDidExtraSecondaryExplosionSound;
// Extra explosion sounds
var () sound SecondaryExplosionSound, ExtraSecondaryExplosionSound;
var bool bExploded, bClientExploded;
replication
{
reliable if(Role == Role_Authority && bNetDirty)
bExploded;
}
function Trigger( actor Other, pawn EventInstigator )
{
if(!bExploded)
{
bExploded = true;
ExplosionTime=Level.TimeSeconds;
if(Role == Role_Authority)
{
PlaySound(ExplosionSound, SLOT_Misc, ExplosionSoundVolume,,ExplosionSoundRadius,,false);
if(KFGameType(Level.Game) != none)
{
KFGameType(Level.Game).DramaticEvent(1.f,3.f); // MICHEAL BAY, BITCHES!
}
}
PlayExplosionAnim();
NetUpdateFrequency = 0.1 ;
}
}
function Tick(Float DeltaTime)
{
if(Role == Role_Authority && bExploded &&
(Level.TimeSeconds - ExplosionTime > ExtraExplosionSoundInterval) )
{
if( !bDidSecondaryExplosionSound )
{
bDidSecondaryExplosionSound=true;
ExplosionTime=Level.TimeSeconds;
PlaySound(SecondaryExplosionSound, SLOT_Misc, SecondaryExplosionSoundVolume,,SecondaryExplosionSoundRadius,,false);
}
else if( !bDidExtraSecondaryExplosionSound )
{
bDidExtraSecondaryExplosionSound=true;
PlaySound(ExtraSecondaryExplosionSound, SLOT_Misc, SecondaryExplosionSoundVolume,,SecondaryExplosionSoundRadius,,false);
}
}
}
simulated function PostNetReceive()
{
if(bExploded && !bClientExploded)
{
bClientExploded = true;
PlayExplosionAnim();
}
}
simulated function PlayExplosionAnim()
{
PlayAnim(ExplosionAnim,1.f,0.f,0);
}
defaultproperties
{
ExplosionAnim = "Explode"
DrawType = DT_Mesh
mesh = SkeletalMesh'Yahct_Anim.Yahct_SK'
ExplosionSoundVolume=2.0
ExplosionSoundRadius=7500
SecondaryExplosionSoundVolume=0.5
SecondaryExplosionSoundRadius=2500
bNetNotify = true
bStatic=False
bStasis=False
RemoteRole=ROLE_SimulatedProxy
bNoDelete=True
bSkipActorPropertyReplication=True
bAlwaysRelevant=True
}

View file

@ -0,0 +1,7 @@
class Inv_Explosives extends KF_StoryInventoryItem;
defaultproperties
{
AttachmentClass = none; // explosives can have no visible attachment when carried!
PickupClass = class 'Pickup_Explosives'
}

View file

@ -0,0 +1,7 @@
class Inv_GasCan extends KF_StoryInventoryItem;
defaultproperties
{
AttachmentClass = none; // gas can have no visible attachment when carried!
PickupClass = class 'Pickup_GasCan'
}

View file

@ -0,0 +1,9 @@
class Inv_TransmitterCord extends Inv_TransmitterPart;
defaultproperties
{
PickupClass = class 'Pickup_TransmitterCord'
CarriedMaterial = Texture 'Pier_T.Icons.Goldbar_Icon_64'
GroundMaterial = Texture 'Pier_T.Icons.Goldbar_Icon_64'
}

View file

@ -0,0 +1,7 @@
class Inv_TransmitterPart extends KF_StoryInventoryItem;
defaultproperties
{
bRender1PMesh = false
AttachmentClass = none; // gold bars have no visible attachment when carried!
}

View file

@ -0,0 +1,9 @@
class Inv_TransmitterSwitch extends Inv_TransmitterPart;
defaultproperties
{
PickupClass = class 'Pickup_TransmitterSwitch'
CarriedMaterial = Texture 'Pier_T.Icons.Goldbar_Icon_64'
GroundMaterial = Texture 'Pier_T.Icons.Goldbar_Icon_64'
}

View file

@ -0,0 +1,49 @@
/*
--------------------------------------------------------------
KF_Roulette_Ball
--------------------------------------------------------------
Bounce Bounce.
Author : Alex Quick
--------------------------------------------------------------
*/
class KF_Roulette_Ball extends Actor
placeable;
/* Animation to play while this ball is rolling */
var name RollAnim;
function StartRolling()
{
bFixedRotationDir = true;
bRotateToDesired = false;
if(RollAnim != '')
{
PlayAnim(RollAnim,1.f,0.1f);
}
}
function StopRolling()
{
bFixedRotationDir = false;
bRotateToDesired = true;
}
defaultproperties
{
bNoDelete = true
RotationRate=(Pitch=0,Yaw=19000,Roll=0)
bStatic = false
Physics = PHYS_Rotating
DrawType = DT_Mesh
DrawScale = 0.75
PrePivot=(X=-0,Y=0,Z=-5)
Mesh = SkeletalMesh 'Pier_anim.RTL_Ball'
Skins(0)=Texture'Engine.DecoPaint'
RollAnim = "Ball_Roll"
}

View file

@ -0,0 +1,275 @@
/*
--------------------------------------------------------------
KF_Roulette_Bet_Zone
--------------------------------------------------------------
Represents a distinct betting area on the Roulette table. Cash
thrown into this volume before the wheel spins will be considered
a valid bet.
Author : Alex Quick
--------------------------------------------------------------
*/
class KF_Roulette_Bet_Zone extends StaticMeshActor;
#exec OBJ LOAD FILE=Pier_SM.usx
#exec OBJ LOAD FILE=Pier_T.utx
/* A struct representing a player's bet on this number. */
struct SPlayerBetInfo
{
var PlayerController BettingPlayer;
var CashPickup BetPickup; // the cash pickup representing our bet and winnings.
};
enum EBetType
{
BET_Straight,
BET_Even,
BET_Odd,
BET_Red,
BET_Black,
BET_1st,
BET_2nd,
BET_3rd,
BET_Low,
BET_High,
};
var () EBetType ZoneType;
var () int ZoneNumber;
/* Reference to the table this zone belongs to */
var KF_Roulette_Wheel OwningTable;
/* Array of all the bets in this zone in the current spin - Cleared after each spin.*/
var array<SPlayerBetInfo> CurrentBets;
/* The amount this zone pays out when it hits. Set by OwningTable */
var float PayOutAmount;
var StaticMesh ChipPileSmall,ChipPileMedium,ChipPileHuge;
function OnActorLanded(Actor FallingActor)
{
local CashPickup Dosh;
Dosh = CashPickup(FallingActor);
if(Dosh != none)
{
if(OwningTable != none &&
OwningTable.AcceptNewBets())
{
AddBet(Dosh);
}
else
{
OwningTable.OnBetRejected();
}
}
}
/* We didn't win anything on this tile .. remove the cash */
function ClearOldBets()
{
local int i,NumBets;
Numbets = CurrentBets.length ;
/* Remove all the old chips */
for(i = 0 ; i < NumBets ; i ++)
{
if(CurrentBets[i].BetPickup != none)
{
CurrentBets[i].BetPickup.Destroy();
}
}
CurrentBets.length = 0 ;
}
function OnWheelSpin()
{
local int i;
for(i = 0 ; i < Currentbets.Length ; i ++)
{
if(CurrentBets[i].BetPickup != none)
{
SetChipState(Currentbets[i].BetPickup,false);
}
}
}
/* Allows or disables pickup of chips from the table */
function SetChipState( CashPickup ChipStack , bool AllowPickup)
{
ChipStack.SetCollision(AllowPickup);
OwningTable.ClientSetChipMaterial(ChipStack,AllowPickup);
}
function AddBet(CashPickup Dosh)
{
local int ExistingIndex;
local bool bPlayerAlreadyBet;
if(Dosh == none ||
Dosh.DroppedBy == none ||
Dosh.DroppedBy.PlayerReplicationInfo == none)
{
return;
}
bPlayerAlreadyBet = FindExistingPlayer(Dosh,ExistingIndex);
/* This guy already has a bet here, just update the amount he put down */
if(bPlayerAlreadyBet)
{
CurrentBets[ExistingIndex].BetPickup.CashAmount += Dosh.CashAmount;
/* also update the mesh on the table */
CurrentBets[ExistingIndex].BetPickup.SetStaticMesh(GetChipMeshFor(CurrentBets[ExistingIndex].BetPickup.CashAmount));
}
else
{
CurrentBets.length = CurrentBets.length + 1;
CurrentBets[CurrentBets.length - 1].BettingPlayer = PlayerController(Dosh.DroppedBy);
Currentbets[CurrentBets.length - 1].BetPickup = Dosh;
OwningTable.AddPlayer(CurrentBets[CurrentBets.length - 1].BettingPlayer);
}
log("Adding : $"$Dosh.CashAmount$" Bet to :"@GetZoneName());
log("Current total on :"@GetZoneName()@" is : $"$CurrentBets[0].BetPickup.CashAmount);
/* turn it into a stack of chips when it hits the table */
if(!bPlayerAlreadyBet)
{
Dosh.bPreventFadeOut = true;
Dosh.LifeSpan = 0;
Dosh.SetStaticMesh(GetChipMeshFor(Dosh.CashAmount));
SetChipState(Dosh,false);
Dosh.bOnlyOwnerCanPickup = true;
Dosh.CashAmount = 0;
}
else
{
Dosh.Destroy();
}
OwningTable.OnAddBet();
}
/* Returns the total amount of bets placed on this part of the table */
function int GetBetTotal()
{
local int idx;
local int BetTotal;
for(idx = 0 ; idx < CurrentBets.length ; idx ++)
{
if(CurrentBets[idx].BetPickup != none &&
!CurrentBets[idx].BetPickup.bHidden)
{
BetTotal += CurrentBets[idx].BetPickup.CashAmount;
}
}
return BetTotal;
}
/* Determine which mesh to use for this cash pickup. Large values means larger chip piles */
function StaticMesh GetChipMeshFor( int CashAmount)
{
if(CashAmount <= 50)
{
return ChipPileSmall ;
}
else if(CashAmount <= 250)
{
return ChipPileMedium;
}
else
{
return ChipPileHuge;
}
}
/* Convert the Enum for this Zone's Type into a human readable name */
function string GetZoneName()
{
local String ZoneString;
switch(ZoneType)
{
case BET_Straight : ZoneString = string(ZoneNumber); break;
case BET_Even : ZoneString = "Evens"; break;
case BET_Odd : ZoneString = "Odds"; break;
case BET_Black : ZoneString = "Black"; break;
case BET_Red : ZoneString = "Red" ; break;
case BET_1st : ZoneString = "First12"; break;
case BET_2nd : ZoneString = "Second12"; break;
case Bet_3rd : ZoneString = "Third12"; break;
case Bet_Low : ZoneString = "Low"; break;
case Bet_High : ZoneString = "High"; break;
}
return ZoneString;
}
function PayOut()
{
local int i;
local int PayOutSum;
for(i = 0 ; i < CurrentBets.length ; i ++)
{
if(CurrentBets[i].BettingPlayer != none )
{
PayOutSum = (CurrentBets[i].BetPickup.CashAmount + (CurrentBets[i].BetPickup.CashAmount * PayOutAmount));
log("*************************");
log(GetZoneName()@" Paid out $"$PayOutSum@" to - "@CurrentBets[i].BettingPlayer.PlayerReplicationInfo.PlayerName);
CurrentBets[i].BetPickup.CashAmount = PayOutSum;
CurrentBets[i].BetPickup.SetStaticMesh(GetChipMeshFor(PayOutSum));
SetChipState(CurrentBets[i].BetPickup,true);
}
}
}
/* Has this player already placed a bet in this zone or not ? */
function bool FindExistingPlayer(CashPickup Dosh, optional out int ExistingIndex)
{
local int i;
for(i = 0 ; i < CurrentBets.length ; i ++)
{
if(CurrentBets[i].BettingPlayer == Dosh.DroppedBy &&
CurrentBets[i].BetPickup != none &&
!CurrentBets[i].BetPickup.bHidden )
{
ExistingIndex = i;
return true;
}
}
return false;
}
defaultproperties
{
StaticMesh = StaticMesh'Pier_SM.1'
ChipPileSmall = StaticMesh'Pier_SM.Env_Pier_Chips_Small'
ChipPileMedium = StaticMesh'Pier_SM.Env_Pier_Chips_Medium'
ChipPileHuge = StaticMesh'Pier_SM.Env_Pier_Chips_Large'
}

View file

@ -0,0 +1,95 @@
class KF_Roulette_Screen extends Actor
placeable;
var ScriptedTexture ScriptedScreen;
var Shader ShadedScreen;
var Material ScriptedScreenBack;
var Font ScreenFont;
var color BackColor;
/* Reference to the table this zone belongs to */
var KF_Roulette_Wheel OwningTable;
simulated function PostBeginPlay()
{
InitMaterials();
}
simulated function InitMaterials()
{
if( ScriptedScreen==None )
{
ScriptedScreen = ScriptedTexture(Level.ObjectPool.AllocateObject(class'ScriptedTexture'));
ScriptedScreen.SetSize(256,256);
ScriptedScreen.FallBackMaterial = ScriptedScreenBack;
ScriptedScreen.Client = Self;
}
if( ShadedScreen==None )
{
ShadedScreen = Shader(Level.ObjectPool.AllocateObject(class'Shader'));
ShadedScreen.Diffuse = ScriptedScreen;
ShadedScreen.SelfIllumination = ScriptedScreen;
skins[0] = ShadedScreen;
}
}
simulated function Tick(float DeltaTime)
{
if(ScriptedScreen != none)
{
ScriptedScreen.Revision++;
if( ScriptedScreen.Revision>10 )
ScriptedScreen.Revision = 1;
}
}
simulated event RenderTexture(ScriptedTexture Tex)
{
local int SizeX, SizeY;
local string WinningNumber;
local color WinningClr;
local string ClrString;
local int i;
local float PosX,PosY;
Tex.DrawTile(0,0,Tex.USize,Tex.VSize,0,0,256,256,Texture'KillingFloorWeapons.Welder.WelderScreen',BackColor); // Draws the tile background
PosX = Tex.USize/2 ;
PosY = Tex.VSize/2 ;
for(i = OwningTable.WinningNumbers.length-1 ; i >= 0; i --)
{
if(i == OwningTable.WinningNumbers.length-1)
{
WinningNumber = ">>>"$OwningTable.WinningNumbers[i]$"<<<";
}
else
{
WinningNumber = string(OwningTable.WinningNumbers[i]);
}
ClrString = Owningtable.GetPocketClr(OwningTable.WinningNumbers[i]);
switch(ClrString)
{
case "Black" : WinningClr = class 'Canvas'.static.MakeColor(0,0,0); break;
case "Red" : WinningClr = class 'Canvas'.static.MakeColor(255,50,50); break;
case "Green" : WinningClr = class 'Canvas'.static.MakeColor(50,255,50); break;
}
Tex.TextSize(WinningNumber,ScreenFont,SizeX,SizeY);
Tex.DrawText(PosX - SizeX/2, PosY - SizeY/2,WinningNumber,ScreenFont,WinningClr);
PosY -= (SizeY * 1.25);
}
}
defaultproperties
{
BackColor=(R=128,B=128,G=128,A=255)
ScreenFont=Font'ROFonts.ROBtsrmVr24'
}

View file

@ -0,0 +1,782 @@
/*
--------------------------------------------------------------
KF_Roulette_Wheel
--------------------------------------------------------------
Interactive prop for the 2013 Summer Sideshow map. Players
place bets by throwing dosh onto the table. The game begins
when there are enough bets on the table.
Author : Alex Quick
--------------------------------------------------------------
*/
class KF_Roulette_Wheel extends Actor
placeable
dependson(KF_Roulette_Bet_Zone);
const NUMPOCKETS = 37;
const POCKETSPACING = 1771.24; // (65536 / NumPockets)
const NUMBETSNDS = 3;
var int FinalPocket;
/* The Tags of the Roulette zone volumes should all match this name */
var() name TableName;
/* A struct representing a player who has bets on this table */
struct SPlayerTableInfo
{
var PlayerController BettingPlayer;
var int InitialBetSum; // amount this player had on the table as of the first bet.
var int CurrentBetSum; // amount this player has on the table right this minute.
};
/* Array of all players who have bets placed on this table */
var array<SPlayerTableInfo> AllPlayers;
/* A struct representing a pocket on the roulette wheel. */
struct SPocketInfo
{
var byte PocketClr; // 0 = Green, 1=Black , 2 = Red
var int PocketPosition; // Rotation Roll value for this pocket. (RUUs)
};
/* An array that stores all the colours associated with the "Pockets on the roulette wheel. */
var SPocketInfo PocketInfo[NUMPOCKETS];
/* Minimum bet that must be on the table to play */
var() int MinBet;
var() KF_Roulette_Ball Ball;
var float MaxBallSpin,MaxWheelSpin;
var float LastBallSpeedDecrement,BallSpeedDecrementInterval;
var array<int> WinningNumbers;
/* Array of all the areas on this table that players can bet in */
var array<KF_Roulette_Bet_Zone> BetZones;
var float SpinDuration;
/* Percent of SpinDuration that must pass before all betting is closed */
var float BetsClosedTimePct;
var float LastSpinTime;
/* The Roulette wheel is turning and the ball is in motion */
var bool bSpinning;
/* Amount of time after a bet is placed before the wheel starts spinning */
var float SpinCountDown;
var float LastSpinCountDownTime;
/* There are sufficient bets on the table to spin, and the countdown to spin is in progress */
var bool bCountingDownToSpin;
var bool bNotifiedBettingClosed;
/* At least one player left his winnings from a previous spin on the table*/
var bool bLettingItRide;
/* Sounds ===============================================================*/
/* Sound the roulette wheel makes when its spinning around */
var Sound WheelSpinSnd;
var Sound PlaceBetSnds[NUMBETSNDS];
var string PlaceBetSndsRef[NUMBETSNDS];
var string WheelSpinSndRef;
/* This Table is active and open for business */
var bool bActive;
var () const bool bStartActive;
replication
{
reliable if(Role == Role_Authority)
FinalPocket;
}
function PreBeginPlay()
{
PreLoadSounds();
}
function PostBeginPlay()
{
FindBetZones();
SetActive(bStartActive);
}
function PreLoadSounds()
{
local int i;
if ( default.WheelSpinSndRef != "" )
{
WheelSpinSnd = sound(DynamicLoadObject(default.WheelSpinSndRef, class'Sound', true));
}
for(i = 0 ; i < NUMBETSNDS; i ++)
{
if ( default.PlaceBetSndsRef[i] != "" )
{
PlaceBetSnds[i] = sound(DynamicLoadObject(default.PlaceBetSndsRef[i], class'Sound', true));
}
}
}
/* Cache all the 'pieces' of this table */
function FindBetZones()
{
local KF_Roulette_Bet_Zone Zone;
foreach AllActors(class 'KF_Roulette_Bet_Zone', Zone, TableName)
{
BetZones[BetZones.length] = Zone;
Zone.OwningTable = self;
Zone.PayOutAmount = GetPayoutFor(Zone.ZoneType);
}
}
/* Returns true if this table is open for betting */
function bool AcceptNewBets()
{
return bActive && (!bSpinning || Level.TimeSeconds - LastSpinTime < (SpinDuration*BetsClosedTimePct)) ;
}
/* Player placed a bet on this table */
function OnAddBet()
{
StartCountDown();
PlaySound(PlaceBetSnds[Rand(NUMBETSNDS)]);
}
/* bet was rejected */
function OnBetRejected()
{
NotifyBettingClosed();
}
/* Check if there are enough bets on the table to start the countdown to the spin */
function bool StartCountDown(optional bool SuppressNotifications)
{
if(!bCountingDownToSpin && !bSpinning && CheckMinBet(SuppressNotifications))
{
bCountingDownToSpin = true;
LastSpinCountDownTime = Level.TimeSeconds;
SetTimer(SpinCountDown,false);
return true;
}
return false;
}
function AbortCountDown()
{
bLettingItRide = false;
bCountingDownToSpin = false;
SetTimer(0.f,false);
}
function Timer()
{
bCountingDownToSpin = false;
SpinWheel();
}
/* A player placed a bet somewhere on this table. Add him to the game */
function AddPlayer(PlayerController NewPlayer)
{
if(!FindPlayer(NewPlayer))
{
AllPlayers.length = AllPlayers.length + 1;
AllPlayers[AllPlayers.length - 1].BettingPlayer = NewPlayer;
}
StartCountDown();
}
/* A Player was removed from the game - (busted out or took his winnings off the table) */
function RemovePlayer(PlayerController PlayerToRemove)
{
local int PlayerIdx;
if(FindPlayer(PlayerToRemove,PlayerIdx))
{
AllPlayers.Remove(PlayerIdx,1);
}
}
function bool FindPlayer(PlayerController PlayerToFind, optional out int PlayerIdx)
{
local int i;
for(i = 0 ; i < AllPlayers.length ; i ++)
{
if(AllPlayers[i].BettingPlayer == PlayerToFind)
{
PlayerIdx = i;
return true;
}
}
return false;
}
/* Begins the wheel animation */
function SpinWheel()
{
local int i;
if(Level.TimeSeconds - LastSpinTime > SpinDuration)
{
if(WheelSpinSnd != none)
{
PlaySound(WheelSpinSnd);
}
LastSpinTime = Level.TimeSeconds;
log("******* SPINNING THE WHEEL ********** ");
FinalPocket = Rand(arrayCount(PocketInfo));
log(" The ball landed on : "@FinalPocket@GetPocketClr(FinalPocket));
bFixedRotationDir = true;
bRotateToDesired = false;
RotationRate.Yaw = -MaxWheelSpin ;
Ball.StartRolling();
bSpinning = true;
for(i = 0 ; i < BetZones.length ; i ++)
{
BetZones[i].OnWheelSpin();
}
if(bLettingItRide)
{
NotifyLetItRide();
}
UpdatePlayerBetTotals();
}
}
simulated function int GetCurrentPocket()
{
return GetPocketAtPosition(RUUToPosition(Ball.Rotation.Yaw - Rotation.Yaw));
}
/* Toggle Table Active or not*/
function SetActive(bool On)
{
if(Ball != none)
{
Ball.bHidden = !On;
}
bHidden = !On;
bActive = On;
if(!bActive)
{
if(bCountingDownToSpin)
{
AbortCountDown();
}
OnSpinComplete();
}
}
function Tick(Float DeltaTime)
{
local int i;
/* Betting is closed */
if(!AcceptNewBets() && !bNotifiedBettingClosed)
{
bNotifiedBettingClosed = true;
NotifyBettingClosed();
}
if(bCountingDownToSpin)
{
/* Someone picked up their winnings */
if(!CheckMinBet())
{
AbortCountDown();
}
for(i = 0 ; i < AllPlayers.Length ; i ++)
{
if(AllPlayers[i].BettingPlayer != none)
{
AllPlayers[i].BettingPlayer.ReceiveLocalizedMessage(class 'Msg_RouletteCountDown',int(SpinCountDown - (Level.TimeSeconds - LastSpinCountDownTime)));
}
}
}
if(bSpinning)
{
/* if(Level.TimeSeconds - LastBallSpeedDecrement > BallSpeedDecrementInterval)
{
LastBallSpeedDecrement = Level.TimeSeconds;
Ball.RotationRate.Yaw = FMax(Ball.RotationRate.Yaw - ((MaxBallSpin * BallSpeedDecrementInterval)/SpinDuration),MaxBallSpin*0.01);
}
*/
if(Level.TimeSeconds - LastSpinTime >= SpinDuration )
{
OnSpinComplete();
}
}
}
function int GetPocketAtPosition(int InPos)
{
local int i;
for(i = 0 ; i < NUMPOCKETS ; i ++)
{
if(PocketInfo[i].PocketPosition == InPos)
{
return i ;
}
}
return -1;
}
/* Converts the wheel position integer to a Unreal Unit Rotation value */
function float PositionToRUU(int Position)
{
return (Position * PocketSpacing) & 65536;
}
/* Converts a Rotation value to a wheel position integer */
function int RUUToPosition(float RotVal)
{
return FClamp(Round(RotVal / PocketSpacing),0,NumPockets-1) ;
}
/* Called when the ball has come to a rest on the desired number. */
function OnSpinComplete()
{
RotationRate.Yaw = 0.f;
Ball.DesiredRotation.Yaw = PositionToRUU(FinalPocket);
Ball.StopRolling();
bFixedRotationDir = false;
bRotateToDesired = true;
DesiredRotation.Yaw = 0.f;
bSpinning = false;
bNotifiedBettingClosed = false;
WinningNumbers[WinningNumbers.length] = FinalPocket;
ProcessBets();
}
static function string GetPocketClr(int Pocket)
{
local int ClrIdx;
local string ClrString;
ClrIdx = default.PocketInfo[Pocket].PocketClr;
switch(ClrIdx)
{
case 0 : ClrString = "Green" ; break;
case 1 : ClrString = "Black" ; break;
case 2 : ClrString = "Red" ; break;
}
return ClrString;
}
/* Returns true if there are enough bets on the table to spin the wheel */
function bool CheckMinBet(optional bool SuppressNotification)
{
local int i;
local int BetTotal;
local bool EnoughCash;
for(i = 0 ; i < BetZones.length ; i ++)
{
BetTotal += BetZones[i].GetBetTotal();
}
EnoughCash = BetTotal >= MinBet;
if(!EnoughCash && !SuppressNotification)
{
NotifyNeedMinBet();
}
return EnoughCash;
}
/* Returns the payout ratio for a specific type of Bet */
function float GetPayoutFor(KF_Roulette_Bet_Zone.EBetType Bet)
{
switch(Bet)
{
case BET_Straight : return 35.f ; break; // 35 to 1
Default : return 1.f; break; // 1 to 1
}
}
/* Calculates the winnings for each BetZone and clears bets on Zones which didn't hit */
function ProcessBets()
{
local int i;
if(BetZones.length == 0)
{
log("WARNING - No BetZones associated with this table. ");
}
for(i = 0 ; i < BetZones.length ; i ++)
{
if(BetZones[i].ZoneType == BET_Red && IsRed(FinalPocket)) // Red bet
{
log("Red bet Wins on "$FinalPocket);
BetZones[i].PayOut();
}
else if(BetZones[i].ZoneType == BET_Black && IsBlack(FinalPocket)) // Black bet
{
log("Black bet Wins on "$FinalPocket);
BetZones[i].PayOut();
}
else if (BetZones[i].ZoneType == BET_Even && IsEven(FinalPocket))
{
log("Even number bet Wins on "$FinalPocket);
BetZones[i].PayOut();
}
else if (BetZones[i].ZoneType == BET_Odd && !IsEven(FinalPocket))
{
log("Odd number bet Wins on "$FinalPocket);
BetZones[i].PayOut();
}
else if(BetZones[i].ZoneType == BET_1st && IsFirsts(FinalPocket)) // First 12
{
log("Firsts bet Wins on "$FinalPocket);
BetZones[i].PayOut();
}
else if(BetZones[i].ZoneType == BET_2nd && IsSeconds(FinalPocket)) // Second 12
{
log("Seconds bet Wins on "$FinalPocket);
BetZones[i].PayOut();
}
else if(BetZones[i].ZoneType == BET_3rd && IsThirds(FinalPocket)) // Third 12
{
log("Thirds bet Wins on "$FinalPocket);
BetZones[i].PayOut();
}
else if(BetZones[i].ZoneType == BET_Low && IsLow(FinalPocket)) // Low Bet
{
log("Low bet Wins on "$FinalPocket);
BetZones[i].PayOut();
}
else if(BetZones[i].ZoneType == BET_High && IsHigh(FinalPocket)) // High Bet
{
log("High bet Wins on "$FinalPocket);
BetZones[i].PayOut();
}
else if(BetZones[i].ZoneType == BET_Straight &&
FinalPocket == BetZones[i].ZoneNumber) // Straight number
{
log("Straight Bet Wins on "$FinalPocket);
BetZones[i].PayOut();
}
else
{
BetZones[i].ClearOldBets();
}
}
UpdatePlayerBetTotals();
NotifyWinnings();
RemoveBustedPlayers();
/* Let's see if there's enough cash on the table to start another spin ... */
if(StartCountDown(true))
{
bLettingItRide = true;
}
}
/* Updates the current bet totals for all players on the table */
function UpdatePlayerBetTotals()
{
local int i, NumPlayers;
NumPlayers = AllPlayers.length;
for(i = 0 ; i < NumPlayers ; i ++)
{
AllPlayers[i].CurrentbetSum = GetCurrentBetTotalFor(AllPlayers[i].BettingPlayer);
}
}
/* Returns the total amount of dosh a player has bet on this table at the moment */
function int GetCurrentBetTotalFor( PlayerController Player)
{
local int i;
local int idx;
local int TotalBet;
for(i = 0; i < BetZones.Length ; i ++)
{
for(idx = 0 ; idx < BetZones[i].CurrentBets.length ;idx ++)
{
if(BetZones[i].CurrentBets[idx].BettingPlayer == Player)
{
TotalBet += BetZones[i].CurrentBets[idx].BetPickup.CashAmount ;
}
}
}
return TotalBet;
}
/* Remove any players who have no more bets on the table */
function RemoveBustedPlayers()
{
local int i, NumPlayers;
NumPlayers = AllPlayers.length;
for(i = 0 ; i < NumPlayers ; i ++)
{
if(AllPlayers[i].CurrentBetSum <= 0) // this guys went broke, he's not in the game anymore.
{
AllPlayers.Remove(i,1);
}
}
}
/* == Player Feedback & Localized Messaging ======================================================
==================================================================================================*/
/* Let players know how the last spin went. Send them a local message with their net winnings */
function NotifyWinnings()
{
local int i;
local int NetWinnings;
for(i = 0 ; i< AllPlayers.length ; i ++)
{
if(AllPlayers[i].BettingPlayer != none)
{
NetWinnings = AllPlayers[i].CurrentBetSum - AllPlayers[i].InitialBetSum ;
/* let players know which number it landed on */
AllPlayers[i].BettingPlayer.ReceiveLocalizedMessage(class 'Msg_RouletteSpin',FinalPocket);
/* let players know how much they have won so far. */
AllPlayers[i].BettingPlayer.ReceiveLocalizedMessage(class 'Msg_RouletteWinnings', NetWinnings);
}
}
}
/* Let players know that they are letting it ride. */
function NotifyLetitRide()
{
local int i;
for(i = 0 ; i< AllPlayers.length ; i ++)
{
if(AllPlayers[i].BettingPlayer != none)
{
AllPlayers[i].BettingPlayer.ReceiveLocalizedMessage(class 'Msg_RouletteGeneric', 1);
}
}
}
/* Let players know that they need to place more cash on the table to play*/
function NotifyNeedMinBet()
{
local int i;
for(i = 0 ; i< AllPlayers.length ; i ++)
{
if(AllPlayers[i].BettingPlayer != none)
{
AllPlayers[i].BettingPlayer.ReceiveLocalizedMessage(class 'Msg_RouletteGeneric', 3);
}
}
}
/* Let players know that they cannot place anymore bets right now */
function NotifyBettingClosed()
{
local int i;
for(i = 0 ; i< AllPlayers.length ; i ++)
{
if(AllPlayers[i].BettingPlayer != none)
{
AllPlayers[i].BettingPlayer.ReceiveLocalizedMessage(class 'Msg_RouletteGeneric', 2);
}
}
}
/*============================================================================================
=============================================================================================*/
/* Changes the UV2 Material on the Chips so they look glowy to the player who won them
and not glowy to everyone else */
function ClientSetChipMaterial(CashPickup Chips, bool Glow)
{
local int i;
local Material NewMat;
for(i = 0 ; i < AllPlayers.length ; i ++)
{
NewMat = none ;
if(KFPlayerController_Story(AllPlayers[i].BettingPlayer) != none )
{
if(Glow && AllPlayers[i].Bettingplayer == Chips.DroppedBy)
{
NewMat = Chips.default.UV2Texture ;
}
KFPlayerController_Story(AllPlayers[i].BettingPlayer).ClientSetUV2Tex(Chips,NewMat);
}
}
}
function bool IsBlack(int Num)
{
return PocketInfo[Num].PocketClr == 1;
}
function bool IsRed(int Num)
{
return PocketInfo[Num].PocketClr == 2;
}
function bool IsEven(int Num)
{
return Num % 2 == 0;
}
function bool IsFirsts(int Num)
{
return Num <= 12 && Num > 0;
}
function bool IsSeconds(int Num)
{
return Num > 12 && Num <= 24 ;
}
function bool IsThirds( int Num)
{
return Num > 24 && Num <= 36;
}
function bool IsLow (int Num)
{
return Num > 0 && Num <= 18;
}
function bool IsHigh( int Num)
{
return Num >= 19 && Num <= 36 ;
}
defaultproperties
{
DrawType = DT_StaticMesh
StaticMesh = StaticMesh'Pier_SM.Env_Pier_Roulette_Table_Wheel'
Physics = PHYS_Rotating
bFixedRotationDir= true
bCollideActors = true
RemoteRole = Role_SimulatedProxy
MaxBallSpin = 190000
MaxWheelSpin = 10000
MinBet = 100
BetsClosedTimePct = 0.5
SpinDuration = 5
SpinCountDown = 5
BallSpeedDecrementInterval = 0.1
WheelSpinSndRef ="Steamland_SND.Roulette_WheelSpin"
PlaceBetSndsRef(0)="Steamland_SND.Roulette_StackOff_1"
PlaceBetSndsRef(1)="Steamland_SND.Roulette_StackOff_2"
PlaceBetSndsRef(2)="Steamland_SND.Roulette_StackOff_3"
PocketInfo(0)=(PocketClr=0,PocketPosition=32)
PocketInfo(1)=(PocketClr=2,PocketPosition=18)
PocketInfo(2)=(PocketClr=1,Pocketposition=1)
PocketInfo(3)=(PocketClr=2,Pocketposition=30)
PocketInfo(4)=(PocketClr=2,Pocketposition=36)
PocketInfo(5)=(PocketClr=2,PocketPosition=14)
PocketInfo(6)=(PocketClr=1,PocketPosition=5)
PocketInfo(7)=(PocketClr=2,PocketPosition=26)
PocketInfo(8)=(PocketClr=1,PocketPosition=11)
PocketInfo(9)=(PocketClr=2,PocketPosition=22)
PocketInfo(10)=(PocketClr=1,PocketPosition=13)
PocketInfo(11)=(PocketClr=1,PocketPosition=9)
PocketInfo(12)=(PocketClr=2,PocketPosition=28)
PocketInfo(13)=(PocketClr=1,PocketPosition=7)
PocketInfo(14)=(PocketClr=2,PocketPosition=20)
PocketInfo(15)=(PocketClr=1,Pocketposition=34)
PocketInfo(16)=PocketClr=2,PocketPosition=16)
PocketInfo(17)=(PocketClr=1,Pocketposition=3)
PocketInfo(18)=(PocketClr=2,PocketPosition=24)
PocketInfo(19)=(PocketClr=2,Pocketposition=35)
PocketInfo(20)=(PocketClr=1,PocketPosition=19)
PocketInfo(21)=(PocketClr=2,Pocketposition=0)
PocketInfo(22)=(PocketClr=1,Pocketposition=23)
PocketInfo(23)=(PocketClr=2,PocketPosition=12)
PocketInfo(24)=(PocketClr=1,PocketPosition=15)
PocketInfo(25)=(PocketClr=2,Pocketposition=2)
PocketInfo(26)=(PocketClr=1,Pocketposition=31)
PocketInfo(27)=(PocketClr=2,PocketPosition=6)
PocketInfo(28)=(PocketClr=1,PocketPosition=27)
PocketInfo(29)=(PocketClr=1,PocketPosition=25)
PocketInfo(30)=(PocketClr=2,PocketPosition=10)
PocketInfo(31)=(PocketClr=1,PocketPosition=21)
PocketInfo(32)=(PocketClr=2,Pocketposition=33)
PocketInfo(33)=(PocketClr=1,PocketPosition=17)
PocketInfo(34)=(PocketClr=2,Pocketposition=4)
PocketInfo(35)=(PocketClr=1,PocketPosition=29)
PocketInfo(36)=(PocketClr=2,PocketPosition=8)
}

View file

@ -0,0 +1,92 @@
class KF_Slot_AmmoPickup extends KFAmmoPickup;
var() byte AmmoMultiplier; // Multiply the amount of ammo received by this number
// Overridden so KF_Slot_AmmoPickup is never added to the AmmoPickups array
event PostBeginPlay(){}
auto state Pickup
{
// Overridden so we do not try and access AmmoPickups
function Touch(Actor Other)
{
local Inventory CurInv;
local bool bPickedUp;
local int AmmoPickupAmount;
local Boomstick DBShotty;
local bool bResuppliedBoomstick;
local float VeterancyMod;
if ( Pawn(Other) != none && Pawn(Other).bCanPickupInventory && Pawn(Other).Controller != none &&
FastTrace(Other.Location, Location) )
{
for ( CurInv = Other.Inventory; CurInv != none; CurInv = CurInv.Inventory )
{
if( Boomstick(CurInv) != none )
{
DBShotty = Boomstick(CurInv);
}
if ( KFAmmunition(CurInv) != none && KFAmmunition(CurInv).bAcceptsAmmoPickups )
{
if ( KFAmmunition(CurInv).AmmoPickupAmount > 1 )
{
if ( KFAmmunition(CurInv).AmmoAmount < KFAmmunition(CurInv).MaxAmmo )
{
if ( KFPlayerReplicationInfo(Pawn(Other).PlayerReplicationInfo) != none && KFPlayerReplicationInfo(Pawn(Other).PlayerReplicationInfo).ClientVeteranSkill != none )
{
VeterancyMod = KFPlayerReplicationInfo(Pawn(Other).PlayerReplicationInfo).ClientVeteranSkill.static.GetAmmoPickupMod(KFPlayerReplicationInfo(Pawn(Other).PlayerReplicationInfo), KFAmmunition(CurInv));
AmmoPickupAmount = float(KFAmmunition(CurInv).AmmoPickupAmount) * VeterancyMod * AmmoMultiplier;
}
else
{
AmmoPickupAmount = KFAmmunition(CurInv).AmmoPickupAmount * AmmoMultiplier;
}
KFAmmunition(CurInv).AmmoAmount = Min(KFAmmunition(CurInv).MaxAmmo, KFAmmunition(CurInv).AmmoAmount + AmmoPickupAmount);
if( DBShotgunAmmo(CurInv) != none )
{
bResuppliedBoomstick = true;
}
bPickedUp = true;
}
}
else if ( KFAmmunition(CurInv).AmmoAmount < KFAmmunition(CurInv).MaxAmmo )
{
bPickedUp = true;
if ( FRand() <= (1.0 / Level.Game.GameDifficulty) )
{
AmmoPickupAmount = KFAmmunition(CurInv).AmmoAmount + AmmoPickupAmount * AmmoMultiplier;
KFAmmunition(CurInv).AmmoAmount = Min(KFAmmunition(CurInv).MaxAmmo, AmmoPickupAmount);
}
}
}
}
if ( bPickedUp )
{
if( bResuppliedBoomstick && DBShotty != none )
{
DBShotty.AmmoPickedUp();
}
AnnouncePickup(Pawn(Other));
if(RespawnTime > 0)
{
GotoState('Sleeping', 'Begin');
}
else
{
Destroy();
}
}
}
}
}
defaultproperties
{
AmmoMultiplier=1
RespawnTime=0.000000
}

View file

@ -0,0 +1,53 @@
class KF_Slot_CashPickup extends CashPickup;
simulated function PostBeginPlay()
{
Super.PostbeginPlay();
Velocity = Normal(vector(Rotation)) * 250.f + VRand()*50.f ;
}
function InitDroppedPickupFor(Inventory Inv)
{
SetPhysics(PHYS_Falling);
GotoState('FallingPickup');
Inventory = Inv;
bAlwaysRelevant = false;
bOnlyReplicateHidden = false;
bUpdateSimulatedPosition = true;
bDropped = true;
LifeSpan = 5;
bIgnoreEncroachers = false; // handles case of dropping stuff on lifts etc
NetUpdateFrequency = 8;
}
function GiveCashTo( Pawn Other )
{
// You all love the mental-mad typecasting XD
if( !bDroppedCash )
{
}
else if ( Other.PlayerReplicationInfo != none && DroppedBy.PlayerReplicationInfo != none &&
((DroppedBy.PlayerReplicationInfo.Score + float(CashAmount)) / Other.PlayerReplicationInfo.Score) >= 0.50 &&
PlayerController(DroppedBy) != none && KFSteamStatsAndAchievements(PlayerController(DroppedBy).SteamStatsAndAchievements) != none )
{
if ( Other.PlayerReplicationInfo != DroppedBy.PlayerReplicationInfo )
{
KFSteamStatsAndAchievements(PlayerController(DroppedBy).SteamStatsAndAchievements).AddDonatedCash(CashAmount);
}
}
if( Other.Controller!=None && Other.Controller.PlayerReplicationInfo!=none )
{
Other.Controller.PlayerReplicationInfo.Score += CashAmount;
}
AnnouncePickup(Other);
SetRespawn();
}
defaultproperties
{
bFixedRotationDir=False
bOnlyDirtyReplication =false
CashAmount = 100
RespawnTime = 0
}

View file

@ -0,0 +1,671 @@
/*
--------------------------------------------------------------
KF_Slot_Machine
--------------------------------------------------------------
Interactive prop for the 2013 Summer Sideshow map. Can be used
by players to randomly dole out prizes.
Author : Alex Quick
--------------------------------------------------------------
*/
#exec OBJ LOAD FILE=Pier_anim.ukx
class KF_Slot_Machine extends Actor
placeable;
const NUMREELS = 3;
const NUMSYMBOLS = 6;
const NUMAMBIENTSNDS = 3;
var() edfindable KF_Slot_Reel Reels[NUMREELS] ;
var float DesiredRolls[NUMREELS];
var int NumSpinning;
var() float SpinDuration;
var float LastSpinTime;
var float LastReelStopTime;
var string Snd_ReelStoppedRef,Snd_ReelSpinningRef,Snd_MonsterPrizeRef,Snd_CashPrizeRef,Snd_JackpotRef, Snd_LeverPullRef;
var Sound Snd_ReelStopped,Snd_ReelSpinning,Snd_MonsterPrize,Snd_CashPrize,Snd_Jackpot,Snd_LeverPull;
// The volume to play these slot machine sounds at
var float ReelStoppedVolume, CashPrizeVolume, MonsterPrizeVolume, JackpotVolume, LeverPullVolume;
// The sound radius to use for these slot machine sounds
var float ReelSpinningRadius, ReelStoppedRadius, CashPrizeRadius, MonsterPrizeRadius, JackpotRadius, LeverPullRadius;
// The volume of the ambient sound when the real spinning is playing
var byte ReelSpinningVolume;
var string Snd_AmbientActiveRef[NUMAMBIENTSNDS];
var Sound Snd_AmbientActive[NUMAMBIENTSNDS];
var Pawn CurrentPlayer;
var() const name YouLostEvent;
var() const name YouWonEvent;
var int RemainingPayOut;
// rate at which you accrue 'good karma' if you keep pulling and not hitting.
var() const float JackPotChanceIncreaseRate;
var() int MaxBet;
var int RemainingBonusSpins;
var() const edfindable KF_StoryWaveDesigner AssociatedDesigner;
var float JackPotChance;
var bool bFirstSpin;
/* ==== Animation Stuff =================================*/
/* Animation the slot machine plays when it is used */
var name SlotPullAnim;
var byte RepAnimByte,LastRepAnimByte;
struct SReelSymbol
{
var float ReelPosition; // The Rotation (Roll) that this symbol inhabits on the reel.
var string SymbolName; // Name of the Symbol.
var int NumReqHits; // The number of hits this symbol requires to pay out.
var int NumHits; // The number of times this symbol was on the payline during the current spin. Cleared each new spin.
};
var SReelSymbol ReelSymbols[NUMSYMBOLS];
var bool bActive;
var() const bool bStartActive;
replication
{
reliable if(Role == Role_Authority && bNetDirty)
RepAnimByte;
}
function PreBeginPlay()
{
PreLoadSounds();
}
function PostBeginPlay()
{
SetActive(bStartActive);
}
function PreLoadSounds()
{
local int i;
if ( default.Snd_ReelStoppedRef != "" )
{
Snd_ReelStopped = sound(DynamicLoadObject(default.Snd_ReelStoppedRef, class'Sound', true));
}
if( default.Snd_ReelSpinningRef != "")
{
Snd_ReelSpinning = sound(DynamicLoadObject(default.Snd_ReelSpinningRef, class'Sound', true));
}
if( default.Snd_MonsterPrizeRef != "")
{
Snd_MonsterPrize = sound(DynamicLoadObject(default.Snd_MonsterPrizeRef, class'Sound', true));
}
if( default.Snd_CashPrizeRef != "")
{
Snd_CashPrize = sound(DynamicLoadObject(default.Snd_CashPrizeRef, class'Sound', true));
}
if( default.Snd_JackpotRef != "")
{
Snd_Jackpot = sound(DynamicLoadObject(default.Snd_JackpotRef, class'Sound', true));
}
if( default.Snd_LeverPullRef != "")
{
Snd_LeverPull = sound(DynamicLoadObject(default.Snd_LeverPullRef, class'Sound', true));
}
for(i = 0 ; i < NUMAMBIENTSNDS ; i ++)
{
if( default.Snd_AmbientActiveRef[i] != "")
{
Snd_AmbientActive[i] = sound(DynamicLoadObject(default.Snd_AmbientActiveRef[i], class'Sound', true));
}
}
}
/* A player threw some cash at a slot machine . */
simulated event Touch( Actor Other )
{
local Cashpickup DroppedCash;
DroppedCash = CashPickup(Other);
if(DroppedCash != none)
{
if(DroppedCash.bDroppedCash &&
DroppedCash.CashAmount >= MaxBet &&
DroppedCash.DroppedBy != none &&
DroppedCash.DroppedBy.Pawn != none &&
AttemptSpin(DroppedCash.DroppedBy.Pawn))
{
DroppedCash.SetRespawn();
}
else
{
/* Flings the dropped cash back at the guy who threw it. */
DroppedCash.Velocity = vect(0,0,0);
}
}
}
/* Attempts to spin the slot reels. Returns true if successfull */
function bool AttemptSpin(Pawn SlotPlayer)
{
/* Dont' allow a new spin if the reels are already spinning or the machine is still paying out a prize */
if(bActive &&
!ReelsAreSpinning() &&
RemainingPayOut == 0 &&
!IsAnimating())
{
if(Snd_LeverPull != none)
{
PlaySound(Snd_LeverPull,SLOT_None,LeverPullVolume,false,LeverPullRadius,SoundPitch / 64.0);
}
AmbientSound = Snd_ReelSpinning;
SoundVolume = ReelSpinningVolume;
SoundRadius = ReelSpinningRadius;
bNetNotify = true;
NetUpdateTime = Level.TimeSeconds - 1;
CurrentPlayer = SlotPlayer;
if(RemainingBonusSpins > 0)
{
RemainingBonusSpins = Max(RemainingBonusSpins -1, 0) ;
}
CalculateReelPositions();
if(SlotPullAnim != '')
{
RepAnimByte ++ ;
PlayPullAnim();
}
return true;
}
return false;
}
event Trigger( Actor Other, Pawn EventInstigator )
{
SetActive(!bActive);
}
function bool ReelsAreSpinning()
{
return NumSpinning > 0;
}
/* The final positions for each reel are calculated before they actually start spinning */
function CalculateReelPositions()
{
local int i,idx;
local string SymbolName;
for(i = 0 ; i < ArrayCount(ReelSymbols) ; i ++)
{
ReelSymbols[i].NumHits = 0;
}
// log("CHANCE TO HIT JACKPOINT : "@JackPotChance*100$"%");
for(i = 0 ; i < ArrayCount(Reels) ; i ++)
{
if(FRand() < JackPotChance)
{
DesiredRolls[i] = 0.f;
}
else
{
DesiredRolls[i] = 11000.f * Round(RandRange(0,arraycount(ReelSymbols)-1)) ;
}
SymbolName = GetSymbolAtPosition(DesiredRolls[i]);
// log("["$i$"] : "$SymbolName);
for(idx = 0 ; idx < arraycount(ReelSymbols) ; idx ++)
{
if(ReelSymbols[idx].SymbolName == SymbolName)
{
ReelSymbols[idx].NumHits ++;
}
}
}
}
function string GetSymbolAtPosition(float Position, optional out int Index)
{
local int i;
for(i = 0 ; i < arrayCount(ReelSymbols); i ++ )
{
if(Position == ReelSymbols[i].ReelPosition)
{
Index = i;
return ReelSymbols[i].SymbolName;
}
}
return "COULD NOT FIND A REEL SYMBOL AT POSITION :"$Position;
}
function SpinReels()
{
local int i;
if(Level.NetMode == NM_Client)
{
return;
}
LastSpinTime = Level.TimeSeconds;
for(i = 0 ; i < ArrayCount(Reels) ; i ++)
{
Reels[i].bFixedRotationDir = true;
Reels[i].bRotateToDesired = false;
Reels[i].NetUpdateFrequency = 5;
Reels[i].NetUpdateTime = Level.TimeSeconds - 1;
NumSpinning ++ ;
}
}
/* Is this Machine open for business ? */
function SetActive(bool On)
{
local int i;
for(i = 0 ; i < NUMREELS ; i ++)
{
if(Reels[i] != none)
{
Reels[i].bHidden = !On;
Reels[i].NetUpdateTime = Level.TimeSeconds - 1;
}
}
// bHidden = !On;
bActive = On;
if(bActive)
{
AmbientSound = Snd_AmbientActive[Rand(NUMAMBIENTSNDS)] ;
SoundVolume = default.SoundVolume;
SoundRadius = default.SoundRadius;
}
else
{
AmbientSound = none;
}
}
function Tick(Float DeltaTime)
{
local int i;
if(RemainingBonusSpins > 0)
{
AttemptSpin(CurrentPlayer);
}
if(!ReelsAreSpinning())
{
return;
}
if(Level.TimeSeconds - LastSpinTime >= SpinDuration)
{
for(i = 0 ; i < ArrayCount(Reels) ; i ++)
{
if(Reels[i].bFixedRotationDir &&
Level.TimeSeconds - LastReelStopTime >= 1.f)
{
LastReelStopTime = Level.TimeSeconds;
Reels[i].bFixedRotationDir = false;
Reels[i].bRotateToDesired = true;
Reels[i].DesiredRotation.Roll = DesiredRolls[i];
Reels[i].NetUpdateFrequency = Reels[i].default.NetUpdateFrequency ;
NumSpinning -- ;
if(Snd_ReelStopped != none)
{
PlaySound(Snd_ReelStopped,,ReelStoppedVolume,false,ReelStoppedRadius,SoundPitch / 64.0);
}
}
}
}
if(NumSpinning == 0)
{
PayOut();
}
}
/* Spits out a reward based on the symbols on the reels */
function PayOut()
{
local int i,idx;
local bool bWon;
local array<String> WinningSymbols;
local bool bAlreadyWonOnThisSymbol;
AmbientSound = Snd_AmbientActive[Rand(NUMAMBIENTSNDS)];
SoundVolume = default.SoundVolume;
SoundRadius = default.SoundRadius;
for(i=0; i < ArrayCount(ReelSymbols) ; i ++)
{
bAlreadyWonOnThisSymbol = false;
for(idx = 0 ; idx < WinningSymbols.length ; idx ++)
{
if(ReelSymbols[i].SymbolName == WinningSymbols[idx])
{
bAlreadyWonOnThisSymbol = true;
break;
}
}
if(!bAlreadyWonOnThisSymbol && ReelSymbols[i].NumHits >= ReelSymbols[i].NumReqHits)
{
WinningSymbols[WinningSymbols.length] = ReelSymbols[i].SymbolName;
if(!bWon && ReelSymbols[i].SymbolName == "Fuel")
{
bWon = true;
}
switch(ReelSymbols[i].SymbolName)
{
Case "Fuel" : SpawnFuel() ; break;
Case "Ammo" : SpawnAmmo(ReelSymbols[i].NumHits - 1); break;
Case "Monster" : SpawnEnemy(ReelSymbols[i].NumHits); break;
}
}
}
if(!bWon) // didnt win anything, or won something bad.
{
if(YouLostEvent != '')
{
TriggerEvent(YouLostEvent,self,CurrentPlayer);
}
// give the player a helping hand if he fails enough times.
JackPotChance = FMin(JackPotChance + JackPotChanceIncreaseRate,1.f);
}
else
{
if(YouWonEvent != '')
{
TriggerEvent(YouWonEvent,self,CurrentPlayer);
}
JackPotChance = 0.f; // reset.
}
if(bFirstSpin)
{
bFirstSpin = false;
}
}
function SpawnAmmo(int NumToSpawn)
{
local KF_Slot_AmmoPickup AmmoPickup;
local int i;
if(Snd_CashPrize != none)
{
PlaySound(Snd_CashPrize,SLOT_None,CashPrizeVolume,false,CashPrizeRadius,SoundPitch / 64.0);
}
for(i = 0 ; i < NumToSpawn ; i ++)
{
AmmoPickup = Spawn(class 'KF_Slot_AmmoPickup',self,,GetPayoutLocation(),Rotation);
if(AmmoPickup != none)
{
AmmoPickup.Velocity = GetPayoutVelocity() + (i * GetPayoutVelocity()/2) ;
}
}
}
function SpawnFuel()
{
local Pickup_GasCan FuelPickup;
FuelPickup = Spawn(class 'Pickup_GasCan',self,,GetPayoutLocation(),Rotation);
if(FuelPickup != none)
{
FuelPickup.Velocity = GetPayoutVelocity();
}
if(Snd_Jackpot != none)
{
PlaySound(Snd_Jackpot,SLOT_None,JackpotVolume,,JackpotRadius,SoundPitch / 64.0);
}
if(bFirstSpin)
{
UnlockAchievement();
}
}
// The player got the fuel on his first spin!
function UnlockAchievement()
{
local Controller C;
local KFPlayerController KFPC;
local KFSteamStatsAndAchievements KFAchievements;
for (C = Level.ControllerList; C != None; C = C.NextController)
{
KFPC = KFPlayerController(C);
if(KFPC != none)
{
KFAchievements = KFSteamStatsAndAchievements( KFPC.SteamStatsAndAchievements );
if(KFAchievements != none)
{
KFAchievements.CheckAndSetAchievementComplete( KFAchievements.KFACHIEVEMENT_777 );
}
}
}
}
function SpawnEnemy(int NumHits)
{
local int i;
local string Type;
if(AssociatedDesigner == none)
{
log("Warning - No wave Designer associated with : "@self@" it will not be able to spawn ZEDs.");
return;
}
Switch(NumHits)
{
case 1 : Type = "Siren"; break;
case 2 : Type = "Scrake"; break;
case 3 : Type = "FleshPound"; break;
}
if(Type == "FleshPound" && Snd_MonsterPrize != none)
{
if(Snd_MonsterPrize != none)
{
PlaySound(Snd_MonsterPrize,SLOT_None,MonsterPrizeVolume,false,MonsterPrizeRadius,SoundPitch / 64.0);
}
}
for(i = 0 ; i < AssociatedDesigner.Waves.Length ; i ++)
{
if(AssociatedDesigner.Waves[i].Wave_Spawns[0].SquadList[0] ~= Type)
{
if(AssociatedDesigner.Waves[i].WaveController != none)
{
AssociatedDesigner.Waves[i].WaveController.Trigger(self,none);
}
}
}
}
/* The machine was just used by a player. Make the lever animate*/
simulated function PlayPullAnim()
{
PlayAnim(SlotPullAnim,1.f,0.1);
}
/* A variable was replicated.
Check if we need to play a new animation on the client
Network : Clients
*/
simulated event PostNetReceive()
{
if(RepAnimByte != LastRepAnimByte)
{
LastRepAnimByte = RepAnimByte;
PlayPullAnim();
}
}
/* Give the player some dosh */
function SpawnCash(int Amount)
{
local PlayerController PC;
if(Snd_CashPrize != none)
{
PlaySound(Snd_CashPrize,SLOT_None,CashPrizeVolume,false,CashPrizeRadius);
}
if(CurrentPlayer != none && CurrentPlayer.Controller != none)
{
PC = PlayerController(Currentplayer.Controller);
if(PC != none)
{
PC.ClientPlaySound(class 'CashPickup'.default.PickupSound);
PC.ReceiveLocalizedMessage(class 'Msg_CashReward',Amount);
PC.PlayerReplicationInfo.Score += Amount;
PC.PlayerReplicationInfo.NetUpdateTime = Level.TimeSeconds - 1;
}
}
}
function AddBonusSpins(int NumToAdd)
{
RemainingBonusSpins += NumToAdd;
AttemptSpin(CurrentPlayer);
}
/* Fling prizes in the direction of the player who played the machine*/
simulated function vector GetPayoutVelocity()
{
return Normal(Vector(Rotation)) * 50.f + (Vect(0,0,1) * 25.f) ;
}
function Timer()
{
SpawnCash(RemainingPayOut);
}
function vector GetPayoutLocation(optional float SpawnOffset)
{
return Location + Normal(Vector(Rotation)) * ((CollisionRadius/2) + (SpawnOffset/2)) ;
}
defaultproperties
{
bFirstSpin = true
JackPotChanceIncreaseRate = 0.02
NetUpdateFrequency = 1
RemoteRole = Role_SimulatedProxy
SlotPullAnim="Pull"
bNetNotify = true
bUseDynamicLights = true
bDirectional = true
bCollideActors = true
bUseCylinderCollision = true
CollisionHeight = 60
CollisionRadius = 35
DrawType = DT_Mesh
Mesh = SkeletalMesh'FrightYard_SKM.GasPump_Slots'
Snd_ReelStoppedRef = "SteamLand_SND.SlotMachine_ReelStop"
Snd_ReelSpinningRef = "FreakCircus_Snd_two.Test.arcade6"
Snd_MonsterPrizeRef = "Hellride_Snd.General.KF_HellRide_EvilLaugh_02"
Snd_CashPrizeRef = "SteamLand_SND.SlotMachine_Dosh"
Snd_JackpotRef = "SteamLand_SND.SlotMachine_JackPot"
Snd_LeverPullRef = "SteamLand_SND.SlotMachine_LeverPull"
Snd_AmbientActiveRef(0)="SteamLand_SND.Ambient_SlotMachine_1"
Snd_AmbientActiveRef(1)="SteamLand_SND.Ambient_SlotMachine_2"
Snd_AmbientActiveRef(2)="SteamLand_SND.Ambient_SlotMachine_3"
Snd_ReelSpinning=Sound'FreakCircus_Snd_two.Test.arcade6'
ReelSpinningVolume=255
ReelStoppedVolume=2.0
CashPrizeVolume=2.0
MonsterPrizeVolume=2.0
JackpotVolume=2.0
LeverPullVolume=2.0
ReelSpinningRadius=750
ReelStoppedRadius=500.0
CashPrizeRadius=500.0
MonsterPrizeRadius=500.0
JackpotRadius=750.0
LeverPullRadius=500.0
SoundVolume=128
SoundRadius=250
bFullVolume=true
SpinDuration = 6
Maxbet = 50
ReelSymbols(0)=(ReelPosition=0,SymbolName="Fuel",NumReqHits=3)
ReelSymbols(1)=(ReelPosition=11000,SymbolName="Ammo",NumReqHits=2)
ReelSymbols(2)=(ReelPosition=22000,SymbolName="Monster",NumReqHits=1)
ReelSymbols(3)=(ReelPosition=33000,SymbolName="Fuel",NumReqHits=3)
ReelSymbols(4)=(ReelPosition=44000,SymbolName="Ammo",NumReqHits=2)
ReelSymbols(5)=(ReelPosition=55000,SymbolName="Monster",NumReqHits=1)
}

View file

@ -0,0 +1,26 @@
/*
--------------------------------------------------------------
KF_Slot_Reel
--------------------------------------------------------------
Reel Actor used in conjunction with KF_Slot_Machines.
It spins around.
Author : Alex Quick
--------------------------------------------------------------
*/
class KF_Slot_Reel extends Actor
placeable;
defaultproperties
{
RotationRate=(Pitch=0,Yaw=0,Roll=190000)
bUnlit = true
bStatic = false
Physics = PHYS_Rotating
DrawType = DT_StaticMesh
StaticMesh = StaticMesh 'FrightYard2_SM.FY_SlotReel'
NetUpdateFrequency = 1
}

View file

@ -0,0 +1,69 @@
/*
--------------------------------------------------------------
Msg_ExplosivePickupNotification
--------------------------------------------------------------
Local Message class for the explosives that destroy halliday's yacth
Author : Alex Quick
--------------------------------------------------------------
*/
class Msg_ExplosivePickupNotification extends WaitingMessage;
var localized string ExplosivesPickedUpString;
var localized string ExplosivesDroppedString;
var localized string ExplosivesPlacedString;
static function string GetString(
optional int Switch,
optional PlayerReplicationInfo RelatedPRI_1,
optional PlayerReplicationInfo RelatedPRI_2,
optional Object OptionalObject
)
{
switch(Switch)
{
case 1 :
return RelatedPRI_1.PlayerName@default.ExplosivesPickedUpString ;
case 2 :
return RelatedPRI_1.PlayerName@default.ExplosivesDroppedString ;
case 3 :
return RelatedPRI_1.PlayerName@default.ExplosivesPlacedString;
}
}
static function GetPos(int Switch, out EDrawPivot OutDrawPivot, out EStackMode OutStackMode, out float OutPosX, out float OutPosY)
{
OutDrawPivot = default.DrawPivot;
OutStackMode = default.StackMode;
OutPosX = default.PosX;
OutPosY = 0.7;
}
static function float GetLifeTime(int Switch)
{
return default.LifeTime;
}
static function int GetFontSize(int Switch, PlayerReplicationInfo RelatedPRI1, PlayerReplicationInfo RelatedPRI2, PlayerReplicationInfo LocalPlayer)
{
return 2;
}
defaultproperties
{
Lifetime=4
DrawColor=(R=255,G=50,B=50)
ExplosivesPickedUpString = "picked up a crate of explosives"
ExplosivesDroppedString = "dropped a crate of explosives!"
ExplosivesPlacedString = "placed the explosives in the boat"
}

View file

@ -0,0 +1,69 @@
/*
--------------------------------------------------------------
Msg_RemoteControlNotification
--------------------------------------------------------------
Local Message class for Remote Control / Container Crate objective notifications.
Author : Alex Quick
--------------------------------------------------------------
*/
class Msg_GasCanNotification extends WaitingMessage;
var localized string GasWasPickedUpString;
var localized string GasWasDroppedString;
var localized string GasWasPlacedString;
static function string GetString(
optional int Switch,
optional PlayerReplicationInfo RelatedPRI_1,
optional PlayerReplicationInfo RelatedPRI_2,
optional Object OptionalObject
)
{
switch(Switch)
{
case 1 : // Someone picked up the gas.
return RelatedPRI_1.PlayerName@default.GasWasPickedUpString ;
case 2 : // Someone dropped the gas.
return RelatedPRI_1.PlayerName@default.GasWasDroppedString ;
case 3 : // Someone placed the gas in the boat.
return RelatedPRI_1.PlayerName@default.GasWasPlacedString;
}
}
static function GetPos(int Switch, out EDrawPivot OutDrawPivot, out EStackMode OutStackMode, out float OutPosX, out float OutPosY)
{
OutDrawPivot = default.DrawPivot;
OutStackMode = default.StackMode;
OutPosX = default.PosX;
OutPosY = 0.7;
}
static function float GetLifeTime(int Switch)
{
return default.LifeTime;
}
static function int GetFontSize(int Switch, PlayerReplicationInfo RelatedPRI1, PlayerReplicationInfo RelatedPRI2, PlayerReplicationInfo LocalPlayer)
{
return 2;
}
defaultproperties
{
Lifetime=4
DrawColor=(R=255,G=50,B=50)
GasWasPickedUpString = "picked up a can of gas!"
GasWasDroppedString = "dropped a can of gas!"
GasWasPlacedString = "fueled up a boat"
}

View file

@ -0,0 +1,69 @@
/*
--------------------------------------------------------------
Msg_RemoteControlNotification
--------------------------------------------------------------
Local Message class for Remote Control / Container Crate objective notifications.
Author : Alex Quick
--------------------------------------------------------------
*/
class Msg_RemoteControlNotification extends WaitingMessage;
var localized string RemoteWasPickedUpString;
var localized string RemoteWasDroppedString;
var localized string RemoteWasPlacedString;
static function string GetString(
optional int Switch,
optional PlayerReplicationInfo RelatedPRI_1,
optional PlayerReplicationInfo RelatedPRI_2,
optional Object OptionalObject
)
{
switch(Switch)
{
case 1 : // Someone picked up the remote control piece.
return RelatedPRI_1.PlayerName@default.RemoteWasPickedUpString ;
case 2 : // Someone dropped the remote control piece.
return RelatedPRI_1.PlayerName@default.RemoteWasDroppedString ;
case 3 : // Someone placed the remote control piece.
return RelatedPRI_1.PlayerName@default.RemoteWasPlacedString;
}
}
static function GetPos(int Switch, out EDrawPivot OutDrawPivot, out EStackMode OutStackMode, out float OutPosX, out float OutPosY)
{
OutDrawPivot = default.DrawPivot;
OutStackMode = default.StackMode;
OutPosX = default.PosX;
OutPosY = 0.7;
}
static function float GetLifeTime(int Switch)
{
return default.LifeTime;
}
static function int GetFontSize(int Switch, PlayerReplicationInfo RelatedPRI1, PlayerReplicationInfo RelatedPRI2, PlayerReplicationInfo LocalPlayer)
{
return 2;
}
defaultproperties
{
Lifetime=4
DrawColor=(R=255,G=50,B=50)
RemoteWasPickedUpString = "picked up a piece of the remote control!"
RemoteWasDroppedString = "dropped a piece of the remote control!"
RemoteWasPlacedString = "placed a piece of the remote control"
}

View file

@ -0,0 +1,25 @@
class Msg_RouletteCountDown extends TimerMessage;
var localized string CountDownPrefix;
static function string GetString(
optional int Switch,
optional PlayerReplicationInfo RelatedPRI_1,
optional PlayerReplicationInfo RelatedPRI_2,
optional Object OptionalObject
)
{
return default.CountDownPrefix@Switch$default.CountDownTrailer;
}
static function int GetFontSize(int Switch, PlayerReplicationInfo RelatedPRI1, PlayerReplicationInfo RelatedPRI2, PlayerReplicationInfo LocalPlayer)
{
return 5;
}
defaultproperties
{
DrawColor=(G=0)
CountDownPrefix = "Wheel will spin in :"
PosY=0.6
}

View file

@ -0,0 +1,67 @@
/*
--------------------------------------------------------------
Msg_RouletteGeneric
--------------------------------------------------------------
Generic Messages related to roulette.
Author : Alex Quick
--------------------------------------------------------------
*/
class Msg_RouletteGeneric extends WaitingMessage;
var localized string LetItRideString;
var localized string BettingClosedString;
var localized string NeedMinBetString;
static function string GetString(
optional int Switch,
optional PlayerReplicationInfo RelatedPRI_1,
optional PlayerReplicationInfo RelatedPRI_2,
optional Object OptionalObject
)
{
switch(Switch)
{
case 1 : return default.LetItRideString;
case 2 : return default.BettingClosedString;
case 3 : return default.NeedMinBetString@class'KF_Roulette_Wheel'.default.MinBet;
}
}
static function ClientReceive(
PlayerController P,
optional int Switch,
optional PlayerReplicationInfo RelatedPRI_1,
optional PlayerReplicationInfo RelatedPRI_2,
optional Object OptionalObject
)
{
super(CriticalEventPlus).ClientReceive(P, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject);
}
static function float GetLifeTime(int Switch)
{
return 5;
}
static function GetPos(int Switch, out EDrawPivot OutDrawPivot, out EStackMode OutStackMode, out float OutPosX, out float OutPosY)
{
OutDrawPivot = default.DrawPivot;
OutStackMode = default.StackMode;
OutPosX = default.PosX;
OutPosY = 0.7;
}
static function int GetFontSize(int Switch, PlayerReplicationInfo RelatedPRI1, PlayerReplicationInfo RelatedPRI2, PlayerReplicationInfo LocalPlayer)
{
return 5;
}
defaultproperties
{
LetItRideString = "You let it ride!"
BettingClosedString = "No More bets!"
NeedMinBetString ="Minimum bet for this table is :"
}

View file

@ -0,0 +1,54 @@
/*
--------------------------------------------------------------
Msg_RouletteSpin
--------------------------------------------------------------
local message that lets players know which number the last spin landed on
Author : Alex Quick
--------------------------------------------------------------
*/
class Msg_RouletteSpin extends WaitingMessage;
var localized string LetItRideString;
static function string GetString(
optional int Switch,
optional PlayerReplicationInfo RelatedPRI_1,
optional PlayerReplicationInfo RelatedPRI_2,
optional Object OptionalObject
)
{
return "The Ball landed on :"@Switch@class'KF_Roulette_Wheel'.static.GetPocketClr(Switch)@"!" ;
}
static function ClientReceive(
PlayerController P,
optional int Switch,
optional PlayerReplicationInfo RelatedPRI_1,
optional PlayerReplicationInfo RelatedPRI_2,
optional Object OptionalObject
)
{
super(CriticalEventPlus).ClientReceive(P, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject);
}
static function float GetLifeTime(int Switch)
{
return 5;
}
static function GetPos(int Switch, out EDrawPivot OutDrawPivot, out EStackMode OutStackMode, out float OutPosX, out float OutPosY)
{
OutDrawPivot = default.DrawPivot;
OutStackMode = default.StackMode;
OutPosX = default.PosX;
OutPosY = 0.7;
}
static function int GetFontSize(int Switch, PlayerReplicationInfo RelatedPRI1, PlayerReplicationInfo RelatedPRI2, PlayerReplicationInfo LocalPlayer)
{
return 4;
}

View file

@ -0,0 +1,54 @@
/*
--------------------------------------------------------------
Msg_RouletteWinnings
--------------------------------------------------------------
Local Message class for Roulette table in KF Summer Sideshow map.
Lets the players know whether they won / lost and how much.
Author : Alex Quick
--------------------------------------------------------------
*/
class Msg_RouletteWinnings extends WaitingMessage;
static function string GetString(
optional int Switch,
optional PlayerReplicationInfo RelatedPRI_1,
optional PlayerReplicationInfo RelatedPRI_2,
optional Object OptionalObject
)
{
return "Total Winnings = "@Switch@"!";
}
static function ClientReceive(
PlayerController P,
optional int Switch,
optional PlayerReplicationInfo RelatedPRI_1,
optional PlayerReplicationInfo RelatedPRI_2,
optional Object OptionalObject
)
{
super(CriticalEventPlus).ClientReceive(P, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject);
}
static function float GetLifeTime(int Switch)
{
return 5;
}
static function GetPos(int Switch, out EDrawPivot OutDrawPivot, out EStackMode OutStackMode, out float OutPosX, out float OutPosY)
{
OutDrawPivot = default.DrawPivot;
OutStackMode = default.StackMode;
OutPosX = default.PosX;
OutPosY = 0.8;
}
static function int GetFontSize(int Switch, PlayerReplicationInfo RelatedPRI1, PlayerReplicationInfo RelatedPRI2, PlayerReplicationInfo LocalPlayer)
{
return 5;
}

View file

@ -0,0 +1,24 @@
class Pickup_Explosives extends KF_StoryInventoryPickup;
defaultproperties
{
bRenderIconThroughWalls = true
bRender1PMesh = false
CollisionRadius = 40
CollisionHeight = 10
bOrientOnSlope=false
AIThreatModifier = 1.5
MaxHeldCopies = 1
MessageClass = class 'Msg_ExplosivePickupNotification'
UV2Texture = FadeColor'PatchTex.Common.PickupOverlay'
InventoryType = class 'Inv_Explosives'
CarriedMaterial = Texture 'FrightYard_T.TNT_Icon_64'
GroundMaterial = Colormodifier 'FrightYard_T.RemotePickupGroundIco_cm'
StaticMesh = StaticMesh'FrightYard_SM.Dynamite.SM_Dynamite_Open'
}

View file

@ -0,0 +1,24 @@
class Pickup_GasCan extends KF_StoryInventoryPickup;
defaultproperties
{
bRenderIconThroughWalls = true
bRender1PMesh = false
CollisionRadius = 40
CollisionHeight = 10
bOrientOnSlope=false
AIThreatModifier = 1.5
MaxHeldCopies = 2
MessageClass = class 'Msg_GasCanNotification'
UV2Texture = FadeColor'PatchTex.Common.PickupOverlay'
InventoryType = class 'Inv_GasCan'
StaticMesh = StaticMesh 'FrightYard_SM.GasolineCan.SM_GasolineCan'
CarriedMaterial = Texture 'FrightYard_T.Gas_Icon_64'
GroundMaterial = Colormodifier 'FrightYard_T.RemotePickupGroundIco_cm'
}

View file

@ -0,0 +1,12 @@
class Pickup_TransmitterCord extends Pickup_TransmitterPart;
#exec OBJ LOAD FILE=FrightYard2_T.utx
defaultproperties
{
InventoryType = class 'Inv_TransmitterCord'
StaticMesh = StaticMesh 'FrightYard2_SM.FY_Transmitter_Cord'
CarriedMaterial = Texture 'FrightYard_T.Coil_Icon_64'
GroundMaterial = Colormodifier 'FrightYard_T.RemotePickupGroundIco_cm'
}

View file

@ -0,0 +1,12 @@
class Pickup_TransmitterSwitch extends Pickup_TransmitterPart;
#exec OBJ LOAD FILE=FrightYard2_T.utx
defaultproperties
{
InventoryType = class 'Inv_TransmitterSwitch'
StaticMesh = StaticMesh 'FrightYard2_SM.FY_Transmitter_Collapsed'
CarriedMaterial = Texture 'FrightYard_T.Transmitter_Icon_64'
GroundMaterial = Colormodifier 'FrightYard_T.RemotePickupGroundIco_cm'
}

View file

@ -0,0 +1,18 @@
class Pickup_Transmitterpart extends KF_StoryInventoryPickup;
defaultproperties
{
bRenderIconThroughWalls = false
bRender1PMesh = false
CollisionRadius = 40
CollisionHeight = 10
bOrientOnSlope=false
AIThreatModifier = 1.5
MaxHeldCopies = 2
MessageClass = class 'Msg_RemoteControlNotification'
UV2Texture = FadeColor'PatchTex.Common.PickupOverlay'
}

View file

@ -0,0 +1,40 @@
<html>
<head><title>Index of /kf_sources/FrightScript/Classes/</title></head>
<body>
<h1>Index of /kf_sources/FrightScript/Classes/</h1><hr><pre><a href="../">../</a>
<a href="ACTION_KillZEDs.uc">ACTION_KillZEDs.uc</a> 06-Oct-2019 10:27 317
<a href="BloatKillVolume.uc">BloatKillVolume.uc</a> 06-Oct-2019 10:27 782
<a href="ContainerCrane.uc">ContainerCrane.uc</a> 06-Oct-2019 10:27 5377
<a href="CreepyCamera.uc">CreepyCamera.uc</a> 06-Oct-2019 10:27 5068
<a href="DeckGun.uc">DeckGun.uc</a> 06-Oct-2019 10:27 8002
<a href="DeckGunProjectile.uc">DeckGunProjectile.uc</a> 06-Oct-2019 10:27 2590
<a href="DeckGunProjectile_Explosion.uc">DeckGunProjectile_Explosion.uc</a> 06-Oct-2019 10:27 7966
<a href="DeckGunProjectile_Trail.uc">DeckGunProjectile_Trail.uc</a> 06-Oct-2019 10:27 1729
<a href="HallidaysYacht.uc">HallidaysYacht.uc</a> 06-Oct-2019 10:27 2957
<a href="Inv_Explosives.uc">Inv_Explosives.uc</a> 06-Oct-2019 10:27 216
<a href="Inv_GasCan.uc">Inv_GasCan.uc</a> 06-Oct-2019 10:27 201
<a href="Inv_TransmitterCord.uc">Inv_TransmitterCord.uc</a> 06-Oct-2019 10:27 260
<a href="Inv_TransmitterPart.uc">Inv_TransmitterPart.uc</a> 06-Oct-2019 10:27 198
<a href="Inv_TransmitterSwitch.uc">Inv_TransmitterSwitch.uc</a> 06-Oct-2019 10:27 264
<a href="KF_Roulette_Ball.uc">KF_Roulette_Ball.uc</a> 06-Oct-2019 10:27 1000
<a href="KF_Roulette_Bet_Zone.uc">KF_Roulette_Bet_Zone.uc</a> 06-Oct-2019 10:27 7650
<a href="KF_Roulette_Screen.uc">KF_Roulette_Screen.uc</a> 06-Oct-2019 10:27 2889
<a href="KF_Roulette_Wheel.uc">KF_Roulette_Wheel.uc</a> 06-Oct-2019 10:27 21508
<a href="KF_Slot_AmmoPickup.uc">KF_Slot_AmmoPickup.uc</a> 06-Oct-2019 10:27 2957
<a href="KF_Slot_CashPickup.uc">KF_Slot_CashPickup.uc</a> 06-Oct-2019 10:27 1554
<a href="KF_Slot_Machine.uc">KF_Slot_Machine.uc</a> 06-Oct-2019 10:27 18233
<a href="KF_Slot_Reel.uc">KF_Slot_Reel.uc</a> 06-Oct-2019 10:27 631
<a href="Msg_ExplosivePickupNotification.uc">Msg_ExplosivePickupNotification.uc</a> 06-Oct-2019 10:27 1844
<a href="Msg_GasCanNotification.uc">Msg_GasCanNotification.uc</a> 06-Oct-2019 10:27 1881
<a href="Msg_RemoteControlNotification.uc">Msg_RemoteControlNotification.uc</a> 06-Oct-2019 10:27 2008
<a href="Msg_RouletteCountDown.uc">Msg_RouletteCountDown.uc</a> 06-Oct-2019 10:27 651
<a href="Msg_RouletteGeneric.uc">Msg_RouletteGeneric.uc</a> 06-Oct-2019 10:27 1887
<a href="Msg_RouletteSpin.uc">Msg_RouletteSpin.uc</a> 06-Oct-2019 10:27 1530
<a href="Msg_RouletteWinnings.uc">Msg_RouletteWinnings.uc</a> 06-Oct-2019 10:27 1499
<a href="Pickup_Explosives.uc">Pickup_Explosives.uc</a> 06-Oct-2019 10:27 659
<a href="Pickup_GasCan.uc">Pickup_GasCan.uc</a> 06-Oct-2019 10:27 644
<a href="Pickup_TransmitterCord.uc">Pickup_TransmitterCord.uc</a> 06-Oct-2019 10:27 385
<a href="Pickup_TransmitterSwitch.uc">Pickup_TransmitterSwitch.uc</a> 06-Oct-2019 10:27 401
<a href="Pickup_Transmitterpart.uc">Pickup_Transmitterpart.uc</a> 06-Oct-2019 10:27 408
</pre><hr></body>
</html>