diff --git a/3zb2/zig.cfg b/3zb2/zig.cfg index c7bcefa..bf639a0 100644 --- a/3zb2/zig.cfg +++ b/3zb2/zig.cfg @@ -10,6 +10,7 @@ set autospawn 3 set zigmode 1 set zigspawn 1 set zigkiller 1 +set zigrapple 0 set respawn_protection 1 set ctf 0 set aimfix 1 diff --git a/CONFIG.txt b/CONFIG.txt index 6cda9a3..f56c00d 100644 --- a/CONFIG.txt +++ b/CONFIG.txt @@ -52,6 +52,7 @@ chedit Chaining mode on/off (default off = 0, on = 1) zigmode Capture and Hold (ZigFlag) (default off = 0, on = 1) zigspawn ZigFlag returns home after 60s (default on = 1, off = 0) zigkiller ZigFlag holder kill gives bonus frag (default on = 1, off = 0) +zgrapple Add CTF grapple to none CTF game s(default off = 0, on = 1) botlist Set the botlist section name (default = "default") ctf CTF mode on/off (default off = 0, on = 1) aimfix Enable more accurate aiming (default on = 1, off = 0) diff --git a/README.md b/README.md index 8f6070c..3322034 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ more refined, just for fun. I was trying to keep the look and feel of the origin * Optional identified generic gameplay fixes. * Optional respawn protection. * Optional spawn bots at distance. +* Optional grapple. * Optional HUD playerid. * Optional enhanced HUD. @@ -59,6 +60,7 @@ exec addbot.cfg set zigmode 1 set zigspawn 1 set zigkiller 1 +set zigrapple 0 set ctf 0 set aimfix 1 set combathud 1 @@ -224,6 +226,10 @@ Auto switch to upgraded weapon on pickup, enable `1` or disable `0` (default): weaponswap 1 +Option to add grapple to the fray - CTF `pak0.pak` required. + + zigrapple 1 + `Capture and Hold (ZigFlag)` mode for Deathmatch/Team games: zigmode 1 diff --git a/src/bot/func.c b/src/bot/func.c index c3cacca..22b8d6c 100644 --- a/src/bot/func.c +++ b/src/bot/func.c @@ -444,7 +444,8 @@ void PutBotInServer (edict_t *ent) client->ctf_grapple = NULL; item = FindItem("Grapple"); - if(ctf->value) client->pers.inventory[ITEM_INDEX(item)] = 1; //ponpoko + if(ctf->value || zigrapple->value) + client->pers.inventory[ITEM_INDEX(item)] = 1; //ponpoko //ZOID // clear entity values @@ -572,9 +573,14 @@ void PutBotInServer (edict_t *ent) gi.multicast (ent->s.origin, MULTICAST_PVS); } + + if(zigrapple->value) + CTFPlayerResetGrapple(ent); + if(ctf->value) { - CTFPlayerResetGrapple(ent); + if(!zigrapple->value) + CTFPlayerResetGrapple(ent); client->zc.ctfstate = CTFS_OFFENCER; } @@ -807,8 +813,14 @@ void RemoveBot() e->s.modelindex = 0; e->solid = SOLID_NOT; - if(ctf->value) { + if(zigrapple->value) CTFPlayerResetGrapple(e); + + if(ctf->value) { + + if(!zigrapple->value) + CTFPlayerResetGrapple(e); + CTFDeadDropFlag(e); CTFDeadDropTech(e); } diff --git a/src/bot/za.c b/src/bot/za.c index b5ed256..ff8ed02 100644 --- a/src/bot/za.c +++ b/src/bot/za.c @@ -405,6 +405,10 @@ void Bot_SearchItems (edict_t *ent) j = 0; q = false;//rocket jump needed + + if(zigrapple->value) + if( ent->client->ctf_grapple != NULL) j = -1; + //search Items if(ctf->value) { diff --git a/src/g_main.c b/src/g_main.c index cb91789..e5b32f7 100644 --- a/src/g_main.c +++ b/src/g_main.c @@ -69,6 +69,7 @@ cvar_t *autospawn; cvar_t *zigmode; cvar_t *zigspawn; cvar_t *zigkiller; +cvar_t *zigrapple; cvar_t *spawnbotfar; cvar_t *respawn_protection; int flagbounce; diff --git a/src/g_misc.c b/src/g_misc.c index 27fc9cd..93e0074 100644 --- a/src/g_misc.c +++ b/src/g_misc.c @@ -36,6 +36,18 @@ void SP_func_areaportal (edict_t *ent) Misc functions ================= */ +void VelocityForHead (int damage, vec3_t v) +{ + if(damage > 50) + damage = 50; + + v[0] = damage * 10.0 * crandom(); + v[1] = damage * 10.0 * crandom(); + v[2] = 400.0 * crandom(); + + VectorScale (v, 0.7, v); +} + void VelocityForDamage (int damage, vec3_t v) { v[0] = 100.0 * crandom(); @@ -200,7 +212,17 @@ void ThrowHead (edict_t *self, char *gibname, int damage, int type) vscale = 1.0; } - VelocityForDamage (damage, vd); + if(fixflaws->value) + { + // Reduce floating heads in new physics + self->clipmask = MASK_SOLID; + self->groundentity = NULL; + self->gravity = 2.0; + VelocityForHead (damage, vd); + } + else + VelocityForDamage (damage, vd); + VectorMA (self->velocity, vscale, vd, self->velocity); ClipGibVelocity (self); @@ -294,7 +316,18 @@ void ThrowClientHead (edict_t *self, int damage) self->flags |= FL_NO_KNOCKBACK; self->movetype = MOVETYPE_BOUNCE; - VelocityForDamage (damage, vd); + + if(fixflaws->value) + { + // Reduce floating heads in new physics + self->clipmask = MASK_SOLID; + self->groundentity = NULL; + self->gravity = 2.0; + VelocityForHead (damage, vd); + } + else + VelocityForDamage (damage, vd); + VectorAdd (self->velocity, vd, self->velocity); if (self->client) // bodies in the queue don't have a client anymore @@ -765,7 +798,15 @@ void func_object_use (edict_t *self, edict_t *other, edict_t *activator) self->solid = SOLID_BSP; self->svflags &= ~SVF_NOCLIENT; self->use = NULL; + + if(fixflaws->value) + gi.linkentity (self); + KillBox (self); + + if(fixflaws->value) + gi.unlinkentity (self); + func_object_release (self); } @@ -896,8 +937,14 @@ void func_explosive_spawn (edict_t *self, edict_t *other, edict_t *activator) self->solid = SOLID_BSP; self->svflags &= ~SVF_NOCLIENT; self->use = NULL; + + if(fixflaws->value) + gi.linkentity (self); + KillBox (self); - gi.linkentity (self); + + if(!fixflaws->value) + gi.linkentity (self); } void SP_func_explosive (edict_t *self) diff --git a/src/g_save.c b/src/g_save.c index 4ab1f69..7a70d2f 100644 --- a/src/g_save.c +++ b/src/g_save.c @@ -213,6 +213,7 @@ void InitGame (void) spawnbotfar = gi.cvar("spawnbotfar", "0", CVAR_ARCHIVE); zigspawn = gi.cvar("zigspawn", "1", CVAR_ARCHIVE); zigkiller = gi.cvar("zigkiller", "1", CVAR_SERVERINFO | CVAR_ARCHIVE); + zigrapple = gi.cvar("zigrapple", "0", CVAR_SERVERINFO | CVAR_ARCHIVE); basepath = gi.cvar("basepath", ".", CVAR_NOSET); respawn_protection = gi.cvar("respawn_protection", "0", CVAR_ARCHIVE); diff --git a/src/header/local.h b/src/header/local.h index 7d8ee07..0c711f7 100644 --- a/src/header/local.h +++ b/src/header/local.h @@ -624,6 +624,7 @@ extern cvar_t *autospawn; extern cvar_t *zigmode; extern cvar_t *zigspawn; extern cvar_t *zigkiller; +extern cvar_t *zigrapple; extern cvar_t *respawn_protection; extern cvar_t *spawnbotfar; extern cvar_t *killerflag; diff --git a/src/player/client.c b/src/player/client.c index 4475ae4..cd14b20 100644 --- a/src/player/client.c +++ b/src/player/client.c @@ -615,10 +615,15 @@ void player_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damag //ZOID TossClientWeapon (self); + + if(zigrapple->value) + CTFPlayerResetGrapple(self); //ZOID if(ctf->value) { - CTFPlayerResetGrapple(self); + if(!zigrapple->value) + CTFPlayerResetGrapple(self); + CTFDeadDropFlag(self); CTFDeadDropTech(self); } @@ -726,7 +731,8 @@ void InitClientPersistant (gclient_t *client) //ZOID item = FindItem("Grapple"); - if(ctf->value) client->pers.inventory[ITEM_INDEX(item)] = 1; //ponpoko + if(ctf->value || zigrapple->value) + client->pers.inventory[ITEM_INDEX(item)] = 1; //ponpoko //ZOID client->pers.health = 100; diff --git a/windows/gamex86.dll b/windows/gamex86.dll index a74f647..39eb1ba 100644 Binary files a/windows/gamex86.dll and b/windows/gamex86.dll differ diff --git a/windows/gamex86_64.dll b/windows/gamex86_64.dll index 555cc62..101474d 100644 Binary files a/windows/gamex86_64.dll and b/windows/gamex86_64.dll differ diff --git a/windows/path.diff b/windows/path.diff index 44aba47..143a9a7 100644 --- a/windows/path.diff +++ b/windows/path.diff @@ -12,7 +12,7 @@ index ac62468..d9bcf86 100644 # ---------- diff --git a/src/bot/func.c b/src/bot/func.c -index c3cacca..98b7273 100644 +index 22b8d6c..0beb853 100644 --- a/src/bot/func.c +++ b/src/bot/func.c @@ -86,8 +86,7 @@ void Load_BotInfo() @@ -44,10 +44,10 @@ index 7da1da0..b7583d9 100644 fpout = fopen(name,"rb"); if(fpout == NULL) diff --git a/src/g_main.c b/src/g_main.c -index 60648ab..23e22c4 100644 +index e5b32f7..d1bea09 100644 --- a/src/g_main.c +++ b/src/g_main.c -@@ -224,8 +224,8 @@ void Get_NextMap() +@@ -225,8 +225,8 @@ void Get_NextMap() if(!maplist->string) return; @@ -78,7 +78,7 @@ index c694cd5..7955ffc 100644 fpout = fopen(name,"wb"); if(fpout == NULL) gi.cprintf(NULL,PRINT_HIGH,"Can't open %s\n",name); diff --git a/src/header/local.h b/src/header/local.h -index 876e3f6..de3e09a 100644 +index 0c711f7..8a70923 100644 --- a/src/header/local.h +++ b/src/header/local.h @@ -566,10 +566,10 @@ extern int meansOfDeath;