forked from github/server
- artsculpture und artacademy
This commit is contained in:
parent
7b5675e6a6
commit
ccb01c1f81
|
@ -3085,6 +3085,7 @@ expandwork(region * r)
|
|||
if (a) verdienst = a->data.i;
|
||||
}
|
||||
#endif
|
||||
|
||||
earnings = min(n, rpeasants(r) * p_wage) + verdienst;
|
||||
/* Mehr oder weniger durch Trank "Riesengrass" oder "Faulobstschnaps" */
|
||||
|
||||
|
|
|
@ -1375,6 +1375,10 @@ set_display(region * r, unit * u, strlist * S)
|
|||
cmistake(u, S->s, 29, MSG_PRODUCE);
|
||||
break;
|
||||
}
|
||||
if (u->building->type == bt_find("artsculpture") && u->building->display[0] != 0) {
|
||||
cmistake(u, S->s, 29, MSG_PRODUCE);
|
||||
break;
|
||||
}
|
||||
s = &u->building->display;
|
||||
break;
|
||||
|
||||
|
@ -1600,6 +1604,10 @@ set_name(region * r, unit * u, strlist * S)
|
|||
cmistake(u, S->s, 29, MSG_EVENT);
|
||||
break;
|
||||
}
|
||||
if (u->building->type == bt_find("artsculpure")) {
|
||||
cmistake(u, S->s, 29, MSG_EVENT);
|
||||
break;
|
||||
}
|
||||
s = &u->building->name;
|
||||
freset(u->building, FL_UNNAMED);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "plane.h"
|
||||
#include "karma.h"
|
||||
#include "rand.h"
|
||||
#include "movement.h"
|
||||
|
||||
/* util includes */
|
||||
#include <base36.h>
|
||||
|
@ -209,6 +210,7 @@ teach_unit(unit * teacher, unit * student, int nteaching, skill_t sk,
|
|||
if (academy) *academy += n;
|
||||
} /* sonst nehmen sie nicht am Unterricht teil */
|
||||
}
|
||||
|
||||
/* Teaching ist die Anzahl Leute, denen man noch was beibringen kann. Da
|
||||
* hier nicht n verwendet wird, werden die Leute gezählt und nicht die
|
||||
* effektiv gelernten Tage. -> FALSCH ? (ENNO)
|
||||
|
@ -669,12 +671,23 @@ learn(void)
|
|||
* in einer Uni */
|
||||
teach->value += u->number * 10;
|
||||
}
|
||||
|
||||
if (is_cursed(r->attribs,C_BADLEARN,0)) {
|
||||
teach->value -= u->number * 10;
|
||||
}
|
||||
|
||||
days = (int)((u->number * 30 + teach->value) * multi);
|
||||
if (fval(u, UFL_HUNGER)) days = days / 2;
|
||||
days = (int)((u->number * 30 + teach->value) * multi);
|
||||
|
||||
/* the artacademy currently improves the learning of entertainment
|
||||
of all units in the region, to be able to make it cumulative with
|
||||
with an academy */
|
||||
|
||||
if(buildingtype_exists(r, bt_find("artacademy"))) {
|
||||
days *= 2;
|
||||
}
|
||||
|
||||
if (fval(u, UFL_HUNGER)) days = days / 2;
|
||||
|
||||
while (days) {
|
||||
if (days>=u->number*30) {
|
||||
learn_skill(u, sk, 1.0);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <message.h>
|
||||
#include <magic.h>
|
||||
#include <ship.h>
|
||||
#include <building.h>
|
||||
|
||||
/* gamecode includes */
|
||||
#include <economy.h>
|
||||
|
@ -240,6 +241,82 @@ item_type it_bagpipeoffear = {
|
|||
NULL
|
||||
};
|
||||
|
||||
static int
|
||||
use_instantartacademy(struct unit * u, const struct item_type * itype,
|
||||
int amount, const char *cm)
|
||||
{
|
||||
building *b;
|
||||
|
||||
if(u->region->land == NULL) {
|
||||
cmistake(u, cm, 242, MSG_MAGIC);
|
||||
return 0;
|
||||
}
|
||||
|
||||
b = new_building(bt_find("artacademy"), u->region, u->faction->locale);
|
||||
b->size = 100;
|
||||
sprintf(buf, "%s", LOC(u->faction->locale, "artacademy"));
|
||||
set_string(&b->name, buf);
|
||||
|
||||
ADDMSG(&u->region->msgs, msg_message(
|
||||
"artacademy_create", "unit command", u, cm));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static resource_type rt_instantartacademy = {
|
||||
{ "instantartacademy", "instantartacademy_p" },
|
||||
{ "instantartacademy", "instantartacademy_p" },
|
||||
RTF_ITEM,
|
||||
&res_changeitem
|
||||
};
|
||||
|
||||
item_type it_instantartacademy = {
|
||||
&rt_instantartacademy, /* resourcetype */
|
||||
0, 1, 0, /* flags, weight, capacity */
|
||||
NULL, /* construction */
|
||||
&use_instantartacademy,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static int
|
||||
use_instantartsculpture(struct unit * u, const struct item_type * itype,
|
||||
int amount, const char *cm)
|
||||
{
|
||||
building *b;
|
||||
|
||||
if(u->region->land == NULL) {
|
||||
cmistake(u, cm, 242, MSG_MAGIC);
|
||||
return 0;
|
||||
}
|
||||
|
||||
b = new_building(bt_find("artsculpture"), u->region, u->faction->locale);
|
||||
b->size = 100;
|
||||
sprintf(buf, "%s", LOC(u->faction->locale, "artsculpture"));
|
||||
set_string(&b->name, buf);
|
||||
|
||||
ADDMSG(&u->region->msgs, msg_message(
|
||||
"artsculpture_create", "unit region command", u, cm));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static resource_type rt_instantartsculpture = {
|
||||
{ "instantartsculpture", "instantartsculpture_p" },
|
||||
{ "instantartsculpture", "instantartsculpture_p" },
|
||||
RTF_ITEM,
|
||||
&res_changeitem
|
||||
};
|
||||
|
||||
item_type it_instantartsculpture = {
|
||||
&rt_instantartsculpture, /* resourcetype */
|
||||
0, 1, 0, /* flags, weight, capacity */
|
||||
NULL, /* construction */
|
||||
&use_instantartsculpture,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
void
|
||||
register_artrewards(void)
|
||||
|
@ -253,5 +330,9 @@ register_artrewards(void)
|
|||
register_function((pf_generic)use_aurapotion50, "aurapotion50");
|
||||
it_register(&it_bagpipeoffear);
|
||||
register_function((pf_generic)use_bagpipeoffear, "bagpipeoffear");
|
||||
it_register(&it_instantartacademy);
|
||||
register_function((pf_generic)use_instantartacademy, "instantartacademy");
|
||||
it_register(&it_instantartsculpture);
|
||||
register_function((pf_generic)use_instantartsculpture, "instantartsculpture");
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ extern struct item_type it_hornofdancing;
|
|||
extern struct item_type it_trappedairelemental;
|
||||
extern struct item_type it_aurapotion50;
|
||||
extern struct item_type it_bagpipeoffear;
|
||||
extern struct item_type it_instantartacademie;
|
||||
extern struct item_type it_instantartacademy;
|
||||
extern struct item_type it_instantartsculpture;
|
||||
|
||||
extern void register_artrewards(void);
|
||||
|
|
|
@ -2694,8 +2694,10 @@ wage(const region *r, const unit *u, boolean img)
|
|||
curse * c;
|
||||
int wage;
|
||||
attrib *a;
|
||||
building_type *artsculpture_type = bt_find("artsculpture");
|
||||
static const curse_type * drought_ct, * blessedharvest_ct;
|
||||
static boolean init;
|
||||
|
||||
if (!init) {
|
||||
init = true;
|
||||
drought_ct = ct_find("drought");
|
||||
|
@ -2720,6 +2722,13 @@ wage(const region *r, const unit *u, boolean img)
|
|||
wage += curse_geteffect(get_curse(r->attribs, blessedharvest_ct));
|
||||
}
|
||||
|
||||
/* Artsculpture: Income +5 */
|
||||
for(b=r->buildings; b; b=b->next) {
|
||||
if(b->type == artsculpture_type) {
|
||||
wage += 5;
|
||||
}
|
||||
}
|
||||
|
||||
/* Godcurse: Income -10 */
|
||||
if (curse_active(get_curse(r->attribs, ct_find("godcursezone")))) {
|
||||
wage = max(0,wage-10);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<building name="xmas_exit" maxsize="10" maxcapacity="2" nobuild="yes" nodestroy="yes" unique="yes" auraregen="1.00"/>
|
||||
<building name="caldera" capacity="1" nodestroy="yes" nobuild="yes" auraregen="1.00"/>
|
||||
<building name="genericbuilding" maxsize="1" nobuild="yes" auraregen="1.00"/>
|
||||
<building name="artacademy" maxsize="100" nobuild="yes" nodestroy="yes" unique="yes" auraregen="1.00"/>
|
||||
<building name="blessedstonecircle" maxsize="100" nobuild="yes" magic="yes" magres="60" magresbonus="30" auraregen="1.50">
|
||||
<construction skill="sk_building" minskill="2" reqsize="100" maxsize="100">
|
||||
<requirement type="log" recycle="0.5" quantity="500"/>
|
||||
|
|
|
@ -609,6 +609,14 @@
|
|||
<string name="genericbuilding">
|
||||
<text locale="de">Struktur</text>
|
||||
</string>
|
||||
<string name="artacademy">
|
||||
<text locale="de">Akademie der Künste</text>
|
||||
<text locale="en">academy of arts</text>
|
||||
</string>
|
||||
<string name="artacademy">
|
||||
<text locale="de">Skulptur</text>
|
||||
<text locale="en">sculpture</text>
|
||||
</string>
|
||||
|
||||
<!--Testitem -->
|
||||
<string name="wand">
|
||||
|
|
|
@ -5893,5 +5893,23 @@
|
|||
<text locale="en">"$unit($unit) plays the bagpipe. Stricken with fear the peasants give $int($money) silver."</text>
|
||||
</message>
|
||||
|
||||
<message name="artacademy_create" section="magic">
|
||||
<type>
|
||||
<arg name="unit" type="unit"/>
|
||||
<arg name="region" type="region"/>
|
||||
</type>
|
||||
<text locale="de">"$unit($unit) in $region($region) erschafft eine Akademie der Künste."</text>
|
||||
<text locale="en">"$unit($unit) in $region($region) creates an academy of arts."</text>
|
||||
</message>
|
||||
|
||||
<message name="artsculpture_create" section="magic">
|
||||
<type>
|
||||
<arg name="unit" type="unit"/>
|
||||
<arg name="region" type="region"/>
|
||||
</type>
|
||||
<text locale="de">"$unit($unit) in $region($region) erschafft eine Skulptur."</text>
|
||||
<text locale="en">"$unit($unit) in $region($region) creates a sculpture."</text>
|
||||
</message>
|
||||
|
||||
</messages>
|
||||
|
||||
|
|
Loading…
Reference in New Issue