Today's progress. A whole lot of stuff added, and some cleanup too.

Fixed the sizes and offsets of player models.
Adjusted weapon offsets to be more in line with the originals.
Implemented all armors and most of the usable items.
Add lights to some item pickups. This might get done to DT too.
Key display on both HUD types, along with some fixes.
ASMD has complete animations. Other weapons will follow.
This commit is contained in:
Marisa the Magician 2019-08-16 03:22:58 +02:00
commit 8da5167e59
39 changed files with 1488 additions and 371 deletions

View file

@ -17,11 +17,14 @@ Class ASMDAmmo : Ammo
tracer = Spawn("ASMDAmmoX",pos);
tracer.angle = angle;
tracer.target = self;
tracer = Spawn("ASMDAmmoXX",pos);
tracer.angle = angle;
tracer.target = self;
}
States
{
Spawn:
ASMA A -1;
SHOA A -1;
Stop;
}
}
@ -51,7 +54,17 @@ Class ASMDAmmoX : Actor
States
{
Spawn:
ASMA A -1 Bright;
SHOA A -1 Bright;
Stop;
}
}
Class ASMDAmmoXX : ASMDAmmoX
{
States
{
Spawn:
SHOA A -1;
Stop;
}
}
@ -61,7 +74,7 @@ Class ASMDAmmo2X : ASMDAmmoX
States
{
Spawn:
ASMA B -1 Bright;
SHOA B -1 Bright;
Stop;
}
}
@ -86,13 +99,43 @@ Class ASMDAmmo2 : ASMDAmmo
States
{
Spawn:
ASMA B -1;
SHOA B -1;
Stop;
}
}
Class ASMD : UTWeapon
{
override void PlayUpSound( Actor origin )
{
origin.A_PlaySound(upsound,CHAN_WEAPON,Dampener.Active(origin)?.1:1.);
}
action void A_ShockFire()
{
Weapon weap = Weapon(invoker);
if ( !weap ) return;
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
A_PlaySound("shock/fire",CHAN_WEAPON,Dampener.Active(self)?.2:1.);
invoker.FireEffect();
UTMainHandler.DoFlash(self,Color(80,64,32,255),1);
UTMainHandler.DoSwing(self,(FRandom[ASMD](-0.1,-0.6),FRandom[ASMD](-0.1,0.5)),2,-0.3,3,SWING_Spring,0,4);
if ( !Dampener.Active(self) ) A_AlertMonsters();A_AlertMonsters();
A_QuakeEx(2,2,2,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
}
action void A_ShockAlt()
{
Weapon weap = Weapon(invoker);
if ( !weap ) return;
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
A_PlaySound("shock/altfire",CHAN_WEAPON,Dampener.Active(self)?.2:1.);
invoker.FireEffect();
UTMainHandler.DoFlash(self,Color(80,64,32,255),1);
UTMainHandler.DoSwing(self,(FRandom[ASMD](-0.1,-0.6),FRandom[ASMD](-0.1,0.5)),3,-0.4,3,SWING_Spring,0,4);
if ( !Dampener.Active(self) ) A_AlertMonsters();A_AlertMonsters();
A_QuakeEx(2,2,2,8,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
}
Default
{
Tag "$T_ASMD";
@ -114,5 +157,85 @@ Class ASMD : UTWeapon
Stop;
ASMP B -1;
Stop;
Ready:
ASMS ABCDEFGHIJKLMN 1 A_WeaponReady(WRF_NOFIRE);
Idle:
#### # 8 A_Overlay(-9999,"Dummy"); // little hackeroo to make this more responsive
ASMI AB 30;
Goto Idle+1;
Dummy:
TNT1 A 1
{
A_CheckReload();
A_WeaponReady();
// that's a mouthful
if ( player.FindPSprite(PSP_WEAPON).CurState.InStateSequence(invoker.FindState("Idle")) && (player.cmd.forwardmove || player.cmd.sidemove) && (player.vel.length() > 0.5) )
player.SetPSPrite(PSP_WEAPON,invoker.FindState("Sway"));
}
Wait;
Vapour:
#### # 2 A_Overlay(-9999,"Dummy");
ASMI A 6
{
A_PlaySound("asmd/vapour",CHAN_6,0.5);
A_Overlay(PSP_FLASH,"VapourFlash");
A_OverlayFlags(PSP_FLASH,PSPF_RenderStyle,true);
A_OverlayRenderstyle(PSP_FLASH,STYLE_Add);
}
ASMV ABCDEFGHIJ 4;
Goto Idle;
VapourFlash:
ASVI A 6;
ASVF ABCDEFGHIJ 4;
Stop;
Sway:
#### # 4;
ASMI C 10 A_JumpIf((!player.cmd.forwardmove && !player.cmd.sidemove) || (player.vel.length() < 0.5),4);
ASMI D 10 A_JumpIf((!player.cmd.forwardmove && !player.cmd.sidemove) || (player.vel.length() < 0.5),5);
ASMI E 10 A_JumpIf((!player.cmd.forwardmove && !player.cmd.sidemove) || (player.vel.length() < 0.5),6);
ASMI F 10 A_JumpIf((!player.cmd.forwardmove && !player.cmd.sidemove) || (player.vel.length() < 0.5),7);
Goto Sway+1;
ASMI C 4;
ASMI A 0 A_Jump(32,"Vapour");
Goto Idle;
ASMI D 4;
ASMI A 0 A_Jump(32,"Vapour");
Goto Idle;
ASMI E 4;
ASMI A 0 A_Jump(32,"Vapour");
Goto Idle;
ASMI F 4;
ASMI A 0 A_Jump(32,"Vapour");
Goto Idle;
Fire:
#### # 1
{
A_ShockFire();
A_Overlay(-9999,"Null");
}
ASMF ABCDEFGH 2;
ASMF I 5;
ASMI A 0 A_Refire();
ASMI A 0 A_Jump(48,"Vapour");
Goto Idle;
AltFire:
#### # 1
{
A_ShockAlt();
A_Overlay(-9999,"Null");
}
ASMA ABCDFGHI 2;
ASMA J 1;
ASMA J 0 A_Refire();
ASMI A 0 A_Jump(48,"Vapour");
Goto Idle;
Deselect:
ASMD A 1 A_Overlay(-9999,"Null");
ASMD BCDEFGHIJ 1;
ASMD J 1 A_Lower(int.max);
Wait;
Select:
ASMS A 1 A_Raise(int.max);
Wait;
}
}

View file

@ -88,14 +88,15 @@ Class UnrealBackpack : BackpackItem replaces Backpack
Super.DoPickupSpecial(toucher);
if ( gameinfo.gametype&GAME_DOOMCHEX )
{
static const Class<Inventory> xitems[] = {"Flare", "Seeds", "SentryItem", "VoiceBox", "ForceField", "Dampener"};
int xitemn[6];
xitemn[0] = max(0,Random[BackpackExtra](-3,5));
xitemn[1] = max(0,Random[BackpackExtra](-3,5));
xitemn[2] = max(0,Random[BackpackExtra](-4,1));
static const Class<Inventory> xitems[] = {"Flare", "Seeds", "SentryItem", "VoiceBox", "ForceField", "Dampener", "Peacemaker"};
int xitemn[7];
xitemn[0] = max(0,Random[BackpackExtra](-1,3));
xitemn[1] = max(0,Random[BackpackExtra](-1,3));
xitemn[2] = max(0,Random[BackpackExtra](-2,1));
xitemn[3] = max(0,Random[BackpackExtra](-2,1));
xitemn[4] = max(0,Random[BackpackExtra](-3,1));
xitemn[5] = max(0,Random[BackpackExtra](-2,1));
xitemn[4] = max(0,Random[BackpackExtra](-2,1));
xitemn[5] = max(0,Random[BackpackExtra](-1,1));
xitemn[6] = max(0,Random[BackpackExtra](-2,1));
// random doubling
if ( !Random[BackpackExtra](0,4) ) xitemn[0] *= 2;
if ( !Random[BackpackExtra](0,4) ) xitemn[1] *= 2;
@ -103,11 +104,12 @@ Class UnrealBackpack : BackpackItem replaces Backpack
if ( !Random[BackpackExtra](0,7) ) xitemn[3] *= 2;
if ( !Random[BackpackExtra](0,6) ) xitemn[4] *= 2;
if ( !Random[BackpackExtra](0,5) ) xitemn[5] *= 2;
if ( !Random[BackpackExtra](0,9) ) xitemn[6] *= 2;
int total = 0;
for ( int i=0; i<6; i++ ) total += xitemn[i];
for ( int i=0; i<7; i++ ) total += xitemn[i];
if ( total <= 0 ) return;
String extratxt = StringTable.Localize("$I_BACKPACKEXTRA");
for ( int i=0; i<6; i++ )
for ( int i=0; i<7; i++ )
{
if ( xitemn[i] <= 0 ) continue;
extratxt = extratxt..String.Format("%dx %s, ",xitemn[i],GetDefaultByType(xitems[i]).GetTag());
@ -187,6 +189,167 @@ Class UTranslator : UnrealInventory
Class VoiceBox : UnrealInventory
{
Actor box;
Default
{
Tag "$T_VOICEBOX";
Inventory.PickupMessage "$I_VOICEBOX";
Inventory.Icon "I_VoiceB";
Inventory.MaxAmount 5;
UnrealInventory.Charge 600;
}
override void Tick()
{
Super.Tick();
if ( bActive )
{
if ( box ) Charge = box.ReactionTime;
else
{
Charge = DefaultCharge;
bActive = false;
Amount--;
if ( Amount <= 0 ) DepleteOrDestroy();
}
}
}
override bool Use( bool pickup )
{
if ( pickup || bActive ) return false;
bActive = true;
Vector3 x, y, z;
[x, y, z] = dt_CoordUtil.GetAxes(Owner.pitch,Owner.angle,Owner.roll);
Vector3 origin = Owner.Vec2OffsetZ(0,0,Owner.player.viewz);
origin = level.Vec3Offset(origin,x*20.-z*8.);
box = Spawn("VoiceBoxActive",origin);
box.ReactionTime = Charge;
box.vel = x*12.;
box.vel.z += 3.;
box.target = Owner;
box.angle = Owner.angle;
box.pitch = Owner.pitch;
return false;
}
States
{
Spawn:
VBOX A -1;
Stop;
}
}
Class VoiceBoxHitbox : Actor
{
Default
{
Tag "$T_VOICEBOX";
Radius 6;
Height 9;
Health 60;
+SHOOTABLE;
+NOGRAVITY;
+NOCLIP;
+DONTSPLASH;
+NOBLOOD;
+NOTELEPORT;
}
override void Tick()
{
Super.Tick();
if ( !master )
{
Destroy();
return;
}
SetOrigin(master.pos,true);
}
override void Die( Actor source, Actor inflictor, int dmgflags, Name MeansOfDeath )
{
if ( master ) master.ReactionTime = 0;
Super.Die(source,inflictor,dmgflags,MeansOfDeath);
}
}
Class VoiceBoxActive : Actor
{
Actor b;
bool alreadyhit;
override void PostBeginPlay()
{
Super.PostBeginPlay();
b = Spawn("VoiceBoxHitbox",pos);
b.master = self;
}
action void A_VoiceBoxPlay()
{
static const String BattleSounds[] =
{
"automag/shot",
"utrl/explode",
"automag/shot",
"automag/shot",
"flak/altfire",
"utrl/explode",
"flak/fire",
"shock/fire",
"stinger/hit2",
"automag/shot"
};
if ( invoker.b ) invoker.b.A_AlertMonsters(0,AMF_TARGETEMITTER);
for ( int i=0; i<10; i++ ) if ( !Random[Voicebox](0,30) ) A_PlaySound(BattleSounds[i],CHAN_AUTO,FRandom[Voicebox](0.5,1.0));
}
Default
{
Radius 6;
Height 6;
PROJECTILE;
-NOGRAVITY;
+USEBOUNCESTATE;
+SKYEXPLODE;
+MOVEWITHSECTOR;
+CANBOUNCEWATER;
BounceType "Hexen";
BounceFactor 0.3;
WallBounceFactor 0.3;
Gravity 0.35;
ReactionTime 200;
}
States
{
Spawn:
VBOX A -1;
Stop;
Bounce:
VBOX A 0
{
if ( alreadyhit )
{
ClearBounce();
ExplodeMissile();
}
else
{
A_SetPitch(0);
A_PlaySound("transloc/bounce");
if ( BlockingFloor ) alreadyhit = true;
}
}
Goto Spawn;
Death:
VBOX A 30;
VBOX ABCDEFGHIJ 1
{
A_VoiceBoxPlay();
ReactionTime--;
return A_JumpIf(ReactionTime<=0,"Death2");
}
Goto Death+1;
Death2:
TNT1 A 1 A_Log("// TODO explosion");
Stop;
}
}
Class Flare : UnrealInventory
@ -209,14 +372,200 @@ Class Dampener : UnrealInventory
if ( d && d.bActive ) return true;
return false;
}
override bool Use( bool pickup )
{
if ( pickup ) return false;
bActive = !bActive;
Owner.A_PlaySound(bActive?"dampener/on":"dampener/off",CHAN_ITEM);
return false;
}
override void Tick()
{
Super.Tick();
if ( !bActive ) return;
if ( DrainCharge(1) )
{
Owner.A_PlaySound("dampener/off",CHAN_ITEM);
PrintPickupMessage(true,StringTable.Localize("$D_DAMPENER"));
}
}
Default
{
Tag "$T_DAMPENER";
Inventory.PickupMessage "$I_DAMPENER";
Inventory.Icon "I_Dampen";
Inventory.MaxAmount 5;
UnrealInventory.Charge 1000;
}
States
{
Spawn:
DAMP A 8 A_CheckProximity(1,"PlayerPawn",80,1,CPXF_ANCESTOR|CPXF_CHECKSIGHT);
Wait;
DAMP ABC 8;
DAMP DEFGHIJ 3;
DAMP D 0 A_CheckProximity(1,"PlayerPawn",80,0,CPXF_ANCESTOR|CPXF_CHECKSIGHT|CPXF_EXACT);
Goto Spawn+4;
DAMP CBA 8;
Goto Spawn;
}
}
Class Forcefield : UnrealInventory
{
Default
{
Tag "$T_FORCEFIELD";
Inventory.PickupMessage "$I_FORCEFIELD";
Inventory.Icon "I_ForceF";
Inventory.MaxAmount 5;
}
override bool Use( bool pickup )
{
if ( pickup ) return false;
Vector3 x, y, z;
[x, y, z] = dt_CoordUtil.GetAxes(Owner.pitch,Owner.angle,Owner.roll);
Vector3 origin = level.Vec3Offset(Owner.Vec2OffsetZ(0,0,Owner.player.viewz),x*90.);
origin = level.Vec3Offset(origin,(0,0,-GetDefaultByType("ForceFieldEffect").Height*.5));
if ( !level.IsPointInLevel(origin) )
{
PrintPickupMessage(true,StringTable.Localize("$M_FFNOROOM"));
return false;
}
let a = Spawn("ForceFieldEffect",origin);
if ( !a.TestMobjLocation() )
{
PrintPickupMessage(true,StringTable.Localize("$M_FFNOROOM"));
a.Destroy();
return false;
}
a.target = Owner;
a.angle = Owner.angle;
return true;
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
tracer = Spawn("ForcefieldX",pos);
tracer.angle = angle;
tracer.target = self;
}
States
{
Spawn:
FFPK A -1;
Stop;
}
}
Class ForcefieldX : Actor
{
Default
{
RenderStyle "Add";
+NOGRAVITY;
+NOCLIP;
+DONTSPLASH;
Radius 0.1;
Height 0;
}
override void Tick()
{
Super.Tick();
if ( !target )
{
Destroy();
return;
}
Warp(target,flags:WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION);
bInvisible = target.bInvisible||!target.InStateSequence(target.CurState,target.FindState("Spawn"));
}
States
{
Spawn:
FFPK A -1 Bright;
Stop;
}
}
Class ForceFieldLight : DynamicLight
{
double cdown;
Default
{
DynamicLight.Type "Point";
+DYNAMICLIGHT.ATTENUATE;
Args 0,0,0,100;
}
override void Tick()
{
Super.Tick();
if ( !target )
{
Destroy();
return;
}
SetOrigin(target.Vec3Offset(0,0,target.height/2.),true);
if ( isFrozen() ) return;
args[LIGHT_RED] = int(255*cdown);
args[LIGHT_BLUE] = int(255*cdown);
if ( target.bSOLID )
{
cdown = min(1.,cdown+1./27);
return;
}
cdown = max(0.,cdown-1./35);
if ( cdown <= 0. ) Destroy();
}
}
Class ForcefieldEffect : Actor
{
double nvol;
Default
{
Tag "$T_FORCEFIELD";
RenderStyle "Add";
+NOGRAVITY;
+NOTELEPORT;
+DONTSPLASH;
+CANNOTPUSH;
+SHOOTABLE;
+SOLID;
+NODAMAGE;
+NOBLOOD;
Mass int.max;
Health int.max;
Radius 15;
Height 45;
}
override int DamageMobj( Actor inflictor, Actor source, int damage, Name mod, int flags, double angle )
{
A_PlaySound("ffield/hit",CHAN_BODY);
return Super.DamageMobj(inflictor,source,damage,mod,flags,angle);
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
A_PlaySound("ffield/on",CHAN_ITEM);
A_PlaySound("ffield/active",CHAN_VOICE,0.6,true);
let tracer = Spawn("ForceFieldLight",pos);
tracer.target = self;
}
States
{
Spawn:
FFLD ABCDEFGHI 3 Bright;
FFLD J 700 Bright;
FFLD J 35 Bright
{
A_UnsetShootable();
A_UnsetSolid();
}
FFLD A 1 Bright A_PlaySound("ffield/hit",CHAN_VOICE);
Stop;
}
}
Class UFlashlight : UnrealInventory

View file

@ -5,11 +5,11 @@ Class StingerAmmo : Ammo
Tag "$T_STINGERAMMO";
Inventory.Icon "I_Stingr";
Inventory.PickupMessage "";
Inventory.Amount 40;
Inventory.Amount 5;
Inventory.MaxAmount 200;
Ammo.BackpackAmount 80;
Ammo.BackpackAmount 20;
Ammo.BackpackMaxAmount 400;
Ammo.DropAmount 10;
Ammo.DropAmount 2;
}
override String PickupMessage()
{
@ -25,6 +25,18 @@ Class StingerAmmo : Ammo
Class StingerAmmo2 : StingerAmmo
{
Default
{
Tag "$T_STINGERAMMO2";
Inventory.Amount 40;
Ammo.DropAmount 15;
}
States
{
Spawn:
SAMO B -1;
Stop;
}
}
Class StingerProjectile : Actor
@ -87,6 +99,10 @@ Class Stinger : UTWeapon
Weapon.AmmoGive 40;
UTWeapon.DropAmmo 20;
}
override void PlayUpSound( Actor origin )
{
origin.A_PlaySound(upsound,CHAN_WEAPON,Dampener.Active(origin)?.1:1.);
}
action void A_StingerFire( bool hold = false )
{
Weapon weap = Weapon(invoker);
@ -177,7 +193,7 @@ Class Stinger : UTWeapon
STNI A 3;
STNI A 0 A_Refire(1);
Goto Idle;
STNI A 0 A_PlaySound("stinger/hold",CHAN_WEAPON,CountInv("Dampener")?.1:1.,true);
STNI A 0 A_PlaySound("stinger/hold",CHAN_WEAPON,Dampener.Active(self)?.1:1.,true);
Hold:
STNH A 1
{
@ -188,7 +204,7 @@ Class Stinger : UTWeapon
}
STNH BCDEFG 1;
STNH A 0 A_Refire();
STNH A 2 A_PlaySound("stinger/release",CHAN_WEAPON);
STNH A 2 A_PlaySound("stinger/release",CHAN_WEAPON,Dampener.Active(self)?.1:1.);
Goto Idle;
AltFire:
STNF A 2 A_StingerAltFire();

View file

@ -1,31 +1,250 @@
Class UnrealArmor : UTArmor
{
int priority;
Property AbsorptionPriority : priority;
Default
{
-INVENTORY.ALWAYSPICKUP;
UnrealArmor.AbsorptionPriority 0;
}
override void AttachToOwner( Actor other )
{
Super.AttachToOwner(other);
// re-sort self against other armors based on priority
Inventory cprev = null, prev = null;
for ( Inventory i=other.Inv; i; i=i.Inv )
{
if ( i.Inv == self ) prev = i;
if ( !(i is 'UnrealArmor') || (i == self) || (UnrealArmor(i).priority >= priority) )
{
cprev = i;
continue;
}
// got one, move ourselves
if ( prev ) prev.Inv = Inv;
if ( cprev ) cprev.Inv = self;
else other.Inv = self;
Inv = i;
break;
}
}
}
Class UArmor : UnrealArmor
{
}
Class KevlarSuit : UnrealArmor
{
Default
{
Tag "$T_UARMOR";
Inventory.Amount 100;
Inventory.MaxAmount 100;
Inventory.InterHubAmount 100;
UTArmor.ArmorAbsorption 90;
UnrealArmor.AbsorptionPriority 7;
Inventory.PickupMessage "$I_UARMOR";
Inventory.PickupSound "misc/u1armor";
Inventory.Icon "I_Armor";
}
States
{
Spawn:
UARM A -1;
Stop;
}
}
Class AsbestosSuit : UnrealArmor
{
Default
{
Tag "$T_ASBSUIT";
Inventory.Amount 50;
Inventory.MaxAmount 50;
Inventory.InterHubAmount 50;
UTArmor.ArmorAbsorption 50;
UnrealArmor.AbsorptionPriority 6;
Inventory.PickupMessage "$I_ASBSUIT";
Inventory.PickupSound "misc/suit";
Inventory.Icon "I_Suit";
}
override void AbsorbDamage( int damage, Name damageType, out int newdamage )
{
if ( (damageType == 'Fire') || (damageType == 'Ice') ) damage = newdamage = 0;
Super.AbsorbDamage(damage,damageType,newdamage);
}
override void AttachToOwner( Actor other )
{
// 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
{
Spawn:
ASBS A -1;
Stop;
}
}
Class ToxinSuit : UnrealArmor
{
Default
{
Tag "$T_TOXSUIT";
Inventory.Amount 50;
Inventory.MaxAmount 50;
Inventory.InterHubAmount 50;
UTArmor.ArmorAbsorption 50;
UnrealArmor.AbsorptionPriority 6;
Inventory.PickupMessage "$I_TOXSUIT";
Inventory.PickupSound "misc/suit";
Inventory.Icon "I_TSuit";
}
override void AbsorbDamage( int damage, Name damageType, out int newdamage )
{
if ( damageType == 'Slime' ) damage = newdamage = 0;
Super.AbsorbDamage(damage,damageType,newdamage);
}
override void AttachToOwner( Actor other )
{
Super.AttachToOwner(other);
// remove other suits
Inventory i = other.FindInventory("AsbestosSuit");
if ( i ) other.RemoveInventory(i);
i = other.FindInventory("KevlarSuit");
if ( i ) other.RemoveInventory(i);
}
States
{
Spawn:
TOXS A -1;
Stop;
}
}
Class KevlarSuit : UnrealArmor
{
Default
{
Tag "$T_KEVSUIT";
Inventory.Amount 100;
Inventory.MaxAmount 100;
Inventory.InterHubAmount 100;
UTArmor.ArmorAbsorption 80;
UnrealArmor.AbsorptionPriority 6;
Inventory.PickupMessage "$I_KEVSUIT";
Inventory.PickupSound "misc/suit";
Inventory.Icon "I_Kevlar";
}
override void AttachToOwner( Actor other )
{
Super.AttachToOwner(other);
// remove other suits
Inventory i = other.FindInventory("AsbestosSuit");
if ( i ) other.RemoveInventory(i);
i = other.FindInventory("ToxinSuit");
if ( i ) other.RemoveInventory(i);
}
States
{
Spawn:
KEVS A -1;
Stop;
}
}
Class ShieldBelt : UnrealArmor
{
override void AbsorbDamage( int damage, Name damageType, out int newdamage )
{
if ( (damage > 0) && (amount > 0) && !DamageTypeDefinition.IgnoreArmor(damageType) )
{
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) ) PrintPickupMessage(true,StringTable.Localize("$D_SHIELDBELT"));
}
Default
{
Tag "$T_SHIELDBELT";
+COUNTITEM;
+INVENTORY.BIGPOWERUP;
Inventory.Amount 100;
Inventory.MaxAmount 100;
Inventory.InterHubAmount 100;
UTArmor.ArmorAbsorption 100;
UnrealArmor.AbsorptionPriority 10;
Inventory.PickupMessage "$I_SHIELDBELT";
Inventory.PickupSound "belt/pickup";
Inventory.RespawnTics 2100;
Inventory.Icon "I_Shield";
}
States
{
Spawn:
BELT A -1;
Stop;
}
}
Class PowerShield : UnrealArmor
{
bool gothit;
override void AbsorbDamage( int damage, Name damageType, out int newdamage )
{
if ( (damage > 0) && (amount > 0) && !DamageTypeDefinition.IgnoreArmor(damageType) )
{
Owner.A_PlaySound("belt/absorb",CHAN_7);
UTMainHandler.DoFlash(Owner,Color(80,224,0,255),5);
gothit = true;
}
int oldamt = amount;
amount = int.max; // blocks all damage
Super.AbsorbDamage(damage,damageType,newdamage);
amount = oldamt; // does not drain here
}
override void Tick()
{
Super.Tick();
if ( !Owner || !Owner.player ) return;
if ( gothit )
{
amount--;
gothit = false;
}
if ( amount <= 0 )
{
PrintPickupMessage(true,StringTable.Localize("$D_POWERSHIELD"));
DepleteOrDestroy();
}
}
Default
{
Tag "$T_POWERSHIELD";
+COUNTITEM;
+INVENTORY.BIGPOWERUP;
Inventory.Amount 200;
Inventory.MaxAmount 200;
Inventory.InterHubAmount 200;
UTArmor.ArmorAbsorption 100;
UnrealArmor.AbsorptionPriority 11; // wow dude
Inventory.PickupMessage "$I_POWERSHIELD";
Inventory.PickupSound "sbelt/pickup";
Inventory.RespawnTics 3500;
Inventory.Icon "I_PBelt";
}
States
{
Spawn:
BELT A -1;
Stop;
}
}

View file

@ -18,7 +18,7 @@ Class UFlakBox : Ammo
States
{
Spawn:
FBOX A -1;
FAMO A -1;
Stop;
}
}
@ -37,17 +37,21 @@ Class UFlakAmmo : UFlakBox
States
{
Spawn:
FSHL B -1;
FAMO B -1;
Stop;
}
}
Class UFlakCannon : UTWeapon
{
override void PlayUpSound( Actor origin )
{
origin.A_PlaySound(upsound,CHAN_WEAPON,Dampener.Active(origin)?.1:1.);
}
action void A_Loading( bool first = false )
{
if ( first ) A_PlaySound("flak/load",CHAN_WEAPON);
else A_PlaySound("flak/reload",CHAN_6);
if ( first ) A_PlaySound("flak/load",CHAN_WEAPON,Dampener.Active(self)?.1:1.);
else A_PlaySound("flak/reload",CHAN_6,Dampener.Active(self)?.06:.6);
}
action void A_FireChunks()
{
@ -96,16 +100,16 @@ Class UFlakCannon : UTWeapon
States
{
Spawn:
FLKP A -1;
FPCK A -1;
Stop;
FLKP B -1;
FPCK B -1;
Stop;
Select:
FLKS A 1 A_Raise(int.max);
Wait;
Ready:
FLKS ABCDEFGHIJKLMNOPQRSTUVWXYZ 1 A_WeaponReady(WRF_NOFIRE);
FLS2 ABCD 1 A_WeaponReady(WRF_NOFIRE);
FLKS ABCDFGHIKLMNPQRSUVWXZ 1 A_WeaponReady(WRF_NOFIRE);
FLS2 ABC 1 A_WeaponReady(WRF_NOFIRE);
FLKL A 1 A_Loading(true);
FLKL BCEFGIJKMNO 1;
Goto Idle;
@ -124,7 +128,7 @@ Class UFlakCannon : UTWeapon
FLKF A 1 A_FireChunks();
FLKF BCDEFGHI 1;
FLKF J 5;
FLKE A 1 A_PlaySound("flak/click",CHAN_6);
FLKE A 1 A_PlaySound("flak/click",CHAN_6,Dampener.Active(self)?.05:.5);
FLKE BCDEFGHIJKLMN 1;
FLKE S 4;
Goto Loading;

View file

@ -124,7 +124,7 @@ Class UPlayer : UTPlayer
if ( !type ) continue;
let def = GetDefaultByType (type);
if ( def.Icon.isValid() && (def.MaxAmount > 1) &&
!(type is "PuzzleItem") && !(type is "Powerup") && !(type is "Ammo") && !(type is "Armor"))
!(type is "PuzzleItem") && !(type is "Powerup") && !(type is "Ammo") && !(type is "Armor") )
{
// Do not give replaced items unless using "give everything"
if ( (giveall == ALL_YESYES) || (GetReplacement(type) == type) )
@ -488,10 +488,42 @@ Class UnrealInventory : Inventory
// Drawstuffs over HUD
virtual ui void PostRender( double lbottom ) {}
bool DrainCharge( int val )
{
Charge -= val;
if ( Charge > 0 ) return false;
if ( Amount > 1 )
{
Amount--;
Charge = DefaultCharge;
bActive = false;
return true;
}
DepleteOrDestroy();
return true;
}
override void AttachToOwner( Actor other )
{
Super.AttachToOwner(other);
Charge = DefaultCharge;
}
override bool HandlePickup( Inventory item )
{
if ( (item.GetClass() == GetClass()) && ((MaxAmount > 1) || (DefaultCharge > 0)) )
{
if ( MaxAmount > 1 ) Amount = min(MaxAmount,Amount+item.Amount);
else Charge = DefaultCharge; // reset charge
item.bPickupGood = true;
return true;
}
return Super.HandlePickup(item);
}
Default
{
+INVENTORY.INVBAR;
UnrealInventory.Charge 0;
Inventory.PickupSound "misc/p_pkup";
}
}
@ -599,21 +631,6 @@ Class UnrealStaticHandler : StaticEventHandler
Class UnrealMainHandler : EventHandler
{
// can't detect terraindef-based damage
// this is currently an engine limitation
static bool, bool DetectHurtfloors()
{
bool foundslime = false, foundlava = false;
for ( int i=0; i<level.Sectors.Size(); i++ )
{
Sector s = level.Sectors[i];
if ( !s.DamageAmount || !s.DamageInterval ) continue;
if ( s.DamageType == 'Slime' ) foundslime = true;
else if ( s.DamageType == 'Fire' ) foundlava = true;
}
return foundslime, foundlava;
}
override void CheckReplacement( ReplaceEvent e )
{
if ( (e.Replacee == 'Chainsaw') || (e.Replacee == 'Gauntlets') )
@ -719,7 +736,7 @@ Class UnrealMainHandler : EventHandler
else switch( Random[Replacements](0,2) )
{
case 0:
e.Replacement = 'StingerAmmo2';
e.Replacement = 'StingerAmmo';
break;
case 1:
e.Replacement = 'ASMDAmmo2';
@ -734,7 +751,7 @@ Class UnrealMainHandler : EventHandler
switch( Random[Replacements](0,2) )
{
case 0:
e.Replacement = 'StingerAmmo';
e.Replacement = 'StingerAmmo2';
break;
case 1:
e.Replacement = 'ASMDAmmo';
@ -792,37 +809,9 @@ Class UnrealMainHandler : EventHandler
else if ( (e.Replacee == 'Soulsphere') || (e.Replacee == 'ArtiSuperHealth') ) e.Replacement = 'SuperHealth';
else if ( e.Replacee == 'Megasphere' ) e.Replacement = 'ShieldBelt';
else if ( (e.Replacee == 'Allmap') || (e.Replacee == 'SuperMap') ) e.Replacement = 'MotionDetector';
else if ( (e.Replacee == 'BlurSphere') || (e.Replacee == 'ArtiInvisibility') )
{
if ( Random[Replacements](0,1) ) e.Replacement = 'UInvisibility';
else e.Replacement = 'Dampener';
}
else if ( (e.Replacee == 'Infrared') || (e.Replacee == 'ArtiTorch') )
{
if ( !Random[Replacements](0,2) ) e.Replacement = 'USearchlight';
else e.Replacement = 'UFlashlight';
}
else if ( e.Replacee == 'RadSuit' )
{
bool HasSlime, HasLava;
[HasSlime, HasLava] = DetectHurtfloors();
if ( HasSlime )
{
if ( HasLava )
{
if ( Random[Replacements](0,3) )
{
if ( Random[Replacements](0,1) ) e.Replacement = 'AsbestosSuit';
else e.Replacement = 'ToxinSuit';
}
else e.Replacement = 'UJumpBoots';
}
else if ( Random[Replacements](0,3) ) e.Replacement = 'ToxinSuit';
else e.Replacement = 'UJumpBoots';
}
else if ( HasLava && Random[Replacements](0,3) ) e.Replacement = 'AsbestosSuit';
else e.Replacement = 'UJumpBoots';
}
else if ( (e.Replacee == 'BlurSphere') || (e.Replacee == 'ArtiInvisibility') ) e.Replacement = 'UInvisibility';
else if ( (e.Replacee == 'Infrared') || (e.Replacee == 'ArtiTorch') ) e.Replacement = 'UFlashlight';
else if ( e.Replacee == 'RadSuit' ) e.Replacement = 'UJumpBoots';
else if ( e.Replacee == 'ArtiFly' ) e.Replacement = 'UJumpBoots';
else if ( (e.Replacee == 'Backpack') || (e.Replacee == 'BagOfHolding') ) e.Replacement = 'UnrealBackpack';
else if ( (e.Replacee == 'ArmorBonus') || (e.Replacee == 'ArtiTimeBomb') ) e.Replacement = 'Flare';
@ -843,7 +832,7 @@ Class UnrealMainHandler : EventHandler
else if ( e.Replacee == 'ArtiTeleport' )
{
// I have no idea what to replace this with, so just have some random stuff
switch( Random[Replacements](0,5) )
switch( Random[Replacements](0,7) )
{
case 0:
e.Replacement = 'UnrealBackpack';
@ -866,6 +855,9 @@ Class UnrealMainHandler : EventHandler
case 6:
e.Replacement = 'SentryItem';
break;
case 7:
e.Replacement = 'Peacemaker';
break;
}
}
else if ( e.Replacee == 'TeleportFog' ) e.Replacement = 'UTeleportFog';
@ -898,6 +890,9 @@ Class UnrealMainHandler : EventHandler
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';
// we don't need these
else if ( e.Replacee is 'UTActivatable' ) e.Replacement = 'UNothing';
else if ( e.Replacee is 'UTActivatableHealth' ) e.Replacement = 'UNothing';
}
// translocator stuff

View file

@ -20,13 +20,14 @@ Class UnrealHUD : BaseStatusBar
HUDFont mMapFont;
// Common Textures
TextureID HalfHud, HudLine, HudAmmo, IconHeal, IconSkul, IconSel, IconBase;
TextureID HalfHud, HudLine, HudAmmo, IconHeal, IconSkul, IconSel, IconBase, KeyIcons[7];
// 0.83 HUD stuff
String OldAmmo[18];
Class<Inventory> OldAmmoType[18];
String OldArmor[6];
Class<Inventory> OldArmorType[6];
String OldKeys[7];
HUDFont mOldDigits;
// Translations
@ -59,6 +60,13 @@ Class UnrealHUD : BaseStatusBar
IconSel = TexMan.CheckForTexture("IconSel",TexMan.Type_Any);
IconBase = TexMan.CheckForTexture("IconBase",TexMan.Type_Any);
RedIcon = Translation.GetID('RedIcon');
KeyIcons[0] = TexMan.CheckForTexture("I_KeyR",TexMan.Type_Any);
KeyIcons[1] = TexMan.CheckForTexture("I_KeyB",TexMan.Type_Any);
KeyIcons[2] = TexMan.CheckForTexture("I_KeyY",TexMan.Type_Any);
KeyIcons[3] = TexMan.CheckForTexture("I_SkullR",TexMan.Type_Any);
KeyIcons[4] = TexMan.CheckForTexture("I_SkullB",TexMan.Type_Any);
KeyIcons[5] = TexMan.CheckForTexture("I_SkullY",TexMan.Type_Any);
KeyIcons[6] = TexMan.CheckForTexture("I_KeyG",TexMan.Type_Any);
mOldDigits = HUDFont.Create(Font.FindFont('U083Digits'),26,Mono_CellLeft);
OldAmmo[0] = "Disp083";
OldAmmo[1] = "Clip083";
@ -108,6 +116,13 @@ Class UnrealHUD : BaseStatusBar
OldArmorType[3] = "ToxinSuit";
OldArmorType[4] = "ShieldBelt";
OldArmorType[5] = "PowerShield";
OldKeys[0] = "Redk083";
OldKeys[1] = "Bluek083";
OldKeys[2] = "Goldk083";
OldKeys[3] = "Rskul083";
OldKeys[4] = "Bskul083";
OldKeys[5] = "Gskul083";
OldKeys[6] = "Grenk083";
}
override void Draw( int state, double TicFrac )
@ -145,15 +160,17 @@ Class UnrealHUD : BaseStatusBar
UTWeapon(CPlayer.ReadyWeapon).PostRender(lbottom);
}
private void DrawNumberOf( int n, double x, double y )
private void DrawNumberOf( Inventory i, double x, double y )
{
if ( n <= 0 ) return;
CurX = X-4;
CurY = Y+20;
n++;
string itxt = String.Format("%d",n);
if ( i.Amount <= 1 ) return;
double TempX = CurX, TempY = CurY;
string itxt = String.Format("%d",i.Amount);
CurX += 30;
CurY += 23;
CurX -= TinyRedFont.StringWidth(itxt);
Screen.DrawText(TinyRedFont,Font.CR_UNTRANSLATED,CurX,CurY,itxt,DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true);
CurX = TempX;
CurY = TempY;
}
private void DrawIconValue( int n )
@ -190,8 +207,10 @@ 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) )
Screen.DrawTexture(HudLine,false,CurX+2,CurY+29,DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true,DTA_WindowRightF,Min(27.*(UnrealInventory(i).Charge/double(UnrealInventory(i).DefaultCharge)),27.));
if ( (i is 'UnrealInventory') && (UnrealInventory(i).DefaultCharge > 0) && (UnrealInventory(i).Charge < UnrealInventory(i).DefaultCharge) )
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.));
}
private void DrawFragCount( double x, double y )
@ -347,7 +366,7 @@ Class UnrealHUD : BaseStatusBar
{
bRed = ((Prev is 'UnrealInventory') && UnrealInventory(Prev).bActive) || (Prev is 'Powerup') || ((Prev is 'UTranslator') && bFlashTranslator);
DrawHudIcon(x,y,Prev,bRed);
if ( Prev.MaxAmount > 1 ) DrawNumberOf(Prev.Amount,x,y);
if ( Prev.MaxAmount > 1 ) DrawNumberOf(Prev,x,y);
}
bRed = ((SelectedItem is 'UnrealInventory') && UnrealInventory(SelectedItem).bActive) || (SelectedItem is 'Powerup') || ((SelectedItem is 'UTranslator') && bFlashTranslator);
if ( !Next && !Prev && !bDrawOne ) DrawHudIcon(x+64,y,SelectedItem,bRed);
@ -355,13 +374,13 @@ Class UnrealHUD : BaseStatusBar
CurX = x+32;
if ( !Next && !Prev && !bDrawOne ) CurX = x+64;
CurY = y;
Screen.DrawTexture(IconSel,false,CurX,CurY,DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true);
if ( SelectedItem.MaxAmount > 1 ) DrawNumberOf(SelectedItem.Amount,CurX,y);
Screen.DrawTexture(IconSel,false,CurX,CurY,DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true,DTA_Alpha,0.5);
if ( SelectedItem.MaxAmount > 1 ) DrawNumberOf(SelectedItem,CurX,y);
if ( Next )
{
bRed = ((Next is 'UnrealInventory') && UnrealInventory(Next).bActive) || (Next is 'Powerup') || ((Next is 'UTranslator') && bFlashTranslator);
DrawHudIcon(x+64,y,Next,bRed);
if ( Next.MaxAmount > 1 ) DrawNumberOf(Next.Amount,x+64,y);
if ( Next.MaxAmount > 1 ) DrawNumberOf(Next,x+64,y);
}
}
@ -380,8 +399,10 @@ Class UnrealHUD : BaseStatusBar
if ( !bDrawOne )
{
DrawHudIcon(CurX,y,Inv,false);
DrawIconValue(Inv.Amount);
CurX += 32;
CurY += HudMode?29:27;
DrawIconValue(Inv.Amount);
CurY -= HudMode?29:27;
}
else if ( UTArmor(Inv).absorb > CurAbs )
{
@ -392,11 +413,13 @@ Class UnrealHUD : BaseStatusBar
if ( bDrawOne && BestArmor )
{
DrawHudIcon(CurX,Y,BestArmor,false);
DrawIconValue(BestArmor.Amount);
CurX += 32;
CurY += HudMode?29:27;
DrawIconValue(BestArmor.Amount);
CurY -= HudMode?29:27;
}
if ( (ArmorAmount > 0) && !HudMode )
Screen.DrawText(LargeFont,Font.CR_UNTRANSLATED,CurX,Y,String.Format("%d",ArmorAmount),DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true);
Screen.DrawText(LargeFont,Font.CR_UNTRANSLATED,CurX+2,Y,String.Format("%d",ArmorAmount),DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true);
}
private void DrawAmmo( double x, double y )
@ -426,7 +449,7 @@ Class UnrealHUD : BaseStatusBar
CurX = X+2;
CurY = Y+29;
if ( (HudMode != 1) && (HudMode != 2) && (HudMode != 4) )
Screen.DrawTexture(HudLine,false,CurX,CurY,DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true,DTA_WindowRightF,Min(27.*(CPlayer.ReadyWeapon.Ammo1.Amount/double(CPlayer.ReadyWeapon.Ammo1.MaxAmount)),27.));
Screen.DrawTexture(HudLine,false,CurX,CurY,DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true,DTA_WindowRightF,Min(28.*(CPlayer.ReadyWeapon.Ammo1.Amount/double(CPlayer.ReadyWeapon.Ammo1.MaxAmount)),28.));
// TODO secondary ammo display
}
@ -441,11 +464,11 @@ Class UnrealHUD : BaseStatusBar
CurY += 29;
DrawIconValue(Max(0,CPlayer.mo.Health));
CurY -= 29;
if ( !HudMode ) Screen.DrawText(cfont,Font.CR_UNTRANSLATED,CurX,CurY,String.Format("%d",Max(0,CPlayer.mo.Health)),DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true);
if ( !HudMode ) Screen.DrawText(cfont,Font.CR_UNTRANSLATED,CurX+2,CurY,String.Format("%d",Max(0,CPlayer.mo.Health)),DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true);
CurX = X+2;
CurY = Y+29;
if ( (HudMode != 1) && (HudMode != 2) && (HudMode != 4) )
Screen.DrawTexture(HudLine,false,CurX,CurY,DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true,DTA_WindowRightF,Min(27.*(CPlayer.mo.Health/double(CPlayer.mo.SpawnHealth())),27.));
Screen.DrawTexture(HudLine,false,CurX,CurY,DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true,DTA_WindowRightF,Min(28.*(CPlayer.mo.Health/double(CPlayer.mo.SpawnHealth())),28.));
}
private void DrawIdentifyInfo()
@ -470,9 +493,25 @@ Class UnrealHUD : BaseStatusBar
}
}
private void DrawKeys( double x, double y )
private void DrawKeys( double x, double y, bool leftright = false )
{
// TODO draws the key icons from right to left, bottom to top
if ( deathmatch ) return; // no need to draw in DM
if ( gameinfo.gametype&(GAME_Hexen|GAME_Strife) ) return; // no key display for these ATM (will do eventually)
CurX = x;
CurY = y;
int cnt = 0;
for ( int i=0; i<6; i++ )
{
if ( !CPlayer.mo.CheckKeys(i+1,false,true) ) continue;
Screen.DrawTexture(KeyIcons[((i==0)&&(gameinfo.gametype&GAME_Heretic))?6:i],false,CurX,CurY,DTA_VirtualWidthF,ClipX,DTA_VirtualHeightF,ClipY,DTA_KeepRatio,true);
cnt++;
if ( !(cnt%3) )
{
CurX = x;
CurY -= 16;
}
else CurX += leftright?16:-16;
}
}
private void DrawUnrealHUD()
@ -499,13 +538,20 @@ Class UnrealHUD : BaseStatusBar
else if ( HudMode == 3 ) DrawInventory(ClipX-96,ClipY-64);
else if ( HudMode == 4 ) DrawInventory(ClipX-64,ClipY-64,true);
else if ( HudMode == 2 ) DrawInventory(ClipX/2-64,ClipY-32);
// Display Frag count
if ( HudMode < 3 ) DrawFragCount(ClipX-32,ClipY-64);
else if ( HudMode == 3 ) DrawFragCount(0,ClipY-64);
else if ( HudMode == 4 ) DrawFragCount(0,ClipY-32);
// Display Keys
if ( HudMode < 3 ) DrawKeys(ClipX-32,ClipY-32);
else if ( HudMode < 6 ) DrawKeys(ClipX,ClipY-32);
if ( deathmatch )
{
// Display Frag count
if ( HudMode < 3 ) DrawFragCount(ClipX-32,ClipY-64);
else if ( HudMode == 3 ) DrawFragCount(0,ClipY-64);
else if ( HudMode == 4 ) DrawFragCount(0,ClipY-32);
}
else
{
// Display Keys
if ( HudMode < 3 ) DrawKeys(ClipX-(deathmatch?48:16),ClipY-48);
else if ( HudMode == 3 ) DrawKeys(deathmatch?32:0,ClipY-48,true);
else if ( HudMode == 4 ) DrawKeys(deathmatch?32:0,ClipY-16,true);
}
// Display Identification Info
DrawIdentifyInfo();
}
@ -515,6 +561,7 @@ Class UnrealHUD : BaseStatusBar
// 0.83 status bar, just for funsies
DrawImage("Bar083",(0,336),DI_ITEM_OFFSETS);
static const float slotofs[] = {525, 84, 128, 173, 216, 259, 349, 392, 436, 481};
static const float keyofs[] = {187, 211, 235, 379, 403, 427};
for ( int i=0; i<10; i++ )
{
if ( !CPlayer.HasWeaponsInSlot(i) ) continue;
@ -557,20 +604,27 @@ Class UnrealHUD : BaseStatusBar
break;
}
}
for ( int i=0; i<6; i++ )
{
if ( !CPlayer.mo.CheckKeys(i+1,false,true) ) continue;
DrawImage(OldKeys[((i==0)&&(gameinfo.gametype&GAME_Heretic))?6:i],(keyofs[i],366),DI_ITEM_OFFSETS);
}
if ( HudMode > 5 ) return;
// Draw frags in DM
if ( deathmatch ) DrawFragCount(ClipX-32,0);
// Need to draw the inventory bar (and translator)
if ( ClipX < 320 ) HudMode = 4;
DrawInventory(ClipX-96,0,false,true);
DrawInventory(ClipX-(deathmatch?128:96),0,false,true);
}
override void Tick()
{
Super.Tick();
CPlayer.inventorytics = 0;
vtracer.ignore = CPlayer.mo;
vtracer.trace(CPlayer.mo.Vec2OffsetZ(0,0,CPlayer.viewz),CPlayer.mo.CurSector,(cos(CPlayer.mo.angle)*cos(CPlayer.mo.pitch),sin(CPlayer.mo.angle)*cos(CPlayer.mo.pitch),-sin(CPlayer.mo.pitch)),1000,0);
if ( vtracer.Results.HitType != TRACE_HitActor ) return;
lastseen = vtracer.Results.HitActor;
lastseentic = gametic;
CPlayer.inventorytics = 0;
}
override void DrawAutomapHUD( double ticFrac )
@ -590,17 +644,8 @@ Class UnrealHUD : BaseStatusBar
[tmp,tmp,hres] = StatusbarToRealCoords(0,0,HorizontalResolution);
double swidth = 0;
double ltop = 0, rtop = 0;
if ( HudMode < 2 )
{
for ( Inventory Inv=CPlayer.mo.Inv; Inv; Inv=Inv.Inv )
{
if ( !(Inv is 'UTArmor') ) continue;
if ( (Inv.Amount <= 0) || Inv.Icon.IsNull() ) continue;
rtop += 64*scalev.y;
break;
}
if ( CPlayer.mo.InvSel ) ltop += 64*scalev.y;
}
if ( (HudMode < 6) && CPlayer.mo.InvSel )
rtop += (32*scalev.y)/scale.Y;
int protrusion = GetProtrusion(swidth/hres);
[tmp,tmp,hres] = StatusbarToRealCoords(0,0,protrusion);
width += int((swidth-hres)/scale.X);

View file

@ -18,6 +18,23 @@ Class Amplifier : UnrealInventory
Class UJumpBoots : UnrealInventory
{
override void PostBeginPlay()
{
Super.PostBeginPlay();
// detect hurtfloors
// can't detect terraindef-based damage
// this is currently an engine limitation
bool foundslime = false;
bool foundlava = false;
for ( int i=0; i<level.Sectors.Size(); i++ )
{
Sector s = level.Sectors[i];
if ( !s.DamageInterval || !s.DamageAmount ) continue;
if ( s.DamageType == 'Slime' ) foundslime = true;
else if ( s.DamageType == 'Fire' ) foundlava = true;
}
// TODO replace self with asbestos/toxin suits
}
}
Class MotionDetector : UnrealInventory