void G_AddMercBalance(gentity_t *self, int amount) {//mercs don't suffer mishaps, but they do lose/gain MP if(!WalkCheck(self)) {//running or moving very fast, can't balance as well if(amount > 0) { amount *= 2; } else { amount = amount * .5f; } } //G_Printf("%i: %i: %i Mishap Points\n", level.time, self->s.number, amount); self->client->ps.saberAttackChainCount += amount; if(self->client->ps.saberAttackChainCount < 0) { self->client->ps.saberAttackChainCount = MISHAPLEVEL_NONE; } else if(self->client->ps.saberAttackChainCount > MISHAPLEVEL_MAX) { self->client->ps.saberAttackChainCount = MISHAPLEVEL_MAX; } }
void G_AddMishap(gentity_t *self, int amount) {//mercs don't suffer mishaps, but they do lose/gain MP if(!WalkCheck(self)) { if(amount > 0) { amount *= 2; } else { amount = amount * .5f; } } if(g_debugsaberbehavior.integer > 1) { G_Printf("%i: %i: %i Mishap Points\n", level.time, self->s.number, amount); } self->client->ps.saberAttackChainCount -= amount; if(self->client->ps.saberAttackChainCount < BALANCE_NONE) { self->client->ps.saberAttackChainCount = BALANCE_NONE; } else if(self->client->ps.saberAttackChainCount > BALANCE_MAX) { self->client->ps.saberAttackChainCount = BALANCE_MAX; } }
void SabBeh_AddBalance(gentity_t *self, sabmech_t *mechSelf, int amount, qboolean attack) { if(!WalkCheck(self)) {//running or moving very fast, can't balance as well if(amount > 0) { amount *= 2; } else { amount = amount * .5f; } } //G_Printf("%i: %i: %i Mishap Points\n", level.time, self->s.number, amount); self->client->ps.saberAttackChainCount -= amount; if(self->client->ps.saberAttackChainCount > BALANCE_MAX) { self->client->ps.saberAttackChainCount = BALANCE_MAX; } else if(self->client->ps.saberAttackChainCount < BALANCE_NONE) {//overflowing causes a full mishap. int randNum = Q_irand(0, 2); switch (randNum) { case 0: mechSelf->doDisarm = qtrue; break; case 1: mechSelf->doKnockdown = qtrue; break; }; self->client->ps.saberAttackChainCount = BALANCE_LOW; } }
void SabBeh_AddBalance(gentity_t *self, sabmech_t *mechSelf, int amount, qboolean attack) { if(!WalkCheck(self)) {//running or moving very fast, can't balance as well if(amount > 0) { amount *= 1; // 2 ORIG } else { amount = amount * .5f; } } //G_Printf("%i: %i: %i Mishap Points\n", level.time, self->s.number, amount); self->client->ps.saberAttackChainCount += amount; if(self->client->ps.saberAttackChainCount < 0) { self->client->ps.saberAttackChainCount = MISHAPLEVEL_NONE; } else if(self->client->ps.saberAttackChainCount > MISHAPLEVEL_MAX) {//overflowing causes a full mishap. int randNum = Q_irand(0, 2); switch (randNum) { case 0: mechSelf->doButterFingers = qtrue; break; case 1: mechSelf->doKnockdown = qtrue; break; }; self->client->ps.saberAttackChainCount = MISHAPLEVEL_HEAVY; } }