Reduced gravity on Biosludge to make it feel more like the original. Buffed chainsaw altfire, making it hit fast on a wider arc. Correctly fixed armor + shield belt behaviors. Made it so jump boots drain after landing, thus preventing fall damage on the last jump in case it's enabled. Made jump boots drain slowly over time, for balance reasons (especially when jumping is disabled).
193 lines
4.2 KiB
Text
193 lines
4.2 KiB
Text
Class UTArmor : Armor
|
|
{
|
|
int absorb;
|
|
|
|
Property ArmorAbsorption : absorb;
|
|
|
|
Default
|
|
{
|
|
+INVENTORY.AUTOACTIVATE;
|
|
+INVENTORY.UNTOSSABLE;
|
|
-INVENTORY.KEEPDEPLETED;
|
|
+INVENTORY.ALWAYSPICKUP;
|
|
}
|
|
override void AbsorbDamage( int damage, Name damageType, out int newdamage )
|
|
{
|
|
int saved;
|
|
if ( (amount > 0) && !DamageTypeDefinition.IgnoreArmor(damageType) )
|
|
{
|
|
saved = int(damage*absorb/100.);
|
|
if ( amount <= saved ) saved = amount;
|
|
newdamage -= saved;
|
|
amount -= saved;
|
|
damage = newdamage;
|
|
}
|
|
if ( damage > 0 ) newdamage = ApplyDamageFactors(GetClass(),damageType,damage,damage);
|
|
}
|
|
}
|
|
|
|
Class UTArmorBonus : UTArmor replaces ArmorBonus
|
|
{
|
|
override void AbsorbDamage( int damage, Name damageType, out int newdamage )
|
|
{
|
|
absorb = Clamp(amount*2,25,75);
|
|
Super.AbsorbDamage(damage,damageType,newdamage);
|
|
}
|
|
|
|
Default
|
|
{
|
|
Tag "Armor Bonus";
|
|
+COUNTITEM;
|
|
Inventory.Amount 1;
|
|
Inventory.MaxAmount 50;
|
|
Inventory.InterHubAmount 50;
|
|
UTArmor.ArmorAbsorption 25;
|
|
Inventory.PickupMessage "You picked up an Armor Bonus.";
|
|
Inventory.PickupSound "misc/ut_shard";
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XANH A -1;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class UTThighPads : UTArmor replaces GreenArmor
|
|
{
|
|
override bool HandlePickup( Inventory item )
|
|
{
|
|
if ( item is 'UTThighPads' )
|
|
{
|
|
let s = Owner.FindInventory("UTShieldBelt");
|
|
if ( s )
|
|
{
|
|
// sum up current amounts
|
|
let a = Owner.FindInventory("UTBodyArmor");
|
|
int samount = s.amount;
|
|
if ( a ) samount += a.amount;
|
|
if ( amount < item.amount ) amount = item.amount;
|
|
amount = min(s.maxamount-samount,amount);
|
|
item.bPickupGood = true;
|
|
return true;
|
|
}
|
|
}
|
|
return Super.HandlePickup(item);
|
|
}
|
|
Default
|
|
{
|
|
Tag "Thigh Pads";
|
|
Inventory.Amount 50;
|
|
Inventory.MaxAmount 50;
|
|
Inventory.InterHubAmount 50;
|
|
UTArmor.ArmorAbsorption 50;
|
|
Inventory.PickupMessage "You got the Thigh Pads.";
|
|
Inventory.PickupSound "misc/ut_armor";
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
THIG A -1;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class UTBodyArmor : UTArmor replaces BlueArmor
|
|
{
|
|
override bool HandlePickup( Inventory item )
|
|
{
|
|
if ( item is 'UTBodyArmor' )
|
|
{
|
|
let s = Owner.FindInventory("UTShieldBelt");
|
|
if ( s )
|
|
{
|
|
// sum up current amounts
|
|
let p = Owner.FindInventory("UTThighPads");
|
|
int samount = s.amount;
|
|
if ( p ) samount += p.amount;
|
|
if ( amount < item.amount ) amount = item.amount;
|
|
amount = min(s.maxamount-samount,amount);
|
|
item.bPickupGood = true;
|
|
return true;
|
|
}
|
|
}
|
|
return Super.HandlePickup(item);
|
|
}
|
|
Default
|
|
{
|
|
Tag "Body Armor";
|
|
Inventory.Amount 100;
|
|
Inventory.MaxAmount 100;
|
|
Inventory.InterHubAmount 100;
|
|
UTArmor.ArmorAbsorption 75;
|
|
Inventory.PickupMessage "You got the Body Armor.";
|
|
Inventory.PickupSound "misc/ut_armor";
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
UARM A -1;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class UTShieldBelt : UTArmor replaces Megasphere
|
|
{
|
|
override void AbsorbDamage( int damage, Name damageType, out int newdamage )
|
|
{
|
|
if ( (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,"The Shield Belt has depleted.");
|
|
}
|
|
override bool HandlePickup( Inventory item )
|
|
{
|
|
if ( (item is 'UTBodyArmor') || (item is 'UTThighPads') )
|
|
{
|
|
// sum up current amounts
|
|
let a = Owner.FindInventory("UTBodyArmor");
|
|
let p = Owner.FindInventory("UTThighPads");
|
|
int samount = amount;
|
|
if ( a ) samount += a.amount;
|
|
if ( p ) samount += p.amount;
|
|
item.amount = min(item.amount,maxamount-samount);
|
|
if ( item.amount <= 0 )
|
|
{
|
|
item.amount = 1;
|
|
amount -= 1;
|
|
}
|
|
}
|
|
if ( item is 'UTShieldBelt' ) Use(true);
|
|
return Super.HandlePickup(item);
|
|
}
|
|
override bool Use( bool pickup )
|
|
{
|
|
// removes thigh pads and body armor like in UT
|
|
Owner.TakeInventory("UTThighPads",50);
|
|
Owner.TakeInventory("UTBodyArmor",150);
|
|
return false;
|
|
}
|
|
Default
|
|
{
|
|
Tag "Shield Belt";
|
|
+COUNTITEM;
|
|
+INVENTORY.BIGPOWERUP;
|
|
Inventory.Amount 150;
|
|
Inventory.MaxAmount 150;
|
|
Inventory.InterHubAmount 150;
|
|
UTArmor.ArmorAbsorption 100;
|
|
Inventory.PickupMessage "You got the Shield Belt.";
|
|
Inventory.PickupSound "belt/pickup";
|
|
Inventory.RespawnTics 2100;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
BELT A -1;
|
|
Stop;
|
|
}
|
|
}
|