- Horn des Tanzes

- Gefangener Windgeist
This commit is contained in:
Christian Schlittchen 2004-05-07 11:11:30 +00:00
parent d97ae0f0e0
commit 425cf5368d
15 changed files with 349 additions and 21 deletions

View File

@ -2299,7 +2299,7 @@ report(FILE *F, faction * f, const faction_list * addresses,
w += weight(u);
}
}
sprintf(buf, "%s, %s, (%d/%d)",
sprintf(buf, "%s, %s %s, (%d/%d)",
shipname(sh),
LOC(f->locale, sh->type->name[0]),
(w + 99) / 100, /* +99 weil sonst die Nachkommastellen ignoriert würden */

View File

@ -18,6 +18,7 @@ SOURCES =
seed.c
weapons.c
xerewards.c
artrewards.c
;
Library items : $(SOURCES) ;

View File

@ -0,0 +1,168 @@
/* 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-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 <eressea.h>
#include "artrewards.h"
/* kernel includes */
#include <item.h>
#include <region.h>
#include <faction.h>
#include <unit.h>
#include <skill.h>
#include <curse.h>
#include <message.h>
#include <magic.h>
#include <ship.h>
/* util includes */
#include <functions.h>
/* libc includes */
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#define HORNRANGE 10
#define HORNDURATION 3
#define HORNIMMUNITY 30
static int
age_peaceimmune(attrib * a)
{
return --a->data.i;
}
static attrib_type at_peaceimmune = {
"peaceimmune",
NULL, NULL,
age_peaceimmune,
a_writedefault,
a_readdefault
};
static int
use_hornofdancing(struct unit * u, const struct item_type * itype,
int amount, const char *cm)
{
region *r;
int regionsPacified = 0;
for(r=regions; r; r=r->next) {
if(distance(u->region, r) < HORNRANGE) {
if(a_find(r->attribs, &at_peaceimmune) == NULL) {
attrib *a;
create_curse(u, &r->attribs, ct_find("peacezone"),
20, HORNDURATION, 1, 0);
a = a_add(&r->attribs, a_new(&at_peaceimmune));
a->data.i = HORNIMMUNITY;
ADDMSG(&r->msgs, msg_message("hornofpeace_r_success",
"unit region", u, u->region));
regionsPacified++;
} else {
ADDMSG(&r->msgs, msg_message("hornofpeace_r_nosuccess",
"unit region", u, u->region));
}
}
}
if(regionsPacified > 0) {
ADDMSG(&u->faction->msgs, msg_message("hornofpeace_u_success",
"unit region command pacified", u, u->region, cm, regionsPacified));
} else {
ADDMSG(&u->faction->msgs, msg_message("hornofpeace_u_nosuccess",
"unit region command", u, u->region, cm));
}
return 0;
}
static resource_type rt_hornofdancing = {
{ "hornofdancing", "hornofdancing_p" },
{ "hornofdancing", "hornofdancing_p" },
RTF_ITEM,
&res_changeitem
};
item_type it_hornofdancing = {
&rt_hornofdancing, /* resourcetype */
0, 0, 0, /* flags, weight, capacity */
NULL, /* construction */
&use_hornofdancing,
NULL,
NULL
};
#define SPEEDUP 2
static int
use_trappedairelemental(struct unit * u, const struct item_type * itype,
int amount, const char *cm)
{
curse *c;
int shipId;
ship *sh;
shipId = getshipid();
if(shipId <= 0) {
cmistake(u, cm, 20, MSG_MOVE);
return 0;
}
sh = findshipr(u->region, shipId);
if(!sh) {
cmistake(u, cm, 20, MSG_MOVE);
return 0;
}
c = create_curse(u, &sh->attribs, ct_find("shipspeedup"),
20, 999999, SPEEDUP, 0);
curse_setflag(c, CURSE_NOAGE);
ADDMSG(&u->faction->msgs, msg_message("trappedairelemental_success",
"unit region command ship", u, u->region, cm, sh));
return 1;
}
static resource_type rt_trappedairelemental = {
{ "trappedairelemental", "trappedairelemental_p" },
{ "trappedairelemental", "trappedairelemental_p" },
RTF_ITEM,
&res_changeitem
};
item_type it_trappedairelemental = {
&rt_trappedairelemental, /* resourcetype */
0, 0, 0, /* flags, weight, capacity */
NULL, /* construction */
&use_trappedairelemental,
NULL,
NULL
};
void
register_artrewards(void)
{
at_register(&at_peaceimmune);
it_register(&it_hornofdancing);
register_function((pf_generic)use_hornofdancing, "usehornofdancing");
it_register(&it_trappedairelemental);
register_function((pf_generic)use_trappedairelemental, "trappedairelemental");
}

View File

@ -0,0 +1,32 @@
/* 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-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 H_ITM_ARTREWARDS
#define H_ITM_ARTREWARDS
#ifdef __cplusplus
extern "C" {
#endif
extern struct item_type it_hornofdancing;
extern struct item_type it_trappedairelemental;
extern struct item_type it_bagpipeoffear;
extern struct item_type it_instantartacademie;
extern struct item_type it_instantartsculpture;
extern void register_artrewards(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -18,6 +18,7 @@
#include "lmsreward.h"
#include "demonseye.h"
#include "xerewards.h"
#include "artrewards.h"
#include "weapons.h"
#include "racespoils.h"
#if GROWING_TREES
@ -42,6 +43,7 @@ register_items(void)
register_questkeys();
register_catapultammo();
register_racespoils();
register_artrewards();
}
void

View File

@ -57,6 +57,7 @@
#include "ship.h"
#include "karma.h"
#include "group.h"
#include "movement.h"
/* util includes */
#include <base36.h>
@ -485,6 +486,9 @@ shipspeed (const ship * sh, const unit * u)
int k = sh->type->range;
static const curse_type * stormwind_ct, * nodrift_ct;
static boolean init;
attrib *a;
curse *c;
if (!init) {
init = true;
stormwind_ct = ct_find("stormwind");
@ -501,8 +505,22 @@ shipspeed (const ship * sh, const unit * u)
k += 1;
if (old_race(u->faction->race) == RC_AQUARIAN
&& old_race(u->race) == RC_AQUARIAN)
&& old_race(u->race) == RC_AQUARIAN) {
k += 1;
}
a = a_find(sh->attribs, &at_speedup);
while(a != NULL) {
k += a->data.i;
a = a->nexttype;
}
c = get_curse(sh->attribs, ct_find("shipspeedup"));
while(c) {
k += curse_geteffect(c);
c = c->nexthash;
}
#ifdef SHIPSPEED
k *= SHIPSPEED;
#endif
@ -3088,6 +3106,7 @@ attrib_init(void)
#ifdef WDW_PYRAMIDSPELL
at_register(&at_wdwpyramid);
#endif
at_register(&at_speedup);
}
void

View File

@ -106,21 +106,6 @@ MagicPower(void)
return value;
}
static ship *
findshipr(const region *r, int n)
/* Ein Schiff in einer bestimmten Region finden: */
{
ship * sh;
for (sh = r->ships; sh; sh = sh->next) {
if (sh->no == n) {
assert(sh->region == r);
return sh;
}
}
return 0;
}
static building *
findbuildingr(const region *r, int n)
/* Ein Gebäude in einer bestimmten Region finden: */

View File

@ -132,6 +132,23 @@ attrib_type at_traveldir_new = {
a_traveldir_new_read
};
static int
age_speedup(attrib *a)
{
if(a->data.i > 0) {
--a->data.i;
}
return a->data.i;
}
attrib_type at_speedup = {
"speedup",
NULL, NULL,
age_speedup,
a_writedefault,
a_readdefault
};
/* ------------------------------------------------------------- */
direction_t

View File

@ -65,6 +65,8 @@ struct building_type;
boolean buildingtype_exists(const struct region * r, const struct building_type * bt);
struct unit* owner_buildingtyp(const struct region * r, const struct building_type * bt);
extern struct attrib_type at_speedup;
#ifdef __cplusplus
}
#endif

View File

@ -128,6 +128,20 @@ findship(int i)
return sfindhash(i);
}
struct ship *
findshipr(const region *r, int n)
{
ship * sh;
for (sh = r->ships; sh; sh = sh->next) {
if (sh->no == n) {
assert(sh->region == r);
return sh;
}
}
return 0;
}
void
damage_ship(ship * sh, double percent)
{

View File

@ -87,7 +87,8 @@ extern void getshipweight(const struct ship * sh, int *weight, int *cabins);
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 struct ship *findship(int n);
extern struct ship *findshipr(const struct region *r, int n);
extern const struct ship_type * findshiptype(const char *s, const struct locale * lang);

View File

@ -78,7 +78,6 @@ cinfo_shipnodrift(const struct locale * lang, void * obj, typ_t typ, curse *c, i
return 1;
}
/* C_DISORIENTATION */
static int
cinfo_disorientation(void * obj, typ_t typ, curse *c, int self)
{
@ -94,6 +93,20 @@ cinfo_disorientation(void * obj, typ_t typ, curse *c, int self)
return 1;
}
static int
cinfo_shipspeedup(void * obj, typ_t typ, curse *c, int self)
{
unused(typ);
unused(obj);
unused(self);
assert(typ == TYP_SHIP);
sprintf(buf, "Ein Windgeist beschleunigt dieses Schiff. (%s)", curseid(c));
return 1;
}
static struct curse_type ct_stormwind = { "stormwind",
CURSETYP_NORM, 0, NO_MERGE,
"",
@ -115,16 +128,22 @@ static struct curse_type ct_shipdisorientation = { "shipdisorientation",
CURSETYP_NORM, 0, NO_MERGE,
"Dieses Schiff hat sich verfahren."
};
static struct curse_type ct_shipspeedup = { "shipspeedup",
CURSETYP_NORM, 0, 0,
NULL
};
void
register_shipcurse(void)
{
register_function((pf_generic)cinfo_disorientation, "curseinfo::disorientation");
register_function((pf_generic)cinfo_shipnodrift, "curseinfo::shipnodrift");
register_function((pf_generic)cinfo_shipspeedup, "curseinfo::shipspeedup");
ct_register(&ct_stormwind);
ct_register(&ct_flyingship);
ct_register(&ct_nodrift);
ct_register(&ct_shipdisorientation);
ct_register(&ct_shipspeedup);
}

View File

@ -4,7 +4,7 @@ ifndef ERESSEA
endif
# Hier definieren, damit nicht '@gcc'
CC = gcc-3.3 -D_GNU_SOURCE -ansi -pedantic
CC = gcc-3.3 -D_GNU_SOURCE -ansi -pedantic -I/usr/include/libxml2
DEPEND = @gcc-3.3 -MM -MG -r
# CC = gcc -D_GNU_SOURCE
AR = ar

View File

@ -1389,6 +1389,22 @@
<text locale="de">Saphirne Schlüssel</text>
<text locale="en">sapphire keys</text>
</string>
<string name="hornofdancing">
<text locale="de">Horn des Tanzes</text>
<text locale="en">horn of dancing</text>
</string>
<string name="hornofdancing_p">
<text locale="de">Hörner des Tanzes</text>
<text locale="en">horns of dancing</text>
</string>
<string name="trappedairelemental">
<text locale="de">Gefangener Windgeist</text>
<text locale="en">trapped air elemental</text>
</string>
<string name="trappedairelemental_p">
<text locale="de">Gefangene Windgeister</text>
<text locale="en">trapped air elementals</text>
</string>
<!--herb singular -->
<string name="h0">

View File

@ -5811,5 +5811,57 @@
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Die Einheit $unit($target) hat keinen Kontakt mit uns aufgenommen."</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - The unit $unit($target) did not contact us."</text>
</message>
<message name="hornofpeace_u_success" section="magic">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
<arg name="command" type="order"/>
<arg name="pacified" type="int"/>
</type>
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - $int($pacified) Regionen wurden befriedet."</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - $int($pacified) regions have been pacified."</text>
</message>
<message name="hornofpeace_u_nosuccess" section="magic">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
<arg name="command" type="order"/>
<arg name="target" type="unit"/>
</type>
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Keine Region konnte befriedet werden."</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - No region could be pacified."</text>
</message>
<message name="hornofpeace_r_success" section="magic">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
</type>
<text locale="de">"$unit($unit) in $region($region) bläst das Horn des Tanzes. In der ganzen Region breitet sich eine friedliche Feststimmmung aus."</text>
<text locale="en">"$unit($unit) in $region($region) blows the Horn of Dancing. Peaceful harmony spreads over the region."</text>
</message>
<message name="hornofpeace_r_nosuccess" section="magic">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
</type>
<text locale="de">"$unit($unit) in $region($region) bläst das Horn des Tanzes, doch niemand hier lässt sich von Stimmung anstecken."</text>
<text locale="en">"$unit($unit) in $region($region) blows the Horn of Dancing, but nobody here gets into the mood."</text>
</message>
<message name="trappedairelemental_success" section="magic">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
<arg name="command" type="order"/>
<arg name="ship" type="ship"/>
</type>
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Die $ship($ship) wird jetzt schneller ihr Ziel erreichen."</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - The $ship($ship) will now be faster."</text>
</message>
</messages>