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)
1051 if (
op->attacktype == 0)
1052 op->attacktype =
op->arch->clone.attacktype;
1069 if (
op->contr->character_load >= 1.0)
1070 op->contr->character_load = 1.0;
1081 op->contr->character_load = 0;
1087 op->weapon_speed += 0.005*wc_obj->
level;
1089 op->weapon_speed += 0.005*
op->level;
1095 op->weapon_speed -=
op->contr->character_load*0.2;
1097 if (
op->weapon_speed < 0.05)
1098 op->weapon_speed = 0.05;
1127 float max = 9, added_speed = 0, speed_reduce_from_disease = 1;
1128 int weapon_speed = 0;
1129 int best_wc = 0, best_ac = 0, wc = 0,
ac = 0;
1131 const object *grace_obj = NULL, *mana_obj = NULL, *wc_obj = NULL;
1140 op->contr->encumbrance = 0;
1143 op->contr->digestion = 0;
1144 op->contr->gen_hp = 0;
1145 op->contr->gen_sp = 0;
1146 op->contr->gen_grace = 0;
1147 op->contr->gen_sp_armour = 10;
1148 op->contr->item_power = 0;
1159 memcpy(
op->body_used,
op->body_info,
sizeof(
op->body_info));
1161 if (
op->slaying != NULL) {
1184 op->path_attuned =
op->arch->clone.path_attuned;
1185 op->path_repelled =
op->arch->clone.path_repelled;
1186 op->path_denied =
op->arch->clone.path_denied;
1187 op->glow_radius =
op->arch->clone.glow_radius;
1188 op->move_type =
op->arch->clone.move_type;
1189 op->chosen_skill = NULL;
1194 memcpy(&
op->resist, &
op->arch->clone.resist,
sizeof(
op->resist));
1197 if (
op->resist[i] > 0)
1198 prot[i] =
op->resist[i], vuln[i] = 0;
1200 vuln[i] = -(
op->resist[i]), prot[i] = 0;
1201 potion_resist[i] = 0;
1204 wc =
op->arch->clone.stats.wc;
1205 op->stats.dam =
op->arch->clone.stats.dam;
1215 ac =
MAX(-10,
op->arch->clone.stats.ac-
op->level/3);
1218 ac =
op->arch->clone.stats.ac;
1220 op->stats.luck =
op->arch->clone.stats.luck;
1221 op->speed =
op->arch->clone.speed;
1231 if (
tmp->glow_radius >
op->glow_radius)
1232 op->glow_radius =
tmp->glow_radius;
1247 else if (
tmp->level > mana_obj->level)
1253 else if (
tmp->level > grace_obj->
level)
1312 op->contr->digestion +=
tmp->stats.food;
1313 op->contr->gen_hp +=
tmp->stats.hp;
1314 op->contr->gen_sp +=
tmp->stats.sp;
1315 op->contr->gen_grace +=
tmp->stats.grace;
1316 op->contr->gen_sp_armour +=
tmp->gen_sp_armour;
1325 op->contr->item_power +=
tmp->item_power;
1333 op->body_used[i] +=
tmp->body_info[i];
1338 if (((
float)
tmp->last_sp/100.0) < speed_reduce_from_disease)
1339 speed_reduce_from_disease = (float)
tmp->last_sp/100.0;
1353 if (potion_resist[i])
1354 potion_resist[i] =
MAX(potion_resist[i],
tmp->resist[i]);
1356 potion_resist[i] =
tmp->resist[i];
1357 }
else if (
tmp->resist[i] > 0)
1358 prot[i] += ((100-prot[i])*
tmp->resist[i])/100;
1359 else if (
tmp->resist[i] < 0)
1360 vuln[i] += ((100-vuln[i])*(-
tmp->resist[i]))/100;
1366 op->attacktype |=
tmp->attacktype;
1368 op->path_attuned |=
tmp->path_attuned;
1369 op->path_repelled |=
tmp->path_repelled;
1370 op->path_denied |=
tmp->path_denied;
1371 op->stats.luck +=
tmp->stats.luck;
1372 op->move_type |=
tmp->move_type;
1404 added_speed += (float)
tmp->stats.exp/3.0;
1407 switch (
tmp->type) {
1417 if (
op->chosen_skill) {
1418 LOG(
llevDebug,
"fix_object, op %s has multiple skills applied\n",
op->name);
1420 op->chosen_skill =
tmp;
1421 if (
tmp->stats.dam > 0) {
1424 if (weapon_speed < 0)
1426 op->stats.dam +=
tmp->stats.dam*(1+(
op->chosen_skill->level/9));
1427 op->stats.dam +=
tmp->magic;
1430 wc -= (
tmp->stats.wc+
tmp->magic);
1432 if (
tmp->slaying != NULL) {
1433 if (
op->slaying != NULL)
1441 op->contr->encumbrance += (
int)3*
tmp->weight/1000;
1447 if (
op->chosen_skill) {
1448 LOG(
llevDebug,
"fix_object, op %s has multiple skills applied\n",
op->name);
1450 op->chosen_skill =
tmp;
1457 op->contr->encumbrance += (
int)
tmp->weight/2000;
1467 wc -=
tmp->stats.wc;
1469 op->stats.dam += (
tmp->stats.dam+
tmp->magic);
1475 wc -=
tmp->stats.wc;
1476 if (
tmp->stats.ac &&
tmp->stats.ac+
tmp->magic > 0)
1478 op->stats.dam += (
tmp->stats.dam+
tmp->magic);
1480 if (weapon_speed < 0)
1482 if (
tmp->slaying != NULL) {
1483 if (
op->slaying != NULL)
1491 op->current_weapon =
tmp;
1493 op->contr->encumbrance += (
int)3*
tmp->weight/1000;
1498 op->contr->encumbrance += (
int)
tmp->weight/1000;
1506 if (
tmp->stats.wc) {
1508 if (
tmp->type ==
BRACERS &&
op->type ==
PLAYER &&
op->arch->name && strcmp(
op->arch->name,
"serpentman_player") == 0)
1513 wc -=
tmp->stats.wc;
1515 else if (best_wc < tmp->stats.wc) {
1517 best_wc =
tmp->stats.wc;
1518 wc -=
tmp->stats.wc;
1521 if (
tmp->stats.ac) {
1528 if (
tmp->type ==
BRACERS &&
op->type ==
PLAYER &&
op->arch->name && strcmp(
op->arch->name,
"serpentman_player") == 0)
1535 else if (best_ac < tmp->stats.ac+
tmp->magic) {
1537 best_ac =
tmp->stats.ac+
tmp->magic;
1542 op->stats.dam += (
tmp->stats.dam+
tmp->magic);
1561 op->resist[i] = prot[i]-vuln[i];
1562 if (potion_resist[i]
1563 && ((potion_resist[i] >
op->resist[i]) || (potion_resist[i] < 0)))
1564 op->resist[i] = potion_resist[i];
1567 fix_player(
op, &
ac, &wc, grace_obj, mana_obj, wc_obj, weapon_speed, added_speed);
1569 op->speed =
op->speed*speed_reduce_from_disease;
1572 if (
op->speed >
max)
1575 op->speed += added_speed/10.0;
1597 if (added_speed >= 0)
1598 LOG(
llevInfo,
"fix_object: Monster %s has negative speed of %f.\n",
1599 op->name ?
op->name :
"(null)",
op->speed);
1605 &&
op->stats.dam >
op->arch->clone.stats.dam*3)
1606 op->stats.dam =
op->arch->clone.stats.dam*3;
1630 if (
op->move_type == 0)
1651 return op->stats.Dex > 0
1652 &&
op->stats.Str > 0
1653 &&
op->stats.Con > 0
1654 &&
op->stats.Int > 0
1655 &&
op->stats.Wis > 0
1656 &&
op->stats.Pow > 0
1657 &&
op->stats.Cha > 0;
1689 && (atnr == -1 || abil->
resist[i] > abil->
resist[atnr])) {
1704 if (
pl->contr != NULL) {
1718 object *abil = NULL;
1719 object *skin = NULL;
1745 "Your metabolism now focuses on %s!",
1783 LOG(
llevError,
"add_player_exp: couldn't find skill %s\n", skill_name);
1793 skill_obj->
level = 1;
1840 if (
op->level > 1) {
1842 snprintf(
buf,
sizeof(
buf),
"You are now level %d in the %s skill.",
op->level,
op->name);
1844 snprintf(
buf,
sizeof(
buf),
"You are now level %d.",
op->level);
1854 snprintf(
buf,
sizeof(
buf),
"You are now level %d in the %s skill.",
op->level,
op->name);
1856 snprintf(
buf,
sizeof(
buf),
"You are now level %d.",
op->level);
1902 if (
op->total_exp <
op->stats.exp)
1903 op->total_exp =
op->stats.exp;
1906 if (
op->total_exp < 0)
1921 if (
op->contr->last_skill_ob[i] != NULL) {
1925 LOG(
llevDebug,
"pruning removed object from last_skill_ob\n");
1926 op->contr->last_skill_ob[i] = NULL;
1930 if (
op->contr->last_skill_ob[i]->skill != NULL) {
1931 if (!strcmp(
op->contr->last_skill_ob[i]->skill,
name)) {
1932 return op->contr->last_skill_ob[i];
1936 "%s's skill object %s does not have a skill name\n",
1937 op->name,
op->contr->last_skill_ob[i]->name);
1959 object *skill_obj = NULL;
1960 int64_t limit, exp_to_add;
1961 int64_t added_skill_exp = 0, added_skill_total_exp = 0;
1964 if (
op->contr->braced)
1973 if (
op->chosen_skill
1974 &&
op->chosen_skill->type ==
SKILL
1975 && !strcmp(skill_name,
op->chosen_skill->skill))
1976 skill_obj =
op->chosen_skill;
2007 if (exp_to_add > limit)
2023 if (exp_to_add > limit)
2025 added_skill_exp = skill_obj->
stats.
exp;
2027 added_skill_exp = skill_obj->
stats.
exp - added_skill_exp;
2029 added_skill_total_exp = skill_obj->
total_exp;
2031 added_skill_total_exp = skill_obj->
total_exp - added_skill_total_exp;
2037 added_skill_exp = added_skill_total_exp = exp_to_add;
2040 ADD_EXP(
op->stats.exp, (
float)added_skill_exp*(skill_obj ? skill_obj->
expmul : 1));
2067 if (exp >
op->stats.exp)
2068 exp =
op->stats.exp;
2119 float fraction = (float)exp/(
float)
op->stats.exp;
2126 tmp->stats.exp -= del_exp;
2133 tmp->stats.exp -= del_exp;
2140 op->stats.exp -= del_exp;
2166 void change_exp(
object *
op, int64_t exp,
const char *skill_name,
int flag) {
2169 LOG(
llevError,
"change_exp() called for null object!\n");
2199 op->stats.exp += exp;
2233 int64_t percentage_loss;
2251 tmp->stats.exp -= loss;
2262 op->stats.exp -= loss;
2310 void share_exp(
object *
op, int64_t exp,
const char *skill,
int flag) {
2311 int shares = 0,
count = 0;
2315 if (
op->type !=
PLAYER ||
op->contr->party == NULL) {
2320 party =
op->contr->party;
2325 shares += (
pl->ob->level+4);
2331 if (
count == 1 || shares > exp)
2334 int64_t share = exp/shares, given = 0, nexp;
2337 nexp = (
pl->ob->level+4)*share;
2415 index = (size_t)stat;
2439 int on_stat = 0, tmp_bonus;
2455 if (
buf[0] ==
'}') {
2457 LOG(
llevError,
"Number of bonus does not match max stat (%d!=%d, bonus=%s)\n",
2470 while (!isdigit(*cp) && *cp!=
'.' && *cp!=
'-' && *cp!=
'+' && *cp != 0)
2473 if (*cp == 0)
break;
2475 tmp_bonus = atoi(cp);
2478 LOG(
llevError,
"Number of bonus entries exceed max stat (line=%s, bonus=%s)\n",
2482 (*bonuses)[on_stat] = tmp_bonus;
2486 while ((isdigit(*cp) || *cp==
'-' || *cp==
'+') && *cp != 0)
2491 LOG(
llevError,
"Reached end of file without getting close brace? bonus=%s\n", bonus_name);
2518 *bonuses =
static_cast<float *
>(calloc(
settings.
max_stat+1,
sizeof(
float)));
2532 if (
buf[0] ==
'}') {
2534 LOG(
llevError,
"Number of bonus does not match max stat (%d!=%d, bonus=%s)\n",
2547 while (!isdigit(*cp) && *cp!=
'.' && *cp!=
'-' && *cp!=
'+' && *cp != 0)
2550 if (*cp == 0)
break;
2552 tmp_bonus = atof(cp);
2555 LOG(
llevError,
"Number of bonus entries exceed max stat (line=%s, bonus=%s)\n",
2559 (*bonuses)[on_stat] = tmp_bonus;
2565 while ((isdigit(*cp) || *cp==
'-' || *cp==
'+' || *cp==
'.') && *cp != 0)
2570 LOG(
llevError,
"Reached end of file without getting close brace? bonus=%s\n", bonus_name);
2594 if ((fp = fopen(
buf,
"r")) == NULL) {
2595 LOG(
llevError,
"Fatal error: could not open experience table (%s)\n",
buf);
2603 if ((cp = strrchr(
buf,
'\n')) != NULL)
2612 while (isspace(*cp) && *cp != 0)
2615 if (!strncasecmp(cp,
"max_stat", 8)) {
2616 int newmax = atoi(cp+8);
2627 LOG(
llevError,
"Got invalid max_stat (%d) from stat_bonus file\n", newmax);
2638 LOG(
llevError,
"Got bonus line or otherwise unknown value before max stat! (%s)\n",
2674 if (!new_int_bonuses[i]) {
2681 if (!new_float_bonuses[i]) {
2702 new_int_bonuses[i] = NULL;
2708 new_float_bonuses[i] = NULL;