From: LegendaryGuard Date: Mon, 13 Dec 2021 23:10:09 +0000 (+0100) Subject: Adjust new monster models animations in the code X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6dc0028ed222d791af71aedd045390ac85bbc8bb;p=xonotic%2Fxonotic-data.pk3dir.git Adjust new monster models animations in the code --- diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index 74a041b15..b0636795b 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -69,13 +69,20 @@ float autocvar_g_monster_mage_speed_stop; float autocvar_g_monster_mage_speed_run; float autocvar_g_monster_mage_speed_walk; +//For a new model, it will work wrong with old model, there are more animations for it. Probably, the unused animations will be used in the future /* const float mage_anim_idle = 0; const float mage_anim_walk = 1; -const float mage_anim_attack = 2; -const float mage_anim_pain = 3; -const float mage_anim_death = 4; -const float mage_anim_run = 5; +const float mage_anim_attack1 = 2; +const float mage_anim_spawn = 3; // Or attack4 +const float mage_anim_attack2 = 4; +const float mage_anim_attack3 = 5; +const float mage_anim_pain = 6; +const float mage_anim_pain = 7; +const float mage_anim_pain = 8; +const float mage_anim_death = 9; +const float mage_anim_death2 = 10; +const float mage_anim_run = 1; */ void M_Mage_Defend_Heal(entity this); @@ -428,13 +435,15 @@ METHOD(Mage, mr_think, bool(Mage thismon, entity actor)) METHOD(Mage, mr_pain, float(Mage this, entity actor, float damage_take, entity attacker, float deathtype)) { TC(Mage, this); + actor.pain_finished = time + 0.34; + setanim(actor, ((random() > 0.5) ? actor.anim_pain1 : actor.anim_pain2), true, true, false); return damage_take; } METHOD(Mage, mr_death, bool(Mage this, entity actor)) { TC(Mage, this); - setanim(actor, actor.anim_die1, false, true, true); + setanim(actor, ((random() > 0.5) ? actor.anim_die1 : actor.anim_die2), false, true, true); return true; } @@ -444,12 +453,16 @@ METHOD(Mage, mr_anim, bool(Mage this, entity actor)) { TC(Mage, this); vector none = '0 0 0'; - actor.anim_die1 = animfixfps(actor, '4 1 0.5', none); // 2 seconds + actor.anim_die1 = animfixfps(actor, '9 1 0.5', none); // 2 seconds + actor.anim_die2 = animfixfps(actor, '10 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_pain1 = animfixfps(actor, '3 1 2', none); // 0.5 seconds + actor.anim_spawn = animfixfps(actor, '3 1 2', none); // 0.5 seconds + actor.anim_pain1 = animfixfps(actor, '6 1 2', none); // 0.5 seconds + actor.anim_pain2 = animfixfps(actor, '7 1 2', none); // 0.5 seconds + //actor.anim_pain3 = animfixfps(actor, '8 1 2', none); // 0.5 seconds, removed to make it compilable actor.anim_shoot = animfixfps(actor, '2 1 5', none); // analyze models and set framerate - actor.anim_run = animfixfps(actor, '5 1 1', none); + actor.anim_run = animfixfps(actor, '1 1 1', none); return true; } #endif @@ -467,6 +480,9 @@ METHOD(Mage, mr_setup, bool(Mage this, entity actor)) actor.monster_loot = ITEM_HealthBig; actor.monster_attackfunc = M_Mage_Attack; + setanim(actor, actor.anim_spawn, false, true, true); + actor.spawn_time = actor.animstate_endtime; + return true; } #endif diff --git a/qcsrc/common/monsters/monster/shambler.qc b/qcsrc/common/monsters/monster/shambler.qc index 789b7afe4..2ed784969 100644 --- a/qcsrc/common/monsters/monster/shambler.qc +++ b/qcsrc/common/monsters/monster/shambler.qc @@ -17,16 +17,25 @@ float autocvar_g_monster_shambler_speed_stop; float autocvar_g_monster_shambler_speed_run; float autocvar_g_monster_shambler_speed_walk; +//For a new model /* const float shambler_anim_stand = 0; const float shambler_anim_walk = 1; const float shambler_anim_run = 2; -const float shambler_anim_smash = 3; +const float shambler_anim_smash = 6; +const float shambler_anim_smash2 = 5; const float shambler_anim_swingr = 4; -const float shambler_anim_swingl = 5; -const float shambler_anim_magic = 6; +const float shambler_anim_swingl = 3; +const float shambler_anim_magic = 4; const float shambler_anim_pain = 7; -const float shambler_anim_death = 8; +const float shambler_anim_pain2 = 8; +const float shambler_anim_pain3 = 9; +const float shambler_anim_pain4 = 10; +const float shambler_anim_pain5 = 11; +const float shambler_anim_spawn = 12; +const float shambler_anim_death = 13; +const float shambler_anim_death2 = 15; +const float shambler_anim_death3 = 17; */ .float shambler_lastattack; // delay attacks separately @@ -211,14 +220,16 @@ METHOD(Shambler, mr_pain, float(Shambler this, entity actor, float damage_take, { TC(Shambler, this); actor.pain_finished = time + 0.5; - setanim(actor, actor.anim_pain1, true, true, false); + setanim(actor, ((random() > 0.5) ? actor.anim_pain1 : actor.anim_pain2), true, true, false); + //setanim(actor, ((random() > 0.5) ? actor.anim_pain1 : actor.anim_pain2 : actor.anim_pain3 : actor.anim_pain4 : actor.anim_pain5), true, true, false); return damage_take; } METHOD(Shambler, mr_death, bool(Shambler this, entity actor)) { TC(Shambler, this); - setanim(actor, actor.anim_die1, false, true, true); + setanim(actor, ((random() > 0.5) ? actor.anim_die1 : actor.anim_die2), false, true, true); + //setanim(actor, ((random() > 0.5) ? actor.anim_die1 : actor.anim_die2 : actor.anim_die3), false, true, true); return true; } #endif @@ -227,14 +238,21 @@ METHOD(Shambler, mr_anim, bool(Shambler this, entity actor)) { TC(Shambler, this); vector none = '0 0 0'; - actor.anim_die1 = animfixfps(actor, '8 1 0.5', none); // 2 seconds + actor.anim_die1 = animfixfps(actor, '13 1 0.5', none); // 2 seconds + actor.anim_die2 = animfixfps(actor, '15 1 0.5', none); // 2 seconds + //actor.anim_die3 = animfixfps(actor, '17 1 0.5', none); // 2 seconds, brokes compiling actor.anim_walk = animfixfps(actor, '1 1 1', none); actor.anim_idle = animfixfps(actor, '0 1 1', none); actor.anim_pain1 = animfixfps(actor, '7 1 2', none); // 0.5 seconds - actor.anim_melee1 = animfixfps(actor, '3 1 5', none); // analyze models and set framerate + actor.anim_pain2 = animfixfps(actor, '8 1 2', none); // 0.5 seconds + //actor.anim_pain3 = animfixfps(actor, '9 1 2', none); // 0.5 seconds, brokes compiling + //actor.anim_pain4 = animfixfps(actor, '10 1 2', none); // 0.5 seconds, brokes compiling + //actor.anim_pain5 = animfixfps(actor, '11 1 2', none); // 0.5 seconds, brokes compiling + actor.anim_spawn = animfixfps(actor, '12 1 0.5', none); // 2 seconds, brokes compiling + actor.anim_melee1 = animfixfps(actor, '6 1 5', none); // analyze models and set framerate actor.anim_melee2 = animfixfps(actor, '4 1 5', none); // analyze models and set framerate - actor.anim_melee3 = 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_melee3 = animfixfps(actor, '3 1 5', none); // analyze models and set framerate + actor.anim_shoot = animfixfps(actor, '4 1 5', none); // analyze models and set framerate actor.anim_run = animfixfps(actor, '2 1 1', none); return true; } @@ -254,7 +272,7 @@ METHOD(Shambler, mr_setup, bool(Shambler this, entity actor)) actor.monster_loot = ITEM_HealthMega; actor.weapon = WEP_ELECTRO.m_id; // matches attacks better than WEP_VORTEX - setanim(actor, actor.anim_shoot, false, true, true); + setanim(actor, actor.anim_spawn, false, true, true); actor.spawn_time = actor.animstate_endtime; StatusEffects_apply(STATUSEFFECT_SpawnShield, actor, actor.spawn_time, 0); actor.monster_attackfunc = M_Shambler_Attack; diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index 3f3e65d4a..4a31a904e 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -77,11 +77,26 @@ float autocvar_g_monster_spider_speed_stop; float autocvar_g_monster_spider_speed_run; float autocvar_g_monster_spider_speed_walk; +//For a new model /* -const float spider_anim_idle = 0; -const float spider_anim_walk = 1; -const float spider_anim_attack = 2; -const float spider_anim_attack2 = 3; +const float spider_anim_melee = 0; +const float spider_anim_death = 1; +const float spider_anim_death2 = 2; +const float spider_anim_shoot1 = 3; +const float spider_anim_ultrashoot = 4; +const float spider_anim_idle = 5; +const float spider_anim_spawn = 6; +const float spider_anim_pain = 7; +const float spider_anim_pain2 = 8; +const float spider_anim_pain3 = 9; +const float spider_anim_moveforward = 10; +const float spider_anim_moveforwardright = 11; +const float spider_anim_movebackright = 12; +const float spider_anim_movebackward = 13; +const float spider_anim_movebackleft = 14; +const float spider_anim_moveleft = 15; +const float spider_anim_moveforwardleft = 16; +const float spider_anim_movebackleft = 17; */ void M_Spider_Attack_Web_Explode(entity this) @@ -183,14 +198,17 @@ METHOD(Spider, mr_think, bool(Spider this, entity actor)) METHOD(Spider, mr_pain, float(Spider this, entity actor, float damage_take, entity attacker, float deathtype)) { TC(Spider, this); + actor.pain_finished = time + 0.34; + setanim(actor, ((random() > 0.5) ? actor.anim_pain1 : actor.anim_pain2), true, true, false); + //setanim(actor, ((random() > 0.5) ? actor.anim_pain1 : actor.anim_pain2 : actor.anim_pain3), true, true, false); return damage_take; } METHOD(Spider, mr_death, bool(Spider this, entity actor)) { TC(Spider, this); - setanim(actor, actor.anim_melee, false, true, true); - actor.angles_x = 180; + setanim(actor, ((random() > 0.5) ? actor.anim_die1 : actor.anim_die2), false, true, true); + actor.angles_x = 0; return true; } #endif @@ -199,11 +217,17 @@ METHOD(Spider, mr_anim, bool(Spider this, entity actor)) { TC(Spider, this); vector none = '0 0 0'; - actor.anim_walk = animfixfps(actor, '1 1 1', none); - actor.anim_idle = animfixfps(actor, '0 1 1', none); - actor.anim_melee = animfixfps(actor, '2 1 5', none); // analyze models and set framerate - actor.anim_shoot = animfixfps(actor, '3 1 5', none); // analyze models and set framerate - actor.anim_run = animfixfps(actor, '1 1 1', none); + actor.anim_walk = animfixfps(actor, '10 1 1', none); + actor.anim_die1 = animfixfps(actor, '1 1 1', none); + actor.anim_die2 = animfixfps(actor, '2 1 1', none); + actor.anim_pain1 = animfixfps(actor, '7 1 1', none); + //actor.anim_pain3 = animfixfps(actor, '8 1 1', none); //brokes compiling + actor.anim_pain2 = animfixfps(actor, '9 1 1', none); + actor.anim_idle = animfixfps(actor, '5 1 1', none); + actor.anim_spawn = animfixfps(actor, '6 1 1', none); + actor.anim_melee = animfixfps(actor, '0 1 5', none); // analyze models and set framerate + actor.anim_shoot = animfixfps(actor, '4 1 5', none); // analyze models and set framerate + actor.anim_run = animfixfps(actor, '10 1 1', none); return true; } #endif @@ -219,6 +243,9 @@ METHOD(Spider, mr_setup, bool(Spider this, entity actor)) actor.monster_loot = ITEM_HealthMedium; actor.monster_attackfunc = M_Spider_Attack; + + setanim(actor, actor.anim_spawn, false, true, true); + actor.spawn_time = actor.animstate_endtime; return true; } diff --git a/qcsrc/common/monsters/monster/wyvern.qc b/qcsrc/common/monsters/monster/wyvern.qc index 6b1965b54..57135f687 100644 --- a/qcsrc/common/monsters/monster/wyvern.qc +++ b/qcsrc/common/monsters/monster/wyvern.qc @@ -59,10 +59,14 @@ float autocvar_g_monster_wyvern_speed_walk; /* const float wyvern_anim_hover = 0; -const float wyvern_anim_fly = 1; -const float wyvern_anim_magic = 2; +const float wyvern_anim_flyrun = 1; +const float wyvern_anim_fly = 2; const float wyvern_anim_pain = 3; -const float wyvern_anim_death = 4; +const float wyvern_anim_pain2 = 4; +const float wyvern_anim_melee = 5; +const float wyvern_anim_magic = 6; +const float wyvern_anim_flyfast = 7; +const float wyvern_anim_death = 8; */ void M_Wyvern_Attack_Fireball_Explode(entity this) @@ -120,7 +124,7 @@ METHOD(Wyvern, mr_pain, float(Wyvern this, entity actor, float damage_take, enti { TC(Wyvern, this); actor.pain_finished = time + 0.5; - setanim(actor, actor.anim_pain1, true, true, false); + setanim(actor, ((random() > 0.5) ? actor.anim_pain1 : actor.anim_pain2), true, true, false); return damage_take; } @@ -139,12 +143,13 @@ 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_die1 = animfixfps(actor, '8 1 0.5', none); // 2 seconds + actor.anim_walk = animfixfps(actor, '2 1 1', none); actor.anim_idle = animfixfps(actor, '0 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_shoot = animfixfps(actor, '6 1 5', none); // analyze models and set framerate + actor.anim_run = animfixfps(actor, '1 1 1', none); // or 7? They just look with the same process return true; } #endif