void p_medic_attack (edict_t *ent) { ent->client->idle_frames = 0; if (ent->client->weapon_mode == 1) { // cable/healing mode if (ent->s.frame != MEDIC_FRAMES_CABLE_END) G_RunFrames(ent, MEDIC_FRAMES_CABLE_START, MEDIC_FRAMES_CABLE_END, false); else ent->s.frame = 218; // loop from this frame forward p_medic_heal(ent); } else if (ent->client->weapon_mode == 2) { // blaster bolt mode if (ent->s.frame != MEDIC_FRAMES_BOLT_END) G_RunFrames(ent, MEDIC_FRAMES_BOLT_START, MEDIC_FRAMES_BOLT_END, false); else ent->s.frame = 185; // loop from this frame forward p_medic_firebolt(ent); } else { // hyperblaster mode if (ent->s.frame != MEDIC_FRAMES_HB_END) G_RunFrames(ent, MEDIC_FRAMES_HB_START, MEDIC_FRAMES_HB_END, false); else ent->s.frame = 195; // loop from this frame forward p_medic_firehb(ent); } }
void RunMedicFrames (edict_t *ent, usercmd_t *ucmd) { if ((ent->mtype != MORPH_MEDIC) || (ent->deadflag == DEAD_DEAD)) return; ent->s.modelindex2 = 0; // no weapon model if (!ent->myskills.administrator) ent->s.skinnum = 0; else ent->s.skinnum = 2; if (level.framenum >= ent->count) { p_medic_regen(ent); // play running animation if we are moving forward or strafing if ((ucmd->forwardmove > 0) || ucmd->sidemove) G_RunFrames(ent, MEDIC_FRAMES_RUN_START, MEDIC_FRAMES_RUN_END, false); // play animation in reverse if we are going backwards else if (ucmd->forwardmove < 0) G_RunFrames(ent, MEDIC_FRAMES_RUN_START, MEDIC_FRAMES_RUN_END, true); // attack else if ((ent->client->buttons & BUTTON_ATTACK) && (level.time > ent->monsterinfo.attack_finished)) p_medic_attack(ent); // play jump animation if we are off ground and not submerged in water else if (!ent->groundentity && (ent->waterlevel < 2)) p_medic_jump(ent); else G_RunFrames(ent, MEDIC_FRAMES_IDLE_START, MEDIC_FRAMES_IDLE_END, false); // run idle frames ent->count = level.framenum + 1; } }
void RunParasiteFrames (edict_t *ent, usercmd_t *ucmd) { qboolean idle = false; // if we aren't a parasite or we are dead, we shouldn't be here! if ((ent->mtype != M_MYPARASITE) || (ent->deadflag == DEAD_DEAD)) return; ent->s.modelindex2 = 0; ent->s.skinnum = 0; if (level.framenum >= ent->count) { ent->count = level.framenum + 1; // play running animation if we are moving forward or strafing if ((ucmd->forwardmove > 0) || ucmd->sidemove) G_RunFrames(ent, 70, 76, false); // play animation in reverse if we are going backwards else if (ucmd->forwardmove < 0) G_RunFrames(ent, 70, 76, true); else idle = true; if ((ent->client->buttons & BUTTON_ATTACK) && myparasite_attack(ent) && idle) { // run attack frames G_RunFrames(ent, 39, 51, false); ent->client->idle_frames = 0; } else if (idle) { // if we were attacking, reset it if (ent->shots) { ent->shots = 0; ent->enemy = NULL; ent->wait = level.time + PARASITE_REFIRE; } // if we just finished an attack if (ent->oldenemy) { if (ent->s.frame < 56) G_RunFrames(ent, 39, 56, false); // run end attack frames else ent->oldenemy = NULL; // we're done } else G_RunFrames(ent, 83, 99, false); // run idle frames // play parasite's tapping sound if (ent->groundentity && ((ent->s.frame==85) || (ent->s.frame==87) || (ent->s.frame==91) || (ent->s.frame==93) || (ent->s.frame==97) || (ent->s.frame==99))) gi.sound (ent, CHAN_WEAPON, gi.soundindex("parasite/paridle1.wav"), 1, ATTN_IDLE, 0); } } }
void RunBerserkFrames (edict_t *ent, usercmd_t *ucmd) { if ((ent->mtype != MORPH_BERSERK) || (ent->deadflag == DEAD_DEAD)) return; ent->s.modelindex2 = 0; // no weapon model ent->s.skinnum = 0; if (level.framenum >= ent->count) { int regen_frames = qf2sf(BERSERK_REGEN_FRAMES); // morph mastery reduces regen time if (ent->myskills.abilities[MORPH_MASTERY].current_level > 0) regen_frames *= 0.5; M_Regenerate(ent, regen_frames, qf2sf(BERSERK_REGEN_DELAY), 1.0, true, false, false, &ent->monsterinfo.regen_delay1); // play running animation if we are moving forward or strafing if ((ucmd->forwardmove > 0) || (!ucmd->forwardmove && ucmd->sidemove)) { if ((ent->client->buttons & BUTTON_ATTACK) && (level.time > ent->monsterinfo.attack_finished)) p_berserk_attack(ent, BERSERK_RUN_FORWARD); else G_RunFrames(ent, BERSERK_FRAMES_RUN_START, BERSERK_FRAMES_RUN_END, false); } // play animation in reverse if we are going backwards else if (ucmd->forwardmove < 0) { if ((ent->client->buttons & BUTTON_ATTACK) && (level.time > ent->monsterinfo.attack_finished)) p_berserk_attack(ent, BERSERK_RUN_BACKWARD); else G_RunFrames(ent, BERSERK_FRAMES_RUN_START, BERSERK_FRAMES_RUN_END, true); } // standing attack else if ((ent->client->buttons & BUTTON_ATTACK) && (level.time > ent->monsterinfo.attack_finished)) p_berserk_attack(ent, 0); // play jump animation if we are off ground and not submerged in water else if (!ent->groundentity && (ent->waterlevel < 2)) p_berserk_jump(ent); else G_RunFrames(ent, BERSERK_FRAMES_IDLE1_START, BERSERK_FRAMES_IDLE1_END, false); // run idle frames ent->count = level.framenum + qf2sf(1); } }
void boss_tank_think (edict_t *self) { int frame; if (!boss_checkstatus(self)) return; if (self->linkcount != self->monsterinfo.linkcount) { self->monsterinfo.linkcount = self->linkcount; M_CheckGround (self); } self->monsterinfo.trail_time = level.time + 1; // stay in eye-cam if (self->style == FRAMES_RUN_FORWARD) G_RunFrames(self, TANK_FRAMES_START_WALK, TANK_FRAMES_END_WALK, false); else if (self->style == FRAMES_RUN_BACKWARD) G_RunFrames(self, TANK_FRAMES_START_WALK, TANK_FRAMES_END_WALK, true); else if (self->style == FRAMES_ATTACK) { if (self->owner->client->weapon_mode) G_RunFrames(self, TANK_FRAMES_START_PUNCH, TANK_FRAMES_END_PUNCH, false); else G_RunFrames(self, TANK_FRAMES_START_ROCKET, TANK_FRAMES_END_ROCKET, false); } else boss_idle(self); boss_regenerate(self); boss_tank_attack(self); frame = self->s.frame; // play tank step sound if (self->groundentity && ((frame == 41) || (frame == 49))) gi.sound (self, CHAN_WEAPON, gi.soundindex ("tank/step.wav"), 1, ATTN_NORM, 0); self->nextthink = level.time + FRAMETIME; }
void p_medic_jump (edict_t *ent) { // run jump animation forward until last frame, then hold it if (ent->s.frame != MEDIC_FRAMES_JUMP_END) G_RunFrames(ent, MEDIC_FRAMES_JUMP_START, MEDIC_FRAMES_JUMP_END, false); }
void boss_idle (edict_t *self) { G_RunFrames(self, TANK_FRAMES_START_STAND, TANK_FRAMES_END_STAND, false); }
void p_berserk_attack (edict_t *ent, int move_state) { int punch_dmg = BERSERK_PUNCH_INITIAL_DAMAGE + BERSERK_PUNCH_ADDON_DAMAGE * ent->myskills.abilities[BERSERK].current_level; int slash_dmg = BERSERK_SLASH_INITIAL_DAMAGE + BERSERK_SLASH_ADDON_DAMAGE * ent->myskills.abilities[BERSERK].current_level; int crush_dmg = BERSERK_CRUSH_INITIAL_DAMAGE + BERSERK_CRUSH_ADDON_DAMAGE * ent->myskills.abilities[BERSERK].current_level; vec3_t forward, right, up, angles; ent->client->idle_frames = 0; AngleVectors(ent->s.angles, NULL, right, up); AngleVectors(ent->client->v_angle, forward, NULL, NULL); VectorCopy(ent->client->v_angle, angles); if (move_state == BERSERK_RUN_FORWARD) { G_RunFrames(ent, BERSERK_FRAMES_RUNATTACK1_START, BERSERK_FRAMES_RUNATTACK1_END, false); // swing left-right if (ent->s.frame == 124) { angles[YAW] += 20; AngleCheck(&angles[YAW]); AngleVectors(angles, forward, NULL, NULL); p_berserk_melee(ent, forward, NULL, punch_dmg, BERSERK_PUNCH_KNOCKBACK, BERSERK_PUNCH_RANGE, MOD_BERSERK_PUNCH); } else if (ent->s.frame == 125) { p_berserk_melee(ent, forward, NULL, punch_dmg, BERSERK_PUNCH_KNOCKBACK, BERSERK_PUNCH_RANGE, MOD_BERSERK_PUNCH); } else if (ent->s.frame == 126) { angles[YAW] -= 20; AngleCheck(&angles[YAW]); AngleVectors(angles, forward, NULL, NULL); p_berserk_melee(ent, forward, NULL, punch_dmg, BERSERK_PUNCH_KNOCKBACK, BERSERK_PUNCH_RANGE, MOD_BERSERK_PUNCH); } } else if (move_state == BERSERK_RUN_BACKWARD) { G_RunFrames(ent, BERSERK_FRAMES_RUNATTACK1_START, BERSERK_FRAMES_RUNATTACK1_END, true); // swing left-right if (ent->s.frame == 124) { angles[YAW] += 20; AngleCheck(&angles[YAW]); AngleVectors(angles, forward, NULL, NULL); p_berserk_melee(ent, forward, NULL, punch_dmg, BERSERK_PUNCH_KNOCKBACK, BERSERK_PUNCH_RANGE, MOD_BERSERK_PUNCH); } else if (ent->s.frame == 125) { p_berserk_melee(ent, forward, NULL, punch_dmg, BERSERK_PUNCH_KNOCKBACK, BERSERK_PUNCH_RANGE, MOD_BERSERK_PUNCH); } else if (ent->s.frame == 126) { angles[YAW] -= 20; AngleCheck(&angles[YAW]); AngleVectors(angles, forward, NULL, NULL); p_berserk_melee(ent, forward, NULL, punch_dmg, BERSERK_PUNCH_KNOCKBACK, BERSERK_PUNCH_RANGE, MOD_BERSERK_PUNCH); } } else if (ent->client->weapon_mode == 1) // slash { G_RunFrames(ent, BERSERK_FRAMES_SLASH_START, BERSERK_FRAMES_SLASH_END, false); if ((ent->s.frame == 79) || (ent->s.frame == 80)) p_berserk_melee(ent, forward, up, slash_dmg, BERSERK_SLASH_KNOCKBACK, BERSERK_SLASH_RANGE, MOD_BERSERK_SLASH); } else if (ent->client->weapon_mode == 2) // crush { G_RunFrames(ent, BERSERK_FRAMES_SLAM_START, BERSERK_FRAMES_SLAM_END, false); if (ent->s.frame == 154) p_berserk_crush(ent, crush_dmg, BERSERK_CRUSH_RANGE, MOD_BERSERK_CRUSH); } else // punch { G_RunFrames(ent, BERSERK_FRAMES_PUNCH_START, BERSERK_FRAMES_PUNCH_END, false); // swing left-right if (ent->s.frame == 66) { angles[YAW] += 20;//45; AngleCheck(&angles[YAW]); AngleVectors(angles, forward, NULL, NULL); p_berserk_melee(ent, forward, right, punch_dmg, BERSERK_PUNCH_KNOCKBACK, BERSERK_PUNCH_RANGE, MOD_BERSERK_PUNCH); } else if (ent->s.frame == 67) { p_berserk_melee(ent, forward, right, punch_dmg, BERSERK_PUNCH_KNOCKBACK, BERSERK_PUNCH_RANGE, MOD_BERSERK_PUNCH); } else if (ent->s.frame == 68) { angles[YAW] -= 20;//45; AngleCheck(&angles[YAW]); AngleVectors(angles, forward, NULL, NULL); p_berserk_melee(ent, forward, right, punch_dmg, BERSERK_PUNCH_KNOCKBACK, BERSERK_PUNCH_RANGE, MOD_BERSERK_PUNCH); } } p_berserk_swing(ent); }
void p_berserk_jump (edict_t *ent) { // run jump animation forward until last frame, then hold it if (ent->s.frame != BERSERK_FRAMES_JUMP_END) G_RunFrames(ent, BERSERK_FRAMES_DUCK_START, BERSERK_FRAMES_DUCK_END, false); }