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

📄 m_gladiator.pas

📁 delphi编的不错的贪吃蛇
💻 PAS
📖 第 1 页 / 共 2 页
字号:
//100%
{----------------------------------------------------------------------------}
{                                                                            }
{ File(s): m_gladiator.h                                                     }
{                                                                            }
{ Initial conversion by : Ben Watt (ben@delphigamedev.com)                   }
{ Initial conversion on : 07 March-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-06-04                                                   }
{ Updated by :  Scott Price (scott.price@totalise.co.uk)                     }
{               Mostly pointer de-references                                 }
{                                                                            }
{----------------------------------------------------------------------------}
{ * Still dependent (to compile correctly) on:                               }
{----------------------------------------------------------------------------}
{ * TODO:                                                                    }
{----------------------------------------------------------------------------}
{
==============================================================================

GLADIATOR

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

unit m_gladiator;

interface

uses
  g_main,
  g_local;

procedure SP_monster_gladiator(self : edict_p); cdecl;

implementation

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

var
  sound_pain1,
  sound_pain2,
  sound_die,
  sound_gun,
  sound_cleaver_swing,
  sound_cleaver_hit,
  sound_cleaver_miss,
  sound_idle,
  sound_search,
  sound_sight            : Integer;
  
// start m_gladiator.h
// G:\quake2\baseq2\models/monsters/gladiatr

// This file generated by ModelGen - Do NOT Modify

const
  FRAME_stand1  = 0;
  FRAME_stand2  = 1;
  FRAME_stand3  = 2;
  FRAME_stand4  = 3;
  FRAME_stand5  = 4;
  FRAME_stand6  = 5;
  FRAME_stand7  = 6;
  FRAME_walk1   = 7;
  FRAME_walk2   = 8;
  FRAME_walk3   = 9;
  FRAME_walk4   = 10;
  FRAME_walk5   = 11;
  FRAME_walk6   = 12;
  FRAME_walk7   = 13;
  FRAME_walk8   = 14;
  FRAME_walk9   = 15;
  FRAME_walk10  = 16;
  FRAME_walk11  = 17;
  FRAME_walk12  = 18;
  FRAME_walk13  = 19;
  FRAME_walk14  = 20;
  FRAME_walk15  = 21;
  FRAME_walk16  = 22;
  FRAME_run1    = 23;
  FRAME_run2    = 24;
  FRAME_run3    = 25;
  FRAME_run4    = 26;
  FRAME_run5    = 27;
  FRAME_run6    = 28;
  FRAME_melee1  = 29;
  FRAME_melee2  = 30;
  FRAME_melee3  = 31;
  FRAME_melee4  = 32;
  FRAME_melee5  = 33;
  FRAME_melee6  = 34;
  FRAME_melee7  = 35;
  FRAME_melee8  = 36;
  FRAME_melee9  = 37;
  FRAME_melee10 = 38;
  FRAME_melee11 = 39;
  FRAME_melee12 = 40;
  FRAME_melee13 = 41;
  FRAME_melee14 = 42;
  FRAME_melee15 = 43;
  FRAME_melee16 = 44;
  FRAME_melee17 = 45;
  FRAME_attack1 = 46;
  FRAME_attack2 = 47;
  FRAME_attack3 = 48;
  FRAME_attack4 = 49;
  FRAME_attack5 = 50;
  FRAME_attack6 = 51;
  FRAME_attack7 = 52;
  FRAME_attack8 = 53;
  FRAME_attack9 = 54;
  FRAME_pain1   = 55;
  FRAME_pain2   = 56;
  FRAME_pain3   = 57;
  FRAME_pain4   = 58;
  FRAME_pain5   = 59;
  FRAME_pain6   = 60;
  FRAME_death1  = 61;
  FRAME_death2  = 62;
  FRAME_death3  = 63;
  FRAME_death4  = 64;
  FRAME_death5  = 65;
  FRAME_death6  = 66;
  FRAME_death7  = 67;
  FRAME_death8  = 68;
  FRAME_death9  = 69;
  FRAME_death10 = 70;
  FRAME_death11 = 71;
  FRAME_death12 = 72;
  FRAME_death13 = 73;
  FRAME_death14 = 74;
  FRAME_death15 = 75;
  FRAME_death16 = 76;
  FRAME_death17 = 77;
  FRAME_death18 = 78;
  FRAME_death19 = 79;
  FRAME_death20 = 80;
  FRAME_death21 = 81;
  FRAME_death22 = 82;
  FRAME_painup1 = 83;
  FRAME_painup2 = 84;
  FRAME_painup3 = 85;
  FRAME_painup4 = 86;
  FRAME_painup5 = 87;
  FRAME_painup6 = 88;
  FRAME_painup7 = 89;

  MODEL_SCALE   = 1.000000;  

// end m_gladiator.h

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

procedure gladiator_sight(self, other : edict_p); cdecl;
begin
  gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
end;

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

procedure gladiator_cleaver_swing(self : edict_p); cdecl;
begin
  gi.sound(self, CHAN_WEAPON, sound_cleaver_swing, 1, ATTN_NORM, 0);
end;

const
  gladiator_frames_stand : Array[0..6] 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));

  gladiator_move_stand : mmove_t =
    (firstframe:FRAME_stand1; lastframe:FRAME_stand7; frame:@gladiator_frames_stand; endfunc:nil);

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

const
  gladiator_frames_walk : Array[0..15] of mframe_t =
    ((aifunc:ai_walk; dist:15; thinkfunc:nil),
     (aifunc:ai_walk; dist:7;  thinkfunc:nil),
     (aifunc:ai_walk; dist:6;  thinkfunc:nil),
     (aifunc:ai_walk; dist:5;  thinkfunc:nil),
     (aifunc:ai_walk; dist:2;  thinkfunc:nil),
     (aifunc:ai_walk; dist:0;  thinkfunc:nil),
     (aifunc:ai_walk; dist:2;  thinkfunc:nil),
     (aifunc:ai_walk; dist:8;  thinkfunc:nil),
     (aifunc:ai_walk; dist:12; thinkfunc:nil),
     (aifunc:ai_walk; dist:8;  thinkfunc:nil),
     (aifunc:ai_walk; dist:5;  thinkfunc:nil),
     (aifunc:ai_walk; dist:5;  thinkfunc:nil),
     (aifunc:ai_walk; dist:2;  thinkfunc:nil),
     (aifunc:ai_walk; dist:2;  thinkfunc:nil),
     (aifunc:ai_walk; dist:1;  thinkfunc:nil),
     (aifunc:ai_walk; dist:8;  thinkfunc:nil));

  gladiator_move_walk : mmove_t =
    (firstframe:FRAME_walk1; lastframe:FRAME_walk16; frame:@gladiator_frames_walk; endfunc:nil);

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

const
  gladiator_frames_run : Array[0..5] of mframe_t =
    ((aifunc:ai_run; dist:23; thinkfunc:nil),
     (aifunc:ai_run; dist:14; thinkfunc:nil),
     (aifunc:ai_run; dist:14; thinkfunc:nil),
     (aifunc:ai_run; dist:21; thinkfunc:nil),
     (aifunc:ai_run; dist:12; thinkfunc:nil),
     (aifunc:ai_run; dist:13; thinkfunc:nil));

  gladiator_move_run : mmove_t =
    (firstframe:FRAME_run1; lastframe:FRAME_run6; frame:@gladiator_frames_run; endfunc:nil);

procedure gladiator_run(self : edict_p); cdecl;
begin
  if (self^.monsterinfo.aiflags and AI_STAND_GROUND) <> 0 then
    self^.monsterinfo.currentmove := @gladiator_move_stand
  else
    self^.monsterinfo.currentmove := @gladiator_move_run;

⌨️ 快捷键说明

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