#ifndef _OBJECTDEF_INC #define _OBJECTDEF_INC #include "mapdef.inc" #include "objects.asm" .echo "Processing objectdef.inc" ;Generic Object - An object with no default attributes ; x - X Position ; y - Y Position ; z - Z Position ; w - Width ; h - Height ; d - Depth ; ac - Animation counter ; ap - Animation pointer #macro new_object(aa, ff, xx, ww, yy, hh, zz, dd, ac, ap) #if current_section != section_object zerror("Object created in wrong section!") #endif #if xx > 16*16-ww #define xx eval(16*16-ww) #endif #if yy > 16*16-hh #define yy eval(16*16-hh) #endif #if xx < 0 #define xx 0 #endif #if yy < 0 #define yy 0 #endif #ifndef ap zerror("Not enough arguments passed to new_object") #else #ifndef aa .db kNo_action #else .db aa #endif .db ff, xx, ww, yy, hh, zz, dd, ac .dw ap #endif #endmacro ;Eye - A switch that only an arrow can trigger ; x - X Position ; y - Y Position ; g - Direction to face ; type - Object ID #macro eye(x, y, g, type) #ifndef g #define g d_down #endif #ifndef type #define type kNo_action #endif set_dname(g) clr() wr("#define this_image eye_",dname,"_gfx") wr("#define this_width eye_",dname,"_gfx_width") wr("#define this_height eye_",dname,"_gfx_height") run() ; hug the wall opposite of the way you are facing wall_hug(x, y, this_width-1, this_height-1, 3-g) new_object(type,o_destroyable,x+ox,this_width,y+oy,this_height,0,16,0,this_image) #endmacro ;Pot - Breakable pot with items in it ; x - X Position ; y - Y Position ; w - Width [optional] ; h - Height [optional] ;Properties ; image_file = pot.bmp ; image_width = 16 ; image_height = 16 ; padding = 1 #macro pot(x, y, w, h) #ifndef w\ #define ww 12\ #else\ #define ww eval(w)\ #endif #ifndef h\ #define hh 12\ #else\ #define hh eval(h)\ #endif wall_hug(x, y, ww, hh, d_down) new_object(kDestroy, o_noaccess | o_destroyable, x+ox, ww, y+oy, hh, 0, 12, 0, pot_gfx) #undef ww #undef hh #endmacro ;General Block - A block which can move to same tiles ; x - X Position ; y - Y Position ;Properties ; image_file = block.bmp #macro general_block(x, y) nearest_tile(x, y) new_object(kPush_object1,0,x+ox,16,y+oy,16,0,0,0,block_gfx) #endmacro ;Plant - Destroyable plant with items in it ; x - X Position ; y - Y Position ;Properties ; image_file = plant.bmp ; image_width = 16 ; image_height = 16 ; padding = 1 #macro plant(x, y) new_object(kDestroy, o_noaccess | o_destoyable, x, 12, y, 12, 0, 12, 0, plant_gfx) #endmacro ;Pillar - Overhead top of a pillar ; x - X Position ; y - Y Position ;Properties ; image_file = pillar.bmp ; image_width = 16 ; image_height = 16 #macro pillar(x, y) nearest_tile(x, y) new_object(kNo_action, 0, x+ox, 16, y, 16, 16, 0, 0, pillar_gfx) #endmacro ;Scary Tree - Overhead top of the graveyard tree ; x - X Position ; y - Y Position ;Properties ; image_file = tree.bmp #macro scary_tree(x, y) new_object(kNo_action, 0, x, 32, y+4, 12, 16, 0, 0, tree_gfx) #endmacro ;Crystal Switch - A switch that is attacked to trigger an event ; x - X Position ; y - Y Position ; type - Object ID ;Properties ; image_file = crystal switch.bmp ; image_width = 9 ; image_height = 18 ; padding = 1 #macro crystal_switch(x, y, type) #define crystal_switch_w 6 #define crystal_switch_h 6 #ifndef type #define type kNo_action #endif wall_hug(x, y, 6, 6, d_down) new_object(type, o_destroyable | o_noaccess, x+ox,6,y+oy+4,6,0, 16, 0, crystal_switch_gfx) #endmacro ;Button - A switch that is activated by stepping ; x - X Position ; y - Y Position ; type - Object ID ;Properties ; image_file = button.bmp ; image_width = 15 ; image_height = 11 ; padding = 1 #macro button(x, y, type) #ifndef type #define type kNo_action #endif nearest_tile(x, y) new_object(type, 0, x+ox+7, 2, y+oy+5, 8, 0, 0, 0, button_gfx) #endmacro ;Memory Block - A block which can move to same tiles ; x - X Position ; y - Y Position ;Properties ; image_file = block.bmp #macro memory_block(x, y) nearest_tile(x, y) new_object(kMemoryBlock, 0, x+ox, 16, y+oy, 16, 0, 0, 0, block_gfx) #endmacro ;Locked Block - A block which can move to same tiles ; x - X Position ; y - Y Position ;Properties ; image_file = lock.bmp #macro locked_door(x, y) nearest_tile(x, y) new_object(kLocked_door, o_touchable | o_noaccess, x+ox, 16, y+oy, 16, 0, 16, 0, lock_gfx) #endmacro ;Boss Door - Door which only boss key can open ; x - X Position ; y - Y Position #macro boss_door(x, y) nearest_tile(x, y) new_object(kBoss_door, o_touchable | o_noaccess,x+ox,16,y+oy,16,0,16,0,lock_gfx) #endmacro ;Chest - A treasure chest containing an item ; x - X Position ; y - Y Position ; type - Object ID based on item ;Properties ; image_file = chest.bmp #macro chest(x, y, type) #ifndef type #define type kNo_action #endif nearest_tile(x, y) new_object(type, o_touchable | o_noaccess, x+ox, 16, y+oy, 16, 0, 16, 0, chest_gfx) #endmacro ;Sign - Link can read by touching ; x - X Position ; y - Y Position ; type - Object ID ;Properties ; image_file = sign.bmp #macro sign(x, y, type) #ifndef type #define type kNo_action #endif new_object(type, o_touchable|o_noaccess, x, 6, y, 6, 0, 16, 0, sign_gfx) #endmacro ;Horizontal Door Top - Door top which appears over Link ; x - X Position ; y - Y Position ;Properties ; image_file = doortoph.bmp #macro doortoph(x, y) nearest_tile(x, y) new_object(kNo_action,0,x+ox-4,24,y+oy,24,20,0,0,doortoph_gfx) #endmacro ;Vertical Door Top - Door top which appears over Link ; x - X Position ; y - Y Position ;Properties ; image_file = doortopv.bmp #macro doortopv(x, y) nearest_tile(x, y) new_object(kNo_action,0,x+ox-4,24,y+oy-2,22,20,0,0,doortopv_gfx) #endmacro ;Wall Top - Overhead arch for wall entrances ; x - X Position ; y - Y Position #macro walltop(x, y) new_object(kNo_action,0,x,16,y+20,20,20,0,0,walltop_gfx) #endmacro #endif