Demoslayer mode now has "ammo orbs" as well.
This commit is contained in:
parent
94e421aca1
commit
7d6562c326
6 changed files with 75 additions and 46 deletions
|
|
@ -218,6 +218,7 @@ extend Class SWWMHandler
|
|||
if ( src.Health < 100 )
|
||||
{
|
||||
int amt = clamp(e.Thing.SpawnHealth()/20,1,10);
|
||||
if ( e.Thing.bBOSS || e.Thing.FindInventory("BossMarker") ) amt *= 2;
|
||||
if ( e.Thing.Health < (e.Thing.GetGibHealth()*2) ) amt *= 3;
|
||||
else if ( e.Thing.Health < e.Thing.GetGibHealth() ) amt *= 2;
|
||||
for ( int i=0; i<amt; i++ )
|
||||
|
|
@ -231,7 +232,8 @@ extend Class SWWMHandler
|
|||
}
|
||||
if ( src.CountInv("ArmorNugget") < 100 )
|
||||
{
|
||||
int amt = clamp(e.Thing.SpawnHealth()/40,1,5);
|
||||
int amt = clamp(e.Thing.SpawnHealth()/30,1,10);
|
||||
if ( e.Thing.bBOSS || e.Thing.FindInventory("BossMarker") ) amt *= 2;
|
||||
if ( e.Thing.Health < (e.Thing.GetGibHealth()*2) ) amt *= 3;
|
||||
else if ( e.Thing.Health < e.Thing.GetGibHealth() ) amt *= 2;
|
||||
for ( int i=0; i<amt; i++ )
|
||||
|
|
@ -243,6 +245,28 @@ extend Class SWWMHandler
|
|||
a.vel.xy = (cos(ang),sin(ang))*FRandom[Junk](4,8);
|
||||
}
|
||||
}
|
||||
bool needsammo = false;
|
||||
for ( Inventory i=src.Inv; i; i=i.inv )
|
||||
{
|
||||
if ( !(i is 'SWWMAmmo') || (i.Stamina <= 0) || (i.Stamina > 50000) || (i.Amount >= i.MaxAmount) ) continue;
|
||||
needsammo = true;
|
||||
break;
|
||||
}
|
||||
if ( needsammo )
|
||||
{
|
||||
int amt = clamp(e.Thing.SpawnHealth()/40,1,10);
|
||||
if ( e.Thing.bBOSS || e.Thing.FindInventory("BossMarker") ) amt *= 2;
|
||||
if ( e.Thing.Health < (e.Thing.GetGibHealth()*2) ) amt *= 3;
|
||||
else if ( e.Thing.Health < e.Thing.GetGibHealth() ) amt *= 2;
|
||||
for ( int i=0; i<amt; i++ )
|
||||
{
|
||||
if ( Random[Junk](0,1) ) continue;
|
||||
let a = Actor.Spawn("AmmoOrb",e.Thing.Vec3Offset(0,0,e.Thing.Height/2));
|
||||
a.vel.z = FRandom[Junk](4,16);
|
||||
double ang = FRandom[Junk](0,360);
|
||||
a.vel.xy = (cos(ang),sin(ang))*FRandom[Junk](4,8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// no credits unless it's a counted kill or marine (that isn't friendly) or another player in DM
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue