Merge branch 'packer/alias_movetospec' into 'master'
authorMario <zacjardine@y7mail.com>
Fri, 15 Jan 2016 15:06:54 +0000 (15:06 +0000)
committerMario <zacjardine@y7mail.com>
Fri, 15 Jan 2016 15:06:54 +0000 (15:06 +0000)
add movetospec alias

add movetospec in addition to existing moveto... aliases

See merge request !273

mutators.cfg
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/menu/xonotic/credits.qc
qcsrc/server/g_world.qc

index 5eaa0ad..4675b00 100644 (file)
@@ -304,8 +304,11 @@ set g_buffs_medic_time 60 "medic buff carry time"
 set g_buffs_medic_survive_chance 0.6 "multiplier chance of player surviving a fatal hit"
 set g_buffs_medic_survive_health 5 "amount of health player survives with after taking a fatal hit"
 set g_buffs_medic_rot 0.2 "health rot rate multiplier"
-set g_buffs_medic_max 2.5 "stable health medic limit multiplier"
+set g_buffs_medic_max 1.5 "stable health medic limit multiplier"
 set g_buffs_medic_regen 1.7 "health medic rate multiplier"
+set g_buffs_medic_heal_amount 15 "health given to nearby players on a delay"
+set g_buffs_medic_heal_range 400 "furthest away players can be from carrier to get healed by medic buff"
+set g_buffs_medic_heal_delay 1 "delay between team healing"
 set g_buffs_vengeance 1 "vengeance buff: attackers also take damage"
 set g_buffs_vengeance_time 60 "vengeance buff carry time"
 set g_buffs_vengeance_damage_multiplier 0.6 "amount of damage dealt the attacker takes when hitting a target with vengeance"
@@ -337,7 +340,7 @@ set g_buffs_flight_time 60 "flight buff carry time"
 set g_buffs_flight_gravity 0.3 "player gravity multiplier while holding flight buff"
 set g_buffs_invisible 1 "invisible buff: carrier becomes invisible"
 set g_buffs_invisible_time 60 "invisible buff carry time"
-set g_buffs_invisible_alpha 0.4 "player invisibility multiplier while holding invisible buff"
+set g_buffs_invisible_alpha 0.15 "player invisibility multiplier while holding invisible buff"
 set g_buffs_inferno 1 "inferno buff: targets damaged by player carrying inferno buff will also receive burning damage"
 set g_buffs_inferno_time 60 "inferno buff carry time"
 set g_buffs_inferno_damagemultiplier 0.05 "multiplier of damage dealt during burn"
@@ -348,9 +351,10 @@ set g_buffs_inferno_burntime_target_time 5 "seconds of burn given g_buffs_infern
 set g_buffs_swapper 0 "swapper buff: press dropweapon to switch places with a nearby enemy"
 set g_buffs_swapper_time 60 "swapper buff carry time"
 set g_buffs_swapper_range 1500 "maximum range of swapping with enemy"
-set g_buffs_magnet 0 "magnet buff: greatly increased item pickup range"
+set g_buffs_magnet 1 "magnet buff: greatly increased item pickup range"
 set g_buffs_magnet_time 60 "magnet buff carry time"
-set g_buffs_magnet_range_item 450 "item pickup range"
+set g_buffs_magnet_range_item 350 "range around player that items are automatically picked up (excludes other buffs)"
+set g_buffs_magnet_range_buff 200 "range around player that only buffs are picked up (drops magnet buff)"
 
 
 // ==============
index 117d2db..0b3f4ee 100644 (file)
@@ -19,6 +19,9 @@ float autocvar_g_buffs_medic_survive_health;
 float autocvar_g_buffs_medic_rot;
 float autocvar_g_buffs_medic_max;
 float autocvar_g_buffs_medic_regen;
+float autocvar_g_buffs_medic_heal_amount = 15;
+float autocvar_g_buffs_medic_heal_delay = 1;
+float autocvar_g_buffs_medic_heal_range = 400;
 float autocvar_g_buffs_vengeance_damage_multiplier;
 float autocvar_g_buffs_bash_force;
 float autocvar_g_buffs_bash_force_self;
@@ -42,6 +45,7 @@ float autocvar_g_buffs_inferno_burntime_target_time;
 float autocvar_g_buffs_inferno_damagemultiplier;
 float autocvar_g_buffs_swapper_range;
 float autocvar_g_buffs_magnet_range_item;
+float autocvar_g_buffs_magnet_range_buff = 200;
 
 // ammo
 .float buff_ammo_prev_infitems;
@@ -50,6 +54,8 @@ float autocvar_g_buffs_magnet_range_item;
 .float buff_invisible_prev_alpha;
 // flight
 .float buff_flight_prev_gravity;
+// medic
+.float buff_medic_healtime;
 // disability
 .float buff_disability_time;
 .float buff_disability_effect_time;
@@ -490,6 +496,20 @@ void buff_Vengeance_DelayedDamage()
        return;
 }
 
+// note: only really useful in teamplay
+void buff_Medic_Heal(entity this)
+{
+       FOREACH_CLIENT(IS_PLAYER(it) && it != this && vdist(it.origin - this.origin, <=, autocvar_g_buffs_medic_heal_range),
+       {
+               if(SAME_TEAM(it, this))
+               if(it.health < autocvar_g_balance_health_regenstable)
+               {
+                       Send_Effect(EFFECT_HEALING, it.origin, '0 0 0', 1);
+                       it.health = bound(0, it.health + autocvar_g_buffs_medic_heal_amount, autocvar_g_balance_health_regenstable);
+               }
+       });
+}
+
 float buff_Inferno_CalculateTime(float x, float offset_x, float offset_y, float intersect_x, float intersect_y, float base)
 {
        return offset_y + (intersect_y - offset_y) * logn(((x - offset_x) * ((base - 1) / intersect_x)) + 1, base);
@@ -558,18 +578,17 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerDamage_Calculate)
        if(frag_target != frag_attacker)
                frag_target.buff_disability_time = time + autocvar_g_buffs_disability_slowtime;
 
-       if(frag_attacker.buffs & BUFF_MEDIC.m_itemid)
-       if(DEATH_WEAPONOF(frag_deathtype) != WEP_ARC)
-       if(SAME_TEAM(frag_attacker, frag_target))
-       if(frag_attacker != frag_target)
+       if(frag_target.buffs & BUFF_INFERNO.m_itemid)
        {
-               frag_target.health = min(g_pickup_healthmega_max, frag_target.health + frag_damage);
-               frag_damage = 0;
+               if(frag_deathtype == DEATH_FIRE.m_id)
+                       frag_damage = 0;
+               if(frag_deathtype == DEATH_LAVA.m_id)
+                       frag_damage *= 0.5; // TODO: cvarize?
        }
 
        if(frag_attacker.buffs & BUFF_INFERNO.m_itemid)
        if(frag_target != frag_attacker) {
-               float time = buff_Inferno_CalculateTime(
+               float btime = buff_Inferno_CalculateTime(
                        frag_damage,
                        0,
                        autocvar_g_buffs_inferno_burntime_min_time,
@@ -577,7 +596,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerDamage_Calculate)
                        autocvar_g_buffs_inferno_burntime_target_time,
                        autocvar_g_buffs_inferno_burntime_factor
                );
-               Fire_AddDamage(frag_target, frag_attacker, (frag_damage * autocvar_g_buffs_inferno_damagemultiplier) * time, time, DEATH_BUFF.m_id);
+               Fire_AddDamage(frag_target, frag_attacker, (frag_damage * autocvar_g_buffs_inferno_damagemultiplier), btime, DEATH_BUFF.m_id);
        }
 
        // this... is ridiculous (TODO: fix!)
@@ -869,17 +888,24 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerPreThink)
 
        if(self.buffs & BUFF_MAGNET.m_itemid)
        {
-               vector pickup_size = '1 1 1' * autocvar_g_buffs_magnet_range_item;
-               for(other = world; (other = findflags(other, flags, FL_ITEM)); )
-               if(boxesoverlap(self.absmin - pickup_size, self.absmax + pickup_size, other.absmin, other.absmax))
+               vector pickup_size;
+               FOREACH_ENTITY_FLAGS(flags, FL_ITEM,
                {
-                       setself(other);
-                       other = this;
-                       if(self.touch)
-                               self.touch();
-                       other = self;
-                       setself(this);
-               }
+                       if(it.buffs)
+                               pickup_size = '1 1 1' * autocvar_g_buffs_magnet_range_buff;
+                       else
+                               pickup_size = '1 1 1' * autocvar_g_buffs_magnet_range_item;
+
+                       if(boxesoverlap(self.absmin - pickup_size, self.absmax + pickup_size, it.absmin, it.absmax))
+                       {
+                               setself(other);
+                               other = this;
+                               if(self.touch)
+                                       self.touch();
+                               other = self;
+                               setself(this);
+                       }
+               });
        }
 
        if(self.buffs & BUFF_AMMO.m_itemid)
@@ -890,6 +916,13 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerPreThink)
        if(self.alpha != autocvar_g_buffs_invisible_alpha)
                self.alpha = autocvar_g_buffs_invisible_alpha; // powerups reset alpha, so we must enforce this (TODO)
 
+       if(self.buffs & BUFF_MEDIC.m_itemid)
+       if(time >= self.buff_medic_healtime)
+       {
+               buff_Medic_Heal(self);
+               self.buff_medic_healtime = time + autocvar_g_buffs_medic_heal_delay;
+       }
+
 #define BUFF_ONADD(b) if ( (self.buffs & (b).m_itemid) && !(self.oldbuffs & (b).m_itemid))
 #define BUFF_ONREM(b) if (!(self.buffs & (b).m_itemid) &&  (self.oldbuffs & (b).m_itemid))
 
index e3a8dec..d9a1ecb 100644 (file)
        NL() \
        NL() \
        TITLE(_("Game Engine")) \
-               FUNCTION(_("DarkPlaces")) \
+               FUNCTION("DarkPlaces") \
                        PERSON(Forest "LordHavoc" Hale) \
                NL() \
                FUNCTION(_("Engine Additions")) \
                NL() \
        NL() \
        TITLE(_("Compiler")) \
-               FUNCTION(_("GMQCC")) \
+               FUNCTION("GMQCC") \
                        PERSON(Wolfgang "Blub\0" Bumiller) \
                        PERSON(Dale "graphitemaster" Weiler) \
                NL() \
index 7f831d2..160be73 100644 (file)
@@ -583,9 +583,12 @@ spawnfunc(worldspawn)
                        // Only ever use versioned csprogs.dat files on dedicated servers;
                        // we need to reset csqc_progname on clients ourselves, and it's easier if the client's release name is constant
                        string pk3csprogs = "csprogs-" WATERMARK ".dat";
-                       if (cvar_string_normal("csqc_progname") != pk3csprogs && fexists(pk3csprogs))
+                       // This always works; fall back to it if a versioned csprogs.dat is suddenly missing
+                       string select = "csprogs.dat";
+                       if (fexists(pk3csprogs)) select = pk3csprogs;
+                       if (cvar_string_normal("csqc_progname") != select)
                        {
-                               cvar_set_normal("csqc_progname", pk3csprogs);
+                               cvar_set_normal("csqc_progname", select);
                                wantrestart = true;
                        }
                        // Check for updates on startup
@@ -616,8 +619,12 @@ spawnfunc(worldspawn)
                                }
                        }
                }
-               if (wantrestart) changelevel(mapname);
-               // let initialization continue, shutdown depends on it
+               if (wantrestart)
+               {
+                       LOG_INFOF("Restart requested\n");
+                       changelevel(mapname);
+                       // let initialization continue, shutdown depends on it
+               }
        }
 
        float fd, l;