256 lines
8.5 KiB
Text
256 lines
8.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 'PurpleShell';
|
|
}
|
|
// case 8-9
|
|
return 'BlueShell';
|
|
}
|
|
}
|
|
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,17) )
|
|
{
|
|
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 'PurpleShell';
|
|
case 11:
|
|
case 12:
|
|
case 13:
|
|
return 'BlueShell';
|
|
case 14:
|
|
case 15:
|
|
return 'WhiteShell';
|
|
}
|
|
// case 16-17
|
|
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('ModernSparkster')) ) return Random[Replacements](0,2)?'SparksterBAmmo':'SparksterRAmmo';*/
|
|
/*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('ModernSparkster')) )
|
|
{
|
|
if ( Random[Replacements](0,1) ) return Random[Replacements](0,2)?'SparksterBAmmo2':'SparksterBAmmo3';
|
|
return Random[Replacements](0,2)?'SparksterRAmmo2':'SparksterRAmmo3';
|
|
}*/
|
|
/*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) && (notondemand || SWWMUtility.ItemExists('RayKhom') || SWWMUtility.ItemExists('GrandLance')) ) return 'RayBattery';*/
|
|
if ( !Random[Replacements](0,2) )
|
|
{
|
|
if ( !Random[Replacements](0,3) )
|
|
{
|
|
/*if ( !Random[Replacements](0,2) && (notondemand || SWWMUtility.ItemExists('MisterRifle')) ) return 'MisterGAmmo';*/
|
|
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('RayKhom')) ) return 'RayBolt2';*/
|
|
if ( notondemand || SWWMUtility.ItemExists('CandyGun') ) return 'CandyGunBullets';
|
|
}
|
|
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('EMPCarbine')) ) return 'EMPCore';*/
|
|
if ( notondemand || SWWMUtility.ItemExists('SilverBullet') ) return Random[Replacements](0,2)?'SilverBullets':'SilverBullets2';
|
|
}
|
|
/*if ( !Random[Replacements](0,4) && (notondemand || SWWMUtility.ItemExists('BlackfireIgniter')) ) return 'DarkCanister';*/
|
|
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('GrandLance')) && SWWMUtility.CheckNeedsItem('GrandAmmo',true) && !SWWMUtility.ItemExists('GrandAmmo',worldonly:true) && !SWWMUtility.ItemExists('GrandLance',worldonly:true) )
|
|
// return 'GrandAmmo';
|
|
//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,2) && (notondemand || SWWMUtility.ItemExists('EMPCarbine')) ) return Random[Replacements](0,3)?'EMPCore2':'EMPCore';
|
|
if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('MisterRifle')) ) return Random[Replacements](0,2)?'MisterRound5':'MisterAmmo';
|
|
if ( notondemand || SWWMUtility.ItemExists('RayKhom') ) return Random[Replacements](0,2)?'RayBolt5':'RayAmmo';
|
|
}*/
|
|
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,2) && (notondemand || SWWMUtility.ItemExists('BlackfireIgniter')) ) return 'DarkCanister';*/
|
|
return Random[Replacements](0,3)?'SparkUnit':'SparkUnit2';
|
|
}
|
|
}
|