Commit graph

21109 commits

Author SHA1 Message Date
toaster
d5cd4f6798 Make placeholder for vote screen gametype color yellowmap[0] instead of 255 cyan 2023-01-01 14:54:58 +00:00
Sally Coolatta
761be01dbb Contain end & size into savebuffer_t
I would've liked to make it use a single allocate function to do this very cleanly, but these cases were very clearly not meant to be standardized and use wildly different methods to allocate & free...
2023-01-01 00:23:23 -08:00
James R
77d54a09fe Remove global lua_save_p and use savebuffer_t for LUA_Archive / LUA_UnArchive 2023-01-01 00:23:23 -08:00
James R
061f8b0587 g_demo.c: use savebuffer_t 2023-01-01 00:23:21 -08:00
Sally Coolatta
38a35b6f78 Make save_p / savebuffers not global
This caused some scary issues with P_SaveNetGame the other day, and it's making ACS net sync harder. Let's just cut this off right now.

Also fixed some scary mix-ups in some of the Lua archiving code.
2023-01-01 00:22:56 -08:00
toaster
42a6b03e48 Remove "circuitmap"
An effectively useless global scope boolean that literally checks for the presence of a finish line, created in and used only by things we inherited from vanilla SRB2
2022-12-31 23:27:59 +00:00
toaster
84b066245e Demo savemode text is consistent colour now 2022-12-31 23:14:43 +00:00
toaster
425a02d09b Make GTR_BUMPERS less monolithic
* Battle-like item box respawn handling inverse of GTR_CIRCUIT
* Make battle fullscreen overlay forbid GTR_CIRCUIT
* Make GTR_ITEMARROWS actually do something
* Make everything related to points actually use GTR_POINTLIMIT
* Fobid sphere addition without GTR_SPHERES, to mirror ring addition forbidding
2022-12-31 23:12:41 +00:00
toaster
c23a2d8dca Don't force a reset of the level in GTR_BUMPER when lonesome if not GTR_CAPSULES 2022-12-31 22:49:20 +00:00
toaster
3357f56c9e G_RandMap should consider & all valid flags for gametype, not ==. 2022-12-31 22:44:49 +00:00
toaster
94bcf79710 Restrict collecting rings in GTR_SPHERES, not GTR_BUMPERS! 2022-12-31 22:34:19 +00:00
toaster
98646ef65b Fix arrangement of gametype rules between SOC and constants 2022-12-31 22:33:09 +00:00
toaster
36d6fcaba4 Add a preview for Special Attack unlock type 2022-12-31 21:43:39 +00:00
toaster
05241341b8 Remove the last few instances of gametype-specific colorisation 2022-12-31 21:38:52 +00:00
Sally Coolatta
a602530811 Add ACS functions that can replicate line triggers
PlayerTeam, PlayerRings, PlayerScore, CountEnemies, CountPushables, HaveUnlockableTrigger, HaveUnlockable, PlayerSkin, GetObjectDye, PlayerEmeralds, PlayerLap, LowestLap, and EncoreMode
2022-12-31 16:02:55 -05:00
toaster
a2c5ff6ac8 Remove the duplication of levellist.netgame into cupgrid.netgame 2022-12-31 20:56:00 +00:00
toaster
e0c4c235df Move "return" in "Are you sure you want to return to the menu?" to the next line, to balance the lines out a little better 2022-12-31 20:34:11 +00:00
toaster
76ea72ceac Prevent entering the cup or level select if there's no valid maps to pick from. 2022-12-31 20:33:31 +00:00
Sally Coolatta
a0adb05c9b Merge branch 'master' into acs 2022-12-31 15:04:51 -05:00
toaster
c857153c29 Unstaged closing brace 2022-12-31 19:03:13 +00:00
toaster
6b18f869b9 Prevent a special stage win by sneaking ahead of the UFO to the goal line 2022-12-31 19:02:22 +00:00
toaster
5b027ff2fe Instead of preventing lives for GTR_CAPSULES, prevent them for it being GPEVENT_BONUS 2022-12-31 19:00:52 +00:00
toaster
a86ed5c6cb Rework the conditions for the previous commit
- The "never force a retry" condition is now `!G_GametypeUsesLives()`
- In GT_SPECIAL *and* GT_VERSUS, check for K_IsPlayerLosing before retry, instead of bespoke check
2022-12-31 18:59:56 +00:00
toaster
39e68d1ae3 Clear UFO pointer if its object was removed (matches up with general mobjthinker P_SetTarget handling) 2022-12-31 18:45:04 +00:00
Sally Coolatta
bdc77041ce Merge branch 'acs' of https://git.do.srb2.org/KartKrew/Kart into acs 2022-12-31 13:41:34 -05:00
Sally Coolatta
d5155e3d83 Add Hexen line activation flags
- Lines can be set to activate when crossing or bumping into them, with distinctions for players, enemies, and missiles+items.
- A new flag has been added to determine if a line special can activate more than once.
- Finish Line + Respawn Line are now handled like other specials. This means that:
    - They follow the new line activation rules (so you can potentially have a finish line that you have to bump instead of cross)
    - More importantly, they can be called as functions in ACS. (Player_FinishLine and Player_Respawn)
- Fixed linedef flags not being saved in save games.
2022-12-31 13:41:17 -05:00
Sally Coolatta
c27139dbcb Add Hexen line activation flags
- Lines can be set to activate when crossing or bumping into them, with distinctions for players, enemies, and missiles+items.
- A new flag has been added to determine if a line special can activate more than once.
- Finish Line + Respawn Line are now handled like other specials. This means that:
    - They follow the new line activation rules (so you can potentially have a finish line that you have to bump instead of cross)
    - More importantly, they can be called as functions in ACS. (Player_FinishLine and Player_Respawn)
- Fixed linedef flags not being saved in save games.
2022-12-31 13:38:05 -05:00
toaster
44555be704 Change the conditions for forced retry at end of round
- If modeattacking, never
- If Sealed Star, if the UFO still exists or the emerald hasn't been picked up
2022-12-31 17:57:22 +00:00
toaster
36b1f5f488 Have a Cup visibly locked if no levels are accessible by the current rules of menusearch_t
- Solved by leveraging M_GetFirstLevelInList alongside existing M_CountLevelsInList calls
- Also optimises the above calls in the M_CupLocked case, since that's no longer being directly used otherwise
2022-12-31 17:50:49 +00:00
toaster
2db7562c24 LF2_FINISHNEEDED
- Replacement for LF2_VISITNEEDED, which was itself a Kart-specific inversion of LF2_NOVISITNEEDED
- Prevents selection in time attack before you've beaten the level in another context (GP, or MP if applicable)
- Should be used for Sealed Stars (and Adventure Example) exclusively IMO, but usable for others too
Related adjustments:
- Allow a map to have a `TypeOfLevel` of 0 without error
- Change the Condition String for UC_MAPVISITED to "Finish a round on X" (previously "Beat X")
2022-12-31 16:22:46 +00:00
toaster
dc7222821c Move M_Init() to fix saving of some menu-specific cvars 2022-12-31 16:05:04 +00:00
Eidolon
6af003771d Add SRB2_ASSERT, srb2::NotNull<T>
Add SRB2_ASSERT, superceding I_Assert

This assertion macro always expands to a call of srb2::do_assert, which
is overloaded with two templates: one which applies if the provided
Level is less than or equal to the SRB2_ASSERTION_LEVEL, and one which
is a no-op. When optimizations are enabled, this will verifiably remove
the evaluation of the expression in all cases, instead of evaluating the
expression and doing nothing with it.

Add srb2::NotNull wrapper utility

This is meant to be used in places where pointers are used as
parameters. It can be used with any pointer-like type, not just raw
pointers. During construction of NotNull, the pointer will be asserted
not-null in debug and paranoia builds, and in release optimizations with
no assertions, the code decays gracefully to standard pointer-passing.
2022-12-30 23:49:29 -06:00
James R
e9dc22a399 Rename strcasestr to nongnu_strcasestr, macro strcasestr ifndef _GNU_SOURCE
Fix for GCC C++ compiler, which always defines _GNU_SOURCE.
2022-12-30 20:17:26 -08:00
Eidolon
fe32cba866 Merge branch 'cxx-io' into 'master'
C++ IO abstractions and std::span

See merge request KartKrew/Kart!840
2022-12-31 03:46:30 +00:00
Eidolon
97ff0dee6a Merge branch 'extern-c-everything' into 'master'
Add extern "C" in C++ to all headers

See merge request KartKrew/Kart!842
2022-12-31 03:46:17 +00:00
Eidolon
e7c379bc8d Add srb2::io streams abstraction 2022-12-30 21:15:44 -06:00
Eidolon
be021baa02 Add extern "C" in C++ to all headers 2022-12-30 19:26:16 -06:00
toaster
21858082d2 EXPERIMENTAL: Use yellowmap for all pause menu icons (except Try Again/Restart Map) instead of custom
Will make long-term management of this menu easier, and pushes aside some inconsistencies between graphics
May be reverted in part or full if it doesn't work for particular assets
2022-12-31 00:01:44 +00:00
toaster
b09045f657 Dehardcode menu gametype selection, part 3
Multiplayer map select now uses the value of `menugametype` accessible just above it on the menu, instead of having to select from a hardcoded set of options
2022-12-30 23:58:22 +00:00
toaster
be49e99a9e Guarantee menugametype's value is good before it's relevant 2022-12-30 23:42:50 +00:00
toaster
ebb2a79666 Dehardcode menu gametype selection, part 2
- Add "Gametype" toggle option to pause menu for admins
    - A/Confirm button on any gametype other than current to do random map in new gametype
    - C/Extra button to return to current gametype
    - A/Confirm button on current gametype does a funny noise and nothing else right now, idk what to do
- `randomlevel` supports the same `-gametype` parameter as `map`
- Both `randomlevel` and `map`'s `-gametype` parameter prohibits `GTR_FORBIDMP` mask gametype changes in netgames
- `randomlevel` properly sets encore based on `cv_kartencore`'s value (and permitting `GTR_ENCORE`)
- Split out `menugametype` change functions
- `yellowmap` now remaps all intermediary shades of grey to match funny pause menu remaps
2022-12-30 20:35:55 +00:00
Sally Coolatta
b93ffbef2f Update UDMF config to work with latest UZB 2022-12-30 15:05:25 -05:00
toaster
3ee8713e46 Dehardcode menu gametype selection, part 1
- Introduce `menugametype`
    - Controlled by IT_KEYHANDLER/M_HandleMenuGametype
    - Excludes gametypes that do not support multiplayer by default
        - GTR_CAPSULES and GTR_BOSS for now, but also user-specifiable GTR_NOMP
- Remove gametype_cons_t and G_UpdateGametypeSelections, an obstacle in the way of infinitely allocatable custom gametypes
2022-12-30 15:23:26 +00:00
toaster
52040c1248 Replays (net and timeeattack) now recognise gametypes by name
- Should support custom gametypes, but haven't been thoroughly testing those
- Custom gametypes must now be unique by name
- Custom gametypes now have a maximum name length of 31
2022-12-29 23:13:51 +00:00
toaster
834150585b Rework demo time/laptime handling
* `ATTACKING_` constants have been changed to be flags
    - `ATTACKING_TIME` contains time data for all gametypes
    - `ATTACKING_LAPS` contains laps data for `GTR_CIRCUIT` on maps with more than 1 lap
* `demoflags` now contains raw `ATTACKING_` flags
* Best time/best lap demo files will now be saved properly again (broken since `new-menus`)
* Ghosts will now be loaded properly again (broken since `unlockables-undefeatable`)
2022-12-29 21:30:04 +00:00
toaster
1f18aa727a Forgot to *stash* this time 2022-12-29 17:57:19 +00:00
toaster
881507889d Fix Broly SIGFPE
- Don't spawn the KI if the duration <= 0
- If the KI spawned but the duration <= 0 for any other reason remove the object instead of performing the division
2022-12-29 17:54:19 +00:00
toaster
d1852adf30 Forgot to stage this 2022-12-29 17:46:11 +00:00
toaster
df3624d96c Executor calls for UFO Catcher special events
Requested by Charyb.
- LE_PINCHPHASE (-2 or 65534) for busting open the Catcher
- LE_BOSSDEAD (-4 or 65532) for grabbing the emerald
Would like to use args for UDMF compatibility but there is no spawnpoint for the Catcher so it's hardcoded for now
2022-12-29 17:44:19 +00:00
toaster
7482e11992 SPB special stage experiment
If you smuggle an SPB to after the death of the UFO Catcher, spawn a single, free-on-straightways manta ring before it blows up.
Testing shows that you can get hit by the SPB's explosion only if you use the free manta ring just before a sneaker panel... but also Sal thinks it's cool and I think it adds depth
2022-12-28 23:35:27 +00:00