string sample = this.(samplefield);
if (sample != "") sample = GlobalSound_sample(sample, random());
float myscale = ((this.scale) ? this.scale : 1); // safety net
- // TODO: change volume depending on size too?
sound7(this, chan, sample, VOL_BASE, ATTEN_NORM, 100 / myscale, 0);
this.msound_delay = time + sound_delay;
void Monster_Touch(entity this, entity toucher)
{
- if(toucher == NULL) { return; }
+ if(!toucher) { return; }
if(toucher.monster_attack && this.enemy != toucher && !IS_MONSTER(toucher) && time >= this.spawn_time)
if(Monster_ValidTarget(this, toucher, true))
if(Monster_ValidTarget(this, actor, true)) { this.enemy = actor; }
}
-.float pass_distance;
vector Monster_Move_Target(entity this, entity targ)
{
// enemy is always preferred target
)
{
this.enemy = NULL;
- //this.pass_distance = 0;
}
if(this.enemy)
this.monster_moveto = '0 0 0';
this.monster_face = '0 0 0';
- //this.pass_distance = vlen((('1 0 0' * this.enemy.origin_x) + ('0 1 0' * this.enemy.origin_y)) - (('1 0 0' * this.origin_x) + ('0 1 0' * this.origin_y)));
Monster_Sound(this, monstersound_sight, 0, false, CH_VOICE);
}
}
this.monster_attackfunc = mon.monster_attackfunc;
this.candrop = true;
this.oldtarget2 = this.target2;
- //this.pass_distance = 0;
this.deadflag = DEAD_NO;
this.spawn_time = time;
this.gravity = 1;