34 static size_t get_index(
int stat,
size_t max_index);
41 #define ADD_EXP(exptotal, exp) do { exptotal += exp; if (exptotal > MAX_EXPERIENCE) exptotal = MAX_EXPERIENCE; } while (0)
42 #define ADD_TOTALEXP(exptotal, exp) do { exptotal += exp; if (exptotal > MAX_TOTAL_EXPERIENCE) exptotal = MAX_TOTAL_EXPERIENCE; } while(0)
58 #define INT_FEAR_BONUS 0
59 #define INT_TURN_BONUS 1
60 #define INT_CLERIC_CHANCE 2
61 #define INT_LEARN_SPELL 3
62 #define INT_CHA_BONUS 4
63 #define INT_DEX_BONUS 5
64 #define INT_DAM_BONUS 6
65 #define INT_THAC0_BONUS 7
66 #define INT_WEIGHT_LIMIT 8
67 #define NUM_INT_BONUSES 9
76 "cha_fear_bonus",
"wis_turn_bonus",
"wis_cleric_chance",
"int_wis_learn_spell",
77 "cha_shop_bonus",
"dex_bonus",
"str_damage_bonus",
"str_hit_bonus",
85 #define FLOAT_CON_BONUS 0
86 #define FLOAT_DEX_BONUS 1
87 #define FLOAT_SP_BONUS 2
88 #define FLOAT_GRACE_BONUS 3
89 #define NUM_FLOAT_BONUSES 4
92 "con_hp_bonus",
"dex_speed_bonus",
"pow_int_sp_bonus",
"wis_pow_grace_bonus"
99 #define MAX_EXPERIENCE levels[settings.max_level]
103 #define MAX_SAVE_LEVEL 110
115 18, 17, 16, 15, 14, 14, 13, 13, 12, 12,
116 12, 11, 11, 11, 11, 10, 10, 10, 10, 9,
117 9, 9, 9, 9, 8, 8, 8, 8, 8, 8,
118 7, 7, 7, 7, 7, 7, 7, 6, 6, 6,
119 6, 6, 6, 6, 6, 5, 5, 5, 5, 5,
120 5, 5, 5, 5, 4, 4, 4, 4, 4, 4,
121 4, 4, 4, 4, 3, 3, 3, 3, 3, 3,
122 3, 3, 3, 3, 3, 2, 2, 2, 2, 2,
123 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,
124 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
125 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
130 "physical",
"magical",
"fire",
"electricity",
"cold",
131 "confusion",
"acid",
"drain",
"weaponmagic",
"ghosthit",
132 "poison",
"slow",
"paralyze",
"turn undead",
"fear",
133 "cancellation",
"depletion",
"death",
"chaos",
"counterspell",
134 "god power",
"holy power",
"blinding",
"",
"life stealing",
140 "You feel drained of strength.",
141 "You feel drained of agility.",
142 "You feel drained of health.",
143 "You feel drained of wisdom.",
144 "You feel drained of charisma.",
145 "You feel drained of intelligence.",
146 "You feel drained of power."
151 "You feel your strength return.",
152 "You feel your agility return.",
153 "You feel your health return.",
154 "You feel your wisdom return.",
155 "You feel your charisma return.",
156 "You feel your intelligence return.",
157 "You feel your power return."
162 "You feel stronger.",
163 "You feel more agile.",
166 "You seem to look better.",
168 "You feel more potent."
175 "You feel less healthy!",
179 "You feel less potent!"
297 LOG(
llevError,
"Invalid attribute in change_attr_value: %d\n", attr);
359 else if (v < min_stat)
369 #define DIFF_MSG(flag, subtype1, subtype2, msg1, msg2) \
370 draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_ATTRIBUTE, (flag > 0) ? subtype1 : subtype2, (flag > 0) ? msg1 : msg2);
403 memcpy(&refop,
op,
sizeof(
object));
415 nstat = flag*i+ostat;
422 if (nstat < 1 && i*flag < 0)
427 if (nstat != ostat) {
449 op->attacktype &= ~
tmp->attacktype;
450 op->path_attuned &= ~
tmp->path_attuned;
451 op->path_repelled &= ~
tmp->path_repelled;
452 op->path_denied &= ~
tmp->path_denied;
456 op->move_type &= ~
tmp->move_type;
471 "Your hands begin to glow red.",
472 "Your hands stop glowing red.");
477 "You feel very protected.",
478 "You don't feel protected anymore.");
483 "A magic force shimmers around you.",
484 "The magic force fades away.");
489 "You feel more safe now, somehow.",
490 "Suddenly you feel less safe, somehow.");
506 "You start to float in the air!",
507 "You float down to the ground.");
515 "You soar into the air!.",
517 "You float down to the ground."));
521 "You feel ready for a swim",
522 "You no longer feel like swimming");
542 if (
op->arch->clone.race)
553 "You walk more quietly.",
554 "You walk more noisily.");
559 "You become transparent.",
560 "You can see yourself.");
574 op->contr->do_los = 1;
583 op->contr->do_los = 1;
591 op->contr->do_los = 1;
593 "Your vision is better in the dark.",
594 "You see less well in the dark.");
605 op->contr->do_los = 1;
613 op->contr->do_los = 1;
618 if (
tmp->stats.luck) {
621 "You feel more lucky.",
622 "You feel less lucky.");
628 "You feel much more healthy!",
629 "You feel much less healthy!");
635 "You feel one with the powers of magic!",
636 "You suddenly feel very mundane.");
643 "You feel closer to your god!",
644 "You suddenly feel less holy.");
650 "You feel more confident in combat.",
651 "You feel less confident in combat.");
657 "You feel more confident in your dodging skills.",
658 "You feel less confident in your dodging skills.");
664 "You feel like you're moving faster.",
665 "You feel like you're moving more slowly.");
671 "You feel your digestion slowing down.",
672 "You feel your digestion speeding up.");
680 if (
op->resist[i] != refop.
resist[i]) {
682 if (
op->resist[i] > refop.
resist[i])
684 "Your resistance to %s rises to %d%%.",
688 "Your resistance to %s drops to %d%%.",
698 if ((curr_val >
MIN_STAT && i < 0) || (curr_val < settings.max_stat && i > 0)) {
784 return (
count == 0) ? 0 : 1;
819 if (new_luck >= -100 && new_luck <= 100) {
821 tmp->stats.luck = new_luck;
824 if (!
tmp->stats.luck) {
831 int diff =
tmp->stats.luck > 0 ? -1 : 1;
832 op->stats.luck += diff;
833 tmp->stats.luck += diff;
846 op->stats.Str -=
op->arch->clone.stats.Str;
847 op->stats.Dex -=
op->arch->clone.stats.Dex;
848 op->stats.Con -=
op->arch->clone.stats.Con;
849 op->stats.Wis -=
op->arch->clone.stats.Wis;
850 op->stats.Pow -=
op->arch->clone.stats.Pow;
851 op->stats.Cha -=
op->arch->clone.stats.Cha;
852 op->stats.Int -=
op->arch->clone.stats.Int;
853 op->contr->orig_stats.Str -=
op->arch->clone.stats.Str;
854 op->contr->orig_stats.Dex -=
op->arch->clone.stats.Dex;
855 op->contr->orig_stats.Con -=
op->arch->clone.stats.Con;
856 op->contr->orig_stats.Wis -=
op->arch->clone.stats.Wis;
857 op->contr->orig_stats.Pow -=
op->arch->clone.stats.Pow;
858 op->contr->orig_stats.Cha -=
op->arch->clone.stats.Cha;
859 op->contr->orig_stats.Int -=
op->arch->clone.stats.Int;
869 op->stats.Str +=
op->arch->clone.stats.Str;
870 op->stats.Dex +=
op->arch->clone.stats.Dex;
871 op->stats.Con +=
op->arch->clone.stats.Con;
872 op->stats.Wis +=
op->arch->clone.stats.Wis;
873 op->stats.Pow +=
op->arch->clone.stats.Pow;
874 op->stats.Cha +=
op->arch->clone.stats.Cha;
875 op->stats.Int +=
op->arch->clone.stats.Int;
876 op->contr->orig_stats.Str +=
op->arch->clone.stats.Str;
877 op->contr->orig_stats.Dex +=
op->arch->clone.stats.Dex;
878 op->contr->orig_stats.Con +=
op->arch->clone.stats.Con;
879 op->contr->orig_stats.Wis +=
op->arch->clone.stats.Wis;
880 op->contr->orig_stats.Pow +=
op->arch->clone.stats.Pow;
881 op->contr->orig_stats.Cha +=
op->arch->clone.stats.Cha;
882 op->contr->orig_stats.Int +=
op->arch->clone.stats.Int;
897 static void fix_player(
object *
op,
int *
ac,
int *wc,
const object *grace_obj,
const object *mana_obj,
const object *wc_obj,
int weapon_speed,
float added_speed)
906 pl_level =
op->level;
919 for (i = 1,
op->stats.maxhp = 0; i <= pl_level && i <= 10; i++) {
924 if (tmpf < 1.0) tmpf = 1.0;
932 op->stats.maxhp = (
int)(maxhp + 0.5);
934 op->stats.maxhp += 2 * (
op->level - 10);
936 op->stats.maxhp +=
op->arch->clone.stats.maxhp;
938 if (
op->stats.hp >
op->stats.maxhp)
939 op->stats.hp =
op->stats.maxhp;
945 if (!mana_obj || !mana_obj->
level) {
948 float sp_tmp = 0.0, mana_bonus;
951 mana_lvl_max = (mana_obj->
level >10 ? 10: mana_obj->
level);
954 for (i = 1; i <= mana_lvl_max; i++) {
957 stmp =
op->contr->levsp[i] + mana_bonus;
960 if (i == 1) stmp += mana_bonus;
968 op->stats.maxsp = (
int)sp_tmp+
op->arch->clone.stats.maxsp;
971 op->stats.maxsp += 2 * (mana_obj->
level - 10);
975 if (
op->stats.sp >
op->stats.maxsp*2)
976 op->stats.sp =
op->stats.maxsp*2;
979 if (!grace_obj || !grace_obj->
level) {
980 op->stats.maxgrace = 1;
987 float sp_tmp = 0.0, grace_bonus;
991 for (i = 1; i <= grace_obj->
level && i <= 10; i++) {
992 float grace_tmp =
op->contr->levgrace[i] + grace_bonus;
996 grace_tmp += grace_bonus;
1000 sp_tmp += grace_tmp;
1002 op->stats.maxgrace = (
int)sp_tmp+
op->arch->clone.stats.maxgrace;
1006 op->stats.maxgrace += 2 * (grace_obj->
level - 10);
1010 if (
op->contr->braced) {
1028 if (wc_obj && wc_obj->
level >= 1) {
1030 int wc_increase_rate;
1032 wc_increase_rate = wc_in?atoi(wc_in):5;
1033 assert(wc_increase_rate != 0);
1036 (*wc) -= (wc_obj->
level-1)/wc_increase_rate;
1037 op->stats.dam += (wc_obj->
level-1)/4;
1043 if (
op->stats.dam < 1)
1058 if (
op->attacktype == 0)
1059 op->attacktype =
op->arch->clone.attacktype;
1076 if (
op->contr->character_load >= 1.0)
1077 op->contr->character_load = 1.0;
1088 op->contr->character_load = 0;
1094 op->weapon_speed += 0.005*wc_obj->
level;
1096 op->weapon_speed += 0.005*
op->level;
1102 op->weapon_speed -=
op->contr->character_load*0.2;
1104 if (
op->weapon_speed < 0.05)
1105 op->weapon_speed = 0.05;
1134 float max = 9, added_speed = 0, speed_reduce_from_disease = 1;
1135 int weapon_speed = 0;
1136 int best_wc = 0, best_ac = 0, wc = 0,
ac = 0;
1138 const object *grace_obj = NULL, *mana_obj = NULL, *wc_obj = NULL;
1147 op->contr->encumbrance = 0;
1150 op->contr->digestion = 0;
1151 op->contr->gen_hp = 0;
1152 op->contr->gen_sp = 0;
1153 op->contr->gen_grace = 0;
1154 op->contr->gen_sp_armour = 10;
1155 op->contr->item_power = 0;
1166 memcpy(
op->body_used,
op->body_info,
sizeof(
op->body_info));
1168 if (
op->slaying != NULL) {
1191 op->path_attuned =
op->arch->clone.path_attuned;
1192 op->path_repelled =
op->arch->clone.path_repelled;
1193 op->path_denied =
op->arch->clone.path_denied;
1194 op->glow_radius =
op->arch->clone.glow_radius;
1195 op->move_type =
op->arch->clone.move_type;
1196 op->chosen_skill = NULL;
1201 memcpy(&
op->resist, &
op->arch->clone.resist,
sizeof(
op->resist));
1204 if (
op->resist[i] > 0)
1205 prot[i] =
op->resist[i], vuln[i] = 0;
1207 vuln[i] = -(
op->resist[i]), prot[i] = 0;
1208 potion_resist[i] = 0;
1211 wc =
op->arch->clone.stats.wc;
1212 op->stats.dam =
op->arch->clone.stats.dam;
1222 ac =
MAX(-10,
op->arch->clone.stats.ac-
op->level/3);
1225 ac =
op->arch->clone.stats.ac;
1227 op->stats.luck =
op->arch->clone.stats.luck;
1228 op->speed =
op->arch->clone.speed;
1238 if (
tmp->glow_radius >
op->glow_radius)
1239 op->glow_radius =
tmp->glow_radius;
1254 else if (
tmp->level > mana_obj->level)
1260 else if (
tmp->level > grace_obj->
level)
1319 op->contr->digestion +=
tmp->stats.food;
1320 op->contr->gen_hp +=
tmp->stats.hp;
1321 op->contr->gen_sp +=
tmp->stats.sp;
1322 op->contr->gen_grace +=
tmp->stats.grace;
1323 op->contr->gen_sp_armour +=
tmp->gen_sp_armour;
1332 op->contr->item_power +=
tmp->item_power;
1340 op->body_used[i] +=
tmp->body_info[i];
1345 if (((
float)
tmp->last_sp/100.0) < speed_reduce_from_disease)
1346 speed_reduce_from_disease = (float)
tmp->last_sp/100.0;
1360 if (potion_resist[i])
1361 potion_resist[i] =
MAX(potion_resist[i],
tmp->resist[i]);
1363 potion_resist[i] =
tmp->resist[i];
1364 }
else if (
tmp->resist[i] > 0)
1365 prot[i] += ((100-prot[i])*
tmp->resist[i])/100;
1366 else if (
tmp->resist[i] < 0)
1367 vuln[i] += ((100-vuln[i])*(-
tmp->resist[i]))/100;
1373 op->attacktype |=
tmp->attacktype;
1375 op->path_attuned |=
tmp->path_attuned;
1376 op->path_repelled |=
tmp->path_repelled;
1377 op->path_denied |=
tmp->path_denied;
1378 op->stats.luck +=
tmp->stats.luck;
1379 op->move_type |=
tmp->move_type;
1411 added_speed += (float)
tmp->stats.exp/3.0;
1414 switch (
tmp->type) {
1424 if (
op->chosen_skill) {
1425 LOG(
llevDebug,
"fix_object, op %s has multiple skills applied\n",
op->name);
1427 op->chosen_skill =
tmp;
1428 if (
tmp->stats.dam > 0) {
1431 if (weapon_speed < 0)
1433 op->stats.dam +=
tmp->stats.dam*(1+(
op->chosen_skill->level/9));
1434 op->stats.dam +=
tmp->magic;
1437 wc -= (
tmp->stats.wc+
tmp->magic);
1439 if (
tmp->slaying != NULL) {
1440 if (
op->slaying != NULL)
1448 op->contr->encumbrance += (
int)3*
tmp->weight/1000;
1454 if (
op->chosen_skill) {
1455 LOG(
llevDebug,
"fix_object, op %s has multiple skills applied\n",
op->name);
1457 op->chosen_skill =
tmp;
1464 op->contr->encumbrance += (
int)
tmp->weight/2000;
1474 wc -=
tmp->stats.wc;
1476 op->stats.dam += (
tmp->stats.dam+
tmp->magic);
1482 wc -=
tmp->stats.wc;
1483 if (
tmp->stats.ac &&
tmp->stats.ac+
tmp->magic > 0)
1485 op->stats.dam += (
tmp->stats.dam+
tmp->magic);
1487 if (weapon_speed < 0)
1489 if (
tmp->slaying != NULL) {
1490 if (
op->slaying != NULL)
1498 op->current_weapon =
tmp;
1500 op->contr->encumbrance += (
int)3*
tmp->weight/1000;
1505 op->contr->encumbrance += (
int)
tmp->weight/1000;
1513 if (
tmp->stats.wc) {
1515 if (
tmp->type ==
BRACERS &&
op->type ==
PLAYER &&
op->arch->name && strcmp(
op->arch->name,
"serpentman_player") == 0)
1520 wc -=
tmp->stats.wc;
1522 else if (best_wc < tmp->stats.wc) {
1524 best_wc =
tmp->stats.wc;
1525 wc -=
tmp->stats.wc;
1528 if (
tmp->stats.ac) {
1535 if (
tmp->type ==
BRACERS &&
op->type ==
PLAYER &&
op->arch->name && strcmp(
op->arch->name,
"serpentman_player") == 0)
1542 else if (best_ac < tmp->stats.ac+
tmp->magic) {
1544 best_ac =
tmp->stats.ac+
tmp->magic;
1549 op->stats.dam += (
tmp->stats.dam+
tmp->magic);
1568 op->resist[i] = prot[i]-vuln[i];
1569 if (potion_resist[i]
1570 && ((potion_resist[i] >
op->resist[i]) || (potion_resist[i] < 0)))
1571 op->resist[i] = potion_resist[i];
1574 fix_player(
op, &
ac, &wc, grace_obj, mana_obj, wc_obj, weapon_speed, added_speed);
1576 op->speed =
op->speed*speed_reduce_from_disease;
1579 if (
op->speed >
max)
1582 op->speed += added_speed/10.0;
1604 if (added_speed > 0)
1605 LOG(
llevInfo,
"fix_object: Monster %s has negative speed of %f.\n",
1606 op->name ?
op->name :
"(null)",
op->speed);
1612 &&
op->stats.dam >
op->arch->clone.stats.dam*3)
1613 op->stats.dam =
op->arch->clone.stats.dam*3;
1637 if (
op->move_type == 0)
1658 return op->stats.Dex > 0
1659 &&
op->stats.Str > 0
1660 &&
op->stats.Con > 0
1661 &&
op->stats.Int > 0
1662 &&
op->stats.Wis > 0
1663 &&
op->stats.Pow > 0
1664 &&
op->stats.Cha > 0;
1696 && (atnr == -1 || abil->
resist[i] > abil->
resist[atnr])) {
1711 if (
pl->contr != NULL) {
1725 object *abil = NULL;
1726 object *skin = NULL;
1752 "Your metabolism now focuses on %s!",
1790 LOG(
llevError,
"add_player_exp: couldn't find skill %s\n", skill_name);
1800 skill_obj->
level = 1;
1849 if (
op->level > 1) {
1851 snprintf(
buf,
sizeof(
buf),
"You are now level %d in the %s skill.",
op->level,
op->name);
1853 snprintf(
buf,
sizeof(
buf),
"You are now level %d.",
op->level);
1863 snprintf(
buf,
sizeof(
buf),
"You are now level %d in the %s skill.",
op->level,
op->name);
1865 snprintf(
buf,
sizeof(
buf),
"You are now level %d.",
op->level);
1911 if (
op->total_exp <
op->stats.exp)
1912 op->total_exp =
op->stats.exp;
1915 if (
op->total_exp < 0)
1930 if (
op->contr->last_skill_ob[i] != NULL) {
1934 LOG(
llevDebug,
"pruning removed object from last_skill_ob\n");
1935 op->contr->last_skill_ob[i] = NULL;
1939 if (
op->contr->last_skill_ob[i]->skill != NULL) {
1940 if (!strcmp(
op->contr->last_skill_ob[i]->skill,
name)) {
1941 return op->contr->last_skill_ob[i];
1945 "%s's skill object %s does not have a skill name\n",
1946 op->name,
op->contr->last_skill_ob[i]->name);
1968 object *skill_obj = NULL;
1969 int64_t limit, exp_to_add;
1970 int64_t added_skill_exp = 0, added_skill_total_exp = 0;
1973 if (
op->contr->braced)
1982 if (
op->chosen_skill
1983 &&
op->chosen_skill->type ==
SKILL
1984 && !strcmp(skill_name,
op->chosen_skill->skill))
1985 skill_obj =
op->chosen_skill;
2016 if (exp_to_add > limit)
2032 if (exp_to_add > limit)
2034 added_skill_exp = skill_obj->
stats.
exp;
2036 added_skill_exp = skill_obj->
stats.
exp - added_skill_exp;
2038 added_skill_total_exp = skill_obj->
total_exp;
2040 added_skill_total_exp = skill_obj->
total_exp - added_skill_total_exp;
2046 added_skill_exp = added_skill_total_exp = exp_to_add;
2049 ADD_EXP(
op->stats.exp, (
float)added_skill_exp*(skill_obj ? skill_obj->
expmul : 1));
2076 if (exp >
op->stats.exp)
2077 exp =
op->stats.exp;
2128 float fraction = (float)exp/(
float)
op->stats.exp;
2135 tmp->stats.exp -= del_exp;
2142 tmp->stats.exp -= del_exp;
2149 op->stats.exp -= del_exp;
2175 void change_exp(
object *
op, int64_t exp,
const char *skill_name,
int flag) {
2178 LOG(
llevError,
"change_exp() called for null object!\n");
2208 op->stats.exp += exp;
2242 int64_t percentage_loss;
2260 tmp->stats.exp -= loss;
2271 op->stats.exp -= loss;
2319 void share_exp(
object *
op, int64_t exp,
const char *skill,
int flag) {
2320 int shares = 0,
count = 0;
2324 if (
op->type !=
PLAYER ||
op->contr->party == NULL) {
2329 party =
op->contr->party;
2334 shares += (
pl->ob->level+4);
2340 if (
count == 1 || shares > exp)
2343 int64_t share = exp/shares, given = 0, nexp;
2346 nexp = (
pl->ob->level+4)*share;
2424 index = (size_t)stat;
2448 int on_stat = 0, tmp_bonus;
2464 if (
buf[0] ==
'}') {
2466 LOG(
llevError,
"Number of bonus does not match max stat (%d!=%d, bonus=%s)\n",
2479 while (!isdigit(*cp) && *cp!=
'.' && *cp!=
'-' && *cp!=
'+' && *cp != 0)
2482 if (*cp == 0)
break;
2484 tmp_bonus = atoi(cp);
2487 LOG(
llevError,
"Number of bonus entries exceed max stat (line=%s, bonus=%s)\n",
2491 (*bonuses)[on_stat] = tmp_bonus;
2495 while ((isdigit(*cp) || *cp==
'-' || *cp==
'+') && *cp != 0)
2500 LOG(
llevError,
"Reached end of file without getting close brace? bonus=%s\n", bonus_name);
2527 *bonuses =
static_cast<float *
>(calloc(
settings.
max_stat+1,
sizeof(
float)));
2541 if (
buf[0] ==
'}') {
2543 LOG(
llevError,
"Number of bonus does not match max stat (%d!=%d, bonus=%s)\n",
2556 while (!isdigit(*cp) && *cp!=
'.' && *cp!=
'-' && *cp!=
'+' && *cp != 0)
2559 if (*cp == 0)
break;
2561 tmp_bonus = atof(cp);
2564 LOG(
llevError,
"Number of bonus entries exceed max stat (line=%s, bonus=%s)\n",
2568 (*bonuses)[on_stat] = tmp_bonus;
2574 while ((isdigit(*cp) || *cp==
'-' || *cp==
'+' || *cp==
'.') && *cp != 0)
2579 LOG(
llevError,
"Reached end of file without getting close brace? bonus=%s\n", bonus_name);
2603 if ((fp = fopen(
buf,
"r")) == NULL) {
2604 LOG(
llevError,
"Fatal error: could not open experience table (%s)\n",
buf);
2612 if ((cp = strrchr(
buf,
'\n')) != NULL)
2621 while (isspace(*cp) && *cp != 0)
2624 if (!strncasecmp(cp,
"max_stat", 8)) {
2625 int newmax = atoi(cp+8);
2636 LOG(
llevError,
"Got invalid max_stat (%d) from stat_bonus file\n", newmax);
2647 LOG(
llevError,
"Got bonus line or otherwise unknown value before max stat! (%s)\n",
2683 if (!new_int_bonuses[i]) {
2690 if (!new_float_bonuses[i]) {
2711 new_int_bonuses[i] = NULL;
2717 new_float_bonuses[i] = NULL;