forked from github/server
magicskillboost
-- implementiert. Kann nur einmal pro Partei verwendet werden, und nur von einem Magier. Müssen wir erklären. Amulett des wahren Sehens und Ring der Unsichtbarkeit geben lediglich einen Bonus auf Wahrnehmung (+2) und Tarnung (+4). -- das define war nicht aktiviert Halblinge haben Armbrustschiessen +0 (statt +1). -- spearates Rassenfile für WDW Es gibt spezielle Regeln für Allianzen, und der HELFE und KONTAKTIERE Befehl sind eingeschränkt. Konkret kann kein HELP_FIGHT HELP_GUARD HELP_FSTEALTH HELP_MONEY gegeben werden (die anderen sind erlaubt). -- mit #defeine ALLIES_ONLY definiert Jede Allianz kann bis zu 15 Magier und 15 Alchemisten haben. Jede einzelne Partei der Allianz kann dabei nicht mehr als 15/Anzahl_Parteien (aufgerundet) Magier bzw. Alchemisten haben, und die Gesamtsumme darf 15 nicht übersteigen. -- mit #define ALLIANCE_LIMITS gemacht. Die Startgeschenke (Personen, Silber, ...) werden pro Allianz, nicht pro Spieler verteilt. Größere Allianzen bekommen also weniger pro Spieler. -- Nochmal geändert: Die Allianzen kriegen jede 168 Personen zum Start, weil sich das gut aufteilen lässt. Das wird auf 28 Einheiten pro Partei gesplittet, jede Einheit hat eines der Talente, außer der Starteinheit, die hat den magicskillboost. Einige Skills kommen öfter vor als andere, das ist nicht einfach vermeidbar. Sollte aber auch wurscht sein, es geht primär darum, lehren zu können. Es gibt ein Einheitenlimit von 1000 Einheiten pro Allianz. -- die Regel sparen wir uns einfach mal.
This commit is contained in:
parent
1a8e1acf74
commit
5a37c65498
|
@ -2871,11 +2871,7 @@ wahrnehmung(region * r, faction * f)
|
|||
int w = 0;
|
||||
|
||||
for (u = r->units; u; u = u->next) {
|
||||
if (u->faction == f
|
||||
#ifdef HELFE_WAHRNEHMUNG
|
||||
|| alliedunit(u, f, HELP_OBSERVE)
|
||||
#endif
|
||||
) {
|
||||
if (u->faction == f) {
|
||||
if (eff_skill(u, SK_OBSERVATION, r) > w) {
|
||||
w = eff_skill(u, SK_OBSERVATION, r);
|
||||
}
|
||||
|
|
|
@ -1086,7 +1086,7 @@ quit(void)
|
|||
} else if(u->faction->alliance != f2->alliance) {
|
||||
cmistake(u, S->s, 315, MSG_EVENT);
|
||||
#else
|
||||
#warning ENHANCED_QUIT defined without ALLIANCES
|
||||
#error ENHANCED_QUIT defined without ALLIANCES
|
||||
#endif
|
||||
} else if(!alliedfaction(NULL, f, f2, HELP_MONEY)) {
|
||||
cmistake(u, S->s, 316, MSG_EVENT);
|
||||
|
@ -1311,15 +1311,6 @@ set_ally(unit * u, strlist * S)
|
|||
sf->status = sf->status | HELP_FIGHT;
|
||||
break;
|
||||
|
||||
#ifdef HELFE_WAHRNEHMUNG
|
||||
case P_OBSERVE:
|
||||
if (not_kw == P_NOT)
|
||||
sf->status = sf->status & (HELP_ALL - HELP_OBSERVE);
|
||||
else
|
||||
sf->status = sf->status | HELP_OBSERVE;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case P_FACTIONSTEALTH:
|
||||
if (not_kw == P_NOT)
|
||||
sf->status = sf->status & (HELP_ALL - HELP_FSTEALTH);
|
||||
|
|
|
@ -62,6 +62,9 @@
|
|||
#include <xml.h>
|
||||
|
||||
#include <modules/xecmd.h>
|
||||
#ifdef ALLIANCES
|
||||
# include <modules/alliance.h>
|
||||
#endif
|
||||
|
||||
/* libc includes */
|
||||
#include <stdio.h>
|
||||
|
@ -352,11 +355,43 @@ const char *options[MAXOPTIONS] =
|
|||
"SHOWSKCHANGE"
|
||||
};
|
||||
|
||||
#ifdef ALLIANCE_LIMITS
|
||||
int
|
||||
max_skill(const faction * f, skill_t sk)
|
||||
allied_skillcount(const faction * f, skill_t sk)
|
||||
{
|
||||
int num = 0;
|
||||
alliance * a = f->alliance;
|
||||
faction_list * members = a->members;
|
||||
while (members!=NULL) {
|
||||
num += count_skill(members->data, sk);
|
||||
members=members->next;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
int
|
||||
allied_skilllimit(const faction * f, skill_t sk)
|
||||
{
|
||||
return atoi(get_param(global.parameters, "allied.skilllimit"));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int
|
||||
max_skill(faction * f, skill_t sk)
|
||||
{
|
||||
int m = INT_MAX;
|
||||
|
||||
#ifdef ALLIANCE_LIMITS
|
||||
if (sk!=SK_ALCHEMY && sk!=SK_MAGIC) return INT_MAX;
|
||||
if (f->alliance!=NULL) {
|
||||
int ac = listlen(f->alliance->members); /* number of factions */
|
||||
int al = allied_skilllimit(f, sk); /* limit per alliance */
|
||||
int fl = (al+ac-1)/ac; /* faction limit */
|
||||
int sc = al - allied_skillcount(f, sk);
|
||||
if (sc==0) return count_skill(f, sk);
|
||||
return fl;
|
||||
}
|
||||
#endif
|
||||
switch (sk) {
|
||||
case SK_MAGIC:
|
||||
m = MAXMAGICIANS;
|
||||
|
@ -367,7 +402,6 @@ max_skill(const faction * f, skill_t sk)
|
|||
m = MAXALCHEMISTS;
|
||||
break;
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
|
@ -791,7 +825,7 @@ autoalliance(const plane * pl, const faction * sf, const faction * f2)
|
|||
}
|
||||
|
||||
static int
|
||||
alliance(const ally * sf, int mode)
|
||||
ally_mode(const ally * sf, int mode)
|
||||
{
|
||||
if (sf==NULL) return 0;
|
||||
return sf->status & mode;
|
||||
|
@ -801,14 +835,21 @@ int
|
|||
alliedgroup(const struct plane * pl, const struct faction * f,
|
||||
const struct faction * f2, const struct ally * sf, int mode)
|
||||
{
|
||||
#ifdef ALLIANCES
|
||||
if (f->alliance!=f2->alliance) return 0;
|
||||
#endif
|
||||
while (sf && sf->faction!=f2) sf=sf->next;
|
||||
if (sf==NULL) {
|
||||
return mode & autoalliance(pl, f, f2);
|
||||
mode = mode & autoalliance(pl, f, f2);
|
||||
}
|
||||
return alliance(sf, mode) | (mode & autoalliance(pl, f, f2));
|
||||
mode = ally_mode(sf, mode) | (mode & autoalliance(pl, f, f2));
|
||||
#ifdef ALLIANCES
|
||||
if (f->alliance!=f2->alliance) {
|
||||
# ifdef ALLIES_ONLY
|
||||
mode &= ~ALLIES_ONLY;
|
||||
# else
|
||||
mode = 0;
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
return mode;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -104,7 +104,6 @@ struct xml_stack;
|
|||
#define NEW_RECEIPIES /* Vereinfachte, besser verteilte Kräuterzutaten für Tränke */
|
||||
#define NEW_TAVERN
|
||||
#define GOBLINKILL
|
||||
#undef HELFE_WAHRNEHMUNG
|
||||
|
||||
#define USE_FIREWALL 1
|
||||
#undef COMPATIBILITY
|
||||
|
@ -900,7 +899,7 @@ extern boolean check_leuchtturm(struct region * r, struct faction * f);
|
|||
extern void update_lighthouse(struct building * lh);
|
||||
|
||||
/* skills */
|
||||
extern int max_skill(const struct faction * f, skill_t sk);
|
||||
extern int max_skill(struct faction * f, skill_t sk);
|
||||
extern int count_skill(struct faction * f, skill_t sk);
|
||||
extern int count_all_money(const struct region * r);
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include "eressea.h"
|
||||
#include "item.h"
|
||||
|
||||
#include <attributes/key.h>
|
||||
|
||||
#include "alchemy.h"
|
||||
#include "build.h"
|
||||
#include "faction.h"
|
||||
|
@ -2037,6 +2039,31 @@ use_mistletoe(struct unit * user, const struct item_type * itype, int amount, co
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
use_magicboost(struct unit * user, const struct item_type * itype, int amount, const char * cmd)
|
||||
{
|
||||
int mtoes = new_get_pooled(user, itype->rtype, GET_SLACK|GET_RESERVE|GET_POOLED_SLACK);
|
||||
faction * f = user->faction;
|
||||
if (user->number>mtoes) {
|
||||
ADDMSG(&user->faction->msgs, msg_message("use_singleperson",
|
||||
"unit item region command", user, itype->rtype, user->region, cmd));
|
||||
return -1;
|
||||
}
|
||||
if (!is_mage(user) || find_key(f->attribs, atoi36("mbst"))!=NULL) {
|
||||
cmistake(user, user->thisorder, 214, MSG_EVENT);
|
||||
return -1;
|
||||
}
|
||||
new_use_pooled(user, itype->rtype, GET_SLACK|GET_RESERVE|GET_POOLED_SLACK, user->number);
|
||||
|
||||
a_add(&f->attribs, make_key(atoi36("mbst")));
|
||||
set_level(user, sk_find("sk_magic"), 3);
|
||||
|
||||
ADDMSG(&user->faction->msgs, msg_message("use_item",
|
||||
"unit item", user, itype->rtype));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
use_snowball(struct unit * user, const struct item_type * itype, int amount, const char * cmd)
|
||||
{
|
||||
|
@ -2667,6 +2694,7 @@ register_resources(void)
|
|||
register_function((pf_generic)use_bloodpotion, "usebloodpotion");
|
||||
register_function((pf_generic)use_foolpotion, "usefoolpotion");
|
||||
register_function((pf_generic)use_mistletoe, "usemistletoe");
|
||||
register_function((pf_generic)use_magicboost, "usemagicboost");
|
||||
register_function((pf_generic)use_snowball, "usesnowball");
|
||||
|
||||
register_function((pf_generic)give_horses, "givehorses");
|
||||
|
|
|
@ -742,18 +742,21 @@ tagbegin(struct xml_stack * stack)
|
|||
const char * zName = xml_value(tag, "name");
|
||||
race * rc;
|
||||
|
||||
state->nextattack = 0;
|
||||
state->nextfamiliar = 0;
|
||||
|
||||
if (zName) {
|
||||
rc = rc_find(zName);
|
||||
if (rc==NULL) {
|
||||
rc = rc_add(rc_new(zName));
|
||||
if (rc!=NULL) {
|
||||
/* not reading the same race twice, first race counts */
|
||||
return XML_OK;
|
||||
}
|
||||
state->race = rc = rc_add(rc_new(zName));
|
||||
} else {
|
||||
log_error(("missing required tag 'name'\n"));
|
||||
return XML_USERERROR;
|
||||
}
|
||||
|
||||
state->nextattack = 0;
|
||||
state->nextfamiliar = 0;
|
||||
|
||||
rc->magres = xml_fvalue(tag, "magres");
|
||||
rc->maxaura = xml_fvalue(tag, "maxaura");
|
||||
rc->regaura = xml_fvalue(tag, "regaura");
|
||||
|
@ -810,7 +813,8 @@ tagbegin(struct xml_stack * stack)
|
|||
if (xml_bvalue(tag, "resistpierce")) rc->battle_flags |= BF_RES_PIERCE;
|
||||
|
||||
state->race = rc;
|
||||
} else if (strcmp(tag->name, "ai")==0) {
|
||||
} else if (state->race!=NULL) {
|
||||
if (strcmp(tag->name, "ai")==0) {
|
||||
race * rc = state->race;
|
||||
rc->splitsize = xml_ivalue(tag, "splitsize");
|
||||
|
||||
|
@ -893,6 +897,7 @@ tagbegin(struct xml_stack * stack)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return XML_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1994,12 +1994,19 @@ addally(const faction * f, ally ** sfp, int aid, int state)
|
|||
{
|
||||
struct faction * af = findfaction(aid);
|
||||
ally * sf;
|
||||
#ifndef HELFE_WAHRNEHMUNG
|
||||
state &= ~HELP_OBSERVE;
|
||||
#ifndef REGIONOWNERS
|
||||
state &= ~HELP_TRAVEL;
|
||||
#endif
|
||||
#ifdef ALLIANCES
|
||||
# ifdef ALLIES_ONLY
|
||||
if (af!=NULL && af->alliance!=f->alliance) state &= ~ALLIES_ONLY;;
|
||||
# else
|
||||
# endif
|
||||
if (af!=NULL && af->alliance!=f->alliance) return;
|
||||
#endif
|
||||
if (state==0) return;
|
||||
|
||||
sf = calloc(1, sizeof(ally));
|
||||
sf->faction = af;
|
||||
if (!sf->faction) ur_add((void*)aid, (void**)&sf->faction, resolve_faction);
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#define RECRUITFRACTION 40 /* 100/RECRUITFRACTION% */
|
||||
#define CATAPULT_AMMUNITION 1 /* Gebaut werden kann sie auch mit 0! */
|
||||
#define CHANGED_CROSSBOWS 1
|
||||
#define NEWATSROI 0
|
||||
#define NEWATSROI 1
|
||||
#define COMBAT_TURNS 5
|
||||
#define PEASANTS_DO_NOT_STARVE 0
|
||||
#define NEW_MIGRATION 1
|
||||
|
@ -45,7 +45,9 @@
|
|||
|
||||
#define ENHANCED_QUIT
|
||||
#define ALLIANCES
|
||||
#define ALLIES_ONLY (HELP_FIGHT|HELP_GUARD|HELP_FSTEALTH|HELP_MONEY)
|
||||
#undef ALLIANCEJOIN
|
||||
#define ALLIANCE_LIMITS
|
||||
#define AUTOALLIANCE (HELP_FIGHT)
|
||||
|
||||
#define WDW_PHOENIX
|
||||
|
|
|
@ -386,6 +386,9 @@
|
|||
<File
|
||||
RelativePath="..\common\settings-vinyambar.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\common\settings-wdw.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\common\settings.h">
|
||||
</File>
|
||||
|
|
|
@ -42,8 +42,6 @@ read_game(const char * filename)
|
|||
static int
|
||||
write_game(const char *filename)
|
||||
{
|
||||
char ztext[64];
|
||||
|
||||
free_units();
|
||||
remove_empty_factions(true);
|
||||
|
||||
|
|
|
@ -144,6 +144,7 @@ struct settings global = {
|
|||
1000, /* maxunits */
|
||||
};
|
||||
|
||||
#if 0
|
||||
static int
|
||||
crwritemap(void)
|
||||
{
|
||||
|
@ -157,6 +158,7 @@ crwritemap(void)
|
|||
fclose(F);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
game_init(void)
|
||||
|
@ -319,6 +321,9 @@ lua_init(void)
|
|||
{
|
||||
lua_State * luaState = lua_open();
|
||||
luaopen_base(luaState);
|
||||
luaopen_math(luaState);
|
||||
luaopen_string(luaState);
|
||||
luaopen_io(luaState);
|
||||
luabind::open(luaState);
|
||||
bind_eressea(luaState);
|
||||
bind_alliance(luaState);
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<eressea>
|
||||
<include file="messages.xml"></include>
|
||||
|
||||
<include file="vinyambar/de/strings.xml"></include>
|
||||
<include file="vinyambar/wdw-races.xml"></include>
|
||||
<include file="vinyambar/wdw-resources.xml"></include>
|
||||
|
||||
<comment>Localization</comment>
|
||||
<include file="de/strings.xml"></include>
|
||||
<include file="en/strings.xml"></include>
|
||||
|
@ -22,8 +26,8 @@
|
|||
<param name="GiveRestriction" value="0"></param>
|
||||
<param name="database.gameid" value="3"></param>
|
||||
<param name="hunger.long" value="0"></param>
|
||||
<param name="alliance.skilllimit" value="15"></param>
|
||||
</game>
|
||||
<include file="vinyambar/de/strings.xml"></include>
|
||||
<strings>
|
||||
<string name="mailto">
|
||||
<text>vinyambar@eressea.amber.kn-bremen.de</text>
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<races>
|
||||
<race name="halfling" magres="0.050000" maxaura="1.000000" regaura="1.000000" recruitcost="80" maintenance="10" weight="1000" capacity="540" speed="1.000000" hp="18" ac="0" damage="1d5" unarmedattack="-2" unarmeddefense="-2" attackmodifier="0" defensemodifier="0" playerrace walk giveitem giveperson giveunit getitem equipment>
|
||||
<ai splitsize="10000" attackrandom moverandom learn></ai>
|
||||
<function name="itemdrop" value="halflingspoil"></function>
|
||||
<skill name="sk_crossbow" modifier="0"></skill>
|
||||
<skill name="sk_mining" modifier="1"></skill>
|
||||
<skill name="sk_bow" modifier="-1"></skill>
|
||||
<skill name="sk_building" modifier="1"></skill>
|
||||
<skill name="sk_trade" modifier="2"></skill>
|
||||
<skill name="sk_catapult" modifier="-1"></skill>
|
||||
<skill name="sk_herbalism" modifier="2"></skill>
|
||||
<skill name="sk_training" modifier="-1"></skill>
|
||||
<skill name="sk_riding" modifier="-1"></skill>
|
||||
<skill name="sk_shipcraft" modifier="-1"></skill>
|
||||
<skill name="sk_melee" modifier="-1"></skill>
|
||||
<skill name="sk_sailing" modifier="-2"></skill>
|
||||
<skill name="sk_polearm" modifier="-1"></skill>
|
||||
<skill name="sk_espionage" modifier="1"></skill>
|
||||
<skill name="sk_roadwork" modifier="1"></skill>
|
||||
<skill name="sk_stealth" modifier="1"></skill>
|
||||
<skill name="sk_entertainment" modifier="1"></skill>
|
||||
<skill name="sk_cartmaking" modifier="2"></skill>
|
||||
<skill name="sk_perception" modifier="1"></skill>
|
||||
<skill name="sk_taxation" modifier="-1"></skill>
|
||||
<skill name="sk_unarmed" modifier="-99"></skill>
|
||||
<attack type="1" damage="1d5"></attack>
|
||||
<familiar race="owl" default></familiar>
|
||||
<familiar race="rat"></familiar>
|
||||
<familiar race="eagle"></familiar>
|
||||
<familiar race="songdragon"></familiar>
|
||||
<familiar race="eagle"></familiar>
|
||||
<familiar race="rat"></familiar>
|
||||
</race>
|
||||
</races>
|
|
@ -0,0 +1,16 @@
|
|||
<resource name="magicskillboost">
|
||||
<comment>Boost a magician's skill to level 3</comment>
|
||||
<item notlost weight="0">
|
||||
<function name="use" value="usemagicboost"></function>
|
||||
</item>
|
||||
</resource>
|
||||
<strings>
|
||||
<string name="magicskillboost">
|
||||
<text locale="de">Schriftrolle</text>
|
||||
<text locale="en">scroll</text>
|
||||
</string>
|
||||
<string name="magicskillboost_p">
|
||||
<text locale="de">Schriftrollen</text>
|
||||
<text locale="en">scrolls</text>
|
||||
</string>
|
||||
</strings>
|
Loading…
Reference in New Issue