forked from github/server
eliminate new_race array in favor of a function (TODO: make it fast)
This commit is contained in:
parent
11a264742b
commit
c3dfbdea18
37 changed files with 289 additions and 260 deletions
|
@ -1534,7 +1534,7 @@ report_computer(const char *filename, report_context * ctx, const char *charset)
|
||||||
fprintf(F, "%d;Anzahl Personen\n", count_all(f));
|
fprintf(F, "%d;Anzahl Personen\n", count_all(f));
|
||||||
fprintf(F, "\"%s\";Magiegebiet\n", magic_school[f->magiegebiet]);
|
fprintf(F, "\"%s\";Magiegebiet\n", magic_school[f->magiegebiet]);
|
||||||
|
|
||||||
if (f->race == new_race[RC_HUMAN]) {
|
if (f->race == get_race(RC_HUMAN)) {
|
||||||
fprintf(F, "%d;Anzahl Immigranten\n", count_migrants(f));
|
fprintf(F, "%d;Anzahl Immigranten\n", count_migrants(f));
|
||||||
fprintf(F, "%d;Max. Immigranten\n", count_maxmigrants(f));
|
fprintf(F, "%d;Max. Immigranten\n", count_maxmigrants(f));
|
||||||
}
|
}
|
||||||
|
|
|
@ -530,7 +530,7 @@ static void recruit(unit * u, struct order *ord, request ** recruitorders)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (rc == new_race[RC_INSECT]) {
|
if (rc == get_race(RC_INSECT)) {
|
||||||
gamedate date;
|
gamedate date;
|
||||||
get_gamedate(turn, &date);
|
get_gamedate(turn, &date);
|
||||||
if (date.season == 0 && r->terrain != newterrain(T_DESERT)) {
|
if (date.season == 0 && r->terrain != newterrain(T_DESERT)) {
|
||||||
|
@ -563,7 +563,7 @@ static void recruit(unit * u, struct order *ord, request ** recruitorders)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(rc->ec_flags & ECF_REC_HORSES) && fval(r, RF_ORCIFIED)) {
|
if (!(rc->ec_flags & ECF_REC_HORSES) && fval(r, RF_ORCIFIED)) {
|
||||||
if (rc != new_race[RC_ORC]) {
|
if (rc != get_race(RC_ORC)) {
|
||||||
cmistake(u, ord, 238, MSG_EVENT);
|
cmistake(u, ord, 238, MSG_EVENT);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -755,7 +755,7 @@ static void give_cmd(unit * u, order * ord)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u2 && u_race(u2) == new_race[RC_SPELL]) {
|
if (u2 && u_race(u2) == get_race(RC_SPELL)) {
|
||||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found",
|
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found",
|
||||||
""));
|
""));
|
||||||
return;
|
return;
|
||||||
|
@ -1967,7 +1967,7 @@ static void buy(unit * u, request ** buyorders, struct order *ord)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u_race(u) == new_race[RC_INSECT]) {
|
if (u_race(u) == get_race(RC_INSECT)) {
|
||||||
/* entweder man ist insekt, oder... */
|
/* entweder man ist insekt, oder... */
|
||||||
if (r->terrain != newterrain(T_SWAMP) && r->terrain != newterrain(T_DESERT)
|
if (r->terrain != newterrain(T_SWAMP) && r->terrain != newterrain(T_DESERT)
|
||||||
&& !rbuildings(r)) {
|
&& !rbuildings(r)) {
|
||||||
|
@ -2271,7 +2271,7 @@ static bool sell(unit * u, request ** sellorders, struct order *ord)
|
||||||
}
|
}
|
||||||
/* In der Region muß es eine Burg geben. */
|
/* In der Region muß es eine Burg geben. */
|
||||||
|
|
||||||
if (u_race(u) == new_race[RC_INSECT]) {
|
if (u_race(u) == get_race(RC_INSECT)) {
|
||||||
if (r->terrain != newterrain(T_SWAMP) && r->terrain != newterrain(T_DESERT)
|
if (r->terrain != newterrain(T_SWAMP) && r->terrain != newterrain(T_DESERT)
|
||||||
&& !rbuildings(r)) {
|
&& !rbuildings(r)) {
|
||||||
cmistake(u, ord, 119, MSG_COMMERCE);
|
cmistake(u, ord, 119, MSG_COMMERCE);
|
||||||
|
@ -2766,7 +2766,7 @@ static void steal_cmd(unit * u, struct order *ord, request ** stealorders)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fval(r->terrain, SEA_REGION) && u_race(u) != new_race[RC_AQUARIAN]) {
|
if (fval(r->terrain, SEA_REGION) && u_race(u) != get_race(RC_AQUARIAN)) {
|
||||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "error_onlandonly", ""));
|
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "error_onlandonly", ""));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2820,7 +2820,7 @@ static void steal_cmd(unit * u, struct order *ord, request ** stealorders)
|
||||||
|
|
||||||
if (n <= 0) {
|
if (n <= 0) {
|
||||||
/* Wahrnehmung == Tarnung */
|
/* Wahrnehmung == Tarnung */
|
||||||
if (u_race(u) != new_race[RC_GOBLIN] || eff_skill(u, SK_STEALTH, r) <= 3) {
|
if (u_race(u) != get_race(RC_GOBLIN) || eff_skill(u, SK_STEALTH, r) <= 3) {
|
||||||
ADDMSG(&u->faction->msgs, msg_message("stealfail", "unit target", u, u2));
|
ADDMSG(&u->faction->msgs, msg_message("stealfail", "unit target", u, u2));
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
ADDMSG(&u2->faction->msgs, msg_message("stealdetect", "unit", u2));
|
ADDMSG(&u2->faction->msgs, msg_message("stealdetect", "unit", u2));
|
||||||
|
@ -3227,10 +3227,10 @@ void produce(struct region *r)
|
||||||
order *ord;
|
order *ord;
|
||||||
bool trader = false;
|
bool trader = false;
|
||||||
|
|
||||||
if (u_race(u) == new_race[RC_SPELL] || fval(u, UFL_LONGACTION))
|
if (u_race(u) == get_race(RC_SPELL) || fval(u, UFL_LONGACTION))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (u_race(u) == new_race[RC_INSECT] && r_insectstalled(r) &&
|
if (u_race(u) == get_race(RC_INSECT) && r_insectstalled(r) &&
|
||||||
!is_cursed(u->attribs, C_KAELTESCHUTZ, 0))
|
!is_cursed(u->attribs, C_KAELTESCHUTZ, 0))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -3266,7 +3266,7 @@ void produce(struct region *r)
|
||||||
if (todo == NOKEYWORD)
|
if (todo == NOKEYWORD)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (fval(r->terrain, SEA_REGION) && u_race(u) != new_race[RC_AQUARIAN]
|
if (fval(r->terrain, SEA_REGION) && u_race(u) != get_race(RC_AQUARIAN)
|
||||||
&& !(u_race(u)->flags & RCF_SWIM)
|
&& !(u_race(u)->flags & RCF_SWIM)
|
||||||
&& todo != K_STEAL && todo != K_SPY && todo != K_SABOTAGE)
|
&& todo != K_STEAL && todo != K_SPY && todo != K_SABOTAGE)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -188,7 +188,8 @@ void give_men(int n, unit * u, unit * u2, struct order *ord)
|
||||||
return;
|
return;
|
||||||
} else if (u == u2) {
|
} else if (u == u2) {
|
||||||
error = 10;
|
error = 10;
|
||||||
} else if (!u2 && u_race(u) == new_race[RC_SNOTLING]) {
|
}
|
||||||
|
else if (!u2 && u_race(u) == get_race(RC_SNOTLING)) {
|
||||||
/* snotlings may not be given to the peasants. */
|
/* snotlings may not be given to the peasants. */
|
||||||
error = 307;
|
error = 307;
|
||||||
} else if (u2 && u2->number && (fval(u, UFL_HERO) != fval(u2, UFL_HERO))) {
|
} else if (u2 && u2->number && (fval(u, UFL_HERO) != fval(u2, UFL_HERO))) {
|
||||||
|
@ -236,7 +237,7 @@ void give_men(int n, unit * u, unit * u2, struct order *ord)
|
||||||
if (u2->faction->newbies + n > MAXNEWBIES) {
|
if (u2->faction->newbies + n > MAXNEWBIES) {
|
||||||
error = 129;
|
error = 129;
|
||||||
} else if (u_race(u) != u2->faction->race) {
|
} else if (u_race(u) != u2->faction->race) {
|
||||||
if (u2->faction->race != new_race[RC_HUMAN]) {
|
if (u2->faction->race != get_race(RC_HUMAN)) {
|
||||||
error = 120;
|
error = 120;
|
||||||
} else if (count_migrants(u2->faction) + n >
|
} else if (count_migrants(u2->faction) + n >
|
||||||
count_maxmigrants(u2->faction)) {
|
count_maxmigrants(u2->faction)) {
|
||||||
|
@ -298,7 +299,7 @@ void give_men(int n, unit * u, unit * u2, struct order *ord)
|
||||||
} else {
|
} else {
|
||||||
if (getunitpeasants) {
|
if (getunitpeasants) {
|
||||||
#ifdef ORCIFICATION
|
#ifdef ORCIFICATION
|
||||||
if (u_race(u) == new_race[RC_SNOTLING] && !fval(u->region, RF_ORCIFIED)) {
|
if (u_race(u) == get_race(RC_SNOTLING) && !fval(u->region, RF_ORCIFIED)) {
|
||||||
attrib *a = a_find(u->region->attribs, &at_orcification);
|
attrib *a = a_find(u->region->attribs, &at_orcification);
|
||||||
if (!a)
|
if (!a)
|
||||||
a = a_add(&u->region->attribs, a_new(&at_orcification));
|
a = a_add(&u->region->attribs, a_new(&at_orcification));
|
||||||
|
@ -393,7 +394,7 @@ void give_unit(unit * u, unit * u2, order * ord)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (u_race(u) != u2->faction->race) {
|
if (u_race(u) != u2->faction->race) {
|
||||||
if (u2->faction->race != new_race[RC_HUMAN]) {
|
if (u2->faction->race != get_race(RC_HUMAN)) {
|
||||||
cmistake(u, ord, 120, MSG_COMMERCE);
|
cmistake(u, ord, 120, MSG_COMMERCE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -620,7 +620,7 @@ weapon_skill(const weapon_type * wtype, const unit * u, bool attacking)
|
||||||
skill = effskill(u, SK_WEAPONLESS);
|
skill = effskill(u, SK_WEAPONLESS);
|
||||||
if (skill <= 0) {
|
if (skill <= 0) {
|
||||||
/* wenn kein waffenloser kampf, dann den rassen-defaultwert */
|
/* wenn kein waffenloser kampf, dann den rassen-defaultwert */
|
||||||
if (u_race(u) == new_race[RC_ORC]) {
|
if (u_race(u) == get_race(RC_ORC)) {
|
||||||
int sword = effskill(u, SK_MELEE);
|
int sword = effskill(u, SK_MELEE);
|
||||||
int spear = effskill(u, SK_SPEAR);
|
int spear = effskill(u, SK_SPEAR);
|
||||||
skill = _max(sword, spear) - 3;
|
skill = _max(sword, spear) - 3;
|
||||||
|
@ -709,7 +709,7 @@ static int CavalryBonus(const unit * u, troop enemy, int type)
|
||||||
if (skl > 0) {
|
if (skl > 0) {
|
||||||
if (type == BONUS_DAMAGE) {
|
if (type == BONUS_DAMAGE) {
|
||||||
int dmg = _min(skl, 8);
|
int dmg = _min(skl, 8);
|
||||||
if (u_race(enemy.fighter->unit) == new_race[RC_TROLL]) {
|
if (u_race(enemy.fighter->unit) == get_race(RC_TROLL)) {
|
||||||
dmg = dmg / 4;
|
dmg = dmg / 4;
|
||||||
} else {
|
} else {
|
||||||
dmg = dmg / 2;
|
dmg = dmg / 2;
|
||||||
|
@ -1264,7 +1264,7 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile)
|
||||||
|
|
||||||
assert(dt.index < du->number);
|
assert(dt.index < du->number);
|
||||||
df->person[dt.index].hp -= rda;
|
df->person[dt.index].hp -= rda;
|
||||||
if (u_race(au) == new_race[RC_DAEMON]) {
|
if (u_race(au) == get_race(RC_DAEMON)) {
|
||||||
vampirism(at, rda);
|
vampirism(at, rda);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1273,7 +1273,7 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile)
|
||||||
fprintf(bdebug, "Damage %d, armor %d: %d -> %d HP\n",
|
fprintf(bdebug, "Damage %d, armor %d: %d -> %d HP\n",
|
||||||
da, ar, df->person[dt.index].hp + rda, df->person[dt.index].hp);
|
da, ar, df->person[dt.index].hp + rda, df->person[dt.index].hp);
|
||||||
}
|
}
|
||||||
if (u_race(au) == new_race[RC_DAEMON]) {
|
if (u_race(au) == get_race(RC_DAEMON)) {
|
||||||
#ifdef TODO_RUNESWORD
|
#ifdef TODO_RUNESWORD
|
||||||
if (select_weapon(dt, 0, -1) == WP_RUNESWORD)
|
if (select_weapon(dt, 0, -1) == WP_RUNESWORD)
|
||||||
continue;
|
continue;
|
||||||
|
@ -1288,7 +1288,7 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sieben Leben */
|
/* Sieben Leben */
|
||||||
if (u_race(du) == new_race[RC_CAT] && (chance(1.0 / 7))) {
|
if (u_race(du) == get_race(RC_CAT) && (chance(1.0 / 7))) {
|
||||||
assert(dt.index >= 0 && dt.index < du->number);
|
assert(dt.index >= 0 && dt.index < du->number);
|
||||||
df->person[dt.index].hp = unit_max_hp(du);
|
df->person[dt.index].hp = unit_max_hp(du);
|
||||||
return false;
|
return false;
|
||||||
|
@ -1847,11 +1847,11 @@ int skilldiff(troop at, troop dt, int dist)
|
||||||
skdiff += 2;
|
skdiff += 2;
|
||||||
|
|
||||||
/* Effekte durch Rassen */
|
/* Effekte durch Rassen */
|
||||||
if (awp != NULL && u_race(au) == new_race[RC_HALFLING] && dragonrace(u_race(du))) {
|
if (awp != NULL && u_race(au) == get_race(RC_HALFLING) && dragonrace(u_race(du))) {
|
||||||
skdiff += 5;
|
skdiff += 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u_race(au) == new_race[RC_GOBLIN]) {
|
if (u_race(au) == get_race(RC_GOBLIN)) {
|
||||||
static int goblin_bonus = -1;
|
static int goblin_bonus = -1;
|
||||||
if (goblin_bonus < 0)
|
if (goblin_bonus < 0)
|
||||||
goblin_bonus =
|
goblin_bonus =
|
||||||
|
@ -2355,7 +2355,7 @@ double fleechance(unit * u)
|
||||||
c += (eff_skill(u, SK_STEALTH, r) * 0.05);
|
c += (eff_skill(u, SK_STEALTH, r) * 0.05);
|
||||||
c += horsebonus(u);
|
c += horsebonus(u);
|
||||||
|
|
||||||
if (u_race(u) == new_race[RC_HALFLING]) {
|
if (u_race(u) == get_race(RC_HALFLING)) {
|
||||||
c += 0.20;
|
c += 0.20;
|
||||||
c = _min(c, 0.90);
|
c = _min(c, 0.90);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3408,18 +3408,18 @@ fighter *make_fighter(battle * b, unit * u, side * s1, bool attack)
|
||||||
if (fig->horses) {
|
if (fig->horses) {
|
||||||
if (!fval(r->terrain, CAVALRY_REGION) || r_isforest(r)
|
if (!fval(r->terrain, CAVALRY_REGION) || r_isforest(r)
|
||||||
|| eff_skill(u, SK_RIDING, r) < CavalrySkill()
|
|| eff_skill(u, SK_RIDING, r) < CavalrySkill()
|
||||||
|| u_race(u) == new_race[RC_TROLL] || fval(u, UFL_WERE))
|
|| u_race(u) == get_race(RC_TROLL) || fval(u, UFL_WERE))
|
||||||
fig->horses = 0;
|
fig->horses = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fig->elvenhorses) {
|
if (fig->elvenhorses) {
|
||||||
if (eff_skill(u, SK_RIDING, r) < 5 || u_race(u) == new_race[RC_TROLL]
|
if (eff_skill(u, SK_RIDING, r) < 5 || u_race(u) == get_race(RC_TROLL)
|
||||||
|| fval(u, UFL_WERE))
|
|| fval(u, UFL_WERE))
|
||||||
fig->elvenhorses = 0;
|
fig->elvenhorses = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Schauen, wie gut wir in Taktik sind. */
|
/* Schauen, wie gut wir in Taktik sind. */
|
||||||
if (tactics > 0 && u_race(u) == new_race[RC_INSECT])
|
if (tactics > 0 && u_race(u) == get_race(RC_INSECT))
|
||||||
tactics -= 1 - (int)log10(fig->side->size[SUM_ROW]);
|
tactics -= 1 - (int)log10(fig->side->size[SUM_ROW]);
|
||||||
#ifdef TACTICS_MODIFIER
|
#ifdef TACTICS_MODIFIER
|
||||||
if (tactics > 0 && statusrow(fig->status) == FIGHT_ROW)
|
if (tactics > 0 && statusrow(fig->status) == FIGHT_ROW)
|
||||||
|
@ -4187,7 +4187,7 @@ static void battle_flee(battle * b)
|
||||||
/* keine Flucht von Schiffen auf hoher See */
|
/* keine Flucht von Schiffen auf hoher See */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (fval(u_race(u), RCF_UNDEAD) || u_race(u) == new_race[RC_SHADOWKNIGHT]) {
|
if (fval(u_race(u), RCF_UNDEAD) || u_race(u) == get_race(RC_SHADOWKNIGHT)) {
|
||||||
/* Untote fliehen nicht. Warum eigentlich? */
|
/* Untote fliehen nicht. Warum eigentlich? */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -312,7 +312,7 @@ void build_road(region * r, unit * u, int size, direction_t d)
|
||||||
if (size > 0)
|
if (size > 0)
|
||||||
left = _min(size, left);
|
left = _min(size, left);
|
||||||
/* baumaximum anhand der rohstoffe */
|
/* baumaximum anhand der rohstoffe */
|
||||||
if (u_race(u) == new_race[RC_STONEGOLEM]) {
|
if (u_race(u) == get_race(RC_STONEGOLEM)) {
|
||||||
n = u->number * GOLEM_STONE;
|
n = u->number * GOLEM_STONE;
|
||||||
} else {
|
} else {
|
||||||
n = get_pooled(u, get_resourcetype(R_STONE), GET_DEFAULT, left);
|
n = get_pooled(u, get_resourcetype(R_STONE), GET_DEFAULT, left);
|
||||||
|
@ -353,7 +353,7 @@ void build_road(region * r, unit * u, int size, direction_t d)
|
||||||
* maximum. */
|
* maximum. */
|
||||||
rsetroad(r, d, rroad(r, d) + (short)n);
|
rsetroad(r, d, rroad(r, d) + (short)n);
|
||||||
|
|
||||||
if (u_race(u) == new_race[RC_STONEGOLEM]) {
|
if (u_race(u) == get_race(RC_STONEGOLEM)) {
|
||||||
int golemsused = n / GOLEM_STONE;
|
int golemsused = n / GOLEM_STONE;
|
||||||
if (n % GOLEM_STONE != 0) {
|
if (n % GOLEM_STONE != 0) {
|
||||||
++golemsused;
|
++golemsused;
|
||||||
|
|
|
@ -49,7 +49,6 @@ static void test_build_building_with_golem(CuTest *tc) {
|
||||||
test_create_world();
|
test_create_world();
|
||||||
|
|
||||||
rc = test_create_race("stonegolem");
|
rc = test_create_race("stonegolem");
|
||||||
new_race[RC_STONEGOLEM] = rc;
|
|
||||||
rc->flags |= RCF_STONEGOLEM;
|
rc->flags |= RCF_STONEGOLEM;
|
||||||
btype = bt_find("castle");
|
btype = bt_find("castle");
|
||||||
assert(btype && rc);
|
assert(btype && rc);
|
||||||
|
|
|
@ -26,6 +26,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include "curse.h" /* für C_NOCOST */
|
#include "curse.h" /* für C_NOCOST */
|
||||||
#include "unit.h"
|
#include "unit.h"
|
||||||
#include "faction.h"
|
#include "faction.h"
|
||||||
|
#include "race.h"
|
||||||
#include "region.h"
|
#include "region.h"
|
||||||
#include "skill.h"
|
#include "skill.h"
|
||||||
#include "magic.h"
|
#include "magic.h"
|
||||||
|
@ -612,7 +613,7 @@ int bt_effsize(const building_type * btype, const building * b, int bsize)
|
||||||
if (b && get_param_int(global.parameters, "rules.dwarf_castles", 0)
|
if (b && get_param_int(global.parameters, "rules.dwarf_castles", 0)
|
||||||
&& strcmp(btype->_name, "castle") == 0) {
|
&& strcmp(btype->_name, "castle") == 0) {
|
||||||
unit *u = building_owner(b);
|
unit *u = building_owner(b);
|
||||||
if (u && u->faction->race == new_race[RC_HALFLING]) {
|
if (u && u->faction->race == get_race(RC_HALFLING)) {
|
||||||
i = bsize * 10 / 8;
|
i = bsize * 10 / 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,6 @@ struct settings global = {
|
||||||
bool lomem = false;
|
bool lomem = false;
|
||||||
FILE *logfile;
|
FILE *logfile;
|
||||||
FILE *updatelog;
|
FILE *updatelog;
|
||||||
const struct race *new_race[MAXRACES];
|
|
||||||
bool battledebug = false;
|
bool battledebug = false;
|
||||||
int turn = -1;
|
int turn = -1;
|
||||||
|
|
||||||
|
@ -245,7 +244,7 @@ int LongHunger(const struct unit *u)
|
||||||
if (!fval(u, UFL_HUNGER))
|
if (!fval(u, UFL_HUNGER))
|
||||||
return false;
|
return false;
|
||||||
#ifdef NEW_DAEMONHUNGER_RULE
|
#ifdef NEW_DAEMONHUNGER_RULE
|
||||||
if (u_race(u) == new_race[RC_DAEMON])
|
if (u_race(u) == get_race(RC_DAEMON))
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -284,8 +283,7 @@ race_t old_race(const struct race * rc)
|
||||||
{
|
{
|
||||||
race_t i;
|
race_t i;
|
||||||
for (i = 0; i != MAXRACES; ++i) {
|
for (i = 0; i != MAXRACES; ++i) {
|
||||||
if (new_race[i] == rc)
|
if (get_race(i) == rc) return i;
|
||||||
return i;
|
|
||||||
}
|
}
|
||||||
return NORACE;
|
return NORACE;
|
||||||
}
|
}
|
||||||
|
@ -434,7 +432,7 @@ int max_magicians(const faction * f)
|
||||||
if ((a = a_find(f->attribs, &at_maxmagicians)) != NULL) {
|
if ((a = a_find(f->attribs, &at_maxmagicians)) != NULL) {
|
||||||
m = a->data.i;
|
m = a->data.i;
|
||||||
}
|
}
|
||||||
if (f->race == new_race[RC_ELF])
|
if (f->race == get_race(RC_ELF))
|
||||||
++m;
|
++m;
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
@ -591,7 +589,7 @@ void verify_data(void)
|
||||||
log_warning("Einheit %s hat %d Personen\n", unitid(u), u->number);
|
log_warning("Einheit %s hat %d Personen\n", unitid(u), u->number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (f->no != 0 && ((mage > 3 && f->race != new_race[RC_ELF]) || mage > 4))
|
if (f->no != 0 && ((mage > 3 && f->race != get_race(RC_ELF)) || mage > 4))
|
||||||
log_error("Partei %s hat %d Magier.\n", factionid(f), mage);
|
log_error("Partei %s hat %d Magier.\n", factionid(f), mage);
|
||||||
if (alchemist > 3)
|
if (alchemist > 3)
|
||||||
log_error("Partei %s hat %d Alchemisten.\n", factionid(f), alchemist);
|
log_error("Partei %s hat %d Alchemisten.\n", factionid(f), alchemist);
|
||||||
|
@ -1075,7 +1073,7 @@ int count_maxmigrants(const faction * f)
|
||||||
}
|
}
|
||||||
if (migrants == INT_MAX) {
|
if (migrants == INT_MAX) {
|
||||||
int x = 0;
|
int x = 0;
|
||||||
if (f->race == new_race[RC_HUMAN]) {
|
if (f->race == get_race(RC_HUMAN)) {
|
||||||
int nsize = count_all(f);
|
int nsize = count_all(f);
|
||||||
if (nsize > 0) {
|
if (nsize > 0) {
|
||||||
x = (int)(log10(nsize / 50.0) * 20);
|
x = (int)(log10(nsize / 50.0) * 20);
|
||||||
|
@ -2078,8 +2076,8 @@ void remove_empty_units_in_region(region * r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((u->number == 0 && u_race(u) != new_race[RC_SPELL]) || (u->age <= 0
|
if ((u->number == 0 && u_race(u) != get_race(RC_SPELL)) || (u->age <= 0
|
||||||
&& u_race(u) == new_race[RC_SPELL])) {
|
&& u_race(u) == get_race(RC_SPELL))) {
|
||||||
remove_unit(up, u);
|
remove_unit(up, u);
|
||||||
}
|
}
|
||||||
if (*up == u)
|
if (*up == u)
|
||||||
|
@ -2502,7 +2500,7 @@ default_wage(const region * r, const faction * f, const race * rc, int in_turn)
|
||||||
|
|
||||||
if (f != NULL) {
|
if (f != NULL) {
|
||||||
int index = 0;
|
int index = 0;
|
||||||
if (rc == new_race[RC_ORC] || rc == new_race[RC_SNOTLING]) {
|
if (rc == get_race(RC_ORC) || rc == get_race(RC_SNOTLING)) {
|
||||||
index = 1;
|
index = 1;
|
||||||
}
|
}
|
||||||
wage = wagetable[esize][index];
|
wage = wagetable[esize][index];
|
||||||
|
|
|
@ -371,10 +371,6 @@ int max_magicians(const struct faction * f);
|
||||||
|
|
||||||
extern const char *localenames[];
|
extern const char *localenames[];
|
||||||
|
|
||||||
/** compatibility: **/
|
|
||||||
race_t old_race(const struct race *);
|
|
||||||
extern const struct race *new_race[];
|
|
||||||
|
|
||||||
/* globale settings des Spieles */
|
/* globale settings des Spieles */
|
||||||
typedef struct settings {
|
typedef struct settings {
|
||||||
const char *gamename;
|
const char *gamename;
|
||||||
|
|
|
@ -252,13 +252,14 @@ unit *addplayer(region * r, faction * f)
|
||||||
equip_unit(u, get_equipment(buffer));
|
equip_unit(u, get_equipment(buffer));
|
||||||
u->hp = unit_max_hp(u) * u->number;
|
u->hp = unit_max_hp(u) * u->number;
|
||||||
fset(u, UFL_ISNEW);
|
fset(u, UFL_ISNEW);
|
||||||
if (f->race == new_race[RC_DAEMON]) {
|
if (f->race == get_race(RC_DAEMON)) {
|
||||||
race_t urc;
|
race_t urc;
|
||||||
|
race *rc;
|
||||||
do {
|
do {
|
||||||
urc = (race_t) (rng_int() % MAXRACES);
|
urc = (race_t) (rng_int() % MAXRACES);
|
||||||
} while (new_race[urc] == NULL || urc == RC_DAEMON
|
rc = get_race(urc);
|
||||||
|| !playerrace(new_race[urc]));
|
} while (rc == NULL || urc == RC_DAEMON || !playerrace(rc));
|
||||||
u->irace = new_race[urc];
|
u->irace = rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
return u;
|
return u;
|
||||||
|
|
|
@ -103,7 +103,7 @@ static int res_changepeasants(unit * u, const resource_type * rtype, int delta)
|
||||||
static int res_changeitem(unit * u, const resource_type * rtype, int delta)
|
static int res_changeitem(unit * u, const resource_type * rtype, int delta)
|
||||||
{
|
{
|
||||||
int num;
|
int num;
|
||||||
if (rtype == get_resourcetype(R_STONE) && u_race(u) == new_race[RC_STONEGOLEM]
|
if (rtype == get_resourcetype(R_STONE) && u_race(u) == get_race(RC_STONEGOLEM)
|
||||||
&& delta <= 0) {
|
&& delta <= 0) {
|
||||||
int reduce = delta / GOLEM_STONE;
|
int reduce = delta / GOLEM_STONE;
|
||||||
if (delta % GOLEM_STONE != 0)
|
if (delta % GOLEM_STONE != 0)
|
||||||
|
@ -111,7 +111,7 @@ static int res_changeitem(unit * u, const resource_type * rtype, int delta)
|
||||||
scale_number(u, u->number + reduce);
|
scale_number(u, u->number + reduce);
|
||||||
num = u->number;
|
num = u->number;
|
||||||
} else if (rtype == get_resourcetype(R_IRON)
|
} else if (rtype == get_resourcetype(R_IRON)
|
||||||
&& u_race(u) == new_race[RC_IRONGOLEM] && delta <= 0) {
|
&& u_race(u) == get_race(RC_IRONGOLEM) && delta <= 0) {
|
||||||
int reduce = delta / GOLEM_IRON;
|
int reduce = delta / GOLEM_IRON;
|
||||||
if (delta % GOLEM_IRON != 0)
|
if (delta % GOLEM_IRON != 0)
|
||||||
--reduce;
|
--reduce;
|
||||||
|
@ -725,7 +725,7 @@ typedef struct t_item {
|
||||||
static int
|
static int
|
||||||
mod_elves_only(const unit * u, const region * r, skill_t sk, int value)
|
mod_elves_only(const unit * u, const region * r, skill_t sk, int value)
|
||||||
{
|
{
|
||||||
if (u_race(u) == new_race[RC_ELF])
|
if (u_race(u) == get_race(RC_ELF))
|
||||||
return value;
|
return value;
|
||||||
unused_arg(r);
|
unused_arg(r);
|
||||||
return -118;
|
return -118;
|
||||||
|
@ -734,8 +734,8 @@ mod_elves_only(const unit * u, const region * r, skill_t sk, int value)
|
||||||
static int
|
static int
|
||||||
mod_dwarves_only(const unit * u, const region * r, skill_t sk, int value)
|
mod_dwarves_only(const unit * u, const region * r, skill_t sk, int value)
|
||||||
{
|
{
|
||||||
if (u_race(u) == new_race[RC_DWARF])
|
if (u_race(u) == get_race(RC_DWARF))
|
||||||
return value;
|
return value;
|
||||||
unused_arg(r);
|
unused_arg(r);
|
||||||
return -118;
|
return -118;
|
||||||
}
|
}
|
||||||
|
@ -798,7 +798,7 @@ static int
|
||||||
use_warmthpotion(struct unit *u, const struct item_type *itype, int amount,
|
use_warmthpotion(struct unit *u, const struct item_type *itype, int amount,
|
||||||
struct order *ord)
|
struct order *ord)
|
||||||
{
|
{
|
||||||
if (u->faction->race == new_race[RC_INSECT]) {
|
if (u->faction->race == get_race(RC_INSECT)) {
|
||||||
fset(u, UFL_WARMTH);
|
fset(u, UFL_WARMTH);
|
||||||
} else {
|
} else {
|
||||||
/* nur für insekten: */
|
/* nur für insekten: */
|
||||||
|
@ -840,7 +840,7 @@ static int
|
||||||
use_bloodpotion(struct unit *u, const struct item_type *itype, int amount,
|
use_bloodpotion(struct unit *u, const struct item_type *itype, int amount,
|
||||||
struct order *ord)
|
struct order *ord)
|
||||||
{
|
{
|
||||||
if (u_race(u) == new_race[RC_DAEMON]) {
|
if (u_race(u) == get_race(RC_DAEMON)) {
|
||||||
change_effect(u, itype->rtype->ptype, 100 * amount);
|
change_effect(u, itype->rtype->ptype, 100 * amount);
|
||||||
} else {
|
} else {
|
||||||
const race *irace = u_irace(u);
|
const race *irace = u_irace(u);
|
||||||
|
|
|
@ -1029,7 +1029,7 @@ spellpower(region * r, unit * u, const spell * sp, int cast_level, struct order
|
||||||
|
|
||||||
elf_power = get_param_int(global.parameters, "rules.magic.elfpower", 0);
|
elf_power = get_param_int(global.parameters, "rules.magic.elfpower", 0);
|
||||||
|
|
||||||
if (elf_power && u_race(u) == new_race[RC_ELF] && r_isforest(r)) {
|
if (elf_power && u_race(u) == get_race(RC_ELF) && r_isforest(r)) {
|
||||||
++force;
|
++force;
|
||||||
}
|
}
|
||||||
rtype = rt_find("rop");
|
rtype = rt_find("rop");
|
||||||
|
@ -1370,7 +1370,7 @@ static void do_fumble(castorder * co)
|
||||||
duration = rng_int() % level / 2;
|
duration = rng_int() % level / 2;
|
||||||
if (duration < 2) duration = 2;
|
if (duration < 2) duration = 2;
|
||||||
add_trigger(&u->attribs, "timer", trigger_timeout(duration, trestore));
|
add_trigger(&u->attribs, "timer", trigger_timeout(duration, trestore));
|
||||||
u_setrace(u, new_race[RC_TOAD]);
|
u_setrace(u, get_race(RC_TOAD));
|
||||||
u->irace = NULL;
|
u->irace = NULL;
|
||||||
ADDMSG(&r->msgs, msg_message("patzer6", "unit region spell", u, r, sp));
|
ADDMSG(&r->msgs, msg_message("patzer6", "unit region spell", u, r, sp));
|
||||||
break;
|
break;
|
||||||
|
@ -2594,7 +2594,7 @@ static castorder *cast_cmd(unit * u, order * ord)
|
||||||
* normalerweise nur Meermenschen, ausgenommen explizit als
|
* normalerweise nur Meermenschen, ausgenommen explizit als
|
||||||
* OCEANCASTABLE deklarierte Sprüche */
|
* OCEANCASTABLE deklarierte Sprüche */
|
||||||
if (fval(r->terrain, SEA_REGION)) {
|
if (fval(r->terrain, SEA_REGION)) {
|
||||||
if (u_race(u) != new_race[RC_AQUARIAN]
|
if (u_race(u) != get_race(RC_AQUARIAN)
|
||||||
&& !fval(u_race(u), RCF_SWIM)
|
&& !fval(u_race(u), RCF_SWIM)
|
||||||
&& !(sp->sptyp & OCEANCASTABLE)) {
|
&& !(sp->sptyp & OCEANCASTABLE)) {
|
||||||
/* Fehlermeldung */
|
/* Fehlermeldung */
|
||||||
|
@ -2732,10 +2732,10 @@ void magic(void)
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
order *ord;
|
order *ord;
|
||||||
|
|
||||||
if (u->number <= 0 || u_race(u) == new_race[RC_SPELL])
|
if (u->number <= 0 || u_race(u) == get_race(RC_SPELL))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (u_race(u) == new_race[RC_INSECT] && r_insectstalled(r) &&
|
if (u_race(u) == get_race(RC_INSECT) && r_insectstalled(r) &&
|
||||||
!is_cursed(u->attribs, C_KAELTESCHUTZ, 0))
|
!is_cursed(u->attribs, C_KAELTESCHUTZ, 0))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -295,7 +295,7 @@ int walkingcapacity(const struct unit *u)
|
||||||
|
|
||||||
n = wagen_mit_pferden * vcap;
|
n = wagen_mit_pferden * vcap;
|
||||||
|
|
||||||
if (u_race(u) == new_race[RC_TROLL]) {
|
if (u_race(u) == get_race(RC_TROLL)) {
|
||||||
/* 4 Trolle ziehen einen Wagen. */
|
/* 4 Trolle ziehen einen Wagen. */
|
||||||
/* Unbesetzte Wagen feststellen */
|
/* Unbesetzte Wagen feststellen */
|
||||||
wagen_ohne_pferde = vehicles - wagen_mit_pferden;
|
wagen_ohne_pferde = vehicles - wagen_mit_pferden;
|
||||||
|
@ -351,7 +351,7 @@ static int canwalk(unit * u)
|
||||||
get_transporters(u->items, &animals, &acap, &vehicles, &vcap);
|
get_transporters(u->items, &animals, &acap, &vehicles, &vcap);
|
||||||
|
|
||||||
maxwagen = effskill(u, SK_RIDING) * u->number * 2;
|
maxwagen = effskill(u, SK_RIDING) * u->number * 2;
|
||||||
if (u_race(u) == new_race[RC_TROLL]) {
|
if (u_race(u) == get_race(RC_TROLL)) {
|
||||||
maxwagen = _max(maxwagen, u->number / 4);
|
maxwagen = _max(maxwagen, u->number / 4);
|
||||||
}
|
}
|
||||||
maxpferde = effskill(u, SK_RIDING) * u->number * 4 + u->number;
|
maxpferde = effskill(u, SK_RIDING) * u->number * 4 + u->number;
|
||||||
|
@ -622,7 +622,7 @@ ship *move_ship(ship * sh, region * from, region * to, region_list * route)
|
||||||
|
|
||||||
static bool is_freezing(const unit * u)
|
static bool is_freezing(const unit * u)
|
||||||
{
|
{
|
||||||
if (u_race(u) != new_race[RC_INSECT])
|
if (u_race(u) != get_race(RC_INSECT))
|
||||||
return false;
|
return false;
|
||||||
if (is_cursed(u->attribs, C_KAELTESCHUTZ, 0))
|
if (is_cursed(u->attribs, C_KAELTESCHUTZ, 0))
|
||||||
return false;
|
return false;
|
||||||
|
@ -1547,7 +1547,7 @@ static const region_list *travel_route(unit * u,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* unit is an insect and cannot move into a glacier */
|
/* unit is an insect and cannot move into a glacier */
|
||||||
if (u_race(u) == new_race[RC_INSECT]) {
|
if (u_race(u) == get_race(RC_INSECT)) {
|
||||||
if (r_insectstalled(next) && is_freezing(u)) {
|
if (r_insectstalled(next) && is_freezing(u)) {
|
||||||
ADDMSG(&u->faction->msgs, msg_message("detectforbidden",
|
ADDMSG(&u->faction->msgs, msg_message("detectforbidden",
|
||||||
"unit region", u, next));
|
"unit region", u, next));
|
||||||
|
|
|
@ -62,6 +62,28 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
race *races;
|
race *races;
|
||||||
int num_races = 0;
|
int num_races = 0;
|
||||||
|
|
||||||
|
static const char *racenames[MAXRACES] = {
|
||||||
|
"dwarf", "elf", NULL, "goblin", "human", "troll", "demon", "insect",
|
||||||
|
"halfling", "cat", "aquarian", "orc", "snotling", "undead", "illusion",
|
||||||
|
"youngdragon", "dragon", "wyrm", "ent", "catdragon", "dracoid",
|
||||||
|
"special", "spell", "irongolem", "stonegolem", "shadowdemon",
|
||||||
|
"shadowmaster", "mountainguard", "alp", "toad", "braineater", "peasant",
|
||||||
|
"wolf", NULL, NULL, NULL, NULL, "songdragon", NULL,
|
||||||
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
|
NULL, NULL, NULL, NULL, NULL, "seaserpent",
|
||||||
|
"shadowknight", "centaur", "skeleton", "skeletonlord", "zombie",
|
||||||
|
"juju-zombie", "ghoul", "ghast", "museumghost", "gnome", "template",
|
||||||
|
"clone"
|
||||||
|
};
|
||||||
|
|
||||||
|
struct race *get_race(race_t rt) {
|
||||||
|
assert(rt < MAXRACES);
|
||||||
|
if (racenames[rt]) {
|
||||||
|
return rc_get_or_create(racenames[rt]);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
race_list *get_familiarraces(void)
|
race_list *get_familiarraces(void)
|
||||||
{
|
{
|
||||||
static int init = 0;
|
static int init = 0;
|
||||||
|
|
|
@ -43,6 +43,68 @@ extern "C" {
|
||||||
struct param;
|
struct param;
|
||||||
struct spell;
|
struct spell;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
RC_DWARF, /* 0 - Zwerg */
|
||||||
|
RC_ELF,
|
||||||
|
RC_GOBLIN = 3,
|
||||||
|
RC_HUMAN,
|
||||||
|
|
||||||
|
RC_TROLL,
|
||||||
|
RC_DAEMON,
|
||||||
|
RC_INSECT,
|
||||||
|
RC_HALFLING,
|
||||||
|
RC_CAT,
|
||||||
|
|
||||||
|
RC_AQUARIAN,
|
||||||
|
RC_ORC,
|
||||||
|
RC_SNOTLING,
|
||||||
|
RC_UNDEAD,
|
||||||
|
RC_ILLUSION,
|
||||||
|
|
||||||
|
RC_FIREDRAGON,
|
||||||
|
RC_DRAGON,
|
||||||
|
RC_WYRM,
|
||||||
|
RC_TREEMAN,
|
||||||
|
RC_BIRTHDAYDRAGON,
|
||||||
|
|
||||||
|
RC_DRACOID,
|
||||||
|
RC_SPECIAL,
|
||||||
|
RC_SPELL,
|
||||||
|
RC_IRONGOLEM,
|
||||||
|
RC_STONEGOLEM,
|
||||||
|
|
||||||
|
RC_SHADOW,
|
||||||
|
RC_SHADOWLORD,
|
||||||
|
RC_IRONKEEPER,
|
||||||
|
RC_ALP,
|
||||||
|
RC_TOAD,
|
||||||
|
|
||||||
|
RC_HIRNTOETER,
|
||||||
|
RC_PEASANT,
|
||||||
|
RC_WOLF = 32,
|
||||||
|
|
||||||
|
RC_SONGDRAGON = 37,
|
||||||
|
|
||||||
|
RC_SEASERPENT = 51,
|
||||||
|
RC_SHADOWKNIGHT,
|
||||||
|
RC_CENTAUR,
|
||||||
|
RC_SKELETON,
|
||||||
|
|
||||||
|
RC_SKELETON_LORD,
|
||||||
|
RC_ZOMBIE,
|
||||||
|
RC_ZOMBIE_LORD,
|
||||||
|
RC_GHOUL,
|
||||||
|
RC_GHOUL_LORD,
|
||||||
|
|
||||||
|
RC_MUS_SPIRIT,
|
||||||
|
RC_GNOME,
|
||||||
|
RC_TEMPLATE,
|
||||||
|
RC_CLONE,
|
||||||
|
|
||||||
|
MAXRACES,
|
||||||
|
NORACE = -1
|
||||||
|
} race_t;
|
||||||
|
|
||||||
typedef struct att {
|
typedef struct att {
|
||||||
int type;
|
int type;
|
||||||
union {
|
union {
|
||||||
|
@ -107,8 +169,12 @@ extern "C" {
|
||||||
extern void racelist_clear(struct race_list **rl);
|
extern void racelist_clear(struct race_list **rl);
|
||||||
extern void racelist_insert(struct race_list **rl, const struct race *r);
|
extern void racelist_insert(struct race_list **rl, const struct race *r);
|
||||||
|
|
||||||
extern struct race_list *get_familiarraces(void);
|
|
||||||
extern struct race *races;
|
struct race_list *get_familiarraces(void);
|
||||||
|
struct race *races;
|
||||||
|
struct race *get_race(race_t rt);
|
||||||
|
/** TODO: compatibility hacks: **/
|
||||||
|
race_t old_race(const struct race *);
|
||||||
|
|
||||||
extern race *rc_get_or_create(const char *name);
|
extern race *rc_get_or_create(const char *name);
|
||||||
extern const race *rc_find(const char *);
|
extern const race *rc_find(const char *);
|
||||||
|
@ -170,11 +236,11 @@ extern "C" {
|
||||||
extern const char *racename(const struct locale *lang, const struct unit *u,
|
extern const char *racename(const struct locale *lang, const struct unit *u,
|
||||||
const race * rc);
|
const race * rc);
|
||||||
|
|
||||||
#define omniscient(f) (((f)->race)==new_race[RC_ILLUSION] || ((f)->race)==new_race[RC_TEMPLATE])
|
#define omniscient(f) ((f)->race==get_race(RC_ILLUSION) || (f)->race==get_race(RC_TEMPLATE))
|
||||||
|
|
||||||
#define playerrace(rc) (fval((rc), RCF_PLAYERRACE))
|
#define playerrace(rc) (fval((rc), RCF_PLAYERRACE))
|
||||||
#define dragonrace(rc) ((rc) == new_race[RC_FIREDRAGON] || (rc) == new_race[RC_DRAGON] || (rc) == new_race[RC_WYRM] || (rc) == new_race[RC_BIRTHDAYDRAGON])
|
#define dragonrace(rc) ((rc) == get_race(RC_FIREDRAGON) || (rc) == get_race(RC_DRAGON) || (rc) == get_race(RC_WYRM) || (rc) == get_race(RC_BIRTHDAYDRAGON))
|
||||||
#define humanoidrace(rc) (fval((rc), RCF_UNDEAD) || (rc)==new_race[RC_DRACOID] || playerrace(rc))
|
#define humanoidrace(rc) (fval((rc), RCF_UNDEAD) || (rc)==get_race(RC_DRACOID) || playerrace(rc))
|
||||||
#define illusionaryrace(rc) (fval(rc, RCF_ILLUSIONARY))
|
#define illusionaryrace(rc) (fval(rc, RCF_ILLUSIONARY))
|
||||||
|
|
||||||
extern bool allowed_dragon(const struct region *src,
|
extern bool allowed_dragon(const struct region *src,
|
||||||
|
|
|
@ -1527,7 +1527,7 @@ static void prepare_reports(void)
|
||||||
prepare_lighthouse(u->building, u->faction);
|
prepare_lighthouse(u->building, u->faction);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u_race(u) != new_race[RC_SPELL] || u->number == RS_FARVISION) {
|
if (u_race(u) != get_race(RC_SPELL) || u->number == RS_FARVISION) {
|
||||||
if (fval(u, UFL_DISBELIEVES)) {
|
if (fval(u, UFL_DISBELIEVES)) {
|
||||||
add_seen(u->faction->seen, r, see_unit, true);
|
add_seen(u->faction->seen, r, see_unit, true);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -126,7 +126,7 @@ static unit *unitorders(FILE * F, int enc, struct faction *f)
|
||||||
i = getid();
|
i = getid();
|
||||||
u = findunitg(i, NULL);
|
u = findunitg(i, NULL);
|
||||||
|
|
||||||
if (u && u_race(u) == new_race[RC_SPELL])
|
if (u && u_race(u) == get_race(RC_SPELL))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (u && u->faction == f) {
|
if (u && u->faction == f) {
|
||||||
order **ordp;
|
order **ordp;
|
||||||
|
|
|
@ -107,12 +107,13 @@ int skill_mod(const race * rc, skill_t sk, const struct terrain_type *terrain)
|
||||||
|
|
||||||
result = rc->bonus[sk];
|
result = rc->bonus[sk];
|
||||||
|
|
||||||
if (rc == new_race[RC_DWARF]) {
|
if (rc == get_race(RC_DWARF)) {
|
||||||
if (sk == SK_TACTICS) {
|
if (sk == SK_TACTICS) {
|
||||||
if (terrain == newterrain(T_MOUNTAIN) || fval(terrain, ARCTIC_REGION))
|
if (terrain == newterrain(T_MOUNTAIN) || fval(terrain, ARCTIC_REGION))
|
||||||
++result;
|
++result;
|
||||||
}
|
}
|
||||||
} else if (rc == new_race[RC_INSECT]) {
|
}
|
||||||
|
else if (rc == get_race(RC_INSECT)) {
|
||||||
if (terrain == newterrain(T_MOUNTAIN) || fval(terrain, ARCTIC_REGION))
|
if (terrain == newterrain(T_MOUNTAIN) || fval(terrain, ARCTIC_REGION))
|
||||||
--result;
|
--result;
|
||||||
else if (terrain == newterrain(T_DESERT) || terrain == newterrain(T_SWAMP))
|
else if (terrain == newterrain(T_DESERT) || terrain == newterrain(T_SWAMP))
|
||||||
|
@ -171,7 +172,7 @@ int rc_skillmod(const struct race *rc, const region * r, skill_t sk)
|
||||||
mods = skill_mod(rc, sk, r->terrain);
|
mods = skill_mod(rc, sk, r->terrain);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (rc == new_race[RC_ELF] && r && r_isforest(r)) {
|
if (rc == get_race(RC_ELF) && r && r_isforest(r)) {
|
||||||
if (sk == SK_PERCEPTION || sk == SK_STEALTH) {
|
if (sk == SK_PERCEPTION || sk == SK_STEALTH) {
|
||||||
++mods;
|
++mods;
|
||||||
} else if (sk == SK_TACTICS) {
|
} else if (sk == SK_TACTICS) {
|
||||||
|
|
|
@ -158,7 +158,7 @@ void spawn_braineaters(float chance)
|
||||||
if (next-- == 0) {
|
if (next-- == 0) {
|
||||||
unit *u =
|
unit *u =
|
||||||
createunit(r, f0, 1 + rng_int() % 10 + rng_int() % 10,
|
createunit(r, f0, 1 + rng_int() % 10 + rng_int() % 10,
|
||||||
new_race[RC_HIRNTOETER]);
|
get_race(RC_HIRNTOETER));
|
||||||
equip_unit(u, get_equipment("monster_braineater"));
|
equip_unit(u, get_equipment("monster_braineater"));
|
||||||
|
|
||||||
next = rng_int() % (int)(chance * 100);
|
next = rng_int() % (int)(chance * 100);
|
||||||
|
|
|
@ -180,70 +180,6 @@ enum {
|
||||||
MAXOPTIONS
|
MAXOPTIONS
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------- Typ von Einheiten ----------------------------- */
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
RC_DWARF, /* 0 - Zwerg */
|
|
||||||
RC_ELF,
|
|
||||||
RC_GOBLIN = 3,
|
|
||||||
RC_HUMAN,
|
|
||||||
|
|
||||||
RC_TROLL,
|
|
||||||
RC_DAEMON,
|
|
||||||
RC_INSECT,
|
|
||||||
RC_HALFLING,
|
|
||||||
RC_CAT,
|
|
||||||
|
|
||||||
RC_AQUARIAN,
|
|
||||||
RC_ORC,
|
|
||||||
RC_SNOTLING,
|
|
||||||
RC_UNDEAD,
|
|
||||||
RC_ILLUSION,
|
|
||||||
|
|
||||||
RC_FIREDRAGON,
|
|
||||||
RC_DRAGON,
|
|
||||||
RC_WYRM,
|
|
||||||
RC_TREEMAN,
|
|
||||||
RC_BIRTHDAYDRAGON,
|
|
||||||
|
|
||||||
RC_DRACOID,
|
|
||||||
RC_SPECIAL,
|
|
||||||
RC_SPELL,
|
|
||||||
RC_IRONGOLEM,
|
|
||||||
RC_STONEGOLEM,
|
|
||||||
|
|
||||||
RC_SHADOW,
|
|
||||||
RC_SHADOWLORD,
|
|
||||||
RC_IRONKEEPER,
|
|
||||||
RC_ALP,
|
|
||||||
RC_TOAD,
|
|
||||||
|
|
||||||
RC_HIRNTOETER,
|
|
||||||
RC_PEASANT,
|
|
||||||
RC_WOLF = 32,
|
|
||||||
|
|
||||||
RC_SONGDRAGON = 37,
|
|
||||||
|
|
||||||
RC_SEASERPENT = 51,
|
|
||||||
RC_SHADOWKNIGHT,
|
|
||||||
RC_CENTAUR,
|
|
||||||
RC_SKELETON,
|
|
||||||
|
|
||||||
RC_SKELETON_LORD,
|
|
||||||
RC_ZOMBIE,
|
|
||||||
RC_ZOMBIE_LORD,
|
|
||||||
RC_GHOUL,
|
|
||||||
RC_GHOUL_LORD,
|
|
||||||
|
|
||||||
RC_MUS_SPIRIT,
|
|
||||||
RC_GNOME,
|
|
||||||
RC_TEMPLATE,
|
|
||||||
RC_CLONE,
|
|
||||||
|
|
||||||
MAXRACES,
|
|
||||||
NORACE = -1
|
|
||||||
} race_t;
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
M_GRAY = 0, /* Gray */
|
M_GRAY = 0, /* Gray */
|
||||||
M_ILLAUN = 1, /* Illaun */
|
M_ILLAUN = 1, /* Illaun */
|
||||||
|
|
|
@ -330,7 +330,7 @@ void make_zombie(unit * u)
|
||||||
{
|
{
|
||||||
u_setfaction(u, get_monsters());
|
u_setfaction(u, get_monsters());
|
||||||
scale_number(u, 1);
|
scale_number(u, 1);
|
||||||
u_setrace(u, new_race[RC_ZOMBIE]);
|
u_setrace(u, get_race(RC_ZOMBIE));
|
||||||
u->irace = NULL;
|
u->irace = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -578,6 +578,7 @@ static int parse_ships(xmlDocPtr doc)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static void race_compat(void)
|
static void race_compat(void)
|
||||||
{
|
{
|
||||||
/* required for old_race, do not change order! */
|
/* required for old_race, do not change order! */
|
||||||
|
@ -612,6 +613,7 @@ static void race_compat(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static potion_type *xml_readpotion(xmlXPathContextPtr xpath, item_type * itype)
|
static potion_type *xml_readpotion(xmlXPathContextPtr xpath, item_type * itype)
|
||||||
{
|
{
|
||||||
|
@ -1883,7 +1885,6 @@ static int parse_races(xmlDocPtr doc)
|
||||||
|
|
||||||
xmlXPathFreeContext(xpath);
|
xmlXPathFreeContext(xpath);
|
||||||
|
|
||||||
race_compat();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
17
src/laws.c
17
src/laws.c
|
@ -288,7 +288,7 @@ void get_food(region * r)
|
||||||
* bei fehlenden Bauern den Dämon hungern lassen
|
* bei fehlenden Bauern den Dämon hungern lassen
|
||||||
*/
|
*/
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
if (u_race(u) == new_race[RC_DAEMON]) {
|
if (u_race(u) == get_race(RC_DAEMON)) {
|
||||||
int hungry = u->number;
|
int hungry = u->number;
|
||||||
|
|
||||||
/* use peasantblood before eating the peasants themselves */
|
/* use peasantblood before eating the peasants themselves */
|
||||||
|
@ -310,7 +310,7 @@ void get_food(region * r)
|
||||||
if (donor == u)
|
if (donor == u)
|
||||||
donor = r->units;
|
donor = r->units;
|
||||||
while (donor != NULL) {
|
while (donor != NULL) {
|
||||||
if (u_race(donor) == new_race[RC_DAEMON] && donor!=u) {
|
if (u_race(donor) == get_race(RC_DAEMON) && donor != u) {
|
||||||
if (get_effect(donor, pt_blood)) {
|
if (get_effect(donor, pt_blood)) {
|
||||||
/* if he's in our faction, drain him: */
|
/* if he's in our faction, drain him: */
|
||||||
if (donor->faction == u->faction)
|
if (donor->faction == u->faction)
|
||||||
|
@ -358,7 +358,7 @@ void get_food(region * r)
|
||||||
|
|
||||||
static void age_unit(region * r, unit * u)
|
static void age_unit(region * r, unit * u)
|
||||||
{
|
{
|
||||||
if (u_race(u) == new_race[RC_SPELL]) {
|
if (u_race(u) == get_race(RC_SPELL)) {
|
||||||
if (--u->age <= 0) {
|
if (--u->age <= 0) {
|
||||||
remove_unit(&r->units, u);
|
remove_unit(&r->units, u);
|
||||||
}
|
}
|
||||||
|
@ -749,7 +749,7 @@ growing_trees(region * r, const int current_season, const int last_weeks_season)
|
||||||
|
|
||||||
if (current_season == SEASON_SUMMER || current_season == SEASON_AUTUMN) {
|
if (current_season == SEASON_SUMMER || current_season == SEASON_AUTUMN) {
|
||||||
double seedchance = 0.01F * RESOURCE_QUANTITY;
|
double seedchance = 0.01F * RESOURCE_QUANTITY;
|
||||||
int elves = count_race(r, new_race[RC_ELF]);
|
int elves = count_race(r, get_race(RC_ELF));
|
||||||
|
|
||||||
a = a_find(r->attribs, &at_germs);
|
a = a_find(r->attribs, &at_germs);
|
||||||
if (a && last_weeks_season == SEASON_SPRING) {
|
if (a && last_weeks_season == SEASON_SPRING) {
|
||||||
|
@ -2931,7 +2931,7 @@ int guard_on_cmd(unit * u, struct order *ord)
|
||||||
if (fval(u, UFL_MOVED)) {
|
if (fval(u, UFL_MOVED)) {
|
||||||
cmistake(u, ord, 187, MSG_EVENT);
|
cmistake(u, ord, 187, MSG_EVENT);
|
||||||
} else if (fval(u_race(u), RCF_ILLUSIONARY)
|
} else if (fval(u_race(u), RCF_ILLUSIONARY)
|
||||||
|| u_race(u) == new_race[RC_SPELL]) {
|
|| u_race(u) == get_race(RC_SPELL)) {
|
||||||
cmistake(u, ord, 95, MSG_EVENT);
|
cmistake(u, ord, 95, MSG_EVENT);
|
||||||
} else {
|
} else {
|
||||||
/* Monster der Monsterpartei dürfen immer bewachen */
|
/* Monster der Monsterpartei dürfen immer bewachen */
|
||||||
|
@ -3395,7 +3395,7 @@ static void ageing(void)
|
||||||
if (is_cursed(u->attribs, C_OLDRACE, 0)) {
|
if (is_cursed(u->attribs, C_OLDRACE, 0)) {
|
||||||
curse *c = get_curse(u->attribs, ct_find("oldrace"));
|
curse *c = get_curse(u->attribs, ct_find("oldrace"));
|
||||||
if (c->duration == 1 && !(c_flags(c) & CURSE_NOAGE)) {
|
if (c->duration == 1 && !(c_flags(c) & CURSE_NOAGE)) {
|
||||||
u_setrace(u, new_race[curse_geteffect_int(c)]);
|
u_setrace(u, get_race(curse_geteffect_int(c)));
|
||||||
u->irace = NULL;
|
u->irace = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4262,7 +4262,8 @@ void process(void)
|
||||||
if (porder->flags & PROC_LONGORDER) {
|
if (porder->flags & PROC_LONGORDER) {
|
||||||
if (u->number == 0) {
|
if (u->number == 0) {
|
||||||
ord = NULL;
|
ord = NULL;
|
||||||
} else if (u_race(u) == new_race[RC_INSECT]
|
}
|
||||||
|
else if (u_race(u) == get_race(RC_INSECT)
|
||||||
&& r_insectstalled(r)
|
&& r_insectstalled(r)
|
||||||
&& !is_cursed(u->attribs, C_KAELTESCHUTZ, 0)) {
|
&& !is_cursed(u->attribs, C_KAELTESCHUTZ, 0)) {
|
||||||
ord = NULL;
|
ord = NULL;
|
||||||
|
@ -4275,7 +4276,7 @@ void process(void)
|
||||||
*/
|
*/
|
||||||
ord = NULL;
|
ord = NULL;
|
||||||
} else if (fval(r->terrain, SEA_REGION)
|
} else if (fval(r->terrain, SEA_REGION)
|
||||||
&& u_race(u) != new_race[RC_AQUARIAN]
|
&& u_race(u) != get_race(RC_AQUARIAN)
|
||||||
&& !(u_race(u)->flags & RCF_SWIM)) {
|
&& !(u_race(u)->flags & RCF_SWIM)) {
|
||||||
/* error message disabled by popular demand */
|
/* error message disabled by popular demand */
|
||||||
ord = NULL;
|
ord = NULL;
|
||||||
|
|
|
@ -341,7 +341,7 @@ static void guardian_faction(plane * pl, int id)
|
||||||
f->passw = _strdup(itoa36(rng_int()));
|
f->passw = _strdup(itoa36(rng_int()));
|
||||||
set_email(&f->email, "igjarjuk@eressea.de");
|
set_email(&f->email, "igjarjuk@eressea.de");
|
||||||
f->name = _strdup("Igjarjuks Kundschafter");
|
f->name = _strdup("Igjarjuks Kundschafter");
|
||||||
f->race = new_race[RC_ILLUSION];
|
f->race = get_race(RC_ILLUSION);
|
||||||
f->age = turn;
|
f->age = turn;
|
||||||
f->locale = get_locale("de");
|
f->locale = get_locale("de");
|
||||||
f->options =
|
f->options =
|
||||||
|
@ -352,7 +352,7 @@ static void guardian_faction(plane * pl, int id)
|
||||||
addlist(&factions, f);
|
addlist(&factions, f);
|
||||||
fhash(f);
|
fhash(f);
|
||||||
}
|
}
|
||||||
if (f->race != new_race[RC_ILLUSION]) {
|
if (f->race != get_race(RC_ILLUSION)) {
|
||||||
assert(!"guardian id vergeben");
|
assert(!"guardian id vergeben");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
@ -368,7 +368,7 @@ static void guardian_faction(plane * pl, int id)
|
||||||
}
|
}
|
||||||
if (u)
|
if (u)
|
||||||
continue;
|
continue;
|
||||||
u = createunit(r, f, 1, new_race[RC_GOBLIN]);
|
u = createunit(r, f, 1, get_race(RC_GOBLIN));
|
||||||
set_string(&u->name, "Igjarjuks Auge");
|
set_string(&u->name, "Igjarjuks Auge");
|
||||||
i_change(&u->items, it_find("roi"), 1);
|
i_change(&u->items, it_find("roi"), 1);
|
||||||
set_order(&u->thisorder, NULL);
|
set_order(&u->thisorder, NULL);
|
||||||
|
|
|
@ -47,8 +47,8 @@ int average_score_of_age(int age, int a)
|
||||||
int sum = 0, count = 0;
|
int sum = 0, count = 0;
|
||||||
|
|
||||||
for (f = factions; f; f = f->next) {
|
for (f = factions; f; f = f->next) {
|
||||||
if (!is_monsters(f) && f->race != new_race[RC_TEMPLATE] && f->age <= age + a
|
if (!is_monsters(f) && f->age <= age + a
|
||||||
&& f->age >= age - a) {
|
&& f->age >= age - a && f->race != get_race(RC_TEMPLATE)) {
|
||||||
sum += f->score;
|
sum += f->score;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
@ -106,8 +106,8 @@ void score(void)
|
||||||
int i;
|
int i;
|
||||||
faction *f = u->faction;
|
faction *f = u->faction;
|
||||||
|
|
||||||
if (f == NULL || u_race(u) == new_race[RC_SPELL]
|
if (f == NULL || u_race(u) == get_race(RC_SPELL)
|
||||||
|| u_race(u) == new_race[RC_BIRTHDAYDRAGON]) {
|
|| u_race(u) == get_race(RC_BIRTHDAYDRAGON)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ void score(void)
|
||||||
|
|
||||||
for (fc = factions; fc; fc = fc->next) {
|
for (fc = factions; fc; fc = fc->next) {
|
||||||
fc->score = fc->score / 5;
|
fc->score = fc->score / 5;
|
||||||
if (!is_monsters(fc) && fc->race != new_race[RC_TEMPLATE]) {
|
if (!is_monsters(fc) && fc->race != get_race(RC_TEMPLATE)) {
|
||||||
allscores += fc->score;
|
allscores += fc->score;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -389,7 +389,7 @@ static int dragon_affinity_value(region * r, unit * u)
|
||||||
{
|
{
|
||||||
int m = all_money(r, u->faction);
|
int m = all_money(r, u->faction);
|
||||||
|
|
||||||
if (u_race(u) == new_race[RC_FIREDRAGON]) {
|
if (u_race(u) == get_race(RC_FIREDRAGON)) {
|
||||||
return (int)(normalvariate(m, m / 2));
|
return (int)(normalvariate(m, m / 2));
|
||||||
} else {
|
} else {
|
||||||
return (int)(normalvariate(m, m / 4));
|
return (int)(normalvariate(m, m / 4));
|
||||||
|
@ -497,7 +497,7 @@ static order *monster_seeks_target(region * r, unit * u)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r == target->region) { /* Wir haben ihn! */
|
if (r == target->region) { /* Wir haben ihn! */
|
||||||
if (u_race(u) == new_race[RC_ALP]) {
|
if (u_race(u) == get_race(RC_ALP)) {
|
||||||
alp_findet_opfer(u, r);
|
alp_findet_opfer(u, r);
|
||||||
} else {
|
} else {
|
||||||
assert(!"Seeker-Monster hat keine Aktion fuer Ziel");
|
assert(!"Seeker-Monster hat keine Aktion fuer Ziel");
|
||||||
|
@ -614,7 +614,7 @@ static void recruit_dracoids(unit * dragon, int size)
|
||||||
region *r = dragon->region;
|
region *r = dragon->region;
|
||||||
const struct item *weapon = NULL;
|
const struct item *weapon = NULL;
|
||||||
order *new_order = NULL;
|
order *new_order = NULL;
|
||||||
unit *un = createunit(r, f, size, new_race[RC_DRACOID]);
|
unit *un = createunit(r, f, size, get_race(RC_DRACOID));
|
||||||
|
|
||||||
fset(un, UFL_ISNEW | UFL_MOVED);
|
fset(un, UFL_ISNEW | UFL_MOVED);
|
||||||
|
|
||||||
|
@ -653,7 +653,7 @@ static order *plan_dragon(unit * u)
|
||||||
}
|
}
|
||||||
move |= chance(0.04); /* 4% chance to change your mind */
|
move |= chance(0.04); /* 4% chance to change your mind */
|
||||||
|
|
||||||
if (u_race(u) == new_race[RC_WYRM] && !move) {
|
if (u_race(u) == get_race(RC_WYRM) && !move) {
|
||||||
unit *u2;
|
unit *u2;
|
||||||
for (u2 = r->units; u2; u2 = u2->next) {
|
for (u2 = r->units; u2; u2 = u2->next) {
|
||||||
/* wyrme sind einzelgänger */
|
/* wyrme sind einzelgänger */
|
||||||
|
@ -715,7 +715,8 @@ static order *plan_dragon(unit * u)
|
||||||
if (long_order == NULL) {
|
if (long_order == NULL) {
|
||||||
/* money is gone, need a new target */
|
/* money is gone, need a new target */
|
||||||
set_new_dragon_target(u, u->region, DRAGON_RANGE);
|
set_new_dragon_target(u, u->region, DRAGON_RANGE);
|
||||||
} else if (u_race(u) != new_race[RC_FIREDRAGON]) {
|
}
|
||||||
|
else if (u_race(u) != get_race(RC_FIREDRAGON)) {
|
||||||
/* neue dracoiden! */
|
/* neue dracoiden! */
|
||||||
if (r->land && !fval(r->terrain, FORBIDDEN_REGION)) {
|
if (r->land && !fval(r->terrain, FORBIDDEN_REGION)) {
|
||||||
int ra = 20 + rng_int() % 100;
|
int ra = 20 + rng_int() % 100;
|
||||||
|
@ -894,7 +895,7 @@ void spawn_dragons(void)
|
||||||
unit *u;
|
unit *u;
|
||||||
|
|
||||||
if (fval(r->terrain, SEA_REGION) && rng_int() % 10000 < 1) {
|
if (fval(r->terrain, SEA_REGION) && rng_int() % 10000 < 1) {
|
||||||
u = createunit(r, monsters, 1, new_race[RC_SEASERPENT]);
|
u = createunit(r, monsters, 1, get_race(RC_SEASERPENT));
|
||||||
fset(u, UFL_ISNEW | UFL_MOVED);
|
fset(u, UFL_ISNEW | UFL_MOVED);
|
||||||
equip_unit(u, get_equipment("monster_seaserpent"));
|
equip_unit(u, get_equipment("monster_seaserpent"));
|
||||||
}
|
}
|
||||||
|
@ -904,9 +905,9 @@ void spawn_dragons(void)
|
||||||
|| r->terrain == newterrain(T_DESERT))
|
|| r->terrain == newterrain(T_DESERT))
|
||||||
&& rng_int() % 10000 < (5 + 100 * chaosfactor(r))) {
|
&& rng_int() % 10000 < (5 + 100 * chaosfactor(r))) {
|
||||||
if (chance(0.80)) {
|
if (chance(0.80)) {
|
||||||
u = createunit(r, monsters, nrand(60, 20) + 1, new_race[RC_FIREDRAGON]);
|
u = createunit(r, monsters, nrand(60, 20) + 1, get_race(RC_FIREDRAGON));
|
||||||
} else {
|
} else {
|
||||||
u = createunit(r, monsters, nrand(30, 20) + 1, new_race[RC_DRAGON]);
|
u = createunit(r, monsters, nrand(30, 20) + 1, get_race(RC_DRAGON));
|
||||||
}
|
}
|
||||||
fset(u, UFL_ISNEW | UFL_MOVED);
|
fset(u, UFL_ISNEW | UFL_MOVED);
|
||||||
equip_unit(u, get_equipment("monster_dragon"));
|
equip_unit(u, get_equipment("monster_dragon"));
|
||||||
|
@ -959,19 +960,19 @@ void spawn_undead(void)
|
||||||
|
|
||||||
switch (rng_int() % 3) {
|
switch (rng_int() % 3) {
|
||||||
case 0:
|
case 0:
|
||||||
rc = new_race[RC_SKELETON];
|
rc = get_race(RC_SKELETON);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
rc = new_race[RC_ZOMBIE];
|
rc = get_race(RC_ZOMBIE);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
rc = new_race[RC_GHOUL];
|
rc = get_race(RC_GHOUL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
u = createunit(r, monsters, undead, rc);
|
u = createunit(r, monsters, undead, rc);
|
||||||
fset(u, UFL_ISNEW | UFL_MOVED);
|
fset(u, UFL_ISNEW | UFL_MOVED);
|
||||||
if ((rc == new_race[RC_SKELETON] || rc == new_race[RC_ZOMBIE])
|
if ((rc == get_race(RC_SKELETON) || rc == get_race(RC_ZOMBIE))
|
||||||
&& rng_int() % 10 < 4) {
|
&& rng_int() % 10 < 4) {
|
||||||
equip_unit(u, get_equipment("rising_undead"));
|
equip_unit(u, get_equipment("rising_undead"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <kernel/config.h>
|
#include <kernel/config.h>
|
||||||
|
|
||||||
/* kernel includes */
|
/* kernel includes */
|
||||||
|
#include <kernel/race.h>
|
||||||
#include <kernel/region.h>
|
#include <kernel/region.h>
|
||||||
#include <kernel/unit.h>
|
#include <kernel/unit.h>
|
||||||
|
|
||||||
|
@ -31,7 +32,7 @@ void age_firedragon(unit * u)
|
||||||
{
|
{
|
||||||
if (u->number > 0 && rng_int() % 100 < age_chance(u->age, DRAGONAGE, 1)) {
|
if (u->number > 0 && rng_int() % 100 < age_chance(u->age, DRAGONAGE, 1)) {
|
||||||
double q = (double)u->hp / (double)(unit_max_hp(u) * u->number);
|
double q = (double)u->hp / (double)(unit_max_hp(u) * u->number);
|
||||||
u_setrace(u, new_race[RC_DRAGON]);
|
u_setrace(u, get_race(RC_DRAGON));
|
||||||
u->irace = NULL;
|
u->irace = NULL;
|
||||||
scale_number(u, 1);
|
scale_number(u, 1);
|
||||||
u->hp = (int)(unit_max_hp(u) * u->number * q);
|
u->hp = (int)(unit_max_hp(u) * u->number * q);
|
||||||
|
@ -42,7 +43,7 @@ void age_dragon(unit * u)
|
||||||
{
|
{
|
||||||
if (u->number > 0 && rng_int() % 100 < age_chance(u->age, WYRMAGE, 1)) {
|
if (u->number > 0 && rng_int() % 100 < age_chance(u->age, WYRMAGE, 1)) {
|
||||||
double q = (double)u->hp / (double)(unit_max_hp(u) * u->number);
|
double q = (double)u->hp / (double)(unit_max_hp(u) * u->number);
|
||||||
u_setrace(u, new_race[RC_WYRM]);
|
u_setrace(u, get_race(RC_WYRM));
|
||||||
u->irace = NULL;
|
u->irace = NULL;
|
||||||
u->hp = (int)(unit_max_hp(u) * u->number * q);
|
u->hp = (int)(unit_max_hp(u) * u->number * q);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <kernel/config.h>
|
#include <kernel/config.h>
|
||||||
|
|
||||||
/* kernel includes */
|
/* kernel includes */
|
||||||
|
#include <kernel/race.h>
|
||||||
#include <kernel/unit.h>
|
#include <kernel/unit.h>
|
||||||
#include <kernel/faction.h>
|
#include <kernel/faction.h>
|
||||||
#include <kernel/messages.h>
|
#include <kernel/messages.h>
|
||||||
|
@ -28,7 +29,7 @@
|
||||||
|
|
||||||
void age_illusion(unit * u)
|
void age_illusion(unit * u)
|
||||||
{
|
{
|
||||||
if (u->faction->race != new_race[RC_ILLUSION]) {
|
if (u->faction->race != get_race(RC_ILLUSION)) {
|
||||||
if (u->age == ILLUSIONMAX) {
|
if (u->age == ILLUSIONMAX) {
|
||||||
ADDMSG(&u->faction->msgs, msg_message("warnillusiondissolve", "unit", u));
|
ADDMSG(&u->faction->msgs, msg_message("warnillusiondissolve", "unit", u));
|
||||||
} else if (u->age > ILLUSIONMAX) {
|
} else if (u->age > ILLUSIONMAX) {
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <kernel/config.h>
|
#include <kernel/config.h>
|
||||||
|
|
||||||
/* kernel includes */
|
/* kernel includes */
|
||||||
|
#include <kernel/race.h>
|
||||||
#include <kernel/unit.h>
|
#include <kernel/unit.h>
|
||||||
#include <kernel/faction.h>
|
#include <kernel/faction.h>
|
||||||
#include <kernel/region.h>
|
#include <kernel/region.h>
|
||||||
|
@ -51,7 +52,7 @@ void age_undead(unit * u)
|
||||||
if (rng_int() % 100 < UNDEAD_BREAKUP_FRACTION)
|
if (rng_int() % 100 < UNDEAD_BREAKUP_FRACTION)
|
||||||
++n;
|
++n;
|
||||||
}
|
}
|
||||||
u2 = create_unit(r, get_monsters(), 0, new_race[RC_UNDEAD], 0, NULL, u);
|
u2 = create_unit(r, get_monsters(), 0, get_race(RC_UNDEAD), 0, NULL, u);
|
||||||
make_undead_unit(u2);
|
make_undead_unit(u2);
|
||||||
transfermen(u, u2, u->number - n);
|
transfermen(u, u2, u->number - n);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +63,7 @@ void age_skeleton(unit * u)
|
||||||
if (is_monsters(u->faction) && rng_int() % 100 < age_chance(u->age, 27, 1)) {
|
if (is_monsters(u->faction) && rng_int() % 100 < age_chance(u->age, 27, 1)) {
|
||||||
int n = _max(1, u->number / 2);
|
int n = _max(1, u->number / 2);
|
||||||
double q = (double)u->hp / (double)(unit_max_hp(u) * u->number);
|
double q = (double)u->hp / (double)(unit_max_hp(u) * u->number);
|
||||||
u_setrace(u, new_race[RC_SKELETON_LORD]);
|
u_setrace(u, get_race(RC_SKELETON_LORD));
|
||||||
u->irace = NULL;
|
u->irace = NULL;
|
||||||
scale_number(u, n);
|
scale_number(u, n);
|
||||||
u->hp = (int)(unit_max_hp(u) * u->number * q);
|
u->hp = (int)(unit_max_hp(u) * u->number * q);
|
||||||
|
@ -74,7 +75,7 @@ void age_zombie(unit * u)
|
||||||
if (is_monsters(u->faction) && rng_int() % 100 < age_chance(u->age, 27, 1)) {
|
if (is_monsters(u->faction) && rng_int() % 100 < age_chance(u->age, 27, 1)) {
|
||||||
int n = _max(1, u->number / 2);
|
int n = _max(1, u->number / 2);
|
||||||
double q = (double)u->hp / (double)(unit_max_hp(u) * u->number);
|
double q = (double)u->hp / (double)(unit_max_hp(u) * u->number);
|
||||||
u_setrace(u, new_race[RC_ZOMBIE_LORD]);
|
u_setrace(u, get_race(RC_ZOMBIE_LORD));
|
||||||
u->irace = NULL;
|
u->irace = NULL;
|
||||||
scale_number(u, n);
|
scale_number(u, n);
|
||||||
u->hp = (int)(unit_max_hp(u) * u->number * q);
|
u->hp = (int)(unit_max_hp(u) * u->number * q);
|
||||||
|
@ -86,7 +87,7 @@ void age_ghoul(unit * u)
|
||||||
if (is_monsters(u->faction) && rng_int() % 100 < age_chance(u->age, 27, 1)) {
|
if (is_monsters(u->faction) && rng_int() % 100 < age_chance(u->age, 27, 1)) {
|
||||||
int n = _max(1, u->number / 2);
|
int n = _max(1, u->number / 2);
|
||||||
double q = (double)u->hp / (double)(unit_max_hp(u) * u->number);
|
double q = (double)u->hp / (double)(unit_max_hp(u) * u->number);
|
||||||
u_setrace(u, new_race[RC_GHOUL_LORD]);
|
u_setrace(u, get_race(RC_GHOUL_LORD));
|
||||||
u->irace = NULL;
|
u->irace = NULL;
|
||||||
scale_number(u, n);
|
scale_number(u, n);
|
||||||
u->hp = (int)(unit_max_hp(u) * u->number * q);
|
u->hp = (int)(unit_max_hp(u) * u->number * q);
|
||||||
|
|
|
@ -127,8 +127,8 @@ static void dissolve_units(void)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (u_race(u) == new_race[RC_STONEGOLEM]
|
if (u_race(u) == get_race(RC_STONEGOLEM)
|
||||||
|| u_race(u) == new_race[RC_IRONGOLEM]) {
|
|| u_race(u) == get_race(RC_IRONGOLEM)) {
|
||||||
msg =
|
msg =
|
||||||
msg_message("dissolve_units_4", "unit region number race", u, r,
|
msg_message("dissolve_units_4", "unit region number race", u, r,
|
||||||
n, u_race(u));
|
n, u_race(u));
|
||||||
|
@ -446,7 +446,7 @@ static unit *random_unit(const region * r)
|
||||||
unit *u;
|
unit *u;
|
||||||
|
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
if (u_race(u) != new_race[RC_SPELL]) {
|
if (u_race(u) != get_race(RC_SPELL)) {
|
||||||
c += u->number;
|
c += u->number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -459,7 +459,7 @@ static unit *random_unit(const region * r)
|
||||||
u = r->units;
|
u = r->units;
|
||||||
|
|
||||||
while (u && c < n) {
|
while (u && c < n) {
|
||||||
if (u_race(u) != new_race[RC_SPELL]) {
|
if (u_race(u) != get_race(RC_SPELL)) {
|
||||||
c += u->number;
|
c += u->number;
|
||||||
}
|
}
|
||||||
u = u->next;
|
u = u->next;
|
||||||
|
@ -478,7 +478,7 @@ void chaos(region * r)
|
||||||
if (u && playerrace(u_race(u))) {
|
if (u && playerrace(u_race(u))) {
|
||||||
ADDMSG(&u->faction->msgs, msg_message("chaos_disease", "unit", u));
|
ADDMSG(&u->faction->msgs, msg_message("chaos_disease", "unit", u));
|
||||||
u_setfaction(u, get_monsters());
|
u_setfaction(u, get_monsters());
|
||||||
u_setrace(u, new_race[RC_GHOUL]);
|
u_setrace(u, get_race(RC_GHOUL));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -491,19 +491,19 @@ void chaos(region * r)
|
||||||
mfac = 100;
|
mfac = 100;
|
||||||
u =
|
u =
|
||||||
createunit(r, get_monsters(), rng_int() % 8 + 1,
|
createunit(r, get_monsters(), rng_int() % 8 + 1,
|
||||||
new_race[RC_FIREDRAGON]);
|
get_race(RC_FIREDRAGON));
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
mfac = 500;
|
mfac = 500;
|
||||||
u =
|
u =
|
||||||
createunit(r, get_monsters(), rng_int() % 4 + 1,
|
createunit(r, get_monsters(), rng_int() % 4 + 1,
|
||||||
new_race[RC_DRAGON]);
|
get_race(RC_DRAGON));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
mfac = 1000;
|
mfac = 1000;
|
||||||
u =
|
u =
|
||||||
createunit(r, get_monsters(), rng_int() % 2 + 1,
|
createunit(r, get_monsters(), rng_int() % 2 + 1,
|
||||||
new_race[RC_WYRM]);
|
get_race(RC_WYRM));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (mfac)
|
if (mfac)
|
||||||
|
@ -537,7 +537,7 @@ void chaos(region * r)
|
||||||
|
|
||||||
for (up = &r->units; *up;) {
|
for (up = &r->units; *up;) {
|
||||||
unit *u = *up;
|
unit *u = *up;
|
||||||
if (u_race(u) != new_race[RC_SPELL] && u->ship == 0 && !canfly(u)) {
|
if (u_race(u) != get_race(RC_SPELL) && u->ship == 0 && !canfly(u)) {
|
||||||
ADDMSG(&u->faction->msgs, msg_message("tidalwave_kill",
|
ADDMSG(&u->faction->msgs, msg_message("tidalwave_kill",
|
||||||
"region unit", r, u));
|
"region unit", r, u));
|
||||||
remove_unit(up, u);
|
remove_unit(up, u);
|
||||||
|
@ -605,7 +605,7 @@ damage_unit(unit * u, const char *dam, bool physical, bool magic)
|
||||||
double magres = magic_resistance(u);
|
double magres = magic_resistance(u);
|
||||||
|
|
||||||
assert(u->number);
|
assert(u->number);
|
||||||
if (fval(u_race(u), RCF_ILLUSIONARY) || u_race(u) == new_race[RC_SPELL]) {
|
if (fval(u_race(u), RCF_ILLUSIONARY) || u_race(u) == get_race(RC_SPELL)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -676,7 +676,7 @@ void drown(region * r)
|
||||||
while (*up) {
|
while (*up) {
|
||||||
unit *u = *up;
|
unit *u = *up;
|
||||||
int amphibian_level = 0;
|
int amphibian_level = 0;
|
||||||
if (u->ship || u_race(u) == new_race[RC_SPELL] || u->number == 0) {
|
if (u->ship || u_race(u) == get_race(RC_SPELL) || u->number == 0) {
|
||||||
up = &u->next;
|
up = &u->next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1110,7 +1110,7 @@ static void demon_skillchanges(void)
|
||||||
for (r = regions; r; r = r->next) {
|
for (r = regions; r; r = r->next) {
|
||||||
unit *u;
|
unit *u;
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
if (u_race(u) == new_race[RC_DAEMON]) {
|
if (u_race(u) == get_race(RC_DAEMON)) {
|
||||||
skill *sv = u->skills;
|
skill *sv = u->skills;
|
||||||
int upchance = 15;
|
int upchance = 15;
|
||||||
int downchance = 10;
|
int downchance = 10;
|
||||||
|
|
|
@ -1289,7 +1289,7 @@ static void statistics(FILE * F, const region * r, const faction * f)
|
||||||
msg_release(m);
|
msg_release(m);
|
||||||
}
|
}
|
||||||
if (production(r) && (!fval(r->terrain, SEA_REGION)
|
if (production(r) && (!fval(r->terrain, SEA_REGION)
|
||||||
|| f->race == new_race[RC_AQUARIAN])) {
|
|| f->race == get_race(RC_AQUARIAN))) {
|
||||||
if (markets_module()) { /* hack */
|
if (markets_module()) { /* hack */
|
||||||
m =
|
m =
|
||||||
msg_message("nr_stat_salary_new", "max", wage(r, NULL, NULL, turn + 1));
|
msg_message("nr_stat_salary_new", "max", wage(r, NULL, NULL, turn + 1));
|
||||||
|
@ -2199,7 +2199,7 @@ report_plaintext(const char *filename, report_context * ctx,
|
||||||
nr_render(m, f->locale, buf, sizeof(buf), f);
|
nr_render(m, f->locale, buf, sizeof(buf), f);
|
||||||
msg_release(m);
|
msg_release(m);
|
||||||
centre(F, buf, true);
|
centre(F, buf, true);
|
||||||
if (f->race == new_race[RC_HUMAN]) {
|
if (f->race == get_race(RC_HUMAN)) {
|
||||||
int maxmig = count_maxmigrants(f);
|
int maxmig = count_maxmigrants(f);
|
||||||
if (maxmig > 0) {
|
if (maxmig > 0) {
|
||||||
m =
|
m =
|
||||||
|
@ -2238,7 +2238,7 @@ report_plaintext(const char *filename, report_context * ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Insekten-Winter-Warnung */
|
/* Insekten-Winter-Warnung */
|
||||||
if (f->race == new_race[RC_INSECT]) {
|
if (f->race == get_race(RC_INSECT)) {
|
||||||
if (thisseason == 0) {
|
if (thisseason == 0) {
|
||||||
centre(F, LOC(f->locale, "nr_insectwinter"), true);
|
centre(F, LOC(f->locale, "nr_insectwinter"), true);
|
||||||
rnl(F);
|
rnl(F);
|
||||||
|
|
|
@ -104,7 +104,7 @@ int sp_summon_alp(struct castorder *co)
|
||||||
unit *mage = co->magician.u;
|
unit *mage = co->magician.u;
|
||||||
int cast_level = co->level;
|
int cast_level = co->level;
|
||||||
spellparameter *pa = co->par;
|
spellparameter *pa = co->par;
|
||||||
const struct race *rc = new_race[RC_ALP];
|
const struct race *rc = get_race(RC_ALP);
|
||||||
struct faction *f = get_monsters();
|
struct faction *f = get_monsters();
|
||||||
struct message *msg;
|
struct message *msg;
|
||||||
|
|
||||||
|
|
|
@ -832,7 +832,7 @@ int sp_wolfhowl(struct castorder * co)
|
||||||
attrib *a;
|
attrib *a;
|
||||||
message *msg;
|
message *msg;
|
||||||
int force = (int)(get_force(power, 3) / 2);
|
int force = (int)(get_force(power, 3) / 2);
|
||||||
const race * rc = new_race[RC_WOLF];
|
const race * rc = get_race(RC_WOLF);
|
||||||
if (force>0) {
|
if (force>0) {
|
||||||
unit *u =
|
unit *u =
|
||||||
create_unit(r, mage->faction, force, rc, 0, NULL, mage);
|
create_unit(r, mage->faction, force, rc, 0, NULL, mage);
|
||||||
|
@ -876,7 +876,7 @@ int sp_shadowknights(struct castorder * co)
|
||||||
message *msg;
|
message *msg;
|
||||||
|
|
||||||
u =
|
u =
|
||||||
create_unit(r, mage->faction, force, new_race[RC_SHADOWKNIGHT], 0, NULL,
|
create_unit(r, mage->faction, force, get_race(RC_SHADOWKNIGHT), 0, NULL,
|
||||||
mage);
|
mage);
|
||||||
setstatus(u, ST_FIGHT);
|
setstatus(u, ST_FIGHT);
|
||||||
|
|
||||||
|
@ -1556,7 +1556,7 @@ int sp_reanimate(struct castorder * co)
|
||||||
while (healable--) {
|
while (healable--) {
|
||||||
fighter *tf = select_corpse(b, fi);
|
fighter *tf = select_corpse(b, fi);
|
||||||
if (tf != NULL && tf->side->casualties > 0
|
if (tf != NULL && tf->side->casualties > 0
|
||||||
&& u_race(tf->unit) != new_race[RC_DAEMON]
|
&& u_race(tf->unit) != get_race(RC_DAEMON)
|
||||||
&& (chance(c))) {
|
&& (chance(c))) {
|
||||||
assert(tf->alive < tf->unit->number);
|
assert(tf->alive < tf->unit->number);
|
||||||
/* t.fighter->person[].hp beginnt mit t.index = 0 zu zählen,
|
/* t.fighter->person[].hp beginnt mit t.index = 0 zu zählen,
|
||||||
|
@ -1739,7 +1739,7 @@ int sp_undeadhero(struct castorder * co)
|
||||||
|
|
||||||
if (j > 0) {
|
if (j > 0) {
|
||||||
unit *u =
|
unit *u =
|
||||||
create_unit(r, mage->faction, 0, new_race[RC_UNDEAD], 0, du->name,
|
create_unit(r, mage->faction, 0, get_race(RC_UNDEAD), 0, du->name,
|
||||||
du);
|
du);
|
||||||
|
|
||||||
/* new units gets some stats from old unit */
|
/* new units gets some stats from old unit */
|
||||||
|
|
|
@ -881,7 +881,7 @@ static int sp_summonent(castorder * co)
|
||||||
|
|
||||||
ents = (int)_min(power * power, rtrees(r, 2));
|
ents = (int)_min(power * power, rtrees(r, 2));
|
||||||
|
|
||||||
u = create_unit(r, mage->faction, ents, new_race[RC_TREEMAN], 0, NULL, mage);
|
u = create_unit(r, mage->faction, ents, get_race(RC_TREEMAN), 0, NULL, mage);
|
||||||
|
|
||||||
a = a_new(&at_unitdissolve);
|
a = a_new(&at_unitdissolve);
|
||||||
a->data.ca[0] = 2; /* An r->trees. */
|
a->data.ca[0] = 2; /* An r->trees. */
|
||||||
|
@ -1182,7 +1182,7 @@ static void fumble_ents(const castorder * co)
|
||||||
}
|
}
|
||||||
|
|
||||||
ents = (int)(force * 10);
|
ents = (int)(force * 10);
|
||||||
u = create_unit(r, get_monsters(), ents, new_race[RC_TREEMAN], 0, NULL, NULL);
|
u = create_unit(r, get_monsters(), ents, get_race(RC_TREEMAN), 0, NULL, NULL);
|
||||||
|
|
||||||
if (u) {
|
if (u) {
|
||||||
message *unseen;
|
message *unseen;
|
||||||
|
@ -1634,7 +1634,7 @@ static int sp_great_drought(castorder * co)
|
||||||
rsetterrain(r, T_OCEAN);
|
rsetterrain(r, T_OCEAN);
|
||||||
/* Einheiten duerfen hier auf keinen Fall geloescht werden! */
|
/* Einheiten duerfen hier auf keinen Fall geloescht werden! */
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
if (u_race(u) != new_race[RC_SPELL] && u->ship == 0) {
|
if (u_race(u) != get_race(RC_SPELL) && u->ship == 0) {
|
||||||
set_number(u, 0);
|
set_number(u, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2131,7 +2131,7 @@ static int sp_ironkeeper(castorder * co)
|
||||||
}
|
}
|
||||||
|
|
||||||
keeper =
|
keeper =
|
||||||
create_unit(r, mage->faction, 1, new_race[RC_IRONKEEPER], 0, NULL, mage);
|
create_unit(r, mage->faction, 1, get_race(RC_IRONKEEPER), 0, NULL, mage);
|
||||||
|
|
||||||
/*keeper->age = cast_level + 2; */
|
/*keeper->age = cast_level + 2; */
|
||||||
setstatus(keeper, ST_AVOID); /* kaempft nicht */
|
setstatus(keeper, ST_AVOID); /* kaempft nicht */
|
||||||
|
@ -2322,7 +2322,7 @@ void patzer_peasantmob(const castorder * co)
|
||||||
assert(rpeasants(r) >= 0);
|
assert(rpeasants(r) >= 0);
|
||||||
|
|
||||||
u =
|
u =
|
||||||
create_unit(r, f, n, new_race[RC_PEASANT], 0, LOC(f->locale, "angry_mob"),
|
create_unit(r, f, n, get_race(RC_PEASANT), 0, LOC(f->locale, "angry_mob"),
|
||||||
NULL);
|
NULL);
|
||||||
fset(u, UFL_ISNEW);
|
fset(u, UFL_ISNEW);
|
||||||
/* guard(u, GUARD_ALL); hier zu frueh! Befehl BEWACHE setzten */
|
/* guard(u, GUARD_ALL); hier zu frueh! Befehl BEWACHE setzten */
|
||||||
|
@ -2548,23 +2548,23 @@ static int sp_summondragon(castorder * co)
|
||||||
|
|
||||||
for (time = 1; time < 7; time++) {
|
for (time = 1; time < 7; time++) {
|
||||||
if (rng_int() % 100 < 25) {
|
if (rng_int() % 100 < 25) {
|
||||||
switch (rng_int() % 3) {
|
switch (rng_int() % 3) {
|
||||||
case 0:
|
case 0:
|
||||||
race = new_race[RC_WYRM];
|
race = get_race(RC_WYRM);
|
||||||
number = 1;
|
number = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
race = new_race[RC_DRAGON];
|
race = get_race(RC_DRAGON);
|
||||||
number = 2;
|
number = 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
default:
|
default:
|
||||||
race = new_race[RC_FIREDRAGON];
|
race = get_race(RC_FIREDRAGON);
|
||||||
number = 6;
|
number = 6;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
trigger *tsummon = trigger_createunit(r, f, race, number);
|
trigger *tsummon = trigger_createunit(r, f, race, number);
|
||||||
add_trigger(&r->attribs, "timer", trigger_timeout(time, tsummon));
|
add_trigger(&r->attribs, "timer", trigger_timeout(time, tsummon));
|
||||||
|
@ -2577,7 +2577,7 @@ static int sp_summondragon(castorder * co)
|
||||||
for (rl2 = rl; rl2; rl2 = rl2->next) {
|
for (rl2 = rl; rl2; rl2 = rl2->next) {
|
||||||
region *r2 = rl2->data;
|
region *r2 = rl2->data;
|
||||||
for (u = r2->units; u; u = u->next) {
|
for (u = r2->units; u; u = u->next) {
|
||||||
if (u_race(u) == new_race[RC_WYRM] || u_race(u) == new_race[RC_DRAGON]) {
|
if (u_race(u) == get_race(RC_WYRM) || u_race(u) == get_race(RC_DRAGON)) {
|
||||||
attrib *a = a_find(u->attribs, &at_targetregion);
|
attrib *a = a_find(u->attribs, &at_targetregion);
|
||||||
if (!a) {
|
if (!a) {
|
||||||
a = a_add(&u->attribs, make_targetregion(r));
|
a = a_add(&u->attribs, make_targetregion(r));
|
||||||
|
@ -2689,13 +2689,13 @@ static int sp_unholypower(castorder * co)
|
||||||
|
|
||||||
switch (old_race(u_race(u))) {
|
switch (old_race(u_race(u))) {
|
||||||
case RC_SKELETON:
|
case RC_SKELETON:
|
||||||
target_race = new_race[RC_SKELETON_LORD];
|
target_race = get_race(RC_SKELETON_LORD);
|
||||||
break;
|
break;
|
||||||
case RC_ZOMBIE:
|
case RC_ZOMBIE:
|
||||||
target_race = new_race[RC_ZOMBIE_LORD];
|
target_race = get_race(RC_ZOMBIE_LORD);
|
||||||
break;
|
break;
|
||||||
case RC_GHOUL:
|
case RC_GHOUL:
|
||||||
target_race = new_race[RC_GHOUL_LORD];
|
target_race = get_race(RC_GHOUL_LORD);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cmistake(mage, co->order, 284, MSG_MAGIC);
|
cmistake(mage, co->order, 284, MSG_MAGIC);
|
||||||
|
@ -2963,7 +2963,7 @@ static int sp_summonshadow(castorder * co)
|
||||||
unit *u;
|
unit *u;
|
||||||
int val, number = (int)(force * force);
|
int val, number = (int)(force * force);
|
||||||
|
|
||||||
u = create_unit(r, mage->faction, number, new_race[RC_SHADOW], 0, NULL, mage);
|
u = create_unit(r, mage->faction, number, get_race(RC_SHADOW), 0, NULL, mage);
|
||||||
|
|
||||||
/* Bekommen Tarnung = (Magie+Tarnung)/2 und Wahrnehmung 1. */
|
/* Bekommen Tarnung = (Magie+Tarnung)/2 und Wahrnehmung 1. */
|
||||||
val = get_level(mage, SK_MAGIC) + get_level(mage, SK_STEALTH);
|
val = get_level(mage, SK_MAGIC) + get_level(mage, SK_STEALTH);
|
||||||
|
@ -3004,7 +3004,7 @@ static int sp_summonshadowlords(castorder * co)
|
||||||
int amount = (int)(force * force);
|
int amount = (int)(force * force);
|
||||||
|
|
||||||
u =
|
u =
|
||||||
create_unit(r, mage->faction, amount, new_race[RC_SHADOWLORD], 0, NULL,
|
create_unit(r, mage->faction, amount, get_race(RC_SHADOWLORD), 0, NULL,
|
||||||
mage);
|
mage);
|
||||||
|
|
||||||
/* Bekommen Tarnung = Magie und Wahrnehmung 5. */
|
/* Bekommen Tarnung = Magie und Wahrnehmung 5. */
|
||||||
|
@ -3257,7 +3257,7 @@ static int sp_summonundead(castorder * co)
|
||||||
unit *mage = co->magician.u;
|
unit *mage = co->magician.u;
|
||||||
int cast_level = co->level;
|
int cast_level = co->level;
|
||||||
int force = (int)(co->force * 10);
|
int force = (int)(co->force * 10);
|
||||||
const race *race = new_race[RC_SKELETON];
|
const race *race = get_race(RC_SKELETON);
|
||||||
|
|
||||||
if (!r->land || deathcount(r) == 0) {
|
if (!r->land || deathcount(r) == 0) {
|
||||||
ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "error_nograves",
|
ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "error_nograves",
|
||||||
|
@ -3268,11 +3268,11 @@ static int sp_summonundead(castorder * co)
|
||||||
undead = _min(deathcount(r), 2 + lovar(force));
|
undead = _min(deathcount(r), 2 + lovar(force));
|
||||||
|
|
||||||
if (cast_level <= 8) {
|
if (cast_level <= 8) {
|
||||||
race = new_race[RC_SKELETON];
|
race = get_race(RC_SKELETON);
|
||||||
} else if (cast_level <= 12) {
|
} else if (cast_level <= 12) {
|
||||||
race = new_race[RC_ZOMBIE];
|
race = get_race(RC_ZOMBIE);
|
||||||
} else {
|
} else {
|
||||||
race = new_race[RC_GHOUL];
|
race = get_race(RC_GHOUL);
|
||||||
}
|
}
|
||||||
|
|
||||||
u = create_unit(r, mage->faction, undead, race, 0, NULL, mage);
|
u = create_unit(r, mage->faction, undead, race, 0, NULL, mage);
|
||||||
|
@ -3641,7 +3641,7 @@ static int sp_rallypeasantmob(castorder * co)
|
||||||
|
|
||||||
for (u = r->units; u; u = un) {
|
for (u = r->units; u; u = un) {
|
||||||
un = u->next;
|
un = u->next;
|
||||||
if (is_monsters(u->faction) && u_race(u) == new_race[RC_PEASANT]) {
|
if (is_monsters(u->faction) && u_race(u) == get_race(RC_PEASANT)) {
|
||||||
rsetpeasants(r, rpeasants(r) + u->number);
|
rsetpeasants(r, rpeasants(r) + u->number);
|
||||||
rsetmoney(r, rmoney(r) + get_money(u));
|
rsetmoney(r, rmoney(r) + get_money(u));
|
||||||
set_money(u, 0);
|
set_money(u, 0);
|
||||||
|
@ -3709,7 +3709,7 @@ static int sp_raisepeasantmob(castorder * co)
|
||||||
assert(rpeasants(r) >= 0);
|
assert(rpeasants(r) >= 0);
|
||||||
|
|
||||||
u =
|
u =
|
||||||
create_unit(r, monsters, n, new_race[RC_PEASANT], 0, LOC(monsters->locale,
|
create_unit(r, monsters, n, get_race(RC_PEASANT), 0, LOC(monsters->locale,
|
||||||
"furious_mob"), NULL);
|
"furious_mob"), NULL);
|
||||||
fset(u, UFL_ISNEW);
|
fset(u, UFL_ISNEW);
|
||||||
guard(u, GUARD_ALL);
|
guard(u, GUARD_ALL);
|
||||||
|
@ -3984,7 +3984,7 @@ static int sp_bigrecruit(castorder * co)
|
||||||
* Rekrutierungskosten mit einfliessen lassen. */
|
* Rekrutierungskosten mit einfliessen lassen. */
|
||||||
|
|
||||||
n = (int)force + lovar((force * force * 1000) / f->race->recruitcost);
|
n = (int)force + lovar((force * force * 1000) / f->race->recruitcost);
|
||||||
if (f->race == new_race[RC_ORC]) {
|
if (f->race == get_race(RC_ORC)) {
|
||||||
n = _min(2 * maxp, n);
|
n = _min(2 * maxp, n);
|
||||||
n = _max(n, 1);
|
n = _max(n, 1);
|
||||||
rsetpeasants(r, maxp - (n + 1) / 2);
|
rsetpeasants(r, maxp - (n + 1) / 2);
|
||||||
|
@ -4062,7 +4062,7 @@ static int sp_pump(castorder * co)
|
||||||
}
|
}
|
||||||
|
|
||||||
u =
|
u =
|
||||||
create_unit(rt, mage->faction, RS_FARVISION, new_race[RC_SPELL], 0,
|
create_unit(rt, mage->faction, RS_FARVISION, get_race(RC_SPELL), 0,
|
||||||
"spell/pump", NULL);
|
"spell/pump", NULL);
|
||||||
u->age = 2;
|
u->age = 2;
|
||||||
set_level(u, SK_PERCEPTION, eff_skill(target, SK_PERCEPTION, u->region));
|
set_level(u, SK_PERCEPTION, eff_skill(target, SK_PERCEPTION, u->region));
|
||||||
|
@ -4288,7 +4288,7 @@ static int sp_raisepeasants(castorder * co)
|
||||||
rsetpeasants(r, rpeasants(r) - bauern);
|
rsetpeasants(r, rpeasants(r) - bauern);
|
||||||
|
|
||||||
u2 =
|
u2 =
|
||||||
create_unit(r, mage->faction, bauern, new_race[RC_PEASANT], 0,
|
create_unit(r, mage->faction, bauern, get_race(RC_PEASANT), 0,
|
||||||
LOC(mage->faction->locale, "furious_mob"), mage);
|
LOC(mage->faction->locale, "furious_mob"), mage);
|
||||||
|
|
||||||
fset(u2, UFL_LOCKED);
|
fset(u2, UFL_LOCKED);
|
||||||
|
@ -4672,7 +4672,7 @@ int sp_clonecopy(castorder * co)
|
||||||
_snprintf(name, sizeof(name), (const char *)LOC(mage->faction->locale,
|
_snprintf(name, sizeof(name), (const char *)LOC(mage->faction->locale,
|
||||||
"clone_of"), unitname(mage));
|
"clone_of"), unitname(mage));
|
||||||
clone =
|
clone =
|
||||||
create_unit(target_region, mage->faction, 1, new_race[RC_CLONE], 0, name,
|
create_unit(target_region, mage->faction, 1, get_race(RC_CLONE), 0, name,
|
||||||
mage);
|
mage);
|
||||||
setstatus(clone, ST_FLEE);
|
setstatus(clone, ST_FLEE);
|
||||||
fset(clone, UFL_LOCKED);
|
fset(clone, UFL_LOCKED);
|
||||||
|
@ -4723,7 +4723,7 @@ int sp_dreamreading(castorder * co)
|
||||||
}
|
}
|
||||||
|
|
||||||
u2 =
|
u2 =
|
||||||
create_unit(u->region, mage->faction, RS_FARVISION, new_race[RC_SPELL], 0,
|
create_unit(u->region, mage->faction, RS_FARVISION, get_race(RC_SPELL), 0,
|
||||||
"spell/dreamreading", NULL);
|
"spell/dreamreading", NULL);
|
||||||
set_number(u2, 1);
|
set_number(u2, 1);
|
||||||
u2->age = 2; /* Nur fuer diese Runde. */
|
u2->age = 2; /* Nur fuer diese Runde. */
|
||||||
|
@ -5518,7 +5518,7 @@ int sp_showastral(castorder * co)
|
||||||
region *r2 = rl2->data;
|
region *r2 = rl2->data;
|
||||||
if (!is_cursed(r2->attribs, C_ASTRALBLOCK, 0)) {
|
if (!is_cursed(r2->attribs, C_ASTRALBLOCK, 0)) {
|
||||||
for (u = r2->units; u; u = u->next) {
|
for (u = r2->units; u; u = u->next) {
|
||||||
if (u_race(u) != new_race[RC_SPECIAL] && u_race(u) != new_race[RC_SPELL])
|
if (u_race(u) != get_race(RC_SPECIAL) && u_race(u) != get_race(RC_SPELL))
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5538,7 +5538,7 @@ int sp_showastral(castorder * co)
|
||||||
for (rl2 = rl; rl2; rl2 = rl2->next) {
|
for (rl2 = rl; rl2; rl2 = rl2->next) {
|
||||||
if (!is_cursed(rl2->data->attribs, C_ASTRALBLOCK, 0)) {
|
if (!is_cursed(rl2->data->attribs, C_ASTRALBLOCK, 0)) {
|
||||||
for (u = rl2->data->units; u; u = u->next) {
|
for (u = rl2->data->units; u; u = u->next) {
|
||||||
if (u_race(u) != new_race[RC_SPECIAL] && u_race(u) != new_race[RC_SPELL]) {
|
if (u_race(u) != get_race(RC_SPECIAL) && u_race(u) != get_race(RC_SPELL)) {
|
||||||
c++;
|
c++;
|
||||||
scat(unitname(u));
|
scat(unitname(u));
|
||||||
scat(" (");
|
scat(" (");
|
||||||
|
@ -5596,7 +5596,7 @@ int sp_viewreality(castorder * co)
|
||||||
region *rt = rl2->data;
|
region *rt = rl2->data;
|
||||||
if (!is_cursed(rt->attribs, C_ASTRALBLOCK, 0)) {
|
if (!is_cursed(rt->attribs, C_ASTRALBLOCK, 0)) {
|
||||||
u =
|
u =
|
||||||
create_unit(rt, mage->faction, RS_FARVISION, new_race[RC_SPELL], 0,
|
create_unit(rt, mage->faction, RS_FARVISION, get_race(RC_SPELL), 0,
|
||||||
"spell/viewreality", NULL);
|
"spell/viewreality", NULL);
|
||||||
set_level(u, SK_PERCEPTION, co->level / 2);
|
set_level(u, SK_PERCEPTION, co->level / 2);
|
||||||
u->age = 2;
|
u->age = 2;
|
||||||
|
@ -5678,7 +5678,7 @@ int sp_disruptastral(castorder * co)
|
||||||
|
|
||||||
if (trl != NULL) {
|
if (trl != NULL) {
|
||||||
for (u = r2->units; u; u = u->next) {
|
for (u = r2->units; u; u = u->next) {
|
||||||
if (u_race(u) != new_race[RC_SPELL]) {
|
if (u_race(u) != get_race(RC_SPELL)) {
|
||||||
region_list *trl2 = trl;
|
region_list *trl2 = trl;
|
||||||
region *tr;
|
region *tr;
|
||||||
int c = rng_int() % inhab_regions;
|
int c = rng_int() % inhab_regions;
|
||||||
|
|
14
src/spy.c
14
src/spy.c
|
@ -238,16 +238,16 @@ int setstealth_cmd(unit * u, struct order *ord)
|
||||||
trace = findrace(s, u->faction->locale);
|
trace = findrace(s, u->faction->locale);
|
||||||
if (trace) {
|
if (trace) {
|
||||||
/* demons can cloak as other player-races */
|
/* demons can cloak as other player-races */
|
||||||
if (u_race(u) == new_race[RC_DAEMON]) {
|
if (u_race(u) == get_race(RC_DAEMON)) {
|
||||||
race_t allowed[] = { RC_DWARF, RC_ELF, RC_ORC, RC_GOBLIN, RC_HUMAN,
|
race_t allowed[] = { RC_DWARF, RC_ELF, RC_ORC, RC_GOBLIN, RC_HUMAN,
|
||||||
RC_TROLL, RC_DAEMON, RC_INSECT, RC_HALFLING, RC_CAT, RC_AQUARIAN,
|
RC_TROLL, RC_DAEMON, RC_INSECT, RC_HALFLING, RC_CAT, RC_AQUARIAN,
|
||||||
NORACE
|
NORACE
|
||||||
};
|
};
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; allowed[i] != NORACE; ++i)
|
for (i = 0; allowed[i] != NORACE; ++i)
|
||||||
if (new_race[allowed[i]] == trace)
|
if (get_race(allowed[i]) == trace)
|
||||||
break;
|
break;
|
||||||
if (new_race[allowed[i]] == trace) {
|
if (get_race(allowed[i]) == trace) {
|
||||||
u->irace = trace;
|
u->irace = trace;
|
||||||
if (u_race(u)->flags & RCF_SHAPESHIFTANY && get_racename(u->attribs))
|
if (u_race(u)->flags & RCF_SHAPESHIFTANY && get_racename(u->attribs))
|
||||||
set_racename(&u->attribs, NULL);
|
set_racename(&u->attribs, NULL);
|
||||||
|
@ -256,10 +256,10 @@ int setstealth_cmd(unit * u, struct order *ord)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Singdrachen koennen sich nur als Drachen tarnen */
|
/* Singdrachen koennen sich nur als Drachen tarnen */
|
||||||
if (u_race(u) == new_race[RC_SONGDRAGON]
|
if (u_race(u) == get_race(RC_SONGDRAGON)
|
||||||
|| u_race(u) == new_race[RC_BIRTHDAYDRAGON]) {
|
|| u_race(u) == get_race(RC_BIRTHDAYDRAGON)) {
|
||||||
if (trace == new_race[RC_SONGDRAGON] || trace == new_race[RC_FIREDRAGON]
|
if (trace == get_race(RC_SONGDRAGON) || trace == get_race(RC_FIREDRAGON)
|
||||||
|| trace == new_race[RC_DRAGON] || trace == new_race[RC_WYRM]) {
|
|| trace == get_race(RC_DRAGON) || trace == get_race(RC_WYRM)) {
|
||||||
u->irace = trace;
|
u->irace = trace;
|
||||||
if (u_race(u)->flags & RCF_SHAPESHIFTANY && get_racename(u->attribs))
|
if (u_race(u)->flags & RCF_SHAPESHIFTANY && get_racename(u->attribs))
|
||||||
set_racename(&u->attribs, NULL);
|
set_racename(&u->attribs, NULL);
|
||||||
|
|
|
@ -95,7 +95,7 @@ bool is_migrant(unit * u)
|
||||||
return false;
|
return false;
|
||||||
if (is_familiar(u))
|
if (is_familiar(u))
|
||||||
return false;
|
return false;
|
||||||
if (u_race(u) == new_race[RC_TOAD])
|
if (u_race(u) == get_race(RC_TOAD))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -104,7 +104,7 @@ bool is_migrant(unit * u)
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
bool magic_lowskill(unit * u)
|
bool magic_lowskill(unit * u)
|
||||||
{
|
{
|
||||||
return (u_race(u) == new_race[RC_TOAD]) ? true : false;
|
return (u_race(u) == get_race(RC_TOAD)) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
@ -574,7 +574,7 @@ int learn_cmd(unit * u, order * ord)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* snotlings koennen Talente nur bis T8 lernen */
|
/* snotlings koennen Talente nur bis T8 lernen */
|
||||||
if (u_race(u) == new_race[RC_SNOTLING]) {
|
if (u_race(u) == get_race(RC_SNOTLING)) {
|
||||||
if (get_level(u, sk) >= 8) {
|
if (get_level(u, sk) >= 8) {
|
||||||
cmistake(u, ord, 308, MSG_EVENT);
|
cmistake(u, ord, 308, MSG_EVENT);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -181,13 +181,14 @@ void report_summary(summary * s, summary * o, bool full)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAXRACES; i++) {
|
for (i = 0; i < MAXRACES; i++) {
|
||||||
const race *rc = new_race[i];
|
if (i != RC_TEMPLATE && i != RC_CLONE && s->factionrace[i]) {
|
||||||
if (s->factionrace[i] && rc && playerrace(rc)
|
const race *rc = get_race(i);
|
||||||
&& i != RC_TEMPLATE && i != RC_CLONE) {
|
if (rc && playerrace(rc)) {
|
||||||
fprintf(F, "%13s%s: %s\n", LOC(default_locale, rc_name(rc, 3)),
|
fprintf(F, "%13s%s: %s\n", LOC(default_locale, rc_name(rc, 3)),
|
||||||
LOC(default_locale, "stat_tribe_p"), pcomp(s->factionrace[i],
|
LOC(default_locale, "stat_tribe_p"), pcomp(s->factionrace[i],
|
||||||
o->factionrace[i]));
|
o->factionrace[i]));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (full) {
|
if (full) {
|
||||||
|
@ -211,22 +212,23 @@ void report_summary(summary * s, summary * o, bool full)
|
||||||
fprintf(F, "\n");
|
fprintf(F, "\n");
|
||||||
if (full) {
|
if (full) {
|
||||||
for (i = 0; i < MAXRACES; i++) {
|
for (i = 0; i < MAXRACES; i++) {
|
||||||
const race *rc = new_race[i];
|
|
||||||
if (s->poprace[i]) {
|
if (s->poprace[i]) {
|
||||||
fprintf(F, "%20s: %s\n", LOC(default_locale, rc_name(rc, 1)),
|
const race *rc = get_race(i);
|
||||||
|
fprintf(F, "%20s: %s\n", LOC(default_locale, rc_name(rc, 1)),
|
||||||
rcomp(s->poprace[i], o->poprace[i]));
|
rcomp(s->poprace[i], o->poprace[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < MAXRACES; i++) {
|
for (i = 0; i < MAXRACES; i++) {
|
||||||
const race *rc = new_race[i];
|
if (i != RC_TEMPLATE && i != RC_CLONE && s->poprace[i]) {
|
||||||
if (s->poprace[i] && playerrace(rc)
|
const race *rc = get_race(i);
|
||||||
&& i != RC_TEMPLATE && i != RC_CLONE) {
|
if (playerrace(rc)) {
|
||||||
fprintf(F, "%20s: %s\n", LOC(default_locale, rc_name(rc, 1)),
|
fprintf(F, "%20s: %s\n", LOC(default_locale, rc_name(rc, 1)),
|
||||||
rcomp(s->poprace[i], o->poprace[i]));
|
rcomp(s->poprace[i], o->poprace[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (full) {
|
if (full) {
|
||||||
fprintf(F, "\nWaffen: %s\n", pcomp(s->waffen, o->waffen));
|
fprintf(F, "\nWaffen: %s\n", pcomp(s->waffen, o->waffen));
|
||||||
|
|
Loading…
Reference in a new issue