forked from github/server
"Mit Katapulten kann man Steuern eintreiben" - added a parameter that checks for siege-weapons. Issue: 1453
This commit is contained in:
parent
f1227d9957
commit
fb8ec1a69f
10 changed files with 34 additions and 31 deletions
|
@ -1305,7 +1305,7 @@ can_guard(const unit * guard, const unit * u)
|
||||||
{
|
{
|
||||||
if (fval(guard, UFL_ISNEW)) return false;
|
if (fval(guard, UFL_ISNEW)) return false;
|
||||||
if (guard->number<=0 || !cansee(guard->faction, guard->region, u, 0)) return false;
|
if (guard->number<=0 || !cansee(guard->faction, guard->region, u, 0)) return false;
|
||||||
if (besieged(guard) || !(fval(guard->race, RCF_UNARMEDGUARD) || armedmen(guard))) return false;
|
if (besieged(guard) || !(fval(guard->race, RCF_UNARMEDGUARD) || armedmen(guard, true))) return false;
|
||||||
|
|
||||||
return !alliedunit(guard, u->faction, HELP_GUARD);
|
return !alliedunit(guard, u->faction, HELP_GUARD);
|
||||||
}
|
}
|
||||||
|
@ -3056,33 +3056,33 @@ expandtax(region * r, request * taxorders)
|
||||||
void
|
void
|
||||||
tax_cmd(unit * u, struct order * ord, request ** taxorders)
|
tax_cmd(unit * u, struct order * ord, request ** taxorders)
|
||||||
{
|
{
|
||||||
/* Steuern werden noch vor der Forschung eingetrieben */
|
/* Steuern werden noch vor der Forschung eingetrieben */
|
||||||
region * r = u->region;
|
region * r = u->region;
|
||||||
unit *u2;
|
unit *u2;
|
||||||
int n;
|
int n;
|
||||||
request *o;
|
request *o;
|
||||||
int max;
|
int max;
|
||||||
|
|
||||||
if (!humanoidrace(u->race) && !is_monsters(u->faction)) {
|
if (!humanoidrace(u->race) && !is_monsters(u->faction)) {
|
||||||
cmistake(u, ord, 228, MSG_INCOME);
|
cmistake(u, ord, 228, MSG_INCOME);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fval(u, UFL_WERE)) {
|
if (fval(u, UFL_WERE)) {
|
||||||
cmistake(u, ord, 228, MSG_INCOME);
|
cmistake(u, ord, 228, MSG_INCOME);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (besieged(u)) {
|
if (besieged(u)) {
|
||||||
cmistake(u, ord, 60, MSG_INCOME);
|
cmistake(u, ord, 60, MSG_INCOME);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
n = armedmen(u);
|
n = armedmen(u, false);
|
||||||
|
|
||||||
if (!n) {
|
if (!n) {
|
||||||
cmistake(u, ord, 48, MSG_INCOME);
|
cmistake(u, ord, 48, MSG_INCOME);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
init_tokens(ord);
|
init_tokens(ord);
|
||||||
skip_token();
|
skip_token();
|
||||||
|
|
|
@ -2423,7 +2423,7 @@ can_start_guarding(const unit * u)
|
||||||
{
|
{
|
||||||
if (u->status>=ST_FLEE) return E_GUARD_FLEEING;
|
if (u->status>=ST_FLEE) return E_GUARD_FLEEING;
|
||||||
if (fval(u->race, RCF_UNARMEDGUARD)) return E_GUARD_OK;
|
if (fval(u->race, RCF_UNARMEDGUARD)) return E_GUARD_OK;
|
||||||
if (!armedmen(u)) return E_GUARD_UNARMED;
|
if (!armedmen(u, true)) return E_GUARD_UNARMED;
|
||||||
if (u->faction->age < NewbieImmunity()) return E_GUARD_NEWBIE;
|
if (u->faction->age < NewbieImmunity()) return E_GUARD_NEWBIE;
|
||||||
return E_GUARD_OK;
|
return E_GUARD_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -379,7 +379,7 @@ make_summary(void)
|
||||||
}
|
}
|
||||||
s->spielerpferde += get_item(u, I_HORSE);
|
s->spielerpferde += get_item(u, I_HORSE);
|
||||||
s->playermoney += get_money(u);
|
s->playermoney += get_money(u);
|
||||||
s->armed_men += armedmen(u);
|
s->armed_men += armedmen(u, true);
|
||||||
for (itm=u->items;itm;itm=itm->next) {
|
for (itm=u->items;itm;itm=itm->next) {
|
||||||
if (itm->type->rtype->wtype) {
|
if (itm->type->rtype->wtype) {
|
||||||
s->waffen += itm->number;
|
s->waffen += itm->number;
|
||||||
|
|
|
@ -198,7 +198,7 @@ message_faction(battle * b, faction * f, struct message * m)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
armedmen(const unit * u)
|
armedmen(const unit * u, boolean siege_weapons)
|
||||||
{
|
{
|
||||||
item * itm;
|
item * itm;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
@ -211,7 +211,7 @@ armedmen(const unit * u)
|
||||||
* Personen minimiert */
|
* Personen minimiert */
|
||||||
for (itm=u->items;itm;itm=itm->next) {
|
for (itm=u->items;itm;itm=itm->next) {
|
||||||
const weapon_type * wtype = resource2weapon(itm->type->rtype);
|
const weapon_type * wtype = resource2weapon(itm->type->rtype);
|
||||||
if (wtype==NULL) continue;
|
if (wtype==NULL || (wtype->flags & WTF_SIEGE)) continue;
|
||||||
if (effskill(u, wtype->skill) >= 1) n += itm->number;
|
if (effskill(u, wtype->skill) >= 1) n += itm->number;
|
||||||
/* if (effskill(u, wtype->skill) >= wtype->minskill) n += itm->number; */
|
/* if (effskill(u, wtype->skill) >= wtype->minskill) n += itm->number; */
|
||||||
if (n>u->number) break;
|
if (n>u->number) break;
|
||||||
|
|
|
@ -233,7 +233,8 @@ siege_cmd(unit * u, order * ord)
|
||||||
d = 0;
|
d = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((bewaffnete = armedmen(u)) == 0 && d == 0) {
|
bewaffnete = armedmen(u, true);
|
||||||
|
if (d == 0 && bewaffnete == 0) {
|
||||||
/* abbruch, falls unbewaffnet oder unfaehig, katapulte zu benutzen */
|
/* abbruch, falls unbewaffnet oder unfaehig, katapulte zu benutzen */
|
||||||
cmistake(u, ord, 80, MSG_EVENT);
|
cmistake(u, ord, 80, MSG_EVENT);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -170,7 +170,7 @@ extern struct faction *factions;
|
||||||
|
|
||||||
void addstrlist(strlist ** SP, const char *s);
|
void addstrlist(strlist ** SP, const char *s);
|
||||||
|
|
||||||
int armedmen(const struct unit * u);
|
int armedmen(const struct unit * u, boolean siege_weapons);
|
||||||
|
|
||||||
unsigned int atoip(const char *s);
|
unsigned int atoip(const char *s);
|
||||||
unsigned int getuint(void);
|
unsigned int getuint(void);
|
||||||
|
|
|
@ -192,6 +192,7 @@ typedef struct armor_type {
|
||||||
#define WTF_PIERCE 0x04
|
#define WTF_PIERCE 0x04
|
||||||
#define WTF_CUT 0x08
|
#define WTF_CUT 0x08
|
||||||
#define WTF_BLUNT 0x10
|
#define WTF_BLUNT 0x10
|
||||||
|
#define WTF_SIEGE 0x20
|
||||||
#define WTF_ARMORPIERCING 0x40 /* armor has only half value */
|
#define WTF_ARMORPIERCING 0x40 /* armor has only half value */
|
||||||
|
|
||||||
typedef struct weapon_type {
|
typedef struct weapon_type {
|
||||||
|
|
|
@ -870,7 +870,7 @@ is_guardian_r(unit * u2)
|
||||||
if (u2->number == 0) return false;
|
if (u2->number == 0) return false;
|
||||||
if ((u2->flags&UFL_GUARD)==0) return false;
|
if ((u2->flags&UFL_GUARD)==0) return false;
|
||||||
if (besieged(u2)) return false;
|
if (besieged(u2)) return false;
|
||||||
if (!armedmen(u2) && !fval(u2->race, RCF_UNARMEDGUARD)) return false;
|
if (!armedmen(u2, true) && !fval(u2->race, RCF_UNARMEDGUARD)) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -644,6 +644,7 @@ xml_readweapon(xmlXPathContextPtr xpath, item_type * itype)
|
||||||
if (xml_bvalue(node, "pierce", false)) flags |= WTF_PIERCE;
|
if (xml_bvalue(node, "pierce", false)) flags |= WTF_PIERCE;
|
||||||
if (xml_bvalue(node, "cut", false)) flags |= WTF_CUT;
|
if (xml_bvalue(node, "cut", false)) flags |= WTF_CUT;
|
||||||
if (xml_bvalue(node, "blunt", false)) flags |= WTF_BLUNT;
|
if (xml_bvalue(node, "blunt", false)) flags |= WTF_BLUNT;
|
||||||
|
if (xml_bvalue(node, "siege", false)) flags |= WTF_SIEGE;
|
||||||
|
|
||||||
propValue = xmlGetProp(node, BAD_CAST "skill");
|
propValue = xmlGetProp(node, BAD_CAST "skill");
|
||||||
assert(propValue!=NULL);
|
assert(propValue!=NULL);
|
||||||
|
|
|
@ -439,7 +439,7 @@
|
||||||
<construction skill="cartmaking" minskill="5" reqsize="1">
|
<construction skill="cartmaking" minskill="5" reqsize="1">
|
||||||
<requirement type="log" quantity="10"/>
|
<requirement type="log" quantity="10"/>
|
||||||
</construction>
|
</construction>
|
||||||
<weapon bash="true" missile="true" skill="catapult" offmod="0" defmod="0" reload="5">
|
<weapon siege="true" bash="true" missile="true" skill="catapult" offmod="0" defmod="0" reload="5">
|
||||||
<damage type="rider" value="3d10+5"/>
|
<damage type="rider" value="3d10+5"/>
|
||||||
<damage type="footman" value="3d10+5"/>
|
<damage type="footman" value="3d10+5"/>
|
||||||
<modifier type="missile_target" value="4"/>
|
<modifier type="missile_target" value="4"/>
|
||||||
|
|
Loading…
Reference in a new issue