From 876875bd5f5767fe4eb44a482343dce04a71fcae Mon Sep 17 00:00:00 2001 From: HellDragon-HK <34013048+HellDragon-HK@users.noreply.github.com> Date: Wed, 3 Jan 2018 13:52:57 -0600 Subject: [PATCH] Recreate Leviathan primary cannon behaviour (#103) In UT3 it works as the Redeemer, in UT2004 it used to just deal a large AOE --- Classes/UT3DmgType_LeviathanCannon.uc | 55 +++++++++++++++++++++++++++ Classes/UT3LeviathanPrimaryWeapon.uc | 46 ++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 Classes/UT3DmgType_LeviathanCannon.uc diff --git a/Classes/UT3DmgType_LeviathanCannon.uc b/Classes/UT3DmgType_LeviathanCannon.uc new file mode 100644 index 0000000..289c1e8 --- /dev/null +++ b/Classes/UT3DmgType_LeviathanCannon.uc @@ -0,0 +1,55 @@ +/* + * Copyright © 2014 GreatEmerald + * Copyright © 2017 HellDragon + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * (1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * (2) Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimers in + * the documentation and/or other materials provided with the + * distribution. + * + * (3) The name of the author may not be used to + * endorse or promote products derived from this software without + * specific prior written permission. + * + * (4) The use, modification and redistribution of this software must + * be made in compliance with the additional terms and restrictions + * provided by the Unreal Tournament 2004 End User License Agreement. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * This software is not supported by Atari, S.A., Epic Games, Inc. or any + * of such parties' affiliates and subsidiaries. + */ + +class UT3DmgType_LeviathanCannon extends DamTypeMASCannon; + +defaultproperties +{ + DeathString="%k's Leviathan had some last words for %o." + MaleSuicide="%o was taken out by his own Leviathan." + FemaleSuicide="%o was taken out by her own Leviathan." + VehicleDamageScaling=1.5 + + bKUseTearOffMomentum=True + KDeathUpKick=700 + KDamageImpulse=20000 + VehicleClass=class'UT3Leviathan' + +} diff --git a/Classes/UT3LeviathanPrimaryWeapon.uc b/Classes/UT3LeviathanPrimaryWeapon.uc index e3c1ea7..0e1d2f7 100644 --- a/Classes/UT3LeviathanPrimaryWeapon.uc +++ b/Classes/UT3LeviathanPrimaryWeapon.uc @@ -1,5 +1,6 @@ /* * Copyright © 2014 GreatEmerald + * Copyright © 2017-2018 HellDragon * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -45,6 +46,45 @@ var Material RedSkinB, BlueSkinB; simulated state InstantFireMode { + + function Explosion(float DamRad) + { + local actor Victims; + local float damageScale, dist; + local vector Dir; + + if (Role < ROLE_Authority) + return; + + foreach VisibleCollidingActors(class 'Actor', Victims, DamRad, GHitLocation) + { + if( (Victims != self) && (Victims != Instigator) && (Victims.Role == ROLE_Authority) && (!Victims.IsA('FluidSurfaceInfo')) ) + { + Dir = Victims.Location - GHitLocation; + dist = FMax(1,VSize(Dir)); + Dir = Dir/dist; + Dir.Z *= 5.0; + Dir = Normal(Dir); + damageScale = 1; + + if (Pawn(Victims) != None && Pawn(Victims).GetTeamNum() == Instigator.GetTeamNum()) + damageScale = 0; + + Victims.TakeDamage( + damageScale * DamageMax, + Instigator, + Victims.Location - 0.5 * (Victims.CollisionHeight + Victims.CollisionRadius) * Dir, + (damageScale * Momentum * Dir), + DamageType + ); + } + } + } + + function AltFire(Controller C) + { + } + ImplodeExplode: bCurrentlyFiring = true; Sleep(0.8); @@ -95,4 +135,10 @@ defaultproperties YawBone = "MainTurretYaw" PitchBone = "MainTurretPitch" WeaponFireAttachmentBone = "MainTurretPitch" + DamageType=class'UT3DmgType_LeviathanCannon' + RotationsPerSecond=0.22 + DamageMin=250 + DamageMax=250 + DamageRadius=2000 + Momentum=250000.0 }