swwmgz_m/zscript/items/swwm_ammospawn.zsc
Marisa the Magician 93ac4d3a4f Remove Dragon's Breath shells.
Nuggets can no longer be stored as spares.
2022-06-07 12:31:02 +02:00

245 lines
7.5 KiB
Text

// on-demand ammo spawners
Mixin Class SWWMOndemandAmmoSpawner
{
Actor dropper;
bool enemydrop;
int dropamount;
override void ModifyDropAmount( int amt )
{
dropamount = amt;
}
override bool SpecialDropAction( Actor dropper )
{
self.dropper = dropper;
enemydrop = true;
return false;
}
override void SpawnAmmo()
{
let ac = PickAmmo();
if ( !ac ) return;
let a = Spawn(ac,pos);
if ( enemydrop )
{
a.bDropped = true;
a.bNoGravity = false;
if ( !(level.compatflags&COMPATF_NOTOSSDROPS) )
a.TossItem();
if ( a is 'Inventory' )
{
let i = Inventory(a);
i.bTossed = true;
if ( i.SpecialDropAction(dropper) )
{
i.Destroy();
return;
}
}
}
SWWMUtility.TransferItemProp(self,a);
}
}
Class SWWMShellAmmoSmall : SWWMAmmoSpawner
{
Mixin SWWMOndemandAmmoSpawner;
static Class<Actor> PickAmmo( bool notondemand = false )
{
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('PuntzerBeta') || SWWMUtility.ItemExists('PuntzerGamma')) )
return Random[Replacements](0,2)?'SMW05SmallAmmo':'SMW05Ammo3';*/
switch( Random[Replacements](0,9) )
{
case 0:
case 1:
case 2:
return 'RedShell';
case 3:
case 4:
case 5:
return 'GreenShell';
case 6:
case 7:
return 'BlueShell';
}
// case 8-9
return 'PurpleShell';
}
}
Class SWWMShellAmmoBig : SWWMAmmoSpawner
{
Mixin SWWMOndemandAmmoSpawner;
static Class<Actor> PickAmmo( bool notondemand = false )
{
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('PuntzerBeta') || SWWMUtility.ItemExists('PuntzerGamma')) )
return Random[Replacements](0,2)?'SMW05SmallAmmo':'SMW05BigAmmo';*/
switch( Random[Replacements](0,14) )
{
case 0:
case 1:
case 2:
case 3:
return 'RedShell2';
case 4:
case 5:
case 6:
case 7:
return 'GreenShell2';
case 8:
case 9:
case 10:
return 'BlueShell';
case 11:
case 12:
return 'PurpleShell';
}
// case 13-14
return 'BlackShell';
}
}
Class SWWMClipAmmoSmall : SWWMAmmoSpawner
{
Mixin SWWMOndemandAmmoSpawner;
static Class<Actor> PickAmmo( bool notondemand = false )
{
if ( !Random[Replacements](0,4) )
{
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('HeavyMahsheenGun')) )
return Random[Replacements](0,2)?'SheenAmmo3':'SheenTinyAmmo';*/
if ( notondemand || SWWMUtility.ItemExists('Eviscerator') )
return 'EvisceratorShell';
}
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('PuntzerBeta') || SWWMUtility.ItemExists('PuntzerGamma')) )
return Random[Replacements](0,2)?'SMW05Ammo':'SMW05Ammo2';*/
return Random[Replacements](0,1)?'RedShell':'GreenShell';
}
}
Class SWWMClipAmmoBig : SWWMAmmoSpawner
{
Mixin SWWMOndemandAmmoSpawner;
static Class<Actor> PickAmmo( bool notondemand = false )
{
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('HeavyMahsheenGun')) )
return Random[Replacements](0,2)?'SheenSmallAmmo':'SheenBigAmmo';*/
return Random[Replacements](0,5)?'EvisceratorShell':Random[Replacements](0,2)?'EvisceratorShell2':'EvisceratorShell3';
}
}
Class SWWMBlastAmmoSmall : SWWMAmmoSpawner
{
Mixin SWWMOndemandAmmoSpawner;
static Class<Actor> PickAmmo( bool notondemand = false )
{
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('HeavyMahsheenGun')) )
return Random[Replacements](0,2)?'SheenSmallAmmo':'SheenTinyAmmo';*/
return 'EvisceratorShell';
}
}
Class SWWMBlastAmmoBig : SWWMAmmoSpawner
{
Mixin SWWMOndemandAmmoSpawner;
static Class<Actor> PickAmmo( bool notondemand = false )
{
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('HeavyMahsheenGun')) )
return Random[Replacements](0,2)?'SheenBigAmmo':'SheenSmallAmmo';*/
return Random[Replacements](0,2)?'EvisceratorShell':Random[Replacements](0,1)?'EvisceratorShell2':'EvisceratorShell3';
}
}
Class SWWMRocketAmmoSmall : SWWMAmmoSpawner
{
Mixin SWWMOndemandAmmoSpawner;
static Class<Actor> PickAmmo( bool notondemand = false )
{
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('Quadravol')) ) return 'QuadravolAmmo';*/
return Random[Replacements](0,2)?'HellblazerMissiles':'HellblazerCrackshots';
}
}
Class SWWMRocketAmmoBig : SWWMAmmoSpawner
{
Mixin SWWMOndemandAmmoSpawner;
static Class<Actor> PickAmmo( bool notondemand = false )
{
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('Quadravol')) )
return Random[Replacements](0,4)?'QuadravolAmmo2':'QuadravolAmmo3';*/
switch ( Random[Replacements](0,11) )
{
case 0:
case 1:
case 2:
case 3:
case 4:
return Random[Replacements](0,4)?'HellblazerMissiles':'HellblazerMissiles2';
case 5:
case 6:
case 7:
case 8:
return Random[Replacements](0,7)?'HellblazerCrackshots':'HellblazerCrackshots2';
case 9:
case 10:
return 'HellblazerRavagers';
}
// case 11
return 'HellblazerWarheads';
}
}
Class SWWMCellAmmoSmall : SWWMAmmoSpawner
{
Mixin SWWMOndemandAmmoSpawner;
static Class<Actor> PickAmmo( bool notondemand = false )
{
if ( !Random[Replacements](0,2) )
{
if ( !Random[Replacements](0,3) )
{
/*if ( !Random[Replacements](0,2) && (notondemand || SWWMUtility.ItemExists('MisterRifle')) ) return 'MisterGAmmo';*/
if ( notondemand || SWWMUtility.ItemExists('CandyGun') ) return 'CandyGunBullets';
}
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('RayKhom')) ) return 'RayBolt2';*/
if ( notondemand || SWWMUtility.ItemExists('SilverBullet') ) return Random[Replacements](0,2)?'SilverBullets':'SilverBullets2';
}
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('ModernSparkster')) ) return Random[Replacements](0,2)?'SparksterBAmmo':'SparksterRAmmo';*/
return 'SparkUnit';
}
}
Class SWWMCellAmmoBig : SWWMAmmoSpawner
{
Mixin SWWMOndemandAmmoSpawner;
static Class<Actor> PickAmmo( bool notondemand = false )
{
if ( !Random[Replacements](0,3) )
{
//if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('RafanKos')) && SWWMUtility.CheckNeedsItem('UltimateAmmo',true) && !SWWMUtility.ItemExists('UltimateAmmo',worldonly:true) && !SWWMUtility.ItemExists('RafanKos',worldonly:true) )
// return 'UltimateAmmo';
if ( (notondemand || SWWMUtility.ItemExists('Ynykron')) && SWWMUtility.CheckNeedsItem('YnykronAmmo',true) && !SWWMUtility.ItemExists('YnykronAmmo',worldonly:true) && !SWWMUtility.ItemExists('Ynykron',worldonly:true) )
return 'YnykronAmmo';
}
/*if ( Random[Replacements](0,1) )
{
if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('RayKhom')) ) return Random[Replacements](0,2)?'RayBolt5':'RayAmmo';
if ( notondemand || SWWMUtility.ItemExists('MisterRifle') ) return Random[Replacements](0,2)?'MisterRound5':'MisterAmmo';
}*/
if ( !Random[Replacements](0,2) && (notondemand || SWWMUtility.ItemExists('SilverBullet')) )
{
if ( Random[Replacements](0,3) ) return Random[Replacements](0,2)?'SilverBullets_2':'SilverBullets2_2';
return Random[Replacements](0,2)?'SilverBulletAmmo':'SilverBulletAmmo2';
}
if ( notondemand || SWWMUtility.ItemExists('CandyGun') ) return Random[Replacements](0,3)?'CandyGunBullets3':'CandyGunAmmo';
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('ModernSparkster')) )
{
if ( Random[Replacements](0,1) ) return Random[Replacements](0,2)?'SparksterBAmmo2':'SparksterBAmmo3';
return Random[Replacements](0,2)?'SparksterRAmmo2':'SparksterRAmmo3';
}*/
return Random[Replacements](0,3)?'SparkUnit':'SparkUnit2';
}
}