v0.2.3: artifact refactoring, changed how new artifacts deal with collections of items.

This commit is contained in:
Evan Debenham
2014-12-10 14:53:05 -05:00
parent e359b5f9ef
commit 1104f6473b
3 changed files with 22 additions and 10 deletions
@@ -205,6 +205,17 @@ public class Artifact extends KindofMisc {
return null;
}
//converts class names to be more concise and readable.
protected String convertName(String className){
//removes known redundant parts of names.
className.replaceFirst("ScrollOf|PotionOf", "");
//inserts a space infront of every uppercase character
className.replaceAll("(\\p{Ll})(\\p{Lu})", "$1 $2");
return className;
};
@Override
public Item random() {
if (Random.Float() < 0.3f) {