summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4d7cf2a)
raw | patch | inline | side by side (parent: 4d7cf2a)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 10 Sep 2017 19:17:34 +0000 (22:17 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 10 Sep 2017 19:21:27 +0000 (22:21 +0300) |
16 files changed:
libs/Lib_items_store.class | patch | blob | history | |
libs/Lib_items_store.java | patch | blob | history | |
src/Blocks.mpsrc | [deleted file] | patch | blob | history |
src/Blocks.pas | [new file with mode: 0644] | patch | blob |
src/BlocksLogic.pas | [new file with mode: 0644] | patch | blob |
src/CAVE.mpsrc | patch | blob | history | |
src/Items.pas | patch | blob | history | |
src/ItemsLogic.pas | [new file with mode: 0644] | patch | blob |
src/Phy.pas | patch | blob | history | |
src/Player.mpsrc | patch | blob | history | |
src/cellui.mpsrc | patch | blob | history | |
src/console.pas | patch | blob | history | |
src/drop.mpsrc | patch | blob | history | |
src/func.mpsrc | patch | blob | history | |
src/invui.mpsrc | patch | blob | history | |
src/items_logic.mpsrc | patch | blob | history |
index 161cba0801033b50306a6d2980814672cce4dc0c..f07d13faac9ba7bb9d70eac5488eff9b240bc130 100644 (file)
Binary files a/libs/Lib_items_store.class and b/libs/Lib_items_store.class differ
Binary files a/libs/Lib_items_store.class and b/libs/Lib_items_store.class differ
index ed2190b480c5a4b592a11c8e60ec9998604c97f1..75245bb80c3390126c3419b6b400113c87673ab5 100644 (file)
class Lib_items_store\r
{\r
/*Items*/\r
- static byte[] item_type;\r
- static byte[] item_tex;\r
- static int[] item_max;\r
static byte[] item_info;\r
- static byte[] item_flags;\r
- /*Blocks*/\r
- static byte[] block_tex;\r
- static int[] block_hp;\r
- static byte[] block_coll;\r
- static byte[] block_tool;\r
- static byte[] block_lvl;\r
- static byte[] block_flags;\r
- static byte[] block_tr;\r
- static byte[] block_li;\r
+\r
/*Craft*/\r
static byte[] [] craftIN_item;\r
static byte[] [] craftIN_sum;\r
static byte[] craftOUT_item;\r
static int[] craftOUT_sum;\r
static byte[] craftOUT_flag;\r
+\r
/*Tools*/\r
static byte[] tool_type;\r
static byte[] tool_lvl;\r
static byte[] tool_speed;\r
static byte[] tool_damg;\r
\r
-/*Items*/\r
- public static void resetitems(int len)\r
- {\r
- try {\r
- item_type = new byte[len];\r
- item_tex = new byte[len];\r
- item_max = new int[len];\r
- item_info = new byte[len];\r
- item_flags = new byte[len];\r
- } catch(Exception e) {e.printStackTrace();}\r
- }\r
-\r
- public static void setitemdata(int id, int type, int tex, int max, int info, int flags)\r
- {\r
- try {\r
- item_type[id] = (byte) type;\r
- item_tex[id] = (byte) tex;\r
- item_max[id] = max;\r
- item_info[id] = (byte) info;\r
- item_flags[id] = (byte) flags;\r
- } catch(Exception e) {e.printStackTrace();}\r
- }\r
-/*\r
- public static int getitemmax(int id)\r
- {\r
- try{\r
- return item_max[id];\r
- } catch(Exception e) { return 0;}\r
- }\r
-*/\r
-\r
-/*Blocks*/\r
-\r
- public static void resetblocks(int len)\r
- {\r
- try {\r
- block_tex = new byte[len];\r
- block_hp = new int[len];\r
- block_coll = new byte[len];\r
- block_tool = new byte[len];\r
- block_lvl = new byte[len];\r
- block_flags = new byte[len];\r
- block_tr = new byte[len];\r
- block_li = new byte[len];\r
- } catch(Exception e) {e.printStackTrace();}\r
- }\r
-\r
- public static void setblockdata(int id, int tex, int hp, int coll, int tool, int lvl, int flags, int tr, int li)\r
- {\r
- try {\r
- block_tex[id] = (byte) tex;\r
- block_hp[id] = hp;\r
- block_coll[id] = (byte) coll;\r
- block_tool[id] = (byte) tool;\r
- block_lvl[id] = (byte) lvl;\r
- block_flags[id] = (byte) flags;\r
- block_tr[id] = (byte) tr;\r
- block_li[id] = (byte) li;\r
- } catch(Exception e) {e.printStackTrace();}\r
- }\r
+ /* Items */\r
\r
- public static int getblocktex(int id)\r
- {\r
- try {\r
- return (int) block_tex[id] & 0xFF;\r
- } catch(Exception e) { return 0;}\r
- }\r
+ public static void resetitems(int len)\r
+ {\r
+ item_info = new byte[len];\r
+ }\r
\r
- public static int getblockhp(int id)\r
- {\r
- try {\r
- return block_hp[id];\r
- } catch(Exception e) { return 0;}\r
- }\r
-\r
- public static int getblockcoll(int id)\r
- {\r
- try {\r
- return (int) block_coll[id] & 0xFF;\r
- } catch(Exception e) { return 0;}\r
- }\r
-\r
- public static int getblocktool(int id)\r
- {\r
- try {\r
- return (int) block_tool[id] & 0xFF;\r
- } catch(Exception e) { return 0;}\r
- }\r
-\r
- public static int getblocklvl(int id)\r
- {\r
- try {\r
- return (int) block_lvl[id] & 0xFF;\r
- } catch(Exception e) { return 0;}\r
- }\r
-\r
- public static int getblockflags(int id)\r
- {\r
- try {\r
- return (int) block_flags[id] & 0xFF;\r
- } catch(Exception e) { return 0;}\r
- }\r
-\r
- public static int getblocktr(int id)\r
- {\r
- try {\r
- return (int) block_tr[id] & 0xFF;\r
- } catch(Exception e) { return 0;}\r
- }\r
-\r
- public static int getblockli(int id)\r
- {\r
- try {\r
- return (int) block_li[id] & 0xFF;\r
- } catch(Exception e) { return 0;}\r
- }\r
+ public static void setitemdata(int id, int type, int tex, int max, int info, int flags)\r
+ {\r
+ item_info[id] = (byte) info;\r
+ }\r
\r
/*Craft*/\r
public static void resetcrafts(int len)\r
diff --git a/src/Blocks.mpsrc b/src/Blocks.mpsrc
--- a/src/Blocks.mpsrc
+++ /dev/null
@@ -1,28 +0,0 @@
-unit Blocks;\r
-\r
-interface\r
-\r
- function IsTransporent(id : integer) : boolean;\r
- function IsForeground(id : integer) : boolean;\r
- function IsOverlapped(id : integer) : boolean;\r
-\r
-implementation\r
-\r
- uses items_store;\r
-\r
- function IsTransporent(id : integer) : boolean;\r
- begin\r
- result := (items_store.GetBlockFlags(id) and 1) <> 0;\r
- end;\r
-\r
- function IsForeground(id : integer) : boolean;\r
- begin\r
- result := (getBlockFlags(id) and 2) <> 0;\r
- end;\r
-\r
- function IsOverlapped(id : integer) : boolean;\r
- begin\r
- result := (getBlockFlags(id) and 4) <> 0;\r
- end;\r
-\r
-end.\r
diff --git a/src/Blocks.pas b/src/Blocks.pas
--- /dev/null
+++ b/src/Blocks.pas
@@ -0,0 +1,349 @@
+unit Blocks;\r
+\r
+interface\r
+\r
+ const (* Block id *)\r
+ none = 0;\r
+ dirt = 1;\r
+ grass = 2;\r
+ stone = 3;\r
+ oakWoodPlanks = 4;\r
+ cobblestone = 5;\r
+ bedrock = 6;\r
+ sand = 7;\r
+ gravel = 8;\r
+ oakWood = 9;\r
+ obsidian = 10;\r
+ bookshelf = 11;\r
+ mossStone = 12;\r
+ blockOfIron = 13;\r
+ blockOfGold = 14;\r
+ blockOfDiamond = 15;\r
+ goldOre = 16;\r
+ ironOre = 17;\r
+ coalOre = 18;\r
+ diamondOre = 19;\r
+ redstoneOre = 20;\r
+ oakLeaves = 21;\r
+ redFlower = 22;\r
+ yellowFlower = 23;\r
+ redMooshroom = 24;\r
+ brownMooshroom = 25;\r
+ torch = 26;\r
+ tnt = 27;\r
+ chest = 28;\r
+ craftingTable = 29;\r
+ cactus = 30;\r
+ glass = 31;\r
+ wool1 = 32;\r
+ wool2 = 33;\r
+ wool3 = 34;\r
+ wool4 = 35;\r
+ wool5 = 36;\r
+ wool6 = 37;\r
+ wool7 = 38;\r
+ wool8 = 39;\r
+ wool9 = 40;\r
+ wool10 = 41;\r
+ wool11 = 42;\r
+ wool12 = 43;\r
+ wool13 = 44;\r
+ wool14 = 45;\r
+ wool15 = 46;\r
+ wool16 = 47;\r
+ snow = 48;\r
+ ladder = 49;\r
+ water = 50;\r
+ lava = 51;\r
+ oakSapling = 52;\r
+ sponge = 53;\r
+ lapisLazuliOre = 54;\r
+ lapisLazuliBlock = 55;\r
+ sandstone = 56;\r
+ tallGrass = 57;\r
+ deadBush = 58;\r
+ cobweb = 59;\r
+ bricks = 60;\r
+ snowBlock = 61;\r
+ ice = 62;\r
+ snowLayer = 63;\r
+ clayBlock = 64;\r
+ sugarCane = 65;\r
+ pumpkin = 66;\r
+ jackLantern = 67;\r
+ stoneBricks = 68;\r
+ mossyStoneBricks = 69;\r
+ crackedStoneBricks = 70;\r
+ chiseledStokeBricks = 71;\r
+ ironBras = 72;\r
+ melonBlock = 73;\r
+ mycelium = 74;\r
+ backgroundOakWood = 75;\r
+ spawner = 76;\r
+ bed1 = 77;\r
+ bed2 = 78;\r
+ openWoodenDoor1 = 79;\r
+ openWoodenDoor2 = 80;\r
+ closedWoodenDoor1 = 81;\r
+ closedWoodenDoor2 = 82;\r
+ birchWood = 83;\r
+ backgroundBirchWood = 84;\r
+ spruceWood = 85;\r
+ backgroundSpruceWood = 86;\r
+ spruceLeaves = 87;\r
+ redMushroomBlock1 = 88;\r
+ redMushroomBlock2 = 89;\r
+ brownMushroomBlock1 = 90;\r
+ brownMushroomBlock2 = 91;\r
+ oakFence = 92;\r
+ backgroundOakFence = 93;\r
+ backgroundOakWoodPlanks = 94;\r
+ painting1 = 95;\r
+ painting2 = 96;\r
+ painting3 = 97;\r
+ painting4 = 98;\r
+ painting5 = 99;\r
+ painting6 = 100;\r
+ painting7 = 101;\r
+ giftChest = 102;\r
+ vines = 103;\r
+ sign = 104;\r
+ redstoneTorch = 105;\r
+ furnace = 106;\r
+ closedWoodenTrapdoor = 107;\r
+ openWoodenTrapdoor = 108;\r
+ netherrack = 109;\r
+ netherPortal = 110;\r
+ glowstone = 111;\r
+ birchLeaves = 112;\r
+ soulSand = 113;\r
+ birchSapling = 114;\r
+ spruceSapling = 115;\r
+ redstoneLampOff = 116;\r
+ redstoneLampOn = 117;\r
+ backgroundObsidian = 118;\r
+ glassPlane = 119;\r
+ farmland = 120;\r
+ cake = 121;\r
+ wheat = 122;\r
+ melonStem = 123;\r
+ pumpkinStem = 124;\r
+ burningFurnace = 125;\r
+ reservedBlock = 126;\r
+\r
+ function GetTexture(id : integer) : integer;\r
+ function GetResistant(id : integer) : integer;\r
+ function GetTool(id : integer) : integer;\r
+ function GetLevel(id : integer) : integer;\r
+ function GetLightAbsorbtion(id : integer) : integer;\r
+ function GetLightEmission(id : integer) : integer;\r
+\r
+ function IsTransporent(id : integer) : boolean;\r
+ function IsForeground(id : integer) : boolean;\r
+ function IsOverlapped(id : integer) : boolean;\r
+ function IsSolid(id : integer) : boolean;\r
+\r
+implementation\r
+\r
+ uses items_store;\r
+\r
+ const\r
+ lastBlock = 125;\r
+\r
+ var\r
+ bltex, hp, tool, lvl, abslight, emmlight, flags : array [0..lastBlock] of integer;\r
+\r
+ function GetTexture(id : integer) : integer;\r
+ begin\r
+ result := bltex[id];\r
+ end;\r
+\r
+ function GetResistant(id : integer) : integer;\r
+ begin\r
+ result := hp[id];\r
+ end;\r
+\r
+ function GetTool(id : integer) : integer;\r
+ begin\r
+ result := tool[id];\r
+ end;\r
+\r
+ function GetLevel(id : integer) : integer;\r
+ begin\r
+ result := lvl[id];\r
+ end;\r
+\r
+ function GetLightAbsorbtion(id : integer) : integer;\r
+ begin\r
+ result := abslight[id];\r
+ end;\r
+\r
+ function GetLightEmission(id : integer) : integer;\r
+ begin\r
+ result := emmlight[id];\r
+ end;\r
+\r
+ function IsTransporent(id : integer) : boolean;\r
+ begin\r
+ result := (flags[id] and (1 << 0)) <> 0;\r
+ end;\r
+\r
+ function IsForeground(id : integer) : boolean;\r
+ begin\r
+ result := (flags[id] and (1 << 1)) <> 0;\r
+ end;\r
+\r
+ function IsOverlapped(id : integer) : boolean;\r
+ begin\r
+ result := (flags[id] and (1 << 2)) <> 0;\r
+ end;\r
+\r
+ function IsSolid(id : integer) : boolean;\r
+ begin\r
+ result := (flags[id] and (1 << 3)) <> 0;\r
+ end;\r
+\r
+ procedure InitBlock(id, xtex, xhp, xtool, xlvl, xabslight, xemmlight : integer; solid, transporent, foreground, overlap : boolean);\r
+ begin\r
+ Assert((id >= 0) and (id <= lastBlock));\r
+ bltex[id] := xtex;\r
+ hp[id] := xhp;\r
+ tool[id] := xtool;\r
+ lvl[id] := xlvl;\r
+ abslight[id] := xabslight;\r
+ emmlight[id] := xemmlight;\r
+ flags[id] := 0;\r
+ if transporent then flags[id] := flags[id] or (1 << 0);\r
+ if foreground then flags[id] := flags[id] or (1 << 1);\r
+ if overlap then flags[id] := flags[id] or (1 << 2);\r
+ if solid then flags[id] := flags[id] or (1 << 3);\r
+ end;\r
+\r
+initialization\r
+ InitBlock(none, 0, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(dirt, 1, 9, 2, 0, 15, 0, true, false, false, false);\r
+ InitBlock(grass, 2, 9, 2, 0, 15, 0, true, false, false, false);\r
+ InitBlock(stone, 3, 60, 1, 1, 15, 0, true, false, false, false);\r
+ InitBlock(oakWoodPlanks, 4, 30, 3, 0, 15, 0, true, false, false, false);\r
+ InitBlock(cobblestone, 5, 60, 1, 1, 15, 0, true, false, false, false);\r
+ InitBlock(bedrock, 6, 2147483647, 0, 0, 15, 0, true, false, false, false);\r
+ InitBlock(sand, 7, 9, 2, 0, 15, 0, true, false, false, false);\r
+ InitBlock(gravel, 8, 9, 2, 0, 15, 0, true, false, false, false);\r
+ InitBlock(oakWood, 9, 30, 3, 0, 15, 0, true, false, false, false);\r
+ InitBlock(obsidian, 10, 1000, 1, 5, 15, 0, true, false, false, false);\r
+ InitBlock(bookshelf, 11, 24, 3, 0, 0, 0, false, false, false, false);\r
+ InitBlock(mossStone, 12, 40, 1, 1, 15, 0, true, false, false, false);\r
+ InitBlock(blockOfIron, 13, 40, 1, 2, 15, 0, true, false, false, false);\r
+ InitBlock(blockOfGold, 14, 60, 1, 3, 15, 0, true, false, false, false);\r
+ InitBlock(blockOfDiamond, 15, 60, 1, 3, 15, 0, true, false, false, false);\r
+ InitBlock(goldOre, 16, 65, 1, 3, 15, 0, true, false, false, false);\r
+ InitBlock(ironOre, 17, 65, 1, 2, 15, 0, true, false, false, false);\r
+ InitBlock(coalOre, 18, 65, 1, 1, 15, 0, true, false, false, false);\r
+ InitBlock(diamondOre, 19, 65, 1, 3, 15, 0, true, false, false, false);\r
+ InitBlock(redstoneOre, 20, 65, 1, 3, 15, 6, true, false, false, false);\r
+ InitBlock(oakLeaves, 21, 3, 4, 1, 1, 0, true, false, false, false);\r
+ InitBlock(redFlower, 22, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(yellowFlower, 23, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(redMooshroom, 24, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(brownMooshroom, 25, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(torch, 26, 0, 0, 0, 0, 14, false, true, false, false);\r
+ InitBlock(tnt, 27, 0, 0, 0, 15, 0, true, false, false, false);\r
+ InitBlock(chest, 28, 39, 3, 0, 0, 0, false, false, false, false);\r
+ InitBlock(craftingTable, 29, 39, 3, 0, 0, 0, false, false, false, false);\r
+ InitBlock(cactus, 30, 6, 0, 0, 0, 0, true, true, false, false);\r
+ InitBlock(glass, 31, 6, 0, 1, 1, 0, true, true, false, false);\r
+ InitBlock(wool1, 32, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool2, 33, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool3, 34, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool4, 35, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool5, 36, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool6, 37, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool7, 38, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool8, 39, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool9, 40, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool10, 41, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool11, 42, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool12, 43, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool13, 44, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool14, 45, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool15, 46, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(wool16, 47, 12, 0, 0, 0, 0, false, false, false, false);\r
+ InitBlock(snow, 48, 9, 2, 0, 15, 0, true, false, false, false);\r
+ InitBlock(ladder, 49, 6, 0, 0, 0, 0, false, true, false, false);\r
+ InitBlock(water, 50, 2147483647, 0, 0, 1, 0, false, true, true, true);\r
+ InitBlock(lava, 55, 2147483647, 0, 0, 15, 15, false, true, true, true);\r
+ InitBlock(oakSapling, 60, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(sponge, 61, 9, 0, 0, 15, 0, true, false, false, false);\r
+ InitBlock(lapisLazuliOre, 62, 65, 1, 2, 15, 0, true, false, false, false);\r
+ InitBlock(lapisLazuliBlock, 63, 65, 1, 2, 15, 0, true, false, false, false);\r
+ InitBlock(sandstone, 64, 50, 1, 1, 15, 0, true, false, false, false);\r
+ InitBlock(tallGrass, 65, 0, 4, 1, 0, 0, false, true, false, true);\r
+ InitBlock(deadBush, 66, 0, 4, 1, 0, 0, false, true, false, true);\r
+ InitBlock(cobweb, 67, 60, 4, 1, 0, 0, false, true, false, true);\r
+ InitBlock(bricks, 68, 60, 1, 1, 15, 0, true, false, false, false);\r
+ InitBlock(snowBlock, 69, 3, 2, 0, 15, 0, true, false, false, false);\r
+ InitBlock(ice, 70, 8, 1, 6, 2, 0, true, true, false, false);\r
+ InitBlock(snowLayer, 71, 2, 2, 1, 1, 0, false, true, true, true);\r
+ InitBlock(clayBlock, 72, 9, 2, 0, 15, 0, true, false, false, false);\r
+ InitBlock(sugarCane, 73, 0, 0, 0, 0, 0, false, true, true, true);\r
+ InitBlock(pumpkin, 74, 15, 3, 0, 1, 0, true, false, false, false);\r
+ InitBlock(jackLantern, 75, 15, 3, 0, 1, 15, true, false, false, false);\r
+ InitBlock(stoneBricks, 76, 60, 1, 1, 15, 0, true, false, false, false);\r
+ InitBlock(mossyStoneBricks, 77, 60, 1, 1, 15, 0, true, false, false, false);\r
+ InitBlock(crackedStoneBricks, 78, 60, 1, 1, 15, 0, true, false, false, false);\r
+ InitBlock(chiseledStokeBricks, 79, 60, 1, 1, 15, 0, true, false, false, false);\r
+ InitBlock(ironBras, 80, 60, 1, 1, 0, 0, false, true, true, false);\r
+ InitBlock(melonBlock, 81, 15, 0, 0, 15, 0, true, false, false, false);\r
+ InitBlock(mycelium, 82, 8, 2, 0, 15, 0, true, false, false, false);\r
+ InitBlock(backgroundOakWood, 98, 30, 3, 0, 0, 0, false, false, false, false);\r
+ InitBlock(spawner, 83, 75, 0, 0, 0, 0, false, true, false, false);\r
+ InitBlock(bed1, 84, 3, 0, 0, 0, 0, false, true, false, false);\r
+ InitBlock(bed2, 85, 3, 0, 0, 0, 0, false, true, false, false);\r
+ InitBlock(openWoodenDoor1, 86, 30, 3, 0, 0, 0, false, true, false, false);\r
+ InitBlock(openWoodenDoor2, 102, 30, 3, 0, 0, 0, false, true, false, false);\r
+ InitBlock(closedWoodenDoor1, 88, 30, 3, 0, 0, 0, true, true, true, false);\r
+ InitBlock(closedWoodenDoor2, 104, 30, 3, 0, 0, 0, true, true, true, false);\r
+ InitBlock(birchWood, 90, 30, 3, 0, 0, 0, true, false, false, false);\r
+ InitBlock(backgroundBirchWood, 99, 30, 3, 0, 0, 0, false, false, false, false);\r
+ InitBlock(spruceWood, 91, 30, 3, 0, 0, 0, true, false, false, false);\r
+ InitBlock(backgroundSpruceWood, 100, 30, 3, 0, 0, 0, false, false, false, false);\r
+ InitBlock(spruceLeaves, 92, 3, 4, 1, 1, 0, true, false, false, false);\r
+ InitBlock(redMushroomBlock1, 93, 3, 3, 0, 2, 0, true, false, false, false);\r
+ InitBlock(redMushroomBlock2, 95, 3, 3, 0, 0, 0, false, false, false, false);\r
+ InitBlock(brownMushroomBlock1, 94, 3, 3, 0, 2, 0, true, false, false, false);\r
+ InitBlock(brownMushroomBlock2, 95, 3, 3, 0, 0, 0, false, false, false, false);\r
+ InitBlock(oakFence, 96, 30, 3, 0, 0, 0, true, true, false, false);\r
+ InitBlock(backgroundOakFence, 101, 30, 3, 0, 0, 0, false, true, false, false);\r
+ InitBlock(backgroundOakWoodPlanks, 97, 30, 3, 0, 0, 0, false, false, false, false);\r
+ InitBlock(painting1, 106, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(painting2, 107, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(painting3, 108, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(painting4, 109, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(painting5, 110, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(painting6, 111, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(painting7, 112, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(giftChest, 113, 30, 3, 0, 0, 15, false, false, false, false);\r
+ InitBlock(vines, 114, 3, 4, 1, 0, 0, false, true, true, true);\r
+ InitBlock(sign, 115, 15, 0, 0, 0, 0, false, true, false, false);\r
+ InitBlock(redstoneTorch, 116, 0, 0, 0, 0, 7, false, true, false, true);\r
+ InitBlock(furnace, 117, 40, 3, 0, 0, 0, false, false, false, false);\r
+ InitBlock(closedWoodenTrapdoor, 118, 30, 3, 0, 0, 0, true, true, true, false);\r
+ InitBlock(openWoodenTrapdoor, 119, 30, 3, 0, 0, 0, false, true, false, false);\r
+ InitBlock(netherrack, 120, 30, 1, 1, 15, 0, true, false, false, false);\r
+ InitBlock(netherPortal, 129, 2147483647, 0, 0, 0, 11, false, true, true, false);\r
+ InitBlock(glowstone, 121, 10, 1, 0, 0, 15, true, false, false, false);\r
+ InitBlock(birchLeaves, 135, 3, 4, 1, 1, 0, true, false, false, false);\r
+ InitBlock(soulSand, 122, 9, 2, 0, 15, 0, true, false, false, false);\r
+ InitBlock(birchSapling, 123, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(spruceSapling, 124, 0, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(redstoneLampOff, 125, 10, 1, 0, 0, 0, true, false, false, false);\r
+ InitBlock(redstoneLampOn, 126, 10, 1, 0, 0, 15, true, false, false, false);\r
+ InitBlock(backgroundObsidian, 127, 1000, 1, 5, 15, 0, false, false, false, false);\r
+ InitBlock(glassPlane, 128, 6, 0, 1, 1, 0, false, true, false, false);\r
+ InitBlock(farmland, 136, 9, 2, 0, 15, 0, true, false, false, false);\r
+ InitBlock(cake, 137, 9, 0, 0, 0, 0, false, true, false, false);\r
+ InitBlock(wheat, 138, 1, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(melonStem, 139, 1, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(pumpkinStem, 139, 1, 0, 0, 0, 0, false, true, false, true);\r
+ InitBlock(burningFurnace, 134, 40, 3, 0, 0, 15, false, false, false, false);\r
+end.\r
diff --git a/src/BlocksLogic.pas b/src/BlocksLogic.pas
--- /dev/null
+++ b/src/BlocksLogic.pas
@@ -0,0 +1,25 @@
+unit BlocksLogic;
+
+interface
+
+ procedure Draw(x, y, camx, camy : integer);
+
+implementation
+
+ uses Vars, Blocks, Maps;
+
+ procedure Draw(x, y, camx, camy : integer);
+ const
+ tileSize = 16;
+ var
+ id : integer;
+ texid : integer;
+ begin
+ id := Maps.GetMap(x, y);
+ texid := Blocks.GetTexture(id);
+ DrawImage(tex[texid], x * tileSize - camx, y * tileSize - camy);
+ end;
+
+initialization
+
+end.
diff --git a/src/CAVE.mpsrc b/src/CAVE.mpsrc
index 830a6abac54eaeb688b7640322757eff3c4e9781..a43998d85f579e1be265f6d7b286907bd3f7f7a5 100644 (file)
--- a/src/CAVE.mpsrc
+++ b/src/CAVE.mpsrc
program CAVE;\r
\r
uses\r
- Items,\r
sign,\r
jsr75i,\r
drop,\r
inv,\r
items_store,\r
video,\r
- Blocks;\r
+ Blocks,\r
+ BlocksLogic,\r
+ Items,\r
+ ItemsLogic;\r
\r
const\r
version_map = 9;\r
else if getBiomMap(ix) = 3 then drawimage(osad[0, osadki_ani], (ix * 16) - camx, (iy * 16) - camy)\r
end;\r
if drw_back and Blocks.IsTransporent(getmap(ix, iy)) then draw_back(ix, iy);\r
- if Blocks.IsForeground(getmap(ix,iy)) = false then draw_block(ix,iy);\r
+ if Blocks.IsForeground(getmap(ix,iy)) = false then BlocksLogic.Draw(ix, iy, camx, camy);\r
end;\r
{===================[drop]===================}\r
Drop.Draw(camx, camy);\r
for ix:=minx to maxx do\r
for iy:=miny to maxy do\r
begin\r
- if Blocks.IsForeground(getmap(ix, iy)) then draw_block(ix, iy);\r
+ if Blocks.IsForeground(getmap(ix, iy)) then BlocksLogic.Draw(ix, iy, camx, camy);\r
\r
setcolor(0, 0, 0);\r
if light_type = 1 then\r
drawimage(gui[1],tmp_ax,0);\r
for ix:=0 to 8 do\r
begin\r
- Items.Draw(inv.getItem(ix), inv.getSum(ix), (ix*16)+tmp_ax+ix*2+4, 1, true);\r
+ ItemsLogic.Draw(inv.getItem(ix), inv.getSum(ix), (ix*16)+tmp_ax+ix*2+4, 1, true);\r
end;\r
drawimage(gui[17],(invslot*16)+tmp_ax+invslot*2+2,0);\r
\r
else\r
if (block>0) then\r
begin\r
- if (Items.GetType(item) = Items.tool) and (getBlockTool(block)=getToolType(item)) then\r
+ if (Items.GetType(item) = Items.tool) and (Blocks.GetTool(block) = getToolType(item)) then\r
toolus:=toolus+getToolSpeed(item);\r
else\r
toolus:=toolus+1;\r
\r
- if toolus>=getBlockHP(block) then\r
+ if toolus >= Blocks.GetResistant(block) then\r
begin\r
- if ((Items.GetType(item) = Items.tool) and (getBlockTool(block)=getToolType(item)) and (getToolLvl(item)>=getBlockLvl(block))) or (getBlockLvl(block)<=0) then\r
+ if ((Items.GetType(item) = Items.tool) and (Blocks.GetTool(block) = getToolType(item)) and (getToolLvl(item) >= Blocks.GetLevel(block))) or (Blocks.GetLevel(block) <= 0) then\r
begin\r
setMap(0, x, y);\r
destroy_block_1(block, x, y);\r
end;\r
end;\r
\r
- if (toolus>0) and (toolus<=getBlockHP(block)) then\r
- toolind:=((toolus*100) div getBlockHP(block)) div 10;\r
+ if (toolus > 0) and (toolus <= Blocks.GetResistant(block)) then begin\r
+ toolind := ((toolus * 100) div Blocks.GetResistant(block)) div 10;\r
+ end;\r
end;\r
\r
function rt_useweap:boolean;\r
begin\r
setmaplight(ss,ix,iy);\r
if ss=0 then break;\r
- ss:=ss-getBlockTr(getmap(ix,iy));\r
+ ss := ss - Blocks.GetLightAbsorbtion(getmap(ix, iy));\r
if ss<0 then ss:=0;\r
end;\r
for iy:=iy+1 to 127 do\r
\r
if clock_stage<>game_time div 75000 then begin clock_stage:=clock_stage+1; if clock_stage>7 then clock_stage:=0; end;\r
\r
- if x<0 then x:=0;\r
- if x+8>4094 then x:=4086;\r
- if getBlockColl(getmap(x div 16, y div 16))>0 then hp:=hp-1;\r
+ if x < 0 then x := 0;\r
+ else if x + 8 > 4094 then x := 4086;\r
+ if Blocks.IsSolid(getmap(x div 16, y div 16)) then hp := hp - 1;\r
+\r
if random(4096)=random(4096) then begin osadki:=not osadki; end;\r
osadki_ani:=osadki_ani+1;\r
if osadki_ani>7 then osadki_ani:=0;\r
for ix:=minx to maxx do\r
for iy:=miny to maxy do\r
begin\r
- if light_type=0 then setmaplight(15,ix,iy);\r
- else\r
- if light_type>0 then if getBlockLi(getmap(ix,iy))>0 then calc_light(getBlockLi(getmap(ix,iy)),ix,iy);\r
+ if light_type = 0 then begin\r
+ SetMapLight(15, ix, iy);\r
+ end else if (light_type > 0) and (Blocks.GetLightEmission(getmap(ix, iy)) > 0) then begin\r
+ calc_light(Blocks.GetLightEmission(GetMap(ix, iy)), ix, iy);\r
+ end;\r
end;\r
\r
minx:=(camx/16)-((getwidth/2)/16);\r
else if id = Items.painting5 then name := 'painting5'\r
else if id = Items.painting6 then name := 'painting6'\r
else if id = Items.painting7 then name := 'painting7'\r
- else if id = Items.reservedBlockItem1 then name := 'reservedBlockItem1'\r
+ else if id = Items.giftChest then name := 'giftChest'\r
else if id = Items.vines then name := 'vines'\r
else if id = Items.sign then name := 'sign'\r
else if id = Items.redstoneTorch then name := 'redstoneTorch'\r
else if id = Items.glassPlane then name := 'glassPlane'\r
else if id = Items.farmland then name := 'farmland'\r
else if id = Items.cake then name := 'cake'\r
- else if id = Items.reservedBlockItem2 then name := 'reservedBlockItem2'\r
- else if id = Items.reservedBlockItem3 then name := 'reservedBlockItem3'\r
- else if id = Items.reservedBlockItem4 then name := 'reservedBlockItem4'\r
- else if id = Items.reservedBlockItem5 then name := 'reservedBlockItem5'\r
- else if id = Items.reservedBlockItem6 then name := 'reservedBlockItem6'\r
+ else if id = Items.wheatBlock then name := 'wheatBlock'\r
+ else if id = Items.melonStem then name := 'melonStem'\r
+ else if id = Items.pumpkinStem then name := 'pumpkinStem'\r
+ else if id = Items.burningFurnace then name := 'burningFurnace'\r
+ else if id = Items.reservedBlockItem then name := 'reservedBlockItem'\r
else if id = Items.stick then name := 'stick'\r
else if id = Items.dandelionYellow then name := 'dandelionYellow'\r
else if id = Items.roseRed then name := 'roseRed'\r
for id := 0 to 194 do begin\r
Debug(' InitOrdItem(' + ItemToString(Items.GetOrdinary(id)) + ');');\r
end;\r
+\r
+ for id := 0 to 125 do begin\r
+ Debug(' InitBlock(' + ItemToString(id) + ', ' +\r
+ Blocks.GetTexture(id) + ', ' +\r
+ Blocks.GetResistant(id) + ', ' +\r
+ Blocks.GetTool(id) + ', ' +\r
+ Blocks.GetLevel(id) + ', ' +\r
+ Blocks.GetLightAbsorbtion(id) + ', ' +\r
+ Blocks.GetLightEmission(id) + ', ' +\r
+ Blocks.IsSolid(id) + ', ' +\r
+ Blocks.IsTransporent(id) + ', ' +\r
+ Blocks.IsForeground(id) + ', ' +\r
+ Blocks.IsOverlapped(id) + ');'\r
+ );\r
+ end;\r
end;\r
\r
begin\r
diff --git a/src/Items.pas b/src/Items.pas
index 9ebb84e18ab21ec96a5fe75aa2663e2d421ffcdf..48475d5f61fe3eb4179e54ba1b8a24161d4dfa60 100644 (file)
--- a/src/Items.pas
+++ b/src/Items.pas
painting5 = 99;
painting6 = 100;
painting7 = 101;
- reservedBlockItem1 = 102;
+ giftChest = 102;
vines = 103;
sign = 104;
redstoneTorch = 105;
glassPlane = 119;
farmland = 120;
cake = 121;
- reservedBlockItem2 = 122;
- reservedBlockItem3 = 123;
- reservedBlockItem4 = 124;
- reservedBlockItem5 = 125;
- reservedBlockItem6 = 126;
+ wheatBlock = 122;
+ melonStem = 123;
+ pumpkinStem = 124;
+ burningFurnace = 125;
+ reservedBlockItem = 126;
stick = 127;
dandelionYellow = 128;
roseRed = 129;
function GetOrdinary(i : integer) : integer;
- procedure DrawSmall(id, x, y : integer);
- procedure Draw(id, sum, x, y : integer; drawIndicator : boolean);
-
implementation
uses Vars, Func;
countOrdItems := countOrdItems + 1;
end;
- procedure DrawSmall(id, x, y : integer);
- begin
- if GetTextureSource(id) = 0 then DrawImage(Vars.tex8[itex[id]], x, y)
- else if GetTextureSource(id) = 1 then DrawImage(Vars.item8[itex[id]], x, y)
- end;
-
- procedure Draw(id, sum, x, y : integer; drawIndicator : boolean);
- const
- maxLength = 15;
- maxHeight = 14;
- redLength = 3;
- var
- class, len : integer;
- begin
- if sum <= 0 then exit;
-
- if GetTextureSource(id) = 0 then DrawImage(Vars.tex[itex[id]], x, y)
- else if GetTextureSource(id) = 1 then DrawImage(Vars.item[itex[id]], x, y)
-
- if drawIndicator and (sum > 1) then begin
- class := GetIndicatorType(id);
- if class = numeric then begin
- Func.DrawFontText('' + sum, x, y + 8)
- end else if class = line then begin
- len := sum * maxLength / imax[id];
- if len <= redLength then SetColor(255, 0, 0) else SetColor(0, 255, 0);
- DrawLine(x, y + maxHeight, x + len, y + maxHeight);
- end;
- end;
- end;
-
initialization
InitItem(none, block, 0, 0, 0, 0, noindicator, false);
InitItem(dirt, block, 1, 64, 1, 0, numeric, true);
InitItem(painting5, block, 110, 1, 99, 0, numeric, true);
InitItem(painting6, block, 111, 1, 100, 0, numeric, true);
InitItem(painting7, block, 112, 1, 101, 0, numeric, true);
- InitItem(reservedBlockItem1, block, 0, 0, 0, 0, noindicator, false);
+ InitItem(giftChest, block, 113, 64, 102, 0, numeric, true);
InitItem(vines, block, 114, 64, 103, 0, numeric, true);
InitItem(sign, block, 98, 16, 104, 1, numeric, true);
InitItem(redstoneTorch, block, 116, 64, 105, 0, numeric, true);
InitItem(glassPlane, block, 128, 64, 119, 0, numeric, true);
InitItem(farmland, block, 136, 64, 120, 0, numeric, true);
InitItem(cake, block, 137, 64, 121, 0, numeric, true);
- InitItem(reservedBlockItem2, block, 0, 0, 0, 0, noindicator, false);
- InitItem(reservedBlockItem3, block, 0, 0, 0, 0, noindicator, false);
- InitItem(reservedBlockItem4, block, 0, 0, 0, 0, noindicator, false);
- InitItem(reservedBlockItem5, block, 0, 0, 0, 0, noindicator, false);
- InitItem(reservedBlockItem6, block, 0, 0, 0, 0, noindicator, false);
+ InitItem(wheatBlock, block, 142, 64, 122, 0, numeric, true);
+ InitItem(melonStem, block, 143, 64, 123, 0, numeric, true);
+ InitItem(pumpkinStem, block, 143, 64, 124, 0, numeric, true);
+ InitItem(burningFurnace, block, 134, 64, 125, 0, numeric, true);
+ InitItem(reservedBlockItem, block, 0, 0, 0, 0, noindicator, false);
InitItem(stick, orditem, 0, 64, 0, 1, numeric, true);
InitItem(dandelionYellow, orditem, 8, 64, 0, 1, numeric, true);
InitItem(roseRed, orditem, 9, 64, 0, 1, numeric, true);
diff --git a/src/ItemsLogic.pas b/src/ItemsLogic.pas
--- /dev/null
+++ b/src/ItemsLogic.pas
@@ -0,0 +1,52 @@
+unit ItemsLogic;
+
+interface
+
+ procedure DrawSmall(id, x, y : integer);
+ procedure Draw(id, sum, x, y : integer; drawIndicator : boolean);
+
+implementation
+
+ uses Items, Vars, Func;
+
+ procedure DrawSmall(id, x, y : integer);
+ var
+ texid, source : integer;
+ begin
+ texid := Items.GetTexture(id);
+ source := Items.GetTextureSource(id);
+ if source = 0 then DrawImage(Vars.tex8[texid], x, y)
+ else if source = 1 then DrawImage(Vars.item8[texid], x, y)
+ end;
+
+ procedure Draw(id, sum, x, y : integer; drawIndicator : boolean);
+ const
+ maxLength = 15;
+ maxHeight = 14;
+ redLength = 3;
+ var
+ texid, source, class, max, len : integer;
+ begin
+ if sum <= 0 then exit;
+
+ texid := Items.GetTexture(id);
+ source := Items.GetTextureSource(id);
+ if source = 0 then DrawImage(Vars.tex[texid], x, y)
+ else if source = 1 then DrawImage(Vars.item[texid], x, y)
+
+ if drawIndicator and (sum > 1) then begin
+ class := Items.GetIndicatorType(id);
+ if class = numeric then begin
+ Func.DrawFontText('' + sum, x, y + 8)
+ end else if class = line then begin
+ max := Items.GetMaximum(id);
+ len := sum * maxLength / max;
+ if len <= redLength then SetColor(255, 0, 0) else SetColor(0, 255, 0);
+ DrawLine(x, y + maxHeight, x + len, y + maxHeight);
+ end;
+ end;
+ end;
+
+initialization
+
+end.
diff --git a/src/Phy.pas b/src/Phy.pas
index 2b795c4d8bc3524aac4cbec37b4e4f385d3bf073..9157e68ebb025aa073ab3e110e1cd45eee63855d 100644 (file)
--- a/src/Phy.pas
+++ b/src/Phy.pas
\r
implementation\r
\r
- uses items_store, maps, vars;\r
+ uses Maps, Vars, Blocks;\r
\r
const\r
maxVelocity = 32;\r
\r
function IsSolid(x, y : integer) : boolean;\r
begin\r
- isSolid := GetBlockColl(getMap(x, y)) <> 0;\r
+ result := Blocks.IsSolid(getMap(x, y));\r
end;\r
\r
function MapColl(x, y, w, h : integer) : boolean;\r
diff --git a/src/Player.mpsrc b/src/Player.mpsrc
index 947adf9cbd706749e7dd07d8b950b446f7087312..0a97db74453571125d066248357684a7b392a46d 100644 (file)
--- a/src/Player.mpsrc
+++ b/src/Player.mpsrc
\r
implementation\r
\r
- uses func, phy, vars, Canvas, drop, jsr75i, inv, Items;\r
+ uses func, phy, vars, Canvas, drop, jsr75i, inv, ItemsLogic;\r
\r
const\r
PLAYER_W=8;\r
DrawImage(playerBody[posi], x - camx, y - camy);\r
DrawImage(playerLegs[posi, animLegs], x - 2 - camx, y + 20 - camy);\r
\r
- if animHand = 0 then Items.DrawSmall(Inv.GetItem(invslot), x - camx, y + 14 - camy);\r
- else if posi = POSI_RIGHT then Items.DrawSmall(Inv.GetItem(invslot), x + 10 - camx, y + 5 - camy + animHand);\r
- else if posi = POSI_LEFT then Items.DrawSmall(Inv.GetItem(invslot), x - 10 - camx, y + 5 - camy + animHand);\r
+ if animHand = 0 then ItemsLogic.DrawSmall(Inv.GetItem(invslot), x - camx, y + 14 - camy);\r
+ else if posi = POSI_RIGHT then ItemsLogic.DrawSmall(Inv.GetItem(invslot), x + 10 - camx, y + 5 - camy + animHand);\r
+ else if posi = POSI_LEFT then ItemsLogic.DrawSmall(Inv.GetItem(invslot), x - 10 - camx, y + 5 - camy + animHand);\r
\r
if (animHand = 0) or (posi = POSI_RIGHT) then DrawImage(playerHand[posi, animHand], x + 2 - camx, y + 8 - camy);\r
else DrawImage(playerHand[posi, animHand], x - 6 - camx, y + 8 - camy);\r
diff --git a/src/cellui.mpsrc b/src/cellui.mpsrc
index 3b14c3fa68d232e188ccf0ca5323daa5c1d5ac12..611532352c6dc4831104a7b8530699eccd6e3a8c 100644 (file)
--- a/src/cellui.mpsrc
+++ b/src/cellui.mpsrc
function FindCurrentWindowsType:boolean;\r
\r
implementation\r
- uses vars, Canvas, console, furnace, chest, inv, func, items_store, Items;\r
+ uses vars, Canvas, console, furnace, chest, inv, func, items_store, Items, ItemsLogic;\r
var\r
layer:integer;\r
last_cell: array [0..CONST_MAX_LAYERS] of integer;\r
for j:=0 to CONST_MAX_CELLS do\r
if inv_type[i, j]<>CELL_TYPE_NULL then\r
begin\r
- Items.Draw(getItemIdx(j, i), getSumIdx(j, i), x+inv_x[i, j], y+inv_y[i, j], getCellFlagIndicator(i, j));\r
+ ItemsLogic.Draw(getItemIdx(j, i), getSumIdx(j, i), x+inv_x[i, j], y+inv_y[i, j], getCellFlagIndicator(i, j));\r
end;\r
end;\r
\r
diff --git a/src/console.pas b/src/console.pas
index 3d227f8bc503cc84e8a558b833dc2f4da3a12d60..378769bcab756989361e1a03a7c03f11001d6c65 100644 (file)
--- a/src/console.pas
+++ b/src/console.pas
decodeInt(nextWord));\r
end;\r
else\r
- if com='RESET_BLOCKS' then\r
- begin\r
- resetBlocks(decodeInt(nextWord)+1);\r
- //addToLog('Max blocks: '+decodeInt(parsed_str[1]));\r
- end;\r
- else\r
- if com='SET_BLOCK' then\r
- begin\r
- setBlockData(decodeInt(nextWord),\r
- decodeInt(nextWord),\r
- decodeInt(nextWord),\r
- decodeInt(nextWord),\r
- decodeInt(nextWord),\r
- decodeInt(nextWord),\r
- decodeInt(nextWord),\r
- decodeInt(nextWord),\r
- decodeInt(nextWord));\r
- end;\r
- else\r
if com='RESET_TOOLS' then\r
begin\r
resetTools(decodeInt(nextWord)+1);\r
diff --git a/src/drop.mpsrc b/src/drop.mpsrc
index 3738c1203edcb140b779403ea72b7e3b604c70d6..e71dabf3172a829be870d735d9f191ebec16e069 100644 (file)
--- a/src/drop.mpsrc
+++ b/src/drop.mpsrc
procedure loadData;\r
\r
implementation\r
- uses phy, jsr75i, vars, items_store, func, Items;\r
+\r
+ uses phy, jsr75i, vars, items_store, func, ItemsLogic;\r
+\r
const\r
MAX_DROP=255;\r
DROP_W=8;\r
begin\r
if not drw_drp then exit;\r
for i:=0 to 255 do if IsNull(i) = false then begin\r
- Items.DrawSmall(drop_item[i], drop_x[i] - camx, drop_y[i] - camy);\r
+ ItemsLogic.DrawSmall(drop_item[i], drop_x[i] - camx, drop_y[i] - camy);\r
end;\r
end;\r
\r
diff --git a/src/func.mpsrc b/src/func.mpsrc
index bce8640e1089e1289ecb8bfd20d74d4e988f5501..1edb76fff251e27bdccf396df6ba65a86fcdd230 100644 (file)
--- a/src/func.mpsrc
+++ b/src/func.mpsrc
interface\r
function get_spawn_x:integer;//Возвращает блок по X где должен появиться игрок\r
function get_spawn_y:integer;//Возвращает блок по Y где должен появиться игрок\r
- procedure draw_block(xx,yy:integer);\r
(*\r
+ procedure draw_block(xx,yy:integer);\r
procedure drawSmallItem(item, x, y:integer);\r
procedure drawItem(item, sum, x, y:integer; indicator:boolean;);\r
*)\r
end;\r
*)\r
\r
+(*\r
procedure draw_block(xx,yy:integer);\r
begin\r
if (getmap(xx,yy)=123) or (getmap(xx,yy)=124) then\r
if getmap(xx,yy)<>0 then\r
drawimage(tex[getBlockTex(getmap(xx,yy))],(xx*16)-camx,(yy*16)-camy);\r
end;\r
+*)\r
\r
(*\r
procedure drawItem(item, sum, x, y:integer; indicator:boolean;);\r
diff --git a/src/invui.mpsrc b/src/invui.mpsrc
index 0fbac2e77077f4db39fe48f972ad7c4340fc6a11..3c4a8f06ed00e4508e00ddb11dfcfd87374c18f3 100644 (file)
--- a/src/invui.mpsrc
+++ b/src/invui.mpsrc
function WindowKeyHanler:boolean;\r
\r
implementation\r
- uses vars, CellUI, console, Canvas, utils, craft, furnace, func, items_store, player, keyboard, Items;\r
+\r
+ uses vars, CellUI, console, Canvas, utils, craft, furnace, func, items_store, player, keyboard, Items, ItemsLogic;\r
+\r
const\r
WINDOW_PLAYER_INV=1;\r
WINDOW_DIV_ITEMS=2;\r
for i:=0 to 1 do\r
for j:=0 to 1 do\r
begin\r
- Items.Draw(getCraftInItem(craftid, id), getCraftInSum(craftid, id), x+52+j*18, y+17+i*18, true);\r
+ ItemsLogic.Draw(getCraftInItem(craftid, id), getCraftInSum(craftid, id), x+52+j*18, y+17+i*18, true);\r
id:=id+1;\r
end;\r
\r
- Items.Draw(getCraftOutItem(craftid), getCraftOutSum(craftid), x+108, y+27, true);\r
+ ItemsLogic.Draw(getCraftOutItem(craftid), getCraftOutSum(craftid), x+108, y+27, true);\r
\r
i:=calcScrollBar(52, getImageHeight(fcScrollImg), MAX_FASTCRAFT_OFFSET, getOffset(0));\r
drawimage(fcScrollImg, x+156, y+66+i);\r
sum1:=GetWindowInfo(WINDOW_INFO_DIV_SUM1);\r
sum2:=GetWindowInfo(WINDOW_INFO_DIV_SUM2);\r
\r
- Items.Draw(item, (sum1-sum2), x+8, y+8, true);\r
- Items.Draw(item, sum2, x+64, y+8, true);\r
+ ItemsLogic.Draw(item, (sum1-sum2), x+8, y+8, true);\r
+ ItemsLogic.Draw(item, sum2, x+64, y+8, true);\r
\r
i:=calcScrollBar(72, getImageWidth(DivScrollImg), sum1, sum2);\r
\r
diff --git a/src/items_logic.mpsrc b/src/items_logic.mpsrc
index 84db3342d06b6dc5d9bee8e6a00abe704949010b..525f02dc3df91513b830952b08f65721292cc45b 100644 (file)
--- a/src/items_logic.mpsrc
+++ b/src/items_logic.mpsrc
else\r
if item=180 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
Mobs.Create(Mobs.zomby, x * 16, y * 16);\r
decItem(invcur);\r
else\r
if item=181 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(2, x*16, y*16);\r
decItem(invcur);\r
else\r
if item=182 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(3, x*16, y*16);\r
decItem(invcur);\r
else\r
if item=205 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(4, x*16, y*16);\r
decItem(invcur);\r
else\r
if item=206 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(5, x*16, y*16);\r
decItem(invcur);\r
else\r
if item=208 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(6, x*16, y*16);\r
decItem(invcur);\r
else\r
if item=209 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(7, x*16, y*16);\r
decItem(invcur);\r
else\r
if item=213 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(8, x*16, y*16);\r
decItem(invcur);\r
else\r
if item=212 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(10, x*16, y*16);\r
decItem(invcur);\r
if getmap(x, y+1)<>120 then\r
setMap(0, x, y);\r
\r
- if (info=0) and (getMap(x-1, y)=0) and (getBlockColl(getMap(x-1, y+1))>0) then\r
+ if (info=0) and (getMap(x-1, y)=0) and Blocks.IsSolid(getMap(x-1, y+1)) then\r
setmap(73, x-1, y);\r
\r
if (getMap(x-1, y)=73) and (getMapinfo(x, y)<>9) then\r
if getmap(x, y+1)<>120 then\r
setMap(0, x, y);\r
\r
- if (info=0) and (getMap(x-1, y)=0) and (getBlockColl(getMap(x-1, y+1))>0) then\r
+ if (info=0) and (getMap(x-1, y)=0) and Blocks.IsSolid(getMap(x-1, y+1)) then\r
setmap(66, x-1, y);\r
\r
if (getMap(x-1, y)=66) and (getMapinfo(x, y)<>9) then\r