Commit graph

127 commits

Author SHA1 Message Date
mazmazz
60c9e5ab37 Lua player argument fixes, GetMusicLength and FadeMusic 2018-08-20 00:21:35 -04:00
mazmazz
fb0d1b45ac I_FadeOutStopMusic, I_FadeInStartDigSong, S_ChangeMusic lua 2018-08-19 22:06:09 -04:00
mazmazz
9b50eec56a S_FadeMusic[FromLevel] and S_StopFadingMusic Lua
* Fixed some arg position weirdness with other music lua funcs
2018-08-19 16:20:14 -04:00
mazmazz
000847654e I_SetInternalMusicVolume lua 2018-08-19 09:39:32 -04:00
mazmazz
c18372dd06 I_GetMusicLoopPoint and I_SetMusicLoopPoint for Lua
* Fix S_GetMusicLength for player compatibility
2018-08-18 20:20:18 -04:00
mazmazz
137291d50b Lua merge fixes 2018-08-18 18:57:53 -04:00
mazmazz
8b6c24c6fa Remove I_MIDIPlaying from Lua 2018-08-18 17:46:14 -04:00
mazmazz
58b204809f Lua for MusicType 2018-08-18 17:18:22 -04:00
mazmazz
76c4f5dd5c Lua for I_GetMusicLength 2018-08-18 14:18:58 -04:00
mazmazz
d93ca34859 Hide MusicPlus lua behind an #ifdef HAVE_LUA_MUSICPLUS
# Conflicts:
#	src/lua_hook.h
#	src/lua_hooklib.c
#	src/p_user.c
2018-08-15 03:37:11 -04:00
mazmazz
0254f4f368 Fix merge errors 2018-08-15 02:42:50 -04:00
mazmazz
878ea36559 Lua: Make P_RestoreMusic follow the non-local player nil output convention 2018-08-15 02:29:26 -04:00
mazmazz
8fe4c369bf Lua: Fix music functions not returning proper values
# Conflicts:
#	src/lua_baselib.c
2018-08-15 02:29:04 -04:00
mazmazz
6bde90f887 Lua: Make S_SpeedMusic and S_ChangeMusic return nil for invalid players 2018-08-15 02:23:18 -04:00
mazmazz
c71719ac6b Music lua: Return nil for invalid players and non-nil for valid players
# Conflicts:
#	src/lua_baselib.c
2018-08-15 02:22:52 -04:00
mazmazz
9dbc807528 Make S_StopMusic return nil for invalid player, true otherwise 2018-08-15 02:21:18 -04:00
mazmazz
8d0044c5f1 Lua S_GetMusicPosition: Remove erroneous position input line
# Conflicts:
#	src/lua_baselib.c
2018-08-15 02:20:56 -04:00
mazmazz
3fb4559480 Lua: Make S_GetMusicPosition and S_SetMusicPosition return nil when non-local player is passed 2018-08-15 02:19:12 -04:00
mazmazz
9a5800d2bb Lua: Added player_t input to S_DigitalPlaying, S_MidiPlaying, S_MusicPlaying, S_MusicPaused, S_MusicName 2018-08-15 02:19:06 -04:00
mazmazz
95e4d0d423 Add player parameter to S_GetMusicPosition lua
# Conflicts:
#	src/lua_baselib.c
2018-08-15 02:18:46 -04:00
mazmazz
44c7410a41 Add S_DigitalPlaying 2018-08-15 02:10:53 -04:00
mazmazz
47423a69ed Refactor to SetMusicPosition, GetMusicPosition
# Conflicts:
#	src/lua_baselib.c
#	src/nds/i_sound.c
#	src/sdl12/mixer_sound.c
#	src/sdl12/sdl_sound.c
#	src/win32ce/win_snd.c
2018-08-15 02:10:46 -04:00
mazmazz
662c366830 S_MusicName, S_MusicExists, S_PauseMusic lua, S_ResumeMusic lua
# Conflicts:
#	src/lua_baselib.c
2018-08-15 02:01:34 -04:00
mazmazz
2483c11cc4 Implement I_MusicPaused in SDL2, SDL1.2, and FMOD; console and lua commands
# Conflicts:
#	src/sdl12/mixer_sound.c
2018-08-15 01:55:03 -04:00
mazmazz
a8d379a6da Lua PositionMusic switch to UINT32 2018-08-15 01:52:20 -04:00
mazmazz
eab4d6b989 Lua PositionMusic/GetPositionMusic and console TUNES position 2018-08-15 01:50:19 -04:00
mazmazz
c6f63d9e9b Lua funcs MidiPlaying/MusicPlaying 2018-08-15 01:44:11 -04:00
toasterbabe
8a61d87961 * Add new damagetype flag (DMG_CANHURTSELF) that allows a player to hurt themselves indirectly.
* Add damagetype to P_RadiusAttack (optinteger in lua, A_Explode var1).
* Removed the prevention of MF_BOSS objects from getting P_RadiusAttacked. This was a holdover from DooM (I checked) - a way to prevent the Cyberdemon from gibbing itself when firing point blank into a wall, and also a way to make it and the Spider Mastermind harder.
* Enemies are solid to other enemies movement-wise now.
* (Fun little aside - if you remove MF_SOLID from a monitor, it now behaves like they did in Sonic Adventure (poppable by colliding with, not just attacking).
* Fixed Metal Sonic battle conflict in MF_PAIN/mass not picked up earlier.
* Miscellaneous tiny code tweaks.
2018-05-08 23:26:36 +01:00
toasterbabe
ff9775225e Merge branch 'master' of https://git.magicalgirl.moe/STJr/SRB2Internal.git into delag_maces
# Conflicts:
#	src/p_mobj.c
2018-04-07 01:54:43 +01:00
toasterbabe
6d59551afd Mace optimisation!
* Handle all chain objects as a hnext/hprev chain.
* When removing mobjs with hnext/hprev, "repair the chain" (make the h links meet).
* Fix hidden slings, which I accidentially broke when I revamped maces the first time.
* Kill MF2_MACEROTATE. Not needed for anything anymore.
* P_MaceRotate now available to Lua to make up for it.
* Related: Made modifying hnext/hprev using Lua safer, so it keeps the reference counts in play.
2018-04-01 20:54:19 +01:00
toasterbabe
05bf3674d3 * M_Random function access to v! (so v.RandomFixed(), etc...)
* Remove deprecated P_Random() from Lua.
2018-03-20 15:00:27 +00:00
toaster
82a868ec8f Merge branch 'lua-sector-find-funcs' into 'master'
Lua sector find funcs

See merge request STJr/SRB2Internal!127
2017-11-02 16:46:16 -04:00
toaster
c84d4261d1 Merge branch 'unca_scrooge' into 'master'
The hardcoded part of ACZ3 so far

See merge request STJr/SRB2Internal!124
2017-11-02 16:43:11 -04:00
Monster Iestyn
2cccb81d7f Merge branch 'master' into lua-sector-find-funcs 2017-11-01 19:14:44 +00:00
Monster Iestyn
440ada120d Merge branch 'master' into lua-action-userdata 2017-10-30 21:33:40 +00:00
Monster Iestyn
1d11797b47 Added six new functions from p_spec.c/h to Lua 2017-10-30 20:09:41 +00:00
toasterbabe
eea5c9d56a Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2Internal.git into unca_scrooge
# Conflicts:
#	src/dehacked.c
#	src/info.h
#	src/p_enemy.c
2017-10-21 12:48:41 +01:00
Alam Ed Arias
1be137f461 cleanup 2017-09-28 11:10:24 -04:00
toasterbabe
4da6169892 Add spr2defaults[] array to make sprite2 defaulting system much, much simpler to manage.
This is in preparation for a seperate project which still involves sprite2s.
2017-08-25 18:00:20 +01:00
Monster Iestyn
9f726bc66d Merge branch 'new_coop' into 'master'
New Co-op

See merge request !104
2017-08-16 15:01:39 -04:00
toasterbabe
a00deee209 * Combine all shield-giving functions into a single one, since they were practically identical anyways.
* Expose P_SwitchShield(player, shieldnum) to Lua.
2017-08-10 13:57:09 +01:00
toasterbabe
b91dc51d6f * Lua P_MobjFromMobj.
* Make A_Repeat only set extravalue2 if it has a var1.
* Improve sound caption.
* Make activesound state-controllable.
2017-07-09 14:54:11 +01:00
toasterbabe
2f3e4c3c65 * Per Mystic's request, made lives for 100 rings individual.
* P_GiveCoopLives bundles the coop lives reward for everyone versus reward for one person in other gametypes thing into one function. Available in Lua.
2017-05-29 22:18:02 +01:00
Monster Iestyn
fd1efff338 Added the META_ACTION userdata type to Lua, created getActionName() to return string name
SRB2's built-in action types will now all be pushed as META_ACTION, state_t.action can be assigned META_ACTION and return it

getUserdataType returns "action" for META_ACTION variables
2017-05-17 20:36:40 +01:00
toasterbabe
73f1550242 There are now captions for specific types of music! (Currently signified with an M, but I'll change that in a bit...) A whole lotta things needed to be modified for this, though.
* Serious refactor of - and internal exposure of - what has become S_StartCaption().
* Renaming of a few existing captions.
* The prevention of access to - or writing over - sfx_None's stuff in SOC or Lua.
* The new Lua wrapper function S_StartMusicCaption(string, tics, optional player), which essentially allows custom music captions to be created. (This is best used for stuff like final lap music in SRB2 Kart or bonus time in a thokker-like game, not a comprehensive Now Playing expy. That'd be a different kettle of fish.)

Also, updated all the lock-on stuff to use P_IsLocalPlayer instead of rolling my own.
2017-04-29 16:27:52 +01:00
toasterbabe
1e64b096fd Bugfixes and code cleanup.
* Getting hit whilst on a swinging mace doesn't send you off in roll/jump state.
* P_GetJumpFlags replaces a bunch of copypasted code.
* Homing attacking a spring sends you directly on its path, rather than rocketing off in the direction you were preiously hurtling in.
2017-04-03 18:28:02 +01:00
toasterbabe
fa29f7deca A bunch of stuff again.
* Lock on targets bob now, and are used for CA_HOMINGTHOK and SH_ATTRACT as well.
* Flag stuff is now animated like it was designed to be but which was kinda messed up.
* Cork sounds.
* P_SpawnLockOn(player_t player, mobj_t lockon, statenum_t state) for Lua.
* Added homing/firing CA2_GUNSLINGER stuff at egg guard shields.
* Fixed homing stuff wrt egg guard shields and sea egg balloons.
* Fixed attract orb goin' gold when doing a CA_HOMINGTHOK homing ability.
* Fixed positioning of player during homing attack.
* Cleaned up lockon spawn code.
2017-03-23 19:11:22 +00:00
toasterbabe
ddf8db12af Big commit, sorry. I broke several things trying to get other things to work and it's only now that all the code that worked yesterday works today!
*P_LookForEnemies is now side-effect-less and only provides a pointer to the found mobj
*player-jumping is dead, long live PF_STARTJUMP
*per Mystic's request, CA2_GUNSLINGER has a targeting icon. It also has a more restricted vertical aiming range.
*mobj for this is in the game as requested
*fast teetering animation flag
*general code cleanup
2017-03-22 18:51:30 +00:00
toasterbabe
90893c02a3 * Added restriction to prevent combination of CA2_GUNSLINGER and ringslinger on.
* Swapped usage of player->spinitem to player->revitem for bullet type selection, since spinitem is used coming out of zoom tubes (which are universal).
* Switched the optional boolean for "bullet" in the Lua wrapper for P_LookForEnemies to be false by default.
* Allowed CA2_GUNSLINGER users to target Detons.
* Cleaned up some code here and there.
2017-03-21 23:24:57 +00:00
toasterbabe
7ac0373dbf After usability complaints:
* CA2_MELEE/CA_TWINSPIN combination abilities (ground hit, somersalt) disabled.
* Enabled movement controls whilst using CA2_MELEE in the air.
* CA2_GUNSLINGER no longer requires charging. In exchange, it involves a cooldown in which you can't move.
* CA2_GUNSLINGER lock-on distance improved, and aiming allowance reduced to compensate.
* Lots of cleanup/gravflip allowances for homing/targeting code.

* Unrelated: Flickies now properly face the direction they're supposed to when getting knocked out of the egg capsule.
* Unrelated: Thok trail fades like spindash trail now.
* Unrelated: Using CA_HOMINGATTACK when nowhere near an enemy uncurls you.
2017-03-21 16:04:49 +00:00