/*
* 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.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
/* Modifications
Copyright 2003-2004 Bytonic Software
Copyright 2010 Google Inc.
*/
package com.googlecode.gwtquake.shared.game.monsters;
import com.googlecode.gwtquake.shared.common.Constants;
import com.googlecode.gwtquake.shared.game.*;
import com.googlecode.gwtquake.shared.game.adapters.EntityDieAdapter;
import com.googlecode.gwtquake.shared.game.adapters.EntityThinkAdapter;
import com.googlecode.gwtquake.shared.game.adapters.EntityPainAdapter;
import com.googlecode.gwtquake.shared.server.ServerGame;
import com.googlecode.gwtquake.shared.server.ServerInit;
import com.googlecode.gwtquake.shared.server.World;
import com.googlecode.gwtquake.shared.util.Lib;
import com.googlecode.gwtquake.shared.util.Math3D;
public class MonsterInsane {
// This file generated by ModelGen - Do NOT Modify
public final static int FRAME_stand1 = 0;
public final static int FRAME_stand2 = 1;
public final static int FRAME_stand3 = 2;
public final static int FRAME_stand4 = 3;
public final static int FRAME_stand5 = 4;
public final static int FRAME_stand6 = 5;
public final static int FRAME_stand7 = 6;
public final static int FRAME_stand8 = 7;
public final static int FRAME_stand9 = 8;
public final static int FRAME_stand10 = 9;
public final static int FRAME_stand11 = 10;
public final static int FRAME_stand12 = 11;
public final static int FRAME_stand13 = 12;
public final static int FRAME_stand14 = 13;
public final static int FRAME_stand15 = 14;
public final static int FRAME_stand16 = 15;
public final static int FRAME_stand17 = 16;
public final static int FRAME_stand18 = 17;
public final static int FRAME_stand19 = 18;
public final static int FRAME_stand20 = 19;
public final static int FRAME_stand21 = 20;
public final static int FRAME_stand22 = 21;
public final static int FRAME_stand23 = 22;
public final static int FRAME_stand24 = 23;
public final static int FRAME_stand25 = 24;
public final static int FRAME_stand26 = 25;
public final static int FRAME_stand27 = 26;
public final static int FRAME_stand28 = 27;
public final static int FRAME_stand29 = 28;
public final static int FRAME_stand30 = 29;
public final static int FRAME_stand31 = 30;
public final static int FRAME_stand32 = 31;
public final static int FRAME_stand33 = 32;
public final static int FRAME_stand34 = 33;
public final static int FRAME_stand35 = 34;
public final static int FRAME_stand36 = 35;
public final static int FRAME_stand37 = 36;
public final static int FRAME_stand38 = 37;
public final static int FRAME_stand39 = 38;
public final static int FRAME_stand40 = 39;
public final static int FRAME_stand41 = 40;
public final static int FRAME_stand42 = 41;
public final static int FRAME_stand43 = 42;
public final static int FRAME_stand44 = 43;
public final static int FRAME_stand45 = 44;
public final static int FRAME_stand46 = 45;
public final static int FRAME_stand47 = 46;
public final static int FRAME_stand48 = 47;
public final static int FRAME_stand49 = 48;
public final static int FRAME_stand50 = 49;
public final static int FRAME_stand51 = 50;
public final static int FRAME_stand52 = 51;
public final static int FRAME_stand53 = 52;
public final static int FRAME_stand54 = 53;
public final static int FRAME_stand55 = 54;
public final static int FRAME_stand56 = 55;
public final static int FRAME_stand57 = 56;
public final static int FRAME_stand58 = 57;
public final static int FRAME_stand59 = 58;
public final static int FRAME_stand60 = 59;
public final static int FRAME_stand61 = 60;
public final static int FRAME_stand62 = 61;
public final static int FRAME_stand63 = 62;
public final static int FRAME_stand64 = 63;
public final static int FRAME_stand65 = 64;
public final static int FRAME_stand66 = 65;
public final static int FRAME_stand67 = 66;
public final static int FRAME_stand68 = 67;
public final static int FRAME_stand69 = 68;
public final static int FRAME_stand70 = 69;
public final static int FRAME_stand71 = 70;
public final static int FRAME_stand72 = 71;
public final static int FRAME_stand73 = 72;
public final static int FRAME_stand74 = 73;
public final static int FRAME_stand75 = 74;
public final static int FRAME_stand76 = 75;
public final static int FRAME_stand77 = 76;
public final static int FRAME_stand78 = 77;
public final static int FRAME_stand79 = 78;
public final static int FRAME_stand80 = 79;
public final static int FRAME_stand81 = 80;
public final static int FRAME_stand82 = 81;
public final static int FRAME_stand83 = 82;
public final static int FRAME_stand84 = 83;
public final static int FRAME_stand85 = 84;
public final static int FRAME_stand86 = 85;
public final static int FRAME_stand87 = 86;
public final static int FRAME_stand88 = 87;
public final static int FRAME_stand89 = 88;
public final static int FRAME_stand90 = 89;
public final static int FRAME_stand91 = 90;
public final static int FRAME_stand92 = 91;
public final static int FRAME_stand93 = 92;
public final static int FRAME_stand94 = 93;
public final static int FRAME_stand95 = 94;
public final static int FRAME_stand96 = 95;
public final static int FRAME_stand97 = 96;
public final static int FRAME_stand98 = 97;
public final static int FRAME_stand99 = 98;
public final static int FRAME_stand100 = 99;
public final static int FRAME_stand101 = 100;
public final static int FRAME_stand102 = 101;
public final static int FRAME_stand103 = 102;
public final static int FRAME_stand104 = 103;
public final static int FRAME_stand105 = 104;
public final static int FRAME_stand106 = 105;
public final static int FRAME_stand107 = 106;
public final static int FRAME_stand108 = 107;
public final static int FRAME_stand109 = 108;
public final static int FRAME_stand110 = 109;
public final static int FRAME_stand111 = 110;
public final static int FRAME_stand112 = 111;
public final static int FRAME_stand113 = 112;
public final static int FRAME_stand114 = 113;
public final static int FRAME_stand115 = 114;
public final static int FRAME_stand116 = 115;
public final static int FRAME_stand117 = 116;
public final static int FRAME_stand118 = 117;
public final static int FRAME_stand119 = 118;
public final static int FRAME_stand120 = 119;
public final static int FRAME_stand121 = 120;
public final static int FRAME_stand122 = 121;
public final static int FRAME_stand123 = 122;
public final static int FRAME_stand124 = 123;
public final static int FRAME_stand125 = 124;
public final static int FRAME_stand126 = 125;
public final static int FRAME_stand127 = 126;
public final static int FRAME_stand128 = 127;
public final static int FRAME_stand129 = 128;
public final static int FRAME_stand130 = 129;
public final static int FRAME_stand131 = 130;
public final static int FRAME_stand132 = 131;
public final static int FRAME_stand133 = 132;
public final static int FRAME_stand134 = 133;
public final static int FRAME_stand135 = 134;
public final static int FRAME_stand136 = 135;
public final static int FRAME_stand137 = 136;
public final static int FRAME_stand138 = 137;
public final static int FRAME_stand139 = 138;
public final static int FRAME_stand140 = 139;
public final static int FRAME_stand141 = 140;
public final static int FRAME_stand142 = 141;
public final static int FRAME_stand143 = 142;
public final static int FRAME_stand144 = 143;
public final static int FRAME_stand145 = 144;
public final static int FRAME_stand146 = 145;
public final static int FRAME_stand147 = 146;
public final static int FRAME_stand148 = 147;
public final static int FRAME_stand149 = 148;
public final static int FRAME_stand150 = 149;
public final static int FRAME_stand151 = 150;
public final static int FRAME_stand152 = 151;
public final static int FRAME_stand153 = 152;
public final static int FRAME_stand154 = 153;
public final static int FRAME_stand155 = 154;
public final static int FRAME_stand156 = 155;
public final static int FRAME_stand157 = 156;
public final static int FRAME_stand158 = 157;
public final static int FRAME_stand159 = 158;
public final static int FRAME_stand160 = 159;
public final static int FRAME_walk27 = 160;
public final static int FRAME_walk28 = 161;
public final static int FRAME_walk29 = 162;
public final static int FRAME_walk30 = 163;
public final static int FRAME_walk31 = 164;
public final static int FRAME_walk32 = 165;
public final static int FRAME_walk33 = 166;
public final static int FRAME_walk34 = 167;
public final static int FRAME_walk35 = 168;
public final static int FRAME_walk36 = 169;
public final static int FRAME_walk37 = 170;
public final static int FRAME_walk38 = 171;
public final static int FRAME_walk39 = 172;
public final static int FRAME_walk1 = 173;
public final static int FRAME_walk2 = 174;
public final static int FRAME_walk3 = 175;
public final static int FRAME_walk4 = 176;
public final static int FRAME_walk5 = 177;
public final static int FRAME_walk6 = 178;
public final static int FRAME_walk7 = 179;
public final static int FRAME_walk8 = 180;
public final static int FRAME_walk9 = 181;
public final static int FRAME_walk10 = 182;
public final static int FRAME_walk11 = 183;
public final static int FRAME_walk12 = 184;
public final static int FRAME_walk13 = 185;
public final static int FRAME_walk14 = 186;
public final static int FRAME_walk15 = 187;
public final static int FRAME_walk16 = 188;
public final static int FRAME_walk17 = 189;
public final static int FRAME_walk18 = 190;
public final static int FRAME_walk19 = 191;
public final static int FRAME_walk20 = 192;
public final static int FRAME_walk21 = 193;
public final static int FRAME_walk22 = 194;
public final static int FRAME_walk23 = 195;
public final static int FRAME_walk24 = 196;
public final static int FRAME_walk25 = 197;
public final static int FRAME_walk26 = 198;
public final static int FRAME_st_pain2 = 199;
public final static int FRAME_st_pain3 = 200;
public final static int FRAME_st_pain4 = 201;
public final static int FRAME_st_pain5 = 202;
public final static int FRAME_st_pain6 = 203;
public final static int FRAME_st_pain7 = 204;
public final static int FRAME_st_pain8 = 205;
public final static int FRAME_st_pain9 = 206;
public final static int FRAME_st_pain10 = 207;
public final static int FRAME_st_pain11 = 208;
public final static int FRAME_st_pain12 = 209;
public final static int FRAME_st_death2 = 210;
public final static int FRAME_st_death3 = 211;
public final static int FRAME_st_death4 = 212;
public final static int FRAME_st_death5 = 213;
public final static int FRAME_st_death6 = 214;
public final static int FRAME_st_death7 = 215;
public final static int FRAME_st_death8 = 216;
public final static int FRAME_st_death9 = 217;
public final static int FRAME_st_death10 = 218;
public final static int FRAME_st_death11 = 219;
public final static int FRAME_st_death12 = 220;
public final static int FRAME_st_death13 = 221;
public final static int FRAME_st_death14 = 222;
public final static int FRAME_st_death15 = 223;
public final static int FRAME_st_death16 = 224;
public final static int FRAME_st_death17 = 225;
public final static int FRAME_st_death18 = 226;
public final static int FRAME_crawl1 = 227;
public final static int FRAME_crawl2 = 228;
public final static int FRAME_crawl3 = 229;
public final static int FRAME_crawl4 = 230;
public final static int FRAME_crawl5 = 231;
public final static int FRAME_crawl6 = 232;
public final static int FRAME_crawl7 = 233;
public final static int FRAME_crawl8 = 234;
public final static int FRAME_crawl9 = 235;
public final static int FRAME_cr_pain2 = 236;
public final static int FRAME_cr_pain3 = 237;
public final static int FRAME_cr_pain4 = 238;
public final static int FRAME_cr_pain5 = 239;
public final static int FRAME_cr_pain6 = 240;
public final static int FRAME_cr_pain7 = 241;
public final static int FRAME_cr_pain8 = 242;
public final static int FRAME_cr_pain9 = 243;
public final static int FRAME_cr_pain10 = 244;
public final static int FRAME_cr_death10 = 245;
public final static int FRAME_cr_death11 = 246;
public final static int FRAME_cr_death12 = 247;
public final static int FRAME_cr_death13 = 248;
public final static int FRAME_cr_death14 = 249;
public final static int FRAME_cr_death15 = 250;
public final static int FRAME_cr_death16 = 251;
public final static int FRAME_cross1 = 252;
public final static int FRAME_cross2 = 253;
public final static int FRAME_cross3 = 254;
public final static int FRAME_cross4 = 255;
public final static int FRAME_cross5 = 256;
public final static int FRAME_cross6 = 257;
public final static int FRAME_cross7 = 258;
public final static int FRAME_cross8 = 259;
public final static int FRAME_cross9 = 260;
public final static int FRAME_cross10 = 261;
public final static int FRAME_cross11 = 262;
public final static int FRAME_cross12 = 263;
public final static int FRAME_cross13 = 264;
public final static int FRAME_cross14 = 265;
public final static int FRAME_cross15 = 266;
public final static int FRAME_cross16 = 267;
public final static int FRAME_cross17 = 268;
public final static int FRAME_cross18 = 269;
public final static int FRAME_cross19 = 270;
public final static int FRAME_cross20 = 271;
public final static int FRAME_cross21 = 272;
public final static int FRAME_cross22 = 273;
public final static int FRAME_cross23 = 274;
public final static int FRAME_cross24 = 275;
public final static int FRAME_cross25 = 276;
public final static int FRAME_cross26 = 277;
public final static int FRAME_cross27 = 278;
public final static int FRAME_cross28 = 279;
public final static int FRAME_cross29 = 280;
public final static int FRAME_cross30 = 281;
public final static float MODEL_SCALE = 1.000000f;
static int sound_fist;
static int sound_shake;
static int sound_moan;
static int sound_scream[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
static EntityThinkAdapter insane_fist = new EntityThinkAdapter() {
public String getID() { return "insane_fist"; }
public boolean think(Entity self) {
ServerGame.PF_StartSound(self, Constants.CHAN_VOICE, sound_fist, (float) 1, (float) Constants.ATTN_IDLE,
(float) 0);
return true;
}
};
static EntityThinkAdapter insane_shake = new EntityThinkAdapter() {
public String getID() { return "insane_shake"; }
public boolean think(Entity self) {
ServerGame.PF_StartSound(self, Constants.CHAN_VOICE, sound_shake, (float) 1, (float) Constants.ATTN_IDLE,
(float) 0);
return true;
}
};
static EntityThinkAdapter insane_moan = new EntityThinkAdapter() {
public String getID() { return "insane_moan"; }
public boolean think(Entity self) {
ServerGame.PF_StartSound(self, Constants.CHAN_VOICE, sound_moan, (float) 1, (float) Constants.ATTN_IDLE,
(float) 0);
return true;
}
};
static EntityThinkAdapter insane_scream = new EntityThinkAdapter() {
public String getID() { return "insane_scream"; }
public boolean think(Entity self) {
ServerGame.PF_StartSound(self, Constants.CHAN_VOICE, sound_scream[Lib.rand() % 8], (float) 1, (float) Constants.ATTN_IDLE,
(float) 0);
return true;
}
};
static EntityThinkAdapter insane_cross = new EntityThinkAdapter() {
public String getID() { return "insane_cross"; }
public boolean think(Entity self) {
if (Lib.random() < 0.8)
self.monsterinfo.currentmove = insane_move_cross;
else
self.monsterinfo.currentmove = insane_move_struggle_cross;
return true;
}
};
static EntityThinkAdapter insane_walk = new EntityThinkAdapter() {
public String getID() { return "insane_walk"; }
public boolean think(Entity self) {
if ((self.spawnflags & 16) != 0) // Hold Ground?
if (self.s.frame == FRAME_cr_pain10) {
self.monsterinfo.currentmove = insane_move_down;
return true;
}
if ((self.spawnflags & 4) != 0)
self.monsterinfo.currentmove = insane_move_crawl;
else if (Lib.random() <= 0.5)
self.monsterinfo.currentmove = insane_move_walk_normal;
else
self.monsterinfo.currentmove = insane_move_walk_insane;
return true;
}
};
static EntityThinkAdapter insane_run = new EntityThinkAdapter() {
public String getID() { return "insane_run"; }
public boolean think(Entity self) {
if ((self.spawnflags & 16) != 0) // Hold Ground?
if (self.s.frame == FRAME_cr_pain10) {
self.monsterinfo.currentmove = insane_move_down;
return true;
}
if ((self.spawnflags & 4) != 0) // Crawling?
self.monsterinfo.currentmove = insane_move_runcrawl;
else if (Lib.random() <= 0.5) // Else, mix it up
self.monsterinfo.currentmove = insane_move_run_normal;
else
self.monsterinfo.currentmove = insane_move_run_insane;
return true;
}
};
static EntityPainAdapter insane_pain = new EntityPainAdapter() {
public String getID() { return "insane_pain"; }
public void pain(Entity self, Entity other, float kick, int damage) {
int l, r;
// if (self.health < (self.max_health / 2))
// self.s.skinnum = 1;
if (GameBase.level.time < self.pain_debounce_time)
return;
self.pain_debounce_time = GameBase.level.time + 3;
r = 1 + (Lib.rand() & 1);
if (self.health < 25)
l = 25;
else if (self.health < 50)
l = 50;
else if (self.health < 75)
l = 75;
else
l = 100;
ServerGame.PF_StartSound(self, Constants.CHAN_VOICE, ServerInit.SV_SoundIndex("player/male/pain" + l + "_" + r + ".wav"), (float) 1, (float) Constants.ATTN_IDLE,
(float) 0);
if (GameBase.skill.value == 3)
return; // no pain anims in nightmare
// Don't go into pain frames if crucified.
if ((self.spawnflags & 8) != 0) {
self.monsterinfo.currentmove = insane_move_struggle_cross;
return;
}
if (((self.s.frame >= FRAME_crawl1) && (self.s.frame <= FRAME_crawl9))
|| ((self.s.frame >= FRAME_stand99) && (self.s.frame <= FRAME_stand160))) {
self.monsterinfo.currentmove = insane_move_crawl_pain;
} else
self.monsterinfo.currentmove = insane_move_stand_pain;
}
};
static EntityThinkAdapter insane_onground = new EntityThinkAdapter() {
public String getID() { return "insane_onground"; }
public boolean think(Entity self) {
self.monsterinfo.currentmove = insane_move_down;
return true;
}
};
static EntityThinkAdapter insane_checkdown = new EntityThinkAdapter() {
public String getID() { return "insane_checkdown"; }
public boolean think(Entity self) {
// if ( (self.s.frame == FRAME_stand94) || (self.s.frame ==
// FRAME_stand65) )
if ((self.spawnflags & 32) != 0) // Always stand
return true;
if (Lib.random() < 0.3)
if (Lib.random() < 0.5)
self.monsterinfo.currentmove = insane_move_uptodown;
else
self.monsterinfo.currentmove = insane_move_jumpdown;
return true;
}
};
static EntityThinkAdapter insane_checkup = new EntityThinkAdapter() {
public String getID() { return "insane_checkup"; }
public boolean think(Entity self) {
// If Hold_Ground and Crawl are set
if ((self.spawnflags & 4) != 0 && (self.spawnflags & 16) != 0)
return true;
if (Lib.random() < 0.5)
self.monsterinfo.currentmove = insane_move_downtoup;
return true;
}
};
static EntityThinkAdapter insane_stand = new EntityThinkAdapter() {
public String getID() { return "insane_stand"; }
public boolean think(Entity self) {
if ((self.spawnflags & 8) != 0) // If crucified
{
self.monsterinfo.currentmove = insane_move_cross;
self.monsterinfo.aiflags |= Constants.AI_STAND_GROUND;
}
// If Hold_Ground and Crawl are set
else if ((self.spawnflags & 4) != 0 && (self.spawnflags & 16) != 0)
self.monsterinfo.currentmove = insane_move_down;
else if (Lib.random() < 0.5)
self.monsterinfo.currentmove = insane_move_stand_normal;
else
self.monsterinfo.currentmove = insane_move_stand_insane;
return true;
}
};
static EntityThinkAdapter insane_dead = new EntityThinkAdapter() {
public String getID() { return "insane_dead"; }
public boolean think(Entity self) {
if ((self.spawnflags & 8) != 0) {
self.flags |= Constants.FL_FLY;
} else {
Math3D.VectorSet(self.mins, -16, -16, -24);
Math3D.VectorSet(self.maxs, 16, 16, -8);
self.movetype = Constants.MOVETYPE_TOSS;
}
self.svflags |= Constants.SVF_DEADMONSTER;
self.nextthink = 0;
World.SV_LinkEdict(self);
return true;
}
};
static EntityDieAdapter insane_die = new EntityDieAdapter() {
public String getID() { return "insane_die"; }
public void die(Entity self, Entity inflictor, Entity attacker,
int damage, float[] point) {
int n;
if (self.health <= self.gib_health) {
ServerGame.PF_StartSound(self, Constants.CHAN_VOICE, ServerInit.SV_SoundIndex("misc/udeath.wav"), (float) 1, (float) Constants.ATTN_IDLE,
(float) 0);
for (n = 0; n < 2; n++)
GameMisc.ThrowGib(self, "models/objects/gibs/bone/tris.md2",
damage, Constants.GIB_ORGANIC);
for (n = 0; n < 4; n++)
GameMisc.ThrowGib(self,
"models/objects/gibs/sm_meat/tris.md2", damage,
Constants.GIB_ORGANIC);
GameMisc.ThrowHead(self, "models/objects/gibs/head2/tris.md2",
damage, Constants.GIB_ORGANIC);
self.deadflag = Constants.DEAD_DEAD;
return;
}
if (self.deadflag == Constants.DEAD_DEAD)
return;
ServerGame.PF_StartSound(self, Constants.CHAN_VOICE, ServerInit.SV_SoundIndex("player/male/death" + ((Lib.rand() % 4) + 1)
+ ".wav"), (float) 1, (float) Constants.ATTN_IDLE,
(float) 0);
self.deadflag = Constants.DEAD_DEAD;
self.takedamage = Constants.DAMAGE_YES;
if ((self.spawnflags & 8) != 0) {
insane_dead.think(self);
} else {
if (((self.s.frame >= FRAME_crawl1) && (self.s.frame <= FRAME_crawl9))
|| ((self.s.frame >= FRAME_stand99) && (self.s.frame <= FRAME_stand160)))
self.monsterinfo.currentmove = insane_move_crawl_death;
else
self.monsterinfo.currentmove = insane_move_stand_death;
}
}
};
static Frame insane_frames_stand_normal[] = new Frame[] {
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, insane_checkdown) };
static MonsterMove insane_move_stand_normal = new MonsterMove(FRAME_stand60,
FRAME_stand65, insane_frames_stand_normal, insane_stand);
static Frame insane_frames_stand_insane[] = new Frame[] {
new Frame(GameAI.ai_stand, 0, insane_shake),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, null),
new Frame(GameAI.ai_stand, 0, insane_checkdown) };
static MonsterMove insane_move_stand_insane = new MonsterMove(FRAME_stand65,
FRAME_stand94, insane_frames_stand_insane, insane_stand);
static Frame insane_frames_uptodown[] = new Frame[] {
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, insane_moan),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 2.7f, null),
new Frame(GameAI.ai_move, 4.1f, null),
new Frame(GameAI.ai_move, 6f, null),
new Frame(GameAI.ai_move, 7.6f, null),
new Frame(GameAI.ai_move, 3.6f, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, insane_fist),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, insane_fist),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null) };
static MonsterMove insane_move_uptodown = new MonsterMove(FRAME_stand1,
FRAME_stand40, insane_frames_uptodown, insane_onground);
static Frame insane_frames_downtoup[] = new Frame[] {
new Frame(GameAI.ai_move, -0.7f, null), // 41
new Frame(GameAI.ai_move, -1.2f, null), // 42
new Frame(GameAI.ai_move, -1.5f, null), // 43
new Frame(GameAI.ai_move, -4.5f, null), // 44
new Frame(GameAI.ai_move, -3.5f, null), // 45
new Frame(GameAI.ai_move, -0.2f, null), // 46
new Frame(GameAI.ai_move, 0, null), // 47
new Frame(GameAI.ai_move, -1.3f, null), // 48
new Frame(GameAI.ai_move, -3, null), // 49
new Frame(GameAI.ai_move, -2, null), // 50
new Frame(GameAI.ai_move, 0, null), // 51
new Frame(GameAI.ai_move, 0, null), // 52
new Frame(GameAI.ai_move, 0, null), // 53
new Frame(GameAI.ai_move, -3.3f, null), // 54
new Frame(GameAI.ai_move, -1.6f, null), // 55
new Frame(GameAI.ai_move, -0.3f, null), // 56
new Frame(GameAI.ai_move, 0, null), // 57
new Frame(GameAI.ai_move, 0, null), // 58
new Frame(GameAI.ai_move, 0, null) // 59
};
static MonsterMove insane_move_downtoup = new MonsterMove(FRAME_stand41,
FRAME_stand59, insane_frames_downtoup, insane_stand);
static Frame insane_frames_jumpdown[] = new Frame[] {
new Frame(GameAI.ai_move, 0.2f, null),
new Frame(GameAI.ai_move, 11.5f, null),
new Frame(GameAI.ai_move, 5.1f, null),
new Frame(GameAI.ai_move, 7.1f, null),
new Frame(GameAI.ai_move, 0, null) };
static MonsterMove insane_move_jumpdown = new MonsterMove(FRAME_stand96,
FRAME_stand100, insane_frames_jumpdown, insane_onground);
static Frame insane_frames_down[] = new Frame[] {
new Frame(GameAI.ai_move, 0, null), // 100)
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
// 110)
new Frame(GameAI.ai_move, -1.7f, null),
new Frame(GameAI.ai_move, -1.6f, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, insane_fist),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
// 120)
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
// 130
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, insane_moan),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
// 140
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
// 150
new Frame(GameAI.ai_move, 0.5f, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, -0.2f, insane_scream),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0.2f, null),
new Frame(GameAI.ai_move, 0.4f, null),
new Frame(GameAI.ai_move, 0.6f, null),
new Frame(GameAI.ai_move, 0.8f, null),
new Frame(GameAI.ai_move, 0.7f, null),
new Frame(GameAI.ai_move, 0, insane_checkup) // 160
};
static MonsterMove insane_move_down = new MonsterMove(FRAME_stand100,
FRAME_stand160, insane_frames_down, insane_onground);
static Frame insane_frames_walk_normal[] = new Frame[] {
new Frame(GameAI.ai_walk, 0, insane_scream),
new Frame(GameAI.ai_walk, 2.5f, null),
new Frame(GameAI.ai_walk, 3.5f, null),
new Frame(GameAI.ai_walk, 1.7f, null),
new Frame(GameAI.ai_walk, 2.3f, null),
new Frame(GameAI.ai_walk, 2.4f, null),
new Frame(GameAI.ai_walk, 2.2f, null),
new Frame(GameAI.ai_walk, 4.2f, null),
new Frame(GameAI.ai_walk, 5.6f, null),
new Frame(GameAI.ai_walk, 3.3f, null),
new Frame(GameAI.ai_walk, 2.4f, null),
new Frame(GameAI.ai_walk, 0.9f, null),
new Frame(GameAI.ai_walk, 0, null) };
static MonsterMove insane_move_walk_normal = new MonsterMove(FRAME_walk27,
FRAME_walk39, insane_frames_walk_normal, insane_walk);
static MonsterMove insane_move_run_normal = new MonsterMove(FRAME_walk27,
FRAME_walk39, insane_frames_walk_normal, insane_run);
static Frame insane_frames_walk_insane[] = new Frame[] {
new Frame(GameAI.ai_walk, 0, insane_scream), // walk 1
new Frame(GameAI.ai_walk, 3.4f, null), // walk 2
new Frame(GameAI.ai_walk, 3.6f, null), // 3
new Frame(GameAI.ai_walk, 2.9f, null), // 4
new Frame(GameAI.ai_walk, 2.2f, null), // 5
new Frame(GameAI.ai_walk, 2.6f, null), // 6
new Frame(GameAI.ai_walk, 0, null), // 7
new Frame(GameAI.ai_walk, 0.7f, null), // 8
new Frame(GameAI.ai_walk, 4.8f, null), // 9
new Frame(GameAI.ai_walk, 5.3f, null), // 10
new Frame(GameAI.ai_walk, 1.1f, null), // 11
new Frame(GameAI.ai_walk, 2, null), // 12
new Frame(GameAI.ai_walk, 0.5f, null), // 13
new Frame(GameAI.ai_walk, 0, null), // 14
new Frame(GameAI.ai_walk, 0, null), // 15
new Frame(GameAI.ai_walk, 4.9f, null), // 16
new Frame(GameAI.ai_walk, 6.7f, null), // 17
new Frame(GameAI.ai_walk, 3.8f, null), // 18
new Frame(GameAI.ai_walk, 2, null), // 19
new Frame(GameAI.ai_walk, 0.2f, null), // 20
new Frame(GameAI.ai_walk, 0, null), // 21
new Frame(GameAI.ai_walk, 3.4f, null), // 22
new Frame(GameAI.ai_walk, 6.4f, null), // 23
new Frame(GameAI.ai_walk, 5, null), // 24
new Frame(GameAI.ai_walk, 1.8f, null), // 25
new Frame(GameAI.ai_walk, 0, null) // 26
};
static MonsterMove insane_move_walk_insane = new MonsterMove(FRAME_walk1,
FRAME_walk26, insane_frames_walk_insane, insane_walk);
static MonsterMove insane_move_run_insane = new MonsterMove(FRAME_walk1,
FRAME_walk26, insane_frames_walk_insane, insane_run);
static Frame insane_frames_stand_pain[] = new Frame[] {
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null) };
static MonsterMove insane_move_stand_pain = new MonsterMove(FRAME_st_pain2,
FRAME_st_pain12, insane_frames_stand_pain, insane_run);
static Frame insane_frames_stand_death[] = new Frame[] {
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null) };
static MonsterMove insane_move_stand_death = new MonsterMove(FRAME_st_death2,
FRAME_st_death18, insane_frames_stand_death, insane_dead);
static Frame insane_frames_crawl[] = new Frame[] {
new Frame(GameAI.ai_walk, 0, insane_scream),
new Frame(GameAI.ai_walk, 1.5f, null),
new Frame(GameAI.ai_walk, 2.1f, null),
new Frame(GameAI.ai_walk, 3.6f, null),
new Frame(GameAI.ai_walk, 2f, null),
new Frame(GameAI.ai_walk, 0.9f, null),
new Frame(GameAI.ai_walk, 3f, null),
new Frame(GameAI.ai_walk, 3.4f, null),
new Frame(GameAI.ai_walk, 2.4f, null) };
static MonsterMove insane_move_crawl = new MonsterMove(FRAME_crawl1, FRAME_crawl9,
insane_frames_crawl, null);
static MonsterMove insane_move_runcrawl = new MonsterMove(FRAME_crawl1,
FRAME_crawl9, insane_frames_crawl, null);
static Frame insane_frames_crawl_pain[] = new Frame[] {
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null) };
static MonsterMove insane_move_crawl_pain = new MonsterMove(FRAME_cr_pain2,
FRAME_cr_pain10, insane_frames_crawl_pain, insane_run);
static Frame insane_frames_crawl_death[] = new Frame[] {
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null) };
static MonsterMove insane_move_crawl_death = new MonsterMove(FRAME_cr_death10,
FRAME_cr_death16, insane_frames_crawl_death, insane_dead);
static Frame insane_frames_cross[] = new Frame[] {
new Frame(GameAI.ai_move, 0, insane_moan),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null) };
static MonsterMove insane_move_cross = new MonsterMove(FRAME_cross1, FRAME_cross15,
insane_frames_cross, insane_cross);
static Frame insane_frames_struggle_cross[] = new Frame[] {
new Frame(GameAI.ai_move, 0, insane_scream),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null),
new Frame(GameAI.ai_move, 0, null) };
static MonsterMove insane_move_struggle_cross = new MonsterMove(FRAME_cross16,
FRAME_cross30, insane_frames_struggle_cross, insane_cross);
/*
* QUAKED misc_insane (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn
* CRAWL CRUCIFIED STAND_GROUND ALWAYS_STAND
*/
public static void SP_misc_insane(Entity self) {
// static int skin = 0; //@@
if (GameBase.deathmatch.value != 0) {
GameUtil.G_FreeEdict(self);
return;
}
sound_fist = ServerInit.SV_SoundIndex("insane/insane11.wav");
sound_shake = ServerInit.SV_SoundIndex("insane/insane5.wav");
sound_moan = ServerInit.SV_SoundIndex("insane/insane7.wav");
sound_scream[0] = ServerInit.SV_SoundIndex("insane/insane1.wav");
sound_scream[1] = ServerInit.SV_SoundIndex("insane/insane2.wav");
sound_scream[2] = ServerInit.SV_SoundIndex("insane/insane3.wav");
sound_scream[3] = ServerInit.SV_SoundIndex("insane/insane4.wav");
sound_scream[4] = ServerInit.SV_SoundIndex("insane/insane6.wav");
sound_scream[5] = ServerInit.SV_SoundIndex("insane/insane8.wav");
sound_scream[6] = ServerInit.SV_SoundIndex("insane/insane9.wav");
sound_scream[7] = ServerInit.SV_SoundIndex("insane/insane10.wav");
self.movetype = Constants.MOVETYPE_STEP;
self.solid = Constants.SOLID_BBOX;
self.s.modelindex = ServerInit.SV_ModelIndex("models/monsters/insane/tris.md2");
Math3D.VectorSet(self.mins, -16, -16, -24);
Math3D.VectorSet(self.maxs, 16, 16, 32);
self.health = 100;
self.gib_health = -50;
self.mass = 300;
self.pain = insane_pain;
self.die = insane_die;
self.monsterinfo.stand = insane_stand;
self.monsterinfo.walk = insane_walk;
self.monsterinfo.run = insane_run;
self.monsterinfo.dodge = null;
self.monsterinfo.attack = null;
self.monsterinfo.melee = null;
self.monsterinfo.sight = null;
self.monsterinfo.aiflags |= Constants.AI_GOOD_GUY;
// @@
// self.s.skinnum = skin;
// skin++;
// if (skin > 12)
// skin = 0;
World.SV_LinkEdict(self);
if ((self.spawnflags & 16) != 0) // Stand Ground
self.monsterinfo.aiflags |= Constants.AI_STAND_GROUND;
self.monsterinfo.currentmove = insane_move_stand_normal;
self.monsterinfo.scale = MODEL_SCALE;
if ((self.spawnflags & 8) != 0) // Crucified ?
{
Math3D.VectorSet(self.mins, -16, 0, 0);
Math3D.VectorSet(self.maxs, 16, 8, 32);
self.flags |= Constants.FL_NO_KNOCKBACK;
GameAI.flymonster_start.think(self);
} else {
GameAI.walkmonster_start.think(self);
self.s.skinnum = Lib.rand() % 3;
}
}
}