Wow looks like I got a lot of stuff in here.

Added brightmaps and gldefs entries for most stuff.
Imported a bunch of sprites, including some recycled stuff from old mods.
Made new icons for the 0.83 status bar.
Remade "Teleport Gun" model.
Made new models for some ammo variants.
Made skeleton code for a lot of stuff, this temporarily makes a lot of items disappear.
Began working on ASMD. Flak Cannon has no projectiles yet.
This commit is contained in:
Marisa the Magician 2019-08-15 02:38:46 +02:00
commit 76cd3a5207
465 changed files with 1330 additions and 58 deletions

View file

@ -0,0 +1,118 @@
Class ASMDAmmo : Ammo
{
Default
{
Tag "$T_ASMDAMMO";
Inventory.Icon "I_ASMD";
Inventory.PickupMessage "$I_ASMDAMMO";
Inventory.Amount 10;
Inventory.MaxAmount 50;
Ammo.BackpackAmount 5;
Ammo.BackpackMaxAmount 100;
Ammo.DropAmount 5;
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
tracer = Spawn("ASMDAmmoX",pos);
tracer.angle = angle;
tracer.target = self;
}
States
{
Spawn:
ASMA A -1;
Stop;
}
}
Class ASMDAmmoX : 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:
ASMA A -1 Bright;
Stop;
}
}
Class ASMDAmmo2X : ASMDAmmoX
{
States
{
Spawn:
ASMA B -1 Bright;
Stop;
}
}
Class ASMDAmmo2 : ASMDAmmo
{
Default
{
Tag "$T_ASMDAMMO2";
Inventory.Icon "I_ASMD";
Inventory.PickupMessage "$I_ASMDAMMO2";
Inventory.Amount 5;
Ammo.DropAmount 3;
}
override void PostBeginPlay()
{
Ammo.PostBeginPlay();
tracer = Spawn("ASMDAmmo2X",pos);
tracer.angle = angle;
tracer.target = self;
}
States
{
Spawn:
ASMA B -1;
Stop;
}
}
Class ASMD : UTWeapon
{
Default
{
Tag "$T_ASMD";
Inventory.PickupMessage "$I_ASMD";
Weapon.UpSound "shock/select";
Weapon.SlotNumber 4;
Weapon.SelectionOrder 4;
Weapon.AmmoType "ASMDAmmo";
Weapon.AmmoUse 1;
Weapon.AmmoType2 "ASMDAmmo";
Weapon.AmmoUse2 1;
Weapon.AmmoGive 20;
UTWeapon.DropAmmo 10;
}
States
{
Spawn:
ASMP A -1;
Stop;
ASMP B -1;
Stop;
}
}

View file

@ -0,0 +1,7 @@
Class UClip : UMiniAmmo
{
}
Class Automag : UTWeapon
{
}

View file

@ -0,0 +1,3 @@
Class Betamag : UTWeapon
{
}

View file

@ -0,0 +1,11 @@
Class BigAmmo : Ammo
{
}
Class BigAmmo2 : BigAmmo
{
}
Class BigGun : UTWeapon
{
}

View file

@ -0,0 +1,3 @@
Class Bonesaw : UTWeapon
{
}

View file

@ -0,0 +1,11 @@
Class WeaponPowerUp : Inventory
{
}
Class DispersionAmmo : Ammo
{
}
Class DispersionPistol : UTWeapon
{
}

99
zscript/dtspawners.zsc Normal file
View file

@ -0,0 +1,99 @@
// 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

@ -0,0 +1,3 @@
Class FlameGun : UTWeapon
{
}

View file

@ -0,0 +1,7 @@
Class SMiniAmmo : Ammo
{
}
Class SMiniGun : UTWeapon
{
}

View file

@ -0,0 +1,14 @@
Class ImpalerAmmo : Ammo
{
}
Class ImpalerAmmo2 : ImpalerAmmo
{
}
Class ImpalerCharge : Ammo
{
}
Class Impaler : UTWeapon
{
}

View file

@ -57,7 +57,7 @@ Class UnrealBackpack : BackpackItem replaces Backpack
}
return Inventory.CreateCopy(other);
}
override bool HandlePickup (Inventory item)
override bool HandlePickup( Inventory item )
{
// Since you already have a backpack, that means you already have every
// kind of ammo in your inventory, so we don't need to look at the
@ -83,6 +83,41 @@ Class UnrealBackpack : BackpackItem replaces Backpack
}
return false;
}
override void DoPickupSpecial( Actor toucher )
{
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));
xitemn[3] = max(0,Random[BackpackExtra](-2,1));
xitemn[4] = max(0,Random[BackpackExtra](-3,1));
xitemn[5] = max(0,Random[BackpackExtra](-2,1));
// random doubling
if ( !Random[BackpackExtra](0,4) ) xitemn[0] *= 2;
if ( !Random[BackpackExtra](0,4) ) xitemn[1] *= 2;
if ( !Random[BackpackExtra](0,9) ) xitemn[2] *= 2;
if ( !Random[BackpackExtra](0,7) ) xitemn[3] *= 2;
if ( !Random[BackpackExtra](0,6) ) xitemn[4] *= 2;
if ( !Random[BackpackExtra](0,5) ) xitemn[5] *= 2;
int total = 0;
for ( int i=0; i<6; i++ ) total += xitemn[i];
if ( total <= 0 ) return;
String extratxt = StringTable.Localize("$I_BACKPACKEXTRA");
for ( int i=0; i<6; i++ )
{
if ( xitemn[i] <= 0 ) continue;
extratxt = extratxt..String.Format("%dx %s, ",xitemn[i],GetDefaultByType(xitems[i]).GetTag());
toucher.GiveInventory(xitems[i],xitemn[i]);
}
// remove trailing comma
extratxt.Truncate(extratxt.Length()-2);
PrintPickupMessage(true,extratxt..".");
}
}
Default
{
Tag "$T_BACKPACK";
@ -149,3 +184,53 @@ Class UTranslator : UnrealInventory
Inventory.MaxAmount 1;
}
}
Class VoiceBox : UnrealInventory
{
}
Class Flare : UnrealInventory
{
}
Class LightFlare : UnrealInventory
{
}
Class DarkFlare : UnrealInventory
{
}
Class Dampener : UnrealInventory
{
static bool Active( Actor Owner )
{
let d = Dampener(Owner.FindInventory("Dampener"));
if ( d && d.bActive ) return true;
return false;
}
}
Class Forcefield : UnrealInventory
{
}
Class ForcefieldEffect : Actor
{
}
Class UFlashlight : UnrealInventory
{
}
Class USearchlight : UnrealInventory
{
}
Class SentryItem : UnrealInventory
{
}
Class MinigunSentry : Actor
{
}

View file

@ -0,0 +1,7 @@
Class FlameAmmo : Ammo
{
}
Class UFlamethrower : UTWeapon
{
}

View file

@ -0,0 +1,7 @@
Class PeaceAmmo : Ammo
{
}
Class Peacemaker : UTWeapon
{
}

View file

@ -0,0 +1,11 @@
Class UShells : Ammo
{
}
Class UShells2 : UShells
{
}
Class QuadShot : UTWeapon
{
}

View file

@ -0,0 +1,7 @@
Class RazorAmmo : Ammo
{
}
Class Razorjack : UTWeapon
{
}

View file

@ -0,0 +1,11 @@
Class URifleAmmo : Ammo
{
}
Class URifleAmmo2 : URifleAmmo
{
}
Class URifle : UTWeapon
{
}

View file

@ -23,6 +23,10 @@ Class StingerAmmo : Ammo
}
}
Class StingerAmmo2 : StingerAmmo
{
}
Class StingerProjectile : Actor
{
Default
@ -89,17 +93,21 @@ Class Stinger : UTWeapon
if ( !weap ) return;
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
if ( hold ) A_Overlay(PSP_FLASH,"MFlashHold");
if ( hold )
{
A_SoundVolume(CHAN_WEAPON,Dampener.Active(self)?.1:1.);
A_Overlay(PSP_FLASH,"MFlashHold");
}
else
{
A_PlaySound("stinger/fire",CHAN_WEAPON);
A_PlaySound("stinger/fire",CHAN_WEAPON,Dampener.Active(self)?.1:1.);
A_Overlay(PSP_FLASH,"MFlash");
}
A_OverlayFlags(PSP_FLASH,PSPF_RenderStyle,true);
A_OverlayRenderstyle(PSP_FLASH,STYLE_Add);
UTMainHandler.DoFlash(self,Color(16,0,64,255),1);
UTMainHandler.DoSwing(self,(FRandom[Stinger](-0.1,-0.2),FRandom[Stinger](-0.1,0.1)),4,-1.5,2,SWING_Spring,2,2);
A_AlertMonsters();
if ( !Dampener.Active(self) ) A_AlertMonsters();
A_QuakeEx(1,1,1,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
Vector3 x, y, z;
[x, y, z] = dt_Matrix4.GetAxes(pitch,angle,roll);
@ -115,13 +123,13 @@ Class Stinger : UTWeapon
Weapon weap = Weapon(invoker);
if ( !weap ) return;
if ( weap.Ammo1.Amount <= 0 ) return;
A_PlaySound("stinger/altfire",CHAN_WEAPON);
A_PlaySound("stinger/altfire",CHAN_WEAPON,Dampener.Active(self)?.1:1.);
A_Overlay(PSP_FLASH,"MFlash");
A_OverlayFlags(PSP_FLASH,PSPF_RenderStyle,true);
A_OverlayRenderstyle(PSP_FLASH,STYLE_Add);
UTMainHandler.DoFlash(self,Color(16,0,64,255),1);
UTMainHandler.DoSwing(self,(FRandom[Stinger](-0.3,-0.8),FRandom[Stinger](-0.4,0.4)),4,-1,3,SWING_Spring,3,5);
A_AlertMonsters();
if ( !Dampener.Active(self) ) A_AlertMonsters();
A_QuakeEx(1,1,1,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
Vector3 x, y, z;
[x, y, z] = dt_Matrix4.GetAxes(pitch,angle,roll);
@ -169,7 +177,7 @@ Class Stinger : UTWeapon
STNI A 3;
STNI A 0 A_Refire(1);
Goto Idle;
STNI A 0 A_PlaySound("stinger/hold",CHAN_WEAPON,1.0,true);
STNI A 0 A_PlaySound("stinger/hold",CHAN_WEAPON,CountInv("Dampener")?.1:1.,true);
Hold:
STNH A 1
{

View file

@ -0,0 +1,7 @@
Class StunnerAmmo : Ammo
{
}
Class Stunner : UTWeapon
{
}

View file

@ -5,3 +5,27 @@ Class UnrealArmor : UTArmor
-INVENTORY.ALWAYSPICKUP;
}
}
Class UArmor : UnrealArmor
{
}
Class KevlarSuit : UnrealArmor
{
}
Class AsbestosSuit : UnrealArmor
{
}
Class ToxinSuit : UnrealArmor
{
}
Class ShieldBelt : UnrealArmor
{
}
Class PowerShield : UnrealArmor
{
}

View file

@ -0,0 +1,7 @@
Class UBioAmmo : Ammo
{
}
Class UBioRifle : UTWeapon
{
}

View file

@ -0,0 +1,10 @@
Class URocketAmmo : Ammo
{
}
Class URocketAmmo2 : URocketAmmo
{
}
Class Eightball : UTWeapon
{
}

View file

@ -55,13 +55,13 @@ Class UFlakCannon : UTWeapon
if ( !weap ) return;
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
A_PlaySound("flak/fire",CHAN_WEAPON);
A_PlaySound("flak/fire",CHAN_WEAPON,Dampener.Active(self)?.2:1.);
A_Overlay(PSP_FLASH,"Flash");
A_OverlayFlags(PSP_FLASH,PSPF_RenderStyle,true);
A_OverlayRenderstyle(PSP_FLASH,STYLE_Add);
UTMainHandler.DoFlash(self,Color(48,255,96,0),1);
UTMainHandler.DoSwing(self,(FRandom[Flak](-0.3,-0.8),FRandom[Flak](-0.5,0.5)),4,-1.5,2,SWING_Spring,2,2);
A_AlertMonsters();
if ( !Dampener.Active(self) ) A_AlertMonsters();
A_QuakeEx(1,1,1,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.05);
}
action void A_FireSlug()
@ -70,13 +70,13 @@ Class UFlakCannon : UTWeapon
if ( !weap ) return;
if ( weap.Ammo1.Amount <= 0 ) return;
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
A_PlaySound("flak/altfire",CHAN_WEAPON);
A_PlaySound("flak/altfire",CHAN_WEAPON,Dampener.Active(self)?.2:1.);
A_Overlay(PSP_FLASH,"AltFlash");
A_OverlayFlags(PSP_FLASH,PSPF_RenderStyle,true);
A_OverlayRenderstyle(PSP_FLASH,STYLE_Add);
UTMainHandler.DoFlash(self,Color(32,255,96,0),1);
UTMainHandler.DoSwing(self,(FRandom[Flak](-0.4,-0.8),FRandom[Flak](0.4,0.8)),4,-1,3,SWING_Spring,3,5);
A_AlertMonsters();
if ( !Dampener.Active(self) ) A_AlertMonsters();
A_QuakeEx(2,2,2,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
}
Default

View file

@ -0,0 +1,19 @@
Class Bandages : Health
{
}
Class UHealth : Health
{
}
Class NaliFruit : Health
{
}
Class Seeds : UnrealInventory
{
}
Class SuperHealth : Health
{
}

View file

@ -0,0 +1,7 @@
Class UMiniAmmo : Ammo
{
}
Class UMinigun : UTWeapon
{
}

View file

@ -2,9 +2,9 @@ Class UPlayer : UTPlayer
{
Default
{
//Player.StartItem "Automag";
//Player.StartItem "DispersionPistol";
//Player.StartItem "UMiniAmmo", 30;
Player.StartItem "Automag";
Player.StartItem "DispersionPistol";
Player.StartItem "UMiniAmmo", 30;
}
// Have to modify the give cheat to handle UT armor
@ -304,7 +304,7 @@ Class UPlayerFemale : UPlayer
Goto Spawn+1;
Taunt2:
#### # 5;
PLT2 ABCDEFGHIJKLMNOPQR 4;
PLT2 ABCDEFGHIJKLMNOPQR 3;
Goto Spawn+1;
Taunt3:
#### # 5;
@ -495,6 +495,29 @@ Class UnrealInventory : Inventory
}
}
Class UTeleportFog : Actor
{
Default
{
+NOBLOCKMAP;
+NOTELEPORT;
+NOGRAVITY;
RenderStyle "Add";
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
Spawn("UTTeleportLight",pos+(0,0,16));
A_PlaySound ("misc/teleport");
}
States
{
Spawn:
TNT1 A 1;
Stop;
}
}
Class UnrealStaticHandler : StaticEventHandler
{
ui TextureID tex[6];
@ -576,19 +599,343 @@ 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 == 'Shotgun') || (e.Replacee == 'SuperShotgun') || (e.Replacee == 'Crossbow') )
if ( (e.Replacee == 'Chainsaw') || (e.Replacee == 'Gauntlets') )
{
/*if ( !Random[Replacements](0,3) ) e.Replacement = 'Automag';
else if ( Random[Replacements](0,1) ) */e.Replacement = 'Stinger';
/*else e.Replacement = 'ASMD';*/
if ( !Random[Replacements](0,3) ) e.Replacement = 'WeaponPowerUp';
else switch ( Random[Replacements](0,3) )
{
case 0:
e.Replacement = 'Bonesaw';
break;
case 1:
e.Replacement = 'Stunner';
break;
case 2:
e.Replacement = 'Betamag';
break;
case 3:
e.Replacement = 'Automag';
break;
}
}
else if ( (e.Replacee == 'Fist') || (e.Replacee == 'Staff') ) e.Replacement = 'DispersionPistol';
else if ( (e.Replacee == 'Pistol') || (e.Replacee == 'GoldWand') )
{
if ( !Random[Replacements](0,2) ) e.Replacement = 'Betamag';
else e.Replacement = 'Automag';
}
else if ( (e.Replacee == 'Shotgun') || (e.Replacee == 'SuperShotgun') || (e.Replacee == 'Crossbow') )
{
if ( !Random[Replacements](0,3) )
{
if ( !Random[Replacements](0,2) ) e.Replacement = 'Betamag';
else e.Replacement = 'Automag';
}
else switch( Random[Replacements](0,2) )
{
case 0:
e.Replacement = 'Stinger';
break;
case 1:
e.Replacement = 'ASMD';
break;
case 2:
e.Replacement = 'QuadShot';
break;
}
}
else if ( (e.Replacee == 'Chaingun') || (e.Replacee == 'Blaster') )
{
if ( Random[Replacements](0,1) ) e.Replacement = 'UMinigun';
else e.Replacement = 'Razorjack';
}
else if ( (e.Replacee == 'RocketLauncher') || (e.Replacee == 'PhoenixRod') )
{
/*if ( Random[Replacements](0,1) ) */e.Replacement = 'UFlakCannon';
/*else e.Replacement = 'Eightball';*/
switch ( Random[Replacements](0,2) )
{
case 0:
e.Replacement = 'FlameGun';
break;
case 1:
e.Replacement = 'UFlakCannon';
break;
case 2:
e.Replacement = 'Eightball';
break;
}
}
else if ( (e.Replacee == 'PlasmaRifle') || (e.Replacee == 'SkullRod') )
{
switch ( Random[Replacements](0,2) )
{
case 0:
e.Replacement = 'UFlamethrower';
break;
case 1:
e.Replacement = 'URifle';
break;
case 2:
e.Replacement = 'UBioRifle';
break;
}
}
else if ( (e.Replacee == 'BFG9000') || (e.Replacee == 'Mace') )
{
if ( Random[Replacements](0,1) ) e.Replacement = 'SMiniGun';
else e.Replacement = 'BigGun';
}
else if ( (e.Replacee == 'Clip') || (e.Replacee == 'GoldWandAmmo') || (e.Replacee == 'GoldWandHefty') ) e.Replacement = 'UClip';
else if ( (e.Replacee == 'ClipBox') )
{
if ( !Random[Replacements](0,2) ) e.Replacement = 'UClip';
else if ( Random[Replacements](0,1) ) e.Replacement = 'UMiniAmmo';
else e.Replacement = 'RazorAmmo';
}
else if ( (e.Replacee == 'BlasterAmmo') || (e.Replacee == 'BlasterHefty') )
{
if ( Random[Replacements](0,1) ) e.Replacement = 'UMiniAmmo';
else e.Replacement = 'RazorAmmo';
}
else if ( (e.Replacee == 'Shell') || (e.Replacee == 'CrossbowAmmo') )
{
if ( !Random[Replacements](0,2) ) e.Replacement = 'UClip';
else switch( Random[Replacements](0,2) )
{
case 0:
e.Replacement = 'StingerAmmo2';
break;
case 1:
e.Replacement = 'ASMDAmmo2';
break;
case 2:
e.Replacement = 'UShells2';
break;
}
}
else if ( (e.Replacee == 'ShellBox') || (e.Replacee == 'CrossbowHefty') )
{
switch( Random[Replacements](0,2) )
{
case 0:
e.Replacement = 'StingerAmmo';
break;
case 1:
e.Replacement = 'ASMDAmmo';
break;
case 2:
e.Replacement = 'UShells';
break;
}
}
else if ( (e.Replacee == 'RocketAmmo') || (e.Replacee == 'PhoenixRodAmmo') || (e.Replacee == 'MaceAmmo') )
{
if ( Random[Replacements](0,1) )
{
if ( !Random[Replacements](0,3) ) e.Replacement = 'UFlakBox';
else e.Replacement = 'UFlakAmmo';
}
else
{
if ( !Random[Replacements](0,3) ) e.Replacement = 'URocketAmmo';
else e.Replacement = 'URocketAmmo2';
}
}
else if ( (e.Replacee == 'RocketBox') || (e.Replacee == 'PhoenixRodHefty') || (e.Replacee == 'MaceHefty') )
{
if ( Random[Replacements](0,1) ) e.Replacement = 'UFlakBox';
else e.Replacement = 'URocketAmmo';
}
else if ( (e.Replacee == 'Cell') || (e.Replacee == 'SkullRodAmmo') )
{
if ( !Random[Replacements](0,4) ) e.Replacement = 'BigAmmo2';
else if ( Random[Replacements](0,1) )
{
if ( !Random[Replacements](0,3) ) e.Replacement = 'ImpalerAmmo';
else e.Replacement = 'ImpalerAmmo2';
}
else
{
if ( !Random[Replacements](0,3) ) e.Replacement = 'URifleAmmo';
else e.Replacement = 'URifleAmmo2';
}
}
else if ( (e.Replacee == 'CellPack') || (e.Replacee == 'SkullRodHefty') )
{
if ( !Random[Replacements](0,4) ) e.Replacement = 'BigAmmo';
else if ( Random[Replacements](0,1) ) e.Replacement = 'ImpalerAmmo';
else e.Replacement = 'URifleAmmo';
}
else if ( (e.Replacee == 'InvulnerabilitySphere') || (e.Replacee == 'ArtiInvulnerability') ) e.Replacement = 'PowerShield';
else if ( (e.Replacee == 'Berserk') || (e.Replacee == 'ArtiTomeOfPower') )
{
if ( !Random[Replacements](0,2) ) e.Replacement = 'WeaponPowerUp';
else e.Replacement = 'Amplifier';
}
else if ( e.Replacee == 'ArtiEgg' ) e.Replacement = 'VoiceBox';
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 == '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';
else if ( (e.Replacee == 'HealthBonus') || (e.Replacee == 'CrystalVial') ) e.Replacement = 'Bandages';
else if ( (e.Replacee == 'GreenArmor') || (e.Replacee == 'Silvershield') ) e.Replacement = 'KevlarSuit';
else if ( (e.Replacee == 'BlueArmor') || (e.Replacee == 'EnchantedShield') ) e.Replacement = 'UArmor';
else if ( e.Replacee == 'Stimpack' )
{
if ( !Random[Replacements](0,2) ) e.Replacement = 'UHealth';
else e.Replacement = 'Seeds';
}
else if ( e.Replacee == 'Medikit' ) e.Replacement = 'UHealth';
else if ( e.Replacee == 'ArtiHealth' )
{
if ( !Random[Replacements](0,2) ) e.Replacement = 'UHealth';
else e.Replacement = 'Seeds';
}
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) )
{
case 0:
e.Replacement = 'UnrealBackpack';
break;
case 1:
e.Replacement = 'ShieldBelt';
break;
case 2:
e.Replacement = 'SuperHealth';
break;
case 3:
e.Replacement = 'Amplifier';
break;
case 4:
e.Replacement = 'WeaponPowerUp';
break;
case 5:
e.Replacement = 'VoiceBox';
break;
case 6:
e.Replacement = 'SentryItem';
break;
}
}
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")
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 '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 'EnhancedShockAmmo' ) e.Replacement = 'UNothing';
else if ( e.Replacee is 'UTBackpack' ) e.Replacement = 'UnrealBackpack';
else if ( e.Replacee is 'UDamage' ) e.Replacement = 'Amplifier';
}
// translocator stuff
override void PlayerEntered( PlayerEvent e )
{
if ( flak_translocator )
{
players[e.playernumber].mo.TakeInventory("Translocator",1);
players[e.playernumber].mo.GiveInventory("UTranslocator",1);
}
}
override void PlayerRespawned( PlayerEvent e )
{
if ( flak_translocator )
{
players[e.playernumber].mo.TakeInventory("Translocator",1);
players[e.playernumber].mo.GiveInventory("UTranslocator",1);
}
}
override void NetworkProcess( ConsoleEvent e )
{
if ( e.Name ~== "refreshtrans" )
{
if ( flak_translocator )
{
for ( int i=0; i<MAXPLAYERS; i++ ) if ( playeringame[i] )
{
players[i].mo.TakeInventory("Translocator",1);
players[i].mo.GiveInventory("UTranslocator",1);
}
}
else
{
for ( int i=0; i<MAXPLAYERS; i++ ) if ( playeringame[i] )
{
players[i].mo.TakeInventory("UTranslocator",1);
}
}
}
else if ( e.Replacee == 'Backpack' ) e.Replacement = 'UnrealBackpack';
}
}

View file

@ -23,8 +23,10 @@ Class UnrealHUD : BaseStatusBar
TextureID HalfHud, HudLine, HudAmmo, IconHeal, IconSkul, IconSel, IconBase;
// 0.83 HUD stuff
String OldAmmo[32];
Class<Ammo> OldAmmoType[32];
String OldAmmo[18];
Class<Inventory> OldAmmoType[18];
String OldArmor[6];
Class<Inventory> OldArmorType[6];
HUDFont mOldDigits;
// Translations
@ -58,10 +60,54 @@ Class UnrealHUD : BaseStatusBar
IconBase = TexMan.CheckForTexture("IconBase",TexMan.Type_Any);
RedIcon = Translation.GetID('RedIcon');
mOldDigits = HUDFont.Create(Font.FindFont('U083Digits'),26,Mono_CellLeft);
OldAmmo[0] = "Clip083";
OldAmmo[1] = "Shell083";
OldAmmo[0] = "Disp083";
OldAmmo[1] = "Clip083";
OldAmmo[2] = "Tary083";
OldAmmo[3] = "Asmd083";
OldAmmo[4] = "Rokt083";
OldAmmo[5] = "Flak083";
OldAmmo[6] = "Razor083";
OldAmmo[7] = "Bio083";
OldAmmo[8] = "Rifle083";
OldAmmo[9] = "Mini083";
OldAmmo[10] = "Shell083";
OldAmmo[11] = "Impal083";
OldAmmo[12] = "Flame083";
OldAmmo[13] = "Tele083";
OldAmmo[14] = "Stun083";
OldAmmo[15] = "Big083";
OldAmmo[16] = "Smini083";
OldAmmo[17] = "Peace083";
OldAmmoType[0] = "DispersionAmmo";
OldAmmoType[1] = "UMiniAmmo";
OldAmmoType[2] = "StingerAmmo";
OldAmmoType[3] = "AsmdAmmo";
OldAmmoType[4] = "URocketAmmo";
OldAmmoType[5] = "UFlakBox";
OldAmmoType[6] = "RazorAmmo";
OldAmmoType[7] = "UBioAmmo";
OldAmmoType[8] = "URifleAmmo";
OldAmmoType[9] = "UMinigun";
OldAmmoType[10] = "UShells";
OldAmmoType[11] = "ImpalerAmmo";
OldAmmoType[12] = "FlameAmmo";
OldAmmoType[13] = "UTranslocatorAmmo";
OldAmmoType[14] = "StunnerAmmo";
OldAmmoType[15] = "BigAmmo";
OldAmmoType[16] = "SMiniAmmo";
OldAmmoType[17] = "PeaceAmmo";
OldArmor[0] = "Armor083";
OldArmor[1] = "Kev083";
OldArmor[2] = "Asb083";
OldArmor[3] = "Tox083";
OldArmor[4] = "Belt083";
OldArmor[5] = "Pbelt083";
OldArmorType[0] = "UArmor";
OldArmorType[1] = "KevlarSuit";
OldArmorType[2] = "AsbestosSuit";
OldArmorType[3] = "ToxinSuit";
OldArmorType[4] = "ShieldBelt";
OldArmorType[5] = "PowerShield";
}
override void Draw( int state, double TicFrac )
@ -144,6 +190,8 @@ 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.));
}
private void DrawFragCount( double x, double y )
@ -473,8 +521,8 @@ Class UnrealHUD : BaseStatusBar
bool used = (CPlayer.ReadyWeapon&&(CPlayer.ReadyWeapon.SlotNumber==i));
DrawImage("Slot083",(slotofs[i],342),DI_ITEM_OFFSETS,used?1.:.8);
}
DrawString(mOldDigits,FormatNumber(CPlayer.health,3),(359,367),DI_TEXT_ALIGN_RIGHT);
int ArmorAmount = 0, CurAbs = 0;
DrawString(mOldDigits,FormatNumber(CPlayer.health,3),(358,366),DI_TEXT_ALIGN_RIGHT);
int ArmorAmount = 0, CurAbs = -1;
Inventory BestArmor = null;
for ( Inventory Inv=CPlayer.mo.Inv; Inv; Inv=Inv.Inv )
{
@ -487,17 +535,24 @@ Class UnrealHUD : BaseStatusBar
BestArmor = Inv;
}
}
// TODO draw different icons based on armor class
if ( BestArmor ) DrawImage("Armor083",(4,340),DI_ITEM_OFFSETS);
if ( ArmorAmount ) DrawString(mOldDigits,FormatNumber(ArmorAmount,3),(168,367),DI_TEXT_ALIGN_RIGHT);
for ( int i=0; i<6; i++ )
{
if ( !(BestArmor is OldArmorType[i]) ) continue;
DrawImage(OldArmor[i],(4,340),DI_ITEM_OFFSETS);
break;
}
if ( ArmorAmount ) DrawString(mOldDigits,FormatNumber(ArmorAmount,3),(167,366),DI_TEXT_ALIGN_RIGHT);
Inventory Ammo1, Ammo2;
[Ammo1, Ammo2] = GetCurrentAmmo();
if ( Ammo1 )
{
if ( Ammo1.Amount ) DrawString(mOldDigits,FormatNumber(Ammo1.Amount,3),(550,367),DI_TEXT_ALIGN_RIGHT);
for ( int i=0; i<32; i++ )
if ( Ammo1.Amount ) DrawString(mOldDigits,FormatNumber(Ammo1.Amount,3),(549,366),DI_TEXT_ALIGN_RIGHT);
for ( int i=0; i<18; i++ )
{
if ( !(Ammo1 is OldAmmoType[i]) ) continue;
// 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);
break;
}

View file

@ -0,0 +1,25 @@
Class UInvisibility : UnrealInventory
{
}
Class PowerUInvisibility : PowerInvisibility
{
}
Class Amplifier : UnrealInventory
{
static Amplifier Active( Actor Owner )
{
let d = Amplifier(Owner.FindInventory("Amplifier"));
if ( d && d.bActive ) return d;
return null;
}
}
Class UJumpBoots : UnrealInventory
{
}
Class MotionDetector : UnrealInventory
{
}

View file

@ -0,0 +1,7 @@
Class UTranslocatorAmmo : Ammo
{
}
Class UTranslocator : UTWeapon
{
}