if (fire & 1)
if (time > actor.attack_finished_single[0] || weapon_prepareattack(thiswep, actor, weaponentity, false, 1.2)) {
if (IS_PLAYER(actor)) W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_WyvernAttack_FIRE, CH_WEAPON_B, 0, DEATH_MONSTER_WYVERN.m_id);
- if (IS_MONSTER(actor)) {
- //actor.anim_finished = time + 1.2;
- setanim(actor, actor.anim_shoot, false, true, true);
- if(actor.animstate_endtime > time)
- actor.anim_finished = actor.animstate_endtime;
- else
- actor.anim_finished = time + 1.2;
- actor.attack_finished_single[0] = actor.anim_finished + 0.2;
- monster_makevectors(actor, actor.enemy);
- }
+ if (IS_MONSTER(actor)) monster_makevectors(actor, actor.enemy);
entity missile = spawn();
missile.owner = missile.realowner = actor;
entity own = this.realowner;
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, DMG_NOWEP, NULL);
+ own, NULL, autocvar_g_monster_wyvern_attack_fireball_radius, this.projectiledeathtype, DMG_NOWEP, NULL);
- FOREACH_ENTITY_RADIUS(this.origin, autocvar_g_monster_wyvern_attack_fireball_radius, it.takedamage == DAMAGE_AIM,
+ FOREACH_ENTITY_RADIUS(this.origin, autocvar_g_monster_wyvern_attack_fireball_radius, it.takedamage == DAMAGE_AIM && it != own,
{
Fire_AddDamage(it, own, 5 * MONSTER_SKILLMOD(own), autocvar_g_monster_wyvern_attack_fireball_damagetime, this.projectiledeathtype);
});
M_Wyvern_Attack_Fireball_Explode(this);
}
+void M_Wyvern_Attack_Fireball(entity this)
+{
+ w_shotdir = normalize((this.enemy.origin + '0 0 10') - this.origin);
+ Weapon wep = WEP_WYVERN_ATTACK;
+ // TODO
+ .entity weaponentity = weaponentities[0];
+ wep.wr_think(wep, this, weaponentity, 1);
+}
+
bool M_Wyvern_Attack(int attack_type, entity actor, entity targ, .entity weaponentity)
{
switch(attack_type)
case MONSTER_ATTACK_MELEE:
case MONSTER_ATTACK_RANGED:
{
- w_shotdir = normalize((actor.enemy.origin + '0 0 10') - actor.origin);
- Weapon wep = WEP_WYVERN_ATTACK;
- wep.wr_think(wep, actor, weaponentity, 1);
+ Monster_Delay(actor, 0, 1, M_Wyvern_Attack_Fireball);
+ //actor.anim_finished = time + 1.2;
+ setanim(actor, actor.anim_shoot, false, true, true);
+ if(actor.animstate_endtime > time)
+ actor.anim_finished = actor.animstate_endtime;
+ else
+ actor.anim_finished = time + 1.2;
+ actor.attack_finished_single[0] = actor.anim_finished + 0.2;
return true;
}
}
return true;
}
+METHOD(Wyvern, mr_deadthink, bool(Wyvern this, entity actor))
+{
+ TC(Wyvern, this);
+ if(IS_ONGROUND(actor))
+ setanim(actor, actor.anim_die2, true, false, false);
+ return true;
+}
+
METHOD(Wyvern, mr_pain, float(Wyvern this, entity actor, float damage_take, entity attacker, float deathtype))
{
TC(Wyvern, this);
actor.anim_melee = animfixfps(actor, '5 1 5', none); // analyze models and set framerate
actor.anim_shoot = animfixfps(actor, '6 1 5', none); // analyze models and set framerate
actor.anim_die1 = animfixfps(actor, '7 1 0.5', none); // 2 seconds
- //actor.anim_dead = animfixfps(actor, '8 1 0.5', none); // 2 seconds
+ actor.anim_die2 = animfixfps(actor, '8 1 0.5', none); // 2 seconds
return true;
}
#endif
{
this.nextthink = time + this.ticrate;
+ Monster mon = Monsters_from(this.monsterid);
+ mon.mr_deadthink(mon, this);
+
if(this.monster_lifetime != 0)
if(time >= this.monster_lifetime)
{
this.state = 0;
this.attack_finished_single[0] = 0;
this.effects = 0;
+ this.dphitcontentsmask &= ~DPCONTENTS_BODY;
if(!((this.flags & FL_FLY) || (this.flags & FL_SWIM)))
this.velocity = '0 0 0';
this.monster_attackfunc = mon.monster_attackfunc;
this.monster_name = mon.monster_name;
this.candrop = true;
- this.view_ofs = '0 0 0.7' * (this.maxs_z * 0.5);
this.oldtarget2 = this.target2;
//this.pass_distance = 0;
this.deadflag = DEAD_NO;
this.scale *= 1.3;
setsize(this, mon.m_mins * this.scale, mon.m_maxs * this.scale);
+ this.view_ofs = '0 0 0.7' * (this.maxs_z * 0.5);
this.ticrate = bound(sys_frametime, ((!this.ticrate) ? autocvar_g_monsters_think_delay : this.ticrate), 60);