From: Mario Date: Sat, 31 Dec 2016 05:44:54 +0000 (+1000) Subject: Merge branch 'master' into Mario/wepent_experimental X-Git-Tag: xonotic-v0.8.2~326^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=707ef9331a9405bbf266ab5aa3a87a175cad8d8f;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into Mario/wepent_experimental # Conflicts: # qcsrc/common/mutators/mutator/overkill/sv_overkill.qc # qcsrc/common/turrets/turret/plasma.qc # qcsrc/common/turrets/turret/plasma_dual.qc # qcsrc/common/weapons/weapon/vaporizer.qc # qcsrc/common/weapons/weapon/vortex.qc --- 707ef9331a9405bbf266ab5aa3a87a175cad8d8f diff --cc qcsrc/common/mutators/mutator/overkill/sv_overkill.qc index 9bc39781b,501b3afd8..ba2d98f49 --- a/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc +++ b/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc @@@ -34,7 -59,40 +34,7 @@@ void W_Blaster_Attack(entity, .entity, spawnfunc(weapon_hmg); spawnfunc(weapon_rpc); - MUTATOR_HOOKFUNCTION(ok, PlayerDamage_Calculate, CBC_ORDER_LAST) -void ok_DecreaseCharge(entity ent, int wep) -{ - if(!ent.ok_use_ammocharge) return; - - entity wepent = Weapons_from(wep); - - if (wepent == WEP_Null) return; // dummy - - ent.ammo_charge[wep] -= max(0, cvar(sprintf("g_overkill_ammo_decharge_%s", wepent.netname))); -} - -void ok_IncreaseCharge(entity ent, int wep) -{ - entity wepent = Weapons_from(wep); - - if (wepent == WEP_Null) return; // dummy - - if(ent.ok_use_ammocharge) - if(!PHYS_INPUT_BUTTON_ATCK(ent)) // not while attacking? - ent.ammo_charge[wep] = min(autocvar_g_overkill_ammo_charge_limit, ent.ammo_charge[wep] + cvar(sprintf("g_overkill_ammo_charge_rate_%s", wepent.netname)) * frametime / W_TICSPERFRAME); -} - -float ok_CheckWeaponCharge(entity ent, int wep) -{ - if(!ent.ok_use_ammocharge) return true; - - entity wepent = Weapons_from(wep); - - if(wepent == WEP_Null) return false; // dummy - - return (ent.ammo_charge[wep] >= cvar(sprintf("g_overkill_ammo_decharge_%s", wepent.netname))); -} - + MUTATOR_HOOKFUNCTION(ok, Damage_Calculate, CBC_ORDER_LAST) { entity frag_attacker = M_ARGV(1, entity); entity frag_target = M_ARGV(2, entity); diff --cc qcsrc/common/turrets/turret/plasma.qc index ed7d4f160,283cf6e51..7317930c9 --- a/qcsrc/common/turrets/turret/plasma.qc +++ b/qcsrc/common/turrets/turret/plasma.qc @@@ -10,8 -10,7 +10,8 @@@ METHOD(PlasmaTurret, tr_attack, void(Pl { if(g_instagib) { - FireRailgunBullet (it, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * max_shot_distance, 10000000000, + .entity weaponentity = weaponentities[0]; // TODO: unhardcode - FireRailgunBullet (it, weaponentity, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000, ++ FireRailgunBullet (it, weaponentity, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * max_shot_distance, 10000000000, 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id); Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, it.tur_shotorg, it.tur_shotdir_updated * 1000, 1); diff --cc qcsrc/common/turrets/turret/plasma_dual.qc index b1e7d5850,7859d26e3..3efe969f3 --- a/qcsrc/common/turrets/turret/plasma_dual.qc +++ b/qcsrc/common/turrets/turret/plasma_dual.qc @@@ -9,8 -9,7 +9,8 @@@ spawnfunc(turret_plasma_dual) { if (!tu METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret thistur, entity it)) { if (g_instagib) { - FireRailgunBullet (it, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * max_shot_distance, 10000000000, + .entity weaponentity = weaponentities[0]; // TODO: unhardcode - FireRailgunBullet (it, weaponentity, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000, ++ FireRailgunBullet (it, weaponentity, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * max_shot_distance, 10000000000, 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id); diff --cc qcsrc/common/weapons/weapon.qh index c873f4463,6220a0cea..6ccfcae57 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@@ -177,7 -175,7 +177,9 @@@ ENDCLASS(OffhandWeapon .OffhandWeapon offhand; #endif - const int MAX_SHOT_DISTANCE = 32768; ++#ifdef GAMEQC + int max_shot_distance = 32768; // determined by world mins/maxs when map loads ++#endif // weapon flags const int WEP_TYPE_OTHER = 0x00; // not for damaging people diff --cc qcsrc/common/weapons/weapon/vaporizer.qc index 4e352c75d,79892920a..3e2575838 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@@ -194,7 -193,7 +194,7 @@@ void W_Vaporizer_Attack(Weapon thiswep yoda = 0; damage_goodhits = 0; - FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, vaporizer_damage, 800, 0, 0, 0, 0, WEP_VAPORIZER.m_id); - FireRailgunBullet(actor, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, vaporizer_damage, 800, 0, 0, 0, 0, WEP_VAPORIZER.m_id); ++ FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, vaporizer_damage, 800, 0, 0, 0, 0, WEP_VAPORIZER.m_id); // do this now, as goodhits is disabled below SendCSQCVaporizerBeamParticle(actor, damage_goodhits); diff --cc qcsrc/common/weapons/weapon/vortex.qc index b3ba65c50,f7f20d2e8..34d9fb8dd --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@@ -202,7 -193,7 +202,7 @@@ void W_Vortex_Attack(Weapon thiswep, en yoda = 0; damage_goodhits = 0; - FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_VORTEX.m_id); - FireRailgunBullet(actor, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_VORTEX.m_id); ++ FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_VORTEX.m_id); if(yoda && flying) Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);