forked from github/server
new_race ist schneller als old_race
This commit is contained in:
parent
20bf8c2052
commit
d8b7f5a32d
|
@ -513,7 +513,7 @@ build_road(region * r, unit * u, int size, direction_t d)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!get_pooled(u, r, R_STONE) && old_race(u->race) != RC_STONEGOLEM) {
|
if (!get_pooled(u, r, R_STONE) && u->race != new_race[RC_STONEGOLEM]) {
|
||||||
cmistake(u, u->thisorder, 151, MSG_PRODUCE);
|
cmistake(u, u->thisorder, 151, MSG_PRODUCE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -545,7 +545,7 @@ build_road(region * r, unit * u, int size, direction_t d)
|
||||||
} /* Auswirkung Schaffenstrunk */
|
} /* Auswirkung Schaffenstrunk */
|
||||||
|
|
||||||
/* und anhand der rohstoffe */
|
/* und anhand der rohstoffe */
|
||||||
if (old_race(u->race) == RC_STONEGOLEM){
|
if (u->race == new_race[RC_STONEGOLEM]){
|
||||||
n = min(n, u->number * GOLEM_STONE);
|
n = min(n, u->number * GOLEM_STONE);
|
||||||
} else {
|
} else {
|
||||||
n = use_pooled(u, r, R_STONE, n);
|
n = use_pooled(u, r, R_STONE, n);
|
||||||
|
@ -556,7 +556,7 @@ build_road(region * r, unit * u, int size, direction_t d)
|
||||||
* maximum. */
|
* maximum. */
|
||||||
rsetroad(r, d, rroad(r, d) + min(n, left));
|
rsetroad(r, d, rroad(r, d) + min(n, left));
|
||||||
|
|
||||||
if (old_race(u->race) == RC_STONEGOLEM){
|
if (u->race == new_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;
|
||||||
|
|
|
@ -1548,7 +1548,7 @@ sp_reanimate(fighter * fi, int level, double power, spell * sp)
|
||||||
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
|
||||||
&& old_race(tf->unit->race) != RC_DAEMON
|
&& tf->unit->race != new_race[RC_DAEMON]
|
||||||
&& (chance(c)))
|
&& (chance(c)))
|
||||||
{
|
{
|
||||||
assert(tf->alive < tf->unit->number);
|
assert(tf->alive < tf->unit->number);
|
||||||
|
|
|
@ -524,7 +524,7 @@ max_skill(faction * f, skill_t sk)
|
||||||
} else {
|
} else {
|
||||||
m = MAXMAGICIANS;
|
m = MAXMAGICIANS;
|
||||||
}
|
}
|
||||||
if (old_race(f->race) == RC_ELF) m += 1;
|
if (f->race == new_race[RC_ELF]) m += 1;
|
||||||
m += fspecial(f, FS_MAGOCRACY) * 2;
|
m += fspecial(f, FS_MAGOCRACY) * 2;
|
||||||
break;
|
break;
|
||||||
case SK_ALCHEMY:
|
case SK_ALCHEMY:
|
||||||
|
@ -594,8 +594,8 @@ shipspeed (const ship * sh, const unit * u)
|
||||||
if( curse_active(get_curse(sh->attribs, nodrift_ct)))
|
if( curse_active(get_curse(sh->attribs, nodrift_ct)))
|
||||||
k += 1;
|
k += 1;
|
||||||
|
|
||||||
if (old_race(u->faction->race) == RC_AQUARIAN
|
if (u->faction->race == new_race[RC_AQUARIAN]
|
||||||
&& old_race(u->race) == RC_AQUARIAN) {
|
&& u->race == new_race[RC_AQUARIAN]) {
|
||||||
k += 1;
|
k += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -737,7 +737,7 @@ 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 && old_race(f->race) != RC_ELF) || mage > 4))
|
if (f->no != 0 && ((mage > 3 && f->race != new_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));
|
||||||
|
@ -1242,7 +1242,7 @@ int
|
||||||
count_maxmigrants(const faction * f)
|
count_maxmigrants(const faction * f)
|
||||||
{
|
{
|
||||||
int x = 0;
|
int x = 0;
|
||||||
if (old_race(f->race) == RC_HUMAN) {
|
if (f->race == new_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);
|
||||||
|
@ -2705,7 +2705,7 @@ lifestyle(const unit * u)
|
||||||
need += 1;
|
need += 1;
|
||||||
if(fspecial(u->faction, FS_ADMINISTRATOR))
|
if(fspecial(u->faction, FS_ADMINISTRATOR))
|
||||||
need += 1;
|
need += 1;
|
||||||
if(fspecial(u->faction, FS_WYRM) && old_race(u->race) == RC_WYRM)
|
if(fspecial(u->faction, FS_WYRM) && u->race == new_race[RC_WYRM])
|
||||||
need *= 500;
|
need *= 500;
|
||||||
|
|
||||||
return need;
|
return need;
|
||||||
|
@ -2719,7 +2719,7 @@ hunger(int number, unit * u)
|
||||||
int hp = u->hp / u->number;
|
int hp = u->hp / u->number;
|
||||||
|
|
||||||
while (number--) {
|
while (number--) {
|
||||||
int dam = old_race(u->race)==RC_HALFLING?15+rand()%14:(13+rand()%12);
|
int dam = u->race==new_race[RC_HALFLING]?15+rand()%14:(13+rand()%12);
|
||||||
if (dam >= hp) {
|
if (dam >= hp) {
|
||||||
++dead;
|
++dead;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2886,7 +2886,7 @@ fwage(const region *r, const faction *f, boolean img)
|
||||||
if (b) esize = buildingeffsize(b, img);
|
if (b) esize = buildingeffsize(b, img);
|
||||||
|
|
||||||
if (f) {
|
if (f) {
|
||||||
wage = wagetable[esize][old_race(f->race) == RC_ORC];
|
wage = wagetable[esize][f->race == new_race[RC_ORC]];
|
||||||
if (fspecial(f, FS_URBAN)) {
|
if (fspecial(f, FS_URBAN)) {
|
||||||
wage += wagetable[esize][3];
|
wage += wagetable[esize][3];
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ addplayer(region *r, faction * f)
|
||||||
u = createunit(r, f, 1, f->race);
|
u = createunit(r, f, 1, f->race);
|
||||||
give_starting_equipment(r, u);
|
give_starting_equipment(r, u);
|
||||||
fset(u, UFL_ISNEW);
|
fset(u, UFL_ISNEW);
|
||||||
if (old_race(f->race) == RC_DAEMON) {
|
if (f->race == new_race[RC_DAEMON]) {
|
||||||
race_t urc;
|
race_t urc;
|
||||||
do
|
do
|
||||||
urc = (race_t)(rand() % MAXRACES);
|
urc = (race_t)(rand() % MAXRACES);
|
||||||
|
|
|
@ -117,12 +117,12 @@ int
|
||||||
res_changeitem(unit * u, const resource_type * rtype, int delta)
|
res_changeitem(unit * u, const resource_type * rtype, int delta)
|
||||||
{
|
{
|
||||||
int num;
|
int num;
|
||||||
if (rtype == oldresourcetype[R_STONE] && old_race(u->race)==RC_STONEGOLEM && delta<=0) {
|
if (rtype == oldresourcetype[R_STONE] && u->race==new_race[RC_STONEGOLEM] && delta<=0) {
|
||||||
int reduce = delta / GOLEM_STONE;
|
int reduce = delta / GOLEM_STONE;
|
||||||
if (delta % GOLEM_STONE != 0) --reduce;
|
if (delta % GOLEM_STONE != 0) --reduce;
|
||||||
scale_number(u, u->number+reduce);
|
scale_number(u, u->number+reduce);
|
||||||
num = u->number;
|
num = u->number;
|
||||||
} else if (rtype == oldresourcetype[R_IRON] && old_race(u->race) == RC_IRONGOLEM && delta<=0) {
|
} else if (rtype == oldresourcetype[R_IRON] && u->race==new_race[RC_IRONGOLEM] && delta<=0) {
|
||||||
int reduce = delta / GOLEM_IRON;
|
int reduce = delta / GOLEM_IRON;
|
||||||
if (delta % GOLEM_IRON != 0) --reduce;
|
if (delta % GOLEM_IRON != 0) --reduce;
|
||||||
scale_number(u, u->number+reduce);
|
scale_number(u, u->number+reduce);
|
||||||
|
|
|
@ -207,10 +207,10 @@ personcapacity(const unit *u)
|
||||||
#else
|
#else
|
||||||
int cap = u->race->weight+540;
|
int cap = u->race->weight+540;
|
||||||
|
|
||||||
if (old_race(u->race) == RC_TROLL)
|
if (u->race == new_race[RC_TROLL])
|
||||||
cap += 540;
|
cap += 540;
|
||||||
#if RACE_ADJUSTMENTS
|
#if RACE_ADJUSTMENTS
|
||||||
else if(old_race(u->race) == RC_GOBLIN)
|
else if (u->race == new_race[RC_GOBLIN])
|
||||||
cap -= 100;
|
cap -= 100;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -281,7 +281,7 @@ walkingcapacity(const struct unit * u)
|
||||||
|
|
||||||
n = wagen_mit_pferden * WAGONCAPACITY;
|
n = wagen_mit_pferden * WAGONCAPACITY;
|
||||||
|
|
||||||
if (old_race(u->race) == RC_TROLL) {
|
if (u->race == new_race[RC_TROLL]) {
|
||||||
/* 4 Trolle ziehen einen Wagen. */
|
/* 4 Trolle ziehen einen Wagen. */
|
||||||
/* Unbesetzte Wagen feststellen */
|
/* Unbesetzte Wagen feststellen */
|
||||||
wagen_ohne_pferde = wagen - wagen_mit_pferden;
|
wagen_ohne_pferde = wagen - wagen_mit_pferden;
|
||||||
|
@ -329,7 +329,7 @@ canwalk(unit * u)
|
||||||
pferde = get_item(u, I_HORSE);
|
pferde = get_item(u, I_HORSE);
|
||||||
|
|
||||||
maxwagen = effskill(u, SK_RIDING) * u->number * 2;
|
maxwagen = effskill(u, SK_RIDING) * u->number * 2;
|
||||||
if (old_race(u->race) == RC_TROLL) {
|
if (u->race == new_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 @@ check_working_buildingtype(const region * r, const building_type * bt)
|
||||||
static boolean
|
static boolean
|
||||||
is_freezing(const unit * u)
|
is_freezing(const unit * u)
|
||||||
{
|
{
|
||||||
if (old_race(u->race)!=RC_INSECT) return false;
|
if (u->race!=new_race[RC_INSECT]) return false;
|
||||||
if (is_cursed(u->attribs, C_KAELTESCHUTZ, 0)) return false;
|
if (is_cursed(u->attribs, C_KAELTESCHUTZ, 0)) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1287,7 +1287,7 @@ travel_route(unit * u, region_list * route_begin, region_list * route_end, order
|
||||||
}
|
}
|
||||||
|
|
||||||
/* unit is an insect and cannot move into a glacier */
|
/* unit is an insect and cannot move into a glacier */
|
||||||
if (old_race(u->race)==RC_INSECT) {
|
if (u->race==new_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));
|
||||||
|
|
|
@ -471,7 +471,7 @@ unitorders(FILE * F, struct faction * f)
|
||||||
i = getid();
|
i = getid();
|
||||||
u = findunitg(i, NULL);
|
u = findunitg(i, NULL);
|
||||||
|
|
||||||
if (u && old_race(u->race) == RC_SPELL) return NULL;
|
if (u && u->race == new_race[RC_SPELL]) return NULL;
|
||||||
if (u && u->faction == f) {
|
if (u && u->faction == f) {
|
||||||
order ** ordp;
|
order ** ordp;
|
||||||
|
|
||||||
|
|
|
@ -1733,7 +1733,7 @@ sp_great_drought(castorder *co)
|
||||||
rsetterrain(r, T_OCEAN);
|
rsetterrain(r, T_OCEAN);
|
||||||
/* Einheiten dürfen hier auf keinen Fall gelöscht werden! */
|
/* Einheiten dürfen hier auf keinen Fall gelöscht werden! */
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
if (old_race(u->race) != RC_SPELL && u->ship == 0) {
|
if (u->race != new_race[RC_SPELL] && u->ship == 0) {
|
||||||
set_number(u, 0);
|
set_number(u, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -858,7 +858,7 @@ set_number(unit * u, int count)
|
||||||
assert (u->faction != 0 || u->number > 0);
|
assert (u->faction != 0 || u->number > 0);
|
||||||
#endif
|
#endif
|
||||||
if (u->faction && u->race != u->faction->race && playerrace(u->race)
|
if (u->faction && u->race != u->faction->race && playerrace(u->race)
|
||||||
&& old_race(u->race) != RC_SPELL && old_race(u->race) != RC_SPECIAL
|
&& u->race != new_race[RC_SPELL] && u->race != new_race[RC_SPECIAL]
|
||||||
&& !(is_cursed(u->attribs, C_SLAVE, 0)))
|
&& !(is_cursed(u->attribs, C_SLAVE, 0)))
|
||||||
{
|
{
|
||||||
u->faction->num_migrants += count - u->number;
|
u->faction->num_migrants += count - u->number;
|
||||||
|
|
Loading…
Reference in New Issue