mirror of
https://github.com/nzp-team/quakec.git
synced 2025-01-19 07:40:51 +00:00
commit
78e9e50e6e
3 changed files with 69 additions and 4 deletions
|
@ -26,6 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void(float what) play_sound_z;
|
void(float what) play_sound_z;
|
||||||
|
void() LinkZombiesHitbox;
|
||||||
|
|
||||||
void() path_corner_touch =
|
void() path_corner_touch =
|
||||||
{
|
{
|
||||||
|
@ -489,6 +490,8 @@ void(float dist) Window_Hop =
|
||||||
self.enemy = find_new_enemy(self);
|
self.enemy = find_new_enemy(self);
|
||||||
//self.th_die();
|
//self.th_die();
|
||||||
self.th_walk();
|
self.th_walk();
|
||||||
|
LinkZombiesHitbox();
|
||||||
|
//bprint (PRINT_HIGH, "Linked hitboxes");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ void() Zombie_Walk_Setup;
|
||||||
void() crawler_rip_board1;
|
void() crawler_rip_board1;
|
||||||
void() crawler_da1;
|
void() crawler_da1;
|
||||||
void() crawler_die1;
|
void() crawler_die1;
|
||||||
|
void() LinkZombiesHitbox;
|
||||||
|
|
||||||
|
|
||||||
float EMPTY_BBOX = 0;
|
float EMPTY_BBOX = 0;
|
||||||
|
@ -1379,6 +1380,8 @@ void() zombieRise =
|
||||||
self.frame ++;
|
self.frame ++;
|
||||||
self.think = zombieRise;
|
self.think = zombieRise;
|
||||||
self.nextthink = time + 0.1;
|
self.nextthink = time + 0.1;
|
||||||
|
LinkZombiesHitbox();
|
||||||
|
//bprint (PRINT_HIGH, "Linked hitboxes");
|
||||||
};
|
};
|
||||||
void() spawn_zombie =
|
void() spawn_zombie =
|
||||||
{
|
{
|
||||||
|
@ -1650,6 +1653,7 @@ void(entity where) spawn_a_zombieB =
|
||||||
|
|
||||||
szombie.mins = '-8 -8 -32';//-16 16 -32
|
szombie.mins = '-8 -8 -32';//-16 16 -32
|
||||||
szombie.maxs = '8 8 30';//16 16 40
|
szombie.maxs = '8 8 30';//16 16 40
|
||||||
|
|
||||||
setsize (szombie, szombie.mins, szombie.maxs);//-16,-16,-32,16,16,40
|
setsize (szombie, szombie.mins, szombie.maxs);//-16,-16,-32,16,16,40
|
||||||
//Setting Uniform skin=================
|
//Setting Uniform skin=================
|
||||||
/*if(random() > 0.5)
|
/*if(random() > 0.5)
|
||||||
|
@ -1728,7 +1732,7 @@ void(entity where) spawn_a_zombieB =
|
||||||
SetZombieWalk(szombie);
|
SetZombieWalk(szombie);
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
|
|
||||||
SetUpHitBoxes(szombie);
|
SetUpHitBoxes(szombie);
|
||||||
//szombie.walktype = 5;
|
//szombie.walktype = 5;
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
szombie.reload_delay = 30 + time;//save floats, equals respawn time.
|
szombie.reload_delay = 30 + time;//save floats, equals respawn time.
|
||||||
|
@ -1742,6 +1746,9 @@ void(entity where) spawn_a_zombieB =
|
||||||
else
|
else
|
||||||
self.th_walk();
|
self.th_walk();
|
||||||
self = old_self;
|
self = old_self;
|
||||||
|
|
||||||
|
LinkZombiesHitbox();
|
||||||
|
//bprint (PRINT_HIGH, "Linked hitboxes");
|
||||||
|
|
||||||
// set up timer for next spawn
|
// set up timer for next spawn
|
||||||
zombie_spawn_timer = zombie_spawn_delay + time;
|
zombie_spawn_timer = zombie_spawn_delay + time;
|
||||||
|
|
|
@ -186,7 +186,7 @@ void() precaches =
|
||||||
//
|
//
|
||||||
|
|
||||||
// player-made
|
// player-made
|
||||||
#ifdef PC
|
|
||||||
precache_sound("sounds/player/footstep1.wav");
|
precache_sound("sounds/player/footstep1.wav");
|
||||||
precache_sound("sounds/player/footstep2.wav");
|
precache_sound("sounds/player/footstep2.wav");
|
||||||
precache_sound("sounds/player/footstep3.wav");
|
precache_sound("sounds/player/footstep3.wav");
|
||||||
|
@ -195,7 +195,7 @@ void() precaches =
|
||||||
precache_sound("sounds/player/jump.wav");
|
precache_sound("sounds/player/jump.wav");
|
||||||
precache_sound("sounds/player/land.wav");
|
precache_sound("sounds/player/land.wav");
|
||||||
precache_sound("sounds/player/pain4.wav");
|
precache_sound("sounds/player/pain4.wav");
|
||||||
#endif // PC
|
|
||||||
|
|
||||||
// weapons
|
// weapons
|
||||||
precache_sound("sounds/weapons/colt/magin.wav");
|
precache_sound("sounds/weapons/colt/magin.wav");
|
||||||
|
@ -395,7 +395,8 @@ void() RelinkZombies =
|
||||||
|
|
||||||
//if(OnlyOrigin)
|
//if(OnlyOrigin)
|
||||||
// continue;
|
// continue;
|
||||||
|
|
||||||
|
/*
|
||||||
min = ent2.bbmins + (v_right * ent2.view_ofs_x) + (v_forward * ent2.view_ofs_y) + (v_up * ent2.view_ofs_z);
|
min = ent2.bbmins + (v_right * ent2.view_ofs_x) + (v_forward * ent2.view_ofs_y) + (v_up * ent2.view_ofs_z);
|
||||||
max = ent2.bbmaxs + (v_right * ent2.view_ofs_x) + (v_forward * ent2.view_ofs_y) + (v_up * ent2.view_ofs_z);
|
max = ent2.bbmaxs + (v_right * ent2.view_ofs_x) + (v_forward * ent2.view_ofs_y) + (v_up * ent2.view_ofs_z);
|
||||||
|
|
||||||
|
@ -404,6 +405,60 @@ void() RelinkZombies =
|
||||||
if(min_z > max_z) { min_z += max_z; max_z = min_z - max_z; min_z -= max_z; }
|
if(min_z > max_z) { min_z += max_z; max_z = min_z - max_z; min_z -= max_z; }
|
||||||
|
|
||||||
setsize(ent2,min,max);
|
setsize(ent2,min,max);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void() LinkZombiesHitbox =
|
||||||
|
{
|
||||||
|
entity ent,ent2;
|
||||||
|
local float i;
|
||||||
|
local vector min, max;
|
||||||
|
|
||||||
|
|
||||||
|
//warn
|
||||||
|
ent = ent2 = world;
|
||||||
|
|
||||||
|
while ((ent = find (ent, classname, "ai_zombie")))
|
||||||
|
{
|
||||||
|
if(ent.currentHitBoxSetup == 0)//empty bbox, we don't care to update
|
||||||
|
continue;
|
||||||
|
|
||||||
|
makevectors (ent.angles);
|
||||||
|
|
||||||
|
for(i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
if(i == 0)
|
||||||
|
ent2 = ent.head;
|
||||||
|
if(i == 1)
|
||||||
|
ent2 = ent.larm;
|
||||||
|
if(i == 2)
|
||||||
|
ent2 = ent.rarm;
|
||||||
|
|
||||||
|
|
||||||
|
if (ent2)
|
||||||
|
{
|
||||||
|
ent2.angles = ent.angles;
|
||||||
|
|
||||||
|
if(ent2.deadflag)
|
||||||
|
ent2.frame = ent.frame;
|
||||||
|
|
||||||
|
//if(OnlyOrigin)
|
||||||
|
// continue;
|
||||||
|
|
||||||
|
|
||||||
|
min = ent2.bbmins + (v_right * ent2.view_ofs_x) + (v_forward * ent2.view_ofs_y) + (v_up * ent2.view_ofs_z);
|
||||||
|
max = ent2.bbmaxs + (v_right * ent2.view_ofs_x) + (v_forward * ent2.view_ofs_y) + (v_up * ent2.view_ofs_z);
|
||||||
|
|
||||||
|
if(min_x > max_x) { min_x += max_x; max_x = min_x - max_x; min_x -= max_x; }
|
||||||
|
if(min_y > max_y) { min_y += max_y; max_y = min_y - max_y; min_y -= max_y; }
|
||||||
|
if(min_z > max_z) { min_z += max_z; max_z = min_z - max_z; min_z -= max_z; }
|
||||||
|
|
||||||
|
setsize(ent2,min,max);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue