]> www.infradead.org Git - users/mchehab/andors-trail.git/commitdiff
Updated unbalanced droplists for Izthiels.
authoroskar.wiksten@gmail.com <oskar.wiksten@gmail.com@08aca716-68be-ccc6-4d58-36f5abd142ac>
Sat, 8 Oct 2011 09:56:19 +0000 (09:56 +0000)
committeroskar.wiksten@gmail.com <oskar.wiksten@gmail.com@08aca716-68be-ccc6-4d58-36f5abd142ac>
Sat, 8 Oct 2011 09:56:19 +0000 (09:56 +0000)
Added additional selftests for unbalanced monster drops.

git-svn-id: https://andors-trail.googlecode.com/svn/trunk@170 08aca716-68be-ccc6-4d58-36f5abd142ac

AndorsTrail/res/values/content_droplist.xml
AndorsTrail/res/values/content_itemlist.xml
AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/actor/MonsterType.java
AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/actor/MonsterTypeCollection.java
AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/item/DropList.java
AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/item/DropListCollection.java
AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/TMXMapReader.java
AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/quest/QuestCollection.java

index 65cd666f1766c6ebe4ebf56a8b6123bc278777b4..3fc8fa874d3f5ad39cd83b3dc5852ecb1a3a9afa 100644 (file)
        {gem4|1|1|10|}
        {health|1|1|10|}
        {bone|1|1|10|}
+       {gloves_life|1|1|1/1000|}
 }|};
 {cave_serpent|{
        {gold|3|10|70|}
 {fieldcritter_3|{{gold|3|17|70|}{gland|1|1|30|}{ring1|1|1|5|}{ring2|1|1|5|}}|};
 {rivertroll|{{gold|0|70|70|}{bone|3|5|50|}{meat|3|5|30|}{club_fine_wooden|1|1|100|}}|};
 
-{izthiel|{{gold|3|15|70|}{izthiel_claw|1|1|30|}{ring_jinxed1|1|1|5|}{ring2|1|1|5|}}|};
-{izthiel_4|{{gold|3|40|70|}{izthiel_claw|1|1|30|}{ring_jinxed1|1|1|20|}{ring2|1|1|20|}}|};
+{izthiel|{{gold|3|15|70|}{izthiel_claw|1|1|30|}{ring_jinxed1|1|1|1|}{ring2|1|1|5|}}|};
+{izthiel_4|{{gold|3|40|70|}{izthiel_claw|1|1|30|}{ring_jinxed1|1|1|1|}{ring2|1|1|20|}{shadowfang|1|1|1/1000|}}|};
 {frog|{{gold|0|3|70|}}|};
 {frog_3|{{gold|0|3|70|}{gland|1|1|30|}}|};
 {iqhan_lesser|{{gold|1|5|70|}{iqhan_pendant|1|1|1|}{shirt_torn|1|1|5|}{dagger0|1|1|5|}}|};
index 89c97ce992c4a0b7ae1b2ecf8a750f73b6379d90..b189383536e87eedb75d672e4fe9177832d15765 100644 (file)
 {chaosreaper|items_weapons:49|Chaosreaper|0|3|1|339|1||||4|-30|||0|2||||0||||||1||||||{{chaotic_grip|5|3|50|}}|||||||};
 {izthiel_claw|items_misc:47|Izthiel claw|21||1|1||||||||||||||1|1|6|||||||||||||||||};
 {iqhan_pendant|items_necklaces_1:2|Iqhan pendant|6||1|10|1|||||6|||||||||||||||||||||||||||};
+{shadowfang|items_weapons_3:41|Shadowfang|0|3|1|512|1|-20|||4|40|||2|5||||0||||||1|||||{{fatigue_minor|1|3|20|}}||||||||};
+{gloves_life|items_armours_2:1|Gloves of life force|4|3|1|390|1|9||||5|||||3||||||||||||||||||||||};
        </string>
 
 </resources>
index 5c9b2065c767fc4c258a00fc9de56a11f774df76..65f428732669cd147ca921c34fdae32be0c2fdc5 100644 (file)
@@ -11,6 +11,7 @@ public final class MonsterType extends ActorTraits {
        public final int exp;
        public final DropList dropList;
        public final String phraseID;
+       public boolean isRespawnable = true;
 
        public MonsterType(
                        String id, 
index 3f6e551ab83422eb88d7b14244a2323aa5684295..a8178d96c805d91ea1562999f2146c27b1611cf3 100644 (file)
@@ -8,6 +8,7 @@ import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
 import com.gpl.rpg.AndorsTrail.context.WorldContext;
 import com.gpl.rpg.AndorsTrail.conversation.ConversationCollection;
 import com.gpl.rpg.AndorsTrail.model.item.DropList;
+import com.gpl.rpg.AndorsTrail.model.item.DropList.DropItem;
 import com.gpl.rpg.AndorsTrail.model.map.MapCollection;
 import com.gpl.rpg.AndorsTrail.resource.parsers.MonsterTypeParser;
 import com.gpl.rpg.AndorsTrail.util.L;
@@ -48,11 +49,25 @@ public final class MonsterTypeCollection {
        public void verifyData(WorldContext world) {
        if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA) {
                for (MonsterType t : monsterTypesById.values()) {
-                       if (t.phraseID != null && t.phraseID.length() > 0) {
+                       if (t.phraseID != null) {
                                if (!world.conversations.isValidPhraseID(t.phraseID)) {
                                        L.log("WARNING: Cannot find phrase \"" + t.phraseID + "\" for MonsterType \"" + t.id + "\".");
                                }
                        }
+                       
+                       if (t.dropList != null && t.isRespawnable && t.phraseID == null) {
+                               int averageItemDropGold = 0;
+                               for (DropItem item : t.dropList.DEBUG_items) {
+                                       averageItemDropGold += item.itemType.baseMarketCost * item.quantity.averagef() * item.chance.current / item.chance.max;
+                               }
+                               
+                               float goldPerExpReward = (float) averageItemDropGold / t.exp;
+                               boolean warn = false;
+                               if (goldPerExpReward > 0.5) warn = true;
+                               else if (averageItemDropGold > 30 && goldPerExpReward > 0.3) warn = true;
+                               
+                               if (warn) L.log("Monster type " + t.id + " rewards " + averageItemDropGold + " gold drop on average, which is a bit high for the exp: " + t.exp + "  (average " + goldPerExpReward + " gold per exp)");
+                       }
                }
        }
        }
index 9b5052bfcc74f05de5741d3a9afde4bb3c6cfed3..2264f9782ffb838932f9fc6b9329c3f787400423 100644 (file)
@@ -40,7 +40,7 @@ public final class DropList {
        }
        
        // Selftest method. Not part of the game logic.
-       public boolean contains(String itemTypeID) {
+       public boolean DEBUG_contains(String itemTypeID) {
                for (DropItem item : items) {
                        if (item.itemType.id.equals(itemTypeID)) return true;
                }
index b08d783bcf597482ace119d187b9967382f9285f..c8640ad04744a8fc9abe402858c59dc0aa4ecae5 100644 (file)
@@ -35,7 +35,7 @@ public final class DropListCollection {
        public boolean verifyExistsDroplistForItem(String itemTypeID) {\r
                if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA) {\r
                        for (DropList d : droplists.values()) {\r
-                               if (d.contains(itemTypeID)) return true;\r
+                               if (d.DEBUG_contains(itemTypeID)) return true;\r
                        }\r
                }\r
                return false;\r
index 4c683fb1de136ea87e62c75249907f999179aaa4..dd196e0cfd8c8fd01230ad9947608983cfb649de 100644 (file)
@@ -362,6 +362,7 @@ public final class TMXMapReader {
                                                String[] monsterTypeIDs = new String[types.size()];
                                                for (int i = 0; i < monsterTypeIDs.length; ++i) {
                                                        monsterTypeIDs[i] = types.get(i).id;
+                                                       if (isUnique) types.get(i).isRespawnable = false;
                                                }
                                                MonsterSpawnArea area = new MonsterSpawnArea(
                                                                position
index ff98028c8a971ba10031ce0ca5e67bf2199e298f..180323f89007552ab80c20e6c20d1dea54be087a 100644 (file)
@@ -66,7 +66,7 @@ public final class QuestCollection  {
                                }\r
                        if (q.showInLog) {\r
                                if (!hasFinishingEntry) {\r
-                                       L.log("WARNING: Quest \"" + q.questID + "\" is shown in log, but has no progress stage that finished the quest.");\r
+                                       L.log("WARNING: Quest \"" + q.questID + "\" is shown in log, but has no progress stage that finishes the quest.");\r
                                }\r
                        }\r
                }       \r