Commit graph

609 commits

Author SHA1 Message Date
Christoph Oelckers
6f92efc72c - renamed thingdef_codeptr.cpp and moved it out of thingdef/.
Ultimately, thingdef should only contain code that is directly related to the DECORATE parser, but that's not the case with this file. It's only function definitions which get used during gameplay and will also be accessed by ZScript.
The change is intentionally on master so that pull requests can adjust to it now instead of creating conflicts later.
2016-10-12 12:43:26 +02:00
Major Cooke
5dc94a10c3 Added A_SetInventory.
- Sets the absolute amount of an inventory actor.
- Limits itself to the range [0, MaxAmount]. Setting beyondMax to true disregards the MaxAmount. Default is false.
2016-10-11 14:44:31 -05:00
Christoph Oelckers
0bce6e3925 - added ACS and DECORATE setter functions for named translations. 2016-10-02 14:09:45 +02:00
Christoph Oelckers
80f2f5829f - added A_SetRenderStyle function which replaces A_SetTranslucent. A_SetTranslucent had to be deprecated due to obsolete semantics of the renderstyle argument. 2016-10-02 00:43:05 +02:00
Major Cooke
dfa4f38c8f Updated to new save game code. 2016-09-24 09:17:18 +02:00
Christoph Oelckers
3eb1af6957 - added a GetMissileDamage function to DECORATE which can be used to properly retrieve an actor's damage value.
The damage property should be considered deprecated inside expressions from now on.
2016-09-19 03:45:22 +02:00
Major Cooke
01e9d351b4 - Don't pass flags directly from A_Explode to P_RadiusAttack. XF_EXPLICITDAMAGETYPE would cause explosions to deal no damage otherwise. 2016-09-08 00:38:12 +02:00
yqco
2e8aa53e6a Add SetActorFlag ACS function
int SetActorFlag(int tid, str flagname, bool value);

- Mimics DECORATE's A_ChangeFlag
- Returns number of actors affected (number of things with the flag)
- Affects activator if TID is 0

# Conflicts:
#	src/p_acs.cpp
2016-09-07 20:44:56 +02:00
Christoph Oelckers
eff03d13f0 - fixed last commit. 2016-09-04 10:28:29 +02:00
Christoph Oelckers
77ac3bb265 - fixed angle range checks in A_CheckIfTargetInLOS.
The fixed point version had a mostly useless check that excluded ANGLE_MAX, this got incorrectly converted to floating point.
Note that this version will clamp the angle to 360°, not merely overflow like it did with the fixed point code
2016-09-04 08:33:19 +02:00
Major Cooke
e22043a25b Fixed: A_FaceMovementDirection would not adjust the angle if it was actually under the limit. 2016-08-22 09:46:00 +02:00
Christoph Oelckers
314e89b84f - fixed what looks like a copy/paste error in A_Explode. 2016-08-16 10:53:30 +02:00
Major Cooke
aa2ca77412 Added damagetype parameter and XF_NOACTORTYPE to A_Explode.
- By default, A_Explode will refer to the actor's damagetype if using none. The flag forces the function's type if used regardless of type.
2016-08-16 08:59:27 +02:00
Major Cooke
9dd458030e This isn't needed. It's already checked at this point. 2016-08-12 09:17:21 +02:00
Major Cooke
7ffccd0009 Fixed: RGF_KILLED was not part of the mask.
- Greatly optimized DoRadiusGive by putting actor flag checking first ahead of pointer, classname and species checking.
2016-08-12 09:17:20 +02:00
Major Cooke
ec14dd94a7 A_Explode now returns the number of actors damaged and can be used in expressions.
- Enemies that do not take damage in any way are not counted.
2016-08-12 09:17:20 +02:00
Xaser Acheron
a1a0da1f13 added SWF_SELECTPRIORITY flag to A_SelectWeapon 2016-07-29 18:48:54 -05:00
Major Cooke
13fa06fe7a Renamed GetProximity to CountProximity.
# Conflicts:
#	wadsrc/static/actors/actor.txt
2016-07-30 00:27:12 +02:00
Major Cooke
167cb28563 Added GetProximity(classname, distance, flags, ptr).
- Behaves similarly to A_CheckProximity but returns the count of classname instead of true/false.

# Conflicts:
#	wadsrc/static/actors/actor.txt
2016-07-30 00:26:55 +02:00
Major Cooke
dfed6ac1fb Added SpriteAngle and SpriteRotation properties.
- Includes four functions, A_SetSprite(Angle/Rotation) and GetSprite(Angle/Rotation).
- SpriteRotation offsets the angle of the sprite, allowing for actors to move backwards or sideways for example.
- SpriteAngle requires +SPRITEANGLE and sets the actor's sprite to the absolute rotation found at that angle. Overrides SpriteRotation once the flag is on.
2016-07-30 00:26:40 +02:00
Major Cooke
6ada8aa644 Fixed A_CopySpriteFrame not working under certain circumstances. 2016-07-28 15:55:49 -05:00
MajorCooke
3d9591229e Added A_CopySpriteFrame(from, to, flags)..
- Copies a sprite/frame from one actor pointer to another. Sprite and/or frame copying can be disabled with flags CPSF_NO<SPRITE/FRAME>.
2016-07-28 08:39:32 +02:00
Blue-Shadow
c428e376cd Added INFLICTORDMGTYPE flag to A_Damage* action functions
It forces the use of the inflictor's damagetype instead of whatever is
passed to the functions.
2016-07-19 08:34:55 +02:00
MajorCooke
7544adfc91 Combined the target/master/tracer checking into AimBulletMissile. 2016-07-16 17:43:00 +02:00
MajorCooke
376c9b0306 - Optimized handling of puffs in the event they're null.
- Only spawn the puff as needed again if the projectile actually spawns.
2016-07-16 17:41:28 +02:00
MajorCooke
02064437c5 Fixed wrong angle/slopes being used and one too many &s for NOINTERACT. 2016-07-16 17:34:17 +02:00
MajorCooke
10fabc3ab7 Cleaned up code. Puffs no longer need ALWAYSPUFF.
- A_CustomBulletAttack and A_FireBullets will perform a second P_LineAttack to get a puff which only returns to the previous function after a tracer.
2016-07-16 17:34:17 +02:00
MajorCooke
4750dfd8b6 Added ability to set the puffs directly as the spawned projectile's target, master, and/or tracer. 2016-07-16 17:34:16 +02:00
MajorCooke
cc8e7f8de6 Cleaning finished. 2016-07-16 17:34:16 +02:00
MajorCooke
791852a6bd Cleaned up. 2016-07-16 17:34:15 +02:00
MajorCooke
3c7e1e0528 - Added the tracer actor spawning for A_FireBullets and A_CustomBulletAttack.
The projectiles spawning conditions rely upon the puff successfully spawning.

# Conflicts:
#	wadsrc/static/actors/actor.txt
2016-07-16 17:34:15 +02:00
MajorCooke
b121284fc0 Added GAF_SWITCH to GetAngle, inverting the function to get the caller's angle on the pointer instead. 2016-07-14 17:14:17 +02:00
MajorCooke
09175a6a7a This wasn't supposed to be committed... 2016-07-14 09:55:13 -05:00
MajorCooke
59593e57c6 - Fixed: RGF_ITEMS wasn't considered a part of the RGF_MASK flag. 2016-07-14 09:27:29 -05:00
Christoph Oelckers
0b93e9b897 Merge branch 'roll' of https://github.com/MajorCooke/zdoom 2016-07-04 00:43:16 +02:00
MajorCooke
613fa4c9e4 Fixed: GetDistance was missing the original Z check disabling introduced in commit bd16ccb. 2016-06-21 10:14:25 +02:00
MajorCooke
9df65f73fc Localized the input checker into P_Thing_CheckInputNum now called by both ACS and DECORATE.. 2016-06-20 09:41:46 -05:00
MajorCooke
26408a5043 Switched the pointer to AAPTR_DEFAULT. 2016-06-20 09:11:38 -05:00
MajorCooke
85a34bbb88 Added GetPlayerInput(int numinput, int ptr = AAPTR_PLAYER1).
- Works exactly like the ACS version, but with pointers instead. The pointer can be anything, so long as it can be identified as a player.
2016-06-20 08:49:57 -05:00
Leonard2
24c73071f4 Fixed a crash with A_JumpIfNoAmmo
Non-weapon layers can pass the caller check even when there is no ReadyWeapon
2016-06-17 18:36:57 +02:00
Leonard2
68c483c041 Renamed the weapon action function caller check to ACTION_CALL_FROM_PSPRITE to avoid confusion
This was always checking for every psprites rather than just weapon layers
2016-06-17 18:36:57 +02:00
Leonard2
abc7113e09 Removed the INSTATECALL flag because it is now unused and was replaced by stateinfo 2016-06-17 18:36:57 +02:00
Christoph Oelckers
cfaa3e3fa9 - changed action function interface so that callers can be identified directly, instead of guessing it from looking at the parameters.
With arbitrary PSP layers the old method was no longer safe because the layer ID was not available in the action function.
2016-06-16 16:16:27 +02:00
Christoph Oelckers
7ccdbf9b62 Merge branch 'PSprites' 2016-06-16 16:16:16 +02:00
Xaser Acheron
de0301a704 split bfg self-damage code into its own function, A_RadiusDamageSelf 2016-06-16 00:43:07 +02:00
MajorCooke
2d4eb8dde4 - Added limit parameter to A_RailAttack and A_CustomRailgun. 2016-06-14 18:20:43 -05:00
MajorCooke
4c8028d64b - Fixed a discrepancy with A_FaceMovementDirection involving pitch adjustments going the wrong way both in motion, and standing still. 2016-06-11 14:07:27 -05:00
MajorCooke
fb286d1737 - Changed endsize to sizestep. Endsize affected more things than I thought it would. 2016-06-11 08:05:29 -05:00
Leonard2
ebe3f23677 Added GetCVar(string name)
Works like ACS's GetCVar
2016-06-11 10:15:49 +02:00
MajorCooke
f787056198 - Added endsize parameter and SPF_NOTIMEFREEZE for A_SpawnParticle.
SPF_NOTIMEFREEZE processes particles with this flag regardless of time freeze. The endsize parameter changes the scale of the particle to that size throughout its lifetime linearly.
2016-06-11 10:00:50 +02:00