Skip to content

Commit

Permalink
Merge branch 'master' into quake
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioSMB committed Feb 15, 2025
2 parents c2aa590 + d833c1d commit 474ade4
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Prepare
run: ./update.sh
Expand All @@ -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: |
Expand All @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Prepare
run: ./update.sh
Expand Down
5 changes: 3 additions & 2 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ SMB modpack
===========

QuakeC source for the SMB server mods

<!---
[![Build Status](https://travis-ci.org/MarioSMB/modpack.svg?branch=master)](https://travis-ci.org/MarioSMB/modpack)

!-->
[![Build Status](https://img.shields.io/github/actions/workflow/status/MarioSMB/modpack/build.yml)](https://github.com/MarioSMB/modpack/actions)

Requirements
============
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mod/common/gamemodes/all.inc
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion mod/common/gamemodes/dotc/sv_dotc.qc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions mod/common/mutators/all.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "dynamic_spawnshield.qc"
#include "hats.qc"
#include "pick_spawns.qc"

Expand Down
82 changes: 82 additions & 0 deletions mod/common/mutators/dynamic_spawnshield.qc
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions mod/common/mutators/hats.qc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 16 additions & 0 deletions mod/server/weapons.qc
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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);
}
}
2 changes: 1 addition & 1 deletion xonotic
Submodule xonotic updated from 70fd97 to 9d9856

0 comments on commit 474ade4

Please sign in to comment.