A_ChangeDamage

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: Developers

A_ChangeDamage

Postby Eriance » Fri Jan 20, 2012 3:31 pm

I got the idea from the "Damage per distance" thread that go no'ed. It would be something I personally could make use of as well for balancing some of DE's weapons.

Originally, I was going to suggest a generic function that change any property; such as "A_ChangeProperty(flag "Property", bool add(1)/subtract(0), int amount)) but that seemed too broad and probably cause some issues.

A_ChangeDamage would be similar, although it will only affect the damage property for the actor. The parameter field are as follows:

A_ChangeDamage(in amount, bool add/subtract)

Each time the function is called, the set amount will be added/subtracted to the damage property of the actor. Thus a modder can subtract damage from a projectile if after the missile has flown a certain distance, or weaken a monsters melee damage after it's been injured. Obviously, the function should check to see if the damage is already at 0 to avoid negative damage values.

Maybe a scaling parameter can also be added, multiplying the damage by a float scaling factor after the initial adding/subtracting.
User avatar
Eriance
Now delivering MORE of LESS!
 
Joined: 26 Jul 2004
Location: Somewhere in nowhere

Re: A_ChangeDamage

Postby XutaWoo » Fri Jan 20, 2012 4:36 pm

I think just making damage a variable and giving this just one agrument would do well enougn, honestly.
User avatar
XutaWoo
one day when going to see the rabbit, there was a previous visitor ...
 
Joined: 30 Dec 2006
Location: beautiful hills of those who are friends

Re: A_ChangeDamage

Postby Major Cooke » Fri Jan 20, 2012 6:20 pm

I would like to add onto Xutawoo's saying:

A_ChangeDamage(int amount, flag(s))

DMG_NORANDOM - Don't randomize the amount of damage between a multiplier of 1-8.

By default, it will take the total amount and multiply it by a random range of 1-8, no matter what else you input for the amount.
User avatar
Major Cooke
That's how my uncle stole christmas three times in a row in a single year. -DBT
 
Joined: 28 Jan 2007

Re: A_ChangeDamage

Postby InsanityBringer » Fri Jan 20, 2012 10:25 pm

a flag for add/subtract isn't required, since you could easily just use a negative value in place of it if you wanted to subtract.

Though this could possibly be useful to have around. I'd like to see something like that that also applies to hitscans -- I did some terrible ACS hackery to make wolf3d style guns with damage falloff, but they're a terrible hack as they involve making the enemy damage itself based on certain parameters.
User avatar
InsanityBringer
 
Joined: 05 Jul 2007

Re: A_ChangeDamage

Postby Eriance » Sat Jan 21, 2012 8:45 am

How would the random value be used? Isn't the Damage property an integer? And the randomized damage only applied when the projectile hits?
User avatar
Eriance
Now delivering MORE of LESS!
 
Joined: 26 Jul 2004
Location: Somewhere in nowhere

Re: A_ChangeDamage

Postby Major Cooke » Sat Jan 21, 2012 1:13 pm

Because by default, if you don't surround the integer with (), it will be randomized and only affected by the +STRIFEDAMAGE flag.

With this function, changing the damage would always result in letting the damage become randomized unless specified by the flag in the function I suggested. This would also disregard any previously used parenthesis.
User avatar
Major Cooke
That's how my uncle stole christmas three times in a row in a single year. -DBT
 
Joined: 28 Jan 2007


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests