From c6a81479cac482ffa71ec53278581aa17442f04b Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Thu, 10 Oct 2019 08:32:36 +0200 Subject: [PATCH] Release Candidate 3: - Fix inventory items not removing themselves when fully drained and no more copies are held. - Fixed Minigun playing the unwind animation on player death. - Fixed main hand Automag still firing when out of ammo dual wielding. - Corrected name clash between two explosion sounds. - Fixed suits still protecting from elemental damage when depleted. - Add option to wear all suits simultaneously. - Stunner now consumes Stinger ammo to recharge, this is more in line with the Unreal Bible. - Max damage per explosion capped to 100 for Stinger. Prevents ludicrous map-clearing explosions with an amplified asmd combo. - Shoot-through lines can now be activated by hitscan/beam weapons thanks to new DT "bullet trail" feature. No more softlocks in custom maps. - Added option to make Peacemaker missiles not seek owner and allies. - Peacemaker missiles start seeking targets much earlier, making it more viable indoors. - Autocannon has had its damage increased again. - Adjusted swingers for many weapons to feel a bit more natural. Still far from perfect. - Reverted changes to Flamethrower projectile density, and simply made it have less dynamic lights. - Adjustments to armors. Suit elemental resistances now take priority (as intended). [please redownload your DT devbuild for full effect] - Added ring effect for 6-rocket tight wad. Completely forgot this was a thing. - Fixed flashlight not clearing its dynlights when depleted and still having copies. --- GunLore.md | 10 +++---- cvarinfo.txt | 5 ++++ language.txt | 4 +++ menudef.txt | 2 ++ sndinfo.txt | 2 +- sounds/{expl2.ogg => cexpl2.ogg} | Bin zscript/asmd.zsc | 3 +++ zscript/automag.zsc | 8 +++--- zscript/betamag.zsc | 9 ++++--- zscript/biggun.zsc | 31 ++++++++++++++++------ zscript/bonesaw.zsc | 4 +-- zscript/dispersionpistol.zsc | 12 ++++----- zscript/flamegun.zsc | 2 +- zscript/gatling.zsc | 6 ++--- zscript/impaler.zsc | 8 ++++++ zscript/miscitems.zsc | 18 ++++++++++++- zscript/napalm.zsc | 16 +++++------ zscript/olsmp.zsc | 1 + zscript/peacemaker.zsc | 3 +++ zscript/quadshot.zsc | 22 ++++++++++++---- zscript/rifle.zsc | 4 ++- zscript/stinger.zsc | 2 +- zscript/stunner.zsc | 13 ++++++++- zscript/uarmoritems.zsc | 44 ++++++++++++++++++------------- zscript/ueightball.zsc | 36 +++++++++++++++++++++++++ zscript/uminigun.zsc | 8 +++--- zscript/unrealcommon.zsc | 10 +++++-- zscript/upowerups.zsc | 11 +++++--- zscript/utranslocator.zsc | 2 ++ 29 files changed, 220 insertions(+), 76 deletions(-) rename sounds/{expl2.ogg => cexpl2.ogg} (100%) diff --git a/GunLore.md b/GunLore.md index 2466e28..891bc21 100644 --- a/GunLore.md +++ b/GunLore.md @@ -42,9 +42,9 @@ this the weapon will need a short time to load up ammunition again. ### Extended behaviour -With each shot, targets will be pumped with highly volatile Tarydium, and can -be detonated with fire from other weapons, or sufficient kinetic force (e.g. -making them fall from a considerable height). +With each shot, targets will be pumped with highly volatile Tarydium, resulting +in a thundering blast of sheer energy when hit with fire from other weapons, or +sufficient kinetic force (e.g. making them fall from a considerable height). ## ASMD @@ -169,8 +169,8 @@ complete opposite effect, causing targets to instead be pulled towards you. Since the charge rod rapidly extends on shoot, both fire modes additionally deal considerable melee damage to anything that's too close. -Its energy supply regenerates much quicker than the Dispersion Pistol, thanks -to superior Skaarj engineering. +Its energy supply will regenerate quickly, as long as you have plenty of +Tarydium Shards in your inventory. ## Razorclaw diff --git a/cvarinfo.txt b/cvarinfo.txt index 8019032..14bb4cf 100644 --- a/cvarinfo.txt +++ b/cvarinfo.txt @@ -91,3 +91,8 @@ server bool sting_flametspread = false; // targets on fire spread the flames server bool sting_impself = false; // disable impaler beam self-hit user bool sting_zoomshader = true; // rifle scope shader server bool sting_proto = true; // allow prototype content +server bool sting_allsuits = false; // allow the player to wear all three + // types of suits simultaneously + // (this is very unbalanced) +server bool sting_peacehome = false; // peacemaker doesn't home in on owner + // or friendlies diff --git a/language.txt b/language.txt index 0edb3fb..d208a99 100644 --- a/language.txt +++ b/language.txt @@ -255,6 +255,8 @@ STING_RAZORAIM = "Razorjack altfire follows the crosshair"; STING_BIOSPLASH = "Biorifle altfire splashes like in UT"; STING_FLAMETSPREAD = "Flamethrower fire spreads between targets"; STING_IMPSELF = "Impaler beam cannot hurt user"; +STING_ALLSUITS = "Can wear all suits simultaneously"; +STING_PEACEHOME = "Peacemaker missiles ignore owner and allies"; STING_MCREDS = "Unreal Credits"; STING_CDR = "Doomreal"; STING_CLEAD = "Development Lead:"; @@ -499,6 +501,8 @@ STING_RAZORAIM = "El fuego alt. del Razorjack sigue el punto de mira"; STING_BIOSPLASH = "El fuego alt. del Biorifle salpica como en UT"; STING_FLAMETSPREAD = "El fuego del Lanzallamas se propaga entre objetivos"; STING_IMPSELF = "El haz del Empalador no daña al usuario"; +STING_ALLSUITS = "Permitir uso de todos los trajes al mismo tiempo"; +STING_PEACEHOME = "Los misiles Peacemaker ignoran al usuario y aliados"; STING_MCREDS = "Créditos de Unreal"; STING_CDR = "Doomreal"; STING_CLEAD = "Desarrolladora Jefe:"; diff --git a/menudef.txt b/menudef.txt index 13c3ae6..fd0546b 100644 --- a/menudef.txt +++ b/menudef.txt @@ -55,6 +55,8 @@ OptionMenu "UnrealOptionMenu" Option "$STING_BIOSPLASH", "sting_biosplash", "YesNo" Option "$STING_FLAMETSPREAD", "sting_flametspread", "YesNo", "sting_proto" Option "$STING_IMPSELF", "sting_impself", "YesNo", "sting_proto" + Option "$STING_ALLSUITS", "sting_allsuits", "YesNo" + Option "$STING_PEACEHOME", "sting_peacehome", "YesNo" } AddOptionMenu "OptionsMenu" diff --git a/sndinfo.txt b/sndinfo.txt index 55ff443..ca233c2 100644 --- a/sndinfo.txt +++ b/sndinfo.txt @@ -323,7 +323,7 @@ flamegun/fire flamgfir flamegun/end flamgend flamegun/charge flamgabg flamegun/alt flamgalt -flamegun/exp expl2 +flamegun/exp cexpl2 $limit flamegun/exp 16 flamegun/exp2 expl04 diff --git a/sounds/expl2.ogg b/sounds/cexpl2.ogg similarity index 100% rename from sounds/expl2.ogg rename to sounds/cexpl2.ogg diff --git a/zscript/asmd.zsc b/zscript/asmd.zsc index cd68ec0..59f567b 100644 --- a/zscript/asmd.zsc +++ b/zscript/asmd.zsc @@ -513,7 +513,10 @@ Class ASMDBeam : Actor if ( isFrozen() || !moving ) return; // step trace tracedir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch)); + t.ShootThroughList.Clear(); t.Trace(pos,cursector,tracedir,1000,0); + for ( int i=0; i 0) ) player.SetPSprite(PSP_WEAPON,ResolveState("Reload")); - else if ( ((invoker.clipcount < invoker.default.clipcount) || (invoker.slaveclipcount < invoker.default.slaveclipcount)) && (invoker.Ammo1.Amount > 0) ) A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM); - else A_WeaponReady(WRF_ALLOWZOOM); + else if ( ((invoker.clipcount < invoker.default.clipcount) || (invoker.slaveclipcount < invoker.default.slaveclipcount)) && (invoker.Ammo1.Amount > 0) ) A_WeaponReady(flags|WRF_ALLOWRELOAD|WRF_ALLOWZOOM); + else A_WeaponReady(flags|WRF_ALLOWZOOM); if ( !invoker.slaveactive && (CountInv("Automag") > 1) ) { invoker.slavespin = invoker.slavereload = invoker.slaverefire = 0; diff --git a/zscript/betamag.zsc b/zscript/betamag.zsc index 4f213be..ecfd7f1 100644 --- a/zscript/betamag.zsc +++ b/zscript/betamag.zsc @@ -238,6 +238,7 @@ Class Betamag : UnrealWeapon Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit(); FLineTraceData d; LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d); + UTBulletTrail.DoTrail(self,origin,dir,10000,int((invoker.Amount+alt)**2)); if ( d.HitType == TRACE_HitActor ) { int dmg = 14; @@ -484,14 +485,14 @@ Class Betamag : UnrealWeapon { A_Overlay(-9999,null); invoker.slavewhip = true; - UTMainHandler.DoSwing(self,(FRandom[Betamag](-0.5,-0.4),FRandom[Betamag](0.2,0.3)),4,0,8,SWING_Spring,5); + UTMainHandler.DoSwing(self,(FRandom[Betamag](-0.5,-0.4),FRandom[Betamag](0.2,0.3)),4,0.3,8,SWING_Spring,5); } AUTW ABCDE 2; AUTW F 0 { if ( self is 'UTPlayer' ) UTPlayer(self).PlayAttacking3(); A_PlaySound("betamag/whip",CHAN_ITEM); - UTMainHandler.DoSwing(self,(FRandom[Betamag](-0.3,-0.2),FRandom[Betamag](-0.8,-0.5)),2,0,8,SWING_Spring,2,0.5); + UTMainHandler.DoSwing(self,(FRandom[Betamag](-0.3,-0.2),FRandom[Betamag](-0.8,-0.5)),7,-1,8,SWING_Spring,2,0.5); } AUTW FGHIJ 2; AUTW K 0 @@ -515,7 +516,7 @@ Class Betamag : UnrealWeapon if ( !((invoker.Ammo1.Amount<=0) && (player.cmd.buttons&(BT_ATTACK|BT_ALTATTACK))) && !(player.cmd.buttons&BT_RELOAD) ) return ResolveState("LeftIdle"); invoker.slavewhip = false; A_Overlay(-9998,null); - UTMainHandler.DoSwing(self,(FRandom[Betamag](0.4,0.5),FRandom[Betamag](0.2,0.3)),4,0,8,SWING_Spring,5); + UTMainHandler.DoSwing(self,(FRandom[Betamag](0.4,0.5),FRandom[Betamag](0.2,0.3)),4,0.3,8,SWING_Spring,5); return ResolveState(null); } 2UTW ABCDE 2; @@ -523,7 +524,7 @@ Class Betamag : UnrealWeapon { if ( self is 'UTPlayer' ) UTPlayer(self).PlayAttacking3(); A_PlaySound("betamag/whip",CHAN_7); - UTMainHandler.DoSwing(self,(FRandom[Betamag](0.2,0.3),FRandom[Betamag](-0.8,-0.5)),2,0,8,SWING_Spring,2,0.5); + UTMainHandler.DoSwing(self,(FRandom[Betamag](0.2,0.3),FRandom[Betamag](-0.8,-0.5)),7,-1,8,SWING_Spring,2,0.5); } 2UTW FGHIJ 2; 2UTW K 0 diff --git a/zscript/biggun.zsc b/zscript/biggun.zsc index 4440610..0f7b877 100644 --- a/zscript/biggun.zsc +++ b/zscript/biggun.zsc @@ -186,6 +186,7 @@ Class HitListEntry Class BigTracer : LineTracer { Actor ignoreme; + Array ShootThroughList; Array hitlist; double penetration; // please don't laugh @@ -213,6 +214,7 @@ Class BigTracer : LineTracer { if ( !Results.HitLine.sidedef[1] || (Results.HitLine.Flags&(Line.ML_BlockHitscan|Line.ML_BlockEverything)) ) return TRACE_Stop; + ShootThroughList.Push(Results.HitLine); return TRACE_Skip; } return TRACE_Stop; @@ -308,7 +310,7 @@ Class BigGun : UnrealWeapon UTMainHandler.DoFlash(self,Color(32,255,128,0),1); A_QuakeEx(2,2,2,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollintensity:0.12); for ( int i=0; i<6; i++ ) - UTMainHandler.DoSwing(self,(FRandom[BigGun](-0.04,-0.2),FRandom[BigGun](-0.2,0.2)),FRandom[BigGun](6,9),FRandom[BigGun](-0.2,0.8),Random[BigGun](2,4),SWING_Spring,Random[BigGun](3,6),FRandom[BigGun](1.5,2.3)); + UTMainHandler.DoSwing(self,(FRandom[BigGun](-0.04,-0.2),FRandom[BigGun](-0.2,0.2)),FRandom[BigGun](6,9),FRandom[BigGun](-2,-3),Random[BigGun](2,4),SWING_Spring,Random[BigGun](3,4),FRandom[BigGun](1.5,2.3)); Vector3 x, y, z, x2, y2, z2; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); vel -= x*(player.onground?9.5:2.5); @@ -321,7 +323,16 @@ Class BigGun : UnrealWeapon invoker.t.ignoreme = self; invoker.t.hitlist.Clear(); invoker.t.penetration = 200.; + invoker.t.ShootThroughList.Clear(); invoker.t.Trace(origin,level.PointInSector(origin.xy),dir,10000.,0); + for ( int i=0; i hitlist; + Array ShootThroughList; override ETraceStatus TraceCallback() { @@ -145,6 +146,7 @@ Class ImpalerBoltTracer : LineTracer { if ( !Results.HitLine.sidedef[1] || (Results.HitLine.Flags&(Line.ML_BlockHitscan|Line.ML_BlockEverything)) ) return TRACE_Stop; + ShootThroughList.Push(Results.HitLine); return TRACE_Skip; } return TRACE_Stop; @@ -167,7 +169,10 @@ Class ImpalerBurstBolt : Actor t.hitlist.Clear(); Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); + t.ShootThroughList.Clear(); t.Trace(pos,CurSector,x,11.125,0); + for ( int i=0; i rad+t.radius) ) continue; - int amt = max(1,int(alpha*5)); + int amt = max(1,int(alpha*10)); OnFire.Apply(t,master,amt); } } @@ -283,7 +283,7 @@ Class UFlame : Actor Speed 20; Radius 4; Height 4; - Alpha 0.4; + Alpha 0.2; Scale 0.1; +NOBLOCKMAP; +NOGRAVITY; @@ -304,7 +304,7 @@ Class UFlame : Actor { A_Flame(); A_SetScale(scale.x*1.01+0.04); - A_FadeOut(0.01); + A_FadeOut(0.005); } Stop; } @@ -886,7 +886,7 @@ Class UFlamethrower : UnrealWeapon Vector3 x, y, z, x2, y2, z2; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),15*x+2.3*y-2.7*z); - //for ( int i=0; i<2; i++ ) + for ( int i=0; i<2; i++ ) { double a = FRandom[FlameT](0,360), s = FRandom[FlameT](0,.05); [x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll); @@ -904,7 +904,7 @@ Class UFlamethrower : UnrealWeapon p.vel = vel*.5+(cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed*FRandom[FlameT](0.3,0.6); p.vel.z -= 3; p.target = self; - //continue; + continue; } p.angle = atan2(dir.y,dir.x); p.pitch = asin(-dir.z); diff --git a/zscript/olsmp.zsc b/zscript/olsmp.zsc index d7d7c48..3876fc2 100644 --- a/zscript/olsmp.zsc +++ b/zscript/olsmp.zsc @@ -165,6 +165,7 @@ Class OLSMP : UnrealWeapon Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit(); FLineTraceData d; LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d); + UTBulletTrail.DoTrail(self,origin,dir,10000,alt?6:4); if ( d.HitType == TRACE_HitActor ) { int dmg = 17; diff --git a/zscript/peacemaker.zsc b/zscript/peacemaker.zsc index 65af97e..8359045 100644 --- a/zscript/peacemaker.zsc +++ b/zscript/peacemaker.zsc @@ -105,6 +105,7 @@ Class PeaceRocket : Actor while ( bi.Next() ) { if ( !bi.Thing || (!bi.Thing.bISMONSTER && !bi.Thing.player) || (bi.Thing.Health <= 0) || (Distance3D(bi.Thing) > 500) || !CheckSight(bi.Thing) ) continue; + if ( sting_peacehome && ((bi.Thing == target) || (target && target.IsFriend(bi.Thing))) ) continue; double dist = Distance3D(bi.Thing); if ( dist > mindist ) break; tracer = bi.Thing; @@ -185,6 +186,8 @@ Class PeaceRocket : Actor A_CheckForTargets(); A_CountDown(); } + // early check + if ( GetAge() == 5 ) A_CheckForTargets(); } Wait; Death: diff --git a/zscript/quadshot.zsc b/zscript/quadshot.zsc index 4dd8b90..4c9db24 100644 --- a/zscript/quadshot.zsc +++ b/zscript/quadshot.zsc @@ -92,6 +92,7 @@ Class QCasing : UCasing Class QuadshotTracer : LineTracer { Actor ignoreme; + Array ShootThroughList; Array hitlist; override ETraceStatus TraceCallback() @@ -123,6 +124,7 @@ Class QuadshotTracer : LineTracer { if ( !Results.HitLine.sidedef[1] || (Results.HitLine.Flags&(Line.ML_BlockHitscan|Line.ML_BlockEverything)) ) return TRACE_Stop; + ShootThroughList.Push(Results.HitLine); return TRACE_Skip; } return TRACE_Stop; @@ -184,8 +186,16 @@ Class QuadShot : UnrealWeapon return ClipOut?-1:ClipCount, -1, (ClipCount<2), false; } - action void ProcessTraceHit( QuadshotTracer t ) + action void ProcessTraceHit( QuadshotTracer t, Vector3 origin, Vector3 dir, int bc = 1 ) { + for ( int i=0; i= MaxAmount ) return; + let sting = Owner.FindInventory("StingerAmmo"); + if ( sting && (sting.Amount > 0) ) + { + sting.Amount--; + Amount++; + } } override bool TryPickup( in out Actor toucher ) { @@ -72,6 +78,7 @@ Class StunLight : PaletteLight Class StunTracer : LineTracer { Actor owner, ignore; + Array ShootThroughList; override ETraceStatus TraceCallback() { @@ -85,6 +92,7 @@ Class StunTracer : LineTracer { if ( !Results.HitLine.sidedef[1] || (Results.HitLine.Flags&(Line.ML_BlockHitscan|Line.ML_BlockEverything)) ) return TRACE_Stop; + ShootThroughList.Push(Results.HitLine); return TRACE_Skip; } return TRACE_Stop; @@ -117,7 +125,10 @@ Class StunProj : Actor } // step trace tracedir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch)); + t.ShootThroughList.Clear(); t.Trace(pos,cursector,tracedir,500,0); + for ( int i=0; i 0) && ((damageType == 'Fire') || (damageType == 'Ice')) ) + newdamage = 0; } override void AttachToOwner( Actor other ) { + Super.AttachToOwner(other); + if ( sting_allsuits ) return; // remove other suits Inventory i = other.FindInventory("ToxinSuit"); if ( i ) other.RemoveInventory(i); i = other.FindInventory("KevlarSuit"); if ( i ) other.RemoveInventory(i); - Super.AttachToOwner(other); } States { @@ -101,14 +102,15 @@ Class ToxinSuit : UnrealArmor Inventory.PickupSound "misc/suit"; Inventory.Icon "I_TSuit"; } - override void AbsorbDamage( int damage, Name damageType, out int newdamage ) + override void ModifyDamage( int damage, Name damageType, out int newdamage, bool passive, Actor inflictor, Actor source, int flags ) { - if ( damageType == 'Slime' ) damage = newdamage = 0; - Super.AbsorbDamage(damage,damageType,newdamage); + if ( passive && (Amount > 0) && ((damageType == 'Slime') || (damageType == 'Poison')) ) + newdamage = 0; } override void AttachToOwner( Actor other ) { Super.AttachToOwner(other); + if ( sting_allsuits ) return; // remove other suits Inventory i = other.FindInventory("AsbestosSuit"); if ( i ) other.RemoveInventory(i); @@ -140,6 +142,7 @@ Class KevlarSuit : UnrealArmor override void AttachToOwner( Actor other ) { Super.AttachToOwner(other); + if ( sting_allsuits ) return; // remove other suits Inventory i = other.FindInventory("AsbestosSuit"); if ( i ) other.RemoveInventory(i); @@ -163,9 +166,13 @@ Class ShieldBelt : UnrealArmor Owner.A_PlaySound("belt/absorb",CHAN_7); UTMainHandler.DoFlash(Owner,Color(80,255,224,0),5); } - int oldamt = amount; Super.AbsorbDamage(damage,damageType,newdamage); - if ( (oldamt > 0) && (amount <= 0) && Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_SHIELDBELT")); + } + override void DepleteOrDestroy() + { + if ( (amount <= 0) && Owner.CheckLocalView() ) + Console.Printf(StringTable.Localize("$D_SHIELDBELT")); + Super.DepleteOrDestroy(); } Default { @@ -202,11 +209,16 @@ Class PowerShield : UnrealArmor Owner.A_PlaySound("belt/absorb",CHAN_7); UTMainHandler.DoFlash(Owner,Color(80,224,0,255),5); gothit = true; + damage = 0; + newdamage = 0; } - int oldamt = amount; - amount = int.max; // blocks all damage - Super.AbsorbDamage(damage,damageType,newdamage); - amount = oldamt; // does not drain here + if ( damage > 0 ) newdamage = ApplyDamageFactors(GetClass(),damageType,damage,damage); + } + override void DepleteOrDestroy() + { + if ( (amount <= 0) && Owner.CheckLocalView() ) + Console.Printf(StringTable.Localize("$D_POWERSHIELD")); + Super.DepleteOrDestroy(); } override void Tick() { @@ -218,11 +230,7 @@ Class PowerShield : UnrealArmor gothit = false; } if ( !(level.maptime%15) && !sting_pshield ) amount--; - if ( amount <= 0 ) - { - if ( Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_POWERSHIELD")); - DepleteOrDestroy(); - } + if ( amount <= 0 ) DepleteOrDestroy(); } Default { diff --git a/zscript/ueightball.zsc b/zscript/ueightball.zsc index 312b590..776af98 100644 --- a/zscript/ueightball.zsc +++ b/zscript/ueightball.zsc @@ -93,6 +93,7 @@ Class URocket : Actor { Vector3 InitialDir, Acceleration; int ticcnt; + bool ringex; Default { Obituary "$O_EIGHTBALL"; @@ -152,6 +153,39 @@ Class URocket : Actor s.vel = pvel; s.scale *= FRandom[Eightball](0.9,2.7); } + if ( !invoker.ringex ) return; + Actor r = Spawn("ASMDSBeamRing",pos); + Vector3 HitNormal = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch)); + if ( BlockingLine ) HitNormal = (-BlockingLine.delta.y,BlockingLine.delta.x,0).unit(); + else if ( BlockingFloor ) + { + // find closest 3d floor for its normal + F3DFloor ff = null; + for ( int i=0; i 0 ) player.SetPSprite(PSP_WEAPON,invoker.FindState("Release")); return ResolveState("Null"); } return ResolveState(null); diff --git a/zscript/unrealcommon.zsc b/zscript/unrealcommon.zsc index e9ae79a..64dfc50 100644 --- a/zscript/unrealcommon.zsc +++ b/zscript/unrealcommon.zsc @@ -663,7 +663,7 @@ Class UnrealInventory : Inventory { Charge -= val; if ( Charge > 0 ) return false; - if ( Amount > 1 ) + if ( Amount >= 1 ) { Amount--; Charge = DefaultCharge; @@ -731,9 +731,15 @@ Class UnrealInventory : Inventory } override void DetachFromOwner() { - Super.DetachFromOwner(); // deactivate bActive = false; + Super.DetachFromOwner(); + } + override void OwnerDied() + { + // deactivate + bActive = false; + Super.OwnerDied(); } override void OnDrop( Actor dropper ) { diff --git a/zscript/upowerups.zsc b/zscript/upowerups.zsc index 784d42b..44644fd 100644 --- a/zscript/upowerups.zsc +++ b/zscript/upowerups.zsc @@ -46,10 +46,15 @@ Class UInvisibility : UnrealInventory DepleteOrDestroy(); } } - override void OnDrop( Actor dropper ) + override void DetachFromOwner() { - Super.OnDrop(dropper); - dropper.TakeInventory("PowerUInvisibility",1); + Owner.TakeInventory("PowerUInvisibility",1); + Super.DetachFromOwner(); + } + override void OwnerDied() + { + Owner.TakeInventory("PowerUInvisibility",1); + Super.OwnerDied(); } override void PostBeginPlay() { diff --git a/zscript/utranslocator.zsc b/zscript/utranslocator.zsc index 48eb2ab..1a1105e 100644 --- a/zscript/utranslocator.zsc +++ b/zscript/utranslocator.zsc @@ -120,6 +120,8 @@ Class UTranslocatorModule : Actor { SetOrigin(tracer.Vec2OffsetZ(0,0,pos.z),false); vel.xy *= 0; + tracer = null; + bHITTRACER = false; } } Stop;