]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/monster/wyvern.qc
Merge branch 'master' into Mario/monsters
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster / wyvern.qc
index 92a098abf2d0c2040522c88f8b6b8e3e620b1bb1..6205c72da839e0268c05f930bb0bc2dc488873a6 100644 (file)
@@ -20,8 +20,13 @@ METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, .entity
     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);
                if (IS_MONSTER(actor)) {
-                       actor.attack_finished_single[0] = time + 1.2;
-                       actor.anim_finished = time + 1.2;
+                       //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);
                }
 
@@ -138,17 +143,19 @@ METHOD(Wyvern, mr_anim, bool(Wyvern this, entity actor))
 {
     TC(Wyvern, this);
     vector none = '0 0 0';
-    actor.anim_die1 = animfixfps(actor, '4 1 0.5', none); // 2 seconds
-    actor.anim_walk = animfixfps(actor, '1 1 1', none);
     actor.anim_idle = animfixfps(actor, '0 1 1', none);
+    actor.anim_walk = animfixfps(actor, '1 1 1', none);
+    actor.anim_run = animfixfps(actor, '2 1 1', none);
     actor.anim_pain1 = animfixfps(actor, '3 1 2', none); // 0.5 seconds
-    actor.anim_shoot = animfixfps(actor, '2 1 5', none); // analyze models and set framerate
-    actor.anim_run = animfixfps(actor, '1 1 1', none);
+    actor.anim_pain2 = animfixfps(actor, '4 1 2', none); // 0.5 seconds
+    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
     return true;
 }
 #endif
 #ifdef SVQC
-spawnfunc(item_cells);
 METHOD(Wyvern, mr_setup, bool(Wyvern this, entity actor))
 {
     TC(Wyvern, this);
@@ -158,15 +165,9 @@ METHOD(Wyvern, mr_setup, bool(Wyvern this, entity actor))
     if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_wyvern_speed_stop); }
     if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_wyvern_damageforcescale); }
 
-    actor.monster_loot = spawnfunc_item_cells;
+    actor.monster_loot = ITEM_Cells;
     actor.monster_attackfunc = M_Wyvern_Attack;
 
     return true;
 }
-
-METHOD(Wyvern, mr_precache, bool(Wyvern this))
-{
-    TC(Wyvern, this);
-    return true;
-}
 #endif