diff --git a/Readme.md b/Readme.md index 8b5f600..1ef20f7 100644 --- a/Readme.md +++ b/Readme.md @@ -8,6 +8,7 @@ Doom Tournament (currently the devel branch is required). ## Currently Implemented + - Dispersion Pistol (slot 1) (replaces fist) - Automag (slot 2) (replaces pistol) - Dual Automags - Stinger (slot 3) (replaces shotguns) @@ -37,7 +38,6 @@ Doom Tournament (currently the devel branch is required). ## In progress - Flak Cannon (slot 6) (replaces rocket launcher) - - Dispersion Pistol (slot 1) (replaces fist) - Flashlight (replaces light amplifier) - Searchlight (must be placed manually for balance reasons) @@ -71,6 +71,7 @@ Doom Tournament (currently the devel branch is required). - Autocannon (slot 0) (replaces bfg9000) - Motion Detector (replaces computer map) + - Light & Dark Flares - Minigun Sentry (rare spawn in backpacks) ## Known bugs diff --git a/gldefs.txt b/gldefs.txt index d876130..f83a276 100644 --- a/gldefs.txt +++ b/gldefs.txt @@ -186,6 +186,62 @@ Object FlareThrownX frame "FLAR" { light "FLARELIGHT" } } +FlickerLight2 DAMMOLIGHT1 +{ + Color 0.2 0.2 1.0 + Size 72 + SecondarySize 80 + Interval 0.1 +} +FlickerLight2 DAMMOLIGHT2 +{ + Color 0.2 1.0 0.2 + Size 72 + SecondarySize 80 + Interval 0.1 +} +FlickerLight2 DAMMOLIGHT3 +{ + Color 1.0 1.0 0.2 + Size 72 + SecondarySize 80 + Interval 0.1 +} +FlickerLight2 DAMMOLIGHT4 +{ + Color 1.0 0.6 0.2 + Size 72 + SecondarySize 80 + Interval 0.1 +} +FlickerLight2 DAMMOLIGHT5 +{ + Color 1.0 0.2 0.2 + Size 72 + SecondarySize 80 + Interval 0.1 +} +Object DispersionAmmo +{ + Frame "DISM" { light "DAMMOLIGHT1" } +} +Object DAmmo2 +{ + Frame "DISM" { light "DAMMOLIGHT2" } +} +Object DAmmo3 +{ + Frame "DISM" { light "DAMMOLIGHT3" } +} +Object DAmmo4 +{ + Frame "DISM" { light "DAMMOLIGHT4" } +} +Object DAmmo5 +{ + Frame "DISM" { light "DAMMOLIGHT5" } +} + // Shaders / Brightmaps HardwareShader Texture "graphics/MenuBarr.png" { diff --git a/language.txt b/language.txt index 5ee67b2..ac3ecc8 100644 --- a/language.txt +++ b/language.txt @@ -1,4 +1,14 @@ [default eng enc ena enz eni ens enj enb enl ent enw] +/* DamNums support */ +DAMNUM_TYPECOLOR_DAMMO1 = "DamBlue"; +DAMNUM_TYPECOLOR_DAMMO2 = "DamGreen"; +DAMNUM_TYPECOLOR_DAMMO3 = "DamYellow"; +DAMNUM_TYPECOLOR_DAMMO4 = "DamOrange"; +DAMNUM_TYPECOLOR_DAMMO5 = "DamRed"; +DAMNUM_TYPECOLOR_STINGER = "DamTeal"; +DAMNUM_TYPECOLOR_EXPLODED = "DamGold"; +DAMNUM_TYPECOLOR_STUNNED = "DamLightBlue"; +DAMNUM_TYPECOLOR_IMPALER = "DamMagenta"; /* Obituaries */ O_DPISTOL = "%o was killed by %k's Dispersion Pistol. What a loser!"; O_AUTOMAG = "%o got gatted by %k's Automag."; diff --git a/menudef.txt b/menudef.txt index b66fd6a..4302f94 100644 --- a/menudef.txt +++ b/menudef.txt @@ -25,7 +25,7 @@ OptionMenu "UnrealOptionMenu" StaticText "$STING_POPTS", "Gold" Option "$STING_TELEHAND", "sting_telegun", "YesNo" Option "$STING_FLARES", "sting_flares", "YesNo" - Command "$FLAK_APPLY", "event refreshtrans" + Command "$FLAK_APPLY", "netevent refreshtrans" Option "$STING_STINGER", "sting_stinger", "YesNo" Option "$STING_RIFLE", "sting_rifle", "YesNo" Option "$STING_RIFLEL", "sting_riflel", "YesNo" diff --git a/modeldef.dpistol b/modeldef.dpistol index 14f467a..2a62326 100644 --- a/modeldef.dpistol +++ b/modeldef.dpistol @@ -40,6 +40,187 @@ Model "WeaponPowerUpX" FrameIndex WPOW T 0 19 } +Model "DispersionAmmo" +{ + Path "models" + Model 0 "DispM1_d.3d" + Scale 0.3 0.18 0.096 + Offset 8 0 0 + AngleOffset 90 + + PITCHFROMMOMENTUM + DONTCULLBACKFACES + + SurfaceSkin 0 0 "sprites/dpistol/DETBA0.png" + SurfaceSkin 0 1 "ArcB1.png" + FrameIndex DISM A 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETBB0.png" + SurfaceSkin 0 1 "ArcB2.png" + FrameIndex DISM B 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETBC0.png" + SurfaceSkin 0 1 "ArcB3.png" + FrameIndex DISM C 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETBD0.png" + SurfaceSkin 0 1 "ArcB4.png" + FrameIndex DISM D 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETBE0.png" + SurfaceSkin 0 1 "ArcB5.png" + FrameIndex DISM E 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETBD0.png" + SurfaceSkin 0 1 "ArcB6.png" + FrameIndex DISM F 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETBC0.png" + SurfaceSkin 0 1 "ArcB7.png" + FrameIndex DISM G 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETBB0.png" + SurfaceSkin 0 1 "ArcB8.png" + FrameIndex DISM H 0 0 +} +Model "DAmmo2" +{ + Path "models" + Model 0 "DispM1_d.3d" + Scale 0.3 0.18 0.096 + Offset 8 0 0 + AngleOffset 90 + + PITCHFROMMOMENTUM + DONTCULLBACKFACES + + SurfaceSkin 0 0 "sprites/dpistol/DETGA0.png" + SurfaceSkin 0 1 "ArcG1.png" + FrameIndex DISM A 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETGB0.png" + SurfaceSkin 0 1 "ArcG2.png" + FrameIndex DISM B 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETGC0.png" + SurfaceSkin 0 1 "ArcG3.png" + FrameIndex DISM C 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETGD0.png" + SurfaceSkin 0 1 "ArcG4.png" + FrameIndex DISM D 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETGE0.png" + SurfaceSkin 0 1 "ArcG5.png" + FrameIndex DISM E 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETGD0.png" + SurfaceSkin 0 1 "ArcG6.png" + FrameIndex DISM F 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETGC0.png" + SurfaceSkin 0 1 "ArcG7.png" + FrameIndex DISM G 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETGB0.png" + SurfaceSkin 0 1 "ArcG8.png" + FrameIndex DISM H 0 0 +} +Model "DAmmo3" +{ + Path "models" + Model 0 "DispM1_d.3d" + Scale 0.3 0.18 0.096 + Offset 8 0 0 + AngleOffset 90 + + PITCHFROMMOMENTUM + DONTCULLBACKFACES + + SurfaceSkin 0 0 "sprites/dpistol/DETYA0.png" + SurfaceSkin 0 1 "ArcY1.png" + FrameIndex DISM A 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETYB0.png" + SurfaceSkin 0 1 "ArcY2.png" + FrameIndex DISM B 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETYC0.png" + SurfaceSkin 0 1 "ArcY3.png" + FrameIndex DISM C 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETYD0.png" + SurfaceSkin 0 1 "ArcY4.png" + FrameIndex DISM D 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETYE0.png" + SurfaceSkin 0 1 "ArcY5.png" + FrameIndex DISM E 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETYD0.png" + SurfaceSkin 0 1 "ArcY6.png" + FrameIndex DISM F 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETYC0.png" + SurfaceSkin 0 1 "ArcY7.png" + FrameIndex DISM G 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETYB0.png" + SurfaceSkin 0 1 "ArcY8.png" + FrameIndex DISM H 0 0 +} +Model "DAmmo4" +{ + Path "models" + Model 0 "DispM1_d.3d" + Scale 0.3 0.18 0.096 + Offset 8 0 0 + AngleOffset 90 + + PITCHFROMMOMENTUM + DONTCULLBACKFACES + + SurfaceSkin 0 0 "sprites/dpistol/DETOA0.png" + SurfaceSkin 0 1 "ArcO1.png" + FrameIndex DISM A 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETOB0.png" + SurfaceSkin 0 1 "ArcO2.png" + FrameIndex DISM B 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETOC0.png" + SurfaceSkin 0 1 "ArcO3.png" + FrameIndex DISM C 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETOD0.png" + SurfaceSkin 0 1 "ArcO4.png" + FrameIndex DISM D 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETOE0.png" + SurfaceSkin 0 1 "ArcO5.png" + FrameIndex DISM E 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETOD0.png" + SurfaceSkin 0 1 "ArcO6.png" + FrameIndex DISM F 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETOC0.png" + SurfaceSkin 0 1 "ArcO7.png" + FrameIndex DISM G 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETOB0.png" + SurfaceSkin 0 1 "ArcO8.png" + FrameIndex DISM H 0 0 +} +Model "DAmmo5" +{ + Path "models" + Model 0 "DispM1_d.3d" + Scale 0.3 0.18 0.096 + Offset 8 0 0 + AngleOffset 90 + + PITCHFROMMOMENTUM + DONTCULLBACKFACES + + SurfaceSkin 0 0 "sprites/dpistol/DETRA0.png" + SurfaceSkin 0 1 "ArcR1.png" + FrameIndex DISM A 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETRB0.png" + SurfaceSkin 0 1 "ArcR2.png" + FrameIndex DISM B 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETRC0.png" + SurfaceSkin 0 1 "ArcR3.png" + FrameIndex DISM C 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETRD0.png" + SurfaceSkin 0 1 "ArcR4.png" + FrameIndex DISM D 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETRE0.png" + SurfaceSkin 0 1 "ArcR5.png" + FrameIndex DISM E 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETRD0.png" + SurfaceSkin 0 1 "ArcR6.png" + FrameIndex DISM F 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETRC0.png" + SurfaceSkin 0 1 "ArcR7.png" + FrameIndex DISM G 0 0 + SurfaceSkin 0 0 "sprites/dpistol/DETRB0.png" + SurfaceSkin 0 1 "ArcR8.png" + FrameIndex DISM H 0 0 +} + Model "DispersionPistol" { Path "models" diff --git a/modeldef.umisc b/modeldef.umisc index 80de2f0..0415fbb 100644 --- a/modeldef.umisc +++ b/modeldef.umisc @@ -381,3 +381,14 @@ Model "FlareThrownX" FrameIndex FLAR A 0 1 } + +Model "UJumpBoots" +{ + Path "models" + Model 0 "lboot_d.3d" + Skin 0 "Jlboot1.png" + Scale 0.06 0.06 0.072 + ZOffset 6 + + FrameIndex JBUT A 0 0 +} diff --git a/models/lboot_a.3d b/models/lboot_a.3d new file mode 100644 index 0000000..4613b69 Binary files /dev/null and b/models/lboot_a.3d differ diff --git a/models/lboot_d.3d b/models/lboot_d.3d new file mode 100644 index 0000000..d84653d Binary files /dev/null and b/models/lboot_d.3d differ diff --git a/sndinfo.txt b/sndinfo.txt index 6d74161..487a4f7 100644 --- a/sndinfo.txt +++ b/sndinfo.txt @@ -135,6 +135,11 @@ u1/metalfootstep2 metwalk2 u1/metalfootstep3 metwalk3 $random u1/metalfootstep { u1/metalfootstep1 u1/metalfootstep2 u1/metalfootstep3 } +u1/bootfootstep1 lbootwk1 +u1/bootfootstep2 lbootwk2 +u1/bootfootstep3 lbootwk3 +$random u1/bootfootstep { u1/bootfootstep1 u1/bootfootstep2 u1/bootfootstep3 } + misc/secret secret misc/i_pkup ammosnd misc/p_pkup genpicks diff --git a/sounds/lbootwk1.ogg b/sounds/lbootwk1.ogg new file mode 100644 index 0000000..aff4930 Binary files /dev/null and b/sounds/lbootwk1.ogg differ diff --git a/sounds/lbootwk2.ogg b/sounds/lbootwk2.ogg new file mode 100644 index 0000000..a145136 Binary files /dev/null and b/sounds/lbootwk2.ogg differ diff --git a/sounds/lbootwk3.ogg b/sounds/lbootwk3.ogg new file mode 100644 index 0000000..8b596ea Binary files /dev/null and b/sounds/lbootwk3.ogg differ diff --git a/trnslate.txt b/trnslate.txt index ec400eb..44a1bf1 100644 --- a/trnslate.txt +++ b/trnslate.txt @@ -1 +1,3 @@ +DamTeal="0:255=%[0,0,0]:[0.30,0.76,1.20]" +DamMagenta="0:255=%[0,0,0]:[1.50,0.30,1.50]" RedIcon="0:255=#[255,0,0]" diff --git a/zscript/asmd.zsc b/zscript/asmd.zsc index ad25266..56ad1cb 100644 --- a/zscript/asmd.zsc +++ b/zscript/asmd.zsc @@ -222,7 +222,6 @@ Class ASMDSpark : Actor +FORCEXYBILLBOARD; +THRUACTORS; +ROLLSPRITE; - +ROLLCENTER; +NOTELEPORT; +DONTSPLASH; +CANBOUNCEWATER; diff --git a/zscript/dispersionpistol.zsc b/zscript/dispersionpistol.zsc index 6228366..2037965 100644 --- a/zscript/dispersionpistol.zsc +++ b/zscript/dispersionpistol.zsc @@ -11,7 +11,7 @@ Class WeaponPowerUp : Inventory override bool TryPickup( in out Actor toucher ) { if ( !toucher.FindInventory("DispersionPistol") ) return false; - let damo = DispersionAmmo(toucher.FindInventory("DispersionAmmo")); + let damo = DefaultAmmo(toucher.FindInventory("DefaultAmmo")); if ( damo ) { damo.BackpackMaxAmount = damo.MaxAmount = min(90,damo.MaxAmount+10); @@ -60,7 +60,7 @@ Class WeaponPowerUpX : ASMDAmmoX } } -Class DispersionAmmo : Ammo +Class DefaultAmmo : Ammo { double rechargephase, rechargespeed; @@ -85,6 +85,361 @@ Class DispersionAmmo : Ammo } } +Class DispExLight1 : PaletteLight +{ + Default + { + Tag "DBlue"; + Args 0,0,0,80; + ReactionTime 25; + } +} +Class DispExLight2 : PaletteLight +{ + Default + { + Tag "DGreen"; + Args 0,0,0,80; + ReactionTime 25; + } +} +Class DispExLight3 : PaletteLight +{ + Default + { + Tag "DYellow"; + Args 0,0,0,80; + ReactionTime 25; + } +} +Class DispExLight4 : PaletteLight +{ + Default + { + Tag "DOrange"; + Args 0,0,0,80; + ReactionTime 25; + } +} +Class DispExLight5 : PaletteLight +{ + Default + { + Tag "DRed"; + Args 0,0,0,80; + ReactionTime 25; + } +} + +Class DispBurst1 : ASMDSpark +{ + States + { + Spawn: + DEFB ABCDEFG 1 Bright + { + A_FadeOut(FRandom[ASMD](0.0,0.3)); + vel *= 0.95; + } + Loop; + } +} +Class DispBurst2 : DispBurst1 +{ + States + { + Spawn: + DEFG ABCDEFG 1 Bright + { + A_FadeOut(FRandom[ASMD](0.0,0.3)); + vel *= 0.95; + } + Loop; + } +} +Class DispBurst3 : DispBurst1 +{ + States + { + Spawn: + DEFY ABCDEFG 1 Bright + { + A_FadeOut(FRandom[ASMD](0.0,0.3)); + vel *= 0.95; + } + Loop; + } +} +Class DispBurst4 : DispBurst1 +{ + States + { + Spawn: + DEFO ABCDEFG 1 Bright + { + A_FadeOut(FRandom[ASMD](0.0,0.3)); + vel *= 0.95; + } + Loop; + } +} +Class DispBurst5 : DispBurst1 +{ + States + { + Spawn: + DEFR ABCDEFG 1 Bright + { + A_FadeOut(FRandom[ASMD](0.0,0.3)); + vel *= 0.95; + } + Loop; + } +} +Class ViewDispBurst1 : ViewASMDSpark +{ + States + { + Spawn: + DEFB ABCDEFG 1 Bright A_FadeOut(FRandom[ASMD](0.0,0.3)); + Loop; + } +} +Class ViewDispBurst2 : ViewDispBurst1 +{ + States + { + Spawn: + DEFG ABCDEFG 1 Bright A_FadeOut(FRandom[ASMD](0.0,0.3)); + Loop; + } +} +Class ViewDispBurst3 : ViewDispBurst1 +{ + States + { + Spawn: + DEFY ABCDEFG 1 Bright A_FadeOut(FRandom[ASMD](0.0,0.3)); + Loop; + } +} +Class ViewDispBurst4 : ViewDispBurst1 +{ + States + { + Spawn: + DEFO ABCDEFG 1 Bright A_FadeOut(FRandom[ASMD](0.0,0.3)); + Loop; + } +} +Class ViewDispBurst5 : ViewDispBurst1 +{ + States + { + Spawn: + DEFR ABCDEFG 1 Bright A_FadeOut(FRandom[ASMD](0.0,0.3)); + Loop; + } +} + +Class DispExplo1 : Actor +{ + Default + { + RenderStyle "Add"; + Scale 0.4; + +NOGRAVITY; + +NOBLOCKMAP; + Radius 0.1; + Height 0; + } + override void PostBeginPlay() + { + Super.PostBeginPlay(); + Scale.x *= RandomPick[DPistol](-1,1); + Scale.y *= RandomPick[DPistol](-1,1); + } + States + { + Spawn: + DSEB ABCDEFGHIJ 2 Bright; + Stop; + } +} +Class DispExplo2 : DispExplo1 +{ + States + { + Spawn: + DISE ABCDEFGHIJ 2 Bright; + Stop; + } +} +Class DispExplo3 : DispExplo1 +{ + States + { + Spawn: + DSEY ABCDEFGHIJ 2 Bright; + Stop; + } +} +Class DispExplo4 : DispExplo1 +{ + States + { + Spawn: + DSEO ABCDEFGHIJ 2 Bright; + Stop; + } +} +Class DispExplo5 : DispExplo1 +{ + States + { + Spawn: + DSER ABCDEFGHIJ 2 Bright; + Stop; + } +} + +// yes this is the projectile class name, blame Epic +Class DispersionAmmo : Actor +{ + Class LightClass, BurstClass, ExploClass; + double mult; + + Property LightClass : LightClass; + Property BurstClass : BurstClass; + Property ExploClass : ExploClass; + + action void A_DispTrail() + { + Vector3 x, y, z, dir; + double a, s; + Actor p; + [x,y,z] = dt_CoordUtil.GetAxes(pitch,angle,roll); + for ( int i=0; i<3; i++ ) + { + a = FRandom[DPistol](0,360); + s = FRandom[ASMD](0,0.35); + dir = (-x+y*cos(a)*s+z*sin(a)*s).unit(); + p = Spawn(invoker.BurstClass,level.Vec3Offset(pos,scale.x*(dir*16.+x*32.))); + p.A_SetScale(0.1*min(0.8+invoker.mult*0.75,1.5)); + p.vel = vel*0.5+dir*FRandom[DPistol](3,8); + } + } + action void A_DispExpl() + { + UTMainHandler.DoKnockback(tracer,(cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch)),6000); + A_AlertMonsters(); + A_SprayDecal("RazorBlast",20); + Spawn(invoker.LightClass,pos); + Actor a; + double ang, pt; + int numpt = int(Random[DPistol](12,18)*invoker.mult); + for ( int i=0; i proj, part; + int ulevel = invoker.upgradelevel; + if ( !(sv_infiniteammo || FindInventory('PowerInfiniteAmmo',true)) ) + { + if ( weap.Ammo1.Amount < max(10,invoker.MainUse) ) + { + weap.Ammo1.Amount -= 1; + ulevel = 0; + } + else weap.Ammo1.Amount -= invoker.MainUse; + } + switch ( ulevel ) { case 0: + proj = "DispersionAmmo"; + part = "ViewDispBurst1"; UTMainHandler.DoFlash(self,Color(80,96,64,255),1); A_Overlay(PSP_FLASH,"Flash1"); break; case 1: + proj = "DAmmo2"; + part = "ViewDispBurst2"; UTMainHandler.DoFlash(self,Color(80,64,255,96),1); A_Overlay(PSP_FLASH,"Flash2"); break; case 2: + proj = "DAmmo3"; + part = "ViewDispBurst3"; UTMainHandler.DoFlash(self,Color(80,255,255,96),1); A_Overlay(PSP_FLASH,"Flash3"); break; case 3: + proj = "DAmmo4"; + part = "ViewDispBurst4"; UTMainHandler.DoFlash(self,Color(80,255,160,64),1); A_Overlay(PSP_FLASH,"Flash4"); break; default: + proj = "DAmmo5"; + part = "ViewDispBurst5"; UTMainHandler.DoFlash(self,Color(80,255,96,64),1); A_Overlay(PSP_FLASH,"Flash5"); break; @@ -172,6 +549,23 @@ Class DispersionPistol : UnrealWeapon UTMainHandler.DoSwing(self,(FRandom[DPistol](-0.1,-0.3),FRandom[DPistol](-0.1,0.3)),2,-0.3,3,SWING_Spring,0,3); if ( !Dampener.Active(self) ) A_AlertMonsters(); A_QuakeEx(2,2,2,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); + Vector3 x, y, z; + [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); + Vector3 origin = (pos.x,pos.y,player.viewz)+10*x+3*y-3*z; + Actor p = Spawn(proj,origin); + 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; + DispersionAmmo(p).mult = mult; + int numpt = Random[DPistol](10,20); + for ( int i=0; i proj, part; switch ( ulevel ) { case 0: + proj = "DispersionAmmo"; + part = "ViewDispBurst1"; UTMainHandler.DoFlash(self,Color(80,96,64,255),1); A_Overlay(PSP_FLASH,"Flash1"); break; case 1: + proj = "DAmmo2"; + part = "ViewDispBurst2"; UTMainHandler.DoFlash(self,Color(80,64,255,96),1); A_Overlay(PSP_FLASH,"Flash2"); break; case 2: + proj = "DAmmo3"; + part = "ViewDispBurst3"; UTMainHandler.DoFlash(self,Color(80,255,255,96),1); A_Overlay(PSP_FLASH,"Flash3"); break; case 3: + proj = "DAmmo4"; + part = "ViewDispBurst4"; UTMainHandler.DoFlash(self,Color(80,255,160,64),1); A_Overlay(PSP_FLASH,"Flash4"); break; default: + proj = "DAmmo5"; + part = "ViewDispBurst5"; UTMainHandler.DoFlash(self,Color(80,255,96,64),1); A_Overlay(PSP_FLASH,"Flash5"); break; @@ -216,12 +621,32 @@ Class DispersionPistol : UnrealWeapon if ( !Dampener.Active(self) ) A_AlertMonsters(); int qs = int(1+invoker.chargesize*0.3); A_QuakeEx(qs,qs,qs,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); + Vector3 x, y, z; + [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); + Vector3 origin = (pos.x,pos.y,player.viewz)+10*x+3*y-3*z; + Actor p = Spawn(proj,origin); + 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; + p.bAMBUSH = true; + double scl = 0.5+invoker.chargesize*0.6; + p.scale *= scl; + DispersionAmmo(p).mult = scl*mult*1.1; + int numpt = Random[DPistol](10,20); + for ( int i=0; i= 5.) ) - return true; + if ( invoker.chargesize >= 5. ) return true; + if ( !(sv_infiniteammo || (FindInventory('PowerInfiniteAmmo',true))) ) + { + if ( weap.Ammo1.Amount < invoker.ChargeUse ) return true; + weap.Ammo1.Amount -= invoker.ChargeUse; + } return false; } - override bool CheckAmmo( int fireMode, bool autoSwitch, bool requireAmmo, int ammocount ) - { - if ( bCharging ) return true; - return Super.CheckAmmo(fireMode,autoSwitch,requireAmmo,ammocount); - } Default { Tag "$T_DPISTOL"; @@ -246,9 +669,9 @@ Class DispersionPistol : UnrealWeapon Weapon.UpSound "dpistol/select"; Weapon.SlotNumber 1; Weapon.SelectionOrder 1; - Weapon.AmmoType "DispersionAmmo"; + Weapon.AmmoType "DefaultAmmo"; Weapon.AmmoUse 1; - Weapon.AmmoType2 "DispersionAmmo"; + Weapon.AmmoType2 "DefaultAmmo"; Weapon.AmmoUse2 1; Weapon.AmmoGive 50; UTWeapon.DropAmmo 25; @@ -294,7 +717,9 @@ Class DispersionPistol : UnrealWeapon TNT1 A 1 { A_CheckReload(); - A_WeaponReady(); + let weap = Weapon(invoker); + if ( weap && weap.Ammo1.Amount > 0 ) A_WeaponReady(); + else A_WeaponReady(WRF_NOFIRE); } Wait; Idle: @@ -423,7 +848,7 @@ Class DispersionPistol : UnrealWeapon #### # 0 { A_Overlay(-9999,"Null"); - invoker.AmmoUse1 = min(6,invoker.upgradelevel+1); + invoker.MainUse = min(6,invoker.upgradelevel+1); if ( invoker.upgradelevel == 0 ) return ResolveState("Idle"); else if ( invoker.upgradelevel == 1 ) return ResolveState("Upgrade1"); else if ( invoker.upgradelevel == 2 ) return ResolveState("Upgrade2"); diff --git a/zscript/miscitems.zsc b/zscript/miscitems.zsc index 34a1ea4..06152e0 100644 --- a/zscript/miscitems.zsc +++ b/zscript/miscitems.zsc @@ -570,8 +570,8 @@ Class FlareThrown : Actor States { Spawn: - FLAR A -1; - Stop; + FLAR A 1 A_JumpIf(ReactionTime<=0,"Death"); + Wait; Bounce: FLAR A 0 { @@ -697,11 +697,24 @@ Class FlareThrownX : Actor } } -Class LightFlare : UnrealInventory +Class BetaFlare : UnrealInventory +{ + Class ThrownClass; + + Property ThrownClass : ThrownClass; + + override bool TryPickup( in out Actor toucher ) + { + if ( !sting_flares ) return false; // not allowed + return Super.TryPickup(toucher); + } +} + +Class LightFlare : BetaFlare { } -Class DarkFlare : UnrealInventory +Class DarkFlare : BetaFlare { } diff --git a/zscript/stinger.zsc b/zscript/stinger.zsc index b372a09..c4f5634 100644 --- a/zscript/stinger.zsc +++ b/zscript/stinger.zsc @@ -152,7 +152,7 @@ Class StingerProjectile : Actor Default { Obituary "$O_STINGER"; - DamageType 'shot'; + DamageType 'Stinger'; DamageFunction Random[Stinger](15,25); Speed 40; Radius 2; diff --git a/zscript/uarmoritems.zsc b/zscript/uarmoritems.zsc index 20ee6f6..f8366f3 100644 --- a/zscript/uarmoritems.zsc +++ b/zscript/uarmoritems.zsc @@ -172,6 +172,7 @@ Class ShieldBelt : UnrealArmor Tag "$T_SHIELDBELT"; +COUNTITEM; +INVENTORY.BIGPOWERUP; + +INVENTORY.ALWAYSPICKUP; Inventory.Amount 100; Inventory.MaxAmount 100; Inventory.InterHubAmount 100; @@ -228,6 +229,7 @@ Class PowerShield : UnrealArmor Tag "$T_POWERSHIELD"; +COUNTITEM; +INVENTORY.BIGPOWERUP; + +INVENTORY.ALWAYSPICKUP; Inventory.Amount 200; Inventory.MaxAmount 200; Inventory.InterHubAmount 200; diff --git a/zscript/unrealcommon.zsc b/zscript/unrealcommon.zsc index e945170..6afb462 100644 --- a/zscript/unrealcommon.zsc +++ b/zscript/unrealcommon.zsc @@ -5,7 +5,7 @@ Class UPlayer : UTPlayer Player.StartItem "Automag"; Player.StartItem "DispersionPistol"; Player.StartItem "UMiniAmmo", 30; - Player.StartItem "DispersionAmmo", 50; + Player.StartItem "DefaultAmmo", 50; } // Have to modify the give cheat to handle UT armor @@ -124,7 +124,7 @@ Class UPlayer : UTPlayer let type = (class)(AllActorClasses[i]); if ( !type ) continue; let def = GetDefaultByType (type); - if ( def.Icon.isValid() && (def.MaxAmount > 1) && + if ( def.Icon.isValid() && ((def.MaxAmount > 1) || (type is 'UnrealInventory')) && !(type is "PuzzleItem") && !(type is "Powerup") && !(type is "Ammo") && !(type is "Armor") ) { // Do not give replaced items unless using "give everything" @@ -177,7 +177,7 @@ Class UPlayer : UTPlayer override void PlayFootstep( double vol ) { let boot = UJumpBoots(FindInventory("UJumpBoots")); - if ( boot && boot.bActive ) A_PlaySound("u1/metalfootstep",CHAN_5,min(1.,vol*2)); + if ( boot ) A_PlaySound("u1/bootfootstep",CHAN_5,min(1.,vol*2)); else A_PlaySound("ut/playerfootstep",CHAN_5,vol); } } @@ -467,6 +467,17 @@ Class UPlayerMale : UPlayer } Class UPlayerMale1 : UPlayerMale { + override void PlayFootstep( double vol ) + { + let boot = UJumpBoots(FindInventory("UJumpBoots")); + if ( boot ) A_PlaySound("u1/bootfootstep",CHAN_5,min(1.,vol*2)); + else + { + double ang = level.time/(20*TICRATE/35.)*360.; + if ( sin(ang) > 0 ) A_PlaySound("u1/metalfootstep",CHAN_5,min(1.,vol*2)); + else A_PlaySound("ut/playerfootstep",CHAN_5,vol); + } + } Default { Player.DisplayName "$N_MALE1"; @@ -541,6 +552,7 @@ Class UnrealInventory : Inventory { Super.AttachToOwner(other); Charge = DefaultCharge; + InterHubAmount = MaxAmount; // it's annoying to set this per-subclass } override bool HandlePickup( Inventory item ) { @@ -560,11 +572,15 @@ Class UnrealInventory : Inventory if ( bDROPPED && (pos.z <= floorz) ) vel.xy *= 0; } + override void DetachFromOwner() + { + Super.DetachFromOwner(); + // deactivate + bActive = false; + } override void OnDrop( Actor dropper ) { Super.OnDrop(dropper); - // deactivate - bActive = false; // drop like weapons Vector2 hofs = RotateVector((dropper.radius,0),dropper.angle); SetOrigin(dropper.Vec3Offset(hofs.x,hofs.y,dropper.height*0.5),false); diff --git a/zscript/unrealhud.zsc b/zscript/unrealhud.zsc index ada40af..378fd00 100644 --- a/zscript/unrealhud.zsc +++ b/zscript/unrealhud.zsc @@ -106,7 +106,7 @@ Class UnrealHUD : BaseStatusBar OldAmmo[15] = "Big083"; OldAmmo[16] = "Smini083"; OldAmmo[17] = "Peace083"; - OldAmmoType[0] = "DispersionAmmo"; + OldAmmoType[0] = "DefaultAmmo"; OldAmmoType[1] = "UMiniAmmo"; OldAmmoType[2] = "StingerAmmo"; OldAmmoType[3] = "AsmdAmmo"; @@ -233,7 +233,7 @@ Class UnrealHUD : BaseStatusBar Screen.DrawTexture(IconBase,false,CurX,CurY,DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true); Screen.DrawTexture(i.Icon,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_TopOffset,0,DTA_LeftOffset,0); } - if ( (i is 'UnrealInventory') && (UnrealInventory(i).DefaultCharge > 0) && (UnrealInventory(i).Charge < UnrealInventory(i).DefaultCharge) ) + if ( (i is 'UnrealInventory') && (UnrealInventory(i).DefaultCharge > 0) ) Screen.DrawTexture(HudLine,false,CurX+2,CurY+29,DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true,DTA_WindowRightF,Min(28.*(UnrealInventory(i).Charge/double(UnrealInventory(i).DefaultCharge)),28.)); else if ( (i is 'UTArmor') && !HudMode ) Screen.DrawTexture(HudLine,false,CurX+2,CurY+29,DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true,DTA_WindowRightF,Min(28.*(i.Amount/double(i.MaxAmount)),28.)); diff --git a/zscript/upowerups.zsc b/zscript/upowerups.zsc index 61c2715..ba347be 100644 --- a/zscript/upowerups.zsc +++ b/zscript/upowerups.zsc @@ -186,6 +186,49 @@ Class AmpSound : Actor Class UJumpBoots : UnrealInventory { + int draincnt; + Default + { + Tag "$T_JUMPBOOTS"; + +COUNTITEM; + +INVENTORY.BIGPOWERUP; + +INVENTORY.ALWAYSPICKUP; + Inventory.MaxAmount 3; + Inventory.Icon "I_Boots"; + Inventory.PickupMessage "$I_JUMPBOOTS"; + Inventory.RespawnTics 1050; + UnrealInventory.Charge 3; + } + override bool Use( bool pickup ) + { + if ( pickup ) return false; + bActive = !bActive; + Owner.A_PlaySound("boot/pickup",CHAN_ITEM); + if ( bActive ) Owner.GiveInventory("PowerJumpBoots_HighJump",1); + else Owner.TakeInventory("PowerJumpBoots_HighJump",1); + return false; + } + override void Tick() + { + Super.Tick(); + if ( !Owner || !Owner.player ) return; + draincnt++; + if ( (draincnt >= 700) || (bActive && (owner.player.jumptics == -1)) ) + { + draincnt = 0; + charge--; + Owner.A_PlaySound("boot/jump",CHAN_BODY); + } + else if ( (charge <= 0) && owner.player.onground ) + { + if ( Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_JUMPBOOTS")); + Amount--; + Owner.TakeInventory("PowerJumpBoots_HighJump",1); + charge = defaultcharge; + bActive = false; + if ( Amount <= 0 ) DepleteOrDestroy(); + } + } override void PostBeginPlay() { Super.PostBeginPlay(); @@ -206,6 +249,23 @@ Class UJumpBoots : UnrealInventory } // TODO replace self with asbestos/toxin suits or scuba } + override void AttachToOwner( Actor Other ) + { + Super.AttachToOwner(Other); + Other.GiveInventory("PowerJumpBoots_IronFeet",1); + } + override void DetachFromOwner() + { + Super.DetachFromOwner(); + Owner.TakeInventory("PowerJumpBoots_HighJump",1); + Owner.TakeInventory("PowerJumpBoots_IronFeet",1); + } + States + { + Spawn: + JBUT A -1; + Stop; + } } Class MotionDetector : UnrealInventory diff --git a/zscript/utranslocator.zsc b/zscript/utranslocator.zsc index d1edbdd..accdf9b 100644 --- a/zscript/utranslocator.zsc +++ b/zscript/utranslocator.zsc @@ -4,4 +4,9 @@ Class UTranslocatorAmmo : Ammo Class UTranslocator : UnrealWeapon { + override bool TryPickup( in out Actor toucher ) + { + if ( !sting_telegun ) return false; // not allowed + return Super.TryPickup(toucher); + } }