5 // ============================
6 // Begin: Missile functions, these are general functions to be manipulated by other code
7 // ============================
8 void W_Seeker_Missile_Explode(entity this, entity directhitentity)
10 this.event_damage = func_null;
11 RadiusDamage(this, this.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), NULL, NULL, WEP_CVAR(seeker, missile_force), this.projectiledeathtype, this.weaponentity_fld, directhitentity);
16 void W_Seeker_Missile_Explode_think(entity this)
18 W_Seeker_Missile_Explode(this, NULL);
21 void W_Seeker_Missile_Touch(entity this, entity toucher)
23 PROJECTILE_TOUCH(this, toucher);
25 W_Seeker_Missile_Explode(this, toucher);
28 void W_Seeker_Missile_Think(entity this)
31 vector desireddir, olddir, newdir, eorg;
38 this.projectiledeathtype |= HITTYPE_SPLASH;
39 W_Seeker_Missile_Explode(this, NULL);
42 spd = vlen(this.velocity);
44 spd - WEP_CVAR(seeker, missile_decel) * frametime,
45 WEP_CVAR(seeker, missile_speed_max),
46 spd + WEP_CVAR(seeker, missile_accel) * frametime
49 if(this.enemy != NULL)
50 if(this.enemy.takedamage != DAMAGE_AIM || IS_DEAD(this.enemy))
53 if(this.enemy != NULL)
56 eorg = 0.5 * (e.absmin + e.absmax);
57 turnrate = WEP_CVAR(seeker, missile_turnrate); // how fast to turn
58 desireddir = normalize(eorg - this.origin);
59 olddir = normalize(this.velocity); // get my current direction
60 dist = vlen(eorg - this.origin);
62 // Do evasive maneuvers for world objects? ( this should be a cpu hog. :P )
63 if(WEP_CVAR(seeker, missile_smart) && (dist > WEP_CVAR(seeker, missile_smart_mindist)))
65 // Is it a better idea (shorter distance) to trace to the target itself?
66 if( vdist(this.origin + olddir * this.wait, <, dist))
67 traceline(this.origin, this.origin + olddir * this.wait, false, this);
69 traceline(this.origin, eorg, false, this);
71 // Setup adaptive tracelength
72 this.wait = bound(WEP_CVAR(seeker, missile_smart_trace_min), vlen(this.origin - trace_endpos), this.wait = WEP_CVAR(seeker, missile_smart_trace_max));
74 // Calc how important it is that we turn and add this to the desierd (enemy) dir.
75 desireddir = normalize(((trace_plane_normal * (1 - trace_fraction)) + (desireddir * trace_fraction)) * 0.5);
78 newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy
79 this.velocity = newdir * spd; // make me fly in the new direction at my flight speed
85 if(WEP_CVAR(seeker, missile_proxy))
87 if(dist <= WEP_CVAR(seeker, missile_proxy_maxrange))
89 if(this.autoswitch == 0)
91 this.autoswitch = time + WEP_CVAR(seeker, missile_proxy_delay);
95 if(this.autoswitch <= time)
97 W_Seeker_Missile_Explode(this, NULL);
104 if(this.autoswitch != 0)
110 if(IS_DEAD(this.enemy))
113 this.cnt = time + 1 + (random() * 4);
114 this.nextthink = this.cnt;
118 //this.angles = vectoangles(this.velocity); // turn model in the new flight direction
119 this.nextthink = time;// + 0.05; // csqc projectiles
120 UpdateCSQCProjectile(this);
125 void W_Seeker_Missile_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
130 if(!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
131 return; // g_projectiles_damage says to halt
133 if(this.realowner == attacker)
134 this.health = this.health - (damage * 0.25);
136 this.health = this.health - damage;
139 W_PrepareExplosionByDamage(this, attacker, W_Seeker_Missile_Explode_think);
143 void W_Seeker_Missile_Animate(entity this)
145 this.frame = this.frame +1;
146 this.nextthink = time + 0.05;
148 if(this.enemy != NULL)
149 if(this.enemy.takedamage != DAMAGE_AIM || IS_DEAD(this.enemy))
154 this.think = W_Seeker_Missile_Think;
155 this.nextthink = time;// + cvar("g_balance_seeker_missile_activate_delay"); // cant dealy with csqc projectiles
157 if(autocvar_g_balance_seeker_missile_proxy)
158 this.move_movetype = MOVETYPE_BOUNCEMISSILE;
160 this.move_movetype = MOVETYPE_FLYMISSILE;
163 UpdateCSQCProjectile(this);
167 void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, .entity weaponentity, vector f_diff, entity m_target)
169 W_DecreaseAmmo(thiswep, actor, WEP_CVAR(seeker, missile_ammo), weaponentity);
171 makevectors(actor.v_angle);
172 W_SetupShot_ProjectileSize(actor, weaponentity, '-2 -2 -2', '2 2 2', false, 2, SND_SEEKER_FIRE, CH_WEAPON_A, 0, ((m_target != NULL) ? WEP_SEEKER.m_id | HITTYPE_SECONDARY : WEP_SEEKER.m_id));
174 Send_Effect(EFFECT_SEEKER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
176 //actor.detornator = false;
178 entity missile = new(seeker_missile);
179 missile.owner = missile.realowner = actor;
180 missile.bot_dodge = true;
181 missile.bot_dodgerating = WEP_CVAR(seeker, missile_damage);
183 setthink(missile, W_Seeker_Missile_Think);
184 settouch(missile, W_Seeker_Missile_Touch);
185 missile.event_damage = W_Seeker_Missile_Damage;
186 missile.nextthink = time;// + 0.2;// + cvar("g_balance_seeker_missile_activate_delay");
187 missile.cnt = time + WEP_CVAR(seeker, missile_lifetime);
188 missile.enemy = m_target;
189 missile.solid = SOLID_BBOX;
191 missile.takedamage = DAMAGE_YES;
192 missile.weaponentity_fld = weaponentity;
193 missile.health = WEP_CVAR(seeker, missile_health);
194 missile.damageforcescale = WEP_CVAR(seeker, missile_damageforcescale);
195 missile.damagedbycontents = true;
196 IL_PUSH(g_damagedbycontents, missile);
197 //missile.think = W_Seeker_Missile_Animate; // csqc projectiles.
199 if(missile.enemy != NULL)
200 missile.projectiledeathtype = WEP_SEEKER.m_id | HITTYPE_SECONDARY;
202 missile.projectiledeathtype = WEP_SEEKER.m_id;
205 setorigin(missile, w_shotorg);
206 setsize(missile, '-4 -4 -4', '4 4 4');
207 set_movetype(missile, MOVETYPE_FLYMISSILE);
208 missile.flags = FL_PROJECTILE;
209 IL_PUSH(g_projectiles, missile);
210 IL_PUSH(g_bot_dodge, missile);
211 missile.missile_flags = MIF_SPLASH | MIF_GUIDED_TAG;
213 W_SetupProjVelocity_UP_PRE(missile, seeker, missile_);
215 missile.angles = vectoangles(missile.velocity);
217 CSQCProjectile(missile, false, PROJECTILE_SEEKER, true);
219 MUTATOR_CALLHOOK(EditProjectile, actor, missile);
222 // ============================
223 // Begin: FLAC, close range attack meant for defeating rockets which are coming at you.
224 // ============================
225 void W_Seeker_Flac_Explode(entity this, entity directhitentity)
227 this.event_damage = func_null;
229 RadiusDamage(this, this.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), NULL, NULL, WEP_CVAR(seeker, flac_force), this.projectiledeathtype, this.weaponentity_fld, directhitentity);
234 void W_Seeker_Flac_Touch(entity this, entity toucher)
236 W_Seeker_Flac_Explode(this, toucher);
239 void W_Seeker_Flac_Explode_use(entity this, entity actor, entity trigger)
241 W_Seeker_Flac_Explode(this, trigger);
244 void W_Seeker_Fire_Flac(Weapon thiswep, entity actor, .entity weaponentity)
250 W_DecreaseAmmo(thiswep, actor, WEP_CVAR(seeker, flac_ammo), weaponentity);
252 c = actor.(weaponentity).bulletcounter % 4;
256 f_diff = '-1.25 -3.75 0';
259 f_diff = '+1.25 -3.75 0';
262 f_diff = '-1.25 +3.75 0';
266 f_diff = '+1.25 +3.75 0';
269 W_SetupShot_ProjectileSize(actor, weaponentity, '-2 -2 -2', '2 2 2', false, 2, SND_FLAC_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, flac_damage), WEP_SEEKER.m_id | HITTYPE_SECONDARY);
272 Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
274 missile = new(missile);
275 missile.owner = missile.realowner = actor;
276 missile.bot_dodge = true;
277 missile.bot_dodgerating = WEP_CVAR(seeker, flac_damage);
278 settouch(missile, W_Seeker_Flac_Touch);
279 missile.use = W_Seeker_Flac_Explode_use;
280 setthink(missile, adaptor_think2use_hittype_splash);
281 missile.nextthink = time + WEP_CVAR(seeker, flac_lifetime) + WEP_CVAR(seeker, flac_lifetime_rand);
282 missile.solid = SOLID_BBOX;
283 set_movetype(missile, MOVETYPE_FLY);
284 missile.projectiledeathtype = WEP_SEEKER.m_id | HITTYPE_SECONDARY;
285 missile.weaponentity_fld = weaponentity;
286 missile.flags = FL_PROJECTILE;
287 IL_PUSH(g_projectiles, missile);
288 IL_PUSH(g_bot_dodge, missile);
289 missile.missile_flags = MIF_SPLASH;
292 //missile.angles = vectoangles(missile.velocity);
293 //missile.scale = 0.4; // BUG: the model is too big
295 setorigin(missile, w_shotorg);
296 setsize(missile, '-2 -2 -2', '2 2 2');
298 W_SetupProjVelocity_UP_PRE(missile, seeker, flac_);
299 CSQCProjectile(missile, true, PROJECTILE_FLAC, true);
301 MUTATOR_CALLHOOK(EditProjectile, actor, missile);
304 // ============================
305 // Begin: Tag and rocket controllers
306 // ============================
307 entity W_Seeker_Tagged_Info(entity isowner, .entity weaponentity, entity istarget)
309 IL_EACH(g_seeker_trackers, it.classname == "tag_tracker" && it.realowner == isowner,
311 if(it.tag_target == istarget && it.weaponentity_fld == weaponentity)
318 void W_Seeker_Attack(entity actor, .entity weaponentity)
320 entity closest_target = NULL;
322 IL_EACH(g_seeker_trackers, it.classname == "tag_tracker" && it.realowner == actor,
326 if(vlen2(actor.origin - it.tag_target.origin) < vlen2(actor.origin - closest_target.origin))
327 closest_target = it.tag_target;
330 closest_target = it.tag_target;
335 traceline(actor.origin + actor.view_ofs, closest_target.origin, MOVE_NOMONSTERS, actor);
336 if(!closest_target || (trace_fraction < 1 && trace_ent != closest_target))
337 closest_target = NULL;
340 W_Seeker_Fire_Missile(WEP_SEEKER, actor, weaponentity, '0 0 0', closest_target);
343 void W_Seeker_Vollycontroller_Think(entity this) // TODO: Merge this with W_Seeker_Attack
347 this.cnt = this.cnt - 1;
349 Weapon thiswep = WEP_SEEKER;
350 .entity weaponentity = this.weaponentity_fld;
351 if((!(this.realowner.items & IT_UNLIMITED_AMMO) && GetResourceAmount(this.realowner, thiswep.ammo_type) < WEP_CVAR(seeker, missile_ammo)) || (this.cnt <= -1) || (IS_DEAD(this.realowner)) || (this.realowner.(weaponentity).m_switchweapon != WEP_SEEKER))
357 this.nextthink = time + WEP_CVAR(seeker, missile_delay) * W_WeaponRateFactor(this.realowner);
359 entity own = this.realowner;
361 oldenemy = own.enemy;
362 own.enemy = this.enemy;
368 W_Seeker_Fire_Missile(WEP_SEEKER, own, weaponentity, '-1.25 -3.75 0', own.enemy); // TODO
371 W_Seeker_Fire_Missile(WEP_SEEKER, own, weaponentity, '+1.25 -3.75 0', own.enemy); // TODO
374 W_Seeker_Fire_Missile(WEP_SEEKER, own, weaponentity, '-1.25 +3.75 0', own.enemy); // TODO
378 W_Seeker_Fire_Missile(WEP_SEEKER, own, weaponentity, '+1.25 +3.75 0', own.enemy); // TODO
382 own.enemy = oldenemy;
385 void W_Seeker_Tracker_Think(entity this)
387 .entity weaponentity = this.weaponentity_fld;
388 // commit suicide if: You die OR target dies OR you switch away from the seeker OR commit suicide if lifetime is up
389 if((IS_DEAD(this.realowner)) || (IS_DEAD(this.tag_target)) || (this.realowner.(weaponentity).m_switchweapon != WEP_SEEKER)
390 || (time > this.tag_time + WEP_CVAR(seeker, tag_tracker_lifetime)))
394 WaypointSprite_Kill(this.tag_target.wps_tag_tracker);
400 // Update the think method information
401 this.nextthink = time;
404 // ============================
405 // Begin: Tag projectile
406 // ============================
407 void W_Seeker_Tag_Explode(entity this)
409 //if(other==this.realowner)
411 Damage_DamageInfo(this.origin, 0, 0, 0, this.velocity, WEP_SEEKER.m_id | HITTYPE_BOUNCE, 0, this);
416 void W_Seeker_Tag_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
420 this.health = this.health - damage;
422 W_Seeker_Tag_Explode(this);
425 void W_Seeker_Tag_Touch(entity this, entity toucher)
431 PROJECTILE_TOUCH(this, toucher);
433 dir = normalize(this.realowner.origin - this.origin);
434 org2 = findbetterlocation(this.origin, 8);
436 te_knightspike(org2);
438 this.event_damage = func_null;
439 Damage_DamageInfo(this.origin, 0, 0, 0, this.velocity, WEP_SEEKER.m_id | HITTYPE_BOUNCE | HITTYPE_SECONDARY, toucher.species, this);
441 if(toucher.takedamage == DAMAGE_AIM && !IS_DEAD(toucher))
443 // check to see if this person is already tagged by me
444 .entity weaponentity = this.weaponentity_fld;
445 entity tag = W_Seeker_Tagged_Info(this.realowner, weaponentity, toucher);
449 if(toucher.wps_tag_tracker && (WEP_CVAR(seeker, type) == 1)) // don't attach another waypointsprite without killing the old one first
450 WaypointSprite_Kill(toucher.wps_tag_tracker);
456 //sprint(this.realowner, strcat("You just tagged ^2", toucher.netname, "^7 with a tracking device!\n"));
457 e = new(tag_tracker);
458 e.weaponentity_fld = this.weaponentity_fld;
459 e.cnt = WEP_CVAR(seeker, missile_count);
460 e.owner = this.owner;
461 e.realowner = this.realowner;
462 IL_PUSH(g_seeker_trackers, e);
464 if(WEP_CVAR(seeker, type) == 1)
466 e.tag_target = toucher;
468 setthink(e, W_Seeker_Tracker_Think);
473 setthink(e, W_Seeker_Vollycontroller_Think);
479 if(WEP_CVAR(seeker, type) == 1)
481 WaypointSprite_Spawn(WP_Seeker, WEP_CVAR(seeker, tag_tracker_lifetime), 0, toucher, '0 0 64', this.realowner, 0, toucher, wps_tag_tracker, true, RADARICON_TAGGED);
482 WaypointSprite_UpdateRule(toucher.wps_tag_tracker, 0, SPRITERULE_DEFAULT);
490 void W_Seeker_Fire_Tag(Weapon thiswep, entity actor, .entity weaponentity)
492 W_DecreaseAmmo(thiswep, actor, WEP_CVAR(seeker, tag_ammo), weaponentity);
494 W_SetupShot_ProjectileSize(actor, weaponentity, '-2 -2 -2', '2 2 2', false, 2, SND_TAG_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count), WEP_SEEKER.m_id | HITTYPE_BOUNCE | HITTYPE_SECONDARY);
496 entity missile = new(seeker_tag);
497 missile.weaponentity_fld = weaponentity;
498 missile.owner = missile.realowner = actor;
499 missile.bot_dodge = true;
500 missile.bot_dodgerating = 50;
501 settouch(missile, W_Seeker_Tag_Touch);
502 setthink(missile, SUB_Remove);
503 missile.nextthink = time + WEP_CVAR(seeker, tag_lifetime);
504 set_movetype(missile, MOVETYPE_FLY);
505 missile.solid = SOLID_BBOX;
507 missile.takedamage = DAMAGE_YES;
508 missile.event_damage = W_Seeker_Tag_Damage;
509 missile.health = WEP_CVAR(seeker, tag_health);
510 missile.damageforcescale = WEP_CVAR(seeker, tag_damageforcescale);
512 setorigin(missile, w_shotorg);
513 setsize(missile, '-2 -2 -2', '2 2 2');
515 missile.flags = FL_PROJECTILE;
516 IL_PUSH(g_projectiles, missile);
517 IL_PUSH(g_bot_dodge, missile);
518 //missile.missile_flags = MIF_..?;
520 set_movetype(missile, MOVETYPE_FLY);
521 W_SetupProjVelocity_PRE(missile, seeker, tag_);
522 missile.angles = vectoangles(missile.velocity);
524 CSQCProjectile(missile, true, PROJECTILE_TAG, false); // has sound
526 MUTATOR_CALLHOOK(EditProjectile, actor, missile);
529 // ============================
530 // Begin: Genereal weapon functions
531 // ============================
533 METHOD(Seeker, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
535 if(WEP_CVAR(seeker, type) == 1)
536 if(W_Seeker_Tagged_Info(actor, weaponentity, actor.enemy) != NULL)
537 PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
539 PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
541 PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
543 METHOD(Seeker, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
545 if(autocvar_g_balance_seeker_reload_ammo && actor.(weaponentity).clip_load < min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo))) { // forced reload
546 thiswep.wr_reload(thiswep, actor, weaponentity);
549 if(WEP_CVAR(seeker, type) == 1)
551 if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(seeker, missile_refire)))
553 W_Seeker_Attack(actor, weaponentity);
554 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR(seeker, missile_animtime), w_ready);
559 if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(seeker, tag_refire)))
561 W_Seeker_Fire_Tag(thiswep, actor, weaponentity);
562 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR(seeker, tag_animtime), w_ready);
569 if(WEP_CVAR(seeker, type) == 1)
571 if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(seeker, tag_refire)))
573 W_Seeker_Fire_Tag(thiswep, actor, weaponentity);
574 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR(seeker, tag_animtime), w_ready);
579 if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(seeker, flac_refire)))
581 W_Seeker_Fire_Flac(thiswep, actor, weaponentity);
582 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR(seeker, flac_animtime), w_ready);
587 METHOD(Seeker, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
590 if(WEP_CVAR(seeker, type) == 1)
592 ammo_amount = GetResourceAmount(actor, thiswep.ammo_type) >= WEP_CVAR(seeker, missile_ammo);
593 ammo_amount += actor.(weaponentity).(weapon_load[WEP_SEEKER.m_id]) >= WEP_CVAR(seeker, missile_ammo);
597 ammo_amount = GetResourceAmount(actor, thiswep.ammo_type) >= WEP_CVAR(seeker, tag_ammo);
598 ammo_amount += actor.(weaponentity).(weapon_load[WEP_SEEKER.m_id]) >= WEP_CVAR(seeker, tag_ammo);
602 METHOD(Seeker, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
605 if(WEP_CVAR(seeker, type) == 1)
607 ammo_amount = GetResourceAmount(actor, thiswep.ammo_type) >= WEP_CVAR(seeker, tag_ammo);
608 ammo_amount += actor.(weaponentity).(weapon_load[WEP_SEEKER.m_id]) >= WEP_CVAR(seeker, tag_ammo);
612 ammo_amount = GetResourceAmount(actor, thiswep.ammo_type) >= WEP_CVAR(seeker, flac_ammo);
613 ammo_amount += actor.(weaponentity).(weapon_load[WEP_SEEKER.m_id]) >= WEP_CVAR(seeker, flac_ammo);
617 METHOD(Seeker, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
619 W_Reload(actor, weaponentity, min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), SND_RELOAD);
621 METHOD(Seeker, wr_suicidemessage, Notification(entity thiswep))
623 return WEAPON_SEEKER_SUICIDE;
625 METHOD(Seeker, wr_killmessage, Notification(entity thiswep))
627 if(w_deathtype & HITTYPE_SECONDARY)
628 return WEAPON_SEEKER_MURDER_TAG;
630 return WEAPON_SEEKER_MURDER_SPRAY;
636 METHOD(Seeker, wr_impacteffect, void(entity thiswep, entity actor))
639 org2 = w_org + w_backoff * 6;
640 if(w_deathtype & HITTYPE_BOUNCE)
642 if(w_deathtype & HITTYPE_SECONDARY)
645 sound(actor, CH_SHOTS, SND_TAG_IMPACT, 1, ATTEN_NORM);
649 pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1);
653 sound(actor, CH_SHOTS, SND_TAGEXP1, 1, ATTEN_NORM);
654 else if(w_random<0.7)
655 sound(actor, CH_SHOTS, SND_TAGEXP2, 1, ATTEN_NORM);
657 sound(actor, CH_SHOTS, SND_TAGEXP3, 1, ATTEN_NORM);
663 pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1);
667 sound(actor, CH_SHOTS, SND_SEEKEREXP1, 1, ATTEN_NORM);
668 else if(w_random<0.7)
669 sound(actor, CH_SHOTS, SND_SEEKEREXP2, 1, ATTEN_NORM);
671 sound(actor, CH_SHOTS, SND_SEEKEREXP3, 1, ATTEN_NORM);