Permalink
Browse files

game: use damage, nextshotTime and spread in weap table for dummy MG

  • Loading branch information...
Aranud committed Jan 10, 2018
1 parent bd0659d commit dfd865f4f53168ee5f275548b12f2873135a08c6
Showing with 10 additions and 15 deletions.
  1. +2 −2 src/cgame/cg_weapons.c
  2. +1 −1 src/game/bg_misc.c
  3. +4 −4 src/game/bg_pmove.c
  4. +0 −5 src/game/bg_public.h
  5. +1 −1 src/game/g_misc.c
  6. +2 −2 src/game/g_script.c
View
@@ -6390,8 +6390,8 @@ void CG_Bullet(vec3_t end, int sourceEntityNum, qboolean flesh, int fleshEntityN
VectorMA(muzzle, 16, up, muzzle);
}
r = Q_crandom(&seed) * MG42_SPREAD_MP;
u = Q_crandom(&seed) * MG42_SPREAD_MP;
r = Q_crandom(&seed) * GetWeaponTableData(WP_DUMMY_MG42)->spread;
u = Q_crandom(&seed) * GetWeaponTableData(WP_DUMMY_MG42)->spread;
VectorMA(muzzle, MAX_TRACE, forward, end);
VectorMA(end, r, right, end);
View
@@ -204,7 +204,7 @@ weaponTable_t weaponTable[WP_NUM_WEAPONS] =
{ WP_MOBILE_MG42, TEAM_AXIS, SK_HEAVY_WEAPONS, WP_MOBILE_MG42_SET, WP_MOBILE_BROWNING, WP_NONE, WP_MOBILE_MG42, WP_MOBILE_MG42, ET_GENERAL, EF_NONE, SVF_NONE, TR_LINEAR, 0, MASK_SHOT, qfalse, qfalse, 18, qfalse, qtrue, 2500, 0.9f, 0, 0, qfalse, qtrue, qfalse, qfalse, qfalse, qtrue, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qtrue, qfalse, qfalse, qfalse, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qtrue, 0, 0, 0, "MOBILE MG 42", WS_MG42, qfalse, qtrue, qtrue, qtrue, 450, 1, 150, 0, 150, 3000, DELAY_LOW, 66, 20, 1500, 300, 250, 250, 0, 1722, 4000.f, { 12, -4, 24 }, 0, 0, 1.0f, 0.3f, 0.6f, "", "mg42", WEAPON_CARD_1, { 1.f, 1.f, 0.f, 1.f, 4 / 8.f, 5 / 8.f }, WEAP_IDLE1, WEAP_ATTACK1, WEAP_ATTACK_LASTSHOT, WEAP_ALTSWITCHFROM, WEAP_ALTSWITCHFROM, WEAP_RELOAD1, WEAP_RAISE, WEAP_DROP, qfalse, {1, 1, 1, 1, 1}, MOD_MOBILE_MG42, MOD_MOBILE_MG42 }, // WP_MOBILE_MG42 // 30
{ WP_K43, TEAM_AXIS, SK_LIGHT_WEAPONS, WP_K43_SCOPE, WP_GARAND, WP_NONE, WP_K43, WP_K43, ET_GENERAL, EF_NONE, SVF_NONE, TR_LINEAR, 0, MASK_SHOT, qfalse, qfalse, 34, qfalse, qtrue, 250, 0.5f, 0, 0, qtrue, qfalse, qfalse, qtrue, qfalse, qtrue, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, 0, 0, 0, "SCOPED K43", WS_K43, qfalse, qtrue, qtrue, qtrue, 30, 1, 10, 20, 10, 1500, DELAY_LOW, 400, 50, 0, 0, 250, 250, 250, 250, 0, { 16, -4, 24 }, 0, 0, 2.0f, 2.f, 1.f, "", "k43", WEAPON_CARD_2, { 1.f, 1.f, 0.f, 1.f, 6 / 8.f, 7 / 8.f }, WEAP_IDLE1, WEAP_ATTACK1, WEAP_ATTACK_LASTSHOT, WEAP_ALTSWITCHFROM, WEAP_ALTSWITCHTO, WEAP_RELOAD1, WEAP_RAISE, WEAP_DROP, qfalse, {1, 1, 1, 1, 1}, MOD_K43, MOD_K43 }, // WP_K43 // 31 // K43
{ WP_FG42, TEAM_FREE, SK_LIGHT_WEAPONS, WP_FG42SCOPE, WP_NONE, WP_NONE, WP_FG42, WP_FG42, ET_GENERAL, EF_NONE, SVF_NONE, TR_LINEAR, 0, MASK_SHOT, qfalse, qtrue, 16, qfalse, qtrue, 500, 0.6f, 0, 0, qfalse, qtrue, qfalse, qfalse, qfalse, qtrue, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, 0, 0, 0, "FG 42", WS_FG42, qtrue, qtrue, qtrue, qtrue, 60, 1, 20, 40, 20, 2000, DELAY_LOW, 100, 100, 0, 0, 250, 250, 50, 50, 0, { 16, -4, 24 }, 0, 0, 1.0f, 0.3f, 0.6f, "", "fg42", WEAPON_CARD_1, { 1.f, 1.f, 0.f, 1.f, 3 / 8.f, 4 / 8.f }, WEAP_IDLE1, WEAP_ATTACK1, WEAP_ATTACK_LASTSHOT, WEAP_ALTSWITCHFROM, WEAP_ALTSWITCHTO, WEAP_RELOAD1, WEAP_RAISE, WEAP_DROP, qfalse, {1, 1, 1, 1, 1}, MOD_FG42, MOD_FG42 }, // WP_FG42 // 32
{ WP_DUMMY_MG42, TEAM_FREE, SK_NUM_SKILLS, WP_NONE, WP_NONE, WP_NONE, WP_DUMMY_MG42, WP_DUMMY_MG42, ET_GENERAL, EF_NONE, SVF_NONE, TR_LINEAR, 0, MASK_SHOT, qfalse, qfalse, 1, qfalse, qfalse, 0, 0.9f, 0, 0, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qtrue, qfalse, qfalse, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, 0, 0, 0, "", WS_MG42, qfalse, qfalse, qfalse, qfalse, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1500, 300, 250, 250, 250, 250, 0, { 16, -4, 24 }, 0, 0, 1.0f, 0, 0, "", NULL, WEAPON_CARD_NONE, { 1.f, 1.f, 0.f, 1.f, 0.f, 1.f }, WEAP_IDLE1, WEAP_ATTACK1, WEAP_ATTACK_LASTSHOT, WEAP_ALTSWITCHFROM, WEAP_ALTSWITCHTO, WEAP_RELOAD1, WEAP_RAISE, WEAP_DROP, qfalse, {1, 1, 1, 1, 1}, MOD_UNKNOWN, MOD_UNKNOWN }, // WP_DUMMY_MG42 // 33 // for storing heat on mounted mg42s...
{ WP_DUMMY_MG42, TEAM_FREE, SK_NUM_SKILLS, WP_NONE, WP_NONE, WP_NONE, WP_DUMMY_MG42, WP_DUMMY_MG42, ET_GENERAL, EF_NONE, SVF_NONE, TR_LINEAR, 0, MASK_SHOT, qfalse, qfalse, 20, qfalse, qfalse, 100, 0.9f, 0, 0, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qtrue, qfalse, qfalse, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, 0, 0, 0, "", WS_MG42, qfalse, qfalse, qfalse, qfalse, 0, 0, 0, 0, 0, 0, 0, 66, 0, 1500, 300, 250, 250, 250, 250, 0, { 16, -4, 24 }, 0, 0, 1.0f, 0, 0, "", NULL, WEAPON_CARD_NONE, { 1.f, 1.f, 0.f, 1.f, 0.f, 1.f }, WEAP_IDLE1, WEAP_ATTACK1, WEAP_ATTACK_LASTSHOT, WEAP_ALTSWITCHFROM, WEAP_ALTSWITCHTO, WEAP_RELOAD1, WEAP_RAISE, WEAP_DROP, qfalse, {1, 1, 1, 1, 1}, MOD_UNKNOWN, MOD_UNKNOWN }, // WP_DUMMY_MG42 // 33 // for storing heat on mounted mg42s...
{ WP_MORTAR, TEAM_ALLIES, SK_HEAVY_WEAPONS, WP_MORTAR_SET, WP_MORTAR2, WP_NONE, WP_MORTAR, WP_MORTAR, ET_GENERAL, EF_NONE, SVF_NONE, TR_LINEAR, 0, MASK_MISSILESHOT, qfalse, qfalse, 1, qtrue, qtrue, 0, 0, 0, 0, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, 0, 0, 0, "MORTAR", WS_MORTAR, qfalse, qtrue, qfalse, qfalse, 15, 1, 1, 0, 0, 0, DELAY_HW, 1600, 0, 0, 0, 250, 250, 0, 1000, 0, { 16, -4, 24 }, 0, 0, 1.0f, 0, 0, "", "mortar", WEAPON_CARD_1, { 1.f, 1.f, 0.f, 1.f, 0 / 8.f, 1 / 8.f }, WEAP_IDLE1, WEAP_ATTACK1, WEAP_ATTACK_LASTSHOT, WEAP_ALTSWITCHFROM, WEAP_ALTSWITCHFROM, WEAP_RELOAD1, WEAP_RAISE, WEAP_DROP, qfalse, {1, 1, 1, 1, 1}, MOD_MORTAR, MOD_MORTAR }, // WP_MORTAR // 34
{ WP_AKIMBO_COLT, TEAM_ALLIES, SK_LIGHT_WEAPONS, WP_NONE, WP_AKIMBO_LUGER, WP_COLT, WP_COLT, WP_AKIMBO_COLT, ET_GENERAL, EF_NONE, SVF_NONE, TR_LINEAR, 0, MASK_SHOT, qfalse, qfalse, 18, qfalse, qtrue, 600, 0.4f, 0, 0, qtrue, qfalse, qfalse, qfalse, qfalse, qtrue, qtrue, qfalse, qfalse, qfalse, qfalse, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, 0, 0, 0, "AKIMBO COLTS", WS_COLT, qtrue, qtrue, qtrue, qtrue, 48, 1, 8, 48, 8, 2700, DELAY_PISTOL, 200, 20, 0, 0, 250, 250, 250, 250, 0, { 16, -4, 24 }, 0, 0, 1.0f, 0, 0, "", "akimbo_colt", WEAPON_CARD_2, { 1.f, 1.f, 0.f, 1.f, 3 / 8.f, 4 / 8.f }, WEAP_IDLE1, WEAP_ATTACK1, WEAP_ATTACK_LASTSHOT, WEAP_ALTSWITCHFROM, WEAP_ALTSWITCHTO, WEAP_RELOAD1, WEAP_RAISE, WEAP_DROP, qfalse, {1, 1, 1, 1, 1}, MOD_AKIMBO_COLT , MOD_AKIMBO_COLT }, // WP_AKIMBO_COLT // 35
{ WP_AKIMBO_LUGER, TEAM_AXIS, SK_LIGHT_WEAPONS, WP_NONE, WP_AKIMBO_COLT, WP_LUGER, WP_LUGER, WP_AKIMBO_LUGER, ET_GENERAL, EF_NONE, SVF_NONE, TR_LINEAR, 0, MASK_SHOT, qfalse, qfalse, 18, qfalse, qtrue, 600, 0.4f, 0, 0, qtrue, qfalse, qfalse, qfalse, qfalse, qtrue, qtrue, qfalse, qfalse, qfalse, qfalse, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qtrue, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, qfalse, 0, 0, 0, "AKIMBO LUGERS", WS_LUGER, qtrue, qtrue, qtrue, qtrue, 48, 1, 8, 48, 8, 2700, DELAY_PISTOL, 200, 20, 0, 0, 250, 250, 250, 250, 0, { 16, -4, 24 }, 0, 0, 1.0f, 0, 0, "", "akimbo_luger", WEAPON_CARD_2, { 1.f, 1.f, 0.f, 1.f, 2 / 8.f, 3 / 8.f }, WEAP_IDLE1, WEAP_ATTACK1, WEAP_ATTACK_LASTSHOT, WEAP_ALTSWITCHFROM, WEAP_ALTSWITCHTO, WEAP_RELOAD1, WEAP_RAISE, WEAP_DROP, qfalse, {1, 1, 1, 1, 1}, MOD_AKIMBO_LUGER, MOD_AKIMBO_LUGER }, // WP_AKIMBO_LUGER // 36
View
@@ -3036,9 +3036,9 @@ static qboolean PM_MountedFire(void)
if (pm->cmd.buttons & BUTTON_ATTACK)
{
pm->ps->weapHeat[WP_DUMMY_MG42] += MG42_RATE_OF_FIRE_MP;
pm->ps->weapHeat[WP_DUMMY_MG42] += GetWeaponTableData(WP_DUMMY_MG42)->nextShotTime;
PM_AddEvent(EV_FIRE_WEAPON_MG42);
pm->ps->weaponTime += MG42_RATE_OF_FIRE_MP;
pm->ps->weaponTime += GetWeaponTableData(WP_DUMMY_MG42)->nextShotTime;
BG_AnimScriptEvent(pm->ps, pm->character->animModelInfo, ANIM_ET_FIREWEAPON, qfalse, qtrue);
pm->ps->viewlocked = VIEWLOCK_JITTER; // this enable screen jitter when firing
@@ -3116,9 +3116,9 @@ static qboolean PM_MountedFire(void)
if (pm->cmd.buttons & BUTTON_ATTACK)
{
pm->ps->weapHeat[WP_DUMMY_MG42] += MG42_RATE_OF_FIRE_MP;
pm->ps->weapHeat[WP_DUMMY_MG42] += GetWeaponTableData(WP_DUMMY_MG42)->nextShotTime;
PM_AddEvent(EV_FIRE_WEAPON_MOUNTEDMG42);
pm->ps->weaponTime += MG42_RATE_OF_FIRE_MP;
pm->ps->weaponTime += GetWeaponTableData(WP_DUMMY_MG42)->nextShotTime;
BG_AnimScriptEvent(pm->ps, pm->character->animModelInfo, ANIM_ET_FIREWEAPON, qfalse, qtrue);
//pm->ps->viewlocked = VIEWLOCK_JITTER; // this enable screen jitter when firing
View
@@ -92,11 +92,6 @@ extern vec3_t playerlegsProneMaxs;
#define AAGUN_DAMAGE 25
#define AAGUN_SPREAD 10
#define MG42_SPREAD_MP 100
#define MG42_DAMAGE_MP 20
#define MG42_RATE_OF_FIRE_MP 66
#define AAGUN_RATE_OF_FIRE 100
#define MG42_YAWSPEED 300.f ///< degrees per second
View
@@ -1482,7 +1482,7 @@ void mg42_fire(gentity_t *other)
// snap to integer coordinates for more efficient network bandwidth usage
SnapVector(muzzle);
Fire_Lead_Ext(self, other, MG42_SPREAD_MP, MG42_DAMAGE_MP, muzzle, forward, right, up, MOD_MACHINEGUN); // FIXME: browning?
Fire_Lead_Ext(self, other, GetWeaponTableData(WP_DUMMY_MG42)->spread, GetWeaponTableData(WP_DUMMY_MG42)->damage, muzzle, forward, right, up, MOD_MACHINEGUN); // FIXME: browning?
}
/**
View
@@ -902,11 +902,11 @@ void mountedmg42_fire(gentity_t *other)
if (self->s.density & 8)
{
Fire_Lead_Ext(other, other, MG42_SPREAD_MP, MG42_DAMAGE_MP, muzzle, forward, right, up, MOD_BROWNING);
Fire_Lead_Ext(other, other, GetWeaponTableData(WP_DUMMY_MG42)->spread, GetWeaponTableData(WP_DUMMY_MG42)->damage, muzzle, forward, right, up, MOD_BROWNING);
}
else
{
Fire_Lead_Ext(other, other, MG42_SPREAD_MP, MG42_DAMAGE_MP, muzzle, forward, right, up, MOD_MG42);
Fire_Lead_Ext(other, other, GetWeaponTableData(WP_DUMMY_MG42)->spread, GetWeaponTableData(WP_DUMMY_MG42)->damage, muzzle, forward, right, up, MOD_MG42);
}
}

0 comments on commit dfd865f

Please sign in to comment.