Skip to content

Commit

Permalink
Poltergeist now receives 50 cells on respawn/death, and power screen …
Browse files Browse the repository at this point in the history
…will automatically activate for berserker and brain morphs. Modified initial and addon health/armor/powercubes to be closer aligned to v4.8; in particular, engineer and knight start with 100 armor (they both have armor-focused abilities).
  • Loading branch information
Vortex-Quake2 committed Jan 3, 2023
1 parent e4a3e20 commit 4888f72
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 73 deletions.
138 changes: 68 additions & 70 deletions lua/variables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,76 +54,74 @@ SPREE_BREAKBONUS = 100
MONSTER_MASTERY_FACTOR = 0.04

-- Character basics
INITIAL_POWERCUBES_ALIEN = 200
LEVELUP_POWERCUBES_ALIEN = 10
INITIAL_ARMOR_CLERIC = 50

INITIAL_HEALTH_CLERIC = 100
LEVELUP_HEALTH_CLERIC = 5
INITIAL_ARMOR_SHAMAN = 50

INITIAL_HEALTH_SHAMAN = 100
LEVELUP_HEALTH_SHAMAN = 5
INITIAL_ARMOR_NECROMANCER = 50
LEVELUP_ARMOR_NECROMANCER = 1
INITIAL_HEALTH_NECROMANCER = 100
LEVELUP_HEALTH_NECROMANCER = 1
INITIAL_HEALTH_SOLDIER = 100
INITIAL_HEALTH_ENGINEER = 100
INITIAL_HEALTH_VAMPIRE = 100
INITIAL_HEALTH_POLTERGEIST = 100
INITIAL_HEALTH_ALIEN = 100
INITIAL_HEALTH_KNIGHT = 100
INITIAL_HEALTH_MAGE = 100
INITIAL_HEALTH_WEAPONMASTER = 100
LEVELUP_HEALTH_SOLDIER = 1
LEVELUP_HEALTH_ENGINEER = 2
LEVELUP_HEALTH_VAMPIRE = 8
LEVELUP_HEALTH_POLTERGEIST = 5
LEVELUP_HEALTH_ALIEN = 5
LEVELUP_HEALTH_KNIGHT = 6
LEVELUP_HEALTH_MAGE = 5
LEVELUP_HEALTH_WEAPONMASTER = 2
INITIAL_ARMOR_SOLDIER = 35
INITIAL_ARMOR_ENGINEER = 35
INITIAL_ARMOR_VAMPIRE = 25
INITIAL_ARMOR_POLTERGEIST = 0
INITIAL_ARMOR_ALIEN = 30
INITIAL_ARMOR_KNIGHT = 25
INITIAL_ARMOR_MAGE = 75
INITIAL_ARMOR_WEAPONMASTER = 50
LEVELUP_ARMOR_SOLDIER = 5
LEVELUP_ARMOR_ENGINEER = 6
LEVELUP_ARMOR_POLTERGEIST = 0
LEVELUP_ARMOR_ALIEN = 4
LEVELUP_ARMOR_KNIGHT = 10
LEVELUP_ARMOR_MAGE = 4
LEVELUP_ARMOR_WEAPONMASTER = 4
LEVELUP_ARMOR_VAMPIRE = 4
LEVELUP_ARMOR_SHAMAN = 4
LEVELUP_ARMOR_CLERIC = 5

INITIAL_POWERCUBES_SOLDIER = 200
LEVELUP_POWERCUBES_SOLDIER = 10
INITIAL_POWERCUBES_VAMPIRE = 200
LEVELUP_POWERCUBES_VAMPIRE = 10
INITIAL_POWERCUBES_KNIGHT = 200
LEVELUP_POWERCUBES_KNIGHT = 10
INITIAL_POWERCUBES_MAGE = 200
LEVELUP_POWERCUBES_MAGE = 30
INITIAL_POWERCUBES_POLTERGEIST = 200
LEVELUP_POWERCUBES_POLTERGEIST = 10
INITIAL_POWERCUBES_ENGINEER = 200
LEVELUP_POWERCUBES_ENGINEER = 15
INITIAL_POWERCUBES_WEAPONMASTER = 200
LEVELUP_POWERCUBES_WEAPONMASTER = 10
INITIAL_POWERCUBES_CLERIC = 200
LEVELUP_POWERCUBES_CLERIC = 10
INITIAL_POWERCUBES_SHAMAN = 200
LEVELUP_POWERCUBES_SHAMAN = 10
INITIAL_POWERCUBES_NECROMANCER = 200
LEVELUP_POWERCUBES_NECROMANCER = 10

INITIAL_POWERCUBES_ALIEN = 200
LEVELUP_POWERCUBES_ALIEN = 10
INITIAL_POWERCUBES_SOLDIER = 200
LEVELUP_POWERCUBES_SOLDIER = 10
INITIAL_POWERCUBES_VAMPIRE = 200
LEVELUP_POWERCUBES_VAMPIRE = 10
INITIAL_POWERCUBES_KNIGHT = 200
LEVELUP_POWERCUBES_KNIGHT = 10
INITIAL_POWERCUBES_MAGE = 200
LEVELUP_POWERCUBES_MAGE = 30
INITIAL_POWERCUBES_POLTERGEIST = 200
LEVELUP_POWERCUBES_POLTERGEIST = 10
INITIAL_POWERCUBES_ENGINEER = 200
LEVELUP_POWERCUBES_ENGINEER = 10
INITIAL_POWERCUBES_WEAPONMASTER = 200
LEVELUP_POWERCUBES_WEAPONMASTER = 10
INITIAL_POWERCUBES_CLERIC = 200
LEVELUP_POWERCUBES_CLERIC = 10
INITIAL_POWERCUBES_SHAMAN = 200
LEVELUP_POWERCUBES_SHAMAN = 10
INITIAL_POWERCUBES_NECROMANCER = 200
LEVELUP_POWERCUBES_NECROMANCER = 10

INITIAL_HEALTH_CLERIC = 100
LEVELUP_HEALTH_CLERIC = 5
INITIAL_HEALTH_SHAMAN = 100
LEVELUP_HEALTH_SHAMAN = 5
INITIAL_HEALTH_NECROMANCER = 100
LEVELUP_HEALTH_NECROMANCER = 1
INITIAL_HEALTH_SOLDIER = 100
LEVELUP_HEALTH_SOLDIER = 1
INITIAL_HEALTH_ENGINEER = 100
LEVELUP_HEALTH_ENGINEER = 2
INITIAL_HEALTH_VAMPIRE = 100
LEVELUP_HEALTH_VAMPIRE = 5
INITIAL_HEALTH_POLTERGEIST = 100
LEVELUP_HEALTH_POLTERGEIST = 5
INITIAL_HEALTH_ALIEN = 100
LEVELUP_HEALTH_ALIEN = 5
INITIAL_HEALTH_KNIGHT = 100
LEVELUP_HEALTH_KNIGHT = 5
INITIAL_HEALTH_MAGE = 100
LEVELUP_HEALTH_MAGE = 5
INITIAL_HEALTH_WEAPONMASTER = 100
LEVELUP_HEALTH_WEAPONMASTER = 1

INITIAL_ARMOR_NECROMANCER = 50
LEVELUP_ARMOR_NECROMANCER = 0
INITIAL_ARMOR_SOLDIER = 50
LEVELUP_ARMOR_SOLDIER = 2
INITIAL_ARMOR_ENGINEER = 100
LEVELUP_ARMOR_ENGINEER = 5
INITIAL_ARMOR_VAMPIRE = 50
LEVELUP_ARMOR_VAMPIRE = 0
INITIAL_ARMOR_POLTERGEIST = 0
LEVELUP_ARMOR_POLTERGEIST = 0
INITIAL_ARMOR_ALIEN = 50
LEVELUP_ARMOR_ALIEN = 0
INITIAL_ARMOR_KNIGHT = 100
LEVELUP_ARMOR_KNIGHT = 10
INITIAL_ARMOR_MAGE = 50
LEVELUP_ARMOR_MAGE = 0
INITIAL_ARMOR_WEAPONMASTER = 50
LEVELUP_ARMOR_WEAPONMASTER = 0
INITIAL_ARMOR_SHAMAN = 50
LEVELUP_ARMOR_SHAMAN = 2
INITIAL_ARMOR_CLERIC = 50
LEVELUP_ARMOR_CLERIC = 2

-- Tballs
TBALLS_RESPAWN = 2
Expand Down
22 changes: 20 additions & 2 deletions src/combat/common/v_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,14 @@ void vrx_add_respawn_items(edict_t *ent) {
ent->client->pers.inventory[ITEM_INDEX(Fdi_TBALL)] = ent->myskills.inventory[ITEM_INDEX(
Fdi_TBALL)] += TBALLS_RESPAWN;

if ((ent->myskills.class_num == CLASS_POLTERGEIST) && (ent->client->pers.inventory[power_cube_index] < 50))
ent->client->pers.inventory[power_cube_index] += 50;
// poltergeist always spawns with at least 50 power cubes (for morphing) and cells (for power screen)
if (ent->myskills.class_num == CLASS_POLTERGEIST)
{
if (ent->client->pers.inventory[power_cube_index] < 50)
ent->client->pers.inventory[power_cube_index] = 50;
if (ent->client->pers.inventory[cell_index] < 50)
ent->client->pers.inventory[cell_index] = 50;
}
else
ent->client->pers.inventory[ITEM_INDEX(Fdi_POWERCUBE)] = ent->myskills.inventory[ITEM_INDEX(
Fdi_POWERCUBE)] += POWERCUBES_RESPAWN;
Expand Down Expand Up @@ -283,4 +289,16 @@ void vrx_pick_respawn_weapon(edict_t *ent) {
ent->client->newweapon = item;

ChangeWeapon(ent);
}

void Use_PowerArmor(edict_t* ent, gitem_t* item);

void vrx_morph_think(edict_t* ent)
{
// only valid player-morphs should be calling this function
if (!ent || !ent->inuse || !ent->client || !ent->mtype)
return;
// activate power screen for berserk and brain automatically when player has cells for it
if ((ent->mtype == MORPH_BERSERK || ent->mtype == MORPH_BRAIN) && ent->client->pers.inventory[cell_index] && !(ent->flags & FL_POWER_ARMOR))
Use_PowerArmor(ent, NULL);
}
2 changes: 1 addition & 1 deletion src/combat/common/v_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,4 +671,4 @@ void ThrowShrapnel(edict_t* self, char* modelname, float speed, vec3_t origin, i
else
chunk->creator = self;
gi.linkentity(chunk);
}
}
1 change: 1 addition & 0 deletions src/quake2/p_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2867,6 +2867,7 @@ void ClientThink (edict_t *ent, usercmd_t *ucmd)
RunBerserkFrames(ent, ucmd);
EatCorpses(ent);
UpdateMirroredEntities(ent);
vrx_morph_think(ent);
}

// az: this code has been a little redundant in places
Expand Down
2 changes: 2 additions & 0 deletions src/v_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ void V_GibSound(edict_t *self, int index);

void vrx_player_death(edict_t *self, edict_t *attacker, edict_t *inflictor);

void vrx_morph_think(edict_t* ent);

//************ vote.c *************
void CheckPlayerVotes(void);
void V_ChangeMap(v_maplist_t *maplist, int mapindex, int gamemode);
Expand Down

0 comments on commit 4888f72

Please sign in to comment.