#include "../deathtypes.qh"
#include "../../server/mutators/mutators_include.qh"
#include "../../server/tturrets/include/turrets_early.qh"
- #include "../../server/vehicles/vehicles_def.qh"
+ #include "../../server/vehicles/vehicle.qh"
#include "../../server/campaign.qh"
#include "../../server/command/common.qh"
#include "../../server/command/cmd.qh"
field = GetMonsterSoundSampleField(argv(0));
if(GetMonsterSoundSampleField_notFound)
continue;
- if(self.field)
- strunzone(self.field);
- self.field = strzone(strcat(argv(1), " ", argv(2)));
+ if (self.(field))
+ strunzone(self.(field));
+ self.(field) = strzone(strcat(argv(1), " ", argv(2)));
}
fclose(fh);
return 1;
}
-.float skin_for_monstersound;
+.int skin_for_monstersound;
void UpdateMonsterSounds()
{
entity mon = get_monsterinfo(self.monsterid);
if(delaytoo)
if(time < self.msound_delay)
return; // too early
- GlobalSound(self.samplefield, chan, VOICETYPE_PLAYERSOUND);
+ GlobalSound(self.(samplefield), chan, VOICETYPE_PLAYERSOUND);
self.msound_delay = time + sound_delay;
}
makevectors(self.v_angle);
}
-float monster_melee(entity targ, float damg, float anim, float er, float anim_finished, float deathtype, float dostop)
+float monster_melee(entity targ, float damg, float anim, float er, float anim_finished, int deathtype, float dostop)
{
if (self.health <= 0)
return false; // attacking while dead?!
vector targ_origin = ((self.enemy.absmin + self.enemy.absmax) * 0.5);
targ_origin = WarpZone_RefSys_TransformOrigin(self.enemy, self, targ_origin); // origin of target as seen by the monster (us)
WarpZone_TraceLine(self.origin, targ_origin, MOVE_NOMONSTERS, self);
-
+
if((self.enemy == world)
|| (self.enemy.deadflag != DEAD_NO || self.enemy.health < 1)
|| (self.enemy.frozen)
self.enemy = world;
self.pass_distance = 0;
}
-
+
if(self.enemy)
{
/*WarpZone_TrailParticles(world, particleeffectnum("red_pass"), self.origin, targ_origin);
print("Trace origin: ", vtos(targ_origin), "\n");
print("Target origin: ", vtos(self.enemy.origin), "\n");
print("My origin: ", vtos(self.origin), "\n"); */
-
+
self.monster_movestate = MONSTER_MOVE_ENEMY;
self.last_trace = time + 1.2;
return targ_origin;
}
-
+
/*makevectors(self.angles);
self.monster_movestate = MONSTER_MOVE_ENEMY;
self.last_trace = time + 1.2;
if(((self.flags & FL_FLY) && (self.spawnflags & MONSTERFLAG_FLY_VERTICAL)) || (self.flags & FL_SWIM))
{
- pos_z = random() * 200;
+ pos.z = random() * 200;
if(random() >= 0.5)
pos.z *= -1;
}
WarpZone_RefSys_Copy(self.enemy, self);
WarpZone_RefSys_AddInverse(self.enemy, self); // wz1^-1 ... wzn^-1 receiver
self.moveto = WarpZone_RefSys_TransformOrigin(self.enemy, self, (0.5 * (self.enemy.absmin + self.enemy.absmax)));
-
+
self.pass_distance = vlen((('1 0 0' * self.enemy.origin.x) + ('0 1 0' * self.enemy.origin.y)) - (('1 0 0' * self.origin.x) + ('0 1 0' * self.origin.y)));
MonsterSound(monstersound_sight, 0, false, CH_VOICE);
}
{
if((self.flags & FL_ONGROUND) || ((self.flags & FL_FLY) || (self.flags & FL_SWIM)))
monster_CalculateVelocity(self, self.moveto, self.origin, true, ((self.enemy) ? runspeed : walkspeed));
-
+
/*&if(self.flags & FL_FLY || self.flags & FL_SWIM)
movelib_move_simple(v_forward, ((self.enemy) ? runspeed : walkspeed), 0.6);
else
if (vlen(self.velocity) <= 30)
self.frame = manim_idle;
}
-
+
self.steerto = steerlib_attract2(self.moveto, 0.5, 500, 0.95);
-
+
vector real_angle = vectoangles(self.steerto) - self.angles;
float turny = 25;
if(self.state == MONSTER_STATE_ATTACK_MELEE)
self.moveto = self.origin;
}
-void monsters_corpse_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void monsters_corpse_damage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
self.health -= damage;
MON_ACTION(self.monsterid, MR_DEATH);
}
-void monsters_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void monsters_damage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.frozen && deathtype != DEATH_KILL && deathtype != DEATH_NADE_ICE_FREEZE)
return;
void monster_changeteam(entity ent, float newteam)
{
if(!teamplay) { return; }
-
+
ent.team = newteam;
ent.monster_attack = true; // new team, activate attacking
monster_setupcolors(ent);
-
+
if(ent.sprite)
{
WaypointSprite_UpdateTeamRadar(ent.sprite, RADARICON_DANGER, ((newteam) ? Team_ColorRGB(newteam) : '1 0 0'));
if(mon.spawnflags & MONSTER_SIZE_BROKEN)
if(!(self.spawnflags & MONSTERFLAG_RESPAWNED))
self.scale *= 1.3;
-
+
setsize(self, mon.mins * self.scale, mon.maxs * self.scale);
if(!self.ticrate)