-#ifndef WYVERN_H
-#define WYVERN_H
-
-#ifndef MENUQC
-MODEL(MON_WYVERN, M_Model("wizard.mdl"));
-#endif
-
-CLASS(Wyvern, Monster)
- ATTRIB(Wyvern, spawnflags, int, MONSTER_TYPE_FLY | MONSTER_SIZE_BROKEN | MON_FLAG_RANGED | MON_FLAG_RIDE);
- ATTRIB(Wyvern, mins, vector, '-20 -20 -58');
- ATTRIB(Wyvern, maxs, vector, '20 20 20');
-#ifndef MENUQC
- ATTRIB(Wyvern, m_model, Model, MDL_MON_WYVERN);
-#endif
- ATTRIB(Wyvern, netname, string, "wyvern");
- ATTRIB(Wyvern, monster_name, string, _("Wyvern"));
-ENDCLASS(Wyvern)
-
-REGISTER_MONSTER(WYVERN, NEW(Wyvern)) {
-#ifndef MENUQC
- this.mr_precache(this);
-#endif
-}
-
-#include <common/weapons/all.qh>
-
-CLASS(WyvernAttack, PortoLaunch)
-/* flags */ ATTRIB(WyvernAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(WyvernAttack, impulse, int, 9);
-/* refname */ ATTRIB(WyvernAttack, netname, string, "wyvern");
-/* wepname */ ATTRIB(WyvernAttack, m_name, string, _("Wyvern attack"));
-ENDCLASS(WyvernAttack)
-REGISTER_WEAPON(WYVERN_ATTACK, NEW(WyvernAttack));
-
-#endif
-
-#ifdef IMPLEMENTATION
+#include "wyvern.qh"
#ifdef SVQC
setorigin(missile, actor.origin + actor.view_ofs + v_forward * 14);
missile.flags = FL_PROJECTILE;
IL_PUSH(g_projectiles, missile);
+ IL_PUSH(g_bot_dodge, missile);
missile.velocity = w_shotdir * (autocvar_g_monster_wyvern_attack_fireball_speed);
missile.avelocity = '300 300 300';
missile.nextthink = time + 5;
}
}
-METHOD(WyvernAttack, wr_checkammo1, bool(WyvernAttack this, entity actor)) {
+METHOD(WyvernAttack, wr_checkammo1, bool(WyvernAttack this, entity actor, .entity weaponentity)) {
TC(WyvernAttack, this);
return true;
}
RadiusDamage(this, own, autocvar_g_monster_wyvern_attack_fireball_damage, autocvar_g_monster_wyvern_attack_fireball_edgedamage, autocvar_g_monster_wyvern_attack_fireball_force, NULL, NULL, autocvar_g_monster_wyvern_attack_fireball_radius, this.projectiledeathtype, NULL);
- FOREACH_ENTITY_FLOAT(takedamage, DAMAGE_AIM,
+ FOREACH_ENTITY_RADIUS(this.origin, autocvar_g_monster_wyvern_attack_fireball_radius, it.takedamage == DAMAGE_AIM,
{
- if(vdist(it.origin - this.origin, <=, autocvar_g_monster_wyvern_attack_fireball_radius))
- Fire_AddDamage(it, own, 5 * MONSTER_SKILLMOD(own), autocvar_g_monster_wyvern_attack_fireball_damagetime, this.projectiledeathtype);
+ Fire_AddDamage(it, own, 5 * MONSTER_SKILLMOD(own), autocvar_g_monster_wyvern_attack_fireball_damagetime, this.projectiledeathtype);
});
delete(this);
M_Wyvern_Attack_Fireball_Explode(this);
}
-bool M_Wyvern_Attack(int attack_type, entity actor, entity targ)
+bool M_Wyvern_Attack(int attack_type, entity actor, entity targ, .entity weaponentity)
{
- .entity weaponentity = weaponentities[0];
switch(attack_type)
{
case MONSTER_ATTACK_MELEE:
return false;
}
-spawnfunc(monster_wyvern) { Monster_Spawn(this, MON_WYVERN.monsterid); }
+spawnfunc(monster_wyvern) { Monster_Spawn(this, true, MON_WYVERN.monsterid); }
#endif // SVQC
#ifdef SVQC
return true;
}
#endif
-#ifndef MENUQC
+#ifdef GAMEQC
METHOD(Wyvern, mr_anim, bool(Wyvern this, entity actor))
{
TC(Wyvern, this);
return true;
}
#endif
-
-#endif