Commit graph

523 commits

Author SHA1 Message Date
Sally Coolatta
5067bb854a Split hitlag into its own file 2023-06-30 23:05:40 -07:00
toaster
4344221252 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into seeecret-colors 2023-06-28 12:48:50 +01:00
James R
996f01f418 Add K_PowerUpRemaining, K_GivePowerUp, K_DropPowerUps to Lua 2023-06-27 02:08:07 -07:00
toaster
5036719280 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into seeecret-colors
# Conflicts:
#	src/k_menudraw.c
2023-06-26 23:25:47 +01:00
AJ Martinez
76c783fe69 SpawnFakeShadow for Lua 2023-06-11 20:33:36 -07:00
toaster
12ecb1f7a4 P_DoPlayerExit changes
- Add flag application in function signature
    - Consistent gating of extra PF_NOCONTEST application behind not already exiting
        - This should fix dying after winning in K_Cooperative gametypes breaking things
- P_DoAllPlayersExit
    - Consistent condition of playeringame, spectator, exiting, etc checks
    - Also could force-give a life (for Battle Prisons)
2023-05-02 18:16:26 +01:00
Sally Coolatta
60e80d876d Improve quake effects
- Quake epicenter + radius now work.
- Since quake epicenter works, removed the display player check on all of the quakes, so other players can feel them.
- Multiple quake effects are stored in a linked list and dynamically created/freed, so they can stack together.
- Made in china
- Made the quake effects only work on the z axis.
- Quakes now alternate their intensity and dampen it over time, instead of randomly picking values.
- Added quake effects for offroad and stair-jank
- Disabled quakes in reducevfx
- Removed actionmovie and windowquake (sorry jartha)
2023-05-01 14:24:32 -04:00
toaster
74d6445a56 Integrate Ring Racers jingles into the inherited-from-SRB2 JT_ jingle system
Most of this work was completed last year by Sal.
- JT_INVINCIBILITY
- JT_GROW
Future work:
- Actually use the S_RecallMusic system (for some reason it doesn't play nice so had to disable it)
2023-04-30 20:50:12 +01:00
Sally Coolatta
c486ec19af SECRET_COLOR 2023-04-25 14:19:52 +01:00
James R
2dd29dd15f lua_baselib.c: expose P_SpawnMobjFromMobjUnscaled 2023-03-26 20:44:43 -07:00
toaster
01dbbc34d1 K_PopPlayerShield
- Split out from K_DropHnextList to make its handling more explicit, and to permit K_DropItems scenarioes to *not* drop shields.
- Always called on P_DamageMobj on any non DMG_STUMBLE damagetype, so shields always get digested on true pain.
    - Todo: Should shields be popped even on DMG_STING..?
- NOT called on Eggman Mark pickup.
- Add to Lua (alongside K_DropHnextList, which was inexplicably missing).
2023-03-21 13:48:30 +00:00
Lat
d755d6edb9 Titlecard CEcho 2023-02-21 16:16:34 +01:00
toaster
b6be0ef6e8 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into music-debug
# Conflicts:
#	src/audio/xmp.cpp
#	src/audio/xmp_player.cpp
#	src/sdl/new_sound.cpp
2023-01-22 15:20:14 +00:00
James R
49c5c785bf Remove musictype_t, S_MusicType and I_SongType return implementation string
Lua API change: S_MusicType now returns string instead of number
2023-01-12 02:50:02 -08:00
Sally Coolatta
5b147f59ed Add sector action
Linedef actions, but on sectors. Including args, stringargs, and unique activator flags.
2023-01-06 05:31:53 -05:00
Sally Coolatta
1caf255f5c Merge branch 'master' into acs 2023-01-05 22:23:51 -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
03c8fd543f More fun rules for Special Stages
- GTR_ROLLINGSTART
    * Initial instathrust, as before
    * Forced MAXPLMOVE forward
    * Disable finish line beam
    * "Super transformation" sound
        - Reference to the previous entry in the series' Perfect Startboost mechanic
- GTR_SPECIALSTART
    * Instant white fade
    * No titlecard (overridden by Boss intro)
    * Starting warp sound
- Match slidein time with no traditional titlecard to the end of the playsim intro fade
- Remove G_IsSpecialStage
2022-12-27 17:58:35 +00:00
Sally Coolatta
3135d14387 Replace LinedefExecute hook
- It is now called the "SpecialExecute" hook, since it can be called from ACS in addition to linedef specials.
- The input arguments are completely different now. Instead of (line_t, mobj_t, sector_t), it's (activator_t, args array, stringargs array). activator_t is userdata containing valid, mo (mobj_t), line (line_t), side (side_t), sector (sector_t), and po (polyobject_t).
2022-12-27 09:24:59 -05:00
toaster
185b36bd27 gametype_t
- New array of pointers to structures in memory (currently mixing static for base-game and Callocated for custom)
- Centralises a metric-ton of previously seperately handled properties into one struct
    - Gametype_Names[]
    - Gametype_ConstantNames[]
    - gametypetol[]
    - timelimits[]
    - pointlimits[]
    - gametypedefaultrules[]
- Don't attempt to guess custom gametype in Replay Hut (requires more work to make custom gametypes behave across the entire experience)
- I_Error if invalid gametype set
- gametyperules is deprecated since it will never be modified seperately from gametype (temporarily a #define, don't wanna bloat this commit too much)
2022-12-26 01:07:57 +00:00
VelocitOni
8cd36dbf03 Merge branch 'master' into unlockables-undefeatable 2022-12-18 01:59:04 -05:00
James R
34dec00539 Add K_SpawnBrolyKi, green circle shrinks during explosion hitlag 2022-12-14 19:54:31 -08:00
toaster
6d0637d39d Unlockable skins (in a way friendly to #define MAXSKINS 255)
Mammoth commit, sorry. I only realised halfway through writing it that SECRET_SKIN was only partially merged.

Ports from 2.2:
- Merge SECRET_SKIN (STJr/SRB2!1474)
    - Default skin is now handled by checking all skins for unlock status, and I_Erroring if none are available
    - Don't show skin names on game startup, to keep our secrets hidden
    - Unlockables now have string variables zallocated.
         - For skin names rather than numbers.
    - Correctly clean up memory when freeing unlockables and emblems.

Bespoke code:
- For temporary testing. `unlocks.pk3`
    - Using this for rapid testing gameboot SOC instead of patch.pk3 because of the intent to turn that into scripts.pk3
- Don't not save gamedata in DEVELOP builds, even if you've used cheats!
- `player->availabilities` is now an array of UINT8
    - (MAXSKINS + 7)/8 entries, or 32 bytes.
    - Included with XD_ADDPLAYER instead of XD_NAMEANDCOLOR.
         - Simplifies a lot of logic with respect to demos, skin changes mid-game, etc.
             - Seriously, there's a lot of random places in the code that just iterate over MAXSPLITSCREENPLAYERS and g_localplayers to update availabilities in real time in a way that's not particularly netsafe...
         - Lines up with the plan for handling unlocks when returning to menus.
         - Was included with XD_ADDBOT, but that actually overruns the netxcmd buffer at first mapload with 7 bots. We might need to consider expanding the size of the netxcmd buffer...
    - In demos, can be interpreted as both relative to the original replay and the current skin list depending on boolean context provided to R_SkinUsable.
    - Used for SF_IRONMAN (and will crash if all other skins are inaccessible).
- Grand Prix bot randomisation uses the host's unlocks.
- Don't show locked characters on the fancy new character select.
-  DXD_JOINDATA for demos
    - Replaces the dual-purpose behaviour of DXD_PLAYSTATE
    - Contains availabilities
    - Handles bot material in a different way
- Forceskin restrictions
    - Won't run in demos, because it's assumed recorded DXD_SKIN will handle all the conversions the original match had
    - Won't run if K_CanChangeRules says no
- Correctly set `mapvisited` on level visit, even in [fake gasp] MULTIPLAYER/NETGAMES!! 🥹
- Added updating unlockables and extra emblems on `mapvisited` update.
    - Currently fails to produce the cecho, but that'll be stripped out entirely in a future commit so I'm not bothered.
2022-11-27 22:53:29 +00:00
Sal
df68b87e93 Merge branch 'gremlin-fix' into 'master'
Evict the wall gremlin

Closes #326

See merge request KartKrew/Kart!777
2022-11-25 22:39:17 +00:00
Sal
6e791d5c8b Merge branch 'tm-as-struct' into 'master'
Put tm* variables into a struct

See merge request KartKrew/Kart!776
2022-11-25 22:39:04 +00:00
Sally Coolatta
8f5e0f63e9 Evict the wall gremlin
Gremlins happened whenever P_TryMove and P_SlideMove/P_BounceMove disagreed on what an object collided with. When TryMove said you collided with a line, but P_BounceMove said that you didn't, then you'd get gremlin'd.

To fix this, P_TryMove now can edit a struct to contain information on what it collides with. P_SlideMove and P_BounceMove no longer try to detect walls on their own and now requires this result from P_TryMove. If a slide/bounce is needed without moving the object, then you'd want to use P_CheckMove to get the result.

Lua is not supported right now.
2022-11-21 16:12:53 -05:00
Sally Coolatta
35f1fe580c P_RestoreTMStruct 2022-11-21 15:59:19 -05:00
Sally Coolatta
b31aa1bbb0 Put tm* variables into a struct
This makes it significantly easier to save/restore the state of these variables, whenever we need to do so for calling movement functions in the middle of other movement functions. This will also make it easier to move it out of global variable hell if desired later.
2022-11-20 19:27:34 -05:00
Sally Coolatta
492c068cdd Try some things to reduce rng biases
- Don't clamp all RNG calls to [0, FRACUNIT-1]. Only does this for P_RandomFixed now.
- Use rejection sampling for any clamped RNG calls, to remove modulo bias.
- Because of this, P_RandomRange ranges >= FRACUNIT are no longer undefined behavior.
- Added P_Random/M_Random to grab RNG output directly.
- Shuffle M_Random's RNG as well, since OS rand can be [0,INT32_MAX] instead of [0,UINT32_MAX].
2022-11-12 09:48:59 -05:00
James R
58bb648b0a Merge branch 'udmf-cherrypick' into 'master'
Update our UDMF

Closes STJr/SRB2#862

See merge request KartKrew/Kart!727
2022-10-29 06:54:48 +00:00
James R
eb96624c71 Add K_StumblePlayer to Lua 2022-10-26 22:55:13 -07:00
Nev3r
5c9599f0a9 "UDMF: The whole thing" merged
See merge request STJr/SRB2!1714

Barely any RR features reimplemented
2022-10-09 01:13:37 -04:00
James R
05dd7d7871 Merge remote-tracking branch 'origin/master' into HEAD 2022-10-01 14:45:39 -07:00
Sally Coolatta
841bcf3619 Allow non-players to water skip/run
Water skipping is enabled for Orbinaut, Jawz, and Ballhog currently. Jawz can water run, as long as their target is on/above the plane they're at -- once their target goes into the water, they'll start skipping.
2022-09-27 12:31:33 -04:00
toaster
d8bb2fe8fe Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into setangle
# Conflicts:
#	src/k_kart.c
#	src/p_enemy.c
#	src/p_mobj.c
2022-09-26 16:25:06 +01:00
Sally Coolatta
15edb40eb5 Merge branch 'master' into rng-states-2 2022-09-25 14:04:42 -04:00
Sally Coolatta
139d6f4a49 Merge branch 'master' into rng-states-2 2022-09-25 14:04:19 -04:00
Sally Coolatta
928d9116da Merge branch 'master' into projectile-sanity 2022-09-25 13:25:55 -04:00
Sally Coolatta
b0e3840550 Add jawz.c + new backwards behavior 2022-09-25 11:27:07 -04:00
toaster
871de857ae Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into setangle
# Conflicts:
#	src/p_enemy.c
#	src/p_mobj.c
2022-09-24 20:23:35 +01:00
Sally Coolatta
a60d4a13a1 RNG classes, take 2
Redone version of my old branch
2022-09-19 00:04:57 -04:00
toaster
7e17f5456c I_Error in all situations where mapheaders were previously allocated outside of SOC.
Also:
- improved error prints for SOC condition definitions
- improved bounds checking to use `nummapheaders` for iterating over mapheaderinfo
There are still situations that use NUMMAPS like mapvisited, randmapbuffer, etc, which need to be addressed before merger.
2022-09-17 13:07:48 +01:00
Sally Coolatta
2fddc9f343 Merge branch 'master' into big-large-map-markers 2022-09-10 16:01:02 -04:00
toaster
975ed1f136 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into new-menus
# Conflicts:
#	src/d_main.c
2022-09-07 21:39:34 +01:00
toaster
d62147e8b5 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into setangle
# Conflicts:
#	src/k_kart.c
2022-09-07 14:23:56 +01:00
Sally Coolatta
01af5127c8 Improved pain then hit confirm sound
- The pain + hit confirm delay is done for all players, instead of only the damaged player.
- The player who got the hit also gets to hear their pain sound at full volume.
- Changed the code so that your hit confirm sound effect will no longer be interrupted if the player who got hit left the game.
2022-09-04 14:23:51 -04:00
Sally Coolatta
107622968e Merge branch 'master' into new-menus 2022-08-27 22:36:58 -04:00
toaster
3a4b485c5d Remove P_InitAngle and its kin, considered on a case-by-case basis for also setting old_angle as well. 2022-08-25 11:35:09 +01:00
toaster
c85206f633 Add P_SetAngle, P_SetPitch and P_SetRoll to the Lua API. 2022-08-25 11:30:53 +01:00