added attack and defend rule. already a bit complicated for flex.