Razorjack implemented, along with a couple extra features.
Adjust SCUBA Gear autouse behaviour so it works properly with manual use. Add 3D floor handling code on various things. Increased size of Eightball explosions to match original game. Fix invisibility playing no sound when activated.
This commit is contained in:
parent
2587d6c505
commit
3e169dfde6
16 changed files with 538 additions and 33 deletions
|
|
@ -361,10 +361,31 @@ Class ASMDBall : Actor
|
|||
if ( BlockingLine ) HitNormal = (-BlockingLine.delta.y,BlockingLine.delta.x,0).unit();
|
||||
else if ( BlockingFloor )
|
||||
{
|
||||
HitNormal = BlockingFloor.floorplane.Normal;
|
||||
// find closest 3d floor for its normal
|
||||
F3DFloor ff = null;
|
||||
for ( int i=0; i<BlockingFloor.Get3DFloorCount(); i++ )
|
||||
{
|
||||
if ( !(BlockingFloor.Get3DFloor(i).top.ZAtPoint(pos.xy) ~== floorz) ) continue;
|
||||
ff = BlockingFloor.Get3DFloor(i);
|
||||
break;
|
||||
}
|
||||
if ( ff ) HitNormal = -ff.top.Normal;
|
||||
else HitNormal = BlockingFloor.floorplane.Normal;
|
||||
r.SetOrigin(r.Vec3Offset(0,0,2),false);
|
||||
}
|
||||
else if ( BlockingCeiling ) HitNormal = BlockingCeiling.ceilingplane.Normal;
|
||||
else if ( BlockingCeiling )
|
||||
{
|
||||
// find closest 3d floor for its normal
|
||||
F3DFloor ff = null;
|
||||
for ( int i=0; i<BlockingCeiling.Get3DFloorCount(); i++ )
|
||||
{
|
||||
if ( !(BlockingCeiling.Get3DFloor(i).bottom.ZAtPoint(pos.xy) ~== ceilingz) ) continue;
|
||||
ff = BlockingCeiling.Get3DFloor(i);
|
||||
break;
|
||||
}
|
||||
if ( ff ) HitNormal = -ff.bottom.Normal;
|
||||
else HitNormal = BlockingCeiling.ceilingplane.Normal;
|
||||
}
|
||||
r.angle = atan2(HitNormal.y,HitNormal.x);
|
||||
r.pitch = asin(-HitNormal.z);
|
||||
r.scale *= 1.5;
|
||||
|
|
@ -589,9 +610,15 @@ Class ASMDBeam : Actor
|
|||
if ( t.Results.Side == 0 ) HitNormal *= -1;
|
||||
}
|
||||
else if ( t.Results.HitType == TRACE_HitFloor )
|
||||
HitNormal = t.Results.HitSector.floorplane.Normal;
|
||||
{
|
||||
if ( t.Results.ffloor ) HitNormal = -t.Results.ffloor.top.Normal;
|
||||
else HitNormal = t.Results.HitSector.floorplane.Normal;
|
||||
}
|
||||
else if ( t.Results.HitType == TRACE_HitCeiling )
|
||||
HitNormal = t.Results.HitSector.ceilingplane.Normal;
|
||||
{
|
||||
if ( t.Results.ffloor ) HitNormal = -t.Results.ffloor.bottom.Normal;
|
||||
else HitNormal = t.Results.HitSector.ceilingplane.Normal;
|
||||
}
|
||||
double mult = Amplifier.GetMult(target,100);
|
||||
BeamExplode(mult>1.5);
|
||||
Actor r;
|
||||
|
|
|
|||
|
|
@ -196,8 +196,16 @@ Class Automag : UnrealWeapon
|
|||
else if ( d.HitType != TRACE_HitNone )
|
||||
{
|
||||
Vector3 hitnormal = -d.HitDir;
|
||||
if ( d.HitType == TRACE_HitFloor ) hitnormal = d.HitSector.floorplane.Normal;
|
||||
else if ( d.HitType == TRACE_HitCeiling ) hitnormal = d.HitSector.ceilingplane.Normal;
|
||||
if ( d.HitType == TRACE_HitFloor )
|
||||
{
|
||||
if ( d.Hit3DFloor ) hitnormal = -d.Hit3DFloor.top.Normal;
|
||||
else hitnormal = d.HitSector.floorplane.Normal;
|
||||
}
|
||||
else if ( d.HitType == TRACE_HitCeiling )
|
||||
{
|
||||
if ( d.Hit3DFloor ) hitnormal = -d.Hit3DFloor.bottom.Normal;
|
||||
else hitnormal = d.HitSector.ceilingplane.Normal;
|
||||
}
|
||||
else if ( d.HitType == TRACE_HitWall )
|
||||
{
|
||||
hitnormal = (-d.HitLine.delta.y,d.HitLine.delta.x,0).unit();
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ Class DispersionPistol : UnrealWeapon
|
|||
A_WeaponOffset(0,32);
|
||||
invoker.bCharging = false;
|
||||
if ( self is 'UTPlayer' )
|
||||
UTPlayer(self).PlayAttacking();
|
||||
UTPlayer(self).PlayAttacking3();
|
||||
DefaultAmmo(weap.Ammo1).rechargephase = 0;
|
||||
A_PlaySound("dpistol/fire",CHAN_WEAPON,Dampener.Active(self)?.4:1.);
|
||||
double mult = Amplifier.GetMult(self,int(invoker.ChargeSize*50)+50);
|
||||
|
|
|
|||
|
|
@ -1444,7 +1444,28 @@ Class SentryItem : UnrealInventory
|
|||
if ( Owner ) Owner.RemoveInventory(self);
|
||||
else
|
||||
{
|
||||
// TODO replace
|
||||
let r = Spawn("Berserk",pos,ALLOW_REPLACE);
|
||||
r.spawnangle = spawnangle;
|
||||
r.spawnpoint = spawnpoint;
|
||||
r.angle = angle;
|
||||
r.pitch = pitch;
|
||||
r.roll = roll;
|
||||
r.special = special;
|
||||
r.args[0] = args[0];
|
||||
r.args[1] = args[1];
|
||||
r.args[2] = args[2];
|
||||
r.args[3] = args[3];
|
||||
r.args[4] = args[4];
|
||||
r.ChangeTid(tid);
|
||||
r.SpawnFlags = SpawnFlags&~MTF_SECRET;
|
||||
r.HandleSpawnFlags();
|
||||
r.SpawnFlags = SpawnFlags;
|
||||
r.bCountSecret = SpawnFlags&MTF_SECRET;
|
||||
r.vel = vel;
|
||||
r.master = master;
|
||||
r.target = target;
|
||||
r.tracer = tracer;
|
||||
r.bDropped = bDropped;
|
||||
}
|
||||
Destroy();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,13 +38,9 @@ Class OLSMPAmmo : Ammo
|
|||
r.target = target;
|
||||
r.tracer = tracer;
|
||||
r.bDropped = bDropped;
|
||||
Destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
Owner.RemoveInventory(self);
|
||||
Destroy();
|
||||
}
|
||||
else Owner.RemoveInventory(self);
|
||||
Destroy();
|
||||
}
|
||||
Default
|
||||
{
|
||||
|
|
@ -187,8 +183,16 @@ Class OLSMP : UnrealWeapon
|
|||
else if ( d.HitType != TRACE_HitNone )
|
||||
{
|
||||
Vector3 hitnormal = -d.HitDir;
|
||||
if ( d.HitType == TRACE_HitFloor ) hitnormal = d.HitSector.floorplane.Normal;
|
||||
else if ( d.HitType == TRACE_HitCeiling ) hitnormal = d.HitSector.ceilingplane.Normal;
|
||||
if ( d.HitType == TRACE_HitFloor )
|
||||
{
|
||||
if ( d.Hit3DFloor ) hitnormal = -d.Hit3DFloor.top.Normal;
|
||||
else hitnormal = d.HitSector.floorplane.Normal;
|
||||
}
|
||||
else if ( d.HitType == TRACE_HitCeiling )
|
||||
{
|
||||
if ( d.Hit3DFloor ) hitnormal = -d.Hit3DFloor.bottom.Normal;
|
||||
else hitnormal = d.HitSector.ceilingplane.Normal;
|
||||
}
|
||||
else if ( d.HitType == TRACE_HitWall )
|
||||
{
|
||||
hitnormal = (-d.HitLine.delta.y,d.HitLine.delta.x,0).unit();
|
||||
|
|
|
|||
|
|
@ -26,19 +26,222 @@ Class RazorAmmo : Ammo
|
|||
|
||||
Class RazorBlade : Actor
|
||||
{
|
||||
Vector3 gvel, accel;
|
||||
double oldgangle, gangle, oldgpitch, gpitch;
|
||||
|
||||
Default
|
||||
{
|
||||
Radius 2;
|
||||
Height 2;
|
||||
Speed 25;
|
||||
DamageFunction (int((30+special1*5)*((DamageType=='Decapitated')?3.5:1.0)));
|
||||
DamageType 'Shredded';
|
||||
Obituary "$O_RAZORJACK";
|
||||
BounceType "Hexen";
|
||||
ReactionTime 5;
|
||||
BounceFactor 1.0;
|
||||
WallBounceFactor 1.0;
|
||||
PROJECTILE;
|
||||
+USEBOUNCESTATE;
|
||||
+SKYEXPLODE;
|
||||
+CANBOUNCEWATER;
|
||||
+NODAMAGETHRUST;
|
||||
+DONTBOUNCEONSHOOTABLES;
|
||||
+ROLLSPRITE;
|
||||
}
|
||||
override void PostBeginPlay()
|
||||
{
|
||||
Super.PostBeginPlay();
|
||||
let t = Spawn("RazorBladeTrail",pos);
|
||||
t.target = self;
|
||||
frame = special1;
|
||||
if ( special1 > 0 )
|
||||
{
|
||||
vel *= 1.+.06+special1;
|
||||
A_PlaySound("ripper/hum",CHAN_VOICE,1.0,true,3.0,pitch:3.125+special1*.2);
|
||||
}
|
||||
else A_PlaySound("ripper/hum",CHAN_VOICE,1.0,true,3.0,pitch:3.125);
|
||||
Vector3 dir = vel.unit();
|
||||
A_SetAngle(atan2(dir.y,dir.x));
|
||||
A_SetPitch(asin(-dir.z));
|
||||
frame = 0;
|
||||
gvel = vel;
|
||||
oldgangle = gangle = angle;
|
||||
oldgpitch = gpitch = pitch;
|
||||
}
|
||||
override int SpecialMissileHit( Actor victim )
|
||||
{
|
||||
if ( pos.z > victim.pos.z+victim.height*0.81 ) DamageType = 'Decapitated';
|
||||
return -1;
|
||||
}
|
||||
override int DoSpecialDamage( Actor target, int damage, Name damagetype )
|
||||
{
|
||||
if ( !target.bNOBLOOD )
|
||||
{
|
||||
target.SpawnBlood(pos,AngleTo(target),damage);
|
||||
A_PlaySound("ripper/flesh");
|
||||
A_AlertMonsters();
|
||||
}
|
||||
UTMainHandler.DoKnockback(target,vel.unit(),15000);
|
||||
return damage;
|
||||
}
|
||||
void A_RazorAltOrient()
|
||||
{
|
||||
if ( !bAMBUSH || !target || !target.player || (target.Health <= 0) ) return;
|
||||
if ( sting_razoraim )
|
||||
{
|
||||
FLineTraceData d;
|
||||
target.LineTrace(target.angle,10000,target.pitch,0,target.player.viewheight,data:d);
|
||||
Vector3 SeekingDir = level.Vec3Diff(pos,d.HitLocation).unit();
|
||||
double MagnitudeVel = Vel.length();
|
||||
SeekingDir = (SeekingDir*0.1*MagnitudeVel+Vel).unit();
|
||||
vel = MagnitudeVel * SeekingDir;
|
||||
accel = SeekingDir * 25.;
|
||||
vel += accel/TICRATE;
|
||||
vel = vel.unit()*clamp(MagnitudeVel,10,15);
|
||||
}
|
||||
else
|
||||
{
|
||||
double dangle, dpitch;
|
||||
dangle = deltaangle(oldgangle,target.angle);
|
||||
dpitch = deltaangle(oldgpitch,target.pitch);
|
||||
gangle += dangle;
|
||||
gpitch += dpitch;
|
||||
vel += (cos(gangle)*cos(gpitch),sin(gangle)*cos(gpitch),-sin(gpitch))*15./TICRATE;
|
||||
double spd = vel.length();
|
||||
vel = vel*clamp(spd,10,15)/spd;
|
||||
gvel = vel;
|
||||
oldgangle = target.angle;
|
||||
oldgpitch = target.pitch;
|
||||
}
|
||||
Vector3 dir = vel.unit();
|
||||
A_SetAngle(atan2(dir.y,dir.x));
|
||||
A_SetPitch(asin(-dir.z));
|
||||
}
|
||||
action void A_RazorHit()
|
||||
{
|
||||
A_PlaySound("ripper/hit");
|
||||
A_AlertMonsters();
|
||||
A_SprayDecal("WallCrack",-20);
|
||||
int numpt = Random[Ripper](5,10);
|
||||
Vector3 x = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
|
||||
for ( int i=0; i<numpt; i++ )
|
||||
{
|
||||
Vector3 pvel = (-x+(FRandom[Ripper](-.8,.8),FRandom[Ripper](-.8,.8),FRandom[Ripper](-.8,.8))).unit()*FRandom[Ripper](0.1,1.2);
|
||||
let s = Spawn("UTSmoke",pos);
|
||||
s.vel = pvel;
|
||||
s.SetShade(Color(1,1,1)*Random[Ripper](128,192));
|
||||
}
|
||||
numpt = Random[Ripper](4,12);
|
||||
for ( int i=0; i<numpt; i++ )
|
||||
{
|
||||
Vector3 pvel = (FRandom[Ripper](-1,1),FRandom[Ripper](-1,1),FRandom[Ripper](-1,1)).unit()*FRandom[Ripper](2,8);
|
||||
let s = Spawn("UTSpark",pos);
|
||||
s.vel = pvel;
|
||||
}
|
||||
numpt = Random[Ripper](4,8);
|
||||
for ( int i=0; i<numpt; i++ )
|
||||
{
|
||||
Vector3 pvel = (FRandom[Ripper](-1,1),FRandom[Ripper](-1,1),FRandom[Ripper](-1,1)).unit()*FRandom[Ripper](2,8);
|
||||
let s = Spawn("UTChip",pos);
|
||||
s.vel = pvel;
|
||||
}
|
||||
}
|
||||
States
|
||||
{
|
||||
Spawn:
|
||||
RAZB # 1 A_RazorAltOrient();
|
||||
Wait;
|
||||
Bounce:
|
||||
RAZB # 0
|
||||
{
|
||||
bHITOWNER = true; // technically the Unreal version sets this 0.2 seconds after being fired, but this works better
|
||||
Vector3 dir = vel.unit();
|
||||
A_SetAngle(atan2(dir.y,dir.x));
|
||||
A_SetPitch(asin(-dir.z));
|
||||
A_RazorHit();
|
||||
A_CountDown();
|
||||
}
|
||||
Goto Spawn;
|
||||
Death:
|
||||
TNT1 A 1 A_StopSound(CHAN_VOICE);
|
||||
Stop;
|
||||
}
|
||||
}
|
||||
|
||||
Class RazorBladeAlt : RazorBlade
|
||||
Class RazorBladeTrail : Actor
|
||||
{
|
||||
Default
|
||||
{
|
||||
RenderStyle "Add";
|
||||
+NOGRAVITY;
|
||||
+NOCLIP;
|
||||
+DONTSPLASH;
|
||||
+NOTELEPORT;
|
||||
Radius 0.1;
|
||||
Height 0;
|
||||
}
|
||||
override void Tick()
|
||||
{
|
||||
if ( !target || target.InStateSequence(target.CurState,target.ResolveState("Death")) )
|
||||
{
|
||||
A_RemoveLight('RazorLight');
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
SetOrigin(target.pos,true);
|
||||
angle = target.angle;
|
||||
pitch = target.pitch;
|
||||
roll = target.roll;
|
||||
alpha = min(target.vel.length()/target.speed,1.);
|
||||
A_AttachLight('RazorLight',DynamicLight.PointLight,Color(2,0,3)*int(80*alpha),80,80);
|
||||
}
|
||||
States
|
||||
{
|
||||
Spawn:
|
||||
RAZB A -1 Bright;
|
||||
Stop;
|
||||
}
|
||||
}
|
||||
|
||||
Class Razorjack : UnrealWeapon
|
||||
{
|
||||
action void A_RazorFire( bool bAlt = false )
|
||||
{
|
||||
Weapon weap = Weapon(invoker);
|
||||
if ( !weap ) return;
|
||||
if ( weap.Ammo1.Amount <= 0 ) return;
|
||||
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
|
||||
A_PlaySound("ripper/fire",CHAN_WEAPON,pitch:bAlt?1.:(1.+invoker.special1*.1));
|
||||
invoker.FireEffect();
|
||||
UTMainHandler.DoFlash(self,Color(16,255,0,255),1);
|
||||
A_AlertMonsters();
|
||||
A_QuakeEx(1,1,1,5,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.08);
|
||||
if ( bAlt ) UTMainHandler.DoSwing(self,(FRandom[Ripper](-0.6,-0.3),FRandom[Ripper](0.2,0.4)),1,-0.3,2,SWING_Spring,2,2);
|
||||
else UTMainHandler.DoSwing(self,(FRandom[Ripper](-0.3,0.3),FRandom[Ripper](0.2,0.6)),1,-0.3,2,SWING_Spring,2,2);
|
||||
Vector3 x, y, z;
|
||||
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
|
||||
Vector3 origin = Vec2OffsetZ(0,0,player.viewz);
|
||||
if ( bAlt ) origin = level.Vec3Offset(origin,x*10-y*4-z*5);
|
||||
else origin = level.Vec3Offset(origin,x*10-z*9);
|
||||
Actor p;
|
||||
p = Spawn("RazorBlade",origin);
|
||||
if ( bAlt )
|
||||
{
|
||||
p.roll = 70;
|
||||
p.bAMBUSH = true;
|
||||
}
|
||||
else p.special1 = invoker.special1;
|
||||
p.angle = angle;
|
||||
p.pitch = BulletSlope();
|
||||
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
|
||||
p.target = self;
|
||||
}
|
||||
Default
|
||||
{
|
||||
Tag "$T_RAZORJACK";
|
||||
Inventory.PickupMessage "$I_RAZORJACK";
|
||||
Weapon.UpSound "razorjack/select";
|
||||
Weapon.UpSound "ripper/select";
|
||||
Weapon.SlotNumber 7;
|
||||
Weapon.SelectionOrder 7;
|
||||
Weapon.AmmoType "RazorAmmo";
|
||||
|
|
@ -55,5 +258,56 @@ Class Razorjack : UnrealWeapon
|
|||
Stop;
|
||||
RZRP B -1;
|
||||
Stop;
|
||||
Select:
|
||||
RZRS A 1 A_Raise(int.max);
|
||||
Wait;
|
||||
Ready:
|
||||
RZRS ABCDEFGHIJKLMNOPQRSTUVWXYZ 1 A_WeaponReady(WRF_NOFIRE);
|
||||
RZS2 ABCD 1 A_WeaponReady(WRF_NOFIRE);
|
||||
Idle:
|
||||
RZRI ABCDEFGHIJKLMNOPQRSUVWXYZ 2
|
||||
{
|
||||
A_CheckReload();
|
||||
A_WeaponReady();
|
||||
}
|
||||
RZI2 ABCDE 2
|
||||
{
|
||||
A_CheckReload();
|
||||
A_WeaponReady();
|
||||
}
|
||||
Loop;
|
||||
Fire:
|
||||
RZRI A 0
|
||||
{
|
||||
invoker.special1 = 0;
|
||||
return A_JumpIf(sting_razor,"ChargeUp");
|
||||
}
|
||||
Release:
|
||||
RZRF A 0 A_RazorFire();
|
||||
RZRF ABCDEFGH 2;
|
||||
Goto Idle;
|
||||
ChargeUp:
|
||||
RZRI ABCDEFGHIJKLMNOPQRSUVWXYZ 1 A_JumpIf(!(player.cmd.buttons&BT_ATTACK),"Release");
|
||||
RZI2 ABCDE 1 A_JumpIf(!(player.cmd.buttons&BT_ATTACK),"Release");
|
||||
RZRI A 0 { invoker.special1 = 1; }
|
||||
RZRI ACEGIKMOQSVXZ 1 A_JumpIf(!(player.cmd.buttons&BT_ATTACK),"Release");
|
||||
RZI2 BD 1 A_JumpIf(!(player.cmd.buttons&BT_ATTACK),"Release");
|
||||
RZRI A 0 { invoker.special1 = 2; }
|
||||
RZRI ADGJMPSWZ 1 A_JumpIf(!(player.cmd.buttons&BT_ATTACK),"Release");
|
||||
RZI2 C 1 A_JumpIf(!(player.cmd.buttons&BT_ATTACK),"Release");
|
||||
RZRI A 0 { invoker.special1 = 3; }
|
||||
Goto Release;
|
||||
AltFire:
|
||||
RZRA ABCDEFGHIJKL 1;
|
||||
AltHold:
|
||||
RZRA M 0 A_RazorFire(true);
|
||||
RZRA MNOP 4;
|
||||
RZRA Q 0 A_ReFire("AltHold");
|
||||
RZRA QRSTU 2;
|
||||
Goto Idle;
|
||||
Deselect:
|
||||
RZRD ABCDEF 1;
|
||||
RZRD F 1 A_Lower(int.max);
|
||||
Wait;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ Class URocket : Actor
|
|||
A_SetRenderStyle(1.0,STYLE_Add);
|
||||
A_SprayDecal("RocketBlast",50);
|
||||
A_NoGravity();
|
||||
A_SetScale(FRandomPick[ExploS](-1.5,1.5),FRandomPick[ExploS](-1.5,1.5));
|
||||
A_SetScale(FRandomPick[ExploS](-2.5,2.5),FRandomPick[ExploS](-2.5,2.5));
|
||||
UTMainHandler.DoBlast(self,rad,80000);
|
||||
A_Explode(dmg,rad);
|
||||
A_QuakeEx(3,3,3,8,0,rad+50,"",QF_RELATIVE|QF_SCALEDOWN,falloff:rad,rollIntensity:0.2);
|
||||
|
|
|
|||
|
|
@ -228,10 +228,21 @@ Class UPlayer : UTPlayer
|
|||
// no animation if crouched
|
||||
if ( (player && (player.mo == self)) && (player.crouchdir == -1) ) return;
|
||||
// check weapon type
|
||||
if ( ((player.ReadyWeapon is 'URifle') && !sting_rifle && (player.buttons&BT_ALTATTACK)) || ((player.ReadyWeapon is 'Peacemaker') && player.buttons&BT_ALTATTACK) )
|
||||
return;
|
||||
let psp = player.FindPSprite(PSP_WEAPON);
|
||||
if ( ((player.ReadyWeapon is 'Stinger') && psp
|
||||
&& psp.CurState.InStateSequence(player.ReadyWeapon.FindState("Hold")))
|
||||
if ( ((player.ReadyWeapon is 'UBioRifle') && (player.buttons&BT_ALTATTACK))
|
||||
|| (player.ReadyWeapon is 'Eightball')
|
||||
|| ((player.ReadyWeapon is 'DispersionPistol') && DispersionPistol(player.ReadyWeapon).bCharging) )
|
||||
{
|
||||
if ( !InStateSequence(CurState,FindState("MissileRepStill")) )
|
||||
SetStateLabel("MissileRepStill");
|
||||
}
|
||||
else if ( ((player.ReadyWeapon is 'Stinger') && psp
|
||||
&& psp.CurState.InStateSequence(player.ReadyWeapon.FindState("Hold")))
|
||||
|| (player.ReadyWeapon is 'UFlamethrower') || (player.ReadyWeapon is 'UMinigun')
|
||||
|| ((player.ReadyWeapon is 'Bonesaw') && player.buttons&BT_ATTACK)
|
||||
|| ((player.ReadyWeapon is 'Impaler') && psp.CurState.InStateSequence(player.ReadyWeapon.FindState("AltHold"))) )
|
||||
{
|
||||
if ( !InStateSequence(CurState,FindState("MissileRep")) )
|
||||
SetStateLabel("MissileRep");
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Class UInvisibility : UnrealInventory
|
|||
bActive = !bActive;
|
||||
if ( bActive )
|
||||
{
|
||||
Owner.A_PlaySound("uinvis/toggle",CHAN_ITEM);
|
||||
Owner.A_PlaySound("invis/pickup",CHAN_ITEM);
|
||||
Owner.GiveInventory("PowerUInvisibility",1);
|
||||
}
|
||||
else Owner.TakeInventory("PowerUInvisibility",1);
|
||||
|
|
@ -244,12 +244,11 @@ Class UJumpBoots : UnrealInventory
|
|||
{
|
||||
Sector s = level.Sectors[i];
|
||||
if ( s.MoreFlags&(Sector.SECMF_UNDERWATER|Sector.SECMF_FORCEDUNDERWATER) ) foundswim = true;
|
||||
for ( int i=0; i<s.Get3DFloorCount(); i++ )
|
||||
if ( s.Get3DFloor(i).flags&F3DFloor.FF_SWIMMABLE ) foundswim = true;
|
||||
if ( !s.DamageInterval || !s.DamageAmount ) continue;
|
||||
if ( s.DamageType == 'Slime' ) foundslime = true;
|
||||
else if ( s.DamageType == 'Fire' ) foundlava = true;
|
||||
// 3d floors don't set the underwater flags or anything so we're completely screwed until Graf merges my goddamn PR
|
||||
//for ( int i=0; i<s.Get3DFloorCount(); i++ )
|
||||
// if ( s.Get3DFloor(i).flags&F3DFloor.FF_SWIMMABLE ) foundswim = true;
|
||||
}
|
||||
// random chance to ignore if a replacement already was made
|
||||
let ti = ThinkerIterator.Create("Inventory");
|
||||
|
|
@ -448,6 +447,7 @@ Class DetectorSound : Actor
|
|||
|
||||
Class SCUBAGear : UnrealInventory
|
||||
{
|
||||
int oldwaterlevel;
|
||||
Default
|
||||
{
|
||||
Tag "$T_SCUBA";
|
||||
|
|
@ -464,6 +464,11 @@ Class SCUBAGear : UnrealInventory
|
|||
if ( !bActive ) Owner.A_PlaySound("scuba/stop",CHAN_ITEM);
|
||||
return false;
|
||||
}
|
||||
override void AttachToOwner( Actor other )
|
||||
{
|
||||
Super.AttachToOwner(other);
|
||||
oldwaterlevel = other.waterlevel;
|
||||
}
|
||||
override void AbsorbDamage( int damage, Name damageType, out int newdamage )
|
||||
{
|
||||
if ( bActive && (damageType == 'Drowning') )
|
||||
|
|
@ -472,8 +477,16 @@ Class SCUBAGear : UnrealInventory
|
|||
override void DoEffect()
|
||||
{
|
||||
Super.DoEffect();
|
||||
if ( sting_autoscuba && ((bActive && (Owner.waterlevel < 2)) || (!bActive && (Owner.waterlevel > 2))) )
|
||||
Use(false);
|
||||
if ( (oldwaterlevel < 2) && (owner.waterlevel > 2) )
|
||||
{
|
||||
if ( sting_autoscuba && !bActive ) Use(false);
|
||||
oldwaterlevel = owner.waterlevel;
|
||||
}
|
||||
else if ( (oldwaterlevel > 2) && (owner.waterlevel < 2) )
|
||||
{
|
||||
if ( sting_autoscuba && bActive ) Use(false);
|
||||
oldwaterlevel = owner.waterlevel;
|
||||
}
|
||||
if ( bActive && !tracer )
|
||||
{
|
||||
tracer = Spawn("SCUBASound",Owner.pos);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue