This commit is contained in:
olikraus 2017-07-21 20:29:34 +02:00
parent 1d9772f780
commit 329708bb46
3 changed files with 21 additions and 13 deletions

View File

@ -30,5 +30,5 @@ ugl: $(UGLOBJ) map.c
$(CC) $(CFLAGS) $(LDFLAGS) $(UGLOBJ) -o ugl
clean:
-rm $(GMOBJ) $(MAPGENOBJ) $(UGLOBJ) gm mapgen map.c
-rm $(GMOBJ) $(MAPGENOBJ) $(UGLOBJ) gm mapgen ugl map.c

View File

@ -143,7 +143,7 @@ tile ': $6b # stone 3
thing 'f $74 # fire
thing '^ $73 # door open
thing 'C $79 # cupboard
thing 'S $7a # bookshelf
thing 'b $7a # bookshelf
thing 'c $78 # chair
thing 't $7b # table
thing 'T $7c # throne
@ -152,6 +152,8 @@ thing 'h $9c # chest
thing 'H $92 # hut
thing 'K $93 # kingdom
item normal_door $72 # $72 = door closed --> inital tile
itemkey normal_door 'x $73 # $73 = door open --> this will be placed on the map, the item can destroy itself, but this tile will stay
@ -167,28 +169,36 @@ endproc
itemstep normal_door
endproc
item spider $54
itemkey spider 'S 32 # use blank as background under 'S'
iteminit spider
endproc
itemhit spider
endproc
itemstep spider
endproc
map test 20 9
mapinit
setPos(3,2)
setItemPos(0)
setItemPos(0)
endproc
: K H
: . .
: ...........
: . .
:+-----^--x--C--S---+
:+-----^--x--C--b---+
:| T f|
:|ctc h |
:| c |
:|ctc h S |
:| c S |
:+-----^-----x------+
endmap
thing 'S $54 # Spider
#thing 'S $54 # Spider
thing 'k $a0 # key
map first 12 12
:+---+ +---+

View File

@ -327,14 +327,12 @@ void item_write(FILE *fp)
fprintf(fp, "item_template_t item_template_list[] = {\n");
for( i = 0; i < item_cnt;i++ )
{
fprintf(fp, " { /* init= */ %u, /* hit= */%u, /* step= */ %u, /* fg= */ 0x%02x}", item_list[i].init_proc, item_list[i].hit_proc, item_list[i].step_proc, item_list[i].fg_tile);
fprintf(fp, " /* %-20s */ { /* init= */ %4u, /* hit= */%4u, /* step= */ %4u, /* fg= */ 0x%02x}", item_list[i].name, item_list[i].init_proc, item_list[i].hit_proc, item_list[i].step_proc, item_list[i].fg_tile);
if ( i != item_cnt-1 )
fprintf(fp, ",\n");
else
fprintf(fp, "\n");
}
fprintf(fp, "};\n\n");
}
@ -691,8 +689,8 @@ static void write_item_onmap(void)
fprintf(out_fp, ",\n");
}
is_first = 0;
fprintf(out_fp, " ");
fprintf(out_fp, "{ /*x=*/ %d, /*y=*/ %d, /*idx=*/ %d, %d}", x, y, tile_list[i].item_index, 0);
fprintf(out_fp, " /* %-20s */ ", item_list[tile_list[i].item_index].name);
fprintf(out_fp, "{ /*x=*/ %2d, /*y=*/ %2d, /*idx=*/ %2d, %2d}", x, y, tile_list[i].item_index, 0);
cnt++;
}
}