src/priestSkills.js
// Buys potions until the amount of each potion_type we defined in the start of the script is above the min_potions value.

Buys potions until the amount of each potion_type we defined in the start of the script is above the min_potions value.
Buys potions until the amount of each potion_type we defined in the start of the script is above the min_potions value .
function buy_potions() {
	if (empty_slots() >= 0) {
		for (type_id in potion_types) {
			var type = potion_types[type_id];
			var item_def = parent.G.items[type];
			if (item_def != null) {
				var cost = item_def.g * purchase_amount;
				if (character.gold >= cost) {
					var num_potions = num_items(type);
					if (num_potions < min_potions) buy(type, purchase_amount);
				}
				else {
					game_log("Not Enough Gold!");
				}
			}
		}
	}
	else {
		game_log("Inventory Full!");
	}
}
function buy_potions ( ) { if ( empty_slots ( ) >= 0 ) { for ( type_id in potion_types ) { var type = potion_types [ type_id ] ; var item_def = parent . G . items [ type ] ; if ( item_def != null ) { var cost = item_def . g * purchase_amount ; if ( character . gold >= cost ) { var num_potions = num_items ( type ) ; if ( num_potions < min_potions ) buy ( type , purchase_amount ) ; } else { game_log ( "Not Enough Gold!" ) ; } } } } else { game_log ( "Inventory Full!" ) ; } }
Buys potions until the amount of each potion_type we defined in the start of the script is above the min_potions value.
Buys potions until the amount of each potion_type we defined in the start of the script is above the min_potions value .