mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-10 22:51:36 +00:00
SERVER: Animate weapon_wall Prop spawning, play a sound during its spawn
This commit is contained in:
parent
26c3578646
commit
421de1b868
2 changed files with 50 additions and 25 deletions
|
@ -240,57 +240,78 @@ void() trigger_activator =
|
||||||
self.touch = trigger_activator_touch;
|
self.touch = trigger_activator_touch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void() prop_reset_velocity =
|
||||||
|
{
|
||||||
|
self.velocity = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void() use_wall_weapon =
|
void() use_wall_weapon =
|
||||||
{
|
{
|
||||||
if (self.enemy)
|
// Already animated the Prop
|
||||||
|
if (self.enemy.boxstatus != 0)
|
||||||
return;
|
return;
|
||||||
entity newent;
|
|
||||||
|
|
||||||
newent = spawn();
|
// Play a sound for it "spawning"
|
||||||
|
sound(self, 1, "sounds/misc/buy.wav", 1, 1);
|
||||||
newent.movetype = MOVETYPE_NONE; // so it doesn't get pushed by anything
|
|
||||||
newent.solid=SOLID_NOT;
|
|
||||||
newent.classname = "wall_weapon";
|
|
||||||
setorigin(newent, self.origin);
|
|
||||||
|
|
||||||
// MP5K and Waffe were added in late in the mix-up.. needs special case. Also grenade bag.
|
// MP5K and Waffe were added in late in the mix-up.. needs special case. Also grenade bag.
|
||||||
switch(self.sequence + 1) {
|
switch(self.sequence + 1) {
|
||||||
case 26: // Grenade bag
|
case 26: // Grenade bag
|
||||||
setmodel(newent, "models/props/grenade_bag.mdl");
|
setmodel(self.enemy, "models/props/grenade_bag.mdl");
|
||||||
break;
|
break;
|
||||||
case 29: // MP5K
|
case 29: // MP5K
|
||||||
setmodel(newent, GetWeaponModel(W_MP5K, 1));
|
setmodel(self.enemy, GetWeaponModel(W_MP5K, 1));
|
||||||
break;
|
break;
|
||||||
case 28: // Waffe
|
case 28: // Waffe
|
||||||
setmodel(newent, GetWeaponModel(W_TESLA, 1));
|
setmodel(self.enemy, GetWeaponModel(W_TESLA, 1));
|
||||||
break;
|
break;
|
||||||
case 30: // Springfield
|
case 30: // Springfield
|
||||||
setmodel(newent, GetWeaponModel(W_SPRING, 1));
|
setmodel(self.enemy, GetWeaponModel(W_SPRING, 1));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
setmodel (newent, GetWeaponModel(self.sequence + 1, 1));
|
setmodel(self.enemy, GetWeaponModel(self.sequence + 1, 1));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
setsize (newent, VEC_HULL2_MIN, VEC_HULL2_MAX);
|
// Send it forward a bit
|
||||||
newent.angles = self.angles;
|
makevectors(self.angles);
|
||||||
|
self.enemy.velocity = v_right * 6;
|
||||||
|
self.enemy.think = prop_reset_velocity;
|
||||||
|
self.enemy.nextthink = time + 0.8;
|
||||||
|
|
||||||
self.enemy = newent;
|
// Make sure we don't repeat this!
|
||||||
|
self.enemy.boxstatus = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void() weapon_wall =
|
void() weapon_wall =
|
||||||
{
|
{
|
||||||
precache_model ("models/misc/chalk.mdl");
|
// Needed for the Prop
|
||||||
|
precache_sound("sounds/misc/buy.wav");
|
||||||
|
|
||||||
setmodel (self, "models/misc/chalk.mdl");
|
// We are, indeed, Wall Chalk.
|
||||||
self.skin = 0;
|
Precache_Set("models/misc/chalk.mdl");
|
||||||
setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
|
setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
|
||||||
|
|
||||||
|
// Set-Up Weapon Prop.
|
||||||
|
entity weapon_prop = spawn();
|
||||||
|
self.enemy = weapon_prop;
|
||||||
|
self.enemy.angles = self.angles;
|
||||||
|
self.enemy.movetype = MOVETYPE_NOCLIP;
|
||||||
|
self.enemy.solid = SOLID_NOT;
|
||||||
|
self.enemy.owner = self;
|
||||||
|
self.enemy.classname = "weapon_wall_prop";
|
||||||
|
setsize(self.enemy, VEC_HULL2_MIN, VEC_HULL2_MAX);
|
||||||
|
|
||||||
|
// We want the Prop to be slightly behind the Chalk.
|
||||||
|
makevectors(self.angles);
|
||||||
|
setorigin(self.enemy, self.origin + v_right*-4);
|
||||||
|
|
||||||
|
// Prep it for usage.
|
||||||
|
self.skin = 0;
|
||||||
self.frame = self.sequence;
|
self.frame = self.sequence;
|
||||||
self.use = use_wall_weapon;
|
self.use = use_wall_weapon;
|
||||||
self.classname = "weapon_wall";
|
self.classname = "weapon_wall";
|
||||||
self.effects = EF_FULLBRIGHT;
|
self.effects = EF_FULLBRIGHT;
|
||||||
//self.effects = EF_WEPLIGHT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===================
|
/* ===================
|
||||||
|
|
|
@ -78,9 +78,13 @@ void() GameRestart_CleanWallSummons =
|
||||||
|
|
||||||
tempe = find(world, classname, "weapon_wall");
|
tempe = find(world, classname, "weapon_wall");
|
||||||
while (tempe != world) {
|
while (tempe != world) {
|
||||||
// We store the world model with .enemy for.. some reason..
|
// Check if it's model has been set, if it is undo the damage.
|
||||||
if (tempe.enemy)
|
if (tempe.enemy.model != "") {
|
||||||
remove(tempe.enemy);
|
setmodel(tempe.enemy, "");
|
||||||
|
tempe.enemy.boxstatus = 0;
|
||||||
|
makevectors(tempe.angles);
|
||||||
|
setorigin(tempe.enemy, tempe.origin + v_right*-4);
|
||||||
|
}
|
||||||
|
|
||||||
tempe = find(tempe, classname, "weapon_wall");
|
tempe = find(tempe, classname, "weapon_wall");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue