game: sync flipper and float with xatrix

This commit is contained in:
Denis Pauk 2023-10-20 00:54:45 +03:00
parent 00fc171350
commit 5ca0b0ce5d
9 changed files with 25 additions and 1873 deletions

View File

@ -1499,8 +1499,8 @@ XATRIX_OBJS_ = \
src/game/monster/brain/brain.o \
src/game/monster/chick/chick.o \
src/game/monster/fixbot/fixbot.o \
src/xatrix/monster/flipper/flipper.o \
src/xatrix/monster/float/float.o \
src/game/monster/flipper/flipper.o \
src/game/monster/float/float.o \
src/game/monster/flyer/flyer.o \
src/game/monster/gekk/gekk.o \
src/game/monster/gladiator/gladb.o \

View File

@ -1,5 +1,6 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (c) ZeniMax Media Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -64,11 +65,11 @@ flipper_stand(edict_t *self)
}
static mframe_t flipper_frames_run[] = {
{ai_run, FLIPPER_RUN_SPEED, NULL}, /* 6 */
{ai_run, FLIPPER_RUN_SPEED, NULL}, /* 6 */
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL}, /* 10 */
{ai_run, FLIPPER_RUN_SPEED, NULL}, /* 10 */
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
@ -79,7 +80,7 @@ static mframe_t flipper_frames_run[] = {
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL}, /* 20 */
{ai_run, FLIPPER_RUN_SPEED, NULL}, /* 20 */
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
@ -236,6 +237,7 @@ static mframe_t flipper_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL}
};
mmove_t flipper_move_pain1 =
{
FRAME_flppn201,
@ -477,7 +479,8 @@ flipper_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /*
/* check for gib */
if (self->health <= self->gib_health)
{
gi.sound(self, CHAN_VOICE, gi.soundindex("misc/udeath.wav"), 1, ATTN_NORM, 0);
gi.sound(self, CHAN_VOICE, gi.soundindex("misc/udeath.wav"),
1, ATTN_NORM, 0);
for (n = 0; n < 2; n++)
{

View File

@ -1,5 +1,6 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (c) ZeniMax Media Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -35,6 +35,13 @@ static int sound_pain1;
static int sound_pain2;
static int sound_sight;
void floater_dead(edict_t *self);
void floater_die(edict_t *self, edict_t *inflictor, edict_t *attacker,
int damage, vec3_t point);
void floater_run(edict_t *self);
void floater_wham(edict_t *self);
void floater_zap(edict_t *self);
void
floater_sight(edict_t *self, edict_t *other /* unused */)
{
@ -57,13 +64,6 @@ floater_idle(edict_t *self)
gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
void floater_dead(edict_t *self);
void floater_die(edict_t *self, edict_t *inflictor, edict_t *attacker,
int damage, vec3_t point);
void floater_run(edict_t *self);
void floater_wham(edict_t *self);
void floater_zap(edict_t *self);
void
floater_fire_blaster(edict_t *self)
{
@ -386,7 +386,8 @@ mmove_t floater_move_attack3 =
FRAME_attak301,
FRAME_attak334,
floater_frames_attack3,
floater_run};
floater_run
};
static mframe_t floater_frames_death[] = {
{ai_move, 0, NULL},
@ -632,6 +633,11 @@ floater_wham(edict_t *self)
{
static vec3_t aim = {MELEE_DISTANCE, 0, 0};
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_attack3, 1, ATTN_NORM, 0);
fire_hit(self, aim, 5 + randk() % 6, -50);
}

View File

@ -1,5 +1,6 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (c) ZeniMax Media Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -24,7 +25,6 @@
* =======================================================================
*/
#define FRAME_actvat01 0
#define FRAME_actvat02 1
#define FRAME_actvat03 2

View File

@ -1,556 +0,0 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (c) ZeniMax Media Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
*
* Baracuda Shark.
*
* =======================================================================
*/
#include "../../header/local.h"
#include "flipper.h"
#define FLIPPER_RUN_SPEED 24
static int sound_chomp;
static int sound_attack;
static int sound_pain1;
static int sound_pain2;
static int sound_death;
static int sound_idle;
static int sound_search;
static int sound_sight;
void flipper_stand(edict_t *self);
static mframe_t flipper_frames_stand[] = {
{ai_stand, 0, NULL}
};
mmove_t flipper_move_stand = {
FRAME_flphor01,
FRAME_flphor01,
flipper_frames_stand,
NULL
};
void
flipper_stand(edict_t *self)
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flipper_move_stand;
}
static mframe_t flipper_frames_run[] = {
{ai_run, FLIPPER_RUN_SPEED, NULL}, /* 6 */
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL}, /* 10 */
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL}, /* 20 */
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL},
{ai_run, FLIPPER_RUN_SPEED, NULL} /* 29 */
};
mmove_t flipper_move_run_loop = {
FRAME_flpver06,
FRAME_flpver29,
flipper_frames_run,
NULL
};
void
flipper_run_loop(edict_t *self)
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flipper_move_run_loop;
}
static mframe_t flipper_frames_run_start[] = {
{ai_run, 8, NULL},
{ai_run, 8, NULL},
{ai_run, 8, NULL},
{ai_run, 8, NULL},
{ai_run, 8, NULL},
{ai_run, 8, NULL}
};
mmove_t flipper_move_run_start = {
FRAME_flpver01,
FRAME_flpver06,
flipper_frames_run_start,
flipper_run_loop
};
void
flipper_run(edict_t *self)
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flipper_move_run_start;
}
/* Standard Swimming */
static mframe_t flipper_frames_walk[] = {
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL},
{ai_walk, 4, NULL}
};
mmove_t flipper_move_walk = {
FRAME_flphor01,
FRAME_flphor24,
flipper_frames_walk,
NULL
};
void
flipper_walk(edict_t *self)
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flipper_move_walk;
}
static mframe_t flipper_frames_start_run[] = {
{ai_run, 8, NULL},
{ai_run, 8, NULL},
{ai_run, 8, NULL},
{ai_run, 8, NULL},
{ai_run, 8, flipper_run}
};
mmove_t flipper_move_start_run = {
FRAME_flphor01, FRAME_flphor05,
flipper_frames_start_run,
NULL
};
void
flipper_start_run(edict_t *self)
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flipper_move_start_run;
}
static mframe_t flipper_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL}
};
mmove_t flipper_move_pain2 = {
FRAME_flppn101,
FRAME_flppn105,
flipper_frames_pain2,
flipper_run
};
static mframe_t flipper_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL}
};
mmove_t flipper_move_pain1 = {
FRAME_flppn201,
FRAME_flppn205,
flipper_frames_pain1,
flipper_run
};
void
flipper_bite(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, 0, 0);
fire_hit(self, aim, 5, 0);
}
void
flipper_preattack(edict_t *self)
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_chomp, 1, ATTN_NORM, 0);
}
static mframe_t flipper_frames_attack[] = {
{ai_charge, 0, flipper_preattack},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, flipper_bite},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, flipper_bite},
{ai_charge, 0, NULL}
};
mmove_t flipper_move_attack = {
FRAME_flpbit01,
FRAME_flpbit20,
flipper_frames_attack,
flipper_run
};
void
flipper_melee(edict_t *self)
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flipper_move_attack;
}
void
flipper_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
int n;
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
}
if (level.time < self->pain_debounce_time)
{
return;
}
self->pain_debounce_time = level.time + 3;
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}
n = (rand() + 1) % 2;
if (n == 0)
{
gi.sound(self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &flipper_move_pain1;
}
else
{
gi.sound(self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &flipper_move_pain2;
}
}
void
flipper_dead(edict_t *self)
{
vec3_t p;
trace_t tr;
if (!self)
{
return;
}
/* original dead bbox was wrong - and make sure the bbox adjustment stays in solidity */
p[0] = self->s.origin[0];
p[1] = self->s.origin[1];
p[2] = self->s.origin[2] - 8;
tr = gi.trace(self->s.origin, self->mins, self->maxs, p, self, self->clipmask);
self->mins[2] = tr.endpos[2] - self->s.origin[2];
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity(self);
}
static mframe_t flipper_frames_death[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL}
};
mmove_t flipper_move_death = {
FRAME_flpdth01,
FRAME_flpdth56,
flipper_frames_death,
flipper_dead
};
void
flipper_sight(edict_t *self, edict_t *other /* unused */)
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void
flipper_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* unused */,
int damage, vec3_t point /* unused */)
{
int n;
if (!self)
{
return;
}
/* check for gib */
if (self->health <= self->gib_health)
{
gi.sound(self, CHAN_VOICE, gi.soundindex("misc/udeath.wav"),
1, ATTN_NORM, 0);
for (n = 0; n < 2; n++)
{
ThrowGib(self, "models/objects/gibs/bone/tris.md2",
damage, GIB_ORGANIC);
}
for (n = 0; n < 2; n++)
{
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2",
damage, GIB_ORGANIC);
}
ThrowHead(self, "models/objects/gibs/sm_meat/tris.md2",
damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
{
return;
}
/* regular death */
gi.sound(self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
self->monsterinfo.currentmove = &flipper_move_death;
}
/*
* QUAKED monster_flipper (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
*/
void
SP_monster_flipper(edict_t *self)
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);
return;
}
sound_pain1 = gi.soundindex("flipper/flppain1.wav");
sound_pain2 = gi.soundindex("flipper/flppain2.wav");
sound_death = gi.soundindex("flipper/flpdeth1.wav");
sound_chomp = gi.soundindex("flipper/flpatck1.wav");
sound_attack = gi.soundindex("flipper/flpatck2.wav");
sound_idle = gi.soundindex("flipper/flpidle1.wav");
sound_search = gi.soundindex("flipper/flpsrch1.wav");
sound_sight = gi.soundindex("flipper/flpsght1.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
self->s.modelindex = gi.modelindex("models/monsters/flipper/tris.md2");
VectorSet(self->mins, -16, -16, 0);
VectorSet(self->maxs, 16, 16, 32);
self->health = 50;
self->gib_health = -30;
self->mass = 100;
self->pain = flipper_pain;
self->die = flipper_die;
self->monsterinfo.stand = flipper_stand;
self->monsterinfo.walk = flipper_walk;
self->monsterinfo.run = flipper_start_run;
self->monsterinfo.melee = flipper_melee;
self->monsterinfo.sight = flipper_sight;
gi.linkentity(self);
self->monsterinfo.currentmove = &flipper_move_stand;
self->monsterinfo.scale = MODEL_SCALE;
swimmonster_start(self);
}

View File

@ -1,189 +0,0 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (c) ZeniMax Media Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
*
* Baracuda Shark animations.
*
* =======================================================================
*/
#define FRAME_flpbit01 0
#define FRAME_flpbit02 1
#define FRAME_flpbit03 2
#define FRAME_flpbit04 3
#define FRAME_flpbit05 4
#define FRAME_flpbit06 5
#define FRAME_flpbit07 6
#define FRAME_flpbit08 7
#define FRAME_flpbit09 8
#define FRAME_flpbit10 9
#define FRAME_flpbit11 10
#define FRAME_flpbit12 11
#define FRAME_flpbit13 12
#define FRAME_flpbit14 13
#define FRAME_flpbit15 14
#define FRAME_flpbit16 15
#define FRAME_flpbit17 16
#define FRAME_flpbit18 17
#define FRAME_flpbit19 18
#define FRAME_flpbit20 19
#define FRAME_flptal01 20
#define FRAME_flptal02 21
#define FRAME_flptal03 22
#define FRAME_flptal04 23
#define FRAME_flptal05 24
#define FRAME_flptal06 25
#define FRAME_flptal07 26
#define FRAME_flptal08 27
#define FRAME_flptal09 28
#define FRAME_flptal10 29
#define FRAME_flptal11 30
#define FRAME_flptal12 31
#define FRAME_flptal13 32
#define FRAME_flptal14 33
#define FRAME_flptal15 34
#define FRAME_flptal16 35
#define FRAME_flptal17 36
#define FRAME_flptal18 37
#define FRAME_flptal19 38
#define FRAME_flptal20 39
#define FRAME_flptal21 40
#define FRAME_flphor01 41
#define FRAME_flphor02 42
#define FRAME_flphor03 43
#define FRAME_flphor04 44
#define FRAME_flphor05 45
#define FRAME_flphor06 46
#define FRAME_flphor07 47
#define FRAME_flphor08 48
#define FRAME_flphor09 49
#define FRAME_flphor10 50
#define FRAME_flphor11 51
#define FRAME_flphor12 52
#define FRAME_flphor13 53
#define FRAME_flphor14 54
#define FRAME_flphor15 55
#define FRAME_flphor16 56
#define FRAME_flphor17 57
#define FRAME_flphor18 58
#define FRAME_flphor19 59
#define FRAME_flphor20 60
#define FRAME_flphor21 61
#define FRAME_flphor22 62
#define FRAME_flphor23 63
#define FRAME_flphor24 64
#define FRAME_flpver01 65
#define FRAME_flpver02 66
#define FRAME_flpver03 67
#define FRAME_flpver04 68
#define FRAME_flpver05 69
#define FRAME_flpver06 70
#define FRAME_flpver07 71
#define FRAME_flpver08 72
#define FRAME_flpver09 73
#define FRAME_flpver10 74
#define FRAME_flpver11 75
#define FRAME_flpver12 76
#define FRAME_flpver13 77
#define FRAME_flpver14 78
#define FRAME_flpver15 79
#define FRAME_flpver16 80
#define FRAME_flpver17 81
#define FRAME_flpver18 82
#define FRAME_flpver19 83
#define FRAME_flpver20 84
#define FRAME_flpver21 85
#define FRAME_flpver22 86
#define FRAME_flpver23 87
#define FRAME_flpver24 88
#define FRAME_flpver25 89
#define FRAME_flpver26 90
#define FRAME_flpver27 91
#define FRAME_flpver28 92
#define FRAME_flpver29 93
#define FRAME_flppn101 94
#define FRAME_flppn102 95
#define FRAME_flppn103 96
#define FRAME_flppn104 97
#define FRAME_flppn105 98
#define FRAME_flppn201 99
#define FRAME_flppn202 100
#define FRAME_flppn203 101
#define FRAME_flppn204 102
#define FRAME_flppn205 103
#define FRAME_flpdth01 104
#define FRAME_flpdth02 105
#define FRAME_flpdth03 106
#define FRAME_flpdth04 107
#define FRAME_flpdth05 108
#define FRAME_flpdth06 109
#define FRAME_flpdth07 110
#define FRAME_flpdth08 111
#define FRAME_flpdth09 112
#define FRAME_flpdth10 113
#define FRAME_flpdth11 114
#define FRAME_flpdth12 115
#define FRAME_flpdth13 116
#define FRAME_flpdth14 117
#define FRAME_flpdth15 118
#define FRAME_flpdth16 119
#define FRAME_flpdth17 120
#define FRAME_flpdth18 121
#define FRAME_flpdth19 122
#define FRAME_flpdth20 123
#define FRAME_flpdth21 124
#define FRAME_flpdth22 125
#define FRAME_flpdth23 126
#define FRAME_flpdth24 127
#define FRAME_flpdth25 128
#define FRAME_flpdth26 129
#define FRAME_flpdth27 130
#define FRAME_flpdth28 131
#define FRAME_flpdth29 132
#define FRAME_flpdth30 133
#define FRAME_flpdth31 134
#define FRAME_flpdth32 135
#define FRAME_flpdth33 136
#define FRAME_flpdth34 137
#define FRAME_flpdth35 138
#define FRAME_flpdth36 139
#define FRAME_flpdth37 140
#define FRAME_flpdth38 141
#define FRAME_flpdth39 142
#define FRAME_flpdth40 143
#define FRAME_flpdth41 144
#define FRAME_flpdth42 145
#define FRAME_flpdth43 146
#define FRAME_flpdth44 147
#define FRAME_flpdth45 148
#define FRAME_flpdth46 149
#define FRAME_flpdth47 150
#define FRAME_flpdth48 151
#define FRAME_flpdth49 152
#define FRAME_flpdth50 153
#define FRAME_flpdth51 154
#define FRAME_flpdth52 155
#define FRAME_flpdth53 156
#define FRAME_flpdth54 157
#define FRAME_flpdth55 158
#define FRAME_flpdth56 159
#define MODEL_SCALE 1.000000

View File

@ -1,836 +0,0 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (c) ZeniMax Media Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
*
* Mechanic.
*
* =======================================================================
*/
#include "../../header/local.h"
#include "float.h"
static int sound_attack2;
static int sound_attack3;
static int sound_death1;
static int sound_idle;
static int sound_pain1;
static int sound_pain2;
static int sound_sight;
void floater_dead(edict_t *self);
void floater_die(edict_t *self, edict_t *inflictor, edict_t *attacker,
int damage, vec3_t point);
void floater_run(edict_t *self);
void floater_wham(edict_t *self);
void floater_zap(edict_t *self);
void
floater_sight(edict_t *self, edict_t *other /* unused */)
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void
floater_idle(edict_t *self)
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
void
floater_fire_blaster(edict_t *self)
{
vec3_t start;
vec3_t forward, right;
vec3_t end;
vec3_t dir;
int effect;
if (!self)
{
return;
}
if ((self->s.frame == FRAME_attak104) || (self->s.frame == FRAME_attak107))
{
effect = EF_HYPERBLASTER;
}
else
{
effect = 0;
}
AngleVectors(self->s.angles, forward, right, NULL);
G_ProjectSource(self->s.origin, monster_flash_offset[MZ2_FLOAT_BLASTER_1],
forward, right, start);
VectorCopy(self->enemy->s.origin, end);
end[2] += self->enemy->viewheight;
VectorSubtract(end, start, dir);
monster_fire_blaster(self, start, dir, 1, 1000, MZ2_FLOAT_BLASTER_1, effect);
}
static mframe_t floater_frames_stand1[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL}
};
mmove_t floater_move_stand1 = {
FRAME_stand101,
FRAME_stand152,
floater_frames_stand1,
NULL
};
static mframe_t floater_frames_stand2[] = {
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL},
{ai_stand, 0, NULL}
};
mmove_t floater_move_stand2 = {
FRAME_stand201,
FRAME_stand252,
floater_frames_stand2,
NULL
};
void
floater_stand(edict_t *self)
{
if (!self)
{
return;
}
if (random() <= 0.5)
{
self->monsterinfo.currentmove = &floater_move_stand1;
}
else
{
self->monsterinfo.currentmove = &floater_move_stand2;
}
}
static mframe_t floater_frames_activate[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL}
};
mmove_t floater_move_activate = {
FRAME_actvat01,
FRAME_actvat31,
floater_frames_activate,
NULL
};
static mframe_t floater_frames_attack1[] = {
{ai_charge, 0, NULL}, /* Blaster attack */
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, floater_fire_blaster}, /* BOOM (0, -25.8, 32.5) -- LOOP Starts */
{ai_charge, 0, floater_fire_blaster},
{ai_charge, 0, floater_fire_blaster},
{ai_charge, 0, floater_fire_blaster},
{ai_charge, 0, floater_fire_blaster},
{ai_charge, 0, floater_fire_blaster},
{ai_charge, 0, floater_fire_blaster},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL} /* -- LOOP Ends */
};
mmove_t floater_move_attack1 = {
FRAME_attak101,
FRAME_attak114,
floater_frames_attack1,
floater_run
};
static mframe_t floater_frames_attack2[] = {
{ai_charge, 0, NULL}, /* Claws */
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, floater_wham}, /* WHAM (0, -45, 29}.6) -- LOOP Starts */
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL}, /* -- LOOP Ends */
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL}
};
mmove_t floater_move_attack2 = {
FRAME_attak201,
FRAME_attak225,
floater_frames_attack2,
floater_run
};
static mframe_t floater_frames_attack3[] = {
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, floater_zap}, /* -- LOOP Starts */
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL}, /* -- LOOP Ends */
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL},
{ai_charge, 0, NULL}
};
mmove_t floater_move_attack3 = {
FRAME_attak301,
FRAME_attak334,
floater_frames_attack3,
floater_run
};
static mframe_t floater_frames_death[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL}
};
mmove_t floater_move_death = {
FRAME_death01,
FRAME_death13,
floater_frames_death,
floater_dead
};
static mframe_t floater_frames_pain1[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL}
};
mmove_t floater_move_pain1 = {
FRAME_pain101,
FRAME_pain107,
floater_frames_pain1,
floater_run
};
static mframe_t floater_frames_pain2[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL}
};
mmove_t floater_move_pain2 = {
FRAME_pain201,
FRAME_pain208,
floater_frames_pain2,
floater_run
};
static mframe_t floater_frames_pain3[] = {
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL},
{ai_move, 0, NULL}
};
mmove_t floater_move_pain3 = {
FRAME_pain301,
FRAME_pain312,
floater_frames_pain3,
floater_run
};
static mframe_t floater_frames_walk[] = {
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL},
{ai_walk, 5, NULL}
};
mmove_t floater_move_walk = {
FRAME_stand101,
FRAME_stand152,
floater_frames_walk,
NULL
};
static mframe_t floater_frames_run[] = {
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL},
{ai_run, 13, NULL}
};
mmove_t floater_move_run = {
FRAME_stand101,
FRAME_stand152,
floater_frames_run,
NULL
};
void
floater_run(edict_t *self)
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &floater_move_stand1;
}
else
{
self->monsterinfo.currentmove = &floater_move_run;
}
}
void
floater_walk(edict_t *self)
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &floater_move_walk;
}
void
floater_wham(edict_t *self)
{
static vec3_t aim = {MELEE_DISTANCE, 0, 0};
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_attack3, 1, ATTN_NORM, 0);
fire_hit(self, aim, 5 + rand() % 6, -50);
}
void
floater_zap(edict_t *self)
{
vec3_t forward, right;
vec3_t origin;
vec3_t dir;
vec3_t offset;
if (!self)
{
return;
}
VectorSubtract(self->enemy->s.origin, self->s.origin, dir);
AngleVectors(self->s.angles, forward, right, NULL);
VectorSet(offset, 18.5, -0.9, 10);
G_ProjectSource(self->s.origin, offset, forward, right, origin);
gi.sound(self, CHAN_WEAPON, sound_attack2, 1, ATTN_NORM, 0);
gi.WriteByte(svc_temp_entity);
gi.WriteByte(TE_SPLASH);
gi.WriteByte(32);
gi.WritePosition(origin);
gi.WriteDir(dir);
gi.WriteByte(1); /* sparks */
gi.multicast(origin, MULTICAST_PVS);
if (range(self, self->enemy) == RANGE_MELEE && infront(self, self->enemy) &&
visible(self, self->enemy))
{
T_Damage(self->enemy, self, self, dir, self->enemy->s.origin,
vec3_origin, 5 + rand() % 6, -10, DAMAGE_ENERGY,
MOD_UNKNOWN);
}
}
void
floater_attack(edict_t *self)
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &floater_move_attack1;
}
void
floater_melee(edict_t *self)
{
if (!self)
{
return;
}
if (random() < 0.5)
{
self->monsterinfo.currentmove = &floater_move_attack3;
}
else
{
self->monsterinfo.currentmove = &floater_move_attack2;
}
}
void
floater_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
int n;
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
}
if (level.time < self->pain_debounce_time)
{
return;
}
self->pain_debounce_time = level.time + 3;
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}
n = (rand() + 1) % 3;
if (n == 0)
{
gi.sound(self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &floater_move_pain1;
}
else
{
gi.sound(self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &floater_move_pain2;
}
}
void
floater_dead(edict_t *self)
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -24);
VectorSet(self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity(self);
}
void
floater_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* unused */,
int damage /* unused */, vec3_t point /* unused */)
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_death1, 1, ATTN_NORM, 0);
BecomeExplosion1(self);
}
/*
* QUAKED monster_floater (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
*/
void
SP_monster_floater(edict_t *self)
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);
return;
}
sound_attack2 = gi.soundindex("floater/fltatck2.wav");
sound_attack3 = gi.soundindex("floater/fltatck3.wav");
sound_death1 = gi.soundindex("floater/fltdeth1.wav");
sound_idle = gi.soundindex("floater/fltidle1.wav");
sound_pain1 = gi.soundindex("floater/fltpain1.wav");
sound_pain2 = gi.soundindex("floater/fltpain2.wav");
sound_sight = gi.soundindex("floater/fltsght1.wav");
gi.soundindex("floater/fltatck1.wav");
self->s.sound = gi.soundindex("floater/fltsrch1.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
self->s.modelindex = gi.modelindex("models/monsters/float/tris.md2");
VectorSet(self->mins, -24, -24, -24);
VectorSet(self->maxs, 24, 24, 32);
self->health = 200;
self->gib_health = -80;
self->mass = 300;
self->pain = floater_pain;
self->die = floater_die;
self->monsterinfo.stand = floater_stand;
self->monsterinfo.walk = floater_walk;
self->monsterinfo.run = floater_run;
self->monsterinfo.attack = floater_attack;
self->monsterinfo.melee = floater_melee;
self->monsterinfo.sight = floater_sight;
self->monsterinfo.idle = floater_idle;
gi.linkentity(self);
if (random() <= 0.5)
{
self->monsterinfo.currentmove = &floater_move_stand1;
}
else
{
self->monsterinfo.currentmove = &floater_move_stand2;
}
self->monsterinfo.scale = MODEL_SCALE;
flymonster_start(self);
}

View File

@ -1,277 +0,0 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (c) ZeniMax Media Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
*
* Mechanic animations.
*
* =======================================================================
*/
#define FRAME_actvat01 0
#define FRAME_actvat02 1
#define FRAME_actvat03 2
#define FRAME_actvat04 3
#define FRAME_actvat05 4
#define FRAME_actvat06 5
#define FRAME_actvat07 6
#define FRAME_actvat08 7
#define FRAME_actvat09 8
#define FRAME_actvat10 9
#define FRAME_actvat11 10
#define FRAME_actvat12 11
#define FRAME_actvat13 12
#define FRAME_actvat14 13
#define FRAME_actvat15 14
#define FRAME_actvat16 15
#define FRAME_actvat17 16
#define FRAME_actvat18 17
#define FRAME_actvat19 18
#define FRAME_actvat20 19
#define FRAME_actvat21 20
#define FRAME_actvat22 21
#define FRAME_actvat23 22
#define FRAME_actvat24 23
#define FRAME_actvat25 24
#define FRAME_actvat26 25
#define FRAME_actvat27 26
#define FRAME_actvat28 27
#define FRAME_actvat29 28
#define FRAME_actvat30 29
#define FRAME_actvat31 30
#define FRAME_attak101 31
#define FRAME_attak102 32
#define FRAME_attak103 33
#define FRAME_attak104 34
#define FRAME_attak105 35
#define FRAME_attak106 36
#define FRAME_attak107 37
#define FRAME_attak108 38
#define FRAME_attak109 39
#define FRAME_attak110 40
#define FRAME_attak111 41
#define FRAME_attak112 42
#define FRAME_attak113 43
#define FRAME_attak114 44
#define FRAME_attak201 45
#define FRAME_attak202 46
#define FRAME_attak203 47
#define FRAME_attak204 48
#define FRAME_attak205 49
#define FRAME_attak206 50
#define FRAME_attak207 51
#define FRAME_attak208 52
#define FRAME_attak209 53
#define FRAME_attak210 54
#define FRAME_attak211 55
#define FRAME_attak212 56
#define FRAME_attak213 57
#define FRAME_attak214 58
#define FRAME_attak215 59
#define FRAME_attak216 60
#define FRAME_attak217 61
#define FRAME_attak218 62
#define FRAME_attak219 63
#define FRAME_attak220 64
#define FRAME_attak221 65
#define FRAME_attak222 66
#define FRAME_attak223 67
#define FRAME_attak224 68
#define FRAME_attak225 69
#define FRAME_attak301 70
#define FRAME_attak302 71
#define FRAME_attak303 72
#define FRAME_attak304 73
#define FRAME_attak305 74
#define FRAME_attak306 75
#define FRAME_attak307 76
#define FRAME_attak308 77
#define FRAME_attak309 78
#define FRAME_attak310 79
#define FRAME_attak311 80
#define FRAME_attak312 81
#define FRAME_attak313 82
#define FRAME_attak314 83
#define FRAME_attak315 84
#define FRAME_attak316 85
#define FRAME_attak317 86
#define FRAME_attak318 87
#define FRAME_attak319 88
#define FRAME_attak320 89
#define FRAME_attak321 90
#define FRAME_attak322 91
#define FRAME_attak323 92
#define FRAME_attak324 93
#define FRAME_attak325 94
#define FRAME_attak326 95
#define FRAME_attak327 96
#define FRAME_attak328 97
#define FRAME_attak329 98
#define FRAME_attak330 99
#define FRAME_attak331 100
#define FRAME_attak332 101
#define FRAME_attak333 102
#define FRAME_attak334 103
#define FRAME_death01 104
#define FRAME_death02 105
#define FRAME_death03 106
#define FRAME_death04 107
#define FRAME_death05 108
#define FRAME_death06 109
#define FRAME_death07 110
#define FRAME_death08 111
#define FRAME_death09 112
#define FRAME_death10 113
#define FRAME_death11 114
#define FRAME_death12 115
#define FRAME_death13 116
#define FRAME_pain101 117
#define FRAME_pain102 118
#define FRAME_pain103 119
#define FRAME_pain104 120
#define FRAME_pain105 121
#define FRAME_pain106 122
#define FRAME_pain107 123
#define FRAME_pain201 124
#define FRAME_pain202 125
#define FRAME_pain203 126
#define FRAME_pain204 127
#define FRAME_pain205 128
#define FRAME_pain206 129
#define FRAME_pain207 130
#define FRAME_pain208 131
#define FRAME_pain301 132
#define FRAME_pain302 133
#define FRAME_pain303 134
#define FRAME_pain304 135
#define FRAME_pain305 136
#define FRAME_pain306 137
#define FRAME_pain307 138
#define FRAME_pain308 139
#define FRAME_pain309 140
#define FRAME_pain310 141
#define FRAME_pain311 142
#define FRAME_pain312 143
#define FRAME_stand101 144
#define FRAME_stand102 145
#define FRAME_stand103 146
#define FRAME_stand104 147
#define FRAME_stand105 148
#define FRAME_stand106 149
#define FRAME_stand107 150
#define FRAME_stand108 151
#define FRAME_stand109 152
#define FRAME_stand110 153
#define FRAME_stand111 154
#define FRAME_stand112 155
#define FRAME_stand113 156
#define FRAME_stand114 157
#define FRAME_stand115 158
#define FRAME_stand116 159
#define FRAME_stand117 160
#define FRAME_stand118 161
#define FRAME_stand119 162
#define FRAME_stand120 163
#define FRAME_stand121 164
#define FRAME_stand122 165
#define FRAME_stand123 166
#define FRAME_stand124 167
#define FRAME_stand125 168
#define FRAME_stand126 169
#define FRAME_stand127 170
#define FRAME_stand128 171
#define FRAME_stand129 172
#define FRAME_stand130 173
#define FRAME_stand131 174
#define FRAME_stand132 175
#define FRAME_stand133 176
#define FRAME_stand134 177
#define FRAME_stand135 178
#define FRAME_stand136 179
#define FRAME_stand137 180
#define FRAME_stand138 181
#define FRAME_stand139 182
#define FRAME_stand140 183
#define FRAME_stand141 184
#define FRAME_stand142 185
#define FRAME_stand143 186
#define FRAME_stand144 187
#define FRAME_stand145 188
#define FRAME_stand146 189
#define FRAME_stand147 190
#define FRAME_stand148 191
#define FRAME_stand149 192
#define FRAME_stand150 193
#define FRAME_stand151 194
#define FRAME_stand152 195
#define FRAME_stand201 196
#define FRAME_stand202 197
#define FRAME_stand203 198
#define FRAME_stand204 199
#define FRAME_stand205 200
#define FRAME_stand206 201
#define FRAME_stand207 202
#define FRAME_stand208 203
#define FRAME_stand209 204
#define FRAME_stand210 205
#define FRAME_stand211 206
#define FRAME_stand212 207
#define FRAME_stand213 208
#define FRAME_stand214 209
#define FRAME_stand215 210
#define FRAME_stand216 211
#define FRAME_stand217 212
#define FRAME_stand218 213
#define FRAME_stand219 214
#define FRAME_stand220 215
#define FRAME_stand221 216
#define FRAME_stand222 217
#define FRAME_stand223 218
#define FRAME_stand224 219
#define FRAME_stand225 220
#define FRAME_stand226 221
#define FRAME_stand227 222
#define FRAME_stand228 223
#define FRAME_stand229 224
#define FRAME_stand230 225
#define FRAME_stand231 226
#define FRAME_stand232 227
#define FRAME_stand233 228
#define FRAME_stand234 229
#define FRAME_stand235 230
#define FRAME_stand236 231
#define FRAME_stand237 232
#define FRAME_stand238 233
#define FRAME_stand239 234
#define FRAME_stand240 235
#define FRAME_stand241 236
#define FRAME_stand242 237
#define FRAME_stand243 238
#define FRAME_stand244 239
#define FRAME_stand245 240
#define FRAME_stand246 241
#define FRAME_stand247 242
#define FRAME_stand248 243
#define FRAME_stand249 244
#define FRAME_stand250 245
#define FRAME_stand251 246
#define FRAME_stand252 247
#define MODEL_SCALE 1.000000