diff --git a/Readme.md b/Readme.md index 2ac8e33..b707541 100644 --- a/Readme.md +++ b/Readme.md @@ -37,6 +37,8 @@ Doom Tournament (currently the devel branch is required). - Super Health (replaces soulsphere) - Nali Fruit Seed (replaces health bonus) - Flare (replaces armor bonus) + - Flashlight (replaces light amplifier) + - Searchlight (must be placed manually for balance reasons) ## In progress @@ -46,8 +48,6 @@ Doom Tournament (currently the devel branch is required). - Minigun (slot 0) (replaces chaingun) - SMP 7243 (slot 0) (replaces bfg9000) - - Flashlight (replaces light amplifier) - - Searchlight (must be placed manually for balance reasons) - Jump Boots (replaces radsuit) - SCUBA Gear (replaces radsuit if map has swimmable water) diff --git a/models/OldAutoMag_a.3d b/models/OldAutoMag_a.3d index 492a82c..d80bbcc 100644 Binary files a/models/OldAutoMag_a.3d and b/models/OldAutoMag_a.3d differ diff --git a/models/OldAutoMag_d.3d b/models/OldAutoMag_d.3d index 67ff117..0c7e28c 100644 Binary files a/models/OldAutoMag_d.3d and b/models/OldAutoMag_d.3d differ diff --git a/sndinfo.txt b/sndinfo.txt index 487a4f7..278a448 100644 --- a/sndinfo.txt +++ b/sndinfo.txt @@ -204,6 +204,8 @@ voice/activate voicesnd univis/toggle invisibl +lite/off fshlite2 + automag/select cocking automag/fire shot automag/click click diff --git a/zscript/biggun.zsc b/zscript/biggun.zsc index 6863719..116fd8f 100644 --- a/zscript/biggun.zsc +++ b/zscript/biggun.zsc @@ -49,6 +49,22 @@ Class BigAmmo3 : BigAmmo } } +Class BigBlast : Actor +{ +} + +Class HitListEntry +{ + Actor hitactor; + Vector3 hitlocation, x; +} + +Class BigTracer : LineTracer +{ + Array hitlist; + double penetration; // please don't laugh +} + Class BigGun : UnrealWeapon { Default diff --git a/zscript/flamegun.zsc b/zscript/flamegun.zsc index 931ff41..4177404 100644 --- a/zscript/flamegun.zsc +++ b/zscript/flamegun.zsc @@ -1,3 +1,11 @@ +Class UFireball : Actor +{ +} + +Class UFireball2 : UFireball +{ +} + Class FlameGun : UnrealWeapon { Default diff --git a/zscript/gatling.zsc b/zscript/gatling.zsc index 35caa17..70cbc46 100644 --- a/zscript/gatling.zsc +++ b/zscript/gatling.zsc @@ -10,6 +10,10 @@ Class SMiniAmmo : Ammo } } +Class SMiniBlast : Actor +{ +} + Class SMiniGun : UnrealWeapon { Default diff --git a/zscript/miscitems.zsc b/zscript/miscitems.zsc index 7d5775a..2625577 100644 --- a/zscript/miscitems.zsc +++ b/zscript/miscitems.zsc @@ -269,19 +269,17 @@ Class VoiceBox : UnrealInventory Inventory.MaxAmount 3; UnrealInventory.Charge 600; } - override void Tick() + override void DoEffect() { - Super.Tick(); - if ( bActive ) + Super.DoEffect(); + if ( !bActive ) return; + if ( box ) Charge = box.ReactionTime; + else { - if ( box ) Charge = box.ReactionTime; - else - { - Charge = DefaultCharge; - bActive = false; - Amount--; - if ( Amount <= 0 ) DepleteOrDestroy(); - } + Charge = DefaultCharge; + bActive = false; + Amount--; + if ( Amount <= 0 ) DepleteOrDestroy(); } } override bool Use( bool pickup ) @@ -742,6 +740,18 @@ Class DarkFlare : BetaFlare } } +Class BetaFlareThrown +{ +} + +Class LightFlareThrown : BetaFlareThrown +{ +} + +Class DarkFlareThrown : BetaFlareThrown +{ +} + Class Dampener : UnrealInventory { static bool Active( Actor Owner ) @@ -757,9 +767,9 @@ Class Dampener : UnrealInventory Owner.A_PlaySound(bActive?"dampener/on":"dampener/off",CHAN_ITEM); return false; } - override void Tick() + override void DoEffect() { - Super.Tick(); + Super.DoEffect(); if ( !bActive ) return; if ( DrainCharge(1) ) { @@ -929,9 +939,64 @@ Class ForcefieldEffect : Actor } } +Class UFlashLight1 : DynamicLight +{ + int basecolor[3]; + Default + { + DynamicLight.Type "Point"; + +DynamicLight.SPOT; + +DynamicLight.ATTENUATE; + +DynamicLight.DONTLIGHTSELF; + args 0,0,0,560; + DynamicLight.SpotInnerAngle 3; + DynamicLight.SpotOuterAngle 10; + } + override void Tick() + { + Super.Tick(); + if ( !target || !UnrealInventory(master) ) + { + Destroy(); + return; + } + if ( target.player ) SetOrigin((target.pos.x,target.pos.y,target.player.viewz),true); + else SetOrigin(target.vec3Offset(0,0,target.height*0.75),true); + A_SetAngle(target.angle,SPF_INTERPOLATE); + A_SetPitch(target.pitch,SPF_INTERPOLATE); + args[LIGHT_RED] = int(basecolor[0]*clamp(UnrealInventory(master).charge/1400.,0.,1.)); + args[LIGHT_GREEN] = int(basecolor[1]*clamp(UnrealInventory(master).charge/1400.,0.,1.)); + args[LIGHT_BLUE] = int(basecolor[2]*clamp(UnrealInventory(master).charge/1400.,0.,1.)); + bDORMANT = (target.health <= 0); + if ( Inventory(target) && target.bInvisible ) bDORMANT = true; + // alert monsters hit by the light + if ( GetClass() != "UFlashLight1" ) return; + if ( !bDORMANT && target.player && (target.health > 0) ) + { + BlockThingsIterator bt = BlockThingsIterator.Create(target,args[LIGHT_INTENSITY]); + while ( bt.Next() ) + { + if ( !bt.Thing || (Distance3D(bt.Thing) > args[LIGHT_INTENSITY]) ) continue; + Vector3 aimdir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch)); + Vector3 reldir = Vec3To(bt.Thing).unit(); + if ( (acos(aimdir dot reldir) < SpotOuterAngle+5) && bt.Thing.CheckSight(target) ) bt.Thing.LastHeard = target; + } + } + } +} +Class UFlashLight2 : UFlashLight1 +{ + Default + { + args 0,0,0,600; + DynamicLight.SpotInnerAngle 0; + DynamicLight.SpotOuterAngle 20; + } +} + Class UFlashlight : UnrealInventory { - Actor lt[3]; + UFlashLight1 lt[2]; Default { @@ -941,6 +1006,66 @@ Class UFlashlight : UnrealInventory Inventory.PickupMessage "$I_FLASHLIGHT"; UnrealInventory.Charge 2800; } + virtual void SetupLights() + { + lt[0].basecolor[0] = 255; + lt[0].basecolor[1] = 240; + lt[0].basecolor[2] = 224; + lt[1].basecolor[0] = 128; + lt[1].basecolor[1] = 120; + lt[1].basecolor[2] = 112; + } + override bool Use( bool pickup ) + { + if ( pickup ) return false; + bActive = !bActive; + Owner.A_PlaySound(bActive?"lite/pickup":"lite/off",CHAN_ITEM); + if ( bActive ) + { + if ( !lt[0] ) lt[0] = UFlashLight1(Spawn("UFlashLight1",owner.pos)); + lt[0].target = owner; + lt[0].master = self; + if ( !lt[1] ) lt[1] = UFlashLight1(Spawn("UFlashLight2",owner.pos)); + lt[1].target = owner; + lt[1].master = self; + SetupLights(); + } + else + { + if ( lt[0] ) lt[0].Destroy(); + if ( lt[1] ) lt[1].Destroy(); + } + return false; + } + override void DoEffect() + { + Super.DoEffect(); + if ( !bActive ) return; + if ( DrainCharge(1) ) + { + Owner.A_PlaySound("lite/off",CHAN_ITEM); + if ( Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_FLASHLIGHT")); + if ( Amount <= 0 ) DepleteOrDestroy(); + } + } + override void DetachFromOwner() + { + Super.DetachFromOwner(); + if ( lt[0] ) lt[0].Destroy(); + if ( lt[1] ) lt[1].Destroy(); + } + override void Travelled() + { + Super.Travelled(); + if ( !bActive ) return; + if ( !lt[0] ) lt[0] = UFlashLight1(Spawn("UFlashLight1",owner.pos)); + lt[0].target = owner; + lt[0].master = self; + if ( !lt[1] ) lt[1] = UFlashLight1(Spawn("UFlashLight2",owner.pos)); + lt[1].target = owner; + lt[1].master = self; + SetupLights(); + } States { Spawn: @@ -960,6 +1085,31 @@ Class USearchlight : UFlashlight Inventory.RespawnTics 1050; UnrealInventory.Charge 70000; } + override void DoEffect() + { + Super.DoEffect(); + if ( !bActive ) return; + if ( DrainCharge(1) ) + { + Owner.A_PlaySound("lite/off",CHAN_ITEM); + if ( Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_SEARCHLIGHT")); + if ( Amount <= 0 ) DepleteOrDestroy(); + } + } + override void SetupLights() + { + lt[0].basecolor[0] = 255; + lt[0].basecolor[1] = 224; + lt[0].basecolor[2] = 192; + lt[0].SpotInnerAngle = 20; + lt[0].SpotOuterAngle = 35; + lt[0].args[3] = 750; + lt[1].basecolor[0] = 128; + lt[1].basecolor[1] = 112; + lt[1].basecolor[2] = 96; + lt[1].SpotOuterAngle = 50; + lt[1].args[3] = 780; + } } Class SentryItem : UnrealInventory diff --git a/zscript/napalm.zsc b/zscript/napalm.zsc index 193ace3..8dfa203 100644 --- a/zscript/napalm.zsc +++ b/zscript/napalm.zsc @@ -19,6 +19,14 @@ Class FlameAmmo : Ammo } } +Class UFlame : Actor +{ +} + +Class UNapalm : Actor +{ +} + Class UFlamethrower : UnrealWeapon { Default diff --git a/zscript/peacemaker.zsc b/zscript/peacemaker.zsc index 373c9a9..93c21f0 100644 --- a/zscript/peacemaker.zsc +++ b/zscript/peacemaker.zsc @@ -10,6 +10,14 @@ Class PeaceAmmo : Ammo } } +Class PeaceRocket : Actor +{ +} + +Class PeaceProj : Actor +{ +} + Class Peacemaker : UnrealWeapon { Default diff --git a/zscript/quadshot.zsc b/zscript/quadshot.zsc index 33e9545..eb023e9 100644 --- a/zscript/quadshot.zsc +++ b/zscript/quadshot.zsc @@ -35,6 +35,10 @@ Class UShells2 : UShells } } +Class QCasing : UCasing +{ +} + Class QuadShot : UnrealWeapon { Default diff --git a/zscript/razorjack.zsc b/zscript/razorjack.zsc index f08c686..a7fd4b2 100644 --- a/zscript/razorjack.zsc +++ b/zscript/razorjack.zsc @@ -24,6 +24,14 @@ Class RazorAmmo : Ammo } } +Class RazorBlade : Actor +{ +} + +Class RazorBladeAlt : RazorBlade +{ +} + Class Razorjack : UnrealWeapon { Default diff --git a/zscript/stunner.zsc b/zscript/stunner.zsc index 9555b6f..33149d0 100644 --- a/zscript/stunner.zsc +++ b/zscript/stunner.zsc @@ -23,6 +23,14 @@ Class StunnerAmmo : Ammo } } +Class StunTrail : Actor +{ +} + +Class StunProj : Actor +{ +} + Class Stunner : UnrealWeapon { Default diff --git a/zscript/ubiorifle.zsc b/zscript/ubiorifle.zsc index e682a5d..bd95d45 100644 --- a/zscript/ubiorifle.zsc +++ b/zscript/ubiorifle.zsc @@ -40,6 +40,18 @@ Class UBioAmmo2 : UBioAmmo } } +Class UBioGel : Actor +{ +} + +Class UBioGlob : UBioGel +{ +} + +Class UBioSplash : UBioGel +{ +} + Class UBioRifle : UnrealWeapon { Default diff --git a/zscript/unrealcommon.zsc b/zscript/unrealcommon.zsc index 11ec1ac..b625a15 100644 --- a/zscript/unrealcommon.zsc +++ b/zscript/unrealcommon.zsc @@ -616,14 +616,28 @@ Class UnrealInventory : Inventory override void AttachToOwner( Actor other ) { Super.AttachToOwner(other); - Charge = DefaultCharge; + if ( !Charge ) Charge = DefaultCharge; InterHubAmount = MaxAmount; // it's annoying to set this per-subclass } override bool HandlePickup( Inventory item ) { if ( (item.GetClass() == GetClass()) && ((MaxAmount > 1) || (DefaultCharge > 0)) ) { - if ( MaxAmount > 1 ) Amount = min(MaxAmount,Amount+item.Amount); + if ( MaxAmount > 1 ) + { + if ( UnrealInventory(item).Charge ) // redistribute charge among copies + { + int addcharge = Charge+UnrealInventory(item).Charge; + charge = min(DefaultCharge,addcharge); + // if there's charge to spare, increase amount + if ( addcharge > charge ) + { + Amount = min(MaxAmount,Amount+item.Amount); + charge = addcharge-charge; + } + } + else Amount = min(MaxAmount,Amount+item.Amount); // fully charged new copy, just increase + } else Charge = DefaultCharge; // reset charge item.bPickupGood = true; return true; diff --git a/zscript/upowerups.zsc b/zscript/upowerups.zsc index 2a1742b..32c1abc 100644 --- a/zscript/upowerups.zsc +++ b/zscript/upowerups.zsc @@ -24,9 +24,9 @@ Class UInvisibility : UnrealInventory else Owner.TakeInventory("PowerUInvisibility",1); return false; } - override void Tick() + override void DoEffect() { - Super.Tick(); + Super.DoEffect(); if ( !bActive ) return; if ( special1 == -1 ) { @@ -116,9 +116,9 @@ Class Amplifier : UnrealInventory Owner.A_PlaySound("amplifier/set",CHAN_ITEM); return false; } - override void Tick() + override void DoEffect() { - Super.Tick(); + Super.DoEffect(); if ( bActive && !tracer ) { tracer = Spawn("AmpSound",Owner.pos); @@ -208,9 +208,9 @@ Class UJumpBoots : UnrealInventory else Owner.TakeInventory("PowerJumpBoots_HighJump",1); return false; } - override void Tick() + override void DoEffect() { - Super.Tick(); + Super.DoEffect(); if ( !Owner || !Owner.player ) return; draincnt++; if ( (draincnt >= 700) || (bActive && (owner.player.jumptics == -1)) ) diff --git a/zscript/utranslocator.zsc b/zscript/utranslocator.zsc index b4c83f1..e88b836 100644 --- a/zscript/utranslocator.zsc +++ b/zscript/utranslocator.zsc @@ -18,6 +18,10 @@ Class UTranslocatorAmmo : Ammo } } +Class UTranslocatorModule : Actor +{ +} + Class UTranslocator : UnrealWeapon { override bool TryPickup( in out Actor toucher )