forked from github/server
- bugifx in sp_undeadhero
- artrewards warning entfernt - artrewards in visual studio project eingebaut
This commit is contained in:
parent
f896b56031
commit
b7f25b807c
|
@ -1,38 +1,38 @@
|
||||||
/* vi: set ts=2:
|
/* vi: set ts=2:
|
||||||
*
|
*
|
||||||
* Eressea PB(E)M host Copyright (C) 1998-2003
|
* Eressea PB(E)M host Copyright (C) 1998-2003
|
||||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||||
* Henning Peters (faroul@beyond.kn-bremen.de)
|
* Henning Peters (faroul@beyond.kn-bremen.de)
|
||||||
* Enno Rehling (enno@eressea-pbem.de)
|
* Enno Rehling (enno@eressea-pbem.de)
|
||||||
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
|
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
|
||||||
*
|
*
|
||||||
* This program may not be used, modified or distributed without
|
* This program may not be used, modified or distributed without
|
||||||
* prior permission by the authors of Eressea.
|
* prior permission by the authors of Eressea.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <eressea.h>
|
#include <eressea.h>
|
||||||
#include "artrewards.h"
|
#include "artrewards.h"
|
||||||
|
|
||||||
/* kernel includes */
|
/* kernel includes */
|
||||||
#include <item.h>
|
#include <kernel/item.h>
|
||||||
#include <region.h>
|
#include <kernel/region.h>
|
||||||
#include <faction.h>
|
#include <kernel/faction.h>
|
||||||
#include <unit.h>
|
#include <kernel/unit.h>
|
||||||
#include <skill.h>
|
#include <kernel/skill.h>
|
||||||
#include <curse.h>
|
#include <kernel/curse.h>
|
||||||
#include <message.h>
|
#include <kernel/message.h>
|
||||||
#include <magic.h>
|
#include <kernel/magic.h>
|
||||||
#include <ship.h>
|
#include <kernel/ship.h>
|
||||||
#include <building.h>
|
#include <kernel/building.h>
|
||||||
|
|
||||||
/* gamecode includes */
|
/* gamecode includes */
|
||||||
#include <economy.h>
|
#include <gamecode/economy.h>
|
||||||
|
|
||||||
/* util includes */
|
/* util includes */
|
||||||
#include <functions.h>
|
#include <util/functions.h>
|
||||||
#include <rand.h>
|
#include <util/rand.h>
|
||||||
|
|
||||||
/* libc includes */
|
/* libc includes */
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -46,20 +46,20 @@
|
||||||
static int
|
static int
|
||||||
age_peaceimmune(attrib * a)
|
age_peaceimmune(attrib * a)
|
||||||
{
|
{
|
||||||
return --a->data.i;
|
return --a->data.i;
|
||||||
}
|
}
|
||||||
|
|
||||||
static attrib_type at_peaceimmune = {
|
static attrib_type at_peaceimmune = {
|
||||||
"peaceimmune",
|
"peaceimmune",
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
age_peaceimmune,
|
age_peaceimmune,
|
||||||
a_writedefault,
|
a_writedefault,
|
||||||
a_readdefault
|
a_readdefault
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
use_hornofdancing(struct unit * u, const struct item_type * itype,
|
use_hornofdancing(struct unit * u, const struct item_type * itype,
|
||||||
int amount, const char *cm)
|
int amount, const char *cm)
|
||||||
{
|
{
|
||||||
region *r;
|
region *r;
|
||||||
int regionsPacified = 0;
|
int regionsPacified = 0;
|
||||||
|
@ -88,29 +88,29 @@ use_hornofdancing(struct unit * u, const struct item_type * itype,
|
||||||
|
|
||||||
if(regionsPacified > 0) {
|
if(regionsPacified > 0) {
|
||||||
ADDMSG(&u->faction->msgs, msg_message("hornofpeace_u_success",
|
ADDMSG(&u->faction->msgs, msg_message("hornofpeace_u_success",
|
||||||
"unit region command pacified", u, u->region, cm, regionsPacified));
|
"unit region command pacified", u, u->region, cm, regionsPacified));
|
||||||
} else {
|
} else {
|
||||||
ADDMSG(&u->faction->msgs, msg_message("hornofpeace_u_nosuccess",
|
ADDMSG(&u->faction->msgs, msg_message("hornofpeace_u_nosuccess",
|
||||||
"unit region command", u, u->region, cm));
|
"unit region command", u, u->region, cm));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static resource_type rt_hornofdancing = {
|
static resource_type rt_hornofdancing = {
|
||||||
{ "hornofdancing", "hornofdancing_p" },
|
{ "hornofdancing", "hornofdancing_p" },
|
||||||
{ "hornofdancing", "hornofdancing_p" },
|
{ "hornofdancing", "hornofdancing_p" },
|
||||||
RTF_ITEM,
|
RTF_ITEM,
|
||||||
&res_changeitem
|
&res_changeitem
|
||||||
};
|
};
|
||||||
|
|
||||||
item_type it_hornofdancing = {
|
item_type it_hornofdancing = {
|
||||||
&rt_hornofdancing, /* resourcetype */
|
&rt_hornofdancing, /* resourcetype */
|
||||||
0, 1, 0, /* flags, weight, capacity */
|
0, 1, 0, /* flags, weight, capacity */
|
||||||
NULL, /* construction */
|
NULL, /* construction */
|
||||||
&use_hornofdancing,
|
&use_hornofdancing,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ item_type it_hornofdancing = {
|
||||||
|
|
||||||
static int
|
static int
|
||||||
use_trappedairelemental(struct unit * u, const struct item_type * itype,
|
use_trappedairelemental(struct unit * u, const struct item_type * itype,
|
||||||
int amount, const char *cm)
|
int amount, const char *cm)
|
||||||
{
|
{
|
||||||
curse *c;
|
curse *c;
|
||||||
int shipId;
|
int shipId;
|
||||||
|
@ -137,34 +137,34 @@ use_trappedairelemental(struct unit * u, const struct item_type * itype,
|
||||||
}
|
}
|
||||||
|
|
||||||
c = create_curse(u, &sh->attribs, ct_find("shipspeedup"),
|
c = create_curse(u, &sh->attribs, ct_find("shipspeedup"),
|
||||||
20, 999999, SPEEDUP, 0);
|
20, 999999, SPEEDUP, 0);
|
||||||
curse_setflag(c, CURSE_NOAGE);
|
curse_setflag(c, CURSE_NOAGE);
|
||||||
|
|
||||||
ADDMSG(&u->faction->msgs, msg_message("trappedairelemental_success",
|
ADDMSG(&u->faction->msgs, msg_message("trappedairelemental_success",
|
||||||
"unit region command ship", u, u->region, cm, sh));
|
"unit region command ship", u, u->region, cm, sh));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static resource_type rt_trappedairelemental = {
|
static resource_type rt_trappedairelemental = {
|
||||||
{ "trappedairelemental", "trappedairelemental_p" },
|
{ "trappedairelemental", "trappedairelemental_p" },
|
||||||
{ "trappedairelemental", "trappedairelemental_p" },
|
{ "trappedairelemental", "trappedairelemental_p" },
|
||||||
RTF_ITEM,
|
RTF_ITEM,
|
||||||
&res_changeitem
|
&res_changeitem
|
||||||
};
|
};
|
||||||
|
|
||||||
item_type it_trappedairelemental = {
|
item_type it_trappedairelemental = {
|
||||||
&rt_trappedairelemental, /* resourcetype */
|
&rt_trappedairelemental, /* resourcetype */
|
||||||
0, 1, 0, /* flags, weight, capacity */
|
0, 1, 0, /* flags, weight, capacity */
|
||||||
NULL, /* construction */
|
NULL, /* construction */
|
||||||
&use_trappedairelemental,
|
&use_trappedairelemental,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
use_aurapotion50(struct unit * u, const struct item_type * itype,
|
use_aurapotion50(struct unit * u, const struct item_type * itype,
|
||||||
int amount, const char *cm)
|
int amount, const char *cm)
|
||||||
{
|
{
|
||||||
if(!is_mage(u)) {
|
if(!is_mage(u)) {
|
||||||
cmistake(u, cm, 214, MSG_MAGIC);
|
cmistake(u, cm, 214, MSG_MAGIC);
|
||||||
|
@ -174,25 +174,25 @@ use_aurapotion50(struct unit * u, const struct item_type * itype,
|
||||||
change_spellpoints(u, 50);
|
change_spellpoints(u, 50);
|
||||||
|
|
||||||
ADDMSG(&u->faction->msgs, msg_message("aurapotion50",
|
ADDMSG(&u->faction->msgs, msg_message("aurapotion50",
|
||||||
"unit region command", u, u->region, cm));
|
"unit region command", u, u->region, cm));
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static resource_type rt_aurapotion50 = {
|
static resource_type rt_aurapotion50 = {
|
||||||
{ "aurapotion50", "aurapotion50_p" },
|
{ "aurapotion50", "aurapotion50_p" },
|
||||||
{ "aurapotion50", "aurapotion50_p" },
|
{ "aurapotion50", "aurapotion50_p" },
|
||||||
RTF_ITEM,
|
RTF_ITEM,
|
||||||
&res_changeitem
|
&res_changeitem
|
||||||
};
|
};
|
||||||
|
|
||||||
item_type it_aurapotion50 = {
|
item_type it_aurapotion50 = {
|
||||||
&rt_aurapotion50, /* resourcetype */
|
&rt_aurapotion50, /* resourcetype */
|
||||||
0, 1, 0, /* flags, weight, capacity */
|
0, 1, 0, /* flags, weight, capacity */
|
||||||
NULL, /* construction */
|
NULL, /* construction */
|
||||||
&use_aurapotion50,
|
&use_aurapotion50,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BAGPIPEFRACTION dice_rand("2d4+2")
|
#define BAGPIPEFRACTION dice_rand("2d4+2")
|
||||||
|
@ -200,7 +200,7 @@ item_type it_aurapotion50 = {
|
||||||
|
|
||||||
static int
|
static int
|
||||||
use_bagpipeoffear(struct unit * u, const struct item_type * itype,
|
use_bagpipeoffear(struct unit * u, const struct item_type * itype,
|
||||||
int amount, const char *cm)
|
int amount, const char *cm)
|
||||||
{
|
{
|
||||||
int money;
|
int money;
|
||||||
|
|
||||||
|
@ -214,31 +214,107 @@ use_bagpipeoffear(struct unit * u, const struct item_type * itype,
|
||||||
rsetmoney(u->region, rmoney(u->region) - money);
|
rsetmoney(u->region, rmoney(u->region) - money);
|
||||||
|
|
||||||
create_curse(u, &u->region->attribs, ct_find("depression"),
|
create_curse(u, &u->region->attribs, ct_find("depression"),
|
||||||
20, BAGPIPEDURATION, 0, 0);
|
20, BAGPIPEDURATION, 0, 0);
|
||||||
|
|
||||||
ADDMSG(&u->faction->msgs, msg_message("bagpipeoffear_faction",
|
ADDMSG(&u->faction->msgs, msg_message("bagpipeoffear_faction",
|
||||||
"unit region command money", u, u->region, cm, money));
|
"unit region command money", u, u->region, cm, money));
|
||||||
|
|
||||||
ADDMSG(&u->region->msgs, msg_message("bagpipeoffear_region",
|
ADDMSG(&u->region->msgs, msg_message("bagpipeoffear_region",
|
||||||
"unit money", u, money));
|
"unit money", u, money));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static resource_type rt_bagpipeoffear = {
|
static resource_type rt_bagpipeoffear = {
|
||||||
{ "bagpipeoffear", "bagpipeoffear_p" },
|
{ "bagpipeoffear", "bagpipeoffear_p" },
|
||||||
{ "bagpipeoffear", "bagpipeoffear_p" },
|
{ "bagpipeoffear", "bagpipeoffear_p" },
|
||||||
RTF_ITEM,
|
RTF_ITEM,
|
||||||
&res_changeitem
|
&res_changeitem
|
||||||
};
|
};
|
||||||
|
|
||||||
item_type it_bagpipeoffear = {
|
item_type it_bagpipeoffear = {
|
||||||
&rt_bagpipeoffear, /* resourcetype */
|
&rt_bagpipeoffear, /* resourcetype */
|
||||||
0, 1, 0, /* flags, weight, capacity */
|
0, 1, 0, /* flags, weight, capacity */
|
||||||
NULL, /* construction */
|
NULL, /* construction */
|
||||||
&use_bagpipeoffear,
|
&use_bagpipeoffear,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
static int
|
||||||
|
use_instantartacademy(struct unit * u, const struct item_type * itype,
|
||||||
|
int amount, const char *cm)
|
||||||
|
{
|
||||||
|
building *b;
|
||||||
|
|
||||||
|
if(u->region->land == NULL) {
|
||||||
|
cmistake(u, cm, 242, MSG_MAGIC);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
b = new_building(bt_find("artacademy"), u->region, u->faction->locale);
|
||||||
|
b->size = 100;
|
||||||
|
sprintf(buf, "%s", LOC(u->faction->locale, "artacademy"));
|
||||||
|
set_string(&b->name, buf);
|
||||||
|
|
||||||
|
ADDMSG(&u->region->msgs, msg_message(
|
||||||
|
"artacademy_create", "unit command", u, cm));
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static resource_type rt_instantartacademy = {
|
||||||
|
{ "instantartacademy", "instantartacademy_p" },
|
||||||
|
{ "instantartacademy", "instantartacademy_p" },
|
||||||
|
RTF_ITEM,
|
||||||
|
&res_changeitem
|
||||||
|
};
|
||||||
|
|
||||||
|
item_type it_instantartacademy = {
|
||||||
|
&rt_instantartacademy, /* resourcetype */
|
||||||
|
0, 1, 0, /* flags, weight, capacity */
|
||||||
|
NULL, /* construction */
|
||||||
|
&use_instantartacademy,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
static int
|
||||||
|
use_instantartsculpture(struct unit * u, const struct item_type * itype,
|
||||||
|
int amount, const char *cm)
|
||||||
|
{
|
||||||
|
building *b;
|
||||||
|
|
||||||
|
if(u->region->land == NULL) {
|
||||||
|
cmistake(u, cm, 242, MSG_MAGIC);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
b = new_building(bt_find("artsculpture"), u->region, u->faction->locale);
|
||||||
|
b->size = 100;
|
||||||
|
sprintf(buf, "%s", LOC(u->faction->locale, "artsculpture"));
|
||||||
|
set_string(&b->name, buf);
|
||||||
|
|
||||||
|
ADDMSG(&u->region->msgs, msg_message(
|
||||||
|
"artsculpture_create", "unit region command", u, cm));
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static resource_type rt_instantartsculpture = {
|
||||||
|
{ "instantartsculpture", "instantartsculpture_p" },
|
||||||
|
{ "instantartsculpture", "instantartsculpture_p" },
|
||||||
|
RTF_ITEM,
|
||||||
|
&res_changeitem
|
||||||
|
};
|
||||||
|
|
||||||
|
item_type it_instantartsculpture = {
|
||||||
|
&rt_instantartsculpture, /* resourcetype */
|
||||||
|
0, 1, 0, /* flags, weight, capacity */
|
||||||
|
NULL, /* construction */
|
||||||
|
&use_instantartsculpture,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -335,4 +411,3 @@ register_artrewards(void)
|
||||||
it_register(&it_instantartsculpture);
|
it_register(&it_instantartsculpture);
|
||||||
register_function((pf_generic)use_instantartsculpture, "instantartsculpture");
|
register_function((pf_generic)use_instantartsculpture, "instantartsculpture");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,9 @@
|
||||||
<Filter
|
<Filter
|
||||||
Name="Header"
|
Name="Header"
|
||||||
Filter="*.h">
|
Filter="*.h">
|
||||||
|
<File
|
||||||
|
RelativePath=".\artrewards.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\birthday_firework.h">
|
RelativePath=".\birthday_firework.h">
|
||||||
</File>
|
</File>
|
||||||
|
@ -151,6 +154,9 @@
|
||||||
RelativePath=".\xerewards.h">
|
RelativePath=".\xerewards.h">
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<File
|
||||||
|
RelativePath=".\artrewards.c">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\birthday_firework.c">
|
RelativePath=".\birthday_firework.c">
|
||||||
</File>
|
</File>
|
||||||
|
|
|
@ -377,7 +377,9 @@ troop
|
||||||
select_corpse(battle * b, fighter * af)
|
select_corpse(battle * b, fighter * af)
|
||||||
/* Wählt eine Leiche aus, der af hilft. casualties ist die Anzahl der
|
/* Wählt eine Leiche aus, der af hilft. casualties ist die Anzahl der
|
||||||
* Toten auf allen Seiten (im Array). Wenn af == NULL, wird die
|
* Toten auf allen Seiten (im Array). Wenn af == NULL, wird die
|
||||||
* Parteizugehörigkeit ignoriert, und irgendeine Leiche genommen. */
|
* Parteizugehörigkeit ignoriert, und irgendeine Leiche genommen.
|
||||||
|
*
|
||||||
|
* Untote werden nicht ausgewählt (casualties, not dead) */
|
||||||
{
|
{
|
||||||
troop dt =
|
troop dt =
|
||||||
{0, 0};
|
{0, 0};
|
||||||
|
@ -2307,16 +2309,17 @@ aftermath(battle * b)
|
||||||
|
|
||||||
#ifdef TROLLSAVE
|
#ifdef TROLLSAVE
|
||||||
/* Trolle können regenerieren */
|
/* Trolle können regenerieren */
|
||||||
if (df->alive > 0 && dead && old_race(du->race) == RC_TROLL) {
|
if (df->alive > 0 && dead>0 && old_race(du->race) == RC_TROLL) {
|
||||||
for (i = 0; i != dead; ++i) {
|
for (i = 0; i != dead; ++i) {
|
||||||
if (chance(TROLL_REGENERATION)) {
|
if (chance(TROLL_REGENERATION)) {
|
||||||
++df->alive;
|
++df->alive;
|
||||||
++df->side->alive;
|
++df->side->alive;
|
||||||
++df->side->battle->alive;
|
++df->side->battle->alive;
|
||||||
++trollsave[df->side->index];
|
++trollsave[df->side->index];
|
||||||
--dead;
|
/* do not change dead here, or loop will not terminate! recalculate later */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dead = du->number - df->alive - df->run.number;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Regeneration durch PR_MERCY */
|
/* Regeneration durch PR_MERCY */
|
||||||
|
@ -2326,19 +2329,23 @@ aftermath(battle * b)
|
||||||
++df->alive;
|
++df->alive;
|
||||||
++df->side->alive;
|
++df->side->alive;
|
||||||
++df->side->battle->alive;
|
++df->side->battle->alive;
|
||||||
--dead;
|
/* do not change dead here, or loop will not terminate! recalculate later */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dead = du->number - df->alive - df->run.number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tote, die wiederbelebt werde können */
|
/* tote insgesamt: */
|
||||||
|
df->side->dead += dead;
|
||||||
|
/* Tote, die wiederbelebt werde können: */
|
||||||
if (playerrace(df->unit->race)) {
|
if (playerrace(df->unit->race)) {
|
||||||
df->side->casualties += dead;
|
df->side->casualties += dead;
|
||||||
}
|
}
|
||||||
#ifdef SHOW_KILLS
|
#ifdef SHOW_KILLS
|
||||||
if (df->hits + df->kills) {
|
if (df->hits + df->kills) {
|
||||||
struct message * m = new_message(du->faction, "killsandhits%u:unit%i:hits%i:kills", du, df->hits, df->kills);
|
struct message * m = msg_message("killsandhits", "unit hits kills", du, df->hits, df->kills);
|
||||||
message_faction(b, du->faction, m);
|
message_faction(b, du->faction, m);
|
||||||
|
msg_release(m);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -2372,7 +2379,6 @@ aftermath(battle * b)
|
||||||
relevant = true;
|
relevant = true;
|
||||||
}
|
}
|
||||||
s->flee = 0;
|
s->flee = 0;
|
||||||
s->dead = 0;
|
|
||||||
|
|
||||||
cv_foreach(df, s->fighters) {
|
cv_foreach(df, s->fighters) {
|
||||||
unit *du = df->unit;
|
unit *du = df->unit;
|
||||||
|
@ -2394,8 +2400,6 @@ aftermath(battle * b)
|
||||||
sum_hp += df->person[n].hp;
|
sum_hp += df->person[n].hp;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->dead += dead;
|
|
||||||
|
|
||||||
if (df->alive == du->number) continue; /* nichts passiert */
|
if (df->alive == du->number) continue; /* nichts passiert */
|
||||||
|
|
||||||
/* die weggerannten werden später subtrahiert! */
|
/* die weggerannten werden später subtrahiert! */
|
||||||
|
|
|
@ -92,7 +92,7 @@ extern "C" {
|
||||||
int removed; /* stoned */
|
int removed; /* stoned */
|
||||||
int flee;
|
int flee;
|
||||||
int dead;
|
int dead;
|
||||||
int casualties;
|
int casualties; /* those dead that were real people, not undead! */
|
||||||
int healed;
|
int healed;
|
||||||
boolean dh;
|
boolean dh;
|
||||||
boolean stealth; /* Die Einheiten sind getarnt */
|
boolean stealth; /* Die Einheiten sind getarnt */
|
||||||
|
|
|
@ -941,7 +941,7 @@ sp_chaosrow(fighter * fi, int level, double power, spell * sp)
|
||||||
n = df->unit->number;
|
n = df->unit->number;
|
||||||
|
|
||||||
if (chance(power/n)) {
|
if (chance(power/n)) {
|
||||||
row = statusrow(df->status);
|
row = statusrow(df->status)+FIRST_ROW;
|
||||||
df->side->size[row] -= df->alive;
|
df->side->size[row] -= df->alive;
|
||||||
if (df->unit->race->battle_flags & BF_NOBLOCK) {
|
if (df->unit->race->battle_flags & BF_NOBLOCK) {
|
||||||
df->side->nonblockers[row] -= df->alive;
|
df->side->nonblockers[row] -= df->alive;
|
||||||
|
@ -1569,6 +1569,9 @@ sp_reanimate(fighter * fi, int level, double power, spell * sp)
|
||||||
++t.fighter->side->size[t.fighter->unit->status + 1];
|
++t.fighter->side->size[t.fighter->unit->status + 1];
|
||||||
++t.fighter->side->healed;
|
++t.fighter->side->healed;
|
||||||
--t.fighter->side->casualties;
|
--t.fighter->side->casualties;
|
||||||
|
assert(t.fighter->side->casualties>=0);
|
||||||
|
--t.fighter->side->dead;
|
||||||
|
assert(t.fighter->side->dead>=0);
|
||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1712,8 +1715,8 @@ sp_undeadhero(fighter * fi, int level, double power, spell * sp)
|
||||||
int maxrow = AVOID_ROW;
|
int maxrow = AVOID_ROW;
|
||||||
cvector *fgs;
|
cvector *fgs;
|
||||||
void **fig;
|
void **fig;
|
||||||
int n, j, undead = 0;
|
int n, undead = 0;
|
||||||
int k = (int)get_force(power,0);
|
int force = (int)get_force(power,0);
|
||||||
double c = 0.50 + 0.02 * power;
|
double c = 0.50 + 0.02 * power;
|
||||||
|
|
||||||
/* Liste aus allen Kämpfern */
|
/* Liste aus allen Kämpfern */
|
||||||
|
@ -1724,42 +1727,38 @@ sp_undeadhero(fighter * fi, int level, double power, spell * sp)
|
||||||
fighter *df = *fig;
|
fighter *df = *fig;
|
||||||
unit *du = df->unit;
|
unit *du = df->unit;
|
||||||
|
|
||||||
if (!k)
|
if (force<=0) break;
|
||||||
break;
|
|
||||||
|
|
||||||
/* keine Monster */
|
/* keine Monster */
|
||||||
if (!playerrace(du->race))
|
if (!playerrace(du->race)) continue;
|
||||||
continue;
|
|
||||||
|
|
||||||
if (df->alive + df->run.number < du->number) {
|
if (df->alive + df->run.number < du->number) {
|
||||||
j = 0;
|
int j = 0;
|
||||||
|
|
||||||
/* Wieviele Untote können wir aus dieser Einheit wecken? */
|
/* Wieviele Untote können wir aus dieser Einheit wecken? */
|
||||||
for (n = df->alive + df->run.number; n <= du->number; n++) {
|
for (n = df->alive + df->run.number; n <= du->number; n++) {
|
||||||
if (!k) break;
|
|
||||||
|
|
||||||
if (chance(c)) {
|
if (chance(c)) {
|
||||||
undead++;
|
++j;
|
||||||
j++;
|
if (--force<=0) break;
|
||||||
--df->side->casualties;
|
|
||||||
++df->side->alive;
|
|
||||||
--k;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j > 0) {
|
if (j > 0) {
|
||||||
int hp = unit_max_hp(du);
|
int hp = unit_max_hp(du);
|
||||||
|
undead += j;
|
||||||
|
df->side->casualties -= j;
|
||||||
if (j == du->number) {
|
if (j == du->number) {
|
||||||
/* Einheit war vollständig tot und konnte vollständig zu
|
/* Einheit war vollständig tot und konnte vollständig zu
|
||||||
* Untoten gemacht werden */
|
* Untoten gemacht werden */
|
||||||
int nr;
|
int nr;
|
||||||
|
|
||||||
|
df->side->dead -= j;
|
||||||
|
df->side->alive += j;
|
||||||
du->race = new_race[RC_UNDEAD];
|
du->race = new_race[RC_UNDEAD];
|
||||||
setguard(du, GUARD_NONE);
|
setguard(du, GUARD_NONE);
|
||||||
u_setfaction(du,mage->faction);
|
u_setfaction(du,mage->faction);
|
||||||
if (fval(mage, UFL_PARTEITARNUNG))
|
if (fval(mage, UFL_PARTEITARNUNG))
|
||||||
fset(du, UFL_PARTEITARNUNG);
|
fset(du, UFL_PARTEITARNUNG);
|
||||||
df->alive = du->number;
|
|
||||||
/* den Toten wieder volle Hitpoints geben */
|
/* den Toten wieder volle Hitpoints geben */
|
||||||
for (nr = 0; nr != df->alive; ++nr) {
|
for (nr = 0; nr != df->alive; ++nr) {
|
||||||
df->person[nr].hp = hp;
|
df->person[nr].hp = hp;
|
||||||
|
|
|
@ -2694,7 +2694,7 @@ wage(const region *r, const unit *u, boolean img)
|
||||||
curse * c;
|
curse * c;
|
||||||
int wage;
|
int wage;
|
||||||
attrib *a;
|
attrib *a;
|
||||||
building_type *artsculpture_type = bt_find("artsculpture");
|
const building_type *artsculpture_type = bt_find("artsculpture");
|
||||||
static const curse_type * drought_ct, * blessedharvest_ct;
|
static const curse_type * drought_ct, * blessedharvest_ct;
|
||||||
static boolean init;
|
static boolean init;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue