Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void A_BFGStateJumpSpray (StateLabel st, int numrays = 40, double ang = 90, double distance = 16*64, double vrange = 32, int flags = 0) {
- FTranslatedLineTarget t;
- // Validate parameters
- if (numrays <= 0) numrays = 40;
- if (ang == 0) ang = 90.;
- if (distance <= 0) distance = 16 * 64;
- if (vrange == 0) vrange = 32.;
- // [XA] Set the originator of the rays to the projectile (self) if
- // the new flag is set, else set it to the player (target)
- Actor originator = (flags & BFGF_MISSILEORIGIN) ? self : target;
- // [RH] Don't crash if no target
- if (!originator)
- return;
- // offset angles from its attack ang
- for (int i = 0; i < numrays; i++) {
- double an = angle - ang / 2 + ang / numrays*i;
- originator.AimLineAttack (an, distance, t, vrange);
- if (t.linetarget != NULL) {
- let targetState = t.linetarget.FindState (st);
- if (targetState != NULL)
- t.linetarget.SetState (targetState );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement