File tree 2 files changed +31
-6
lines changed
2 files changed +31
-6
lines changed Original file line number Diff line number Diff line change @@ -763,11 +763,8 @@ var HUD = function(world, game){
763
763
this . displayQueue = [ ] ;
764
764
this . message = "" ;
765
765
766
- this . addMessage ( "Ash: Whoa! Where am I?\n" +
767
- "Oak: You are in the wonderful world of Pokemon!!" ) ;
768
- this . prompt ( "Do you like it here?" , function ( resp ) {
769
- hud . addMessage ( "then " + resp ) ;
770
- } ) ;
766
+ this . addMessage ( "Welcome to the ASCII world of Pokemon!!" ) ;
767
+ this . addMessage ( "Everything is drawn with letters, numbers, and symbols." ) ;
771
768
772
769
this . isUp = false ;
773
770
this . menu = new HUDMenu ( [
Original file line number Diff line number Diff line change @@ -117,7 +117,35 @@ var sample_data = {
117
117
} ,
118
118
properties : {
119
119
solid :true ,
120
- description : "It's a lock." ,
120
+ inspect : function ( actor ) {
121
+ var hud = actor . world . hud ;
122
+ var keyOb_i = - 1 ;
123
+ var keyObj = null ;
124
+ for ( var item_i = 0 ; item_i < actor . bag . items . length ; item_i ++ ) {
125
+ if ( actor . bag . items [ item_i ] . name === "key" ) {
126
+ keyOb_i = item_i ;
127
+ keyObj = actor . bag . items [ item_i ] ;
128
+ }
129
+ }
130
+ hud . addMessage ( "It's a lock" ) ;
131
+ if ( keyOb_i >= 0 ) {
132
+ hud . prompt ( "Do you want to unlock it with your key?" , function ( resp ) {
133
+ switch ( resp ) {
134
+ case "YES" :
135
+ keyObj . use ( actor ) ;
136
+
137
+ // remove single use items
138
+ if ( keyObj . singleUse === true )
139
+ actor . bag . items . splice ( keyOb_i , 1 ) ;
140
+ break ;
141
+ case "NO" :
142
+ hud . addMessage ( "Ok, then" ) ;
143
+ break ;
144
+ }
145
+ } ) ;
146
+ }
147
+ return "" ;
148
+ }
121
149
} ,
122
150
} ,
123
151
water : {
You can’t perform that action at this time.
0 commit comments