- Katapultmunition. Ab sofort baubar, wird aber erst mit

#define CATAPULT_AMMUNITION 1 benötigt und benutzt.
This commit is contained in:
Christian Schlittchen 2002-04-23 19:00:23 +00:00
parent b74b8ffccb
commit 41be1a2c56
8 changed files with 43 additions and 10 deletions

View File

@ -18,6 +18,7 @@
#include "demonseye.h"
#include "weapons.h"
#include "xerewards.h"
#include "catapultammo.h"
#if GROWING_TREES
# include "seed.h"
#endif
@ -36,6 +37,7 @@ register_items(void)
#endif
register_birthday_firework();
register_lebkuchenherz();
register_catapultammo();
}
void

View File

@ -16,11 +16,14 @@
#include <eressea.h>
#include "weapons.h"
#include "catapultammo.h"
#include <unit.h>
#include <build.h>
#include <race.h>
#include <item.h>
#include <battle.h>
#include <pool.h>
/* util includes */
#include <functions.h>
@ -35,7 +38,7 @@ static weapon_mod wm_bow[] = {
};
static weapon_mod wm_catapult[] = {
{ 1, WMF_MISSILE_TARGET },
{ 4, WMF_MISSILE_TARGET },
{ 0, 0 }
};
@ -187,6 +190,8 @@ attack_firesword(const troop * at, int *casualties, int row)
return true;
}
#define CATAPULT_ATTACKS 6
static boolean
attack_catapult(const troop * at, int * casualties, int row)
{
@ -202,8 +207,15 @@ attack_catapult(const troop * at, int * casualties, int row)
if (row>BEHIND_ROW) return false; /* keine weiteren attacken */
assert(wp->type->itype==olditemtype[I_CATAPULT]);
assert(af->person[at->index].reload==0);
#if CATAPULT_AMMUNITION
if(new_get_pooled(au, &rt_catapultammo, GET_SLACK|GET_RESERVE|GET_POOLED_SLACK|GET_POOLED_RESERVE|GET_POOLED_FORCE) <= 0) {
/* No ammo. Use other weapon if available. */
return true;
}
#endif
assert (af->person[at->index].reload==0);
if (af->catmsg == -1) {
int i, k=0;
for (i=0;i<=at->index;++i) {
@ -215,7 +227,12 @@ attack_catapult(const troop * at, int * casualties, int row)
}
minrow = FIGHT_ROW;
maxrow = FIGHT_ROW;
n = min(10, count_enemies(b, af->side, FS_ENEMY, minrow, maxrow));
n = min(CATAPULT_ATTACKS, count_enemies(b, af->side, FS_ENEMY, minrow, maxrow));
#if CATAPULT_AMMUNITION
new_use_pooled(au, &rt_catapultammo, GET_SLACK|GET_RESERVE|GET_POOLED_SLACK|GET_POOLED_RESERVE|GET_POOLED_FORCE, 1);
#endif
while (--n >= 0) {
/* Select defender */

View File

@ -34,3 +34,5 @@
#define GUARD_DISABLES_PRODUCTION 1
#define RESOURCE_QUANTITY 1.0
#define RECRUITFRACTION 5
#define CATAPULT_AMMUNITION 0 /* Gebaut werden kann sie auch mit 0! */

View File

@ -30,8 +30,9 @@
#define SKILLPOINTS 0
#define NEW_MIGRATION 1
#define PEASANTS_DO_NOT_STARVE 0
#define GUARD_DISABLES_RECRUIT 0
#define GUARD_DISABLES_PRODUCTION 0
#define RESOURCE_QUANTITY 1.0
#define RECRUITFRACTION 20
#define GUARD_DISABLES_RECRUIT 1
#define GUARD_DISABLES_PRODUCTION 1
#define RESOURCE_QUANTITY 0.5
#define RECRUITFRACTION 5
#define CATAPULT_AMMUNITION 1

View File

@ -32,4 +32,5 @@
#define GUARD_DISABLES_PRODUCTION 0
#define RESOURCE_QUANTITY 1.0
#define RECRUITFRACTION 20
#define CATAPULT_AMMUNITION 0

View File

@ -33,7 +33,8 @@
#define GUARD_DISABLES_RECRUIT 1
#define GUARD_DISABLES_PRODUCTION 1
#define RESOURCE_QUANTITY 1.0
#define RECRUITFRACTION 20
#define RECRUITFRACTION 5
#define CATAPULT_AMMUNITION 1
#define VICTORY_CONDITION VICTORY_MURDER
#define VICTORY_DELAY 4

View File

@ -32,4 +32,5 @@
#define GUARD_DISABLES_PRODUCTION 0
#define RESOURCE_QUANTITY 1.0
#define RECRUITFRACTION 20
#define CATAPULT_AMMUNITION 0

View File

@ -609,6 +609,14 @@
<string name="vial_p">
<text locale="de">Phiolen</text>
</string>
<string name="catapultammo">
<text locale="de">Katapultmunition</text>
<text locale="en">catapult ammunition</text>
</string>
<string name="catapultammo_p">
<text locale="de">Katapultmunition</text>
<text locale="en">catapult ammunition</text>
</string>
<comment>Resourcen</comment>
<string name="money">