Commit graph

1367 commits

Author SHA1 Message Date
Christoph Oelckers
1dbbb56a1b Merge branch 'master' into new_level_refactor
# Conflicts:
#	src/p_user.cpp
2019-02-02 16:58:30 +01:00
Christoph Oelckers
235c4c0499 - allow localization of Strife's log text. 2019-02-02 16:56:58 +01:00
Christoph Oelckers
45dc9a7b47 - renamed the level variables.
currentUILevel is now primaryLevel.
For ZScript, currentVMLevel was added. This is also exported as 'level' and will change as needed.
This also means that no breaking deprecations will be needed in the future, because in order to sandbox a level only 4 variables need to be handled: level, players, playeringame and consoleplayer.
The remaining global variables are not relevant for the level state.

The static 'level' has been mostly removed from the code except some places that still need work.
2019-02-02 00:25:51 +01:00
Major Cooke
695eced81a Added Inventory UNCLEARABLE flag.
- Allows prevention of ClearInventory without stopping it from being dropped.
2019-02-01 18:29:31 +01:00
Christoph Oelckers
ff903da19a Merge remote-tracking branch 'remotes/origin/master' into new_level_refactor 2019-01-31 20:43:24 +01:00
Major Cooke
b1c508fa6c Added CheckReplacee.
- Allows defining of what actor is replacing another for information.
- If multiple arachnotrons, a modder can attribute them as being a replacer of Arachnotron itself, allowing A_BossDeath and GetReplacee to work with it.
2019-01-31 19:05:44 +01:00
Erick Tenorio
b9e71d6db3 - DOOM.WAD fixes 2019-01-31 19:03:57 +01:00
Christoph Oelckers
cfa35f548f - make the file name of savegame nodes read only. 2019-01-31 17:57:39 +01:00
Christoph Oelckers
68bff17d63 - this was missing 2019-01-31 03:29:45 +01:00
Christoph Oelckers
ddab2c3e78 - removed the playernum parameter from CheckLocalView
This was always used with 'consoleplayer' which really is the only thing making sense here. But this is a part of the global state which should be avoided in play code.

In particular, this makes no real sense in case of secondary maps where it should always return false.
2019-01-31 03:29:25 +01:00
Christoph Oelckers
b12de04258 - fixed the remaining deprecation warnings in the base script.
All these required access to the sector's Level reference.
The remaining references to the global 'level' variable are all in deprecated functions which is ok.
2019-01-30 00:58:44 +01:00
Christoph Oelckers
6451b7d592 - moved the combined compatibility flags into FLevelLocals. 2019-01-29 19:28:22 +01:00
Christoph Oelckers
14101fa447 - health groups and software rendering textures freed of 'level'
Edited cherry-pick of an older commit.
2019-01-29 16:06:17 +01:00
Christoph Oelckers
f9239f6e0f - added a compiler-side workaround for the formerly static methods of FLevelLocals.
LevelLocals on the left side of.a function call will now always be remapped to 'Level', which will either remap to the same-named instance variable or the global deprecated one.

In a few degenerate cases where there is a conflicting local variable named 'level' it may error out but that is unavoidable here but this is very unlikely.
2019-01-29 02:04:31 +01:00
Christoph Oelckers
60873bc5d6 Moved the PointInSector functions into FLevelLocals 2019-01-29 01:30:41 +01:00
Christoph Oelckers
259ae41774 - sanitized the 'frozen level' code.
This had two different flags that were checked totally inconsistently, and one was not even saved.
Moved everything into a few subfunctions so that these checks do not have to be scattered all over the code.
2019-01-28 20:15:48 +01:00
Christoph Oelckers
3721771934 - forgot to save this. 2019-01-28 18:44:42 +01:00
Christoph Oelckers
3c14a7db76 - use map time, not hub time for map actions. 2019-01-28 18:42:56 +01:00
Christoph Oelckers
66695ac6a0 - made most of the player spawn spot handliing functions members of FLevelLocals. 2019-01-28 02:44:05 +01:00
Christoph Oelckers
b4acb857ad - the final batch of easy level replacements.
What's left will require a bit more work...
2019-01-27 21:59:19 +01:00
Christoph Oelckers
73ea59179c - fixed some deprecation warnings about 'level'. 2019-01-27 14:48:35 +01:00
Christoph Oelckers
84baa5bb4d - deprecated the global 'level' variable.
This will currently output 9 warnings for the UDMF property getters. To silence these a bit more work is needed.
2019-01-27 14:33:02 +01:00
Christoph Oelckers
05830455e7 - made the automap an object.
This simplifies handling a lot because it allows to make the level the owner of its map.
2019-01-26 15:21:20 +01:00
Christoph Oelckers
10feb446fa - made most of the EV_* functions part of FLevelLocals. 2019-01-26 08:28:45 +01:00
Christoph Oelckers
4e052f2857 - use a separate variable pointing to the current level for the UI code.
UI always runs on the primary level, so this does not need the ability to operate on multiple levels. Additionally, this can later be set to null when running play code so that scope violations result in an abort.
2019-01-25 18:31:40 +01:00
Christoph Oelckers
bf3dc2f99b Merge branch 'rolling_back' into new_level_refactor 2019-01-25 00:57:01 +01:00
Christoph Oelckers
b2ee99c7cc - call level compatibility handlers for all levels and pass the map name as a second parameter.
This is for user-made handlers for which the checksum is rather useless both for deciding whether to call the handler and for identifying the map.
2019-01-25 00:56:15 +01:00
Christoph Oelckers
3cef56249d - moved most functions of portals.cpp into FLevelLocals.
Much of this is used during level init and needs to be independent of the current level.
2019-01-25 00:30:55 +01:00
Christoph Oelckers
0e5986769e - moved the tid hash into FLevelLocals and adjusted the interface to the iterators. 2019-01-24 19:28:40 +01:00
Christoph Oelckers
1f2162fea8 - moved the scripted creation functions for tag iterators to LevelLocals
The old static methods are now deprecated, this was done to clarify the relationships at play here.
2019-01-24 02:17:10 +01:00
Christoph Oelckers
5c8ae72453 - fixed: ScriptUtil.PlayerAmmo must be declared static. 2019-01-23 21:50:11 +01:00
Christoph Oelckers
477560e1ef - swapped order of checks for picking up an item.
Failure must take precedence over the morph check because this does not return a proper toucher.
2019-01-23 21:50:10 +01:00
Christoph Oelckers
f6ce5f59ae - fixed armor bonus giving in A_CustomPunch 2019-01-23 21:49:18 +01:00
alexey.lysiuk
12db808307 - fixed 'missing interpolation point' warning 2019-01-23 21:46:46 +01:00
alexey.lysiuk
7d4765b5cd - workaround code generation issue in PlayerPawn.FindMostRecentWeapon()
Multiple values in returned from a subfunction cannot be used directly as a function result

https://forum.zdoom.org/viewtopic.php?t=63284
2019-01-23 21:41:03 +01:00
alexey.lysiuk
8aa47e664e - fixed disappearing inventory after morphing pickup
When player is picked up item that does morph, the corresponding toucher actor is changed in process
Previously, morhing item was removed from original actor leaving player's inventory in inconsistent state

https://forum.zdoom.org/viewtopic.php?t=63124
2019-01-23 21:40:44 +01:00
Christoph Oelckers
5e4ef04a4d - allow assignment of line IDs through LevelCompatbility. 2019-01-23 21:40:19 +01:00
alexey.lysiuk
c6ee8e084c - fixed condition to produce blood splatter during line attack
https://forum.zdoom.org/viewtopic.php?t=63186
2019-01-23 21:23:35 +01:00
Marrub
af06d7cb9e Make LevelLocals::ExecuteSpecial return int
# Conflicts:
#	wadsrc/static/zscript/base.txt
2019-01-23 21:15:33 +01:00
Christoph Oelckers
4126f8ce72 - made OP_NEW a builtin function instead of an opcode.
The code was present 3 times due to the JIt, and this is not something that benefits from being a real opcode, even in the interpreted case.
2019-01-23 21:12:23 +01:00
Christoph Oelckers
a1ae01e392 - fixed last PR.
The result of GetPointer must be null checked as well!
2019-01-23 20:43:23 +01:00
Cacodemon345
70a07e154c Move receiver NULL check above the orresult check (#695)
This is to prevent a VM abort from happening here if orresult is false.
2019-01-23 20:42:41 +01:00
Christoph Oelckers
c651045ed3 - let RunHealth clamping respect the newly added global properties. 2019-01-05 15:37:14 +01:00
Christoph Oelckers
dab68184f5 - moved the global spot state into FLevelLocals.
This way it doesn't even have to be a thinker.
2019-01-05 10:04:27 +01:00
Christoph Oelckers
d898cadda5 - fixed: Trying to remove the first item in an actor's inventory would lose all owned items. 2019-01-04 18:56:14 +01:00
Christoph Oelckers
f9ff097457 - fixed A_Chase default detection. 2019-01-03 23:43:15 +01:00
Christoph Oelckers
9521b6cd1f - removed all remaining native parts of APlayerPawn.
Unlike the other classes, the places where variables from this class were accessed were quite scattered so there isn't much scriptified code. Instead, most of these places are now using the script variable access methods.
This was the last remaining subclass of AActor, meaning that class Actor can now be opened for user-side extensions.
2019-01-03 22:05:49 +01:00
Christoph Oelckers
c18e895272 - exported all native components of APlayerPawn.
Only the class definition itself remains and needs to be taken care of.
2019-01-03 18:01:58 +01:00
Christoph Oelckers
3314a1efe5 - scriptified the remaining PlayerPawn methods. 2019-01-03 14:35:17 +01:00
Christoph Oelckers
2258a71c36 - took several methods out of the native PlayerPawn implementation, either by scriptification or moving them to other places. 2019-01-03 13:59:46 +01:00
Christoph Oelckers
23146f1af2 - scriptified PlayerPawn.ResetAirSupply. 2019-01-03 13:04:48 +01:00
Christoph Oelckers
badacbb968 - scriptified APlayerPawn's DamageFade handling. 2019-01-03 12:47:34 +01:00
Christoph Oelckers
2bd72478ee - scriptified P_CalcHeight.
This was the only code using the ViewBob member variable.
This also moves the range check for this variable to its application, because a badly behaved mod can just as easily change it at run time instead of just setting an absurdly large value in the class definition.
2019-01-03 11:57:20 +01:00
Christoph Oelckers
9e5c5b68c5 - did some more lightening on the PlayerPawn class. 4 more properties and one native member function have been handled. 2019-01-03 10:06:45 +01:00
Christoph Oelckers
c753d59a72 - scriptified A_SkullPop and ObtainInventory.
These were the last relevant items to access PlayerPawn.InvFirst.
2019-01-03 00:35:56 +01:00
Christoph Oelckers
6eb8ded471 - made ColorRangeStart and ColorRangeEnd meta properties of APlayerPawn.
These are only used during initialization and they should have been readonly from the start.
2019-01-02 22:13:57 +01:00
Christoph Oelckers
bc47fdfa78 - scriptified useflechette CCMD's item finding code. 2019-01-02 11:58:26 +01:00
Marrub
3e3d21cd35 Fix A_CustomBulletAttack's spawnofs_xy parameter
The current behaviour offsets to the front of the actor rather than the side, due to an oversight in the code, which oddly is not present in the A_FireBullets equivalent.
2019-01-02 08:13:53 +01:00
Christoph Oelckers
dc612703d5 - scriptified the declaration of AmbientSound
Most of the code is still native, but this means that PlayerPawn is the last remaining child of AActor.
2019-01-02 01:05:20 +01:00
Player701
68091db598 - Since GetParentAmmo is now virtual, BackpackItem and the "give ammo" cheat should call GetParentAmmo to determine base ammo classes. 2019-01-01 22:00:35 +01:00
Christoph Oelckers
d654e02dea - rewrote dynamic lights to not use actors for the internal representation and made DynamicLight a purely scripted class.
This should be less of a drag on the playsim than having each light a separate actor. A quick check with ZDCMP2 showed that the light processing time was reduced to 1/3rd from 0.5 ms to 0.17 ms per tic.
It's also one native actor class less.
2019-01-01 19:35:55 +01:00
alexey.lysiuk
99479d84b1 - fixed everlasting fast projectile after hitting ceiling
Without the test for ceiling hit fast projectile could enter its Death state every tick infinitely

https://forum.zdoom.org/viewtopic.php?t=63023
2019-01-01 08:14:28 +01:00
Christoph Oelckers
0b2a919bbe - fixed crash in AutoUseStrifeHealth
The loop never checked if the item was still valid and would continue to try to use it, even after it was removed from the inventory and destroyed.
As native code this just failed silently, but with the VM it needs to be explicitly checked.
2018-12-31 19:03:02 +01:00
Major Cooke
8d9d71f55f - Fixed: SXF_CLEARCALLERSPECIAL cleared the spawned actor's special instead of the caller. 2018-12-30 19:01:31 +01:00
alexey.lysiuk
36896a1224 - fixed ammo check for weapon with 'uses both' flags
https://forum.zdoom.org/viewtopic.php?t=63047
2018-12-29 13:36:10 +02:00
alexey.lysiuk
8e684f9687 - fixed missing attack sound in A_CustomPunch
See 7bb3855439/src/p_actionfunctions.cpp (L1729)

https://forum.zdoom.org/viewtopic.php?t=63049
2018-12-29 12:34:38 +02:00
Christoph Oelckers
dd3dba2ef1 - made PlayerPawn.TweakSpeeds virtual. 2018-12-29 08:43:36 +01:00
Christoph Oelckers
3559f7dffb Merge branch 'master' of https://github.com/coelckers/gzdoom 2018-12-28 23:14:22 +01:00
Christoph Oelckers
5f303859e9 - made some changes to how the compatibility code works to allow removing the last remaining global variables of the map loading code.
Everything temporary is now part of the MapLoader class.
2018-12-28 23:14:11 +01:00
Erick Tenorio
0a6ec054d2 - TNT.WAD fixes 2018-12-27 20:52:08 +01:00
Erick Tenorio
9ee0271320 - Have Plutonia MAP16 pit kill player 2018-12-27 18:59:29 +01:00
Kevin Caccamo
e04fc026ff Expand UDMF and ZScript API for side's own additive colors
Add 'useowncoloradd_{top,mid,bottom}' sidedef properties to the UDMF 
spec
Only use side's additive colors if 'useowncoloradd_(top|mid|bottom)' is 
set.
Rename UseOwnColors flag to UseOwnSpecialColors
Add UseOwnAdditiveColor flag to side_t::part
Add EnableAdditiveColor to side_t
Add Side.EnableAdditiveColor to ZScript API
2018-12-26 16:58:27 +01:00
Kevin Caccamo
286886e161 Minor fixes for additive colour ZScript API
Sector.SetAdditiveColor actually called Sector.SetSpecialColor
Add use boolean property, used to determine whether or not to override the sector's additive wall colour with the side's additive colour.
2018-12-26 16:58:27 +01:00
Kevin Caccamo
0773e6a98e Rework implementation as per the new specification
The new specification is more flexible, and allows assigning additive 
colors to individual parts of a sector (walls, sprites, flats) and even 
individual parts of a side (top, middle, bottom)

Add AdditiveColors arrays to sector_t and side_t::part
Initialize AdditiveColors arrays to 0
Export AdditiveColors to ZScript
Save AdditiveColors in saved game files
Use colors from AdditiveColors arrays when setting the additive color 
for the render state
Add code to parse the new UDMF additive color properties
Remove additive color slot from sector color/part enum
Add SetAdditiveColor to sector_t and side_t
Add GetAdditiveColor to side_t
Export new methods and additive color arrays to ZScript
2018-12-26 16:58:27 +01:00
Kevin Caccamo
758cd77e55 Rename ColorAdd to AddColor, and use it ingame
Rename ColorAdd to AddColor
Add AddColor to FRenderState
Tweak SpecialColors array in ZScript to include the additive color
Add uAddColor to the shader compiler
Add uAddColor to the texel
2018-12-26 16:58:27 +01:00
Major Cooke
6372cdaa41 Split off pain chance triggering from ReactToDamage into its own function and gave ZScript access to it.
- TriggerPainChance(Name mod, bool forcedPain)
- One exception: PainThrehold is only checked in ReactToDamage, since this function does not require checking damage amount.
2018-12-26 11:55:42 +01:00
alexey.lysiuk
0584ecf65e - declared Actor's Morph() and UnMorph() functions virtual
They are expected to be virtual on C++ side
2018-12-25 16:27:33 +02:00
Christoph Oelckers
fcfccfe739 - fixed random number generation in SpawnFizzle.
This should now produce the same value range as Hexen's original code.
2018-12-23 12:40:26 +01:00
Christoph Oelckers
c1a86e9a4d - fixed bad attempt at restoring position in A_CustomBulletAttack. 2018-12-23 12:13:53 +01:00
Christoph Oelckers
9208fb9b77 - missed this. 2018-12-22 19:12:34 +01:00
Christoph Oelckers
36058df025 - gave the strifehumanoid's burn states dynamic lights.
Unlike everything else from the IWADs this had to use the 'light' keyword in ZScript because this is merely a base class for many others and the light definitions here need to be inheritable.
2018-12-22 16:11:18 +01:00
Christoph Oelckers
5e086ec384 - renamed back arguments of A_FireProjectile. 2018-12-22 16:11:18 +01:00
Christoph Oelckers
f6d9110c70 - removed the redundant GetOffsetPosition export and added direct native support to its existing variants 2018-12-21 13:52:30 +01:00
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
Christoph Oelckers
1deedd5671 - fixed PlayerInfo.FindMostRecentWeapon
returning multiple values from a subfunction is currently not working so this has to add an indirection.
2018-12-21 12:40:05 +01:00
Christoph Oelckers
9fab5f3b2c - fixed: For an initial weapon pickup, sv_unlimited_pickup wasn't checked for the included ammo. 2018-12-21 08:59:37 +01:00
Cacodemon345
789941f24d Export P_GetOffsetPosition and ADynamicLight::SetOffset to ZScript 2018-12-20 22:54:45 +01:00
Player701
d049b3b3eb - Fixed the position of the soul sphere within one of the secret areas (sector 324) of Alien Vendetta MAP28. 2018-12-20 19:03:15 +01:00
Christoph Oelckers
3291d8e9ac - made Ammo.GetParentAmmo virtual 2018-12-19 18:18:15 +01:00
Chronos Ouroboros
bb8fcd63c4 Added a function for triggering use/push specials for usage in custom monster AI. 2018-12-18 21:09:13 +01:00
Chronos Ouroboros
e7118804ba Exported P_CheckFor3DFloorHit and P_CheckFor3DCeilingHit to ZScript. 2018-12-18 21:09:13 +01:00
Christoph Oelckers
462fe891bd - fixed: A powered up weapon which shares its ready state with the parent but is currently in a firing sequence may not force-switch the weapon, because that will cause the sequence to run in the wrong weapon's context. 2018-12-18 20:38:25 +01:00
Christoph Oelckers
ab624c8c5a Merge branch 'master' into Texture_Cleanup
# Conflicts:
#	src/textures/hires/hqresize.cpp
2018-12-11 20:27:24 +01:00
Christoph Oelckers
f6aa16947a - re-added PlayerInfo.BringUpWeapon. 2018-12-11 00:35:53 +01:00
Rachael Alexanderson
28516c2def - split gl_texture_hqresize into two variables - one for mode, one for multiplier. 2018-12-10 14:25:29 -05:00
Christoph Oelckers
79a0f76801 - replaced TexMan.operator() with two functions.
This was done to make reviewing easier, again because it is virtually impossible to search for the operators in the code.

Going through this revealed quite a few places where texture animations were on but shouldn't and even more places that did not check PASLVERS, although they were preparing some paletted rendering.
2018-12-07 02:53:18 +01:00
Christoph Oelckers
32e245f2b9 - moved the software rendering specific parts of the sky setup to r_skyplane.cpp. 2018-12-06 20:52:03 +01:00
Christoph Oelckers
d500dc99ea - handle the Harmony status bar icon scaling a bit more robustly.
Considering that the physical texture size should be abstracted away from modding this needs to be done differently.
Doing any calculations with physical texture sizes on the mod side is only going to cause errors so this had been changed to always return scaled size.
2018-12-06 20:21:33 +01:00
Christoph Oelckers
494a113920 - more direct native entry points.
- disallow bool as a return value for direct native calls because it only sets the lowest 8 bits of the return register.
- changed return type for several functions from bool to int where the return type was the only thing blocking use as direct native call.
2018-12-05 20:10:44 +01:00
Christoph Oelckers
2e7e6cba9d - scriptified P_CheckMeleeRange2. 2018-12-05 18:58:15 +01:00
Christoph Oelckers
de5ab0b4b6 - deprecated a few functions that depend on AAPTR_* to be useful. 2018-12-05 18:33:59 +01:00
Christoph Oelckers
6c9d0b166a Added direct native entry points to a larger number of functions. 2018-12-05 17:34:11 +01:00
Christoph Oelckers
fd801ca91b - fixed: SlotPriority must be a float.
It was a fixed before but I missed that when refactoring it into an automatic property.
2018-12-05 08:13:52 +01:00
Christoph Oelckers
33db5792b4 - moved a large part of the VM thunks out of p_mobj.cpp. 2018-12-05 00:21:16 +01:00
Christoph Oelckers
45d7e5a038 - scriptified ASpecialSpot.
This only had two simple native methods so the class is not fully scripted.
2018-12-04 18:21:48 +01:00
Christoph Oelckers
5e4b366724 Removed all native components from AInventory. 2018-12-04 18:06:09 +01:00
Christoph Oelckers
d66516ec82 - scriptified A_SpawnSingleItem, which was the last piece of native code still referencing AInventory 2018-12-04 17:55:45 +01:00
Christoph Oelckers
44e43c48b5 - scriptified A_SelectWeapon 2018-12-04 17:31:25 +01:00
Christoph Oelckers
9348baeeb1 Removed all remaining references to AInventory
What remains is the class definition and one single reference that will be scriptified.
2018-12-04 17:11:36 +01:00
Christoph Oelckers
99a87f62b6 - The 'A' prefix has no meaning in class names on the script side - even in comments. 2018-12-04 00:23:52 +01:00
Christoph Oelckers
9e70701e50 - fixed max. ammo display on AltHud. 2018-12-03 23:34:23 +01:00
Christoph Oelckers
b6d0492478 - fixed crash with weapons which remove themselves from the inventory but continue calling action functions.
This is still an error, so now this throws a meaningful exception.
2018-12-03 18:51:24 +01:00
Christoph Oelckers
0e095b0c05 - removed all direct references of AInventory::Owner and AInventory::Amount from the C++ code. 2018-12-03 17:41:05 +01:00
Marisa Kirisame
d6d3dd038e Fix RemoveInventory not calling DetachFromOwner when an item is the first in the owner's inventory.
Fix CheckAddToSlots not working because it uses GetReplacement incorrectly.
2018-12-03 17:29:08 +01:00
Christoph Oelckers
d96d505520 - fixed accidentally misnamed parameter in A_Explode. 2018-12-02 21:39:28 +01:00
Christoph Oelckers
807df33e1a - scriptified AInventory::Tick.
This was the last bit of code standing in the way of making AInventory a fully scripted class.
All that's left to sort out is some variable accesses - the vast majority of them in SBARINFO.
2018-12-02 20:58:15 +01:00
Christoph Oelckers
2e383073e8 - scriptified the AutoUseHealth feature.
This again is a piece of code that reads and even writes to inventory items' properties, so better have it on the script side.
2018-12-02 19:45:45 +01:00
Christoph Oelckers
3182569fb8 - scriptified the decision making of the invuseall CCMD.
Custom items had no way to adjust to this - and it also was the last native access to ItemFlags.
2018-12-02 18:43:38 +01:00
Christoph Oelckers
93f91d1039 - scriptified P_DropItem. 2018-12-02 18:31:18 +01:00
Christoph Oelckers
a5fc26b37c - scriptified the no-spawn flag check for armor and health items. 2018-12-02 18:04:44 +01:00
Christoph Oelckers
ee08412e49 - scriptified G_PlayerFinishLevel.
Outside of SBARINFO this was the biggest remaining piece of code that referenced AInventory internals.
2018-12-02 16:26:02 +01:00
Christoph Oelckers
1f33ba2c4d - fixed incomplete null checks in A_RadiusThrust. 2018-12-02 16:06:04 +01:00
Christoph Oelckers
719598aae4 - scriptified AActor::ClearInventory 2018-12-02 15:24:44 +01:00
Christoph Oelckers
d11b33e8fd - scriptified the last components of the alternative HUD.
- moved the ALTHUDCF parser PClass::StaticInit, so that it gets done right after creating the actor definitions.

All left to do is not to reallocate the AltHud object for each frame but store it in a better suited place.
2018-12-02 14:34:10 +01:00
Christoph Oelckers
ba905321b0 - scriptified the main drawer for the in-game HUD and removed all intermediate VM calls from the native source. 2018-12-02 14:34:09 +01:00
Christoph Oelckers
fe39236ee1 - scriptified the AltHUD'S powerup drawer. 2018-12-02 14:34:09 +01:00
Christoph Oelckers
ddaab4d2ab - scriptified and cleaned up the AltHUD's DrawCoordinates, DrawTime and DrawLatency functions.
Some backing functionality was moved elsewhere because scripting should not have access to low level system information.
2018-12-02 14:34:09 +01:00
Christoph Oelckers
4431ec06fd - scriptified the AltHUD's inventory drawer and fixed the InvPrev CCMD. 2018-12-02 14:34:09 +01:00
Christoph Oelckers
714ca9b2ce - scriptified the AltHUD's weapon drawer. 2018-12-02 14:34:08 +01:00
Christoph Oelckers
1406c11f8e - added the missing TNT1A0 check for icon-less keys.
Since it tries to get the icon from the spawn state it also has to check if that actually has a valid sprite.
2018-12-02 14:34:08 +01:00
Christoph Oelckers
fbc441673a - AltHUD ammo drawer scriptified. 2018-12-02 14:34:08 +01:00
Christoph Oelckers
4a1f011dc1 - Alt HUD scriptification, part 1. 2018-12-02 14:34:08 +01:00
Major Cooke
49f2a38799 Fixed A_JumpIfNoAmmo not working. 2018-12-02 07:28:20 +01:00
Christoph Oelckers
a291ed21fe - fixed the AngleToVector calls in stateprovider.txt.
This looks like a search & replace gone wrong.
2018-12-02 00:41:23 +01:00
Major Cooke
e9df56198c - Restored A_SpawnItemEx's "chance" to "failchance" to prevent mod breakage from named parameters. 2018-12-01 23:39:54 +01:00
Christoph Oelckers
577af8860c - scriptified invnext and invprev CCMDs. 2018-12-01 22:37:12 +01:00
Christoph Oelckers
5c647de70c - moved ValidateInvFirst to the script side because this was one of the major functions that directly reference AInventory. 2018-12-01 17:46:20 +01:00
Christoph Oelckers
bc1990b6d7 - moved AInventory::DoRespawn fully to the script side. 2018-12-01 17:29:37 +01:00
Christoph Oelckers
a14b0c58bf - re-fixed the massacre fix for Dehacked-modified inventory items.
Instead of overriding the Massacre method it is preferable to clear the flags causing the bad behavior, most notably ISMONSTER.

# Conflicts:
#	src/g_inventory/a_pickups.cpp
#	src/g_inventory/a_pickups.h
2018-12-01 17:20:52 +01:00
Christoph Oelckers
7301bbc58e - scriptified GiveAmmo and the one remaining piece of native code still using it. 2018-12-01 17:20:23 +01:00
Christoph Oelckers
2c59172c42 - scriptified DropInventory. 2018-12-01 17:18:26 +01:00
Christoph Oelckers
09129e0113 - scriptified UseInventory and several functions using the already scriptified ones, 2018-12-01 17:17:08 +01:00
Christoph Oelckers
588ddd185b - scriptified TakeInventory, including the ACS/FS interfaces. 2018-12-01 17:11:09 +01:00
Christoph Oelckers
023efc7685 - scriptified RemoveInventory and Inventory.OnDestroy. 2018-12-01 17:09:23 +01:00
Christoph Oelckers
eb47fb9adc - scriptified GiveInventory and made the interface a bit more configurable by mods.
Now a child type can decide for itself how to treat 'amount'.
The scripting interfaces to this function in ACS and FraggleScript have been consolidated and also scriptified.
2018-12-01 17:07:09 +01:00
Christoph Oelckers
a426655d61 - scriptified AddInventory. 2018-12-01 17:03:58 +01:00
Christoph Oelckers
aa32acae25 - a bit of code reordering for adding direct native entry points.
- offloaded key list generation for alternative HUD to non-UI parts.

This change also revealed a problem with handling empty sprites in the key list so this got fixed, too.
2018-12-01 14:18:28 +01:00
Christoph Oelckers
03015896d6 - seems there are two versions of Hacx's MAP05. 2018-12-01 10:30:50 +01:00
Christoph Oelckers
a0c0e8bdfe Merge remote-tracking branch 'remotes/origin/weapon_scriptification' into asmjit
# Conflicts:
#	src/g_inventory/a_pickups.cpp
2018-11-30 21:28:44 +01:00
Christoph Oelckers
8e46cb3a21 Merge remote-tracking branch 'remotes/origin/master' into asmjit 2018-11-30 18:49:28 +01:00
Player701
927d333063 - Exported AActor::Grind to ZScript. 2018-11-29 23:46:47 +01:00
Christoph Oelckers
ef2c433a8b - fixed declaration of ChangeStatNum. 2018-11-29 20:15:24 +01:00
Christoph Oelckers
ba2b9430f8 ChangeStatNum must not be virtual
Overriding this would make the engine vulnerable to  badly behaving mods. Intercepting this and altering the behavior can render the entire game inoperable, especially if more internal code gets scriptified later. So even at the risk of breaking some carelsss mods this must be blocked.
2018-11-29 19:00:25 +01:00
Christoph Oelckers
3acd9c8116 Made all virtual base functions for the event handler scripted
This was by far the largest block of native virtuals, and they were only native to be able to allow checking if the event was implemented for the current handler. This can easily be done by looking at the byte code, just like VMCall also does but in turn it removes more than half of the existing native virtuals from the interface.
2018-11-29 18:46:28 +01:00
Christoph Oelckers
f43f0b9bd4 - added a few more direct native entry points. 2018-11-29 00:27:09 +01:00
Christoph Oelckers
a5a9ab07af Merge branch 'master' into asmjit 2018-11-28 18:44:42 +01:00
Christoph Oelckers
7ff0cd70ad - explicitly declare the constructor and destructor methods of FCheckPosition so that they get a working prototype. 2018-11-28 17:33:37 +01:00
Player701
91ea22e85a - Fixed textures on the two switches that rise from the floor in the eastern area of TNT MAP31 2018-11-27 21:14:52 +01:00
Christoph Oelckers
5e4e9e2c2b Merge branch 'master' into asmjit 2018-11-27 19:53:22 +01:00
Alexander
4a85e24228 fixed spelling (mostly comments) 2018-11-27 19:44:06 +01:00
Christoph Oelckers
47b1fa774d Merge branch 'asmjit' into weapon_scriptification
# Conflicts:
#	src/gi.cpp
#	wadsrc/static/zscript/base.txt
2018-11-26 00:14:44 +01:00
Christoph Oelckers
90d79865a5 Merge branch 'master' into asmjit 2018-11-25 23:33:23 +01:00
Christoph Oelckers
9475bfe4f1 - declare builtins as static. 2018-11-25 21:47:28 +01:00
Christoph Oelckers
a501a22b28 - define the built-in functions defined in codegen.cpp through the regular interface instead uf just hacking them into the symbol table with incompletely set up data.
- added direct native variants to these builtins and fixed problems with builtin processing.
2018-11-25 11:41:29 +01:00
Christoph Oelckers
43d434b071 - removed AStateProvider from native code.
The only place still referencing it was CallStateChain, so this has been made a static function now instead of a class method.
2018-11-25 10:09:06 +01:00
Christoph Oelckers
f4789bdefc - fixed handling of dummy flags. 2018-11-25 10:06:00 +01:00
Christoph Oelckers
d6b781312c - removed all remaining native components of the weapon class. 2018-11-25 10:00:55 +01:00
Christoph Oelckers
70d3c31551 - allow defining flags in the script declaration of a class and do that for Weapon. 2018-11-25 09:29:12 +01:00
Christoph Oelckers
b5c4ab8c47 - removed all direct access to AWeapon's members to prepare moving this class fully to the script side.
Disregarding UI-side and setup-related calls there's unfortunately still 6 places in the native game code which require direct access.
2018-11-25 08:17:37 +01:00
Christoph Oelckers
00a48b09e5 - moved the 'Finalize' methods back into a single function in the parser code.
It has been like this initially but was changed when ZDoom gained an overly complicated polymorphic class descriptor object that required a lot of support code. All these complications have long been removed but these methods remained. Since they prevent a class from being moved to the script side entirely they had to be removed.

This was the last major blocker to make Weapon a purely scripted class, the only remaining native method is Serialize which is of no concern for the coming work.
2018-11-25 08:16:18 +01:00
Christoph Oelckers
7012179904 - moved MarkPrecacheSounds completely to the script side and added native support to make this a usable feature. 2018-11-25 07:43:05 +01:00
Christoph Oelckers
8fa16b6c30 - some cleanup on the weapon slot interface.
This really shouldn't make any decisions from directly reading weapon class defaults.
2018-11-25 07:21:02 +01:00
Christoph Oelckers
f218e95c4d - scriptified cht_Takeweaps. 2018-11-25 01:26:19 +01:00
Christoph Oelckers
460c400315 - scriptified ApplyKickback. 2018-11-25 01:12:45 +01:00
Christoph Oelckers
ae27acb944 - scriptified A_WeaponReady and its subfunctions. 2018-11-25 00:54:13 +01:00
Christoph Oelckers
34b7e5f435 - scriptified P_BobWeapon as a virtual function on PlayerPawn. 2018-11-25 00:23:03 +01:00
Christoph Oelckers
8eb4697fbd - removed the bot related properties from AWeapon.
This stuff is now kept locally in the bot code so that it doesn't infest the rest of the engine.
And please don't read the new botsupp.txt file as some new means to configure bots! This was merely done to get this data out of the way.
The bots are still broken beyond repair and virtually unusable, even if proper data is provided for all weapons.
2018-11-24 23:48:23 +01:00
Christoph Oelckers
4392b4e96d - exported the blood spawning part of P_LineAttack as a virtual ZScript function. 2018-11-24 22:35:50 +01:00
Christoph Oelckers
f260709e73 - moved the weapon selection logic to PlayerPawn as overridable virtual functions. 2018-11-24 22:22:36 +01:00
Christoph Oelckers
b6d0d5008e - change teleport freeze handling to a player property plus virtual override on PlayerPawn for increased configurability. 2018-11-24 21:37:00 +01:00
Christoph Oelckers
337750b874 - scriptified BecomeItem and BecomePickup 2018-11-24 21:25:26 +01:00
Christoph Oelckers
3d892d3970 - scriptified FilterCoopRespawnInventory. 2018-11-24 20:58:33 +01:00
Christoph Oelckers
c14b7f58d3 - scriptified some simple sound functions. 2018-11-24 20:33:00 +01:00
Christoph Oelckers
fb91982da2 - scriptified APlayerPawn::Die and fixed a few things I encountered while doing it. 2018-11-24 20:32:12 +01:00
Christoph Oelckers
cf9cd58310 - scriptified ModifyDropAmount as a virtual function hierarchy for Inventory and children. 2018-11-24 19:59:24 +01:00
Christoph Oelckers
652606f70b - scriptified A_Explode and relatives. 2018-11-24 19:29:52 +01:00
Christoph Oelckers
44d51a6de9 - scriptified GetDefaultInventory. 2018-11-24 19:03:33 +01:00
Christoph Oelckers
be100fa5d3 - removed MeleeWeapon flag from the tomed PhoenixRod and the fighterhammer.
In both cases, having this flag on will render the monster-backing-off-check for melee attacks ineffective because it would misinterpret these weapons as close range only - which they aren't. Even for the PhoenixRod the range is longer than what gets checked here.
As a consequence, the bot's check for missile shooting melee weapons has also become pointless because no such weapon is defined anymore.
2018-11-24 18:42:10 +01:00
Christoph Oelckers
814af66864 - exported one FraggleScript function for testing. 2018-11-24 18:33:42 +01:00
Christoph Oelckers
595208f2fd - exported a few more weapon handling functions so that the native GetDownState stub could be removed. 2018-11-24 18:21:40 +01:00
Christoph Oelckers
9584e3bc53 - scriptified P_BringUpWeapon because this was the only native function still referencing AWeapon::GetReadyState. 2018-11-24 17:22:59 +01:00
Christoph Oelckers
b4c272ddff - scriptified A_SpawnItem(Ex) and A_ThrowGrenade.
These were the last native functions referencing AWeapon::DepleteAmmo, so that function is now exclusively on the scripting side.
2018-11-24 17:01:12 +01:00
Christoph Oelckers
6be7fc33f3 - scriptified 3 more functions in stateprovider. 2018-11-24 15:42:43 +01:00
Christoph Oelckers
4c1b3f81ab - scriptified A_RailAttack. 2018-11-24 15:12:30 +01:00
Christoph Oelckers
5c130737c4 - scriptified A_CustomPunch 2018-11-24 14:48:30 +01:00
Christoph Oelckers
7bb3855439 - scriptified A_FireProjectile 2018-11-24 14:16:08 +01:00
Alexander
1b82e2078d add monster tags (Friendly Names) for Hexen 2018-11-24 14:02:48 +01:00
Christoph Oelckers
e071be8371 - scriptified A_FireBullets and A_CustomBulletAttack. 2018-11-24 13:50:27 +01:00
Christoph Oelckers
6fc63b9b78 - started with a ScriptUtil class which will allow moving function implementations for ACS and FraggleScript to zscript.txt
So far 3 functions for testing implemented.
2018-11-24 13:06:01 +01:00
alexey.lysiuk
f11b20122f - made ZRock4 solid like in vanilla Hexen
9164cc6e0f/INFO.C (L5731)
c0c1771e37/src/hexen/info.c (L5748)

https://forum.zdoom.org/viewtopic.php?t=62660
2018-11-24 12:51:14 +02:00