Commit Graph

209 Commits

Author SHA1 Message Date
Randy Heit b2ccd0bd28 Use action function return value to make state jumps happen
- The A_Jump family of action functions now return the state to jump
  to (NULL if no jump is to be taken) instead of jumping directly.
  It is the caller's responsibility to handle the jump. This will
  make it possible to use their results in if statements and
  do something other than jump.
- DECORATE return statements can now return the result of a function
  (but not any random expression--it must be a function call). To
  make a jump happen from inside a multi-action block, you must
  return the value of an A_Jump function. e.g.:
    { return A_Jump(128, "SomeState"); }
- The VMFunction class now contains its prototype instead of storing
  it at a higher level in PFunction. This is so that
  FState::CallAction can easily tell if a function returns a state.
- Removed the FxTailable class because with explicit return
  statements, it's not useful anymore.
2016-02-18 20:39:40 -06:00
MajorCooke e04fe06226 GetDistance Non-Action (Double version)
- Added GetDistance(bool checkz, ptr = aaptr_target).
- Returns the distance of an actor. Must be target, master or tracer.
2016-02-10 17:13:50 -06:00
Christoph Oelckers 646f7a1f90 Merge branch 'ChaseDontTurnScript' of https://github.com/MajorCooke/zdoom 2016-02-10 22:47:41 +01:00
Christoph Oelckers 91f0a8791c - fixed type mismatch in A_RadiusGive declaration. 2016-02-10 19:30:17 +01:00
Christoph Oelckers 6ce0c9f78e - split up PClass::Derive and its child functions because part of them is also needed when initializing an inherited native class with the properties of its parent - but calling the base version in PClass is not possible.
- moved a few AActor properties out of the EXE so that I could easily test if it works.
2016-02-10 00:17:00 +01:00
coelckers 1ca2293983 Merge pull request #538 from MajorCooke/CountInv
CountInv(itemtype, ptr_select)
2016-02-08 21:06:30 +01:00
Christoph Oelckers c940c2ba81 - fixed: The counters for the whirlwind were initialized too late, the first time they are needed is in P_CheckMissileSpawn, which gets called from inside P_SpawnMissile. Also took the opportunity and moved them to properties that are accessible from DECORATE. 2016-02-08 13:34:54 +01:00
MajorCooke 35b7a5ccc1 Updated for scripting branch merge. 2016-02-04 22:41:02 -06:00
MajorCooke 1f8d425a1e - Added CountInv(itemtype, [ptr_select]).
- Returns an inventory item count.
2016-02-04 21:45:31 -06:00
MajorCooke 3399ed60e0 Updated to scripting branch merge. 2016-02-04 20:17:46 -06:00
Randy Heit b3b0886b64 Merge branch 'scripting'
Conflicts:
	src/actor.h
	src/g_doom/a_doomweaps.cpp
	src/g_hexen/a_blastradius.cpp
	src/p_enemy.cpp
	src/p_enemy.h
	src/thingdef/thingdef.h
	src/thingdef/thingdef_codeptr.cpp
	wadsrc/static/actors/constants.txt
2016-02-04 15:17:22 -06:00
MajorCooke a1c1de9edb Fixed merge conflicts. 2016-02-02 18:26:20 -06:00
Christoph Oelckers 058bfdea26 - forgot to commit this with the source changes for A_Face*. 2016-01-29 00:58:18 +01:00
MajorCooke 275cdcd958 Renamed A_FaceVelocity to A_FaceMovementDirection. 2016-01-27 10:12:13 -06:00
coelckers c5379c749e Merge pull request #428 from MajorCooke/A_CheckSPecies
Added A_CheckSpecies(state jump, name species, ptr = AAPTR_DEFAULT)
2016-01-27 16:45:16 +01:00
MajorCooke ece6fa776c - Renamed CHF_DONTANGLE to CHF_NODIRECTIONTURN.
- A_Wander now shares CHF_NODIRECTIONTURN and CHF_NORANDOMTURN instead of having its own flags.
2016-01-27 09:35:19 -06:00
Randy Heit c63f65d441 Merge remote-tracking branch 'origin/master' into scripting
Conflicts:
	src/thingdef/thingdef_codeptr.cpp
	wadsrc/static/actors/constants.txt
2016-01-22 20:53:27 -06:00
MajorCooke 793fc90716 Once more homogenized!
- DECORATE: color, flags, lifetime, size, angle, xyz offset/vel/accel, startalpha, fadestep.
- ACS: Similar, minus the angle parameter.
2016-01-21 19:59:33 -06:00
MajorCooke 28502b9a80 - Reorganized A_SpawnParticle parameters.
- Decorate order is now color, x/y/zoff, velx/y/z, lifetime, angle, flags, size, startalphaf, fadestepf, accelx/y/z.
- ACS order is now color, xyz offset, xyz velocity, lifetime, fullbright, size, startalpha, fadestep, xyz accel
2016-01-21 18:34:39 -06:00
Christoph Oelckers 841c7b275e Merge branch 'ParticleFlags' of https://github.com/MajorCooke/zdoom
Conflicts:
	wadsrc/static/actors/actor.txt
2016-01-22 00:58:42 +01:00
Christoph Oelckers 3b4ed8d7cd - made A_SpawnParticle's fadestep parameter a fixed point value as well. 2016-01-22 00:54:09 +01:00
MajorCooke 13dc6be5a1 - Added flags for A_SpawnParticle and angle parameter.
- SPF_FULLBRIGHT makes the particle full bright.
- SPF_RELATIVE encapsulates the following flags:
- SPF_RELPOS: Position is relative to angle.
- SPF_RELVEL: Velocity is relative to angle.
- SPF_RELACCEL: Acceleration is relative to angle.
- SPF_RELANG: Add caller's angle to angle parameter for relativity.
2016-01-21 16:36:58 -06:00
Christoph Oelckers 39014b1732 - make the startalpha parameter of A_SpawnParticle a float to be consistent with other functions that want an alpha value. 2016-01-21 20:13:55 +01:00
Randy Heit 9744b9e0d9 Merge branch 'master' into scripting
Conflicts:
	src/actor.h
	src/dobject.h
	src/dobjgc.cpp
	src/p_local.h
	src/thingdef/thingdef_codeptr.cpp
2016-01-21 12:45:06 -06:00
MajorCooke d20a7516c9 Updated A_FaceVelocity to remove conflicts. 2016-01-20 15:51:11 -06:00
Christoph Oelckers cfcd2668cc Merge commit '772a5724313f2ad0bd6828fcc28545a9ee5e6068' into scripting
Conflicts:
	src/p_pspr.cpp
	src/thingdef/thingdef_codeptr.cpp
2016-01-17 20:00:45 +01:00
Christoph Oelckers fbaab5044d Merge commit '38df0665e3a2018cf1d0028a36357df6c7e908e9' into scripting
Conflicts:
	src/d_dehacked.cpp
	src/decallib.cpp
	src/g_hexen/a_clericstaff.cpp
	src/p_interaction.cpp
	src/p_local.h
	src/thingdef/thingdef_codeptr.cpp
	wadsrc/static/actors/constants.txt
	wadsrc/static/actors/shared/inventory.txt
2016-01-17 19:50:34 +01:00
Christoph Oelckers 5207aa6cc0 Merge commit '125afcf3defb901e23bd44d32fa86681ef1748f6' into scripting
Conflicts:
	src/p_local.h
	src/p_mobj.cpp
	src/thingdef/thingdef_codeptr.cpp
	wadsrc/static/actors/shared/inventory.txt
2016-01-17 19:09:05 +01:00
MajorCooke da9c3ff9d2 Added A_Wander Flags.
- WF_NORANDOMTURN and WF_DONTANGLE do the same as their CHF_ counterparts for A_Wander.
2016-01-07 17:38:45 -06:00
Edward Richardson c099cd4581 SpawnParticle functions
- Added A_SpawnParticle Decorate and SpawnParticle ACS functions.
2015-12-08 22:58:24 +13:00
MajorCooke 4fb48b332b Added A_CheckProximity.
- Checks to see if a certain actor class, in numbers, is close to the actor/pointer via distance, based upon count. Can check for ancestry, disable Z searching, perform less than or equal to instead of greater or equal to, exact counts, check a pointer instead of itself and differentiate between live monsters and dead.
2015-11-28 10:53:34 -06:00
MajorCooke d730b06da7 Added A_CheckSpecies(state jump, name species, ptr = AAPTR_DEFAULT)
- Performs a state jump if the defined species name for the pointed actor matches the criteria.
2015-11-26 01:33:02 -06:00
MajorCooke ab5b1f479a Updated A_FaceVelocity.
- Now includes anglelimit and pitchlimit.
- Anglelimit and pitchlimit only allows the actor to turn this much, similar to A_FaceTarget's limit. FVF_RESETPITCH also respects the pitch limit.
- (offset, anglelimit, pitchlimit, flags, ptr)
2015-11-25 21:49:25 -06:00
coelckers da39c86967 Merge pull request #401 from MajorCooke/RadiusGiveMinRange
A_RadiusGive Mindist Parameter + RGF_OBJECTS Fix
2015-11-25 12:27:54 +01:00
MajorCooke 75855dc64a A_FaceVelocity(offset, flags, ptr)
- Changes the caller's angle and pitch according to the direction of velocity they're travelling.
- FVF_NOPITCH and FVF_NOANGLE disable changing of pitch/angle respectively and should be counted as mutually exclusive, or the function does nothing.
- FVF_INTERPOLATE - Interpolate's the angle and pitch changes.
- FVF_RESETPITCH will, if there's no z velocity, reset the pitch to 0. Otherwise, the pitch remains unchanged.
2015-11-25 01:44:19 -06:00
Braden Obrzut a8ac748123 Merge commit 'e2d874e343da34df6edfad0bb47370cbe10f4bae' 2015-10-25 15:00:43 -04:00
MajorCooke 75100d76fb - Added Threshold Manipulation.
- Added 'threshold' and 'defthreshold' to DECORATE expression exposure.
- ChaseThreshold sets the default threshold for how long a monster must chase one target before it can switch targets. Default is 100, must not be negative.
- A_SetChaseThreshold can be used to alter the current or default threshold of an actor <pointer>.
- Changing current threshold has no effect on what the default will be once it hits 0 and something makes it infight with another.
2015-10-12 11:06:55 -05:00
coelckers c1496ea1bf Merge pull request #390 from MajorCooke/SetPainThreshold
- Added A_SetPainThreshold for the calling actor('s pointer).
2015-10-11 15:55:32 +02:00
MajorCooke 455b70630d - Added A_JumpIfCloser NoZ boolean. Disables Z distance checking if true. 2015-10-10 10:11:59 -05:00
MajorCooke 154e023800 - Added A_CheckBlock(state block, int flags, int ptr).
- Performs a jump if an actor or a line is in the way.
- Can be used without a jump state if the desire is only to have a pointer change.
- CBF_NOLINES disables jumping if a line is involved.
- CBF_SET* flags set the target, master or tracer to whoever is blocking, for the actor calling the function.
- CBF_SETONPTR causes the pointer changing flags to apply to the pointed actor instead of itself.
2015-10-04 16:00:40 -05:00
MajorCooke af9478f818 - Added Warp properties RadiusOffset and Pitch.
- RadiusOffset is a multiplier of the target actor's radius added onto the offsets x and y.
- Pitch is added to the warping actor's current pitch, provided WARPF_USEPITCH is supplied.
- Fixed WARPF_TOFLOOR not working as intended.
2015-10-03 17:28:54 -05:00
MajorCooke 28622cecaf - Added mindist parameter to A_RadiusGive.
- Actors must be this far away to receive items. Mindist must be less than distance.
- Fixed RGF_OBJECTS not discriminating players and monsters from shootable or vulnerable actors.
2015-09-29 11:40:44 -05:00
MajorCooke 6730525855 - Added A_SetPainThreshold for the calling actor('s pointer). 2015-09-17 09:07:13 -05:00
MajorCooke 143a4c78a9 - Added A_SetFloatSpeed.
- Sets the FloatSpeed of the actor/pointer.
2015-09-06 19:57:43 -05:00
Christoph Oelckers 0a8255f34b Merge branch 'master' of https://github.com/rheit/zdoom 2015-08-27 12:49:23 +02:00
MajorCooke f9e70a82c6 - Added A_SetSpecies(<species>,<pointer>). 2015-08-24 12:45:10 -05:00
MajorCooke ad14caa800 - Added A_Warp heightoffset property. Only has an effect by two flags.
- WARPF_ADDHEIGHT adds the pointed actor's height to heightoffset, and adds to the pointed actor's z position.
- WARPF_MULHEIGHT multiplies the pointed actor's height by heightoffset, and adds to the pointed actor's z position. Overridden by ADDHEIGHT.
2015-08-10 11:19:54 -05:00
Christoph Oelckers 36974431ba Merge branch 'master' into scripting
Conflicts:
	src/thingdef/thingdef_codeptr.cpp
2015-08-01 09:42:31 +02:00
MajorCooke b4f05ee89b - Significant A_RadiusGive update.
- Added filter and species parameter.
- Added new flags: RGF_INCLUSIVE, RGF_ITEMS, RGF_KILLED, RGF_EXFILTER, RGF_EXSPECIES, and RGF_EITHER.
- RGF_ITEMS: Items can receive inventory.
- RGF_KILLED: Actors who are truly dead might not be corpses, and vice versa.
- RGF_EXFILTER: Blacklists the specified actor filter. All but the filtered actor can receive the item.
- RGF_EXSPECIES: Blacklists the specified species. All but the filtered species can receive the item.
- RGF_EITHER: The actor can receive the item if it satisfies either the filter or the species. Only useful when both are used.
- RGF_INCLUSIVE: An actor marked as more than one pointer to the calling actor can ignore the exclusion pointers, but only if at least one is missing. I.e. an actor who is a target and tracer of the calling actor can still receive the item, if the calling actor doesn't pass RGF_NOTARGET and NOTRACER at the same time. RGF_INCLUSIVE only works with the pointer filtering flags. By default, if not specified, the actor will not be loopholed the item if they are under any one of the three filters.
- Fixed discrepancies and dependencies upon several flags and actor conditions which caused the function to fail.
2015-07-22 16:46:14 -05:00
Christoph Oelckers 1b29c3b6cf Merge branch 'master' into scripting
Conflicts:
	src/p_interaction.cpp
	tools/lemon/lemon.c
2015-04-30 16:13:32 +02:00