Skip to content

Commit 4f85206

Browse files
committed
More sprites + first attempt (unstable non-working branch) at grid item property search
1 parent 77d42e0 commit 4f85206

24 files changed

+235
-77
lines changed

res/items/world-itemideas.csv

+52-51
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Concrete,3360,,Y,Concrete,StoneBlock; BuildingMaterial,,15,120,,stone,0.5,,,0.85
4949
Copper Ore,600,,N,"Copper Ore, 1",RawOre,Copper Bar,15,,,,2,,,,
5050
Iron Ore,601,,N,"Iron Ore, 1",RawOre,Iron Bar,15,,,,4,,,,
5151
Gold Ore,602,,N,"Gold Ore, 1",RawOre,Gold Bar,15,,,,10,,,,
52-
Coal,603,,N,"Coal, 1",RawOre,,15,,,,3,"Fuel, 0, 2.5",,,
52+
Coal,603,,N,"Coal, 1",RawOre,,15,,,,3,,"Fuel, 0, 2.5",,
5353
,,,,,,,,,,,,,,,
5454
Vaelium Metal,700,,N,,,,15,,,,8,,,,
5555
Fluvium Metal,701,,N,,,,15,,,,8,,,,
@@ -79,41 +79,41 @@ Flax Plant,1811,,Y,"Flax, 2, 6",Plant,,,,,farm,4,,Walkthrough,,
7979
Silken Wreath,1830,"A dainty, wispy flower of soft pedals.",Y,"Soft Threads, 3, 8",Plant,,,,,farm,15,,Walkthrough,2.5,
8080
Mana Bloom,1831,A flowering cactus-like plant blooming with bright syrup.,Y,"Cactus Fruit, 1, 4 / Raw Mana Bloom, 1, 2",EdiblePlant,,,,,farm,12,,Walkthrough,2.5,
8181
Hemp Plant,1832,A fast growing plant processed into fibers and textiles.,Y,"Hemp Leaves, 2, 6",Plant,,,,,farm,4,,Walkthrough,,
82-
,,,,,,,,,,,,,,,
82+
Woody Shrub,1833,,Y,"Wooden Stick, 4, 10",Plant,,,,,gath,3,,Walkthrough,,
8383
,,,,,,,,,,,,,,,
8484
,,,,,,,,,,,,,,,
8585
Barley Grain,1850,,N,,,,50,,,,2,,,,
8686
Wheat Flour,1851,,N,,,,50,,,,2,,,,
8787
,,,,,,,,,,,,,,,
8888
,,,,,,,,,,,,,,,
89-
Raw Beef,1860,,N,,RawFood; RawMeat,,50,,,,5,"Eat, 10, 1.3",,,
90-
Raw Fish,1870,,N,,RawFood; RawMeat,,50,,,,5,"Eat, 10, 1.3",,,
89+
Raw Beef,1860,,N,,RawFood; RawMeat,,50,,,,5,,"Eat, 10, 1.3",,
90+
Raw Fish,1870,,N,,RawFood; RawMeat,,50,,,,5,,"Eat, 10, 1.3",,
9191
,,,,,,,,,,,,,,,
92-
Wild Fruit,1900,,N,,RawFood; RawFruit,,50,,,,2,"Eat, 5, 0.3",,,
93-
Wild Berries,1901,,N,,RawFood; RawFruit,,50,,,,2,"Eat, 5, 0.3",,,
94-
Apple,1902,,N,,RawFood; RawFruit,,50,,,,2,"Eat, 5, 0.3",,,
95-
Fig,1903,,N,,RawFood; RawFruit,,50,,,,2,"Eat, 5, 0.3",,,
96-
Pear,1904,,N,,RawFood; RawFruit,,50,,,,2,"Eat, 5, 0.3",,,
97-
Grapes,1905,,N,,RawFood; RawFruit,,200,,,,2,"Eat, 5, 0.3",,,
98-
Lentil,1906,,N,,RawFood; RawVegetable,,200,,,,2,"Eat, 5, 0.3",,,
99-
Barley,1907,"Several shoots of barley, with stalks and husks.",N,,HarvestedGrain,Barley Grain,50,,,,2,"Eat, 5, 0.3",,,
100-
Wheat,1908,"Several shoots of wheat, with stalks and husks.",N,,HarvestedGrain,Wheat Flour,50,,,,2,"Eat, 5, 0.3",,,
101-
Potato,1909,,N,,RawFood; RawVegetable,,50,,,,2,"Eat, 5, 0.3",,,
92+
Wild Fruit,1900,,N,,RawFood; RawFruit,,50,,,,2,,"Eat, 5, 0.3",,
93+
Wild Berries,1901,,N,,RawFood; RawFruit,,50,,,,2,,"Eat, 5, 0.3",,
94+
Apple,1902,,N,,RawFood; RawFruit,,50,,,,2,,"Eat, 5, 0.3",,
95+
Fig,1903,,N,,RawFood; RawFruit,,50,,,,2,,"Eat, 5, 0.3",,
96+
Pear,1904,,N,,RawFood; RawFruit,,50,,,,2,,"Eat, 5, 0.3",,
97+
Grapes,1905,,N,,RawFood; RawFruit,,200,,,,2,,"Eat, 5, 0.3",,
98+
Lentil,1906,,N,,RawFood; RawVegetable,,200,,,,2,,"Eat, 5, 0.3",,
99+
Barley,1907,"Several shoots of barley, with stalks and husks.",N,,HarvestedGrain,Barley Grain,50,,,,2,,"Eat, 5, 0.3",,
100+
Wheat,1908,"Several shoots of wheat, with stalks and husks.",N,,HarvestedGrain,Wheat Flour,50,,,,2,,"Eat, 5, 0.3",,
101+
Potato,1909,,N,,RawFood; RawVegetable,,50,,,,2,,"Eat, 5, 0.3",,
102102
Cotton,1910,Raw cotton fibers.,N,,,,50,,,,2,,,,
103103
Flax,1911,Unspun flax fibers.,N,,,,50,,,,2,,,,
104104
Soft Thread,1912,"Silver, soft threads.",N,,,,50,,,,6,,,,
105-
Raw Mana Bloom,1913,,N,,,,50,,,,5,"Heal, 1, 0.15","Luxury Food, 0, 0.3",,
105+
Raw Mana Bloom,1913,,N,,,,50,,,,5,,"Luxury Food, 0, 0.3 / Heal, 1, 0.15",,
106106
Hemp Leaves,1914,,N,,,,50,,,,2,,,,
107107
,,,,,,,,,,,,,,,
108108
,,,,,,,,,,,,,,,
109109
,,,,,,,,,,,,,,,
110-
Bread,1700,,N,,Food,,50,,,,2,"Eat, 10, 1",,,
110+
Bread,1700,,N,,Food,,50,,,,2,,"Eat, 20, 1",,
111111
Salt,1701,,N,,,,200,,,,5,,,,
112-
Cooked Meal,1702,,N,,Food,,15,,,,5,"Eat, 30, 5",,,
113-
Cooked Meat Dish,1703,,N,,Food,,15,,,,8,"Eat, 30, 8",,,
114-
Gruel,1704,,N,,Food,,15,,,,3,"Eat, 30, 1",,0.6,
112+
Cooked Meal,1702,,N,,Food,,15,,,,5,,"Eat, 50, 5",,
113+
Cooked Meat Dish,1703,,N,,Food,,15,,,,8,,"Eat, 50, 8",,
114+
Gruel,1704,,N,,Food,,15,,,,3,,"Eat, 50, 1",0.6,
115115
,,,,,,,,,,,,,,,
116-
Potion of Mana,1750,,N,,Medicine,,15,,,,25,"Heal, 30, 1.0",,,
116+
Potion of Mana,1750,,N,,Medicine,,15,,,,25,,"Heal, 30, 1.0",,
117117
,,,,,,,,,,,,,,,
118118
Wild Fruit Seeds,1950,,N,,Seed,Wild Fruit Bush,200,,,,1,,,,
119119
Wild Berry Seeds,1951,,N,,Seed,Wild Berry Bush,200,,,,1,,,,
@@ -148,13 +148,13 @@ Tropical Palm Leaves,2005,,Y,"Leaves, 1, 1, 0.3",RawTree,,,,,log,1,,Walkthrough,
148148
Spruce Log,2006,,Y,"Spruce Wood, 1, 4, 0.9 / Wooden Stick, 1, 5, 0.1 / Wooden Stick, 1, 3, 0.2",RawTree,,,,,log,2,,Walkthrough,1.2,
149149
Spruce Needles,2007,,Y,"Leaves, 1, 1, 0.1",RawTree,,,,,log,1,,Walkthrough,1.2,
150150
,,,,,,,,,,,,,,,
151-
Pine Sap,2050,,N,,Food,,50,,,,3,"Eat, 15, 0.3","Luxury Food, 0, 0.3",,
152-
Palm Wax,2051,,N,,Wax,,50,,,,3,"Fuel, 0, 1.0",,,
153-
Wood Acid,2052,,N,,,,50,,,,8,"Fuel, 0, 1.0","Poison, 0, 0.3",0.8,
151+
Pine Sap,2050,,N,,Food,,50,,,,3,,"Luxury Food, 0, 0.3 / Eat, 15, 0.3",,
152+
Palm Wax,2051,,N,,Wax,,50,,,,3,,"Fuel, 0, 1.0",,
153+
Wood Acid,2052,,N,,,,50,,,,8,,"Poison, 0, 0.3 / Fuel, 0, 1.0",0.8,
154154
,,,,,,,,,,,,,,,
155155
,,,,,,,,,,,,,,,
156156
Grass,2100,,Y,"Straw, 1, 3, 0.4",Plant,,,,,gath,0,,Walkthrough,,
157-
Compost,2200,,Y,"Compost, 1",OrganicMaterial,,,,,gath,3,"Fuel, 0, 1.0",,0.8,
157+
Compost,2200,,Y,"Compost, 1",OrganicMaterial,,,,,gath,3,,,0.8,
158158
,,,,,,,,,,,,,,,
159159
,,,,,,,,,,,,,,,
160160
,,,,,,,,,,,,,,,
@@ -163,33 +163,33 @@ Compost,2200,,Y,"Compost, 1",OrganicMaterial,,,,,gath,3,"Fuel, 0, 1.0",,0.8,
163163
,,,,,,,,,,,,,,,
164164
,,,,,,,,,,,,,,,
165165
,,,,,,,,,,,,,,,
166-
Wooden Stick,2500,,N,,,,50,,,,0,"Fuel, 0, 0.1",,,
167-
Leaves,2501,,N,,OrganicMaterial; Plant,,200,,,,0,"Fuel, 0, 0.1",,,
166+
Wooden Stick,2500,,N,,,,50,,,,0,,"Fuel, 0, 0.1",,
167+
Leaves,2501,,N,,OrganicMaterial; Plant,,200,,,,0,,"Fuel, 0, 0.1",,
168168
,,,,,,,,,,,,,,,
169169
,,,,,,,,,,,,,,,
170170
Red Dye,2600,,N,,Dye,,50,,,,8,,,1.3,
171171
,,,,,,,,,,,,,,,
172-
Cloth,2800,,N,,,,50,,,,1,"Fuel, 0, 0.2","Clothing, 0, 0.2",,
173-
Linen,2801,,N,,,,50,,,,1,"Fuel, 0, 0.2","Clothing, 0, 0.2",,
174-
Hemp Fabric,2802,,N,,,,50,,,,1,"Fuel, 0, 0.2","Clothing, 0, 0.2",,
172+
Cloth,2800,,N,,,,50,,,,1,,"Clothing, 0, 0.2",,
173+
Linen,2801,,N,,,,50,,,,1,,"Clothing, 0, 0.2",,
174+
Hemp Fabric,2802,,N,,,,50,,,,1,,"Clothing, 0, 0.2",,
175175
,,,,,,,,,,,,,,,
176-
Straw,2900,,N,,OrganicMaterial,,50,,,,0.5,"Fuel, 0, 0.2",,,
176+
Straw,2900,,N,,OrganicMaterial,,50,,,,0.5,,"Fuel, 0, 0.2",,
177177
,,,,,,,,,,,,,,,
178-
Pine Wood,3000,,N,,ProcessedWood,,15,,,,1,"Fuel, 0, 0.5",,,
179-
Oak Wood,3001,,N,,ProcessedWood,,15,,,,1,"Fuel, 0, 0.5",,,
180-
Tropical Palm Wood,3002,,N,,ProcessedWood,,15,,,,1,"Fuel, 0, 0.5",,,
181-
Spruce Wood,3003,,N,,ProcessedWood,,15,,,,1,"Fuel, 0, 0.5",,,
178+
Pine Wood,3000,,N,,ProcessedWood,,15,,,,1,,"Fuel, 0, 0.5",,
179+
Oak Wood,3001,,N,,ProcessedWood,,15,,,,1,,"Fuel, 0, 0.5",,
180+
Tropical Palm Wood,3002,,N,,ProcessedWood,,15,,,,1,,"Fuel, 0, 0.5",,
181+
Spruce Wood,3003,,N,,ProcessedWood,,15,,,,1,,"Fuel, 0, 0.5",,
182182
,,,,,,,,,,,,,,,
183-
Charcoal,3103,,N,,Fuel,,15,,,,3,"Fuel, 0, 1.5",,,
184-
Thatch,3104,Straw and dry vegetation weaved into a flat tile ,Y,"Thatch, 1",Building; BuildingMaterial,,15,15,,build,7,"Fuel, 0, 1.8",,0.8,
185-
Tar,3105,,N,,,,15,,,,5,"Fuel, 0, 1.0",,,
183+
Charcoal,3103,,N,,Fuel,,15,,,,3,,"Fuel, 0, 1.5",,
184+
Thatch,3104,Straw and dry vegetation weaved into a flat tile ,Y,"Thatch, 1",Building; BuildingMaterial,,15,15,,build,7,,"Fuel, 0, 1.8",0.8,
185+
Tar,3105,,N,,,,15,,,,5,,"Fuel, 0, 1.0",,
186186
Cement,3106,,N,,,,50,,,,3,,,,
187187
Ash,3107,,N,,,,50,,,,1,,,,
188188
Basic Soap,3108,,N,,,,50,,,,6,,,,
189189
,,,,,,,,,,,,,,,
190-
Tarp,3149,,Y,"Tarp, 1",Floor; FloorMaterial,,15,,,build,16,"Fuel, 0, 1.0",,,
190+
Tarp,3149,,Y,"Tarp, 1",Floor; FloorMaterial,,15,,,build,16,,"Fuel, 0, 1.0",,
191191
Straw Bale,3150,,Y,"Straw Bale, 1",,,,,,,5,,,0.95,
192-
Wax Block,3199,,N,,,,15,,,,3,"Fuel, 0, 1.0",,,
192+
Wax Block,3199,,N,,,,15,,,,3,,"Fuel, 0, 1.0",,
193193
,,,,,,,,,,,,,,,
194194
Brick,3200,,N,,,,15,,,,2,,,,
195195
Glass,3201,,N,,,,15,,,,4.5,,,,
@@ -209,8 +209,9 @@ Wooden Bow,3390,,N,,RangedWeapon,,15,,,,8,,,,
209209
<Metal> Greatsword,3410,,N,,Weapon,,15,,,,28,,,,
210210
<Metal> Spear,3420,,N,,Weapon,,15,,,,18,,,,
211211
<Metal> Halberd,3430,,N,,Weapon,,15,,,,24,,,,
212-
<Metal> Axe,3440,,N,,Weapon,,15,,,,18,,,,
213-
<Metal> Knife,3450,,N,,Weapon,,15,,,,18,,,,
212+
<Metal> Pickaxe,3435,,N,,Weapon; Tool,,15,,,,18,,,,
213+
<Metal> Axe,3440,,N,,Weapon; Tool,,15,,,,18,,,,
214+
<Metal> Knife,3450,,N,,Weapon; Tool,,15,,,,18,,,,
214215
<Metal> Lance,3460,,N,,Weapon,,5,,,,28,,,,
215216
<Metal> Nail,3470,,N,,Weapon,,15,,,,18,,,,
216217
<Metal> Mace,3480,,N,,Weapon,,15,,,,18,,,,
@@ -240,27 +241,27 @@ Linen Shirt,3710,,,,Clothing; Armor,,15,,,,8,,"Clothing, 0, 1.0",,
240241
Linen Trousers,3711,,,,Clothing; Armor,,15,,,,8,,"Clothing, 0, 1.0",,
241242
Linen Tunic,3712,,,,Clothing; Armor,,15,,,,13,,"Clothing, 0, 1.0",,
242243
,,,,,,,,,,,,,,,
243-
Rope,3749,,,,,,50,,,,6.5,"Fuel, 0, 0.3",,,
244-
Woven Net,3750,,,,,,15,,,,20,"Fuel, 0, 1.0",,,
244+
Rope,3749,,,,,,50,,,,6.5,,"Fuel, 0, 0.3",,
245+
Woven Net,3750,,,,,,15,,,,20,,"Fuel, 0, 1.0",,
245246
,,,,,,,,,,,,,,,
246-
Wooden Wall,4000,A wooden wall used for housing and defense.,Y,"Wooden Wall, 1",Building; BuildingMaterial,,5,,,build,10,"Fuel, 0, 2.0",,1.1,
247-
Wooden Floor,4001,,Y,"Wooden Floor, 1",Building; BuildingMaterial,,5,,,build,10,"Fuel, 0, 1.2",,1.1,
247+
Wooden Wall,4000,A wooden wall used for housing and defense.,Y,"Wooden Wall, 1",Building; BuildingMaterial,,5,,,build,10,,"Fuel, 0, 2.0",1.1,
248+
Wooden Floor,4001,,Y,"Wooden Floor, 1",Building; BuildingMaterial,,5,,,build,10,,"Fuel, 0, 1.2",1.1,
248249
Brick Wall,4050,A brick wall used for housing and defense.,Y,"Brick, 8, 10",Building; BuildingMaterial,,5,60,,build,15,,,1.5,
249250
Stone Wall,4060,,Y,"Stone Wall, 1",Building; BuildingMaterial,,5,150,,build,20,,,2.5,
250251
Earthen Wall,4070,,Y,"Earthen Wall, 1",Building; BuildingMaterial,,5,,,build,6,,,0.8,
251252
,,,,,,,,,,,,,,,
252253
,,,,,,,,,,,,,,,
253-
Straw Basket,5000,,N,,Basket,,5,,,,8,"Fuel, 0, 0.2",,,
254-
Wooden Basket,5001,,N,,Basket,,5,,,,8,"Fuel, 0, 1.0",,,
255-
Straw Bucket,5002,,N,,Bucket,,5,,,,8,"Fuel, 0, 0.7",,,
256-
Wooden Barrel,5003,,N,,Bucket,,5,,,,8,"Fuel, 0, 1.5",,,
254+
Straw Basket,5000,,N,,Basket,,5,,,,8,,"Fuel, 0, 0.2",,
255+
Wooden Basket,5001,,N,,Basket,,5,,,,8,,"Fuel, 0, 1.0",,
256+
Straw Bucket,5002,,N,,Bucket,,5,,,,8,,"Fuel, 0, 0.7",,
257+
Wooden Barrel,5003,,N,,Bucket,,5,,,,8,,"Fuel, 0, 1.5",,
257258
Ceramic Pot,5004,,N,,Bucket,,5,,,,8,,,,
258259
Glass Jug,5005,,N,,Bucket,,5,,,,8,,,,
259260
,,,,,,,,,,,,,,,
260-
<ProcessedWood> Craft,5100,,N,,,,50,,,,1,"Fuel, 0, 0.1",,1.1,
261+
<ProcessedWood> Craft,5100,,N,,,,50,,,,1,,"Fuel, 0, 0.1",1.1,
261262
<Stone> Craft,5110,,N,,,,50,,,,3,,,1.3,
262263
<Stone> Stone Tablet,5120,,N,,Tablet,,15,,,,1.5,,,1.3,
263-
Wax Tablet,5130,,N,,Tablet,,15,,,,3.5,"Fuel, 0, 0.5",,1.1,
264+
Wax Tablet,5130,,N,,Tablet,,15,,,,3.5,,"Fuel, 0, 0.5",1.1,
264265
,,,,,,,,,,,,,,,
265266
Home,,,N,,Building,,,,,,30,,"Personal Home, 0, 1.0",,
266267
,,,,,,,,,,,,,,,

res/items/world-recipes.csv

+4-4
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,16 @@ Wooden Bed,10 <ProcessedWood>,,Carpenter,,,"I / Sbuild, 120 / O",Wooden Bed,,,,
101101
,10 <ProcessedWood>,,Carpenter,,,"I / Sbuild, 720 / O",Wooden Press,,,,
102102
,"10 <ProcessedWood>, 3 Rope, 1 Woven Net, 1 Iron Bar",,Carpenter,,,"I / Sbuild, 1080 / O",Fishery,,,,
103103
,,,,,,,,,,,
104-
Baking Bread,5 Wheat Flour / 5 Barley Grain,,Kiln,,,"I / Scook, 30 / O",Bread,,,,
104+
Baking Bread,5 Wheat Flour / 5 Barley Grain,,Kiln,,,"I / IFuel, 0, 1.0 / Scook, 30 / O",Bread,,,,
105105
Basic Wine,"1 <Bucket>, 5 Grapes",,Brewery,,,"I / Scook, 30 / Ucook, U(1440, 2880) / O",<Bucket> of Wine,,,5,
106106
Basic Ale,"1 <Bucket>, 5 Barley",,Brewery,,,"I / Scook, 30 / Ucook, U(1440, 2880) / O",<Bucket> of Ale,,,5,
107107
,,,,,,,,,,,
108108
Basic Food Canning,"1 <Bucket>, 5 <Food>, 1 Salt",,Oven,,,"I / Scook, 60 / O",Preserved Food (<Bucket>),,,5,
109109
Basic Meat Preservation,"1 <Bucket>, 5 <RawMeat>, 2 Salt",,Oven,,,"I / Scook, 60 / O",Preserved Meat (<Bucket>),,,5,
110110
,,,,,,,,,,,
111-
Gruel,3 Wheat Flour / 3 Barley Grain,,,,,"I / Scook, 30 / O",Gruel,,,,
112-
Basic Cooking,6 <RawFood>,,Oven,,,"I / Scook, 60 / O",Cooked Meal,,,3,
113-
Basic Meat Cooking,"3 <RawMeat>, 4 <RawFood>",,Oven,,,"I / Scook, 60 / O",Cooked Meat Dish,,,3,
111+
Gruel,3 Wheat Flour / 3 Barley Grain,,,,,"I / IFuel, 0, 1.0 / Scook, 30 / O",Gruel,,,,
112+
Basic Cooking,6 <RawFood>,,Oven,,,"I / IFuel, 0, 1.0 / Scook, 60 / O",Cooked Meal,,,3,
113+
Basic Meat Cooking,"3 <RawMeat>, 4 <RawFood>",,Oven,,,"I / IFuel, 0, 1.0 / Scook, 60 / O",Cooked Meat Dish,,,3,
114114
,,,,,,,,,,,
115115
Leather Tanning,"1 Wood Acid, 1 <RawLeather>",,,,,"I / Srefine, 60 / O","_command, spawnRefined, <RawLeather> / Glass Jug",,,,
116116
,,,,,,,,,,,
0 Bytes
Loading

res/spritesetsTesting/Copper Axe.png

2.4 KB
Loading
2.4 KB
Loading
2.23 KB
Loading

res/spritesetsTesting/Gold Axe.png

2.4 KB
Loading
2.4 KB
Loading
2.23 KB
Loading

res/spritesetsTesting/Iron Axe.png

2.4 KB
Loading
2.4 KB
Loading
2.23 KB
Loading

res/spritesetsTesting/Steel Axe.png

2.4 KB
Loading
2.4 KB
Loading
2.23 KB
Loading

src/io/github/dantetam/system/InputSystem.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public void processRightMouseClick(float mouseX, float mouseY) {
193193
}
194194

195195
public void executeAction(String action) {
196-
CustomLog.outPrintln("InputSystem executed " + action);
196+
//CustomLog.outPrintln("InputSystem executed " + action);
197197

198198
if (action.equals("ADVANCE_TURN")) {
199199
CustomLog.outPrintln("##### End turn #####");

src/io/github/dantetam/world/dataparse/ItemCSVParser.java

+2
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,12 @@ private static void processItemDataMap(Map<String, String> record, Map<String, I
116116
add(new InventoryItem(id, 1, name));
117117
}};
118118

119+
/*
119120
List<ProcessStep> steps = new ArrayList<>();
120121
steps.add(new ProcessStep("Wait", pickupTime));
121122
ProcessData.addProcess("Consume Item " + name, singleItem, null, null, null, false,
122123
null, steps, itemActions, 1, null);
124+
*/
123125
}
124126
}
125127

src/io/github/dantetam/world/dataparse/ItemData.java

+14
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,20 @@ public static List<String> itemsWithPartName(String part) {
362362
return names;
363363
}
364364

365+
public static Set<Integer> itemsWithProp(String property) {
366+
return itemPropertiesNamed.get(property);
367+
}
368+
369+
public static ProcessStep getItemProp(int id, String propName) {
370+
List<ProcessStep> props = ItemData.getItemProps(id);
371+
for (ProcessStep prop : props) {
372+
if (prop.stepType.equals(propName)) {
373+
return prop;
374+
}
375+
}
376+
return null;
377+
}
378+
365379
public static LocalBuilding building(int id) {
366380
if (!allItemsById.containsKey(id)) {
367381
throw new IllegalArgumentException("Could not find item id: " + id);

src/io/github/dantetam/world/dataparse/texturespritegen/SpriteHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public abstract class SpriteHandler {
3737

3838
public static void init() {
3939
new TerrainSpriteHandler().loadAllSpriteTextures();
40-
new ShikashiSpriteHandler().loadAllSpriteTextures();
40+
new ToolSpriteHandler().loadAllSpriteTextures();
4141
}
4242

4343
public BufferedImage getBufferedImage(String fileName) {

src/io/github/dantetam/world/dataparse/texturespritegen/TerrainSpriteHandler.java

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ protected Map<String, SpriteSheetInstruction> getItemsToSpriteCoordsMap() {
5353

5454
map.put("Water", new SpriteSheetInstruction(mc,13,15));
5555

56+
map.put("Woody Shrub", new SpriteSheetInstruction(mc,4,8));
5657
map.put("Straw Bale", new SpriteSheetInstruction(ay1,6,8));
5758

5859
listAddTexture(map, ItemData.itemsWithPartName("Tree"), new SpriteSheetInstruction(mc,1,16));

src/io/github/dantetam/world/dataparse/texturespritegen/ShikashiSpriteHandler.java src/io/github/dantetam/world/dataparse/texturespritegen/ToolSpriteHandler.java

+9-4
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,25 @@
33
import java.util.HashMap;
44
import java.util.Map;
55

6+
import io.github.dantetam.world.dataparse.ItemData;
67
import io.github.dantetam.world.dataparse.texturespritegen.SpriteHandler.SpriteSheetInstruction;
78

8-
public class ShikashiSpriteHandler extends SpriteHandler {
9+
public class ToolSpriteHandler extends SpriteHandler {
910

1011
protected String getFileName() {return "res/spritesets/shikashi/main.png";}
1112
protected int getSpriteWidth() {return 32;}
1213
protected int getSpriteHeight() {return 32;}
1314

1415
@Override
1516
protected Map<String, SpriteSheetInstruction> getItemsToSpriteCoordsMap() {
16-
Map<String, SpriteSheetInstruction> itemsToSpriteCoordsMap = new HashMap<>();
17-
SpriteSheetInstruction inst;
17+
Map<String, SpriteSheetInstruction> map = new HashMap<>();
1818

19-
return itemsToSpriteCoordsMap;
19+
String net = "res/spritesets/nethack/nethack.jpg";
20+
21+
listAddTexture(map, ItemData.itemsWithPartName("Axe"), new SpriteSheetInstruction(net,11,22));
22+
listAddTexture(map, ItemData.itemsWithPartName("Pickaxe"), new SpriteSheetInstruction(net,12,5));
23+
24+
return map;
2025
}
2126

2227
}

src/io/github/dantetam/world/grid/ItemMetricsUtil.java

+17
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import io.github.dantetam.world.items.InventoryItem.ItemQuality;
2121
import io.github.dantetam.world.life.LivingEntity;
2222
import io.github.dantetam.world.process.LocalProcess;
23+
import io.github.dantetam.world.process.ProcessStep;
2324
import kdtreegeo.KdTree;
2425

2526
public class ItemMetricsUtil {
@@ -179,6 +180,22 @@ public double score(LivingEntity being, Set<LivingEntity> owners, LocalGrid grid
179180
}
180181
}
181182

183+
public static class PropertyStrAndUtilMetric extends DefaultItemMetric {
184+
public double score(LivingEntity being, Set<LivingEntity> owners, LocalGrid grid, LocalTile tile,
185+
int itemId, String propName, double amountPropRequired) {
186+
ProcessStep prop = ItemData.getItemProp(itemId, propName);
187+
int amountNeeded = (int) Math.ceil(amountPropRequired / prop.modifier);
188+
Map<Integer, Integer> itemsNeeded = new HashMap<>();
189+
itemsNeeded.put(itemId, amountNeeded);
190+
double origScore = super.score(being, owners, grid, tile, itemsNeeded,
191+
new ArrayList<GroupItem>());
192+
193+
double newScore = prop.modifier;
194+
195+
return (origScore + newScore) / 2.0;
196+
}
197+
}
198+
182199
public static class GroupAndUtilMetric extends DefaultItemMetric {
183200
public String[] itemGroups;
184201
public String useUtilityTypePref;

0 commit comments

Comments
 (0)