Commit graph

80 commits

Author SHA1 Message Date
Christoph Oelckers
0770c0022c - cleaned up use of the random function in script files.
Many uses of random() & value have been turned into random(0, value).
This is not only more efficient, it also ensures better random distribution because the parameter-less variant only returns values between 0 and 255.
2018-12-21 12:40:05 +01:00
Alexander
4a85e24228 fixed spelling (mostly comments) 2018-11-27 19:44:06 +01:00
Christoph Oelckers
bfffe6df3e - fixed typo with RNG name. 2018-11-07 19:20:42 +01:00
Christoph Oelckers
9653aa95a4 - fixed: The BossCube must account for its target being gone. 2018-07-27 08:46:28 +02:00
Alexander
97aba0c416 add tags for Doom and Heretic monsters
Why? So mods that reveal enemy names don't show internal monster class names.

Tags are based on language.enu lump:
- Tags for Doom/Doom 2 monsters are referring directly to CC_* strings.
- Tags for Heretic monsters are based on obituaries.
- All tags match corresponding obituaries.
2018-06-27 21:04:00 +02:00
Christoph Oelckers
a851a5d151 - fixed: For melee attacks with a short attack range P_AimLineAttack must check for hits from above and below.
This is necessary to be in line with P_LineAttack which does check for those.
2018-06-03 17:49:00 +02:00
Christoph Oelckers
883a6ffe3a - added an inventory check to A_KeenDie so that it still works if a patch repurposes a pickup item that may end up in the player's inventory. 2018-02-27 10:40:43 +01:00
Blue Shadow
f68d90accb Fixed a case of infinite loop in A_BrainDie 2018-01-08 11:50:01 -05:00
alexey.lysiuk
88deddbc3b Fixed arch-vile bleeding when damaging target
https://forum.zdoom.org/viewtopic.php?t=58220
2017-10-21 11:37:43 +03:00
alexey.lysiuk
4f35940c73 Fixed applying of height argument in A_Fire() function
https://forum.zdoom.org/viewtopic.php?t=58090
2017-10-07 10:12:34 +03:00
Christoph Oelckers
60cb457c4c - fixed incorrect MinMissileChance of SpiderMastermind. 2017-07-03 09:58:40 +02:00
Christoph Oelckers
a6b7ce00c2 - made DropItem fully read-only by changing the two places which messed around with DropItem.Amount to use a local variable instead.
The pointers themselves should have been declared read-only from the start but for that it is too late, so now all its members are.
2017-06-21 11:39:59 +02:00
Christoph Oelckers
a210aaea3e - fixed: All melee functions calling TraceBleed after DamageMobj must first copy the target member to a local variable.
DamageMobj can destroy the damaged actor if the death state sequence has zero duration. But Actor.target is a garbage collected member variable, i.e. it will be null, once the actor it points to gets destroyed.
This was originally done correctly in the C++ code but during the scriptification all those 'AActor *target = self->target' lines were removed because they looked redundant, but were not.
2017-06-06 09:12:58 +02:00
Rachael Alexanderson
c252b5d753 - fixed: forgot to assign +ZDOOMTRANS to rockets 2017-06-04 12:30:35 +02:00
Rachael Alexanderson
01f88cfb16 - Added 'canonical transparency' cvar r_canontrans - this simply turns off transparency for Doom objects that were marked as transparent sometime in ZDoom's development cycle 2017-06-04 12:30:35 +02:00
Christoph Oelckers
12915b5f6e - use an inventory flag to decide what items are slipped by DF_NO_HEALTH and DF_NO_ARMOR. With all the changes over the last 10 years this had become too spotty.
- use an enum type for ItemFlags, just like it was done for actor flags. Since the flag word is almost full it may soon be necessary to add a second one and then this kind of security check may become necessary.
2017-02-28 21:45:47 +01:00
Christoph Oelckers
5ea8ad54a4 - added tags to all ammo types. 2017-02-25 19:56:22 +01:00
Christoph Oelckers
06ad2351d3 - fixed error in vertical velocity calculation for A_SkullAttack. 2017-01-21 19:56:54 +01:00
Christoph Oelckers
bf09a89b5d - fixed typo in A_BrainSpit. 2017-01-02 23:26:19 +01:00
Christoph Oelckers
80effbb547 - fixed: A_M_Refire's 'ignoremissile' parameter lost its default value. 2017-01-01 15:41:40 +01:00
Christoph Oelckers
3d61d2c1f4 - reviewd script code for spawn calls that did not check their results.
Nothing should ever assume that spawning an actor is unconditionally successful. There can always be some edge cases where this is not the case.
2016-12-31 15:40:51 +01:00
Christoph Oelckers
19856d6ccb Merge branch 'master' of https://github.com/rheit/zdoom 2016-12-25 22:56:35 +01:00
Christoph Oelckers
4fcf9933f0 - copy target to a local variable in A_VileAttack so that it remains accessible if A_Explode destroys the actor. 2016-12-23 16:34:02 +01:00
Christoph Oelckers
71fd949f26 Merge branch 'master' of https://github.com/rheit/zdoom 2016-12-11 14:45:42 +01:00
Christoph Oelckers
40355f6298 - allow A_M_Refire to be called without state label because this seems to have been used in existing DECORATE mods. This way of calling it will revert to the old behavior of jumping one state forward instead of to a state label. 2016-12-11 13:07:25 +01:00
Christoph Oelckers
952e47cfe4 - renamed internal MELEERANGE constant to deconflict with Actor's MeleeRange member. 2016-12-10 16:36:19 +01:00
Christoph Oelckers
e41e404143 Merge branch 'zscript' of https://github.com/rheit/zdoom into gz-zscript 2016-12-06 12:33:52 +01:00
Christoph Oelckers
092461ed34 - make dynamic object casts a dedicated VM instruction instead of a builtin function.
This can see some heavy use in iterators where saving several hundreds of function calls can be achieved. In these cases, using a function to do the job will become a significant time waster.
2016-12-05 14:52:34 +01:00
Christoph Oelckers
ebdc672985 - fixed: A_Saw was using the wrong angle for adjusting the facing direction at the end. 2016-12-04 10:45:20 +01:00
Christoph Oelckers
c927aca2a0 Merge branch 'zscript' of https://github.com/rheit/zdoom into gz-zscript
# Conflicts:
#	wadsrc/static/zscript.txt
2016-11-30 18:46:23 +01:00
Christoph Oelckers
f5b3429274 - partial scriptification of the Heresiarch 2016-11-29 15:24:38 +01:00
Christoph Oelckers
3af9232fca - scriptified a_strifeitems.cpp and a_debris.cpp.
- Changed the glass shards so that they do not have to override FloorBounceMissile. It was the only place where this was virtually overridden and provided little usefulness.
- made 'out' variables work.
- fixed virtual call handling for HandlePickup.
2016-11-29 12:17:05 +01:00
Christoph Oelckers
dc9ee0727a - scriptified a_spectral.cpp.
- consolidated A_Tracer and A_Tracer2.

Note that this commit temporarily disables a few features in order to make it compile.
2016-11-28 12:55:33 +01:00
Christoph Oelckers
b5f55cacba - removed test code. 2016-11-25 09:56:06 +01:00
Christoph Oelckers
11ac0c622b - fixed: The BFG needs to get its default ammo usage from the DehInfo struct.
- fixed: State's fields need to be declared native.
2016-11-25 01:33:04 +01:00
Edoardo Prezioso
c25774e311 - Fixed the Super Shotgun refire mismatch. 2016-11-25 00:42:09 +01:00
Edoardo Prezioso
3a059cbfd6 - Backported A_FireRailgun 'puffType' param from Zandronum.
Zandronum added this so that it could restore the original Skulltag piercing armor capability with a specific puff, like it's done with the other zdoom railgun action functions.
2016-11-24 11:31:40 +01:00
Christoph Oelckers
1a20a5b999 - scriptified A_PainShootSkull which was the last remaining bit in g_doom, so this directory is gone now. 2016-11-23 19:47:09 +01:00
Christoph Oelckers
099b9970ef - added proper definitions for all exported native fields.
- synthesize native fields for all declared flags, not just for AActor.
2016-11-22 23:43:32 +01:00
Christoph Oelckers
980c986305 - allow defining native fields through scripts. Internally this only requires exporting the address, but not the entire field.
- added new VARF_Transient flag so that the decision whether to serialize a field does not depend solely on its native status. It may actually make a lot of sense to use the auto-serializer for native fields, too, as this would eliminate a lot of maintenance code.
- defined (u)int8/16 as aliases to the byte and short types (Can't we not just get rid of this naming convention already...?)
- exporting the fields of Actor revealed a few name clashes between them and some global types, so Actor.Sector was renamed to CurSector and Actor.Inventory was renamed to Actor.Inv.
2016-11-22 19:20:31 +01:00
Christoph Oelckers
3db712cd73 - fixed: Switch statement without a default jumped to the first first case label instead.
- removed placeholder code from scripted Marine.
2016-11-21 22:20:25 +01:00
Christoph Oelckers
135cfcf016 - implemented State as an actual native struct, so that its fields can be accessed from scripts.
- refactored state bitfield members into a flag word because the address of a bitfield cannot be taken, making such variables inaccessible to scripts.
- actually use PNativeStruct for representing native structs defined in a script.
2016-11-21 21:34:34 +01:00
Christoph Oelckers
360436c201 - scriptified the scripted marines.
- fixed symbol name generation for native functions.
- moved PrintableName to VMFunction so that native functions also have this information.
2016-11-21 19:09:58 +01:00
Christoph Oelckers
7c122d03e9 - renamed all instances of 'float' parameters to 'double', so that the Float32 type can be made usable for structs. 2016-11-21 13:04:27 +01:00
Christoph Oelckers
e7f6bae83e - implemented named arguments.
- fixed flag CVAR access. As it turned out, OP_LBIT is a bit messy to set up properly when accessing integers that may or may not be big endian, so it now uses a shift and bit masking to do its work.
- used the SpawnPlayerMissile call in A_FireBFG to test named arguments.
2016-11-21 01:32:01 +01:00
Christoph Oelckers
0cbd260f96 - replaced all calls to GetCVar with direct CVar accesses. 2016-11-20 23:39:37 +01:00
Christoph Oelckers
bb25c5faaa - scriptified the remaining Doom weapon code.
- implemented method calls from struct instances.
- optimized disassembly of VM call instructions to print the function's name at the end where it is more visible and does not need to be truncated. Also use the printable name for script functions here.
2016-11-20 12:27:26 +01:00
Christoph Oelckers
3c726aa570 - scriptified A_FirePlasma. 2016-11-20 01:18:21 +01:00
Christoph Oelckers
fdab994fcb - scriptified the Rocket launcher. 2016-11-20 01:11:01 +01:00
Christoph Oelckers
814493b68d - scriptified the Super Shotgun. 2016-11-20 00:45:06 +01:00