(watch rules)

(defrule move-by-default
	?f <- (TurnRemaining ?x)
	(NewTurn)
	(not (OnTheMove))
    =>
    (retract ?f)
    (store Ahead 100)
    (store TurnGunRight 360)
    (store Back 100)
    (store TurnGunRight 360)
    (assert (NowMoving Ahead))
    (assert (NowTurningGun Right))
    (assert (NowMoving Back))
    (assert (NowTurningGun Right))
    (assert (OnTheMove)))

(defrule fire-when-scanning-anything
    (ScannedRobotEvent)
    =>
    (store Fire 1))

(defrule disparado-por-alguien
	?event<-(HitByBulletEvent)
	=>
	(retract ?event)
	(store TurnLeft 90-(Bearing ?event))
	(assert (NowTurningLeft)))
