Back to the Vavoom Forum Archives
The 4th Class
damage = 7 + (P_Random() & 7);While others like "WeaponPhoenixRod.vc" don't. So which code determines how much damage this badass of a weapon deals? <!-- s:twisted: --><img src="{SMILIES_PATH}/icon_twisted.gif" alt=":twisted:" title="Twisted Evil" /><!-- s:twisted: -->
Crimson Wizard
damage = ((P_Random() & 3) + 2) * MissileDamage;AS for MissileDamage, this variable is defined in each missile class. PhoenixFX1 has this line in "defaultproperties" section:
MissileDamage = 20;
Janis Legzdinsh
Anyway, I was wondering which section of the code was responsible for the numbering sequence of the weapons. For example, let's say I want the mage to press "7" to use the bloodscourge instead of "4." How do I do that? And if I want to put 2 or more weapons under the same button (like the staff and the gauntlets in Heretic, they both use "1"), how do I do that? How does the game know to choose the gauntlets over the staff when "1" is pressed?It's handled by method PlayerImpulse in Player class.
The 4th Class
if (impulse == "0") { Use flechette } else if (impulse == "2") { Take out axe/serpentstaff/iceweapon }But I guess there's a reason why you do it your way and not mine. <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->
Crimson Wizard
The 4th Class
Crimson Wizard
Janis Legzdinsh
Well I'm no programmer, but it seems to me PlayerImpulse does a bit more than just determine the numbering sequence of the weapons. Does it also handle launching the items, or at least the 5-0 hotkeys?Yes.
Heh, I thought this impulse variable would be type char instead of type int. This is what I would have had in mind:It's the number of impulse command, so it's integer. Having it as char would make no sense at all.if (impulse == "0") { Use flechette } else if (impulse == "2") { Take out axe/serpentstaff/iceweapon }But I guess there's a reason why you do it your way and not mine. <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->