Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 23d6d6a5dee1b3891a423795f4b554c6 > files > 112

crossfire-1.0.0-3mdk.ppc.rpm

# stats-extract - parse the archetypes-file and output the
# player's stats in a structured format.

/^Object/ {
	randomitems = "";
	name = obj = $2;
}

/^type/         { type = $2 }
/^randomitems/	{ randomitems = $2 }
/^name/		{ name = substr($0, 6) }

/^end/ {
	if (type == 1) {	# Players
		printf("%s,%s\n", decapitalize(name), randomitems);
	}
}

END {
	close("items");
}

function decapitalize(str) {
        return tolower (substr(str, 1, 1)) substr(str, 2);
}