Gewichtsangaben bei der Anzeige von items

This commit is contained in:
Enno Rehling 2004-10-16 12:15:22 +00:00
parent d6cd1c0efe
commit a653ea0824
7 changed files with 271 additions and 266 deletions

View File

@ -2304,11 +2304,7 @@ display_item(faction *f, unit *u, const item_type * itype)
const char *name;
if (u && *i_find(&u->items, itype) == NULL) return false;
/*
info = mkname("info", itype->rtype->_name[0]);
name = LOC(u->faction->locale, info);
if (strcmp(name, info)==0) {
*/
name = resourcename(itype->rtype, 0);
sprintf(filename, "%s/%s/items/%s", resourcepath(), locale_name(f->locale), name);
fp = fopen(filename, "r");
@ -2333,8 +2329,8 @@ display_item(faction *f, unit *u, const item_type * itype)
}
fclose(fp);
name = buf;
/* } */
ADDMSG(&f->msgs, msg_message("displayitem", "item description", itype->rtype, strdup(name)));
ADDMSG(&f->msgs, msg_message("displayitem", "weight item description",
itype->weight/1000, itype->rtype, strdup(name)));
return true;
}

View File

@ -1987,7 +1987,7 @@ attack(battle *b, troop ta, const att *a, int numattack)
switch(a->type) {
case AT_STANDARD: /* Waffen, mag. Gegenstände, Kampfzauber */
case AT_COMBATSPELL:
if (af->magic > 0) {
if (numattack==0 && af->magic > 0) {
/* Magier versuchen immer erstmal zu zaubern, erst wenn das
* fehlschlägt, wird af->magic == 0 und der Magier kämpft
* konventionell weiter */
@ -2027,11 +2027,11 @@ attack(battle *b, troop ta, const att *a, int numattack)
}
if (!td.fighter) return;
if(td.fighter->person[td.index].last_action < b->turn) {
if (td.fighter->person[td.index].last_action < b->turn) {
td.fighter->person[td.index].last_action = b->turn;
td.fighter->action_counter++;
}
if(ta.fighter->person[ta.index].last_action < b->turn) {
if (ta.fighter->person[ta.index].last_action < b->turn) {
ta.fighter->person[ta.index].last_action = b->turn;
ta.fighter->action_counter++;
}

View File

@ -4050,7 +4050,7 @@ sp_charmingsong(castorder *co)
int tb = 0;
/* wenn kein Ziel gefunden, Zauber abbrechen */
if(pa->param[0]->flag == TARGET_NOTFOUND) return 0;
if (pa->param[0]->flag == TARGET_NOTFOUND) return 0;
target = pa->param[0]->data.u;

View File

@ -272,8 +272,10 @@
<type>
<arg name="item" type="resource"/>
<arg name="description" type="string"/>
<arg name="weight" type="int"/>
</type>
<text locale="de">"$resource($item,1): $description"</text>
<text locale="de">"$resource($item,1) ($int($weight) GE): $description"</text>
<text locale="en">"$resource($item,1) ($int($weight) st): $description"</text>
</message>
<message name="healall" section="events">
<type>

View File

@ -213,6 +213,14 @@ function test_parser()
write_game("parser")
end
function test_fail()
plain = terraform(0, 0, "plain")
skill = 5
f = add_faction("enno@eressea.de", "human", "de")
print(f)
end
test_fail()
-- test_handler()
-- test_parser()

View File

@ -1,5 +1,4 @@
The crash of the day:
giving units names or descriptions that exceed NAMESIZE/DISPLAYSIZE can be a bad thing.
weights in item descriptions
[11:01] <Enno`> am besten wäre, wenn mailit nur die optionen, nicht das ganze script enthielte
[11:01] <Enno`> und ein skript dann mailit als input nähme