📄 m_flyer.pas
字号:
// PLEASE, don't modify this file
// 99% complete
{----------------------------------------------------------------------------}
{ }
{ File(s): m_flyer.c }
{ }
{ Initial conversion by : YgriK (Igor Karpov) - glYgriK@hotbox.ru }
{ Initial conversion on : 01-Feb-2002 }
{ }
{ This File contains part of convertion of Quake2 source to ObjectPascal. }
{ More information about this project can be found at: }
{ http://www.sulaco.co.za/quake2/ }
{ }
{ Copyright (C) 1997-2001 Id Software, 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. }
{ }
{----------------------------------------------------------------------------}
{ Updated on : }
{ Updated by : }
{ }
{----------------------------------------------------------------------------}
{ * Still dependent (to compile correctly) on: }
{ 1) unit: g_local }
{ 2) unit: q_shared }
{ 3) unit: game }
{ }
{ .) unit: g_ai }
{ }
{ 1) inc: m_flyer }
{ }
{----------------------------------------------------------------------------}
{ * TODO: }
{ 1) Do more tests }
{ }
{----------------------------------------------------------------------------}
{*
==============================================================================
flyer
==============================================================================
*}
unit m_flyer;
interface
uses g_local;
procedure SP_monster_flyer (self : edict_p);
implementation
uses q_shared, game{, m_flash {, g_ai};
{$I 'm_flyer.inc'}
//REMOVE!!!
var
gi : game_import_t; //from G_LOCAL or G_MAIN;
type
float = single;
//from G_AI
procedure ai_stand (self : edict_p; dist : float); cdecl;
begin
end;
procedure ai_walk (self : edict_p; dist : float); cdecl;
begin
end;
procedure ai_move (self : edict_p; dist : float); cdecl;
begin
end;
procedure ai_charge(self : edict_p; dist : float); cdecl;
begin
end;
procedure ai_run(self : edict_p; dist : float); cdecl;
begin
end;
//function fire_hit - from G_WEAPON or G_LOCAL
//from G_MISC or G_LOCAL
//proc ThrowHead
//proc ThrowGib
//from G_MONSTER or G_LOCAL
//proc walkmonster_start
//REMOVE!!!
//qboolean visible (edict_t *self, edict_t *other);
//static int nextmove; // Used for start/stop frames*)
var
nextmove : integer; // Used for start/stop frames
//static int sound_Xxx;
var
sound_sight,
sound_idle,
sound_pain1,
sound_pain2,
sound_slash,
sound_sproing,
sound_die : integer;
procedure flyer_check_melee (self : edict_p); cdecl; forward;
procedure flyer_loop_melee (self : edict_p); cdecl; forward;
(*void flyer_melee (edict_t *self);
void flyer_setstart (edict_t *self);
void flyer_stand (edict_t *self);*)
procedure flyer_nextmove (self : edict_p); cdecl; forward;
procedure flyer_sight (self, other : edict_p);
begin
gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
end;//procedure
procedure flyer_idle (self : edict_p);
begin
gi.sound (self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
end;//procedure
procedure flyer_pop_blades (self : edict_p); cdecl;
begin
gi.sound (self, CHAN_VOICE, sound_sproing, 1, ATTN_NORM, 0);
end;//procedure
const
flyer_frames_stand : array [0..44] of mframe_t = (
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil),
(aifunc: ai_stand; dist: 0; thinkfunc: Nil) );
flyer_move_stand : mmove_t = (firstframe: FRAME_stand01; lastframe: FRAME_stand45; frame: @flyer_frames_stand; endfunc: Nil);
flyer_frames_walk : array [0..44] of mframe_t = (
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil),
(aifunc: ai_walk; dist: 5; thinkfunc: Nil) );
flyer_move_walk : mmove_t = (firstframe: FRAME_stand01; lastframe: FRAME_stand45; frame: @flyer_frames_walk; endfunc: Nil);
flyer_frames_run : array [0..44] of mframe_t = (
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil),
(aifunc: ai_run; dist: 10; thinkfunc: Nil) );
flyer_move_run : mmove_t = (firstframe: FRAME_stand01; lastframe: FRAME_stand45; frame: @flyer_frames_run; endfunc: Nil);
procedure flyer_run (self : edict_p); cdecl;
begin
if (self.monsterinfo.aiflags AND AI_STAND_GROUND) <> 0
then self.monsterinfo.currentmove := @flyer_move_stand
else self.monsterinfo.currentmove := @flyer_move_run;
end;//procedure
procedure flyer_walk (self : edict_p);
begin
self.monsterinfo.currentmove := @flyer_move_walk;
end;//procedure
procedure flyer_stand (self : edict_t);
begin
self.monsterinfo.currentmove := @flyer_move_stand;
end;//procedure
const
flyer_frames_start : 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: flyer_nextmove) );
flyer_move_start : mmove_t = (firstframe: FRAME_start01; lastframe: FRAME_start06; frame: @flyer_frames_start; endfunc: Nil);
flyer_frames_stop : 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: flyer_nextmove) );
flyer_move_stop : mmove_t = (firstframe: FRAME_stop01; lastframe: FRAME_stop07; frame: @flyer_frames_stop; endfunc: Nil);
procedure flyer_stop (self : edict_p);
begin
self.monsterinfo.currentmove := @flyer_move_stop;
end;//procedure
procedure flyer_start (self : edict_p);
begin
self.monsterinfo.currentmove := @flyer_move_start;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -