I WANT DIE overhaul, suffer.
Fix Silver Bullet ammo autoswitch on reload.
This commit is contained in:
parent
5734ff8fc7
commit
7260fd4140
4 changed files with 78 additions and 3 deletions
|
|
@ -173,6 +173,20 @@ Class SWWMStaticHandler : StaticEventHandler
|
|||
}
|
||||
}
|
||||
|
||||
// fuck
|
||||
Class DontDuplicate : Inventory {}
|
||||
Class DontDuplicate2 : Inventory {}
|
||||
Class HOLYCOWIMTOTALLYGOINGSOFASTOHFUCK : Inventory
|
||||
{
|
||||
override void DoEffect()
|
||||
{
|
||||
Super.DoEffect();
|
||||
if ( !Owner ) return;
|
||||
if ( (Owner.tics > 1) && (Owner.tics > max(1,Owner.CurState.tics/2)) )
|
||||
Owner.tics = max(1,Owner.CurState.tics/2);
|
||||
}
|
||||
}
|
||||
|
||||
// Handler responsible for item replacements and whatever else
|
||||
Class SWWMHandler : EventHandler
|
||||
{
|
||||
|
|
@ -1687,6 +1701,65 @@ Class SWWMHandler : EventHandler
|
|||
|
||||
override void WorldThingSpawned( WorldEvent e )
|
||||
{
|
||||
// I WANT DIE
|
||||
if ( G_SkillPropertyInt(SKILLP_ACSReturn) >= 4 )
|
||||
{
|
||||
if ( e.Thing.bMISSILE && !e.Thing.FindInventory("DontDuplicate") && !e.Thing.IsZeroDamage() && (e.Thing.target && e.Thing.target.bISMONSTER && !e.Thing.target.player) )
|
||||
{
|
||||
e.Thing.speed *= 2;
|
||||
e.Thing.vel *= 2;
|
||||
Vector3 x, y, z;
|
||||
[x, y, z] = swwm_CoordUtil.GetAxes(e.Thing.pitch,e.Thing.angle,e.Thing.roll);
|
||||
int numpt = Random[ExtraMissiles](1,2);
|
||||
for ( int i=0; i<numpt; i++ )
|
||||
{
|
||||
double a = FRandom[ExtraMissiles](0,360);
|
||||
double s = FRandom[ExtraMissiles](0,.1);
|
||||
Vector3 dir = (x+y*cos(a)*s+z*sin(a)*s).unit();
|
||||
let p = Actor.Spawn(e.Thing.GetClass(),e.Thing.pos);
|
||||
p.GiveInventory("DontDuplicate",1);
|
||||
p.target = e.Thing.target;
|
||||
p.tracer = e.Thing.tracer;
|
||||
p.master = e.Thing.master;
|
||||
p.speed *= FRandom[ExtraMissiles](1.,3.);
|
||||
p.vel = dir*p.speed;
|
||||
p.angle = atan2(dir.y,dir.x);
|
||||
p.pitch = asin(-dir.z);
|
||||
p.roll = e.Thing.roll;
|
||||
}
|
||||
}
|
||||
if ( e.Thing is 'BulletPuff' )
|
||||
{
|
||||
let s = Actor.Spawn("ExplodiumMagTrail",e.Thing.pos);
|
||||
s.Scale *= .4;
|
||||
Actor.Spawn("ExploLight",e.Thing.pos);
|
||||
e.Thing.A_StartSound("explodium/hit",CHAN_WEAPON,CHANF_OVERLAP,pitch:1.5);
|
||||
SWWMUtility.DoExplosion(e.Thing,10,7000,80);
|
||||
}
|
||||
if ( e.Thing.bISMONSTER && !(e.Thing is 'PlayerPawn') )
|
||||
{
|
||||
e.Thing.GiveInventory("HOLYCOWIMTOTALLYGOINGSOFASTOHFUCK",1);
|
||||
// random chance to spawn doubles
|
||||
if ( !e.Thing.FindInventory("DontDuplicate") && !Random[ExtraMissiles](0,2) )
|
||||
{
|
||||
int numpt = Random[ExtraMissiles](1,2);
|
||||
for ( int i=0; i<numpt; i++ )
|
||||
{
|
||||
let x = Actor.Spawn(e.Thing.GetClass(),e.Thing.Vec3Angle(e.Thing.Radius*FRandom[ExtraMissiles](1.5,4.),FRandom[ExtraMissiles](0,360)));
|
||||
if ( !x.TestMobjLocation() || !level.IsPointInLevel(x.pos) )
|
||||
{
|
||||
x.ClearCounters();
|
||||
x.Destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
x.angle = e.Thing.angle;
|
||||
x.GiveInventory("DontDuplicate",1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( e.Thing is 'Inventory' )
|
||||
CopyFloatBob(e.Thing);
|
||||
if ( swwm_doomfall && e.Thing.bISMONSTER )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue