Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
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 |
/****************************************************************************** DracoRocketPack Creation date: 2013-04-28 09:23 Last change: $Id$ Copyright © 2013, Wormbo Website: http://www.koehler-homepage.de/Wormbo/ Feel free to reuse this code. Send me a note if you found it helpful or want to report bugs/provide improvements. Please ask for permission first, if you intend to make money off reused code. ******************************************************************************/ class DracoRocketPack extends ONSWeapon; //============================================================================= // Imports //============================================================================= #exec audio import file=Sounds\NapalmRocketFire.wav var bool bTurnedOff; simulated function Tick(float DeltaTime) { if (bTurnedOff) return; if (Instigator != None && Instigator.PlayerReplicationInfo != None) { bForceCenterAim = False; } else if (!bActive && CurrentAim != rot(0,0,0)) { bForceCenterAim = True; bActive = True; } else if (bActive && CurrentAim == rot(0,0,0)) { bActive = False; } } function bool CanAttack(Actor Other) { return Super.CanAttack(Other) && CheckAngle(Normal(Other.Location - WeaponFireLocation)); } simulated function bool CheckAngle(vector Dir) { local vector WeaponDir; WeaponDir = Normal(Owner.Location - Location) << Owner.Rotation; Dir = Dir << Owner.Rotation; if (Dir.Y > 0 ^^ WeaponDir.Y > 0) return true; if (Dir.X > 0) return Dir.X > 0.7 || Dir.Z < -0.8 || Dir.Z > 0.1; else return Dir.X < -0.5 || Dir.Z < -0.7 || Dir.Z > 0.0; } function Projectile SpawnProjectile(class<Projectile> ProjClass, bool bAltFire) { if (!CheckAngle(vector(WeaponFireRotation))) { if (Bot(Instigator.Controller) != None) DracoRocketPackPawn(Instigator).ConsiderSwitchingSides(); else if (PlayerController(Instigator.Controller) != None) PlayerController(Instigator.Controller).ClientPlaySound(Sound'Denied1'); return None; } return Super.SpawnProjectile(ProjClass, bAltFire); } //============================================================================= // Default values //============================================================================= defaultproperties { Mesh = Mesh'ONSFullAnimations.MASRocketPack' DrawScale = 0.4 Skins(0) = Shader'DracoRocketPackShader' YawBone = RocketPivot YawStartConstraint = 0 YawEndConstraint = 65535 PitchBone = RocketPacks PitchUpLimit = 12000 PitchDownLimit = 50000 bAimable = True FireSoundClass = Sound'NapalmRocketFire' FireForce = "RocketLauncherFire" ProjectileClass = class'DracoNapalmRocket' FireInterval = 0.7 Spread = 0.015 WeaponFireAttachmentBone = RocketPackFirePoint WeaponFireOffset = 0.0 DualFireOffset = 32.0 bDualIndependantTargeting = True AIInfo(0) = (bLeadTarget=true,bTrySplash=true,WarnTargetPct=1.0,RefireRate=0.5) } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |