]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/monsters
authorMario <mario@smbclan.net>
Mon, 19 Feb 2018 15:15:59 +0000 (01:15 +1000)
committerMario <mario@smbclan.net>
Mon, 19 Feb 2018 15:15:59 +0000 (01:15 +1000)
# Conflicts:
# qcsrc/common/monsters/monster/shambler.qc

16 files changed:
1  2 
models/monsters/dragon_lod1.dpm
models/monsters/dragon_lod1.dpm.framegroups
models/monsters/dragon_lod2.dpm
models/monsters/dragon_lod2.dpm.framegroups
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/weapons/projectile.qc
qcsrc/common/monsters/monster/golem.qc
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/mage.qh
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/monster/spider.qh
qcsrc/common/monsters/monster/wyvern.qc
qcsrc/common/monsters/monster/wyvern.qh
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/triggers/func/breakable.qc
qcsrc/server/autocvars.qh

index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..7521bc1c36b1ed0f6272d7c6b46da546e1d98405
new file mode 100644 (file)
Binary files differ
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..458bbe4e7010b2e7ad1d2ac9a7467e537680b474
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,14 @@@
++/*
++Generated framegroups file for dragon_lod1
++Used by DarkPlaces to simulate frame groups in DPM models.
++*/
++
++1 101 30 1 // dragon_lod1 idle
++102 101 30 1 // dragon_lod1 glide
++203 101 30 1 // dragon_lod1 fly
++304 26 30 0 // dragon_lod1 pain1
++330 26 30 0 // dragon_lod1 pain2
++356 51 30 0 // dragon_lod1 melee
++407 51 30 0 // dragon_lod1 fireball
++458 101 30 1 // dragon_lod1 dying
++559 26 30 0 // dragon_lod1 dead
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..4b019082e3d37300536bdefb757b0ada87fcfe66
new file mode 100644 (file)
Binary files differ
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..06b76a9e4a38d50f7876a73392f7eff9c27deee8
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,14 @@@
++/*
++Generated framegroups file for dragon_lod2
++Used by DarkPlaces to simulate frame groups in DPM models.
++*/
++
++1 101 30 1 // dragon_lod2 idle
++102 101 30 1 // dragon_lod2 glide
++203 101 30 1 // dragon_lod2 fly
++304 26 30 0 // dragon_lod2 pain1
++330 26 30 0 // dragon_lod2 pain2
++356 51 30 0 // dragon_lod2 melee
++407 51 30 0 // dragon_lod2 fireball
++458 101 30 1 // dragon_lod2 dying
++559 26 30 0 // dragon_lod2 dead
index 6499a683e8f4c2cf198be39cb0bee2c9eb9e9a3f,6499a683e8f4c2cf198be39cb0bee2c9eb9e9a3f..ebec91d625254ee9fd66a6048661b4af2ce98f39
@@@ -26,8 -26,8 +26,10 @@@ void CSQCModel_Hook_PreDraw(entity this
  .int lodmodelindex0;
  .int lodmodelindex1;
  .int lodmodelindex2;
--void CSQCPlayer_LOD_Apply(entity this)
++void CSQCPlayer_LOD_Apply(entity this, bool isplayer)
  {
++      int detailreduction = ((isplayer) ? autocvar_cl_playerdetailreduction : autocvar_cl_modeldetailreduction);
++
        // LOD model loading
        if(this.lodmodelindex0 != this.modelindex)
        {
        }
  
        // apply LOD
--      if(autocvar_cl_playerdetailreduction <= 0)
++      if(detailreduction <= 0)
        {
--              if(autocvar_cl_playerdetailreduction <= -2)
++              if(detailreduction <= -2)
                        this.modelindex = this.lodmodelindex2;
--              else if(autocvar_cl_playerdetailreduction <= -1)
++              else if(detailreduction <= -1)
                        this.modelindex = this.lodmodelindex1;
                else
                        this.modelindex = this.lodmodelindex0;
@@@ -78,7 -78,7 +80,7 @@@
        else
        {
                float distance = vlen(this.origin - view_origin);
--              float f = (distance * current_viewzoom + 100.0) * autocvar_cl_playerdetailreduction;
++              float f = (distance * current_viewzoom + 100.0) * detailreduction;
                f *= 1.0 / bound(0.01, view_quality, 1);
                if(f > autocvar_cl_loddistance2)
                        this.modelindex = this.lodmodelindex2;
@@@ -613,7 -613,7 +615,7 @@@ void CSQCModel_Hook_PreDraw(entity this
        if(this.isplayermodel) // this checks if it's a player MODEL!
        {
                CSQCPlayer_ModelAppearance_Apply(this, this.entnum == player_localnum + 1);
--              CSQCPlayer_LOD_Apply(this);
++              CSQCPlayer_LOD_Apply(this, true);
  
                if(!isplayer)
                {
                        }
                }
        }
++      else
++              CSQCPlayer_LOD_Apply(this, false);
  
        CSQCModel_AutoTagIndex_Apply(this);
  
Simple merge
index d8fab86697123c7ed7ebb2c70b0b7e70c7ef78e6,0000000000000000000000000000000000000000..d49bfd4e51c202d994ec4e2f0cad610093d624d3
mode 100644,000000..100644
--- /dev/null
@@@ -1,284 -1,0 +1,284 @@@
-               Damage(trace_ent, this, this, (autocvar_g_monster_golem_attack_smash_damage) * MONSTER_SKILLMOD(this), DEATH_MONSTER_GOLEM_SMASH.m_id, trace_ent.origin, normalize(trace_ent.origin - this.origin));
 +#include "golem.qh"
 +
 +#ifdef SVQC
 +float autocvar_g_monster_golem_health;
 +float autocvar_g_monster_golem_damageforcescale = 0.1;
 +float autocvar_g_monster_golem_attack_smash_damage;
 +float autocvar_g_monster_golem_attack_smash_range;
 +float autocvar_g_monster_golem_attack_claw_damage;
 +float autocvar_g_monster_golem_attack_lightning_damage;
 +float autocvar_g_monster_golem_attack_lightning_damage_zap = 15;
 +float autocvar_g_monster_golem_attack_lightning_force;
 +float autocvar_g_monster_golem_attack_lightning_radius;
 +float autocvar_g_monster_golem_attack_lightning_radius_zap;
 +float autocvar_g_monster_golem_attack_lightning_speed;
 +float autocvar_g_monster_golem_attack_lightning_speed_up;
 +float autocvar_g_monster_golem_speed_stop;
 +float autocvar_g_monster_golem_speed_run;
 +float autocvar_g_monster_golem_speed_walk;
 +
 +/*
 +const float golem_anim_stand          = 0;
 +const float golem_anim_walk           = 1;
 +const float golem_anim_run            = 2;
 +const float golem_anim_smash          = 3;
 +const float golem_anim_swingr = 4;
 +const float golem_anim_swingl = 5;
 +const float golem_anim_magic          = 6;
 +const float golem_anim_pain           = 7;
 +const float golem_anim_death          = 8;
 +*/
 +
 +.float golem_lastattack; // delay attacks separately
 +
 +void M_Golem_Attack_Smash(entity this)
 +{
 +      makevectors(this.angles);
 +      Send_Effect(EFFECT_EXPLOSION_MEDIUM, (this.origin + (v_forward * 150)) - ('0 0 1' * this.maxs.z), '0 0 0', 1);
 +      sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
 +
 +      // RadiusDamage does NOT support custom starting location, which means we must use this hack...
 +
 +      tracebox(this.origin + v_forward * 50, this.mins * 0.5, this.maxs * 0.5, this.origin + v_forward * autocvar_g_monster_golem_attack_smash_range, MOVE_NORMAL, this);
 +
 +      if(trace_ent.takedamage)
-                                       NULL, NULL, (autocvar_g_monster_golem_attack_lightning_force), this.projectiledeathtype, directhitentity);
++              Damage(trace_ent, this, this, (autocvar_g_monster_golem_attack_smash_damage) * MONSTER_SKILLMOD(this), DEATH_MONSTER_GOLEM_SMASH.m_id, DMG_NOWEP, trace_ent.origin, normalize(trace_ent.origin - this.origin));
 +}
 +
 +void M_Golem_Attack_Swing(entity this)
 +{
 +      Monster_Attack_Melee(this, this.enemy, (autocvar_g_monster_golem_attack_claw_damage), ((random() >= 0.5) ? this.anim_melee2 : this.anim_melee3), this.attack_range, 0.8, DEATH_MONSTER_GOLEM_CLAW.m_id, true);
 +}
 +
 +#include <common/effects/qc/_mod.qh>
 +
 +void M_Golem_Attack_Lightning_Explode(entity this, entity directhitentity)
 +{
 +      sound(this, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM);
 +      Send_Effect(EFFECT_ELECTRO_IMPACT, this.origin, '0 0 0', 1);
 +
 +      this.event_damage = func_null;
 +      this.takedamage = DAMAGE_NO;
 +      set_movetype(this, MOVETYPE_NONE);
 +      this.velocity = '0 0 0';
 +
 +      if(this.move_movetype == MOVETYPE_NONE)
 +              this.velocity = this.oldvelocity;
 +
 +      RadiusDamage (this, this.realowner, (autocvar_g_monster_golem_attack_lightning_damage), (autocvar_g_monster_golem_attack_lightning_damage), (autocvar_g_monster_golem_attack_lightning_radius),
-               Damage(it, this, this.realowner, (autocvar_g_monster_golem_attack_lightning_damage_zap) * MONSTER_SKILLMOD(this), DEATH_MONSTER_GOLEM_ZAP.m_id, it.origin, '0 0 0');
++                                      NULL, NULL, (autocvar_g_monster_golem_attack_lightning_force), this.projectiledeathtype, DMG_NOWEP, directhitentity);
 +
 +      FOREACH_ENTITY_RADIUS(this.origin, autocvar_g_monster_golem_attack_lightning_radius_zap, it != this.realowner && it.takedamage,
 +      {
 +              te_csqc_lightningarc(this.origin, it.origin);
- void M_Golem_Attack_Lightning_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
++              Damage(it, this, this.realowner, (autocvar_g_monster_golem_attack_lightning_damage_zap) * MONSTER_SKILLMOD(this), DEATH_MONSTER_GOLEM_ZAP.m_id, DMG_NOWEP, it.origin, '0 0 0');
 +      });
 +
 +      setthink(this, SUB_Remove);
 +      this.nextthink = time + 0.2;
 +}
 +
 +void M_Golem_Attack_Lightning_Explode_use(entity this, entity actor, entity trigger)
 +{
 +      M_Golem_Attack_Lightning_Explode(this, trigger);
 +}
 +
++void M_Golem_Attack_Lightning_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
 +{
 +      if (this.health <= 0)
 +              return;
 +
 +      if (!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
 +              return; // g_projectiles_damage says to halt
 +
 +      this.health = this.health - damage;
 +
 +      if (this.health <= 0)
 +              W_PrepareExplosionByDamage(this, attacker, adaptor_think2use);
 +}
 +
 +void M_Golem_Attack_Lightning_Touch(entity this, entity toucher)
 +{
 +      PROJECTILE_TOUCH(this, toucher);
 +
 +      this.use(this, NULL, toucher);
 +}
 +
 +void M_Golem_Attack_Lightning_Think(entity this)
 +{
 +      this.nextthink = time;
 +      if (time > this.cnt)
 +      {
 +              M_Golem_Attack_Lightning_Explode(this, NULL);
 +              return;
 +      }
 +}
 +
 +void M_Golem_Attack_Lightning(entity this)
 +{
 +      entity gren;
 +
 +      monster_makevectors(this, this.enemy);
 +
 +      gren = new(grenade);
 +      gren.owner = gren.realowner = this;
 +      gren.bot_dodge = true;
 +      gren.bot_dodgerating = (autocvar_g_monster_golem_attack_lightning_damage);
 +      set_movetype(gren, MOVETYPE_BOUNCE);
 +      PROJECTILE_MAKETRIGGER(gren);
 +      gren.projectiledeathtype = DEATH_MONSTER_GOLEM_ZAP.m_id;
 +      setorigin(gren, CENTER_OR_VIEWOFS(this));
 +      setsize(gren, '-8 -8 -8', '8 8 8');
 +      gren.scale = 2.5;
 +
 +      gren.cnt = time + 5;
 +      gren.nextthink = time;
 +      setthink(gren, M_Golem_Attack_Lightning_Think);
 +      gren.use = M_Golem_Attack_Lightning_Explode_use;
 +      settouch(gren, M_Golem_Attack_Lightning_Touch);
 +
 +      gren.takedamage = DAMAGE_YES;
 +      gren.health = 50;
 +      gren.damageforcescale = 0;
 +      gren.event_damage = M_Golem_Attack_Lightning_Damage;
 +      gren.damagedbycontents = true;
 +      IL_PUSH(g_damagedbycontents, gren);
 +      gren.missile_flags = MIF_SPLASH | MIF_ARC;
 +      W_SetupProjVelocity_Explicit(gren, v_forward, v_up, (autocvar_g_monster_golem_attack_lightning_speed), (autocvar_g_monster_golem_attack_lightning_speed_up), 0, 0, false);
 +
 +      gren.angles = vectoangles (gren.velocity);
 +      gren.flags = FL_PROJECTILE;
 +      IL_PUSH(g_projectiles, gren);
 +      IL_PUSH(g_bot_dodge, gren);
 +
 +      CSQCProjectile(gren, true, PROJECTILE_GOLEM_LIGHTNING, true);
 +}
 +
 +.int state;
 +
 +bool M_Golem_Attack(int attack_type, entity actor, entity targ, .entity weaponentity)
 +{
 +      switch(attack_type)
 +      {
 +              case MONSTER_ATTACK_MELEE:
 +              {
 +                      int swing_cnt = bound(1, floor(random() * 4), 3);
 +                      Monster_Delay(actor, swing_cnt, 0.5, M_Golem_Attack_Swing);
 +                      actor.anim_finished = actor.attack_finished_single[0] = time + (0.5 * swing_cnt); // set this for the delay
 +                      return true;
 +              }
 +              case MONSTER_ATTACK_RANGED:
 +              {
 +                      float randomness = random();
 +
 +                      if(time >= actor.golem_lastattack) // golem doesn't attack much
 +                      if(IS_ONGROUND(actor))
 +                      if(randomness <= 0.5 && vdist(actor.enemy.origin - actor.origin, <=, autocvar_g_monster_golem_attack_smash_range))
 +                      {
 +                              setanim(actor, actor.anim_melee2, true, true, false);
 +                              Monster_Delay(actor, 1, 0.7, M_Golem_Attack_Smash);
 +                              actor.attack_finished_single[0] = time + 1.1;
 +                              actor.anim_finished = time + 1.1;
 +                              actor.state = MONSTER_ATTACK_MELEE; // kinda a melee attack
 +                              actor.golem_lastattack = time + 3 + random() * 1.5;
 +                              return true;
 +                      }
 +                      else if(randomness <= 0.1 && vdist(actor.enemy.origin - actor.origin, >=, autocvar_g_monster_golem_attack_smash_range * 1.5)) // small chance, don't want this spammed
 +                      {
 +                              setanim(actor, actor.anim_shoot, true, true, false);
 +                              actor.state = MONSTER_ATTACK_MELEE; // maybe we should rename this to something more general
 +                              actor.attack_finished_single[0] = time + 1.1;
 +                              actor.anim_finished = 1.1;
 +                              actor.golem_lastattack = time + 3 + random() * 1.5;
 +                              Monster_Delay(actor, 1, 0.6, M_Golem_Attack_Lightning);
 +                              return true;
 +                      }
 +
 +                      return false;
 +              }
 +      }
 +
 +      return false;
 +}
 +
 +spawnfunc(monster_golem) { Monster_Spawn(this, true, MON_GOLEM.monsterid); }
 +// compatibility
 +spawnfunc(monster_shambler) { spawnfunc_monster_golem(this); }
 +#endif // SVQC
 +
 +#ifdef SVQC
 +METHOD(Golem, mr_think, bool(Golem this, entity actor))
 +{
 +    TC(Golem, this);
 +    return true;
 +}
 +
 +METHOD(Golem, mr_pain, float(Golem this, entity actor, float damage_take, entity attacker, float deathtype))
 +{
 +    TC(Golem, this);
 +    actor.pain_finished = time + 0.5;
 +    setanim(actor, actor.anim_pain1, true, true, false);
 +    return damage_take;
 +}
 +
 +METHOD(Golem, mr_death, bool(Golem this, entity actor))
 +{
 +    TC(Golem, this);
 +    setanim(actor, actor.anim_die1, false, true, true);
 +    return true;
 +}
 +#endif
 +#ifdef GAMEQC
 +METHOD(Golem, mr_anim, bool(Golem this, entity actor))
 +{
 +    TC(Golem, this);
 +    vector none = '0 0 0';
 +    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_melee1 = animfixfps(actor, '3 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_melee4 = animfixfps(actor, '6 1 5', none); // analyze models and set framerate
 +    actor.anim_pain1 = animfixfps(actor, '7 1 2', none); // 0.5 seconds
 +    actor.anim_pain2 = animfixfps(actor, '8 1 2', none); // 0.5 seconds
 +    //actor.anim_pain3 = animfixfps(actor, '9 1 2', none); // 0.5 seconds
 +    //actor.anim_pain4 = animfixfps(actor, '10 1 2', none); // 0.5 seconds
 +    //actor.anim_pain5 = animfixfps(actor, '11 1 2', none); // 0.5 seconds
 +    //actor.anim_sight = animfixfps(actor, '12 1 5', none); // analyze models and set framerate
 +    actor.anim_die1 = animfixfps(actor, '13 1 0.5', none); // 2 seconds
 +    actor.anim_die2 = animfixfps(actor, '14 1 0.5', none); // 2 seconds
 +    //actor.anim_dead = animfixfps(actor, '15 1 0.5', none); // 2 seconds
 +    //actor.anim_dieback = animfixfps(actor, '16 1 0.5', none); // 2 seconds
 +    //actor.anim_deadback = animfixfps(actor, '17 1 0.5', none); // 2 seconds
 +    //actor.anim_dead2 = animfixfps(actor, '18 1 0.5', none); // 2 seconds
 +    //actor.anim_dead3 = animfixfps(actor, '19 1 0.5', none); // 2 seconds
 +    //actor.anim_dead4 = animfixfps(actor, '20 1 0.5', none); // 2 seconds
 +    //actor.anim_dead5 = animfixfps(actor, '21 1 0.5', none); // 2 seconds
 +    //actor.anim_dead6 = animfixfps(actor, '22 1 0.5', none); // 2 seconds
 +    return true;
 +}
 +#endif
 +#ifdef SVQC
 +.float animstate_endtime;
 +METHOD(Golem, mr_setup, bool(Golem this, entity actor))
 +{
 +    TC(Golem, this);
 +    if(!actor.health) actor.health = (autocvar_g_monster_golem_health);
 +    if(!actor.attack_range) actor.attack_range = 150;
 +    if(!actor.speed) { actor.speed = (autocvar_g_monster_golem_speed_walk); }
 +    if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_golem_speed_run); }
 +    if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_golem_speed_stop); }
 +    if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_golem_damageforcescale); }
 +
 +    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);
 +    actor.spawn_time = actor.animstate_endtime;
 +    actor.spawnshieldtime = actor.spawn_time;
 +    actor.monster_attackfunc = M_Golem_Attack;
 +
 +    return true;
 +}
 +#endif
Simple merge
Simple merge
index 6205c72da839e0268c05f930bb0bc2dc488873a6,d596d7d33bf29cda76bc76d72cf855a75d70bc88..7c0d9b38f42e0ce8c23c5c0122f07b50395d5364
@@@ -18,15 -18,10 +18,15 @@@ METHOD(WyvernAttack, wr_think, void(Wyv
      TC(WyvernAttack, thiswep);
      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);
+         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.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);
                }
  
Simple merge
Simple merge