From: Kimmo R. <ki...@us...> - 2010-04-10 23:05:52
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/item In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv4640/src/games/stendhal/server/entity/item Modified Files: Item.java Log Message: show damage type and susceptibilities in item description Index: Item.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/item/Item.java,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** Item.java 10 Apr 2010 18:58:51 -0000 1.121 --- Item.java 10 Apr 2010 23:05:44 -0000 1.122 *************** *** 524,528 **** public String describe() { String text = "You see " + Grammar.a_noun(getTitle()) + "."; ! String stats = ""; String levelwarning = ""; if (hasDescription()) { --- 524,528 ---- public String describe() { String text = "You see " + Grammar.a_noun(getTitle()) + "."; ! StringBuilder stats = new StringBuilder(); String levelwarning = ""; if (hasDescription()) { *************** *** 541,565 **** } if (has("atk")) { ! stats += " ATK: " + get("atk"); } if (has("def")) { ! stats += " DEF: " + get("def"); } if (has("rate")) { ! stats += " RATE: " + get("rate"); } if (has("amount")) { ! stats += " HP: " + get("amount"); } if (has("range")) { ! stats += " RANGE: " + get("range"); } if (has("lifesteal")) { ! stats += " LIFESTEAL: " + get("lifesteal"); } if (stats.length() > 0) { ! stats = " Stats are (" + stats.trim() + ")."; } ! return (text + levelwarning + stats); } --- 541,586 ---- } if (has("atk")) { ! stats.append("ATK: "); ! stats.append(get("atk")); ! // Show only special types ! if (getDamageType() != DamageType.CUT) { ! stats.append(" ["); ! stats.append(getDamageType()); ! stats.append("]"); ! } } if (has("def")) { ! stats.append(" DEF: "); ! stats.append(get("def")); } if (has("rate")) { ! stats.append(" RATE: "); ! stats.append(get("rate")); } if (has("amount")) { ! stats.append(" HP: "); ! stats.append(get("amount")); } if (has("range")) { ! stats.append(" RANGE: "); ! stats.append(get("range")); } if (has("lifesteal")) { ! stats.append(" LIFESTEAL: "); ! stats.append(get("lifesteal")); ! } ! if ((susceptibilities != null) && !susceptibilities.isEmpty()) { ! for (Entry<DamageType, Double> entry : susceptibilities.entrySet()) { ! stats.append(" "); ! stats.append(entry.getKey()); ! stats.append(": "); ! stats.append(entry.getValue()); ! } } if (stats.length() > 0) { ! stats.insert(0, " Stats are ("); ! stats.append(")."); } ! return (text + levelwarning + stats.toString()); } |