WIP stuff.

- Add ice death frames to Doomreal players.
- Fix invisibility not reactivating on map transition.
- Fix a certain option not graying out when prototype features were disabled.
- Remove Doom Tournament spawner file as it will be used in the merge add-on.
- Fix various weapons not respecting infinite ammo cheats/powerups.
- Add HUD icons for the Razorclaw.
- Add sanity checks to Minigun sentry for potential cases where it dies while shooting and this causes an abort.
- Fix Biorifle altfire damage here too.
- When UT splash is disabled, Biorifle globs increase in size by 1.4x on impact, as originally intended.
- Eightball no longer loads a rocket after being selected and instead tweens to idle, like in the original.
- Flak Cannon altfire has a slower reload, as it was meant to.
- Adjust "give armor" cheat so it plays nicely with the merge add-on.
- Fix 0.83 hud playing the "new weapon" flash for all players.
- Made the 0.83 icon assignments moddable through external lists.
- HUD will still display a weapon icon even if it uses no ammo (e.g.: Razorclaw).
This commit is contained in:
Marisa the Magician 2019-11-27 21:37:22 +01:00
commit 43f18514c2
38 changed files with 325 additions and 343 deletions

View file

@ -561,7 +561,8 @@ Class ASMDBeam : Actor
BeamExplode(mult>1.5);
if ( target )
{
target.TakeInventory('ASMDAmmo',2);
if ( !sv_infiniteammo && !target.FindInventory('PowerInfiniteAmmo',true) )
target.TakeInventory('ASMDAmmo',2);
UTMainHandler.DoSwing(target,(FRandom[ASMD](-0.1,-0.6),FRandom[ASMD](-0.1,0.5)),10,-2,3,SWING_Spring,3,6);
}
let b = t.Results.HitActor.target;

View file

@ -541,7 +541,8 @@ Class Automag : UnrealWeapon
invoker.clipout = false;
let aadd = min(invoker.Ammo1.Amount,invoker.default.clipcount-invoker.clipcount);
invoker.clipcount += aadd;
invoker.Ammo1.Amount -= aadd;
if ( !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true) )
invoker.Ammo1.Amount -= aadd;
A_PlaySound("automag/reload",CHAN_WEAPON,!Dampener.Active(self)?1.:.1);
if ( self is 'UTPlayer' )
UTPlayer(self).PlayReloading();
@ -576,7 +577,8 @@ Class Automag : UnrealWeapon
invoker.slaveclipout = false;
let aadd = min(invoker.Ammo1.Amount,invoker.default.slaveclipcount-invoker.slaveclipcount);
invoker.slaveclipcount += aadd;
invoker.Ammo1.Amount -= aadd;
if ( !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true) )
invoker.Ammo1.Amount -= aadd;
A_PlaySound("automag/reload",CHAN_6,!Dampener.Active(self)?1.:.1);
if ( self is 'UTPlayer' )
UTPlayer(self).PlayReloading();

View file

@ -63,13 +63,10 @@ Class Betamag : UnrealWeapon
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
override bool HandlePickup( Inventory item )
{

View file

@ -51,13 +51,10 @@ Class BigAmmo : Ammo
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
States
{
@ -294,13 +291,10 @@ Class BigGun : UnrealWeapon
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
override int, int, bool, bool GetClipAmount()
{
@ -579,7 +573,8 @@ Class BigGun : UnrealWeapon
invoker.clipout = false;
let aadd = min(invoker.ammo1.amount,invoker.default.clipcount-invoker.clipcount);
invoker.clipcount += aadd;
invoker.Ammo1.Amount -= aadd;
if ( !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true) )
invoker.Ammo1.Amount -= aadd;
A_QuakeEx(1,1,1,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollintensity:0.12);
A_PlaySound("big/reload",CHAN_WEAPON,Dampener.Active(self)?.3:1.);
if ( self is 'UTPlayer' ) UTPlayer(self).PlayReloading();

View file

@ -33,13 +33,10 @@ Class Bonesaw : UnrealWeapon
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
override String GetObituary( Actor victim, Actor inflictor, Name mod, bool playerattack )
{
@ -135,6 +132,7 @@ Class Bonesaw : UnrealWeapon
Default
{
Tag "$T_RAZORCLAW";
Inventory.Icon "I_BSaw";
Inventory.PickupMessage "$I_RAZORCLAW";
Weapon.UpSound "bonesaw/select";
Weapon.SlotNumber 1;

View file

@ -822,9 +822,12 @@ Class DispersionPistol : UnrealWeapon
{
invoker.chargesize = invoker.count = 0.;
let weap = Weapon(invoker);
if ( weap.Ammo1.Amount < max(10,invoker.ChargeUse) )
weap.Ammo1.Amount--;
else weap.Ammo1.Amount -= invoker.ChargeUse;
if ( !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true) )
{
if ( weap.Ammo1.Amount < max(10,invoker.ChargeUse) )
weap.Ammo1.Amount--;
else weap.Ammo1.Amount -= invoker.ChargeUse;
}
invoker.bCharging = true;
// need to make sure player does the repeat fire anim
if ( self is 'UPlayer' )

View file

@ -1,99 +0,0 @@
// These are here for Doom Tournament maps
Class MultiItemSpawner : Actor
{
}
Class Slot1Weapons : MultiItemSpawner
{
}
Class Slot2Weapons : MultiItemSpawner
{
}
Class Slot3Weapons : MultiItemSpawner
{
}
Class Slot4Weapons : MultiItemSpawner
{
}
Class Slot5Weapons : MultiItemSpawner
{
}
Class Slot6Weapons : MultiItemSpawner
{
}
Class Slot7Weapons : MultiItemSpawner
{
}
Class Slot8Weapons : MultiItemSpawner
{
}
Class Slot9Weapons : MultiItemSpawner
{
}
Class Slot0Weapons : MultiItemSpawner
{
}
Class Slot0SWeapons : MultiItemSpawner
{
}
Class Slot2Ammo : MultiItemSpawner
{
}
Class Slot3Ammo : MultiItemSpawner
{
}
Class Slot4Ammo : MultiItemSpawner
{
}
Class Slot5Ammo : MultiItemSpawner
{
}
Class Slot6Ammo : MultiItemSpawner
{
}
Class Slot7Ammo : MultiItemSpawner
{
}
Class Slot8Ammo : MultiItemSpawner
{
}
Class Slot9Ammo : MultiItemSpawner
{
}
Class Slot0Ammo : MultiItemSpawner
{
}
Class Slot0SAmmo : MultiItemSpawner
{
}
// nothing at all
Class UNothing : Actor
{
States
{
Spawn:
TNT1 A 1;
Stop;
}
}

View file

@ -350,13 +350,10 @@ Class FlameGun : UnrealWeapon
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
action void A_FlameGunFire( bool bAlt = false )
{

View file

@ -154,13 +154,10 @@ Class SMiniGun : UnrealWeapon
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
action void A_SMiniFire( bool bAlt = false )
{

View file

@ -45,13 +45,10 @@ Class ImpalerAmmo : Ammo
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
States
{
@ -775,13 +772,10 @@ Class Impaler : UnrealWeapon
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
override int, int, bool, bool GetClipAmount()
{
@ -845,7 +839,8 @@ Class Impaler : UnrealWeapon
invoker.beam.specialf1 = mul;
invoker.beam.specialf1 *= .5+clamp(invoker.clipcount/double(invoker.default.clipcount),.0,.5);
}
invoker.clipcount = max(0,invoker.clipcount-int(mul));
if ( !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true) )
invoker.clipcount = max(0,invoker.clipcount-int(mul));
}
invoker.FireEffect();
UTMainHandler.DoFlash(self,Color(16,255,32,255),3);

View file

@ -1493,6 +1493,7 @@ Class SentryItem : UnrealInventory
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
r.bNeverRespawn = bNeverRespawn;
}
Destroy();
}
@ -1724,7 +1725,7 @@ Class MinigunSentry : Actor
}
bool TargetVisible()
{
if ( !target || (target.Health <= 0) || !CheckSight(target) ) return false;
if ( !master || !target || (target.Health <= 0) || !CheckSight(target) ) return false;
double angledelta = DeltaAngle(master.angle,AngleTo(target));
double pitchdelta = DeltaAngle(master.pitch,_PitchTo(target));
if ( (abs(angledelta) > maxangle) || (abs(pitchdelta) > maxpitch) ) return false;
@ -1742,6 +1743,7 @@ Class MinigunSentry : Actor
}
void A_SentryFaceDir( double dest, statelabel next )
{
if ( !master ) return;
double angledelta = DeltaAngle(angle,master.angle+dest);
double pitchdelta = DeltaAngle(pitch,master.pitch);
if ( max(abs(angledelta),abs(pitchdelta)) < 2 )
@ -1756,6 +1758,7 @@ Class MinigunSentry : Actor
}
void A_SentryAttack()
{
if ( !master ) return;
master.special1 = special1 = max(0,special1-1);
if ( (special1 <= 0) && master.master && master.master.CheckLocalView() ) Console.Printf(StringTable.Localize("$M_SENTRYDRY"));
A_SentryFaceTarget();
@ -1817,7 +1820,7 @@ Class MinigunSentry : Actor
SENT A 0
{
A_PlaySound("sentry/raise");
master.A_AlertMonsters(0,AMF_TARGETEMITTER);
if ( master ) master.A_AlertMonsters(0,AMF_TARGETEMITTER);
}
SENR ABCDEFGHIJKLMNO 3;
Goto Idle;
@ -1863,8 +1866,11 @@ Class MinigunSentry : Actor
SENW A 0
{
A_PlaySound("sentry/wind",looping:true);
master.A_AlertMonsters(0,AMF_TARGETEMITTER);
master.SetStateLabel("Missile");
if ( master )
{
master.A_AlertMonsters(0,AMF_TARGETEMITTER);
master.SetStateLabel("Missile");
}
}
SENW ABCDEFGHIJKLMNOPQR 1 A_SentryFaceTarget();
Goto MissileLoop;
@ -1902,7 +1908,7 @@ Class MinigunSentry : Actor
A_LookEx(LOF_NOSOUNDCHECK|LOF_NOJUMP);
if ( TargetVisible() && (special1>0) ) return ResolveState("MissileLoop");
A_PlaySound("sentry/unwind");
master.SetStateLabel("MissileEnd");
if ( master ) master.SetStateLabel("MissileEnd");
return ResolveState(null);
}
SENU ABCDEFGHIJKLMNOPQR 1 A_SentryFaceTarget();
@ -1914,8 +1920,11 @@ Class MinigunSentry : Actor
SENI A 0
{
A_PlaySound("sentry/raise");
master.A_AlertMonsters(0,AMF_TARGETEMITTER);
master.SetStateLabel("DoPackUp");
if ( master )
{
master.A_AlertMonsters(0,AMF_TARGETEMITTER);
master.SetStateLabel("DoPackUp");
}
}
SENR ONMLKJIHGFEDCBA 3;
Stop;

View file

@ -44,13 +44,10 @@ Class FlameAmmo : Ammo
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
States
{
@ -825,13 +822,10 @@ Class UFlamethrower : UnrealWeapon
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
override int, int, bool, bool GetClipAmount()
{

View file

@ -38,6 +38,7 @@ Class OLSMPAmmo : Ammo
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
@ -110,13 +111,10 @@ Class OLSMP : UnrealWeapon
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
override void PlayUpSound( Actor origin )
{
@ -348,7 +346,8 @@ Class OLSMP : UnrealWeapon
invoker.clipout = false;
let aadd = min(invoker.Ammo1.Amount,invoker.default.clipcount-invoker.clipcount);
invoker.clipcount += aadd;
invoker.Ammo1.Amount -= aadd;
if ( !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true) )
invoker.Ammo1.Amount -= aadd;
A_PlaySound("automag/reload",CHAN_WEAPON,!Dampener.Active(self)?1.:.1,pitch:0.8);
if ( self is 'UTPlayer' )
UTPlayer(self).PlayReloading();

View file

@ -49,13 +49,10 @@ Class UShells : Ammo
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
States
{
@ -172,13 +169,10 @@ Class QuadShot : UnrealWeapon
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
override int, int, bool, bool GetClipAmount()
@ -492,7 +486,7 @@ Class QuadShot : UnrealWeapon
if ( (invoker.clipcount >= 4) || (invoker.heldshells+weap.Ammo1.Amount <= 0) ) continue;
invoker.clipcount++;
if ( invoker.heldshells > 0 ) invoker.heldshells--;
else weap.Ammo1.Amount--;
else if ( !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true) ) weap.Ammo1.Amount--;
}
if ( self is 'UTPlayer' )
UTPlayer(self).PlayReloading();
@ -508,7 +502,7 @@ Class QuadShot : UnrealWeapon
if ( (invoker.clipcount >= 4) || (invoker.heldshells+weap.Ammo1.Amount <= 0) ) continue;
invoker.clipcount++;
if ( invoker.heldshells > 0 ) invoker.heldshells--;
else weap.Ammo1.Amount--;
else if ( !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true) ) weap.Ammo1.Amount--;
}
if ( self is 'UTPlayer' )
UTPlayer(self).PlayReloading();

View file

@ -22,7 +22,8 @@ Class StunnerAmmo : Ammo
let sting = Owner.FindInventory("StingerAmmo");
if ( sting && (sting.Amount > 0) )
{
sting.Amount--;
if ( !sv_infiniteammo && !Owner.FindInventory('PowerInfiniteAmmo',true) )
sting.Amount--;
Amount++;
}
}
@ -328,13 +329,10 @@ Class Stunner : UnrealWeapon
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
override int, int, bool, bool GetClipAmount()
@ -429,7 +427,7 @@ Class Stunner : UnrealWeapon
invoker.count += 1.2/35.;
if ( invoker.count < 0.24 ) return ResolveState(null);
invoker.count = 0;
if ( !(sv_infiniteammo || (FindInventory('PowerInfiniteAmmo',true))) )
if ( !(sv_infiniteammo || FindInventory('PowerInfiniteAmmo',true)) )
{
if ( weap.Ammo1.Amount < 1 )
return ResolveState("Release");

View file

@ -437,8 +437,8 @@ Class UBioGel : Actor
s.args[3] = int(s.args[3]*Scale.x);
invoker.deadtimer = -2;
if ( invoker.atline ) invoker.atline.RemoteActivate(target,invoker.atside,SPAC_Impact,pos);
UTMainHandler.DoBlast(self,Min(175,int(Scale.x*100)),40000*Scale.x);
A_Explode(int(40*Scale.x),Min(175,int(Scale.x*100)));
UTMainHandler.DoBlast(self,int(Scale.x*100),40000*Scale.x);
A_Explode(int(Args[0]*Scale.x),int(Scale.x*100));
A_PlaySound("ges/explode",CHAN_VOICE);
int numpt = Min(300,int(Scale.x*30))+Random[GES](-10,10);
for ( int i=0; i<numpt; i++ )
@ -463,6 +463,7 @@ Class UBioGel : Actor
{
Obituary "$O_BIORIFLE";
DamageType 'Slime';
Args 40;
Radius 3;
Height 3;
Speed 11;
@ -538,6 +539,11 @@ Class UBioGlob : UBioGel
{
int numsplash;
Default
{
Args 75;
}
void SpawnSplash()
{
Vector3 ofs = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
@ -561,6 +567,7 @@ Class UBioGlob : UBioGel
Super.AlignSelf();
if ( !bAMBUSH && (Scale.x > 1) ) numsplash = int(4*Scale.x)-1;
if ( sting_biosplash ) SpawnSplash();
else Scale *= 1.4;
}
override void Tick()
{

View file

@ -556,6 +556,8 @@ Class Eightball : UnrealWeapon
Wait;
Ready:
EBLS ABCDEFGHIJKLMNO 1 A_WeaponReady(WRF_NOFIRE);
EBLS O 8 A_Overlay(-9999,"Dummy");
Goto Idle+1;
Ready2:
EBLS O 0 A_CheckReload();
EBLL A 0 A_PlaySound("utrl/load",CHAN_6,Dampener.Active(self)?.1:1.);

View file

@ -327,6 +327,14 @@ Class UFlakCannon : UnrealWeapon
}
FLKL BCEFGIJKMNO 1;
Goto Idle;
AltLoading:
FLKL A 2
{
A_CheckReload();
if ( invoker.Ammo1.Amount > 0 ) A_Loading();
}
FLKL BCEFGIJKMNO 2;
Goto Idle;
Idle:
FLKI A 1 A_WeaponReady();
Wait;
@ -351,7 +359,7 @@ Class UFlakCannon : UnrealWeapon
FLKA A 1 A_FireSlug();
FLKA BCDEFGHIJK 1;
FLKA K 10;
Goto Loading;
Goto AltLoading;
Deselect:
FLKD A 0 A_JumpIfNoAmmo("Deselect2");
FLKD ABCDEF 1;

View file

@ -137,14 +137,20 @@ Class UPlayer : UTPlayer
}
if ( giveall || (name ~== "armor") )
{
// Doomreal gives the player all subclasses of UnrealArmor
// Doomreal gives the player all subclasses of UTArmor that are not replaced by something
for ( int i=0; i<AllActorClasses.Size(); i++ )
{
if ( !(AllActorClasses[i].GetParentClass() is "UnrealArmor") ) continue;
let item = Inventory(Spawn(AllActorClasses[i]));
item.ClearCounters(); // don't increase item counts
item.Amount = item.MaxAmount;
if ( !item.CallTryPickup(self) ) item.Destroy();
let type = (Class<UTArmor>)(AllActorClasses[i]);
if ( !type ) continue;
let def = GetDefaultByType(type);
if ( !def.Icon.isValid() ) continue;
if ( GetReplacement(type) == type )
{
let item = Inventory(Spawn(type));
item.ClearCounters(); // don't increase item counts
item.Amount = item.MaxAmount;
if ( !item.CallTryPickup(self) ) item.Destroy();
}
}
if ( !giveall ) return;
}
@ -376,7 +382,7 @@ Class UPlayerFemale : UPlayer
Goto Death;
Death.Decapitated:
#### # 0 A_HeadPop();
PLD6 A 3 A_PlayerScream();
PLD6 A 3 A_PlayerScreamDT();
PLD6 B 3 A_NoBlocking();
PLD6 CDEFGHIJ 3;
PLD6 K 1 A_DMFade();
@ -388,42 +394,42 @@ Class UPlayerFemale : UPlayer
#### # 0 A_Jump(256,"Death1","Death3","Death4");
Death1:
#### # 3;
PLD1 A 3 A_PlayerScream();
PLD1 A 3 A_PlayerScreamDT();
PLD1 B 3 A_NoBlocking();
PLD1 CDEFGHIJKLMNOPQRSTU 3;
PLD1 V 1 A_DMFade();
Wait;
Death2:
#### # 3;
PLD2 A 3 A_PlayerScream();
PLD2 A 3 A_PlayerScreamDT();
PLD2 B 3 A_NoBlocking();
PLD2 CDEFGHIJKLMNOPQ 3;
PLD2 R 1 A_DMFade();
Wait;
Death3:
#### # 3;
PLD3 A 3 A_PlayerScream();
PLD3 A 3 A_PlayerScreamDT();
PLD3 B 3 A_NoBlocking();
PLD3 CDEFGHIJKLMNO 3;
PLD3 P 1 A_DMFade();
Wait;
Death4:
#### # 3;
PLD4 A 3 A_PlayerScream();
PLD4 A 3 A_PlayerScreamDT();
PLD4 B 3 A_NoBlocking();
PLD4 CDEFGHIJKL 3;
PLD4 M 1 A_DMFade();
Wait;
Death5:
#### # 3;
PLD5 A 3 A_PlayerScream();
PLD5 A 3 A_PlayerScreamDT();
PLD5 B 3 A_NoBlocking();
PLD5 CDEFGHIJKLMNO 3;
PLD5 P 1 A_DMFade();
Wait;
Death7:
#### # 0 A_ArmPop();
PLD7 A 3 A_PlayerScream();
PLD7 A 3 A_PlayerScreamDT();
PLD7 B 3 A_NoBlocking();
PLD7 CDEFGHIJKLMNOPQRSTUV 3;
PLD7 W 1 A_DMFade();
@ -557,14 +563,14 @@ Class UPlayerMale : UPlayer
#### # 0 A_Jump(256,"Death2","Death3","Death7");
Death5:
#### # 0 A_TorsoPop();
PLD5 A 3 A_PlayerScream();
PLD5 A 3 A_PlayerScreamDT();
PLD5 B 3 A_NoBlocking();
PLD5 CDEFGHIJKLMNOPQRSTUV 3;
PLD5 W 1 A_DMFade();
Wait;
Death6:
#### # 3;
PLD6 A 3 A_PlayerScream();
PLD6 A 3 A_PlayerScreamDT();
PLD6 B 3 A_NoBlocking();
PLD6 CDEFGHIJKLMNOPQRSTUVWXYZ[ 3;
PLD6 \ 1 A_DMFade();
@ -845,11 +851,6 @@ Class UnrealWeapon : UTWeapon
{
origin.A_PlaySound(upsound,CHAN_WEAPON,Dampener.Active(origin)?.1:1.);
}
// For clips
virtual clearscope int, int, bool, bool GetClipAmount() const
{
return -1, -1, false, false;
}
}
Class UnrealStaticHandler : StaticEventHandler
@ -940,6 +941,17 @@ Class AmmoUsedInSlot
bool UsedInSlot[10];
}
// nothing at all
Class UNothing : Actor
{
States
{
Spawn:
TNT1 A 1;
Stop;
}
}
Class UnrealMainHandler : EventHandler
{
Array<AmmoUsedInSlot> AmmoSlots;
@ -1197,32 +1209,35 @@ Class UnrealMainHandler : EventHandler
}
}
else if ( e.Replacee == 'TeleportFog' ) e.Replacement = 'UTeleportFog';
// replace UT items (while this is mainly for the DT map pack, it also has the added effect of preventing the guns from being added by "give all")
// replace UT items (prevents them from being cheated in)
else if ( e.Replacee is 'ImpactHammer' ) e.Replacement = 'DispersionPistol';
else if ( e.Replacee is 'Translocator' ) e.Replacement = 'UTranslocator';
else if ( e.Replacee is 'UTChainsaw' ) e.Replacement = 'Slot1Weapons';
else if ( e.Replacee is 'Enforcer' ) e.Replacement = 'Slot2Weapons';
else if ( e.Replacee is 'BioRifle' ) e.Replacement = 'Slot3Weapons';
else if ( e.Replacee is 'ShockRifle' ) e.Replacement = 'Slot4Weapons';
else if ( e.Replacee is 'PulseGun' ) e.Replacement = 'Slot5Weapons';
else if ( e.Replacee is 'Ripper2' ) e.Replacement = 'Slot6Weapons';
else if ( e.Replacee is 'Minigun' ) e.Replacement = 'Slot7Weapons';
else if ( e.Replacee is 'FlakCannon' ) e.Replacement = 'Slot8Ammo';
else if ( e.Replacee is 'UTRocketLauncher' ) e.Replacement = 'Slot0Weapons';
else if ( e.Replacee is 'SniperRifle' ) e.Replacement = 'Slot0Weapons';
else if ( e.Replacee is 'WarheadLauncher' ) e.Replacement = 'Slot0SWeapons';
else if ( e.Replacee is 'EnhancedShockRifle' ) e.Replacement = 'Amplifier';
else if ( e.Replacee is 'UTChainsaw' ) e.Replacement = 'Bonesaw';
else if ( e.Replacee is 'Enforcer' ) e.Replacement = 'Automag';
else if ( e.Replacee is 'BioRifle' ) e.Replacement = 'UBioRifle';
else if ( e.Replacee is 'ShockRifle' ) e.Replacement = 'ASMD';
else if ( e.Replacee is 'PulseGun' ) e.Replacement = 'Stinger';
else if ( e.Replacee is 'Ripper2' ) e.Replacement = 'Razorjack';
else if ( e.Replacee is 'Minigun' ) e.Replacement = 'UMinigun';
else if ( e.Replacee is 'FlakCannon' ) e.Replacement = 'UFlakCannon';
else if ( e.Replacee is 'UTRocketLauncher' ) e.Replacement = 'Eightball';
else if ( e.Replacee is 'SniperRifle' ) e.Replacement = 'URifle';
else if ( e.Replacee is 'WarheadLauncher' ) e.Replacement = 'UNothing';
else if ( e.Replacee is 'EnhancedShockRifle' ) e.Replacement = 'UNothing';
else if ( e.Replacee is 'ChainsawAmmo' ) e.Replacement = 'UNothing';
else if ( e.Replacee is 'EClip' ) e.Replacement = 'Slot2Ammo';
else if ( e.Replacee is 'BioAmmo' ) e.Replacement = 'Slot3Ammo';
else if ( e.Replacee is 'ShockAmmo' ) e.Replacement = 'Slot4Ammo';
else if ( e.Replacee is 'PulseAmmo' ) e.Replacement = 'Slot5Ammo';
else if ( e.Replacee is 'RipperAmmo' ) e.Replacement = 'Slot6Ammo';
else if ( e.Replacee is 'MiniAmmo' ) e.Replacement = 'Slot7Ammo';
else if ( e.Replacee is 'FlakAmmo' ) e.Replacement = 'Slot8Ammo';
else if ( e.Replacee is 'UTRocketAmmo' ) e.Replacement = 'Slot9Ammo';
else if ( e.Replacee is 'RifleAmmo' ) e.Replacement = 'Slot0Ammo';
else if ( e.Replacee is 'WarheadAmmo' ) e.Replacement = 'Slot0SAmmo';
else if ( e.Replacee is 'EClip' ) e.Replacement = 'UClip';
else if ( e.Replacee is 'BioAmmo2' ) e.Replacement = 'UBioAmmo2';
else if ( e.Replacee is 'BioAmmo' ) e.Replacement = 'UBioAmmo';
else if ( e.Replacee is 'ShockAmmo2' ) e.Replacement = 'ASMDAmmo2';
else if ( e.Replacee is 'ShockAmmo' ) e.Replacement = 'ASMDAmmo';
else if ( e.Replacee is 'PulseAmmo' ) e.Replacement = 'StingerAmmo';
else if ( e.Replacee is 'RipperAmmo' ) e.Replacement = 'RazorAmmo';
else if ( e.Replacee is 'MiniAmmo' ) e.Replacement = 'UMiniAmmo';
else if ( e.Replacee is 'FlakAmmo' ) e.Replacement = 'UFlakBox';
else if ( e.Replacee is 'UTRocketAmmo' ) e.Replacement = 'URocketAmmo';
else if ( e.Replacee is 'RifleAmmo2' ) e.Replacement = 'URifleAmmo2';
else if ( e.Replacee is 'RifleAmmo' ) e.Replacement = 'URifleAmmo';
else if ( e.Replacee is 'WarheadAmmo' ) e.Replacement = 'UNothing';
else if ( e.Replacee is 'EnhancedShockAmmo' ) e.Replacement = 'UNothing';
else if ( e.Replacee is 'UTBackpack' ) e.Replacement = 'UnrealBackpack';
else if ( e.Replacee is 'UDamage' ) e.Replacement = 'Amplifier';
@ -1239,7 +1254,6 @@ Class UnrealMainHandler : EventHandler
else if ( e.Replacee is 'UTHealthPack' ) e.Replacement = 'SuperHealth';
else if ( e.Replacee is 'UTHealthBonus' ) e.Replacement = 'Bandages';
else if ( e.Replacee is 'UTJumpBoots' ) e.Replacement = 'UJumpBoots';
// we don't need these
else if ( e.Replacee is 'UTActivatable' ) e.Replacement = 'UNothing';
else if ( e.Replacee is 'UTActivatableHealth' ) e.Replacement = 'UNothing';
}
@ -1293,7 +1307,7 @@ Class UnrealMainHandler : EventHandler
let t = players[e.player].mo.FindInventory("UTranslator");
if ( t ) t.Use(false);
}
else if ( e.Name ~== "Bar083SlotFlash" )
else if ( (e.Name ~== "Bar083SlotFlash") && (e.player == consoleplayer) )
slotflash[e.Args[0]] = gametic+20;
}
private static bool CmpWeapon( Class<Weapon> a, Class <Weapon> b )

View file

@ -36,10 +36,10 @@ Class UnrealHUD : BaseStatusBar
bool MidPrintLarge;
// 0.83 HUD stuff
String OldAmmo[19];
Class<Inventory> OldAmmoType[19];
String OldArmor[7];
Class<Inventory> OldArmorType[7];
Array<String> OldAmmo;
Array<Class<Inventory> > OldAmmoType;
Array<String> OldArmor;
Array<Class<Inventory> > OldArmorType;
String OldKeys[7];
HUDFont mOldDigits, mOldDigitsSmall;
Font OldLargeFont, OldSmallFont;
@ -89,59 +89,43 @@ Class UnrealHUD : BaseStatusBar
mMapFont = HUDFont.Create(WhiteFont);
OldLargeFont = Font.GetFont('UOldLargeFont');
OldSmallFont = Font.GetFont('UOldSmallFont');
// arranged so weapon-specific icons are checked first
OldAmmo[0] = "Mini083";
OldAmmo[1] = "Disp083";
OldAmmo[2] = "Clip083";
OldAmmo[3] = "Tary083";
OldAmmo[4] = "Asmd083";
OldAmmo[5] = "Rokt083";
OldAmmo[6] = "Flak083";
OldAmmo[7] = "Razor083";
OldAmmo[8] = "Bio083";
OldAmmo[9] = "Rifle083";
OldAmmo[10] = "Shell083";
OldAmmo[11] = "Impal083";
OldAmmo[12] = "Flame083";
OldAmmo[13] = "Tele083";
OldAmmo[14] = "Stun083";
OldAmmo[15] = "Big083";
OldAmmo[16] = "Smini083";
OldAmmo[17] = "Peace083";
OldAmmo[18] = "OLSMP083";
OldAmmoType[0] = "UMinigun";
OldAmmoType[1] = "DefaultAmmo";
OldAmmoType[2] = "UMiniAmmo";
OldAmmoType[3] = "StingerAmmo";
OldAmmoType[4] = "AsmdAmmo";
OldAmmoType[5] = "URocketAmmo";
OldAmmoType[6] = "UFlakBox";
OldAmmoType[7] = "RazorAmmo";
OldAmmoType[8] = "UBioAmmo";
OldAmmoType[9] = "URifleAmmo";
OldAmmoType[10] = "UShells";
OldAmmoType[11] = "ImpalerAmmo";
OldAmmoType[12] = "FlameAmmo";
OldAmmoType[13] = "UTranslocatorAmmo";
OldAmmoType[14] = "StunnerAmmo";
OldAmmoType[15] = "BigAmmo";
OldAmmoType[16] = "SMiniAmmo";
OldAmmoType[17] = "PeaceAmmo";
OldAmmoType[18] = "OLSMPAmmo";
OldArmor[0] = "Armor083";
OldArmor[1] = "Kev083";
OldArmor[2] = "Asb083";
OldArmor[3] = "Tox083";
OldArmor[4] = "Belt083";
OldArmor[5] = "Pbelt083";
OldArmor[6] = "Bonus083";
OldArmorType[0] = "UArmor";
OldArmorType[1] = "KevlarSuit";
OldArmorType[2] = "AsbestosSuit";
OldArmorType[3] = "ToxinSuit";
OldArmorType[4] = "ShieldBelt";
OldArmorType[5] = "PowerShield";
OldArmorType[6] = "UArmorBonus";
// load icon lists
Array<String> lst, ent;
String dat;
for ( int lmp = Wads.FindLump("oldammoicons.txt"); lmp > 0; lmp = Wads.FindLump("oldammoicons.txt",lmp+1) )
{
dat = Wads.ReadLump(lmp);
lst.Clear();
dat.Split(lst,"\n",0);
for ( int i=0; i<lst.Size(); i++ )
{
if ( (lst[i].Length() <= 0) || (lst[i].Left(1) ~== "#") ) continue;
ent.Clear();
lst[i].Split(ent,",",0);
if ( ent.Size() != 2 ) continue;
Class<Inventory> i = ent[1];
if ( !i ) continue;
OldAmmo.Push(ent[0]);
OldAmmoType.Push(i);
}
}
for ( int lmp = Wads.FindLump("oldarmoricons.txt"); lmp > 0; lmp = Wads.FindLump("oldarmoricons.txt",lmp+1) )
{
dat = Wads.ReadLump(lmp);
lst.Clear();
dat.Split(lst,"\n",0);
for ( int i=0; i<lst.Size(); i++ )
{
if ( (lst[i].Length() <= 0) || (lst[i].Left(1) ~== "#") ) continue;
ent.Clear();
lst[i].Split(ent,",",0);
if ( ent.Size() != 2 ) continue;
Class<Inventory> i = ent[1];
if ( !i ) continue;
OldArmor.Push(ent[0]);
OldArmorType.Push(i);
}
}
OldKeys[0] = "Redk083";
OldKeys[1] = "Bluek083";
OldKeys[2] = "Goldk083";
@ -476,13 +460,52 @@ Class UnrealHUD : BaseStatusBar
{
CurX = x;
CurY = y;
if ( !CPlayer.ReadyWeapon || !CPlayer.ReadyWeapon.Ammo1 ) return;
Font cfont = LargeFont;
if ( CPlayer.ReadyWeapon.Ammo1.Amount <= min(9,CPlayer.ReadyWeapon.Ammo1.MaxAmount/3) ) cfont = LargeRedFont;
if ( !CPlayer.ReadyWeapon ) return;
int sec = -1, sec2 = -1;
bool red = false, red2 = false;
if ( CPlayer.ReadyWeapon is 'UnrealWeapon' )
[sec, sec2, red, red2] = UnrealWeapon(CPlayer.ReadyWeapon).GetClipAmount();
if ( CPlayer.ReadyWeapon is 'UTWeapon' )
[sec, sec2, red, red2] = UTWeapon(CPlayer.ReadyWeapon).GetClipAmount();
Font cfont = LargeFont;
if ( !CPlayer.ReadyWeapon.Ammo1 )
{
if ( CPlayer.ReadyWeapon.Icon.IsNull() ) return;
if ( !HudMode )
{
double bx = CurX;
CurX = bx-MedFont.StringWidth(String.Format("%d",sec))-2;
CurY += cfont.GetHeight()-MedFont.GetHeight()-4;
if ( sec != -1 )
Screen.DrawText(MedFont,red?Font.CR_RED:Font.CR_UNTRANSLATED,CurX,CurY,String.Format("%d",sec),DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true);
CurX = bx-MedFont.StringWidth(String.Format("%d",sec2))-2;
CurY -= MedFont.GetHeight()+2;
if ( sec2 != -1 )
Screen.DrawText(MedFont,red2?Font.CR_RED:Font.CR_UNTRANSLATED,CurX,CurY,String.Format("%d",sec2),DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true);
}
CurX = x;
CurY = y;
Screen.DrawTexture(IconBase,false,CurX,CurY,DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true);
// scale to fit
Vector2 scl = TexMan.GetScaledSize(CPlayer.ReadyWeapon.Icon);
double mscl = 32./max(scl.x,scl.y);
double dw = (ClipX/mscl), dh = (ClipY/mscl);
double dx = (CurX+(32-scl.x*mscl)/2)/mscl, dy = (CurY+(32-scl.y*mscl)/2)/mscl;
Screen.DrawTexture(CPlayer.ReadyWeapon.Icon,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_TopOffset,0,DTA_LeftOffset,0);
if ( HudMode )
{
CurX = x;
CurY = y;
Screen.DrawTexture(IconBase,false,CurX,CurY,DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true);
CurX = (x+30)-TinyFont.StringWidth(String.Format("%d",sec));
CurY = y+2;
if ( sec != -1 )
Screen.DrawText(red?TinyRedFont:TinyFont,Font.CR_UNTRANSLATED,CurX,CurY,String.Format("%d",sec),DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true);
CurX = x+3;
if ( sec2 != -1 )
Screen.DrawText(red2?TinyRedFont:TinyFont,Font.CR_UNTRANSLATED,CurX,CurY,String.Format("%d",sec2),DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true);
}
return;
}
if ( CPlayer.ReadyWeapon.Ammo1.Amount <= min(9,CPlayer.ReadyWeapon.Ammo1.MaxAmount/3) ) cfont = LargeRedFont;
if ( !HudMode )
{
CurX -= cfont.StringWidth(String.Format("%d",CPlayer.ReadyWeapon.Ammo1.Amount))+2;
@ -712,7 +735,7 @@ Class UnrealHUD : BaseStatusBar
let ba = CPlayer.mo.FindInventory("BasicArmor");
if ( ba ) ArmorAmount += ba.amount;
bool drawnarmor = false;
for ( int i=0; i<6; i++ )
for ( int i=0; i<OldArmor.Size(); i++ )
{
if ( !(BestArmor is OldArmorType[i]) ) continue;
DrawImage(OldArmor[i],(4,340),DI_ITEM_OFFSETS);
@ -724,26 +747,23 @@ Class UnrealHUD : BaseStatusBar
if ( ArmorAmount ) DrawString(mOldDigits,FormatNumber(ArmorAmount,3),(167,366),DI_TEXT_ALIGN_RIGHT);
Inventory Ammo1, Ammo2;
[Ammo1, Ammo2] = GetCurrentAmmo();
if ( Ammo1 )
if ( Ammo1 && Ammo1.Amount ) DrawString(mOldDigits,FormatNumber(Ammo1.Amount,3),(549,366),DI_TEXT_ALIGN_RIGHT);
bool drawn = false;
for ( int i=0; i<OldAmmo.Size(); i++ )
{
if ( Ammo1.Amount ) DrawString(mOldDigits,FormatNumber(Ammo1.Amount,3),(549,366),DI_TEXT_ALIGN_RIGHT);
bool drawn = false;
for ( int i=0; i<19; i++ )
{
// match by ammo
if ( (OldAmmoType[i] is 'Ammo') && !(Ammo1 is OldAmmoType[i]) ) continue;
// match by weapon
if ( (OldAmmoType[i] is 'Weapon') && !(CPlayer.ReadyWeapon is OldAmmoType[i]) ) continue;
DrawImage(OldAmmo[i],(560,336),DI_ITEM_OFFSETS);
drawn = true;
break;
}
if ( !drawn )
DrawInventoryIcon(Ammo1,(600,366),DI_ITEM_CENTER,1.,(-1,-1),(2.,2.));
// match by ammo
if ( (OldAmmoType[i] is 'Ammo') && (!Ammo1 || !(Ammo1 is OldAmmoType[i])) ) continue;
// match by weapon
if ( (OldAmmoType[i] is 'Weapon') && !(CPlayer.ReadyWeapon is OldAmmoType[i]) ) continue;
DrawImage(OldAmmo[i],(560,336),DI_ITEM_OFFSETS);
drawn = true;
break;
}
if ( !drawn && Ammo1 )
DrawInventoryIcon(Ammo1,(600,366),DI_ITEM_CENTER,1.,(-1,-1),(2.,2.));
int sec = -1, sec2 = -1;
if ( CPlayer.ReadyWeapon && (CPlayer.ReadyWeapon is 'UnrealWeapon') )
[sec, sec2] = UnrealWeapon(CPlayer.ReadyWeapon).GetClipAmount();
if ( CPlayer.ReadyWeapon && (CPlayer.ReadyWeapon is 'UTWeapon') )
[sec, sec2] = UTWeapon(CPlayer.ReadyWeapon).GetClipAmount();
if ( sec != -1 )
DrawString(mOldDigitsSmall,FormatNumber(sec,3),(633,378),DI_TEXT_ALIGN_RIGHT);
if ( sec2 != -1 )

View file

@ -56,6 +56,11 @@ Class UInvisibility : UnrealInventory
Owner.TakeInventory("PowerUInvisibility",1);
Super.OwnerDied();
}
override void Travelled()
{
if ( bActive ) Owner.TakeInventory("PowerUInvisibility",1);
Super.Travelled();
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
@ -403,13 +408,10 @@ Class MotionDetector : UnrealInventory
r.target = target;
r.tracer = tracer;
r.bDropped = bDropped;
Destroy();
}
else
{
Owner.RemoveInventory(self);
Destroy();
r.bNeverRespawn = bNeverRespawn;
}
else Owner.RemoveInventory(self);
Destroy();
}
override void PostRender( double lbottom )
{