"Bonk Hammer" fun option.

This commit is contained in:
Mari the Deer 2022-08-11 18:04:05 +02:00
commit c0ae825f52
6 changed files with 25 additions and 2 deletions

View file

@ -422,6 +422,7 @@ extend Class SWWMWeapon
if ( raging ) flg |= DMG_FOILINVUL;
int quakin = raging?8:2;
double diff = 0.;
bool hdoomgal = false;
for ( int i=0; i<mt.hits.Size(); i++ )
{
if ( !mt.hits[i].a ) continue;
@ -431,6 +432,7 @@ extend Class SWWMWeapon
if ( !mt.hits[i].a.bDORMANT ) mt.hits[i].a.DaggerAlert(self);
if ( !mt.hits[i].a.bNOBLOOD && !mt.hits[i].a.bDORMANT && (raging || !mt.hits[i].a.bINVULNERABLE) ) blooded = true;
else bloodless = true;
if ( SWWMHDoomHandler.IsCuteGirl(mt.hits[i].a) ) hdoomgal = true;
let p = SWWMPuff.Setup(mt.hits[i].pos,mt.hits[i].dir,invoker,self,mt.hits[i].a);
int newdmg = mt.hits[i].a.DamageMobj(p,self,dmg,'Melee',flg);
// things can instantly cease to exist after taking damage (wow)
@ -459,6 +461,21 @@ extend Class SWWMWeapon
}
self.angle += clamp(diff/mt.hits.Size(),-5.,5.); // averaged reorient
A_QuakeEx(quakin/2,quakin/2,quakin/2,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:0.06*quakin);
if ( flags&MELEE_HammerHit )
{
if ( hdoomgal )
{
flags |= MELEE_ForceSound;
flags &= ~MELEE_FleshSound;
hitsound = "misc/clonk6";
}
else if ( swwm_bonkhammer )
{
flags |= MELEE_ForceSound;
flags &= ~MELEE_FleshSound;
hitsound = "misc/clonk"..Random[Hammer](1,11);
}
}
if ( raging && !(flags&MELEE_ForceSound) )
{
if ( blooded ) A_StartSound("demolitionist/xpunchf",CHAN_WEAPON,CHANF_OVERLAP);