- Dudelsack

This commit is contained in:
Christian Schlittchen 2004-05-08 10:32:46 +00:00
parent b877fb4c5f
commit edde068a9e
4 changed files with 92 additions and 2 deletions

View File

@ -2995,6 +2995,7 @@ entertain(region * r, unit * u)
request *o;
static int entertainbase = 0;
static int entertainperlevel = 0;
if (!entertainbase) {
const char * str = get_param(global.parameters, "entertain.base");
entertainbase = str?atoi(str):0;
@ -3007,7 +3008,6 @@ entertain(region * r, unit * u)
cmistake(u, findorder(u, u->thisorder), 58, MSG_INCOME);
return;
}
if (!effskill(u, SK_ENTERTAINMENT)) {
cmistake(u, findorder(u, u->thisorder), 58, MSG_INCOME);
return;
@ -3025,7 +3025,8 @@ entertain(region * r, unit * u)
return;
}
u->wants = u->number * (entertainbase + effskill(u, SK_ENTERTAINMENT) * entertainperlevel);
u->wants = u->number * (entertainbase + effskill(u, SK_ENTERTAINMENT)
* entertainperlevel);
if ((max_e = geti()) != 0)
u->wants = min(u->wants,max_e);

View File

@ -26,8 +26,12 @@
#include <magic.h>
#include <ship.h>
/* gamecode includes */
#include <economy.h>
/* util includes */
#include <functions.h>
#include <rand.h>
/* libc includes */
#include <assert.h>
@ -156,6 +160,7 @@ item_type it_trappedairelemental = {
NULL
};
static int
use_aurapotion50(struct unit * u, const struct item_type * itype,
int amount, const char *cm)
@ -189,6 +194,52 @@ item_type it_aurapotion50 = {
NULL
};
#define BAGPIPEFRACTION dice_rand("2d4+2")
#define BAGPIPEDURATION dice_rand("2d10+4")
static int
use_bagpipeoffear(struct unit * u, const struct item_type * itype,
int amount, const char *cm)
{
int money;
if(get_curse(u->region->attribs, ct_find("depression"))) {
cmistake(u, cm, 58, MSG_MAGIC);
return 0;
}
money = entertainmoney(u->region)/BAGPIPEFRACTION;
change_money(u, money);
rsetmoney(u->region, rmoney(u->region) - money);
create_curse(u, &u->region->attribs, ct_find("depression"),
20, BAGPIPEDURATION, 0, 0);
ADDMSG(&u->faction->msgs, msg_message("bagpipeoffear_faction",
"unit region command money", u, u->region, cm, money));
ADDMSG(&u->region->msgs, msg_message("bagpipeoffear_region",
"unit money", u, money));
return 0;
}
static resource_type rt_bagpipeoffear = {
{ "bagpipeoffear", "bagpipeoffear_p" },
{ "bagpipeoffear", "bagpipeoffear_p" },
RTF_ITEM,
&res_changeitem
};
item_type it_bagpipeoffear = {
&rt_bagpipeoffear, /* resourcetype */
0, 1, 0, /* flags, weight, capacity */
NULL, /* construction */
&use_bagpipeoffear,
NULL,
NULL
};
void
register_artrewards(void)
@ -200,5 +251,7 @@ register_artrewards(void)
register_function((pf_generic)use_trappedairelemental, "trappedairelemental");
it_register(&it_aurapotion50);
register_function((pf_generic)use_aurapotion50, "aurapotion50");
it_register(&it_bagpipeoffear);
register_function((pf_generic)use_bagpipeoffear, "bagpipeoffear");
}

View File

@ -1405,6 +1405,22 @@
<text locale="de">Gefangene Windgeister</text>
<text locale="en">trapped air elementals</text>
</string>
<string name="auropotion50">
<text locale="de">Auratrank</text>
<text locale="en">aura potion</text>
</string>
<string name="trappedairelemental_p">
<text locale="de">Auratränke</text>
<text locale="en">aura potions</text>
</string>
<string name="bagpipeoffear">
<text locale="de">Dudelsack der Furcht</text>
<text locale="en">bagpipe of fear</text>
</string>
<string name="bagpipeoffear_p">
<text locale="de">Dudelsäcke der Furcht</text>
<text locale="en">bagpipes of fear</text>
</string>
<!--herb singular -->
<string name="h0">

View File

@ -5872,6 +5872,26 @@
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Der Magier fühlt sich durch den Trank magische gestärkt."</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - The mage is magically invigorated."</text>
</message>
<message name="bagpipeoffear_faction" section="magic">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
<arg name="command" type="order"/>
<arg name="money" type="int"/>
</type>
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Ausser sich vor Furcht geben die Bauern dem Barden $int($money) Silber."</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - Stricken with fear the peasants give the bard $int($money) silver."</text>
</message>
<message name="bagpipeoffear_region" section="magic">
<type>
<arg name="unit" type="unit"/>
<arg name="money" type="int"/>
</type>
<text locale="de">"$unit($unit) spielt einen Dudelsack. Ausser sich vor Furcht geben die Bauern $int($money) Silber."</text>
<text locale="en">"$unit($unit) plays the bagpipe. Stricken with fear the peasants give $int($money) silver."</text>
</message>
</messages>