Skip to content

Commit

Permalink
Merge remote-tracking branch 'videoP-jaPRO/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bucky21659 committed Oct 11, 2018
2 parents 2af3821 + 8f47b99 commit d5b9594
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 23 deletions.
3 changes: 3 additions & 0 deletions codemp/game/bg_pmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ qboolean BG_KnockDownable(playerState_t *ps)
return qtrue;
}

extern qboolean BG_InKnockDown(int anim);
qboolean BG_CanJetpack(playerState_t *ps)
{
if (!(ps->stats[STAT_HOLDABLE_ITEMS] & (1 << HI_JETPACK)))
Expand All @@ -352,6 +353,8 @@ qboolean BG_CanJetpack(playerState_t *ps)
return qfalse;
if (BG_InSpecialJump(ps->legsAnim))
return qfalse;
if (BG_InKnockDown(ps->legsAnim))
return qfalse;
return qtrue;
}

Expand Down
3 changes: 2 additions & 1 deletion codemp/game/bg_saber.c
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,7 @@ qboolean PM_SaberInBrokenParry( int move )
if (cgs.jcinfo & JAPRO_CINFO_NOREDCHAIN)
return qfalse;
#endif

if ( move >= LS_V1_BR && move <= LS_V1_B_ )
{
return qtrue;
Expand Down Expand Up @@ -4218,7 +4219,7 @@ void PM_SetSaberMove(short newMove)
{//spins must be played on entire body
parts = SETANIM_BOTH;
}
else if ( (!pm->cmd.forwardmove&&!pm->cmd.rightmove&&!pm->cmd.upmove) )
else if ( (!pm->cmd.forwardmove && !pm->cmd.rightmove && !pm->cmd.upmove) )
{//not trying to run, duck or jump
if ( !BG_FlippingAnim( pm->ps->legsAnim ) &&
!BG_InRoll( pm->ps, pm->ps->legsAnim ) &&
Expand Down
4 changes: 3 additions & 1 deletion codemp/game/g_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -2540,7 +2540,9 @@ void Touch_Item (gentity_t *ent, gentity_t *other, trace_t *trace) {
}
}

G_LogPrintf( "Item: %i %s\n", other->s.number, ent->item->classname );
if (developer.integer) {
G_LogPrintf("Item: %i %s\n", other->s.number, ent->item->classname);
}

predict = other->client->pers.predictItemPickup;

Expand Down
4 changes: 2 additions & 2 deletions codemp/game/g_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3390,7 +3390,7 @@ void G_RunFrame( int levelTime ) {
trap->Print("Auto quitting server %i\n", levelTime);
trap->SendConsoleCommand(EXEC_APPEND, "quit\n");
}
if (levelTime > (2147483648 - 1000)) { //just always quit if its this high.. 24 days?
if (levelTime > (2147483648 - 60*1000)) { //just always quit if its this high.. 24 days?
trap->Print("Auto quitting server %i\n", levelTime);
trap->SendConsoleCommand(EXEC_APPEND, "quit\n");
}
Expand Down Expand Up @@ -3838,7 +3838,7 @@ void G_RunFrame( int levelTime ) {
{ //using jetpack, drain fuel
if (ent->client->jetPackDebReduce < level.time)
{
ent->client->ps.jetpackFuel -= 5;
ent->client->ps.jetpackFuel -= 6;

if (ent->client->ps.jetpackFuel <= 0)
{ //turn it off
Expand Down
4 changes: 3 additions & 1 deletion codemp/game/g_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,9 @@ void TimerStart(gentity_t *trigger, gentity_t *player, trace_t *trace) {//JAPRO
return;
if (player->s.eType == ET_NPC)
return;
if (player->client->ps.pm_type != PM_NORMAL && player->client->ps.pm_type != PM_FLOAT && player->client->ps.pm_type != PM_FREEZE && player->client->ps.pm_type != PM_JETPACK)
if (player->client->ps.duelInProgress)
return;
if (player->client->ps.pm_type != PM_NORMAL && player->client->ps.pm_type != PM_FLOAT && player->client->ps.pm_type != PM_FREEZE && player->client->ps.pm_type != PM_JETPACK) //Allow racemode emotes?
return;
if (player->client->sess.raceMode && player->client->sess.movementStyle == MV_SWOOP && !player->client->ps.m_iVehicleNum) //Dont start the timer for swoop racers if they dont have a swoop
return;
Expand Down
14 changes: 9 additions & 5 deletions codemp/game/g_weapon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2316,6 +2316,10 @@ void rocketThink( gentity_t *ent )
float dot, dot2, dis;
int i;
float vel = (ent->spawnflags&1)?ent->speed:ROCKET_VELOCITY;
qboolean redeemerAllowed = qtrue;

if (!g_entities[ent->r.ownerNum].client || !g_entities[ent->r.ownerNum].client->sess.raceMode)
redeemerAllowed = qfalse;

if ( ent->genericValue1 && ent->genericValue1 < level.time )
{//time's up, we're done, remove us
Expand All @@ -2329,7 +2333,7 @@ void rocketThink( gentity_t *ent )
}
return;
}
if (!(g_tweakWeapons.integer & WT_ROCKET_REDEEMER) && ( !ent->enemy
if ((!(g_tweakWeapons.integer & WT_ROCKET_REDEEMER) || !redeemerAllowed) && ( !ent->enemy
|| !ent->enemy->client
|| ent->enemy->health <= 0
|| ent->enemy->client->ps.powerups[PW_CLOAKED] ))
Expand All @@ -2353,7 +2357,7 @@ void rocketThink( gentity_t *ent )
}
}

if ( !(g_tweakWeapons.integer & WT_ROCKET_REDEEMER) && ent->enemy && ent->enemy->inuse )
if ((!(g_tweakWeapons.integer & WT_ROCKET_REDEEMER) || !redeemerAllowed) && ent->enemy && ent->enemy->inuse )
{
float newDirMult = ent->angle?ent->angle*2.0f:1.0f;
float oldDirMult = ent->angle?(1.0f-ent->angle)*2.0f:1.0f;
Expand Down Expand Up @@ -2464,7 +2468,7 @@ void rocketThink( gentity_t *ent )
VectorCopy( ent->r.currentOrigin, ent->s.pos.trBase );
ent->s.pos.trTime = level.time;
}
else if (g_tweakWeapons.integer & WT_ROCKET_REDEEMER)
else if ((g_tweakWeapons.integer & WT_ROCKET_REDEEMER) && redeemerAllowed)
{
vec3_t fwd, traceFrom, traceTo, dir;
trace_t tr;
Expand Down Expand Up @@ -2546,7 +2550,7 @@ static void WP_FireRocket( gentity_t *ent, qboolean altFire )
if ( altFire )
vel *= 0.5f;

if (altFire && g_tweakWeapons.integer & WT_ROCKET_REDEEMER)
if (altFire && g_tweakWeapons.integer & WT_ROCKET_REDEEMER && !ent->client->sess.raceMode)
damage *= 2;

if (q3style && ent->client->pers.backwardsRocket) {
Expand Down Expand Up @@ -2592,7 +2596,7 @@ static void WP_FireRocket( gentity_t *ent, qboolean altFire )
ent->client->ps.rocketLockTime = 0;
ent->client->ps.rocketTargetTime = 0;
}
else if (altFire && g_tweakWeapons.integer & WT_ROCKET_REDEEMER)
else if (altFire && (g_tweakWeapons.integer & WT_ROCKET_REDEEMER) && !ent->client->sess.raceMode)
{
missile->angle = 0.5f;
missile->think = rocketThink;
Expand Down
25 changes: 12 additions & 13 deletions codemp/game/w_saber.c
Original file line number Diff line number Diff line change
Expand Up @@ -5053,7 +5053,7 @@ static QINLINE qboolean CheckSaberDamage(gentity_t *self, int rSaberNum, int rBl
}
}

if ( !(g_tweakSaber.integer & ST_NO_REDCHAIN) && ((selfSaberLevel < FORCE_LEVEL_3 && ((tryDeflectAgain && Q_irand(1, 10) <= 3) || (!tryDeflectAgain && Q_irand(1, 10) <= 7))) || (Q_irand(1, 10) <= 1 && otherSaberLevel >= FORCE_LEVEL_3))
if (!(g_tweakSaber.integer & ST_NO_REDCHAIN) && ((selfSaberLevel < FORCE_LEVEL_3 && ((tryDeflectAgain && Q_irand(1, 10) <= 3) || (!tryDeflectAgain && Q_irand(1, 10) <= 7))) || (Q_irand(1, 10) <= 1 && otherSaberLevel >= FORCE_LEVEL_3))
&& !PM_SaberInBounce(self->client->ps.saberMove)

&& !PM_SaberInBrokenParry(otherOwner->client->ps.saberMove)
Expand Down Expand Up @@ -5100,7 +5100,7 @@ static QINLINE qboolean CheckSaberDamage(gentity_t *self, int rSaberNum, int rBl

didDefense = qtrue;
}
else if ( !(g_tweakSaber.integer & ST_NO_REDCHAIN) && (selfSaberLevel > FORCE_LEVEL_2 || unblockable) && //if we're doing a special attack, we can send them into a broken parry too (MP only)
else if (!(g_tweakSaber.integer & ST_NO_REDCHAIN) && (selfSaberLevel > FORCE_LEVEL_2 || unblockable) && //if we're doing a special attack, we can send them into a broken parry too (MP only)
( otherOwner->client->ps.fd.forcePowerLevel[FP_SABER_DEFENSE] < selfSaberLevel || (otherOwner->client->ps.fd.forcePowerLevel[FP_SABER_DEFENSE] == selfSaberLevel && (Q_irand(1, 10) >= otherSaberLevel*1.5 || unblockable)) ) &&
PM_SaberInParry(otherOwner->client->ps.saberMove) &&
!PM_SaberInBrokenParry(otherOwner->client->ps.saberMove) &&
Expand Down Expand Up @@ -5199,22 +5199,21 @@ static QINLINE qboolean CheckSaberDamage(gentity_t *self, int rSaberNum, int rBl
attackAdv = (attackStr+attackBonus+self->client->ps.fd.forcePowerLevel[FP_SABER_OFFENSE])-(defendStr+otherOwner->client->ps.fd.forcePowerLevel[FP_SABER_OFFENSE]);

if (!(g_tweakSaber.integer & ST_NO_REDCHAIN)) {

if ( attackAdv > 1 )
if (attackAdv > 1)
{//I won, he should knockaway
otherOwner->client->ps.saberMove = BG_BrokenParryForAttack( otherOwner->client->ps.saberMove );
otherOwner->client->ps.saberMove = BG_BrokenParryForAttack(otherOwner->client->ps.saberMove);
otherOwner->client->ps.saberBlocked = BLOCKED_BOUNCE_MOVE;
}
else if ( attackAdv > 0 )
else if (attackAdv > 0)
{//I won, he should bounce, I should continue
otherOwner->client->ps.saberBlocked = BLOCKED_ATK_BOUNCE;
}
else if ( attackAdv < 1 )
else if (attackAdv < 1)
{//I lost, I get knocked away
self->client->ps.saberMove = BG_BrokenParryForAttack( self->client->ps.saberMove );
self->client->ps.saberMove = BG_BrokenParryForAttack(self->client->ps.saberMove);
self->client->ps.saberBlocked = BLOCKED_BOUNCE_MOVE;
}
else if ( attackAdv < 0 )
else if (attackAdv < 0)
{//I lost, I bounce off
self->client->ps.saberBlocked = BLOCKED_ATK_BOUNCE;
}
Expand All @@ -5223,8 +5222,8 @@ static QINLINE qboolean CheckSaberDamage(gentity_t *self, int rSaberNum, int rBl
self->client->ps.saberBlocked = BLOCKED_ATK_BOUNCE;
otherOwner->client->ps.saberBlocked = BLOCKED_ATK_BOUNCE;
}

}

didOffense = qtrue;

}
Expand Down Expand Up @@ -5272,7 +5271,7 @@ static QINLINE qboolean CheckSaberDamage(gentity_t *self, int rSaberNum, int rBl
otherOwner->client->ps.saberEventFlags |= SEF_PARRIED;
self->client->ps.saberEventFlags |= SEF_BLOCKED;

if ( attackStr+self->client->ps.fd.forcePowerLevel[FP_SABER_OFFENSE] > otherIdleStr+otherOwner->client->ps.fd.forcePowerLevel[FP_SABER_DEFENSE] && !(g_tweakSaber.integer & ST_NO_REDCHAIN) )
if (attackStr + self->client->ps.fd.forcePowerLevel[FP_SABER_OFFENSE] > otherIdleStr + otherOwner->client->ps.fd.forcePowerLevel[FP_SABER_DEFENSE] && !(g_tweakSaber.integer & ST_NO_REDCHAIN))
{
crushTheParry = qtrue;
}
Expand Down Expand Up @@ -5335,7 +5334,6 @@ static QINLINE qboolean CheckSaberDamage(gentity_t *self, int rSaberNum, int rBl
Com_Printf("Equal attack level bounce/deflection for clients %i and %i\n", self->s.number, otherOwner->s.number);
}
#endif

if (!(g_tweakSaber.integer & ST_NO_REDCHAIN)) {
self->client->ps.saberEventFlags |= SEF_DEFLECTED;
otherOwner->client->ps.saberEventFlags |= SEF_DEFLECTED;
Expand All @@ -5359,8 +5357,9 @@ static QINLINE qboolean CheckSaberDamage(gentity_t *self, int rSaberNum, int rBl
}
#endif

if (!(g_tweakSaber.integer & ST_NO_REDCHAIN))
if (!(g_tweakSaber.integer & ST_NO_REDCHAIN)) {
otherOwner->client->ps.saberEventFlags &= ~SEF_BLOCKED;
}

didOffense = qtrue;
}
Expand Down

0 comments on commit d5b9594

Please sign in to comment.