2 const vector WIZARD_MIN = '-16 -16 -24';
3 const vector WIZARD_MAX = '16 16 24';
6 float autocvar_g_monster_wizard;
7 float autocvar_g_monster_wizard_health;
8 float autocvar_g_monster_wizard_speed_walk;
9 float autocvar_g_monster_wizard_speed_run;
10 float autocvar_g_monster_wizard_spike_damage;
11 float autocvar_g_monster_wizard_spike_edgedamage;
12 float autocvar_g_monster_wizard_spike_radius;
13 float autocvar_g_monster_wizard_spike_speed;
16 #define wizard_anim_hover 0
17 #define wizard_anim_fly 1
18 #define wizard_anim_magic 2
19 #define wizard_anim_pain 3
20 #define wizard_anim_death 4
22 void Wiz_FastExplode()
24 self.event_damage = func_null;
25 self.takedamage = DAMAGE_NO;
26 RadiusDamage (self, self.realowner, autocvar_g_monster_wizard_spike_damage, autocvar_g_monster_wizard_spike_edgedamage, autocvar_g_monster_wizard_spike_radius, world, 0, self.projectiledeathtype, other);
35 if(other == self.owner)
39 if(other.team == self.owner.team)
42 pointparticles(particleeffectnum("TE_WIZSPIKE"), self.origin, '0 0 0', 1);
50 local vector dir = '0 0 0';
51 local float dist = 0, flytime = 0;
53 dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
54 dist = vlen (self.enemy.origin - self.origin);
55 flytime = dist * 0.002;
59 self.v_angle = self.angles;
60 makevectors (self.angles);
63 missile.owner = missile.realowner = self;
64 setsize (missile, '0 0 0', '0 0 0');
65 setorigin (missile, self.origin + v_forward * 14 + '0 0 30' + v_right * 14);
66 missile.enemy = self.enemy;
67 missile.nextthink = time + 3;
68 missile.think = Wiz_FastExplode;
69 missile.velocity = dir * autocvar_g_monster_wizard_spike_speed;
70 missile.avelocity = '300 300 300';
71 missile.solid = SOLID_BBOX;
72 missile.movetype = MOVETYPE_FLYMISSILE;
73 missile.touch = Wiz_FastTouch;
74 CSQCProjectile(missile, TRUE, PROJECTILE_CRYLINK, TRUE);
77 missile.owner = missile.realowner = self;
78 setsize (missile, '0 0 0', '0 0 0');
79 setorigin (missile, self.origin + v_forward * 14 + '0 0 30' + v_right * -14);
80 missile.enemy = self.enemy;
81 missile.nextthink = time + 3;
82 missile.touch = Wiz_FastTouch;
83 missile.solid = SOLID_BBOX;
84 missile.movetype = MOVETYPE_FLYMISSILE;
85 missile.think = Wiz_FastExplode;
86 missile.velocity = dir * autocvar_g_monster_wizard_spike_speed;
87 missile.avelocity = '300 300 300';
88 CSQCProjectile(missile, TRUE, PROJECTILE_CRYLINK, TRUE);
93 self.think = wizard_think;
94 self.nextthink = time + 0.1;
96 monster_move(autocvar_g_monster_wizard_speed_run, autocvar_g_monster_wizard_speed_walk, 300, wizard_anim_fly, wizard_anim_hover, wizard_anim_hover);
99 void wizard_fastattack ()
106 Monster_CheckDropCvars ("wizard");
108 self.think = Monster_Fade;
109 self.solid = SOLID_NOT;
110 self.takedamage = DAMAGE_NO;
111 self.event_damage = func_null;
113 self.movetype = MOVETYPE_TOSS;
114 self.flags = FL_ONGROUND;
115 self.nextthink = time + 2.1;
116 self.pain_finished = self.nextthink;
117 self.velocity_x = -200 + 400*random();
118 self.velocity_y = -200 + 400*random();
119 self.velocity_z = 100 + 100*random();
120 self.frame = wizard_anim_death;
122 monster_hook_death(); // for post-death mods
134 self.health = autocvar_g_monster_wizard_health * self.scale;
136 self.classname = "monster_wizard";
137 self.checkattack = GenericCheckAttack;
138 self.attack_ranged = Wiz_Missile;
139 self.nextthink = time + random() * 0.5 + 0.1;
140 self.movetype = MOVETYPE_FLY; // TODO: make it fly up/down
141 self.flags |= FL_FLY;
142 self.think = wizard_think;
143 self.sprite_height = 30 * self.scale;
145 monster_hook_spawn(); // for post-spawn mods
148 void spawnfunc_monster_wizard ()
150 if not(autocvar_g_monster_wizard)
156 self.monster_spawnfunc = spawnfunc_monster_wizard;
158 if(self.spawnflags & MONSTERFLAG_APPEAR)
160 self.think = func_null;
162 self.use = Monster_Appear;
168 if not (monster_initialize(
170 "models/monsters/wizard.mdl",
171 WIZARD_MIN, WIZARD_MAX,
173 wizard_die, wizard_spawn))
179 precache_model ("models/spike.mdl");
180 precache_sound ("weapons/spike.wav");
183 // compatibility with old spawns
184 void spawnfunc_monster_scrag () { spawnfunc_monster_wizard(); }