"Schattendämonen/-meister"

Es gibt ein neues Rassen-flag, dass das betreten von Schiffen fuer eine Rasse unterbindet. Wird eingesetzt fuer SD/SM.
This commit is contained in:
Enno Rehling 2007-02-17 12:51:40 +00:00
parent 96302d39b4
commit bbe226e22e
8 changed files with 15 additions and 8 deletions

View File

@ -2701,7 +2701,7 @@ steal_cmd(unit * u, struct order * ord, request ** stealorders)
faction * f = NULL;
if (!fval(u->race, RCF_CANSTEAL)) {
ADDMSG(&u->faction->msgs, msg_feedback("race_nosteal", "race", u->race));
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "race_nosteal", "race", u->race));
return;
}

View File

@ -3241,7 +3241,7 @@ new_units (void)
if (getparam(u->faction->locale) == P_TEMP) {
const char * token;
char * name = NULL;
int g, alias;
int alias;
order ** newordersp;
if (!checkunitnumber(u->faction, 1)) {

View File

@ -1022,7 +1022,9 @@ create_ship(region * r, unit * u, const struct ship_type * newtype, int want, or
sh = new_ship(newtype, u->faction->locale, r);
leave(r, u);
u->ship = sh;
if (fval(u->race, RCF_CANSAIL)) {
u->ship = sh;
}
fset(u, UFL_OWNER);
sprintf(buffer, "%s %s %s",
locale_string(u->faction->locale, keywords[K_MAKE]), locale_string(u->faction->locale, parameters[P_SHIP]), shipid(sh));
@ -1141,7 +1143,7 @@ enter_ship(unit * u, struct order * ord, int id, boolean report)
/* Muß abgefangen werden, sonst könnten Schwimmer an
* Bord von Schiffen an Land gelangen. */
if (!fval(u->race, RCF_WALK) && !fval(u->race, RCF_FLY)) {
if (!fval(u->race, RCF_CANSAIL) || (!fval(u->race, RCF_WALK) && !fval(u->race, RCF_FLY))) {
cmistake(u, ord, 233, MSG_MOVE);
return false;
}

View File

@ -1999,6 +1999,7 @@ create_unit(region * r, faction * f, int number, const struct race *urace, int i
/* erbt Gebäude/Schiff*/
if (creator->region==r) {
u->building = creator->building;
assert(creator->ship==NULL || fval(u->race, RCF_CANSAIL));
u->ship = creator->ship;
}

View File

@ -136,6 +136,7 @@ extern int rc_specialdamage(const race *, const race *, const struct weapon_type
#define RCF_DRAGON (1<<21) /* Drachenart (für Zauber)*/
#define RCF_COASTAL (1<<22) /* kann in Landregionen an der Küste sein */
#define RCF_UNARMEDGUARD (1<<23) /* kann ohne Waffen bewachen */
#define RCF_CANSAIL (1<<24) /* Einheit darf Schiffe betreten */
/* Economic flags */
#define NOGIVE (1<<0) /* gibt niemals nix */

View File

@ -246,7 +246,9 @@ destroy_unit(unit * u)
if (u->region!=clone->region) {
move_unit(u, clone->region, NULL);
}
u->ship = clone->ship;
if (fval(u->race, RCF_CANSAIL)) {
u->ship = clone->ship;
}
u->building = clone->building;
u->hp = 1;
i = u->no;

View File

@ -1410,6 +1410,7 @@ parse_races(xmlDocPtr doc)
if (xml_bvalue(node, "playerrace", false)) rc->flags |= RCF_PLAYERRACE;
if (xml_bvalue(node, "scarepeasants", false)) rc->flags |= RCF_SCAREPEASANTS;
if (xml_bvalue(node, "cansteal", true)) rc->flags |= RCF_CANSTEAL;
if (xml_bvalue(node, "cansail", true)) rc->flags |= RCF_CANSAIL;
if (xml_bvalue(node, "cannotmove", false)) rc->flags |= RCF_CANNOTMOVE;
if (xml_bvalue(node, "fly", false)) rc->flags |= RCF_FLY;
if (xml_bvalue(node, "coastal", false)) rc->flags |= RCF_COASTAL;

View File

@ -640,7 +640,7 @@
<skill name="stamina" modifier="-10"/>
<attack type="4" damage="1d2"/>
</race>
<race name="alp" magres="0.950000" maxaura="1.000000" regaura="1.000000" recruitcost="50000" weight="0" capacity="0" speed="1.500000" hp="20" ac="2" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="2" defensemodifier="20" fly="yes" walk="yes" canlearn="no" noteach="yes">
<race name="alp" magres="0.950000" maxaura="1.000000" regaura="1.000000" recruitcost="50000" weight="0" capacity="0" speed="1.500000" hp="20" ac="2" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="2" defensemodifier="20" fly="yes" walk="yes" canlearn="no" canteach="no">
<ai splitsize="1"/>
<attack type="1" damage="1d4"/>
</race>
@ -648,14 +648,14 @@
<ai splitsize="1"/>
<attack type="4" damage="2d40"/>
</race>
<race name="shadowmaster" cansteal="no" canlearn="no" magres="0.750000" maxaura="1.000000" regaura="2.000000" recruitcost="50000" weight="500" capacity="540" speed="1.000000" hp="150" ac="4" damage="2d5" unarmedattack="0" unarmeddefense="0" attackmodifier="11" defensemodifier="13" scarepeasants="yes" walk="yes" teach="no" desert="yes" nogive="yes">
<race name="shadowmaster" cansail="no" cansteal="no" canlearn="no" magres="0.750000" maxaura="1.000000" regaura="2.000000" recruitcost="50000" weight="500" capacity="540" speed="1.000000" hp="150" ac="4" damage="2d5" unarmedattack="0" unarmeddefense="0" attackmodifier="11" defensemodifier="13" scarepeasants="yes" walk="yes" teach="no" desert="yes" nogive="yes">
<ai splitsize="50" killpeasants="yes" moverandom="yes" learn="yes"/>
<function name="name" value="nameshadow"/>
<attack type="4" damage="2d4"/>
<attack type="2" damage="2d30"/>
<attack type="3" damage="1d2"/>
</race>
<race name="shadowdemon" cansteal="no" canlearn="no" magres="0.750000" maxaura="1.000000" regaura="1.000000" recruitcost="5000" weight="500" capacity="540" speed="1.000000" hp="50" ac="3" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="8" defensemodifier="11" scarepeasants="yes" walk="yes" teach="no" desert="yes" recruitethereal="yes" nogive="yes">
<race name="shadowdemon" cansail="no" cansteal="no" canlearn="no" magres="0.750000" maxaura="1.000000" regaura="1.000000" recruitcost="5000" weight="500" capacity="540" speed="1.000000" hp="50" ac="3" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="8" defensemodifier="11" scarepeasants="yes" walk="yes" teach="no" desert="yes" recruitethereal="yes" nogive="yes">
<ai splitsize="1000" killpeasants="yes" moverandom="yes" learn="yes"/>
<function name="name" value="nameshadow"/>
<attack type="4" damage="2d3"/>