forked from github/server
BEWACHE nach "langen" Kampf nicht möglich; Fehlermeldungen nach "langen" Kampf Noch ein Flag eingeführt. Hoffe, dass das klappt.
This commit is contained in:
parent
a14d57f32d
commit
3145295ad4
|
@ -3076,7 +3076,7 @@ produce(void)
|
||||||
!is_cursed(u->attribs, C_KAELTESCHUTZ,0))
|
!is_cursed(u->attribs, C_KAELTESCHUTZ,0))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (attacked(u) && u->thisorder==NULL) {
|
if (fval(u, UFL_LONGACTION) && u->thisorder==NULL) {
|
||||||
cmistake(u, u->thisorder, 52, MSG_PRODUCE);
|
cmistake(u, u->thisorder, 52, MSG_PRODUCE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2665,7 +2665,7 @@ instant_orders(void)
|
||||||
unit * u;
|
unit * u;
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
order * ord;
|
order * ord;
|
||||||
freset(u, UFL_MOVED);
|
freset(u, UFL_MOVED); /* reset, because it was saved in the datafile (monsters!) */
|
||||||
for (ord = u->orders; ord; ord = ord->next) {
|
for (ord = u->orders; ord; ord = ord->next) {
|
||||||
switch (get_keyword(ord)) {
|
switch (get_keyword(ord)) {
|
||||||
case K_QUIT:
|
case K_QUIT:
|
||||||
|
@ -2748,7 +2748,7 @@ guard_on_cmd(unit * u, struct order * ord)
|
||||||
} else {
|
} else {
|
||||||
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, RCF_ILLUSIONARY) || u->race == new_race[RC_SPELL]) {
|
} else if (fval(u->race, RCF_ILLUSIONARY) || u->race == new_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 */
|
||||||
|
|
|
@ -473,7 +473,7 @@ learn(void)
|
||||||
&& !is_cursed(u->attribs, C_KAELTESCHUTZ,0)) {
|
&& !is_cursed(u->attribs, C_KAELTESCHUTZ,0)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (attacked(u)) {
|
if (fval(u, UFL_LONGACTION)) {
|
||||||
cmistake(u, u->thisorder, 52, MSG_PRODUCE);
|
cmistake(u, u->thisorder, 52, MSG_PRODUCE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -769,7 +769,7 @@ teaching(void)
|
||||||
|
|
||||||
switch (get_keyword(u->thisorder)) {
|
switch (get_keyword(u->thisorder)) {
|
||||||
case K_TEACH:
|
case K_TEACH:
|
||||||
if (attacked(u)){
|
if (fval(u, UFL_LONGACTION)) {
|
||||||
cmistake(u, u->thisorder, 52, MSG_PRODUCE);
|
cmistake(u, u->thisorder, 52, MSG_PRODUCE);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2428,7 +2428,7 @@ aftermath(battle * b)
|
||||||
|
|
||||||
snumber += du->number;
|
snumber += du->number;
|
||||||
if (relevant) {
|
if (relevant) {
|
||||||
fset(du, UFL_MOVED); /* unit cannot move this round */
|
fset(du, UFL_NOTMOVING); /* unit cannot move this round */
|
||||||
if (df->action_counter >= du->number) {
|
if (df->action_counter >= du->number) {
|
||||||
ship * sh = du->ship?du->ship:leftship(du);
|
ship * sh = du->ship?du->ship:leftship(du);
|
||||||
if (sh) fset(sh, SF_DAMAGED);
|
if (sh) fset(sh, SF_DAMAGED);
|
||||||
|
|
|
@ -997,7 +997,6 @@ const char *strcheck(const char *s, size_t maxlen);
|
||||||
#define strcheck(s, ml) (s)
|
#define strcheck(s, ml) (s)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define attacked(u) (fval(u, UFL_LONGACTION))
|
|
||||||
boolean idle(struct faction * f);
|
boolean idle(struct faction * f);
|
||||||
boolean unit_has_cursed_item(struct unit *u);
|
boolean unit_has_cursed_item(struct unit *u);
|
||||||
|
|
||||||
|
|
|
@ -2470,11 +2470,7 @@ magic(void)
|
||||||
!is_cursed(u->attribs, C_KAELTESCHUTZ,0))
|
!is_cursed(u->attribs, C_KAELTESCHUTZ,0))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(fval(u, UFL_WERE)) {
|
if(fval(u, UFL_WERE|UFL_LONGACTION)) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attacked(u)) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2238,12 +2238,12 @@ hunt(unit *u)
|
||||||
cmistake(u, u->thisorder, 144, MSG_MOVE);
|
cmistake(u, u->thisorder, 144, MSG_MOVE);
|
||||||
fset(u, UFL_LONGACTION); /* FOLGE SCHIFF ist immer lang */
|
fset(u, UFL_LONGACTION); /* FOLGE SCHIFF ist immer lang */
|
||||||
return 0;
|
return 0;
|
||||||
} else if(!fval(u, UFL_OWNER)) {
|
} else if (!fval(u, UFL_OWNER)) {
|
||||||
cmistake(u, u->thisorder, 146, MSG_MOVE);
|
cmistake(u, u->thisorder, 146, MSG_MOVE);
|
||||||
fset(u, UFL_LONGACTION); /* FOLGE SCHIFF ist immer lang */
|
fset(u, UFL_LONGACTION); /* FOLGE SCHIFF ist immer lang */
|
||||||
return 0;
|
return 0;
|
||||||
} else if(attacked(u)) {
|
} else if (fval(u, UFL_NOTMOVING)) {
|
||||||
cmistake(u, u->thisorder, 52, MSG_MOVE);
|
cmistake(u, u->thisorder, 187, MSG_MOVE);
|
||||||
fset(u, UFL_LONGACTION); /* FOLGE SCHIFF ist immer lang */
|
fset(u, UFL_LONGACTION); /* FOLGE SCHIFF ist immer lang */
|
||||||
return 0;
|
return 0;
|
||||||
} else if (!can_move(u)) {
|
} else if (!can_move(u)) {
|
||||||
|
@ -2329,7 +2329,7 @@ move_hunters(void)
|
||||||
while (*up!=NULL) {
|
while (*up!=NULL) {
|
||||||
unit * u = *up;
|
unit * u = *up;
|
||||||
|
|
||||||
if (!fval(u, UFL_MOVED)) {
|
if (!fval(u, UFL_MOVED|UFL_NOTMOVING)) {
|
||||||
order * ord;
|
order * ord;
|
||||||
|
|
||||||
for (ord=u->orders;ord;ord=ord->next) {
|
for (ord=u->orders;ord;ord=ord->next) {
|
||||||
|
@ -2435,16 +2435,16 @@ movement(void)
|
||||||
case K_MOVE:
|
case K_MOVE:
|
||||||
/* after moving, the unit has no thisorder. this prevents
|
/* after moving, the unit has no thisorder. this prevents
|
||||||
* it from moving twice (or getting error messages twice).
|
* it from moving twice (or getting error messages twice).
|
||||||
* UFL_MOVED is set in combat if the unit is not allowed
|
* UFL_NOTMOVING is set in combat if the unit is not allowed
|
||||||
* to move because it was involved in a battle.
|
* to move because it was involved in a battle.
|
||||||
*/
|
*/
|
||||||
if (fval(u, UFL_LONGACTION) || fval(u, UFL_MOVED)) {
|
if (fval(u, UFL_LONGACTION|UFL_MOVED|UFL_NOTMOVING)) {
|
||||||
cmistake(u, u->thisorder, 52, MSG_MOVE);
|
cmistake(u, u->thisorder, 187, MSG_MOVE);
|
||||||
set_order(&u->thisorder, NULL);
|
set_order(&u->thisorder, NULL);
|
||||||
} else if (!can_move(u)) {
|
} else if (!can_move(u)) {
|
||||||
cmistake(u, u->thisorder, 55, MSG_MOVE);
|
cmistake(u, u->thisorder, 55, MSG_MOVE);
|
||||||
set_order(&u->thisorder, NULL);
|
set_order(&u->thisorder, NULL);
|
||||||
} else if (!fval(u, UFL_MOVED)) {
|
} else if (!fval(u, UFL_MOVED|UFL_NOTMOVING)) {
|
||||||
if (ships) {
|
if (ships) {
|
||||||
if (u->ship && fval(u, UFL_OWNER)) {
|
if (u->ship && fval(u, UFL_OWNER)) {
|
||||||
init_tokens(u->thisorder);
|
init_tokens(u->thisorder);
|
||||||
|
@ -2530,7 +2530,7 @@ follow_unit(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a && !fval(u, UFL_MOVED)) {
|
if (a && !fval(u, UFL_MOVED|UFL_NOTMOVING)) {
|
||||||
unit * u2 = a->data.v;
|
unit * u2 = a->data.v;
|
||||||
boolean follow = false;
|
boolean follow = false;
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,7 @@ struct item;
|
||||||
#define UFL_WARMTH (1<<6) /* 64 */
|
#define UFL_WARMTH (1<<6) /* 64 */
|
||||||
#define UFL_HERO (1<<7)
|
#define UFL_HERO (1<<7)
|
||||||
#define UFL_MOVED (1<<8)
|
#define UFL_MOVED (1<<8)
|
||||||
#define UFL_FOLLOWING (1<<9)
|
#define UFL_NOTMOVING (1<<9) /* Die Einheit kann sich wg. langen Kampfes nicht bewegen */
|
||||||
#define UFL_FOLLOWED (1<<10)
|
|
||||||
#define UFL_HUNGER (1<<11) /* kann im Folgemonat keinen langen Befehl außer ARBEITE ausführen */
|
#define UFL_HUNGER (1<<11) /* kann im Folgemonat keinen langen Befehl außer ARBEITE ausführen */
|
||||||
#define UFL_SIEGE (1<<12) /* speedup: belagert eine burg, siehe attribut */
|
#define UFL_SIEGE (1<<12) /* speedup: belagert eine burg, siehe attribut */
|
||||||
#define UFL_TARGET (1<<13) /* speedup: hat ein target, siehe attribut */
|
#define UFL_TARGET (1<<13) /* speedup: hat ein target, siehe attribut */
|
||||||
|
@ -50,8 +49,9 @@ struct item;
|
||||||
/* warning: von 512/1024 gewechslet, wegen konflikt mit NEW_FOLLOW */
|
/* warning: von 512/1024 gewechslet, wegen konflikt mit NEW_FOLLOW */
|
||||||
#define UFL_LOCKED (1<<16) /* Einheit kann keine Personen aufnehmen oder weggeben, nicht rekrutieren. */
|
#define UFL_LOCKED (1<<16) /* Einheit kann keine Personen aufnehmen oder weggeben, nicht rekrutieren. */
|
||||||
#define UFL_DH (1<<18) /* same as FL_DH */
|
#define UFL_DH (1<<18) /* same as FL_DH */
|
||||||
|
|
||||||
#define UFL_STORM (1<<19) /* Kapitän war in einem Sturm */
|
#define UFL_STORM (1<<19) /* Kapitän war in einem Sturm */
|
||||||
|
#define UFL_FOLLOWING (1<<20)
|
||||||
|
#define UFL_FOLLOWED (1<<21)
|
||||||
|
|
||||||
#define UFL_NOAID (1<<22) /* Einheit hat Noaid-Status */
|
#define UFL_NOAID (1<<22) /* Einheit hat Noaid-Status */
|
||||||
#define UFL_MARK (1<<23) /* same as FL_MARK */
|
#define UFL_MARK (1<<23) /* same as FL_MARK */
|
||||||
|
|
|
@ -97,7 +97,7 @@ write_summary()
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern int process_orders(void);
|
extern int process_orders(void);
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ lua_planmonsters(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
race_setscript(const char * rcname, const luabind::object& f)
|
race_setscript(const char * rcname, const luabind::object& f)
|
||||||
{
|
{
|
||||||
race * rc = rc_find(rcname);
|
race * rc = rc_find(rcname);
|
||||||
|
@ -175,17 +175,20 @@ race_setscript(const char * rcname, const luabind::object& f)
|
||||||
|
|
||||||
#define ISLANDSIZE 20
|
#define ISLANDSIZE 20
|
||||||
#define TURNS_PER_ISLAND 4
|
#define TURNS_PER_ISLAND 4
|
||||||
static void
|
static void
|
||||||
lua_autoseed(const char * filename, bool new_island)
|
lua_autoseed(const char * filename, bool new_island)
|
||||||
{
|
{
|
||||||
newfaction * players = read_newfactions(filename);
|
newfaction * players = read_newfactions(filename);
|
||||||
while (players) {
|
if (players!=NULL) {
|
||||||
int n = listlen(players);
|
rng_init(players->subscription);
|
||||||
int k = (n+ISLANDSIZE-1)/ISLANDSIZE;
|
while (players) {
|
||||||
k = n / k;
|
int n = listlen(players);
|
||||||
n = autoseed(&players, k, new_island || (turn % TURNS_PER_ISLAND)==0);
|
int k = (n+ISLANDSIZE-1)/ISLANDSIZE;
|
||||||
if (n==0) {
|
k = n / k;
|
||||||
break;
|
n = autoseed(&players, k, new_island || (turn % TURNS_PER_ISLAND)==0);
|
||||||
|
if (n==0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4034,7 +4034,7 @@
|
||||||
<arg name="region" type="region"/>
|
<arg name="region" type="region"/>
|
||||||
<arg name="command" type="order"/>
|
<arg name="command" type="order"/>
|
||||||
</type>
|
</type>
|
||||||
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Die Einheit kann den Befehl in dieser nicht ausführen, da sie sich bewegt hat oder in einen Kampf verwickelt war."</text>
|
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Die Einheit kann den Befehl in dieser Runde nicht ausführen, da sie sich bewegt hat oder in einen Kampf verwickelt war."</text>
|
||||||
<text locale="fr">"$unit($unit) in $region($region): '$order($command)' - The unit cannot execute this command because it has either moved or been in combat."</text>
|
<text locale="fr">"$unit($unit) in $region($region): '$order($command)' - The unit cannot execute this command because it has either moved or been in combat."</text>
|
||||||
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - The unit cannot execute this command because it has either moved or been in combat."</text>
|
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - The unit cannot execute this command because it has either moved or been in combat."</text>
|
||||||
</message>
|
</message>
|
||||||
|
|
Loading…
Reference in New Issue