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

📄 m_supertank.pas

📁 delphi编的不错的贪吃蛇
💻 PAS
📖 第 1 页 / 共 3 页
字号:
{----------------------------------------------------------------------------}
{                                                                            }
{ File(s): m_supertank.c                                                     }
{                                                                            }
{ Initial conversion by : YgriK (Igor Karpov) - glYgriK@hotbox.ru            }
{ Initial conversion on : 25-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 :                                                               }
{ 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_supertank                                                       }
{                                                                            }
{----------------------------------------------------------------------------}
{ * TODO:                                                                    }
{ 1) Do more tests                                                           }
{                                                                            }
{----------------------------------------------------------------------------}


{*
==============================================================================

SUPERTANK

==============================================================================
*}

unit m_supertank;

interface

uses g_local;

procedure BossExplode (self : edict_p); cdecl;

procedure SP_monster_supertank (self : edict_p); cdecl;

implementation

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

{$I m_supertank.inc}

var
  sound_pain1,
  sound_pain2,
  sound_pain3,
  sound_death,
  sound_search1,
  sound_search2,
  tread_sound : integer;


procedure supertank_dead (self : edict_p); cdecl; forward;
procedure supertankRocket (self : edict_p); cdecl; forward;
procedure supertankMachineGun (self : edict_p); cdecl; forward;
procedure supertank_reattack1 (self : edict_p); cdecl; forward;


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

procedure supertank_search (self : edict_p); cdecl;
begin
  if (_random() < 0.5) then
    gi.sound (self, CHAN_VOICE, sound_search1, 1, ATTN_NORM, 0)
  else
    gi.sound (self, CHAN_VOICE, sound_search2, 1, ATTN_NORM, 0);
end;


//
// stand
//

//mframe_t supertank_frames_stand []=
const
  supertank_frames_stand : array[0..59] 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),
    (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) );
  supertank_move_stand : mmove_t =
    (firstframe: FRAME_stand_1;  lastframe: FRAME_stand_60;  frame: @supertank_frames_stand;  endfunc: Nil);

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


const
  supertank_frames_run : array [0..17] of mframe_t = (
    (aifunc: ai_run;  dist: 12;  thinkfunc: TreadSound),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil),
    (aifunc: ai_run;  dist: 12;  thinkfunc: Nil) );
  supertank_move_run : mmove_t =
    (firstframe: FRAME_forwrd_1;  lastframe: FRAME_forwrd_18;  frame: @supertank_frames_run;  endfunc: Nil);

//
// walk
//

const
  supertank_frames_forward : array [0..17] of mframe_t = (
    (aifunc: ai_walk;  dist: 4;  thinkfunc: TreadSound),
    (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) );
  supertank_move_forward : mmove_t =
    (firstframe: FRAME_forwrd_1;  lastframe: FRAME_forwrd_18;  frame: @supertank_frames_forward; endfunc: Nil);

procedure supertank_forward (self : edict_p);
begin
  self^.monsterinfo.currentmove := @supertank_move_forward;
end;

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

procedure supertank_run (self : edict_p); cdecl;
begin
  if (self^.monsterinfo.aiflags AND AI_STAND_GROUND) <> 0 then
    self^.monsterinfo.currentmove := @supertank_move_stand
  else
    self^.monsterinfo.currentmove := @supertank_move_run;
end;

const
  supertank_frames_turn_right : array [0..17] of mframe_t = (
    (aifunc: ai_move;  dist: 0;  thinkfunc: TreadSound),
    (aifunc: ai_move;  dist: 0;  thinkfunc: Nil),

⌨️ 快捷键说明

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