src/priestSkills.js
// This function contains our logic for when we're farming mobs

This function contains our logic for when we're farming mobs
This function contains our logic for when we ' re farming mobs
function farm() {
	var lowest_health = lowest_health_partymember();
	if (lowest_health != null && lowest_health.health_ratio < 0.8) {
		if (distance_to_point(lowest_health.real_x, lowest_health.real_y) < character.range) {
			heal(lowest_health);
		}
		else {
			move_to_target(lowest_health);
		}
	}
	else {
		var target = find_viable_targets()[0];
		if (target != null) {
			if (distance_to_point(target.real_x, target.real_y) < character.range) {
				if (can_attack(target)) {
					if (target["max_hp"] > 3000) { use_skill("curse", target) };
					attack(target);
				}
			}
			else {
				move_to_target(target);
			}
		}
		else {
			if (!smart.moving) {
				game_log("finding a target");
				smart_move({ to: monster_targets[0] });
			}
		}
	}
}
function farm ( ) { var lowest_health = lowest_health_partymember ( ) ; if ( lowest_health != null && lowest_health . health_ratio < 0.8 ) { if ( distance_to_point ( lowest_health . real_x , lowest_health . real_y ) < character . range ) { heal ( lowest_health ) ; } else { move_to_target ( lowest_health ) ; } } else { var target = find_viable_targets ( ) [ 0 ] ; if ( target != null ) { if ( distance_to_point ( target . real_x , target . real_y ) < character . range ) { if ( can_attack ( target ) ) { if ( target [ "max_hp" ] > 3000 ) { use_skill ( "curse" , target ) } ; attack ( target ) ; } } else { move_to_target ( target ) ; } } else { if ( ! smart . moving ) { game_log ( "finding a target" ) ; smart_move ( { to : monster_targets [ 0 ] } ) ; } } } }
This function contains our logic for when we're farming mobs
This function contains our logic for when we ' re farming mobs
// If we have a target to heal, heal them. Otherwise attack a target.
