Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

JBAddonCelebration.JBTauntingMeshActor


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
//=============================================================================
// JBTauntingMeshActor
// Copyright 2003 by Wormbo <wormbo@onlinehome.de>
// $Id: JBTauntingMeshActor.uc,v 1.5 2004/06/02 09:48:25 wormbo Exp $
//
// Plays taunting animations for the celebration screen.
//=============================================================================


class JBTauntingMeshActor extends Actor
    notplaceable;


//=============================================================================
// Import
//=============================================================================

#exec obj load file=..\Animations\Jugg.ukx


//=============================================================================
// Variables
//=============================================================================

var float TauntDelay;                   // seconds before playing the taunt anim
var array<name> TauntAnims;             // taunt animations for bots
var array<name> IdleAnims;              // idle animations while not taunting
var array<name> DeathAnims;             // death animations when owner died
var bool bStartedTaunting;
var bool bRagdollStarted;
var vector LastLocation, LastLocationOffset;


//=============================================================================
// Tick
//
// Check whether owner died.
//=============================================================================

function Tick(float DeltaTime)
{
  if ( Pawn(Owner) != None ) {
    if ( Mesh != Owner.Mesh )
      LinkMesh(Owner.Mesh);
    Skins = Owner.Skins;
    OverlayMaterial = Owner.OverlayMaterial;
    OverlayTimer = Owner.OverlayTimer;
    ClientOverlayTimer = Owner.ClientOverlayTimer;
    ClientOverlayCounter = Owner.ClientOverlayCounter;
    if ( xPawn(Owner) == None || !xPawn(Owner).bDeRes )
      AmbientGlow = Max(Owner.AmbientGlow, 100);
    else
      AmbientGlow = Owner.AmbientGlow;
    if ( Owner.Physics == PHYS_KarmaRagdoll ) {
      if ( !bRagdollStarted ) {
        LastLocation = Owner.Location;
        bRagdollStarted = True;
        PrePivot = vect(0,0,1) * Owner.default.CollisionHeight;
      }
      LastLocationOffset = Owner.Location - LastLocation;
      LastLocation = Owner.Location;
    }
    SetRotation(Owner.Rotation);
  }
  else if ( bAnimByOwner && Pawn(Owner) == None && !IsInState('Taunting') ) {
    SetDrawScale(0.0);
    bAnimByOwner = False;
  }
}


//=============================================================================
// PlayNamedTauntAnim
//
// Stub function for Taunting state.
//=============================================================================

function PlayNamedTauntAnim(name AnimName);


//=============================================================================
// GetRandomTauntAnim
//
// Returns a random taunt animation name.
//=============================================================================

function name GetRandomTauntAnim()
{
  local int i;
  
  while (TauntAnims.Length > 0) {
    i = Rand(TauntAnims.Length);
    if ( HasAnim(TauntAnims[i]) )
      return TauntAnims[i];
    else
      TauntAnims.Remove(i, 1);
  }
  
  return '';
}


//=============================================================================
// state Taunting
//
// Automatically play some taunt animations.
//=============================================================================

state Taunting
{
  //===========================================================================
  // PlayTauntAnim
  //
  // Play the next taunt animation.
  //===========================================================================
  
  function PlayTauntAnim()
  {
    local name TauntName;
    
    TauntName = GetRandomTauntAnim();
    if ( HasAnim(TauntName) )
      PlayAnim(TauntName,, 0.2);
  }
  
  
  //===========================================================================
  // PlayNamedTauntAnim
  //
  // Tries to play the specified taunt animation.
  //===========================================================================
  
  function PlayNamedTauntAnim(name AnimName)
  {
    if ( HasAnim(AnimName) ) {
      PlayAnim(AnimName,, 0.2);
      //AnimBlendParams(1, 1.0, 0.2, 0.3);
      //AnimBlendToAlpha(1, 1.0, 0.3);
      GotoState('');
      GotoState('Taunting', 'FinishTaunt');
    }
  }
  
BeginTaunting:
  LoopAnim(IdleAnims[Rand(IdleAnims.Length)]);
Taunt:
  Sleep(TauntDelay);
  PlayTauntAnim();
  FinishAnim();
  LoopAnim(IdleAnims[Rand(IdleAnims.Length)],, 0.3);
  Sleep(1.5 * FRand() + 1);
  Goto('Taunt');

ManualTaunting:
  LoopAnim(IdleAnims[Rand(IdleAnims.Length)]);
  //AnimBlendParams(1, 1.0, 0.2, 0.2);
  Stop;

FinishTaunt:
  FinishAnim();
  LoopAnim(IdleAnims[Rand(IdleAnims.Length)],, 0.3);
}


//=============================================================================
// Default properties
//=============================================================================

defaultproperties
{
  TauntAnims(0)=PThrust
  TauntAnims(1)=AssSmack
  TauntAnims(2)=ThroatCut
  TauntAnims(3)=Specific_1
  TauntAnims(4)=gesture_cheer
  TauntAnims(5)=Gesture_Taunt01
  TauntAnims(6)=Gesture_Taunt02
  TauntAnims(7)=Gesture_Taunt03
  TauntAnims(8)=gesture_beckon
  TauntAnims(9)=Idle_Character01
  TauntAnims(10)=Idle_Character02
  TauntAnims(11)=Idle_Character03
  IdleAnims(0)=Idle_Rest
  IdleAnims(1)=Idle_Biggun
  DeathAnims(0)=DeathB
  DeathAnims(1)=DeathF
  DeathAnims(2)=DeathL
  DeathAnims(3)=DeathR
  TauntDelay=1.5
  
  RemoteRole=ROLE_None
  bUnlit=True
  bHidden=True
  bAcceptsProjectors=false
  AmbientGlow=128
  DrawType=DT_Mesh
  Style=STY_Alpha
  DrawScale=1.0
  DrawScale3D=(X=1.0,Y=1.0,Z=1.0)
  bAlwaysTick=true
  LODBias=100000
  Mesh=JuggMaleA
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mi 2.6.2004 11:48:26.000 - Creation time: Do 14.8.2014 09:58:43.195 - Created with UnCodeX