A Christmas present for ZDoom
Moderator: GZDoom Developers
- TheDarkArchon
- Posts: 7656
- Joined: Sat Aug 07, 2004 5:14 am
- Location: Some cold place
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
TheDarkArchon wrote:I take it the fact it's inside A_FirePhoenixPL1 wouldn't effect things.
Code: Select all
//===========================================================================
//
// A_Recoil
//
//===========================================================================
void A_Recoil(AActor * self)
{
FState * CallingState;
int index=CheckIndex(1, &CallingState);
fixed_t xymom = StateParameters[index];
angle = actor->angle + ANG180;
angle >>= ANGLETOFINESHIFT;
actor->momx += FixedMul (xymom, finecosine[angle]);
actor->momy += FixedMul (xymom, finesine[angle]);
}
- TheDarkArchon
- Posts: 7656
- Joined: Sat Aug 07, 2004 5:14 am
- Location: Some cold place
- DoomRater
- Posts: 8265
- Joined: Wed Jul 28, 2004 8:21 am
- Preferred Pronouns: He/Him
- Location: WATR HQ
- Contact:
(didn't know it already existed)
EDIT: Some weapons alert monsters before they are supposed to. Example: the sniper rifle with the scope when the button is held down causes zombies to become active before the bullet is fired. Now, someone would want that only to alert when the gun's bullet is actually loosed...
EDIT 2: That actually doesn't require changing the gun's properties, but it would probably break MassMouth.
EDIT: Some weapons alert monsters before they are supposed to. Example: the sniper rifle with the scope when the button is held down causes zombies to become active before the bullet is fired. Now, someone would want that only to alert when the gun's bullet is actually loosed...
EDIT 2: That actually doesn't require changing the gun's properties, but it would probably break MassMouth.
-
- Posts: 1059
- Joined: Sat Mar 27, 2004 8:56 pm
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Scuba Steve wrote:Hay Graf, there's a bug in the weapons code. Any weapon marked with the flag +SHOOTABLE won't headbob when you pick it up.
http://forum.zdoom.org/viewtopic.php?t=5750
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
DoomRater wrote:(didn't know it already existed)
EDIT: Some weapons alert monsters before they are supposed to. Example: the sniper rifle with the scope when the button is held down causes zombies to become active before the bullet is fired. Now, someone would want that only to alert when the gun's bullet is actually loosed...
EDIT 2: That actually doesn't require changing the gun's properties, but it would probably break MassMouth.
Use the NOALERT flag and then use the code pointer A_AlertMonsters to alert the monsters when necessary. Strife's crossbow already needs this.
- DoomRater
- Posts: 8265
- Joined: Wed Jul 28, 2004 8:21 am
- Preferred Pronouns: He/Him
- Location: WATR HQ
- Contact:
Thanks for the DECORATE lessons, Graf. "_"Graf Zahl wrote:DoomRater wrote:(didn't know it already existed)
EDIT: Some weapons alert monsters before they are supposed to. Example: the sniper rifle with the scope when the button is held down causes zombies to become active before the bullet is fired. Now, someone would want that only to alert when the gun's bullet is actually loosed...
EDIT 2: That actually doesn't require changing the gun's properties, but it would probably break MassMouth.
Use the NOALERT flag and then use the code pointer A_AlertMonsters to alert the monsters when necessary. Strife's crossbow already needs this.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Status update:
I did the first tests with the use state and so far it looks good.
I also did some changes to A_SpawnItem so that monsters spawned by it don't attack the monster that spawned them. By doing this I was also able to remove some special handling from the Wizard/D'sparil and Bishop/Heresiarch which did the same but was not friendly-aware so now it uses the same logic as the general case.
Since I was messing around with this code anyway I also turned the special case of the Bishop which never switches targets into a NOTARGETSWITCH flag. This could be useful for custom monsters.
Nice side effect: I could remove the OkayToSwitchTarget functions from the Wizard, D'Sparil, the Bishop, the Heresiarch and Strife's programmer.
I did the first tests with the use state and so far it looks good.
I also did some changes to A_SpawnItem so that monsters spawned by it don't attack the monster that spawned them. By doing this I was also able to remove some special handling from the Wizard/D'sparil and Bishop/Heresiarch which did the same but was not friendly-aware so now it uses the same logic as the general case.
Since I was messing around with this code anyway I also turned the special case of the Bishop which never switches targets into a NOTARGETSWITCH flag. This could be useful for custom monsters.
Nice side effect: I could remove the OkayToSwitchTarget functions from the Wizard, D'Sparil, the Bishop, the Heresiarch and Strife's programmer.
- TheDarkArchon
- Posts: 7656
- Joined: Sat Aug 07, 2004 5:14 am
- Location: Some cold place
- DoomRater
- Posts: 8265
- Joined: Wed Jul 28, 2004 8:21 am
- Preferred Pronouns: He/Him
- Location: WATR HQ
- Contact:
I figured it could be done with jumps (after thinking about it later), but.... that's gonna require a page and a half of code just to get right! Because I'm firing FIVE such projectiles and I need jumps for ALL of them! There should be a more efficient way of coding it, such as perhaps a Rand command or so?