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

📄 m_parasite.pas

📁 delphi编的不错的贪吃蛇
💻 PAS
📖 第 1 页 / 共 2 页
字号:
{----------------------------------------------------------------------------}
{                                                                            }
{ File(s): m_parasite.c                                                      }
{ Content: actions and effects for parasite villain                          }
{                                                                            }
{ Initial conversion by : Massimo Soricetti (max-67@libero.it)               }
{ Initial conversion on : 09-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:                               }
{ g_local.pas                                                                }
{----------------------------------------------------------------------------}

{
=======================================

parasite

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

unit m_parasite;

interface

uses g_local;

const
  FRAME_break01  =  0;
  FRAME_break02  =  1;
  FRAME_break03  = 2;
  FRAME_break04  = 3;
  FRAME_break05  = 4;
  FRAME_break06  = 5;
  FRAME_break07  = 6;
  FRAME_break08  = 7;
  FRAME_break09  = 8;
  FRAME_break10  = 9;
  FRAME_break11  = 10;
  FRAME_break12  = 11;
  FRAME_break13  = 12;
  FRAME_break14  = 13;
  FRAME_break15  = 14;
  FRAME_break16  = 15;
  FRAME_break17  = 16;
  FRAME_break18  = 17;
  FRAME_break19  = 18;
  FRAME_break20  = 19;
  FRAME_break21  = 20;
  FRAME_break22  = 21;
  FRAME_break23  = 22;
  FRAME_break24  = 23;
  FRAME_break25  = 24;
  FRAME_break26  = 25;
  FRAME_break27  = 26;
  FRAME_break28  = 27;
  FRAME_break29  = 28;
  FRAME_break30  = 29;
  FRAME_break31  = 30;
  FRAME_break32  = 31;
  FRAME_death101 = 32;
  FRAME_death102 = 33;
  FRAME_death103 = 34;
  FRAME_death104 = 35;
  FRAME_death105 = 36;
  FRAME_death106 = 37;
  FRAME_death107 = 38;
  FRAME_drain01  = 39;
  FRAME_drain02  = 40;
  FRAME_drain03  = 41;
  FRAME_drain04  = 42;
  FRAME_drain05  = 43;
  FRAME_drain06  = 44;
  FRAME_drain07  = 45;
  FRAME_drain08  = 46;
  FRAME_drain09  = 47;
  FRAME_drain10  = 48;
  FRAME_drain11  = 49;
  FRAME_drain12  = 50;
  FRAME_drain13  = 51;
  FRAME_drain14  = 52;
  FRAME_drain15  = 53;
  FRAME_drain16  = 54;
  FRAME_drain17  = 55;
  FRAME_drain18  = 56;
  FRAME_pain101  = 57;
  FRAME_pain102  = 58;
  FRAME_pain103  = 59;
  FRAME_pain104  = 60;
  FRAME_pain105  = 61;
  FRAME_pain106  = 62;
  FRAME_pain107  = 63;
  FRAME_pain108  = 64;
  FRAME_pain109  = 65;
  FRAME_pain110  = 66;
  FRAME_pain111  = 67;
  FRAME_run01    = 68;
  FRAME_run02    = 69;
  FRAME_run03    = 70;
  FRAME_run04    = 71;
  FRAME_run05    = 72;
  FRAME_run06    = 73;
  FRAME_run07    = 74;
  FRAME_run08    = 75;
  FRAME_run09    = 76;
  FRAME_run10    = 77;
  FRAME_run11    = 78;
  FRAME_run12    = 79;
  FRAME_run13    = 80;
  FRAME_run14    = 81;
  FRAME_run15    = 82;
  FRAME_stand01  = 83;
  FRAME_stand02  = 84;
  FRAME_stand03  = 85;
  FRAME_stand04  = 86;
  FRAME_stand05  = 87;
  FRAME_stand06  = 88;
  FRAME_stand07  = 89;
  FRAME_stand08  = 90;
  FRAME_stand09  = 91;
  FRAME_stand10  = 92;
  FRAME_stand11  = 93;
  FRAME_stand12  = 94;
  FRAME_stand13  = 95;
  FRAME_stand14  = 96;
  FRAME_stand15  = 97;
  FRAME_stand16  = 98;
  FRAME_stand17  = 99;
  FRAME_stand18  = 100;
  FRAME_stand19  = 101;
  FRAME_stand20  = 102;
  FRAME_stand21  = 103;
  FRAME_stand22  = 104;
  FRAME_stand23  = 105;
  FRAME_stand24  = 106;
  FRAME_stand25  = 107;
  FRAME_stand26  = 108;
  FRAME_stand27  = 109;
  FRAME_stand28  = 110;
  FRAME_stand29  = 111;
  FRAME_stand30  = 112;
  FRAME_stand31  = 113;
  FRAME_stand32  = 114;
  FRAME_stand33  = 115;
  FRAME_stand34  = 116;
  FRAME_stand35  = 117;

  MODEL_SCALE    = 1.000000;

procedure SP_monster_parasite (self: edict_p); cdecl;


implementation

uses g_ai, g_main, q_shared, g_utils, q_shared_add, g_combat, g_local_add,
  GameUnit, g_misc, game_add, g_monster;

procedure parasite_stand (self: edict_p); cdecl; forward;
procedure parasite_start_run (self: edict_p); cdecl; forward;
procedure parasite_run (self: edict_p); cdecl; forward;
procedure parasite_walk (self: edict_p); cdecl; forward;
procedure parasite_start_walk (self: edict_p); cdecl; forward;
procedure parasite_end_fidget (self: edict_p); cdecl; forward;
procedure parasite_do_fidget (self: edict_p); cdecl; forward;
procedure parasite_refidget (self: edict_p); cdecl; forward;
procedure parasite_scratch (self: edict_p);  cdecl; forward;
procedure parasite_tap (self: edict_p); cdecl; forward;
procedure parasite_launch (self: edict_p); cdecl; forward;
procedure parasite_drain_attack (self: edict_p); cdecl; forward;
procedure parasite_reel_in (self: edict_p); cdecl; forward;
procedure parasite_dead (self: edict_p); cdecl; forward;

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

  parasite_move_start_fidget : mmove_t =
        (
        firstframe:FRAME_stand18;
        lastframe:FRAME_stand21;
        frame:@parasite_frames_start_fidget;
        endfunc:parasite_do_fidget
        );

  parasite_frames_fidget : array[0..5] of mframe_t =
        (
	(aifunc:ai_stand; dist : 0; thinkfunc:parasite_scratch),
	(aifunc:ai_stand; dist : 0; thinkfunc:nil),
	(aifunc:ai_stand; dist : 0; thinkfunc:nil),
	(aifunc:ai_stand; dist : 0; thinkfunc:parasite_scratch),
	(aifunc:ai_stand; dist : 0; thinkfunc:nil),
	(aifunc:ai_stand; dist : 0; thinkfunc:nil)
        );

  parasite_move_fidget : mmove_t =
        (
        firstframe:FRAME_stand22;
        lastframe:FRAME_stand27;
        frame:@parasite_frames_fidget;
        endfunc:parasite_refidget
        );

  parasite_frames_end_fidget: array[0..7] of mframe_t=
        (
	(aifunc:ai_stand; dist : 0; thinkfunc:parasite_scratch),
	(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)
        );

  parasite_move_end_fidget : mmove_t =
        (
        firstframe:FRAME_stand28;
        lastframe:FRAME_stand35;
        frame:@parasite_frames_end_fidget;
        endfunc:parasite_stand
        );

  parasite_frames_stand : array[0..16] of mframe_t =
        (
	(aifunc:ai_stand; dist : 0; thinkfunc:nil),
	(aifunc:ai_stand; dist : 0; thinkfunc:nil),
	(aifunc:ai_stand; dist : 0; thinkfunc:parasite_tap),
	(aifunc:ai_stand; dist : 0; thinkfunc:nil),
	(aifunc:ai_stand; dist : 0; thinkfunc:parasite_tap),
	(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:parasite_tap),
	(aifunc:ai_stand; dist : 0; thinkfunc:nil),
	(aifunc:ai_stand; dist : 0; thinkfunc:parasite_tap),
	(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:parasite_tap),
	(aifunc:ai_stand; dist : 0; thinkfunc:nil),
	(aifunc:ai_stand; dist : 0; thinkfunc:parasite_tap)
        );

  parasite_move_stand : mmove_t =
        (
        firstframe:FRAME_stand01;
        lastframe:FRAME_stand17;
        frame:@parasite_frames_stand;
        endfunc:parasite_stand
        );

  parasite_frames_run : array[0..6] of mframe_t =
        (
	(aifunc: ai_run; dist : 30; thinkfunc:nil),
	(aifunc: ai_run; dist : 30; thinkfunc:nil),
	(aifunc: ai_run; dist : 22; thinkfunc:nil),
	(aifunc: ai_run; dist : 19; thinkfunc:nil),
	(aifunc: ai_run; dist : 24; thinkfunc:nil),
	(aifunc: ai_run; dist : 28; thinkfunc:nil),
	(aifunc: ai_run; dist : 25; thinkfunc:nil)
        );

  parasite_move_run: mmove_t =
        (
        firstframe:FRAME_run03;
        lastframe:FRAME_run09;
        frame:@parasite_frames_run;
        endfunc:nil
        );

  parasite_frames_start_run : array[0..1] of mframe_t =
        (
	(aifunc: ai_run; dist : 0; thinkfunc:nil),
	(aifunc: ai_run; dist : 30; thinkfunc:nil)
        );

  parasite_move_start_run : mmove_t =
        (
        firstframe:FRAME_run01;
        lastframe:FRAME_run02;
        frame:@parasite_frames_start_run;
        endfunc:parasite_run
        );

  parasite_frames_stop_run : array [0..5] of mframe_t =
        (
	(aifunc: ai_run; dist : 20; thinkfunc:nil),
  (aifunc: ai_run; dist : 20; thinkfunc:nil),
	(aifunc: ai_run; dist : 12; thinkfunc:nil),
	(aifunc: ai_run; dist : 10; thinkfunc:nil),
	(aifunc: ai_run; dist : 0; thinkfunc:nil),
	(aifunc: ai_run; dist : 0; thinkfunc:nil)
        );

  parasite_move_stop_run : mmove_t =
        (
        firstframe:FRAME_run10;
        lastframe:FRAME_run15;
        frame:@parasite_frames_stop_run;
        endfunc:nil
        );

  parasite_frames_walk : array [0..6] of mframe_t =
        (
	(aifunc: ai_walk; dist : 30; thinkfunc:nil),
	(aifunc: ai_walk; dist : 30; thinkfunc:nil),
	(aifunc: ai_walk; dist : 22; thinkfunc:nil),
	(aifunc: ai_walk; dist : 19; thinkfunc:nil),
	(aifunc: ai_walk; dist : 24; thinkfunc:nil),
	(aifunc: ai_walk; dist : 28; thinkfunc:nil),
	(aifunc: ai_walk; dist : 25; thinkfunc:nil)
        );

  parasite_move_walk : mmove_t =
        (
        firstframe:FRAME_run03;
        lastframe:FRAME_run09;
        frame:@parasite_frames_walk;
        endfunc:parasite_walk
        );

  parasite_frames_start_walk : array [0..1] of mframe_t =
        (
	(aifunc: ai_walk; dist : 0; thinkfunc:nil),
	(aifunc: ai_walk; dist : 30; thinkfunc:parasite_walk)
        );

  parasite_move_start_walk : mmove_t=
        (
        firstframe:FRAME_run01;
        lastframe:FRAME_run02;
        frame:@parasite_frames_start_walk;
        endfunc:nil
        );

  parasite_frames_stop_walk : array [0..5] of mframe_t =
        (
	(aifunc: ai_walk; dist : 20; thinkfunc:nil),
	(aifunc: ai_walk; dist : 20; thinkfunc:nil),
	(aifunc: ai_walk; dist : 12; thinkfunc:nil),
	(aifunc: ai_walk; dist : 10; thinkfunc:nil),
	(aifunc: ai_walk; dist : 0; thinkfunc:nil),
	(aifunc: ai_walk; dist : 0; thinkfunc:nil)
        );

  parasite_move_stop_walk : mmove_t =
        (
        firstframe:FRAME_run10;
        lastframe:FRAME_run15;
        frame:@parasite_frames_stop_walk;
        endfunc:nil
        );

  parasite_frames_pain1 : array[0..10] 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 : 6; thinkfunc:nil),
	(aifunc: ai_move; dist : 16; thinkfunc:nil),
	(aifunc: ai_move; dist :-6; thinkfunc:nil),
	(aifunc: ai_move; dist :-7; thinkfunc:nil),
	(aifunc: ai_move; dist : 0; thinkfunc:nil)
        );

  parasite_move_pain1 : mmove_t =
        (
        firstframe:FRAME_pain101;
        lastframe:FRAME_pain111;
        frame:@parasite_frames_pain1;
        endfunc:parasite_start_run
        );

  parasite_frames_drain : array[0..17] of mframe_t =
        (
	(aifunc: ai_charge; dist : 0; thinkfunc:parasite_launch),
	(aifunc: ai_charge; dist : 0; thinkfunc:nil),
	(aifunc: ai_charge; dist : 15; thinkfunc:parasite_drain_attack),	// Target hits
	(aifunc: ai_charge; dist : 0; thinkfunc:parasite_drain_attack),	// drain

⌨️ 快捷键说明

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