refactoring ship speed, extract total skills of sailors into a function.

This commit is contained in:
Enno Rehling 2015-04-17 16:31:52 +02:00
parent eb1d3e4664
commit afbc4c816b
5 changed files with 48 additions and 50 deletions

View File

@ -5854,11 +5854,10 @@
das 50fache und auch im Kampf werden sich die das 50fache und auch im Kampf werden sich die
erhöhte Kraft und die trollisch zähe Haut erhöhte Kraft und die trollisch zähe Haut
positiv auswirken.</text> positiv auswirken.</text>
<text locale="en">This artifact gives the one wearing it <text locale="en">This artifact gives the wearer
the strength of a cavetroll. He will be able to the strength of a cavetroll. He will be able to
carry fifty times as much as normal and also in carry fifty times his normal load, as well as
combat his enhanced strength and tough troll gain strength and tough troll skin in combat.</text>
skin will serve him well.</text>
</string> </string>
<string name="auraleak"> <string name="auraleak">
<text locale="de">Der Schwarzmagier kann mit diesem <text locale="de">Der Schwarzmagier kann mit diesem

View File

@ -348,10 +348,6 @@ int shipspeed(const ship * sh, const unit * u)
c = c->nexthash; c = c->nexthash;
} }
#ifdef SHIPSPEED
k *= SHIPSPEED;
#endif
if (sh->damage>0) { if (sh->damage>0) {
int size = sh->size * DAMAGE_SCALE; int size = sh->size * DAMAGE_SCALE;
k *= (size - sh->damage); k *= (size - sh->damage);

View File

@ -1807,7 +1807,7 @@ void scale_number(unit * u, int n)
const struct race *u_irace(const struct unit *u) const struct race *u_irace(const struct unit *u)
{ {
if (u->irace && skill_enabled(SK_STEALTH)) { if (u->irace) {
return u->irace; return u->irace;
} }
return u->_race; return u->_race;

View File

@ -4582,7 +4582,7 @@ int sp_illusionary_shapeshift(castorder * co)
irace = u_irace(u); irace = u_irace(u);
if (irace == u_race(u)) { if (irace == u_race(u)) {
trigger *trestore = trigger_changerace(u, NULL, irace); trigger *trestore = trigger_changerace(u, NULL, irace);
add_trigger(&u->attribs, "timer", trigger_timeout((int)power + 2, add_trigger(&u->attribs, "timer", trigger_timeout((int)power + 3,
trestore)); trestore));
u->irace = rc; u->irace = rc;
} }

View File

@ -214,7 +214,6 @@ int setstealth_cmd(unit * u, struct order *ord)
char token[64]; char token[64];
const char *s; const char *s;
int level, rule; int level, rule;
const race *trace;
init_order(ord); init_order(ord);
s = gettoken(token, sizeof(token)); s = gettoken(token, sizeof(token));
@ -237,6 +236,9 @@ int setstealth_cmd(unit * u, struct order *ord)
return 0; return 0;
} }
if (skill_enabled(SK_STEALTH)) { /* hack! E3 erlaubt keine Tarnung */
const race *trace;
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 */
@ -279,6 +281,7 @@ int setstealth_cmd(unit * u, struct order *ord)
} }
return 0; return 0;
} }
}
switch (findparam(s, u->faction->locale)) { switch (findparam(s, u->faction->locale)) {
case P_FACTION: case P_FACTION: