From: TimePath Date: Mon, 28 Sep 2015 02:09:12 +0000 (+1000) Subject: Merge branch 'master' into TimePath/universal_weapons X-Git-Tag: xonotic-v0.8.2~1874^2~87 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6b8b403dbd938914eeaa6a02f98d0e939950d29e;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into TimePath/universal_weapons # Conflicts: # qcsrc/common/turrets/unit/plasma_dual.qc --- 6b8b403dbd938914eeaa6a02f98d0e939950d29e diff --cc qcsrc/common/turrets/unit/plasma_dual.qc index 1744f54f5,bf3362ab8..8b2bc252e --- a/qcsrc/common/turrets/unit/plasma_dual.qc +++ b/qcsrc/common/turrets/unit/plasma_dual.qc @@@ -10,37 -10,8 +10,37 @@@ REGISTER_TURRET /* fullname */ _("Dual Plasma Cannon") ); #else + +#include "../../weapons/all.qh" + +CLASS(PlasmaDualAttack, PortoLaunch) +/* flags */ ATTRIB(PlasmaDualAttack, spawnflags, int, WEP_TYPE_OTHER); +/* impulse */ ATTRIB(PlasmaDualAttack, impulse, int, 5); +/* refname */ ATTRIB(PlasmaDualAttack, netname, string, "plasmadual"); +/* wepname */ ATTRIB(PlasmaDualAttack, message, string, _("Dual plasma")); +ENDCLASS(PlasmaDualAttack) +REGISTER_WEAPON(PLASMA_DUAL, NEW(PlasmaDualAttack)); + #ifdef SVQC + +float t_plasma_dual(float req); +METHOD(PlasmaDualAttack, wr_think, bool(entity thiswep)) { + SELFPARAM(); + if (self.BUTTON_ATCK) + if (weapon_prepareattack(0, WEP_CVAR_PRI(electro, refire))) { + W_SetupShot_Dir(self, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0); + self.tur_shotdir_updated = w_shotdir; + self.tur_shotorg = w_shotorg; + self.tur_head = self; + self.shot_speed = max(1, ((!self.shot_speed) ? 2500 : self.shot_speed)); + self.shot_spread = bound(0.0001, ((!self.shot_spread) ? 0.0125 : self.shot_spread), 500); + t_plasma_dual(TR_ATTACK); + weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready); + } + return true; +} + - void spawnfunc_turret_plasma_dual() { SELFPARAM(); if(!turret_initialize(TUR_PLASMA_DUAL)) remove(self); } + void spawnfunc_turret_plasma_dual() { SELFPARAM(); if(!turret_initialize(TUR_PLASMA_DUAL.m_id)) remove(self); } float t_plasma_dual(float req) {SELFPARAM(); diff --cc qcsrc/common/weapons/weapon/porto.qc index 765f2606b,d764286b7..7e8b28218 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@@ -364,19 -371,8 +364,13 @@@ void W_Porto_Attack(float type // always allow infinite ammo return true; } - case WR_INIT: + METHOD(PortoLaunch, wr_checkammo2, bool(entity this)) + { + // always allow infinite ammo + return true; + } + METHOD(PortoLaunch, wr_init, bool(entity this)) { - precache_sound("porto/bounce.wav"); - precache_sound("porto/create.wav"); - precache_sound("porto/expire.wav"); - precache_sound("porto/explode.wav"); - precache_sound("porto/fire.wav"); - precache_sound("porto/unsupported.wav"); PORTO_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); return true; } diff --cc qcsrc/server/t_items.qc index e6e45963c,7d3e59836..c921502cf --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@@ -1840,22 -1826,22 +1826,22 @@@ float GiveItems(entity e, float beginar wi = get_weaponinfo(j); if(wi.weapon) { - POSTGIVE_WEAPON(e, j, W_Sound("weaponpickup"), string_null); + POSTGIVE_WEAPON(e, j, SND(WEAPONPICKUP), string_null); if (!(save_weapons & WepSet_FromWeapon(j))) if(e.weapons & WepSet_FromWeapon(j)) - WEP_ACTION(wi.weapon, WR_INIT); + _WEP_ACTION(wi.weapon, WR_INIT); } } - POSTGIVE_VALUE(e, strength_finished, 1, "misc/powerup.wav", "misc/poweroff.wav"); - POSTGIVE_VALUE(e, invincible_finished, 1, "misc/powerup_shield.wav", "misc/poweroff.wav"); - POSTGIVE_VALUE(e, ammo_nails, 0, "misc/itempickup.wav", string_null); - POSTGIVE_VALUE(e, ammo_cells, 0, "misc/itempickup.wav", string_null); - POSTGIVE_VALUE(e, ammo_plasma, 0, "misc/itempickup.wav", string_null); - POSTGIVE_VALUE(e, ammo_shells, 0, "misc/itempickup.wav", string_null); - POSTGIVE_VALUE(e, ammo_rockets, 0, "misc/itempickup.wav", string_null); - POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, autocvar_g_balance_pause_fuel_rot, pauseregen_finished, autocvar_g_balance_pause_fuel_regen, "misc/itempickup.wav", string_null); - POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, autocvar_g_balance_pause_armor_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/armor25.wav", string_null); - POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/megahealth.wav", string_null); + POSTGIVE_VALUE(e, strength_finished, 1, SND(POWERUP), SND(POWEROFF)); + POSTGIVE_VALUE(e, invincible_finished, 1, "misc/powerup_shield.wav", SND(POWEROFF)); + POSTGIVE_VALUE(e, ammo_nails, 0, SND(ITEMPICKUP), string_null); + POSTGIVE_VALUE(e, ammo_cells, 0, SND(ITEMPICKUP), string_null); + POSTGIVE_VALUE(e, ammo_plasma, 0, SND(ITEMPICKUP), string_null); + POSTGIVE_VALUE(e, ammo_shells, 0, SND(ITEMPICKUP), string_null); + POSTGIVE_VALUE(e, ammo_rockets, 0, SND(ITEMPICKUP), string_null); + POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, autocvar_g_balance_pause_fuel_rot, pauseregen_finished, autocvar_g_balance_pause_fuel_regen, SND(ITEMPICKUP), string_null); + POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, autocvar_g_balance_pause_armor_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, SND(ARMOR25), string_null); + POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, SND(MEGAHEALTH), string_null); if(e.superweapons_finished <= 0) if(self.weapons & WEPSET_SUPERWEAPONS) diff --cc qcsrc/server/weapons/spawning.qc index 95d02a1d5,81261383f..4fb84744c --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@@ -177,9 -177,10 +177,10 @@@ void weapon_defaultspawnfunc(float wpn if(self.team) f |= FL_NO_WEAPON_STAY; - StartItem(e.model, "weapons/weaponpickup.wav", self.respawntime, self.respawntimejitter, e.message, 0, e.weapon, f, weapon_pickupevalfunc, e.bot_pickupbasevalue); + StartItem(e.model, string_null, self.respawntime, self.respawntimejitter, e.message, 0, e.weapon, f, weapon_pickupevalfunc, e.bot_pickupbasevalue); + self.item_pickupsound_ent = SND_WEAPONPICKUP; #if 0 // WEAPONTODO if (self.modelindex) // don't precache if self was removed - WEP_ACTION(e.weapon, WR_INIT); + _WEP_ACTION(e.weapon, WR_INIT); #endif }