From: Miguel A. B. L. <ari...@us...> - 2005-09-16 23:20:20
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/item In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15757/src/games/stendhal/server/entity/item Modified Files: Corpse.java Item.java Log Message: Added atk and def definition for Items. Fixed corpses bug. Index: Item.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/item/Item.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Item.java 12 Sep 2005 19:39:40 -0000 1.9 --- Item.java 16 Sep 2005 23:20:06 -0000 1.10 *************** *** 43,46 **** --- 43,48 ---- entity.add("name",RPClass.STRING); // name of item (ie 'Kings Sword') entity.add("possibleslots",RPClass.STRING); // komma separated list of slots + entity.add("atk",RPClass.SHORT); // Some items has attack values + entity.add("def",RPClass.SHORT); // Some items has defense values } Index: Corpse.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/item/Corpse.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Corpse.java 12 Sep 2005 21:06:16 -0000 1.8 --- Corpse.java 16 Sep 2005 23:20:06 -0000 1.9 *************** *** 25,29 **** public class Corpse extends PassiveEntity { ! final public static int DEGRADATION_TIMEOUT=600; // 30 minutes at 300 ms private int degradation; private int stage; --- 25,29 ---- public class Corpse extends PassiveEntity { ! final public static int DEGRADATION_TIMEOUT=60; // 30 minutes at 300 ms private int degradation; private int stage; *************** *** 57,61 **** // Add slot if the source corpse hadn't one ! if (!hasSlot("content")) { addSlot(new RPSlot("content")); --- 57,61 ---- // Add slot if the source corpse hadn't one ! if(!hasSlot("content")) { addSlot(new RPSlot("content")); *************** *** 63,66 **** --- 63,80 ---- } + public Corpse(String clazz, int x, int y) throws AttributeNotFoundException + { + put("type","corpse"); + put("class",clazz); + + setx(x); + sety(y); + degradation=DEGRADATION_TIMEOUT; + stage=0; + put("stage",stage); + + addSlot(new RPSlot("content")); + } + public Corpse(RPEntity entity) throws AttributeNotFoundException { *************** *** 109,114 **** put("stage",stage); ! // only modify when the corpse is not inside a container ! if(!isContained()) { world.modify(this); --- 123,138 ---- put("stage",stage); ! if(isContained()) ! { ! // We modify the base container if the object change. ! RPObject base=getContainer(); ! while(base.isContained()) ! { ! base=base.getContainer(); ! } ! ! world.modify(base); ! } ! else { world.modify(this); *************** *** 125,129 **** if(isContained()) { ! getContainer().remove(this.getID()); } else --- 149,153 ---- if(isContained()) { ! getContainerSlot().remove(this.getID()); } else |