diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d590c0603..1176ea8bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Prepare run: ./update.sh @@ -30,7 +30,7 @@ jobs: echo "ARTIFACT_NAME=progs-$(git describe --tags --dirty='~' --always)" >> $GITHUB_ENV - name: Store artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.ARTIFACT_NAME }} path: | @@ -40,7 +40,7 @@ jobs: - name: Publish a release if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} files: | diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index e8f108c36..1f7e4a0f0 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Prepare run: ./update.sh diff --git a/FEATURES.md b/FEATURES.md index 04c63df43..0287a38c0 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -7,7 +7,6 @@ * Persistent custom player models, so you can always show off that pony complexion! * Arena gamemode returning from the early days, the duel gamemode that pits 2 players against eachother until someone scores enough victories * Conquest gamemode, a more ambitious version of domination in which you need to stand by control points to capture them -* DotC (Defense of the Core) gamemode, a highly ambitious and unfinished mode based on the DotA series * Jailbreak gamemode, a variation on clan arena in which you can free your fallen teammates from the enemy's jail cell * Runematch gamemode, another mode from the days of old making its return, in which random 'runes' appear on the map, and the player needs to collect and hold all of them * SNAFU gamemode... needs no explanation @@ -17,6 +16,7 @@ * Boggle minigame, a fun word search game * Nim minigame, the classic matchstick game with balls * Voracity minigame, a little number navigation game +* Dynamic Spawnshield mutator, copied from The Regulars, adjusts spawn shield length to benefit those getting spawnkilled * Hats! * Pick Spawns mutator, allowing you to choose where you spawn * Command to turn off crosshairs on all players, for an extra challenge @@ -39,13 +39,14 @@ * Ability to replace monster model paths, to easily load in custom models * Akimbo mutator for all your dual wielding needs * Freeze mutator, a portable version of freeze tag that can work in just about any gamemode (except freezetag!) +* Random Spawns mutator, spawn at random locations throughout the map * Keep Running mutator which slowly kills players who stand still, a more extreme version of campcheck * Piggy-backing lets you ride your teammates to victory +* Random Spawns mutator, spawn at random locations throughout the map * Little mutator to switch things up by replacing vehicle spawns with a random vehicle * Rifle Arena, a classic mode a bit like instagib, with the fabled sniper rifle and limited health * Shotgun Arena, a funny mode similar to overkill with just the shotgun, and crazy push force * Spawn Invisible mutator, to give spawning players a chance without making them completely invulnerable -* Option to keep players from spawning at the same spawnpoint twice * Zombie Apocalypse mutator, which spawns random monsters around the map constantly * Option to change all or individual player's size * Options to replace any entity on maps diff --git a/README.md b/README.md index 064449b10..1f9b4b283 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,10 @@ SMB modpack =========== QuakeC source for the SMB server mods - + +[![Build Status](https://img.shields.io/github/actions/workflow/status/MarioSMB/modpack/build.yml)](https://github.com/MarioSMB/modpack/actions) Requirements ============ @@ -21,13 +22,13 @@ Building tools - Mac systems should already come with the required building tools once Git is installed Required content packs: - - http://dl.xonotic.fps.gratis/zzz-misc-v006-122-g0a722ad.pk3 - - http://dl.xonotic.fps.gratis/zzz-quickmenu_029.pk3 - - http://dl.xonotic.fps.gratis/zzz-minigames-v006-114-ga3a4a87.pk3 + - https://dl.xonotic.fps.gratis/zzz-misc-v006-122-g0a722ad.pk3 + - https://dl.xonotic.fps.gratis/zzz-quickmenu_029.pk3 + - https://dl.xonotic.fps.gratis/zzz-minigames-v006-114-ga3a4a87.pk3 Optional content packs: - - http://dl.xonotic.fps.gratis/zzz-mod-extra-v006-62-g9667a44.pk3 - - http://dl.xonotic.fps.gratis/zzz-mod-weapons-v006-107-g5176c47.pk3 + - https://dl.xonotic.fps.gratis/zzz-mod-extra-v006-62-g9667a44.pk3 + - https://dl.xonotic.fps.gratis/zzz-mod-weapons-v006-107-g5176c47.pk3 Usage diff --git a/mod/common/gamemodes/all.inc b/mod/common/gamemodes/all.inc index 6d1145e85..21e976687 100644 --- a/mod/common/gamemodes/all.inc +++ b/mod/common/gamemodes/all.inc @@ -1,6 +1,6 @@ #include "arena/module.inc" #include "conquest/module.inc" -#include "dotc/module.inc" +//#include "dotc/module.inc" #include "jailbreak/module.inc" #include "prophunt/module.inc" #include "runematch/module.inc" diff --git a/mod/common/gamemodes/dotc/sv_dotc.qc b/mod/common/gamemodes/dotc/sv_dotc.qc index dde2a8663..0a281ace5 100644 --- a/mod/common/gamemodes/dotc/sv_dotc.qc +++ b/mod/common/gamemodes/dotc/sv_dotc.qc @@ -1,4 +1,4 @@ -//FEATURE: DotC (Defense of the Core) gamemode, a highly ambitious and unfinished mode based on the DotA series +//FEATURE-DISABLED: DotC (Defense of the Core) gamemode, a highly ambitious and unfinished mode based on the DotA series /** DotC - Defense Of The Core. Xonotic's version of DotA diff --git a/mod/common/mutators/all.inc b/mod/common/mutators/all.inc index 87c94c5aa..4a48780c0 100644 --- a/mod/common/mutators/all.inc +++ b/mod/common/mutators/all.inc @@ -1,3 +1,4 @@ +#include "dynamic_spawnshield.qc" #include "hats.qc" #include "pick_spawns.qc" diff --git a/mod/common/mutators/dynamic_spawnshield.qc b/mod/common/mutators/dynamic_spawnshield.qc new file mode 100644 index 000000000..66f066817 --- /dev/null +++ b/mod/common/mutators/dynamic_spawnshield.qc @@ -0,0 +1,82 @@ +//FEATURE: Dynamic Spawnshield mutator, copied from The Regulars, adjusts spawn shield length to benefit those getting spawnkilled + +#ifdef GAMEQC +// how many times player spawnkilled someone +REGISTER_SP(SPWN_KILLS); +// how many times player has been spawnkilled +REGISTER_SP(SPWN_KILLED); +#endif + +#ifdef SVQC +AUTOCVAR(g_spawnshielddynamic, float, 0, "enable Dynamic Spawnshield mutator, set to 0.6 for a sensible value"); +AUTOCVAR(sv_spawnkill_time, float, 1.6, "time after spawn which considers to be spawnkill"); + +REGISTER_MUTATOR(dynamic_spawnshield, autocvar_g_spawnshielddynamic > 0); + +.int spawnkilled_series; +.int spawnkill_series; + +ACCUMULATE void ScoreRules_basics(int teams, float sprio, float stprio, float score_enabled) +{ + if(autocvar_g_spawnshielddynamic > 0 && !INDEPENDENT_PLAYERS) + { + ScoreInfo_SetLabel_PlayerScore(SP_SPWN_KILLS, "spawnkills", 0); + ScoreInfo_SetLabel_PlayerScore(SP_SPWN_KILLED, "spawnkilled", 0); + } +} + +float CalculateSpawnShield(entity this) +{ + if(autocvar_g_spawnshielddynamic > 0 && this.spawnkilled_series > 0) + { + int spawnkilled = this.spawnkilled_series - 1; + // partial sum for series: sum(2 ^ -i) + float val = pow(2, -spawnkilled) * (pow(2, spawnkilled + 1) - 1); + return autocvar_g_spawnshieldtime + val * autocvar_g_spawnshielddynamic; + } + else + return autocvar_g_spawnshieldtime; +} + +MUTATOR_HOOKFUNCTION(dynamic_spawnshield, PlayerSpawn) +{ + entity player = M_ARGV(0, entity); + float shieldtime = StatusEffects_gettime(STATUSEFFECT_SpawnShield, player) - time; + shieldtime = max(shieldtime, CalculateSpawnShield(player)); + + StatusEffects_apply(STATUSEFFECT_SpawnShield, player, time + shieldtime, 0); +} + +void CheckSpawnkill(entity this, entity attacker) +{ + if(autocvar_g_spawnshielddynamic <= 0 || autocvar_sv_spawnkill_time <= 0) + return; + if(this == attacker) + { + this.spawnkilled_series = 0; + this.spawnkill_series = 0; + return; + } + if((time - this.alivetime) < autocvar_sv_spawnkill_time) + { + PlayerScore_Add(this, SP_SPWN_KILLED, 1); + PlayerScore_Add(attacker, SP_SPWN_KILLS, 1); + this.spawnkilled_series++; + attacker.spawnkill_series++; + } + else + this.spawnkilled_series = 0; + + this.spawnkill_series = 0; +} + +// NOTE: needs to be done in PlayerDamaged so we have access to .alivetime +MUTATOR_HOOKFUNCTION(dynamic_spawnshield, PlayerDamaged, CBC_ORDER_LAST) +{ + entity frag_attacker = M_ARGV(0, entity); + entity frag_target = M_ARGV(1, entity); + + if(GetResource(frag_target, RES_HEALTH) < 1 && frag_target.alivetime) + CheckSpawnkill(frag_target, frag_attacker); +} +#endif diff --git a/mod/common/mutators/hats.qc b/mod/common/mutators/hats.qc index f738bb4af..267bddc31 100644 --- a/mod/common/mutators/hats.qc +++ b/mod/common/mutators/hats.qc @@ -258,6 +258,11 @@ classfield(Skeleton) .int bone_hat; classfield(Skeleton) .vector hat_height; classfield(Skeleton) .float hat_scale; +STATIC_INIT(hats) +{ + localcmd("\nalias cl_hat \"seta cl_magical_hax ${* ?}; sendcvar cl_magical_hax\"\n"); +} + MUTATOR_HOOKFUNCTION(mod_hats, TagIndex_Apply) { entity ent = M_ARGV(0, entity); diff --git a/mod/server/weapons.qc b/mod/server/weapons.qc index 58cb46323..ff7a3e946 100644 --- a/mod/server/weapons.qc +++ b/mod/server/weapons.qc @@ -1,5 +1,9 @@ +// FEATURE: Shotgun bonk sound support, works if a sound is placed in sound/weapons/shotgun_melee_impact.ogg + AUTOCVAR(g_mod_weapons, bool, false, "Enable extra weapons provided by the mod"); +SOUND(SHOTGUN_MELEE_IMPACT, W_Sound("shotgun_melee_impact")); + REGISTER_MUTATOR(mod_weapons, autocvar_g_mod_weapons) { MUTATOR_ONADD @@ -21,3 +25,15 @@ REGISTER_MUTATOR(mod_weapons, autocvar_g_mod_weapons) return false; } + +MUTATOR_HOOKFUNCTION(mutator_mod, PlayerDamaged) +{ + entity frag_target = M_ARGV(1, entity); + int frag_deathtype = M_ARGV(5, int); + + if(DEATH_ISWEAPON(frag_deathtype, WEP_SHOTGUN) && (frag_deathtype & HITTYPE_SECONDARY)) + { + // cheap check to see if it exists + sound(frag_target, CH_SHOTS, SND_SHOTGUN_MELEE_IMPACT, VOL_BASE, ATTEN_NORM); + } +} diff --git a/xonotic b/xonotic index 70fd97798..9d98562ab 160000 --- a/xonotic +++ b/xonotic @@ -1 +1 @@ -Subproject commit 70fd977981a46194cf6b2907f1eb8025f63b06a0 +Subproject commit 9d98562ab2b073c3d9d03505019b750c06a426a7