Commit graph

226 commits

Author SHA1 Message Date
Eidolon
7febf53ec0 Merge public master 2025-08-23 11:34:18 -05:00
Chearii
19fdf19eb4 Add baked offset parameters 2025-08-23 11:20:14 -05:00
Ashnal
cc79808aba New MFE_DONTSLOPELAUNCH flag
Makes mobj immune to slope launching
Also 32 bit eflags woo
2025-07-31 18:37:38 -04:00
Antonio Martinez
878972fc7b Use ChangePlayerReferences to relink kartitems 2025-06-07 19:30:59 -04:00
James R
885a8c2557 Add P_IsRelinkItem, fix Hyudoro not being relinked correctly
- MT_HYUDORO itself was being relinked, causing the Hyudoro to not disappear after delivery
- MT_HYUDORO_CENTER is relinked instead; this is the object that actually holds a player reference
2025-06-03 15:53:09 -07:00
Antonio Martinez
e8140ae388 Relink player to kartitems 2025-06-02 12:02:58 -04:00
Eidolon
cb7f437e60 Merge public master 2025-02-13 15:48:11 -06:00
Eidolon
a4d304a1f5 Update copyright years to 2025 2025-02-13 15:32:26 -06:00
Sally Coolatta
0dbe217979 Properly handle stringarg memory during netsaves
- spawnsectors/lines copy over stringargs properly.
- Object thing args/stringargs aren't overwritten if there aren't any script args set.
- StringArgsEqual functions handle NULL properly.
2024-10-25 17:15:00 -04:00
Sally Coolatta
03874c3374 New Ballhog design
Taking the old charge idea, but instead of missiles, it's bananas that explode on the floor and can only be lobbed forward. Charging creates more projectiles in a circle pattern around it.
2024-08-28 01:26:53 -04:00
Sally Coolatta
6b87b586d2 "snapshotmaps" command
Takes two screenshots for a list of maps that have an "Alternate View Point" thing with tag 0 -- one intended for level select pictures and another for Discord Rich Presence. If no view point exists, the map is skipped.
2024-07-21 08:54:49 -04:00
toaster
7f6de407f1 Copyright update: Add Kart Krew (2024) in general for high-traffic inherited sourcefiles 2024-04-02 17:42:38 +01:00
James R
3402c3af64 Polyobjects: add po_movecount member to mobj_t instead of using lastlook
- Polyobject carrying set lastlook on mobjs for internal
  tracking
- lastlook is used by some objects to track their own
  state
- Ring Shooter uses lastlook to remember which player
  summoned it
- A Ring Shooter spawned right next to a polyobject would
  become buggy; If its owner player pressed the respawn
  button again before the Ring Shooter despawned, that
  player would be teleported back to the Ring Shooter
  instead of spawning a new Ring Shooter (which would be
  the correct behavior)
2024-02-29 03:36:07 -08:00
James R
92cd95311c Add P_IsKartItem: true for anything the player can hold or throw (except shield overlays) 2024-01-13 22:56:16 -08:00
James R
39486a56d6 p_saveg.c: initialize "special" fields of mobj, if spawned from mapthing, in default state 2023-12-03 10:44:11 -08:00
James R
049efe809f mobj_t: add owner member 2023-11-13 23:49:33 -08:00
James R
61cad641bb Invincible player punts hazardous/solid things, unless MF_ELEMENTAL
If player is in one of these states:

- Invincibility
- Grow (K_IsBigger)
- Flame Shield dash
- Over 200% speed

And the other object:

- Does not have MF_DONTPUNT

Then, touching a solid object:

- Punts the object, unless the object has MF_ELEMENTAL
- Fizzles the object, if the object has MF_ELEMENTAL

Or, when an object damages the player:

- That object is punted, unless it has MF_ELEMENTAL
- The object fizzles, if it has MF_ELEMENTAL

Punting means:

- A copy of the object is made
- Both the player and copy receive 5 tics of hitlag
- The copy is thrust away from the player at a minimum of
  60 FU, or 2x either the player's or object's momentum,
  whichever is ultimately greater
- The copy despawns after 2 seconds
- The copy flickers constantly, while thrust away

Fizzling means:

- The object disappears completely
- A puff of smoke is spawned in place of the object
- No hitlag is applied to the player

Both punting and fizzling:

- Hide the original object (intangible and invisible)
- The original object reppears after 30 seconds
- For 2 seconds before reappearing, the object flickers
  back in, but is still intangible
2023-11-13 22:18:35 -08:00
James R
a8a1c14580 mobj_t: add reappear and punt_ref members, add to savegame and Lua 2023-11-13 19:39:52 -08:00
James R
b11f340dab Add MF_ELEMENTAL 2023-11-13 19:39:52 -08:00
James R
74d1f1bfb7 Add MF_DONTPUNT 2023-11-13 19:39:52 -08:00
James R
39a7c3b3ad Remove MF_MONITOR 2023-11-13 19:23:54 -08:00
James R
3033c6928b Remove MF_STICKY 2023-11-13 17:27:40 -08:00
toaster
acad8754c8 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into break-through-them-all 2023-10-17 23:32:08 +01:00
toaster
d11fe78e90 UCRP_UFOATTACKMETHOD
`Condition1 = UfoAttackMethod [type]`
    - "smash a UFO Catcher using only [type]"
        - Combine with `Prefix_SealedStar` or `Prefix_IsMap [special stage stage]`
        - Shows up as "???"
    - Types supported:
        - `Boost` - "boost power" (sneakers)
        - `Whip` - "Insta-Whip"
        - `Banana` - "Bananas"
        - `Orbinaut`- "Orbinauts"
        - `Jawz` - "Jawz"
        - `SPB` - "Self Propelled Bombs"
    - Other types could be added on request, these were just the easy ones

In addition, the prototype for P_MobjWasRemoved was moved to `p_mobj.h`.
It's EXTREMELY important that we're able to safely check mobj pointers anywhere a mobj_t is possible to observe, without including the full `p_local.h`...
2023-10-17 01:07:03 +01:00
AJ Martinez
b67aa8af4f Charge instawhip test fixups 2 2023-10-14 05:56:42 -07:00
Oni
bcc8fc6438 Merge branch 'freeze' into 'master'
Mobj thinker freeze condition rework

Closes #690

See merge request KartKrew/Kart!1505
2023-10-02 05:42:19 +00:00
Sally Coolatta
c9291b0f61 Mobj thinker freeze condition rework
- There's a freeze cheat bool to freeze everything except for players.
- There's a level freeze bool to freeze literally everything.
- There's a frozen bool on mobj_t to explicitly control freeze status on an object.
2023-09-18 03:24:58 -04:00
James R.
72ef1d352b mobj_t: add shadowcolor member to change shadow palette index 2023-09-17 21:56:17 -07:00
VelocitOni
8845700c06 Starpost Gentrification
Replaced all mentions of starpostnum and Starpost w/ cheatchecknum and CheatCheck (so Ivo can stop asking why we still need it when its going to save our asses on release patches)
2023-09-01 00:31:49 -04:00
Sally Coolatta
f02e6dbe3c Final thing args code cleanup
- Fix the last few bugs I could find with thing args
- Move version update code
- Rename internal variables to `thing_[string]args` to make older code merge issues more obvious
2023-08-22 02:14:09 -04:00
Sally Coolatta
9d940ed654 Separate script args from mapthing args
SRB2 uses a LOT of mapthing args compared to Hexen (which has none) and ZDoom (which only has them on objects that will never ever activate scripts). So we really badly needed to separate the two if we want attaching scripts to things to be useful.
2023-08-21 03:33:04 -04:00
toaster
45f8f1c89f Remove a bunch of unused emerald stuff inherited from SRB2
All superseded by M_CheckCupEmeralds + GTR_POWERSTONES stuff
2023-06-25 23:49:20 +01:00
Sal
0f909bdb46 Merge branch 'gacha-prep' into 'master'
Add FF_REVERSEANIM and FF_INVERT, extern P_InstaScale

See merge request KartKrew/Kart!1285
2023-06-14 00:25:50 +00:00
Sal
7b98752b67 Merge branch 'refactor-mapthing' into 'master'
Read-only mapthing_t

See merge request KartKrew/Kart!1252
2023-06-14 00:07:42 +00:00
James R
c50e63ccd7 p_mobj.c: add P_InstaScale function
Previously was in objects/broly.c
2023-06-13 14:42:00 -07:00
James R
018f6f3410 Add lightlevel field to mobj_t
Adds r_spritefx.cpp

lightlevel should be -255 to 255, relative offset to
normal sector lightlevel.

If RF_ABSOLUTELIGHTLEVEL, mobj_t.lightlevel becomes an
absolute lightlevel in the range 0 to 255.
2023-06-05 20:00:35 -07:00
Sally Coolatta
9d80323a3a Read-only mapthing_t
Map things are writeable in Lua, which I am pretty certain is a mistake because mapthings are not sent over the network at all. I considered making them net-synced (it would be relatively easy), but it also aligns with another, more "philosophical" issue: Doom generally copies over properties from mapthing_t into mobj_t, and then only refers to it again when needing to respawn an object -- mapthing_t is not really intended to be referred to very often at runtime. At best it's slightly annoying since some objects rely on a spawnpoint for behavior changes, at worst it may make ACS more confusing in the future since Thing and Mobj tags are mixed together or less useful since they wouldn't be able to modify behaviors of objects that are based on args.

So I decided to solve these two issues at the same time; just treat mapthing_t as something to copy values from, like OG Doom does it. This basically just means that special and args are also part of the mobj now instead of the mapthing, which should fill any desire to edit this stuff from Lua, and reduces the number of instances where objects need to check for their spawnpoint to function properly.
2023-05-25 14:40:55 -04:00
James R
9eab5317f3 Stop calling P_NullPrecipThinker
In levels with tens of thousands of precipmobjs, the
overhead of running a thinker for all of them is too much,
no matter how small the thinker is.

ALL thinking is done inside the renderer now, where it can
be limited by distance. Precipmobjs track the last
leveltime they thunk, so interpolated frames don't think
twice.
2023-04-08 13:34:42 -07:00
James R
bced5ecbc5 Render precip through blockmap instead of during BSP
There can be very many precipmobjs in a sector. During BSP
rendering, for each sector reached by BSP (the entire
visible level at least), all the precipmobjs would be
iterated and their distance from the camera calculated, to
determine whether they are within draw distance.

The issue with the old approach is that there really are
too many precipmobjs in each sector. By iterating the
blockmap within a certain range instead, precipmobjs
out of view are not iterated at all, saving some time.

Caveat: drawdist_precip is no longer respected as an
exact value, since it must round to the precision of the
blockmap.

List of potentially scary changes:

- Removes snext/sprev for precipmobj_t
- Removes preciplist for sector_t

- Adds bnext/bprev for precipmobj_t
  - mobj_t and precipmobj_t field offsets are symmetrical

- Modified P_SetPrecipitationThingPosition and P_SetThingPosition
  - The syntax in these functions is kind of wacky
2023-04-06 05:41:06 -07:00
James R
1c9ccab159 Use foflayer when spawning mapthings
- foflayer offsets the thing from an FOF in its sector.
  - foflayer 0 uses the base sector heights.
  - foflayer 1 uses the lowest FOF top height, or highest
    FOF bottom height when the thing is flipped.
  - foflayer 2 uses the second lowest / second highest and
    so on.
2023-03-29 22:23:56 -07:00
James R
61abb7a82e Add MF_DRAWFROMFARAWAY flag, renders objects up to 2x drawdist 2023-03-26 22:01:25 -07:00
James R
629614710c Free MF_AMBIENT 2023-03-26 21:52:31 -07:00
James R
264e445f0c Add MF2_ALREADYHIT; don't deal damage for multiple wombos within the same tic
These wombos still create hitlag.
2023-03-11 05:39:07 -08:00
James R
49bb2a377e Add P_SpawnItemLine, spawn a row of mapthings between two points 2023-02-28 19:14:35 -08:00
James R
061e5b01ec Refactor trackercap
- Don't clear every tic. This is what P_RemoveTracker is
  for.
- Link in P_SpawnMobj. Should cover all cases.
- Remove excess objects. These were leftover from when
  Shrink destroyed items. Just track Jawz, SPB and Break
  the Capsules.
2023-02-21 18:27:46 -08:00
James R
be4c341316 Rename kitemcap to trackercap 2023-02-21 17:48:14 -08:00
Sally Coolatta
345e7f83b0 Copy first mapthing tag to their mobjs
Allows the ThingCount and ThingSound ACS functions to fully work now, and adds significantly more possibilities for scripting later.
2023-01-01 17:07:46 -05:00
Sally Coolatta
a0adb05c9b Merge branch 'master' into acs 2022-12-31 15:04:51 -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
Eidolon
be021baa02 Add extern "C" in C++ to all headers 2022-12-30 19:26:16 -06:00