server/src/common/kernel/ship.h
Enno Rehling 32bc84c970 * Prefix im CR repariert.
* RACE_ADJUSTMENT korrekt deaktiviert.
* Schiffe werden nur noch beschädigt, wenn der Kampf für sie relevant war.
* Erneute Reparatur für Regionen ohne demand.
* KÄMPFE HELFE NICHT repariert.
* Setzen des Kampfzaubers ohne Stufenangabe setzt die Stufe auf 0 (=max)
* Übersetzung des HP-Status im Report
* Teilübersetzung der Spionage-Reports.
* locale_string() liefert auf NULL wieder NULL zurück (statt crash).
2002-02-06 08:06:02 +00:00

101 lines
2.6 KiB
C

/* 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.
*/
#ifndef SHIP_H
#define SHIP_H
#include "build.h"
#define DAMAGE_SCALE 100 /* multiplier for sh->damage */
/* ship_type::flags */
#define SFL_OPENSEA 0x01
#define SFL_FLY 0x02
typedef struct ship_type {
const char * name[2];
int range; /* range in regions */
int flags; /* flags */
int combat; /* modifier for combat */
double storm; /* multiplier for chance to drift in storm */
double damage; /* multiplier for damage taken by the ship */
int cabins; /* max. cabins (people) */
int cargo; /* max. cargo (weight) */
int cptskill; /* min. skill of captain */
int minskill; /* min. skill to sail this (crew) */
int sumskill; /* min. sum of crew+captain */
terrain_t * coast; /* coast that this ship can land on */
construction * construction; /* how to build a ship */
} ship_type;
typedef struct ship_typelist {
struct ship_typelist * next;
const ship_type * type;
} ship_typelist;
extern ship_typelist *shiptypes;
/* Alte Schiffstypen: */
#ifdef NOXMLBOATS
extern const ship_type st_boat;
extern const ship_type st_balloon;
extern const ship_type st_longboat;
extern const ship_type st_dragonship;
extern const ship_type st_caravelle;
extern const ship_type st_trireme;
extern const ship_type st_transport;
#endif
extern const ship_type * st_find(const char* name);
extern void st_register(const ship_type * type);
#define NOSHIP NULL
#define SF_DRIFTED 1<<0
#define SF_MOVED 1<<1
#define SF_DAMAGED 1<<2 /* for use in combat */
typedef struct ship {
struct ship *next;
struct ship *nexthash;
int no;
struct region *region;
char *name;
char *display;
struct attrib * attribs;
int size;
int damage; /* damage in 100th of a point of size */
unsigned int flags;
const struct ship_type * type;
direction_t coast;
} ship;
extern void damage_ship(ship *sh, double percent);
extern struct unit *captain(ship *sh, struct region *r);
extern struct unit *shipowner(const struct region * r, const struct ship * sh);
extern ship *new_ship(const struct ship_type * stype, struct region * r);
extern const char *shipname(const struct ship * sh);
extern ship *findship(int n);
extern const struct ship_type * findshiptype(const char *s, const struct locale * lang);
extern void register_ships(void);
#endif