Commit graph

2928 commits

Author SHA1 Message Date
Christoph Oelckers
045d6d4355 - 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.
2019-04-16 19:01:48 +02:00
Christoph Oelckers
437c72a089 - AltHUD ammo drawer scriptified. 2019-04-16 19:01:46 +02:00
Christoph Oelckers
1033dc3b10 - Alt HUD scriptification, part 1. 2019-04-16 19:01:43 +02:00
Major Cooke
7ff76366ef Fixed A_JumpIfNoAmmo not working. 2019-04-16 18:46:06 +02:00
Christoph Oelckers
1b55e708bc - fixed the AngleToVector calls in stateprovider.txt.
This looks like a search & replace gone wrong.
2019-04-16 18:46:04 +02:00
Major Cooke
4ae14c402b - Restored A_SpawnItemEx's "chance" to "failchance" to prevent mod breakage from named parameters. 2019-04-16 18:46:00 +02:00
Christoph Oelckers
d18ed18d2e - scriptified invnext and invprev CCMDs. 2019-04-16 18:45:54 +02:00
Christoph Oelckers
081d0bbcca - moved ValidateInvFirst to the script side because this was one of the major functions that directly reference AInventory. 2019-04-16 18:45:52 +02:00
Christoph Oelckers
d021d63d33 - moved AInventory::DoRespawn fully to the script side. 2019-04-16 18:45:49 +02:00
Christoph Oelckers
9981674a27 - 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
2019-04-16 18:45:43 +02:00
Christoph Oelckers
be8d1c950d - scriptified GiveAmmo and the one remaining piece of native code still using it. 2019-04-16 18:45:41 +02:00
Christoph Oelckers
f1bf1cc44e - scriptified DropInventory. 2019-04-16 18:45:38 +02:00
Christoph Oelckers
a614f2a81e - scriptified UseInventory and several functions using the already scriptified ones,
# Conflicts:
#	src/g_statusbar/sbar.h
2019-04-16 18:45:36 +02:00
Christoph Oelckers
e7c798f58f - scriptified TakeInventory, including the ACS/FS interfaces. 2019-04-16 18:45:03 +02:00
Christoph Oelckers
d2741813ab - scriptified RemoveInventory and Inventory.OnDestroy. 2019-04-16 18:44:59 +02:00
Christoph Oelckers
8609e2ba68 - 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.
2019-04-16 18:44:56 +02:00
Christoph Oelckers
2a192cde92 - scriptified AddInventory. 2019-04-16 18:44:53 +02:00
drfrag
e3ce680ec9 - Removed duplicate definition of DTA_Internal3. 2019-04-16 18:40:25 +02:00
Christoph Oelckers
4049b56d50 - 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.

# Conflicts:
#	src/g_shared/shared_hud.cpp
2019-04-16 18:17:05 +02:00
Christoph Oelckers
4080bfd3cf - seems there are two versions of Hacx's MAP05.
# Conflicts:
#	wadsrc/static/zscript/base.txt
#	wadsrc/static/zscript/level_compatibility.txt
2019-04-16 17:47:42 +02:00
Christoph Oelckers
1a8b18d539 - fixed declaration of ChangeStatNum. 2019-04-16 17:10:37 +02:00
Christoph Oelckers
886df37d1a 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.
2019-04-16 15:26:16 +02:00
Christoph Oelckers
09f4c7e4a9 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.
2019-04-16 15:26:14 +02:00
Christoph Oelckers
4ac866aedc - added a few more direct native entry points. 2019-04-16 15:12:41 +02:00
Christoph Oelckers
00fed23e5f - explicitly declare the constructor and destructor methods of FCheckPosition so that they get a working prototype. 2019-04-16 15:12:33 +02:00
Christoph Oelckers
29eee14549 - declare builtins as static. 2019-04-16 14:58:18 +02:00
Christoph Oelckers
c01981d08a - 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.
2019-04-15 22:30:01 +02:00
Christoph Oelckers
20ec6ddce4 - 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.
2019-04-15 22:29:58 +02:00
Christoph Oelckers
376c47bef6 - fixed handling of dummy flags. 2019-04-15 22:29:55 +02:00
Christoph Oelckers
96e9dbd967 - removed all remaining native components of the weapon class. 2019-04-15 22:29:52 +02:00
Christoph Oelckers
d871072f28 - allow defining flags in the script declaration of a class and do that for Weapon. 2019-04-15 22:29:47 +02:00
Christoph Oelckers
309cc57504 - 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.
2019-04-15 22:29:43 +02:00
Christoph Oelckers
ce5792242c - 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.
2019-04-15 22:29:39 +02:00
Christoph Oelckers
7caa6a922d - moved MarkPrecacheSounds completely to the script side and added native support to make this a usable feature.
# Conflicts:
#	src/g_inventory/a_pickups.cpp
2019-04-15 22:29:35 +02:00
Christoph Oelckers
ac754b5e96 - some cleanup on the weapon slot interface.
This really shouldn't make any decisions from directly reading weapon class defaults.
2019-04-15 22:29:32 +02:00
Christoph Oelckers
f9dfdace16 - scriptified cht_Takeweaps. 2019-04-15 22:29:30 +02:00
Christoph Oelckers
94b0338c31 - scriptified ApplyKickback. 2019-04-15 22:29:26 +02:00
Christoph Oelckers
59bffe2f55 - scriptified A_WeaponReady and its subfunctions. 2019-04-15 22:29:22 +02:00
Christoph Oelckers
951ed466b3 - scriptified P_BobWeapon as a virtual function on PlayerPawn. 2019-04-15 22:29:19 +02:00
Christoph Oelckers
0515af2bd3 - 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.
2019-04-15 22:29:15 +02:00
Christoph Oelckers
681009e1ea - exported the blood spawning part of P_LineAttack as a virtual ZScript function. 2019-04-15 21:59:08 +02:00
Christoph Oelckers
82ffdd5e6b - moved the weapon selection logic to PlayerPawn as overridable virtual functions. 2019-04-15 21:59:07 +02:00
Christoph Oelckers
27c67716df - change teleport freeze handling to a player property plus virtual override on PlayerPawn for increased configurability.
# Conflicts:
#	src/g_inventory/a_pickups.cpp
2019-04-15 21:59:03 +02:00
Christoph Oelckers
7c1416cb6f - scriptified BecomeItem and BecomePickup
# Conflicts:
#	src/g_inventory/a_pickups.cpp
2019-04-15 21:59:01 +02:00
Christoph Oelckers
08059f718b - scriptified FilterCoopRespawnInventory. 2019-04-15 21:59:00 +02:00
Christoph Oelckers
1ecada388c - scriptified some simple sound functions. 2019-04-15 21:58:58 +02:00
Christoph Oelckers
d123230fb1 - scriptified APlayerPawn::Die and fixed a few things I encountered while doing it. 2019-04-15 21:58:56 +02:00
Christoph Oelckers
0eec8b293a - scriptified ModifyDropAmount as a virtual function hierarchy for Inventory and children. 2019-04-15 21:58:54 +02:00
Christoph Oelckers
f1c7815b16 - scriptified A_Explode and relatives. 2019-04-15 21:58:52 +02:00
Christoph Oelckers
e234d450aa - scriptified GetDefaultInventory. 2019-04-15 21:58:50 +02:00