src/scripts/Mob.js
//query _canAct to check if stunned or otherwise incapaciated, then run execCombatCmd(moveNOP) 
query _canAct to check if stunned or otherwise incapaciated, then run execCombatCmd(moveNOP)
query _canAct to check if stunned or otherwise incapaciated then run execCombatCmd ( moveNOP )
calcCombatMove(enemys,friends){
        let rnd = _.random(1,100);
        let result = {OK:true,msg:''};
        result.action =result.target= null;
        if(rnd>20) {  
            rnd = _.random(0,enemys.length-1);
            result.action = "Attack";
            result.target = [enemys[rnd]];
            result.msg =this.name+" trys to attack you.</br>"+result.msg;
        } else {
            if(this.Skills.countItem('Guard')>0) {
                result.action = "Guard";
                result.target = this;
            }
            result.msg =this.name+" takes a defensive stance.</br>"+result.msg;
        }
        return(result);
    }
calcCombatMove ( enemys , friends ) { let rnd = _ . random ( 1 , 100 ) ; let result = { OK : true , msg : '' } ; result . action = result . target = null ; if ( rnd > 20 ) { rnd = _ . random ( 0 , enemys . length - 1 ) ; result . action = "Attack" ; result . target = [ enemys [ rnd ] ] ; result . msg = this . name + " trys to attack you.</br>" + result . msg ; } else { if ( this . Skills . countItem ( 'Guard' ) > 0 ) { result . action = "Guard" ; result . target = this ; } result . msg = this . name + " takes a defensive stance.</br>" + result . msg ; } return ( result ) ; }
query _canAct to check if stunned or otherwise incapaciated, then run execCombatCmd(moveNOP)
query _canAct to check if stunned or otherwise incapaciated then run execCombatCmd ( moveNOP )