Skip to content

Commit

Permalink
Recreate Leviathan primary cannon behaviour (#103)
Browse files Browse the repository at this point in the history
In UT3 it works as the Redeemer, in UT2004 it used to just deal a large AOE
  • Loading branch information
HellDragon-HK authored and GreatEmerald committed Jan 3, 2018
1 parent 3c6c39b commit 876875b
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
55 changes: 55 additions & 0 deletions Classes/UT3DmgType_LeviathanCannon.uc
Original file line number Diff line number Diff line change
@@ -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'

}
46 changes: 46 additions & 0 deletions Classes/UT3LeviathanPrimaryWeapon.uc
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
}

0 comments on commit 876875b

Please sign in to comment.