home *** CD-ROM | disk | FTP | other *** search
- class Krokoboss extends Figur
- {
- var mc;
- var dybde;
- var iLufta;
- var nesteFrame;
- var brett_y;
- var brett_x;
- var bredde;
- var roligH = 1;
- var roligV = 1;
- var angripH = 20;
- var angripV = 20;
- var angriper = false;
- var forsteKnockoutH = 40;
- var sisteKnockoutH = 55;
- var forsteFlatH = 60;
- var sisteFlatH = 76;
- var knock = false;
- var flat = false;
- var slaar = false;
- var reiserSeg = false;
- var glefser = false;
- var liv = 3;
- function Krokoboss(mc, brett_x, brett_y, bredde, hogde)
- {
- super(mc,brett_x,brett_y,bredde,hogde);
- Figur.figurliste.push(this);
- this.mc.swapDepths(4200 + Figur.figurliste.length);
- this.dybde = this.mc.getDepth();
- this.iLufta = true;
- this.aks_y = 0.7;
- this.liv = 3;
- }
- function knockout()
- {
- if(!this.knock)
- {
- if(this.flat)
- {
- _root.hit.start();
- this.flatUt();
- }
- else
- {
- _root.hit.start();
- this.knock = true;
- this.fart_y = -12;
- this.iLufta = true;
- this.nesteFrame = this.posisjon = this.forsteKnockoutH;
- }
- }
- }
- function flatUt()
- {
- _root.lander.start();
- this.flat = true;
- this.nesteFrame = this.posisjon = this.forsteFlatH;
- }
- function vedTreff()
- {
- if(this.flat && Figur.helt.kraftspark)
- {
- this.flatUt();
- this.iLufta = true;
- this.brett_y += 20;
- }
- else
- {
- if(this.flat && Figur.helt.sparkar)
- {
- if(this.liv < 1)
- {
- this.flatUt();
- this.iLufta = true;
- this.brett_y += 20;
- }
- else
- {
- this.flat = false;
- this.liv -= 1;
- this.knockout();
- }
- }
- if(Figur.helt.stokkeslaar || Figur.helt.feirer)
- {
- this.knockout();
- }
- else if(!Figur.helt.knock && !Figur.helt.flat)
- {
- if(!this.flat && !this.iLufta)
- {
- Figur.helt.krokknock();
- }
- }
- }
- }
- function visRiktigFrame()
- {
- if(!this.aktiv)
- {
- this.bliUsynlig();
- }
- else if(!this.knock && !this.flat)
- {
- if(Math.abs(this.brett_x + this.bredde / 2 - (Figur.helt.brett_x + Figur.helt.bredde / 2)) < 380)
- {
- if(Math.abs(this.brett_x + this.bredde / 2 - (Figur.helt.brett_x + Figur.helt.bredde / 2)) < 350)
- {
- if(Math.abs(this.brett_x + this.bredde / 2 - (Figur.helt.brett_x + Figur.helt.bredde / 2)) < 250)
- {
- this.glefser = true;
- this.nesteFrame = this.posisjon = 30;
- }
- else
- {
- this.glefser = false;
- this.angriper = true;
- this.nesteFrame = this.posisjon = 20;
- }
- }
- else
- {
- this.glefser = false;
- this.angriper = false;
- if(!this.reiserSeg)
- {
- this.reiserSeg = true;
- this.nesteFrame = this.posisjon = 9;
- }
- }
- }
- else
- {
- this.glefser = false;
- this.angriper = false;
- this.reiserSeg = false;
- this.nesteFrame = this.roligH;
- }
- }
- if(!this.knock && !this.flat)
- {
- if(this.reiserSeg)
- {
- if(this.mc._currentframe < 15)
- {
- this.posisjon += 1;
- this.nesteFrame = this.posisjon;
- }
- else
- {
- this.nesteFrame = this.posisjon = 15;
- }
- }
- if(this.angriper)
- {
- if(this.brett_x > 3880)
- {
- this.brett_x -= 4;
- this.nesteFrame = this.posisjon = 20;
- }
- else
- {
- this.angriper = false;
- }
- }
- if(this.glefser)
- {
- this.nesteFrame = this.posisjon = 30;
- }
- }
- if(this.flat)
- {
- if(this.mc._currentframe < this.sisteFlatH)
- {
- this.posisjon += 1;
- this.nesteFrame = this.posisjon;
- }
- else
- {
- this.flat = false;
- }
- }
- if(this.knock)
- {
- if(this.mc._currentframe < this.sisteKnockoutH)
- {
- this.posisjon += 1;
- this.nesteFrame = this.posisjon;
- if(this.brett_x < 4350)
- {
- this.brett_x += 3;
- }
- }
- else if(!this.iLufta)
- {
- this.knock = false;
- this.flatUt();
- }
- else
- {
- this.nesteFrame = this.sisteKnockoutH;
- this.brett_x += 3;
- }
- }
- }
- }
-