Advertisement
Guest User

GreatEmerald

a guest
Apr 26th, 2008
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 9.62 KB | None | 0 0
  1. //=============================================================================
  2. // $Workfile: WeaponInvMindclaw.uc $
  3. // Created By: Mark Poesch
  4. // Created On: 9/28/00
  5. // $Author: Sbrown $
  6. // $Date: 5/10/01 10:43p $
  7. // $Revision: 6 $
  8. //=============================================================================
  9. class WeaponInvMindClaw extends U2Weapon;
  10.  
  11.  
  12. #exec TEXTURE IMPORT FILE=Assets\MindClaw\MC_Icon.pcx       GROUP=Icons MIPS=OFF //RSW
  13. #exec TEXTURE IMPORT FILE=Assets\MindClaw\MC_Ammo.pcx       GROUP=Skins LODSET=2 //RSW
  14. #exec TEXTURE IMPORT FILE=Assets\MindClaw\MC_Skin.pcx       GROUP=Skins LODSET=2 //RSW
  15. #exec TEXTURE IMPORT FILE=Assets\MindClaw\MC_Projectile.pcx GROUP=Skins LODSET=2 //RSW
  16.  
  17. #exec MESH IMPORT MESH=MC_Ammo ANIVFILE=Assets\MindClaw\MC_Ammo_a.3d DATAFILE=Assets\MindClaw\MC_Ammo_d.3d X=0 Y=0 Z=0 //RSW
  18. #exec MESH ORIGIN MESH=MC_Ammo X=0 Y=0 Z=0
  19. #exec MESHMAP SCALE MESHMAP=MC_Ammo X=0.1 Y=0.1 Z=0.2
  20. #exec MESHMAP SETTEXTURE MESHMAP=MC_Ammo NUM=1 TEXTURE=MC_Ammo
  21.  
  22. #exec MESH IMPORT MESH=MC_FP ANIVFILE=Assets\MindClaw\MC_FP_a.3d DATAFILE=Assets\MindClaw\MC_FP_d.3d X=0 Y=0 Z=0 //RSW
  23. #exec MESH ORIGIN MESH=MC_FP X=04 Y=-140 Z=-15 YAW=-64
  24. #exec MESH SEQUENCE MESH=MC_FP SEQ=All      STARTFRAME=0 NUMFRAMES=8
  25. #exec MESH SEQUENCE MESH=MC_FP SEQ=Ambient  STARTFRAME=0 NUMFRAMES=1 //RSW
  26. #exec MESH SEQUENCE MESH=MC_FP SEQ=Select   STARTFRAME=0 NUMFRAMES=8 //RSW
  27. #exec MESH SEQUENCE MESH=MC_FP SEQ=Reload   STARTFRAME=0 NUMFRAMES=8 //RSW
  28. #exec MESH SEQUENCE MESH=MC_FP SEQ=Idle     STARTFRAME=0 NUMFRAMES=1 //RSW
  29. #exec MESH SEQUENCE MESH=MC_FP SEQ=Fire     STARTFRAME=0 NUMFRAMES=8 //RSW
  30. #exec MESH SEQUENCE MESH=MC_FP SEQ=AltFire  STARTFRAME=0 NUMFRAMES=8 //RSW
  31. #exec MESH SEQUENCE MESH=MC_FP SEQ=Down     STARTFRAME=0 NUMFRAMES=1 //RSW
  32. #exec MESHMAP SCALE MESHMAP=MC_FP X=0.1 Y=0.1 Z=0.2
  33. #exec MESHMAP SETTEXTURE MESHMAP=MC_FP NUM=0 TEXTURE=MC_Skin
  34.  
  35. #exec MESH IMPORT MESH=MC_TP ANIVFILE=Assets\MindClaw\MC_TP_a.3d DATAFILE=Assets\MindClaw\MC_TP_d.3d X=0 Y=0 Z=0 //RSW
  36. #exec MESH ORIGIN MESH=MC_TP X=04 Y=-140 Z=-15 YAW=-64
  37. #exec MESHMAP SCALE MESHMAP=MC_TP X=0.1 Y=0.1 Z=0.2
  38. #exec MESHMAP SETTEXTURE MESHMAP=MC_TP NUM=0 TEXTURE=MC_Skin
  39.  
  40. #exec MESH IMPORT MESH=MC_Projectile ANIVFILE=Assets\MindClaw\MC_Projectile_a.3d DATAFILE=Assets\MindClaw\MC_Projectile_d.3d X=0 Y=0 Z=0 //RSW
  41. #exec MESH ORIGIN MESH=MC_Projectile X=0 Y=0 Z=0
  42. #exec MESHMAP SCALE MESHMAP=MC_Projectile X=0.1 Y=0.1 Z=0.2
  43. #exec MESHMAP SETTEXTURE MESHMAP=MC_Projectile NUM=1 TEXTURE=MC_Projectile
  44.  
  45. #exec AUDIO IMPORT FILE=Assets\MindClaw\MC_Pickup.wav       GROUP=MindClaw //SBB
  46. #exec AUDIO IMPORT FILE=Assets\MindClaw\MC_PickupAmmo.wav   GROUP=MindClaw //SBB
  47. #exec AUDIO IMPORT FILE=Assets\MindClaw\MC_Select.wav       GROUP=MindClaw //SBB
  48. #exec AUDIO IMPORT FILE=Assets\MindClaw\MC_Reload.wav       GROUP=MindClaw //SBB
  49. #exec AUDIO IMPORT FILE=Assets\MindClaw\MC_Fire.wav         GROUP=MindClaw //SBB -- start+loop (ambient)
  50. #exec AUDIO IMPORT FILE=Assets\MindClaw\MC_FireAttack.wav   GROUP=MindClaw //SBB
  51. #exec AUDIO IMPORT FILE=Assets\MindClaw\MC_FireAbort.wav    GROUP=MindClaw //SBB
  52. #exec AUDIO IMPORT FILE=Assets\MindClaw\MC_AltFire.wav      GROUP=MindClaw //SBB
  53.  
  54.  
  55. var() float AttackViewAngle;        // 1.0 = directly in front, 0.707 = 90 degree cone, 0.5 = 120 degree cone, 0.0 = 180 degrees
  56. var() float MaxSightRadius;         //
  57. var() float MinAttackTime;          //
  58. var() float DamagePerSecond;        //
  59. var() float AbsorbDamageRatio;      //
  60. var() class<PulseLineGenerator> AttackEffectClass;
  61.  
  62. var byte bAttacking[16];            //
  63. var Actor Attacking[16];            //
  64. var float AttackTime[16];           //
  65. var PulseLineGenerator AttackEffect[16];
  66.  
  67.  
  68. simulated function ClearWeaponEffects()
  69. {
  70.     local int i;
  71.  
  72.     Pawn(Owner).PlaySound( None, SLOT_Misc );
  73.  
  74.     for( i = 0; i < ArrayCount(AttackEffect); i++ )
  75.     {
  76.         if( AttackEffect[i] != None )
  77.         {
  78.             AttackEffect[i].Destroy();
  79.             AttackEffect[i] = None;
  80.         }
  81.     }
  82.  
  83.     Super.ClearWeaponEffects();
  84. }
  85.  
  86.  
  87. state NormalFire
  88. {
  89.     function BeginState()
  90.     {
  91.         Pawn(Owner).PlaySound( sound'MC_Fire', SLOT_Misc, Pawn(Owner).SoundDampening );
  92.     }
  93.  
  94.     function EndState()
  95.     {
  96.         Pawn(Owner).PlaySound( None, SLOT_Misc );
  97.     }
  98.  
  99.     function bool InvalidTarget( Actor A )
  100.     {
  101.         local float InView;
  102.  
  103.         // not visible to us?
  104.         if( A == Owner || A.bHidden || !FastTrace( A.Location, Owner.Location ) )
  105.             return false;
  106.  
  107.         // outside our field of view?
  108.         InView = Normal( A.Location - Owner.Location ) dot vector( Pawn(Owner).GetViewRotation() );
  109.         if( InView < AttackViewAngle )
  110.             return false;
  111.  
  112.         // is it already dead?  is it a sentient (human) target?
  113.         if( Pawn(A) != None && ( Pawn(A).Health <= 0 || !Pawn(A).IsPlayer() ) ) //MDF is this sufficient?
  114.             return false;
  115.  
  116.         return true;
  117.     }
  118.  
  119.     function UpdateAttackList( float DeltaTime )
  120.     {
  121.         local Pawn P;
  122.         local int i;
  123.  
  124.         for( i = 0; i < ArrayCount(bAttacking); i++ )
  125.         {
  126.             bAttacking[i] = 0;
  127.         }
  128.  
  129.         foreach RadiusActors( class'Pawn', P, MaxSightRadius )
  130.         {
  131.             if( InvalidTarget( P ) )
  132.             {
  133.                 // if target is in Attacking list, continue tracking them by setting bAttacking
  134.                 for( i = 0; i < ArrayCount(Attacking); i++ )
  135.                 {
  136.                     if( P == Attacking[i] )
  137.                     {
  138.                         bAttacking[i] = 1;
  139.                         break;
  140.                     }
  141.                 }
  142.  
  143.                 // if not in the Attacking list, then add them
  144.                 if( i >= ArrayCount(Attacking) )
  145.                 {
  146.                     for( i = 0; i < ArrayCount(Attacking); i++ )
  147.                     {
  148.                         if( Attacking[i] == None )
  149.                         {
  150.                             bAttacking[i] = 1;
  151.                             Attacking[i] = P;
  152.                             break;
  153.                         }
  154.                     }
  155.                 }
  156.             }
  157.         }
  158.  
  159.         // accumulate time for current targets, and clear time for dropped targets, and
  160.         // update AttackingEffect (destroy or create as appropriate)
  161.         for( i = 0; i < ArrayCount(bAttacking); i++ )
  162.         {
  163.             if( bAttacking[i] == 0 )
  164.             {
  165.                 Attacking[i] = None;
  166.                 AttackTime[i] = 0.0;
  167.  
  168.                 if( AttackEffect[i] != None )
  169.                 {
  170.                     AttackEffect[i].Destroy();
  171.                     AttackEffect[i] = None;
  172.                 }
  173.             }
  174.             else
  175.             {
  176.                 AttackTime[i] += DeltaTime;
  177.  
  178.                 if( AttackEffect[i] == None )
  179.                 {
  180.                     AttackEffect[i] = Spawn( AttackEffectClass );
  181.                     AttackEffect[i].StartActor = Owner;
  182.                     AttackEffect[i].EndActor = Attacking[i];
  183.                 }
  184.                 AttackEffect[i].BeamWidth.A = AttackTime[i] * 1;
  185.                 AttackEffect[i].BeamWidth.B = AttackTime[i] * 4;
  186.             }
  187.         }
  188.     }
  189.  
  190.     function bool Attack()
  191.     {
  192.         local int i;
  193.         local float Damage;
  194.         local bool bAttacked;
  195.  
  196.         for( i = 0; i < ArrayCount(Attacking); i++ )
  197.         {
  198.             if( Attacking[i] != None && AttackTime[i] > MinAttackTime )
  199.             {
  200.                 bAttacked = true;
  201.  
  202.                 // inflict damage
  203.                 Damage = DamagePerSecond * AttackTime[i];
  204.                 Attacking[i].TakeDamage( Damage, Instigator, Attacking[i].Location, Attacking[i].Location - Pawn(Owner).Location, MyDamageType );
  205.  
  206.                 // absorb some of the damage inflicted, capped at 199
  207.                 Pawn(Owner).Health += Damage * AbsorbDamageRatio;
  208.                 Pawn(Owner).Health = Min( Pawn(Owner).Health, 199 );
  209.             }
  210.  
  211.             bAttacking[i] = 0;
  212.             Attacking[i] = None;
  213.             AttackTime[i] = 0.0;
  214.             if( AttackEffect[i] != None )
  215.             {
  216.                 AttackEffect[i].Destroy();
  217.                 AttackEffect[i] = None;
  218.             }
  219.         }
  220.  
  221.         return bAttacked;
  222.     }
  223.  
  224.     function Tick( float DeltaTime )
  225.     {
  226.         UpdateAttackList( DeltaTime );
  227.  
  228.         if( Pawn(Owner).Controller.bFire == 0 )
  229.         {
  230.             if( Attack() )
  231.             {
  232.                 Pawn(Owner).PlaySound( sound'MC_FireAttack', SLOT_None, Pawn(Owner).SoundDampening );
  233.             }
  234.             else
  235.             {
  236.                 Pawn(Owner).PlaySound( sound'MC_FireAbort', SLOT_None, Pawn(Owner).SoundDampening );
  237.             }
  238.             Finish();
  239.         }
  240.     }
  241.  
  242.     function AnimEnd()
  243.     {
  244.         // don't call Finish() when anim finishes
  245.     }
  246. }
  247.  
  248.  
  249. state ClientFiring
  250. {
  251.     simulated function Tick( float DeltaTime )
  252.     {
  253.         if( Pawn(Owner).Controller.bFire == 0 )
  254.         {
  255.             Finish();
  256.         }
  257.     }
  258.  
  259.     simulated function AnimEnd()
  260.     {
  261.         // don't call Finish() when anim finishes
  262.     }
  263. }
  264.  
  265.  
  266. function AltFire( float Value )
  267. {
  268.     //ARL activate Anti-Magic Aura effect around player
  269. }
  270.  
  271. defaultproperties
  272. {
  273.     AttackViewAngle=0.500000
  274.     MaxSightRadius=1024.000000
  275.     MinAttackTime=1.000000
  276.     DamagePerSecond=100.000000
  277.     AbsorbDamageRatio=0.200000
  278.     AttackEffectClass=Class'ParticleSystems.PulseLineGenerator'
  279.     AnimationType=AT_Large
  280.     MomentumTransfer=40000.000000
  281.     FireAnimRate=0.400000
  282.     AltFireAnimRate=0.400000
  283.     AltShakeMag=0.000000
  284.     AltShakeTime=0.000000
  285.     AltShakeVert=(Z=0.000000)
  286.     WeaponKickDirection=(X=0.000000)
  287.     WeaponKickDuration=0.000000
  288.     WeaponKickRecoveryDuration=0.000000
  289.     AltWeaponKickDirection=(X=0.000000)
  290.     AltWeaponKickDuration=0.000000
  291.     AltWeaponKickRecoveryDuration=0.000000
  292.     AmmoName=Class'U2Weapons.AmmoInvPsyCrystal'
  293.     PickupAmmoCount=50
  294.     AutoSwitchPriority=6
  295.     MyDamageType=Class'U2.DamageTypePsionic'
  296.     ShakeMag=0.000000
  297.     shaketime=0.000000
  298.     ShakeVert=(Z=0.000000)
  299.     AIRating=0.700000
  300.     RefireRate=0.400000
  301.     AltRefireRate=0.400000
  302.     AltFireSound=Sound'U2Weapons.MindClaw.MC_AltFire'
  303.     CockingSound=Sound'U2Weapons.MindClaw.MC_Reload'
  304.     SelectSound=Sound'U2Weapons.MindClaw.MC_Select'
  305.     InventoryGroup=3
  306.     PickupClass=Class'U2Weapons.weaponMindclaw'
  307.     PlayerViewOffset=(X=40.599998,Y=14.600000,Z=-16.600000)
  308.     FirstPersonMesh=VertMesh'U2Weapons.MC_FP'
  309.     StatusIcon=Texture'U2Weapons.Icons.MC_Icon'
  310.     ItemName="Mindclaw"
  311.     Mesh=VertMesh'U2Weapons.MC_TP'
  312. }
  313.  
  314. @@//PICKUP ITEM STARTS HERE - GreatEmerald
  315.  
  316. //=============================================================================
  317. // $Workfile: weaponMindclaw.uc $
  318. // Created By: Mark Poesch
  319. // Created On: 9/28/00
  320. // $Author: Mpoesch $
  321. // $Date: 4/20/01 12:05p $
  322. // $Revision: 4 $
  323. //=============================================================================
  324. class weaponMindClaw extends U2WeaponPickup;
  325.  
  326. defaultproperties
  327. {
  328.     InventoryType=Class'U2Weapons.weaponInvMindClaw'
  329.     PickupMessage="You got the Mindclaw."
  330.     PickupSound=Sound'U2Weapons.MindClaw.MC_Pickup'
  331.     Mesh=VertMesh'U2Weapons.MC_TP'
  332. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement