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

📄 m_boss32.inc

📁 雷神之锤2(Quake2)Delphi源码
💻 INC
📖 第 1 页 / 共 3 页
字号:
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),		        // 10
     (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:11;  thinkfunc:nil),
     (aifunc:ai_move; dist:12;  thinkfunc:nil),
     (aifunc:ai_move; dist:11;  thinkfunc:makron_step_right),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),		        // 20
     (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:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),		        // 30
     (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:5;   thinkfunc:nil),
     (aifunc:ai_move; dist:7;   thinkfunc:nil),
     (aifunc:ai_move; dist:6;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:-1;  thinkfunc:nil),
     (aifunc:ai_move; dist:2;   thinkfunc:nil),		        // 40
     (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:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),		        // 50
     (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:-4;  thinkfunc:nil),
     (aifunc:ai_move; dist:-6;  thinkfunc:makron_step_right),
     (aifunc:ai_move; dist:-4;  thinkfunc:nil),
     (aifunc:ai_move; dist:-4;  thinkfunc:makron_step_left),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),		        // 60
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:-2;  thinkfunc:nil),
     (aifunc:ai_move; dist:-5;  thinkfunc:nil),
     (aifunc:ai_move; dist:-3;  thinkfunc:makron_step_right),
     (aifunc:ai_move; dist:-8;  thinkfunc:nil),
     (aifunc:ai_move; dist:-3;  thinkfunc:makron_step_left),
     (aifunc:ai_move; dist:-7;  thinkfunc:nil),
     (aifunc:ai_move; dist:-4;  thinkfunc:nil),
     (aifunc:ai_move; dist:-4;  thinkfunc:makron_step_right),   // 70
     (aifunc:ai_move; dist:-6;  thinkfunc:nil),
     (aifunc:ai_move; dist:-7;  thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:makron_step_left),
     (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:0;   thinkfunc:nil),		        // 80
     (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:-2;  thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:2;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),		        // 90
     (aifunc:ai_move; dist:27;  thinkfunc:makron_hit),
     (aifunc:ai_move; dist:26;  thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:makron_brainsplorch),
     (aifunc:ai_move; dist:0;   thinkfunc:nil),
     (aifunc:ai_move; dist:0;   thinkfunc:nil));		// 95

  makron_move_death2 : mmove_t =
    (firstframe:FRAME_death201; lastframe:FRAME_death295; frame:makron_frames_death2; endfunc:makron_dead);

  makron_frames_death3 : Array[0..19] 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: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: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:0; thinkfunc:nil),
     (aifunc:ai_move; dist:0; thinkfunc:nil));

  makron_move_death3 : mmove_t =
    (firstframe:FRAME_death301; lastframe:FRAME_death320; frame:makron_frames_death3; endfunc:nil);

  makron_frames_sight : Array[0..12] 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: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:0; thinkfunc:nil));

  makron_move_sight : mmove_t =
    (firstframe:FRAME_active01; lastframe:FRAME_active13; frame:makron_frames_sight; endfunc:makron_run);

procedure makronBFG(self : edict_t);
var
  fwrd, right : vec3_t;
  start       : vec3_t;
  dir         : vec3_t;
  vec         : vec3_t;
begin
  AngleVectors(self.s.angles, fwrd, right, nil);
  G_ProjectSource(self.s.origin, monster_flash_offset[MZ2_MAKRON_BFG], fwrd, right, start);
  VectorCopy(self.enemy.s.origin, vec);
  vec[2] := vec[2] + self.enemy.viewheight;
  VectorSubtract(vec, start, dir);
  VectorNormalize(dir);
  gi.sound(self, CHAN_VOICE, sound_attack_bfg, 1, ATTN_NORM, 0);
  monster_fire_bfg(self, start, dir, 50, 300, 100, 300, MZ2_MAKRON_BFG);
end;

const
  makron_frames_attack3 : Array[0..7] of mframe_t =
    ((aifunc:ai_charge; dist:0; thinkfunc:nil),
     (aifunc:ai_charge; dist:0; thinkfunc:nil),
     (aifunc:ai_charge; dist:0; thinkfunc:nil),
     (aifunc:ai_charge; dist:0; thinkfunc:makronBFG),	 // FIXME: BFG Attack here
     (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));

  makron_move_attack3 : mmove_t =
    (firstframe:FRAME_attak301; lastframe:FRAME_attak308; frame:makron_frames_attack3; endfunc:makron_run);

  makron_frames_attack4 : Array[0..25] of mframe_t =
    ((aifunc:ai_charge; dist:0; thinkfunc:nil),
     (aifunc:ai_charge; dist:0; thinkfunc:nil),
     (aifunc:ai_charge; dist:0; thinkfunc:nil),
     (aifunc:ai_charge; dist:0; thinkfunc:nil),
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (aifunc:ai_move;   dist:0; thinkfunc:MakronHyperblaster),		// fire
     (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));

  makron_move_attack4 : mmove_t =
    (firstframe:FRAME_attak401; lastframe:FRAME_attak426; frame:makron_frames_attack4; endfunc:makron_run);

  makron_frames_attack5 : Array[0..15] of mframe_t =
    ((aifunc:ai_charge; dist:0; thinkfunc:makron_prerailgun),
     (aifunc:ai_charge; dist:0; thinkfunc:nil),
     (aifunc:ai_charge; dist:0; thinkfunc:nil),
     (aifunc:ai_charge; dist:0; thinkfunc:nil),
     (aifunc:ai_charge; dist:0; thinkfunc:nil),
     (aifunc:ai_charge; dist:0; thinkfunc:nil),
     (aifunc:ai_charge; dist:0; thinkfunc:nil),
     (aifunc:ai_charge; dist:0; thinkfunc:MakronSaveloc),
     (aifunc:ai_move;   dist:0; thinkfunc:MakronRailgun),    // Fire railgun
     (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:0; thinkfunc:nil));

  makron_move_attack5 : mmove_t =
    (firstframe:FRAME_attak501; lastframe:FRAME_attak516; frame:makron_frames_attack5; endfunc:makron_run);

procedure MakronSaveloc(self : edict_t);
begin
  VectorCopy(self.enemy.s.origin, self.pos1);	//save for aiming the shot
  self.pos1[2] := self.pos1[2] + self.enemy.viewheight;
end;

// FIXME: He's not firing from the proper Z
procedure MakronRailgun(self : edict_t);
var
  start       : vec3_t;
  dir         : vec3_t;
  fwrd, right : vec3_t;
begin
  AngleVectors(self.s.angles, fwrd, right, nil);
  G_ProjectSource(self.s.origin, monster_flash_offset[MZ2_MAKRON_RAILGUN_1], fwrd, right, start);
	
  // calc direction to where we targted
  VectorSubtract(self.pos1, start, dir);
  VectorNormalize(dir);

  monster_fire_railgun(self, start, dir, 50, 100, MZ2_MAKRON_RAILGUN_1);
end;

// FIXME: This is all wrong. He's not firing at the proper angles.
procedure MakronHyperblaster(self : edict_t);
var
  dir          : vec3_t;
  vec          : vec3_t;
  start        : vec3_t;
  fwrd, right  : vec3_t;
  flash_number : integer;
begin
  flash_number := MZ2_MAKRON_BLASTER_1 + (self.s.frame - FRAME_attak405);

  AngleVectors(self.s.angles, fwrd, right, nil);
  G_ProjectSource(self.s.origin, monster_flash_offset[flash_number], fwrd, right, start);

  if (self.enemy <> nil) then
  begin
    VectorCopy(self.enemy.s.origin, vec);
    vec[2] := vec[2] + self.enemy.viewheight;
    VectorSubtract(vec, start, vec);
    vectoangles(vec, vec);
    dir[0] := vec[0];
  end
  else
    dir[0] = 0;

  if self.s.frame <= FRAME_attak413 then
    dir[1] := self.s.angles[1] - 10 * (self.s.frame - FRAME_attak413);
  else
    dir[1] := self.s.angles[1] + 10 * (self.s.frame - FRAME_attak421);

  dir[2] := 0;

  AngleVectors(dir, fwrd, nil, nil);

  monster_fire_blaster(self, start, fwrd, 15, 1000, MZ2_MAKRON_BLASTER_1, EF_BLASTER);
end;

procedure makron_pain(self, other : edict_t; kick : single; damage : integer);
begin
  if (self.health < (self.max_health / 2)) then
    self.s.skinnum := 1;

  if (level.time < self.pain_debounce_time) then
    exit;

  // Lessen the chance of him going into his pain frames
  if damage <=25 then
  begin
    if (random()<0.2) then
      exit;
  end;

  self.pain_debounce_time := level.time + 3;
  if (skill.value = 3) then
    exit;		// no pain anims in nightmare


  if (damage <= 40) then
  begin
    gi.sound(self, CHAN_VOICE, sound_pain4, 1, ATTN_NONE,0);
    self.monsterinfo.currentmove := makron_move_pain4;
  end
  else
  if (damage <= 110) then
  begin
    gi.sound(self, CHAN_VOICE, sound_pain5, 1, ATTN_NONE,0);
    self.monsterinfo.currentmove := makron_move_pain5;
  end
  else
  begin
    if (damage <= 150) then
    begin
      if (random() <= 0.45) then
      begin
        gi.sound (self, CHAN_VOICE, sound_pain6, 1, ATTN_NONE,0);
        self.monsterinfo.currentmove := makron_move_pain6;
      end

⌨️ 快捷键说明

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