package org.drools.games.wumpus.server;

import org.drools.games.wumpus.MoveCommand;
import org.drools.games.wumpus.ShootCommand;
import org.drools.games.wumpus.GoldWin;
import org.drools.games.wumpus.PitDeath;
import org.drools.games.wumpus.WumpusDeath;

dialect "mvel"

declare Score
	@propertyReactive
end	
    
rule "Move -1" salience 100 agenda-group "Score" when
    $m : MoveCommand()
    $s : Score()
then
    modify( $s) { value = $s.value  - 1 };  
end 

rule "Shoot Arrow -10" salience 100 agenda-group "Score" when
         ShootCommand()
    $s : Score()
then
    modify( $s) { value = $s.value  - 10 };
end   
     

rule "Gold Win +100" salience 100 agenda-group "Score" when
         GoldWin()
    $s : Score()
then
    modify( $s ) { value = $s.value  + 100 };
end     
   
rule "Pit Death -1000" salience 100 agenda-group "Score" when
         PitDeath()
    $s : Score()
then
    modify( $s) { value = $s.value  - 1000 };
end 

rule "Wumpus Death -1000" salience 100  agenda-group "Score" when
         WumpusDeath()
    $s : Score()
then
     modify( $s) { value = $s.value - 1000 };  
end          

