⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m_flyer.pas

📁 delphi编的不错的贪吃蛇
💻 PAS
📖 第 1 页 / 共 2 页
字号:
// 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); cdecl;

implementation

uses q_shared, gameunit, m_flash , g_ai, g_main, g_local_add, game_add,
  g_utils, g_monster, g_weapon, g_misc, CPas;

{$I 'm_flyer.inc'}


var
  nextmove: Integer;  // Used for start/stop frames

  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); cdecl;
begin
  gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
end;

procedure flyer_idle (self : edict_p); cdecl;
begin
  gi.sound (self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
end;

procedure flyer_pop_blades (self : edict_p); cdecl;
begin
  gi.sound (self, CHAN_VOICE, sound_sproing, 1, ATTN_NORM, 0);
end;

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 flyer_walk (self : edict_p); cdecl;
begin
  self^.monsterinfo.currentmove := @flyer_move_walk;
end;

procedure flyer_stand (self : edict_p); cdecl;
begin
  self^.monsterinfo.currentmove := @flyer_move_stand;
end;

var
  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 flyer_start (self : edict_p);
begin
  self^.monsterinfo.currentmove := @flyer_move_start;
end;


var
  flyer_frames_rollright : array [0..8] 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) );
  flyer_move_rollright : mmove_t = (firstframe: FRAME_rollr01;  lastframe: FRAME_rollr09;  frame: @flyer_frames_rollright;  endfunc: Nil);

  flyer_frames_rollleft : array [0..8] of mframe_t = (
    (aifunc: ai_move;  dist: 0;  thinkfunc: Nil),
    (aifunc: ai_move;  dist: 0;  thinkfunc: Nil),

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -