forked from github/server
- fix, damit es mit jam kompiliert
- neue implementierung des heilwassers (vernuenftige use-funktion, reste auf andere einheiten verteilen)
This commit is contained in:
parent
5d02ad1b67
commit
a801d02905
|
@ -91,7 +91,7 @@ static attrib_type at_creator = {
|
|||
/* Rest ist NULL; temporäres, nicht alterndes Attribut */
|
||||
};
|
||||
static int
|
||||
MaxAge() {
|
||||
MaxAge(void) {
|
||||
static int value = -1;
|
||||
if (value<0) {
|
||||
value = atoi(get_param(global.parameters, "MaxAge"));
|
||||
|
@ -100,7 +100,7 @@ MaxAge() {
|
|||
}
|
||||
|
||||
int
|
||||
LongHunger() {
|
||||
LongHunger(void) {
|
||||
static int value = -1;
|
||||
if (value<0) {
|
||||
value = atoi(get_param(global.parameters, "hunger.long"));
|
||||
|
@ -119,7 +119,7 @@ SkillCap(skill_t sk) {
|
|||
}
|
||||
|
||||
boolean
|
||||
TradeDisabled() {
|
||||
TradeDisabled(void) {
|
||||
static int value = -1;
|
||||
if (value<0) {
|
||||
value = (boolean)atoi(get_param(global.parameters, "trade.disabled"));
|
||||
|
@ -128,7 +128,7 @@ TradeDisabled() {
|
|||
}
|
||||
|
||||
int
|
||||
NMRTimeout() {
|
||||
NMRTimeout(void) {
|
||||
static int value = -1;
|
||||
if (value<0) {
|
||||
value = atoi(get_param(global.parameters, "nmr.timeout"));
|
||||
|
|
|
@ -1934,6 +1934,33 @@ static const char *potiontext[MAXPOTIONS] =
|
|||
"Verletzung angewandt.",
|
||||
};
|
||||
|
||||
static int
|
||||
heal(unit * user, int effect)
|
||||
{
|
||||
int req = unit_max_hp(user) * user->number - user->hp;
|
||||
if (req>0) {
|
||||
req = min(req, effect);
|
||||
effect -= req;
|
||||
user->hp += req;
|
||||
}
|
||||
return effect;
|
||||
}
|
||||
|
||||
static int
|
||||
use_healingpotion(struct unit *user, const struct potion_type *ptype, int amount, const char *cmd)
|
||||
{
|
||||
int effect = amount * 400;
|
||||
unit * u = user->region->units;
|
||||
effect = heal(user, effect);
|
||||
while (effect>0 && u!=NULL) {
|
||||
if (u->faction==user->faction) {
|
||||
effect = heal(u, effect);
|
||||
}
|
||||
u = u->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
use_warmthpotion(struct unit *u, const struct potion_type *ptype, int amount, const char *cmd)
|
||||
{
|
||||
|
@ -2096,6 +2123,7 @@ init_oldpotions(void)
|
|||
if (p==P_FOOL) itype->useonother = &use_foolpotion;
|
||||
}
|
||||
oldpotiontype[P_WARMTH]->use = &use_warmthpotion;
|
||||
oldpotiontype[P_WARMTH]->use = &use_healingpotion;
|
||||
oldpotiontype[P_BAUERNBLUT]->use = &use_bloodpotion;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ create_xmas2000(int x, int y)
|
|||
u = createunit(r, f, 2, f->race);
|
||||
if (f->race==new_race[RC_DAEMON]) u->irace = new_race[RC_HUMAN];
|
||||
sprintf(zText, "%s %s", prefix[rand()%prefixes], LOC(u->faction->locale, rc_name(u->irace, 1)));
|
||||
fset(u, FL_PARTEITARNUNG);
|
||||
fset(u, UFL_PARTEITARNUNG);
|
||||
set_string(&u->name, zText);
|
||||
}
|
||||
make_gates(r);
|
||||
|
|
Loading…
Reference in New Issue