import java.util.*; import java.awt.*; public class object121 extends object{ int state=0; int i1=0; int o1=0; public object121(){ methods[0]="hit"; methods[1]="event"; methods[2]="event1"; methods[3]="action1"; methods[4]="resetevent"; //? methods[5]="action74"; //ice methods[6]="action177"; //fire methods[7]="action126"; objnumber=121; } public void init(Global glbl){ global=glbl; if(image == null){ image=global.loadImage(global.Server, global.Directory+"121"+global.Extention, global.show); sound=global.loadSound(global.Server, global.Directory+"2.au"); } general=new General(global,getNr()); state=0; } public void execute(){ if(method.compareTo("action1")==0) action1(); if(method.compareTo("action126")==0) action126(); if(method.compareTo("event")==0) event(); if(method.compareTo("resetevent")==0) resetevent(); if(method.compareTo("event1")==0) event1(); if(method.compareTo("hit")==0){ hit(); return; } } public void hit(){ // global.waitforme=true; if(sound!=null && global.playsound)sound.play(); i1=general.getImageBehind(); o1=general.getBehind(); String l="action"+o1; if(is(l)){ setMethod(l); execute(); } } public void action1(){ state=1; } // Action methods public void event1(){ if(general != null) state=general.push(state); } public void action126(){ int x=global.player.getX(); int x1=x; int y=global.player.getY(); int y1=y; if(global.dir == -global.STEPP){ x-=global.STEPP; x1=x-global.STEPP; } // Right if(global.dir == global.STEPP){ x+=global.STEPP; x1=x+global.STEPP; } // down if(global.dir == global.STEPP*global.WIDTH){ y+=global.STEPP; y1=y+global.STEPP; } // up if(global.dir == -global.STEPP*global.WIDTH){ y-=global.STEPP; y1=y-global.STEPP; } global.grid.setxy(x,y,1); global.grid.setxy(x1,y1,1); global.boardrow=-1; global.boardcol=-1; global.doboard=true; } public void event2(){ global.freeze=false; global.resetevent=true; global.waitforme=false; global.aftermoves=true; global.State=global.NOTHING; state=3; } public void event(){ // put everything here like a 'run' method switch(state){ case 1: event1(); break; case 2: event2(); ;break; } } // public void resetevent(){ } }