-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New MBF21 DEHACKED codepointers (first batch) #20
Conversation
…ked code pointers
…apon codepointers
…this isn't necessary at all since demo_insurance will always be off for mbf21, but hey, it looks nice :P
…hod for converting fixed-point degrees to BAM
…ead value is negative
// according to plan... | ||
// | ||
|
||
int P_GetAmmoPerShot(player_t *player) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't hit by any existing code, right? It will only be hit downstream of the new code pointers? Just making sure heretic doesn't need to be considered :^)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently no, but the eventual plan is for P_CheckAmmo to call this function if (mbf21)
in my eventual ammopershot
PR. Means it still ought not affect Heretic though; presuming you can't set the new complevel there. ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a method, what do you think about using an array shotammo
to match the existing maxammo
and clipammo
? That will fit in with the use of maxammo
and clipammo
in d_deh, assuming we will be making it all configurable the same way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense -- though that seems like a thing to do for the new ammopershot
PR. I'll probably rip out the P_GetAmmoPerShot function completely if it's indeed as simple as indexing an array. ;)
prboom2/src/p_enemy.c
Outdated
if (!mbf21 || !actor->state->misc1) | ||
return; | ||
|
||
mobj_t *mo = P_SpawnMobj(actor->x, actor->y, (actor->state->misc2 << FRACBITS) + actor->z, actor->state->misc1 - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to declare this variable at the top and then set it here to avoid a warning in C, right? 🤓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, maybe. :P -- Fixed for consistency at least. ;)
Please add a code pointers header in https://github.com/kraflab/dsda-doom/blob/master/prboom2/src/mbf21.md and link this pr as well as list the ones added here. Just basic info is fine - it isn't meant to be a spec for public consumption so we can go into more detail once mbf21 is more finalized. |
Just pushed an update to mbf21.md -- in this PR; it's self-referential now. :P |
Got the first handful of codepointers done. There's a few more I may try and sneak in (melee attacks and some of skillsaw's suggestions), but some of 'em will need a bit of research to figure out how best to do 'em, and I don't want to hold up the essentials any longer than I must. ;)
Quick summary of the 'pointers:
type
atheight
z units and sets its angle to the caller's angle.tracer
field.spread
; ifspread
is negative, apply vertical spread equal to 2/3 of this value (approx. equal to SSG vert-spread)spread
behavior as A_MonsterBulletAttackamount
units of ammo. ifamount
is zero, use the weapon slot'sammopershot
. will not reduce ammo below zero.state
if ammo is belowamount
; ifamount
is zero, use the weapon slot'sammopershot
value insteadstate
if trigger is still held down; will also check ammo unlessnoammocheck
is setstate
; also sets the player's 3rd-person sprite to the player actor's firing frame unlessnothirdperson
is setA bit more than the 5 pointers I originally planned, but eh. Low-hanging fruit gets monched. :P