var canvas = 0 ; var context = 0 ; var w = 750 ; var h = 750 ; var cellSize = 50 ; var nRow = h/cellSize ; var nCol = w/cellSize ; var fontSize = 0.4*cellSize ; var room = 0 ; var cells = 0 ; var cells_revert = 0 ; var player = 0 ; var edit_mode = false ; var completed_game = false ; var wall_edge_color = 'rgb(255, 0, 0)' ; var wall_fill_color = 'rgb(255,200,200)' ; var p_i = 3 ; var p_j = 2 ; var p_A = 1 ; var p_B = 2 ; var all_gp = 0 ; var O_A = p_A ; var O_B = p_B ; function Get(id){ return document.getElementById(id) ; } function draw_all(){ Math.seed = 6 ; context.fillStyle = 'rgb(255,255,255)' ; context.fillRect(0,0,w,h) ; draw_all_cells() ; draw_grid() ; draw_room_name() ; if(edit_mode) update_surrounding_rooms() ; for(var i=0 ; icellSize) w = cellSize-dx ; context.fillRect(x,y,w,bh) ; } } } this.interact = function(di,dj){ return false ; } } var wall = new wall_object() ; var sea = new wall_object() ; sea.draw = function(context,i,j,tb_flag){ var th = 0 ; context.fillStyle = sea_fill_color ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; context.strokeStyle = sea_edge_color ; var A = player.A ; var B = player.B ; context.lineCap = 'round' ; context.lineWidth = 4 ; if((i!=0 && get_cell(A,B,i-1,j)!=90) || tb_flag){ context.beginPath() ; context.moveTo((i+0)*cellSize,(j+0)*cellSize) ; context.lineTo((i+0)*cellSize,(j+1)*cellSize) ; context.stroke() ; } if((i!=nCol-1 && get_cell(A,B,i+1,j)!=90) || tb_flag){ context.beginPath() ; context.moveTo((i+1)*cellSize,(j+0)*cellSize) ; context.lineTo((i+1)*cellSize,(j+1)*cellSize) ; context.stroke() ; } if((j!=0 && get_cell(A,B,i,j-1)!=90) || tb_flag){ context.beginPath() ; context.moveTo((i+0)*cellSize,(j+0)*cellSize) ; context.lineTo((i+1)*cellSize,(j+0)*cellSize) ; context.stroke() ; } if((j!=nRow-1 && get_cell(A,B,i,j+1)!=90) || tb_flag){ context.beginPath() ; context.moveTo((i+0)*cellSize,(j+1)*cellSize) ; context.lineTo((i+1)*cellSize,(j+1)*cellSize) ; context.stroke() ; } } function travelator_N(){ this.is_floor = true ; this.draw = function(context,i,j){ var th = 0 ; context.fillStyle = 'rgb(200,200,200)' ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; th = 1 ; context.fillStyle = 'rgb(255,255,255)' ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; context.beginPath() ; context.fillStyle = 'rgb(200,200,200)' ; context.moveTo((i+0.0)*cellSize+th,(j+1.0)*cellSize-th) ; context.lineTo((i+0.0)*cellSize+th,(j+0.5)*cellSize+th) ; context.lineTo((i+0.5)*cellSize+th,(j+0.0)*cellSize+th) ; context.lineTo((i+1.0)*cellSize+th,(j+0.5)*cellSize+th) ; context.lineTo((i+1.0)*cellSize+th,(j+1.0)*cellSize-th) ; context.lineTo((i+0.5)*cellSize+th,(j+0.5)*cellSize+th) ; context.lineTo((i+0.0)*cellSize+th,(j+1.0)*cellSize-th) ; context.fill() ; } this.interact = function(di,dj){ return !(dj==1) ; } } function travelator_E(){ this.is_floor = true ; this.draw = function(context,i,j){ var th = 0 ; context.fillStyle = 'rgb(200,200,200)' ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; th = 1 ; context.fillStyle = 'rgb(255,255,255)' ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; context.beginPath() ; context.fillStyle = 'rgb(200,200,200)' ; context.moveTo((i+0.0)*cellSize+th,(j+0.0)*cellSize+th) ; context.lineTo((i+0.5)*cellSize+th,(j+0.0)*cellSize+th) ; context.lineTo((i+1.0)*cellSize-th,(j+0.5)*cellSize+th) ; context.lineTo((i+0.5)*cellSize+th,(j+1.0)*cellSize-th) ; context.lineTo((i+0.0)*cellSize+th,(j+1.0)*cellSize-th) ; context.lineTo((i+0.5)*cellSize+th,(j+0.5)*cellSize+th) ; context.lineTo((i+0.0)*cellSize+th,(j+0.0)*cellSize+th) ; context.fill() ; } this.interact = function(di,dj){ return !(di==-1) ; } } function travelator_S(){ this.is_floor = true ; this.draw = function(context,i,j){ var th = 0 ; context.fillStyle = 'rgb(200,200,200)' ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; th = 1 ; context.fillStyle = 'rgb(255,255,255)' ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; context.beginPath() ; context.fillStyle = 'rgb(200,200,200)' ; context.moveTo((i+0.0)*cellSize+th,(j+0.0)*cellSize+th) ; context.lineTo((i+0.0)*cellSize+th,(j+0.5)*cellSize+th) ; context.lineTo((i+0.5)*cellSize+th,(j+1.0)*cellSize-th) ; context.lineTo((i+1.0)*cellSize-th,(j+0.5)*cellSize+th) ; context.lineTo((i+1.0)*cellSize-th,(j+0.0)*cellSize+th) ; context.lineTo((i+0.5)*cellSize+th,(j+0.5)*cellSize+th) ; context.lineTo((i+0.0)*cellSize+th,(j+0.0)*cellSize+th) ; context.fill() ; } this.interact = function(di,dj){ return !(dj==-1) ; } } function travelator_W(){ this.is_floor = true ; this.draw = function(context,i,j){ var th = 0 ; context.fillStyle = 'rgb(200,200,200)' ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; th = 1 ; context.fillStyle = 'rgb(255,255,255)' ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; context.beginPath() ; context.fillStyle = 'rgb(200,200,200)' ; context.moveTo((i+1.0)*cellSize-th,(j+0.0)*cellSize+th) ; context.lineTo((i+0.5)*cellSize+th,(j+0.0)*cellSize+th) ; context.lineTo((i+0.0)*cellSize+th,(j+0.5)*cellSize+th) ; context.lineTo((i+0.5)*cellSize+th,(j+1.0)*cellSize-th) ; context.lineTo((i+1.0)*cellSize-th,(j+1.0)*cellSize-th) ; context.lineTo((i+0.5)*cellSize+th,(j+0.5)*cellSize+th) ; context.lineTo((i+1.0)*cellSize-th,(j+0.0)*cellSize+th) ; context.fill() ; } this.interact = function(di,dj){ return !(di==1) ; } } var travN = new travelator_N() ; var travE = new travelator_E() ; var travS = new travelator_S() ; var travW = new travelator_W() ; function floor_object(color){ this.is_floor = true ; this.color = color ; this.draw = function(context,i,j){ var th = 0 ; context.fillStyle = 'rgb(200,200,200)' ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; th = 0 ; context.fillStyle = this.color ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; this.draw_details(context,i,j) ; } this.draw_details = function(context,i,j){ return ; } this.interact = function(di,dj){ return true ; } } var floor = new floor_object('rgb(255,255,255)') ; var grass = new floor_object('rgb(200,255,200)') ; var sand = new floor_object('rgb(255,255,200)') ; var flower_colors = [] ; flower_colors.push( 'rgb(255, 0, 0)' ) ; flower_colors.push( 'rgb(255,200,255)' ) ; flower_colors.push( 'rgb(200,200,255)' ) ; flower_colors.push( 'rgb(255,140,255)' ) ; var flower_density = 0.1 ; grass.draw_details = function(context,i,j){ if(random_from_ABij(player.A,player.B,i,j)>1.0-flower_density){ var r = 0.15*cellSize ; var randomX = random_from_ABij(player.A,player.B,-i+5, j+5) ; var randomY = random_from_ABij(player.A,player.B,-i+5,-j+5) ; var randomC = random_from_ABij(player.A,player.B, i+5,-j+5) ; var dx = r + 0.6*randomX*cellSize ; var dy = r + 0.6*randomY*cellSize ; var x = i*cellSize + dx ; var y = j*cellSize + dy ; var color = flower_colors[ Math.floor( flower_colors.length*randomC ) ] ; draw_flower(context,x,y,r,color) ; } } function draw_flower(context,x,y,r,color){ context.lineWidth = 1 ; for(var i=0 ; i<5 ; i++){ var cx = x + 0.6*r*Math.cos(2*Math.PI*i/5) ; var cy = y + 0.6*r*Math.sin(2*Math.PI*i/5) ; context.beginPath() ; context.arc(cx,cy,r,0,2*Math.PI,true) ; context.strokeStyle = 'rgb(0,0,0)' ; context.fillStyle = color ; context.fill() ; context.stroke() ; } context.beginPath() ; context.arc(x,y,0.75*r,0,2*Math.PI,true) ; context.strokeStyle = 'rgb(0,0,0)' ; context.fillStyle = 'rgb(255,255,0)' ; context.fill() ; context.stroke() ; } function tile_object(color1, color2){ this.is_floor = true ; this.color1 = color1 ; this.color2 = color2 ; this.draw = function(context,i,j){ var th = 0 ; context.fillStyle = 'rgb(200,200,200)' ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; th = 1 ; context.fillStyle = this.color1 ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; context.fillStyle = this.color2 ; context.fillRect(i*cellSize+th,(j+0.5)*cellSize+th,0.5*cellSize-th,0.5*cellSize-th) ; context.fillRect((i+0.5)*cellSize+th,j*cellSize+th,0.5*cellSize-th,0.5*cellSize-th) ; } this.interact = function(di,dj){ return true ; } } var tile_bw = new tile_object('rgb(200,200,200)','rgb(255,255,255)') ; var tile_BB = new tile_object('rgb(150,150,255)','rgb(200,200,255)') ; function pad_and_door(A1,B1,i1,j1,A2,B2,i2,j2,letter,toggle){ // The switch exists at point 1 and the door is at point 2 // The switch can be labelled with a letter // If toggle=true then the pad opens or closes the door with each interaction // Otherwise the door is open only when pressure is applied this.is_floor = true ; this.id = pad_and_door_objects.length ; this.A1 = A1 ; this.A2 = A2 ; this.B1 = B1 ; this.B2 = B2 ; this.i1 = i1 ; this.i2 = i2 ; this.j1 = j1 ; this.j2 = j2 ; this.letter = letter ; this.toggle = (toggle==undefined) ? false : toggle ; this.door_status = 1 ; // 1 for closed, 2 for open this.door_status_in = this.door_status ; this.draw = function(flag){ // flag values: // 1: Draw pressure pad // 2: Draw door // 3: Draw letter on pad var opacity = 0.2 ; if(player.A==this.A1 && player.B==this.B1){ context.font = fontSize+'pt arial' ; context.textAlign = 'center' ; if(flag==1){ var th = 8 ; context.fillStyle = 'black' ; context.fillRect(this.i1*cellSize+th,(this.j1-0)*cellSize+th,cellSize-2*th,cellSize-2*th) ; th = 12 ; context.fillStyle = 'silver' ; context.fillRect(this.i1*cellSize+th,(this.j1-0)*cellSize+th,cellSize-2*th,cellSize-2*th) ; context.fillStyle = (this.door_status==1) ? 'rgb(0,0,0)' : 'rgba(0,0,0,'+opacity+')' ; context.fillText(this.letter,(this.i1+0.5)*cellSize,(this.j1+0.7)*cellSize) ; } if(flag==2){ var th = 0 ; context.strokeStyle = wall_edge_color ; context.fillStyle = wall_fill_color ; //context.fillRect(this.i2*cellSize+th,(this.j2-0)*cellSize+th,cellSize-2*th,cellSize-2*th) ; context.strokeRect(this.i2*cellSize+th,(this.j2-0)*cellSize+th,cellSize-2*th,cellSize-2*th) ; th = 6 ; context.lineWidth = 4 ; context.strokeStyle = wall_edge_color ; //context.fillRect(this.i2*cellSize+th,(this.j2-0)*cellSize+th,cellSize-2*th,cellSize-2*th) ; var CS = cellSize ; var cx = (this.i2+0.5)*CS ; var cy = (this.j2+0.5)*CS ; var cr = 0.5*cellSize-th ; // Draw outline context.beginPath() ; context.moveTo(cx-0.5*CS,cy-0.5*CS) ; context.lineTo(cx+0.5*CS,cy-0.5*CS) ; context.lineTo(cx+0.5*CS,cy+0.5*CS) ; context.lineTo(cx-0.5*CS,cy+0.5*CS) ; context.lineTo(cx-0.5*CS,cy-0.5*CS) ; context.moveTo(cx-cr,cy) ; context.arc(cx,cy,cr,Math.PI,0,false) ; context.lineTo(cx+cr,cy+cr) ; context.lineTo(cx-cr,cy+cr) ; context.lineTo(cx-cr,cy) ; context.fill('evenodd') ; context.stroke() ; // Draw door context.fillStyle = 'rgb(205,133,63)' ; context.beginPath() ; context.moveTo(cx-cr,cy) ; context.arc(cx,cy,cr,Math.PI,0,false) ; context.lineTo(cx+cr,cy+cr) ; context.lineTo(cx-cr,cy+cr) ; context.lineTo(cx-cr,cy) ; context.stroke() ; if(this.door_status==1){ context.fill() ; } context.fillStyle = (this.door_status==1) ? 'rgb(0,0,0)' : 'rgba(0,0,0,'+opacity+')' ; context.fillText(this.letter,(this.i2+0.5)*cellSize,(this.j2+0.7)*cellSize) ; } if(flag==3){ var th = 15 ; context.fillStyle = 'rgba(255,255,255,0.6)' ; context.fillRect(this.i1*cellSize+th, this.j1*cellSize+th, cellSize-2*th, cellSize-2*th) ; context.fillStyle = 'rgb(0,0,0)' ; context.fillText(this.letter,(this.i1+0.5)*cellSize,(this.j1+0.7)*cellSize) ; } if(flag==4){ var th = 15 ; context.fillStyle = 'rgba(255,255,255,0.6)' ; context.fillRect(this.i2*cellSize+th, this.j2*cellSize+th, cellSize-2*th, cellSize-2*th) ; context.fillStyle = 'rgb(0,0,0)' ; context.fillText(this.letter,(this.i2+0.5)*cellSize,(this.j2+0.7)*cellSize) ; } } } this.interact = function(di,dj){ var m_out = get_master_map_cell(player.A,player.B,player.i,player.j) ; var m_in = get_master_map_cell(player.A,player.B,player.i+di,player.j+dj) ; if(m_in>=2000 && m_in<3000 && this.door_status==1) return false ; if(m_out>=1000 && m_out<2000) this.door_status = 3-this.door_status ; if(m_in >=1000 && m_in <2000) this.door_status = 3-this.door_status ; return true ; } this.write_output = function(){ return 'pad_and_door_objects.push(new pad_and_door(' + this.A1 + ',' + this.B1 + ',' + this.i1 + ',' + this.j1 + ',' + this.A2 + ',' + this.B2 + ',' + this.i2 + ',' + this.j2 + ',' + '"' + this.letter + '",true) ) ;' ; } } function lever_and_door(A1,B1,i1,j1,A2,B2,i2,j2,letter,dir){ // The switch exists at point 1 and the door is at point 2 // The switch can be labelled with a letter // The direction of the switch as it is embedded in a wall this.is_floor = true ; this.id = lever_and_door_objects.length ; this.A1 = A1 ; this.A2 = A2 ; this.B1 = B1 ; this.B2 = B2 ; this.i1 = i1 ; this.i2 = i2 ; this.j1 = j1 ; this.j2 = j2 ; this.letter = letter ; this.dir = dir ; this.door_status = 1 ; // 1 for closed, 2 for open this.door_status_in = this.door_status ; this.draw = function(flag){ // flag values: // 1: Draw pressure pad // 2: Draw door // 3: Draw letter on pad var opacity = 0.2 ; if(player.A==this.A1 && player.B==this.B1){ context.font = fontSize+'pt arial' ; context.textAlign = 'center' ; context.beginPath() ; if(flag==1){ //var t = get_thing(1) ; //t.draw(context,this.i1,this.j1) ; var th = 8 ; var lw = cellSize-2*th ; // lever width var lh = th ; // lever height if(true){ if(this.dir=='N'){ context.fillStyle = wall_edge_color ; context.fillRect(this.i1*cellSize,this.j1*cellSize,cellSize,cellSize) ; context.fillStyle = wall_fill_color ; context.fillRect(this.i1*cellSize+th,this.j1*cellSize-th,cellSize-2*th,th) ; } else if(this.dir=='E'){ context.fillRect((this.i1+1)*cellSize-lh,(this.j1+0)*cellSize+th,lh,lw) ; } else if(this.dir=='S'){ context.fillStyle = wall_edge_color ; context.fillRect(this.i1*cellSize,this.j1*cellSize,cellSize,cellSize) ; context.fillStyle = 'red' ; //wall_fill_color ; context.fillRect(this.i1*cellSize+th,this.j1*cellSize-th,cellSize-2*th,th) ; if(false){ context.strokeStyle = 'magenta' ; context.beginPath() ; context.moveTo((this.i1+0.5)*cellSize,this.j1*cellSize-th) ; if(this.door_status==1){ context.lineTo(this.i1*cellSize-2*th,this.j1*cellSize) ; } if(this.door_status==1){ context.lineTo(this.i1*cellSize+2*th,this.j1*cellSize) ; } context.stroke() ; } } else if(this.dir=='W'){ context.fillRect((this.i1+0)*cellSize,(this.j1-0)*cellSize+th,lh,lw) ; } } context.fillStyle = wall_fill_color ; context.fillRect(this.i1*cellSize+th,(this.j1-0)*cellSize+th,cellSize-2*th,cellSize-2*th) ; th = 12 ; context.fillStyle = wall_edge_color ; context.fillRect(this.i1*cellSize+th,(this.j1-0)*cellSize+th,cellSize-2*th,cellSize-2*th) ; context.fillStyle = wall_fill_color ; context.fillText(this.letter,(this.i1+0.5)*cellSize,(this.j1+0.7)*cellSize) ; } if(flag==2){ var th = 0 ; context.strokeStyle = wall_edge_color ; context.fillStyle = wall_fill_color ; //context.fillRect(this.i2*cellSize+th,(this.j2-0)*cellSize+th,cellSize-2*th,cellSize-2*th) ; context.strokeRect(this.i2*cellSize+th,(this.j2-0)*cellSize+th,cellSize-2*th,cellSize-2*th) ; th = 6 ; context.lineWidth = 4 ; context.strokeStyle = wall_edge_color ; //context.fillRect(this.i2*cellSize+th,(this.j2-0)*cellSize+th,cellSize-2*th,cellSize-2*th) ; var CS = cellSize ; var cx = (this.i2+0.5)*CS ; var cy = (this.j2+0.5)*CS ; var cr = 0.5*cellSize-th ; // Draw outline context.beginPath() ; context.moveTo(cx-0.5*CS,cy-0.5*CS) ; context.lineTo(cx+0.5*CS,cy-0.5*CS) ; context.lineTo(cx+0.5*CS,cy+0.5*CS) ; context.lineTo(cx-0.5*CS,cy+0.5*CS) ; context.lineTo(cx-0.5*CS,cy-0.5*CS) ; context.moveTo(cx-cr,cy) ; context.arc(cx,cy,cr,Math.PI,0,false) ; context.lineTo(cx+cr,cy+cr) ; context.lineTo(cx-cr,cy+cr) ; context.lineTo(cx-cr,cy) ; context.fill('evenodd') ; context.stroke() ; // Draw door context.fillStyle = 'rgb(205,133,63)' ; context.beginPath() ; context.moveTo(cx-cr,cy) ; context.arc(cx,cy,cr,Math.PI,0,false) ; context.lineTo(cx+cr,cy+cr) ; context.lineTo(cx-cr,cy+cr) ; context.lineTo(cx-cr,cy) ; context.stroke() ; if(this.door_status==1){ context.fill() ; } context.fillStyle = (this.door_status==1) ? 'rgb(0,0,0)' : 'rgba(0,0,0,'+opacity+')' ; context.fillText(this.letter,(this.i2+0.5)*cellSize,(this.j2+0.7)*cellSize) ; } if(flag==3){ var th = 15 ; context.fillStyle = 'rgba(255,255,255,0.6)' ; context.fillRect(this.i1*cellSize+th, this.j1*cellSize+th, cellSize-2*th, cellSize-2*th) ; context.fillStyle = 'rgb(0,0,0)' ; context.fillText(this.letter,(this.i1+0.5)*cellSize,(this.j1+0.7)*cellSize) ; } if(flag==4){ var th = 15 ; context.fillStyle = 'rgba(255,255,255,0.6)' ; context.fillRect(this.i2*cellSize+th, this.j2*cellSize+th, cellSize-2*th, cellSize-2*th) ; context.fillStyle = 'rgb(0,0,0)' ; context.fillText(this.letter,(this.i2+0.5)*cellSize,(this.j2+0.7)*cellSize) ; } } } this.interact = function(di,dj){ var m = get_master_map_cell(player.A,player.B,player.i+di,player.j+dj) ; if(m>=4000 && m<5000) return (this.door_status==2) ; m = get_cell(this.A2,this.B2,this.i2,this.j2) ; if(m==2) return false ; if(di== 1 && dir=='W') this.door_status = 3 - this.door_status ; if(di==-1 && dir=='E') this.door_status = 3 - this.door_status ; if(dj== 1 && dir=='N') this.door_status = 3 - this.door_status ; if(dj==-1 && dir=='S') this.door_status = 3 - this.door_status ; draw_all() ; return false ; } this.write_output = function(){ return 'lever_and_door_objects.push(new lever_and_door(' + this.A1 + ',' + this.B1 + ',' + this.i1 + ',' + this.j1 + ',' + this.A2 + ',' + this.B2 + ',' + this.i2 + ',' + this.j2 + ',' + '"' + this.letter + '","'+this.dir+'") ) ;' ; } } var gp_fontSize = 0.3*cellSize ; function gold_piece_object(amount){ this.amount = amount ; this.interact = function(){ player.gp_current_room += this.amount ; player.gp += this.amount ; return true ; } this.draw = function(context,i,j){ var cx = (i+0.5)*cellSize ; var cy = (j+0.5)*cellSize ; var cr = 0.3*cellSize ; context.beginPath() ; context.strokeStyle = 'rgb(0,0,0)' ; context.lineWidth = 2 ; context.fillStyle = 'rgb(255,223,0)' ; context.arc(cx,cy,cr,0,2*Math.PI,true) ; context.fill() ; context.stroke() ; context.font = gp_fontSize+'pt arial' ; context.fillStyle = 'rgb(0,0,0)' ; context.textAlign = 'center' ; context.fillText(this.amount,cx,cy+0.35*fontSize) ; } } var gp1 = new gold_piece_object(1) ; var gp2 = new gold_piece_object(2) ; var gp5 = new gold_piece_object(5) ; function count_gold_on_map(){ var gp = 0 ; for(var B=0 ; B=0 && dialogue_stepdialogue_text.length){ dialogue_step = -1 ; if(dialogue_responses.length==0){ dialogue_chosen_response = -1 ; } else{ dialogue_chosen_response = 0 ; for(var i=0 ; i=dialogue_responses.length) dialogue_chosen_response = dialogue_responses.length-1 ; //alert('$'+dialogue_chosen_response) ; draw_dialogue_reponses() ; } function dialogue_choose_default_response(){ //dialogue_chosen_response = 0 ; dialogue_respond() ; } function dialogue_choose_current_response(){ dialogue_respond() ; } function dialogue_respond(){ npcs[current_npc].dialogue_counter = dialogue_responses[dialogue_chosen_response][1] ; dialogue_waiting_for_response = false ; dialogue_responses = [] ; dialogue_chosen_response = -1 ; dialogue_written_responses = false ; npcs[current_npc].converse() ; clear_dialogue() ; } function question_object(question_text, answers_texts){ this.question_text = question_text ; this.answers_texts = answers_texts ; this.cost_type = 0 ; // 0 for not specified, free // 1 for gold pieces this.add_gp_price = function(amount){ this.cost_type = 1 ; this.price = amount ; } this.add_special_price = function(type, amount){ this.cost_type = 1 ; this.price = amount ; } } var current_npc = -1 ; function npc_object(name, A, B, i, j, color1, color2){ this.name = name ; this.A = A ; this.B = B ; this.i = i ; this.j = j ; this.color1 = color1 ; this.color2 = color2 ; this.dialogue_preamble = new Array() ; this.said_preamble = false ; this.dialogue = new Array() ; this.dialogue_counter = 0 ; this.questions = new Array() ; this.index = -1 ; this.draw = function(context,i,j){ var th = 0 ; context.fillStyle = this.color1 ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; th = 4 ; context.fillStyle = this.color2 ; context.fillRect(i*cellSize+th,j*cellSize+th,cellSize-2*th,cellSize-2*th) ; context.fillStyle = this.color1 ; var dx = th ; var dy = th ; var ew = 0.2*cellSize ; // eye width var eh = 0.2*cellSize ; // eye height context.fillRect((i+0)*cellSize+th+dx ,j*cellSize+th+dy,ew,eh) ; context.fillRect((i+1)*cellSize-th-dx-ew,j*cellSize+th+dy,ew,eh) ; context.fillRect((i+0)*cellSize+th+dx,j*cellSize+th+6*dy,cellSize-2*th-2*dx,eh) ; } this.interact = function(di,dj){ this.converse() ; current_npc = this.index ; return false ; } this.converse = function(){ if(this.dialogue_preamble.length==0) this.said_preamble = true ; if(dialogue_step>0 && dialogue_step0){ current_enemy.hit_points -= hurt ; } if(current_enemy.hit_points<=0){ current_enemy.kill() ; draw_combat_table() ; reset_combat_table() ; in_combat = false ; return ; } var attack = current_enemy.attack_base + Math.random()*current_enemy.attack_blur ; var defence = player.defence_base + Math.random()*player.defence_blur ; var hurt = Math.floor(attack) - Math.floor(defence) ; if(hurt>0){ player.hit_points -= hurt ; } draw_combat_table() ; if(player.hit_points<=0){ player.kill() ; in_combat = false ; return ; } window.setTimeout(increment_conflict,combat_delay) ; } function random_from_ABij(A,B,i,j){ var pow_A = Math.pow(2.5,1+A+0.1) ; var pow_B = Math.pow(3.5,1+B+0.2) ; var pow_i = Math.pow(4.5,1+i+0.3) ; var pow_j = Math.pow(5.5,1+j+0.4) ; var result = (pow_A+pow_B+pow_i+pow_j)%1 ; return result ; } function pushable_block_object(){ this.A = -1 ; this.B = -1 ; this.i = -1 ; this.j = -1 ; this.draw = function(context,i,j){ var th = 3 ; var margin = 4 ; context.fillStyle = 'rgb(255,255, 0)' ; context.strokeStyle = 'rgb( 0, 0, 0)' ; context.lineWidth = 2 ; context.beginPath() ; var corner = 0.25*cellSize ; var x, y, w, h ; // Main body of box context.fillStyle = 'rgb(200,200,200)' ; x = (i+0)*cellSize+margin+1 ; y = (j+0)*cellSize+margin+1 ; w = cellSize-2*margin-2 ; h = cellSize-2*margin-2 ; context.fillRect(x,y,w,h) ; context.strokeRect(x,y,w,h) ; context.fillStyle = 'rgb(210,180,140)' ; x = (i+0)*cellSize+margin+5 ; y = (j+0)*cellSize+margin+5 ; w = cellSize-2*margin-10 ; h = cellSize-2*margin-10 ; context.fillRect(x,y,w,h) ; context.strokeRect(x,y,w,h) ; // Diagonal support beams context.strokeStyle = 'rgb(0,0,0)' ; context.lineWidth = 5 ; context.moveTo((i+0)*cellSize+margin+2, (j+0)*cellSize+margin+2) ; context.lineTo((i+1)*cellSize-margin-2, (j+1)*cellSize-margin-2) ; context.stroke() ; context.strokeStyle = 'rgb(200,200,200)' ; context.lineWidth = 2 ; context.moveTo((i+0)*cellSize+margin+2, (j+0)*cellSize+margin+2) ; context.lineTo((i+1)*cellSize-margin-2, (j+1)*cellSize-margin-2) ; context.stroke() ; context.strokeStyle = 'rgb(0,0,0)' ; context.lineWidth = 5 ; context.moveTo((i+1)*cellSize-margin-2, (j+0)*cellSize+margin+2) ; context.lineTo((i+0)*cellSize+margin+2, (j+1)*cellSize-margin-2) ; context.stroke() ; context.strokeStyle = 'rgb(200,200,200)' ; context.lineWidth = 2 ; context.moveTo((i+1)*cellSize-margin-2, (j+0)*cellSize+margin+2) ; context.lineTo((i+0)*cellSize+margin+2, (j+1)*cellSize-margin-2) ; context.stroke() ; // Corners context.strokeStyle = 'rgb( 0, 0, 0)' ; context.fillStyle = 'rgb(200,200,200)' ; w = corner ; h = corner ; x = (i+0)*cellSize+margin-1 ; y = (j+0)*cellSize+margin-1 ; context.fillRect(x,y,w,h) ; context.strokeRect(x,y,w,h) ; x = (i+1)*cellSize-margin+1-corner ; y = (j+0)*cellSize+margin-1 ; context.fillRect(x,y,w,h) ; context.strokeRect(x,y,w,h) ; x = (i+0)*cellSize+margin-1 ; y = (j+1)*cellSize-margin+1-corner ; context.fillRect(x,y,w,h) ; context.strokeRect(x,y,w,h) ; x = (i+1)*cellSize-margin+1-corner ; y = (j+1)*cellSize-margin+1-corner ; context.fillRect(x,y,w,h) ; context.strokeRect(x,y,w,h) ; var m = get_master_map_cell(player.A,player.B,i,j) ; if(m>=1000 && m<2000){ pad_and_door_objects[m%1000].draw(3) ; } if(m>=2000 && m<3000){ pad_and_door_objects[m%2000].draw(4) ; } if(m>=3000 && m<4000){ lever_and_door_objects[m%3000].draw(3) ; } if(m>=4000 && m<5000){ lever_and_door_objects[m%4000].draw(4) ; } } this.interact = function(di,dj){ var i1 = -1 ; var i2 = -1 ; var j1 = -1 ; var j2 = -1 ; if((di+nCol)%nCol==nCol-1){ // W i1 = player.i-1 ; i2 = player.i-2 ; j1 = player.j ; j2 = player.j ; // Check for travelators if(get_master_map_cell(player.A,player.B,i1,j1)==30) return false ; if(get_master_map_cell(player.A,player.B,i1,j1)==31) return false ; if(get_master_map_cell(player.A,player.B,i1,j1)==32) return false ; if(get_master_map_cell(player.A,player.B,i2,j2)==31) return false ; } if((di+nCol)%nCol==1){ // E i1 = player.i+1 ; i2 = player.i+2 ; j1 = player.j ; j2 = player.j ; // Check for travelators if(get_master_map_cell(player.A,player.B,i1,j1)==30) return false ; if(get_master_map_cell(player.A,player.B,i1,j1)==32) return false ; if(get_master_map_cell(player.A,player.B,i1,j1)==33) return false ; if(get_master_map_cell(player.A,player.B,i2,j2)==33) return false ; } if((dj+nRow)%nRow==nRow-1){ // N i1 = player.i ; i2 = player.i ; j1 = player.j-1 ; j2 = player.j-2 ; // Check for travelators if(get_master_map_cell(player.A,player.B,i1,j1)==31) return false ; if(get_master_map_cell(player.A,player.B,i1,j1)==32) return false ; if(get_master_map_cell(player.A,player.B,i1,j1)==33) return false ; if(get_master_map_cell(player.A,player.B,i2,j2)==32) return false ; } if((dj+nRow)%nRow==1){ // S i1 = player.i ; i2 = player.i ; j1 = player.j+1 ; j2 = player.j+2 ; // Check for travelators if(get_master_map_cell(player.A,player.B,i1,j1)==30) return false ; if(get_master_map_cell(player.A,player.B,i1,j1)==31) return false ; if(get_master_map_cell(player.A,player.B,i1,j1)==33) return false ; if(get_master_map_cell(player.A,player.B,i2,j2)==30) return false ; } // Protect against moving off pressure pads with doors that are blocked var m = get_master_map_cell(player.A,player.B,i1,j1) ; if(m>=1000 && m<2000){ var p = pad_and_door_objects[m%1000] ; if(rooms[p.B2][p.A2].cells[p.j2][p.i2]!=m+1000) return false ; } if(is_pushable_traversable(get_cell(player.A,player.B,i2,j2))){ var c_in = get_cell_coords(player.A,player.B,i2,j2) ; var c_out = get_cell_coords(player.A,player.B,i1,j1) ; var value_in = master_map[c_in[1] ][c_in[0] ].cells[c_in[3] ][c_in[2] ] ; var value_out = master_map[c_out[1]][c_out[0]].cells[c_out[3]][c_out[2]] ; if(value_in>=1000 && value_in<2000) pad_and_door_objects[value_in%1000].interact(2*di,2*dj) ; if(value_in>=2000 && value_in<3000 && pad_and_door_objects[value_in%2000].door_status==1) return false ; if(value_in>=4000 && value_in<5000 && lever_and_door_objects[value_in%4000].door_status==1) return false ; set_cell(player.A,player.B,i2,j2,2) ; set_cell(c_out[0],c_out[1],c_out[2],c_out[3],0) return true ; } return false ; } } var pb = new pushable_block_object() ; function get_thing(value){ if(value==0) value = rooms[player.B][player.A].floor_type ; switch(value){ case 0: return floor ; break ; case 1: return wall ; break ; case 2: return pb ; break ; case 11: return grass ; break ; case 12: return sand ; break ; case 21: return gp1 ; break ; case 22: return gp2 ; break ; case 23: return gp5 ; break ; case 30: return travN ; break ; case 31: return travE ; break ; case 32: return travS ; break ; case 33: return travW ; break ; case 40: return tile_bw ; break ; case 41: return tile_BB ; break ; case 90: return sea ; break ; case 99: return player ; break ; } if(value>=1000 && value< 2000) return pad_and_door_objects[value%1000] ; if(value>=2000 && value< 3000) return pad_and_door_objects[value%2000] ; if(value>=3000 && value< 4000) return lever_and_door_objects[value%3000] ; if(value>=4000 && value< 5000) return lever_and_door_objects[value%4000] ; if(value>=8000 && value< 9000) return enemies[value%8000] ; if(value>=9000 && value<10000) return npcs[value%9000] ; return 0 ; } function interact(value,di,dj){ var thing = get_thing(value) ; if(thing==0) return true ; return thing.interact(di,dj) ; } function is_pushable_traversable(type){ var t = get_thing(type) ; if(t.is_floor) return true ; switch(type){ default: break ; } if(type>=1000 && type<2000) return true ; if(type>=2000 && type<3000) return ( pad_and_door_objects[type%2000].door_status==2) ; if(type>=4000 && type<5000) return (lever_and_door_objects[type%4000].door_status==2) ; return false ; } function is_traversable(type){ if(player.ghost_mode==true) return true ; var t = get_thing(type) ; if(t.is_floor) return true ; switch(type){ case 2 : case 21: case 22: case 23: return true ; break ; default : break ; } if(type>=1000 && type< 2000) return true ; if(type>=2000 && type< 3000) return (pad_and_door_objects[type%1000].door_status==2) ; if(type>=8000 && type< 9000) return true ; if(type>=9000 && type<10000) return true ; return false ; } function is_heavy(type){ switch(type){ case 2: case 99: return true ; } return false ; } function keyDown(evt){ var keyDownID = window.event ? event.keyCode : (evt.keyCode != 0 ? evt.keyCode : evt.which) ; switch(keyDownID){ case 37: evt.preventDefault() ; break ; // left case 38: evt.preventDefault() ; break ; // up case 39: evt.preventDefault() ; break ; // right case 40: evt.preventDefault() ; break ; // down case 27: evt.preventDefault() ; break ; // esc case 32: evt.preventDefault() ; break ; // space } if(edit_mode) return ; if(in_combat) return ; if(dialogue_waiting_for_response){ interupt_dialogue() ; switch(keyDownID){ case 38: case 87: dialogue_change_prev_response() ; break ; // up case 40: case 83: dialogue_change_next_response() ; break ; // down case 27: dialogue_choose_default_response() ; break ; // esc case 13: dialogue_choose_current_response() ; break ; // enter } return ; } else{ switch(keyDownID){ case 37: case 65: try_move_W() ; break ; // left case 38: case 87: try_move_N() ; break ; // up case 39: case 68: try_move_E() ; break ; // right case 40: case 83: try_move_S() ; break ; // down case 27: reset_room() ; break ; // esc case 32: interupt_dialogue() ; break ; // space } } } function move_player(di,dj,dA,dB){ var value = 0 ; if(dA==0 && dB==0){ value = cells[player.j+dj][player.i+di] ; if(!is_traversable(value)) return ; } else{ value = get_cell(player.A+dA,player.B+dB,player.i+di,player.j+dj) ; if(!is_traversable(value)) return ; } var i = player.i ; var j = player.j ; var m = get_master_map_cell(player.A,player.B,i,j) ; m = (m==0) ? room.floor_type : m ; // Travelators if(m==30 && ((dj+nRow)%nRow)!= nRow-1) return ; if(m==31 && ((di-nCol)%nCol)!=-nCol+1) return ; if(m==32 && ((dj-nRow)%nRow)!=-nRow+1) return ; if(m==33 && ((di+nCol)%nCol)!= nCol-1) return ; // Conversations m = get_master_map_cell(player.A,player.B,i+di,j+dj) ; if(m<9000 || m>=10000){ interupt_dialogue() ; clear_dialogue() ; current_npc = -1 ; dialogue_step =-1 ; } var success = interact(value,di,dj) ; if(!success) return ; m = get_master_map_cell(player.A,player.B,i,j) ; cells[j][i] = (is_pushable_traversable(m)) ? m : 0 ; if(dA!=0 || dB!=0){ var A = player.A + dA ; var B = player.B + dB ; change_room(A,B,di,dj) ; } m = get_master_map_cell(player.A,player.B,i,j) ; if(m>=1000 && m<2000) pad_and_door_objects[m%1000].interact(di,dj) ; player.i += di ; player.j += dj ; player.A += dA ; player.B += dB ; if(dialogue_step>=0 && dialogue_step=rooms.length ) return blank_room ; if(A<0 || A>=rooms[B].length) return blank_room ; return rooms[B][A] ; } function coords_W(A,B,i,j){ return (i<=0 ) ? [A-1,B,nCol-1,j] : [A,B,i-1,j] ; } function coords_E(A,B,i,j){ return (i>=nCol-1) ? [A+1,B, 0,j] : [A,B,i+1,j] ; } function coords_N(A,B,i,j){ return (j<=0 ) ? [A,B-1,nRow-1,j] : [A,B,i,j-1] ; } function coords_S(A,B,i,j){ return (j>=nRow-1) ? [A,B+1, 0,j] : [A,B,i,j+1] ; } function get_cell_coords(A,B,i,j){ if(i< 0 ){ i = nCol-1 ; A-- ; } if(i>=nCol){ i = 0 ; A++ ; } if(j< 0 ){ j = nRow-1 ; B-- ; } if(j>=nRow){ j = 0 ; B++ ; } var room_tmp = get_room(A,B) ; if(j<0 || j>=room_tmp.cells.length) return -1 ; if(i<0 || i>=room_tmp.cells[j].length) return -1 ; return [A,B,i,j] ; } function get_cell(A,B,i,j){ if( i<0 ){ i = nCol+i ; A-- ; } else if(i>=nCol){ i = i-nCol ; A++ ; } if( j<0 ){ j = nRow+j ; B-- ; } else if(j>=nRow){ j = j-nRow ; B++ ; } var room_tmp = get_room(A,B) ; return room_tmp.cells[j][i] ; } function set_cell(A,B,i,j,value){ if(i< 0 ){ i = nCol+i ; A-- ; } if(i>=nCol){ i = i-nCol ; A++ ; } if(j< 0 ){ j = nRow+j ; B-- ; } if(j>=nRow){ j = j-nRow ; B++ ; } var room_tmp = get_room(A,B) ; room_tmp.cells[j][i] = value ; } function change_room(A,B,di,dj){ player.i_in = player.i+di ; player.j_in = player.j+dj ; player.gp_current_room = 0 ; room = get_room(A,B) ; wall_edge_color = room.wallEdgeColor ; wall_fill_color = room.wallFillColor ; cells = room.cells ; backup_cells() ; draw_room_name() ; update_dialogue_box_style() ; clear_dialogue() ; for(var i=0 ; i=master_map.length) return 0 ; if(A<0 || A>=master_map[B].length) return 0 ; if(j<0 || j>=master_map[B][A].cells.length) return 0 ; if(i<0 || i>=master_map[B][A].cells[j].length) return 0 ; return master_map[B][A].cells[j][i] ; } function populate_rooms(){ rooms = new Array() ; for(var B_=0 ; B_=nCol){ i = i-nCol ; A++ ; } if( j<0 ){ j = nRow+j ; B-- ; } else if(j>=nRow){ j = j-nRow ; B++ ; } var room_tmp = get_room(A,B) ; return room_tmp.cells[j][i] ; } var lever_and_door_objects = [] ; var pad_and_door_objects = [] ; var enemies = [] ; var master_map = [ [ new room_object( [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) ] , [ new room_object( [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,9001,0,0,0,0,0,0,9002,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,9000,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,11,11,11,11,11,11,11,11,11,11,11,11,11,11], [1,11,11,11,11,11,11,11,11,11,11,11,11,11,11], [1,11,11,9001,11,11,11,11,11,11,9002,11,11,11,11], [1,11,11,11,11,11,11,11,11,11,11,11,11,11,11], [1,11,11,11,11,9000,11,11,11,11,11,11,11,11,11], [1,11,11,11,11,11,11,11,11,11,11,11,11,11,11], [1,11,11,11,11,11,11,11,11,11,11,11,11,11,11], [1,11,11,11,11,11,11,11,11,11,11,11,11,11,11], [1,11,11,11,11,11,11,11,11,11,11,11,11,11,11], [1,11,11,11,11,11,11,11,11,11,11,11,11,11,11], [1,11,11,11,11,11,11,11,11,11,11,11,11,11,11], [1,11,11,11,11,11,11,11,11,11,11,11,11,11,11], [1,11,11,11,11,11,11,11,11,11,11,11,11,11,11], [1,1,1,1,1,1,0,0,0,1,1,1,1,1,1] ], "Walled garden","rgb(139,69,19)","rgb(247,232,221)",41) , new room_object( [ [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,11], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,11], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,11], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] ], "Walled garden (East)","rgb( 0, 0, 0)","rgb(200,200,200)",11) , new room_object( [ [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,0,90,90,90,90,90,90,90,90,90,90,90,90,0], [1,0,90,0,90,90,0,0,0,0,0,90,0,0,0], [1,0,90,0,0,0,0,90,90,90,0,0,0,90,0], [1,0,90,90,90,90,0,90,0,90,90,90,90,90,0], [1,0,90,0,0,0,0,90,0,0,0,90,0,90,0], [11,0,90,0,90,90,90,90,0,90,90,90,0,90,0], [11,0,90,0,0,0,0,0,0,90,0,0,0,90,0], [11,0,90,90,90,90,0,90,90,90,0,90,90,90,0], [1,0,90,0,0,0,0,90,0,0,0,0,0,90,0], [1,0,0,0,90,90,90,90,90,90,90,90,0,90,0], [1,0,90,0,0,0,0,0,0,0,0,0,0,90,0], [1,0,90,90,90,90,90,90,90,90,90,90,90,90,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] ], "HedgeMaze","rgb( 0, 0, 0)","rgb(200,200,200)",11) , new room_object( [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) ] , [ new room_object( [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [1,1,1,1,1,1,0,0,0,1,1,1,1,1,1], [1,0,0,0,0,1,0,0,0,0,0,0,0,23,1], [1,0,0,0,0,2000,0,0,0,0,0,0,0,0,1], [1,0,0,0,2,1,0,0,0,0,0,0,0,0,1], [1,0,0,2,0,1,0,0,0,0,0,0,0,0,1], [1,1,1,1000,1,1,0,0,0,0,0,0,0,0,1], [1,3000,1,30,1,4000,0,0,0,0,0,0,0,0,0], [1,0,1,0,1,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,1,1,0,1,1,0,0,0,0,0,0,0,2,1], [1,0,0,0,0,1,0,0,0,0,0,0,0,4001,1], [1,0,0,0,0,1,0,0,0,0,0,0,0,0,1], [1,0,0,0,0,1,0,0,0,0,0,0,0,3001,1], [1,23,0,0,0,1,0,0,0,0,0,0,0,23,1], [1,1,1,1,1,1,0,0,0,1,1,1,1,1,1] ], "A room","rgb( 0, 0, 50)","rgb(255,255,255)",41) , new room_object( [ [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,40,40,40,40,40,40,40,40,40,40,40,40,40,1], [1,40,40,40,40,40,40,40,40,40,40,40,40,40,1], [1,40,40,40,40,40,40,40,40,40,40,40,40,40,1], [1,40,40,40,40,40,40,40,40,40,40,40,40,40,1], [1,40,8000,40,40,40,40,40,40,40,40,40,40,40,1], [40,40,40,40,40,40,40,40,40,40,40,40,40,40,0], [40,40,40,40,40,40,40,40,40,40,40,40,40,40,0], [40,40,40,40,40,40,40,40,40,40,40,40,40,40,0], [1,40,40,40,40,40,40,40,40,40,40,40,40,40,1], [1,40,40,40,40,40,40,40,40,40,40,40,40,40,1], [1,40,40,40,40,40,40,40,40,40,40,40,40,40,1], [1,40,40,40,40,40,40,40,40,40,40,40,40,40,1], [1,40,40,40,40,40,40,40,40,40,40,40,40,40,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",40) , new room_object( [ [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,0,0,0,0,0,0,1,1,1,1,1,1], [1,1,0,0,0,0,0,0,0,0,1,1,1,1,1], [1,0,0,0,0,0,0,0,0,0,0,1,1,1,1], [1,0,0,0,0,0,90,90,0,0,0,0,1,1,1], [1,0,0,0,0,0,90,90,90,90,0,0,0,1,1], [0,0,0,0,0,0,90,90,90,90,0,0,0,0,1], [0,0,0,0,0,0,0,90,90,90,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], [1,1,1,1,1,0,0,0,0,0,0,0,0,1,1], [1,1,1,1,1,1,0,0,0,0,0,0,1,1,1], [1,1,1,1,1,1,1,0,0,0,0,1,1,1,1], [1,1,1,1,1,1,1,1,0,0,1,1,1,1,1], [1,1,1,1,1,1,1,0,0,1,1,1,1,1,1], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) ] , [ new room_object( [ [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,21,21,21,21,21,21,21,21,21,1,1,11], [1,1,1,21,21,21,21,21,21,21,21,21,1,1,11], [1,1,1,21,21,21,21,21,21,21,21,21,1,1,11], [1,1,1,21,21,21,21,21,21,21,21,21,1,1,11], [1,1,1,21,21,21,21,21,21,21,21,21,1,1,11], [1,1,1,1,1,1,0,0,0,1,1,1,1,1,11], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,11], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,11], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,11], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,11], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,11], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,11], [1,1,1,1,1,1,1,0,0,0,11,11,11,11,11], [1,1,1,1,1,1,1,0,1,1,11,11,11,11,11] ], "Treasure room","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [1,1,1,1,1,1,0,0,0,1,1,1,1,1,1], [11,11,11,11,11,1,0,0,0,1,11,11,11,11,11], [11,11,11,11,11,1,0,0,0,1,11,11,11,11,11], [11,11,11,11,11,1,0,0,0,1,11,11,11,11,11], [11,11,11,11,11,1,0,0,0,1,11,11,11,11,11], [11,11,11,11,11,1,0,0,0,1,11,11,11,11,11], [11,11,11,11,11,1,0,0,0,1,11,11,11,11,11], [11,11,11,11,11,1,0,0,0,1,11,11,11,11,11], [11,11,11,11,11,1,0,0,0,1,11,11,11,11,11], [11,11,11,11,11,1,0,0,0,1,11,11,11,11,11], [11,11,11,11,11,1,0,0,0,1,11,11,11,11,11], [11,11,11,11,11,1,0,0,0,1,11,11,11,11,11], [11,11,11,11,11,1,0,0,0,1,11,11,11,11,11], [11,11,11,11,11,1,0,0,0,1,11,11,11,11,11], [11,11,11,11,11,1,0,0,0,1,11,11,11,11,11] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",40) , new room_object( [ [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [1,1,1,1,1,1,1,40,1,1,1,1,1,1,1], [90,90,90,90,90,90,40,40,40,90,90,90,90,90,90], [90,90,90,90,90,90,40,40,40,90,90,90,90,90,90], [90,90,90,90,90,90,40,40,40,90,90,90,90,90,90], [90,90,90,90,90,90,40,40,40,90,90,90,90,90,90], [90,90,90,90,90,90,40,40,40,90,90,90,90,90,90], [90,90,90,90,90,90,40,40,40,90,90,90,90,90,90], [90,90,90,90,90,90,40,40,40,90,90,90,90,90,90], [90,90,90,90,90,90,40,40,40,90,90,90,90,90,90], [90,90,90,90,90,90,90,90,90,90,90,90,90,90,90], [90,90,90,90,90,90,90,90,90,90,90,90,90,90,90], [90,90,90,90,90,90,90,90,90,90,90,90,90,90,90], [90,90,90,90,90,90,90,90,90,90,90,90,90,90,90], [90,90,90,90,90,90,90,90,90,90,90,90,90,90,90], [90,90,90,90,90,90,90,90,90,90,90,90,90,90,90] ], "ThePier","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) ] , [ new room_object( [ [1,1,1,1,1,1,1,0,1,1,11,11,11,11,11], [1,1,1,1,1,1,1,0,1,1,11,11,11,11,11], [1,1,1,1,1,1,1,0,1,1,11,11,11,11,11], [1,1,1,1,1,1,1,0,1,1,11,11,11,11,11], [1,1,1,1,1,1,1,0,1,1,11,11,11,11,11], [1,1,1,1,1,1,1,0,1,1,11,11,11,11,11], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1], [1,1,1,1,1,1,0,0,0,1,1,1,1,1,1], [1,1,1,1,1,1,0,0,0,0,0,0,0,0,0], [1,1,1,1,1,1,0,0,0,1,1,1,1,1,1], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [11,11,11,11,11,1,40,40,40,1,11,11,11,11,11], [11,11,11,11,11,1,40,40,40,1,11,11,11,11,11], [11,11,11,11,11,1,40,40,40,1,11,11,11,11,11], [11,11,11,11,11,1,40,40,40,1,11,11,11,11,11], [11,11,11,11,11,1,40,40,40,1,11,11,11,11,11], [11,11,11,11,11,1,40,40,40,1,11,11,11,11,11], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1], [1,1,1,1,1,1,0,0,0,1,1,1,1,1,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,1,1,1,1,1,0,0,0,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [11,11,11,11,11,11,11,11,11,11,11,11,12,12,90], [1,0,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,0,1,1,1,1,1,1,1,1,1,1,1,1,1], [0,0,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) ] , [ new room_object( [ [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,0,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,0,0,0,0,0,0,0,0], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] ], "TheSewer","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) , new room_object( [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] ], "Nothingness","rgb( 0, 0, 0)","rgb(200,200,200)",0) ] ] ; pad_and_door_objects.push(new pad_and_door(1,2,3,5,1,2,5,2,"A",true) ) ; lever_and_door_objects.push(new lever_and_door(1,2,1,6,1,2,5,6,"a","S") ) ; lever_and_door_objects.push(new lever_and_door(1,2,13,12,1,2,13,10,"b","W") ) ; enemies.push(new enemy_object('Goblin', [2,1,2,5], 9, 3, 10, 2, 10, 0, 'rgb(0,0,0)', 'rgb(255,255,0)', []) ) ; var npcs = [] ; var npc_gerald = new npc_object('Gerald', 0, 0, 5, 5, 'red', 'white') ; npc_gerald.dialogue.push(['Hello there!']) ; npc_gerald.dialogue.push([['My name is Gerald, and I like grapes.',0], ['What?',2], ['Oh',2], ['My face hurts',2]]) ; npc_gerald.dialogue.push(['I saw a hedge once.',[3]]) ; npc_gerald.dialogue.push(['It\'s true.',[2]]) ; npc_gerald.dialogue_preamble.push('What what? (press space to continue the conversation)') ; var npc_gertrude = new npc_object('Gertrude', 0, 0, 3, 3, 'brown', 'pink') ; npc_gertrude.dialogue.push(['Do not listen to Gerald.']) ; npc_gertrude.dialogue.push(['He lies.', [0,2]]) ; npc_gertrude.dialogue.push(['I don\'t know what else to say.',[0]]) ; var npc_glados = new npc_object('GLaDOS', 0, 0,10, 3, 'orange', '#ffdddd') ; npc_glados.dialogue.push(['This was a triumph, I\'m making a note here: HUGE SUCCESS.']) ; npc_glados.dialogue.push(['It\'s hard to overstate my satisfaction.']) ; npc_glados.dialogue.push(['Aperture Science, we do what we must because we can.']) ; npc_glados.dialogue.push(['For the good of all of us except the ones who are dead.']) ; npc_glados.dialogue.push(['But there\'s no sense crying over every mistake, you just keep on trying \'til you run out of cake.']) ; npc_glados.dialogue.push(['And the science gets done and you make a neat gun for the people who are still alive.']) ; npcs.push(npc_gerald ) ; npcs.push(npc_gertrude) ; npcs.push(npc_glados ) ;//pad_and_door_objects.push(new pad_and_door(1,3,6,4,1,3,6,6,'A',true) ) ; //pad_and_door_objects.push(new pad_and_door(1,3,8,4,1,3,8,8,'B',true) ) ; for(var i=0 ; i