Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
SoDOOManiac

Can DeHackEd affect the arch-vile attack damage?

Question

I see the arch-vile attack does damage twice: 20 damage points directly and 70 damage points radius damage from the fire position center, like explosion of the fire.

Chocolate Doom code:

void A_VileAttack (mobj_t* actor)
{    
    mobj_t*    fire;
    int        an;
    
    if (!actor->target)
    return;
    
    A_FaceTarget (actor);

    if (!P_CheckSight (actor, actor->target) )
    return;

    S_StartSound (actor, sfx_barexp);
    P_DamageMobj (actor->target, actor, actor, 20);
    actor->target->momz = 1000*FRACUNIT/actor->target->info->mass;
    
    an = actor->angle >> ANGLETOFINESHIFT;

    fire = actor->tracer;

    if (!fire)
    return;
        
    // move the fire between the vile and the player
    fire->x = actor->target->x - FixedMul (24*FRACUNIT, finecosine[an]);
    fire->y = actor->target->y - FixedMul (24*FRACUNIT, finesine[an]);    
    P_RadiusAttack (fire, actor, 70 );
}

But in the unchanged DeHackEd data the Arch-Vile attack damage is 0 (unlike Imp fireball having 3 base damage, Caco fireball having 5...)

Where is that DeHackEd value from Arch-Vile damage applied?

Arch-Vile attack.png

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 1

The "Archvile attack" is just the fire sprite which appears on the player (or on other monsters).

 

The damage values (20 and 70) are not part of that thing, and cannot be changed via DEHACKED.

Share this post


Link to post
  • 1
13 hours ago, SoDOOManiac said:

But in the unchanged DeHackEd data the Arch-Vile attack damage is 0 (unlike Imp fireball having 3 base damage, Caco fireball having 5...)

As you can see in the code excerpt you've posted, the damage is hardcoded in the function instead of being a property of the object.

 

For comparison, here's the code for fireball damage, it's part of the collision detection code since it's inflicted on impact:

Spoiler

//
// PIT_CheckThing
//
boolean PIT_CheckThing (mobj_t* thing)
{
    fixed_t		blockdist;
    boolean		solid;
    int			damage;
		
    if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_SHOOTABLE) ))
	return true;
    
    blockdist = thing->radius + tmthing->radius;

    if ( abs(thing->x - tmx) >= blockdist
	 || abs(thing->y - tmy) >= blockdist )
    {
	// didn't hit it
	return true;	
    }
    
    // don't clip against self
    if (thing == tmthing)
	return true;
    
    // check for skulls slamming into things
    if (tmthing->flags & MF_SKULLFLY)
    {
	damage = ((P_Random()%8)+1)*tmthing->info->damage;
	
	P_DamageMobj (thing, tmthing, tmthing, damage);
	
	tmthing->flags &= ~MF_SKULLFLY;
	tmthing->momx = tmthing->momy = tmthing->momz = 0;
	
	P_SetMobjState (tmthing, tmthing->info->spawnstate);
	
	return false;		// stop moving
    }

    
    // missiles can hit other things
    if (tmthing->flags & MF_MISSILE)
    {
	// see if it went over / under
	if (tmthing->z > thing->z + thing->height)
	    return true;		// overhead
	if (tmthing->z+tmthing->height < thing->z)
	    return true;		// underneath
		
	if (tmthing->target && (
	    tmthing->target->type == thing->type || 
	    (tmthing->target->type == MT_KNIGHT && thing->type == MT_BRUISER)||
	    (tmthing->target->type == MT_BRUISER && thing->type == MT_KNIGHT) ) )
	{
	    // Don't hit same species as originator.
	    if (thing == tmthing->target)
		return true;

	    if (thing->type != MT_PLAYER)
	    {
		// Explode, but do no damage.
		// Let players missile other players.
		return false;
	    }
	}
	
	if (! (thing->flags & MF_SHOOTABLE) )
	{
	    // didn't do any damage
	    return !(thing->flags & MF_SOLID);	
	}
	
	// damage / explode
	damage = ((P_Random()%8)+1)*tmthing->info->damage;
	P_DamageMobj (thing, tmthing, tmthing->target, damage);

	// don't traverse any more
	return false;				
    }
    
    // check for special pickup
    if (thing->flags & MF_SPECIAL)
    {
	solid = thing->flags&MF_SOLID;
	if (tmflags&MF_PICKUP)
	{
	    // can remove thing
	    P_TouchSpecialThing (thing, tmthing);
	}
	return !solid;
    }
	
    return !(thing->flags & MF_SOLID);
}

 

More precisely, the relevant snippet:

	// damage / explode
	damage = ((P_Random()%8)+1)*tmthing->info->damage;
	P_DamageMobj (thing, tmthing, tmthing->target, damage);

You see it takes the object property (tmthing->info->damage), multiplies it by 1d8, and then applies the results.

Share this post


Link to post
  • 0

If you are willing to compromise a fair bit on the original behavior of the Archvile attack, it is possible to "adjust" the damage by replacing the A_VileAttack codepointer with another A_FaceTarget codepointer, and doing the damage instead on the flame thing using the A_Detonate MBF codepointer, which uses the Damage value of the thing. (But the flame will always deal damage around itself when Detonate is called, regardless of vile line of sight. It will track the same though, so it's possible to escape it.)

Example .bex patch:

Patch File for DeHackEd v3.0
# Created with WhackEd4 1.2.4 BETA
# Note: Use the pound sign ('#') to start comment lines.

Doom version = 21
Patch format = 6


Thing 5 (Archvile attack)
Death sound = 82
Missile damage = 32

[CODEPTR]
FRAME 264 = FaceTarget
FRAME 309 = Detonate
FRAME 310 = Scream

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×