- Attribut at_aggressive für die vinya-NPCs.

- User-Makefiles jetzt mit Hostnamen.
This commit is contained in:
Christian Schlittchen 2002-11-27 18:28:51 +00:00
parent 86c7efc792
commit 4ebdb69508
7 changed files with 174 additions and 6 deletions

View File

@ -42,7 +42,7 @@ MSG_SUBDIR = "--> Making $@ in $$subdir"
## user-defined makefiles
##
MKFILES = $(wildcard $(ERESSEA_SRC)/$(USER).mk $(ERESSEA_SRC)/$(OSTYPE).mk $(ERESSEA_SRC)/$(HOSTTYPE).mk $(ERESSEA_SRC)/$(ARCH).mk)
MKFILES = $(wildcard $(ERESSEA_SRC)/$(USER)@$(HOST).mk $(ERESSEA_SRC)/$(OSTYPE).mk $(ERESSEA_SRC)/$(HOSTTYPE).mk $(ERESSEA_SRC)/$(ARCH).mk)
ifeq ($(MKFILES), )
else
include $(MKFILES)

View File

@ -0,0 +1,41 @@
/* vi: set ts=2:
*
*
* Eressea PB(E)M host Copyright (C) 1998-2000
* 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-pbem.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.
*/
#include <config.h>
#include "aggressive.h"
#include <attrib.h>
attrib_type at_aggressive = {
"aggressive",
NULL,
NULL,
NULL,
NULL,
NULL,
};
attrib *
make_aggressive(int chance)
{
attrib * a = a_new(&at_aggressive);
a->data.i = chance;
return a;
}
void
init_aggressive(void)
{
at_register(&at_aggressive);
}

View File

@ -0,0 +1,17 @@
/* vi: set ts=2:
*
*
* Eressea PB(E)M host Copyright (C) 1998-2000
* 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-pbem.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.
*/
extern struct attrib_type at_aggressive;
extern struct attrib * make_aggressive(int chance);
extern void init_aggressive(void);

View File

@ -38,6 +38,7 @@
# include "option.h"
#endif
#include "moved.h"
#include "aggressive.h"
/* util includes */
#include <attrib.h>
@ -72,4 +73,5 @@ init_attributes(void)
#ifdef USE_UGROUPS
init_ugroup();
#endif
init_aggressive();
}

View File

@ -59,6 +59,7 @@
/* attributes includes */
#include <attributes/targetregion.h>
#include <attributes/hate.h>
#include <attributes/aggressive.h>
/* spezialmonster */
#include <spells/alp.h>
@ -605,7 +606,7 @@ random_attack_by_monster(const region * r, unit * u)
if (target
&& target != u
&& humanoidrace(target->race)
&& !illusionaryrace(target->race)
&& !illusionaryrace(target->race)
&& target->number <= max)
{
if (monster_attack(u, target)) {
@ -990,11 +991,20 @@ plan_monsters(void)
move_monster(r, u);
} else {
boolean done = false;
if((u->race->flags & RCF_ATTACKRANDOM)
&& rand()%100<MONSTERATTACK
&& is_moving == false)
if((u->race->flags & RCF_ATTACKRANDOM) && is_moving == false)
{
done = random_attack_by_monster(r, u);
int chance;
attrib *a = a_find(u->attribs, &at_aggressive);
if(a) {
chance = a->data.i;
} else {
chance = MONSTERATTACK;
}
if(rand()%100 < chance) {
done = random_attack_by_monster(r, u);
}
}
if (!done) {
if(u->race == new_race[RC_SEASERPENT]) {

49
src/corwin@amber.mk Normal file
View File

@ -0,0 +1,49 @@
ifndef ERESSEA
export ERESSEA=$(PWD)
endif
# Hier definieren, damit nicht '@gcc'
CC = gcc-3.2 -D_GNU_SOURCE -ansi -pedantic
DEPEND = @gcc-3.2 -MM -MG -r
# CC = gcc -D_GNU_SOURCE
AR = ar
CTAGS = ctags-exuberant
LD = gcc-3.2
INSTALL = cp
CFLAGS += -march=athlon -minline-all-stringops
# Ps = 0 -> Normal (default)
# Ps = 1 -> Bold
# Ps = 4 -> Underlined
# Ps = 5 -> Blink (appears as Bold)
# Ps = 7 -> Inverse
# Ps = 8 -> Invisible (hidden)
# Ps = 2 2 -> Normal (neither bold nor faint)
# Ps = 2 4 -> Not underlined
# Ps = 2 5 -> Steady (not blinking)
# Ps = 2 7 -> Positive (not inverse)
# Ps = 2 8 -> Visible (not hidden)
# Ps = 3 0 -> Set foreground color to Black
# Ps = 3 1 -> Set foreground color to Red
# Ps = 3 2 -> Set foreground color to Green
# Ps = 3 3 -> Set foreground color to Yellow
# Ps = 3 4 -> Set foreground color to Blue
# Ps = 3 5 -> Set foreground color to Magenta
# Ps = 3 6 -> Set foreground color to Cyan
# Ps = 3 7 -> Set foreground color to White
# Ps = 3 9 -> Set foreground color to default (original)
# Ps = 4 0 -> Set background color to Black
# Ps = 4 1 -> Set background color to Red
# Ps = 4 2 -> Set background color to Green
# Ps = 4 3 -> Set background color to Yellow
# Ps = 4 4 -> Set background color to Blue
# Ps = 4 5 -> Set background color to Magenta
# Ps = 4 6 -> Set background color to Cyan
# Ps = 4 7 -> Set background color to White
# Ps = 4 9 -> Set background color to default (original).
MSG_COMPILE = "\#\#\#\#\# Compiling $@ \#\#\#\#\#"
MSG_SUBDIR = "\#\#\#\#\# Making $@ in $$subdir \#\#\#\#\#"

49
src/corwin@liarana.mk Normal file
View File

@ -0,0 +1,49 @@
ifndef ERESSEA
export ERESSEA=$(PWD)
endif
# Hier definieren, damit nicht '@gcc'
CC = gcc -D_GNU_SOURCE -ansi -pedantic
DEPEND = @gcc -MM -MG -r
# CC = gcc -D_GNU_SOURCE
AR = ar
CTAGS = ctags-exuberant
LD = gcc
INSTALL = cp
# CFLAGS += -march=athlon -minline-all-stringops
# Ps = 0 -> Normal (default)
# Ps = 1 -> Bold
# Ps = 4 -> Underlined
# Ps = 5 -> Blink (appears as Bold)
# Ps = 7 -> Inverse
# Ps = 8 -> Invisible (hidden)
# Ps = 2 2 -> Normal (neither bold nor faint)
# Ps = 2 4 -> Not underlined
# Ps = 2 5 -> Steady (not blinking)
# Ps = 2 7 -> Positive (not inverse)
# Ps = 2 8 -> Visible (not hidden)
# Ps = 3 0 -> Set foreground color to Black
# Ps = 3 1 -> Set foreground color to Red
# Ps = 3 2 -> Set foreground color to Green
# Ps = 3 3 -> Set foreground color to Yellow
# Ps = 3 4 -> Set foreground color to Blue
# Ps = 3 5 -> Set foreground color to Magenta
# Ps = 3 6 -> Set foreground color to Cyan
# Ps = 3 7 -> Set foreground color to White
# Ps = 3 9 -> Set foreground color to default (original)
# Ps = 4 0 -> Set background color to Black
# Ps = 4 1 -> Set background color to Red
# Ps = 4 2 -> Set background color to Green
# Ps = 4 3 -> Set background color to Yellow
# Ps = 4 4 -> Set background color to Blue
# Ps = 4 5 -> Set background color to Magenta
# Ps = 4 6 -> Set background color to Cyan
# Ps = 4 7 -> Set background color to White
# Ps = 4 9 -> Set background color to default (original).
MSG_COMPILE = "\#\#\#\#\# Compiling $@ \#\#\#\#\#"
MSG_SUBDIR = "\#\#\#\#\# Making $@ in $$subdir \#\#\#\#\#"