]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'sev/luma-menu-update' into 'master'
authorMario <zacjardine@y7mail.com>
Mon, 1 Oct 2018 11:47:06 +0000 (11:47 +0000)
committerMario <zacjardine@y7mail.com>
Mon, 1 Oct 2018 11:47:06 +0000 (11:47 +0000)
Minor Luma menu theme update

See merge request xonotic/xonotic-data.pk3dir!604

27 files changed:
bal-wep-xdf.cfg
binds-xonotic.cfg
gamemodes-server.cfg
gfx/menu/luma/icon_mod_XDF.tga [deleted file]
gfx/menu/luma/icon_mod_xdf.tga [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/duel/sv_duel.qc
qcsrc/common/gamemodes/gamemode/duel/sv_duel.qh
qcsrc/common/mapobjects/func/button.qc
qcsrc/common/mutators/mutator/overkill/okmachinegun.qh
qcsrc/common/mutators/mutator/overkill/oknex.qh
qcsrc/common/mutators/mutator/overkill/okrpc.qc
qcsrc/common/mutators/mutator/overkill/okshotgun.qh
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/menu/xonotic/keybinder.qc
qcsrc/server/clientkill.qc
qcsrc/server/command/cmd.qc
qcsrc/server/g_damage.qc
qcsrc/server/weapons/accuracy.qc
qcsrc/server/weapons/accuracy.qh
qcsrc/server/weapons/tracing.qc
ruleset-XPM.cfg
vehicles.cfg [new file with mode: 0644]
xonotic-server.cfg

index 2e0e74aa3d7a993b7a97f1ac1b43f9ead3bbc797..13bdc529a9f7364e36ce66ec85b596732e2b0f7b 100644 (file)
@@ -762,11 +762,11 @@ set g_balance_arc_bolt_ammo 1
 set g_balance_arc_bolt_damage 25
 set g_balance_arc_bolt_damageforcescale 0
 set g_balance_arc_bolt_edgedamage 12.5
-set g_balance_arc_bolt_force 120
+set g_balance_arc_bolt_force 200
 set g_balance_arc_bolt_health 15
 set g_balance_arc_bolt_lifetime 5
 set g_balance_arc_bolt_radius 65
-set g_balance_arc_bolt_refire 0.16667
+set g_balance_arc_bolt_refire 0.033333
 set g_balance_arc_bolt_speed 2300
 set g_balance_arc_bolt_spread 0
 set g_balance_arc_burst_ammo 15
index 18ee7ea28f1a100f21e29c8e0aed1d0c9fece23e..611f5da95a867d7be500d8caf38b8a84038f12e0 100644 (file)
@@ -40,6 +40,7 @@ bind MWHEELUP weapnext
 bind MWHEELDOWN weapprev
 bind r reload
 bind BACKSPACE dropweapon
+bind k kill
 bind g dropweapon
 bind f +use
 bind v +button8 // drag object
index 7cc47c3639858e77f0aea47961a61ecd86bd5378..530e8881891057894e6437094d58ef4954641c1f 100644 (file)
@@ -539,3 +539,5 @@ set g_invasion_type 0 "type of invasion mode - 0: round-based, 1: hunting, 2: co
 //  duel
 // ======
 set g_duel 0 "Duel: frag the opponent more in a one versus one arena battle"
+set g_duel_warmup 1 "Have a short warmup period before beginning the actual duel"
+set g_duel_with_powerups 0 "Enable powerups to spawn in the duel gamemode"
diff --git a/gfx/menu/luma/icon_mod_XDF.tga b/gfx/menu/luma/icon_mod_XDF.tga
deleted file mode 100644 (file)
index 6749a48..0000000
Binary files a/gfx/menu/luma/icon_mod_XDF.tga and /dev/null differ
diff --git a/gfx/menu/luma/icon_mod_xdf.tga b/gfx/menu/luma/icon_mod_xdf.tga
new file mode 100644 (file)
index 0000000..6749a48
Binary files /dev/null and b/gfx/menu/luma/icon_mod_xdf.tga differ
index 7e4c891e6440da0a58553045438f9a27eaca35f1..ab01f64ee7dfefc6a5ebaaa15740fff29a3e498c 100644 (file)
@@ -2,7 +2,8 @@
 
 MUTATOR_HOOKFUNCTION(duel, ReadLevelCvars)
 {
-       warmup_stage = 1;
+       if(autocvar_g_duel_warmup)
+               warmup_stage = 1; // otherwise allow it if it's enabled
        //sv_ready_restart_after_countdown = 0;
 }
 
@@ -16,3 +17,13 @@ MUTATOR_HOOKFUNCTION(duel, Scores_CountFragsRemaining)
        // announce remaining frags?
        return true;
 }
+
+MUTATOR_HOOKFUNCTION(duel, FilterItemDefinition)
+{
+       entity definition = M_ARGV(0, entity);
+
+       if(definition.instanceOfPowerup)
+       {
+               return !autocvar_g_duel_with_powerups;
+       }
+}
index 9a0d716b920a1aa660c150ef7ae0fc5946036b54..705bedc47e9a3e9a5e644c6ab860fd108c3530b3 100644 (file)
@@ -6,3 +6,6 @@ REGISTER_MUTATOR(duel, false)
     MUTATOR_STATIC();
        return 0;
 }
+
+bool autocvar_g_duel_with_powerups;
+bool autocvar_g_duel_warmup = true;
index a8537f172534225adce4855a8713e34fdaecbcfb..024d5cfd873cfb37d288785876d4e4c0684a681f 100644 (file)
@@ -5,6 +5,43 @@
 void button_wait(entity this);
 void button_return(entity this);
 
+// in case button is deactivated by a relay_deactivate while it pressed down
+// set both fields to -1 in button_return!!
+.float wait_remaining;
+.float activation_time;
+
+void button_setactive(entity this, int astate)
+{
+       int oldstate = this.active;
+       if (astate == ACTIVE_TOGGLE)
+       {
+               if (this.active == ACTIVE_ACTIVE)
+                       this.active = ACTIVE_NOT;
+               else
+                       this.active = ACTIVE_ACTIVE;
+       }
+       else
+               this.active = astate;
+
+       if (this.active == ACTIVE_ACTIVE && oldstate == ACTIVE_NOT)
+       {
+               // button was deactivated while it was pressed
+               if (this.wait_remaining >= 0)
+               {
+                       this.nextthink =  this.wait_remaining + this.ltime;
+                       setthink(this, button_return);
+               }
+       }
+       else if (this.active == ACTIVE_NOT && oldstate == ACTIVE_ACTIVE)
+       {
+               // check if button is in pressed state
+               if (this.activation_time >= 0)
+               {
+                       this.wait_remaining = this.wait - (time - this.activation_time);
+               }
+       }
+}
+
 void button_wait(entity this)
 {
        this.state = STATE_TOP;
@@ -24,11 +61,17 @@ void button_done(entity this)
 
 void button_return(entity this)
 {
+       if (this.active != ACTIVE_ACTIVE)
+       {
+               return;
+       }
        this.state = STATE_DOWN;
        SUB_CalcMove (this, this.pos1, TSPEED_LINEAR, this.speed, button_done);
        this.frame = 0;                 // use normal textures
        if (GetResourceAmount(this, RESOURCE_HEALTH))
                this.takedamage = DAMAGE_YES;   // can be shot again
+       this.wait_remaining = -1;
+       this.activation_time = -1;
 }
 
 
@@ -46,6 +89,8 @@ void button_fire(entity this)
        if (this.state == STATE_UP || this.state == STATE_TOP)
                return;
 
+       this.activation_time = time;
+
        if (this.noise != "")
                _sound (this, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
 
@@ -60,6 +105,9 @@ void button_reset(entity this)
        this.frame = 0;                 // use normal textures
        this.state = STATE_BOTTOM;
        this.velocity = '0 0 0';
+       this.wait_remaining = -1;
+       this.activation_time = -1;
+       this.active = ACTIVE_ACTIVE;
        setthink(this, func_null);
        this.nextthink = 0;
        if (GetResourceAmount(this, RESOURCE_HEALTH))
@@ -77,6 +125,8 @@ void button_use(entity this, entity actor, entity trigger)
 
 void button_touch(entity this, entity toucher)
 {
+       if (this.active != ACTIVE_ACTIVE)
+               return;
        if (!toucher)
                return;
        if (!toucher.iscreature)
@@ -91,6 +141,8 @@ void button_touch(entity this, entity toucher)
 
 void button_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
 {
+       if (this.active != ACTIVE_ACTIVE)
+               return;
        if(this.spawnflags & NOSPLASH)
                if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
                        return;
@@ -157,9 +209,10 @@ spawnfunc(func_button)
     if(this.noise != "")
         precache_sound(this.noise);
 
-       this.active = ACTIVE_ACTIVE;
        this.draggable = drag_undraggable;
 
+       this.setactive = button_setactive;
+
        this.pos1 = this.origin;
        this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip);
     this.flags |= FL_NOTARGET;
index 997b49de9d6161aab5b74374d8498f790b6107e3..32176da90a3b1713080854ec37508d1700a75b7f 100644 (file)
@@ -4,7 +4,7 @@ CLASS(OverkillMachineGun, Weapon)
 /* spawnfunc */ ATTRIB(OverkillMachineGun, m_canonical_spawnfunc, string, "weapon_okmachinegun");
 /* ammotype  */ ATTRIB(OverkillMachineGun, ammo_type, int, RESOURCE_BULLETS);
 /* impulse   */ ATTRIB(OverkillMachineGun, impulse, int, 3);
-/* flags        */ ATTRIB(OverkillMachineGun, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS | WEP_FLAG_MUTATORBLOCKED);
+/* flags        */ ATTRIB(OverkillMachineGun, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS | WEP_FLAG_MUTATORBLOCKED);
 /* rating      */ ATTRIB(OverkillMachineGun, bot_pickupbasevalue, float, 7000);
 /* color        */ ATTRIB(OverkillMachineGun, wpcolor, vector, '1 1 0');
 /* modelname */ ATTRIB(OverkillMachineGun, mdl, string, "ok_mg");
index f38588e39e6a9a2ef11804b6edea7711e821d30e..ec8ceeb3902df4ed2cbdc7affa69d654cc9448c8 100644 (file)
@@ -4,7 +4,7 @@ CLASS(OverkillNex, Weapon)
 /* spawnfunc */ ATTRIB(OverkillNex, m_canonical_spawnfunc, string, "weapon_oknex");
 /* ammotype  */ ATTRIB(OverkillNex, ammo_type, int, RESOURCE_CELLS);
 /* impulse   */ ATTRIB(OverkillNex, impulse, int, 7);
-/* flags     */ ATTRIB(OverkillNex, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_MUTATORBLOCKED);
+/* flags     */ ATTRIB(OverkillNex, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_MUTATORBLOCKED);
 /* rating    */ ATTRIB(OverkillNex, bot_pickupbasevalue, float, 8000);
 /* color     */ ATTRIB(OverkillNex, wpcolor, vector, '0.5 1 1');
 /* modelname */ ATTRIB(OverkillNex, mdl, string, "ok_sniper");
index 859d8dc9952b6743f1e045ca9736a124dd413376..50c842d9844144c6c5da0b60ed31f41c9c7cd33b 100644 (file)
@@ -14,7 +14,7 @@ void W_OverkillRocketPropelledChainsaw_Explode(entity this, entity directhitenti
        {
                // if chainsaw hit something, it removed fired damage (so that direct hit is 100%)
                // now that we also damaged something by explosion we'd go over 100% so let's add the fired damage back
-               accuracy_add(this.realowner, DEATH_WEAPONOF(this.projectiledeathtype).m_id, WEP_CVAR(okrpc, damage), 0);
+               accuracy_add(this.realowner, DEATH_WEAPONOF(this.projectiledeathtype), WEP_CVAR(okrpc, damage), 0);
        }
 
        delete(this);
@@ -71,7 +71,7 @@ void W_OverkillRocketPropelledChainsaw_Think(entity this)
                                // We remove it here so that a direct hit that passes through and doesn't damage anything by the explosion later is still 100%.
                                float fired_damage = WEP_CVAR_PRI(okrpc, damage2) - WEP_CVAR_PRI(okrpc, damage);
                                float hit_damage = WEP_CVAR_PRI(okrpc, damage2);
-                               accuracy_add(this.realowner, DEATH_WEAPONOF(this.projectiledeathtype).m_id, fired_damage, hit_damage);
+                               accuracy_add(this.realowner, DEATH_WEAPONOF(this.projectiledeathtype), fired_damage, hit_damage);
                        }
                        this.m_chainsaw_damage += WEP_CVAR_PRI(okrpc, damage2);
                }
index a383c9d7a8b1bef15311879e438bd60ccc9c0649..1124baa68bff28fc72e75c9c4d4d2529384d3e7a 100644 (file)
@@ -4,7 +4,7 @@ CLASS(OverkillShotgun, Weapon)
 /* spawnfunc */ ATTRIB(OverkillShotgun, m_canonical_spawnfunc, string, "weapon_okshotgun");
 /* ammotype  */ ATTRIB(OverkillShotgun, ammo_type, int, RESOURCE_SHELLS);
 /* impulse   */ ATTRIB(OverkillShotgun, impulse, int, 2);
-/* flags     */ ATTRIB(OverkillShotgun, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_MUTATORBLOCKED);
+/* flags     */ ATTRIB(OverkillShotgun, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_MUTATORBLOCKED);
 /* rating    */ ATTRIB(OverkillShotgun, bot_pickupbasevalue, float, 6000);
 /* color     */ ATTRIB(OverkillShotgun, wpcolor, vector, '0.5 0.25 0');
 /* modelname */ ATTRIB(OverkillShotgun, mdl, string, "ok_shotgun");
index b2847592690092900aa4c4a8a967605f7c08911a..35bb1e3db197cc93b18ecf51c9cf166f98a62a5d 100644 (file)
@@ -473,7 +473,7 @@ void W_Arc_Beam_Think(entity this)
                                {
                                        accuracy_add(
                                                own,
-                                               WEP_ARC.m_id,
+                                               WEP_ARC,
                                                0,
                                                rootdamage * coefficient * falloff
                                        );
index 84113b7020f210352d85360cfc5f6b0d6d488d61..ea7f5b8aea19e1031d1506847a0a117940701f1c 100644 (file)
@@ -42,7 +42,7 @@ void W_Fireball_Explode(entity this, entity directhitentity)
                        dir = normalize(e.origin + e.view_ofs - this.origin);
 
                        if(accuracy_isgooddamage(this.realowner, e))
-                               accuracy_add(this.realowner, WEP_FIREBALL.m_id, 0, WEP_CVAR_PRI(fireball, bfgdamage) * points);
+                               accuracy_add(this.realowner, WEP_FIREBALL, 0, WEP_CVAR_PRI(fireball, bfgdamage) * points);
 
                        Damage(e, this, this.realowner, WEP_CVAR_PRI(fireball, bfgdamage) * points, this.projectiledeathtype | HITTYPE_BOUNCE | HITTYPE_SPLASH, this.weaponentity_fld, e.origin + e.view_ofs, WEP_CVAR_PRI(fireball, bfgforce) * dir);
                        Send_Effect(EFFECT_FIREBALL_BFGDAMAGE, e.origin, -1 * dir, 1);
index b09140b6c81896cbefac879dfff4f33809ebe160..7e60667e5350bf1b8bb1c62bb19645df71d1ed42 100644 (file)
@@ -106,7 +106,7 @@ void W_Shockwave_Melee_Think(entity this)
 
                        // handle accuracy
                        if(accuracy_isgooddamage(this.realowner, target_victim))
-                               { accuracy_add(this.realowner, WEP_SHOCKWAVE.m_id, 0, swing_damage); }
+                               { accuracy_add(this.realowner, WEP_SHOCKWAVE, 0, swing_damage); }
 
                        #ifdef DEBUG_SHOCKWAVE
                        LOG_INFOF(
@@ -573,7 +573,7 @@ void W_Shockwave_Attack(Weapon thiswep, entity actor, .entity weaponentity)
                );
 
                if(accuracy_isgooddamage(actor, head))
-                       accuracy_add(actor, thiswep.m_id, 0, final_damage);
+                       accuracy_add(actor, thiswep, 0, final_damage);
 
                #ifdef DEBUG_SHOCKWAVE
                LOG_INFOF(
index 4a3ab170343eb5cb233b30e92803a93c2e934904..8faac3d5d03d7e2a4f2dd8f98e9303a572a36ea5 100644 (file)
@@ -95,7 +95,7 @@ void W_Shotgun_Melee_Think(entity this)
                                this.realowner.origin + this.realowner.view_ofs,
                                v_forward * WEP_CVAR_SEC(shotgun, force));
 
-                       if(accuracy_isgooddamage(this.realowner, target_victim)) { accuracy_add(this.realowner, WEP_SHOTGUN.m_id, 0, swing_damage); }
+                       if(accuracy_isgooddamage(this.realowner, target_victim)) { accuracy_add(this.realowner, WEP_SHOTGUN, 0, swing_damage); }
 
                        // draw large red flash for debugging
                        //te_customflash(targpos, 200, 2, '15 0 0');
index 414459c2b30c64cf64e0795444971ed29bb10a3f..cefa4558f2fd9b43f7aa2fa1a9fe94f8cd63582b 100644 (file)
@@ -105,7 +105,7 @@ NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew)
 void W_RocketMinsta_Explosion(entity actor, .entity weaponentity, vector loc)
 {
        if(accuracy_canbegooddamage(actor))
-               accuracy_add(actor, WEP_DEVASTATOR.m_id, autocvar_g_rm_damage, 0);
+               accuracy_add(actor, WEP_DEVASTATOR, autocvar_g_rm_damage, 0);
        entity dmgent = spawn();
        dmgent.owner = dmgent.realowner = actor;
        setorigin(dmgent, loc);
index a14406bcec7202aa518df979bcb29f619f5c90a3..f4417171ff6c6e0b1498bad74f73b5ffd5d4f398 100644 (file)
@@ -103,6 +103,7 @@ void Xonotic_KeyBinds_Read()
        KEYBIND_DEF("+use"                                  , _("drop key / drop flag"));
        KEYBIND_DEF(""                                      , "");
        KEYBIND_DEF(""                                      , _("Misc"));
+       KEYBIND_DEF("kill"                                  , _("respawn"));
        KEYBIND_DEF("quickmenu"                             , _("quick menu"));
        KEYBIND_DEF("menu_showsandboxtools"                 , _("sandbox menu"));
        KEYBIND_DEF("+button8"                              , _("drag object"));
index 8d7293bb066214c1f5e47535be2ab93453f47c46..08758a06536f706bd722e6ed57549e0ae1b6d154 100644 (file)
@@ -195,8 +195,6 @@ void ClientKill_Silent(entity this, float _delay)
 // Called when a client types 'kill' in the console
 void ClientKill(entity this)
 {
-       // TODO: once .health is removed, will need to check it here for the "already dead" message!
-
        if (game_stopped || this.player_blocked || STAT(FROZEN, this))
                return;
 
index 915fea7ee0ca2ca02ffb14d9341d539b4b4a7d14..80716d811c8e1da75124b95edb4a23b2e2ea5150 100644 (file)
@@ -247,6 +247,36 @@ void ClientCommand_join(entity caller, int request)
        }
 }
 
+void ClientCommand_kill(entity caller, int request)
+{
+       switch (request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       if(IS_SPEC(caller) || IS_OBSERVER(caller))
+                               return; // no point warning about this, command does nothing
+
+                       if(GetResourceAmount(caller, RESOURCE_HEALTH) <= 0)
+                       {
+                               sprint(caller, "Can't die - you are already dead!\n");
+                               return;
+                       }
+
+                       ClientKill(caller);
+
+                       return;  // never fall through to usage
+               }
+
+               default:
+               case CMD_REQUEST_USAGE:
+               {
+                       sprint(caller, "\nUsage:^3 cmd kill\n");
+                       sprint(caller, "  No arguments required.\n");
+                       return;
+               }
+       }
+}
+
 void ClientCommand_physics(entity caller, int request, int argc)
 {
        switch (request)
@@ -730,6 +760,7 @@ void ClientCommand_(entity caller, int request)
        CLIENT_COMMAND("autoswitch", ClientCommand_autoswitch(ent, request, arguments), "Whether or not to switch automatically when getting a better weapon") \
        CLIENT_COMMAND("clientversion", ClientCommand_clientversion(ent, request, arguments), "Release version of the game") \
        CLIENT_COMMAND("join", ClientCommand_join(ent, request), "Become a player in the game") \
+       CLIENT_COMMAND("kill", ClientCommand_kill(ent, request), "Become a member of the dead") \
        CLIENT_COMMAND("minigame", ClientCommand_minigame(ent, request, arguments, command), "Start a minigame") \
        CLIENT_COMMAND("mv_getpicture", ClientCommand_mv_getpicture(ent, request, arguments), "Retrieve mapshot picture from the server") \
        CLIENT_COMMAND("physics", ClientCommand_physics(ent, request, arguments), "Change physics set") \
index c238b93f6ece829649afef7b136824d1585b1692..e9ab3d79ac945a2fa9cec1cf2a392b16aa72fbe0 100644 (file)
@@ -1053,7 +1053,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
        RadiusDamage_running = 0;
 
        if(!DEATH_ISSPECIAL(deathtype))
-               accuracy_add(attacker, DEATH_WEAPONOF(deathtype).m_id, 0, min(coredamage, stat_damagedone));
+               accuracy_add(attacker, DEATH_WEAPONOF(deathtype), 0, min(coredamage, stat_damagedone));
 
        return total_damage_to_creatures;
 }
@@ -1182,7 +1182,7 @@ float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
                                }
                        }
                        if(accuracy_isgooddamage(o, e))
-                               accuracy_add(o, DEATH_WEAPONOF(dt).m_id, 0, max(0, totaldamage - mindamage));
+                               accuracy_add(o, DEATH_WEAPONOF(dt), 0, max(0, totaldamage - mindamage));
                        return max(0, totaldamage - mindamage); // can never be negative, but to make sure
                }
                else
@@ -1196,7 +1196,7 @@ float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
                e.fire_owner = o;
                e.fire_hitsound = false;
                if(accuracy_isgooddamage(o, e))
-                       accuracy_add(o, DEATH_WEAPONOF(dt).m_id, 0, d);
+                       accuracy_add(o, DEATH_WEAPONOF(dt), 0, d);
                return d;
        }
 }
index 8cd7ab66c346f5bc2041c747f116c8d15b412664..8a7bac1b9f6dd0c22b5a1f79b822aef19298b127 100644 (file)
@@ -61,30 +61,31 @@ void accuracy_resend(entity e)
 //.float hit_time;
 .float fired_time;
 
-void accuracy_add(entity this, int w, int fired, int hit)
+void accuracy_add(entity this, Weapon w, int fired, int hit)
 {
        if (IS_INDEPENDENT_PLAYER(this)) return;
        entity a = CS(this).accuracy;
        if (!a) return;
        if (!hit && !fired) return;
-       if (w == WEP_Null.m_id) return;
-       w -= WEP_FIRST;
-       int b = accuracy_byte(a.accuracy_hit[w], a.accuracy_fired[w]);
-       if (hit)    a.accuracy_hit  [w] += hit;
-       if (fired)  a.accuracy_fired[w] += fired;
+       if (w == WEP_Null) return;
+       int wepid = w.m_id;
+       wepid -= WEP_FIRST;
+       int b = accuracy_byte(a.accuracy_hit[wepid], a.accuracy_fired[wepid]);
+       if (hit)    a.accuracy_hit  [wepid] += hit;
+       if (fired)  a.accuracy_fired[wepid] += fired;
 
     if (hit && STAT(HIT_TIME, a) != time) { // only run this once per frame
-        a.accuracy_cnt_hit[w] += 1;
+        a.accuracy_cnt_hit[wepid] += 1;
         STAT(HIT_TIME, a) = time;
     }
 
     if (fired && a.fired_time != time) { // only run this once per frame
-        a.accuracy_cnt_fired[w] += 1;
+        a.accuracy_cnt_fired[wepid] += 1;
         a.fired_time = time;
     }
 
-       if (b == accuracy_byte(a.accuracy_hit[w], a.accuracy_fired[w])) return; // no change
-       int sf = 1 << (w % 24);
+       if (b == accuracy_byte(a.accuracy_hit[wepid], a.accuracy_fired[wepid])) return; // no change
+       int sf = 1 << (wepid % 24);
        a.SendFlags |= sf;
        FOREACH_CLIENT(IS_SPEC(it) && it.enemy == this, { CS(it).accuracy.SendFlags |= sf; });
 }
index d24ee1cf50cf514605e9cc8d1122e854129ffa70..627698aa217c6f0bb21e4edf534cde9ee823833c 100644 (file)
@@ -25,7 +25,7 @@ void accuracy_free(entity e);
 void accuracy_resend(entity e);
 
 // update accuracy stats
-void accuracy_add(entity e, float w, float fired, float hit);
+void accuracy_add(entity e, Weapon w, float fired, float hit);
 
 // helper
 bool accuracy_isgooddamage(entity attacker, entity targ);
index 570d976db1d664505d01f6484fdaab7db7fa518d..506bb43c408b847393bd13216a0e79c066130db6 100644 (file)
@@ -26,7 +26,6 @@
 void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vector s_forward, vector mi, vector ma, float antilag, float recoil, Sound snd, float chan, float maxdamage, float range, int deathtype)
 {
        TC(Sound, snd);
-       float nudge = 1; // added to traceline target and subtracted from result  TOOD(divVerent): do we still need this? Doesn't the engine do this now for us?
        float oldsolid = ent.dphitcontentsmask;
        Weapon wep = DEATH_WEAPONOF(deathtype);
        if(!IS_CLIENT(ent))
@@ -57,7 +56,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vect
 
        // track max damage
        if (IS_PLAYER(ent) && accuracy_canbegooddamage(ent))
-               accuracy_add(ent, wep.m_id, maxdamage, 0);
+               accuracy_add(ent, wep, maxdamage, 0);
 
        if(IS_PLAYER(ent))
                W_HitPlotAnalysis(ent, wep, v_forward, v_right, v_up);
@@ -65,20 +64,20 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vect
        vector md = ent.(weaponentity).movedir;
        vector vecs = ((md.x > 0) ? md : '0 0 0');
 
-       vector dv = v_right * -vecs.y + v_up * vecs.z;
-       w_shotorg = ent.origin + ent.view_ofs + dv;
+       vector dv = v_forward * vecs.x + v_right * -vecs.y + v_up * vecs.z;
+       w_shotorg = ent.origin + ent.view_ofs;
 
        // now move the shotorg forward as much as requested if possible
        if(antilag)
        {
                if(CS(ent).antilag_debug)
-                       tracebox_antilag(ent, w_shotorg, mi, ma, w_shotorg + v_forward * (vecs.x + nudge), MOVE_NORMAL, ent, CS(ent).antilag_debug);
+                       tracebox_antilag(ent, w_shotorg, mi, ma, w_shotorg + dv, MOVE_NORMAL, ent, CS(ent).antilag_debug);
                else
-                       tracebox_antilag(ent, w_shotorg, mi, ma, w_shotorg + v_forward * (vecs.x + nudge), MOVE_NORMAL, ent, ANTILAG_LATENCY(ent));
+                       tracebox_antilag(ent, w_shotorg, mi, ma, w_shotorg + dv, MOVE_NORMAL, ent, ANTILAG_LATENCY(ent));
        }
        else
-               tracebox(w_shotorg, mi, ma, w_shotorg + v_forward * (vecs.x + nudge), MOVE_NORMAL, ent);
-       w_shotorg = trace_endpos - v_forward * nudge;
+               tracebox(w_shotorg, mi, ma, w_shotorg + dv, MOVE_NORMAL, ent);
+       w_shotorg = trace_endpos;
        // calculate the shotdir from the chosen shotorg
        if(W_DualWielding(ent))
                w_shotdir = s_forward;
@@ -143,7 +142,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vect
        }
 
        // nudge w_shotend so a trace to w_shotend hits
-       w_shotend = w_shotend + normalize(w_shotend - w_shotorg) * nudge;
+       w_shotend = w_shotend + normalize(w_shotend - w_shotorg);
        //if(w_shotend != prevend) { printf("SERVER: shotEND differs: %s - %s\n", vtos(w_shotend), vtos(prevend)); }
        //if(w_shotorg != prevorg) { printf("SERVER: shotORG differs: %s - %s\n", vtos(w_shotorg), vtos(prevorg)); }
        //if(w_shotdir != prevdir) { printf("SERVER: shotDIR differs: %s - %s\n", vtos(w_shotdir), vtos(prevdir)); }
@@ -266,7 +265,7 @@ void FireRailgunBullet (entity this, .entity weaponentity, vector start, vector
        //explosion = spawn();
 
        // Find all non-hit players the beam passed close by
-       if(deathtype == WEP_VAPORIZER.m_id || deathtype == WEP_VORTEX.m_id)
+       if(deathtype == WEP_VAPORIZER.m_id || deathtype == WEP_VORTEX.m_id) // WEAPONTODO
        {
                FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != this, {
                        if(!it.railgunhit)
@@ -321,7 +320,8 @@ void FireRailgunBullet (entity this, .entity weaponentity, vector start, vector
        IL_CLEAR(g_railgunhit);
 
        // calculate hits and fired shots for hitscan
-       accuracy_add(this, this.(weaponentity).m_weapon.m_id, 0, min(bdamage, totaldmg));
+       if(this.(weaponentity))
+               accuracy_add(this, this.(weaponentity).m_weapon, 0, min(bdamage, totaldmg));
 
        trace_endpos = endpoint;
        trace_ent = endent;
@@ -421,7 +421,7 @@ void fireBullet(entity this, .entity weaponentity, vector start, vector dir, flo
                                // do not exceed 100%
                                float added_damage = min(damage - total_damage, damage * solid_penetration_left);
                                total_damage += damage * solid_penetration_left;
-                               accuracy_add(this, this.(weaponentity).m_weapon.m_id, 0, added_damage);
+                               accuracy_add(this, this.(weaponentity).m_weapon, 0, added_damage);
                        }
                }
 
index eb682aa55ce7a2b2fb3880753146d9833e716a27..67589147b634f9968c2b1e6af4b906c37a3af9c1 100644 (file)
@@ -14,6 +14,7 @@ set teamplay_mode 2 // friendly fire and self damage
 set sv_vote_nospectators 1
 set g_chat_nospectators 2
 set g_warmup 1
+set g_warmup_limit 0
 set g_balance_teams 0
 set g_spawnshieldtime 0
 set g_spawn_furthest 1
diff --git a/vehicles.cfg b/vehicles.cfg
new file mode 100644 (file)
index 0000000..1d2f153
--- /dev/null
@@ -0,0 +1,305 @@
+set g_vehicles 1
+
+set g_vehicles_enter 0 "require pressing use key to enter a vehicle"
+set g_vehicles_enter_radius 250
+set g_vehicles_steal 1 "allow stealing enemy vehicles in teamplay modes"
+set g_vehicles_steal_show_waypoint 1 "show a waypoint above the thief"
+set g_vehicles_delayspawn 1
+set g_vehicles_delayspawn_jitter 10
+set g_vehicles_teams 1 "allow team specific vehicles"
+
+set g_vehicles_teleportable 0
+set g_vehicles_crush_dmg 70
+set g_vehicles_crush_force 50
+set g_vehicles_allow_bots 0
+set g_vehicles_exit_attempts 25
+set g_vehicles_thinkrate 0.1
+
+set g_vehicles_vortex_damagerate 0.75
+set g_vehicles_machinegun_damagerate 0.75
+set g_vehicles_rifle_damagerate 0.75
+set g_vehicles_vaporizer_damagerate 0.5
+set g_vehicles_tag_damagerate 5
+set g_vehicles_weapon_damagerate 2
+
+// {{{ #1: Bumblebee
+set g_vehicle_bumblebee 1
+set g_vehicle_bumblebee_respawntime 60
+
+set g_vehicle_bumblebee_speed_forward 350
+set g_vehicle_bumblebee_speed_strafe 350
+set g_vehicle_bumblebee_speed_up 350
+set g_vehicle_bumblebee_speed_down 350
+set g_vehicle_bumblebee_turnspeed 120
+set g_vehicle_bumblebee_pitchspeed 60
+set g_vehicle_bumblebee_pitchlimit 60
+set g_vehicle_bumblebee_friction 0.5
+set g_vehicle_bumblebee_swim 0
+
+set g_vehicle_bumblebee_energy 500
+set g_vehicle_bumblebee_energy_regen 50
+set g_vehicle_bumblebee_energy_regen_pause 1
+
+set g_vehicle_bumblebee_health 1000
+set g_vehicle_bumblebee_health_regen 65
+set g_vehicle_bumblebee_health_regen_pause 10
+
+set g_vehicle_bumblebee_shield 400
+set g_vehicle_bumblebee_shield_regen 150
+set g_vehicle_bumblebee_shield_regen_pause 0.75
+
+set g_vehicle_bumblebee_cannon_ammo 100
+set g_vehicle_bumblebee_cannon_ammo_regen 100
+set g_vehicle_bumblebee_cannon_ammo_regen_pause 1
+
+set g_vehicle_bumblebee_cannon_lock 1
+
+set g_vehicle_bumblebee_cannon_turnspeed 260
+set g_vehicle_bumblebee_cannon_pitchlimit_down 60
+set g_vehicle_bumblebee_cannon_pitchlimit_up 60
+set g_vehicle_bumblebee_cannon_turnlimit_in 20
+set g_vehicle_bumblebee_cannon_turnlimit_out 80
+
+
+set g_vehicle_bumblebee_raygun_turnspeed 180
+set g_vehicle_bumblebee_raygun_pitchlimit_down 20
+set g_vehicle_bumblebee_raygun_pitchlimit_up 5
+set g_vehicle_bumblebee_raygun_turnlimit_sides 35
+
+set g_vehicle_bumblebee_raygun 0
+set g_vehicle_bumblebee_raygun_range 2048
+set g_vehicle_bumblebee_raygun_dps 250
+set g_vehicle_bumblebee_raygun_aps 100
+set g_vehicle_bumblebee_raygun_fps 100
+
+set g_vehicle_bumblebee_healgun_hps 150
+set g_vehicle_bumblebee_healgun_hmax 100
+set g_vehicle_bumblebee_healgun_aps 75
+set g_vehicle_bumblebee_healgun_amax 100
+set g_vehicle_bumblebee_healgun_sps 100
+set g_vehicle_bumblebee_healgun_locktime 2.5
+
+set g_vehicle_bumblebee_blowup_radius 500
+set g_vehicle_bumblebee_blowup_coredamage 500
+set g_vehicle_bumblebee_blowup_edgedamage 100
+set g_vehicle_bumblebee_blowup_forceintensity 600
+set g_vehicle_bumblebee_bouncepain "1 100 200"
+
+set g_vehicle_bumblebee_cannon_cost 2
+set g_vehicle_bumblebee_cannon_damage 60
+set g_vehicle_bumblebee_cannon_radius 225
+set g_vehicle_bumblebee_cannon_refire 0.2
+set g_vehicle_bumblebee_cannon_speed 20000
+set g_vehicle_bumblebee_cannon_spread 0
+set g_vehicle_bumblebee_cannon_force -35
+// }}}
+// {{{ #2: Racer
+set g_vehicle_racer 1
+set g_vehicle_racer_respawntime 35
+
+set g_vehicle_racer_thinkrate 0.05 // TODO: any higher causes it to sink in liquids
+
+set g_vehicle_racer_speed_afterburn 3000
+set g_vehicle_racer_afterburn_cost 130 "energy consumed per second"
+
+set g_vehicle_racer_waterburn_cost 5
+set g_vehicle_racer_waterburn_speed 750
+
+set g_vehicle_racer_water_speed_forward 600
+set g_vehicle_racer_water_speed_strafe 600
+
+set g_vehicle_racer_pitchlimit 30
+
+set g_vehicle_racer_water_downforce 0.03
+set g_vehicle_racer_water_upforcedamper 15
+
+set g_vehicle_racer_anglestabilizer 1.75
+set g_vehicle_racer_downforce 0.01
+
+set g_vehicle_racer_speed_forward 650
+set g_vehicle_racer_speed_strafe 650
+set g_vehicle_racer_springlength 90
+set g_vehicle_racer_upforcedamper 2
+set g_vehicle_racer_friction 0.45
+
+set g_vehicle_racer_water_time 5
+
+set g_vehicle_racer_hovertype 0 "0 = hover, otherwise = maglev"
+set g_vehicle_racer_hoverpower 8000 "this is multiplied by 4 for the 4 engines"
+
+set g_vehicle_racer_turnroll 30
+set g_vehicle_racer_turnspeed 220
+set g_vehicle_racer_pitchspeed 125
+
+set g_vehicle_racer_energy 100
+set g_vehicle_racer_energy_regen 90
+set g_vehicle_racer_energy_regen_pause 0.35
+
+set g_vehicle_racer_health 200
+set g_vehicle_racer_health_regen 0
+set g_vehicle_racer_health_regen_pause 0
+
+set g_vehicle_racer_shield 100
+set g_vehicle_racer_shield_regen 30
+set g_vehicle_racer_shield_regen_pause 1
+
+set g_vehicle_racer_rocket_locktarget 1
+set g_vehicle_racer_rocket_locking_time 0.35
+set g_vehicle_racer_rocket_locking_releasetime 0.5
+set g_vehicle_racer_rocket_locked_time 4
+
+set g_vehicle_racer_blowup_radius 250
+set g_vehicle_racer_blowup_coredamage 250
+set g_vehicle_racer_blowup_edgedamage 15
+set g_vehicle_racer_blowup_forceintensity 250
+
+set g_vehicle_racer_bouncefactor 0.25 "factor of old velocity to keep after collision"
+set g_vehicle_racer_bouncestop 0 "if not 0, new velocity after bounce is 0 if new velocity is smaller than this"
+set g_vehicle_racer_bouncepain "200 0.15 150" "minspeed_for_pain speedchange_to_pain_factor max_damage"
+
+set g_vehicle_racer_cannon_cost 1.5
+set g_vehicle_racer_cannon_damage 15
+set g_vehicle_racer_cannon_radius 100
+set g_vehicle_racer_cannon_refire 0.05
+set g_vehicle_racer_cannon_speed 15000
+set g_vehicle_racer_cannon_spread 0.0125
+set g_vehicle_racer_cannon_force 50
+
+set g_vehicle_racer_rocket_accel 1600
+set g_vehicle_racer_rocket_damage 100
+set g_vehicle_racer_rocket_radius 125
+set g_vehicle_racer_rocket_force 350
+set g_vehicle_racer_rocket_speed 900
+set g_vehicle_racer_rocket_turnrate 0.2
+set g_vehicle_racer_rocket_refire 3
+
+set g_vehicle_racer_rocket_climbspeed 1600
+set g_vehicle_racer_rocket_locked_maxangle 1.8
+// }}}
+// {{{ #3: Raptor
+set g_vehicle_raptor 1
+set g_vehicle_raptor_respawntime 40
+
+set g_vehicle_raptor_takeofftime 1.5
+
+set g_vehicle_raptor_movestyle 1 "0: move relative to player angles, 1: ignore aiming for up/down movement"
+set g_vehicle_raptor_turnspeed 200
+set g_vehicle_raptor_pitchspeed 50
+set g_vehicle_raptor_pitchlimit 45
+
+set g_vehicle_raptor_speed_forward 1700
+set g_vehicle_raptor_speed_strafe 2200
+set g_vehicle_raptor_speed_up 2300
+set g_vehicle_raptor_speed_down 2000
+set g_vehicle_raptor_friction 2
+
+set g_vehicle_raptor_swim 0
+
+set g_vehicle_raptor_cannon_turnspeed 120
+set g_vehicle_raptor_cannon_turnlimit 20
+set g_vehicle_raptor_cannon_pitchlimit_up 12
+set g_vehicle_raptor_cannon_pitchlimit_down 32
+
+set g_vehicle_raptor_cannon_locktarget 1
+set g_vehicle_raptor_cannon_locking_time 0.2
+set g_vehicle_raptor_cannon_locking_releasetime 0.45
+set g_vehicle_raptor_cannon_locked_time 1
+set g_vehicle_raptor_cannon_predicttarget 1
+
+set g_vehicle_raptor_energy 100
+set g_vehicle_raptor_energy_regen 25
+set g_vehicle_raptor_energy_regen_pause 0.25
+
+set g_vehicle_raptor_health 250
+set g_vehicle_raptor_health_regen 0
+set g_vehicle_raptor_health_regen_pause 0
+
+set g_vehicle_raptor_shield 200
+set g_vehicle_raptor_shield_regen 25
+set g_vehicle_raptor_shield_regen_pause 1.5
+
+set g_vehicle_raptor_bouncefactor 0.2
+set g_vehicle_raptor_bouncestop 0
+set g_vehicle_raptor_bouncepain "1 4 1000"
+
+set g_vehicle_raptor_cannon_cost 1
+set g_vehicle_raptor_cannon_damage 10
+set g_vehicle_raptor_cannon_radius 60
+set g_vehicle_raptor_cannon_refire 0.03
+set g_vehicle_raptor_cannon_speed 24000
+set g_vehicle_raptor_cannon_spread 0.01
+set g_vehicle_raptor_cannon_force 25
+
+set g_vehicle_raptor_bomblets 8
+set g_vehicle_raptor_bomblet_alt 750
+set g_vehicle_raptor_bomblet_time 0.5
+set g_vehicle_raptor_bomblet_damage 55
+set g_vehicle_raptor_bomblet_spread 0.4
+set g_vehicle_raptor_bomblet_edgedamage 25
+set g_vehicle_raptor_bomblet_radius 350
+set g_vehicle_raptor_bomblet_force 150
+set g_vehicle_raptor_bomblet_explode_delay 0.4
+
+set g_vehicle_raptor_bombs_refire 5
+
+set g_vehicle_raptor_flare_refire 5
+set g_vehicle_raptor_flare_lifetime 10
+set g_vehicle_raptor_flare_chase 0.9
+set g_vehicle_raptor_flare_range 2000
+// }}}
+// {{{ #4: Spiderbot
+set g_vehicle_spiderbot 1
+set g_vehicle_spiderbot_respawntime 45
+
+set g_vehicle_spiderbot_speed_stop 50
+set g_vehicle_spiderbot_speed_strafe 400
+set g_vehicle_spiderbot_speed_walk 500
+set g_vehicle_spiderbot_speed_run 700
+set g_vehicle_spiderbot_turnspeed 90
+set g_vehicle_spiderbot_turnspeed_strafe 300
+set g_vehicle_spiderbot_movement_inertia 0.15
+
+set g_vehicle_spiderbot_springlength 150
+set g_vehicle_spiderbot_springup 20
+set g_vehicle_spiderbot_springblend 0.1
+set g_vehicle_spiderbot_tiltlimit 90
+
+set g_vehicle_spiderbot_head_pitchlimit_down -20
+set g_vehicle_spiderbot_head_pitchlimit_up 30
+set g_vehicle_spiderbot_head_turnlimit 90
+set g_vehicle_spiderbot_head_turnspeed 110
+
+set g_vehicle_spiderbot_health 800
+set g_vehicle_spiderbot_health_regen 10
+set g_vehicle_spiderbot_health_regen_pause 5
+
+set g_vehicle_spiderbot_shield 200
+set g_vehicle_spiderbot_shield_regen 25
+set g_vehicle_spiderbot_shield_regen_pause 0.35
+
+set g_vehicle_spiderbot_bouncepain "0 0 0" "minspeed_for_pain speedchange_to_pain_factor max_damage"
+
+set g_vehicle_spiderbot_minigun_damage 16
+set g_vehicle_spiderbot_minigun_refire 0.06
+set g_vehicle_spiderbot_minigun_spread 0.012
+set g_vehicle_spiderbot_minigun_ammo_cost 1
+set g_vehicle_spiderbot_minigun_ammo_max 100
+set g_vehicle_spiderbot_minigun_ammo_regen 40
+set g_vehicle_spiderbot_minigun_ammo_regen_pause 1
+set g_vehicle_spiderbot_minigun_force 9
+set g_vehicle_spiderbot_minigun_solidpenetration 32
+
+set g_vehicle_spiderbot_rocket_damage 50
+set g_vehicle_spiderbot_rocket_force 150
+set g_vehicle_spiderbot_rocket_radius 250
+set g_vehicle_spiderbot_rocket_speed 3500
+set g_vehicle_spiderbot_rocket_spread 0.05
+set g_vehicle_spiderbot_rocket_refire 0.1
+// volley
+set g_vehicle_spiderbot_rocket_refire2 0.025
+set g_vehicle_spiderbot_rocket_reload 4
+set g_vehicle_spiderbot_rocket_health 100
+set g_vehicle_spiderbot_rocket_noise 0.2
+set g_vehicle_spiderbot_rocket_turnrate 0.25
+set g_vehicle_spiderbot_rocket_lifetime 20
+// }}}
index 6aa5844b7d871ae817ffba57801e2b1d319014d6..61f8ccd4b286890be7be1dfe25c934da5cc2b36a 100644 (file)
@@ -25,7 +25,7 @@ set g_maxplayers_spectator_blocktime 5        "if the players voted for the \"nospectat
 
 // tournament mod
 set g_warmup 0 "split the game into a warmup- and match-stage"
-set g_warmup_limit 0   "limit warmup-stage to this time (in seconds); if set to -1 the warmup-stage is not affected by any timelimit, if set to 0 the usual timelimit also affects warmup-stage"
+set g_warmup_limit 180 "limit warmup-stage to this time (in seconds); if set to -1 the warmup-stage is not affected by any timelimit, if set to 0 the usual timelimit also affects warmup-stage"
 set g_warmup_allow_timeout 0   "allow calling timeouts in the warmup-stage (if sv_timeout is set to 1)"
 set g_warmup_allguns 1 "provide more weapons on start while in warmup: 0 = normal start weapons, 1 = all guns available on the map, 2 = all normal weapons"
 set g_warmup_majority_factor 0.8 "minimum percentage of players ready needed for warmup to end"
@@ -540,6 +540,7 @@ set g_mod_config  "" "Current config mod name"
 exec balance-xonotic.cfg
 exec physicsX.cfg
 exec turrets.cfg
+exec vehicles.cfg
 exec gamemodes-server.cfg
 exec mutators.cfg
 exec monsters.cfg