berserker: slam attack, running club attack

Based on: 31bc4e52e3
This commit is contained in:
Guilherme Nemeth 2022-08-16 11:15:22 -03:00 committed by Denis Pauk
parent 03c39f34ae
commit d137fe863c
3 changed files with 67 additions and 4 deletions

View file

@ -325,8 +325,15 @@ mmove_t berserk_move_attack_club =
void
berserk_strike(edict_t *self)
{
/* Unused, but removal is
very PITA. Let it be... */
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, 0, -6);
fire_hit(self, aim, (10 + (randk() % 6)), 400); /* Slower attack */
}
static mframe_t berserk_frames_attack_strike[] = {
@ -354,6 +361,50 @@ mmove_t berserk_move_attack_strike =
berserk_run
};
static void
berserk_attack_running_club(edict_t *self)
{
/* Same as regular club attack */
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, self->mins[0], -4);
fire_hit(self, aim, (5 + (randk() % 6)), 400); /* Slower attack */
}
static mframe_t berserk_frames_attack_running_club[] = {
{ai_charge, 21, NULL},
{ai_charge, 11, NULL},
{ai_charge, 21, NULL},
{ai_charge, 25, NULL},
{ai_charge, 18, NULL},
{ai_charge, 19, NULL},
{ai_charge, 21, NULL},
{ai_charge, 11, NULL},
{ai_charge, 21, NULL},
{ai_charge, 25, NULL},
{ai_charge, 18, NULL},
{ai_charge, 19, NULL},
{ai_charge, 21, NULL},
{ai_charge, 11, NULL},
{ai_charge, 21, NULL},
{ai_charge, 25, berserk_swing},
{ai_charge, 18, berserk_attack_running_club},
{ai_charge, 19, NULL}
};
mmove_t berserk_move_attack_running_club =
{
FRAME_r_att1,
FRAME_r_att18,
berserk_frames_attack_running_club,
berserk_run
};
void
berserk_melee(edict_t *self)
{
@ -364,14 +415,24 @@ berserk_melee(edict_t *self)
monster_done_dodge(self);
if ((randk() % 2) == 0)
const int r = randk() % 4;
if (r == 0)
{
self->monsterinfo.currentmove = &berserk_move_attack_spike;
}
else
else if (r == 1)
{
self->monsterinfo.currentmove = &berserk_move_attack_strike;
}
else if (r == 2)
{
self->monsterinfo.currentmove = &berserk_move_attack_club;
}
else
{
self->monsterinfo.currentmove = &berserk_move_attack_running_club;
}
}
static mframe_t berserk_frames_pain1[] = {

View file

@ -56,6 +56,7 @@ extern mmove_t army_move_pain3;
extern mmove_t army_move_run;
extern mmove_t army_move_stand;
extern mmove_t berserk_move_attack_club;
extern mmove_t berserk_move_attack_running_club;
extern mmove_t berserk_move_attack_spike;
extern mmove_t berserk_move_attack_strike;
extern mmove_t berserk_move_death1;

View file

@ -55,6 +55,7 @@
{"army_move_run", &army_move_run},
{"army_move_stand", &army_move_stand},
{"berserk_move_attack_club", &berserk_move_attack_club},
{"berserk_move_attack_running_club", &berserk_move_attack_running_club},
{"berserk_move_attack_spike", &berserk_move_attack_spike},
{"berserk_move_attack_strike", &berserk_move_attack_strike},
{"berserk_move_death1", &berserk_move_death1},