forked from github/server
defender-factions that help the region's owner.
This commit is contained in:
parent
ecdb0b760e
commit
319abf6c5d
|
@ -957,7 +957,19 @@ alliedunit(const unit * u, const faction * f2, int mode)
|
|||
assert(u->region); /* the unit should be in a region, but it's possible that u->number==0 (TEMP units) */
|
||||
if (u->faction == f2) return mode;
|
||||
if (u->faction != NULL && f2!=NULL) {
|
||||
plane * pl = rplane(u->region);
|
||||
plane * pl;
|
||||
|
||||
if (mode&HELP_FIGHT) {
|
||||
if ((u->flags&UFL_DEFENDER) || (u->faction->flags&FFL_DEFENDER)) {
|
||||
faction * owner = region_get_owner(u->region);
|
||||
/* helps the owner of the region */
|
||||
if (owner==f2) {
|
||||
return HELP_FIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pl = rplane(u->region);
|
||||
automode = mode & autoalliance(pl, u->faction, f2);
|
||||
|
||||
if (pl!=NULL && (pl->flags & PFL_NOALLIANCES))
|
||||
|
|
|
@ -30,6 +30,7 @@ struct seen_region;
|
|||
#define FFL_ISNEW (1<<1)
|
||||
#define FFL_RESTART (1<<2)
|
||||
#define FFL_QUIT (1<<3)
|
||||
#define FFL_DEFENDER (1<<10)
|
||||
#define FFL_SELECT (1<<18) /* ehemals f->dh, u->dh, r->dh, etc... */
|
||||
#define FFL_NOAID (1<<21) /* Hilfsflag Kampf */
|
||||
#define FFL_MARK (1<<23) /* für markierende algorithmen, die das
|
||||
|
@ -43,7 +44,7 @@ struct seen_region;
|
|||
#define FFL_GM (1<<30) /* eine Partei mit Sonderrechten */
|
||||
#define FFL_NPC (1<<31) /* eine Partei mit Monstern */
|
||||
|
||||
#define FFL_SAVEMASK (FFL_NEWID|FFL_GM|FFL_NPC|FFL_NOTIMEOUT|FFL_DBENTRY|FFL_NOTIMEOUT)
|
||||
#define FFL_SAVEMASK (FFL_DEFENDER|FFL_NEWID|FFL_GM|FFL_NPC|FFL_NOTIMEOUT|FFL_DBENTRY|FFL_NOTIMEOUT)
|
||||
|
||||
struct faction * get_monsters(void);
|
||||
#define is_monsters(f) ((f)->flags&FFL_NPC)
|
||||
|
|
|
@ -41,6 +41,7 @@ struct item;
|
|||
#define UFL_HERO (1<<7)
|
||||
#define UFL_MOVED (1<<8)
|
||||
#define UFL_NOTMOVING (1<<9) /* Die Einheit kann sich wg. langen Kampfes nicht bewegen */
|
||||
#define UFL_DEFENDER (1<<10)
|
||||
#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_TARGET (1<<13) /* speedup: hat ein target, siehe attribut */
|
||||
|
@ -64,7 +65,7 @@ struct item;
|
|||
#define UFL_GROUP (1<<28)
|
||||
|
||||
/* Flags, die gespeichert werden sollen: */
|
||||
#define UFL_SAVEMASK (UFL_MOVED | UFL_NOAID | UFL_OWNER | UFL_PARTEITARNUNG | UFL_LOCKED | UFL_HUNGER | UFL_TAKEALL | UFL_GUARD | UFL_STEALTH | UFL_GROUP | UFL_HERO)
|
||||
#define UFL_SAVEMASK (UFL_DEFENDER|UFL_MOVED|UFL_NOAID|UFL_OWNER|UFL_PARTEITARNUNG|UFL_LOCKED|UFL_HUNGER|UFL_TAKEALL|UFL_GUARD|UFL_STEALTH|UFL_GROUP|UFL_HERO)
|
||||
|
||||
#define UNIT_MAXSIZE 50000
|
||||
extern int maxheroes(const struct faction * f);
|
||||
|
|
Loading…
Reference in New Issue