Advertisement
Guest User

GreatEmerald

a guest
Apr 26th, 2008
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 8.79 KB | None | 0 0
  1. @@//LEECHGUN WEAPON PICKUP - GreatEmerald
  2.  
  3. //=============================================================================
  4. // weaponLeechGun.uc
  5. // $Author: Mpoesch $
  6. // $Date: 4/20/01 12:05p $
  7. // $Revision: 3 $
  8. //=============================================================================
  9. class weaponLeechGun extends U2WeaponPickup;
  10.  
  11. defaultproperties
  12. {
  13.     InventoryType=Class'U2Weapons.weaponInvLeechGun'
  14.     PickupMessage="You got a Leech Gun."
  15.     PickupSound=Sound'U2Weapons.LeechGun.LG_Pickup'
  16.     Mesh=VertMesh'U2Weapons.LG_TP'
  17. }
  18.  
  19. @@//THE FULL WEAPON - GreatEmerald
  20.  
  21. //=============================================================================
  22. // WeaponInvLeechGun.uc
  23. // $Author: Sbrown $
  24. // $Date: 5/10/01 10:43p $
  25. // $Revision: 5 $
  26. //=============================================================================
  27. class WeaponInvLeechGun extends U2Weapon;
  28.  
  29.  
  30. #exec TEXTURE IMPORT FILE=Assets\LeechGun\LG_Icon.pcx   GROUP=Icons MIPS=OFF //RSW
  31. #exec TEXTURE IMPORT FILE=Assets\LeechGun\LG_Ammo.pcx   GROUP=Skins LODSET=2 //RSW
  32. #exec TEXTURE IMPORT FILE=Assets\LeechGun\LG_Skin.pcx   GROUP=Skins LODSET=2 //RSW
  33. #exec TEXTURE IMPORT FILE=Assets\LeechGun\LG_Leech.pcx  GROUP=Skins LODSET=2 //RSW
  34.  
  35. #exec MESH IMPORT MESH=LG_Ammo ANIVFILE=Assets\LeechGun\LG_Ammo_a.3d DATAFILE=Assets\LeechGun\LG_Ammo_d.3d X=0 Y=0 Z=0 //RSW
  36. #exec MESH ORIGIN MESH=LG_Ammo X=0 Y=0 Z=0
  37. #exec MESHMAP SCALE MESHMAP=LG_Ammo X=0.1 Y=0.1 Z=0.2
  38. #exec MESHMAP SETTEXTURE MESHMAP=LG_Ammo NUM=1 TEXTURE=LG_Ammo
  39.  
  40. #exec MESH IMPORT MESH=LG_FP ANIVFILE=Assets\LeechGun\LG_FP_a.3d DATAFILE=Assets\LeechGun\LG_FP_d.3d X=0 Y=0 Z=0 //RSW
  41. #exec MESH ORIGIN MESH=LG_FP X=04 Y=-140 Z=-15 YAW=-64
  42. #exec MESH SEQUENCE MESH=LG_FP SEQ=All      STARTFRAME=0 NUMFRAMES=8
  43. #exec MESH SEQUENCE MESH=LG_FP SEQ=Ambient  STARTFRAME=0 NUMFRAMES=1 //RSW
  44. #exec MESH SEQUENCE MESH=LG_FP SEQ=Select   STARTFRAME=0 NUMFRAMES=8 //RSW
  45. #exec MESH SEQUENCE MESH=LG_FP SEQ=Reload   STARTFRAME=0 NUMFRAMES=8 //RSW
  46. #exec MESH SEQUENCE MESH=LG_FP SEQ=Idle     STARTFRAME=0 NUMFRAMES=1 //RSW
  47. #exec MESH SEQUENCE MESH=LG_FP SEQ=Fire     STARTFRAME=0 NUMFRAMES=8 //RSW
  48. #exec MESH SEQUENCE MESH=LG_FP SEQ=AltFire  STARTFRAME=0 NUMFRAMES=8 //RSW
  49. #exec MESH SEQUENCE MESH=LG_FP SEQ=Down     STARTFRAME=0 NUMFRAMES=1 //RSW
  50. #exec MESHMAP SCALE MESHMAP=LG_FP X=0.1 Y=0.1 Z=0.2
  51. #exec MESHMAP SETTEXTURE MESHMAP=LG_FP NUM=0 TEXTURE=LG_Skin
  52.  
  53. #exec MESH IMPORT MESH=LG_TP ANIVFILE=Assets\LeechGun\LG_TP_a.3d DATAFILE=Assets\LeechGun\LG_TP_d.3d X=0 Y=0 Z=0 //RSW
  54. #exec MESH ORIGIN MESH=LG_TP X=04 Y=-140 Z=-15 YAW=-64
  55. #exec MESHMAP SCALE MESHMAP=LG_TP X=0.1 Y=0.1 Z=0.2
  56. #exec MESHMAP SETTEXTURE MESHMAP=LG_TP NUM=0 TEXTURE=LG_Skin
  57.  
  58. #exec MESH IMPORT MESH=LG_Leech ANIVFILE=Assets\LeechGun\LG_Leech_a.3d DATAFILE=Assets\LeechGun\LG_Leech_d.3d X=0 Y=0 Z=0 //RSW
  59. #exec MESH ORIGIN MESH=LG_Leech X=0 Y=0 Z=0
  60. #exec MESHMAP SCALE MESHMAP=LG_Leech X=0.1 Y=0.1 Z=0.2
  61. #exec MESHMAP SETTEXTURE MESHMAP=LG_Leech NUM=1 TEXTURE=LG_Leech
  62.  
  63. #exec AUDIO IMPORT FILE=Assets\LeechGun\LG_Pickup.wav       GROUP=LeechGun //SBB
  64. #exec AUDIO IMPORT FILE=Assets\LeechGun\LG_PickupAmmo.wav   GROUP=LeechGun //SBB
  65. #exec AUDIO IMPORT FILE=Assets\LeechGun\LG_Select.wav       GROUP=LeechGun //SBB
  66. #exec AUDIO IMPORT FILE=Assets\LeechGun\LG_Reload.wav       GROUP=LeechGun //SBB
  67. #exec AUDIO IMPORT FILE=Assets\LeechGun\LG_Fire.wav         GROUP=LeechGun //SBB
  68. #exec AUDIO IMPORT FILE=Assets\LeechGun\LG_AltFire.wav      GROUP=LeechGun //SBB
  69. #exec AUDIO IMPORT FILE=Assets\LeechGun\LG_Bounce.wav       GROUP=LeechGun //SBB: NEW
  70. #exec AUDIO IMPORT FILE=Assets\LeechGun\LG_Attack.wav       GROUP=LeechGun //SBB: NEW
  71.  
  72. defaultproperties
  73. {
  74.     AnimationType=AT_Large
  75.     FireAnimRate=0.900000
  76.     AltFireAnimRate=0.700000
  77.     AmmoName=Class'U2Weapons.AmmoInvLeechPod'
  78.     PickupAmmoCount=21
  79.     AutoSwitchPriority=5
  80.     ProjectileClass=Class'U2Weapons.projectileLeech'
  81.     AltProjectileClass=Class'U2Weapons.projectileStickyLeech'
  82.     AIRating=0.600000
  83.     RefireRate=0.900000
  84.     AltRefireRate=0.700000
  85.     FireSound=Sound'U2Weapons.LeechGun.LG_Fire'
  86.     AltFireSound=Sound'U2Weapons.LeechGun.LG_AltFire'
  87.     CockingSound=Sound'U2Weapons.LeechGun.LG_Reload'
  88.     SelectSound=Sound'U2Weapons.LeechGun.LG_Select'
  89.     InventoryGroup=3
  90.     PickupClass=Class'U2Weapons.weaponLeechGun'
  91.     PlayerViewOffset=(X=40.599998,Y=14.600000,Z=-16.600000)
  92.     FirstPersonMesh=VertMesh'U2Weapons.LG_FP'
  93.     StatusIcon=Texture'U2Weapons.Icons.LG_Icon'
  94.     ItemName="Leech Gun"
  95.     Mesh=VertMesh'U2Weapons.LG_TP'
  96. }
  97.  
  98. @@//THE LEECH PROJECTILE - GreatEmerald
  99.  
  100. //=============================================================================
  101. // projectileLeech.uc -- spawned by the weaponLeechGun Fire() and AltFire()
  102. // $Author: Mpoesch $
  103. // $Date: 4/18/01 7:58a $
  104. // $Revision: 3 $
  105. //=============================================================================
  106. class projectileLeech extends U2Projectile;
  107.  
  108.  
  109. var() float ForgetInstigatorTime;
  110. var() float AttackRange;
  111. var() float ChaseLifeSpan;
  112. var() float ChaseSpeed;
  113. var() vector JumpVect;
  114. var() float SpeedLeeched;
  115. var() float AttackLifeSpan;
  116. var() float AttackPeriod;
  117. var Pawn TargetPawn;
  118.  
  119.  
  120. function TakeDamage( int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType )
  121. {
  122.     //SBB Leech carcass and/or death effect(s)
  123.     Destroy();
  124. }
  125.  
  126.  
  127. function ProcessTouch( Actor Other, Vector HitLocation )
  128. {
  129.     if( Other != Instigator && Other.IsA( 'Pawn' ) )
  130.     {
  131.         TargetPawn = Pawn(Other);
  132.         GotoState( 'Attacking' );
  133.     }
  134. }
  135.  
  136.  
  137. auto state Flying
  138. {
  139.     function LandedEx( CheckResult Hit )
  140.     {
  141.         SetRotation( Rotator( Hit.Normal ) );
  142.         GotoState( 'Waiting' );
  143.     }
  144. }
  145.  
  146.  
  147. state Waiting
  148. {
  149.     function BeginState()
  150.     {
  151.         Velocity = Vect(0,0,0);
  152.         SetPhysics( PHYS_None );
  153.         SetTimer( 0.4, true ); // look around periodically -- average latency of 2/10th of a second is equivalent to human reflexes
  154.         ResetLifeSeconds();
  155.     }
  156.  
  157.     function Timer()
  158.     {
  159.         local Pawn P;
  160.  
  161.         if( GetLifeSeconds() > ForgetInstigatorTime )
  162.         {
  163.             Instigator = None; // forget instigator (attack the Player)
  164.         }
  165.  
  166.         foreach RadiusActors( class'Pawn', P, AttackRange )
  167.         {
  168.             if( P != Instigator && FastTrace( Location, P.Location ) )
  169.             {
  170.                 TargetPawn = P;
  171.                 GotoState( 'Chasing' );
  172.                 break;
  173.             }
  174.         }
  175.     }
  176. }
  177.  
  178.  
  179. state Chasing
  180. {
  181.     function ChaseTarget( vector HitNormal )
  182.     {
  183.         local vector TargetDirection;
  184.         local rotator FacingDirection;
  185.  
  186.         TargetDirection = Normal( TargetPawn.Location - Location );
  187.         FacingDirection = rotator( HitNormal );
  188.         FacingDirection.Yaw = rotator( TargetDirection ).Yaw;
  189.  
  190.         SetRotation( FacingDirection );
  191.  
  192. //!!mwp     bSimFall = true;
  193.         Velocity = TargetDirection * ChaseSpeed + 5.0 * JumpVect;
  194.         SetPhysics( PHYS_Falling );
  195.     }
  196.  
  197.     function BeginState()
  198.     {
  199.         LifeSpan = ChaseLifeSpan;
  200.         ChaseTarget( vect(0,0,1) );
  201.     }
  202.  
  203.     function LandedEx( CheckResult Hit )
  204.     {
  205.         PlaySound( ImpactSound, SLOT_Misc );
  206.  
  207.         if( FastTrace( Location, TargetPawn.Location ) )
  208.         {
  209.             ChaseTarget( Hit.Normal );
  210.         }
  211.         else
  212.         {
  213.             TargetPawn = None;
  214.             GotoState( 'Waiting' );
  215.         }
  216.     }
  217. }
  218.  
  219.  
  220. state Attacking
  221. {
  222.     ignores TakeDamage;
  223.  
  224.     function BeginState()
  225.     {
  226.         SetCollision( false, false, false );
  227.         bHidden = true;
  228.         SetBase( TargetPawn );
  229.         LifeSpan = AttackLifeSpan;
  230.         SetTimer( AttackPeriod, true );
  231.         TargetPawn.GroundSpeed = TargetPawn.Default.GroundSpeed * SpeedLeeched;
  232.     }
  233.  
  234.     function Timer()
  235.     {
  236.         if( TargetPawn != None && TargetPawn.Health > 0 && !TargetPawn.bDeleteMe )
  237.         {
  238.             TargetPawn.PlaySound( Sound'LG_Attack', SLOT_Misc );
  239.             TargetPawn.TakeDamage( Damage, Instigator, TargetPawn.Location, Vect(0,0,0), MyDamageType );   
  240.         }
  241.         else
  242.         {
  243.             Destroy();
  244.         }
  245.     }
  246.  
  247.     function Destroyed()
  248.     {
  249.         if( TargetPawn != None )
  250.         {
  251.             TargetPawn.GroundSpeed = TargetPawn.Default.GroundSpeed;
  252.         }
  253.     }
  254. }
  255.  
  256. defaultproperties
  257. {
  258.     ForgetInstigatorTime=3.000000
  259.     AttackRange=512.000000
  260.     ChaseLifeSpan=10.000000
  261.     ChaseSpeed=250.000000
  262.     JumpVect=(Z=32.000000)
  263.     SpeedLeeched=0.500000
  264.     AttackLifeSpan=10.000000
  265.     AttackPeriod=1.000000
  266.     BounceDamping=0.200000
  267.     speed=800.000000
  268.     MaxSpeed=800.000000
  269.     Damage=1.000000
  270.     MyDamageType=Class'U2.DamageTypeLeechGun'
  271.     ImpactSound=Sound'U2Weapons.LeechGun.LG_Bounce'
  272.     Physics=PHYS_Falling
  273.     Mesh=VertMesh'U2Weapons.LG_Leech'
  274.     DrawScale=0.700000
  275.     TransientSoundVolume=1.000000
  276.     CollisionRadius=3.000000
  277.     CollisionHeight=3.000000
  278.     bBounce=True
  279. }
  280.  
  281. @@//THE SECONDARY FIRE PROJECTILE - GreatEmerald
  282.  
  283. //=============================================================================
  284. // projectileStickyLeech.uc -- spawned by the weaponLeechGun AltFire()
  285. // $Author: Aleiby $
  286. // $Date: 4/06/01 2:56a $
  287. // $Revision: 1 $
  288. //=============================================================================
  289. class projectileStickyLeech extends projectileLeech;
  290.  
  291.  
  292. auto state Flying
  293. {
  294.     function HitWallEx( CheckResult Hit )
  295.     {
  296.         // override bounce behavior (stick to wall and wait for target)
  297.         LandedEx( Hit );
  298.     }
  299. }
  300.  
  301. defaultproperties
  302. {
  303. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement