Skip to content

Commit

Permalink
Increased damage, reduced power cube cost of MIRV, but it consumes 1 …
Browse files Browse the repository at this point in the history
…grenade. Removed health, cost, delay of spike grenade, but it consumes 1 grenade. Reduced cost of napalm, but it consumes 1 grenade.
  • Loading branch information
Vortex-Quake2 committed Jan 4, 2023
1 parent 4888f72 commit f69aad0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
14 changes: 7 additions & 7 deletions lua/variables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,12 @@ EXPLODING_ARMOR_DMG_ADDON = 40
EXPLODING_ARMOR_MAX_RADIUS = 200
EXPLODING_ARMOR_DELAY = 1
EXPLODING_ARMOR_DETECTION = 32
MIRV_INITIAL_DAMAGE = 40
MIRV_ADDON_DAMAGE = 7
MIRV_INITIAL_RADIUS = 80
MIRV_ADDON_RADIUS = 2
MIRV_INITIAL_DAMAGE = 50
MIRV_ADDON_DAMAGE = 10
MIRV_INITIAL_RADIUS = 100
MIRV_ADDON_RADIUS = 2.5
MIRV_DELAY = 0.5
MIRV_COST = 35
MIRV_COST = 15
SPIKER_INITIAL_HEALTH = 100
SPIKER_ADDON_HEALTH = 50
SPIKER_INITIAL_DAMAGE = 50
Expand Down Expand Up @@ -1040,7 +1040,7 @@ PROXY_ADDON_HEALTH = 30
NAPALM_MAX_COUNT = 3
NAPALM_ATTACK_DELAY = 1.0
NAPALM_DELAY = 1.0
NAPALM_COST = 25
NAPALM_COST = 20
NAPALM_DURATION = 10.0
NAPALM_INITIAL_DMG = 100
NAPALM_ADDON_DMG = 20
Expand Down Expand Up @@ -1099,7 +1099,7 @@ CALTROPS_DELAY = 0.2
CALTROPS_MAX_COUNT = 10


SPIKEGRENADE_COST = 25
SPIKEGRENADE_COST = 20
SPIKEGRENADE_DELAY = 1.0
SPIKEGRENADE_DURATION = 10.0
SPIKEGRENADE_INITIAL_DAMAGE = 50
Expand Down
6 changes: 6 additions & 0 deletions src/combat/abilities/mirv.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ void Cmd_TossMirv (edict_t *ent)

if (!V_CanUseAbilities(ent, MIRV, MIRV_COST, true))
return;
if (ent->client->pers.inventory[grenade_index] < 1)
{
safe_cprintf(ent, PRINT_HIGH, "You need at least 1 grenade to use this ability.\n");
return;
}

damage = MIRV_INITIAL_DAMAGE + MIRV_ADDON_DAMAGE * ent->myskills.abilities[MIRV].current_level;
radius = MIRV_INITIAL_RADIUS + MIRV_ADDON_RADIUS * ent->myskills.abilities[MIRV].current_level;
Expand All @@ -165,4 +170,5 @@ void Cmd_TossMirv (edict_t *ent)

ent->client->ability_delay = level.time + MIRV_DELAY;
ent->client->pers.inventory[power_cube_index] -= cost;
ent->client->pers.inventory[grenade_index]--;
}
7 changes: 7 additions & 0 deletions src/combat/abilities/napalm.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ void Cmd_Napalm_f (edict_t *ent)
if (!G_CanUseAbilities(ent, ent->myskills.abilities[NAPALM].current_level, cost))
return;

if (ent->client->pers.inventory[grenade_index] < 1)
{
safe_cprintf(ent, PRINT_HIGH, "You need at least 1 grenade to use this ability.\n");
return;
}

if (ent->num_napalm >= NAPALM_MAX_COUNT)
{
safe_cprintf(ent, PRINT_HIGH, "Can't throw any more napalm grenades.\n");
Expand All @@ -269,5 +275,6 @@ void Cmd_Napalm_f (edict_t *ent)
fire_napalm(ent, start, forward, damage, burn_dmg, 400, NAPALM_DURATION, radius);

ent->client->pers.inventory[power_cube_index] -= cost;
ent->client->pers.inventory[grenade_index]--;
ent->client->ability_delay = level.time + NAPALM_DELAY;
}
13 changes: 10 additions & 3 deletions src/combat/abilities/spikegrenade.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ void ThrowSpikeGrenade (edict_t *self, vec3_t start, vec3_t forward, int slevel,

VectorCopy(start, grenade->s.origin);
grenade->movetype = MOVETYPE_BOUNCE;
grenade->health = grenade->max_health = 100;//4.4
grenade->takedamage = DAMAGE_AIM;//4.4
grenade->die = spikegren_die;//4.4
//grenade->health = grenade->max_health = 100 + 25 * slevel;//4.4
//grenade->takedamage = DAMAGE_AIM;//4.4
//grenade->die = spikegren_die;//4.4
grenade->owner = self;
grenade->monsterinfo.level = slevel;
grenade->mtype = M_SPIKE_GRENADE;
Expand Down Expand Up @@ -222,6 +222,12 @@ void Cmd_SpikeGrenade_f (edict_t *ent)
if (!V_CanUseAbilities(ent, SPIKE_GRENADE, cost, true))
return;

if (ent->client->pers.inventory[grenade_index] < 1)
{
safe_cprintf(ent, PRINT_HIGH, "You need at least 1 grenade to use this ability.\n");
return;
}

VectorCopy(ent->s.origin, start);
start[2] += ent->viewheight - 8;
AngleVectors(ent->client->v_angle, forward, NULL, NULL);
Expand All @@ -234,5 +240,6 @@ void Cmd_SpikeGrenade_f (edict_t *ent)
ThrowSpikeGrenade(ent, start, forward, ent->myskills.abilities[SPIKE_GRENADE].current_level, SPIKEGRENADE_DURATION);

ent->client->pers.inventory[power_cube_index] -= cost;
ent->client->pers.inventory[grenade_index]--;
ent->client->ability_delay = level.time + SPIKEGRENADE_DELAY;
}
3 changes: 2 additions & 1 deletion src/combat/common/g_combat.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,8 @@ int T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker,
if (!targ->inuse)
return 0;

// gi.dprintf("original damage: %d target: %s (%.1f)\n", damage, targ->classname, level.time);
//gi.dprintf("original damage: %d target: %s (%.1f)\n", damage, targ->classname, level.time);

before_sub = damage = G_AddDamage(targ, inflictor, attacker, point, damage, dflags, mod);

//4.1 some abilities that increase damage are seperate from all the others.
Expand Down

0 comments on commit f69aad0

Please sign in to comment.