From cd83cf5873e6e51080c7ab8f899c9960e6a69a66 Mon Sep 17 00:00:00 2001 From: Der1248 Date: Sun, 2 Jun 2019 18:01:52 +0200 Subject: [PATCH] Castrum 1.9.0 upload --- menu/Thumbs.db | Bin 28160 -> 28160 bytes mods/castrum/Chapter6.lua | 747 ++++++++ mods/castrum/fight.lua | 194 +- mods/castrum/init.lua | 1443 ++++++++++++--- mods/castrum/island_fight.lua | 1553 +++++++++++++++++ mods/castrum/models/castrum_canon_side_1.png | Bin 221 -> 400 bytes mods/castrum/models/castrum_canon_top_1.png | Bin 229 -> 400 bytes .../castrum/textures/castrum_fire_cannon1.png | Bin 0 -> 495 bytes .../castrum/textures/castrum_fire_cannon2.png | Bin 0 -> 505 bytes .../castrum/textures/castrum_fire_cannon3.png | Bin 0 -> 501 bytes .../castrum/textures/castrum_fire_cannon4.png | Bin 0 -> 489 bytes .../castrum/textures/castrum_fire_cannon5.png | Bin 0 -> 503 bytes mods/castrum/update.lua | 71 +- mods/dungeon_loot/mapgen.lua | 24 +- 14 files changed, 3648 insertions(+), 384 deletions(-) create mode 100644 mods/castrum/Chapter6.lua create mode 100644 mods/castrum/island_fight.lua create mode 100644 mods/castrum/textures/castrum_fire_cannon1.png create mode 100644 mods/castrum/textures/castrum_fire_cannon2.png create mode 100644 mods/castrum/textures/castrum_fire_cannon3.png create mode 100644 mods/castrum/textures/castrum_fire_cannon4.png create mode 100644 mods/castrum/textures/castrum_fire_cannon5.png diff --git a/menu/Thumbs.db b/menu/Thumbs.db index 9adfba5aadc7a299c0f0be2868dd60a2187f1028..d00db583d9de56f1e303a77083c2878a55f84a10 100644 GIT binary patch delta 66 zcmZp;!`N_#aYGIZ`-S!n#~8`0n~PcIGILahZ&%M<_|#&u1ji1Jw!-zU?`G}Xzd12S PgK-j<075{5>qRmEspA~I delta 66 zcmZp;!`N_#aYGIZdqZMKYtQv7n~PcIGIMZ7F19|vtGIu%1ji1JL#_e~woG1;wmC6J PgK-j<075{5>qRmEfPWgA diff --git a/mods/castrum/Chapter6.lua b/mods/castrum/Chapter6.lua new file mode 100644 index 0000000..19789ee --- /dev/null +++ b/mods/castrum/Chapter6.lua @@ -0,0 +1,747 @@ +local list = { + {1, {x=-173, y=9, z=-70},{x=-172, y=9, z=-70},2}, + {2, {x=-173, y=9, z=-62},{x=-172, y=9, z=-62},2}, + {3, {x=-171, y=9, z=-69},{x=-170, y=9, z=-69},2}, + {4, {x=-171, y=9, z=-63},{x=-170, y=9, z=-63},2}, + {5, {x=-170, y=9, z=-67},{x=-169, y=9, z=-67},2}, + {6, {x=-170, y=9, z=-65},{x=-169, y=9, z=-65},2}, + {7, {x=-174, y=9, z=-72},{x=-173, y=9, z=-72},2}, + {8, {x=-174, y=9, z=-60},{x=-173, y=9, z=-60},2}, + {9, {x=-172, y=9, z=-70},{x=-171, y=9, z=-71},2}, + {10, {x=-172, y=9, z=-62},{x=-171, y=9, z=-61},2}, + {11, {x=-172, y=9, z=-71},{x=-171, y=9, z=-72},2}, + {12, {x=-172, y=9, z=-61},{x=-171, y=9, z=-60},2}, + {13, {x=-172, y=9, z=-72},{x=-171, y=9, z=-73},2}, + {14, {x=-172, y=9, z=-60},{x=-171, y=9, z=-59},2}, + {15, {x=-173, y=9, z=-72},{x=-172, y=9, z=-73},2}, + {16, {x=-173, y=9, z=-60},{x=-172, y=9, z=-59},2}, + {17, {x=-174, y=9, z=-73},{x=-173, y=9, z=-74},2}, + {18, {x=-174, y=9, z=-59},{x=-173, y=9, z=-58},2}, + {19, {x=-172, y=9, z=-73},{x=-171, y=9, z=-74},2}, + {20, {x=-172, y=9, z=-59},{x=-171, y=9, z=-58},2}, + {21, {x=-173, y=9, z=-74},{x=-172, y=9, z=-75},2}, + {22, {x=-173, y=9, z=-58},{x=-172, y=9, z=-57},2}, + {23, {x=-171, y=9, z=-72},{x=-170, y=9, z=-72},2}, + {24, {x=-171, y=9, z=-60},{x=-170, y=9, z=-60},2}, + {25, {x=-171, y=9, z=-71},{x=-170, y=9, z=-71},2}, + {26, {x=-171, y=9, z=-61},{x=-170, y=9, z=-61},2}, + {27, {x=-170, y=9, z=-70},{x=-169, y=9, z=-70},2}, + {28, {x=-170, y=9, z=-62},{x=-169, y=9, z=-62},2}, + {29, {x=-170, y=9, z=-69},{x=-169, y=9, z=-69},2}, + {30, {x=-170, y=9, z=-63},{x=-169, y=9, z=-63},2}, + {31, {x=-169, y=9, z=-68},{x=-168, y=9, z=-68},2}, + {32, {x=-169, y=9, z=-64},{x=-168, y=9, z=-64},2}, + {33, {x=-169, y=9, z=-67},{x=-168, y=9, z=-67},2}, + {34, {x=-169, y=9, z=-65},{x=-168, y=9, z=-65},2}, + {35, {x=-168, y=9, z=-66},{x=-167, y=9, z=-66},2}, + {36, {x=-172, y=9, z=-75},{x=-171, y=9, z=-76},2}, + {37, {x=-172, y=9, z=-57},{x=-171, y=9, z=-56},2}, + {38, {x=-171, y=9, z=-74},{x=-170, y=9, z=-74},2}, + {39, {x=-171, y=9, z=-58},{x=-170, y=9, z=-58},2}, + {40, {x=-171, y=9, z=-73},{x=-170, y=9, z=-73},2}, + {41, {x=-171, y=9, z=-59},{x=-170, y=9, z=-59},2}, + {42, {x=-170, y=9, z=-72},{x=-169, y=9, z=-72},2}, + {43, {x=-170, y=9, z=-60},{x=-169, y=9, z=-60},2}, + {44, {x=-170, y=9, z=-71},{x=-169, y=9, z=-71},2}, + {45, {x=-170, y=9, z=-61},{x=-169, y=9, z=-61},2}, + {46, {x=-169, y=9, z=-70},{x=-168, y=9, z=-70},2}, + {47, {x=-169, y=9, z=-62},{x=-168, y=9, z=-62},2}, + {48, {x=-169, y=9, z=-69},{x=-168, y=9, z=-69},2}, + {49, {x=-169, y=9, z=-63},{x=-168, y=9, z=-63},2}, + {50, {x=-168, y=9, z=-68},{x=-167, y=9, z=-68},2}, + {51, {x=-168, y=9, z=-64},{x=-167, y=9, z=-64},2}, + {52, {x=-168, y=9, z=-67},{x=-167, y=9, z=-67},2}, + {53, {x=-168, y=9, z=-65},{x=-167, y=9, z=-65},2}, + {54, {x=-167, y=9, z=-66},{x=-166, y=9, z=-66},2}, + {55, {x=-171, y=9, z=-76},{x=-170, y=9, z=-77},2}, + {56, {x=-171, y=9, z=-56},{x=-170, y=9, z=-55},2}, + {57, {x=-170, y=9, z=-74},{x=-169, y=9, z=-75},2}, + {58, {x=-170, y=9, z=-58},{x=-169, y=9, z=-57},2}, + {59, {x=-170, y=9, z=-73},{x=-169, y=9, z=-73},2}, + {60, {x=-170, y=9, z=-59},{x=-169, y=9, z=-59},2}, + {61, {x=-169, y=9, z=-72},{x=-168, y=9, z=-72},2}, + {62, {x=-169, y=9, z=-60},{x=-168, y=9, z=-60},2}, + {63, {x=-169, y=9, z=-71},{x=-168, y=9, z=-71},2}, + {64, {x=-169, y=9, z=-61},{x=-168, y=9, z=-61},2}, + {65, {x=-168, y=9, z=-70},{x=-167, y=9, z=-70},2}, + {66, {x=-168, y=9, z=-62},{x=-167, y=9, z=-62},2}, + {67, {x=-168, y=9, z=-69},{x=-167, y=9, z=-69},2}, + {68, {x=-168, y=9, z=-63},{x=-167, y=9, z=-63},2}, + {69, {x=-167, y=9, z=-68},{x=-166, y=9, z=-68},2}, + {70, {x=-167, y=9, z=-64},{x=-166, y=9, z=-64},2}, + {71, {x=-167, y=9, z=-67},{x=-166, y=9, z=-67},2}, + {72, {x=-167, y=9, z=-65},{x=-166, y=9, z=-65},2}, + {73, {x=-166, y=9, z=-66},{x=-165, y=9, z=-66},2}, + {74, {x=-170, y=9, z=-77},{x=-169, y=9, z=-78},2}, + {75, {x=-170, y=9, z=-55},{x=-169, y=9, z=-54},2}, + {76, {x=-169, y=9, z=-75},{x=-168, y=9, z=-76},2}, + {77, {x=-169, y=9, z=-57},{x=-168, y=9, z=-56},2}, + {78, {x=-169, y=9, z=-73},{x=-168, y=9, z=-74},2}, + {79, {x=-169, y=9, z=-59},{x=-168, y=9, z=-58},2}, + {80, {x=-168, y=9, z=-72},{x=-167, y=9, z=-72},2}, + {81, {x=-168, y=9, z=-60},{x=-167, y=9, z=-60},2}, + {82, {x=-169, y=9, z=-75},{x=-168, y=9, z=-75},2}, + {83, {x=-169, y=9, z=-57},{x=-168, y=9, z=-57},2}, + {84, {x=-168, y=9, z=-73},{x=-167, y=9, z=-73},2}, + {85, {x=-168, y=9, z=-59},{x=-167, y=9, z=-59},2}, + {86, {x=-168, y=9, z=-71},{x=-167, y=9, z=-71},2}, + {87, {x=-168, y=9, z=-61},{x=-167, y=9, z=-61},2}, + {88, {x=-167, y=9, z=-70},{x=-166, y=9, z=-70},2}, + {89, {x=-167, y=9, z=-62},{x=-166, y=9, z=-62},2}, + {90, {x=-167, y=9, z=-69},{x=-166, y=9, z=-69},2}, + {91, {x=-167, y=9, z=-63},{x=-166, y=9, z=-63},2}, + {92, {x=-166, y=9, z=-68},{x=-165, y=9, z=-68},2}, + {93, {x=-166, y=9, z=-64},{x=-165, y=9, z=-64},2}, + {94, {x=-166, y=9, z=-67},{x=-165, y=9, z=-67},2}, + {95, {x=-166, y=9, z=-65},{x=-165, y=9, z=-65},2}, + {96, {x=-165, y=9, z=-66},{x=-164, y=9, z=-66},2}, + {97, {x=-169, y=9, z=-78},{x=-168, y=9, z=-79},2}, + {98, {x=-169, y=9, z=-54},{x=-168, y=9, z=-53},2}, + {99, {x=-168, y=9, z=-76},{x=-167, y=9, z=-77},2}, + {100, {x=-168, y=9, z=-56},{x=-167, y=9, z=-55},2}, + {101, {x=-168, y=9, z=-74},{x=-167, y=9, z=-75},2}, + {102, {x=-168, y=9, z=-58},{x=-167, y=9, z=-57},2}, + {103, {x=-168, y=9, z=-76},{x=-167, y=9, z=-77},2}, + {104, {x=-168, y=9, z=-56},{x=-167, y=9, z=-55},2}, + {105, {x=-167, y=9, z=-74},{x=-166, y=9, z=-75},2}, + {106, {x=-167, y=9, z=-58},{x=-166, y=9, z=-57},2}, + {107, {x=-167, y=9, z=-72},{x=-166, y=9, z=-73},2}, + {108, {x=-167, y=9, z=-60},{x=-166, y=9, z=-59},2}, + {109, {x=-167, y=9, z=-71},{x=-166, y=9, z=-71},2}, + {110, {x=-167, y=9, z=-61},{x=-166, y=9, z=-61},2}, + {111, {x=-166, y=9, z=-70},{x=-165, y=9, z=-70},2}, + {112, {x=-166, y=9, z=-62},{x=-165, y=9, z=-62},2}, + {113, {x=-166, y=9, z=-69},{x=-165, y=9, z=-69},2}, + {114, {x=-166, y=9, z=-63},{x=-165, y=9, z=-63},2}, + {115, {x=-165, y=9, z=-68},{x=-164, y=9, z=-68},2}, + {116, {x=-165, y=9, z=-64},{x=-164, y=9, z=-64},2}, + {117, {x=-165, y=9, z=-67},{x=-164, y=9, z=-67},2}, + {118, {x=-165, y=9, z=-65},{x=-164, y=9, z=-65},2}, + {119, {x=-164, y=9, z=-66},{x=-163, y=9, z=-66},2}, + {120, {x=-168, y=9, z=-79},{x=-167, y=9, z=-80},2}, + {121, {x=-168, y=9, z=-53},{x=-167, y=9, z=-52},2}, + {122, {x=-167, y=9, z=-77},{x=-166, y=9, z=-78},2}, + {123, {x=-167, y=9, z=-55},{x=-166, y=9, z=-54},2}, + {124, {x=-167, y=9, z=-75},{x=-166, y=9, z=-76},2}, + {125, {x=-167, y=9, z=-57},{x=-166, y=9, z=-56},2}, + {126, {x=-166, y=9, z=-73},{x=-165, y=9, z=-74},2}, + {127, {x=-166, y=9, z=-59},{x=-165, y=9, z=-58},2}, + {128, {x=-166, y=9, z=-71},{x=-165, y=9, z=-72},2}, + {129, {x=-166, y=9, z=-61},{x=-165, y=9, z=-60},2}, + {130, {x=-165, y=9, z=-70},{x=-164, y=9, z=-70},2}, + {131, {x=-165, y=9, z=-62},{x=-164, y=9, z=-62},2}, + {132, {x=-165, y=9, z=-69},{x=-164, y=9, z=-69},2}, + {133, {x=-165, y=9, z=-63},{x=-164, y=9, z=-63},2}, + {134, {x=-164, y=9, z=-68},{x=-163, y=9, z=-68},2}, + {135, {x=-164, y=9, z=-64},{x=-163, y=9, z=-64},2}, + {136, {x=-164, y=9, z=-67},{x=-163, y=9, z=-67},2}, + {137, {x=-164, y=9, z=-65},{x=-163, y=9, z=-65},2}, + {138, {x=-163, y=9, z=-66},{x=-162, y=9, z=-66},2}, + {139, {x=-167, y=9, z=-80},{x=-166, y=9, z=-81},2}, + {140, {x=-167, y=9, z=-52},{x=-166, y=9, z=-51},2}, + {141, {x=-166, y=9, z=-78},{x=-165, y=9, z=-79},2}, + {142, {x=-166, y=9, z=-54},{x=-165, y=9, z=-53},2}, + {143, {x=-166, y=9, z=-76},{x=-165, y=9, z=-77},2}, + {144, {x=-166, y=9, z=-56},{x=-165, y=9, z=-55},2}, + {145, {x=-165, y=9, z=-74},{x=-164, y=9, z=-75},2}, + {146, {x=-165, y=9, z=-58},{x=-164, y=9, z=-57},2}, + {147, {x=-165, y=9, z=-72},{x=-164, y=9, z=-73},2}, + {148, {x=-165, y=9, z=-60},{x=-164, y=9, z=-59},2}, + {149, {x=-164, y=9, z=-70},{x=-163, y=9, z=-71},2}, + {150, {x=-164, y=9, z=-62},{x=-163, y=9, z=-61},2}, + {151, {x=-164, y=9, z=-69},{x=-163, y=9, z=-69},2}, + {152, {x=-164, y=9, z=-63},{x=-163, y=9, z=-63},2}, + {153, {x=-163, y=9, z=-68},{x=-162, y=9, z=-68},2}, + {154, {x=-163, y=9, z=-64},{x=-162, y=9, z=-64},2}, + {155, {x=-163, y=9, z=-67},{x=-162, y=9, z=-67},2}, + {156, {x=-163, y=9, z=-65},{x=-162, y=9, z=-65},2}, + {157, {x=-162, y=9, z=-66},{x=-161, y=9, z=-66},2}, + {158, {x=-166, y=9, z=-81},{x=-165, y=9, z=-81},2}, + {159, {x=-166, y=9, z=-51},{x=-165, y=9, z=-51},2}, + {160, {x=-165, y=9, z=-79},{x=-164, y=9, z=-79},2}, + {161, {x=-165, y=9, z=-53},{x=-164, y=9, z=-53},2}, + {162, {x=-165, y=9, z=-77},{x=-164, y=9, z=-78},2}, + {163, {x=-165, y=9, z=-55},{x=-164, y=9, z=-54},2}, + {164, {x=-164, y=9, z=-75},{x=-163, y=9, z=-76},2}, + {165, {x=-164, y=9, z=-57},{x=-163, y=9, z=-56},2}, + {166, {x=-164, y=9, z=-73},{x=-163, y=9, z=-74},2}, + {167, {x=-164, y=9, z=-59},{x=-163, y=9, z=-58},2}, + {168, {x=-163, y=9, z=-71},{x=-162, y=9, z=-72},2}, + {169, {x=-163, y=9, z=-61},{x=-162, y=9, z=-60},2}, + {170, {x=-163, y=9, z=-69},{x=-162, y=9, z=-70},2}, + {171, {x=-163, y=9, z=-63},{x=-162, y=9, z=-62},2}, + {172, {x=-162, y=9, z=-68},{x=-161, y=9, z=-68},2}, + {173, {x=-162, y=9, z=-64},{x=-161, y=9, z=-64},2}, + {174, {x=-162, y=9, z=-67},{x=-161, y=9, z=-67},2}, + {175, {x=-162, y=9, z=-65},{x=-161, y=9, z=-65},2}, + {176, {x=-161, y=9, z=-66},{x=-160, y=9, z=-66},2}, + {177, {x=-165, y=9, z=-81},{x=-164, y=9, z=-81},2}, + {178, {x=-165, y=9, z=-51},{x=-164, y=9, z=-51},2}, + {179, {x=-164, y=9, z=-79},{x=-163, y=9, z=-79},2}, + {180, {x=-164, y=9, z=-53},{x=-163, y=9, z=-53},2}, + {181, {x=-164, y=9, z=-78},{x=-163, y=9, z=-78},2}, + {182, {x=-164, y=9, z=-54},{x=-163, y=9, z=-54},2}, + {183, {x=-163, y=9, z=-76},{x=-162, y=9, z=-76},2}, + {184, {x=-163, y=9, z=-56},{x=-162, y=9, z=-56},2}, + {185, {x=-163, y=9, z=-74},{x=-162, y=9, z=-74},2}, + {186, {x=-163, y=9, z=-58},{x=-162, y=9, z=-58},2}, + {187, {x=-162, y=9, z=-72},{x=-161, y=9, z=-73},2}, + {188, {x=-162, y=9, z=-60},{x=-161, y=9, z=-59},2}, + {189, {x=-162, y=9, z=-70},{x=-161, y=9, z=-71},2}, + {190, {x=-162, y=9, z=-62},{x=-161, y=9, z=-61},2}, + {191, {x=-161, y=9, z=-68},{x=-160, y=9, z=-69},2}, + {192, {x=-161, y=9, z=-64},{x=-160, y=9, z=-63},2}, + {193, {x=-161, y=9, z=-67},{x=-160, y=9, z=-67},2}, + {194, {x=-161, y=9, z=-65},{x=-160, y=9, z=-65},2}, + {195, {x=-160, y=9, z=-66},{x=-159, y=9, z=-66},2}, + {196, {x=-164, y=9, z=-81},{x=-163, y=9, z=-81},2}, + {197, {x=-164, y=9, z=-51},{x=-163, y=9, z=-51},2}, + {198, {x=-163, y=9, z=-79},{x=-162, y=9, z=-79},2}, + {199, {x=-163, y=9, z=-53},{x=-162, y=9, z=-53},2}, + {200, {x=-163, y=9, z=-78},{x=-162, y=9, z=-78},2}, + {201, {x=-163, y=9, z=-54},{x=-162, y=9, z=-54},2}, + {202, {x=-162, y=9, z=-76},{x=-161, y=9, z=-76},2}, + {203, {x=-162, y=9, z=-56},{x=-161, y=9, z=-56},2}, + {204, {x=-162, y=9, z=-74},{x=-161, y=9, z=-74},2}, + {205, {x=-162, y=9, z=-58},{x=-161, y=9, z=-58},2}, + {206, {x=-161, y=9, z=-73},{x=-160, y=9, z=-73},2}, + {207, {x=-161, y=9, z=-59},{x=-160, y=9, z=-59},2}, + {208, {x=-161, y=9, z=-71},{x=-160, y=9, z=-71},2}, + {209, {x=-161, y=9, z=-61},{x=-160, y=9, z=-61},2}, + {210, {x=-160, y=9, z=-69},{x=-159, y=9, z=-69},2}, + {211, {x=-160, y=9, z=-63},{x=-159, y=9, z=-63},2}, + {212, {x=-160, y=9, z=-67},{x=-159, y=9, z=-68},2}, + {213, {x=-160, y=9, z=-65},{x=-159, y=9, z=-64},2}, + {214, {x=-159, y=9, z=-66},{x=-158, y=9, z=-66},2}, + {215, {x=-163, y=9, z=-81},{x=-162, y=9, z=-81},2}, + {216, {x=-163, y=9, z=-51},{x=-162, y=9, z=-51},2}, + {217, {x=-162, y=9, z=-79},{x=-161, y=9, z=-79},2}, + {218, {x=-162, y=9, z=-53},{x=-161, y=9, z=-53},2}, + {219, {x=-162, y=9, z=-78},{x=-161, y=9, z=-78},2}, + {220, {x=-162, y=9, z=-54},{x=-161, y=9, z=-54},2}, + {221, {x=-161, y=9, z=-76},{x=-160, y=9, z=-76},2}, + {222, {x=-161, y=9, z=-56},{x=-160, y=9, z=-56},2}, + {223, {x=-161, y=9, z=-74},{x=-160, y=9, z=-74},2}, + {224, {x=-161, y=9, z=-58},{x=-160, y=9, z=-58},2}, + {225, {x=-160, y=9, z=-73},{x=-159, y=9, z=-73},2}, + {226, {x=-160, y=9, z=-59},{x=-159, y=9, z=-59},2}, + {227, {x=-160, y=9, z=-71},{x=-159, y=9, z=-71},2}, + {228, {x=-160, y=9, z=-61},{x=-159, y=9, z=-61},2}, + {229, {x=-159, y=9, z=-69},{x=-158, y=9, z=-69},2}, + {230, {x=-159, y=9, z=-63},{x=-158, y=9, z=-63},2}, + {231, {x=-159, y=9, z=-68},{x=-158, y=9, z=-68},2}, + {232, {x=-159, y=9, z=-64},{x=-158, y=9, z=-64},2}, + {233, {x=-162, y=9, z=-81},{x=-161, y=9, z=-81},2}, + {234, {x=-162, y=9, z=-51},{x=-161, y=9, z=-51},2}, + {235, {x=-161, y=9, z=-79},{x=-160, y=9, z=-79},2}, + {236, {x=-161, y=9, z=-53},{x=-160, y=9, z=-53},2}, + {237, {x=-161, y=9, z=-78},{x=-160, y=9, z=-78},2}, + {238, {x=-161, y=9, z=-54},{x=-160, y=9, z=-54},2}, + {239, {x=-160, y=9, z=-76},{x=-159, y=9, z=-76},2}, + {240, {x=-160, y=9, z=-56},{x=-159, y=9, z=-56},2}, + {241, {x=-160, y=9, z=-74},{x=-159, y=9, z=-74},2}, + {242, {x=-160, y=9, z=-58},{x=-159, y=9, z=-58},2}, + {243, {x=-159, y=9, z=-73},{x=-158, y=9, z=-73},2}, + {244, {x=-159, y=9, z=-59},{x=-158, y=9, z=-59},2}, + {245, {x=-159, y=9, z=-71},{x=-158, y=9, z=-71},2}, + {246, {x=-159, y=9, z=-61},{x=-158, y=9, z=-61},2}, + {247, {x=-161, y=9, z=-81},{x=-160, y=9, z=-81},2}, + {248, {x=-161, y=9, z=-51},{x=-160, y=9, z=-51},2}, + {249, {x=-160, y=9, z=-79},{x=-159, y=9, z=-79},2}, + {250, {x=-160, y=9, z=-53},{x=-159, y=9, z=-53},2}, + {251, {x=-160, y=9, z=-78},{x=-159, y=9, z=-78},2}, + {252, {x=-160, y=9, z=-54},{x=-159, y=9, z=-54},2}, + {253, {x=-159, y=9, z=-76},{x=-158, y=9, z=-76},2}, + {254, {x=-159, y=9, z=-56},{x=-158, y=9, z=-56},2}, + {255, {x=-159, y=9, z=-74},{x=-158, y=9, z=-74},2}, + {256, {x=-159, y=9, z=-58},{x=-158, y=9, z=-58},2}, + {257, {x=-160, y=9, z=-81},{x=-159, y=9, z=-81},2}, + {258, {x=-160, y=9, z=-51},{x=-159, y=9, z=-51},2}, + {259, {x=-159, y=9, z=-79},{x=-158, y=9, z=-79},2}, + {260, {x=-159, y=9, z=-53},{x=-158, y=9, z=-53},2}, + {261, {x=-159, y=9, z=-78},{x=-158, y=9, z=-78},2}, + {262, {x=-159, y=9, z=-54},{x=-158, y=9, z=-54},2}, + {263, {x=-159, y=9, z=-81},{x=-158, y=9, z=-81},2}, + {264, {x=-159, y=9, z=-51},{x=-158, y=9, z=-51},2}, + {265, {x=-158, y=9, z=-81},{x=-157, y=9, z=-81},2}, + {266, {x=-158, y=9, z=-51},{x=-157, y=9, z=-51},2}, + {267, {x=-157, y=9, z=-81},{x=-156, y=9, z=-80},2}, + {268, {x=-157, y=9, z=-51},{x=-156, y=9, z=-52},2}, + {269, {x=-158, y=9, z=-79},{x=-157, y=9, z=-79},2}, + {270, {x=-158, y=9, z=-53},{x=-157, y=9, z=-53},2}, + {271, {x=-158, y=9, z=-78},{x=-157, y=9, z=-78},2}, + {272, {x=-158, y=9, z=-54},{x=-157, y=9, z=-54},2}, + {273, {x=-156, y=9, z=-80},{x=-155, y=9, z=-80},2}, + {274, {x=-156, y=9, z=-52},{x=-155, y=9, z=-52},2}, + {275, {x=-157, y=9, z=-79},{x=-156, y=9, z=-79},2}, + {276, {x=-157, y=9, z=-53},{x=-156, y=9, z=-53},2}, + {277, {x=-157, y=9, z=-78},{x=-156, y=9, z=-78},2}, + {278, {x=-157, y=9, z=-54},{x=-156, y=9, z=-54},2}, + {279, {x=-158, y=9, z=-76},{x=-157, y=9, z=-76},2}, + {280, {x=-158, y=9, z=-56},{x=-157, y=9, z=-56},2}, + {281, {x=-158, y=9, z=-74},{x=-157, y=9, z=-74},2}, + {282, {x=-158, y=9, z=-58},{x=-157, y=9, z=-58},2}, + {283, {x=-155, y=9, z=-80},{x=-154, y=9, z=-79},2}, + {284, {x=-155, y=9, z=-52},{x=-154, y=9, z=-53},2}, + {285, {x=-156, y=9, z=-79},{x=-155, y=9, z=-78},2}, + {286, {x=-156, y=9, z=-53},{x=-155, y=9, z=-54},2}, + {287, {x=-156, y=9, z=-78},{x=-155, y=9, z=-77},2}, + {288, {x=-156, y=9, z=-54},{x=-155, y=9, z=-55},2}, + {289, {x=-157, y=9, z=-76},{x=-156, y=9, z=-76},2}, + {290, {x=-157, y=9, z=-56},{x=-156, y=9, z=-56},2}, + {291, {x=-157, y=9, z=-74},{x=-156, y=9, z=-74},2}, + {292, {x=-157, y=9, z=-58},{x=-156, y=9, z=-58},2}, + {293, {x=-158, y=9, z=-73},{x=-157, y=9, z=-73},2}, + {294, {x=-158, y=9, z=-59},{x=-157, y=9, z=-59},2}, + {295, {x=-158, y=9, z=-71},{x=-157, y=9, z=-71},2}, + {296, {x=-158, y=9, z=-61},{x=-157, y=9, z=-61},2}, + {297, {x=-154, y=9, z=-79},{x=-153, y=9, z=-79},2}, + {298, {x=-154, y=9, z=-53},{x=-153, y=9, z=-53},2}, + {299, {x=-155, y=9, z=-78},{x=-154, y=9, z=-78},2}, + {300, {x=-155, y=9, z=-54},{x=-154, y=9, z=-54},2}, + {301, {x=-155, y=9, z=-77},{x=-154, y=9, z=-77},2}, + {302, {x=-155, y=9, z=-55},{x=-154, y=9, z=-55},2}, + {303, {x=-156, y=9, z=-76},{x=-155, y=9, z=-76},2}, + {304, {x=-156, y=9, z=-56},{x=-155, y=9, z=-56},2}, + {305, {x=-156, y=9, z=-74},{x=-155, y=9, z=-74},2}, + {306, {x=-156, y=9, z=-58},{x=-155, y=9, z=-58},2}, + {307, {x=-157, y=9, z=-73},{x=-156, y=9, z=-73},2}, + {308, {x=-157, y=9, z=-59},{x=-156, y=9, z=-59},2}, + {309, {x=-157, y=9, z=-71},{x=-156, y=9, z=-71},2}, + {310, {x=-157, y=9, z=-61},{x=-156, y=9, z=-61},2}, + {311, {x=-158, y=9, z=-69},{x=-157, y=9, z=-69},2}, + {312, {x=-158, y=9, z=-63},{x=-157, y=9, z=-63},2}, + {313, {x=-158, y=9, z=-68},{x=-157, y=9, z=-68},2}, + {314, {x=-158, y=9, z=-64},{x=-157, y=9, z=-64},2}, + {315, {x=-153, y=9, z=-79},{x=-152, y=9, z=-78},2}, + {316, {x=-153, y=9, z=-53},{x=-152, y=9, z=-54},2}, + {317, {x=-154, y=9, z=-78},{x=-153, y=9, z=-77},2}, + {318, {x=-154, y=9, z=-54},{x=-153, y=9, z=-55},2}, + {319, {x=-154, y=9, z=-77},{x=-153, y=9, z=-76},2}, + {320, {x=-154, y=9, z=-55},{x=-153, y=9, z=-56},2}, + {321, {x=-155, y=9, z=-76},{x=-154, y=9, z=-75},2}, + {322, {x=-155, y=9, z=-56},{x=-154, y=9, z=-57},2}, + {323, {x=-155, y=9, z=-74},{x=-154, y=9, z=-74},2}, + {324, {x=-155, y=9, z=-58},{x=-154, y=9, z=-58},2}, + {325, {x=-156, y=9, z=-73},{x=-155, y=9, z=-73},2}, + {326, {x=-156, y=9, z=-59},{x=-155, y=9, z=-59},2}, + {327, {x=-156, y=9, z=-71},{x=-155, y=9, z=-71},2}, + {328, {x=-156, y=9, z=-61},{x=-155, y=9, z=-61},2}, + {329, {x=-157, y=9, z=-69},{x=-156, y=9, z=-69},2}, + {330, {x=-157, y=9, z=-63},{x=-156, y=9, z=-63},2}, + {331, {x=-157, y=9, z=-68},{x=-156, y=9, z=-68},2}, + {332, {x=-157, y=9, z=-64},{x=-156, y=9, z=-64},2}, + {333, {x=-158, y=9, z=-66},{x=-157, y=9, z=-66},2}, + {334, {x=-152, y=9, z=-78},{x=-151, y=9, z=-78},2}, + {335, {x=-152, y=9, z=-54},{x=-151, y=9, z=-54},2}, + {336, {x=-153, y=9, z=-77},{x=-152, y=9, z=-77},2}, + {337, {x=-153, y=9, z=-55},{x=-152, y=9, z=-55},2}, + {338, {x=-151, y=9, z=-78},{x=-150, y=9, z=-77},2}, + {339, {x=-151, y=9, z=-54},{x=-150, y=9, z=-55},2}, + {340, {x=-152, y=9, z=-77},{x=-151, y=9, z=-76},2}, + {341, {x=-152, y=9, z=-55},{x=-151, y=9, z=-56},2}, + {342, {x=-153, y=9, z=-76},{x=-152, y=9, z=-75},2}, + {343, {x=-153, y=9, z=-56},{x=-152, y=9, z=-57},2}, + {344, {x=-154, y=9, z=-75},{x=-153, y=9, z=-74},2}, + {345, {x=-154, y=9, z=-57},{x=-153, y=9, z=-58},2}, + {346, {x=-154, y=9, z=-74},{x=-153, y=9, z=-73},2}, + {347, {x=-154, y=9, z=-58},{x=-153, y=9, z=-59},2}, + {348, {x=-155, y=9, z=-73},{x=-154, y=9, z=-72},2}, + {349, {x=-155, y=9, z=-59},{x=-154, y=9, z=-60},2}, + {350, {x=-155, y=9, z=-71},{x=-154, y=9, z=-71},2}, + {351, {x=-155, y=9, z=-61},{x=-154, y=9, z=-61},2}, + {352, {x=-156, y=9, z=-69},{x=-155, y=9, z=-69},2}, + {353, {x=-156, y=9, z=-63},{x=-155, y=9, z=-63},2}, + {354, {x=-156, y=9, z=-68},{x=-155, y=9, z=-68},2}, + {355, {x=-156, y=9, z=-64},{x=-155, y=9, z=-64},2}, + {356, {x=-157, y=9, z=-66},{x=-156, y=9, z=-66},2}, + {357, {x=-150, y=9, z=-77},{x=-149, y=9, z=-77},2}, + {358, {x=-150, y=9, z=-55},{x=-149, y=9, z=-55},2}, + {359, {x=-151, y=9, z=-76},{x=-150, y=9, z=-76},2}, + {360, {x=-151, y=9, z=-56},{x=-150, y=9, z=-56},2}, + {361, {x=-152, y=9, z=-75},{x=-151, y=9, z=-75},2}, + {362, {x=-152, y=9, z=-57},{x=-151, y=9, z=-57},2}, + {363, {x=-153, y=9, z=-74},{x=-152, y=9, z=-74},2}, + {364, {x=-153, y=9, z=-58},{x=-152, y=9, z=-58},2}, + {365, {x=-149, y=9, z=-77},{x=-148, y=9, z=-76},2}, + {366, {x=-149, y=9, z=-55},{x=-148, y=9, z=-56},2}, + {367, {x=-150, y=9, z=-76},{x=-149, y=9, z=-75},2}, + {368, {x=-150, y=9, z=-56},{x=-149, y=9, z=-57},2}, + {369, {x=-151, y=9, z=-75},{x=-150, y=9, z=-74},2}, + {370, {x=-151, y=9, z=-57},{x=-150, y=9, z=-58},2}, + {371, {x=-152, y=9, z=-74},{x=-151, y=9, z=-73},2}, + {372, {x=-152, y=9, z=-58},{x=-151, y=9, z=-59},2}, + {373, {x=-153, y=9, z=-73},{x=-152, y=9, z=-72},2}, + {374, {x=-153, y=9, z=-59},{x=-152, y=9, z=-60},2}, + {375, {x=-154, y=9, z=-72},{x=-153, y=9, z=-71},2}, + {376, {x=-154, y=9, z=-60},{x=-153, y=9, z=-61},2}, + {377, {x=-154, y=9, z=-71},{x=-153, y=9, z=-70},2}, + {378, {x=-154, y=9, z=-61},{x=-153, y=9, z=-62},2}, + {379, {x=-155, y=9, z=-69},{x=-154, y=9, z=-69},2}, + {380, {x=-155, y=9, z=-63},{x=-154, y=9, z=-63},2}, + {381, {x=-155, y=9, z=-68},{x=-154, y=9, z=-68},2}, + {382, {x=-155, y=9, z=-64},{x=-154, y=9, z=-64},2}, + {383, {x=-156, y=9, z=-66},{x=-155, y=9, z=-66},2}, + {384, {x=-148, y=9, z=-76},{x=-147, y=9, z=-76},2}, + {385, {x=-148, y=9, z=-56},{x=-147, y=9, z=-56},2}, + {386, {x=-149, y=9, z=-75},{x=-148, y=9, z=-75},2}, + {387, {x=-149, y=9, z=-57},{x=-148, y=9, z=-57},2}, + {388, {x=-150, y=9, z=-74},{x=-149, y=9, z=-74},2}, + {389, {x=-150, y=9, z=-58},{x=-149, y=9, z=-58},2}, + {390, {x=-151, y=9, z=-73},{x=-150, y=9, z=-73},2}, + {391, {x=-151, y=9, z=-59},{x=-150, y=9, z=-59},2}, + {392, {x=-152, y=9, z=-72},{x=-151, y=9, z=-72},2}, + {393, {x=-152, y=9, z=-60},{x=-151, y=9, z=-60},2}, + {394, {x=-153, y=9, z=-71},{x=-152, y=9, z=-71},2}, + {395, {x=-153, y=9, z=-61},{x=-152, y=9, z=-61},2}, + {396, {x=-147, y=9, z=-76},{x=-146, y=9, z=-75},2}, + {397, {x=-147, y=9, z=-56},{x=-146, y=9, z=-57},2}, + {398, {x=-148, y=9, z=-75},{x=-147, y=9, z=-74},2}, + {399, {x=-148, y=9, z=-57},{x=-147, y=9, z=-58},2}, + {400, {x=-149, y=9, z=-74},{x=-148, y=9, z=-73},2}, + {401, {x=-149, y=9, z=-58},{x=-148, y=9, z=-59},2}, + {402, {x=-150, y=9, z=-73},{x=-149, y=9, z=-72},2}, + {403, {x=-150, y=9, z=-59},{x=-149, y=9, z=-60},2}, + {404, {x=-151, y=9, z=-72},{x=-150, y=9, z=-71},2}, + {405, {x=-151, y=9, z=-60},{x=-150, y=9, z=-61},2}, + {406, {x=-152, y=9, z=-71},{x=-151, y=9, z=-70},2}, + {407, {x=-152, y=9, z=-61},{x=-151, y=9, z=-62},2}, + {408, {x=-153, y=9, z=-70},{x=-152, y=9, z=-69},2}, + {409, {x=-153, y=9, z=-62},{x=-152, y=9, z=-63},2}, + {410, {x=-154, y=9, z=-69},{x=-153, y=9, z=-68},2}, + {411, {x=-154, y=9, z=-63},{x=-153, y=9, z=-64},2}, + {412, {x=-154, y=9, z=-68},{x=-153, y=9, z=-67},2}, + {413, {x=-154, y=9, z=-64},{x=-153, y=9, z=-65},2}, + {414, {x=-155, y=9, z=-66},{x=-154, y=9, z=-66},2}, + {415, {x=-146, y=9, z=-75},{x=-145, y=9, z=-75},2}, + {416, {x=-146, y=9, z=-57},{x=-145, y=9, z=-57},2}, + {417, {x=-147, y=9, z=-74},{x=-146, y=9, z=-74},2}, + {418, {x=-147, y=9, z=-58},{x=-146, y=9, z=-58},2}, + {419, {x=-148, y=9, z=-73},{x=-147, y=9, z=-73},2}, + {420, {x=-148, y=9, z=-59},{x=-147, y=9, z=-59},2}, + {421, {x=-149, y=9, z=-72},{x=-148, y=9, z=-72},2}, + {422, {x=-149, y=9, z=-60},{x=-148, y=9, z=-60},2}, + {423, {x=-150, y=9, z=-71},{x=-149, y=9, z=-71},2}, + {424, {x=-150, y=9, z=-61},{x=-149, y=9, z=-61},2}, + {425, {x=-151, y=9, z=-70},{x=-150, y=9, z=-70},2}, + {426, {x=-151, y=9, z=-62},{x=-150, y=9, z=-62},2}, + {427, {x=-152, y=9, z=-69},{x=-151, y=9, z=-69},2}, + {428, {x=-152, y=9, z=-63},{x=-151, y=9, z=-63},2}, + {429, {x=-153, y=9, z=-68},{x=-152, y=9, z=-68},2}, + {430, {x=-153, y=9, z=-64},{x=-152, y=9, z=-64},2}, + {431, {x=-145, y=9, z=-75},{x=-144, y=9, z=-75},2}, + {432, {x=-145, y=9, z=-57},{x=-144, y=9, z=-57},2}, + {433, {x=-146, y=9, z=-74},{x=-145, y=9, z=-74},2}, + {434, {x=-146, y=9, z=-58},{x=-145, y=9, z=-58},2}, + {435, {x=-147, y=9, z=-73},{x=-146, y=9, z=-73},2}, + {436, {x=-147, y=9, z=-59},{x=-146, y=9, z=-59},2}, + {437, {x=-148, y=9, z=-72},{x=-147, y=9, z=-72},2}, + {438, {x=-148, y=9, z=-60},{x=-147, y=9, z=-60},2}, + {439, {x=-149, y=9, z=-71},{x=-148, y=9, z=-71},2}, + {440, {x=-149, y=9, z=-61},{x=-148, y=9, z=-61},2}, + {441, {x=-150, y=9, z=-70},{x=-149, y=9, z=-70},2}, + {442, {x=-150, y=9, z=-62},{x=-149, y=9, z=-62},2}, + {443, {x=-151, y=9, z=-69},{x=-150, y=9, z=-69},2}, + {444, {x=-151, y=9, z=-63},{x=-150, y=9, z=-63},2}, + {445, {x=-152, y=9, z=-68},{x=-151, y=9, z=-68},2}, + {446, {x=-152, y=9, z=-64},{x=-151, y=9, z=-64},2}, + {447, {x=-153, y=9, z=-67},{x=-152, y=9, z=-67},2}, + {448, {x=-153, y=9, z=-65},{x=-152, y=9, z=-65},2}, + {449, {x=-154, y=9, z=-66},{x=-153, y=9, z=-66},2}, + {450, {x=-144, y=9, z=-75},{x=-144, y=9, z=-74},2}, + {451, {x=-144, y=9, z=-57},{x=-144, y=9, z=-58},2}, + {452, {x=-145, y=9, z=-74},{x=-145, y=9, z=-73},2}, + {453, {x=-145, y=9, z=-58},{x=-145, y=9, z=-59},2}, + {454, {x=-144, y=9, z=-74},{x=-144, y=9, z=-73},2}, + {455, {x=-144, y=9, z=-58},{x=-144, y=9, z=-59},2}, + {456, {x=-146, y=9, z=-73},{x=-146, y=9, z=-72},2}, + {457, {x=-146, y=9, z=-59},{x=-146, y=9, z=-60},2}, + {458, {x=-145, y=9, z=-73},{x=-145, y=9, z=-72},2}, + {459, {x=-145, y=9, z=-59},{x=-145, y=9, z=-60},2}, + {460, {x=-144, y=9, z=-73},{x=-144, y=9, z=-72},2}, + {461, {x=-144, y=9, z=-59},{x=-144, y=9, z=-60},2}, + {462, {x=-148, y=9, z=-71},{x=-147, y=9, z=-71},2}, + {463, {x=-148, y=9, z=-61},{x=-147, y=9, z=-61},2}, + {464, {x=-149, y=9, z=-70},{x=-148, y=9, z=-70},2}, + {465, {x=-149, y=9, z=-62},{x=-148, y=9, z=-62},2}, + {466, {x=-150, y=9, z=-69},{x=-149, y=9, z=-69},2}, + {467, {x=-150, y=9, z=-63},{x=-149, y=9, z=-63},2}, + {468, {x=-151, y=9, z=-68},{x=-150, y=9, z=-68},2}, + {469, {x=-151, y=9, z=-64},{x=-150, y=9, z=-64},2}, + {470, {x=-152, y=9, z=-67},{x=-151, y=9, z=-67},2}, + {471, {x=-152, y=9, z=-65},{x=-151, y=9, z=-65},2}, + {472, {x=-153, y=9, z=-66},{x=-152, y=9, z=-66},2}, + {473, {x=-148, y=9, z=-70},{x=-147, y=9, z=-70},2}, + {474, {x=-148, y=9, z=-62},{x=-147, y=9, z=-62},2}, + {475, {x=-149, y=9, z=-69},{x=-148, y=9, z=-69},2}, + {476, {x=-149, y=9, z=-63},{x=-148, y=9, z=-63},2}, + {477, {x=-150, y=9, z=-68},{x=-149, y=9, z=-68},2}, + {478, {x=-150, y=9, z=-64},{x=-149, y=9, z=-64},2}, + {479, {x=-151, y=9, z=-67},{x=-150, y=9, z=-67},2}, + {480, {x=-151, y=9, z=-65},{x=-150, y=9, z=-65},2}, + {481, {x=-152, y=9, z=-66},{x=-151, y=9, z=-66},2}, + {482, {x=-148, y=9, z=-69},{x=-147, y=9, z=-69},2}, + {483, {x=-148, y=9, z=-63},{x=-147, y=9, z=-63},2}, + {484, {x=-149, y=9, z=-68},{x=-148, y=9, z=-68},2}, + {485, {x=-149, y=9, z=-64},{x=-148, y=9, z=-64},2}, + {486, {x=-150, y=9, z=-67},{x=-149, y=9, z=-67},2}, + {487, {x=-150, y=9, z=-65},{x=-149, y=9, z=-65},2}, + {488, {x=-151, y=9, z=-66},{x=-150, y=9, z=-66},2}, + {489, {x=-147, y=9, z=-72},{x=-146, y=9, z=-71},2}, + {490, {x=-147, y=9, z=-60},{x=-146, y=9, z=-61},2}, + {491, {x=-146, y=9, z=-72},{x=-145, y=9, z=-71},2}, + {492, {x=-146, y=9, z=-60},{x=-145, y=9, z=-61},2}, + {493, {x=-147, y=9, z=-71},{x=-146, y=9, z=-70},2}, + {494, {x=-147, y=9, z=-61},{x=-146, y=9, z=-62},2}, + {495, {x=-148, y=9, z=-68},{x=-147, y=9, z=-68},2}, + {496, {x=-148, y=9, z=-64},{x=-147, y=9, z=-64},2}, + {497, {x=-149, y=9, z=-67},{x=-148, y=9, z=-67},2}, + {498, {x=-149, y=9, z=-65},{x=-148, y=9, z=-65},2}, + {499, {x=-150, y=9, z=-66},{x=-149, y=9, z=-66},2}, + {500, {x=-147, y=9, z=-70},{x=-146, y=9, z=-69},2}, + {501, {x=-147, y=9, z=-62},{x=-146, y=9, z=-63},2}, + {502, {x=-146, y=9, z=-71},{x=-145, y=9, z=-70},2}, + {503, {x=-146, y=9, z=-61},{x=-145, y=9, z=-62},2}, + {504, {x=-145, y=9, z=-72},{x=-144, y=9, z=-71},2}, + {505, {x=-145, y=9, z=-60},{x=-144, y=9, z=-61},2}, + {506, {x=-145, y=9, z=-70},{x=-145, y=9, z=-69},2}, + {507, {x=-145, y=9, z=-62},{x=-145, y=9, z=-63},2}, + {508, {x=-144, y=9, z=-71},{x=-144, y=9, z=-70},2}, + {509, {x=-144, y=9, z=-61},{x=-144, y=9, z=-62},2}, + {510, {x=-145, y=9, z=-71},{x=-145, y=9, z=-70},2}, + {511, {x=-145, y=9, z=-61},{x=-145, y=9, z=-62},2}, + {512, {x=-144, y=9, z=-72},{x=-144, y=9, z=-71},2}, + {513, {x=-144, y=9, z=-60},{x=-144, y=9, z=-61},2}, + {514, {x=-144, y=9, z=-70},{x=-144, y=9, z=-69},2}, + {515, {x=-144, y=9, z=-62},{x=-144, y=9, z=-63},2}, + {516, {x=-149, y=9, z=-66},{x=-148, y=9, z=-66},2}, + {517, {x=-147, y=9, z=-68},{x=-147, y=9, z=-67},2}, + {518, {x=-147, y=9, z=-64},{x=-147, y=9, z=-65},2}, + {519, {x=-147, y=9, z=-69},{x=-147, y=9, z=-68},2}, + {520, {x=-147, y=9, z=-63},{x=-147, y=9, z=-64},2}, + {521, {x=-146, y=9, z=-69},{x=-146, y=9, z=-68},2}, + {522, {x=-146, y=9, z=-63},{x=-146, y=9, z=-64},2}, + {523, {x=-145, y=9, z=-69},{x=-145, y=9, z=-68},2}, + {524, {x=-145, y=9, z=-63},{x=-145, y=9, z=-64},2}, + {525, {x=-144, y=9, z=-69},{x=-144, y=9, z=-68},2}, + {526, {x=-144, y=9, z=-63},{x=-144, y=9, z=-64},2}, + {527, {x=-146, y=9, z=-70},{x=-146, y=9, z=-69},2}, + {528, {x=-146, y=9, z=-62},{x=-146, y=9, z=-63},2}, + {529, {x=-145, y=9, z=-70},{x=-145, y=9, z=-69},2}, + {530, {x=-145, y=9, z=-62},{x=-145, y=9, z=-63},2}, + {531, {x=-144, y=9, z=-71},{x=-144, y=9, z=-70},2}, + {532, {x=-144, y=9, z=-61},{x=-144, y=9, z=-62},2}, + {533, {x=-144, y=9, z=-70},{x=-144, y=9, z=-69},2}, + {534, {x=-144, y=9, z=-62},{x=-144, y=9, z=-63},2}, + {535, {x=-147, y=9, z=-67},{x=-146, y=9, z=-67},2}, + {536, {x=-147, y=9, z=-65},{x=-146, y=9, z=-65},2}, + {537, {x=-148, y=9, z=-67},{x=-147, y=9, z=-67},2}, + {538, {x=-148, y=9, z=-65},{x=-147, y=9, z=-65},2}, + {539, {x=-148, y=9, z=-66},{x=-147, y=9, z=-66},2}, + {540, {x=-146, y=9, z=-67},{x=-145, y=9, z=-67},2}, + {541, {x=-146, y=9, z=-65},{x=-145, y=9, z=-65},2}, + {542, {x=-145, y=9, z=-68},{x=-145, y=9, z=-67},2}, + {543, {x=-145, y=9, z=-64},{x=-145, y=9, z=-65},2}, + {544, {x=-144, y=9, z=-68},{x=-144, y=9, z=-67},2}, + {545, {x=-144, y=9, z=-64},{x=-144, y=9, z=-65},2}, + {546, {x=-146, y=9, z=-68},{x=-145, y=9, z=-67},2}, + {547, {x=-146, y=9, z=-64},{x=-145, y=9, z=-65},2}, + {548, {x=-146, y=9, z=-69},{x=-146, y=9, z=-68},2}, + {549, {x=-146, y=9, z=-63},{x=-146, y=9, z=-64},2}, + {550, {x=-145, y=9, z=-69},{x=-145, y=9, z=-68},2}, + {551, {x=-145, y=9, z=-63},{x=-145, y=9, z=-64},2}, + {552, {x=-144, y=9, z=-69},{x=-144, y=9, z=-68},2}, + {553, {x=-144, y=9, z=-63},{x=-144, y=9, z=-64},2}, + {554, {x=-146, y=9, z=-68},{x=-145, y=9, z=-67},2}, + {555, {x=-146, y=9, z=-64},{x=-145, y=9, z=-65},2}, + {556, {x=-147, y=9, z=-68},{x=-146, y=9, z=-68},2}, + {557, {x=-147, y=9, z=-64},{x=-146, y=9, z=-64},2}, + {558, {x=-147, y=9, z=-67},{x=-146, y=9, z=-67},2}, + {559, {x=-147, y=9, z=-65},{x=-146, y=9, z=-65},2}, + {560, {x=-147, y=9, z=-66},{x=-146, y=9, z=-66},2}, + {561, {x=-146, y=9, z=-67},{x=-145, y=9, z=-67},2}, + {562, {x=-146, y=9, z=-65},{x=-145, y=9, z=-65},2}, + {563, {x=-146, y=9, z=-66},{x=-145, y=9, z=-66},2}, + {564, {x=-145, y=9, z=-68},{x=-145, y=9, z=-67},2}, + {565, {x=-145, y=9, z=-64},{x=-145, y=9, z=-65},2}, + {566, {x=-144, y=9, z=-68},{x=-144, y=9, z=-67},2}, + {567, {x=-144, y=9, z=-64},{x=-144, y=9, z=-65},2}, + {568, {x=-146, y=9, z=-68},{x=-145, y=9, z=-67},2}, + {569, {x=-146, y=9, z=-64},{x=-145, y=9, z=-65},2}, + + {570, {x=-174, y=9, z=-70},{x=-173, y=9, z=-70},1}, + {571, {x=-174, y=9, z=-62},{x=-173, y=9, z=-62},1}, + {572, {x=-172, y=9, z=-69},{x=-171, y=9, z=-69},1}, + {573, {x=-172, y=9, z=-63},{x=-171, y=9, z=-63},1}, + {574, {x=-171, y=9, z=-67},{x=-170, y=9, z=-67},1}, + {575, {x=-171, y=9, z=-65},{x=-170, y=9, z=-65},1}, + {576, {x=-173, y=9, z=-70},{x=-172, y=9, z=-70},1}, + {577, {x=-173, y=9, z=-62},{x=-172, y=9, z=-62},1}, + {578, {x=-171, y=9, z=-69},{x=-170, y=9, z=-69},1}, + {579, {x=-171, y=9, z=-63},{x=-170, y=9, z=-63},1}, + {580, {x=-170, y=9, z=-67},{x=-169, y=9, z=-67},1}, + {581, {x=-170, y=9, z=-65},{x=-169, y=9, z=-65},1}, + {582, {x=-172, y=9, z=-70},{x=-171, y=9, z=-70},1}, + {583, {x=-172, y=9, z=-62},{x=-171, y=9, z=-62},1}, + {584, {x=-170, y=9, z=-69},{x=-169, y=9, z=-69},1}, + {585, {x=-170, y=9, z=-63},{x=-169, y=9, z=-63},1}, + {586, {x=-169, y=9, z=-67},{x=-168, y=9, z=-67},1}, + {587, {x=-169, y=9, z=-65},{x=-168, y=9, z=-65},1}, + {588, {x=-171, y=9, z=-70},{x=-170, y=9, z=-70},1}, + {589, {x=-171, y=9, z=-62},{x=-170, y=9, z=-62},1}, + {590, {x=-169, y=9, z=-69},{x=-168, y=9, z=-69},1}, + {591, {x=-169, y=9, z=-63},{x=-168, y=9, z=-63},1}, + {592, {x=-168, y=9, z=-67},{x=-167, y=9, z=-67},1}, + {593, {x=-168, y=9, z=-65},{x=-167, y=9, z=-65},1}, + {594, {x=-170, y=9, z=-70},{x=-169, y=9, z=-70},1}, + {595, {x=-170, y=9, z=-62},{x=-169, y=9, z=-62},1}, + {596, {x=-168, y=9, z=-69},{x=-167, y=9, z=-69},1}, + {597, {x=-168, y=9, z=-63},{x=-167, y=9, z=-63},1}, + {598, {x=-167, y=9, z=-67},{x=-166, y=9, z=-67},1}, + {599, {x=-167, y=9, z=-65},{x=-166, y=9, z=-65},1}, + {600, {x=-169, y=9, z=-70},{x=-168, y=9, z=-70},1}, + {601, {x=-169, y=9, z=-62},{x=-168, y=9, z=-62},1}, + {602, {x=-167, y=9, z=-69},{x=-166, y=9, z=-69},1}, + {603, {x=-167, y=9, z=-63},{x=-166, y=9, z=-63},1}, + {604, {x=-166, y=9, z=-67},{x=-165, y=9, z=-67},1}, + {605, {x=-166, y=9, z=-65},{x=-165, y=9, z=-65},1}, + {606, {x=-168, y=9, z=-70},{x=-167, y=9, z=-71},1}, + {607, {x=-168, y=9, z=-62},{x=-167, y=9, z=-61},1}, + {608, {x=-165, y=9, z=-67},{x=-164, y=9, z=-67},1}, + {609, {x=-165, y=9, z=-65},{x=-164, y=9, z=-65},1}, + {610, {x=-166, y=9, z=-69},{x=-165, y=9, z=-69},1}, + {611, {x=-166, y=9, z=-63},{x=-165, y=9, z=-63},1}, + {612, {x=-167, y=9, z=-71},{x=-166, y=9, z=-71},1}, + {613, {x=-167, y=9, z=-61},{x=-166, y=9, z=-61},1}, + {614, {x=-166, y=9, z=-71},{x=-165, y=9, z=-72},1}, + {615, {x=-166, y=9, z=-61},{x=-165, y=9, z=-60},1}, + {616, {x=-165, y=9, z=-69},{x=-164, y=9, z=-70},1}, + {617, {x=-165, y=9, z=-63},{x=-164, y=9, z=-62},1}, + {618, {x=-164, y=9, z=-67},{x=-163, y=9, z=-68},1}, + {619, {x=-164, y=9, z=-65},{x=-163, y=9, z=-64},1}, + {620, {x=-165, y=9, z=-72},{x=-164, y=9, z=-72},1}, + {621, {x=-165, y=9, z=-60},{x=-164, y=9, z=-60},1}, + {622, {x=-164, y=9, z=-70},{x=-163, y=9, z=-70},1}, + {623, {x=-164, y=9, z=-62},{x=-163, y=9, z=-62},1}, + {624, {x=-163, y=9, z=-68},{x=-162, y=9, z=-67},1}, + {625, {x=-163, y=9, z=-64},{x=-162, y=9, z=-65},1}, + {626, {x=-164, y=9, z=-72},{x=-163, y=9, z=-73},1}, + {627, {x=-164, y=9, z=-60},{x=-163, y=9, z=-59},1}, + {628, {x=-163, y=9, z=-70},{x=-162, y=9, z=-71},1}, + {629, {x=-163, y=9, z=-62},{x=-162, y=9, z=-61},1}, + {630, {x=-162, y=9, z=-67},{x=-161, y=9, z=-68},1}, + {631, {x=-162, y=9, z=-65},{x=-161, y=9, z=-64},1}, + {632, {x=-163, y=9, z=-73},{x=-162, y=9, z=-73},1}, + {633, {x=-163, y=9, z=-59},{x=-162, y=9, z=-59},1}, + {634, {x=-162, y=9, z=-71},{x=-161, y=9, z=-71},1}, + {635, {x=-162, y=9, z=-61},{x=-161, y=9, z=-61},1}, + {636, {x=-161, y=9, z=-68},{x=-160, y=9, z=-67},1}, + {637, {x=-161, y=9, z=-64},{x=-160, y=9, z=-65},1}, + {638, {x=-162, y=9, z=-73},{x=-161, y=9, z=-74},1}, + {639, {x=-162, y=9, z=-59},{x=-161, y=9, z=-58},1}, + {640, {x=-161, y=9, z=-71},{x=-160, y=9, z=-71},1}, + {641, {x=-161, y=9, z=-61},{x=-160, y=9, z=-61},1}, + {642, {x=-160, y=9, z=-67},{x=-159, y=9, z=-68},1}, + {643, {x=-160, y=9, z=-65},{x=-159, y=9, z=-64},1}, + {644, {x=-161, y=9, z=-74},{x=-160, y=9, z=-74},1}, + {645, {x=-161, y=9, z=-58},{x=-160, y=9, z=-58},1}, + {646, {x=-160, y=9, z=-74},{x=-159, y=9, z=-74},1}, + {647, {x=-160, y=9, z=-58},{x=-159, y=9, z=-58},1}, + {648, {x=-160, y=9, z=-71},{x=-159, y=9, z=-71},1}, + {649, {x=-160, y=9, z=-61},{x=-159, y=9, z=-61},1}, + {650, {x=-159, y=9, z=-68},{x=-158, y=9, z=-67},1}, + {651, {x=-159, y=9, z=-64},{x=-158, y=9, z=-65},1}, + {652, {x=-159, y=9, z=-74},{x=-158, y=9, z=-74},1}, + {653, {x=-159, y=9, z=-58},{x=-158, y=9, z=-58},1}, + {654, {x=-159, y=9, z=-71},{x=-158, y=9, z=-71},1}, + {655, {x=-159, y=9, z=-61},{x=-158, y=9, z=-61},1}, + {656, {x=-158, y=9, z=-67},{x=-157, y=9, z=-68},1}, + {657, {x=-158, y=9, z=-65},{x=-157, y=9, z=-64},1}, + {658, {x=-158, y=9, z=-74},{x=-157, y=9, z=-74},1}, + {659, {x=-158, y=9, z=-58},{x=-157, y=9, z=-58},1}, + {660, {x=-157, y=9, z=-74},{x=-156, y=9, z=-74},1}, + {661, {x=-157, y=9, z=-58},{x=-156, y=9, z=-58},1}, + {662, {x=-158, y=9, z=-71},{x=-157, y=9, z=-71},1}, + {663, {x=-158, y=9, z=-61},{x=-157, y=9, z=-61},1}, + {664, {x=-157, y=9, z=-68},{x=-156, y=9, z=-67},1}, + {665, {x=-157, y=9, z=-64},{x=-156, y=9, z=-65},1}, + {666, {x=-156, y=9, z=-74},{x=-155, y=9, z=-74},1}, + {667, {x=-156, y=9, z=-58},{x=-155, y=9, z=-58},1}, + {668, {x=-157, y=9, z=-71},{x=-156, y=9, z=-71},1}, + {669, {x=-157, y=9, z=-61},{x=-156, y=9, z=-61},1}, + {670, {x=-155, y=9, z=-74},{x=-154, y=9, z=-74},1}, + {671, {x=-155, y=9, z=-58},{x=-154, y=9, z=-58},1}, + {672, {x=-156, y=9, z=-71},{x=-155, y=9, z=-71},1}, + {673, {x=-156, y=9, z=-61},{x=-155, y=9, z=-61},1}, + {674, {x=-156, y=9, z=-67},{x=-155, y=9, z=-68},1}, + {675, {x=-156, y=9, z=-65},{x=-155, y=9, z=-64},1}, + {676, {x=-154, y=9, z=-74},{x=-153, y=9, z=-74},1}, + {677, {x=-154, y=9, z=-58},{x=-153, y=9, z=-58},1}, + {678, {x=-155, y=9, z=-71},{x=-154, y=9, z=-71},1}, + {679, {x=-155, y=9, z=-61},{x=-154, y=9, z=-61},1}, + {680, {x=-155, y=9, z=-68},{x=-154, y=9, z=-67},1}, + {681, {x=-155, y=9, z=-64},{x=-154, y=9, z=-65},1}, + {682, {x=-153, y=9, z=-74},{x=-152, y=9, z=-74},1}, + {683, {x=-153, y=9, z=-58},{x=-152, y=9, z=-58},1}, + {684, {x=-154, y=9, z=-71},{x=-153, y=9, z=-71},1}, + {685, {x=-154, y=9, z=-61},{x=-153, y=9, z=-61},1}, + {686, {x=-152, y=9, z=-74},{x=-151, y=9, z=-74},1}, + {687, {x=-152, y=9, z=-58},{x=-151, y=9, z=-58},1}, + {688, {x=-153, y=9, z=-71},{x=-152, y=9, z=-71},1}, + {689, {x=-153, y=9, z=-61},{x=-152, y=9, z=-61},1}, + {690, {x=-154, y=9, z=-67},{x=-153, y=9, z=-68},1}, + {691, {x=-154, y=9, z=-65},{x=-153, y=9, z=-64},1}, + {692, {x=-151, y=9, z=-74},{x=-150, y=9, z=-73},1}, + {693, {x=-151, y=9, z=-58},{x=-150, y=9, z=-59},1}, + {694, {x=-152, y=9, z=-71},{x=-151, y=9, z=-70},1}, + {695, {x=-152, y=9, z=-61},{x=-151, y=9, z=-62},1}, + {696, {x=-153, y=9, z=-68},{x=-152, y=9, z=-67},1}, + {697, {x=-153, y=9, z=-64},{x=-152, y=9, z=-65},1}, + {698, {x=-150, y=9, z=-73},{x=-149, y=9, z=-73},1}, + {699, {x=-150, y=9, z=-59},{x=-149, y=9, z=-59},1}, + {700, {x=-151, y=9, z=-70},{x=-150, y=9, z=-69},1}, + {701, {x=-151, y=9, z=-62},{x=-150, y=9, z=-63},1}, + {702, {x=-152, y=9, z=-67},{x=-151, y=9, z=-67},1}, + {703, {x=-152, y=9, z=-65},{x=-151, y=9, z=-65},1}, + {704, {x=-149, y=9, z=-73},{x=-148, y=9, z=-72},1}, + {705, {x=-149, y=9, z=-59},{x=-148, y=9, z=-60},1}, + {706, {x=-150, y=9, z=-69},{x=-149, y=9, z=-69},1}, + {707, {x=-150, y=9, z=-63},{x=-149, y=9, z=-63},1}, + {708, {x=-151, y=9, z=-67},{x=-150, y=9, z=-67},1}, + {709, {x=-151, y=9, z=-65},{x=-150, y=9, z=-65},1}, + {710, {x=-148, y=9, z=-72},{x=-147, y=9, z=-71},1}, + {711, {x=-148, y=9, z=-60},{x=-147, y=9, z=-61},1}, + {712, {x=-149, y=9, z=-69},{x=-148, y=9, z=-69},1}, + {713, {x=-149, y=9, z=-63},{x=-148, y=9, z=-63},1}, + {714, {x=-150, y=9, z=-67},{x=-149, y=9, z=-67},1}, + {715, {x=-150, y=9, z=-65},{x=-149, y=9, z=-65},1}, + {716, {x=-147, y=9, z=-71},{x=-146, y=9, z=-70},1}, + {717, {x=-147, y=9, z=-61},{x=-146, y=9, z=-62},1}, + {718, {x=-148, y=9, z=-69},{x=-147, y=9, z=-69},1}, + {719, {x=-148, y=9, z=-63},{x=-147, y=9, z=-63},1}, + {720, {x=-149, y=9, z=-67},{x=-148, y=9, z=-67},1}, + {721, {x=-149, y=9, z=-65},{x=-148, y=9, z=-65},1}, + {722, {x=-146, y=9, z=-70},{x=-145, y=9, z=-69},1}, + {723, {x=-146, y=9, z=-62},{x=-145, y=9, z=-63},1}, + {724, {x=-147, y=9, z=-69},{x=-146, y=9, z=-68},1}, + {725, {x=-147, y=9, z=-63},{x=-146, y=9, z=-64},1}, + {726, {x=-148, y=9, z=-67},{x=-147, y=9, z=-67},1}, + {727, {x=-148, y=9, z=-65},{x=-147, y=9, z=-65},1}, + {728, {x=-145, y=9, z=-69},{x=-144, y=9, z=-69},1}, + {729, {x=-145, y=9, z=-63},{x=-144, y=9, z=-63},1}, + {730, {x=-146, y=9, z=-68},{x=-145, y=9, z=-68},1}, + {731, {x=-146, y=9, z=-64},{x=-145, y=9, z=-64},1}, + {732, {x=-147, y=9, z=-67},{x=-146, y=9, z=-67},1}, + {733, {x=-147, y=9, z=-65},{x=-146, y=9, z=-65},1}, + {734, {x=-146, y=9, z=-67},{x=-145, y=9, z=-67},1}, + {735, {x=-146, y=9, z=-65},{x=-145, y=9, z=-65},1}, + {736, {x=-145, y=9, z=-68},{x=-144, y=9, z=-67},1}, + {737, {x=-145, y=9, z=-64},{x=-144, y=9, z=-65},1}, + {738, {x=-144, y=9, z=-69},{x=-144, y=9, z=-68},1}, + {739, {x=-144, y=9, z=-63},{x=-144, y=9, z=-64},1}, + {740, {x=-144, y=9, z=-68},{x=-144, y=9, z=-67},1}, + {741, {x=-144, y=9, z=-64},{x=-144, y=9, z=-65},1}, +} +function Chapter6() + return list +end \ No newline at end of file diff --git a/mods/castrum/fight.lua b/mods/castrum/fight.lua index 89d44d2..d17e000 100644 --- a/mods/castrum/fight.lua +++ b/mods/castrum/fight.lua @@ -406,6 +406,76 @@ function set_fight(player,level) turn(player,{x=-174, y=9, z=-72},3) minetest.set_node({x=-174, y=9, z=-60}, {name="castrum:knight_lv3_dark"}) turn(player,{x=-174, y=9, z=-60},3) + elseif level == 6 then + minetest.set_node({x=-173, y=9, z=-65}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-173, y=9, z=-65},3) + minetest.set_node({x=-173, y=9, z=-67}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-173, y=9, z=-67},3) + minetest.set_node({x=-174, y=9, z=-64}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-174, y=9, z=-64},3) + minetest.set_node({x=-174, y=9, z=-68}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-174, y=9, z=-68},3) + minetest.set_node({x=-172, y=9, z=-66}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-172, y=9, z=-66},3) + minetest.set_node({x=-173, y=9, z=-62}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-173, y=9, z=-62},3) + minetest.set_node({x=-173, y=9, z=-70}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-173, y=9, z=-70},3) + minetest.set_node({x=-171, y=9, z=-69}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-171, y=9, z=-69},3) + minetest.set_node({x=-171, y=9, z=-63}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-171, y=9, z=-63},3) + minetest.set_node({x=-170, y=9, z=-65}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-170, y=9, z=-65},3) + minetest.set_node({x=-170, y=9, z=-67}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-170, y=9, z=-67},3) + minetest.set_node({x=-170, y=9, z=-70}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-170, y=9, z=-70},3) + minetest.set_node({x=-169, y=9, z=-68}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-169, y=9, z=-68},3) + minetest.set_node({x=-169, y=9, z=-64}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-169, y=9, z=-64},3) + minetest.set_node({x=-168, y=9, z=-66}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-168, y=9, z=-66},3) + minetest.set_node({x=-170, y=9, z=-62}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-170, y=9, z=-62},3) + minetest.set_node({x=-172, y=9, z=-71}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-172, y=9, z=-71},3) + minetest.set_node({x=-172, y=9, z=-61}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-172, y=9, z=-61},3) + minetest.set_node({x=-174, y=9, z=-72}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-174, y=9, z=-72},3) + minetest.set_node({x=-174, y=9, z=-60}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-174, y=9, z=-60},3) + minetest.set_node({x=-174, y=9, z=-67}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-174, y=9, z=-67},3) + minetest.set_node({x=-174, y=9, z=-65}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-174, y=9, z=-65},3) + minetest.set_node({x=-174, y=9, z=-59}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-174, y=9, z=-59},3) + minetest.set_node({x=-174, y=9, z=-73}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-174, y=9, z=-73},3) + minetest.set_node({x=-172, y=9, z=-60}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-172, y=9, z=-60},3) + minetest.set_node({x=-172, y=9, z=-72}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-172, y=9, z=-72},3) + minetest.set_node({x=-174, y=9, z=-65}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-174, y=9, z=-65},3) + minetest.set_node({x=-174, y=9, z=-67}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-174, y=9, z=-67},3) + minetest.set_node({x=-174, y=9, z=-62}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-174, y=9, z=-62},3) + minetest.set_node({x=-174, y=9, z=-70}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-174, y=9, z=-70},3) + minetest.set_node({x=-172, y=9, z=-69}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-172, y=9, z=-69},3) + minetest.set_node({x=-172, y=9, z=-63}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-172, y=9, z=-63},3) + minetest.set_node({x=-171, y=9, z=-65}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-171, y=9, z=-65},3) + minetest.set_node({x=-171, y=9, z=-67}, {name="castrum:knight_lv3_dark"}) + turn(player,{x=-171, y=9, z=-67},3) + end player:set_attribute("fightlv", ""..level) end @@ -443,134 +513,127 @@ function fight_step1(player) end end function fight_step3(player,num2,num,dignum,m,j,i) + local d = 0 if minetest.get_node({x=j*(-1), y=9, z=i*(-1)}).name == "castrum:knight_lv"..num2.."_dark" and dignum < m then if minetest.get_node({x=j*(-1)+1, y=9, z=i*(-1)}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1)+1, y=10, z=i*(-1)}).name == "castrum:knight_lv"..num.."_sit" then player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 if minetest.get_node({x=j*(-1)+1, y=9, z=i*(-1)}).name == "castrum:horse1" then player:set_attribute("fighthkill1", ""..(player:get_attribute("fighthkill1")+1)) end minetest.set_node({x=j*(-1)+1, y=9, z=i*(-1)}, {name="air"}) minetest.set_node({x=j*(-1)+1, y=10, z=i*(-1)}, {name="air"}) + d = 1 end - if minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1)-1, y=10, z=i*(-1)}).name == "castrum:knight_lv"..num.."_sit" then + if (minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1)-1, y=10, z=i*(-1)}).name == "castrum:knight_lv"..num.."_sit") and d == 0 then player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 if minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)}).name == "castrum:horse1" then player:set_attribute("fighthkill1", ""..(player:get_attribute("fighthkill1")+1)) end minetest.set_node({x=j*(-1)-1, y=9, z=i*(-1)}, {name="air"}) minetest.set_node({x=j*(-1)-1, y=10, z=i*(-1)}, {name="air"}) + d = 1 end - if minetest.get_node({x=j*(-1), y=9, z=i*(-1)}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1), y=10, z=i*(-1)}).name == "castrum:knight_lv"..num.."_sit" then + if (minetest.get_node({x=j*(-1), y=9, z=i*(-1)}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1), y=10, z=i*(-1)}).name == "castrum:knight_lv"..num.."_sit") and d == 0 then player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 if minetest.get_node({x=j*(-1), y=9, z=i*(-1)}).name == "castrum:horse1" then player:set_attribute("fighthkill1", ""..(player:get_attribute("fighthkill1")+1)) end minetest.set_node({x=j*(-1), y=9, z=i*(-1)}, {name="air"}) minetest.set_node({x=j*(-1), y=10, z=i*(-1)}, {name="air"}) + d = 1 end - if minetest.get_node({x=j*(-1)+1, y=9, z=i*(-1)-1}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1)+1, y=10, z=i*(-1)-1}).name == "castrum:knight_lv"..num.."_sit" then + if (minetest.get_node({x=j*(-1)+1, y=9, z=i*(-1)-1}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1)+1, y=10, z=i*(-1)-1}).name == "castrum:knight_lv"..num.."_sit") and d == 0 then player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 if minetest.get_node({x=j*(-1)+1, y=9, z=i*(-1)-1}).name == "castrum:horse1" then player:set_attribute("fighthkill1", ""..(player:get_attribute("fighthkill1")+1)) end minetest.set_node({x=j*(-1)+1, y=9, z=i*(-1)-1}, {name="air"}) minetest.set_node({x=j*(-1)+1, y=10, z=i*(-1)-1}, {name="air"}) + d = 1 end - if minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)-1}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1)-1, y=10, z=i*(-1)-1}).name == "castrum:knight_lv"..num.."_sit" then + if (minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)-1}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1)-1, y=10, z=i*(-1)-1}).name == "castrum:knight_lv"..num.."_sit") and d == 0 then player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 if minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)-1}).name == "castrum:horse1" then player:set_attribute("fighthkill1", ""..(player:get_attribute("fighthkill1")+1)) end minetest.set_node({x=j*(-1)-1, y=9, z=i*(-1)-1}, {name="air"}) minetest.set_node({x=j*(-1)-1, y=10, z=i*(-1)-1}, {name="air"}) + d = 1 end - if minetest.get_node({x=j*(-1), y=9, z=i*(-1)-1}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1), y=10, z=i*(-1)-1}).name == "castrum:knight_lv"..num.."_sit" then + if (minetest.get_node({x=j*(-1), y=9, z=i*(-1)-1}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1), y=10, z=i*(-1)-1}).name == "castrum:knight_lv"..num.."_sit") and d == 0 then player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 if minetest.get_node({x=j*(-1), y=9, z=i*(-1)-1}).name == "castrum:horse1" then player:set_attribute("fighthkill1", ""..(player:get_attribute("fighthkill1")+1)) end minetest.set_node({x=j*(-1), y=9, z=i*(-1)-1}, {name="air"}) minetest.set_node({x=j*(-1), y=10, z=i*(-1)-1}, {name="air"}) + d = 1 end - if minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)+1}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1)-1, y=10, z=i*(-1)+1}).name == "castrum:knight_lv"..num.."_sit" then + if (minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)+1}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1)-1, y=10, z=i*(-1)+1}).name == "castrum:knight_lv"..num.."_sit") and d == 0 then player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 if minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)+1}).name == "castrum:horse1" then player:set_attribute("fighthkill1", ""..(player:get_attribute("fighthkill1")+1)) end minetest.set_node({x=j*(-1)-1, y=9, z=i*(-1)+1}, {name="air"}) minetest.set_node({x=j*(-1)-1, y=10, z=i*(-1)+1}, {name="air"}) + d = 1 end - if minetest.get_node({x=j*(-1)+1, y=9, z=i*(-1)+1}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1)+1, y=10, z=i*(-1)+1}).name == "castrum:knight_lv"..num.."_sit" then + if (minetest.get_node({x=j*(-1)+1, y=9, z=i*(-1)+1}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1)+1, y=10, z=i*(-1)+1}).name == "castrum:knight_lv"..num.."_sit") and d == 0 then player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 if minetest.get_node({x=j*(-1)+1, y=9, z=i*(-1)+1}).name == "castrum:horse1" then player:set_attribute("fighthkill1", ""..(player:get_attribute("fighthkill1")+1)) end minetest.set_node({x=j*(-1)+1, y=9, z=i*(-1)+1}, {name="air"}) minetest.set_node({x=j*(-1)+1, y=10, z=i*(-1)+1}, {name="air"}) + d = 1 end - if minetest.get_node({x=j*(-1), y=9, z=i*(-1)+1}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1), y=10, z=i*(-1)+1}).name == "castrum:knight_lv"..num.."_sit" then + if (minetest.get_node({x=j*(-1), y=9, z=i*(-1)+1}).name == "castrum:knight_lv"..num or minetest.get_node({x=j*(-1), y=10, z=i*(-1)+1}).name == "castrum:knight_lv"..num.."_sit") and d == 0 then player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 if minetest.get_node({x=j*(-1), y=9, z=i*(-1)+1}).name == "castrum:horse1" then player:set_attribute("fighthkill1", ""..(player:get_attribute("fighthkill1")+1)) end minetest.set_node({x=j*(-1), y=9, z=i*(-1)+1}, {name="air"}) minetest.set_node({x=j*(-1), y=10, z=i*(-1)+1}, {name="air"}) + d = 1 end - if minetest.get_node({x=j*(-1)+1, y=9, z=i*(-1)}).name == "castrum:castrum_knight"..num and dd == 0 then + if minetest.get_node({x=j*(-1)+1, y=9, z=i*(-1)}).name == "castrum:castrum_knight1" and d == 0 then minetest.set_node({x=j*(-1)+1, y=9, z=i*(-1)}, {name="air"}) - player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 + d = 1 end - if minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)}).name == "castrum:castrum_knight"..num and dd == 0 then + if minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)}).name == "castrum:castrum_knight1" and d == 0 then minetest.set_node({x=j*(-1)-1, y=9, z=i*(-1)}, {name="air"}) - player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 + d = 1 end - if minetest.get_node({x=j*(-1), y=9, z=i*(-1)}).name == "castrum:castrum_knight"..num and dd == 0 then + if minetest.get_node({x=j*(-1), y=9, z=i*(-1)}).name == "castrum:castrum_knight1" and d == 0 then minetest.set_node({x=j*(-1), y=9, z=i*(-1)}, {name="air"}) - player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 + d = 1 end - if minetest.get_node({x=j*(-1)+1, y=9, z=i*(-1)-1}).name == "castrum:castrum_knight"..num and dd == 0 then + if minetest.get_node({x=j*(-1)+1, y=9, z=i*(-1)-1}).name == "castrum:castrum_knight1" and d == 0 then minetest.set_node({x=j*(-1)+1, y=9, z=i*(-1)-1}, {name="air"}) - player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 + d = 1 end - if minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)-1}).name == "castrum:castrum_knight"..num and dd == 0 then + if minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)-1}).name == "castrum:castrum_knight1" and d == 0 then minetest.set_node({x=j*(-1)-1, y=9, z=i*(-1)-1}, {name="air"}) - player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 + d = 1 end - if minetest.get_node({x=j*(-1), y=9, z=i*(-1)-1}).name == "castrum:castrum_knight"..num and dd == 0 then + if minetest.get_node({x=j*(-1), y=9, z=i*(-1)-1}).name == "castrum:castrum_knight1" and d == 0 then minetest.set_node({x=j*(-1), y=9, z=i*(-1)-1}, {name="air"}) - player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 + d = 1 end - if minetest.get_node({x=j*(-1)+1, y=9, z=i*(-1)+1}).name == "castrum:castrum_knight"..num and dd == 0 then + if minetest.get_node({x=j*(-1)+1, y=9, z=i*(-1)+1}).name == "castrum:castrum_knight1" and d == 0 then minetest.set_node({x=j*(-1)+1, y=9, z=i*(-1)+1}, {name="air"}) - player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 + d = 1 end - if minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)+1}).name == "castrum:castrum_knight"..num and dd == 0 then + if minetest.get_node({x=j*(-1)-1, y=9, z=i*(-1)+1}).name == "castrum:castrum_knight1" and d == 0 then minetest.set_node({x=j*(-1)-1, y=9, z=i*(-1)+1}, {name="air"}) - player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 + d = 1 end - if minetest.get_node({x=j*(-1), y=9, z=i*(-1)+1}).name == "castrum:castrum_knight"..num and dd == 0 then + if minetest.get_node({x=j*(-1), y=9, z=i*(-1)+1}).name == "castrum:castrum_knight1" and d == 0 then minetest.set_node({x=j*(-1), y=9, z=i*(-1)+1}, {name="air"}) - player:set_attribute("fightkill"..num, ""..(player:get_attribute("fightkill"..num)+1)) - dd = 1 + d = 1 end end + return d end function fight_step2(player) local move = tonumber(player:get_attribute("fightmove")) @@ -588,6 +651,8 @@ function fight_step2(player) list = Chapter4() elseif tonumber(chapter) == 5 then list = Chapter5() + elseif tonumber(chapter) == 6 then + list = Chapter6() end local move2 = move local d = 0 @@ -596,19 +661,19 @@ function fight_step2(player) for j=144,174 do for i=51,81 do dignum = math.random(8) - fight_step3(player,1,1,dignum,5,j,i) - fight_step3(player,1,2,dignum,3,j,i) - fight_step3(player,1,3,dignum,2,j,i) - fight_step3(player,2,1,dignum,7,j,i) - fight_step3(player,2,2,dignum,5,j,i) - fight_step3(player,2,2,dignum,3,j,i) - fight_step3(player,3,1,dignum,8,j,i) - fight_step3(player,3,2,dignum,7,j,i) - fight_step3(player,3,3,dignum,5,j,i) + d = fight_step3(player,1,1,dignum,5,j,i) + d = fight_step3(player,1,2,dignum,3,j,i) + d = fight_step3(player,1,3,dignum,2,j,i) + d = fight_step3(player,2,1,dignum,7,j,i) + d = fight_step3(player,2,2,dignum,5,j,i) + d = fight_step3(player,2,2,dignum,3,j,i) + d = fight_step3(player,3,1,dignum,8,j,i) + d = fight_step3(player,3,2,dignum,7,j,i) + d = fight_step3(player,3,3,dignum,5,j,i) end end while d == 0 and move2 < 167 and dd == 0 and tonumber(chapter) == 1 do - if minetest.get_node(list[move2][2]).name == "castrum:knight_lv1_dark" and minetest.get_node(list[move2][3]).name == "air" then + if minetest.get_node(list[move2][2]).name == "castrum:knight_lv1_dark" and (minetest.get_node(list[move2][3]).name == "air" or minetest.get_node(list[move2][3]).name == "castrum:knight_lv1_dark") then minetest.set_node(list[move2][2], {name="air"}) minetest.set_node(list[move2][3], {name="castrum:knight_lv1_dark"}) player:set_attribute("fightmove", ""..(move2+1)) @@ -621,7 +686,7 @@ function fight_step2(player) end end while d == 0 and move2 < 300 and dd == 0 and tonumber(chapter) == 2 do - if minetest.get_node(list[move2][2]).name == "castrum:knight_lv1_dark" and minetest.get_node(list[move2][3]).name == "air" then + if minetest.get_node(list[move2][2]).name == "castrum:knight_lv1_dark" and (minetest.get_node(list[move2][3]).name == "air" or minetest.get_node(list[move2][3]).name == "castrum:knight_lv1_dark") then minetest.set_node(list[move2][2], {name="air"}) minetest.set_node(list[move2][3], {name="castrum:knight_lv1_dark"}) @@ -635,7 +700,7 @@ function fight_step2(player) end end while d == 0 and move2 < 300 and dd == 0 and tonumber(chapter) == 3 do - if minetest.get_node(list[move2][2]).name == "castrum:knight_lv2_dark" and minetest.get_node(list[move2][3]).name == "air" then + if minetest.get_node(list[move2][2]).name == "castrum:knight_lv2_dark" and (minetest.get_node(list[move2][3]).name == "air" or minetest.get_node(list[move2][3]).name == "castrum:knight_lv2_dark") then minetest.set_node(list[move2][2], {name="air"}) minetest.set_node(list[move2][3], {name="castrum:knight_lv2_dark"}) player:set_attribute("fightmove", ""..(move2+1)) @@ -648,7 +713,7 @@ function fight_step2(player) end end while d == 0 and move2 < 430 and dd == 0 and tonumber(chapter) == 4 do - if minetest.get_node(list[move2][2]).name == "castrum:knight_lv2_dark" and minetest.get_node(list[move2][3]).name == "air" then + if minetest.get_node(list[move2][2]).name == "castrum:knight_lv2_dark" and (minetest.get_node(list[move2][3]).name == "air" or minetest.get_node(list[move2][3]).name == "castrum:knight_lv2_dark") then minetest.set_node(list[move2][2], {name="air"}) minetest.set_node(list[move2][3], {name="castrum:knight_lv2_dark"}) player:set_attribute("fightmove", ""..(move2+1)) @@ -661,7 +726,20 @@ function fight_step2(player) end end while d == 0 and move2 < 430 and dd == 0 and tonumber(chapter) == 5 do - if minetest.get_node(list[move2][2]).name == "castrum:knight_lv3_dark" and minetest.get_node(list[move2][3]).name == "air" then + if minetest.get_node(list[move2][2]).name == "castrum:knight_lv3_dark" and (minetest.get_node(list[move2][3]).name == "air" or minetest.get_node(list[move2][3]).name == "castrum:knight_lv3_dark") then + minetest.set_node(list[move2][2], {name="air"}) + minetest.set_node(list[move2][3], {name="castrum:knight_lv3_dark"}) + player:set_attribute("fightmove", ""..(move2+1)) + screwdriver_handler(player, {type="node", under=list[move2][3], above=list[move2][3]}, 1) + screwdriver_handler(player, {type="node", under=list[move2][3], above=list[move2][3]}, 1) + screwdriver_handler(player, {type="node", under=list[move2][3], above=list[move2][3]}, 1) + d = 1 + else + move2 = move2+1 + end + end + while d == 0 and move2 < 742 and dd == 0 and tonumber(chapter) == 6 do + if minetest.get_node(list[move2][2]).name == "castrum:knight_lv3_dark" and (minetest.get_node(list[move2][3]).name == "air" or minetest.get_node(list[move2][3]).name == "castrum:knight_lv3_dark") then minetest.set_node(list[move2][2], {name="air"}) minetest.set_node(list[move2][3], {name="castrum:knight_lv3_dark"}) player:set_attribute("fightmove", ""..(move2+1)) diff --git a/mods/castrum/init.lua b/mods/castrum/init.lua index 0adfc9d..8ba7f6e 100644 --- a/mods/castrum/init.lua +++ b/mods/castrum/init.lua @@ -6,7 +6,7 @@ minetest.register_on_joinplayer(function(player) offset = {x=0, y=10}, alignment = {x=1, y=0}, number = 0xFFFFFF , - text = "For Minetest : 5.0.0", + text = "For Minetest : 5.0.x", }) player:hud_add({ hud_elem_type = "text", @@ -14,7 +14,7 @@ minetest.register_on_joinplayer(function(player) offset = {x=0, y=30}, alignment = {x=1, y=0}, number = 0xFFFFFF , - text = "Game Version : 1.8.1", + text = "Game Version : 1.9.0", }) player:hud_add({ hud_elem_type = "text", @@ -22,7 +22,7 @@ minetest.register_on_joinplayer(function(player) offset = {x=0, y=50}, alignment = {x=1, y=0}, number = 0xFFFFFF , - text = "Map Version : 10", + text = "Map Version : 11", }) end) function file_check(file_name) @@ -168,12 +168,6 @@ minetest.register_on_joinplayer(function(player) file:write("0") file:close() end - - - - - - if file_check(minetest.get_worldpath().."/SAVE/Island_Barracks.txt") == true then else file = io.open(minetest.get_worldpath().."/SAVE/Island_Barracks.txt", "w") @@ -228,15 +222,53 @@ minetest.register_on_joinplayer(function(player) file:write("0") file:close() end - + if file_check(minetest.get_worldpath().."/SAVE/Camp3.txt") == true then + else + file = io.open(minetest.get_worldpath().."/SAVE/Camp3.txt", "w") + file:write("0") + file:close() + end + if file_check(minetest.get_worldpath().."/SAVE/Cannon1.txt") == true then + else + file = io.open(minetest.get_worldpath().."/SAVE/Cannon1.txt", "w") + file:write("0") + file:close() + end + if file_check(minetest.get_worldpath().."/SAVE/Cannon2.txt") == true then + else + file = io.open(minetest.get_worldpath().."/SAVE/Cannon2.txt", "w") + file:write("0") + file:close() + end + if file_check(minetest.get_worldpath().."/SAVE/Island_Battleground.txt") == true then + else + file = io.open(minetest.get_worldpath().."/SAVE/Island_Battleground.txt", "w") + file:write("0") + file:close() + end + if file_check(minetest.get_worldpath().."/SAVE/Island_Pier2.txt") == true then + else + file = io.open(minetest.get_worldpath().."/SAVE/Island_Pier2.txt", "w") + file:write("0") + file:close() + end + if file_check(minetest.get_worldpath().."/SAVE/Island_Chapter.txt") == true then + else + file = io.open(minetest.get_worldpath().."/SAVE/Island_Chapter.txt", "w") + file:write("1") + file:close() + end end) dofile(minetest.get_modpath("castrum").."/Chapter1.lua") dofile(minetest.get_modpath("castrum").."/Chapter2.lua") dofile(minetest.get_modpath("castrum").."/Chapter3.lua") dofile(minetest.get_modpath("castrum").."/Chapter4.lua") dofile(minetest.get_modpath("castrum").."/Chapter5.lua") +dofile(minetest.get_modpath("castrum").."/Chapter6.lua") dofile(minetest.get_modpath("castrum").."/fight.lua") +dofile(minetest.get_modpath("castrum").."/island_fight.lua") dofile(minetest.get_modpath("castrum").."/update.lua") +local btimer = 1 local timer = 0 local timer2 = 0 local timer3 = 0 @@ -249,13 +281,18 @@ local timer9 = 0 local timer10 = 0 local tree2 = 0 local tree3 = 0 +local tree4 = 0 local quarry2 = 0 local quarry3 = 0 local mine2 = 0 local mine3 = 0 local sandmine2 = 0 +local sandmine3 = 0 local last = {x=-40,y=8.5,z=-5} minetest.register_globalstep(function(dtime) + if btimer > 0 then + btimer = btimer + dtime; + end timer = timer + dtime; timer2 = timer2 + dtime; timer3 = timer3 + dtime; @@ -272,35 +309,60 @@ minetest.register_globalstep(function(dtime) file = io.open(minetest.get_worldpath().."/SAVE/Ship1.txt", "r") local ship1 = file:read("*l") file:close() - if pos.x < -9.5 and pos.x > -15.5 and pos.z > -62.5 and pos.z < -54 and tonumber(ship1) > 1 then - last = pos - elseif pos.x < -10.5 and pos.x > -14.5 and pos.z > -63.5 and pos.z < -62.5 and tonumber(ship1) > 1 then - last = pos - elseif pos.x < -11.5 and pos.x > -13.5 and pos.z > -64.5 and pos.z < -63.5 and tonumber(ship1) > 1 then - last = pos - elseif pos.x < 132.5 and pos.x > 127.5 and pos.z > 39.5 and pos.z < 48.5 then - last = pos - elseif pos.x < 131.5 and pos.x > 128.5 and pos.z > 48.5 and pos.z < 49.5 then - last = pos - elseif pos.x < 130.5 and pos.x > 129.5 and pos.z > 49.5 and pos.z < 50.5 then - last = pos - elseif pos.x < 320.5 and pos.x > 315.5 and pos.z > 39.5 and pos.z < 48.5 then - last = pos - elseif pos.x < 319.5 and pos.x > 316.5 and pos.z > 48.5 and pos.z < 49.5 then - last = pos - elseif pos.x < 318.5 and pos.x > 317.5 and pos.z > 49.5 and pos.z < 50.5 then - last = pos - elseif pos.x < 168.5 and pos.x > 161.5 and pos.z > 40.5 and pos.z < 51.5 then - last = pos - elseif pos.x < 166.5 and pos.x > 163.5 and pos.z > 51.5 and pos.z < 53.5 then - last = pos - elseif pos.x < 165.5 and pos.x > 164.5 and pos.z > 53.5 and pos.z < 55.5 then - last = pos - elseif pos.y < 8 then - player:setpos(last) - elseif minetest.get_node({x=pos.x, y=(pos.y-0.5),z=pos.z}).name ~= "air" then - last = pos - end + if btimer == 0 then + if pos.x < -9.5 and pos.x > -15.5 and pos.z > -62.5 and pos.z < -54 and tonumber(ship1) > 1 then + last = pos + elseif pos.x < -10.5 and pos.x > -14.5 and pos.z > -63.5 and pos.z < -62.5 and tonumber(ship1) > 1 then + last = pos + elseif pos.x < -11.5 and pos.x > -13.5 and pos.z > -64.5 and pos.z < -63.5 and tonumber(ship1) > 1 then + last = pos + elseif pos.x < 132.5 and pos.x > 127.5 and pos.z > 39.5 and pos.z < 48.5 then + last = pos + elseif pos.x < 131.5 and pos.x > 128.5 and pos.z > 48.5 and pos.z < 49.5 then + last = pos + elseif pos.x < 130.5 and pos.x > 129.5 and pos.z > 49.5 and pos.z < 50.5 then + last = pos + elseif pos.x < 320.5 and pos.x > 315.5 and pos.z > 39.5 and pos.z < 48.5 then + last = pos + elseif pos.x < 319.5 and pos.x > 316.5 and pos.z > 48.5 and pos.z < 49.5 then + last = pos + elseif pos.x < 318.5 and pos.x > 317.5 and pos.z > 49.5 and pos.z < 50.5 then + last = pos + elseif pos.x < 168.5 and pos.x > 161.5 and pos.z > 40.5 and pos.z < 51.5 then + last = pos + elseif pos.x < 166.5 and pos.x > 163.5 and pos.z > 51.5 and pos.z < 53.5 then + last = pos + elseif pos.x < 165.5 and pos.x > 164.5 and pos.z > 53.5 and pos.z < 55.5 then + last = pos + elseif minetest.get_node({x=pos.x,y=pos.y-1, z = pos.z}).name == "default:wood" then + last = pos + elseif minetest.get_node({x=pos.x,y=pos.y-1, z = pos.z}).name == "castrum:sea_fight1" then + last = pos + elseif minetest.get_node({x=pos.x,y=pos.y-1, z = pos.z}).name == "castrum:island_start_fight" then + last = pos + elseif minetest.get_node({x=pos.x,y=pos.y-1, z = pos.z}).name == "castrum:turn_ship" then + last = pos + elseif minetest.get_node({x=pos.x,y=pos.y-1, z = pos.z}).name == "castrum:fire_cannon_ready" then + last = pos + elseif minetest.get_node({x=pos.x,y=pos.y-1, z = pos.z}).name == "castrum:fire_cannon_5" then + last = pos + elseif minetest.get_node({x=pos.x,y=pos.y-1, z = pos.z}).name == "castrum:fire_cannon_4" then + last = pos + elseif minetest.get_node({x=pos.x,y=pos.y-1, z = pos.z}).name == "castrum:fire_cannon_3" then + last = pos + elseif minetest.get_node({x=pos.x,y=pos.y-1, z = pos.z}).name == "castrum:fire_cannon_2" then + last = pos + elseif minetest.get_node({x=pos.x,y=pos.y-1, z = pos.z}).name == "castrum:fire_cannon_1" then + last = pos + elseif pos.y < 8 then + player:setpos(last) + elseif minetest.get_node({x=pos.x, y=(pos.y-0.5),z=pos.z}).name ~= "air" then + last = pos + end + end + if btimer > 5 then + btimer = 0 + end if minetest.get_node({x=-4, y=8,z=-52}).name == "default:wood" or minetest.get_node({x=-8, y=8,z=-65}).name == "default:wood" or minetest.get_node({x=121, y=8,z=38}).name == "default:wood" or minetest.get_node({x=125, y=8,z=51}).name == "default:wood" then file = io.open(minetest.get_worldpath().."/SAVE/Pier.txt", "r") local level = file:read("*l") @@ -393,6 +455,9 @@ minetest.register_globalstep(function(dtime) elseif tonumber(quarry) == 5 then quarrytime = 1.6 quarrynum = 3 + elseif tonumber(quarry) == 6 then + quarrytime = 1.5 + quarrynum = 3 end local treetime = 0 local treenum = 1 @@ -414,6 +479,9 @@ minetest.register_globalstep(function(dtime) elseif tonumber(tree) == 6 then treetime = 2.7 treenum = 3 + elseif tonumber(tree) == 7 then + treetime = 2.4 + treenum = 4 end local minetime = 0 local minenum = 1 @@ -430,7 +498,10 @@ minetest.register_globalstep(function(dtime) minetime = 7 minenum = 2 elseif tonumber(mine) == 5 then - minetime = 6.5 + minetime = 5.5 + minenum = 3 + elseif tonumber(mine) == 6 then + minetime = 4.5 minenum = 3 end local laketime = 0 @@ -457,6 +528,9 @@ minetest.register_globalstep(function(dtime) elseif tonumber(sandmine) == 3 then sandminetime = 2 sandminenum = 2 + elseif tonumber(sandmine) == 4 then + sandminetime = 1.8 + sandminenum = 3 end local lake2time = 0 if tonumber(lake2) == 1 then @@ -477,6 +551,8 @@ minetest.register_globalstep(function(dtime) cactusfarmtime = 9 elseif tonumber(cactusfarm) == 4 then cactusfarmtime = 7 + elseif tonumber(cactusfarm) == 5 then + cactusfarmtime = 5.5 end local mountain_quarrytime = 0 if tonumber(mountain_quarry) == 0 then @@ -517,11 +593,15 @@ minetest.register_globalstep(function(dtime) if inv then tree2 = tree2+1 tree3 = tree3+1 + tree4 = tree4+1 if tree2 == 2 then tree2 = 0 end if tree3 == 3 then tree3 = 0 + end + if tree4 == 4 then + tree4 = 0 end inv:add_item("main", "default:wood") if treenum > 1 and tree2 == 1 then @@ -529,6 +609,9 @@ minetest.register_globalstep(function(dtime) end if treenum > 2 and tree3 == 1 then inv:add_item("main", "default:pine_wood") + end + if treenum > 3 and tree4 == 1 then + inv:add_item("main", "default:acacia_wood") end end end @@ -572,12 +655,19 @@ minetest.register_globalstep(function(dtime) local inv = minetest.get_inventory({type="node", pos={x=132, y=9, z=15}}) if inv then sandmine2 = sandmine2+1 + sandmine3 = sandmine3+1 if sandmine2 == 2 then sandmine2 = 0 + end + if sandmine3 == 3 then + sandmine3 = 0 end inv:add_item("main", "default:sand") if sandminenum > 1 and sandmine2 == 1 then inv:add_item("main", "default:desert_sand") + end + if sandminenum > 1 and sandmine3 == 1 then + inv:add_item("main", "default:silver_sand") end end end @@ -671,47 +761,47 @@ minetest.register_on_dignode(function(pos, node, digger) digger:set_attribute("fightpos", minetest.pos_to_string(pos)) if minetest.get_node({x=pos.x-1, y=9, z=pos.z}).name == "castrum:knight_lv1_dark" or minetest.get_node({x=pos.x-1, y=9, z=pos.z}).name == "castrum:knight_lv2_dark" or minetest.get_node({x=pos.x-1, y=9, z=pos.z}).name == "castrum:knight_lv3_dark" or minetest.get_node({x=pos.x-1, y=9, z=pos.z}).name == "castrum:knight_dark" then minetest.set_node({x=pos.x-1, y=8, z=pos.z}, {name="castrum:fight2"}) - elseif (minetest.get_node({x=pos.x-1, y=9, z=pos.z}).name ~= "castrum:knight_lv1" or minetest.get_node({x=pos.x-1, y=9, z=pos.z}).name ~= "castrum:knight_lv2") and minetest.get_node({x=pos.x-1, y=8, z=pos.z}).name ~= "default:gravel" then + elseif minetest.get_node({x=pos.x-1, y=9, z=pos.z}).name ~= "castrum:knight_lv1" and minetest.get_node({x=pos.x-1, y=9, z=pos.z}).name ~= "castrum:knight_lv2" and minetest.get_node({x=pos.x-1, y=9, z=pos.z}).name ~= "castrum:knight_lv3" and minetest.get_node({x=pos.x-1, y=8, z=pos.z}).name ~= "default:gravel" then minetest.set_node({x=pos.x-1, y=8, z=pos.z}, {name="castrum:fight1"}) end if minetest.get_node({x=pos.x-1, y=9, z=pos.z-1}).name == "castrum:knight_lv1_dark" or minetest.get_node({x=pos.x-1, y=9, z=pos.z-1}).name == "castrum:knight_lv2_dark" or minetest.get_node({x=pos.x-1, y=9, z=pos.z-1}).name == "castrum:knight_lv3_dark" or minetest.get_node({x=pos.x-1, y=9, z=pos.z-1}).name == "castrum:knight_dark" then minetest.set_node({x=pos.x-1, y=8, z=pos.z-1}, {name="castrum:fight2"}) - elseif (minetest.get_node({x=pos.x-1, y=9, z=pos.z-1}).name ~= "castrum:knight_lv1" or minetest.get_node({x=pos.x-1, y=9, z=pos.z-1}).name ~= "castrum:knight_lv2" or minetest.get_node({x=pos.x-1, y=9, z=pos.z-1}).name ~= "castrum:knight_lv3") and minetest.get_node({x=pos.x-1, y=8, z=pos.z-1}).name ~= "default:gravel" then + elseif minetest.get_node({x=pos.x-1, y=9, z=pos.z-1}).name ~= "castrum:knight_lv1" and minetest.get_node({x=pos.x-1, y=9, z=pos.z-1}).name ~= "castrum:knight_lv2" and minetest.get_node({x=pos.x-1, y=9, z=pos.z-1}).name ~= "castrum:knight_lv3" and minetest.get_node({x=pos.x-1, y=8, z=pos.z-1}).name ~= "default:gravel" then minetest.set_node({x=pos.x-1, y=8, z=pos.z-1}, {name="castrum:fight1"}) end if minetest.get_node({x=pos.x-1, y=9, z=pos.z+1}).name == "castrum:knight_lv1_dark" or minetest.get_node({x=pos.x-1, y=9, z=pos.z+1}).name == "castrum:knight_lv2_dark" or minetest.get_node({x=pos.x-1, y=9, z=pos.z+1}).name == "castrum:knight_lv3_dark" or minetest.get_node({x=pos.x-1, y=9, z=pos.z+1}).name == "castrum:knight_dark" then minetest.set_node({x=pos.x-1, y=8, z=pos.z+1}, {name="castrum:fight2"}) - elseif (minetest.get_node({x=pos.x-1, y=9, z=pos.z+1}).name ~= "castrum:knight_lv1" or minetest.get_node({x=pos.x-1, y=9, z=pos.z+1}).name ~= "castrum:knight_lv2"or minetest.get_node({x=pos.x-1, y=9, z=pos.z+1}).name ~= "castrum:knight_lv3") and minetest.get_node({x=pos.x-1, y=8, z=pos.z+1}).name ~= "default:gravel" then + elseif minetest.get_node({x=pos.x-1, y=9, z=pos.z+1}).name ~= "castrum:knight_lv1" and minetest.get_node({x=pos.x-1, y=9, z=pos.z+1}).name ~= "castrum:knight_lv2"and minetest.get_node({x=pos.x-1, y=9, z=pos.z+1}).name ~= "castrum:knight_lv3" and minetest.get_node({x=pos.x-1, y=8, z=pos.z+1}).name ~= "default:gravel" then minetest.set_node({x=pos.x-1, y=8, z=pos.z+1}, {name="castrum:fight1"}) end if minetest.get_node({x=pos.x, y=9, z=pos.z}).name == "castrum:knight_lv1_dark" or minetest.get_node({x=pos.x, y=9, z=pos.z}).name == "castrum:knight_lv2_dark" or minetest.get_node({x=pos.x, y=9, z=pos.z}).name == "castrum:knight_lv3_dark" or minetest.get_node({x=pos.x, y=9, z=pos.z}).name == "castrum:knight_dark" then minetest.set_node({x=pos.x, y=8, z=pos.z}, {name="castrum:fight2"}) - elseif (minetest.get_node({x=pos.x, y=9, z=pos.z}).name ~= "castrum:knight_lv1" or minetest.get_node({x=pos.x, y=9, z=pos.z}).name ~= "castrum:knight_lv2" or minetest.get_node({x=pos.x, y=9, z=pos.z}).name ~= "castrum:knight_lv3") and minetest.get_node({x=pos.x, y=8, z=pos.z}).name ~= "default:gravel" then + elseif minetest.get_node({x=pos.x, y=9, z=pos.z}).name ~= "castrum:knight_lv1" and minetest.get_node({x=pos.x, y=9, z=pos.z}).name ~= "castrum:knight_lv2" and minetest.get_node({x=pos.x, y=9, z=pos.z}).name ~= "castrum:knight_lv3" and minetest.get_node({x=pos.x, y=8, z=pos.z}).name ~= "default:gravel" then minetest.set_node({x=pos.x, y=8, z=pos.z}, {name="castrum:fight1"}) end if minetest.get_node({x=pos.x, y=9, z=pos.z-1}).name == "castrum:knight_lv1_dark" or minetest.get_node({x=pos.x, y=9, z=pos.z-1}).name == "castrum:knight_lv2_dark" or minetest.get_node({x=pos.x, y=9, z=pos.z-1}).name == "castrum:knight_lv3_dark" or minetest.get_node({x=pos.x, y=9, z=pos.z-1}).name == "castrum:knight_dark" then minetest.set_node({x=pos.x, y=8, z=pos.z-1}, {name="castrum:fight2"}) - elseif (minetest.get_node({x=pos.x, y=9, z=pos.z-1}).name ~= "castrum:knight_lv1" or minetest.get_node({x=pos.x, y=9, z=pos.z-1}).name ~= "castrum:knight_lv2" or minetest.get_node({x=pos.x, y=9, z=pos.z-1}).name ~= "castrum:knight_lv3") and minetest.get_node({x=pos.x, y=8, z=pos.z-1}).name ~= "default:gravel" then + elseif minetest.get_node({x=pos.x, y=9, z=pos.z-1}).name ~= "castrum:knight_lv1" and minetest.get_node({x=pos.x, y=9, z=pos.z-1}).name ~= "castrum:knight_lv2" and minetest.get_node({x=pos.x, y=9, z=pos.z-1}).name ~= "castrum:knight_lv3" and minetest.get_node({x=pos.x, y=8, z=pos.z-1}).name ~= "default:gravel" then minetest.set_node({x=pos.x, y=8, z=pos.z-1}, {name="castrum:fight1"}) end if minetest.get_node({x=pos.x, y=9, z=pos.z+1}).name == "castrum:knight_lv1_dark" or minetest.get_node({x=pos.x, y=9, z=pos.z+1}).name == "castrum:knight_lv2_dark" or minetest.get_node({x=pos.x, y=9, z=pos.z+1}).name == "castrum:knight_lv3_dark" or minetest.get_node({x=pos.x, y=9, z=pos.z+1}).name == "castrum:knight_dark" then minetest.set_node({x=pos.x, y=8, z=pos.z+1}, {name="castrum:fight2"}) - elseif (minetest.get_node({x=pos.x, y=9, z=pos.z+1}).name ~= "castrum:knight_lv1" or minetest.get_node({x=pos.x, y=9, z=pos.z+1}).name ~= "castrum:knight_lv2" or minetest.get_node({x=pos.x, y=9, z=pos.z+1}).name ~= "castrum:knight_lv3") and minetest.get_node({x=pos.x, y=8, z=pos.z+1}).name ~= "default:gravel" then + elseif minetest.get_node({x=pos.x, y=9, z=pos.z+1}).name ~= "castrum:knight_lv1" and minetest.get_node({x=pos.x, y=9, z=pos.z+1}).name ~= "castrum:knight_lv2" and minetest.get_node({x=pos.x, y=9, z=pos.z+1}).name ~= "castrum:knight_lv3" and minetest.get_node({x=pos.x, y=8, z=pos.z+1}).name ~= "default:gravel" then minetest.set_node({x=pos.x, y=8, z=pos.z+1}, {name="castrum:fight1"}) end if minetest.get_node({x=pos.x+1, y=9, z=pos.z}).name == "castrum:knight_lv1_dark" or minetest.get_node({x=pos.x+1, y=9, z=pos.z}).name == "castrum:knight_lv2_dark" or minetest.get_node({x=pos.x+1, y=9, z=pos.z}).name == "castrum:knight_lv3_dark" or minetest.get_node({x=pos.x+1, y=9, z=pos.z}).name == "castrum:knight_dark" then minetest.set_node({x=pos.x+1, y=8, z=pos.z}, {name="castrum:fight2"}) - elseif (minetest.get_node({x=pos.x+1, y=9, z=pos.z}).name ~= "castrum:knight_lv1" or minetest.get_node({x=pos.x+1, y=9, z=pos.z}).name ~= "castrum:knight_lv2" or minetest.get_node({x=pos.x+1, y=9, z=pos.z}).name ~= "castrum:knight_lv3") and minetest.get_node({x=pos.x+1, y=8, z=pos.z}).name ~= "default:gravel" then + elseif minetest.get_node({x=pos.x+1, y=9, z=pos.z}).name ~= "castrum:knight_lv1" and minetest.get_node({x=pos.x+1, y=9, z=pos.z}).name ~= "castrum:knight_lv2" and minetest.get_node({x=pos.x+1, y=9, z=pos.z}).name ~= "castrum:knight_lv3" and minetest.get_node({x=pos.x+1, y=8, z=pos.z}).name ~= "default:gravel" then minetest.set_node({x=pos.x+1, y=8, z=pos.z}, {name="castrum:fight1"}) end if minetest.get_node({x=pos.x+1, y=9, z=pos.z-1}).name == "castrum:knight_lv1_dark" or minetest.get_node({x=pos.x+1, y=9, z=pos.z-1}).name == "castrum:knight_lv2_dark" or minetest.get_node({x=pos.x+1, y=9, z=pos.z-1}).name == "castrum:knight_lv3_dark" or minetest.get_node({x=pos.x+1, y=9, z=pos.z-1}).name == "castrum:knight_dark" then minetest.set_node({x=pos.x+1, y=8, z=pos.z-1}, {name="castrum:fight2"}) - elseif (minetest.get_node({x=pos.x+1, y=9, z=pos.z-1}).name ~= "castrum:knight_lv1" or minetest.get_node({x=pos.x+1, y=9, z=pos.z-1}).name ~= "castrum:knight_lv2" or minetest.get_node({x=pos.x+1, y=9, z=pos.z-1}).name ~= "castrum:knight_lv3") and minetest.get_node({x=pos.x+1, y=8, z=pos.z-1}).name ~= "default:gravel" then + elseif minetest.get_node({x=pos.x+1, y=9, z=pos.z-1}).name ~= "castrum:knight_lv1" and minetest.get_node({x=pos.x+1, y=9, z=pos.z-1}).name ~= "castrum:knight_lv2" and minetest.get_node({x=pos.x+1, y=9, z=pos.z-1}).name ~= "castrum:knight_lv3" and minetest.get_node({x=pos.x+1, y=8, z=pos.z-1}).name ~= "default:gravel" then minetest.set_node({x=pos.x+1, y=8, z=pos.z-1}, {name="castrum:fight1"}) end if minetest.get_node({x=pos.x+1, y=9, z=pos.z+1}).name == "castrum:knight_lv1_dark" or minetest.get_node({x=pos.x+1, y=9, z=pos.z+1}).name == "castrum:knight_lv2_dark" or minetest.get_node({x=pos.x+1, y=9, z=pos.z+1}).name == "castrum:knight_lv3_dark" or minetest.get_node({x=pos.x+1, y=9, z=pos.z+1}).name == "castrum:knight_dark" then minetest.set_node({x=pos.x+1, y=8, z=pos.z+1}, {name="castrum:fight2"}) - elseif (minetest.get_node({x=pos.x+1, y=9, z=pos.z+1}).name ~= "castrum:knight_lv1" or minetest.get_node({x=pos.x+1, y=9, z=pos.z+1}).name ~= "castrum:knight_lv2" or minetest.get_node({x=pos.x+1, y=9, z=pos.z+1}).name ~= "castrum:knight_lv3") and minetest.get_node({x=pos.x+1, y=8, z=pos.z+1}).name ~= "default:gravel" then + elseif minetest.get_node({x=pos.x+1, y=9, z=pos.z+1}).name ~= "castrum:knight_lv1" and minetest.get_node({x=pos.x+1, y=9, z=pos.z+1}).name ~= "castrum:knight_lv2" and minetest.get_node({x=pos.x+1, y=9, z=pos.z+1}).name ~= "castrum:knight_lv3" and minetest.get_node({x=pos.x+1, y=8, z=pos.z+1}).name ~= "default:gravel" then minetest.set_node({x=pos.x+1, y=8, z=pos.z+1}, {name="castrum:fight1"}) end if node.name == "castrum:knight_lv1" then @@ -832,15 +922,15 @@ minetest.register_on_dignode(function(pos, node, digger) end end end) - function minetest.handle_node_drops(pos, drops, digger) end minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing) + if minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "castrum:fight1" and newnode.name == "castrum:knight_lv1" then minetest.set_node(pos, {name="castrum:knight_lv1"}) screwdriver_handler(placer, {type="node", under=pos, above=pos}, 1) local inv = placer:get_inventory() - inv:remove_item("main", "castrum:knight_lv1") + Item_Remove2(player, "main", "castrum:knight_lv1") local fight = placer:get_attribute("fight") placer:set_attribute("fightdig", "false") if fight == "true" then @@ -855,7 +945,7 @@ minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack minetest.set_node(pos, {name="castrum:knight_lv2"}) screwdriver_handler(placer, {type="node", under=pos, above=pos}, 1) local inv = placer:get_inventory() - inv:remove_item("main", "castrum:knight_lv2") + Item_Remove2(player, "main", "castrum:knight_lv2") local fight = placer:get_attribute("fight") placer:set_attribute("fightdig", "false") if fight == "true" then @@ -870,7 +960,7 @@ minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack minetest.set_node(pos, {name="castrum:knight_lv3"}) screwdriver_handler(placer, {type="node", under=pos, above=pos}, 1) local inv = placer:get_inventory() - inv:remove_item("main", "castrum:knight_lv3") + Item_Remove2(player, "main", "castrum:knight_lv3") local fight = placer:get_attribute("fight") placer:set_attribute("fightdig", "false") if fight == "true" then @@ -881,6 +971,14 @@ minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack end fight_step2(placer) end + elseif minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "castrum:sea_fight1" and newnode.name == "castrum:pirate_lv1" then + minetest.set_node(pos, {name="castrum:pirate_lv1"}) + minetest.set_node({x=pos.x, y=pos.y-1, z=pos.z}, {name="default:wood"}) + if pos.z == -24 then + screwdriver_handler(placer, {type="node", under=pos, above=pos}, 1) + screwdriver_handler(placer, {type="node", under=pos, above=pos}, 1) + end + else minetest.set_node(pos, {name=oldnode.name}) return itemstack @@ -969,6 +1067,16 @@ function Home1(v,player) end end end + elseif v+0 == 9 then + for i=26,32 do + for j=19,25 do + for k=9,14 do + if minetest.get_node({x=i*(-1), y=k, z=j*(-1)}).name == "default:pine_wood" then + minetest.set_node({x=i*(-1), y=k, z=j*(-1)}, {name="default:acacia_wood"}) + end + end + end + end elseif v+0 == 0 then for i=26,32 do for j=19,25 do @@ -6097,13 +6205,26 @@ function Mine(v,player) minetest.set_node({x=-11, y=11, z=-7}, {name="default:stone_with_iron"}) minetest.set_node({x=-12, y=9, z=-9}, {name="default:stone_with_tin"}) minetest.set_node({x=-16, y=9, z=-11}, {name="default:stone_with_tin"}) - minetest.set_node({x=-12, y=9, z=-6}, {name="default:stone_with_copper"}) - minetest.set_node({x=-13, y=9, z=-10}, {name="default:stone_with_copper"}) minetest.set_node({x=-11, y=9, z=-13}, {name="default:stone_with_copper"}) minetest.set_node({x=-18, y=9, z=-6}, {name="default:stone_with_copper"}) minetest.set_node({x=-18, y=9, z=-14}, {name="default:stone_with_copper"}) + elseif v+0 == 6 then + minetest.set_node({x=-12, y=10, z=-9}, {name="default:stone_with_tin"}) + minetest.set_node({x=-16, y=10, z=-11}, {name="default:stone_with_tin"}) + minetest.set_node({x=-12, y=10, z=-6}, {name="default:stone_with_copper"}) + minetest.set_node({x=-13, y=10, z=-10}, {name="default:stone_with_copper"}) + minetest.set_node({x=-11, y=10, z=-13}, {name="default:stone_with_copper"}) + minetest.set_node({x=-18, y=10, z=-6}, {name="default:stone_with_copper"}) + minetest.set_node({x=-18, y=10, z=-14}, {name="default:stone_with_copper"}) + minetest.set_node({x=-11, y=9, z=-14}, {name="default:stone_with_copper"}) + minetest.set_node({x=-17, y=9, z=-6}, {name="default:stone_with_copper"}) + minetest.set_node({x=-19, y=9, z=-6}, {name="default:stone_with_copper"}) + minetest.set_node({x=-19, y=9, z=-14}, {name="default:stone_with_copper"}) + minetest.set_node({x=-16, y=9, z=-10}, {name="default:stone_with_tin"}) + minetest.set_node({x=-16, y=9, z=-12}, {name="default:stone_with_tin"}) + minetest.set_node({x=-17, y=9, z=-11}, {name="default:stone_with_tin"}) elseif v+0 == 0 then for j=11,19 do for i=6,14 do @@ -6226,6 +6347,14 @@ function Quarry(v,player) minetest.set_node({x=-17, y=9, z=7}, {name="default:obsidian"}) minetest.set_node({x=-19, y=9, z=7}, {name="default:obsidian"}) minetest.set_node({x=-19, y=9, z=-1}, {name="default:obsidian"}) + elseif v+0 == 6 then + minetest.set_node({x=-12, y=11, z=7}, {name="default:obsidian"}) + minetest.set_node({x=-12, y=11, z=4}, {name="default:obsidian"}) + minetest.set_node({x=-11, y=11, z=0}, {name="default:obsidian"}) + minetest.set_node({x=-13, y=11, z=3}, {name="default:obsidian"}) + minetest.set_node({x=-16, y=11, z=2}, {name="default:obsidian"}) + minetest.set_node({x=-18, y=11, z=7}, {name="default:obsidian"}) + minetest.set_node({x=-18, y=11, z=-1}, {name="default:obsidian"}) elseif v+0 == 0 then for j=11,19 do for i=0,7 do @@ -6372,6 +6501,39 @@ function Tree(v,player) minetest.set_node({x=-12, y=9, z=12}, {name="air"}) minetest.set_node({x=-11, y=9, z=13}, {name="air"}) minetest.set_node({x=-13, y=9, z=13}, {name="air"}) + elseif v+0 == 7 then + minetest.set_node({x=-12, y=12, z=13}, {name="default:pine_tree"}) + minetest.set_node({x=-12, y=11, z=14}, {name="air"}) + minetest.set_node({x=-12, y=11, z=12}, {name="air"}) + minetest.set_node({x=-11, y=11, z=14}, {name="air"}) + minetest.set_node({x=-11, y=11, z=13}, {name="air"}) + minetest.set_node({x=-11, y=11, z=12}, {name="air"}) + minetest.set_node({x=-13, y=11, z=14}, {name="air"}) + minetest.set_node({x=-13, y=11, z=13}, {name="air"}) + minetest.set_node({x=-13, y=11, z=12}, {name="air"}) + minetest.set_node({x=-13, y=12, z=14}, {name="default:pine_needles"}) + minetest.set_node({x=-11, y=12, z=14}, {name="default:pine_needles"}) + minetest.set_node({x=-11, y=12, z=12}, {name="default:pine_needles"}) + minetest.set_node({x=-13, y=12, z=12}, {name="default:pine_needles"}) + minetest.set_node({x=-12, y=12, z=14}, {name="default:pine_needles"}) + minetest.set_node({x=-12, y=12, z=12}, {name="default:pine_needles"}) + minetest.set_node({x=-11, y=12, z=13}, {name="default:pine_needles"}) + minetest.set_node({x=-13, y=12, z=13}, {name="default:pine_needles"}) + minetest.set_node({x=-12, y=13, z=13}, {name="default:pine_needles"}) + minetest.set_node({x=-11, y=13, z=13}, {name="default:pine_needles"}) + minetest.set_node({x=-13, y=13, z=13}, {name="default:pine_needles"}) + minetest.set_node({x=-12, y=13, z=12}, {name="default:pine_needles"}) + minetest.set_node({x=-12, y=13, z=14}, {name="default:pine_needles"}) + minetest.set_node({x=-12, y=12, z=15}, {name="default:pine_needles"}) + minetest.set_node({x=-14, y=12, z=13}, {name="default:pine_needles"}) + + + minetest.set_node({x=-18, y=9, z=19}, {name="default:acacia_tree"}) + minetest.set_node({x=-18, y=9, z=20}, {name="default:acacia_leaves"}) + minetest.set_node({x=-18, y=9, z=18}, {name="default:acacia_leaves"}) + minetest.set_node({x=-17, y=9, z=19}, {name="default:acacia_leaves"}) + minetest.set_node({x=-19, y=9, z=19}, {name="default:acacia_leaves"}) + minetest.set_node({x=-18, y=10, z=19}, {name="default:acacia_leaves"}) elseif v+0 == 0 then for j=11,19 do for i=12,20 do @@ -6841,12 +7003,12 @@ function Ship2(v,player) minetest.set_node({x=165, y=7, z=44}, {name="castrum:sail1"}) minetest.set_node({x=165, y=7, z=50}, {name="castrum:sail2"}) - minetest.set_node({x=168, y=7, z=42}, {name="castrum:comming_soon"}) + minetest.set_node({x=168, y=7, z=42}, {name="castrum:cannon1"}) minetest.set_node({x=168, y=7, z=46}, {name="castrum:comming_soon"}) minetest.set_node({x=168, y=7, z=48}, {name="castrum:comming_soon"}) minetest.set_node({x=168, y=7, z=50}, {name="castrum:comming_soon"}) - minetest.set_node({x=162, y=7, z=42}, {name="castrum:comming_soon"}) + minetest.set_node({x=162, y=7, z=42}, {name="castrum:cannon2"}) minetest.set_node({x=162, y=7, z=44}, {name="castrum:comming_soon"}) minetest.set_node({x=162, y=7, z=46}, {name="castrum:comming_soon"}) minetest.set_node({x=162, y=7, z=48}, {name="castrum:comming_soon"}) @@ -7047,6 +7209,19 @@ function Camp2(v,player) end end end +function Camp3(v,player) + if v+0 == 1 then + minetest.set_node({x=-85, y=9, z=-57}, {name="castrum:fire"}) + elseif v+0 == 0 then + for j=81,89 do + for i=53,61 do + for k=9,9 do + minetest.set_node({x=j*(-1), y=k, z=i*(-1)}, {name="air"}) + end + end + end + end +end function Island_Walle(v,player) if v+0 == 1 then for i=0,33 do @@ -7553,6 +7728,23 @@ function Sandmine(v,player) minetest.set_node({x=130, y=9, z=12}, {name="default:desert_sandstone"}) minetest.set_node({x=131, y=9, z=13}, {name="default:desert_sandstone"}) minetest.set_node({x=131, y=9, z=11}, {name="default:desert_sandstone"}) + elseif v+0 == 4 then + minetest.set_node({x=131, y=11, z=12}, {name="default:desert_sandstone"}) + minetest.set_node({x=130, y=11, z=8}, {name="default:desert_sandstone"}) + minetest.set_node({x=127, y=11, z=9}, {name="default:desert_sandstone"}) + minetest.set_node({x=127, y=11, z=13}, {name="default:desert_sandstone"}) + minetest.set_node({x=126, y=11, z=6}, {name="default:desert_sandstone"}) + minetest.set_node({x=124, y=11, z=12}, {name="default:desert_sandstone"}) + minetest.set_node({x=123, y=11, z=7}, {name="default:desert_sandstone"}) + + minetest.set_node({x=123, y=9, z=13}, {name="default:silver_sandstone"}) + minetest.set_node({x=123, y=9, z=13}, {name="default:silver_sandstone"}) + minetest.set_node({x=124, y=9, z=6}, {name="default:silver_sandstone"}) + minetest.set_node({x=124, y=9, z=9}, {name="default:silver_sandstone"}) + minetest.set_node({x=125, y=9, z=10}, {name="default:silver_sandstone"}) + minetest.set_node({x=128, y=9, z=11}, {name="default:silver_sandstone"}) + minetest.set_node({x=130, y=9, z=6}, {name="default:silver_sandstone"}) + minetest.set_node({x=130, y=9, z=14}, {name="default:silver_sandstone"}) elseif v+0 == 0 then for j=123,131 do for i=6,14 do @@ -7671,6 +7863,30 @@ function Battleground(v,player) end end end + elseif v+0 == 9 then + minetest.set_node({x=-72, y=11, z=-80}, {name="default:desert_stone_block"}) + minetest.set_node({x=-72, y=11, z=-82}, {name="default:desert_stone_block"}) + minetest.set_node({x=-72, y=11, z=-84}, {name="default:desert_stone_block"}) + minetest.set_node({x=-74, y=11, z=-84}, {name="default:desert_stone_block"}) + minetest.set_node({x=-76, y=11, z=-84}, {name="default:desert_stone_block"}) + minetest.set_node({x=-76, y=11, z=-82}, {name="default:desert_stone_block"}) + minetest.set_node({x=-76, y=11, z=-80}, {name="default:desert_stone_block"}) + minetest.set_node({x=-72, y=9, z=-80}, {name="default:desert_stone_block"}) + minetest.set_node({x=-72, y=9, z=-82}, {name="default:desert_stone_block"}) + minetest.set_node({x=-72, y=9, z=-84}, {name="default:desert_stone_block"}) + minetest.set_node({x=-74, y=9, z=-84}, {name="default:desert_stone_block"}) + minetest.set_node({x=-76, y=9, z=-84}, {name="default:desert_stone_block"}) + minetest.set_node({x=-76, y=9, z=-82}, {name="default:desert_stone_block"}) + minetest.set_node({x=-76, y=9, z=-80}, {name="default:desert_stone_block"}) + minetest.set_node({x=-74, y=9, z=-80}, {name="default:desert_stone_block"}) + minetest.set_node({x=-73, y=10, z=-80}, {name="default:desert_stone_block"}) + minetest.set_node({x=-75, y=10, z=-80}, {name="default:desert_stone_block"}) + minetest.set_node({x=-76, y=10, z=-81}, {name="default:desert_stone_block"}) + minetest.set_node({x=-76, y=10, z=-83}, {name="default:desert_stone_block"}) + minetest.set_node({x=-72, y=10, z=-81}, {name="default:desert_stone_block"}) + minetest.set_node({x=-72, y=10, z=-83}, {name="default:desert_stone_block"}) + minetest.set_node({x=-73, y=10, z=-84}, {name="default:desert_stone_block"}) + minetest.set_node({x=-75, y=10, z=-84}, {name="default:desert_stone_block"}) elseif v+0 == 0 then for j=72,76 do for i=80,84 do @@ -7681,6 +7897,48 @@ function Battleground(v,player) end end end +function Island_Battleground(v,player) + if v+0 == 1 then + for j=180,184 do + for i=42,46 do + minetest.set_node({x=j, y=9, z=i}, {name="default:sandstone"}) + end + end + elseif v+0 == 2 then + for j=180,184 do + for i=42,46 do + minetest.set_node({x=j, y=10, z=i}, {name="default:sandstone"}) + end + end + minetest.set_node({x=180, y=10, z=44}, {name="air"}) + elseif v+0 == 3 then + minetest.set_node({x=180, y=11, z=46}, {name="default:sandstone"}) + minetest.set_node({x=182, y=11, z=46}, {name="default:sandstone"}) + minetest.set_node({x=184, y=11, z=46}, {name="default:sandstone"}) + minetest.set_node({x=184, y=11, z=44}, {name="default:sandstone"}) + minetest.set_node({x=184, y=11, z=42}, {name="default:sandstone"}) + minetest.set_node({x=182, y=11, z=42}, {name="default:sandstone"}) + minetest.set_node({x=180, y=11, z=42}, {name="default:sandstone"}) + elseif v+0 == 4 then + minetest.set_node({x=180, y=12, z=46}, {name="castrum:fire"}) + minetest.set_node({x=182, y=12, z=46}, {name="castrum:fire"}) + minetest.set_node({x=184, y=12, z=46}, {name="castrum:fire"}) + minetest.set_node({x=184, y=12, z=44}, {name="castrum:fire"}) + minetest.set_node({x=184, y=12, z=42}, {name="castrum:fire"}) + minetest.set_node({x=182, y=12, z=42}, {name="castrum:fire"}) + minetest.set_node({x=180, y=12, z=42}, {name="castrum:fire"}) + minetest.set_node({x=182, y=11, z=44}, {name="castrum:skeleton_captain"}) + screwdriver_handler(player, {type="node", under={x=182, y=11, z=44}, above={x=182, y=11, z=44}}, 1) + elseif v+0 == 0 then + for j=180,184 do + for i=42,46 do + for k=9,12 do + minetest.set_node({x=j, y=k, z=i}, {name="air"}) + end + end + end + end +end function Island_Smithy(v,player) if v+0 == 1 then for j=166,173 do @@ -7798,10 +8056,20 @@ function Cactusfarm(v,player) minetest.set_node({x=125, y=12, z=-4}, {name="castrum:cactus"}) minetest.set_node({x=127, y=12, z=-6}, {name="castrum:cactus"}) minetest.set_node({x=127, y=13, z=-4}, {name="castrum:cactus"}) + elseif v+0 == 5 then + minetest.set_node({x=129, y=13, z=-4}, {name="castrum:cactus"}) + minetest.set_node({x=127, y=13, z=-2}, {name="castrum:cactus"}) + minetest.set_node({x=125, y=13, z=-4}, {name="castrum:cactus"}) + minetest.set_node({x=127, y=13, z=-6}, {name="castrum:cactus"}) + minetest.set_node({x=127, y=14, z=-4}, {name="castrum:cactus"}) + minetest.set_node({x=130, y=12, z=-7}, {name="castrum:cactus"}) + minetest.set_node({x=130, y=12, z=-1}, {name="castrum:cactus"}) + minetest.set_node({x=124, y=12, z=-1}, {name="castrum:cactus"}) + minetest.set_node({x=124, y=12, z=-7}, {name="castrum:cactus"}) elseif v+0 == 0 then for j=123,131 do for i=0,8 do - for k=9,13 do + for k=9,14 do minetest.set_node({x=j, y=k, z=i*(-1)}, {name="air"}) end end @@ -8192,6 +8460,49 @@ function Island_Pier(v,player) end end end +function Island_Pier2(v,player) + if v+0 == 1 then + for j=176,178 do + for i=42,46 do + minetest.set_node({x=j, y=8, z=i}, {name="default:wood"}) + end + end + minetest.set_node({x=178, y=7, z=42}, {name="default:wood"}) + minetest.set_node({x=178, y=6, z=42}, {name="default:wood"}) + minetest.set_node({x=178, y=7, z=46}, {name="default:wood"}) + minetest.set_node({x=178, y=6, z=46}, {name="default:wood"}) + elseif v+0 == 2 then + for j=179,181 do + for i=42,46 do + minetest.set_node({x=j, y=8, z=i}, {name="default:wood"}) + end + end + minetest.set_node({x=181, y=7, z=42}, {name="default:wood"}) + minetest.set_node({x=181, y=6, z=42}, {name="default:wood"}) + minetest.set_node({x=181, y=7, z=46}, {name="default:wood"}) + minetest.set_node({x=181, y=6, z=46}, {name="default:wood"}) + elseif v+0 == 3 then + for j=182,184 do + for i=42,46 do + minetest.set_node({x=j, y=8, z=i}, {name="default:wood"}) + end + end + minetest.set_node({x=184, y=7, z=42}, {name="default:wood"}) + minetest.set_node({x=184, y=6, z=42}, {name="default:wood"}) + minetest.set_node({x=184, y=7, z=46}, {name="default:wood"}) + minetest.set_node({x=184, y=6, z=46}, {name="default:wood"}) + minetest.set_node({x=179, y=8, z=44}, {name="castrum:comming_soon"}) + elseif v+0 == 0 then + for j=176,184 do + for i=42,46 do + for k=6,7 do + minetest.set_node({x=j, y=k, z=i}, {name="default:water_source"}) + end + minetest.set_node({x=j, y=8, z=i}, {name="air"}) + end + end + end +end function Island_Barracks(v,player) if v+0 == 1 then for j=165,173 do @@ -8314,6 +8625,24 @@ function Sail2(v,player) end end end +function Cannon1(v,player) + if v+0 == 1 then + minetest.set_node({x=169, y=9, z=42}, {name="castrum:cannon_1_1"}) + screwdriver_handler(player, {type="node", under={x=169, y=9, z=42}, above={x=169, y=9, z=42}}, 1) + elseif v+0 == 0 then + minetest.set_node({x=169, y=9, z=42}, {name="air"}) + end +end +function Cannon2(v,player) + if v+0 == 1 then + minetest.set_node({x=161, y=9, z=42}, {name="castrum:cannon_1_1"}) + screwdriver_handler(player, {type="node", under={x=161, y=9, z=42}, above={x=161, y=9, z=42}}, 1) + screwdriver_handler(player, {type="node", under={x=161, y=9, z=42}, above={x=161, y=9, z=42}}, 1) + screwdriver_handler(player, {type="node", under={x=161, y=9, z=42}, above={x=161, y=9, z=42}}, 1) + elseif v+0 == 0 then + minetest.set_node({x=161, y=9, z=42}, {name="air"}) + end +end function Bridge_Status(player) file = io.open(minetest.get_worldpath().."/SAVE/Bridge.txt", "r") local level = file:read("*l") @@ -8472,6 +8801,9 @@ local knight_pos = { {37, -66, -71, 3}, {38, -66, -70, 3}, {39, -66, -69, 3}, + {40, -66, -68, 3}, + {41, -83, -54, 0}, + {42, -84, -54, 0}, } function Update_knight(player) @@ -8505,6 +8837,20 @@ function Update_knight(player) end minetest.set_node({x=-63, y=9, z=-70}, {name="castrum:fire"}) end + file = io.open(minetest.get_worldpath().."/SAVE/Camp3.txt", "r") + local camp3 = file:read("*l") + file:close() + if tonumber(camp3) > 0 then + for j=59,67 do + for i=81,89 do + for k=9,9 do + minetest.set_node({x=j*(-1), y=k, z=i*(-1)}, {name="air"}) + end + end + end + minetest.set_node({x=-85, y=9, z=-57}, {name="castrum:fire"}) + end + for i=1,tonumber(knight3) do print (i) minetest.set_node({x=knight_pos[i][2], y=9, z=knight_pos[i][3]}, {name="castrum:knight_lv3_sit"}) @@ -8603,6 +8949,19 @@ function Item_Remove(player,item,num) local num4 = num-num3 local test2 = player:get_inventory():remove_item("main", item.." "..num4):get_count() end +function Item_Remove2(player,list,item) + items = {} + for i in item:gmatch("%S+") do + table.insert(items, i) + end + local num2 = math.floor(tonumber(items[2])/99) + for i=1,num2 do + local test = player:get_inventory():remove_item(list, items[1].." 99"):get_count() + end + local num3 = num2*99 + local num4 = tonumber(items[2])-num3 + local test2 = player:get_inventory():remove_item(list, items[1].." "..num4):get_count() +end function nextrange(x, max) x = x + 1 if x > max then @@ -8666,19 +9025,25 @@ home1.get_formspec = function(player, pos) need2 = "10 Wooden Planks" need3 = "Fountain lv.1" elseif tonumber(level) == 6 then - label = (level-5).."/3" + label = (level-5).."/4" label2 = "Upgrade" need1 = "64 Cobblestone" need2 = "80 Jungle Wood Planks" need3 = "Fountain lv.2" elseif tonumber(level) == 7 then - label = (level-5).."/3" + label = (level-5).."/4" label2 = "Upgrade" need1 = "128 Cobblestone" need2 = "160 Pine Wood Planks" need3 = "Fountain lv.4" + elseif tonumber(level) == 8 then + label = (level-5).."/4" + label2 = "Upgrade" + need1 = "256 Cobblestone" + need2 = "320 Acacia Wood Planks" + need3 = "Fountain lv.6" else - label = (level-5).."/3" + label = (level-5).."/4" label2 = "Upgrade (comming soon)" end formspec = "size[5,6.5]" @@ -9809,23 +10174,27 @@ mine.get_formspec = function(player, pos) label2 = "Build" need1 = "Fountain lv.3" elseif tonumber(level) == 1 then - label = (level).."/5" + label = (level).."/6" label2 = "Upgrade" need1 = "Completed chapter 2" elseif tonumber(level) == 2 then - label = (level).."/5" + label = (level).."/6" label2 = "Upgrade" need1 = "Completed chapter 3" elseif tonumber(level) == 3 then - label = (level).."/5" + label = (level).."/6" label2 = "Upgrade" need1 = "Completed chapter 4" elseif tonumber(level) == 4 then - label = (level).."/5" + label = (level).."/6" label2 = "Upgrade" need1 = "Completed chapter 5" + elseif tonumber(level) == 5 then + label = (level).."/6" + label2 = "Upgrade" + need1 = "Completed chapter 6" else - label = (level).."/5" + label = (level).."/6" label2 = "Upgrade (comming soon)" end formspec = "size[5,6.5]" @@ -9857,27 +10226,31 @@ quarry.get_formspec = function(player, pos) local need3 = "" local need4 = "" if tonumber(level) == 0 then - label = (level+1).."/6" + label = (level+1).."/7" label2 = "Upgrade" need1 = "Completed chapter 1" elseif tonumber(level) == 1 then - label = (level+1).."/6" + label = (level+1).."/7" label2 = "Upgrade" need1 = "Completed chapter 2" elseif tonumber(level) == 2 then - label = (level+1).."/6" + label = (level+1).."/7" label2 = "Upgrade" need1 = "Completed chapter 3" elseif tonumber(level) == 3 then - label = (level+1).."/6" + label = (level+1).."/7" label2 = "Upgrade" need1 = "Completed chapter 4" elseif tonumber(level) == 4 then - label = (level+1).."/6" + label = (level+1).."/7" label2 = "Upgrade" need1 = "Completed chapter 5" + elseif tonumber(level) == 5 then + label = (level+1).."/7" + label2 = "Upgrade" + need1 = "Completed chapter 6" else - label = (level+1).."/6" + label = (level+1).."/7" label2 = "Upgrade (comming soon)" end formspec = "size[5,6.5]" @@ -9914,27 +10287,31 @@ tree.get_formspec = function(player, pos) label2 = "Build" need1 = "Fountain lv.1" elseif tonumber(level) == 1 then - label = (level).."/6" + label = (level).."/7" label2 = "Upgrade" need1 = "Completed chapter 1" elseif tonumber(level) == 2 then - label = (level).."/6" + label = (level).."/7" label2 = "Upgrade" need1 = "Completed chapter 2" elseif tonumber(level) == 3 then - label = (level).."/6" + label = (level).."/7" label2 = "Upgrade" need1 = "Completed chapter 3" elseif tonumber(level) == 4 then - label = (level).."/6" + label = (level).."/7" label2 = "Upgrade" need1 = "Completed chapter 4" elseif tonumber(level) == 5 then - label = (level).."/6" + label = (level).."/7" label2 = "Upgrade" need1 = "Completed chapter 5" + elseif tonumber(level) == 6 then + label = (level).."/7" + label2 = "Upgrade" + need1 = "Completed chapter 6" else - label = (level).."/6" + label = (level).."/7" label2 = "Upgrade (comming soon)" end formspec = "size[5,6.5]" @@ -10325,6 +10702,44 @@ camp2.get_formspec = function(player, pos) .."image_button[4.5,-0.3;0.8,0.8;;esc;X]" return formspec end +local camp3 = {} +camp3.get_formspec = function(player, pos) + if player == nil then + return + end + file = io.open(minetest.get_worldpath().."/SAVE/Camp3.txt", "r") + local level = file:read("*l") + file:close() + local label = "" + local label2 = "" + local need1 = "" + local need2 = "" + local need3 = "" + local need4 = "" + if tonumber(level) < 1 then + label = "not build yet ("..math.floor((level/1)*100).."%)" + label2 = "Build" + need1 = "Home 3 lv.1" + need2 = "Camp 2 lv.1" + else + label = (level).."/1" + label2 = "Upgrade (comming soon)" + end + formspec = "size[5,6.5]" + .."background[5,6.5;1,1;gui_formbg.png;true]" + .."listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]" + .."bgcolor[#080808BB;true]" + .."label[0,0;Level: "..label.."]" + .."label[0,0.5;You need:]" + .."label[0,0.8;"..need1.."]" + .."label[0,1.1;"..need2.."]" + .."label[0,1.4;"..need3.."]" + .."label[0,1.7;"..need4.."]" + .."button[0,2;5,1;;"..label2.."]" + --.."button[0,3;5,1;;del]" + .."image_button[4.5,-0.3;0.8,0.8;;esc;X]" + return formspec +end local knight = {} knight.get_formspec = function(player, pos) if player == nil then @@ -10354,6 +10769,8 @@ knight.get_formspec = function(player, pos) max1 = max1+11 elseif tonumber(home1) == 8 then max1 = max1+14 + elseif tonumber(home1) == 9 then + max1 = max1+17 end if tonumber(home2) == 6 then max1 = max1+8 @@ -10372,12 +10789,18 @@ knight.get_formspec = function(player, pos) file:close() file = io.open(minetest.get_worldpath().."/SAVE/Camp2.txt", "r") local camp2 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Camp3.txt", "r") + local camp3 = file:read("*l") file:close() if tonumber(camp1) == 1 then max2 = max2+20 end if tonumber(camp2) == 1 then max2 = max2+20 + end + if tonumber(camp3) == 1 then + max2 = max2+20 end if max1 > max2 then max = max2 @@ -10448,31 +10871,37 @@ battleground.get_formspec = function(player, pos) need1 = "4 Cobblestone" need2 = "Fountain lv.1" elseif tonumber(level) == 4 then - label = (level-3).."/5" + label = (level-3).."/6" label2 = "Upgrade" need1 = "Completed chapter 1" need2 = "40 Cobblestone" need3 = "Fountain lv.2" elseif tonumber(level) == 5 then - label = (level-3).."/5" + label = (level-3).."/6" label2 = "Upgrade" need1 = "Completed chapter 2" need2 = "200 Cobblestone" need3 = "Fountain lv.3" elseif tonumber(level) == 6 then - label = (level-3).."/5" + label = (level-3).."/6" label2 = "Upgrade" need1 = "Completed chapter 3" need2 = "200 Desert Cobblestone" need3 = "Fountain lv.4" elseif tonumber(level) == 7 then - label = (level-3).."/5" + label = (level-3).."/6" label2 = "Upgrade" need1 = "Completed chapter 4" need2 = "400 Desert Cobblestone" need3 = "Fountain lv.5" + elseif tonumber(level) == 8 then + label = (level-3).."/6" + label2 = "Upgrade" + need1 = "Completed chapter 5" + need2 = "600 Desert Cobblestone" + need3 = "Fountain lv.6" else - label = (level-3).."/5" + label = (level-3).."/6" label2 = "Upgrade (comming soon)" end formspec = "size[5,6.5]" @@ -10504,6 +10933,56 @@ battleground.get_formspec = function(player, pos) formspec = formspec.."button[0,3;5,1;;Start Chapter 5]" elseif tonumber(chapter) == 5 then formspec = formspec.."button[0,3;5,1;;Start Chapter 5 (battleground lv.5 needed)]" + elseif tonumber(chapter) == 6 and tonumber(level) > 8 then + formspec = formspec.."button[0,3;5,1;;Start Chapter 6]" + elseif tonumber(chapter) == 6 then + formspec = formspec.."button[0,3;5,1;;Start Chapter 6 (battleground lv.6 needed)]" + end + formspec = formspec--.."button[0,4;5,1;;del]" + .."image_button[4.5,-0.3;0.8,0.8;;esc;X]" + return formspec +end +local island_battleground = {} +island_battleground.get_formspec = function(player, pos) + if player == nil then + return + end + file = io.open(minetest.get_worldpath().."/SAVE/Island_Battleground.txt", "r") + local level = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Island_Chapter.txt", "r") + local chapter = file:read("*l") + file:close() + local label = "" + local label2 = "" + local need1 = "" + local need2 = "" + local need3 = "" + local need4 = "" + if tonumber(level) < 4 then + label = "not build yet ("..math.floor((level/4)*100).."%)" + label2 = "Build" + need1 = "400 Sand" + need2 = "Island Fountain lv.1" + else + label = (level-3).."/1" + label2 = "Upgrade (comming soon)" + end + formspec = "size[5,6.5]" + .."background[5,6.5;1,1;gui_formbg.png;true]" + .."listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]" + .."bgcolor[#080808BB;true]" + .."label[0,0;Level: "..label.."]" + .."label[0,0.5;You need:]" + .."label[0,0.8;"..need1.."]" + .."label[0,1.1;"..need2.."]" + .."label[0,1.4;"..need3.."]" + .."label[0,1.7;"..need4.."]" + .."button[0,2;5,1;;"..label2.."]" + if tonumber(chapter) == 1 and tonumber(level) > 3 then + formspec = formspec.."button[0,3;5,1;;Start Island Chapter 1]" + elseif tonumber(chapter) == 2 and tonumber(level) > 3 then + formspec = formspec.."button[0,3;5,1;;Start Island Chapter 2 (comming soon)]" end formspec = formspec--.."button[0,4;5,1;;del]" .."image_button[4.5,-0.3;0.8,0.8;;esc;X]" @@ -10790,6 +11269,80 @@ sail2.get_formspec = function(player, pos) .."image_button[4.5,-0.3;0.8,0.8;;esc;X]" return formspec end +local cannon1 = {} +cannon1.get_formspec = function(player, pos) + if player == nil then + return + end + file = io.open(minetest.get_worldpath().."/SAVE/Cannon1.txt", "r") + local level = file:read("*l") + file:close() + local label = "" + local label2 = "" + local need1 = "" + local need2 = "" + local need3 = "" + local need4 = "" + if tonumber(level) < 1 then + label = "not build yet ("..math.floor((level/1)*100).."%)" + label2 = "Build" + need1 = "25 Steel Ingot" + else + label = (level).."/1" + label2 = "Upgrade (comming soon)" + end + formspec = "size[5,6.5]" + .."background[5,6.5;1,1;gui_formbg.png;true]" + .."listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]" + .."bgcolor[#080808BB;true]" + .."label[0,0;Level: "..label.."]" + .."label[0,0.5;You need:]" + .."label[0,0.8;"..need1.."]" + .."label[0,1.1;"..need2.."]" + .."label[0,1.4;"..need3.."]" + .."label[0,1.7;"..need4.."]" + .."button[0,2;5,1;;"..label2.."]" + --.."button[0,3;5,1;;del]" + .."image_button[4.5,-0.3;0.8,0.8;;esc;X]" + return formspec +end +local cannon2 = {} +cannon2.get_formspec = function(player, pos) + if player == nil then + return + end + file = io.open(minetest.get_worldpath().."/SAVE/Cannon2.txt", "r") + local level = file:read("*l") + file:close() + local label = "" + local label2 = "" + local need1 = "" + local need2 = "" + local need3 = "" + local need4 = "" + if tonumber(level) < 1 then + label = "not build yet ("..math.floor((level/1)*100).."%)" + label2 = "Build" + need1 = "25 Steel Ingot" + else + label = (level).."/1" + label2 = "Upgrade (comming soon)" + end + formspec = "size[5,6.5]" + .."background[5,6.5;1,1;gui_formbg.png;true]" + .."listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]" + .."bgcolor[#080808BB;true]" + .."label[0,0;Level: "..label.."]" + .."label[0,0.5;You need:]" + .."label[0,0.8;"..need1.."]" + .."label[0,1.1;"..need2.."]" + .."label[0,1.4;"..need3.."]" + .."label[0,1.7;"..need4.."]" + .."button[0,2;5,1;;"..label2.."]" + --.."button[0,3;5,1;;del]" + .."image_button[4.5,-0.3;0.8,0.8;;esc;X]" + return formspec +end local island_fountain = {} island_fountain.get_formspec = function(player, pos) if player == nil then @@ -10926,19 +11479,23 @@ sandmine.get_formspec = function(player, pos) local need3 = "" local need4 = "" if tonumber(level) == 0 then - label = (level+1).."/4" + label = (level+1).."/5" label2 = "Upgrade" need1 = "Completed chapter 3" elseif tonumber(level) == 1 then - label = (level+1).."/4" + label = (level+1).."/5" label2 = "Upgrade" need1 = "Completed chapter 4" elseif tonumber(level) == 2 then - label = (level+1).."/4" + label = (level+1).."/5" label2 = "Upgrade" need1 = "Completed chapter 5" + elseif tonumber(level) == 3 then + label = (level+1).."/5" + label2 = "Upgrade" + need1 = "Completed chapter 6" else - label = (level+1).."/4" + label = (level+1).."/5" label2 = "Upgrade (comming soon)" end formspec = "size[5,6.5]" @@ -10975,19 +11532,23 @@ cactusfarm.get_formspec = function(player, pos) label2 = "Build" need1 = "Island Fountain lv.1" elseif tonumber(level) == 1 then - label = (level).."/4" + label = (level).."/5" label2 = "Upgrade" need1 = "Completed chapter 3" elseif tonumber(level) == 2 then - label = (level).."/4" + label = (level).."/5" label2 = "Upgrade" need1 = "Completed chapter 4" elseif tonumber(level) == 3 then - label = (level).."/4" + label = (level).."/5" label2 = "Upgrade" need1 = "Completed chapter 5" + elseif tonumber(level) == 4 then + label = (level).."/5" + label2 = "Upgrade" + need1 = "Completed chapter 6" else - label = (level).."/4" + label = (level).."/5" label2 = "Upgrade (comming soon)" end formspec = "size[5,6.5]" @@ -11042,6 +11603,43 @@ island_pier.get_formspec = function(player, pos) .."image_button[4.5,-0.3;0.8,0.8;;esc;X]" return formspec end +local island_pier2 = {} +island_pier2.get_formspec = function(player, pos) + if player == nil then + return + end + file = io.open(minetest.get_worldpath().."/SAVE/Island_Pier2.txt", "r") + local level = file:read("*l") + file:close() + local label = "" + local label2 = "" + local need1 = "" + local need2 = "" + local need3 = "" + local need4 = "" + if tonumber(level) < 3 then + label = "not build yet ("..math.floor((level/3)*100).."%)" + label2 = "Build" + need1 = "100 Wooden Planks" + else + label = (level-2).."/1" + label2 = "Upgrade (comming soon)" + end + formspec = "size[5,6.5]" + .."background[5,6.5;1,1;gui_formbg.png;true]" + .."listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]" + .."bgcolor[#080808BB;true]" + .."label[0,0;Level: "..label.."]" + .."label[0,0.5;You need:]" + .."label[0,0.8;"..need1.."]" + .."label[0,1.1;"..need2.."]" + .."label[0,1.4;"..need3.."]" + .."label[0,1.7;"..need4.."]" + .."button[0,2;5,1;;"..label2.."]" + --.."button[0,3;5,1;;del]" + .."image_button[4.5,-0.3;0.8,0.8;;esc;X]" + return formspec +end local island_barracks = {} island_barracks.get_formspec = function(player, pos) if player == nil then @@ -11649,6 +12247,14 @@ minetest.register_node("castrum:camp2",{ minetest.show_formspec(player:get_player_name(), "camp2" , camp2.get_formspec(player)) end, }) +minetest.register_node("castrum:camp3",{ + tiles = {"default_diamond_block.png"}, + description = "Configurate Camp 3", + --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + on_punch = function(pos, node, player, pointed_thing) + minetest.show_formspec(player:get_player_name(), "camp3" , camp3.get_formspec(player)) + end, +}) minetest.register_node("castrum:island_walle",{ tiles = {"default_diamond_block.png"}, description = "Configurate Island Walle", @@ -11729,6 +12335,14 @@ minetest.register_node("castrum:island_pier",{ minetest.show_formspec(player:get_player_name(), "island_pier" , island_pier.get_formspec(player)) end, }) +minetest.register_node("castrum:island_pier2",{ + tiles = {"default_diamond_block.png"}, + description = "Configurate Island Pier 2", + --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + on_punch = function(pos, node, player, pointed_thing) + minetest.show_formspec(player:get_player_name(), "island_pier2" , island_pier2.get_formspec(player)) + end, +}) minetest.register_node("castrum:island_barracks",{ tiles = {"default_diamond_block.png"}, description = "Configurate Island Barracks", @@ -11745,6 +12359,14 @@ minetest.register_node("castrum:battleground",{ minetest.show_formspec(player:get_player_name(), "battleground" , battleground.get_formspec(player)) end, }) +minetest.register_node("castrum:island_battleground",{ + tiles = {"default_diamond_block.png"}, + description = "Configurate Island Battleground", + --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + on_punch = function(pos, node, player, pointed_thing) + minetest.show_formspec(player:get_player_name(), "island_battleground" , island_battleground.get_formspec(player)) + end, +}) minetest.register_node("castrum:bridge_status",{ tiles = {"castrum_bridge_status.png"}, description = "Change Bridge Status", @@ -11817,6 +12439,22 @@ minetest.register_node("castrum:sail2",{ minetest.show_formspec(player:get_player_name(), "sail2" , sail2.get_formspec(player)) end, }) +minetest.register_node("castrum:cannon1",{ + tiles = {"default_diamond_block.png"}, + description = "Configurate Cannon 1", + --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + on_punch = function(pos, node, player, pointed_thing) + minetest.show_formspec(player:get_player_name(), "cannon1" , cannon1.get_formspec(player)) + end, +}) +minetest.register_node("castrum:cannon2",{ + tiles = {"default_diamond_block.png"}, + description = "Configurate Cannon 2", + --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + on_punch = function(pos, node, player, pointed_thing) + minetest.show_formspec(player:get_player_name(), "cannon2" , cannon2.get_formspec(player)) + end, +}) minetest.register_node("castrum:fight1",{ tiles = {"castrum_fight1.png"}, description = "Fight 1", @@ -11827,7 +12465,19 @@ minetest.register_node("castrum:fight2",{ description = "Fight 2", --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, }) - +minetest.register_node("castrum:sea_fight1",{ + tiles = {"castrum_fight1.png"}, + description = "Sea Fight 1", + --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, +}) +minetest.register_node("castrum:test",{ + tiles = {"castrum_bridge_status.png"}, + description = "Test", + groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + on_punch = function(pos, node, player, pointed_thing) + Chapter_Ship1_2(player) + end, +}) minetest.register_craftitem("castrum:soul", { description = "Soul", inventory_image = "castrum_soul.png", @@ -11921,7 +12571,7 @@ minetest.register_craftitem("castrum:horse1_item_1", { minetest.set_node({x=pos.x,y=pos.y+2,z=pos.z}, {name="castrum:knight_lv1_sit"}) screwdriver_handler(placer, {type="node", under={x=pos.x,y=pos.y+2,z=pos.z}, above={x=pos.x,y=pos.y+2,z=pos.z}}, 1) local inv = placer:get_inventory() - inv:remove_item("main", "castrum:knight_lv2") + Item_Remove2(player, "main", "castrum:knight_lv2") local fight = placer:get_attribute("fight") placer:set_attribute("fightdig", "false") if fight == "true" then @@ -11947,7 +12597,7 @@ minetest.register_craftitem("castrum:horse1_item_2", { minetest.set_node({x=pos.x,y=pos.y+2,z=pos.z}, {name="castrum:knight_lv2_sit"}) screwdriver_handler(placer, {type="node", under={x=pos.x,y=pos.y+2,z=pos.z}, above={x=pos.x,y=pos.y+2,z=pos.z}}, 1) local inv = placer:get_inventory() - inv:remove_item("main", "castrum:knight_lv2") + Item_Remove2(player, "main", "castrum:knight_lv2") local fight = placer:get_attribute("fight") placer:set_attribute("fightdig", "false") if fight == "true" then @@ -11973,7 +12623,7 @@ minetest.register_craftitem("castrum:horse1_item_3", { minetest.set_node({x=pos.x,y=pos.y+2,z=pos.z}, {name="castrum:knight_lv3_sit"}) screwdriver_handler(placer, {type="node", under={x=pos.x,y=pos.y+2,z=pos.z}, above={x=pos.x,y=pos.y+2,z=pos.z}}, 1) local inv = placer:get_inventory() - inv:remove_item("main", "castrum:knight_lv3") + Item_Remove2(player, "main", "castrum:knight_lv3") local fight = placer:get_attribute("fight") placer:set_attribute("fightdig", "false") if fight == "true" then @@ -11991,7 +12641,7 @@ minetest.register_craftitem("castrum:horse1_item_3", { stairs.register_stair_and_slab( "castrum_wood", "default:wood", - {}, + {cracky = 3}, {"default_wood.png"}, "Wooden Stair", "Wooden Slab", @@ -12319,28 +12969,34 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 6 and inv:contains_item("main", "default:cobble 8") and inv:contains_item("main", "default:wood 10") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:cobble 8") - inv:remove_item("main", "default:wood 10") + Item_Remove2(player, "main", "default:cobble 8") + Item_Remove2(player, "main", "default:wood 10") upgrade = true elseif tonumber(level) < 6 and inv:contains_item("main", "default:cobble 8") and inv:contains_item("main", "default:wood 10") then txt = "build fountain first" elseif tonumber(level) == 6 and inv:contains_item("main", "default:cobble 64") and inv:contains_item("main", "default:junglewood 80") and tonumber(fountain) > 4 then - inv:remove_item("main", "default:junglewood 80") - inv:remove_item("main", "default:cobble 64") + Item_Remove2(player, "main", "default:junglewood 80") + Item_Remove2(player, "main", "default:cobble 64") upgrade = true elseif tonumber(level) == 6 and inv:contains_item("main", "default:cobble 64") and inv:contains_item("main", "default:junglewood 80") then txt = "upgrade fountain to lv.2 first" elseif tonumber(level) == 7 and inv:contains_item("main", "default:cobble 128") and inv:contains_item("main", "default:pine_wood 160") and tonumber(fountain) > 6 then - inv:remove_item("main", "default:pine_wood 160") - inv:remove_item("main", "default:cobble 128") + Item_Remove2(player, "main", "default:pine_wood 160") + Item_Remove2(player, "main", "default:cobble 128") upgrade = true elseif tonumber(level) == 7 and inv:contains_item("main", "default:cobble 128") and inv:contains_item("main", "default:pine_wood 160") then txt = "upgrade fountain to lv.4 first" + elseif tonumber(level) == 8 and inv:contains_item("main", "default:cobble 256") and inv:contains_item("main", "default:acacia_wood 320") and tonumber(fountain) > 8 then + Item_Remove2(player, "main", "default:acacia_wood 320") + Item_Remove2(player, "main", "default:cobble 256") + upgrade = true + elseif tonumber(level) == 8 and inv:contains_item("main", "default:cobble 256") and inv:contains_item("main", "default:acacia_wood 320") then + txt = "upgrade fountain to lv.6 first" end if upgrade == false then minetest.chat_send_player(player:get_player_name(), txt) end - if (tonumber(level)) < 8 and upgrade then + if (tonumber(level)) < 9 and upgrade then Home1(tonumber(level)+1,player) file = io.open(minetest.get_worldpath().."/SAVE/Home1.txt", "w") file:write(tonumber(level)+1) @@ -12371,20 +13027,20 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 6 and inv:contains_item("main", "default:cobble 8") and inv:contains_item("main", "default:wood 10") and tonumber(fountain) > 5 then - inv:remove_item("main", "default:cobble 8") - inv:remove_item("main", "default:wood 10") + Item_Remove2(player, "main", "default:cobble 8") + Item_Remove2(player, "main", "default:wood 10") upgrade = true elseif tonumber(level) < 6 and inv:contains_item("main", "default:cobble 8") and inv:contains_item("main", "default:wood 10") then txt = "upgrade fountain to lv.3 first" elseif tonumber(level) == 6 and inv:contains_item("main", "default:cobble 64") and inv:contains_item("main", "default:junglewood 80") and tonumber(fountain) > 6 then - inv:remove_item("main", "default:junglewood 80") - inv:remove_item("main", "default:cobble 64") + Item_Remove2(player, "main", "default:junglewood 80") + Item_Remove2(player, "main", "default:cobble 64") upgrade = true elseif tonumber(level) == 6 and inv:contains_item("main", "default:cobble 64") and inv:contains_item("main", "default:junglewood 80") then txt = "upgrade fountain to lv.4 first" elseif tonumber(level) == 7 and inv:contains_item("main", "default:cobble 128") and inv:contains_item("main", "default:pine_wood 160") and tonumber(fountain) > 8 then - inv:remove_item("main", "default:pine_wood 160") - inv:remove_item("main", "default:cobble 128") + Item_Remove2(player, "main", "default:pine_wood 160") + Item_Remove2(player, "main", "default:cobble 128") upgrade = true elseif tonumber(level) == 7 and inv:contains_item("main", "default:cobble 128") and inv:contains_item("main", "default:pine_wood 160") then txt = "upgrade fountain to lv.6 first" @@ -12424,17 +13080,17 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 9 and inv:contains_item("main", "default:wood 3") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:wood 3") + Item_Remove2(player, "main", "default:wood 3") upgrade = true elseif tonumber(level) < 9 and inv:contains_item("main", "default:wood 3") then txt = "build fountain first" elseif tonumber(level) == 9 and inv:contains_item("main", "default:junglewood 27") and tonumber(fountain) > 5 then - inv:remove_item("main", "default:junglewood 27") + Item_Remove2(player, "main", "default:junglewood 27") upgrade = true elseif tonumber(level) == 9 and inv:contains_item("main", "default:junglewood 27") then txt = "upgrade fountain to lv.3 first" elseif tonumber(level) == 10 and inv:contains_item("main", "default:pine_wood 108") and tonumber(fountain) > 7 then - inv:remove_item("main", "default:pine_wood 108") + Item_Remove2(player, "main", "default:pine_wood 108") upgrade = true elseif tonumber(level) == 10 and inv:contains_item("main", "default:pine_wood 108") then txt = "upgrade fountain to lv.5 first" @@ -12473,12 +13129,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) == 9 and inv:contains_item("main", "default:junglewood 27") and tonumber(fountain) > 5 then - inv:remove_item("main", "default:junglewood 27") + Item_Remove2(player, "main", "default:junglewood 27") upgrade = true elseif tonumber(level) == 9 and inv:contains_item("main", "default:junglewood 27") then txt = "upgrade fountain to lv.3 first" elseif tonumber(level) == 10 and inv:contains_item("main", "default:pine_wood 108") and tonumber(fountain) > 7 then - inv:remove_item("main", "default:pine_wood 108") + Item_Remove2(player, "main", "default:pine_wood 108") upgrade = true elseif tonumber(level) == 10 and inv:contains_item("main", "default:pine_wood 108") then txt = "upgrade fountain to lv.5 first" @@ -12517,19 +13173,19 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 9 and inv:contains_item("main", "castrum:shovel_stone 3") and tonumber(bridge) > 8 then - inv:remove_item("main", "castrum:shovel_stone 3") + Item_Remove2(player, "main", "castrum:shovel_stone 3") upgrade = true elseif tonumber(level) < 9 and inv:contains_item("main", "castrum:shovel_stone 3") then txt = "build bridge first" elseif tonumber(level) == 9 and inv:contains_item("main", "castrum:shovel_steel 27") and inv:contains_item("main", "castrum:bucket_water 30") and tonumber(bridge) > 9 then - inv:remove_item("main", "castrum:shovel_steel 27") - inv:remove_item("main", "castrum:bucket_water 30") + Item_Remove2(player, "main", "castrum:shovel_steel 27") + Item_Remove2(player, "main", "castrum:bucket_water 30") upgrade = true elseif tonumber(level) == 9 and inv:contains_item("main", "castrum:shovel_steel 27") and inv:contains_item("main", "castrum:bucket_water 30") then txt = "upgrade bridge to lv.2 first" elseif tonumber(level) == 10 and inv:contains_item("main", "castrum:shovel_bronze 54") and inv:contains_item("main", "castrum:bucket_water 60") and tonumber(bridge) > 10 then - inv:remove_item("main", "castrum:shovel_bronze 54") - inv:remove_item("main", "castrum:bucket_water 60") + Item_Remove2(player, "main", "castrum:shovel_bronze 54") + Item_Remove2(player, "main", "castrum:bucket_water 60") upgrade = true elseif tonumber(level) == 10 and inv:contains_item("main", "castrum:shovel_bronze 54") and inv:contains_item("main", "castrum:bucket_water 60") then txt = "upgrade bridge to lv.3 first" @@ -12568,35 +13224,35 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 14 and inv:contains_item("main", "default:cobble 3") then - inv:remove_item("main", "default:cobble 3") + Item_Remove2(player, "main", "default:cobble 3") upgrade = true elseif tonumber(level) == 14 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:cobble 10") - inv:remove_item("main", "castrum:sword_stone 3") + Item_Remove2(player, "main", "default:cobble 10") + Item_Remove2(player, "main", "castrum:sword_stone 3") upgrade = true elseif tonumber(level) == 14 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") then txt = "build fountain first" elseif tonumber(level) == 15 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") and tonumber(fountain) > 4 then - inv:remove_item("main", "default:cobble 40") - inv:remove_item("main", "castrum:sword_stone 12") + Item_Remove2(player, "main", "default:cobble 40") + Item_Remove2(player, "main", "castrum:sword_stone 12") upgrade = true elseif tonumber(level) == 15 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") then txt = "upgrade fountain to lv.2 first" elseif tonumber(level) == 16 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") and tonumber(fountain) > 5 then - inv:remove_item("main", "default:desert_cobble 40") - inv:remove_item("main", "castrum:sword_steel 12") + Item_Remove2(player, "main", "default:desert_cobble 40") + Item_Remove2(player, "main", "castrum:sword_steel 12") upgrade = true elseif tonumber(level) == 16 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") then txt = "upgrade fountain to lv.3 first" elseif tonumber(level) == 17 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") and tonumber(fountain) > 6 then - inv:remove_item("main", "default:desert_cobble 160") - inv:remove_item("main", "castrum:sword_steel 48") + Item_Remove2(player, "main", "default:desert_cobble 160") + Item_Remove2(player, "main", "castrum:sword_steel 48") upgrade = true elseif tonumber(level) == 17 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") then txt = "upgrade fountain to lv.4 first" elseif tonumber(level) == 18 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") and tonumber(fountain) > 7 then Item_Remove(player,"default:desert_cobble",320) - inv:remove_item("main", "castrum:sword_bronze 48") + Item_Remove2(player, "main", "castrum:sword_bronze 48") upgrade = true elseif tonumber(level) == 18 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") then txt = "upgrade fountain to lv.5 first" @@ -12670,13 +13326,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 4 and inv:contains_item("main", "default:cobble 10") and tonumber(tower1) > 17 and tonumber(tower2) > 17 and tonumber(tower3) > 17 and tonumber(tower4) > 17 and tonumber(walle) > 13 and tonumber(wallw) > 13 and tonumber(walln) > 13 and tonumber(walls) > 13 then - inv:remove_item("main", "default:cobble 10") + Item_Remove2(player, "main", "default:cobble 10") upgrade = true elseif tonumber(level) < 4 and inv:contains_item("main", "default:cobble 10") then txt = "build walls and towers first" elseif tonumber(level) == 4 and inv:contains_item("main", "default:cobble 25") and inv:contains_item("main", "castrum:pick_stone 8") and tonumber(tower1) > 18 and tonumber(tower2) > 18 and tonumber(tower3) > 18 and tonumber(tower4) > 18 and tonumber(walle) > 14 and tonumber(wallw) > 14 and tonumber(walln) > 14 and tonumber(walls) > 14 and tonumber(moate) > 8 and tonumber(moatw) > 8 and tonumber(moats) > 8 and tonumber(moatn) > 8 then - inv:remove_item("main", "default:cobble 25") - inv:remove_item("main", "castrum:pick_stone 8") + Item_Remove2(player, "main", "default:cobble 25") + Item_Remove2(player, "main", "castrum:pick_stone 8") upgrade = true elseif tonumber(level) == 4 and inv:contains_item("main", "default:cobble 25") and inv:contains_item("main", "castrum:pick_stone 8") and tonumber(tower1) > 18 and tonumber(tower2) > 18 and tonumber(tower3) > 18 and tonumber(tower4) > 18 and tonumber(walle) > 14 and tonumber(wallw) > 14 and tonumber(walln) > 14 and tonumber(walls) > 14 then txt = "upgrade moats to lv.1 first" @@ -12684,14 +13340,14 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) txt = "upgrade walls and towers to lv.2 first" elseif tonumber(level) == 5 and inv:contains_item("main", "default:cobble 100") and inv:contains_item("main", "castrum:pick_stone 32") and tonumber(tower1) > 19 and tonumber(tower2) > 19 and tonumber(tower3) > 19 and tonumber(tower4) > 19 and tonumber(walle) > 15 and tonumber(wallw) > 15 and tonumber(walln) > 15 and tonumber(walls) > 15 then - inv:remove_item("main", "default:cobble 100") - inv:remove_item("main", "castrum:pick_stone 32") + Item_Remove2(player, "main", "default:cobble 100") + Item_Remove2(player, "main", "castrum:pick_stone 32") upgrade = true elseif tonumber(level) == 5 and inv:contains_item("main", "default:cobble 100") and inv:contains_item("main", "castrum:pick_stone 32") then txt = "upgrade walls and towers to lv.3 first" elseif tonumber(level) == 6 and inv:contains_item("main", "default:desert_cobble 100") and inv:contains_item("main", "castrum:pick_steel 32") and tonumber(tower1) > 20 and tonumber(tower2) > 20 and tonumber(tower3) > 20 and tonumber(tower4) > 20 and tonumber(walle) > 16 and tonumber(wallw) > 16 and tonumber(walln) > 16 and tonumber(walls) > 16 and tonumber(moate) > 9 and tonumber(moatw) > 9 and tonumber(moats) > 9 and tonumber(moatn) > 9 then - inv:remove_item("main", "default:desert_cobble 100") - inv:remove_item("main", "castrum:pick_steel 32") + Item_Remove2(player, "main", "default:desert_cobble 100") + Item_Remove2(player, "main", "castrum:pick_steel 32") upgrade = true elseif tonumber(level) == 6 and inv:contains_item("main", "default:desert_cobble 100") and inv:contains_item("main", "castrum:pick_steel 32") and tonumber(tower1) > 20 and tonumber(tower2) > 20 and tonumber(tower3) > 20 and tonumber(tower4) > 20 and tonumber(walle) > 16 and tonumber(wallw) > 16 and tonumber(walln) > 16 and tonumber(walls) > 16 then txt = "upgrade moats to lv.2 first" @@ -12700,13 +13356,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) elseif tonumber(level) == 7 and inv:contains_item("main", "default:desert_cobble 400") and inv:contains_item("main", "castrum:pick_steel 64") and tonumber(tower1) > 21 and tonumber(tower2) > 21 and tonumber(tower3) > 21 and tonumber(tower4) > 21 and tonumber(walle) > 17 and tonumber(wallw) > 17 and tonumber(walln) > 17 and tonumber(walls) > 17 then Item_Remove(player,"default:desert_cobble",400) - inv:remove_item("main", "castrum:pick_steel 64") + Item_Remove2(player, "main", "castrum:pick_steel 64") upgrade = true elseif tonumber(level) == 7 and inv:contains_item("main", "default:desert_cobble 400") and inv:contains_item("main", "castrum:pick_steel 64") then txt = "upgrade walls and towers to lv.5 first" elseif tonumber(level) == 8 and inv:contains_item("main", "default:desert_cobble 600") and inv:contains_item("main", "castrum:pick_bronze 64") and tonumber(tower1) > 22 and tonumber(tower2) > 22 and tonumber(tower3) > 22 and tonumber(tower4) > 22 and tonumber(walle) > 18 and tonumber(wallw) > 18 and tonumber(walln) > 18 and tonumber(walls) > 18 and tonumber(moate) > 10 and tonumber(moatw) > 10 and tonumber(moats) > 10 and tonumber(moatn) > 10 then - inv:remove_item("main", "default:desert_cobble 600") - inv:remove_item("main", "castrum:pick_bronze 64") + Item_Remove2(player, "main", "default:desert_cobble 600") + Item_Remove2(player, "main", "castrum:pick_bronze 64") upgrade = true elseif tonumber(level) == 8 and inv:contains_item("main", "default:desert_cobble 600") and inv:contains_item("main", "castrum:pick_bronze 64") and tonumber(tower1) > 22 and tonumber(tower2) > 22 and tonumber(tower3) > 22 and tonumber(tower4) > 22 and tonumber(walle) > 18 and tonumber(wallw) > 18 and tonumber(walln) > 18 and tonumber(walls) > 18 then txt = "upgrade moats to lv.3 first" @@ -12747,35 +13403,35 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 18 and inv:contains_item("main", "default:cobble 3") then - inv:remove_item("main", "default:cobble 3") + Item_Remove2(player, "main", "default:cobble 3") upgrade = true elseif tonumber(level) == 18 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:cobble 10") - inv:remove_item("main", "castrum:sword_stone 3") + Item_Remove2(player, "main", "default:cobble 10") + Item_Remove2(player, "main", "castrum:sword_stone 3") upgrade = true elseif tonumber(level) == 18 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") then txt = "build fountain first" elseif tonumber(level) == 19 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") and tonumber(fountain) > 4 then - inv:remove_item("main", "default:cobble 40") - inv:remove_item("main", "castrum:sword_stone 12") + Item_Remove2(player, "main", "default:cobble 40") + Item_Remove2(player, "main", "castrum:sword_stone 12") upgrade = true elseif tonumber(level) == 19 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") then txt = "upgrade fountain to lv.2 first" elseif tonumber(level) == 20 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") and tonumber(fountain) > 5 then - inv:remove_item("main", "default:desert_cobble 40") - inv:remove_item("main", "castrum:sword_steel 12") + Item_Remove2(player, "main", "default:desert_cobble 40") + Item_Remove2(player, "main", "castrum:sword_steel 12") upgrade = true elseif tonumber(level) == 20 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") then txt = "upgrade fountain to lv.3 first" elseif tonumber(level) == 21 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") and tonumber(fountain) > 6 then - inv:remove_item("main", "default:desert_cobble 160") - inv:remove_item("main", "castrum:sword_steel 48") + Item_Remove2(player, "main", "default:desert_cobble 160") + Item_Remove2(player, "main", "castrum:sword_steel 48") upgrade = true elseif tonumber(level) == 21 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") then txt = "upgrade fountain to lv.4 first" elseif tonumber(level) == 22 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") and tonumber(fountain) > 7 then Item_Remove(player,"default:desert_cobble",320) - inv:remove_item("main", "castrum:sword_bronze 48") + Item_Remove2(player, "main", "castrum:sword_bronze 48") upgrade = true elseif tonumber(level) == 22 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") then txt = "upgrade fountain to lv.5 first" @@ -12814,35 +13470,35 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 14 and inv:contains_item("main", "default:cobble 3") then - inv:remove_item("main", "default:cobble 3") + Item_Remove2(player, "main", "default:cobble 3") upgrade = true elseif tonumber(level) == 14 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:cobble 10") - inv:remove_item("main", "castrum:sword_stone 3") + Item_Remove2(player, "main", "default:cobble 10") + Item_Remove2(player, "main", "castrum:sword_stone 3") upgrade = true elseif tonumber(level) == 14 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") then txt = "build fountain first" elseif tonumber(level) == 15 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") and tonumber(fountain) > 4 then - inv:remove_item("main", "default:cobble 40") - inv:remove_item("main", "castrum:sword_stone 12") + Item_Remove2(player, "main", "default:cobble 40") + Item_Remove2(player, "main", "castrum:sword_stone 12") upgrade = true elseif tonumber(level) == 15 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") then txt = "upgrade fountain to lv.2 first" elseif tonumber(level) == 16 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") and tonumber(fountain) > 5 then - inv:remove_item("main", "default:desert_cobble 40") - inv:remove_item("main", "castrum:sword_steel 12") + Item_Remove2(player, "main", "default:desert_cobble 40") + Item_Remove2(player, "main", "castrum:sword_steel 12") upgrade = true elseif tonumber(level) == 16 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") then txt = "upgrade fountain to lv.3 first" elseif tonumber(level) == 17 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") and tonumber(fountain) > 6 then - inv:remove_item("main", "default:desert_cobble 160") - inv:remove_item("main", "castrum:sword_steel 48") + Item_Remove2(player, "main", "default:desert_cobble 160") + Item_Remove2(player, "main", "castrum:sword_steel 48") upgrade = true elseif tonumber(level) == 17 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") then txt = "upgrade fountain to lv.4 first" elseif tonumber(level) == 18 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") and tonumber(fountain) > 7 then Item_Remove(player,"default:desert_cobble",320) - inv:remove_item("main", "castrum:sword_bronze 48") + Item_Remove2(player, "main", "castrum:sword_bronze 48") upgrade = true elseif tonumber(level) == 18 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") then txt = "upgrade fountain to lv.5 first" @@ -12881,35 +13537,35 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 18 and inv:contains_item("main", "default:cobble 3") then - inv:remove_item("main", "default:cobble 3") + Item_Remove2(player, "main", "default:cobble 3") upgrade = true elseif tonumber(level) == 18 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:cobble 10") - inv:remove_item("main", "castrum:sword_stone 3") + Item_Remove2(player, "main", "default:cobble 10") + Item_Remove2(player, "main", "castrum:sword_stone 3") upgrade = true elseif tonumber(level) == 18 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") then txt = "build fountain first" elseif tonumber(level) == 19 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") and tonumber(fountain) > 4 then - inv:remove_item("main", "default:cobble 40") - inv:remove_item("main", "castrum:sword_stone 12") + Item_Remove2(player, "main", "default:cobble 40") + Item_Remove2(player, "main", "castrum:sword_stone 12") upgrade = true elseif tonumber(level) == 19 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") then txt = "upgrade fountain to lv.2 first" elseif tonumber(level) == 20 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") and tonumber(fountain) > 5 then - inv:remove_item("main", "default:desert_cobble 40") - inv:remove_item("main", "castrum:sword_steel 12") + Item_Remove2(player, "main", "default:desert_cobble 40") + Item_Remove2(player, "main", "castrum:sword_steel 12") upgrade = true elseif tonumber(level) == 20 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") then txt = "upgrade fountain to lv.3 first" elseif tonumber(level) == 21 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") and tonumber(fountain) > 6 then - inv:remove_item("main", "default:desert_cobble 160") - inv:remove_item("main", "castrum:sword_steel 48") + Item_Remove2(player, "main", "default:desert_cobble 160") + Item_Remove2(player, "main", "castrum:sword_steel 48") upgrade = true elseif tonumber(level) == 21 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") then txt = "upgrade fountain to lv.4 first" elseif tonumber(level) == 22 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") and tonumber(fountain) > 7 then Item_Remove(player,"default:desert_cobble",320) - inv:remove_item("main", "castrum:sword_bronze 48") + Item_Remove2(player, "main", "castrum:sword_bronze 48") upgrade = true elseif tonumber(level) == 22 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") then txt = "upgrade fountain to lv.5 first" @@ -12948,35 +13604,35 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 14 and inv:contains_item("main", "default:cobble 3") then - inv:remove_item("main", "default:cobble 3") + Item_Remove2(player, "main", "default:cobble 3") upgrade = true elseif tonumber(level) == 14 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:cobble 10") - inv:remove_item("main", "castrum:sword_stone 3") + Item_Remove2(player, "main", "default:cobble 10") + Item_Remove2(player, "main", "castrum:sword_stone 3") upgrade = true elseif tonumber(level) == 14 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") then txt = "build fountain first" elseif tonumber(level) == 15 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") and tonumber(fountain) > 4 then - inv:remove_item("main", "default:cobble 40") - inv:remove_item("main", "castrum:sword_stone 12") + Item_Remove2(player, "main", "default:cobble 40") + Item_Remove2(player, "main", "castrum:sword_stone 12") upgrade = true elseif tonumber(level) == 15 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") then txt = "upgrade fountain to lv.2 first" elseif tonumber(level) == 16 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") and tonumber(fountain) > 5 then - inv:remove_item("main", "default:desert_cobble 40") - inv:remove_item("main", "castrum:sword_steel 12") + Item_Remove2(player, "main", "default:desert_cobble 40") + Item_Remove2(player, "main", "castrum:sword_steel 12") upgrade = true elseif tonumber(level) == 16 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") then txt = "upgrade fountain to lv.3 first" elseif tonumber(level) == 17 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") and tonumber(fountain) > 6 then - inv:remove_item("main", "default:desert_cobble 160") - inv:remove_item("main", "castrum:sword_steel 48") + Item_Remove2(player, "main", "default:desert_cobble 160") + Item_Remove2(player, "main", "castrum:sword_steel 48") upgrade = true elseif tonumber(level) == 17 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") then txt = "upgrade fountain to lv.4 first" elseif tonumber(level) == 18 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") and tonumber(fountain) > 7 then Item_Remove(player,"default:desert_cobble",320) - inv:remove_item("main", "castrum:sword_bronze 48") + Item_Remove2(player, "main", "castrum:sword_bronze 48") upgrade = true elseif tonumber(level) == 18 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") then txt = "upgrade fountain to lv.5 first" @@ -13015,35 +13671,35 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 14 and inv:contains_item("main", "default:cobble 3") then - inv:remove_item("main", "default:cobble 3") + Item_Remove2(player, "main", "default:cobble 3") upgrade = true elseif tonumber(level) == 14 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:cobble 10") - inv:remove_item("main", "castrum:sword_stone 3") + Item_Remove2(player, "main", "default:cobble 10") + Item_Remove2(player, "main", "castrum:sword_stone 3") upgrade = true elseif tonumber(level) == 14 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") then txt = "build fountain first" elseif tonumber(level) == 15 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") and tonumber(fountain) > 4 then - inv:remove_item("main", "default:cobble 40") - inv:remove_item("main", "castrum:sword_stone 12") + Item_Remove2(player, "main", "default:cobble 40") + Item_Remove2(player, "main", "castrum:sword_stone 12") upgrade = true elseif tonumber(level) == 15 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") then txt = "upgrade fountain to lv.2 first" elseif tonumber(level) == 16 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") and tonumber(fountain) > 5 then - inv:remove_item("main", "default:desert_cobble 40") - inv:remove_item("main", "castrum:sword_steel 12") + Item_Remove2(player, "main", "default:desert_cobble 40") + Item_Remove2(player, "main", "castrum:sword_steel 12") upgrade = true elseif tonumber(level) == 16 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") then txt = "upgrade fountain to lv.3 first" elseif tonumber(level) == 17 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") and tonumber(fountain) > 6 then - inv:remove_item("main", "default:desert_cobble 160") - inv:remove_item("main", "castrum:sword_steel 48") + Item_Remove2(player, "main", "default:desert_cobble 160") + Item_Remove2(player, "main", "castrum:sword_steel 48") upgrade = true elseif tonumber(level) == 17 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") then txt = "upgrade fountain to lv.4 first" elseif tonumber(level) == 18 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") and tonumber(fountain) > 7 then Item_Remove(player,"default:desert_cobble",320) - inv:remove_item("main", "castrum:sword_bronze 48") + Item_Remove2(player, "main", "castrum:sword_bronze 48") upgrade = true elseif tonumber(level) == 18 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") then txt = "upgrade fountain to lv.5 first" @@ -13082,19 +13738,19 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 9 and inv:contains_item("main", "castrum:shovel_stone 3") and tonumber(bridge) > 8 then - inv:remove_item("main", "castrum:shovel_stone 3") + Item_Remove2(player, "main", "castrum:shovel_stone 3") upgrade = true elseif tonumber(level) < 9 and inv:contains_item("main", "castrum:shovel_stone 3") then txt = "build bridge first" elseif tonumber(level) == 9 and inv:contains_item("main", "castrum:shovel_steel 27") and inv:contains_item("main", "castrum:bucket_water 30") and tonumber(bridge) > 9 then - inv:remove_item("main", "castrum:shovel_steel 27") - inv:remove_item("main", "castrum:bucket_water 30") + Item_Remove2(player, "main", "castrum:shovel_steel 27") + Item_Remove2(player, "main", "castrum:bucket_water 30") upgrade = true elseif tonumber(level) == 9 and inv:contains_item("main", "castrum:shovel_steel 27") and inv:contains_item("main", "castrum:bucket_water 30") then txt = "upgrade bridge to lv.2 first" elseif tonumber(level) == 10 and inv:contains_item("main", "castrum:shovel_bronze 54") and inv:contains_item("main", "castrum:bucket_water 60") and tonumber(bridge) > 10 then - inv:remove_item("main", "castrum:shovel_bronze 54") - inv:remove_item("main", "castrum:bucket_water 60") + Item_Remove2(player, "main", "castrum:shovel_bronze 54") + Item_Remove2(player, "main", "castrum:bucket_water 60") upgrade = true elseif tonumber(level) == 10 and inv:contains_item("main", "castrum:shovel_bronze 54") and inv:contains_item("main", "castrum:bucket_water 60") then txt = "upgrade bridge to lv.3 first" @@ -13133,35 +13789,35 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 18 and inv:contains_item("main", "default:cobble 3") then - inv:remove_item("main", "default:cobble 3") + Item_Remove2(player, "main", "default:cobble 3") upgrade = true elseif tonumber(level) == 18 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:cobble 10") - inv:remove_item("main", "castrum:sword_stone 3") + Item_Remove2(player, "main", "default:cobble 10") + Item_Remove2(player, "main", "castrum:sword_stone 3") upgrade = true elseif tonumber(level) == 18 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") then txt = "build fountain first" elseif tonumber(level) == 19 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") and tonumber(fountain) > 4 then - inv:remove_item("main", "default:cobble 40") - inv:remove_item("main", "castrum:sword_stone 12") + Item_Remove2(player, "main", "default:cobble 40") + Item_Remove2(player, "main", "castrum:sword_stone 12") upgrade = true elseif tonumber(level) == 19 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") then txt = "upgrade fountain to lv.2 first" elseif tonumber(level) == 20 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") and tonumber(fountain) > 5 then - inv:remove_item("main", "default:desert_cobble 40") - inv:remove_item("main", "castrum:sword_steel 12") + Item_Remove2(player, "main", "default:desert_cobble 40") + Item_Remove2(player, "main", "castrum:sword_steel 12") upgrade = true elseif tonumber(level) == 20 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") then txt = "upgrade fountain to lv.3 first" elseif tonumber(level) == 21 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") and tonumber(fountain) > 6 then - inv:remove_item("main", "default:desert_cobble 160") - inv:remove_item("main", "castrum:sword_steel 48") + Item_Remove2(player, "main", "default:desert_cobble 160") + Item_Remove2(player, "main", "castrum:sword_steel 48") upgrade = true elseif tonumber(level) == 21 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") then txt = "upgrade fountain to lv.4 first" elseif tonumber(level) == 22 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") and tonumber(fountain) > 7 then Item_Remove(player,"default:desert_cobble",320) - inv:remove_item("main", "castrum:sword_bronze 48") + Item_Remove2(player, "main", "castrum:sword_bronze 48") upgrade = true elseif tonumber(level) == 22 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") then txt = "upgrade fountain to lv.5 first" @@ -13200,19 +13856,19 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 9 and inv:contains_item("main", "castrum:shovel_stone 3") and tonumber(bridge) > 8 then - inv:remove_item("main", "castrum:shovel_stone 3") + Item_Remove2(player, "main", "castrum:shovel_stone 3") upgrade = true elseif tonumber(level) < 9 and inv:contains_item("main", "castrum:shovel_stone 3") then txt = "build bridge first" elseif tonumber(level) == 9 and inv:contains_item("main", "castrum:shovel_steel 27") and inv:contains_item("main", "castrum:bucket_water 30") and tonumber(bridge) > 9 then - inv:remove_item("main", "castrum:shovel_steel 27") - inv:remove_item("main", "castrum:bucket_water 30") + Item_Remove2(player, "main", "castrum:shovel_steel 27") + Item_Remove2(player, "main", "castrum:bucket_water 30") upgrade = true elseif tonumber(level) == 9 and inv:contains_item("main", "castrum:shovel_steel 27") and inv:contains_item("main", "castrum:bucket_water 30") then txt = "upgrade bridge to lv.2 first" elseif tonumber(level) == 10 and inv:contains_item("main", "castrum:shovel_bronze 54") and inv:contains_item("main", "castrum:bucket_water 60") and tonumber(bridge) > 10 then - inv:remove_item("main", "castrum:shovel_bronze 54") - inv:remove_item("main", "castrum:bucket_water 60") + Item_Remove2(player, "main", "castrum:shovel_bronze 54") + Item_Remove2(player, "main", "castrum:bucket_water 60") upgrade = true elseif tonumber(level) == 10 and inv:contains_item("main", "castrum:shovel_bronze 54") and inv:contains_item("main", "castrum:bucket_water 60") then txt = "upgrade bridge to lv.3 first" @@ -13251,19 +13907,19 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 9 and inv:contains_item("main", "castrum:shovel_stone 3") and tonumber(bridge) > 8 then - inv:remove_item("main", "castrum:shovel_stone 3") + Item_Remove2(player, "main", "castrum:shovel_stone 3") upgrade = true elseif tonumber(level) < 9 and inv:contains_item("main", "castrum:shovel_stone 3") then txt = "build bridge first" elseif tonumber(level) == 9 and inv:contains_item("main", "castrum:shovel_steel 27") and inv:contains_item("main", "castrum:bucket_water 30") and tonumber(bridge) > 9 then - inv:remove_item("main", "castrum:shovel_steel 27") - inv:remove_item("main", "castrum:bucket_water 30") + Item_Remove2(player, "main", "castrum:shovel_steel 27") + Item_Remove2(player, "main", "castrum:bucket_water 30") upgrade = true elseif tonumber(level) == 9 and inv:contains_item("main", "castrum:shovel_steel 27") and inv:contains_item("main", "castrum:bucket_water 30") then txt = "upgrade bridge to lv.2 first" elseif tonumber(level) == 10 and inv:contains_item("main", "castrum:shovel_bronze 54") and inv:contains_item("main", "castrum:bucket_water 60") and tonumber(bridge) > 10 then - inv:remove_item("main", "castrum:shovel_bronze 54") - inv:remove_item("main", "castrum:bucket_water 60") + Item_Remove2(player, "main", "castrum:shovel_bronze 54") + Item_Remove2(player, "main", "castrum:bucket_water 60") upgrade = true elseif tonumber(level) == 10 and inv:contains_item("main", "castrum:shovel_bronze 54") and inv:contains_item("main", "castrum:bucket_water 60") then txt = "upgrade bridge to lv.3 first" @@ -13302,35 +13958,35 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 18 and inv:contains_item("main", "default:cobble 3") then - inv:remove_item("main", "default:cobble 3") + Item_Remove2(player, "main", "default:cobble 3") upgrade = true elseif tonumber(level) == 18 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:cobble 10") - inv:remove_item("main", "castrum:sword_stone 3") + Item_Remove2(player, "main", "default:cobble 10") + Item_Remove2(player, "main", "castrum:sword_stone 3") upgrade = true elseif tonumber(level) == 18 and inv:contains_item("main", "default:cobble 10") and inv:contains_item("main", "castrum:sword_stone 3") then txt = "build fountain first" elseif tonumber(level) == 19 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") and tonumber(fountain) > 4 then - inv:remove_item("main", "default:cobble 40") - inv:remove_item("main", "castrum:sword_stone 12") + Item_Remove2(player, "main", "default:cobble 40") + Item_Remove2(player, "main", "castrum:sword_stone 12") upgrade = true elseif tonumber(level) == 19 and inv:contains_item("main", "default:cobble 40") and inv:contains_item("main", "castrum:sword_stone 12") then txt = "upgrade fountain to lv.2 first" elseif tonumber(level) == 20 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") and tonumber(fountain) > 5 then - inv:remove_item("main", "default:desert_cobble 40") - inv:remove_item("main", "castrum:sword_steel 12") + Item_Remove2(player, "main", "default:desert_cobble 40") + Item_Remove2(player, "main", "castrum:sword_steel 12") upgrade = true elseif tonumber(level) == 20 and inv:contains_item("main", "default:desert_cobble 40") and inv:contains_item("main", "castrum:sword_steel 12") then txt = "upgrade fountain to lv.3 first" elseif tonumber(level) == 21 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") and tonumber(fountain) > 6 then - inv:remove_item("main", "default:desert_cobble 160") - inv:remove_item("main", "castrum:sword_steel 48") + Item_Remove2(player, "main", "default:desert_cobble 160") + Item_Remove2(player, "main", "castrum:sword_steel 48") upgrade = true elseif tonumber(level) == 21 and inv:contains_item("main", "default:desert_cobble 160") and inv:contains_item("main", "castrum:sword_steel 48") then txt = "upgrade fountain to lv.4 first" elseif tonumber(level) == 22 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") and tonumber(fountain) > 7 then Item_Remove(player,"default:desert_cobble",320) - inv:remove_item("main", "castrum:sword_bronze 48") + Item_Remove2(player, "main", "castrum:sword_bronze 48") upgrade = true elseif tonumber(level) == 22 and inv:contains_item("main", "default:desert_cobble 320") and inv:contains_item("main", "castrum:sword_bronze 48") then txt = "upgrade fountain to lv.5 first" @@ -13369,16 +14025,16 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 6 and inv:contains_item("main", "default:cobble 8") and inv:contains_item("main", "default:wood 6") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:cobble 8") - inv:remove_item("main", "default:wood 6") + Item_Remove2(player, "main", "default:cobble 8") + Item_Remove2(player, "main", "default:wood 6") upgrade = true elseif tonumber(level) == 6 and inv:contains_item("main", "default:cobble 80") and inv:contains_item("main", "default:wood 60") and tonumber(fountain) > 5 then - inv:remove_item("main", "default:cobble 80") - inv:remove_item("main", "default:wood 60") + Item_Remove2(player, "main", "default:cobble 80") + Item_Remove2(player, "main", "default:wood 60") upgrade = true elseif tonumber(level) == 7 and inv:contains_item("main", "default:desert_cobble 80") and inv:contains_item("main", "default:junglewood 60") and tonumber(fountain) > 5 then - inv:remove_item("main", "default:desert_cobble 80") - inv:remove_item("main", "default:junglewood 60") + Item_Remove2(player, "main", "default:desert_cobble 80") + Item_Remove2(player, "main", "default:junglewood 60") upgrade = true elseif tonumber(level) < 6 and inv:contains_item("main", "default:cobble 8") and inv:contains_item("main", "default:wood 6") then txt = "build fountain first" @@ -13423,14 +14079,14 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 7 and inv:contains_item("main", "default:wood 100") and inv:contains_item("main", "castrum:bucket_river_water 25") and tonumber(fountain) > 6 then - inv:remove_item("main", "default:wood 100") - inv:remove_item("main", "castrum:bucket_river_water 25") + Item_Remove2(player, "main", "default:wood 100") + Item_Remove2(player, "main", "castrum:bucket_river_water 25") upgrade = true elseif tonumber(level) < 7 and inv:contains_item("main", "default:wood 100") and inv:contains_item("main", "castrum:bucket_river_water 25") then txt = "upgrade fountain to lv.4 first" elseif tonumber(level) == 7 and inv:contains_item("main", "default:junglewood 400") and inv:contains_item("main", "castrum:bucket_river_water 100") and tonumber(fountain) > 8 then - inv:remove_item("main", "default:junglewood 400") - inv:remove_item("main", "castrum:bucket_river_water 100") + Item_Remove2(player, "main", "default:junglewood 400") + Item_Remove2(player, "main", "castrum:bucket_river_water 100") upgrade = true elseif tonumber(level) == 7 and inv:contains_item("main", "default:junglewood 400") and inv:contains_item("main", "castrum:bucket_river_water 100") then txt = "upgrade fountain to lv.6 first" @@ -13524,6 +14180,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) elseif tonumber(level) == 3 and tonumber(chapter) > 4 then upgrade = true elseif tonumber(level) == 4 and tonumber(chapter) > 5 then + upgrade = true + elseif tonumber(level) == 5 and tonumber(chapter) > 6 then upgrade = true elseif tonumber(level) == 1 then txt = "complete chapter 2 first" @@ -13533,11 +14191,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) txt = "complete chapter 4 first" elseif tonumber(level) == 4 then txt = "complete chapter 5 first" + elseif tonumber(level) == 5 then + txt = "complete chapter 6 first" end if upgrade == false then minetest.chat_send_player(player:get_player_name(), txt) end - if (tonumber(level)) < 5 and upgrade then + if (tonumber(level)) < 6 and upgrade then Mine(tonumber(level)+1,player) file = io.open(minetest.get_worldpath().."/SAVE/Mine.txt", "w") file:write(tonumber(level)+1) @@ -13579,6 +14239,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) elseif tonumber(level) == 3 and tonumber(chapter) > 4 then upgrade = true elseif tonumber(level) == 4 and tonumber(chapter) > 5 then + upgrade = true + elseif tonumber(level) == 5 and tonumber(chapter) > 6 then upgrade = true elseif tonumber(level) == 0 then txt = "complete chapter 1 first" @@ -13590,11 +14252,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) txt = "complete chapter 4 first" elseif tonumber(level) == 4 then txt = "complete chapter 5 first" + elseif tonumber(level) == 5 then + txt = "complete chapter 6 first" end if upgrade == false then minetest.chat_send_player(player:get_player_name(), txt) end - if (tonumber(level)) < 5 and upgrade then + if (tonumber(level)) < 6 and upgrade then Quarry(tonumber(level)+1,player) file = io.open(minetest.get_worldpath().."/SAVE/Quarry.txt", "w") file:write(tonumber(level)+1) @@ -13640,6 +14304,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) elseif tonumber(level) == 4 and tonumber(chapter) > 4 then upgrade = true elseif tonumber(level) == 5 and tonumber(chapter) > 5 then + upgrade = true + elseif tonumber(level) == 6 and tonumber(chapter) > 6 then upgrade = true elseif tonumber(level) == 1 then txt = "complete chapter 1 first" @@ -13651,11 +14317,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) txt = "complete chapter 4 first" elseif tonumber(level) == 5 then txt = "complete chapter 5 first" + elseif tonumber(level) == 6 then + txt = "complete chapter 6 first" end if upgrade == false then minetest.chat_send_player(player:get_player_name(), txt) end - if (tonumber(level)) < 6 and upgrade then + if (tonumber(level)) < 7 and upgrade then Tree(tonumber(level)+1,player) file = io.open(minetest.get_worldpath().."/SAVE/Tree.txt", "w") file:write(tonumber(level)+1) @@ -13683,13 +14351,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 5 and inv:contains_item("main", "default:wood 5") then - inv:remove_item("main", "default:wood 5") + Item_Remove2(player, "main", "default:wood 5") upgrade = true elseif tonumber(level) == 5 and inv:contains_item("main", "default:junglewood 25") then - inv:remove_item("main", "default:junglewood 25") + Item_Remove2(player, "main", "default:junglewood 25") upgrade = true elseif tonumber(level) == 6 and inv:contains_item("main", "default:pine_wood 100") then - inv:remove_item("main", "default:pine_wood 100") + Item_Remove2(player, "main", "default:pine_wood 100") upgrade = true end if upgrade == false then @@ -13726,12 +14394,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 5 and inv:contains_item("main", "default:wood 10") and tonumber(fountain) > 4 then - inv:remove_item("main", "default:wood 10") + Item_Remove2(player, "main", "default:wood 10") upgrade = true elseif tonumber(level) < 5 and inv:contains_item("main", "default:wood 10") then txt = "upgrade fountain to lv.2 first" elseif tonumber(level) == 5 and inv:contains_item("main", "default:junglewood 50") and tonumber(fountain) > 6 then - inv:remove_item("main", "default:junglewood 50") + Item_Remove2(player, "main", "default:junglewood 50") upgrade = true elseif tonumber(level) == 5 and inv:contains_item("main", "default:junglewood 50") then txt = "upgrade fountain to lv.4 first" @@ -13760,7 +14428,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if formname == "craft" then for k, v in pairs(fields) do if v == "Craft" then - if player:get_attribute("need3string") then + if player:get_attribute("need1string") then if player:get_inventory():contains_item("main", player:get_attribute("need1string")) and player:get_inventory():contains_item("main", player:get_attribute("need2string")) and player:get_inventory():contains_item("main", player:get_attribute("need3string")) then player:get_inventory():remove_item("main", player:get_attribute("need1string")) player:get_inventory():remove_item("main", player:get_attribute("need2string")) @@ -13975,18 +14643,18 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 6 and inv:contains_item("main", "default:wood 20") and inv:contains_item("main", "default:cobble 20") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:wood 20") - inv:remove_item("main", "default:cobble 20") + Item_Remove2(player, "main", "default:wood 20") + Item_Remove2(player, "main", "default:cobble 20") upgrade = true elseif tonumber(level) == 6 and inv:contains_item("main", "default:wood 200") and inv:contains_item("main", "default:cobble 200") and inv:contains_item("main", "castrum:bucket_water 50") and tonumber(fountain) > 5 then Item_Remove(player,"default:wood",200) Item_Remove(player,"default:cobble",200) - inv:remove_item("main", "castrum:bucket_water 50") + Item_Remove2(player, "main", "castrum:bucket_water 50") upgrade = true elseif tonumber(level) == 7 and inv:contains_item("main", "default:junglewood 400") and inv:contains_item("main", "default:desert_cobble 400") and inv:contains_item("main", "castrum:bucket_river_water 50") and tonumber(fountain) > 7 then Item_Remove(player,"default:junglewood",400) Item_Remove(player,"default:desert_cobble",400) - inv:remove_item("main", "castrum:bucket_river_water 50") + Item_Remove2(player, "main", "castrum:bucket_river_water 50") upgrade = true elseif tonumber(level) < 6 and inv:contains_item("main", "default:wood 20") and inv:contains_item("main", "default:cobble 20") then txt = "build fountain first" @@ -14093,6 +14761,49 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end end end + if formname == "camp3" then + for k, v in pairs(fields) do + if v == "del" then + Camp3(0,player) + file = io.open(minetest.get_worldpath().."/SAVE/Camp3.txt", "w") + file:write("0") + file:close() + minetest.show_formspec(player:get_player_name(), "camp3" , camp3.get_formspec(player)) + elseif v == "Upgrade" or v == "Build" then + file = io.open(minetest.get_worldpath().."/SAVE/Camp3.txt", "r") + local level = file:read("*l") + file:close() + local inv = player:get_inventory() + local upgrade = false + file = io.open(minetest.get_worldpath().."/SAVE/Home3.txt", "r") + local home3 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Camp2.txt", "r") + local camp2 = file:read("*l") + file:close() + local txt = "not enough items" + if tonumber(level) < 1 and tonumber(home3) > 5 and tonumber(camp2) > 0 then + upgrade = true + elseif tonumber(level) < 1 and tonumber(home3) > 5 then + txt = "build camp 2 first" + elseif tonumber(level) < 1 then + txt = "build home 3 first" + end + if upgrade == false then + minetest.chat_send_player(player:get_player_name(), txt) + end + if (tonumber(level)) < 1 and upgrade then + Camp3(tonumber(level)+1,player) + file = io.open(minetest.get_worldpath().."/SAVE/Camp3.txt", "w") + file:write(tonumber(level)+1) + file:close() + end + minetest.show_formspec(player:get_player_name(), "camp3" , camp3.get_formspec(player)) + elseif v == "X" then + minetest.show_formspec(player:get_player_name(), "", "") + end + end + end if formname == "knight" then for k, v in pairs(fields) do if v == "Get Knight" then @@ -14114,6 +14825,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) max1 = max1+11 elseif tonumber(home1) == 8 then max1 = max1+14 + elseif tonumber(home1) == 9 then + max1 = max1+17 end if tonumber(home2) == 6 then max1 = max1+8 @@ -14132,12 +14845,18 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) file:close() file = io.open(minetest.get_worldpath().."/SAVE/Camp2.txt", "r") local camp2 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Camp3.txt", "r") + local camp3 = file:read("*l") file:close() if tonumber(camp1) == 1 then max2 = max2+20 end if tonumber(camp2) == 1 then max2 = max2+20 + end + if tonumber(camp3) == 1 then + max2 = max2+20 end if max1 > max2 then max = max2 @@ -14157,9 +14876,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) file:close() if (tonumber(knight_1)+tonumber(knight_2)+tonumber(knight_3)) < max then if player:get_attribute("2need1string") then - if player:get_inventory():contains_item("main", player:get_attribute("2need1string")) and player:get_inventory():contains_item("main", player:get_attribute("2need2string")) then + if player:get_inventory():contains_item("main", player:get_attribute("2need1string")) then player:get_inventory():remove_item("main", player:get_attribute("2need1string")) - player:get_inventory():remove_item("main", player:get_attribute("2need2string")) Add_knight(player,player:get_attribute("knightlv"),true) else minetest.chat_send_player(player:get_player_name(), "not enough items") @@ -14225,12 +14943,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local txt = "not enough items" if tonumber(level) < 4 and tonumber(fountain) > 3 and inv:contains_item("main", "default:cobble 4") then upgrade = true - inv:remove_item("main", "default:cobble 4") + Item_Remove2(player, "main", "default:cobble 4") elseif tonumber(level) < 4 and inv:contains_item("main", "default:cobble 4") then txt = "build fountain first" elseif tonumber(level) == 4 and tonumber(fountain) > 4 and inv:contains_item("main", "default:cobble 40") and tonumber(chapter) > 1 then upgrade = true - inv:remove_item("main", "default:cobble 40") + Item_Remove2(player, "main", "default:cobble 40") elseif tonumber(level) == 4 and inv:contains_item("main", "default:cobble 40") and tonumber(fountain) > 4 then txt = "complete chapter 1 first" elseif tonumber(level) == 4 and inv:contains_item("main", "default:cobble 40") then @@ -14256,11 +14974,18 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) txt = "complete chapter 4 first" elseif tonumber(level) == 7 and inv:contains_item("main", "default:desert_cobble 400") then txt = "upgrade fountain to lv.5 first" + elseif tonumber(level) == 8 and tonumber(fountain) > 8 and inv:contains_item("main", "default:desert_cobble 600") and tonumber(chapter) > 5 then + upgrade = true + Item_Remove(player,"default:desert_cobble",600) + elseif tonumber(level) == 8 and inv:contains_item("main", "default:desert_cobble 600") and tonumber(fountain) > 8 then + txt = "complete chapter 5 first" + elseif tonumber(level) == 8 and inv:contains_item("main", "default:desert_cobble 600") then + txt = "upgrade fountain to lv.6 first" end if upgrade == false then minetest.chat_send_player(player:get_player_name(), txt) end - if (tonumber(level)) < 8 and upgrade then + if (tonumber(level)) < 9 and upgrade then Battleground(tonumber(level)+1,player) file = io.open(minetest.get_worldpath().."/SAVE/Battleground.txt", "w") file:write(tonumber(level)+1) @@ -14282,6 +15007,54 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) minetest.show_formspec(player:get_player_name(), "", "") elseif v == "Start Chapter 5" then get_fight(5,player) + minetest.show_formspec(player:get_player_name(), "", "") + elseif v == "Start Chapter 6" then + get_fight(6,player) + minetest.show_formspec(player:get_player_name(), "", "") + elseif v == "X" then + minetest.show_formspec(player:get_player_name(), "", "") + end + end + end + if formname == "island_battleground" then + for k, v in pairs(fields) do + if v == "del" then + Island_Battleground(0,player) + file = io.open(minetest.get_worldpath().."/SAVE/Island_Battleground.txt", "w") + file:write("0") + file:close() + minetest.show_formspec(player:get_player_name(), "island_battleground" , island_battleground.get_formspec(player)) + elseif v == "Upgrade" or v == "Build" then + file = io.open(minetest.get_worldpath().."/SAVE/Island_Battleground.txt", "r") + local level = file:read("*l") + file:close() + local inv = player:get_inventory() + local upgrade = false + file = io.open(minetest.get_worldpath().."/SAVE/Island_Fountain.txt", "r") + local fountain = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Island_Chapter.txt", "r") + local chapter = file:read("*l") + file:close() + local txt = "not enough items" + if tonumber(level) < 4 and tonumber(fountain) > 3 and inv:contains_item("main", "default:sand 400") then + upgrade = true + Item_Remove2(player, "main", "default:sand 400") + elseif tonumber(level) < 4 and inv:contains_item("main", "default:sand 400") then + txt = "build island fountain first" + end + if upgrade == false then + minetest.chat_send_player(player:get_player_name(), txt) + end + if (tonumber(level)) < 4 and upgrade then + Island_Battleground(tonumber(level)+1,player) + file = io.open(minetest.get_worldpath().."/SAVE/Island_Battleground.txt", "w") + file:write(tonumber(level)+1) + file:close() + end + minetest.show_formspec(player:get_player_name(), "island_battleground" , island_battleground.get_formspec(player)) + elseif v == "Start Island Chapter 1" then + set_sea_fight(1,player) minetest.show_formspec(player:get_player_name(), "", "") elseif v == "X" then minetest.show_formspec(player:get_player_name(), "", "") @@ -14307,10 +15080,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 7 and inv:contains_item("main", "default:sand 3") then - inv:remove_item("main", "default:sand 3") + Item_Remove2(player, "main", "default:sand 3") upgrade = true elseif tonumber(level) == 7 and inv:contains_item("main", "default:desert_sand 21") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:desert_sand 21") + Item_Remove2(player, "main", "default:desert_sand 21") upgrade = true elseif tonumber(level) == 7 and inv:contains_item("main", "default:desert_sand 21") then txt = "build island fountain first" @@ -14349,10 +15122,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 7 and inv:contains_item("main", "default:sand 3") then - inv:remove_item("main", "default:sand 3") + Item_Remove2(player, "main", "default:sand 3") upgrade = true elseif tonumber(level) == 7 and inv:contains_item("main", "default:desert_sand 21") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:desert_sand 21") + Item_Remove2(player, "main", "default:desert_sand 21") upgrade = true elseif tonumber(level) == 7 and inv:contains_item("main", "default:desert_sand 21") then txt = "build island fountain first" @@ -14391,10 +15164,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 7 and inv:contains_item("main", "default:sand 3") then - inv:remove_item("main", "default:sand 3") + Item_Remove2(player, "main", "default:sand 3") upgrade = true elseif tonumber(level) == 7 and inv:contains_item("main", "default:desert_sand 21") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:desert_sand 21") + Item_Remove2(player, "main", "default:desert_sand 21") upgrade = true elseif tonumber(level) == 7 and inv:contains_item("main", "default:desert_sand 21") then txt = "build island fountain first" @@ -14433,10 +15206,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 7 and inv:contains_item("main", "default:sand 3") then - inv:remove_item("main", "default:sand 3") + Item_Remove2(player, "main", "default:sand 3") upgrade = true elseif tonumber(level) == 7 and inv:contains_item("main", "default:desert_sand 21") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:desert_sand 21") + Item_Remove2(player, "main", "default:desert_sand 21") upgrade = true elseif tonumber(level) == 7 and inv:contains_item("main", "default:desert_sand 21") then txt = "build island fountain first" @@ -14484,12 +15257,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 4 and inv:contains_item("main", "default:sand 10") and tonumber(island_walle) > 6 and tonumber(island_wallw) > 6 and tonumber(island_walln) > 6 and tonumber(island_walls) > 6 then - inv:remove_item("main", "default:sand 10") + Item_Remove2(player, "main", "default:sand 10") upgrade = true elseif tonumber(level) < 4 and inv:contains_item("main", "default:sand 10") then txt = "build island walls first" elseif tonumber(level) == 4 and inv:contains_item("main", "default:desert_sand 100") and tonumber(island_walle) > 7 and tonumber(island_wallw) > 7 and tonumber(island_walln) > 7 and tonumber(island_walls) > 7 then - inv:remove_item("main", "default:desert_sand 100") + Item_Remove2(player, "main", "default:desert_sand 100") upgrade = true elseif tonumber(level) == 4 and inv:contains_item("main", "default:desert_sand 100") then txt = "upgrade island walls to lv.2 first" @@ -14543,11 +15316,15 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) upgrade = true elseif tonumber(level) == 2 then txt = "complete chapter 5 first" + elseif tonumber(level) == 3 and tonumber(chapter) > 6 then + upgrade = true + elseif tonumber(level) == 3 then + txt = "complete chapter 6 first" end if upgrade == false then minetest.chat_send_player(player:get_player_name(), txt) end - if (tonumber(level)) < 3 and upgrade then + if (tonumber(level)) < 4 and upgrade then Sandmine(tonumber(level)+1,player) file = io.open(minetest.get_worldpath().."/SAVE/Sandmine.txt", "w") file:write(tonumber(level)+1) @@ -14578,12 +15355,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 5 and inv:contains_item("main", "default:wood 10") and tonumber(fountain) > 4 then - inv:remove_item("main", "default:wood 10") + Item_Remove2(player, "main", "default:wood 10") upgrade = true elseif tonumber(level) < 5 and inv:contains_item("main", "default:wood 10") then txt = "upgrade fountain to lv.2 first" elseif tonumber(level) == 5 and inv:contains_item("main", "default:junglewood 50") and tonumber(fountain) > 6 then - inv:remove_item("main", "default:junglewood 50") + Item_Remove2(player, "main", "default:junglewood 50") upgrade = true elseif tonumber(level) == 5 and inv:contains_item("main", "default:junglewood 50") then txt = "upgrade fountain to lv.4 first" @@ -14678,8 +15455,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 6 and inv:contains_item("main", "default:sand 80") and inv:contains_item("main", "default:wood 60") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:sand 80") - inv:remove_item("main", "default:wood 60") + Item_Remove2(player, "main", "default:sand 80") + Item_Remove2(player, "main", "default:wood 60") upgrade = true elseif tonumber(level) < 6 and inv:contains_item("main", "default:sand 80") and inv:contains_item("main", "default:wood 60") then txt = "build island fountain first" @@ -14738,11 +15515,15 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) upgrade = true elseif tonumber(level) == 3 then txt = "complete chapter 5 first" + elseif tonumber(level) == 4 and tonumber(chapter) > 6 then + upgrade = true + elseif tonumber(level) == 4 then + txt = "complete chapter 6 first" end if upgrade == false then minetest.chat_send_player(player:get_player_name(), txt) end - if (tonumber(level)) < 4 and upgrade then + if (tonumber(level)) < 5 and upgrade then Cactusfarm(tonumber(level)+1,player) file = io.open(minetest.get_worldpath().."/SAVE/Cactusfarm.txt", "w") file:write(tonumber(level)+1) @@ -14853,7 +15634,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 3 and inv:contains_item("main", "default:mossycobble 50") then - inv:remove_item("main", "default:mossycobble 50") + Item_Remove2(player, "main", "default:mossycobble 50") upgrade = true end if upgrade == false then @@ -14931,8 +15712,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 5 and inv:contains_item("main", "default:sand 80") and inv:contains_item("main", "default:glass 10") and tonumber(fountain) > 3 then - inv:remove_item("main", "default:sand 80") - inv:remove_item("main", "default:glass 10") + Item_Remove2(player, "main", "default:sand 80") + Item_Remove2(player, "main", "default:glass 10") upgrade = true elseif tonumber(level) < 5 and inv:contains_item("main", "default:sand 80") and inv:contains_item("main", "default:glass 10") then txt = "build island fountain first" @@ -14971,14 +15752,14 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 6 and inv:contains_item("main", "default:cobble 8") and inv:contains_item("main", "default:wood 10") and tonumber(fountain) > 7 then - inv:remove_item("main", "default:cobble 8") - inv:remove_item("main", "default:wood 10") + Item_Remove2(player, "main", "default:cobble 8") + Item_Remove2(player, "main", "default:wood 10") upgrade = true elseif tonumber(level) < 6 and inv:contains_item("main", "default:cobble 8") and inv:contains_item("main", "default:wood 10") then txt = "upgrade fountain to lv.5 first" elseif tonumber(level) == 6 and inv:contains_item("main", "default:cobble 64") and inv:contains_item("main", "default:junglewood 80") and tonumber(fountain) > 8 then - inv:remove_item("main", "default:junglewood 80") - inv:remove_item("main", "default:cobble 64") + Item_Remove2(player, "main", "default:junglewood 80") + Item_Remove2(player, "main", "default:cobble 64") upgrade = true elseif tonumber(level) == 6 and inv:contains_item("main", "default:cobble 64") and inv:contains_item("main", "default:junglewood 80") then txt = "upgrade fountain to lv.6 first" @@ -15014,7 +15795,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 7 and inv:contains_item("main", "default:wood 100") then - inv:remove_item("main", "default:wood 100") + Item_Remove2(player, "main", "default:wood 100") upgrade = true end if upgrade == false then @@ -15032,6 +15813,40 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end end end + if formname == "island_pier2" then + for k, v in pairs(fields) do + if v == "del" then + Island_Pier2(0,player) + file = io.open(minetest.get_worldpath().."/SAVE/Island_Pier2.txt", "w") + file:write("0") + file:close() + minetest.show_formspec(player:get_player_name(), "island_pier2" , island_pier2.get_formspec(player)) + elseif v == "Upgrade" or v == "Build" then + file = io.open(minetest.get_worldpath().."/SAVE/Island_Pier2.txt", "r") + local level = file:read("*l") + file:close() + local inv = player:get_inventory() + local upgrade = false + local txt = "not enough items" + if tonumber(level) < 3 and inv:contains_item("main", "default:wood 100") then + Item_Remove2(player, "main", "default:wood 100") + upgrade = true + end + if upgrade == false then + minetest.chat_send_player(player:get_player_name(), txt) + end + if (tonumber(level)) < 3 and upgrade then + Island_Pier2(tonumber(level)+1,player) + file = io.open(minetest.get_worldpath().."/SAVE/Island_Pier2.txt", "w") + file:write(tonumber(level)+1) + file:close() + end + minetest.show_formspec(player:get_player_name(), "island_pier2" , island_pier2.get_formspec(player)) + elseif v == "X" then + minetest.show_formspec(player:get_player_name(), "", "") + end + end + end if formname == "island_barracks" then for k, v in pairs(fields) do if v == "del" then @@ -15052,7 +15867,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local txt = "not enough items" if tonumber(level) < 6 and inv:contains_item("main", "default:sand 200") and inv:contains_item("main", "default:cactus 80") and tonumber(fountain) > 4 then Item_Remove(player,"default:sand",200) - inv:remove_item("main", "default:cactus 80") + Item_Remove2(player, "main", "default:cactus 80") upgrade = true elseif tonumber(level) < 6 and inv:contains_item("main", "default:sand 200") and inv:contains_item("main", "default:cactus 80") then txt = "upgrade island fountain to lv.2 first" @@ -15140,7 +15955,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 14 and inv:contains_item("main", "default:wood 80") and tonumber(fountain) > 4 then - inv:remove_item("main", "default:wood 80") + Item_Remove2(player, "main", "default:wood 80") upgrade = true elseif tonumber(level) < 14 and inv:contains_item("main", "default:wood 80") then txt = "upgrade island fountain to lv.2 first" @@ -15247,7 +16062,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 1 and inv:contains_item("main", "wool:white 9") then - inv:remove_item("main", "wool:white 9") + Item_Remove2(player, "main", "wool:white 9") upgrade = true end if upgrade == false then @@ -15281,7 +16096,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local upgrade = false local txt = "not enough items" if tonumber(level) < 1 and inv:contains_item("main", "wool:white 4") then - inv:remove_item("main", "wool:white 4") + Item_Remove2(player, "main", "wool:white 4") upgrade = true end if upgrade == false then @@ -15299,4 +16114,72 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end end end + if formname == "cannon1" then + for k, v in pairs(fields) do + if v == "del" then + Cannon1(0,player) + file = io.open(minetest.get_worldpath().."/SAVE/Cannon1.txt", "w") + file:write("0") + file:close() + minetest.show_formspec(player:get_player_name(), "cannon1" , cannon1.get_formspec(player)) + elseif v == "Upgrade" or v == "Build" then + file = io.open(minetest.get_worldpath().."/SAVE/Cannon1.txt", "r") + local level = file:read("*l") + file:close() + local inv = player:get_inventory() + local upgrade = false + local txt = "not enough items" + if tonumber(level) < 1 and inv:contains_item("main", "default:steel_ingot 25") then + Item_Remove2(player, "main", "default:steel_ingot 25") + upgrade = true + end + if upgrade == false then + minetest.chat_send_player(player:get_player_name(), txt) + end + if (tonumber(level)) < 1 and upgrade then + Cannon1(tonumber(level)+1,player) + file = io.open(minetest.get_worldpath().."/SAVE/Cannon1.txt", "w") + file:write(tonumber(level)+1) + file:close() + end + minetest.show_formspec(player:get_player_name(), "cannon1" , cannon1.get_formspec(player)) + elseif v == "X" then + minetest.show_formspec(player:get_player_name(), "", "") + end + end + end + if formname == "cannon2" then + for k, v in pairs(fields) do + if v == "del" then + Cannon2(0,player) + file = io.open(minetest.get_worldpath().."/SAVE/Cannon2.txt", "w") + file:write("0") + file:close() + minetest.show_formspec(player:get_player_name(), "cannon2" , cannon2.get_formspec(player)) + elseif v == "Upgrade" or v == "Build" then + file = io.open(minetest.get_worldpath().."/SAVE/Cannon2.txt", "r") + local level = file:read("*l") + file:close() + local inv = player:get_inventory() + local upgrade = false + local txt = "not enough items" + if tonumber(level) < 1 and inv:contains_item("main", "default:steel_ingot 25") then + Item_Remove2(player, "main", "default:steel_ingot 25") + upgrade = true + end + if upgrade == false then + minetest.chat_send_player(player:get_player_name(), txt) + end + if (tonumber(level)) < 1 and upgrade then + Cannon2(tonumber(level)+1,player) + file = io.open(minetest.get_worldpath().."/SAVE/Cannon2.txt", "w") + file:write(tonumber(level)+1) + file:close() + end + minetest.show_formspec(player:get_player_name(), "cannon2" , cannon2.get_formspec(player)) + elseif v == "X" then + minetest.show_formspec(player:get_player_name(), "", "") + end + end + end end) \ No newline at end of file diff --git a/mods/castrum/island_fight.lua b/mods/castrum/island_fight.lua new file mode 100644 index 0000000..031f18f --- /dev/null +++ b/mods/castrum/island_fight.lua @@ -0,0 +1,1553 @@ +function nextrange(x, max) + x = x + 1 + if x > max then + x = 0 + end + return x +end +function screwdriver_handler(user, pointed_thing, mode) + if pointed_thing.type ~= "node" then + return + end + local pos = pointed_thing.under + local keys = user:get_player_control() + local player_name = user:get_player_name() + + if minetest.is_protected(pos, user:get_player_name()) then + minetest.record_protection_violation(pos, user:get_player_name()) + return + end + + local node = minetest.get_node(pos) + local ndef = minetest.registered_nodes[node.name] + if not ndef or not ndef.paramtype2 == "facedir" or + (ndef.drawtype == "nodebox" and + not ndef.node_box.type == "fixed") or + node.param2 == nil then + return + end + local n = node.param2 + local axisdir = math.floor(n / 4) + local rotation = n - axisdir * 4 + if mode == 1 then + n = axisdir * 4 + nextrange(rotation, 3) + elseif mode == 3 then + n = nextrange(axisdir, 5) * 4 + end + + node.param2 = n + minetest.swap_node(pos, node) +end +function turn(player,pos,num) + for i=1,num do + screwdriver_handler(player, {type="node", under=pos, above=pos}, 1) + end +end +local levels = { +-- l,c1,c2,c3,c4,c5,c6,c7,c8,c9,p1,p2,p3,p4,p5,p6,p7,p8,p9,s1,s2,hp + {1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1,10}, +} +function set_sea_fight(level,player) + file = io.open(minetest.get_worldpath().."/SAVE/Pirate_1.txt", "r") + local pirate_1 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Ship2.txt", "r") + local ship2 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Sail1.txt", "r") + local sail1 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Sail2.txt", "r") + local sail2 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Cannon1.txt", "r") + local cannon1 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Cannon2.txt", "r") + local cannon2 = file:read("*l") + file:close() + local inv = player:get_inventory() + local num = 0 + for i=1,32 do + if inv:get_stack("main", i):is_empty() then + num = num+1 + end + end + if tonumber(ship2) > 13 then + if tonumber(sail1) > 0 and tonumber(sail2) > 0 then + if tonumber(cannon1) > 0 or tonumber(cannon2) > 0 then + if tonumber(pirate_1) > 0 then + if num > 4 then + if tonumber(pirate_1) > 0 then + player:set_attribute("sea_started", "false") + inv:add_item("main","castrum:pirate_lv1 "..pirate_1) + Chapter_Ship1_1(player) + Chapter_Ship2_1(player) + player:set_attribute("sea_level", ""..level) + player:set_attribute("sea_fight_pos1", "1") + player:set_attribute("sea_fight_pos2", "1") + player:set_attribute("sea_fight_step_1c1", "0") + player:set_attribute("sea_fight_step_1c2", "0") + player:set_attribute("sea_fight_step_2c1", "0") + player:set_attribute("sea_fight_step_2c2", "0") + player:set_attribute("sea_fight_e_hp", ""..levels[level][22]) + player:set_attribute("sea_fight_p_hp", "10") + player:set_attribute("sea_fight_c1", ""..levels[level][2]) + player:set_attribute("sea_fight_c2", ""..levels[level][3]) + player:set_attribute("sea_fight_p1", ""..levels[level][11]) + player:set_attribute("sea_fight_p2", ""..levels[level][12]) + player:set_attribute("sea_fight_s1", ""..levels[level][20]) + player:set_attribute("sea_fight_s2", ""..levels[level][21]) + player:setpos({x=-156, y=7.5, z=-27}) + end + else + minetest.chat_send_player(player:get_player_name(), "you have not enough space in your inventory") + end + else + minetest.chat_send_player(player:get_player_name(), "you have no pirates") + end + else + minetest.chat_send_player(player:get_player_name(), "build a cannon first") + end + else + minetest.chat_send_player(player:get_player_name(), "build sails first") + end + else + minetest.chat_send_player(player:get_player_name(), "build ship2 first") + end + +end +function EnemyStep(player) + local stepdone = 0 + if player:get_attribute("sea_fight_pos2") == "1" then + if tonumber(player:get_attribute("sea_fight_c1")) > 0 then + if player:get_attribute("sea_fight_step_2c1") == "0" and player:get_attribute("sea_fight_p1") == "1" and player:get_attribute("sea_fight_c1") == "1"then + stepdone = 1 + if math.random(100) < 31 then + player:set_attribute("sea_fight_p_hp", ""..tonumber(player:get_attribute("sea_fight_p_hp")-2)) + minetest.chat_send_player(player:get_player_name(), "Hit! The enemy has done 2Hp damage. You have "..player:get_attribute("sea_fight_p_hp").." hp left.") + else + minetest.chat_send_player(player:get_player_name(), "The enemy did not hit you!") + end + player:set_attribute("sea_fight_step_2c1", "5") + else + if tonumber(player:get_attribute("sea_fight_step_2c1")) > 0 then + player:set_attribute("sea_fight_step_2c1", ""..tonumber(player:get_attribute("sea_fight_step_2c1"))-1) + end + end + if tonumber(player:get_attribute("sea_fight_step_2c2")) > 0 then + player:set_attribute("sea_fight_step_2c2", ""..tonumber(player:get_attribute("sea_fight_step_2c2"))-1) + end + end + else + if tonumber(player:get_attribute("sea_fight_c2")) > 0 then + if player:get_attribute("sea_fight_step_2c2") == "0" and player:get_attribute("sea_fight_p2") == "1" and player:get_attribute("sea_fight_c2") == "1" then + stepdone = 1 + if math.random(100) < 31 then + player:set_attribute("sea_fight_p_hp", ""..tonumber(player:get_attribute("sea_fight_p_hp")-2)) + minetest.chat_send_player(player:get_player_name(), "Hit! The enemy has done 2Hp damage. You have "..player:get_attribute("sea_fight_p_hp").." hp left.") + else + minetest.chat_send_player(player:get_player_name(), "The enemy did not hit you!") + end + player:set_attribute("sea_fight_step_2c2", "5") + else + if tonumber(player:get_attribute("sea_fight_step_2c2")) > 0 then + player:set_attribute("sea_fight_step_2c2", ""..tonumber(player:get_attribute("sea_fight_step_2c2"))-1) + end + end + if tonumber(player:get_attribute("sea_fight_step_2c1")) > 0 then + player:set_attribute("sea_fight_step_2c1", ""..tonumber(player:get_attribute("sea_fight_step_2c1"))-1) + end + end + end + if stepdone == 0 then + local p = tonumber(player:get_attribute("sea_fight_s1"))*3+ tonumber(player:get_attribute("sea_fight_s2"))*2+25 + if math.random(100) < (p+1) then + if tonumber(player:get_attribute("sea_fight_pos2")) == 1 then + player:set_attribute("sea_fight_pos2", "2") + Chapter_Ship2_2(player) + else + player:set_attribute("sea_fight_pos2", "1") + Chapter_Ship2_1(player) + end + minetest.chat_send_player(player:get_player_name(), "The ememy turned the ship successfully") + else + minetest.chat_send_player(player:get_player_name(), "The enemy did not turn the ship") + end + end +end +function Check1(player) + if tonumber(player:get_attribute("sea_fight_e_hp")) < 1 or tonumber(player:get_attribute("sea_fight_p_hp")) < 1 then + player:set_attribute("sea_started", "false") + player:setpos({x=178, y=8.5, z=44}) + local inv = player:get_inventory() + inv:remove_item("main", "castrum:pirate_lv1 9") + local pirate1 = 0 + for j=149,169 do + for i=23,31 do + if minetest.get_node({x=j*(-1), y=8, z=i*(-1)}).name == "castrum:pirate_lv1" then + pirate1 = pirate1 +1 + end + end + end + file = io.open(minetest.get_worldpath().."/SAVE/Pirate_1.txt", "r") + local pirate_1 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Pirate_1.txt", "w") + file:write((tonumber(pirate_1)-pirate1)) + file:close() + Update_pirate(player) + end + if tonumber(player:get_attribute("sea_fight_e_hp")) < 1 then + minetest.chat_send_player(player:get_player_name(), "you win") + file = io.open(minetest.get_worldpath().."/SAVE/Island_Chapter.txt", "r") + local chapter = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Island_Chapter.txt", "w") + file:write((tonumber(chapter)+1)) + file:close() + else + EnemyStep(player) + Check2(player) + end +end +function Check2(player) + if tonumber(player:get_attribute("sea_fight_e_hp")) < 1 or tonumber(player:get_attribute("sea_fight_p_hp")) < 1 then + player:set_attribute("sea_started", "false") + player:setpos({x=178, y=8.5, z=44}) + local inv = player:get_inventory() + inv:remove_item("main", "castrum:pirate_lv1 9") + local pirate1 = 0 + for j=149,169 do + for i=23,31 do + if minetest.get_node({x=j*(-1), y=8, z=i*(-1)}).name == "castrum:pirate_lv1" then + pirate1 = pirate1 +1 + end + end + end + file = io.open(minetest.get_worldpath().."/SAVE/Pirate_1.txt", "r") + local pirate_1 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Pirate_1.txt", "w") + file:write((tonumber(pirate_1)-pirate1)) + file:close() + Update_pirate(player) + end + if tonumber(player:get_attribute("sea_fight_p_hp")) < 1 then + minetest.chat_send_player(player:get_player_name(), "you lose") + end +end +function Chapter_Ship1_1(player) + local pirate1 = 0 + local pirate2 = 0 + if minetest.get_node({x=-166, y=8, z=-30}).name == "castrum:pirate_lv1" then + pirate1 = 1 + end + if minetest.get_node({x=-166, y=8, z=-24}).name == "castrum:pirate_lv1" then + pirate2 = 1 + end + for j=149,169 do + for i=23,31 do + for k=7,20 do + minetest.set_node({x=j*(-1), y=k, z=i*(-1)}, {name="air"}) + end + end + end + for j=149,169 do + for i=23,31 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="castrum:water"}) + end + end + for j=150,161 do + for i=24,30 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="default:wood"}) + end + end + for j=162,163 do + for i=25,29 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="default:wood"}) + end + end + for j=164,165 do + for i=26,28 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="default:wood"}) + end + end + for j=166,167 do + minetest.set_node({x=j*(-1), y=7, z=-27}, {name="default:wood"}) + end + for j=151,161 do + minetest.set_node({x=j*(-1), y=8, z=-23}, {name="default:wood"}) + minetest.set_node({x=j*(-1), y=8, z=-31}, {name="default:wood"}) + end + for i=25,29 do + minetest.set_node({x=-149, y=8, z=i*(-1)}, {name="default:wood"}) + end + minetest.set_node({x=-150, y=8, z=-30}, {name="default:wood"}) + minetest.set_node({x=-150, y=8, z=-27}, {name="default:wood"}) + minetest.set_node({x=-150, y=8, z=-24}, {name="default:wood"}) + minetest.set_node({x=-162, y=8, z=-30}, {name="default:wood"}) + minetest.set_node({x=-162, y=8, z=-24}, {name="default:wood"}) + minetest.set_node({x=-164, y=8, z=-29}, {name="default:wood"}) + minetest.set_node({x=-164, y=8, z=-25}, {name="default:wood"}) + minetest.set_node({x=-166, y=8, z=-28}, {name="default:wood"}) + minetest.set_node({x=-166, y=8, z=-26}, {name="default:wood"}) + minetest.set_node({x=-167, y=8, z=-27}, {name="default:wood"}) + minetest.set_node({x=-168, y=8, z=-27}, {name="default:wood"}) + for i=25,29 do + minetest.set_node({x=-149, y=9, z=i*(-1)}, {name="default:wood"}) + end + minetest.set_node({x=-150, y=9, z=-30}, {name="default:wood"}) + minetest.set_node({x=-150, y=9, z=-24}, {name="default:wood"}) + minetest.set_node({x=-151, y=9, z=-31}, {name="default:wood"}) + minetest.set_node({x=-151, y=9, z=-23}, {name="default:wood"}) + minetest.set_node({x=-153, y=9, z=-31}, {name="default:wood"}) + minetest.set_node({x=-153, y=9, z=-23}, {name="default:wood"}) + minetest.set_node({x=-155, y=9, z=-31}, {name="default:wood"}) + minetest.set_node({x=-155, y=9, z=-23}, {name="default:wood"}) + minetest.set_node({x=-157, y=9, z=-31}, {name="default:wood"}) + minetest.set_node({x=-157, y=9, z=-23}, {name="default:wood"}) + minetest.set_node({x=-159, y=9, z=-31}, {name="default:wood"}) + minetest.set_node({x=-159, y=9, z=-23}, {name="default:wood"}) + minetest.set_node({x=-161, y=9, z=-31}, {name="default:wood"}) + minetest.set_node({x=-161, y=9, z=-23}, {name="default:wood"}) + minetest.set_node({x=-162, y=9, z=-30}, {name="default:wood"}) + minetest.set_node({x=-162, y=9, z=-24}, {name="default:wood"}) + minetest.set_node({x=-163, y=9, z=-30}, {name="default:wood"}) + minetest.set_node({x=-163, y=9, z=-24}, {name="default:wood"}) + minetest.set_node({x=-164, y=9, z=-29}, {name="default:wood"}) + minetest.set_node({x=-164, y=9, z=-25}, {name="default:wood"}) + minetest.set_node({x=-165, y=9, z=-29}, {name="default:wood"}) + minetest.set_node({x=-165, y=9, z=-25}, {name="default:wood"}) + minetest.set_node({x=-166, y=9, z=-28}, {name="default:wood"}) + minetest.set_node({x=-166, y=9, z=-26}, {name="default:wood"}) + minetest.set_node({x=-167, y=9, z=-28}, {name="default:wood"}) + minetest.set_node({x=-167, y=9, z=-26}, {name="default:wood"}) + minetest.set_node({x=-168, y=9, z=-27}, {name="default:wood"}) + minetest.set_node({x=-169, y=9, z=-27}, {name="default:wood"}) + for i=25,29 do + minetest.set_node({x=-149, y=10, z=i*(-1)}, {name="default:wood"}) + end + minetest.set_node({x=-150, y=10, z=-30}, {name="default:wood"}) + minetest.set_node({x=-150, y=10, z=-24}, {name="default:wood"}) + minetest.set_node({x=-150, y=8, z=-25}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-150, y=8, z=-26}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-150, y=8, z=-28}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-150, y=8, z=-29}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-150, y=8, z=-25}, above={x=-150, y=8, z=-25}}, 1) + screwdriver_handler(player, {type="node", under={x=-150, y=8, z=-26}, above={x=-150, y=8, z=-26}}, 1) + screwdriver_handler(player, {type="node", under={x=-150, y=8, z=-28}, above={x=-150, y=8, z=-28}}, 1) + screwdriver_handler(player, {type="node", under={x=-150, y=8, z=-29}, above={x=-150, y=8, z=-29}}, 1) + minetest.set_node({x=-151, y=8, z=-24}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-151, y=8, z=-30}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-151, y=8, z=-30}, above={x=-151, y=8, z=-30}}, 1) + screwdriver_handler(player, {type="node", under={x=-151, y=8, z=-30}, above={x=-151, y=8, z=-30}}, 1) + minetest.set_node({x=-153, y=8, z=-24}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-153, y=8, z=-30}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-153, y=8, z=-30}, above={x=-153, y=8, z=-30}}, 1) + screwdriver_handler(player, {type="node", under={x=-153, y=8, z=-30}, above={x=-153, y=8, z=-30}}, 1) + minetest.set_node({x=-154, y=8, z=-24}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-155, y=8, z=-24}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-155, y=8, z=-30}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-155, y=8, z=-30}, above={x=-155, y=8, z=-30}}, 1) + screwdriver_handler(player, {type="node", under={x=-155, y=8, z=-30}, above={x=-155, y=8, z=-30}}, 1) + minetest.set_node({x=-157, y=8, z=-24}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-157, y=8, z=-30}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-157, y=8, z=-30}, above={x=-157, y=8, z=-30}}, 1) + screwdriver_handler(player, {type="node", under={x=-157, y=8, z=-30}, above={x=-157, y=8, z=-30}}, 1) + minetest.set_node({x=-159, y=8, z=-24}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-159, y=8, z=-30}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-159, y=8, z=-30}, above={x=-159, y=8, z=-30}}, 1) + screwdriver_handler(player, {type="node", under={x=-159, y=8, z=-30}, above={x=-159, y=8, z=-30}}, 1) + minetest.set_node({x=-161, y=8, z=-24}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-161, y=8, z=-30}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-161, y=8, z=-30}, above={x=-161, y=8, z=-30}}, 1) + screwdriver_handler(player, {type="node", under={x=-161, y=8, z=-30}, above={x=-161, y=8, z=-30}}, 1) + minetest.set_node({x=-162, y=8, z=-25}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-162, y=8, z=-29}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-162, y=8, z=-29}, above={x=-162, y=8, z=-29}}, 1) + screwdriver_handler(player, {type="node", under={x=-162, y=8, z=-29}, above={x=-162, y=8, z=-29}}, 1) + minetest.set_node({x=-163, y=8, z=-25}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-163, y=8, z=-29}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-163, y=8, z=-29}, above={x=-163, y=8, z=-29}}, 1) + screwdriver_handler(player, {type="node", under={x=-163, y=8, z=-29}, above={x=-163, y=8, z=-29}}, 1) + minetest.set_node({x=-164, y=8, z=-26}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-164, y=8, z=-28}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-164, y=8, z=-28}, above={x=-164, y=8, z=-28}}, 1) + screwdriver_handler(player, {type="node", under={x=-164, y=8, z=-28}, above={x=-164, y=8, z=-28}}, 1) + minetest.set_node({x=-165, y=8, z=-26}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-165, y=8, z=-28}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-165, y=8, z=-28}, above={x=-165, y=8, z=-28}}, 1) + screwdriver_handler(player, {type="node", under={x=-165, y=8, z=-28}, above={x=-165, y=8, z=-28}}, 1) + minetest.set_node({x=-166, y=8, z=-27}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-166, y=8, z=-27}, above={x=-166, y=8, z=-27}}, 1) + screwdriver_handler(player, {type="node", under={x=-166, y=8, z=-27}, above={x=-166, y=8, z=-27}}, 1) + screwdriver_handler(player, {type="node", under={x=-166, y=8, z=-27}, above={x=-166, y=8, z=-27}}, 1) + for i=25,29 do + minetest.set_node({x=-149, y=11, z=i*(-1)}, {name="default:fence_wood"}) + end + minetest.set_node({x=-150, y=11, z=-30}, {name="default:fence_wood"}) + minetest.set_node({x=-150, y=11, z=-24}, {name="default:fence_wood"}) + for j=151,161 do + minetest.set_node({x=j*(-1), y=10, z=-23}, {name="default:fence_wood"}) + minetest.set_node({x=j*(-1), y=10, z=-31}, {name="default:fence_wood"}) + end + minetest.set_node({x=-154, y=10, z=-23}, {name="air"}) + minetest.set_node({x=-162, y=10, z=-30}, {name="default:fence_wood"}) + minetest.set_node({x=-162, y=10, z=-24}, {name="default:fence_wood"}) + minetest.set_node({x=-163, y=10, z=-30}, {name="default:fence_wood"}) + minetest.set_node({x=-163, y=10, z=-24}, {name="default:fence_wood"}) + minetest.set_node({x=-164, y=10, z=-29}, {name="default:fence_wood"}) + minetest.set_node({x=-164, y=10, z=-25}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=10, z=-29}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=10, z=-25}, {name="default:fence_wood"}) + minetest.set_node({x=-166, y=10, z=-28}, {name="default:fence_wood"}) + minetest.set_node({x=-166, y=10, z=-26}, {name="default:fence_wood"}) + minetest.set_node({x=-167, y=10, z=-28}, {name="default:fence_wood"}) + minetest.set_node({x=-167, y=10, z=-26}, {name="default:fence_wood"}) + minetest.set_node({x=-168, y=10, z=-27}, {name="default:fence_wood"}) + minetest.set_node({x=-169, y=10, z=-27}, {name="default:fence_wood"}) + for k=8,14 do + minetest.set_node({x=-159, y=k, z=-27}, {name="default:wood"}) + end + minetest.set_node({x=-159, y=14, z=-28}, {name="default:fence_wood"}) + minetest.set_node({x=-159, y=14, z=-29}, {name="default:fence_wood"}) + minetest.set_node({x=-159, y=14, z=-26}, {name="default:fence_wood"}) + minetest.set_node({x=-159, y=14, z=-25}, {name="default:fence_wood"}) + for k=8,16 do + minetest.set_node({x=-153, y=k, z=-27}, {name="default:wood"}) + end + minetest.set_node({x=-153, y=16, z=-26}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=16, z=-25}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=16, z=-24}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=16, z=-23}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=16, z=-28}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=16, z=-29}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=16, z=-30}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=16, z=-31}, {name="default:fence_wood"}) + minetest.set_node({x=-150, y=9, z=-27}, {name="castrum:pirate_captain"}) + screwdriver_handler(player, {type="node", under={x=-150, y=9, z=-27}, above={x=-150, y=9, z=-27}}, 1) + for i=23,31 do + minetest.set_node({x=-154, y=16, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-155, y=15, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-155, y=14, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-155, y=13, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-154, y=12, z=i*(-1)}, {name="wool:white"}) + end + for i=25,29 do + minetest.set_node({x=-160, y=14, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-161, y=13, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-161, y=12, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-160, y=11, z=i*(-1)}, {name="wool:white"}) + end + + local started = player:get_attribute("sea_started") + minetest.set_node({x=-156, y=7, z=-27}, {name="castrum:island_start_fight"}) + file = io.open(minetest.get_worldpath().."/SAVE/Cannon1.txt", "r") + local level = file:read("*l") + file:close() + if tonumber(level) == 1 then + if started == "false" then + minetest.set_node({x=-152, y=7, z=-24}, {name="castrum:sea_fight1"}) + end + minetest.set_node({x=-152, y=9, z=-23}, {name="castrum:cannon_1_1"}) + end + file = io.open(minetest.get_worldpath().."/SAVE/Cannon2.txt", "r") + local level = file:read("*l") + file:close() + if tonumber(level) == 1 then + if started == "false" then + minetest.set_node({x=-152, y=7, z=-30}, {name="castrum:sea_fight1"}) + end + minetest.set_node({x=-152, y=9, z=-31}, {name="castrum:cannon_1_1"}) + screwdriver_handler(player, {type="node", under={x=-152, y=9, z=-31}, above={x=-152, y=9, z=-31}}, 1) + screwdriver_handler(player, {type="node", under={x=-152, y=9, z=-31}, above={x=-152, y=9, z=-31}}, 1) + end + if pirate1 == 1 and started == "true" then + minetest.set_node({x=-152, y=8, z=-24}, {name="castrum:pirate_lv1"}) + screwdriver_handler(player, {type="node", under={x=-152, y=8, z=-24}, above={x=-152, y=8, z=-24}}, 1) + screwdriver_handler(player, {type="node", under={x=-152, y=8, z=-24}, above={x=-152, y=8, z=-24}}, 1) + if player:get_attribute("sea_fight_step_1c1") == "0" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_ready"}) + elseif player:get_attribute("sea_fight_step_1c1") == "1" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_1"}) + elseif player:get_attribute("sea_fight_step_1c1") == "2" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_2"}) + elseif player:get_attribute("sea_fight_step_1c1") == "3" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_3"}) + elseif player:get_attribute("sea_fight_step_1c1") == "4" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_4"}) + elseif player:get_attribute("sea_fight_step_1c1") == "5" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_5"}) + end + end + if pirate2 == 1 and started == "true" then + minetest.set_node({x=-152, y=8, z=-30}, {name="castrum:pirate_lv1"}) + end + if started == "true" then + minetest.set_node({x=-162, y=7, z=-27}, {name="castrum:turn_ship"}) + end +end +function Chapter_Ship1_2(player) + local pirate1 = 0 + local pirate2 = 0 + + if minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + pirate1 = 1 + end + if minetest.get_node({x=-152, y=8, z=-30}).name == "castrum:pirate_lv1" then + pirate2 = 1 + end + for j=149,169 do + for i=23,31 do + for k=7,20 do + minetest.set_node({x=j*(-1), y=k, z=i*(-1)}, {name="air"}) + end + end + end + for j=149,169 do + for i=23,31 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="castrum:water"}) + end + end + for j=157,168 do + for i=24,30 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="default:wood"}) + end + end + + for j=155,156 do + for i=25,29 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="default:wood"}) + end + end + + for j=153,154 do + for i=26,28 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="default:wood"}) + end + end + for j=151,152 do + minetest.set_node({x=j*(-1), y=7, z=-27}, {name="default:wood"}) + end + + for j=157,167 do + minetest.set_node({x=j*(-1), y=8, z=-23}, {name="default:wood"}) + minetest.set_node({x=j*(-1), y=8, z=-31}, {name="default:wood"}) + end + for i=25,29 do + minetest.set_node({x=-169, y=8, z=i*(-1)}, {name="default:wood"}) + end + minetest.set_node({x=-168, y=8, z=-30}, {name="default:wood"}) + minetest.set_node({x=-168, y=8, z=-27}, {name="default:wood"}) + minetest.set_node({x=-168, y=8, z=-24}, {name="default:wood"}) + minetest.set_node({x=-156, y=8, z=-30}, {name="default:wood"}) + minetest.set_node({x=-156, y=8, z=-24}, {name="default:wood"}) + minetest.set_node({x=-154, y=8, z=-29}, {name="default:wood"}) + minetest.set_node({x=-154, y=8, z=-25}, {name="default:wood"}) + minetest.set_node({x=-152, y=8, z=-28}, {name="default:wood"}) + minetest.set_node({x=-152, y=8, z=-26}, {name="default:wood"}) + minetest.set_node({x=-151, y=8, z=-27}, {name="default:wood"}) + minetest.set_node({x=-150, y=8, z=-27}, {name="default:wood"}) + + for i=25,29 do + minetest.set_node({x=-169, y=9, z=i*(-1)}, {name="default:wood"}) + end + minetest.set_node({x=-168, y=9, z=-30}, {name="default:wood"}) + minetest.set_node({x=-168, y=9, z=-24}, {name="default:wood"}) + minetest.set_node({x=-167, y=9, z=-31}, {name="default:wood"}) + minetest.set_node({x=-167, y=9, z=-23}, {name="default:wood"}) + minetest.set_node({x=-165, y=9, z=-31}, {name="default:wood"}) + minetest.set_node({x=-165, y=9, z=-23}, {name="default:wood"}) + minetest.set_node({x=-163, y=9, z=-31}, {name="default:wood"}) + minetest.set_node({x=-163, y=9, z=-23}, {name="default:wood"}) + minetest.set_node({x=-161, y=9, z=-31}, {name="default:wood"}) + minetest.set_node({x=-161, y=9, z=-23}, {name="default:wood"}) + minetest.set_node({x=-159, y=9, z=-31}, {name="default:wood"}) + minetest.set_node({x=-159, y=9, z=-23}, {name="default:wood"}) + minetest.set_node({x=-157, y=9, z=-31}, {name="default:wood"}) + minetest.set_node({x=-157, y=9, z=-23}, {name="default:wood"}) + minetest.set_node({x=-156, y=9, z=-30}, {name="default:wood"}) + minetest.set_node({x=-156, y=9, z=-24}, {name="default:wood"}) + minetest.set_node({x=-155, y=9, z=-30}, {name="default:wood"}) + minetest.set_node({x=-155, y=9, z=-24}, {name="default:wood"}) + minetest.set_node({x=-154, y=9, z=-29}, {name="default:wood"}) + minetest.set_node({x=-154, y=9, z=-25}, {name="default:wood"}) + minetest.set_node({x=-153, y=9, z=-29}, {name="default:wood"}) + minetest.set_node({x=-153, y=9, z=-25}, {name="default:wood"}) + minetest.set_node({x=-152, y=9, z=-28}, {name="default:wood"}) + minetest.set_node({x=-152, y=9, z=-26}, {name="default:wood"}) + minetest.set_node({x=-151, y=9, z=-28}, {name="default:wood"}) + minetest.set_node({x=-151, y=9, z=-26}, {name="default:wood"}) + minetest.set_node({x=-150, y=9, z=-27}, {name="default:wood"}) + minetest.set_node({x=-149, y=9, z=-27}, {name="default:wood"}) + + for i=25,29 do + minetest.set_node({x=-169, y=10, z=i*(-1)}, {name="default:wood"}) + end + minetest.set_node({x=-168, y=10, z=-30}, {name="default:wood"}) + minetest.set_node({x=-168, y=10, z=-24}, {name="default:wood"}) + minetest.set_node({x=-168, y=8, z=-25}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-168, y=8, z=-26}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-168, y=8, z=-28}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-168, y=8, z=-29}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-25}, above={x=-168, y=8, z=-25}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-26}, above={x=-168, y=8, z=-26}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-28}, above={x=-168, y=8, z=-28}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-29}, above={x=-168, y=8, z=-29}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-25}, above={x=-168, y=8, z=-25}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-26}, above={x=-168, y=8, z=-26}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-28}, above={x=-168, y=8, z=-28}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-29}, above={x=-168, y=8, z=-29}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-25}, above={x=-168, y=8, z=-25}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-26}, above={x=-168, y=8, z=-26}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-28}, above={x=-168, y=8, z=-28}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-29}, above={x=-168, y=8, z=-29}}, 1) + + minetest.set_node({x=-167, y=8, z=-24}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-167, y=8, z=-30}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-167, y=8, z=-30}, above={x=-167, y=8, z=-30}}, 1) + screwdriver_handler(player, {type="node", under={x=-167, y=8, z=-30}, above={x=-167, y=8, z=-30}}, 1) + minetest.set_node({x=-165, y=8, z=-24}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-165, y=8, z=-30}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-165, y=8, z=-30}, above={x=-165, y=8, z=-30}}, 1) + screwdriver_handler(player, {type="node", under={x=-165, y=8, z=-30}, above={x=-165, y=8, z=-30}}, 1) + minetest.set_node({x=-164, y=8, z=-30}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-164, y=8, z=-30}, above={x=-164, y=8, z=-30}}, 1) + screwdriver_handler(player, {type="node", under={x=-164, y=8, z=-30}, above={x=-164, y=8, z=-30}}, 1) + minetest.set_node({x=-163, y=8, z=-24}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-163, y=8, z=-30}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-163, y=8, z=-30}, above={x=-163, y=8, z=-30}}, 1) + screwdriver_handler(player, {type="node", under={x=-163, y=8, z=-30}, above={x=-163, y=8, z=-30}}, 1) + minetest.set_node({x=-161, y=8, z=-24}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-161, y=8, z=-30}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-161, y=8, z=-30}, above={x=-161, y=8, z=-30}}, 1) + screwdriver_handler(player, {type="node", under={x=-161, y=8, z=-30}, above={x=-161, y=8, z=-30}}, 1) + minetest.set_node({x=-159, y=8, z=-24}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-159, y=8, z=-30}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-159, y=8, z=-30}, above={x=-159, y=8, z=-30}}, 1) + screwdriver_handler(player, {type="node", under={x=-159, y=8, z=-30}, above={x=-159, y=8, z=-30}}, 1) + minetest.set_node({x=-157, y=8, z=-24}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-157, y=8, z=-30}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-157, y=8, z=-30}, above={x=-157, y=8, z=-30}}, 1) + screwdriver_handler(player, {type="node", under={x=-157, y=8, z=-30}, above={x=-157, y=8, z=-30}}, 1) + minetest.set_node({x=-156, y=8, z=-25}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-156, y=8, z=-29}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-156, y=8, z=-29}, above={x=-156, y=8, z=-29}}, 1) + screwdriver_handler(player, {type="node", under={x=-156, y=8, z=-29}, above={x=-156, y=8, z=-29}}, 1) + minetest.set_node({x=-155, y=8, z=-25}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-155, y=8, z=-29}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-155, y=8, z=-29}, above={x=-155, y=8, z=-29}}, 1) + screwdriver_handler(player, {type="node", under={x=-155, y=8, z=-29}, above={x=-155, y=8, z=-29}}, 1) + minetest.set_node({x=-154, y=8, z=-26}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-154, y=8, z=-28}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-154, y=8, z=-28}, above={x=-154, y=8, z=-28}}, 1) + screwdriver_handler(player, {type="node", under={x=-154, y=8, z=-28}, above={x=-154, y=8, z=-28}}, 1) + minetest.set_node({x=-153, y=8, z=-26}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-153, y=8, z=-28}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-153, y=8, z=-28}, above={x=-153, y=8, z=-28}}, 1) + screwdriver_handler(player, {type="node", under={x=-153, y=8, z=-28}, above={x=-153, y=8, z=-28}}, 1) + minetest.set_node({x=-152, y=8, z=-27}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-152, y=8, z=-27}, above={x=-152, y=8, z=-27}}, 1) + + for i=25,29 do + minetest.set_node({x=-169, y=11, z=i*(-1)}, {name="default:fence_wood"}) + end + minetest.set_node({x=-168, y=11, z=-30}, {name="default:fence_wood"}) + minetest.set_node({x=-168, y=11, z=-24}, {name="default:fence_wood"}) + for j=157,167 do + minetest.set_node({x=j*(-1), y=10, z=-23}, {name="default:fence_wood"}) + minetest.set_node({x=j*(-1), y=10, z=-31}, {name="default:fence_wood"}) + end + minetest.set_node({x=-164, y=10, z=-31}, {name="air"}) + + minetest.set_node({x=-156, y=10, z=-30}, {name="default:fence_wood"}) + minetest.set_node({x=-156, y=10, z=-24}, {name="default:fence_wood"}) + minetest.set_node({x=-155, y=10, z=-30}, {name="default:fence_wood"}) + minetest.set_node({x=-155, y=10, z=-24}, {name="default:fence_wood"}) + minetest.set_node({x=-154, y=10, z=-29}, {name="default:fence_wood"}) + minetest.set_node({x=-154, y=10, z=-25}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=10, z=-29}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=10, z=-25}, {name="default:fence_wood"}) + minetest.set_node({x=-152, y=10, z=-28}, {name="default:fence_wood"}) + minetest.set_node({x=-152, y=10, z=-26}, {name="default:fence_wood"}) + minetest.set_node({x=-151, y=10, z=-28}, {name="default:fence_wood"}) + minetest.set_node({x=-151, y=10, z=-26}, {name="default:fence_wood"}) + minetest.set_node({x=-150, y=10, z=-27}, {name="default:fence_wood"}) + minetest.set_node({x=-149, y=10, z=-27}, {name="default:fence_wood"}) + for k=8,14 do + minetest.set_node({x=-159, y=k, z=-27}, {name="default:wood"}) + end + minetest.set_node({x=-159, y=14, z=-28}, {name="default:fence_wood"}) + minetest.set_node({x=-159, y=14, z=-29}, {name="default:fence_wood"}) + minetest.set_node({x=-159, y=14, z=-26}, {name="default:fence_wood"}) + minetest.set_node({x=-159, y=14, z=-25}, {name="default:fence_wood"}) + + for k=8,16 do + minetest.set_node({x=-165, y=k, z=-27}, {name="default:wood"}) + end + minetest.set_node({x=-165, y=16, z=-26}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=16, z=-25}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=16, z=-24}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=16, z=-23}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=16, z=-28}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=16, z=-29}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=16, z=-30}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=16, z=-31}, {name="default:fence_wood"}) + + minetest.set_node({x=-168, y=9, z=-27}, {name="castrum:pirate_captain"}) + screwdriver_handler(player, {type="node", under={x=-168, y=9, z=-27}, above={x=-168, y=9, z=-27}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=9, z=-27}, above={x=-168, y=9, z=-27}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=9, z=-27}, above={x=-168, y=9, z=-27}}, 1) + for i=23,31 do + minetest.set_node({x=-164, y=16, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-163, y=15, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-163, y=14, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-163, y=13, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-164, y=12, z=i*(-1)}, {name="wool:white"}) + end + for i=25,29 do + minetest.set_node({x=-158, y=14, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-157, y=13, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-157, y=12, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-158, y=11, z=i*(-1)}, {name="wool:white"}) + end + minetest.set_node({x=-156, y=7, z=-27}, {name="castrum:turn_ship"}) + minetest.set_node({x=-162, y=7, z=-27}, {name="castrum:island_start_fight"}) + file = io.open(minetest.get_worldpath().."/SAVE/Cannon1.txt", "r") + local level = file:read("*l") + file:close() + if tonumber(level) == 1 then + minetest.set_node({x=-166, y=9, z=-31}, {name="castrum:cannon_1_1"}) + screwdriver_handler(player, {type="node", under={x=-166, y=9, z=-31}, above={x=-166, y=9, z=-31}}, 1) + screwdriver_handler(player, {type="node", under={x=-166, y=9, z=-31}, above={x=-166, y=9, z=-31}}, 1) + end + file = io.open(minetest.get_worldpath().."/SAVE/Cannon2.txt", "r") + local level = file:read("*l") + file:close() + if tonumber(level) == 1 then + minetest.set_node({x=-166, y=9, z=-23}, {name="castrum:cannon_1_1"}) + end + if pirate1 == 1 then + minetest.set_node({x=-166, y=8, z=-30}, {name="castrum:pirate_lv1"}) + end + if pirate2 == 1 then + minetest.set_node({x=-166, y=8, z=-24}, {name="castrum:pirate_lv1"}) + screwdriver_handler(player, {type="node", under={x=-166, y=8, z=-24}, above={x=-166, y=8, z=-24}}, 1) + screwdriver_handler(player, {type="node", under={x=-166, y=8, z=-24}, above={x=-166, y=8, z=-24}}, 1) + if player:get_attribute("sea_fight_step_1c2") == "0" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_ready"}) + elseif player:get_attribute("sea_fight_step_1c2") == "1" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_1"}) + elseif player:get_attribute("sea_fight_step_1c2") == "2" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_2"}) + elseif player:get_attribute("sea_fight_step_1c2") == "3" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_3"}) + elseif player:get_attribute("sea_fight_step_1c2") == "4" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_4"}) + elseif player:get_attribute("sea_fight_step_1c2") == "5" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_5"}) + end + end +end +function Chapter_Ship2_1(player) + for j=149,169 do + for i=2,10 do + for k=7,20 do + minetest.set_node({x=j*(-1), y=k, z=i*(-1)}, {name="air"}) + end + end + end + for j=149,169 do + for i=2,10 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="castrum:water"}) + end + end + for j=150,161 do + for i=3,9 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="default:wood"}) + end + end + for j=162,163 do + for i=4,8 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="default:wood"}) + end + end + for j=164,165 do + for i=5,7 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="default:wood"}) + end + end + for j=166,167 do + minetest.set_node({x=j*(-1), y=7, z=-6}, {name="default:wood"}) + end + for j=151,161 do + minetest.set_node({x=j*(-1), y=8, z=-2}, {name="default:wood"}) + minetest.set_node({x=j*(-1), y=8, z=-10}, {name="default:wood"}) + end + for i=4,8 do + minetest.set_node({x=-149, y=8, z=i*(-1)}, {name="default:wood"}) + end + minetest.set_node({x=-150, y=8, z=-9}, {name="default:wood"}) + minetest.set_node({x=-150, y=8, z=-6}, {name="default:wood"}) + minetest.set_node({x=-150, y=8, z=-3}, {name="default:wood"}) + minetest.set_node({x=-162, y=8, z=-9}, {name="default:wood"}) + minetest.set_node({x=-162, y=8, z=-3}, {name="default:wood"}) + minetest.set_node({x=-164, y=8, z=-8}, {name="default:wood"}) + minetest.set_node({x=-164, y=8, z=-4}, {name="default:wood"}) + minetest.set_node({x=-166, y=8, z=-7}, {name="default:wood"}) + minetest.set_node({x=-166, y=8, z=-5}, {name="default:wood"}) + minetest.set_node({x=-167, y=8, z=-6}, {name="default:wood"}) + minetest.set_node({x=-168, y=8, z=-6}, {name="default:wood"}) + for i=4,8 do + minetest.set_node({x=-149, y=9, z=i*(-1)}, {name="default:wood"}) + end + minetest.set_node({x=-150, y=9, z=-9}, {name="default:wood"}) + minetest.set_node({x=-150, y=9, z=-3}, {name="default:wood"}) + minetest.set_node({x=-151, y=9, z=-10}, {name="default:wood"}) + minetest.set_node({x=-151, y=9, z=-2}, {name="default:wood"}) + minetest.set_node({x=-153, y=9, z=-10}, {name="default:wood"}) + minetest.set_node({x=-153, y=9, z=-2}, {name="default:wood"}) + minetest.set_node({x=-155, y=9, z=-10}, {name="default:wood"}) + minetest.set_node({x=-155, y=9, z=-2}, {name="default:wood"}) + minetest.set_node({x=-157, y=9, z=-10}, {name="default:wood"}) + minetest.set_node({x=-157, y=9, z=-2}, {name="default:wood"}) + minetest.set_node({x=-159, y=9, z=-10}, {name="default:wood"}) + minetest.set_node({x=-159, y=9, z=-2}, {name="default:wood"}) + minetest.set_node({x=-161, y=9, z=-10}, {name="default:wood"}) + minetest.set_node({x=-161, y=9, z=-2}, {name="default:wood"}) + minetest.set_node({x=-162, y=9, z=-9}, {name="default:wood"}) + minetest.set_node({x=-162, y=9, z=-3}, {name="default:wood"}) + minetest.set_node({x=-163, y=9, z=-9}, {name="default:wood"}) + minetest.set_node({x=-163, y=9, z=-3}, {name="default:wood"}) + minetest.set_node({x=-164, y=9, z=-8}, {name="default:wood"}) + minetest.set_node({x=-164, y=9, z=-4}, {name="default:wood"}) + minetest.set_node({x=-165, y=9, z=-8}, {name="default:wood"}) + minetest.set_node({x=-165, y=9, z=-4}, {name="default:wood"}) + minetest.set_node({x=-166, y=9, z=-7}, {name="default:wood"}) + minetest.set_node({x=-166, y=9, z=-5}, {name="default:wood"}) + minetest.set_node({x=-167, y=9, z=-7}, {name="default:wood"}) + minetest.set_node({x=-167, y=9, z=-5}, {name="default:wood"}) + minetest.set_node({x=-168, y=9, z=-6}, {name="default:wood"}) + minetest.set_node({x=-169, y=9, z=-6}, {name="default:wood"}) + for i=4,8 do + minetest.set_node({x=-149, y=10, z=i*(-1)}, {name="default:wood"}) + end + minetest.set_node({x=-150, y=10, z=-9}, {name="default:wood"}) + minetest.set_node({x=-150, y=10, z=-3}, {name="default:wood"}) + minetest.set_node({x=-150, y=8, z=-4}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-150, y=8, z=-5}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-150, y=8, z=-7}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-150, y=8, z=-8}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-150, y=8, z=-4}, above={x=-150, y=8, z=-4}}, 1) + screwdriver_handler(player, {type="node", under={x=-150, y=8, z=-5}, above={x=-150, y=8, z=-5}}, 1) + screwdriver_handler(player, {type="node", under={x=-150, y=8, z=-7}, above={x=-150, y=8, z=-7}}, 1) + screwdriver_handler(player, {type="node", under={x=-150, y=8, z=-8}, above={x=-150, y=8, z=-8}}, 1) + minetest.set_node({x=-151, y=8, z=-3}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-151, y=8, z=-9}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-151, y=8, z=-9}, above={x=-151, y=8, z=-9}}, 1) + screwdriver_handler(player, {type="node", under={x=-151, y=8, z=-9}, above={x=-151, y=8, z=-9}}, 1) + minetest.set_node({x=-153, y=8, z=-3}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-153, y=8, z=-9}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-153, y=8, z=-9}, above={x=-153, y=8, z=-9}}, 1) + screwdriver_handler(player, {type="node", under={x=-153, y=8, z=-9}, above={x=-153, y=8, z=-9}}, 1) + minetest.set_node({x=-154, y=8, z=-9}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-154, y=8, z=-9}, above={x=-154, y=8, z=-9}}, 1) + screwdriver_handler(player, {type="node", under={x=-154, y=8, z=-9}, above={x=-154, y=8, z=-9}}, 1) + minetest.set_node({x=-155, y=8, z=-3}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-155, y=8, z=-9}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-155, y=8, z=-9}, above={x=-155, y=8, z=-9}}, 1) + screwdriver_handler(player, {type="node", under={x=-155, y=8, z=-9}, above={x=-155, y=8, z=-9}}, 1) + minetest.set_node({x=-157, y=8, z=-3}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-157, y=8, z=-9}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-157, y=8, z=-9}, above={x=-157, y=8, z=-9}}, 1) + screwdriver_handler(player, {type="node", under={x=-157, y=8, z=-9}, above={x=-157, y=8, z=-9}}, 1) + minetest.set_node({x=-159, y=8, z=-3}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-159, y=8, z=-9}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-159, y=8, z=-9}, above={x=-159, y=8, z=-9}}, 1) + screwdriver_handler(player, {type="node", under={x=-159, y=8, z=-9}, above={x=-159, y=8, z=-9}}, 1) + minetest.set_node({x=-161, y=8, z=-3}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-161, y=8, z=-9}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-161, y=8, z=-9}, above={x=-161, y=8, z=-9}}, 1) + screwdriver_handler(player, {type="node", under={x=-161, y=8, z=-9}, above={x=-161, y=8, z=-9}}, 1) + minetest.set_node({x=-162, y=8, z=-4}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-162, y=8, z=-8}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-162, y=8, z=-8}, above={x=-162, y=8, z=-8}}, 1) + screwdriver_handler(player, {type="node", under={x=-162, y=8, z=-8}, above={x=-162, y=8, z=-8}}, 1) + minetest.set_node({x=-163, y=8, z=-4}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-163, y=8, z=-8}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-163, y=8, z=-8}, above={x=-163, y=8, z=-8}}, 1) + screwdriver_handler(player, {type="node", under={x=-163, y=8, z=-8}, above={x=-163, y=8, z=-8}}, 1) + minetest.set_node({x=-164, y=8, z=-5}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-164, y=8, z=-7}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-164, y=8, z=-7}, above={x=-164, y=8, z=-7}}, 1) + screwdriver_handler(player, {type="node", under={x=-164, y=8, z=-7}, above={x=-164, y=8, z=-7}}, 1) + minetest.set_node({x=-165, y=8, z=-5}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-165, y=8, z=-7}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-165, y=8, z=-7}, above={x=-165, y=8, z=-7}}, 1) + screwdriver_handler(player, {type="node", under={x=-165, y=8, z=-7}, above={x=-165, y=8, z=-7}}, 1) + minetest.set_node({x=-166, y=8, z=-6}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-166, y=8, z=-6}, above={x=-166, y=8, z=-6}}, 1) + screwdriver_handler(player, {type="node", under={x=-166, y=8, z=-6}, above={x=-166, y=8, z=-6}}, 1) + screwdriver_handler(player, {type="node", under={x=-166, y=8, z=-6}, above={x=-166, y=8, z=-6}}, 1) + for i=4,8 do + minetest.set_node({x=-149, y=11, z=i*(-1)}, {name="default:fence_wood"}) + end + minetest.set_node({x=-150, y=11, z=-9}, {name="default:fence_wood"}) + minetest.set_node({x=-150, y=11, z=-3}, {name="default:fence_wood"}) + for j=151,161 do + minetest.set_node({x=j*(-1), y=10, z=-2}, {name="default:fence_wood"}) + minetest.set_node({x=j*(-1), y=10, z=-10}, {name="default:fence_wood"}) + end + minetest.set_node({x=-154, y=10, z=-10}, {name="air"}) + minetest.set_node({x=-162, y=10, z=-9}, {name="default:fence_wood"}) + minetest.set_node({x=-162, y=10, z=-3}, {name="default:fence_wood"}) + minetest.set_node({x=-163, y=10, z=-9}, {name="default:fence_wood"}) + minetest.set_node({x=-163, y=10, z=-3}, {name="default:fence_wood"}) + minetest.set_node({x=-164, y=10, z=-8}, {name="default:fence_wood"}) + minetest.set_node({x=-164, y=10, z=-4}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=10, z=-8}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=10, z=-4}, {name="default:fence_wood"}) + minetest.set_node({x=-166, y=10, z=-7}, {name="default:fence_wood"}) + minetest.set_node({x=-166, y=10, z=-5}, {name="default:fence_wood"}) + minetest.set_node({x=-167, y=10, z=-7}, {name="default:fence_wood"}) + minetest.set_node({x=-167, y=10, z=-5}, {name="default:fence_wood"}) + minetest.set_node({x=-168, y=10, z=-6}, {name="default:fence_wood"}) + minetest.set_node({x=-169, y=10, z=-6}, {name="default:fence_wood"}) + for k=8,14 do + minetest.set_node({x=-159, y=k, z=-6}, {name="default:wood"}) + end + minetest.set_node({x=-159, y=14, z=-7}, {name="default:fence_wood"}) + minetest.set_node({x=-159, y=14, z=-8}, {name="default:fence_wood"}) + minetest.set_node({x=-159, y=14, z=-5}, {name="default:fence_wood"}) + minetest.set_node({x=-159, y=14, z=-4}, {name="default:fence_wood"}) + for k=8,16 do + minetest.set_node({x=-153, y=k, z=-6}, {name="default:wood"}) + end + minetest.set_node({x=-153, y=16, z=-5}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=16, z=-4}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=16, z=-3}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=16, z=-2}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=16, z=-7}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=16, z=-8}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=16, z=-9}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=16, z=-10}, {name="default:fence_wood"}) + minetest.set_node({x=-150, y=9, z=-6}, {name="castrum:skeleton_captain"}) + screwdriver_handler(player, {type="node", under={x=-150, y=9, z=-6}, above={x=-150, y=9, z=-6}}, 1) + for i=2,10 do + minetest.set_node({x=-154, y=16, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-155, y=15, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-155, y=14, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-155, y=13, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-154, y=12, z=i*(-1)}, {name="wool:white"}) + end + for i=4,8 do + minetest.set_node({x=-160, y=14, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-161, y=13, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-161, y=12, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-160, y=11, z=i*(-1)}, {name="wool:white"}) + end + local c1 = player:get_attribute("sea_fight_c1") + if c1 == "1" then + minetest.set_node({x=-152, y=9, z=-10}, {name="castrum:cannon_1_1"}) + screwdriver_handler(player, {type="node", under={x=-152, y=9, z=-10}, above={x=-152, y=9, z=-10}}, 1) + screwdriver_handler(player, {type="node", under={x=-152, y=9, z=-10}, above={x=-152, y=9, z=-10}}, 1) + end + local c2 = player:get_attribute("sea_fight_c2") + if c2 == "1" then + minetest.set_node({x=-152, y=9, z=-2}, {name="castrum:cannon_1_1"}) + end + local p1 = player:get_attribute("sea_fight_p1") + if p1 == "1" then + minetest.set_node({x=-152, y=8, z=-9}, {name="castrum:skeleton_lv1"}) + end + local p2 = player:get_attribute("sea_fight_p2") + if p2 == "1" then + minetest.set_node({x=-152, y=8, z=-3}, {name="castrum:skeleton_lv1"}) + screwdriver_handler(player, {type="node", under={x=-152, y=8, z=-3}, above={x=-152, y=8, z=-3}}, 1) + screwdriver_handler(player, {type="node", under={x=-152, y=8, z=-3}, above={x=-152, y=8, z=-3}}, 1) + end +end +function Chapter_Ship2_2(player) + for j=149,169 do + for i=2,10 do + for k=7,20 do + minetest.set_node({x=j*(-1), y=k, z=i*(-1)}, {name="air"}) + end + end + end + for j=149,169 do + for i=2,10 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="castrum:water"}) + end + end + for j=157,168 do + for i=3,9 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="default:wood"}) + end + end + + for j=155,156 do + for i=4,8 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="default:wood"}) + end + end + + for j=153,154 do + for i=5,7 do + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="default:wood"}) + end + end + for j=151,152 do + minetest.set_node({x=j*(-1), y=7, z=-6}, {name="default:wood"}) + end + + for j=157,167 do + minetest.set_node({x=j*(-1), y=8, z=-2}, {name="default:wood"}) + minetest.set_node({x=j*(-1), y=8, z=-10}, {name="default:wood"}) + end + for i=4,8 do + minetest.set_node({x=-169, y=8, z=i*(-1)}, {name="default:wood"}) + end + + minetest.set_node({x=-168, y=8, z=-9}, {name="default:wood"}) + minetest.set_node({x=-168, y=8, z=-6}, {name="default:wood"}) + minetest.set_node({x=-168, y=8, z=-3}, {name="default:wood"}) + minetest.set_node({x=-156, y=8, z=-9}, {name="default:wood"}) + minetest.set_node({x=-156, y=8, z=-3}, {name="default:wood"}) + minetest.set_node({x=-154, y=8, z=-8}, {name="default:wood"}) + minetest.set_node({x=-154, y=8, z=-4}, {name="default:wood"}) + minetest.set_node({x=-152, y=8, z=-7}, {name="default:wood"}) + minetest.set_node({x=-152, y=8, z=-5}, {name="default:wood"}) + minetest.set_node({x=-151, y=8, z=-6}, {name="default:wood"}) + minetest.set_node({x=-150, y=8, z=-6}, {name="default:wood"}) + + for i=4,8 do + minetest.set_node({x=-169, y=9, z=i*(-1)}, {name="default:wood"}) + end + minetest.set_node({x=-168, y=9, z=-9}, {name="default:wood"}) + minetest.set_node({x=-168, y=9, z=-3}, {name="default:wood"}) + minetest.set_node({x=-167, y=9, z=-10}, {name="default:wood"}) + minetest.set_node({x=-167, y=9, z=-2}, {name="default:wood"}) + minetest.set_node({x=-165, y=9, z=-10}, {name="default:wood"}) + minetest.set_node({x=-165, y=9, z=-2}, {name="default:wood"}) + minetest.set_node({x=-163, y=9, z=-10}, {name="default:wood"}) + minetest.set_node({x=-163, y=9, z=-2}, {name="default:wood"}) + minetest.set_node({x=-161, y=9, z=-10}, {name="default:wood"}) + minetest.set_node({x=-161, y=9, z=-2}, {name="default:wood"}) + minetest.set_node({x=-159, y=9, z=-10}, {name="default:wood"}) + minetest.set_node({x=-159, y=9, z=-2}, {name="default:wood"}) + minetest.set_node({x=-157, y=9, z=-10}, {name="default:wood"}) + minetest.set_node({x=-157, y=9, z=-2}, {name="default:wood"}) + minetest.set_node({x=-156, y=9, z=-9}, {name="default:wood"}) + minetest.set_node({x=-156, y=9, z=-3}, {name="default:wood"}) + minetest.set_node({x=-155, y=9, z=-9}, {name="default:wood"}) + minetest.set_node({x=-155, y=9, z=-3}, {name="default:wood"}) + minetest.set_node({x=-154, y=9, z=-8}, {name="default:wood"}) + minetest.set_node({x=-154, y=9, z=-4}, {name="default:wood"}) + minetest.set_node({x=-153, y=9, z=-8}, {name="default:wood"}) + minetest.set_node({x=-153, y=9, z=-4}, {name="default:wood"}) + minetest.set_node({x=-152, y=9, z=-7}, {name="default:wood"}) + minetest.set_node({x=-152, y=9, z=-5}, {name="default:wood"}) + minetest.set_node({x=-151, y=9, z=-7}, {name="default:wood"}) + minetest.set_node({x=-151, y=9, z=-5}, {name="default:wood"}) + minetest.set_node({x=-150, y=9, z=-6}, {name="default:wood"}) + minetest.set_node({x=-149, y=9, z=-6}, {name="default:wood"}) + + for i=4,8 do + minetest.set_node({x=-169, y=10, z=i*(-1)}, {name="default:wood"}) + end + minetest.set_node({x=-168, y=10, z=-9}, {name="default:wood"}) + minetest.set_node({x=-168, y=10, z=-3}, {name="default:wood"}) + minetest.set_node({x=-168, y=8, z=-4}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-168, y=8, z=-5}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-168, y=8, z=-7}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-168, y=8, z=-8}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-4}, above={x=-168, y=8, z=-4}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-5}, above={x=-168, y=8, z=-5}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-7}, above={x=-168, y=8, z=-7}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-8}, above={x=-168, y=8, z=-8}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-4}, above={x=-168, y=8, z=-4}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-5}, above={x=-168, y=8, z=-5}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-7}, above={x=-168, y=8, z=-7}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-8}, above={x=-168, y=8, z=-8}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-4}, above={x=-168, y=8, z=-4}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-5}, above={x=-168, y=8, z=-5}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-7}, above={x=-168, y=8, z=-7}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=8, z=-8}, above={x=-168, y=8, z=-8}}, 1) + + minetest.set_node({x=-167, y=8, z=-3}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-167, y=8, z=-9}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-167, y=8, z=-9}, above={x=-167, y=8, z=-9}}, 1) + screwdriver_handler(player, {type="node", under={x=-167, y=8, z=-9}, above={x=-167, y=8, z=-9}}, 1) + minetest.set_node({x=-165, y=8, z=-3}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-165, y=8, z=-9}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-165, y=8, z=-9}, above={x=-165, y=8, z=-9}}, 1) + screwdriver_handler(player, {type="node", under={x=-165, y=8, z=-9}, above={x=-165, y=8, z=-9}}, 1) + minetest.set_node({x=-164, y=8, z=-3}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-163, y=8, z=-3}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-163, y=8, z=-9}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-163, y=8, z=-9}, above={x=-163, y=8, z=-9}}, 1) + screwdriver_handler(player, {type="node", under={x=-163, y=8, z=-9}, above={x=-163, y=8, z=-9}}, 1) + minetest.set_node({x=-161, y=8, z=-3}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-161, y=8, z=-9}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-161, y=8, z=-9}, above={x=-161, y=8, z=-9}}, 1) + screwdriver_handler(player, {type="node", under={x=-161, y=8, z=-9}, above={x=-161, y=8, z=-9}}, 1) + minetest.set_node({x=-159, y=8, z=-3}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-159, y=8, z=-9}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-159, y=8, z=-9}, above={x=-159, y=8, z=-9}}, 1) + screwdriver_handler(player, {type="node", under={x=-159, y=8, z=-9}, above={x=-159, y=8, z=-9}}, 1) + minetest.set_node({x=-157, y=8, z=-3}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-157, y=8, z=-9}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-157, y=8, z=-9}, above={x=-157, y=8, z=-9}}, 1) + screwdriver_handler(player, {type="node", under={x=-157, y=8, z=-9}, above={x=-157, y=8, z=-9}}, 1) + minetest.set_node({x=-156, y=8, z=-4}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-156, y=8, z=-8}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-156, y=8, z=-8}, above={x=-156, y=8, z=-8}}, 1) + screwdriver_handler(player, {type="node", under={x=-156, y=8, z=-8}, above={x=-156, y=8, z=-8}}, 1) + minetest.set_node({x=-155, y=8, z=-4}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-155, y=8, z=-8}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-155, y=8, z=-8}, above={x=-155, y=8, z=-8}}, 1) + screwdriver_handler(player, {type="node", under={x=-155, y=8, z=-8}, above={x=-155, y=8, z=-8}}, 1) + minetest.set_node({x=-154, y=8, z=-5}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-154, y=8, z=-7}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-154, y=8, z=-7}, above={x=-154, y=8, z=-7}}, 1) + screwdriver_handler(player, {type="node", under={x=-154, y=8, z=-7}, above={x=-154, y=8, z=-7}}, 1) + minetest.set_node({x=-153, y=8, z=-5}, {name="stairs:stair_castrum_wood"}) + minetest.set_node({x=-153, y=8, z=-7}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-153, y=8, z=-7}, above={x=-153, y=8, z=-7}}, 1) + screwdriver_handler(player, {type="node", under={x=-153, y=8, z=-7}, above={x=-153, y=8, z=-7}}, 1) + minetest.set_node({x=-152, y=8, z=-6}, {name="stairs:stair_castrum_wood"}) + screwdriver_handler(player, {type="node", under={x=-152, y=8, z=-6}, above={x=-152, y=8, z=-6}}, 1) + + for i=4,8 do + minetest.set_node({x=-169, y=11, z=i*(-1)}, {name="default:fence_wood"}) + end + minetest.set_node({x=-168, y=11, z=-9}, {name="default:fence_wood"}) + minetest.set_node({x=-168, y=11, z=-3}, {name="default:fence_wood"}) + for j=157,167 do + minetest.set_node({x=j*(-1), y=10, z=-2}, {name="default:fence_wood"}) + minetest.set_node({x=j*(-1), y=10, z=-10}, {name="default:fence_wood"}) + end + minetest.set_node({x=-164, y=10, z=-2}, {name="air"}) + + minetest.set_node({x=-156, y=10, z=-9}, {name="default:fence_wood"}) + minetest.set_node({x=-156, y=10, z=-3}, {name="default:fence_wood"}) + minetest.set_node({x=-155, y=10, z=-9}, {name="default:fence_wood"}) + minetest.set_node({x=-155, y=10, z=-3}, {name="default:fence_wood"}) + minetest.set_node({x=-154, y=10, z=-8}, {name="default:fence_wood"}) + minetest.set_node({x=-154, y=10, z=-4}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=10, z=-8}, {name="default:fence_wood"}) + minetest.set_node({x=-153, y=10, z=-4}, {name="default:fence_wood"}) + minetest.set_node({x=-152, y=10, z=-7}, {name="default:fence_wood"}) + minetest.set_node({x=-152, y=10, z=-5}, {name="default:fence_wood"}) + minetest.set_node({x=-151, y=10, z=-7}, {name="default:fence_wood"}) + minetest.set_node({x=-151, y=10, z=-5}, {name="default:fence_wood"}) + minetest.set_node({x=-150, y=10, z=-6}, {name="default:fence_wood"}) + minetest.set_node({x=-149, y=10, z=-6}, {name="default:fence_wood"}) + for k=8,14 do + minetest.set_node({x=-159, y=k, z=-6}, {name="default:wood"}) + end + minetest.set_node({x=-159, y=14, z=-7}, {name="default:fence_wood"}) + minetest.set_node({x=-159, y=14, z=-8}, {name="default:fence_wood"}) + minetest.set_node({x=-159, y=14, z=-5}, {name="default:fence_wood"}) + minetest.set_node({x=-159, y=14, z=-4}, {name="default:fence_wood"}) + + for k=8,16 do + minetest.set_node({x=-165, y=k, z=-6}, {name="default:wood"}) + end + minetest.set_node({x=-165, y=16, z=-5}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=16, z=-4}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=16, z=-3}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=16, z=-2}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=16, z=-7}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=16, z=-8}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=16, z=-9}, {name="default:fence_wood"}) + minetest.set_node({x=-165, y=16, z=-10}, {name="default:fence_wood"}) + + minetest.set_node({x=-168, y=9, z=-6}, {name="castrum:skeleton_captain"}) + screwdriver_handler(player, {type="node", under={x=-168, y=9, z=-6}, above={x=-168, y=9, z=-6}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=9, z=-6}, above={x=-168, y=9, z=-6}}, 1) + screwdriver_handler(player, {type="node", under={x=-168, y=9, z=-6}, above={x=-168, y=9, z=-6}}, 1) + for i=2,10 do + minetest.set_node({x=-164, y=16, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-163, y=15, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-163, y=14, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-163, y=13, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-164, y=12, z=i*(-1)}, {name="wool:white"}) + end + for i=4,8 do + minetest.set_node({x=-158, y=14, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-157, y=13, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-157, y=12, z=i*(-1)}, {name="wool:white"}) + minetest.set_node({x=-158, y=11, z=i*(-1)}, {name="wool:white"}) + end + local c1 = player:get_attribute("sea_fight_c1") + if c1 == "1" then + minetest.set_node({x=-166, y=9, z=-2}, {name="castrum:cannon_1_1"}) + screwdriver_handler(player, {type="node", under={x=-152, y=9, z=-10}, above={x=-152, y=9, z=-10}}, 1) + screwdriver_handler(player, {type="node", under={x=-152, y=9, z=-10}, above={x=-152, y=9, z=-10}}, 1) + end + local c2 = player:get_attribute("sea_fight_c2") + if c2 == "1" then + minetest.set_node({x=-166, y=9, z=-10}, {name="castrum:cannon_1_1"}) + end + local p1 = player:get_attribute("sea_fight_p1") + if p1 == "1" then + minetest.set_node({x=-166, y=8, z=-3}, {name="castrum:skeleton_lv1"}) + end + local p2 = player:get_attribute("sea_fight_p2") + if p2 == "1" then + minetest.set_node({x=-166, y=8, z=-9}, {name="castrum:skeleton_lv1"}) + screwdriver_handler(player, {type="node", under={x=-152, y=8, z=-3}, above={x=-152, y=8, z=-3}}, 1) + screwdriver_handler(player, {type="node", under={x=-152, y=8, z=-3}, above={x=-152, y=8, z=-3}}, 1) + end +end + +local island_start_fight = {} +island_start_fight.get_formspec = function(player, pos) + if player == nil then + return + end + formspec = "size[5,6.5]" + .."background[5,6.5;1,1;gui_formbg.png;true]" + .."listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]" + .."bgcolor[#080808BB;true]" + .."button[0,2;5,1;;Start Fight]" + .."button[0,3;5,1;;Go Back]" + .."image_button[4.5,-0.3;0.8,0.8;;esc;X]" + return formspec +end +local island_go_back = {} +island_go_back.get_formspec = function(player, pos) + if player == nil then + return + end + formspec = "size[5,6.5]" + .."background[5,6.5;1,1;gui_formbg.png;true]" + .."listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]" + .."bgcolor[#080808BB;true]" + .."label[0,1.4;If you go back, you will lose your placed pirates!]" + .."label[0,1.7;Go Back?]" + .."button[0,2;2.5,1;;Yes]" + .."button[2.5,2;2.5,1;;No]" + .."image_button[4.5,-0.3;0.8,0.8;;esc;X]" + return formspec +end +local island_fight = {} +island_fight.get_formspec = function(player, pos) + if player == nil then + return + end + file = io.open(minetest.get_worldpath().."/SAVE/Sail1.txt", "r") + local sail1 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Sail2.txt", "r") + local sail2 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Cannon1.txt", "r") + local cannon1 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Cannon2.txt", "r") + local cannon2 = file:read("*l") + file:close() + local turn = 0 + if tonumber(sail1) == 1 then + turn = turn+4 + end + if tonumber(sail2) == 1 then + turn = turn+2 + end + local pos1 = player:get_attribute("sea_fight_pos1") + local sc1 = "ready" + local sc2 = "ready" + local pc1 = 0 + local pc2 = 0 + + if tonumber(pos1) == 1 then + if minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + pc1 = 15 + else + sc1 = "no pirate" + end + if minetest.get_node({x=-152, y=8, z=-30}).name == "castrum:pirate_lv1" then + pc2 = 15 + else + sc2 = "no pirate" + end + end + if tonumber(cannon1) == 0 then + sc1 = "missing" + end + if tonumber(cannon2) == 0 then + sc2 = "missing" + end + if tonumber(pos1) == 1 then + sc2 = "no enemy" + end + formspec = "size[5,6.5]" + .."background[5,6.5;1,1;gui_formbg.png;true]" + .."listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]" + .."bgcolor[#080808BB;true]" + .."button[0,1;1,1;;Cannon 1\n"..sc1.."]" + .."button[4,1;1,1;;Cannon 2\n"..sc2.."]" + .."button[4,2;1,1;;Cannon 3\nmissing]" + .."button[0,3;1,1;;Cannon 4\nmissing]" + .."button[4,3;1,1;;Cannon 5\nmissing]" + .."button[0,4;1,1;;Cannon 6\nmissing]" + .."button[4,4;1,1;;Cannon 7\nmissing]" + .."button[0,5;1,1;;Cannon 8\nmissing]" + .."button[4,5;1,1;;Cannon 9\nmissing]" + .."button[1.5,2.5;2,1;;Turn the Ship]" + .."label[2.2,3.2;"..turn.."%]" + .."label[0.2,1.7;"..pc1.."%]" + .."label[4.2,1.7;"..pc2.."%]" + .."image_button[4.5,-0.3;0.8,0.8;;esc;X]" + return formspec +end +minetest.register_node("castrum:island_start_fight",{ + tiles = {"default_diamond_block.png"}, + description = "Start island fight", + --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + on_punch = function(pos, node, player, pointed_thing) + minetest.show_formspec(player:get_player_name(), "island_start_fight" , island_start_fight.get_formspec(player)) + end, +}) +minetest.register_node("castrum:fire_cannon_ready",{ + tiles = {"castrum_bridge_status.png"}, + description = "Fire Cannon (ready)", + --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + on_punch = function(pos, node, player, pointed_thing) + local pos1 = player:get_attribute("sea_fight_pos1") + if tonumber(pos1) == 1 then + if pos.x == -152 then + if minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + if minetest.get_node({x=-152, y=9, z=-23}).name == "castrum:cannon_1_1" then + if math.random(100) < 31 then + player:set_attribute("sea_fight_e_hp", ""..tonumber(player:get_attribute("sea_fight_e_hp")-2)) + minetest.chat_send_player(player:get_player_name(), "Hit! You have done 2 hp damage. The enemy has "..player:get_attribute("sea_fight_e_hp").." hp left.") + else + minetest.chat_send_player(player:get_player_name(), "You did not hit the enemy!") + end + end + end + minetest.set_node(pos, {name="castrum:fire_cannon_5"}) + player:set_attribute("sea_fight_step_1c1", "5") + if tonumber(player:get_attribute("sea_fight_step_1c2")) > 0 then + player:set_attribute("sea_fight_step_1c2", ""..tonumber(player:get_attribute("sea_fight_step_1c2"))-1) + end + end + else + if pos.x == -166 then + if minetest.get_node({x=-166, y=8, z=-24}).name == "castrum:pirate_lv1" then + if minetest.get_node({x=-166, y=9, z=-23}).name == "castrum:cannon_1_1" then + if math.random(100) < 31 then + player:set_attribute("sea_fight_e_hp", ""..tonumber(player:get_attribute("sea_fight_e_hp")-2)) + minetest.chat_send_player(player:get_player_name(), "Hit! You have done 2 hp damage. The enemy has "..player:get_attribute("sea_fight_e_hp").." hp left.") + else + minetest.chat_send_player(player:get_player_name(), "You did not hit the enemy!") + end + end + end + minetest.set_node(pos, {name="castrum:fire_cannon_5"}) + player:set_attribute("sea_fight_step_1c2", "5") + if tonumber(player:get_attribute("sea_fight_step_1c1")) > 0 then + player:set_attribute("sea_fight_step_1c1", ""..tonumber(player:get_attribute("sea_fight_step_1c1"))-1) + end + end + end + if pos1 == "1" then + if player:get_attribute("sea_fight_step_1c1") == "0" and minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_ready"}) + elseif player:get_attribute("sea_fight_step_1c1") == "1" and minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_1"}) + elseif player:get_attribute("sea_fight_step_1c1") == "2" and minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_2"}) + elseif player:get_attribute("sea_fight_step_1c1") == "3" and minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_3"}) + elseif player:get_attribute("sea_fight_step_1c1") == "4" and minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_4"}) + elseif player:get_attribute("sea_fight_step_1c1") == "5" and minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_5"}) + end + else + if player:get_attribute("sea_fight_step_1c2") == "0" and minetest.get_node({x=-166, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_ready"}) + elseif player:get_attribute("sea_fight_step_1c2") == "1" and minetest.get_node({x=-166, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_1"}) + elseif player:get_attribute("sea_fight_step_1c2") == "2" and minetest.get_node({x=-166, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_2"}) + elseif player:get_attribute("sea_fight_step_1c2") == "3" and minetest.get_node({x=-166, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_3"}) + elseif player:get_attribute("sea_fight_step_1c2") == "4" and minetest.get_node({x=-166, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_4"}) + elseif player:get_attribute("sea_fight_step_1c2") == "5" and minetest.get_node({x=-166, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_5"}) + end + end + Check1(player) + end, +}) +minetest.register_node("castrum:fire_cannon_1",{ + tiles = {"castrum_fire_cannon1.png"}, + description = "Fire Cannon (1 Round)", + --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + on_punch = function(pos, node, player, pointed_thing) + end, +}) +minetest.register_node("castrum:fire_cannon_2",{ + tiles = {"castrum_fire_cannon2.png"}, + description = "Fire Cannon (2 Rounds)", + --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + on_punch = function(pos, node, player, pointed_thing) + end, +}) +minetest.register_node("castrum:fire_cannon_3",{ + tiles = {"castrum_fire_cannon3.png"}, + description = "Fire Cannon (3 Rounds)", + --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + on_punch = function(pos, node, player, pointed_thing) + end, +}) +minetest.register_node("castrum:fire_cannon_4",{ + tiles = {"castrum_fire_cannon4.png"}, + description = "Fire Cannon (4 Rounds)", + --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + on_punch = function(pos, node, player, pointed_thing) + end, +}) +minetest.register_node("castrum:fire_cannon_5",{ + tiles = {"castrum_fire_cannon5.png"}, + description = "Fire Cannon (5 Rounds)", + --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + on_punch = function(pos, node, player, pointed_thing) + end, +}) +minetest.register_node("castrum:turn_ship",{ + tiles = {"castrum_bridge_status.png"}, + description = "Turn Ship", + --groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + on_punch = function(pos, node, player, pointed_thing) + local pos1 = player:get_attribute("sea_fight_pos1") + file = io.open(minetest.get_worldpath().."/SAVE/Sail1.txt", "r") + local sail1 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Sail2.txt", "r") + local sail2 = file:read("*l") + file:close() + local p = tonumber(sail1)*3+ tonumber(sail2)*2+25 + if math.random(100) < (p+1) then + if tonumber(pos1) == 1 then + player:set_attribute("sea_fight_pos1", "2") + Chapter_Ship1_2(player) + else + player:set_attribute("sea_fight_pos1", "1") + Chapter_Ship1_1(player) + end + minetest.chat_send_player(player:get_player_name(), "You turned the ship successfully") + else + minetest.chat_send_player(player:get_player_name(), "You did not turn the ship") + end + if tonumber(player:get_attribute("sea_fight_step_1c1")) > 0 then + player:set_attribute("sea_fight_step_1c1", ""..tonumber(player:get_attribute("sea_fight_step_1c1"))-1) + end + if tonumber(player:get_attribute("sea_fight_step_1c2")) > 0 then + player:set_attribute("sea_fight_step_1c2", ""..tonumber(player:get_attribute("sea_fight_step_1c2"))-1) + end + local pos1 = player:get_attribute("sea_fight_pos1") + if pos1 == "1" then + if player:get_attribute("sea_fight_step_1c1") == "0" and minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_ready"}) + elseif player:get_attribute("sea_fight_step_1c1") == "1" and minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_1"}) + elseif player:get_attribute("sea_fight_step_1c1") == "2" and minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_2"}) + elseif player:get_attribute("sea_fight_step_1c1") == "3" and minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_3"}) + elseif player:get_attribute("sea_fight_step_1c1") == "4" and minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_4"}) + elseif player:get_attribute("sea_fight_step_1c1") == "5" and minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_5"}) + end + else + if player:get_attribute("sea_fight_step_1c2") == "0" and minetest.get_node({x=-166, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_ready"}) + elseif player:get_attribute("sea_fight_step_1c2") == "1" and minetest.get_node({x=-166, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_1"}) + elseif player:get_attribute("sea_fight_step_1c2") == "2" and minetest.get_node({x=-166, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_2"}) + elseif player:get_attribute("sea_fight_step_1c2") == "3" and minetest.get_node({x=-166, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_3"}) + elseif player:get_attribute("sea_fight_step_1c2") == "4" and minetest.get_node({x=-166, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_4"}) + elseif player:get_attribute("sea_fight_step_1c2") == "5" and minetest.get_node({x=-166, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-166, y=7, z=-25}, {name="castrum:fire_cannon_5"}) + end + end + Check1(player) + end, +}) +minetest.register_on_player_receive_fields(function(player, formname, fields) + local player_inv = player:get_inventory() + if formname == "island_start_fight" then + for k, v in pairs(fields) do + if v == "Start Fight" then + if player:get_attribute("sea_started") == "false" then + if minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" or minetest.get_node({x=-152, y=8, z=-30}).name == "castrum:pirate_lv1" then + player:set_attribute("sea_started", "true") + if minetest.get_node({x=-152, y=8, z=-24}).name == "castrum:pirate_lv1" then + minetest.set_node({x=-152, y=7, z=-25}, {name="castrum:fire_cannon_ready"}) + end + minetest.set_node({x=-162, y=7, z=-27}, {name="castrum:turn_ship"}) + local inv = player:get_inventory() + inv:remove_item("main", "castrum:pirate_lv1 9") + for j=149,169 do + for i=23,31 do + if minetest.get_node({x=j*(-1), y=7, z=i*(-1)}).name == "castrum:sea_fight1" then + minetest.set_node({x=j*(-1), y=7, z=i*(-1)}, {name="default:wood"}) + end + end + end + else + minetest.chat_send_player(player:get_player_name(), "you have to place a pirate") + end + minetest.show_formspec(player:get_player_name(), "", "") + end + elseif v == "Go Back" then + minetest.show_formspec(player:get_player_name(), "island_go_back", island_go_back.get_formspec(player)) + elseif v == "X" then + minetest.show_formspec(player:get_player_name(), "", "") + end + end + end + if formname == "island_go_back" then + for k, v in pairs(fields) do + if v == "Yes" then + player:set_attribute("sea_started", "false") + player:setpos({x=178, y=8.5, z=44}) + local inv = player:get_inventory() + inv:remove_item("main", "castrum:pirate_lv1 9") + local pirate1 = 0 + for j=149,169 do + for i=23,31 do + if minetest.get_node({x=j*(-1), y=8, z=i*(-1)}).name == "castrum:pirate_lv1" then + pirate1 = pirate1 +1 + end + end + end + file = io.open(minetest.get_worldpath().."/SAVE/Pirate_1.txt", "r") + local pirate_1 = file:read("*l") + file:close() + file = io.open(minetest.get_worldpath().."/SAVE/Pirate_1.txt", "w") + file:write((tonumber(pirate_1)-pirate1)) + file:close() + Update_pirate(player) + minetest.show_formspec(player:get_player_name(), "", "") + elseif v == "No" then + minetest.show_formspec(player:get_player_name(), "", "") + elseif v == "X" then + minetest.show_formspec(player:get_player_name(), "", "") + end + end + end +end) \ No newline at end of file diff --git a/mods/castrum/models/castrum_canon_side_1.png b/mods/castrum/models/castrum_canon_side_1.png index d202acab5bb7de351dd055b90d9538c09e5c4ca1..45c0f911b009bc092a8784aa3e80ddc5e2b8e683 100644 GIT binary patch delta 384 zcmV-`0e}A80gwZb8Gi!+001a04^sdD0Ao;0R7KL#)6dV((9qD)(b2@k#jLEX$jQjd z%*)5e$kx`?#>d96v9PD7r^?F8!otF$qN16ZnbXwNz`?-2zP^{2m)6qJ%*xKp&CSls z$)28`m6er~lasr=y12NwudlDq&(6@&%`m`+mH+?%32;bRbAJE;3ljhU3ljkVnw%H_ z000McNliru;{_ZD8XvtK0!;t_0KiE^K~xyi6^>bULop0Oku1rx{pOd%N!tCdvM!&% z<$yBAF>*ip>sX#k&d|8xj4->LbLdxpIXZ(?mB%4B5&DS+Y}!jNo0TLU6PC~&mWJF(zbv0CKAGeqN+u+ eK6UB3eDx0mCkeDVg59YA0000S#8A4Z7 zE0d96v9PD7r^?F8!otF$qN16ZnbXwNz`?-2zP^{2m)6qJ%*xKp&CSls z$)28`m6er~lasr=y12NwudlDq&(6@&%`m`+mH+?%32;bRbAJE;3ljhU3ljkVnw%H_ z000McNliru;{_ZD8WXguPG$fA0KiE^K~xyi6^>bw!ypht1#~y7X}rcZi8J><Akh9OlE;rTq_nJ`wGxHUP?))J e=8Kzhd-xxRqzbTp9QjcI00008q? delta 212 zcmV;_04x8H1LXmb8Gir(0026epuGS90IW$wK~xyiUC*&~#2^$!!Cwgp0Wu5P<7~Ac z_!94`|B{@0Iv6V{rL@0NPHEe=eYeU~N8Fsad$r_6OAoN_Pw{N;`EbhJkzgcC{=iUY z3LRdp9Abr>V~k6kY}*2b1j%SyvQ6un8Nlcx5e z7Sn|*6@`MX`~d}5f(!q^A8;cs{09F(aOGZbC4w$o7NN9)XrZ>Xwbj1USCS@^NnK2t zR4CQUEbil+d*?ocLR$0rCC7FV79HD#nbIs7D4*1}_S8@m!(UR%>E+iRV%qBVLO!Vp zqA(RYaz}Ci6;c`iAm+Ni$RC_+bZSFpvcDlLGPCt*0)Wva#G;~QQ07fsm;FJ+(EKrU z>7{EADFB3`vM2{6UOIhOrH*Uql#&r8BTJ{>*+C`KvrWn|UIhTKO`5u`I%GVn_Lo_C z>viiE2Oun>Ni@rpO|)WbK>(=b20X+RCF~QYj^!iW;b<<0XK?`V2w0J@A_0KecXZ8e zmJC4hzgd-tHnX lztJIqd0#}8CpW;S@&hS*&G5M%rbhq(002ovPDHLkV1i5p(%}FA literal 0 HcmV?d00001 diff --git a/mods/castrum/textures/castrum_fire_cannon2.png b/mods/castrum/textures/castrum_fire_cannon2.png new file mode 100644 index 0000000000000000000000000000000000000000..402e1c38aed885f6ae8cf78c0e5144bbb49a1978 GIT binary patch literal 505 zcmV1w5pdbqNV% ze&+Bm-}kSRcq|)IQuIlHu;7yb{*=##gK8zCu$IeAV)##54|emmhqyMkGF~eg2_f+# zGz>ynMUR&T03hx<-L0)}E_7ObZt~s`7P$HK>;iz(rPO1B=P>Rq9yF6_#L>~?=*D%I z^cetTCS^fZ#i(@o0*C6|9Ie1#NjX2LM7mF;+zC1-3!B*{<8^39RMhIA)|JODFL^g0Rr8JMorA z2$oJ<(+2=Kg#aQ20N~=NIhI#$&OU|&C4;7yvcLTzRm1JNt!mPM;F{Dm{re03Hv%7* vZz-|2bw$15?X-N-=}>h{;k^b~{Y$t|9f9 z!~6KX_kQ!!bz>)+%nNx;U!r?l1RRLtzSTm>^+x-Yftx`;6Hf*(Mj>;%PmWzyj?*fv(;4 z>5v0JG9x27F8QrX=S}Xow!t~`IP+|Se?01q@_<_0#{?Y!fLi?Ktm&|yS#{s7#>1fh zY5M?75Due7rN?3?x0C>Y*0b)1grZDF@z}AvmU>F^C$x9C>iaKGYC!@~BvH)L97Cms zN@o@(JkKlS%S4gpH&W}{SpY!c!bFjn?HVc-X1i)6rb#L*hcP3R^ezqG2qvgqHN%uf z67(*$GzS3W2@K#XP{@~OR}$%*vb>cE5|kvKTbumjklIxv=wNBg(wwKO?pWwAN|ED( rTV@BlOXXr_kHynb@z?N<#Zj%}T>S5dM;Elcu)y zr(i*Eid7Guy!Zf~1VJCfi-`CPzJXWof+rDtfg*?%L0c7Fn@v5eY=V^P zu!rxP`DSK!W|hZ+6^m;=4T!G#G{8{%s5qo_VJ)prrZPJIvU<^ex#csA#(&spEI`P+T3de@;YmzuBx0P6C~lbX+dX4QOktGAu@ zyC(%iS4mVYD&6Nlv$IJ6^LW@3N5ML*j*4{b8itqn4p`QZfXGBu5VlP zqv9xvB17RDqJ?!+V_sleRM1A*PEPz@D2b9@lScmt(bY!T0kF0;Hz1+cq;A&-V2ltz z0vzw(P0c6AvSw~26DF7`GQF4{@{t;4JM7?gncMXr&YSp$DTg~(%nNrnnvFXxmKckT fP8!h-$ft74E+PFr3ZPo`!3XVnM&<+e?PH?uNQ%4s1f z)EDYHt`Z}UR~i5!Qs)PyjqUknwI@QsjmVM+>(3?tqs5rTCClI~JsCWt_LPoOI| zE!yJ%l4(U!VqtG|{_KO>j-_+XT+Uoe=kLYtYoSd|?qU210I12YPCsn+qgCV0e7$S8 zJ}nPGWQhdPqEj(j&&(zOR3ExtNjU0Ig!Gl=Dc@9+Kc&sxMK6DGRPjH^YFIQgJGQP- zU87^uao2SLobDH=mQ%%S9e@;UEURH=Il4wgSS#y^(Z37*MXB4M!5bm6R4W?**0<*R zQ0g|Q*|7mAaRPV_PWB2D3yI;3I=`CsC#Xp>ximE3kZNV!r(|}R*|G008-1Zcl>mee tcdnV`?=F>z8ch}(j- 0 then Update_knight(player) end - file = io.open(minetest.get_worldpath().."/SAVE/Camp2.txt", "r") local level = file:read("*l") file:close() for i=1,tonumber(level) do Camp2(i,player) + end + file = io.open(minetest.get_worldpath().."/SAVE/Camp3.txt", "r") + local level = file:read("*l") + file:close() + for i=1,tonumber(level) do + Camp3(i,player) end file = io.open(minetest.get_worldpath().."/SAVE/Cactusfarm.txt", "r") local level = file:read("*l") @@ -288,8 +261,6 @@ minetest.register_chatcommand("update", { for i=1,tonumber(level) do Home3(i,player) end - - file = io.open(minetest.get_worldpath().."/SAVE/Island_Barracks.txt", "r") local level = file:read("*l") file:close() @@ -343,6 +314,36 @@ minetest.register_chatcommand("update", { file:close() if tonumber(level) > 0 then Update_pirates(player) + end + file = io.open(minetest.get_worldpath().."/SAVE/Camp3.txt", "r") + local level = file:read("*l") + file:close() + for i=1,tonumber(level) do + Camp3(i,player) + end + file = io.open(minetest.get_worldpath().."/SAVE/Cannon1.txt", "r") + local level = file:read("*l") + file:close() + for i=1,tonumber(level) do + Cannon1(i,player) + end + file = io.open(minetest.get_worldpath().."/SAVE/Cannon2.txt", "r") + local level = file:read("*l") + file:close() + for i=1,tonumber(level) do + Cannon2(i,player) + end + file = io.open(minetest.get_worldpath().."/SAVE/Island_Pier2.txt", "r") + local level = file:read("*l") + file:close() + for i=1,tonumber(level) do + Island_Pier2(i,player) + end + file = io.open(minetest.get_worldpath().."/SAVE/Island_Battleground.txt", "r") + local level = file:read("*l") + file:close() + for i=1,tonumber(level) do + Island_Battleground(i,player) end end, }) \ No newline at end of file diff --git a/mods/dungeon_loot/mapgen.lua b/mods/dungeon_loot/mapgen.lua index c6a4509..366d4ce 100644 --- a/mods/dungeon_loot/mapgen.lua +++ b/mods/dungeon_loot/mapgen.lua @@ -88,18 +88,20 @@ local function populate_chest(pos, rand, dungeontype) amount = rand:next(loot.count[1], loot.count[2]) end - if itemdef.tool_capabilities then - for n = 1, amount do - local wear = rand:next(0.20 * 65535, 0.75 * 65535) -- 20% to 75% wear - table.insert(items, ItemStack({name = loot.name, wear = wear})) + if itemdef then + if itemdef.tool_capabilities then + for n = 1, amount do + local wear = rand:next(0.20 * 65535, 0.75 * 65535) -- 20% to 75% wear + table.insert(items, ItemStack({name = loot.name, wear = wear})) + end + elseif itemdef.stack_max == 1 then + -- not stackable, add separately + for n = 1, amount do + table.insert(items, loot.name) + end + else + table.insert(items, ItemStack({name = loot.name, count = amount})) end - elseif itemdef.stack_max == 1 then - -- not stackable, add separately - for n = 1, amount do - table.insert(items, loot.name) - end - else - table.insert(items, ItemStack({name = loot.name, count = amount})) end end end