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

📄 m_flipper.pas

📁 delphi编的不错的贪吃蛇
💻 PAS
📖 第 1 页 / 共 2 页
字号:
//100%
{----------------------------------------------------------------------------}
{                                                                            }
{ File(s): m_flipper.h                                                       }
{                                                                            }
{ Initial conversion by : Ben Watt (ben@delphigamedev.com)                   }
{ Initial conversion on : 29-Jan-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 :  2003-May-23                                                  }
{ Updated by :  Scott Price (scott.price@totalise.co.uk)                     }
{               Pointer dereferences mostly                                  }
{                                                                            }
{----------------------------------------------------------------------------}
{ * Still dependent (to compile correctly) on:                               }
{ none                                                                       }
{----------------------------------------------------------------------------}
{ * TODO:                                                                    }
{ none                                                                       }
{----------------------------------------------------------------------------}
{
==============================================================================

FLIPPER

==============================================================================
}

unit m_flipper;

interface

uses
  g_local,
  q_shared;


{$I m_flipper.inc}

const MODEL_SCALE     = 1.000000;


procedure flipper_stand(self : edict_p); cdecl;
procedure flipper_run_loop(self : edict_p); cdecl;
procedure flipper_run(self : edict_p); cdecl;
procedure flipper_walk(self : edict_p); cdecl;
procedure flipper_start_run(self : edict_p); cdecl;
procedure flipper_bite(self : edict_p); cdecl;
procedure flipper_preattack(self : edict_p); cdecl;
procedure flipper_melee(self : edict_p); cdecl;
procedure flipper_pain(self, other : edict_p; kick : single; damage : integer); cdecl;
procedure flipper_dead(self : edict_p); cdecl;
procedure flipper_sight(self, other : edict_p); cdecl;
procedure flipper_die(self, inflictor, attacker : edict_p; damage : integer; const point : vec3_t); cdecl;

procedure SP_monster_flipper(self : edict_p); cdecl;



implementation



uses g_ai, g_weapon, g_main, g_local_add, q_shared_add, g_misc, GameUnit,
  g_utils, game_add, g_monster, CPas;


var
  sound_chomp,
  sound_attack,
  sound_pain1,
  sound_pain2,
  sound_death,
  sound_idle,
  sound_search,
  sound_sight   : Integer;


const
  flipper_frames_stand : array[0..0] of mframe_t =
    ((aifunc:ai_stand; dist:0; thinkfunc:nil));

  flipper_move_stand : mmove_t =
    (firstframe:FRAME_flphor01; lastframe:FRAME_flphor01; frame:@flipper_frames_stand; endfunc:nil);


procedure flipper_stand(self : edict_p);
begin
  self^.monsterinfo.currentmove := @flipper_move_stand;
end;

const
  FLIPPER_RUN_SPEED = 24;
  flipper_frames_run : array[0..23] of mframe_t =
    ((aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),   // 6
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),   // 10

     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),   // 20

     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil),
     (aifunc:ai_run; dist:FLIPPER_RUN_SPEED; thinkfunc:nil));  // 29

  flipper_move_run_loop : mmove_t =
    (firstframe:FRAME_flpver06; lastframe:FRAME_flpver29; frame:@flipper_frames_run; endfunc:nil);

procedure flipper_run_loop(self : edict_p);
begin
  self^.monsterinfo.currentmove := @flipper_move_run_loop;
end;

const
  flipper_frames_run_start : array[0..5] of mframe_t =
    ((aifunc:ai_run; dist:8;  thinkfunc:nil),
     (aifunc:ai_run; dist:8;  thinkfunc:nil),
     (aifunc:ai_run; dist:8;  thinkfunc:nil),
     (aifunc:ai_run; dist:8;  thinkfunc:nil),
     (aifunc:ai_run; dist:8;  thinkfunc:nil),
     (aifunc:ai_run; dist:8;  thinkfunc:nil));

  flipper_move_run_start : mmove_t =
    (firstframe:FRAME_flpver01; lastframe:FRAME_flpver06; frame:@flipper_frames_run_start; endfunc:flipper_run_loop);

procedure flipper_run(self : edict_p);
begin
  self^.monsterinfo.currentmove := @flipper_move_run_start;
end;

const
  { Standard Swimming }
  flipper_frames_walk : array[0..23] of mframe_t =
    ((aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil),
     (aifunc:ai_walk; dist:4; thinkfunc:nil));

  flipper_move_walk : mmove_t =
    (firstframe:FRAME_flphor01; lastframe:FRAME_flphor24; frame:@flipper_frames_walk; endfunc:nil);

procedure flipper_walk(self : edict_p);
begin
  self^.monsterinfo.currentmove := @flipper_move_walk;
end;

const
  flipper_frames_start_run : Array[0..4] of mframe_t =
    ((aifunc:ai_run; dist:8; thinkfunc:nil),
     (aifunc:ai_run; dist:8; thinkfunc:nil),
     (aifunc:ai_run; dist:8; thinkfunc:nil),
     (aifunc:ai_run; dist:8; thinkfunc:nil),
     (aifunc:ai_run; dist:8; thinkfunc:flipper_run));

  flipper_move_start_run : mmove_t =
    (firstframe:FRAME_flphor01; lastframe:FRAME_flphor05; frame:@flipper_frames_start_run; endfunc:nil);

procedure flipper_start_run(self : edict_p);
begin
  self^.monsterinfo.currentmove := @flipper_move_start_run;
end;

const
  flipper_frames_pain2 : array[0..4] 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));

  flipper_move_pain2 : mmove_t =
    (firstframe:FRAME_flppn101; lastframe:FRAME_flppn105; frame:@flipper_frames_pain2; endfunc:flipper_run);

  flipper_frames_pain1 : array[0..4] 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));

⌨️ 快捷键说明

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