Spindash dust
Charging a spindash kicks up dust, we all know this feature was dying to get in at some point. Bubble and flame forms of spin dust are included from FSonic, for underwater and elemental respectively.
Oh, and as a bonus I reorganised the spindash/spinning/other ability2 stuff code to look a bit neater and more organised.
New resources:
* MT_SPINDUST - the object
* S_SPINDUST1 to 4 - the normal form's states
* S_SPINDUST_BUBBLE1 to 4 - the bubble form's states
* S_SPINDUST_FIRE1 to 4 - the bubble form's states
* SPR_DUST - the normal form's sprite set (uses frames A to D, just pinch FSonic's sprites really)
* SPR_FPRT - the flame form's sprite set (frame A only)
SF_NOSPINDASHDUST disables spindash dust for a character
See merge request !52
Multi-patch texture support for transparency AND translucency
Fixes the transparent bits of the multi-patch glass texture in THZ1 turning cyan when linedef types 900-908 are applied for translucency
See merge request !56
Zoom tube camera fix
Fixed a mistake where I accidentially allowed people to change the player angle whilst in a zoom tube when previously improving them.
See merge request !57
Smoother ropes and zoom tubes
Makes rope hangs and zoom tubes suck less. Specifically, they handle corners (and vertical height changes, ala sloped rope hangs) a LOT nicer. Ported from internal.
See merge request !139
As LJSonic has pointed out, there's no need for a for loop in either case; just use sector->floorpic/ceilingpic as a levelflats index directly
(Besides, if that was to stop any out-of-bounds indexes being used, that's hardly the way to do it anyway)
*Added FLIPX/FLIPY support for multi-patch textures and single-patch textures without holes
*Added FLIPY support for single-patch textures with holes; I'll sort FLIPX support out later
To re-enable support for the above, uncomment the define HAVE_LUA_SEGS line in lua_script.h. Plain bbox userdata stuff is not disabled (though currently it's not used anyway)
* Cleaner A_ParticleSpawn code.
* Removed several hacks with Mario blocks, and corrected a mistaken assumption with when the FOF's thinker is being applied.
* Made the flashing of T_LaserFlash even less obnoxious.
Turns out sdl12's version of this function only did stuff for DC/GP2X ports; support for them have been cut out for SDL2, so for now let's just not use the function at all
I'm convinced there's going to be some stupid side effects from doing this, but it's the quickest way I can fix the polyobj planes not all appearing anyway
Sprite2 changes
Some stuff!
* Lua access to sprite2.
* Introducing new Lua-exclusive function, P_IsValidSprite2(mo, spr2). Basically just a wrapper for (((skin_t *)mobj->skin)->sprites[spr2].numframes > 0), useful for creating custom sprite2 defaulting functions since hooking into P_GetMobjSprite2 wouldn't be worth it.
* FF_ANIMATE support for sprite2s. The var2 of the state works identically to normal FF_ANIMATE, but var1 is completely disregarded - it just runs all of the frames available to that one sprite2 animation set.
* As a result, a bunch of states which were either not previously animatable or had animated at constant speed now get animation without state changes.
* P_SetMobjState now supports sprite2 defaulting like P_SetPlayerMobjState does.
See merge request !51
Damage control + Match rebalancing
This is two branches in one since while I was working on damage-control's changes months back, I felt it was best Match rebalancing was merged in here too (thanks JTE for helping me do so).
Changes from damage-control:
* `player->health` (formerly the "HUD copy" of `player->mo->health`) is now `player->rings`, and is also now the player's actual ring count.
* `player->mo->health` (formerly rings + 1) is now always 1 when alive, regardless of ring count; if player with rings is damaged, this is untouched.
* P_RingDamage now includes ring spilling code.
* P_ShieldDamage now has a damagetype argument, allowing me to remove the last MT_NULL hack left in from the pre-damagetype days that I forgot about.
* The old "switch-to-seestate" enemy damaging behavior in P_DamageMobj has been removed. This was a Doom left-over and doesn't really affect SRB2's enemies anyway - see, Doom enemies had a random chance of using seestate or painstate, SRB2 enemies always use painstate.
* Other minor efforts to reorganise damaging code and have it make more sense, but otherwise nothing that should affect gameplay in general.
Changes from match-rebalancing:
* New weapon/ammo dropping behavior: if you have the weapon panel + ammo, you drop the panel (but not the ammo); if you don't, you just drop the ammo.
* New Match ammo consumption: Weapon rings can now be fired with no rings at double the ammo cost.
* New emerald behaviour: collecting all 7 emeralds no longer turns you super (read: Match super is dead now) but instead steal points from enemies and gives you and teammates invincibility + sneakers
* Tails ringslinger buff: Any character with CA_FLY will now throw rings 1.5x as fast.
See merge request !28
To that end, I've made MF_MONITOR *without* MF_SHOOTABLE act like MF_MONITOR does, and MF_SHOOTABLE allow for both missiles AND players to destroy. This has had the side effect of allowing MF_ENEMY and MF_BOSS to use MF_MONITOR as a substitute for MF_SHOOTABLE that doesn't allow missiles to cause them damage, which might be useful for Jetty-syns.
* All Lua-originated sprite2 settings are now forced through P_GetMobjSprite2. Makes sense because of SPR2_JUMP, which none of the main characters have sprites for yet all use.
* Cleaned up P_GetMobjSprite2 to not set irrelevant, otherwise-unused variable.
Console improvements
* Unused console backgrounds no longer take up memory
* Input cursor can now move left and right
* Support for selections (Shift-arrow keys, CTRL-A, etc)
* Clipboard support (CTRL-C to copy, CTRL-V to paste, CTRL-X to cut)
* Fixed handling of simultaneous modifier key presses
https://dl.dropboxusercontent.com/u/3518218/21/console.gif
None of this affects chat yet, that's not part of the console. I'll look at it later.
See merge request !133
I added similar checks for the other num* but it seems some MD2s break the other limits without knowing anyway ...so I've commented these checks out for now, unless we have further discussion regarding them later on
Also, the "teleport" devmode command can now gracefully handle coordinates specified outside maps with no/few thok barriers, which previously prevented teleport via the thok barrier bleed's sector floor and ceiling being equal.
Fixing various problems with MF_SOLID collision
(I, toast, wrote the original merge request, but Alam made this merge request because I made a mistake. Twice. In a row.)
* Solid objects are now no longer intangible when your z is less than the other object's.
* I originally thought the bug was limited to just solid objects on slopes (hence the branch name), and was wondering about undesired side effects - but looking at this gfy, this was a major bug that slopes made easier to expose.
* Unfixed = http://gfycat.com/BareLimitedCavy
* Fixed = http://gfycat.com/JubilantOffensiveGar
* You now properly lose your momentum when jumping at a solid object.
* The way I fixed this was a hack, but it was originally a much worse hack which resulted in very bizzare physics issues, so...
* Unfixed = http://gfycat.com/ShockingAbsoluteArthropods (also demonstrates the first bug)
* Fixed = http://gfycat.com/EmbellishedCourageousGordonsetter
See merge request !119
Fixed players disappearing when spindashing whilst wearing multi-layer shields
* Before: http://i.imgur.com/gxUFElo.png
* After: http://i.imgur.com/NxsOg94.png
The problem was that MT_OVERLAY's default radius and height were never getting changed from 1*FRACUNIT, and that meant that when you spindashed, the game considered it completely below the surface of the flat you were standing on. Since you're not usually clipped on flats that don't belong to FOFs, we didn't notice this aspect of the issue sooner.
(SORRY FOR THE MULTIPLE MR'S AGAIN I TOTALLY SUCK AT REMEMBERING TO MAKE SURE IT GOES TO NEXT INSTEAD OF MASTER)
See merge request !124
my P_SearchBlockmap_* functions are now a single searchBlockmap function, you can choose between "objects" and "lines" with the first arg to decide what to iterate through. I also rearranged the argument order a bit for easy stack cleanup etc
I'll remove the old stuff later, don't worry, it's disabled for now
Development improvements
An improvement to Objectplace I've wanted to make for a loooong time.
* Object number up/down is now assigned to ringslinger weapon next/prev. SO much nicer to use, especially since most people have that stuff bound to the scroll wheel.
Also, some changes to the devmode overlay:
* Plays nicely with showfps on - see http://imgur.com/a/zSzvm for the various cases (showfps on, devmode 65535, and both).
* Add PF_THOKKED to the flags in devmode DBG_DETAILED (as "TH").
* "Flags:" replaced with "PF:", "Heap used" replaced with "Heap". The latter is a debatable change, but the former isn't - otherwise the line is way too long compared to the rest of the stuff.
See merge request !45
Hardcoded music name switches
Like I said earlier, it's better if all the hardcoded music switches in 2.2 start with an underscore so that it's harder to accidentally overwrite them.
Should be accepted when music.dta is updated.
See merge request !17
Same no non-music lump requirement as music.dta, and is ignored with no error if music_new.dta doesn't exist
(should hopefully make playing around with music easier)
Also, only one shield ability is selectively blocked by being Super now, and that's because Invincibility does it too and therefore I assume that's a match balance thing instead of a keyboard clash.
v.drawScaled negative scales fix
Lua now errors if you try to use negative scales with v.drawScaled, rather than crashing as it does in 2.1.16 currently. Not much else to say here.
See merge request !126
* Bubblewrap shield bounce now no longer allows thokking post-bounce, but still allows bouncing
* plus a bunch of tiny changes to clean up code around the place.
Fixing FF_REVERSEPLATFORM clipping fixes
Forgot the case where == 0.
Tested by @wolfy852 in Top Down, where the bugs this caused were first discovered.
See merge request !121
Even more slope-related fixes
What it says on the tin pretty much:
Currently included fixes:
* Pusher specials applied to FOFs did not properly account for slopes applied to the bottom plane; this probably was just a minor slipup that appeared on adding the support in the first place, I take it? (some waterfall in the last section of SUGOI's Fudge Canyon is the only place I can think of offhand where this bug is noticable)
See merge request !114
* Some shield sounds swapped (can be reverted later).
* Partial implementation of S3K shield abilities.
* The ability to elemental-groundpound onto gold monitors without going straight through them.
* Force shield ability removed because nobody could agree on it, we'll keep it blank until another idea can get through the disagreement juggernaut.
* shields give you 1000 points
* redundant shields don't make you puase
* checkpoints give you 2000 points
* falling down a deathpit is just falling, not bouncing
Treating " as whitespace in TEXTURES (and animdefs too i guess)
SLADE adds this character in its TEXTURES editor and makes SRB2 cry unless the lump is manually edited; this just treats it as whitespace so we don't have to think too hard about it.
Also, two I_Errors now refer to the correct lump name.
See merge request !122
Proper barrel sky distortion
Skies now use proper barrel distortion in both axes, rather than just the x-axis (i.e. just horizontally) as in all previous SRB2 versions. Credit goes to Nev3r for the original change and idea.
Was going to make an option for a non-barrel distorted sky, assuming barrel distortion is the default, but I just can't quite get it to work in a way that is pleasing to the eyes. So I've not bothered with it here for now, unless someone objects to barrel distorted skies for any reason?
See merge request !35
FOF wall slope skewing
FOF walls now can optionally skew with respect to slopes (software mode only currently):
* Upper Unpegged on the CONTROL linedef enables wall skewing
* Lower Unpegged on the IN-LEVEL linedefs ^1 determine which slope to skew with respect to (off = top slope, on = bottom slope)
* If Transfer Line is used however, Lower Unpegged on the control sector's linedefs does the above's job instead
^1 (this is because they already control pegging of individual FOF walls as it is, so this is for convenience and my sanity that they also deal with skewing)
See merge request !39
Fixes to horizontal spring collision
Fixed various issues arising from collision with exclusively horizontal springs. Thamks to @Inuyasha for the heads up! Of note:
* If you hold down your jump button whilst jumping into it, you no longer immediately use your ability.
* Characters with (CA_DOUBLEJUMP && CA2_MULTIABILITY) or CA_FLOAT or CA_HOVER no longer lose track of their jump count.
Also:
* Upped the strength of info.c's red and yellow horizontal springs.
See merge request !41
Horizon lines
Horizon lines for software mode! Place a Linedef type 41 somewhere on a one-sided linedef and it'll do fancy rendering hacks to draw the adjacent floor/ceiling to the "horizon". One small thing to sort out when I remember to do so, but this is good enough for merge already.
See merge request !44
FF_ANIMATE additions: globally synced animations
FF_GLOBALANIM = makes the animation synced to the level's timer, so all objects will display the same frame at the same time
![](https://dl.dropboxusercontent.com/u/3518218/22/srb22-0008.gif)
I mean, doesn't that look so much prettier?
There's also some changes to FF_MIDDLESTARTCHANCE (FF_ANIMATE behavior was split due to not acting consistent between that and SPR2 behavior).
See merge request !46
* Object number up/down is now assigned to ringslinger weapon next/prev. SO much nicer to use, especially since most people have that stuff bound to the scroll wheel.
* introducing the new friend, SH_FORCEHP (which is used as a bitmask to get the extra hitpoints of a force-shield user)
* P_DamageMobj now considers the unimplemented shield constants as well as the implemented ones.
* When not pressing any direction, you now go backwards by default - to emphasise that this is primarily for defensive, not offensive, purposes.
* The camera can now handle the player going backwards without them going completely off-screen.
* Fixed some overzealous checks.
* The spinfire ring is now capable of damaging enemies. (god, what a terrible hack this is)
* When ground pounding, you now bounce off the floor a little bit to make the ability less spammable.
* The Dodge Dash
* Allows you to dash - no control, no falling, no key response - for 2 + (number of extra shield hitpoints) tics.
* If you're holding movement keys down, you dash in the direction you're holding - otherwise, you dash directly forward.
* You're spinning (spindash spin, not jump spin) until your dash is over, then your momentum is cut down significantly and you end up in falling frames.
* It may not necessarily be super useful for Sonic, but it helps the other characters.
* http://gfycat.com/BogusFailingFritillarybutterfly
* http://gfycat.com/PoliticalIdealisticBallpython (outdated speed, shows any direction)
Animated sky support
What it says on the tin: skies can be animated textures now. Just set them up as normal animated textures (keeping in mind the starting texture still has to comply with the SKYn/SKYnn/SKYnnn naming format) and hey presto, your sky animates.
See merge request !34
* GFZ3 Eggmobile's laser won't change its angle when you move left and right anymore.
* Changed because its ability to move quickly was extremely punishing for new players (see ProJared's youtube video on the matter).
* http://gfycat.com/PassionateUnknownAgama (the twitching on the third laser has been fixed since this was recorded)
* GFZ3 Eggmobile will, when too far away from the ground and moving upwards, slow itself down vertically.
* This was punishing and annoying for both old and new players alike.
* http://gfycat.com/ShabbyAncientEarthworm (old values - the typical settling height is slightly lower now)
* If you hold down your jump button whilst jumping into it, you no longer immediately use your ability.
* Characters with CA_DOUBLEJUMP and CA2_MULTIABILITY no longer lose track of their jump count.
(the problem was that MT_OVERLAY's default radius and height were never getting changed from 1*FRACUNIT, and that meant that when you spindashed, the game considered it completely below the surface of the flat you were standing on. Since you're not usually clipped on flats that don't belong to FOFs, we didn't notice this issue sooner.)
* Camerascale, shieldscale, height and spinheight are now player attributes which are set to the skin attribute on skin change, not read directly from the skin.
* P_GetPlayerHeight and P_GetPlayerSpinHeight are now macros instead of functions.
* Extra protection against switching to a locked skin.
* flips the sprite ala MFE_VERTICALFLIP except you don't need to flip the direction of gravity for the object just to draw upside down
* stacks properly with reverse gravity
HOWEVER, since these changes to PIT_CheckThing do raise questions about whether there may be unintended side effects here. As a result, I may remake this for internal only if necessary.
* Sets the sortscale of the mobj to that of its tracer.
* Basically, Smiles' tails won't clip through shields thanks to this.
* http://gfycat.com/GraveGlassEwe
* Also has support for chains of MF2_LINKDRAW!
More slope fixes (aka sorry guys I made another quick SUGOI fix)
Another slopes fix branch!
This branch currently includes a fix for:
* Knuckles gliding into a slope while in 2D mode causes him to try to "climb" on air above them, if the original non-sloped height is higher. Unfortunately he still tries to grab onto places that he can't really climb on, but at least now it's on the slope itself and not in mid-air lol. This issue is encountered in SUGOI's Retro Hill Zone, if you want to check for yourselves.
* Bustable FOF-busting code for both players AND pushables not accounting for slopes
* (Unrelated to slopes): Fix FF_SHATTERBOTTOM FOFs acting like THZ goop when stood on; I added this fix as a bonus because I encountered it in a test map of mine for the bustables fix
(Other fixes may or may not appear here in the near future, I haven't decided yet. Don't wait on me to get in any further fixes before merging, that said)
See merge request !110
Last-minute NiGHTS exiting bugfix
One single-line fix concerning the end of NiGHTS maps. Extremely small, literally zero side effects here, the only reason I'm not committing directly to master (aside from ettiquette) is that I don't have the ability to do so.
* The NiGHTS drone had a single tic of visibility when you hit the goal, which is evident stepping frame by frame through http://gfycat.com/ComplicatedComposedAoudad (the contents of which may or may not make it into 2.2). This is no longer the case.
See merge request !100
Also, the particles made via spindashing in shallow water are now located behind the player. This does move the running particles too, but that's okay.
* Fixed bug where being pushed off a platform whilst charging a spindash would leave you in your charging frames instead of your rolling ones when you hit the ground (http://gfycat.com/MassiveThreadbareItalianbrownbear for how it works now, http://gfycat.com/MarvelousEnlightenedAuk is how it used to work)
* Fixed bug where spindashing on top of a bubble spawnpoint led to you being able to move around in spindash frames (no gif since obvious desired behaviour is obvious)
* Spindash animation speeds up the faster you'll shoot off.
* The spin charging mechanism is now scale-independent, and only multiplies by scale when shooting off - less FixedMul calls, and potentially deals with weird quirks of changing scale whilst spindashing that nobody's discovered because there's no place to find that in the main game!
Also:
* Climbing animation defaults to rolling instead of walking, because what.