📄 m_gladiator.pas
字号:
gladiator_frames_attack_gun : Array[0..8] of mframe_t =
((aifunc:ai_charge; dist:0; thinkfunc:nil),
(aifunc:ai_charge; dist:0; thinkfunc:nil),
(aifunc:ai_charge; dist:0; thinkfunc:nil),
(aifunc:ai_charge; dist:0; thinkfunc:GladiatorGun),
(aifunc:ai_charge; dist:0; thinkfunc:nil),
(aifunc:ai_charge; dist:0; thinkfunc:nil),
(aifunc:ai_charge; dist:0; thinkfunc:nil),
(aifunc:ai_charge; dist:0; thinkfunc:nil),
(aifunc:ai_charge; dist:0; thinkfunc:nil));
gladiator_move_attack_gun : mmove_t =
(firstframe:FRAME_attack1; lastframe:FRAME_attack9; frame:gladiator_frames_attack_gun; endfunc:gladiator_run);
procedure gladiator_attack(self : edict_t);
var
range : single;
v : vec3_t;
begin
// a small safe zone
VectorSubtract(self.s.origin, self.enemy.s.origin, v);
range := VectorLength(v);
if(range <= (MELEE_DISTANCE + 32)) then
exit;
// charge up the railgun
gi.sound(self, CHAN_WEAPON, sound_gun, 1, ATTN_NORM, 0);
VectorCopy(self.enemy.s.origin, self.pos1); //save for aiming the shot
self.pos1[2] := self.pos1[2] + self.enemy.viewheight;
self.monsterinfo.currentmove := gladiator_move_attack_gun;
end;
const
gladiator_frames_pain : Array[0..5] of mframe_t =
((aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil));
gladiator_move_pain : mmove_t =
(firstframe:FRAME_pain1; lastframe:FRAME_pain6; frame:gladiator_frames_pain; endfunc:gladiator_run);
gladiator_frames_pain_air : Array[0..6] of mframe_t =
((aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil));
gladiator_move_pain_air : mmove_t =
(firstframe:FRAME_painup1; lastframe:FRAME_painup7; frame:gladiator_frames_pain_air; endfunc:gladiator_run);
procedure gladiator_pain(self, other : edict_t; kick : single; damage : integer);
begin
if (self.health < (self.max_health / 2)) then
self.s.skinnum = 1;
if (level.time < self.pain_debounce_time) then
begin
if ((self.velocity[2] > 100) and (self.monsterinfo.currentmove = gladiator_move_pain))
self.monsterinfo.currentmove := gladiator_move_pain_air;
exit;
end;
self.pain_debounce_time := level.time + 3;
if (random() < 0.5) then
gi.sound(self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
else
gi.sound(self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
if skill.value = 3 then
exit; // no pain anims in nightmare
if (self.velocity[2] > 100) then
self.monsterinfo.currentmove := gladiator_move_pain_air;
else
self.monsterinfo.currentmove := gladiator_move_pain;
end;
procedure gladiator_dead(self : edict_t);
begin
VectorSet(self.mins, -16, -16, -24);
VectorSet(self.maxs, 16, 16, -8);
self.movetype := MOVETYPE_TOSS;
self.svflags := self.svflags or SVF_DEADMONSTER;
self.nextthink := 0;
gi.linkentity(self);
end;
const
gladiator_frames_death : Array[0..21] of mframe_t =
((aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil),
(aifunc:ai_move; dist:0; thinkfunc:nil));
gladiator_move_death : mmove_t =
(firstframe:FRAME_death1; lastframe:FRAME_death22; frame:gladiator_frames_death; endfunc:gladiator_dead);
procedure gladiator_die(self, inflictor, attacker : edict_t; damage : integer; point : vec3_t);
var
n : integer;
begin
// check for gib
if (self.health <= self.gib_health) then
begin
gi.sound(self, CHAN_VOICE, gi.soundindex('misc/udeath.wav'), 1, ATTN_NORM, 0);
for n := 0 to 1 do
ThrowGib(self, 'models/objects/gibs/bone/tris.md2', damage, GIB_ORGANIC);
for n := 0 to 3 do
ThrowGib(self, 'models/objects/gibs/sm_meat/tris.md2', damage, GIB_ORGANIC);
ThrowHead(self, 'models/objects/gibs/head2/tris.md2', damage, GIB_ORGANIC);
self.deadflag := DEAD_DEAD;
exit;
end;
if self.deadflag = DEAD_DEAD then
exit;
// regular death
gi.sound(self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
self.deadflag := DEAD_DEAD;
self.takedamage := DAMAGE_YES;
self.monsterinfo.currentmove := gladiator_move_death;
end;
{QUAKED monster_gladiator (1 .5 0) (-32 -32 -24) (32 32 64) Ambush Trigger_Spawn Sight
}
procedure SP_monster_gladiator(self : edict_t);
begin
if (deathmatch.value) then
begin
G_FreeEdict(self);
exit;
end;
sound_pain1 := gi.soundindex('gladiator/pain.wav');
sound_pain2 := gi.soundindex('gladiator/gldpain2.wav');
sound_die := gi.soundindex('gladiator/glddeth2.wav');
sound_gun := gi.soundindex('gladiator/railgun.wav');
sound_cleaver_swing := gi.soundindex('gladiator/melee1.wav');
sound_cleaver_hit := gi.soundindex('gladiator/melee2.wav');
sound_cleaver_miss := gi.soundindex('gladiator/melee3.wav');
sound_idle := gi.soundindex('gladiator/gldidle1.wav');
sound_search := gi.soundindex('gladiator/gldsrch1.wav');
sound_sight := gi.soundindex('gladiator/sight.wav');
self.movetype := MOVETYPE_STEP;
self.solid := SOLID_BBOX;
self.s.modelindex := gi.modelindex('models/monsters/gladiatr/tris.md2');
VectorSet(self.mins, -32, -32, -24);
VectorSet(self.maxs, 32, 32, 64);
self.health := 400;
self.gib_health := -175;
self.mass := 400;
self.pain := gladiator_pain;
self.die := gladiator_die;
self.monsterinfo.stand := gladiator_stand;
self.monsterinfo.walk := gladiator_walk;
self.monsterinfo.run := gladiator_run;
self.monsterinfo.dodge := nil;
self.monsterinfo.attack := gladiator_attack;
self.monsterinfo.melee := gladiator_melee;
self.monsterinfo.sight := gladiator_sight;
self.monsterinfo.idle := gladiator_idle;
self.monsterinfo.search := gladiator_search;
gi.linkentity(self);
self.monsterinfo.currentmove := gladiator_move_stand;
self.monsterinfo.scale := MODEL_SCALE;
walkmonster_start(self);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -