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

📄 m_soldier.pas

📁 delphi编的不错的贪吃蛇
💻 PAS
📖 第 1 页 / 共 5 页
字号:
  FRAME_death206        	= 313;
  FRAME_death207        	= 314;
  FRAME_death208        	= 315;
  FRAME_death209        	= 316;
  FRAME_death210        	= 317;
  FRAME_death211        	= 318;
  FRAME_death212        	= 319;
  FRAME_death213        	= 320;
  FRAME_death214        	= 321;
  FRAME_death215        	= 322;
  FRAME_death216        	= 323;
  FRAME_death217        	= 324;
  FRAME_death218        	= 325;
  FRAME_death219        	= 326;
  FRAME_death220        	= 327;
  FRAME_death221        	= 328;
  FRAME_death222        	= 329;
  FRAME_death223        	= 330;
  FRAME_death224        	= 331;
  FRAME_death225        	= 332;
  FRAME_death226        	= 333;
  FRAME_death227        	= 334;
  FRAME_death228        	= 335;
  FRAME_death229        	= 336;
  FRAME_death230        	= 337;
  FRAME_death231        	= 338;
  FRAME_death232        	= 339;
  FRAME_death233        	= 340;
  FRAME_death234        	= 341;
  FRAME_death235        	= 342;
  FRAME_death301        	= 343;
  FRAME_death302        	= 344;
  FRAME_death303        	= 345;
  FRAME_death304        	= 346;
  FRAME_death305        	= 347;
  FRAME_death306        	= 348;
  FRAME_death307        	= 349;
  FRAME_death308        	= 350;
  FRAME_death309        	= 351;
  FRAME_death310        	= 352;
  FRAME_death311        	= 353;
  FRAME_death312        	= 354;
  FRAME_death313        	= 355;
  FRAME_death314        	= 356;
  FRAME_death315        	= 357;
  FRAME_death316        	= 358;
  FRAME_death317        	= 359;
  FRAME_death318        	= 360;
  FRAME_death319        	= 361;
  FRAME_death320        	= 362;
  FRAME_death321        	= 363;
  FRAME_death322        	= 364;
  FRAME_death323        	= 365;
  FRAME_death324        	= 366;
  FRAME_death325        	= 367;
  FRAME_death326        	= 368;
  FRAME_death327        	= 369;
  FRAME_death328        	= 370;
  FRAME_death329        	= 371;
  FRAME_death330        	= 372;
  FRAME_death331        	= 373;
  FRAME_death332        	= 374;
  FRAME_death333        	= 375;
  FRAME_death334        	= 376;
  FRAME_death335        	= 377;
  FRAME_death336        	= 378;
  FRAME_death337        	= 379;
  FRAME_death338        	= 380;
  FRAME_death339        	= 381;
  FRAME_death340        	= 382;
  FRAME_death341        	= 383;
  FRAME_death342        	= 384;
  FRAME_death343        	= 385;
  FRAME_death344        	= 386;
  FRAME_death345        	= 387;
  FRAME_death401        	= 388;
  FRAME_death402        	= 389;
  FRAME_death403        	= 390;
  FRAME_death404        	= 391;
  FRAME_death405        	= 392;
  FRAME_death406        	= 393;
  FRAME_death407        	= 394;
  FRAME_death408        	= 395;
  FRAME_death409        	= 396;
  FRAME_death410        	= 397;
  FRAME_death411        	= 398;
  FRAME_death412        	= 399;
  FRAME_death413        	= 400;
  FRAME_death414        	= 401;
  FRAME_death415        	= 402;
  FRAME_death416        	= 403;
  FRAME_death417        	= 404;
  FRAME_death418        	= 405;
  FRAME_death419        	= 406;
  FRAME_death420        	= 407;
  FRAME_death421        	= 408;
  FRAME_death422        	= 409;
  FRAME_death423        	= 410;
  FRAME_death424        	= 411;
  FRAME_death425        	= 412;
  FRAME_death426        	= 413;
  FRAME_death427        	= 414;
  FRAME_death428        	= 415;
  FRAME_death429        	= 416;
  FRAME_death430        	= 417;
  FRAME_death431        	= 418;
  FRAME_death432        	= 419;
  FRAME_death433        	= 420;
  FRAME_death434        	= 421;
  FRAME_death435        	= 422;
  FRAME_death436        	= 423;
  FRAME_death437        	= 424;
  FRAME_death438        	= 425;
  FRAME_death439        	= 426;
  FRAME_death440        	= 427;
  FRAME_death441        	= 428;
  FRAME_death442        	= 429;
  FRAME_death443        	= 430;
  FRAME_death444        	= 431;
  FRAME_death445        	= 432;
  FRAME_death446        	= 433;
  FRAME_death447        	= 434;
  FRAME_death448        	= 435;
  FRAME_death449        	= 436;
  FRAME_death450        	= 437;
  FRAME_death451        	= 438;
  FRAME_death452        	= 439;
  FRAME_death453        	= 440;
  FRAME_death501        	= 441;
  FRAME_death502        	= 442;
  FRAME_death503        	= 443;
  FRAME_death504        	= 444;
  FRAME_death505        	= 445;
  FRAME_death506        	= 446;
  FRAME_death507        	= 447;
  FRAME_death508        	= 448;
  FRAME_death509        	= 449;
  FRAME_death510        	= 450;
  FRAME_death511        	= 451;
  FRAME_death512        	= 452;
  FRAME_death513        	= 453;
  FRAME_death514        	= 454;
  FRAME_death515        	= 455;
  FRAME_death516        	= 456;
  FRAME_death517        	= 457;
  FRAME_death518        	= 458;
  FRAME_death519        	= 459;
  FRAME_death520        	= 460;
  FRAME_death521        	= 461;
  FRAME_death522        	= 462;
  FRAME_death523        	= 463;
  FRAME_death524        	= 464;
  FRAME_death601        	= 465;
  FRAME_death602        	= 466;
  FRAME_death603        	= 467;
  FRAME_death604        	= 468;
  FRAME_death605        	= 469;
  FRAME_death606        	= 470;
  FRAME_death607        	= 471;
  FRAME_death608        	= 472;
  FRAME_death609        	= 473;
  FRAME_death610        	= 474;

var
  sound_idle,
  sound_sight1,
  sound_sight2,
  sound_pain_light,
  sound_pain,
  sound_pain_ss,
  sound_death_light,
  sound_death,
  sound_death_ss,
  sound_cock           : Integer;

procedure soldier_idle(self : edict_p); cdecl;
procedure soldier_cock(self : edict_p); cdecl;
procedure soldier_stand(self : edict_p); cdecl;
procedure soldier_walk1_random(self : edict_p); cdecl;
procedure soldier_walk(self : edict_p); cdecl;
procedure soldier_run(self : edict_p); cdecl;
procedure soldier_pain (self, other : edict_p; kick : single; damage : integer); cdecl;
procedure soldier_fire(self : edict_p; flash_number : integer); cdecl;
procedure soldier_fire1(self : edict_p); cdecl;
procedure soldier_attack1_refire1(self : edict_p); cdecl;
procedure soldier_attack1_refire2(self : edict_p); cdecl;
procedure soldier_fire2(self : edict_p); cdecl;
procedure soldier_attack2_refire1(self : edict_p); cdecl;
procedure soldier_attack2_refire2(self : edict_p); cdecl;
procedure soldier_duck_down(self : edict_p); cdecl;
procedure soldier_duck_up(self : edict_p); cdecl;
procedure soldier_fire3(self : edict_p); cdecl;
procedure soldier_attack3_refire(self : edict_p); cdecl;
procedure soldier_fire4(self : edict_p); cdecl;
(*
procedure soldier_fire5(self : edict_p); cdecl;
procedure soldier_attack5_refire(self : edict_p); cdecl;
*)
procedure soldier_fire8(self : edict_p); cdecl;
procedure soldier_attack6_refire(self : edict_p); cdecl;
procedure soldier_attack(self : edict_p); cdecl;
procedure soldier_sight(self, other : edict_p); cdecl;
procedure soldier_duck_hold(self : edict_p); cdecl;
procedure soldier_dodge(self, attacker : edict_p; eta : single); cdecl;
procedure soldier_fire6(self : edict_p); cdecl;
procedure soldier_fire7(self : edict_p); cdecl;
procedure soldier_dead(self : edict_p); cdecl;
procedure soldier_die(self, inflictor, attacker : edict_p; damage : integer; const point : vec3_t); cdecl;

procedure SP_monster_soldier_x(self : edict_p); cdecl;
procedure SP_monster_soldier_light(self : edict_p); cdecl;
procedure SP_monster_soldier(self : edict_p); cdecl;
procedure SP_monster_soldier_ss(self : edict_p); cdecl;

implementation

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

procedure soldier_idle(self : edict_p);
begin
  if _random() > 0.8 then
    gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
end;

procedure soldier_cock(self : edict_p);
begin
  if self.s.frame = FRAME_stand322 then
    gi.sound(self, CHAN_WEAPON, sound_cock, 1, ATTN_IDLE, 0)
  else
    gi.sound(self, CHAN_WEAPON, sound_cock, 1, ATTN_NORM, 0);
end;


// STAND

const
  soldier_frames_stand1 : Array[0..29] of mframe_t =
    ((aifunc:ai_stand; dist:0; thinkfunc:soldier_idle),
     (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));

  soldier_move_stand1 : mmove_t =
    (firstframe:FRAME_stand101; lastframe:FRAME_stand130; frame:@soldier_frames_stand1; endfunc:soldier_stand);

  soldier_frames_stand3 : Array[0..38] 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:soldier_cock),
     (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));

  soldier_move_stand3 : mmove_t =
    (firstframe:FRAME_stand301; lastframe:FRAME_stand339; frame:@soldier_frames_stand3; endfunc:soldier_stand);


{$IF false}
  soldier_frames_stand4 : Array[0..51] 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),

⌨️ 快捷键说明

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