forked from github/server
removed karma and luck
This commit is contained in:
parent
c80ea1254e
commit
560fed45fb
|
@ -2,7 +2,7 @@
|
|||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="build"
|
||||
Name="amalgamation-basic"
|
||||
ProjectGUID="{4A17DAEE-2261-4E2C-96F6-BA4132A09551}"
|
||||
RootNamespace="build"
|
||||
SccProjectName="Svn"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include <gamecode/give.c>
|
||||
#include <gamecode/items.c>
|
||||
#include <gamecode/laws.c>
|
||||
#include <gamecode/luck.c>
|
||||
#include <gamecode/market.c>
|
||||
#include <gamecode/monster.c>
|
||||
#include <gamecode/randenc.c>
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include <kernel/faction.c>
|
||||
#include <kernel/group.c>
|
||||
#include <kernel/item.c>
|
||||
#include <kernel/karma.c>
|
||||
#include <kernel/magic.c>
|
||||
#include <kernel/message.c>
|
||||
#include <kernel/move.c>
|
||||
|
|
|
@ -213,14 +213,6 @@
|
|||
RelativePath=".\gamecode\laws.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\gamecode\luck.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\gamecode\luck.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\gamecode\market.c"
|
||||
>
|
||||
|
|
|
@ -38,7 +38,6 @@ without prior permission by the authors of Eressea.
|
|||
#include <kernel/faction.h>
|
||||
#include <kernel/group.h>
|
||||
#include <kernel/item.h>
|
||||
#include <kernel/karma.h>
|
||||
#include <kernel/magic.h>
|
||||
#include <kernel/message.h>
|
||||
#include <kernel/move.h>
|
||||
|
@ -688,11 +687,6 @@ cr_output_unit(FILE * F, const region * r,
|
|||
|
||||
assert(u && u->number);
|
||||
|
||||
#if KARMA_MODULE
|
||||
if (fspecial(u->faction, FS_HIDDEN))
|
||||
a_fshidden = a_find(u->attribs, &at_fshidden);
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
fprintf(F, "EINHEIT %d\n", u->no);
|
||||
fprintf(F, "\"%s\";Name\n", u->name);
|
||||
str = u_description(u, f->locale);
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include <kernel/equipment.h>
|
||||
#include <kernel/faction.h>
|
||||
#include <kernel/item.h>
|
||||
#include <kernel/karma.h>
|
||||
#include <kernel/magic.h>
|
||||
#include <kernel/message.h>
|
||||
#include <kernel/move.h>
|
||||
|
@ -260,10 +259,6 @@ add_recruits(unit * u, int number, int wanted)
|
|||
unit * unew;
|
||||
char equipment[64];
|
||||
|
||||
#if KARMA_MODULE
|
||||
int i = fspecial(u->faction, FS_MILITIA);
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
if (u->number==0) {
|
||||
set_number(u, number);
|
||||
u->hp = number * unit_max_hp(u);
|
||||
|
@ -280,22 +275,6 @@ add_recruits(unit * u, int number, int wanted)
|
|||
change_level(unew, SK_RIDING, 1);
|
||||
}
|
||||
|
||||
#if KARMA_MODULE
|
||||
if (i > 0) {
|
||||
if (unew->race->bonus[SK_SPEAR] >= 0)
|
||||
change_level(unew, SK_SPEAR, i);
|
||||
if (unew->race->bonus[SK_MELEE] >= 0)
|
||||
change_level(unew, SK_MELEE, i);
|
||||
if (unew->race->bonus[SK_LONGBOW] >= 0)
|
||||
change_level(unew, SK_LONGBOW, i);
|
||||
if (unew->race->bonus[SK_CROSSBOW] >= 0)
|
||||
change_level(unew, SK_CROSSBOW, i);
|
||||
if (unew->race->bonus[SK_RIDING] >= 0)
|
||||
change_level(unew, SK_RIDING, i);
|
||||
if (unew->race->bonus[SK_STAMINA] >= 0)
|
||||
change_level(unew, SK_STAMINA, i);
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
if (unew!=u) {
|
||||
transfermen(unew, u, unew->number);
|
||||
remove_unit(&r->units, unew);
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
#include <kernel/faction.h>
|
||||
#include <kernel/group.h>
|
||||
#include <kernel/item.h>
|
||||
#include <kernel/karma.h>
|
||||
#include <kernel/magic.h>
|
||||
#include <kernel/message.h>
|
||||
#include <kernel/move.h>
|
||||
|
@ -3472,15 +3471,6 @@ monthly_healing(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
#if KARMA_MODULE
|
||||
if (fspecial(u->faction, FS_UNDEAD)) continue;
|
||||
|
||||
if(fspecial(u->faction, FS_REGENERATION)) {
|
||||
u->hp = umhp;
|
||||
continue;
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
p *= heal_factor(u);
|
||||
if (u->hp < umhp) {
|
||||
#ifdef NEW_DAEMONHUNGER_RULE
|
||||
|
@ -3984,9 +3974,6 @@ init_processor(void)
|
|||
add_proc_order(p, K_NAME, &name_cmd, 0, NULL);
|
||||
add_proc_order(p, K_GUARD, &guard_off_cmd, 0, NULL);
|
||||
add_proc_order(p, K_RESHOW, &reshow_cmd, 0, NULL);
|
||||
#if KARMA_MODULE
|
||||
add_proc_order(p, K_WEREWOLF, &setwere_cmd, 0, NULL);
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
if (get_param_int(global.parameters, "rules.alliances", 0)==1) {
|
||||
p+=10;
|
||||
|
@ -4012,10 +3999,6 @@ init_processor(void)
|
|||
add_proc_order(p, K_LEAVE, &leave_cmd, 0, "Verlassen");
|
||||
|
||||
if (!nobattle) {
|
||||
#if KARMA_MODULE
|
||||
p+=10;
|
||||
add_proc_global(p, &jihad_attacks, "Jihad-Angriffe");
|
||||
#endif
|
||||
add_proc_region(p, &do_battle, "Attackieren");
|
||||
}
|
||||
|
||||
|
@ -4107,10 +4090,6 @@ init_processor(void)
|
|||
p+=10;
|
||||
add_proc_global(p, &reorder, "Einheiten sortieren");
|
||||
}
|
||||
#if KARMA_MODULE
|
||||
p+=10;
|
||||
add_proc_global(p, &karma, "Jihads setzen");
|
||||
#endif
|
||||
add_proc_order(p, K_PROMOTION, &promotion_cmd, 0, "Heldenbefoerderung");
|
||||
if (!global.disabled[K_NUMBER]) {
|
||||
add_proc_order(p, K_NUMBER, &renumber_cmd, 0, "Neue Nummern (Einheiten)");
|
||||
|
|
|
@ -1,187 +0,0 @@
|
|||
/* vi: set ts=2:
|
||||
*
|
||||
*
|
||||
* Eressea PB(E)M host Copyright (C) 1998-2003
|
||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||
* Henning Peters (faroul@beyond.kn-bremen.de)
|
||||
* Enno Rehling (enno@eressea.de)
|
||||
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
|
||||
*
|
||||
* based on:
|
||||
*
|
||||
* Atlantis v1.0 13 September 1993 Copyright 1993 by Russell Wallace
|
||||
* Atlantis v1.7 Copyright 1996 by Alex Schröder
|
||||
*
|
||||
* This program may not be used, modified or distributed without
|
||||
* prior permission by the authors of Eressea.
|
||||
* This program may not be sold or used commercially without prior written
|
||||
* permission from the authors.
|
||||
*/
|
||||
|
||||
#include <platform.h>
|
||||
#include <kernel/config.h>
|
||||
|
||||
#include "luck.h"
|
||||
|
||||
/* attributes includes */
|
||||
#include <attributes/racename.h>
|
||||
#include <items/weapons.h>
|
||||
|
||||
#include "economy.h"
|
||||
#include "randenc.h"
|
||||
|
||||
/* kernel include */
|
||||
#include <kernel/unit.h>
|
||||
#include <kernel/faction.h>
|
||||
#include <kernel/item.h>
|
||||
#include <kernel/message.h>
|
||||
#include <kernel/race.h>
|
||||
#include <kernel/pool.h>
|
||||
#include <kernel/region.h>
|
||||
#include <kernel/skill.h>
|
||||
#include <kernel/karma.h>
|
||||
|
||||
/* util includes */
|
||||
#include <util/rand.h>
|
||||
#include <util/rng.h>
|
||||
#include <util/message.h>
|
||||
|
||||
/* libc includes */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
|
||||
#if KARMA_MODULE
|
||||
|
||||
#define STANDARD_LUCK 0
|
||||
|
||||
static void
|
||||
lucky_silver(const unit *u)
|
||||
{
|
||||
int i = 0, r, max = 0;
|
||||
int luck = fspecial(u->faction, FS_LUCKY);
|
||||
|
||||
do {
|
||||
r = 1 + rng_int()%(10000*(luck+STANDARD_LUCK));
|
||||
if(r > max) max = r;
|
||||
i++;
|
||||
} while(i <= luck);
|
||||
|
||||
i_change(&((unit *)u)->items, i_silver, max);
|
||||
|
||||
ADDMSG(&u->faction->msgs, msg_message("lucky_item",
|
||||
"unit item amount", u, i_silver->rtype, max));
|
||||
}
|
||||
|
||||
typedef struct luckyitem {
|
||||
const char * name;
|
||||
int weight; /* weighting the item */
|
||||
} luckyitem;
|
||||
|
||||
static void
|
||||
lucky_item(const unit *u)
|
||||
{
|
||||
int i = 0, r, max = 0;
|
||||
item_type *itype;
|
||||
int amount;
|
||||
int luck = fspecial(u->faction, FS_LUCKY);
|
||||
/* Das ist schöner so, denke ich... */
|
||||
static int nitems = 0;
|
||||
static int maxweight = 0;
|
||||
struct luckyitem it_list[] = {
|
||||
{ "mallorn", 1 },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
if (nitems==0) {
|
||||
while (it_list[nitems].name) {
|
||||
maxweight +=it_list[nitems].weight;
|
||||
++nitems;
|
||||
}
|
||||
}
|
||||
/* weight is unused */
|
||||
r = rng_int()%nitems;
|
||||
|
||||
do {
|
||||
r = rng_int()%nitems;
|
||||
if(r > max) max = r;
|
||||
i++;
|
||||
} while(i <= luck);
|
||||
|
||||
itype = it_find(it_list[r].name);
|
||||
|
||||
if(luck)
|
||||
amount = 10 + rng_int()%(luck*40) + rng_int()%(luck*40);
|
||||
else
|
||||
amount = 5 + rng_int()%10 +rng_int()%10;
|
||||
|
||||
i_change(&((unit *)u)->items, itype, amount);
|
||||
ADDMSG(&u->faction->msgs, msg_message("lucky_item",
|
||||
"unit item amount", u, itype->rtype, amount));
|
||||
}
|
||||
|
||||
static void
|
||||
lucky_magic_item(const unit *u)
|
||||
{
|
||||
#if defined(__GNUC__) && !defined(__STDC__)
|
||||
item_type *itype;
|
||||
int amount;
|
||||
int luck = fspecial(u->faction, FS_LUCKY);
|
||||
const int n_items = 13;
|
||||
item_type *it_list[] = {
|
||||
olditemtype[I_AMULET_OF_HEALING],
|
||||
olditemtype[I_AMULET_OF_TRUE_SEEING],
|
||||
olditemtype[I_RING_OF_INVISIBILITY],
|
||||
olditemtype[I_RING_OF_POWER],
|
||||
olditemtype[I_FIRESWORD],
|
||||
olditemtype[I_CHASTITY_BELT],
|
||||
olditemtype[I_FEENSTIEFEL],
|
||||
olditemtype[I_ANTIMAGICCRYSTAL],
|
||||
olditemtype[I_RING_OF_NIMBLEFINGER],
|
||||
olditemtype[I_TROLLBELT],
|
||||
olditemtype[I_TACTICCRYSTAL],
|
||||
olditemtype[I_SACK_OF_CONSERVATION],
|
||||
};
|
||||
|
||||
itype = it_list[rng_int()%n_items];
|
||||
amount = 1 + rng_int()%luck;
|
||||
|
||||
i_change(&((unit *)u)->items, itype, amount);
|
||||
ADDMSG(&u->faction->msgs, msg_message("lucky_item",
|
||||
"unit item amount", u, itype->rtype, amount));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
lucky_event(const faction *f)
|
||||
{
|
||||
const unit *u = random_unit_in_faction(f);
|
||||
|
||||
if(!u) return;
|
||||
|
||||
switch(rng_int()%3) {
|
||||
case 0:
|
||||
lucky_silver(u);
|
||||
break;
|
||||
case 1:
|
||||
lucky_item(u);
|
||||
break;
|
||||
case 2:
|
||||
lucky_magic_item(u);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
check_luck(void)
|
||||
{
|
||||
faction *f;
|
||||
|
||||
for(f=factions; f; f=f->next) {
|
||||
if(rng_int()%100 < STANDARD_LUCK+fspecial(f, FS_LUCKY)*8)
|
||||
lucky_event(f);
|
||||
}
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
|
@ -1,35 +0,0 @@
|
|||
/* vi: set ts=2:
|
||||
*
|
||||
*
|
||||
* Eressea PB(E)M host Copyright (C) 1998-2003
|
||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||
* Henning Peters (faroul@beyond.kn-bremen.de)
|
||||
* Enno Rehling (enno@eressea.de)
|
||||
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
|
||||
*
|
||||
* based on:
|
||||
*
|
||||
* Atlantis v1.0 13 September 1993 Copyright 1993 by Russell Wallace
|
||||
* Atlantis v1.7 Copyright 1996 by Alex Schröder
|
||||
*
|
||||
* This program may not be used, modified or distributed without
|
||||
* prior permission by the authors of Eressea.
|
||||
* This program may not be sold or used commercially without prior written
|
||||
* permission from the authors.
|
||||
*/
|
||||
|
||||
#ifndef H_GC_LUCK
|
||||
#define H_GC_LUCK
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void check_luck(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -24,7 +24,6 @@
|
|||
#include "randenc.h"
|
||||
|
||||
#include "economy.h"
|
||||
#include "luck.h"
|
||||
#include "monster.h"
|
||||
|
||||
/* kernel includes */
|
||||
|
@ -35,7 +34,6 @@
|
|||
#include <kernel/equipment.h>
|
||||
#include <kernel/faction.h>
|
||||
#include <kernel/item.h>
|
||||
#include <kernel/karma.h>
|
||||
#include <kernel/magic.h>
|
||||
#include <kernel/message.h>
|
||||
#include <kernel/move.h>
|
||||
|
@ -618,11 +616,7 @@ drown(region *r)
|
|||
unit ** up = up=&r->units;
|
||||
while (*up) {
|
||||
unit *u = *up;
|
||||
#if KARMA_MODULE
|
||||
int amphibian_level = fspecial(u->faction, FS_AMPHIBIAN);
|
||||
#else
|
||||
int amphibian_level = 0;
|
||||
#endif
|
||||
if (u->ship || u->race == new_race[RC_SPELL] || u->number==0) {
|
||||
up=&u->next;
|
||||
continue;
|
||||
|
@ -1127,30 +1121,6 @@ icebergs(void)
|
|||
}
|
||||
}
|
||||
|
||||
#if KARMA_MODULE
|
||||
static void
|
||||
karma_update(void)
|
||||
{
|
||||
faction * f;
|
||||
/* lycanthropen werden werwölfe */
|
||||
for (f = factions; f; f=f->next) {
|
||||
if (f->alive) {
|
||||
int level = fspecial(f, FS_LYCANTROPE);
|
||||
if (level > 0) {
|
||||
unit * u;
|
||||
for(u = f->units; u; u=u->nextF) {
|
||||
if (rng_int()%100 < 2*level) {
|
||||
ADDMSG(&u->faction->msgs,
|
||||
msg_message("becomewere", "unit region", u, u->region));
|
||||
fset(u, UFL_WERE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HERBS_ROT
|
||||
static void
|
||||
rotting_herbs(void)
|
||||
|
@ -1286,10 +1256,6 @@ randomevents(void)
|
|||
}
|
||||
}
|
||||
|
||||
#if KARMA_MODULE
|
||||
karma_update();
|
||||
#endif
|
||||
|
||||
/* Chaos */
|
||||
for (r = regions; r; r = r->next) {
|
||||
int i;
|
||||
|
@ -1308,7 +1274,4 @@ randomevents(void)
|
|||
|
||||
dissolve_units();
|
||||
check_split();
|
||||
#if KARMA_MODULE
|
||||
check_luck();
|
||||
#endif /* KARMA_MODULE */
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include <kernel/faction.h>
|
||||
#include <kernel/group.h>
|
||||
#include <kernel/item.h>
|
||||
#include <kernel/karma.h>
|
||||
#include <kernel/message.h>
|
||||
#include <kernel/move.h>
|
||||
#include <kernel/objtypes.h>
|
||||
|
@ -1980,28 +1979,6 @@ report_plaintext(const char * filename, report_context * ctx, const char * chars
|
|||
centre(F, alliancename(f->alliance), true);
|
||||
}
|
||||
|
||||
#if KARMA_MODULE
|
||||
buf[0] = 0;
|
||||
dh = 0;
|
||||
for (a=a_find(f->attribs, &at_faction_special); a && a->type==&at_faction_special; a=a->next) {
|
||||
char buf2[80];
|
||||
dh++;
|
||||
if (fspecials[a->data.sa[0]].maxlevel != 100) {
|
||||
sprintf(buf2, "%s (%d)", fspecials[a->data.sa[0]].name, a->data.sa[1]);
|
||||
} else {
|
||||
sprintf(buf2, "%s", fspecials[a->data.sa[0]].name);
|
||||
}
|
||||
if(dh > 1) strcat(buf, ", ");
|
||||
strcat(buf, buf2);
|
||||
}
|
||||
if(dh > 0) centre(F, buf, true);
|
||||
|
||||
if (f->karma > 0) {
|
||||
sprintf(buf, "Deine Partei hat %d Karma.", f->karma);
|
||||
centre(F, buf, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (f->age <= 2) {
|
||||
const char * s;
|
||||
if (f->age <= 1) {
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include <kernel/build.h>
|
||||
#include <kernel/reports.h>
|
||||
#include <kernel/item.h>
|
||||
#include <kernel/karma.h>
|
||||
#include <kernel/faction.h>
|
||||
#include <kernel/magic.h>
|
||||
#include <kernel/message.h>
|
||||
|
@ -170,44 +169,6 @@ spy_cmd(unit * u, struct order * ord)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
setwere_cmd(unit *u, struct order * ord)
|
||||
{
|
||||
#if KARMA_MODULE
|
||||
int level = fspecial(u->faction, FS_LYCANTROPE);
|
||||
const char *s;
|
||||
|
||||
if (!level) {
|
||||
cmistake(u, ord, 311, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
init_tokens(ord);
|
||||
skip_token();
|
||||
s = getstrtoken();
|
||||
|
||||
if (s == NULL || *s == '\0') {
|
||||
if(fval(u, UFL_WERE)) {
|
||||
cmistake(u, ord, 309, MSG_EVENT);
|
||||
} else if(rng_int()%100 < 35+(level-1)*20) { /* 35, 55, 75, 95% */
|
||||
fset(u, UFL_WERE);
|
||||
} else {
|
||||
cmistake(u, ord, 311, MSG_EVENT);
|
||||
}
|
||||
} else if (findparam(s, u->faction->locale) == P_NOT) {
|
||||
if(fval(u, UFL_WERE)) {
|
||||
cmistake(u, ord, 310, MSG_EVENT);
|
||||
} else if(rng_int()%100 < 90-level*20) { /* 70, 50, 30, 10% */
|
||||
freset(u, UFL_WERE);
|
||||
} else {
|
||||
cmistake(u, ord, 311, MSG_EVENT);
|
||||
}
|
||||
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
set_factionstealth(unit * u, faction * f)
|
||||
{
|
||||
|
@ -328,43 +289,6 @@ setstealth_cmd(unit * u, struct order * ord)
|
|||
/* TARNE ALLES (was nicht so alles geht?) */
|
||||
u_seteffstealth(u, -1);
|
||||
break;
|
||||
#if KARMA_MODULE
|
||||
case P_NUMBER:
|
||||
/* TARNE ANZAHL [NICHT] */
|
||||
if (!fspecial(u->faction, FS_HIDDEN)) {
|
||||
cmistake(u, ord, 277, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
s = getstrtoken();
|
||||
if (findparam(s, u->faction->locale) == P_NOT) {
|
||||
attrib * a = a_find(u->attribs, &at_fshidden);
|
||||
if (a==NULL) a->data.ca[0] = 0;
|
||||
if (a->data.i == 0) a_remove(&u->attribs, a);
|
||||
} else {
|
||||
attrib * a = a_find(u->attribs, &at_fshidden);
|
||||
if (a!=NULL) a = a_add(&u->attribs, a_new(&at_fshidden));
|
||||
a->data.ca[0] = 1;
|
||||
}
|
||||
break;
|
||||
#endif /* KARMA_MODULE */
|
||||
#if KARMA_MODULE
|
||||
case P_ITEMS:
|
||||
/* TARNE GEGENSTÄNDE [NICHT] */
|
||||
if(!fspecial(u->faction, FS_HIDDEN)) {
|
||||
cmistake(u, ord, 277, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
if (findparam(s, u->faction->locale) == P_NOT) {
|
||||
attrib * a = a_find(u->attribs, &at_fshidden);
|
||||
if (a!=NULL) a->data.ca[1] = 0;
|
||||
if (a->data.i == 0) a_remove(&u->attribs, a);
|
||||
} else {
|
||||
attrib * a = a_find(u->attribs, &at_fshidden);
|
||||
if (a==NULL) a = a_add(&u->attribs, a_new(&at_fshidden));
|
||||
a->data.ca[1] = 1;
|
||||
}
|
||||
break;
|
||||
#endif /* KARMA_MODULE */
|
||||
case P_NOT:
|
||||
u_seteffstealth(u, -1);
|
||||
break;
|
||||
|
|
|
@ -29,7 +29,6 @@ struct unit;
|
|||
struct region;
|
||||
struct strlist;
|
||||
|
||||
extern int setwere_cmd(struct unit * u, struct order * ord);
|
||||
extern int setstealth_cmd(struct unit * u, struct order * ord);
|
||||
extern int spy_cmd(struct unit * u, struct order * ord);
|
||||
extern int sabotage_cmd(struct unit * u, struct order * ord);
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include <kernel/building.h>
|
||||
#include <kernel/faction.h>
|
||||
#include <kernel/item.h>
|
||||
#include <kernel/karma.h>
|
||||
#include <kernel/magic.h>
|
||||
#include <kernel/message.h>
|
||||
#include <kernel/move.h>
|
||||
|
@ -708,21 +707,6 @@ learn_cmd(unit * u, order * ord)
|
|||
change_effect(u, oldpotiontype[P_FOOL], -l);
|
||||
}
|
||||
|
||||
#if KARMA_MODULE
|
||||
l = fspecial(u->faction, FS_WARRIOR);
|
||||
if (l > 0) {
|
||||
if (sk == SK_CROSSBOW || sk == SK_LONGBOW
|
||||
|| sk == SK_CATAPULT || sk == SK_MELEE || sk == SK_SPEAR
|
||||
|| sk == SK_STAMINA || sk == SK_WEAPONLESS)
|
||||
{
|
||||
teach->value += u->number * 5 * (l+1);
|
||||
} else {
|
||||
teach->value -= u->number * 5 * (l+1);
|
||||
teach->value = MAX(0, teach->value);
|
||||
}
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
if (p != studycost) {
|
||||
/* ist_in_gebaeude(r, u, BT_UNIVERSITAET) == 1) { */
|
||||
/* p ist Kosten ohne Uni, studycost mit; wenn
|
||||
|
|
|
@ -36,7 +36,6 @@ without prior permission by the authors of Eressea.
|
|||
#include <kernel/faction.h>
|
||||
#include <kernel/group.h>
|
||||
#include <kernel/item.h>
|
||||
#include <kernel/karma.h>
|
||||
#include <kernel/magic.h>
|
||||
#include <kernel/message.h>
|
||||
#include <kernel/move.h>
|
||||
|
|
|
@ -277,14 +277,6 @@
|
|||
RelativePath=".\kernel\item.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\kernel\karma.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\kernel\karma.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\kernel\magic.c"
|
||||
>
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "faction.h"
|
||||
#include "group.h"
|
||||
#include "item.h"
|
||||
#include "karma.h"
|
||||
#include "magic.h"
|
||||
#include "message.h"
|
||||
#include "move.h"
|
||||
|
@ -1104,13 +1103,6 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
|
|||
++at.fighter->hits;
|
||||
#endif
|
||||
|
||||
#if KARMA_MODULE
|
||||
if (fval(au, UFL_WERE)) {
|
||||
int level = fspecial(du->faction, FS_LYCANTROPE);
|
||||
da += level;
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
switch (type) {
|
||||
case AT_STANDARD:
|
||||
weapon = select_weapon(at, true, missile);
|
||||
|
@ -1156,14 +1148,6 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
|
|||
/* Momentan nur Trollgürtel und Werwolf-Eigenschaft */
|
||||
am = select_magicarmor(dt);
|
||||
|
||||
#if KARMA_MODULE
|
||||
if(fval(du, UFL_WERE)) {
|
||||
/* this counts as magical armor */
|
||||
int level = fspecial(du->faction, FS_LYCANTROPE);
|
||||
am += level;
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
#if CHANGED_CROSSBOWS
|
||||
if (awtype && fval(awtype, WTF_ARMORPIERCING)) {
|
||||
/* crossbows */
|
||||
|
@ -1189,22 +1173,6 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
|
|||
ar += am;
|
||||
|
||||
if (type!=AT_COMBATSPELL && type!=AT_SPELL) {
|
||||
#if KARMA_MODULE
|
||||
int faerie_level = fspecial(du->faction, FS_FAERIE);
|
||||
|
||||
da += jihad(au->faction, du->race);
|
||||
if (type == AT_STANDARD && faerie_level) {
|
||||
int c;
|
||||
|
||||
for (c=0;weapon->type->itype->construction->materials[c].number; c++) {
|
||||
if(weapon->type->itype->construction->materials[c].rtype == oldresourcetype[R_IRON]) {
|
||||
da += faerie_level;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
if (damage_rules&DAMAGE_CRITICAL) {
|
||||
double kritchance = (sk * 3 - sd) / 200.0;
|
||||
|
||||
|
@ -1905,13 +1873,6 @@ skilldiff(troop at, troop dt, int dist)
|
|||
skdiff += 5;
|
||||
}
|
||||
|
||||
#if KARMA_MODULE
|
||||
/* Werwolf */
|
||||
if(fval(au, UFL_WERE)) {
|
||||
skdiff += fspecial(au->faction, FS_LYCANTROPE);
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
if (au->race == new_race[RC_GOBLIN]) {
|
||||
static int goblin_bonus = -1;
|
||||
if (goblin_bonus<0) goblin_bonus = get_param_int(global.parameters, "rules.combat.goblinbonus", 10);
|
||||
|
@ -1920,11 +1881,6 @@ skilldiff(troop at, troop dt, int dist)
|
|||
}
|
||||
}
|
||||
|
||||
#if KARMA_MODULE
|
||||
/* TODO this should be a skillmod */
|
||||
skdiff += jihad(au->faction, du->race);
|
||||
#endif
|
||||
|
||||
if (df->building) {
|
||||
boolean init = false;
|
||||
static const curse_type * strongwall_ct, * magicwalls_ct;
|
||||
|
@ -2695,16 +2651,6 @@ aftermath(battle * b)
|
|||
unit *du = df->unit;
|
||||
int dead = dead_fighters(df);
|
||||
int pr_mercy = 0;
|
||||
#if KARMA_MODULE
|
||||
const attrib *a= a_find(du->attribs, &at_prayer_effect);
|
||||
|
||||
while (a && a->type==&at_prayer_effect) {
|
||||
if (a->data.sa[0] == PR_MERCY) {
|
||||
pr_mercy = a->data.sa[1];
|
||||
}
|
||||
a = a->next;
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
#ifdef TROLLSAVE
|
||||
/* Trolle können regenerieren */
|
||||
|
@ -3357,15 +3303,6 @@ make_fighter(battle * b, unit * u, side * s1, boolean attack)
|
|||
/* Effekte von Artefakten */
|
||||
strongmen = MIN(fig->unit->number, get_item(u, I_TROLLBELT));
|
||||
|
||||
#if KARMA_MODULE
|
||||
for (a = a_find(u->attribs, &at_prayer_effect); a && a->type==&at_prayer_effect; a = a->next) {
|
||||
if (a->data.sa[0] == PR_AID) {
|
||||
pr_aid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
/* Hitpoints, Attack- und Defence-Boni für alle Personen */
|
||||
for (i = 0; i < fig->alive; i++) {
|
||||
assert(i < fig->unit->number);
|
||||
|
@ -4414,18 +4351,6 @@ do_battle(region * r)
|
|||
battle_update(b);
|
||||
battle_attacks(b);
|
||||
|
||||
#if KARMA_MODULE
|
||||
/* Regeneration */
|
||||
for (fi=0;fi!=b->nfighters;++fi) {
|
||||
fighter *fig = b->fighters[fi];
|
||||
|
||||
if (fspecial(fig->unit->faction, FS_REGENERATION)) {
|
||||
fig->fighting = fig->alive - fig->removed;
|
||||
if (fig->fighting == 0) continue;
|
||||
do_regenerate(fig);
|
||||
}
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
}
|
||||
|
||||
if (verbosity>0) log_stdio(stdout, "\n");
|
||||
|
|
|
@ -379,12 +379,6 @@ static int eressea_building_protection(building * b, unit * u)
|
|||
int beff = buildingeffsize(b, false)-1;
|
||||
/* -1 because the tradepost has no protection value */
|
||||
|
||||
#if KARMA_MODULE
|
||||
if (fspecial(u->faction, FS_SAPPER)) {
|
||||
/* Halbe Schutzwirkung, aufgerundet */
|
||||
beff = (beff+1)/2;
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
return beff;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include "faction.h"
|
||||
#include "group.h"
|
||||
#include "item.h"
|
||||
#include "karma.h"
|
||||
#include "magic.h"
|
||||
#include "message.h"
|
||||
#include "move.h"
|
||||
|
@ -556,9 +555,6 @@ max_magicians(const faction * f)
|
|||
m = a->data.i;
|
||||
}
|
||||
if (f->race == new_race[RC_ELF]) ++m;
|
||||
#if KARMA_MODULE
|
||||
m += fspecial(f, FS_MAGOCRACY) * 2;
|
||||
#endif /* KARMA_MODULE */
|
||||
return m;
|
||||
}
|
||||
|
||||
|
@ -2429,7 +2425,6 @@ int
|
|||
weight(const unit * u)
|
||||
{
|
||||
int w, n = 0, in_bag = 0;
|
||||
int faerie_level = 0;
|
||||
|
||||
item * itm;
|
||||
for (itm=u->items;itm;itm=itm->next) {
|
||||
|
@ -2439,15 +2434,7 @@ weight(const unit * u)
|
|||
in_bag += w;
|
||||
}
|
||||
|
||||
#if KARMA_MODULE
|
||||
faerie_level = fspecial(u->faction, FS_FAERIE);
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
if (faerie_level) {
|
||||
n += (u->number * u->race->weight)/(1+faerie_level);
|
||||
} else {
|
||||
n += u->number * u->race->weight;
|
||||
}
|
||||
n += u->number * u->race->weight;
|
||||
|
||||
w = get_item(u, I_BAG_OF_HOLDING) * BAGCAPACITY;
|
||||
if( w > in_bag )
|
||||
|
@ -2522,14 +2509,6 @@ lifestyle(const unit * u)
|
|||
if (pl && fval(pl, PFL_NOFEED))
|
||||
return 0;
|
||||
|
||||
#if KARMA_MODULE
|
||||
if(fspecial(u->faction, FS_REGENERATION))
|
||||
need += 1;
|
||||
if(fspecial(u->faction, FS_ADMINISTRATOR))
|
||||
need += 1;
|
||||
if(fspecial(u->faction, FS_WYRM) && u->race == new_race[RC_WYRM])
|
||||
need *= 500;
|
||||
#endif /* KARMA_MODULE */
|
||||
return need;
|
||||
}
|
||||
|
||||
|
@ -2809,11 +2788,6 @@ default_wage(const region *r, const faction * f, const race * rc, int in_turn)
|
|||
index = 1;
|
||||
}
|
||||
wage = wagetable[esize][index];
|
||||
#if KARMA_MODULE
|
||||
if (fspecial(f, FS_URBAN)) {
|
||||
wage += wagetable[esize][3];
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
} else {
|
||||
if (is_mourning(r, in_turn)) {
|
||||
wage = 10;
|
||||
|
@ -3129,13 +3103,6 @@ attrib_init(void)
|
|||
at_register(&at_guard);
|
||||
at_register(&at_group);
|
||||
|
||||
#if KARMA_MODULE
|
||||
at_register(&at_faction_special);
|
||||
at_register(&at_prayer_timeout);
|
||||
at_register(&at_wyrm);
|
||||
at_register(&at_jihad);
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
at_register(&at_building_generic_type);
|
||||
at_register(&at_maxmagicians);
|
||||
at_register(&at_npcfaction);
|
||||
|
|
|
@ -86,9 +86,6 @@ typedef struct faction {
|
|||
int money;
|
||||
#if SCORE_MODULE
|
||||
int score;
|
||||
#endif
|
||||
#if KARMA_MODULE
|
||||
int karma;
|
||||
#endif
|
||||
struct alliance * alliance;
|
||||
#ifdef VICTORY_DELAY
|
||||
|
|
|
@ -1,606 +0,0 @@
|
|||
/* vi: set ts=2:
|
||||
*
|
||||
* Eressea PB(E)M host Copyright (C) 1998-2003
|
||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||
* Henning Peters (faroul@beyond.kn-bremen.de)
|
||||
* Enno Rehling (enno@eressea.de)
|
||||
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
|
||||
*
|
||||
* This program may not be used, modified or distributed without
|
||||
* prior permission by the authors of Eressea.
|
||||
*/
|
||||
|
||||
/* TODO: enum auf fst_ umstellen. Pointer auf Display-Routine */
|
||||
#include <platform.h>
|
||||
#include <kernel/config.h>
|
||||
|
||||
#include "karma.h"
|
||||
|
||||
/* kernel includes */
|
||||
#include "unit.h"
|
||||
#include "save.h"
|
||||
#include "race.h"
|
||||
#include "region.h"
|
||||
#include "item.h"
|
||||
#include "group.h"
|
||||
#include "order.h"
|
||||
#include "pool.h"
|
||||
#include "skill.h"
|
||||
#include "faction.h"
|
||||
#include "magic.h"
|
||||
#include "message.h"
|
||||
|
||||
/* util includes */
|
||||
#include <util/attrib.h>
|
||||
#include <util/base36.h>
|
||||
#include <util/rng.h>
|
||||
|
||||
/* libc includes */
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
attrib_type at_faction_special = {
|
||||
"faction_special", NULL, NULL, NULL, a_writeshorts, a_readshorts
|
||||
};
|
||||
|
||||
int
|
||||
age_prayer_timeout(attrib *a) {
|
||||
return (--a->data.sa[0]>0)?AT_AGE_KEEP:AT_AGE_REMOVE;
|
||||
}
|
||||
|
||||
attrib_type at_prayer_timeout = {
|
||||
"prayer_timeout", NULL, NULL, age_prayer_timeout, a_writeshorts, a_readshorts
|
||||
};
|
||||
|
||||
attrib_type at_prayer_effect = {
|
||||
"prayer_effect", NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
attrib_type at_wyrm = {
|
||||
"wyrm", NULL, NULL, NULL, a_writeint, a_readint
|
||||
};
|
||||
|
||||
attrib_type at_fshidden = {
|
||||
"fshidden", NULL, NULL, NULL, a_writeint, a_readint
|
||||
};
|
||||
|
||||
attrib_type at_jihad = {
|
||||
"jihad", NULL, NULL, NULL, a_writeshorts, a_readshorts
|
||||
};
|
||||
|
||||
#if KARMA_MODULE
|
||||
struct fspecialdata fspecials[MAXFACTIONSPECIALS] = {
|
||||
{
|
||||
"Regeneration",
|
||||
"Personen in einer Partei mit dieser Eigenschaft heilen jeden "
|
||||
"Schaden innerhalb einer Woche und zusätzlich in jeder Kampfrunde "
|
||||
"HP entsprechend ihres Ausdauer-Talents. Sie benötigen jedoch 11 "
|
||||
"Silber Unterhalt pro Woche.",
|
||||
1
|
||||
},
|
||||
{ /* TODO: Für alte Parteien zu stark */
|
||||
"Städter",
|
||||
"Personen einer Partei mit dieser Eigenschaft lieben die Städte und "
|
||||
"verabscheuen das Leben in der freien Natur. Ihr Arbeitlohn verändert "
|
||||
"sich in Abhängigkeit vom größten Gebäude in der Region. Ist es eine "
|
||||
"Zitadelle so erhalten sie 2 Silber mehr pro Runde, bei einer Festung "
|
||||
"1 Silber mehr. Bei einer Burg bekommen sie den normalen Arbeitslohn, "
|
||||
"bei einem Turm 1 Silber, bei einer Befestigung 3 Silber weniger. Gibt "
|
||||
"es kein entsprechendes Gebäude in der Region, verringert sich ihr "
|
||||
"Arbeitslohn um 5 Silber.",
|
||||
1
|
||||
},
|
||||
{
|
||||
"Barbar",
|
||||
"Einheiten dieser Partei erhalten durch Lernen von Waffentalenten "
|
||||
"(Taktik und Reiten zählen nicht dazu!) 40 statt 30 Lerntage. Weitere "
|
||||
"Stufen erhöhen den Bonus um 5 Lerntage. Die Fokussierung auf das "
|
||||
"Kriegerdasein führt jedoch zu Problemen, andere Talente zu erlernen. "
|
||||
"In allen nichtkriegerischen Talenten einschließlich Magie und Taktik "
|
||||
"erhalten sie die entsprechende Anzahl von Lerntagen weniger pro "
|
||||
"Lernwoche.",
|
||||
100
|
||||
},
|
||||
/* TODO: Noch nicht so implementiert. */
|
||||
{
|
||||
"Wyrm",
|
||||
"Eine Partei mit dieser Eigenschaft kann einen ihrer Magier mit Hilfe "
|
||||
"eines speziellen Zaubers permanent in einen Drachen verwandeln. Der "
|
||||
"Drache ist zunächst jung, kann sich jedoch durch Lernen des speziellen "
|
||||
"Talents 'Drachenwesen' in einen größeren Drachen verwandeln. Um zu "
|
||||
"einem ausgewachsenen Drachen zu werden benötigt der verwandelte Magier "
|
||||
"die Talentstufe 6, um zu einem Wyrm zu werden die Talentstufe 12. "
|
||||
"Ein junger Drache benötigt 1000 Silber Unterhalt pro Woche, ein "
|
||||
"ausgewachsener Drache 5000 und ein Wyrm 10000 Silber. Bekommt er "
|
||||
"dieses Silber nicht, besteht eine Wahrscheinlichkeit, das er desertiert!",
|
||||
100
|
||||
},
|
||||
/* TODO: Relativ sinnlose Eigenschaft. */
|
||||
{
|
||||
"Miliz",
|
||||
"Alle Personen dieser Partei beginnen mit 30 Talenttagen in allen "
|
||||
"Waffentalenten, in denen ihre Rasse keinen Malus hat. Zusätzliche "
|
||||
"Stufen bringen jeweils einen zusätzlichen Talentpunkt.",
|
||||
100
|
||||
},
|
||||
{ /* Ohne Schiffsunterhaltskosten schwache Eigenschaft. */
|
||||
/* Aufpassen: Tragkraft? */
|
||||
"Feenreich",
|
||||
"Alle Personen dieser Partei wiegen nur noch die Hälfte ihres normalen "
|
||||
"Gewichtes. Die Nähe zum Feenreich macht sie jedoch besonders "
|
||||
"anfällig gegen Waffen aus Eisen, bei einem Treffer durch eine "
|
||||
"solche Waffe nehmen sie einen zusätzlichen Schadenspunkt. Zusätzliche "
|
||||
"Stufen dieser Eigenschaft verringern das Gewicht auf 1/3, 1/4, ... und "
|
||||
"erhöhen den Schaden durch Eisenwaffen um einen weiteren Punkt.",
|
||||
100
|
||||
},
|
||||
{
|
||||
"Administrator",
|
||||
"Das Einheitenlimit einer Partei mit dieser Eigenschaft erhöht sich um "
|
||||
"400 Einheiten. Leider verschlingt der Verwaltungsaufwand viel Silber, "
|
||||
"so dass sich der Unterhalt pro Person um 1 Silberstück erhöht. Weitere "
|
||||
"Stufen der Eigenschaft erhöhen das Limit um weitere 400 Einheiten und "
|
||||
"den Unterhalt um ein weiteres Silberstück.",
|
||||
100
|
||||
},
|
||||
/* TODO: Noch nicht so implementiert */
|
||||
{
|
||||
"Telepath",
|
||||
"Der Geist fremder Personen bleibt den Magiern einer Partei mit dieser "
|
||||
"Eigenschaft nicht verschlossen. Fremde Einheiten erscheinen im Report "
|
||||
"wie eigene Einheiten, mit allen Talentwerten und Gegenständen. Leider "
|
||||
"führt eine so intensive Beschäftigung mit dem Geistigen zur körperlichen "
|
||||
"Verkümmerung, und die Partei erhält -1 auf alle Talente außer "
|
||||
"Alchemie, Kräuterkunde, Magie, Spionage, Tarnung und Wahrnehmung. Wird "
|
||||
"diese Eigenschaft ein zweites Mal erworben, so bleibt die Wirkung nicht "
|
||||
"auf Magier beschränkt, sondern alle Einheiten einer Partei können "
|
||||
"die Talente und Gegenstände aller fremden Einheiten sehen. Allerdings "
|
||||
"gibt es in beiden Fällen eine Einschränkung: Die Einheit muß sich einen "
|
||||
"Monat lang auf die psychischen Ströme einer Region einstellen, bevor "
|
||||
"sie in der Lage ist, die Gedanken der anderen zu lesen.",
|
||||
2
|
||||
},
|
||||
{
|
||||
"Amphibium",
|
||||
"Einheiten dieser Partei können durch Ozeanfelder laufen. Allerdings "
|
||||
"nehmen sie 10 Schadenspunkte, wenn sie am Ende einer Woche in einem "
|
||||
"Ozeanfeld stehen. Pferde weigern sich, in ein Ozeanfeld zu laufen. "
|
||||
"Zusätzliche Stufen dieser Eigenschaft reduzieren den Schaden um jeweils "
|
||||
"5 Punkte. Achtung: Auf dem Ozean wird kein Schaden regeneriert.",
|
||||
3
|
||||
},
|
||||
/* TODO: negative Eigenschaft */
|
||||
{
|
||||
"Magokrat",
|
||||
"Eine Partei mit dieser Eigenschaft hat eine so hohe magische "
|
||||
"Affinität, dass sie pro Stufe der Eigenschaft zwei zusätzlich "
|
||||
"Magier ausbilden kann.",
|
||||
100
|
||||
},
|
||||
/* TODO: negative Eigenschaft, vergleichsweise schwach */
|
||||
{
|
||||
"Sappeur",
|
||||
"Befestigungen wirken gegen Einheiten einer Partei mit dieser "
|
||||
"Eigenschaft nur mit ihrer halben Schutzwirkung (aufgerundet).",
|
||||
1
|
||||
},
|
||||
/* TODO: Noch nicht implementiert */
|
||||
{
|
||||
"Springer",
|
||||
"Einheiten einer Partei mit dieser Eigenschaft können sich mit "
|
||||
"Hilfe eines speziellen Befehls über eine Entfernung von zwei "
|
||||
"Regionen teleportieren. Einheiten, die sich so teleportieren, "
|
||||
"bleiben jedoch für einige Wochen instabil und können sich in "
|
||||
"seltenen Fällen selbständig in eine zufällige Nachbarregion "
|
||||
"versetzen. Zusätzliche Stufen erhöhen die Reichweite um jeweils "
|
||||
"eine Region, erhöhen jedoch die Wahrscheinlichkeit eines zufälligen "
|
||||
"Versetzens geringfügig.",
|
||||
100
|
||||
},
|
||||
{
|
||||
/* Evt. zwei Stufen draus machen */
|
||||
"Versteckt",
|
||||
"Eine Partei mit dieser Eigenschaft hat die Fähigkeit zu Tarnung "
|
||||
"zur Perfektion getrieben. Jede Einheit mit mindestens Tarnung 3 "
|
||||
"versteckt alle ihre Gegenstände so, daß sie von anderen Parteien "
|
||||
"nicht mehr gesehen werden können. Jede Einheit mit mindestens Tarnung 6 "
|
||||
"schafft es auch, die Zahl der in ihr befindlichen Personen zu verbergen. "
|
||||
"Um diese Eigenschaft steuern zu können, stehen diesen Parteien die "
|
||||
"Befehle TARNE ANZAHL [NICHT] und TARNE GEGENSTÄNDE [NICHT] zur "
|
||||
"Verfügung.",
|
||||
1
|
||||
},
|
||||
/* TODO: Noch nicht implementiert */
|
||||
{
|
||||
"Erdelementarist",
|
||||
"Alle Gebäude dieser Partei sind von Erdelementaren beseelt und können "
|
||||
"sich mit Hilfe eines speziellen Befehls jede Woche um eine Region "
|
||||
"bewegen. Dies macht es den Bewohnern - welche alle einer Partei mit "
|
||||
"dieser Eigenschaft angehören müssen - jedoch unmöglich, in dieser "
|
||||
"Woche ihren normalen Tätigkeiten nachzugehen.",
|
||||
1
|
||||
},
|
||||
{
|
||||
"Magische Immunität",
|
||||
"Eine Partei mit dieser Eigenschaft ist völlig immun gegen alle Arten "
|
||||
"von Magie. Allerdings verlieren die Magier einer solchen Partei ihre "
|
||||
"Fähigkeit, Aura zu regenerieren, völlig.",
|
||||
1
|
||||
},
|
||||
/* TODO: Noch nicht implementiert */
|
||||
{
|
||||
"Vielseitige Magie",
|
||||
"Eine Partei mit dieser Eigenschaft kann einen ihrer Magier in einem "
|
||||
"anderen als dem Parteimagiegebiet ausbilden. Weitere Stufen ermöglichen "
|
||||
"jeweils einem weiteren Magier das Lernen eines anderen Gebiets.",
|
||||
100
|
||||
},
|
||||
{
|
||||
"Jihad",
|
||||
"Eine Partei mit dieser Eigenschaft kann eine (Spieler)-Rasse "
|
||||
"mit dem speziellen kurzen Befehl JIHAD <RASSE> zum Feind erklären. "
|
||||
"Bei einem Kampf gegen einen Angehörigen dieser Rasse bekommen ihre "
|
||||
"Kämpfer grundsätzlich einen Bonus von +1 auf Angriff und Schaden. "
|
||||
"Allerdings kann es zu spontanen Pogromen gegen Angehörige der mit einem "
|
||||
"Jihad belegten Rasse kommen. Wird die Eigenschaft mehrmals erworben "
|
||||
"können entweder mehrere Rassen mit einem Jihad belegt werden, "
|
||||
"oder eine Rasse mehrfach, in diesem Fall addiert sich die Wirkung. "
|
||||
"Ein einmal erklärter Jihad kann nicht wieder rückgängig gemacht "
|
||||
"werden.",
|
||||
100
|
||||
},
|
||||
/* TODO: is_undead() und Sonderbehandlungen von Untoten */
|
||||
/* in dieser Form ultimative Eigenschaft für Orks */
|
||||
{
|
||||
"Untot",
|
||||
"Personen einer Partei mit dieser Eigenschaft bekommen automatisch doppelt "
|
||||
"soviele Trefferpunkte wie normale Angehörige der entsprechenden Rasse, "
|
||||
"verlieren jedoch ihre Fähigkeit zur Regeneration erlittenen Schadens "
|
||||
"komplett.",
|
||||
1
|
||||
},
|
||||
{
|
||||
"Windvolk",
|
||||
"Ein solches Volk ist sehr athletisch und die Kinder üben besonders "
|
||||
"den Langstreckenlauf von kleinauf. Nach jahrelangem Training sind "
|
||||
"sie dann in der Lage, sich zu Fuß so schnell zu bewegen als würden "
|
||||
"sie reiten. Allerdings hat das jahrelange Konditionstraining ihre "
|
||||
"Kräfte schwinden lassen, und ihre Tragkraft ist um 2 Gewichtseinheiten "
|
||||
"verringert.",
|
||||
1
|
||||
},
|
||||
{
|
||||
"Glück",
|
||||
"Diese Eigenschaft bewirkt, das der Partei gelegentlich positive "
|
||||
"Ereignisse zustoßen. Dies können spontane Verbesserungen des "
|
||||
"Wissensstandes, ein Fund wertvoller Gegenstände oder ähnliches "
|
||||
"sein. Je häufiger diese Eigenschaft erworben wird, desto größer die "
|
||||
"Wahrscheinlichkeit für solche Ereignisse, und desto postiver ihre "
|
||||
"Auswirkungen.",
|
||||
100
|
||||
},
|
||||
{
|
||||
"Lykanthrop",
|
||||
"Angehörige einer Partei mit dieser Eigenschaft sind Werwesen. Einheiten "
|
||||
"einer solchen Partei können sich mit Hilfe der langen Befehle 'WERWESEN' und "
|
||||
"'WERWESEN NICHT' in eine andere Form verwandeln. Beide Befehle haben "
|
||||
"nur eine gewisse Erfolgswahrscheinlichkeit und funktionieren nicht immer: "
|
||||
"Je höher die Stufe der Eigenschaft, desto größer die Wahrscheinlichkeit, "
|
||||
"dass die Verwandlung gelingt, und je geringer die Chance, sich "
|
||||
"zurückzuverwandeln. Zudem besteht eine zunehmende kleine Chance der "
|
||||
"spontanen Verwandlung. In Werform erhalten die Einheiten einen Bonus auf "
|
||||
"Angriff, Schaden und natürliche Rüstung in Höhe der Eigenschaft. Sie "
|
||||
"benutzen jedoch keine Pferde im Kampf, und verwenden als Rüstungen nur "
|
||||
"Schilde. Sie sind eingeschränkt und können in Werform kein Geld verdienen, "
|
||||
"nicht Zaubern und nicht Lernen oder Lehren.",
|
||||
4
|
||||
},
|
||||
/* TODO: Noch nicht implementiert */
|
||||
{
|
||||
"Elite",
|
||||
"Für eine Partei mit dieser Eigenschaft verdoppeln sich alle Boni- und "
|
||||
"Mali ihrer Rasse. Ihre Unterhaltskosten erhöhen sich auf 12 Silber pro "
|
||||
"Runde, ihr Einheitenlimit reduziert sich auf 25%%. Diese Eigenschaft "
|
||||
"kann nicht erworben werden, wenn die Partei nach dem Erwerb zuviele "
|
||||
"Einheiten hätte.",
|
||||
1
|
||||
}
|
||||
};
|
||||
|
||||
void
|
||||
buy_special(unit *u, struct order * ord, fspecial_t special)
|
||||
{
|
||||
int count = 0;
|
||||
int cost;
|
||||
attrib *a, *a2 = NULL;
|
||||
faction *f = u->faction;
|
||||
|
||||
/* Kosten berechnen */
|
||||
|
||||
for(a=a_find(f->attribs, &at_faction_special); a && a->type==&at_faction_special; a=a->next) {
|
||||
count += a->data.sa[1];
|
||||
if(a->data.sa[0] == special) a2 = a;
|
||||
}
|
||||
|
||||
cost = (int)(100 * pow(3, count));
|
||||
|
||||
/* Prüfen, ob genug Karma vorhanden. */
|
||||
|
||||
if(f->karma < cost) {
|
||||
cmistake(u, ord, 250, MSG_EVENT);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Alles ok, attribut geben */
|
||||
|
||||
if (a2) {
|
||||
if(a2->data.sa[1] < fspecials[special].maxlevel) {
|
||||
a2->data.sa[1]++;
|
||||
ADDMSG(&f->msgs, msg_message("new_fspecial_level",
|
||||
"special level", special, a2->data.sa[1]));
|
||||
} else {
|
||||
cmistake(u, ord, 251, MSG_EVENT);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
a2 = a_add(&f->attribs, a_new(&at_faction_special));
|
||||
a2->data.sa[0] = (short)special;
|
||||
a2->data.sa[1] = 1;
|
||||
ADDMSG(&f->msgs, msg_message("new_fspecial", "special", special));
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
fspecial(const faction *f, fspecial_t special)
|
||||
{
|
||||
attrib *a;
|
||||
|
||||
for (a=a_find(f->attribs, &at_faction_special); a && a->type==&at_faction_special; a=a->next) {
|
||||
if(a->data.sa[0] == special) return a->data.sa[1];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
sacrifice_cmd(unit * u, struct order * ord)
|
||||
{
|
||||
int n = 1, karma;
|
||||
const char *s;
|
||||
|
||||
init_tokens(ord);
|
||||
skip_token();
|
||||
s = getstrtoken();
|
||||
|
||||
if (s && *s) n = atoi(s);
|
||||
if (n <= 0) {
|
||||
cmistake(u, ord, 252, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s = getstrtoken();
|
||||
|
||||
switch(findparam(s, u->faction->locale)) {
|
||||
case P_MONEY:
|
||||
n = use_pooled(u, oldresourcetype[R_SILVER], GET_DEFAULT, n);
|
||||
if(n < 10000) {
|
||||
cmistake(u, ord, 51, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
change_resource(u, oldresourcetype[R_SILVER], n);
|
||||
karma = n/10000;
|
||||
u->faction->karma += karma;
|
||||
break;
|
||||
|
||||
case P_AURA:
|
||||
if(!is_mage(u)) {
|
||||
cmistake(u, ord, 214, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
if (get_level(u, SK_MAGIC) < 10) {
|
||||
cmistake(u, ord, 253, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
n = MIN(get_spellpoints(u), min(max_spellpoints(u->region, u), n));
|
||||
if(n <= 0) {
|
||||
cmistake(u, ord, 254, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
karma = n;
|
||||
u->faction->karma += n;
|
||||
change_maxspellpoints(u, -n);
|
||||
break;
|
||||
default:
|
||||
cmistake(u, u->thisorder, 255, MSG_EVENT);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
prayer_cmd(unit * u, struct order * ord)
|
||||
{
|
||||
region *r = u->region;
|
||||
attrib *a, *a2;
|
||||
unit *u2;
|
||||
int karma_cost;
|
||||
short mult = 1;
|
||||
param_t p;
|
||||
const char *s;
|
||||
|
||||
init_tokens(ord);
|
||||
skip_token();
|
||||
s = getstrtoken();
|
||||
|
||||
if (findparam(s, u->faction->locale) == P_FOR) s = getstrtoken();
|
||||
p = findparam(s, u->faction->locale);
|
||||
|
||||
switch(p) {
|
||||
case P_AURA:
|
||||
if (!is_mage(u)) {
|
||||
cmistake(u, ord, 214, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
case P_AID:
|
||||
case P_MERCY:
|
||||
break;
|
||||
default:
|
||||
cmistake(u, ord, 256, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
a = a_find(u->faction->attribs, &at_prayer_timeout);
|
||||
if (a) mult = (short)(2 * a->data.sa[1]);
|
||||
karma_cost = 10 * mult;
|
||||
|
||||
if (u->faction->karma < karma_cost) {
|
||||
cmistake(u, ord, 250, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
u->faction->karma -= karma_cost;
|
||||
|
||||
ADDMSG(&u->faction->msgs, msg_message("pray_success", "unit", u));
|
||||
|
||||
switch (p) {
|
||||
case P_AURA:
|
||||
set_spellpoints(u, max_spellpoints(u->region, u));
|
||||
break;
|
||||
case P_AID:
|
||||
for(u2 = r->units; u2; u2=u2->next) if(u2->faction == u->faction) {
|
||||
a2 = a_add(&u->attribs, a_new(&at_prayer_effect));
|
||||
a2->data.sa[0] = PR_AID;
|
||||
a2->data.sa[1] = 1;
|
||||
}
|
||||
break;
|
||||
case P_MERCY:
|
||||
for(u2 = r->units; u2; u2=u2->next) if(u2->faction == u->faction) {
|
||||
a2 = a_add(&u->attribs, a_new(&at_prayer_effect));
|
||||
a2->data.sa[0] = PR_MERCY;
|
||||
a2->data.sa[1] = 80;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(!a) a = a_add(&u->faction->attribs, a_new(&at_prayer_timeout));
|
||||
a->data.sa[0] = (short)(mult * 14);
|
||||
a->data.sa[1] = (short)mult;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
jihad_cmd(unit * u, struct order * ord)
|
||||
{
|
||||
faction *f = u->faction;
|
||||
int can = fspecial(f, FS_JIHAD);
|
||||
int has = 0;
|
||||
const race * jrace;
|
||||
race_t jrt;
|
||||
attrib *a;
|
||||
const char *s;
|
||||
|
||||
for (a = a_find(f->attribs, &at_jihad); a && a->type==&at_jihad; a = a->next) {
|
||||
has += a->data.sa[1];
|
||||
}
|
||||
|
||||
if (has >= can) {
|
||||
cmistake(u, ord, 280, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
init_tokens(ord);
|
||||
skip_token();
|
||||
s = getstrtoken();
|
||||
|
||||
if (!s || !*s) {
|
||||
cmistake(u, ord, 281, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
jrace = rc_find(s);
|
||||
jrt = old_race(jrace);
|
||||
|
||||
if (!playerrace(jrace)) {
|
||||
cmistake(u, ord, 282, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (a = a_find(f->attribs, &at_jihad); a && a->type==&at_jihad; a = a->next) {
|
||||
if (a->data.sa[0] == jrt) break;
|
||||
}
|
||||
|
||||
if (a) {
|
||||
a->data.sa[1]++;
|
||||
} else {
|
||||
a = a_add(&f->attribs, a_new(&at_jihad));
|
||||
a->data.sa[0] = (short)jrt;
|
||||
a->data.sa[1] = 1;
|
||||
}
|
||||
|
||||
add_message(&f->msgs, msg_message("setjihad", "race", jrace));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
jihad(faction *f, const race * rc)
|
||||
{
|
||||
attrib *a;
|
||||
race_t jrt = old_race(rc);
|
||||
|
||||
for(a = a_find(f->attribs, &at_jihad); a && a->type==&at_jihad; a = a->next) {
|
||||
if(a->data.sa[0] == jrt) return a->data.sa[1];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
jihad_attacks(void)
|
||||
{
|
||||
faction *f;
|
||||
region *r;
|
||||
unit *u, *u2;
|
||||
ally *sf, **sfp;
|
||||
|
||||
for(f=factions; f; f=f->next) if(fspecial(f, FS_JIHAD)) {
|
||||
region * last = lastregion(f);
|
||||
for (r=firstregion(f); r != last; r = r->next) if (rng_int()%1000 <= 1) {
|
||||
boolean doit = false;
|
||||
|
||||
for(u=r->units; u; u=u->next) if(jihad(f, u->race)) {
|
||||
doit = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(doit == false) continue;
|
||||
|
||||
log_printf("-->> Pogrom durch %s in %s\n", factionid(f), regionname(r, NULL));
|
||||
|
||||
for(u2 = r->units; u; u=u->next) if(u2->faction == f) {
|
||||
for(u=r->units; u; u=u->next) if(jihad(f, u->race)) {
|
||||
/* Allianz auflösen */
|
||||
sfp = &u2->faction->allies;
|
||||
if (fval(u, UFL_GROUP)) {
|
||||
attrib * a = a_find(u2->attribs, &at_group);
|
||||
if (a) sfp = &((group*)a->data.v)->allies;
|
||||
}
|
||||
|
||||
for (sf=*sfp; sf; sf = sf->next) {
|
||||
if(sf->faction == u->faction) break;
|
||||
}
|
||||
|
||||
if (sf) sf->status = sf->status & (HELP_ALL - HELP_FIGHT);
|
||||
|
||||
addlist(&u2->orders, create_order(K_ATTACK, u->faction->locale, "%i", u->no));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
karma(void)
|
||||
{
|
||||
parse(K_PRAY, prayer_cmd, false);
|
||||
parse(K_SETJIHAD, jihad_cmd, false);
|
||||
parse(K_SACRIFICE, sacrifice_cmd, true);
|
||||
}
|
||||
#endif
|
|
@ -1,76 +0,0 @@
|
|||
/* vi: set ts=2:
|
||||
*
|
||||
* Eressea PB(E)M host Copyright (C) 1998-2003
|
||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||
* Henning Peters (faroul@beyond.kn-bremen.de)
|
||||
* Enno Rehling (enno@eressea.de)
|
||||
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
|
||||
*
|
||||
* This program may not be used, modified or distributed without
|
||||
* prior permission by the authors of Eressea.
|
||||
*/
|
||||
#ifndef H_KRNL_KARMA
|
||||
#define H_KRNL_KARMA
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
FS_REGENERATION,
|
||||
FS_URBAN,
|
||||
FS_WARRIOR,
|
||||
FS_WYRM,
|
||||
FS_MILITIA,
|
||||
FS_FAERIE,
|
||||
FS_ADMINISTRATOR,
|
||||
FS_TELEPATHY,
|
||||
FS_AMPHIBIAN,
|
||||
FS_MAGOCRACY,
|
||||
FS_SAPPER,
|
||||
FS_JUMPER,
|
||||
FS_HIDDEN,
|
||||
FS_EARTHELEMENTALIST,
|
||||
FS_MAGICIMMUNE,
|
||||
FS_VARIEDMAGIC,
|
||||
FS_JIHAD,
|
||||
FS_UNDEAD,
|
||||
FS_QUICK,
|
||||
FS_LUCKY,
|
||||
FS_LYCANTROPE,
|
||||
FS_ELITE,
|
||||
MAXFACTIONSPECIALS
|
||||
} fspecial_t;
|
||||
|
||||
#if KARMA_MODULE
|
||||
typedef enum {
|
||||
PR_AID,
|
||||
PR_MERCY,
|
||||
MAXPRAYEREFFECTS
|
||||
} prayereffect_t;
|
||||
|
||||
typedef struct fspecialdata {
|
||||
const char *name;
|
||||
const char *description;
|
||||
const short maxlevel;
|
||||
} fspecialdata;
|
||||
|
||||
extern struct attrib_type at_faction_special;
|
||||
extern struct attrib_type at_prayer_timeout;
|
||||
extern struct attrib_type at_prayer_effect;
|
||||
extern struct attrib_type at_wyrm;
|
||||
extern struct attrib_type at_fshidden;
|
||||
extern struct attrib_type at_jihad;
|
||||
|
||||
extern struct fspecialdata fspecials[];
|
||||
|
||||
extern int fspecial(const struct faction *f, fspecial_t special);
|
||||
extern void karma(void);
|
||||
extern int jihad(struct faction *, const struct race *);
|
||||
extern void jihad_attacks(void);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -26,7 +26,6 @@
|
|||
#include "curse.h"
|
||||
#include "faction.h"
|
||||
#include "item.h"
|
||||
#include "karma.h"
|
||||
#include "message.h"
|
||||
#include "objtypes.h"
|
||||
#include "order.h"
|
||||
|
@ -452,47 +451,6 @@ update_spellbook(faction * f, int level)
|
|||
}
|
||||
}
|
||||
|
||||
#if KARMA_MODULE
|
||||
void wyrm_update(unit * u, struct sc_mage * mage, int sk)
|
||||
{
|
||||
spell_list * slist, ** slistp;
|
||||
/* Nur Wyrm-Magier bekommen den Wyrmtransformationszauber */
|
||||
spell * sp = find_spellbyid(M_GRAY, SPL_BECOMEWYRM);
|
||||
|
||||
if (fspecial(u->faction, FS_WYRM) && !has_spell(u, sp) && sp->level<=sk) {
|
||||
add_spell(mage, find_spellbyid(M_GRAY, SPL_BECOMEWYRM));
|
||||
}
|
||||
|
||||
/* Transformierte Wyrm-Magier bekommen Drachenodem */
|
||||
if (dragonrace(u->race)) {
|
||||
race_t urc = old_race(u->race);
|
||||
switch (urc) {
|
||||
/* keine breaks! Wyrme sollen alle drei Zauber können.*/
|
||||
case RC_WYRM:
|
||||
sp = find_spellbyid(M_GRAY, SPL_WYRMODEM);
|
||||
slistp = get_spelllist(mage, u->faction);
|
||||
if (sp!=NULL && !has_spell(*slistp, sp) && sp->level<=sk) {
|
||||
add_spell(slistp, sp);
|
||||
}
|
||||
case RC_DRAGON:
|
||||
sp = find_spellbyid(M_GRAY, SPL_DRAGONODEM);
|
||||
slistp = get_spelllist(mage, u->faction);
|
||||
if (sp!=NULL && !has_spell(*slistp, sp) && sp->level<=sk) {
|
||||
add_spell(slistp, sp);
|
||||
}
|
||||
case RC_FIREDRAGON:
|
||||
sp = find_spellbyid(M_GRAY, SPL_FIREDRAGONODEM);
|
||||
slistp = get_spelllist(mage, u->faction);
|
||||
if (sp!=NULL && !has_spell(*slistp, sp) && sp->level<=sk) {
|
||||
add_spell(slistp, sp);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return slistp;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
updatespelllist(unit * u)
|
||||
{
|
||||
|
@ -526,9 +484,6 @@ updatespelllist(unit * u)
|
|||
}
|
||||
}
|
||||
|
||||
#if KARMA_MODULE
|
||||
wyrm_update(u, mage, sk);
|
||||
#endif /* KARMA_MODULE */
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
|
@ -1259,9 +1214,6 @@ target_resists_magic(unit *magician, void *obj, int objtyp, int t_bonus)
|
|||
skill * sv;
|
||||
unit * u = (unit*)obj;
|
||||
|
||||
#if KARMA_MODULE
|
||||
if (fspecial(u->faction, FS_MAGICIMMUNE)) return true;
|
||||
#endif /* KARMA_MODULE */
|
||||
at = effskill(magician, SK_MAGIC);
|
||||
|
||||
for (sv = u->skills; sv != u->skills + u->skill_size; ++sv) {
|
||||
|
@ -1492,10 +1444,6 @@ regeneration(unit * u)
|
|||
double potenz = 1.5;
|
||||
double divisor = 2.0;
|
||||
|
||||
#if KARMA_MODULE
|
||||
if (fspecial(u->faction, FS_MAGICIMMUNE)) return 0;
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
sk = effskill(u, SK_MAGIC);
|
||||
/* Rassenbonus/-malus */
|
||||
d = pow(sk, potenz) * u->race->regaura / divisor;
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "curse.h"
|
||||
#include "faction.h"
|
||||
#include "item.h"
|
||||
#include "karma.h"
|
||||
#include "magic.h"
|
||||
#include "message.h"
|
||||
#include "order.h"
|
||||
|
@ -211,12 +210,6 @@ int
|
|||
personcapacity(const unit *u)
|
||||
{
|
||||
int cap = u->race->weight+u->race->capacity;
|
||||
|
||||
#if KARMA_MODULE
|
||||
if (fspecial(u->faction, FS_QUICK))
|
||||
cap -= 200;
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
return cap;
|
||||
}
|
||||
|
||||
|
@ -399,9 +392,6 @@ canswim(unit *u)
|
|||
if (get_item(u, I_DOLPHIN) >= u->number && effskill(u, SK_RIDING) >= 4)
|
||||
return true;
|
||||
|
||||
#if KARMA_MODULE
|
||||
if (fspecial(u->faction, FS_AMPHIBIAN)) return true;
|
||||
#endif /* KARMA_MODULE */
|
||||
if (u->race->flags & RCF_FLY) return true;
|
||||
|
||||
if (u->race->flags & RCF_SWIM) return true;
|
||||
|
@ -1350,10 +1340,6 @@ movement_speed(unit * u)
|
|||
|
||||
default:
|
||||
mp = BP_WALKING;
|
||||
#if KARMA_MODULE
|
||||
/* faction special */
|
||||
if (fspecial(u->faction, FS_QUICK)) mp = BP_RIDING;
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
/* Siebenmeilentee */
|
||||
if (get_effect(u, oldpotiontype[P_FAST]) >= u->number) {
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "faction.h"
|
||||
#include "group.h"
|
||||
#include "item.h"
|
||||
#include "karma.h"
|
||||
#include "magic.h"
|
||||
#include "names.h"
|
||||
#include "pathfinder.h"
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include <kernel/faction.h>
|
||||
#include <kernel/group.h>
|
||||
#include <kernel/item.h>
|
||||
#include <kernel/karma.h>
|
||||
#include <kernel/magic.h>
|
||||
#include <kernel/message.h>
|
||||
#include <kernel/move.h>
|
||||
|
@ -439,13 +438,6 @@ bufunit(const faction * f, const unit * u, int indent, int mode, char * buf, siz
|
|||
itemcloak = curse_active(get_curse(u->attribs, itemcloak_ct));
|
||||
}
|
||||
|
||||
#if KARMA_MODULE
|
||||
if (fspecial(u->faction, FS_HIDDEN)) {
|
||||
a_fshidden = a_find(u->attribs, &at_fshidden);
|
||||
}
|
||||
telepath_see = fspecial(f, FS_TELEPATHY);
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
bytes = (int)strlcpy(bufp, unitname(u), size);
|
||||
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "faction.h"
|
||||
#include "group.h"
|
||||
#include "item.h"
|
||||
#include "karma.h"
|
||||
#include "magic.h"
|
||||
#include "message.h"
|
||||
#include "move.h"
|
||||
|
@ -1226,12 +1225,10 @@ readfaction(struct storage * store)
|
|||
assert(f->race);
|
||||
f->magiegebiet = (magic_t)store->r_int(store);
|
||||
|
||||
#if KARMA_MODULE
|
||||
f->karma = store->r_int(store);
|
||||
#else
|
||||
/* ignore karma */
|
||||
store->r_int(store);
|
||||
#endif /* KARMA_MODULE */
|
||||
if (store->version<FOSS_VERSION) {
|
||||
/* ignore karma */
|
||||
store->r_int(store);
|
||||
}
|
||||
|
||||
f->flags = store->r_int(store);
|
||||
if (f->no==0) {
|
||||
|
@ -1323,11 +1320,6 @@ writefaction(struct storage * store, const faction * f)
|
|||
store->w_tok(store, f->race->_name[0]);
|
||||
store->w_brk(store);
|
||||
store->w_int(store, f->magiegebiet);
|
||||
#if KARMA_MODULE
|
||||
store->w_int(store, f->karma);
|
||||
#else
|
||||
store->w_int(store, 0);
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
store->w_int(store, f->flags&FFL_SAVEMASK);
|
||||
a_write(store, f->attribs);
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "skill.h"
|
||||
|
||||
#include "curse.h"
|
||||
#include "karma.h"
|
||||
#include "item.h"
|
||||
#include "magic.h"
|
||||
#include "race.h"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "building.h"
|
||||
#include "faction.h"
|
||||
#include "group.h"
|
||||
#include "karma.h"
|
||||
#include "connection.h"
|
||||
#include "item.h"
|
||||
#include "move.h"
|
||||
|
@ -1304,22 +1303,6 @@ get_modifier(const unit *u, skill_t sk, int level, const region *r, boolean noit
|
|||
}
|
||||
skill = skillmod(u->attribs, u, r, sk, skill, SMF_ALWAYS);
|
||||
|
||||
#if KARMA_MODULE
|
||||
if (fspecial(u->faction, FS_TELEPATHY)) {
|
||||
switch(sk) {
|
||||
case SK_ALCHEMY:
|
||||
case SK_HERBALISM:
|
||||
case SK_MAGIC:
|
||||
case SK_SPY:
|
||||
case SK_STEALTH:
|
||||
case SK_PERCEPTION:
|
||||
break;
|
||||
default:
|
||||
skill -= 2;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HUNGER_REDUCES_SKILL
|
||||
if (fval(u, UFL_HUNGER)) {
|
||||
skill = skill/2;
|
||||
|
@ -1689,12 +1672,6 @@ unit_max_hp(const unit * u)
|
|||
p = pow(effskill(u, SK_STAMINA) / 2.0, 1.5) * 0.2;
|
||||
h += (int) (h * p + 0.5);
|
||||
}
|
||||
#if KARMA_MODULE
|
||||
if (fspecial(u->faction, FS_UNDEAD)) {
|
||||
h *= 2;
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
/* der healing curse verändert die maximalen hp */
|
||||
if (heal_ct) {
|
||||
curse *c = get_curse(u->region->attribs, heal_ct);
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#define MUSEUM_MODULE 1
|
||||
#define ARENA_MODULE 1
|
||||
#define XECMD_MODULE 1
|
||||
#define KARMA_MODULE 0
|
||||
#define DUNGEON_MODULE 0
|
||||
#define CHANGED_CROSSBOWS 0 /* use the WTF_ARMORPIERCING flag */
|
||||
#undef GLOBAL_WARMING /* number of turns before global warming sets in */
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include <kernel/faction.h>
|
||||
#include <kernel/reports.h>
|
||||
#include <kernel/item.h>
|
||||
#include <kernel/karma.h>
|
||||
#include <kernel/magic.h>
|
||||
#include <kernel/message.h>
|
||||
#include <kernel/objtypes.h>
|
||||
|
@ -6415,37 +6414,7 @@ sp_break_curse(castorder *co)
|
|||
int
|
||||
sp_becomewyrm(castorder *co)
|
||||
{
|
||||
#if KARMA_MODULE
|
||||
unit *u = co->magician.u;
|
||||
int wyrms_already_created = 0;
|
||||
int wyrms_allowed = 0;
|
||||
attrib *a;
|
||||
|
||||
wyrms_allowed = fspecial(u->faction, FS_WYRM);
|
||||
a = a_find(u->faction->attribs, &at_wyrm);
|
||||
if (a) wyrms_already_created = a->data.i;
|
||||
|
||||
if (wyrms_already_created >= wyrms_allowed) {
|
||||
cmistake(u, co->order, 262, MSG_MAGIC);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!a) {
|
||||
a_add(&u->faction->attribs, a_new(&at_wyrm));
|
||||
a->data.i = 1;
|
||||
} else {
|
||||
a->data.i++;
|
||||
}
|
||||
|
||||
u->race = new_race[RC_WYRM];
|
||||
add_spell(get_mage(u), find_spellbyid(M_GRAY, SPL_WYRMODEM));
|
||||
|
||||
ADDMSG(&u->faction->msgs, msg_message("becomewyrm", "u", u));
|
||||
|
||||
return co->level;
|
||||
#else
|
||||
return 0;
|
||||
#endif /* KARMA_MODULE */
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
|
|
Loading…
Reference in New Issue