Commit graph

645 commits

Author SHA1 Message Date
JugadorXEI
0d7ffd78b3 Expose VFX and visual functions from k_kart.c to Lua 2025-08-21 01:48:58 +00:00
Eidolon
c28559cb4b Merge branch 'exposeLoopVars' into 'master'
Expose loop variables to Lua (get only)

See merge request KartKrew/RingRacers!128
2025-08-21 00:27:12 +00:00
JugadorXEI
67419a95de Expose loop variables to Lua (get only) 2025-08-08 13:51:00 +02:00
FreakyMutantMan
1f1e0bdb6e Removing a slur from an old comment in favor of a potentially dated reference. 2025-07-02 21:11:48 +00:00
Eidolon
a4d304a1f5 Update copyright years to 2025 2025-02-13 15:32:26 -06:00
Cheariisan
aa1cd4d7d0 Expose most of the music handler to Lua 2024-08-28 22:04:31 +00:00
Sal
e4b81494d6 Merge branch 'follower-lua' into 'master'
Expose follower array and follower_t to lua

See merge request KartKrew/RingRacers!42
2024-08-22 13:05:41 +00:00
haya_underscore
ff035e0af5 Expose follower array and follower_t to lua 2024-08-22 13:05:41 +00:00
Jisk
8bdd0abfaf Expose K_AddMessage functions. 2024-08-17 18:34:12 +00:00
AJ Martinez
bf585359c9 Add soft tumble, don't drop items vs invinc 2024-05-01 18:09:34 -07:00
James R
44ea14104e Add G_GametypeAllowsRetrying, split away from G_GametypeUsesLives
- Cases for lives specifically and not retrying use
  G_GametypeUsesLives
  - Such as HUD elements and GAME OVER

- Cases for retrying and losing lives use
  G_GametypeAllowsRetrying
  - Such as GP bonus rounds
2024-04-06 22:19:34 -07:00
Sally Coolatta
7dfa597c7d SRB2 -> DRRR copyright in src, acs, android folder
Be consistent with toaster's recent changes to copyright
2024-04-05 02:08:23 -04:00
Sally Coolatta
af6340741e Add speed to gametype
Set a specific gamespeed per gametype. KARTSPEED_AUTO for it to be decided by game settings.

Wanted this for a while, but also it makes game speed display logic for DRP very straightforward.
2024-03-22 16:58:36 -04:00
Sally Coolatta
9b93f56111 Add pre-Podium intermission music 2024-03-10 14:08:59 -04:00
toaster
7f0df71558 R_SkinAvailableEX
- Most R_SkinAvailable calls should be returning index into demo.skinlist (same numerical value as when demo was recorded), for demo sync
- A handful of general things permit exception for this
- Expose `replaynumskins` (calculated as `(demo.playback ? demo.numskins : numskins)`) to Lua
    - There's *always* more that can be done for this, but this is the minimum spec that can at least be somewhat stable
2024-03-05 13:21:38 -08:00
Eidolon
af7800c17b C++ compat: rename tm -> g_tm
This one's not even C++. It's in the ISO C standard library. :(
2024-02-19 19:36:42 -06:00
James R
235d107f50 P_AddPlayerScore: negative values remove points 2024-01-26 14:30:55 -08:00
toaster
1c12b28498 Blend Eye Hardcode part 2
- VS_ArenaCenterInit - setting up the boss arena centerpoint
- VS_GetArena - Getting a particular arena
- VS_PredictAroundArena - Predict momentum of object around arena
- VS_RandomPointOnArena - Select random position around arena
2023-10-29 22:04:50 +00:00
toaster
e060e9dadc More consistent handling of special event round icons
- Gametypes have "GPpic" and "GPpicMini" parameters
- These are shown in contexts where a Round Number would be shown in GP, but an eventmode is under way.
- Instead of having different rules to show up on the pause menu, titlecard, and tally/intermission...
    - Pause Menu Roundqueue, Tally, and Intermission have all been aligned to the same rules.
    - As long as the titlecard is standard, it will show the GP Pic per those rules. (GTR_SPECIALSTART and GTR_BOSS still have their unique behaviour here)
2023-10-25 20:34:40 +01:00
James R
baf7f82af3 HU_DoTitlecardCEcho: add splitscreen support and interrupt feature
- Takes player argument and only appears on the screen if
  they're a display player.
- Uses 4P font when in splitscreen.
- Uses 1P font if not in splitscreen, or player argument
  is NULL -- message to everyone.
- Interrupt argument controls whether the message should
  overwrite another message that's already playing.
  - Global and player specific messages are considered
    separately.
2023-08-26 21:39:18 +01:00
James R
8a72f42818 Split G_ExitLevel into G_BeginLevelExit and G_FinishExitLevel
- Save retry condition in G_BeginLevelExit
- Apply condition in G_FinishExitLevel

Preparation for ACS level end scripts, since the exit
condition will need be known when the countdown starts,
not when it ends (that'd be too late to do anything in the
level).
2023-08-20 00:36:00 -07:00
James R
646701c55c Remove Lua Music API
In preparation for replacing music handling entirely.
Eventually, we can make a new Lua API.
2023-08-05 16:26:53 -07:00
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