@ -13,23 +13,41 @@ class AddCondition extends AddNode {
super . addButton ( WIDTH _WINDOW / 3 , HEIGHT _WINDOW / ( 16 / 5 ) , 'enemyBot' , c1 , false ) ;
super . addButton ( WIDTH _WINDOW / 3 , HEIGHT _WINDOW / ( 16 / 5 ) , 'enemyBot' , c1 , false ) ;
super . addButton ( WIDTH _WINDOW / 1.5 , HEIGHT _WINDOW / ( 16 / 5 ) , 'myself' , c1 , true ) ;
super . addButton ( WIDTH _WINDOW / 1.5 , HEIGHT _WINDOW / ( 16 / 5 ) , 'myself' , c1 , true ) ;
let c2 = super . newCategory ( 'shield' , true , true ) ;
let c2 = super . newCategory ( 'shield' , true , true ) ;
super . addButton ( WIDTH _WINDOW / 3 , HEIGHT _WINDOW / ( 16 / 9 ) , 'shield0' , c2 , 0 ) ;
super . addButton ( WIDTH _WINDOW / 8 , HEIGHT _WINDOW / ( 16 / 9 ) , 'shortRange' , c2 , [ 1 / 3 , 'range' ] ) ;
super . addButton ( WIDTH _WINDOW / 1.5 , HEIGHT _WINDOW / ( 16 / 9 ) , 'shield33' , c2 , 1 / 3 ) ;
super . addButton ( WIDTH _WINDOW / 4 * 1.5 , HEIGHT _WINDOW / ( 16 / 9 ) , 'mediumRange' , c2 , [ 2 / 3 , 'range' ] ) ;
super . addButton ( WIDTH _WINDOW / 3 , HEIGHT _WINDOW / ( 16 / 12 ) , 'shield66' , c2 , 2 / 3 ) ;
super . addButton ( WIDTH _WINDOW / 4 , HEIGHT _WINDOW / ( 16 / 12 ) , 'longRange' , c2 , [ 1 , 'range' ] ) ;
super . addButton ( WIDTH _WINDOW / 1.5 , HEIGHT _WINDOW / ( 16 / 12 ) , 'shield100' , c2 , 1 ) ;
let line = this . add . graphics ( ) ;
line . lineStyle ( 10 , 0xffffff , 1 ) ;
line . lineBetween ( WIDTH _WINDOW / 2 , HEIGHT _WINDOW / ( 16 / 8 ) , WIDTH _WINDOW / 2 , HEIGHT _WINDOW / ( 16 / 13 ) ) ;
super . addButton ( WIDTH _WINDOW / 8 * 5 , HEIGHT _WINDOW / ( 16 / 9 ) , 'shield0' , c2 , [ 0 , 'shield' ] ) ;
super . addButton ( WIDTH _WINDOW / 8 * 7 , HEIGHT _WINDOW / ( 16 / 9 ) , 'shield33' , c2 , [ 1 / 3 , 'shield' ] ) ;
super . addButton ( WIDTH _WINDOW / 8 * 5 , HEIGHT _WINDOW / ( 16 / 12 ) , 'shield66' , c2 , [ 2 / 3 , 'shield' ] ) ;
super . addButton ( WIDTH _WINDOW / 8 * 7 , HEIGHT _WINDOW / ( 16 / 12 ) , 'shield100' , c2 , [ 1 , 'shield' ] ) ;
}
}
addNode ( ) {
addNode ( ) {
if ( super . verifyCategory ( ) ) {
if ( super . verifyCategory ( ) ) {
this . selected . addRect ( new RectangleNode ( this . selected . getX ( ) , this . selected . getY ( ) + 200 , this . gameR , 'condition' , [ this . lCategory [ 0 ] . getValue ( ) , true , false , this . lCategory [ 1 ] . getValue ( ) , 0 ] ) ) ;
if ( this . lCategory [ 1 ] . getValue ( ) [ 1 ] === 'range' ) {
this . selected . addRect ( new RectangleNode ( this . selected . getX ( ) , this . selected . getY ( ) + 200 , this . gameR , 'condition' , [ this . lCategory [ 0 ] . getValue ( ) , false , true , 0 , this . lCategory [ 1 ] . getValue ( ) [ 0 ] ] ) ) ;
} else {
this . selected . addRect ( new RectangleNode ( this . selected . getX ( ) , this . selected . getY ( ) + 200 , this . gameR , 'condition' , [ this . lCategory [ 0 ] . getValue ( ) , true , false , this . lCategory [ 1 ] . getValue ( ) [ 0 ] , 0 ] ) ) ;
}
super . cancel ( ) ;
super . cancel ( ) ;
}
}
}
}
modifyNode ( ) {
modifyNode ( ) {
if ( super . verifyCategory ( ) ) {
if ( super . verifyCategory ( ) ) {
this . selected . node . shieldFilter = false ;
this . selected . node . rangeFilter = false ;
if ( this . lCategory [ 1 ] . getValue ( ) [ 1 ] === 'range' ) {
this . selected . node . rangeFilter = true ;
this . selected . node . range = this . lCategory [ 1 ] . getValue ( ) [ 0 ] ;
} else {
this . selected . node . shieldFilter = true ;
this . selected . node . shield = this . lCategory [ 1 ] . getValue ( ) [ 0 ] ;
}
this . selected . node . myself = this . lCategory [ 0 ] . getValue ( ) ;
this . selected . node . myself = this . lCategory [ 0 ] . getValue ( ) ;
this . selected . node . shield = this . lCategory [ 1 ] . getValue ( ) ;
this . selected . rect . setFrame ( this . selected . node . getFrame ( ) ) ;
this . selected . rect . setFrame ( this . selected . node . getFrame ( ) ) ;
super . cancel ( ) ;
super . cancel ( ) ;
}
}