diff --git a/src/common/gamecode/economy.c b/src/common/gamecode/economy.c index 63a4c13c9..eade1e7e9 100644 --- a/src/common/gamecode/economy.c +++ b/src/common/gamecode/economy.c @@ -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); diff --git a/src/common/items/artrewards.c b/src/common/items/artrewards.c index 956cfe28a..c1eb2a925 100644 --- a/src/common/items/artrewards.c +++ b/src/common/items/artrewards.c @@ -26,8 +26,12 @@ #include #include +/* gamecode includes */ +#include + /* util includes */ #include +#include /* libc includes */ #include @@ -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"); } diff --git a/src/res/de/strings.xml b/src/res/de/strings.xml index b99507060..4e12aef5e 100644 --- a/src/res/de/strings.xml +++ b/src/res/de/strings.xml @@ -1405,6 +1405,22 @@ Gefangene Windgeister trapped air elementals + + Auratrank + aura potion + + + Auratränke + aura potions + + + Dudelsack der Furcht + bagpipe of fear + + + Dudelsäcke der Furcht + bagpipes of fear + diff --git a/src/res/messages.xml b/src/res/messages.xml index de7013536..41744285b 100644 --- a/src/res/messages.xml +++ b/src/res/messages.xml @@ -5872,6 +5872,26 @@ "$unit($unit) in $region($region): '$order($command)' - Der Magier fühlt sich durch den Trank magische gestärkt." "$unit($unit) in $region($region): '$order($command)' - The mage is magically invigorated." + + + + + + + + + "$unit($unit) in $region($region): '$order($command)' - Ausser sich vor Furcht geben die Bauern dem Barden $int($money) Silber." + "$unit($unit) in $region($region): '$order($command)' - Stricken with fear the peasants give the bard $int($money) silver." + + + + + + + + "$unit($unit) spielt einen Dudelsack. Ausser sich vor Furcht geben die Bauern $int($money) Silber." + "$unit($unit) plays the bagpipe. Stricken with fear the peasants give $int($money) silver." +