From f26743600c2d2c6622d5dea57caae134bd1ab563 Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Sun, 22 Sep 2019 18:47:51 -0400 Subject: [PATCH] various small fixes --- source/ai_subs.qc | 4 ++-- source/c_combat.qc | 19 ++++++------------- source/c_defs.qc | 7 +++++++ source/m_boss.qc | 4 ++-- source/m_shalrath.qc | 2 +- source/m_shambler.qc | 8 +++----- source/p_weapons.qc | 5 ++--- todo | 7 +++++-- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/source/ai_subs.qc b/source/ai_subs.qc index d40a13f..821ba59 100644 --- a/source/ai_subs.qc +++ b/source/ai_subs.qc @@ -277,13 +277,13 @@ some monsters refire twice automatically void(float normal) sub_attack_finished = { self.cnt = 0; // refire count for nightmare - if(skill != 3) { + if(skill != SK_NIGHTMARE) { self.attack_finished = time + normal; } }; void(void() thinkst) sub_check_refire = { - if(skill != 3) { + if(skill != SK_NIGHTMARE) { return; } if(self.cnt == 1) { diff --git a/source/c_combat.qc b/source/c_combat.qc index cf2eaa2..13339d8 100644 --- a/source/c_combat.qc +++ b/source/c_combat.qc @@ -113,15 +113,9 @@ void(entity targ, entity inflictor, entity attacker, float damage) ent_damage = float take; // team play damage avoidance - if(teamplay == 1 && is_same_team(targ, attacker)) { - return; - } - - if(teamplay == 3 && are_both_players(targ, attacker)) { - return; - } - - if(!targ.takedamage) { + if((teamplay == 1 && is_same_team(targ, attacker)) || + (teamplay == 3 && are_both_players(targ, attacker)) || + !targ.takedamage) { return; } @@ -134,7 +128,6 @@ void(entity targ, entity inflictor, entity attacker, float damage) ent_damage = } // save damage based on the target's armor level - save = ceil(targ.armortype * damage); if(save >= targ.armorvalue) { save = targ.armorvalue; @@ -184,8 +177,8 @@ void(entity targ, entity inflictor, entity attacker, float damage) ent_damage = oldself = self; self = targ; - if((self.flags & FL_MONSTER) && attacker != world) { - // get mad unless of the same class(except for soldiers) + if(self.flags & FL_MONSTER && attacker != world) { + // get mad unless of the same class (except for soldiers) if(self != attacker && attacker != self.enemy) { if((self.classname != attacker.classname) || (self.classname == "monster_army")) { @@ -201,7 +194,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) ent_damage = if(self.th_pain) { self.th_pain(attacker, take); // nightmare mode monsters don't go into pain frames often - if(skill == 3) { + if(skill == SK_NIGHTMARE) { self.pain_finished = time + 5; } } diff --git a/source/c_defs.qc b/source/c_defs.qc index 7d51160..d68508d 100644 --- a/source/c_defs.qc +++ b/source/c_defs.qc @@ -608,6 +608,13 @@ enum { AI_MONSTER_HIGH = 48, }; +enum { + SK_EASY, + SK_NORMAL, + SK_HARD, + SK_NIGHTMARE, +}; + // super co-op additions enum { PRO_NONE, diff --git a/source/m_boss.qc b/source/m_boss.qc index 304261d..658064e 100644 --- a/source/m_boss.qc +++ b/source/m_boss.qc @@ -192,7 +192,7 @@ void(vector p) boss_missile = { org = self.origin + p_x * v_forward + p_y * v_right + p_z*'0 0 1'; // lead the player on hard mode - if(skill > 1) { + if(skill > SK_NORMAL) { t = vec_len(self.enemy.origin - org) / 300; vec = self.enemy.velocity; vec_z = 0; @@ -225,7 +225,7 @@ void() boss_awake = { set_model(self, "progs/boss.mdl"); set_size(self, '-128 -128 -24', '128 128 256'); - if(skill == 0) { + if(skill == SK_EASY) { self.health = 1; } else { self.health = 3; diff --git a/source/m_shalrath.qc b/source/m_shalrath.qc index 5cd47b7..ffcc6e5 100644 --- a/source/m_shalrath.qc +++ b/source/m_shalrath.qc @@ -158,7 +158,7 @@ void() shalrath_home = { return; } dir = normalize(vtemp - self.origin); - if(skill == 3) { + if(skill == SK_NIGHTMARE) { self.velocity = dir * 350; } else { self.velocity = dir * 250; diff --git a/source/m_shambler.qc b/source/m_shambler.qc index 8a20b13..81204ff 100644 --- a/source/m_shambler.qc +++ b/source/m_shambler.qc @@ -313,12 +313,10 @@ void() sham_magic6 = [ $magic6, sham_magic9 ] { sham_cast_lightning(); sound(self, CHAN_WEAPON, "shambler/sboom.wav", 1, ATTN_NORM); }; -void() sham_magic9 = [ $magic9, sham_magic10 ] -{sham_cast_lightning();}; -void() sham_magic10 = [ $magic10, sham_magic11 ] -{sham_cast_lightning();}; +void() sham_magic9 = [ $magic9, sham_magic10 ] {sham_cast_lightning();}; +void() sham_magic10 = [ $magic10, sham_magic11 ] {sham_cast_lightning();}; void() sham_magic11 = [ $magic11, sham_magic12 ] { - if(skill == 3) { + if(skill == SK_NIGHTMARE) { sham_cast_lightning(); } }; diff --git a/source/p_weapons.qc b/source/p_weapons.qc index 8bb399e..0b903f5 100644 --- a/source/p_weapons.qc +++ b/source/p_weapons.qc @@ -201,8 +201,7 @@ Go to the trouble of combining multiple pellets into a single damage call. ================ */ void(float shotcount, vector dir, vector spread) fire_bullets = { - vector direction; - vector src; + vector direction, src; make_vectors(self.v_angle); @@ -382,7 +381,7 @@ void(vector p1, vector p2, entity from, float damage) lightning_damage = { f_x = 0 - f_y; f_y = f_x; f_z = 0; - f = f * 16; + f *= 16; e1 = e2 = world; diff --git a/todo b/todo index c495ede..6ac2d3c 100644 --- a/todo +++ b/todo @@ -19,8 +19,7 @@ extraneous features: add expansion pack entities emotes -player sound effect option -players shoot through eachother (teamplay 4?) +player sounds option selectable player models and skins sound clips third person player weapon models @@ -38,3 +37,7 @@ no friendly fire rename all functions to be lower_underscore restart map after 10 seconds when everyone is dead users can cancel map ends (" initiated travel to ") + +rejected: + +players shoot through eachother (teamplay 4?) (can theoretically be done in quakec but the math is too complex)