Species update with base hit/mana/stam

This commit is contained in:
kinther 2025-12-29 09:07:21 -08:00
parent 9443bab159
commit 497218958e
4 changed files with 96 additions and 6 deletions

View file

@ -584,14 +584,24 @@ void grant_class_skills(struct char_data *ch, bool reset)
/* Some initializations for characters, including initial skills */
void do_start(struct char_data *ch)
{
int base_hit = 90;
int base_mana = 100;
int base_stamina = 90;
GET_LEVEL(ch) = 1;
GET_EXP(ch) = 1;
roll_real_abils(ch);
GET_MAX_HIT(ch) = 90;
GET_MAX_MANA(ch) = 100;
GET_MAX_STAMINA(ch) = 90;
if (!get_species_base_points(GET_SPECIES(ch), &base_hit, &base_mana, &base_stamina)) {
base_hit = 90;
base_mana = 100;
base_stamina = 90;
}
GET_MAX_HIT(ch) = base_hit;
GET_MAX_MANA(ch) = base_mana;
GET_MAX_STAMINA(ch) = base_stamina;
grant_class_skills(ch, TRUE);
grant_species_skills(ch);
@ -616,6 +626,20 @@ void advance_level(struct char_data *ch)
{
int add_hp, add_mana = 0, add_move = 0, i;
if (GET_LEVEL(ch) >= LVL_IMMORT) {
GET_MAX_HIT(ch) = 999;
GET_MAX_MANA(ch) = 999;
GET_MAX_STAMINA(ch) = 999;
for (i = 0; i < 3; i++)
GET_COND(ch, i) = (char) -1;
SET_BIT_AR(PRF_FLAGS(ch), PRF_HOLYLIGHT);
snoop_check(ch);
save_char(ch);
return;
}
add_hp = GET_ABILITY_MOD(GET_CON(ch));
switch (GET_CLASS(ch)) {

View file

@ -21,6 +21,7 @@
#include "house.h"
#include "constants.h"
#include "oasis.h"
#include "species.h"
#include "dg_scripts.h"
#include "dg_event.h"
#include "act.h"
@ -2740,6 +2741,18 @@ struct char_data *read_mobile(mob_vnum nr, int type) /* and mob_rnum */
} else
mob->points.max_hit = rand_number(mob->points.hit, mob->points.mana);
{
int base_hit = 0;
int base_mana = 0;
int base_stamina = 0;
if (get_species_base_points(GET_SPECIES(mob), &base_hit, &base_mana, &base_stamina)) {
mob->points.max_hit += base_hit;
mob->points.max_mana += base_mana;
mob->points.max_stamina += base_stamina;
}
}
mob->points.hit = mob->points.max_hit;
mob->points.mana = mob->points.max_mana;
mob->points.stamina = mob->points.max_stamina;
@ -3813,9 +3826,9 @@ void init_char(struct char_data *ch)
GET_EXP(ch) = 7000000;
/* The implementor never goes through do_start(). */
GET_MAX_HIT(ch) = 500;
GET_MAX_MANA(ch) = 100;
GET_MAX_STAMINA(ch) = 82;
GET_MAX_HIT(ch) = 999;
GET_MAX_MANA(ch) = 999;
GET_MAX_STAMINA(ch) = 999;
GET_HIT(ch) = GET_MAX_HIT(ch);
GET_MANA(ch) = GET_MAX_MANA(ch);
GET_STAMINA(ch) = GET_MAX_STAMINA(ch);

View file

@ -65,6 +65,43 @@ const int pc_species_list[] = {
-1
};
struct species_base_points {
int hit;
int mana;
int stamina;
};
static const struct species_base_points species_base_points[NUM_SPECIES] = {
{ 100, 90, 100 }, /* Human */
{ 90, 110, 90 }, /* City Elf */
{ 100, 80, 140 }, /* Desert Elf */
{ 95, 90, 95 }, /* Half-Elf */
{ 110, 75, 110 }, /* Dwarf */
{ 110, 80, 110 }, /* Mul */
{ 180, 50, 180 }, /* Half-Giant */
{ 90, 90, 90 }, /* Mantis */
{ 90, 100, 90 }, /* Gith */
{ 90, 90, 90 }, /* Aarakocra */
{ 100, 100, 100 }, /* Dray */
{ 70, 120, 80 }, /* Kenku */
{ 60, 10, 80 }, /* Jozhal */
{ 120, 10, 120 }, /* Pterran */
{ 100, 60, 100 }, /* Tarek */
{ 60, 10, 80 }, /* Aprig */
{ 100, 10, 100 }, /* Carru */
{ 100, 10, 80 }, /* Crodlu */
{ 80, 10, 200 }, /* Erdlu */
{ 120, 10, 400 }, /* Inix */
{ 75, 10, 75 }, /* Jhakar */
{ 100, 10, 300 }, /* Kank */
{ 200, 10, 150 }, /* Mekillot */
{ 100, 10, 150 }, /* Worm */
{ 10, 10, 20 }, /* Renk */
{ 10, 10, 20 }, /* Rat */
{ 110, 110, 110 }, /* Undead */
{ 250, 250, 250 } /* Dragon */
};
static const struct species_skill_bonus species_skill_none[] = {
{ -1, 0 }
};
@ -285,6 +322,21 @@ int species_ability_cap(int species, int ability)
return species_ability_caps[species][ability];
}
bool get_species_base_points(int species, int *hit, int *mana, int *stamina)
{
if (species < 0 || species >= NUM_SPECIES)
return FALSE;
if (hit)
*hit = species_base_points[species].hit;
if (mana)
*mana = species_base_points[species].mana;
if (stamina)
*stamina = species_base_points[species].stamina;
return TRUE;
}
static void apply_species_ranges(struct char_data *ch)
{
int species;

View file

@ -17,6 +17,7 @@ bool species_is_pc_selectable(int species);
int species_ability_mod(int species, int ability);
int species_ability_min(int species, int ability);
int species_ability_cap(int species, int ability);
bool get_species_base_points(int species, int *hit, int *mana, int *stamina);
void apply_species_bonuses(struct char_data *ch);
void grant_species_skills(struct char_data *ch);