diff --git a/.gitignore b/.gitignore index 717f5fe..a7ed2ac 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ tags ## Files related to minetest development cycle *.patch + +## Removed mods +OLDmods/*/ \ No newline at end of file diff --git a/OLDmods/README.md b/OLDmods/README.md new file mode 100644 index 0000000..fbe2c88 --- /dev/null +++ b/OLDmods/README.md @@ -0,0 +1,4 @@ +Here are removed mods and why. I do not add them to git but keep +their name for reference : + + villagers : not needed and suspected to slow down chests diff --git a/ROADMAP b/ROADMAP index 993af0f..ee6ddab 100644 --- a/ROADMAP +++ b/ROADMAP @@ -235,16 +235,17 @@ It's really fast. May be used on a website, to show the actual map. - [ ] Rebuild minetest with master - Don't forget to issue a *git pull* before - [ ] May also test with the stable-0.4 branch -**** Next stream test +**** [fix_SlowChestOpening] Next stream test - [X] New texture pack Pixel Perfection - [X] Replaced welcome_popup with server_news - [X] Now hoe can be created from right - [X] New server craft : FIXED -2019-03-10 19:24:41: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback luaentity_Step(): Runtime error from mod '' in callback item_OnPlace(): ...nbru/.minetest/games/minetest-pvp/mods/creative/init.lua:43: attempt to index local 'placer' (a n -2019-03-10 19:24:41: ERROR[Main]: il value) -2019-03-10 19:24:41: ERROR[Main]: stack traceback: -2019-03-10 19:24:41: ERROR[Main]: /mods/creative/init.lua:43: in function 'callback' - +- [ ] SlowChestOpening test + Moving unwanted mods to OLDmods + - [ ] First test with no mod at all + - [ ] remove mods until + Start with villagers + **** DONE Improve minetestmapper *Should show factions* - [X] Clone this project and create a gitlab project as minetestmapper-factions diff --git a/mods/villagers/README.txt b/mods/villagers/README.txt deleted file mode 100644 index 1e6c85f..0000000 --- a/mods/villagers/README.txt +++ /dev/null @@ -1,34 +0,0 @@ -VILLAGERS - -BY: ErrorNull -DESCRIPTION: Villagers for Minetest -VERSION: 0.17 -LICENCE: WTFPL - -REQUIRES: Sokomine's mg_villages mod. -Github - https://github.com/Sokomine/mg_villages -Forum - https://forum.minetest.net/viewtopic.php?f=9&t=13588 - -COINS: -This mod primarily uses coins for trading. Ten silver coins equal 1 gold coin. A new player will start with a few coins - if that setting was not disabled from config.lua. To get more coins, look for villagers of the following job types that will trade you coins for certain items: ore_seller, potterer, saddler, stoneminer, servant, and schoolteacher. Use the '/villagers list' command below to quickly find some traders while in a village. Also, villagers with job types of "major" can exchange silver coins for gold coins and vice versa. - -CHAT COMMAND: -/villagers list -Displays a formspec that lists all villagers currently spawned nearby that has a job title. Villagers with no job title are not shown. In addition to some details about each trader, there is a GO button that will teleport you to that trader. This tool is meant to for testing while this mod is WIP, and will be restricted upon official release. The following details are shown for each trader: -- Village: village type that the trader resides in -- Plot: Plot number that the trader initially spawned in -- Bed: Bed number (or spawn sequence#) of the trader -- Name: Trader's name -- Title: Trader's job title -- Origin: x and z coordinates of villager's initial spawn point -- Current: The currentx and z coordinates of villager -- Walked: How many meters the villager has walked -- Dist: Distance the villager is from the player -GO button: Teleports player to the trader/villager -REFRESH button: Updates numbers for Current, Walked and Dist to the present moment. - -UN-SPAWNED VILLAGERS? -Some villagers may not appear immediately when a player spawns or teleports directly into a new village. If this happens, walk (or fly) about 40 blocks away from the village, then walk back and the villager should appear and remain as a permanent resident of the village. - -NOTE ABOUT 'GRASSHUT' VILLAGE TYPE: -This is a village type that is available when the very nice 'cottages' mod (https://forum.minetest.net/viewtopic.php?t=5120) is installed with 'mg_villages' mod - both by Sokomine. At this time, my villagers mod do not support the GRASSHUT village type because it requires Mossmanikin's 'dryplants' mod which depends on Venessa's 'biome_lib' mod. Venessa's biome_lib mod and her beautiful mods 'plantlife_modpack' and 'moretrees' are amazing mods that make the world look so much more lush and realistic. However, in my experience so far with biome_lib and other mods that depend on it, it becomes fairly processing intensive and detracks from my goal of having a lightweight, server and multiplayer friendly villagers mod. If you have a fast computer and primarily play singleplayer, then I would highly recommend installing Venessa's plantlife and moretrees mods for sure! diff --git a/mods/villagers/TODO.txt b/mods/villagers/TODO.txt deleted file mode 100644 index 2286afa..0000000 --- a/mods/villagers/TODO.txt +++ /dev/null @@ -1,91 +0,0 @@ -TODO: -- add support for farming redo in trading goods -- finish details trade items for remaining job titles -- add support for 3d armor in trading goods - -- redo /villagers spawn chat command into formspec instead -- remove dependancy on mg_villagers mod. -- make unique chat for 'single' houses and for region type - --- use the nodemetadata to track how many mystery and simplejob traders will spawn.. --- then can spawn mystery trader and coin exchange trader -- create mystery merchants that sell only one valueable items at a time (only one in each village) - -- add 'rosetta stone' item. if player does not hold in inventory, speeach from native and desert --- villagers will not display in a legible format - -- add check for unsupported mods. do not load villager's mod if unsupported mods are present -- minetest.after removing chat bubbles when many are in screen. - -- prevent manual spawning if in water -- villagers in snowy region will offer some snow for free -- create custom main dialogue for traders -- make metalsmith use only mineral and metal related dialogue from 'game facts' -- make chat dialogue based on scm type and not building type anymore --- for now, only librarians, smith, tower gaurds, and house residents give random game facts. -- slightly reduce the chance for smalltalk chat for each villager -- make item stock based on the item type: expensive items have less stock, but bigger villages have more stock. - -- make villagers who spawn in homes with multiple inhabitants follow these patterns: --- 1 inhab: a) adult male b) adult female c) old male d) old female --- 2 inhab: a) adult male and female b) old male and female c) more to come --- 3 inhab: a) adult male and female and young b) old male and female and young --- 4 inhab: a) adult male and female and two young b) old male and female and adult female and young --- 5 inhab: a) adult male and female and three young b) old male and female and adult male and female and young - -- make custom dialogue also based on village type. Ex: huts in medieval are larger and have beds and huts in cornernote do not. - -- make the village region type (hot, cold, normal, native, desert) not based purely on the village type, but instead --- based on the surrounding blocks and village tree types from the village spawn point. - -- allow villagers to open/close and walk through doors and gates -- while villager is walking and attempting to chat, show chat bubble 'pardon me', 'excuse me', 'sorry', 'coming through', 'walking here', etc. -- due to many more spawned villagers matching each bed, make most of these villagers walk the roads instead of randomly wandering around the plot - -- add new variable 'vDoorFound' and 'vDoorPosition' that stores the position of a found door as verifyPath() executes -- after each walk action, check if vDoorFound is true contains a position and currPos + 2 nodes forward doesn't hit maxDistance, then set action to USEDOOR -- USEDOOR: villager opens door, walks forward two nodes, and closes door, then sets action to STAND. - -- have villagers appear on bed laying down at night -- make villagers that have no beds lay on the ground at night with a sleeping mat (maybe next to a tree or building) - -- have guards wield a shield and/or weapon -- make tower villagers appear atop tower - -- have farmers/field workers plant seedlings if they encounter bare soil -- make field villagers stay near their fields and not wander off -- villager wields the tool depending on what item digging - shovel for snow, hoe for crops and soil, etc - -- add unique chat dialogue for remaining villager types -- add better clothing textures for 'church' villager types -- add clothing textures that match old aged villagers -- make church villagers look for and stay inside the church - -- add support for weather mod -- have villagers say something different depending on weather - -- when adding more hair textures start using v1.8 type -- add probability for adult and old males to have beards -- add probability for gloves in cold regions -- add more jacket styles -- add more female short sleeved, long sleeved and sleeveless shirt styles -- add different dress type of males (currently using slightly modified texture of female full dress) -- add more full dress styles for females - -- tower guard spawn atop the tower too! -- free roaming villagers that just walk the streets and chat -- villagers climb stairs and villagers sit on furniture -- support for Farming Redo items for trading - -- allow villagers to kill mobs -- allow villagers to get 'knocked out' (but not die) from attackes -- knocked out villagers will automatically recover and stand back up after some time -- cannot trade with a knocked out villager -- knocked out villager can only respond like 'uuuhg', 'ouch', 'help', etc when knocked out -- player can right-click on villager with a healing item to help recovery - -ISSUES/BUGS: - -- player who initiated a chat or trade might have chat bubble stick when --- another player chats same villager -- on very rare occasions villagers seen to walk diagonally \ No newline at end of file diff --git a/mods/villagers/actions.lua b/mods/villagers/actions.lua deleted file mode 100644 index 41a84df..0000000 --- a/mods/villagers/actions.lua +++ /dev/null @@ -1,757 +0,0 @@ - --- ====================================== VILLAGER ACTIONS ================================================ --- ======================================================================================================== - --- SUPPORTING FUNCTIONS -- - --- verify weather current target position is a valid spot for villager to walk -function targetClear(self) - - local pos = {x=self.vTargetPos.x, y=self.vTargetPos.y, z=self.vTargetPos.z} - local nodenames - - --check vertical pos at villager's lowerbody - nodenames = villagers.getNodeName({x=pos.x, y=pos.y, z=pos.z}) - if villagers.log then io.write("\n - "..nodenames[2]) end - if minetest.registered_nodes[nodenames[1]].walkable then - if villagers.log then io.write("[fail] ") end - return false - else - if villagers.log then io.write("[OK] ") end - end - - --check vertical pos at villager's upperbody - nodenames = villagers.getNodeName({x=pos.x, y=pos.y+1, z=pos.z}) - if villagers.log then io.write(nodenames[2]) end - if minetest.registered_nodes[nodenames[1]].walkable then - if villagers.log then io.write("[fail] ") end - return false - else - if villagers.log then io.write("[OK] ") end - end - - --check vertical pos below villager's feet - nodenames = villagers.getNodeName({x=pos.x, y=pos.y-1, z=pos.z}) - local nodename = nodenames[2] - if villagers.log then io.write(nodenames[2]) end - if string.find(nodename, "WATER") or string.find(nodename, "LAVA") or string.find(nodename, "AIR") then - if villagers.log then io.write("[fail] ") end - return false - else - if villagers.log then io.write("[OK] ") end - end - - return true -end - -local function turnYaw(self, yaw_index, turnRight) - local new_yaw_index - if turnRight then - new_yaw_index = yaw_index + 1 - if new_yaw_index > 8 then new_yaw_index = 1 end - else - new_yaw_index = yaw_index - 1 - if new_yaw_index < 1 then new_yaw_index = 8 end - end - - local new_yaw = villagers.YAWS[new_yaw_index] - self.vFacingDirection = villagers.DIRECTIONS[new_yaw_index] - - self.vYaw = new_yaw - self.object:set_yaw(new_yaw) -end - -local function posHasObject(pos) - local objects = minetest.get_objects_inside_radius(pos, 0.8) - local object_count = #objects - local return_bool - if object_count > 0 then - - for n = 1, #objects do - if objects[n]:is_player() then - if villagers.log then io.write("foundPlayer["..objects[n]:get_player_name().."] ") end - else - local luaentity = objects[n]:get_luaentity() - if luaentity.vName then - if villagers.log then io.write("foundVillager["..luaentity.vName.."] ") end - else - if villagers.log then io.write("foundEntity ") end - end - local pos = objects[n]:get_pos() - if villagers.log then io.write("("..pos.x..","..pos.z..") ") end - end - - end - - return_bool = true - else - if villagers.log then io.write("targetPosNoEntity ") end - return_bool = false - end - return return_bool -end - --- MAIN VILLAGER ACTIONS - --- stand idle -function villagers.standVillager(self) - if villagers.log then io.write("stand() ") end - self.vAction = "STAND" - - -- skip remaining code if villager already standing - if self.vAction == "STAND" then - return - end - - self.object:set_animation( - {x=self.animation["stand_start"], y=self.animation["stand_end"]}, - self.animation_speed + math.random(10) - ) - - -- replace turn preference from 'right' to 'left' or vice versa - -- after a string of consecutive turns - if self.vTurnPreference == "right" then - self.vTurnPreference = "left" - else - self.vTurnPreference = "right" - end - -end - --- turn left or right by 45 degrees -local function turnVillager(self) - if villagers.log then io.write("turn() ") end - self.vAction = "TURN" - - local face_dir = self.vFacingDirection - if self.vTurnDirection == "right" then - if face_dir == "N" then turnYaw(self, 1, true) - elseif face_dir == "NE" then turnYaw(self, 2, true) - elseif face_dir == "E" then turnYaw(self, 3, true) - elseif face_dir == "SE" then turnYaw(self, 4, true) - elseif face_dir == "S" then turnYaw(self, 5, true) - elseif face_dir == "SW" then turnYaw(self, 6, true) - elseif face_dir == "W" then turnYaw(self, 7, true) - elseif face_dir == "NW" then turnYaw(self, 8, true) - end - else - if face_dir == "N" then turnYaw(self, 1) - elseif face_dir == "NE" then turnYaw(self, 2) - elseif face_dir == "E" then turnYaw(self, 3) - elseif face_dir == "SE" then turnYaw(self, 4) - elseif face_dir == "S" then turnYaw(self, 5) - elseif face_dir == "SW" then turnYaw(self, 6) - elseif face_dir == "W" then turnYaw(self, 7) - elseif face_dir == "NW" then turnYaw(self, 8) - end - end - - if villagers.log then io.write("nowFacing="..self.vFacingDirection.." ") end -end - -local function walkVillagerEnd(self) - if villagers.log then io.write(string.upper(self.vName).." ") end - - -- stop villager and show standing anim. villager should - -- now be standing at or near the target position - self.object:setvelocity({x=0,y=0,z=0}) - self.object:set_animation( - {x=self.animation["stand_start"], y=self.animation["stand_end"]}, - self.animation_speed + math.random(10) - ) - self.vAction = "STAND" - - -- update total distance travelled by villager - local travelDistance = vector.distance(self.vPos, {x=self.vTargetPos.x, y=self.vPos.y, z=self.vTargetPos.z}) - self.vTotalDistance = self.vTotalDistance + travelDistance - - -- teleport villager to exact target position to makeup for any - -- discrepencies in movement time and distance - self.vPos.x = self.vTargetPos.x - self.vPos.z = self.vTargetPos.z - self.object:set_pos(self.vPos) - - -- update villager pathfinding parameters for next walk attempt - local newOriginDist = villagers.round(vector.distance(self.vOriginPos, self.vPos),1) - self.vOriginDistance = newOriginDist - - if newOriginDist < self.vOriginDistMax then - - else - self.vAction = "TURNBACK" - if villagers.log then io.write("DistMaxed set_vAction=TURNBACK ") end - end - if villagers.log then io.write("originDist="..newOriginDist.." ") end - -end - --- walk forward a specific number of blocks -local function walkVillager(self) - if villagers.log then io.write("walk() ") end - self.vAction = "WALKING" - - -- calculate velocity and direction - local facing = self.vFacingDirection - local x_velocity = villagers.NODE_AREA[facing][1] - local z_velocity = villagers.NODE_AREA[facing][2] - - --move villager in the direction of target position - self.object:setvelocity({x=x_velocity,y=0,z=z_velocity}) - - --show walking animation - self.object:set_animation( - {x=self.animation["walk_start"], y=self.animation["walk_end"]}, - self.animation_speed + math.random(10) - ) - - local distance = villagers.round(vector.distance(self.vPos, {x=self.vTargetPos.x, y=self.vPos.y, z=self.vTargetPos.z}),1) - - --after 'distance' seconds, stop villager movement - minetest.after(distance, function() - if villagers.log then io.write("\n ** MTAFTER.WALK-ENDED("..distance..") ") end - walkVillagerEnd(self) - if villagers.log then io.write("MTAFTER_END **") end - end) - - if villagers.log then io.write("mtAfterScheduled runIn: "..distance.."sec ") end -end - -local function digVillager(self) - local log = false - if log then io.write("dig() ") end - - -- skip remaining code if villager already standing - if self.vAction == "DIG" then - self.vSavepoints.digVillager = nil - return - end - self.vAction = "DIG" - - self.object:set_animation( - {x=self.animation["dig_start"], y=self.animation["dig_end"]}, - self.animation_speed + math.random(10) - ) - - self.vSoundHandle = minetest.sound_play( - "default_dig_crumbly", - {object = self.object, loop = true, gain = 0.2, max_hear_distance = 8} - ) - -end - -local function replaceNode(self) - local log = false - if log then io.write("replace() ") end - self.vAction = "REPLACE" - - local dugNodeData = villagers.getFacingNodeInfo(self, 3) - local dugPosition = dugNodeData[1] - local dugNodeName = dugNodeData[2] - local dugNodeNickname = dugNodeData[3] - - -- snow - if dugNodeNickname == "SNOW" then - minetest.remove_node(dugPosition) - - -- grass - elseif string.find(dugNodeNickname, "GRASS_") then - if dugNodeNickname == "GRASS_1" then - minetest.remove_node(dugPosition) - else - minetest.set_node(dugPosition, {name = "default:grass_1"}) - end - - -- cotton - elseif dugNodeNickname == "COTTON_8" then - minetest.set_node(dugPosition, {name = "farming:cotton_1"}) - - -- wheat - elseif dugNodeNickname == "WHEAT_8" then - minetest.set_node(dugPosition, {name = "farming:wheat_1"}) - - elseif string.find(dugNodeNickname, "FLOWER_") then - minetest.set_node(dugPosition, {name = "default:grass_1"}) - end - - minetest.sound_stop(self.vSoundHandle) - minetest.sound_play("default_dig_snappy", {pos = dugPosition, gain = 0.4, max_hear_distance = 8} ) - - -- show standing anim for the rest of the action cycle - self.object:set_animation( - {x=self.animation["stand_start"], y=self.animation["stand_end"]}, - self.animation_speed + math.random(10) - ) - - self.vAction = "STAND" -end - --- stand still while verifying path in front and taking note any obstructions -local function verifyPath(self, forced_step_distance, walking_back) - if villagers.log then io.write("verify() ") end - - -- if villager has despawned - if self == nil then return end - - -- verifyPath() called from turnBack() - if walking_back then - self.vAction = "WALKBACK" - - -- verifyPath() called via normal action cycle - else - self.vAction = "VERIFY" - end - - local remainingDistance - if forced_step_distance then - -- 'forced_step_distance' param is typicalled passed when verifyPath() - -- is manually executed by turnBack() when walk distance is maxed and - -- only want villager to walk forward 1 block/node - remainingDistance = forced_step_distance - else - remainingDistance = math.random(math.floor(self.vOriginDistMax - self.vOriginDistance)) - end - - local possibleWalkDistance = 0 - local facingDeadEnd = false - - if villagers.log then - local currPos = self.object:get_pos() - io.write("getPos("..currPos.x..","..currPos.z..") ") - io.write("vPos("..self.vPos.x..","..self.vPos.z..") ") - io.write("goalDist="..remainingDistance.." ") - end - - -- re-initialize targetPos to player's current x,z coordinates - self.vTargetPos.x = self.vPos.x - self.vTargetPos.z = self.vPos.z - - for i = 1, remainingDistance do - --check a column of 3 nodes that is in front of villager. if encounter liquid, - --cliff or block node, break loop and save the target pos reached so far - - -- set targetPos to one node forward - self.vTargetPos.x = self.vTargetPos.x + villagers.NODE_AREA[self.vFacingDirection][1] - self.vTargetPos.z = self.vTargetPos.z + villagers.NODE_AREA[self.vFacingDirection][2] - - if targetClear(self) then - if posHasObject(self.vTargetPos) then - - -- reset targetPos back to the previous node - self.vTargetPos.x = self.vTargetPos.x - villagers.NODE_AREA[self.vFacingDirection][1] - self.vTargetPos.z = self.vTargetPos.z - villagers.NODE_AREA[self.vFacingDirection][2] - if i == 1 then - facingDeadEnd = true - end - break - else - possibleWalkDistance = possibleWalkDistance + 1 - end - else - -- reset targetPos back to the previous node - self.vTargetPos.x = self.vTargetPos.x - villagers.NODE_AREA[self.vFacingDirection][1] - self.vTargetPos.z = self.vTargetPos.z - villagers.NODE_AREA[self.vFacingDirection][2] - if i == 1 then - facingDeadEnd = true - end - break -- break from for loop - end - - end - - if facingDeadEnd then - - -- villager is trying to walk back but is apparently - -- blocked by an entity. do not turn villager, but - -- wait for next cycle and verifyPath() and attempt - -- walking forward again. - if walking_back then - if villagers.log then io.write("walkBackBlocked waitAnotherCycle " ) end - - -- an entity is blocking the node directly in front - -- of villager. simply have villager turn - else - if villagers.log then io.write("frontNodeBlocked ") end - turnVillager(self) - end - - elseif possibleWalkDistance > 0 then - self.vAction = "WALK" - end - -end - --- turn villager 180 degrees and walk random distance back -local function turnBack(self) - if villagers.log then io.write("turnBack() ") end - self.vAction = "TURNBACK" - - local face_dir = self.vFacingDirection - local new_facing_dir - - if face_dir == "N" then - new_facing_dir = "S" - self.vYaw = villagers.YAWS[5] - elseif face_dir == "E" then - new_facing_dir = "W" - self.vYaw = villagers.YAWS[7] - elseif face_dir == "S" then - new_facing_dir = "N" - self.vYaw = villagers.YAWS[1] - elseif face_dir == "W" then - new_facing_dir = "E" - self.vYaw = villagers.YAWS[3] - end - - -- update yaw to 180 degrees from prior yaw - self.object:set_yaw(self.vYaw) - self.vFacingDirection = new_facing_dir - - -- if villager despawns before executing below minetest.after() code - -- then setting vAction to 'WALKBACK' ensures villager resumes - -- walking back 1 node upon respawn via verifyPath(self, 1, true) - self.vAction = "WALKBACK" - - minetest.after(1.0, function() - if villagers.log then io.write("\n ** mtAfter.walkBack(1) ") end - verifyPath(self, 1, true) - if villagers.log then io.write("MTAFTER_END **") end - end) - -end - -local function randomAct(self) - local log = false - if log then io.write("randomAct() ") end - - local face_dir = self.vFacingDirection - if (face_dir == "N" or face_dir == "E" or face_dir == "S" or face_dir == "W") then - if log then io.write(face_dir.." ") end - local targetNode = villagers.getFacingNodeInfo(self) - local tNodeName = targetNode[2] - local tNodeNickname = targetNode[3] - local tNodeDrawtype = minetest.registered_nodes[tNodeName].drawtype - - if log then io.write(tNodeDrawtype.." "..tNodeNickname.." plot="..self.vType.." ") end - - -- air, ladders/signs, and torches - if tNodeDrawtype == "airlike" or tNodeDrawtype == "signlike" or tNodeDrawtype == "torchlike" then - -- villager can walk further distance from origin - if self.vOriginDistance < self.vOriginDistMax then - local random_num = math.random(5) - if random_num == 1 then turnVillager(self) - elseif random_num == 2 then villagers.standVillager(self) - else verifyPath(self) end - - else turnBack(self) end - - -- plants or crops - -- only farmers and field workers will walk into fields and and dig crops - elseif tNodeDrawtype == "plantlike" then - if tNodeNickname == "COTTON_8" then - if self.vType == "field" or self.vType == "farm_tiny" or self.vType == "farm_full" then - self.vDigging = "cotton" - digVillager(self) - else - local random_num = math.random(4) - if random_num == 1 then verifyPath(self) - elseif random_num == 2 then villagers.standVillager(self) - else turnVillager(self) end - end - - elseif tNodeNickname == "WHEAT_8" then - if self.vType == "field" or self.vType == "farm_tiny" or self.vType == "farm_full" then - self.vDigging = "wheat" - digVillager(self) - else - local random_num = math.random(4) - if random_num == 1 then verifyPath(self) - elseif random_num == 2 then villagers.standVillager(self) - else turnVillager(self) end - end - - elseif tNodeNickname == "COTTON_1" or tNodeNickname == "WHEAT_1" then - if self.vType == "field" or self.vType == "farm_tiny" or self.vType == "farm_full" then - verifyPath(self, 1) - else - if math.random(2) == 1 then turnVillager(self) - else villagers.standVillager(self) end - end - - elseif tNodeNickname == "GRASS_1" or tNodeNickname == "GRASS_5" then - local randomNum = math.random(6) - if randomNum == 1 then turnVillager(self) - elseif randomNum == 2 then villagers.standVillager(self) - elseif randomNum == 3 then verifyPath(self) - else - self.vDigging = "grass" - digVillager(self) - end - - elseif string.find(tNodeNickname, "FLOWER_") then - self.vDigging = "flower" - digVillager(self) - - else - local randomNum = math.random(3) - if randomNum == 1 then villagers.standVillager(self) - elseif randomNum == 2 then verifyPath(self) - else turnVillager(self) end - end - - -- all other solid nodes - elseif tNodeNickname == "SNOW" then - if math.random(3) == 1 then - villagers.standVillager(self) - else - self.vDigging = "snow" - - digVillager(self) - end - - -- target node is a node block or common obstruction - else turnVillager(self) end - - -- facing direction is NE, SE, SW, NW - else turnVillager(self) end - -end - - -local function animateVillager(self) - local log = false - if log then - --io.write("\nANIM ") - io.write(string.upper("\n"..self.vName).." ") - end - - - local current_action = self.vAction - if current_action == "STAND" then -- tested ok! - randomAct(self) -- randomly do another action - - elseif current_action == "TURN" then -- tested ok! - randomAct(self) -- randomly do another action - - elseif current_action == "DIG" then -- tested ok! - replaceNode(self) - - -- if villager despawns while digging - elseif current_action == "RESUMEDIG" then -- tested ok! - digVillager(self) - - elseif current_action == "WALK" then -- tested OK! - walkVillager(self) - - elseif current_action == "WALKING" then -- tested ok! - if log then io.write("walking.. ") end - - elseif current_action == "TURNBACK" then -- test ok! - turnBack(self) - - elseif current_action == "WALKBACK" then - verifyPath(self, 1, true) - - elseif current_action == "ENDCHAT" then - if log then io.write("chatEnding.. ") end - - else - if log then io.write("error vAction="..current_action.." ") end - end - - if log then io.write("ANIM_END") end -end - - -function villagers.on_leftclick(self, clicker, time_from_last_punch) - self.object:set_hp(15) -- don't let villager die from punches, for now........ - - -- prevent chat if punched by non-player entity (mobs, weapons, etc.) - if not clicker:is_player() then - --print("## Punched by non-player. No chat.") - return - end - - -- debugging - if villagers.log3 then print("\n## "..self.vTextureString.."\n") end - - local current_action = self.vAction - if villagers.log or villagers.log2 then io.write("vAction="..current_action.." ") end - - if current_action == "STAND" or current_action == "TURN" or current_action == "WALK" or - current_action == "DIG" or current_action == "RESUMEDIG" then - - villagers.chatVillager(self, clicker) - - elseif current_action == "ENDCHAT" or current_action == "ENDTRADE" then - local message_text = villagers.chat.busy[math.random(#villagers.chat.busy)] - villagers.showMessageBubble(self, clicker, message_text, "FRONT", 1.5) - - elseif current_action == "CHAT" then - if self.vChatting == clicker:get_player_name() then - - -- if player constantly click spams villager - -- villager will not be able to 'understand' player - if time_from_last_punch < 0.8 then - villagers.showMessageBubble(self, clicker, villagers.chat.spam[math.random(#villagers.chat.spam)], "FRONT", 1) - else - villagers.chatVillager(self, clicker) - end - else - local message_text = "I'm chatting with someone\nOne moment.." - villagers.showMessageBubble(self, clicker, message_text, "FRONT", 2) - end - - elseif current_action == "TRADE" then - local message_text = "I'm trading with "..string.upper(self.vTrading).."\nOne moment.." - villagers.showMessageBubble(self, clicker, message_text, "FRONT", 2) - - -- villager will not chat if currently performing the - -- below actions - else - local current_action = self.vAction - if current_action == "WALKING" then - local message_text = villagers.chat.walking[math.random(#villagers.chat.walking)] - villagers.showMessageBubble(self, clicker, message_text, "FRONT", 1.5) - elseif current_action == "WALKBACK" then - local message_text = villagers.chat.walkback[math.random(#villagers.chat.walkback)] - villagers.showMessageBubble(self, clicker, message_text, "FRONT", 1.5) - elseif current_action == "TURNBACK" then - local message_text = villagers.chat.busy[math.random(#villagers.chat.busy)] - villagers.showMessageBubble(self, clicker, message_text, "FRONT", 1.5) - else - print("## ERROR Invalid current_action: "..current_action) - end - - end - -end - - -function villagers.on_rightclick(self, clicker) - - local current_action = self.vAction - if villagers.log then io.write("vAction="..current_action.." ") end - - if current_action == "STAND" or current_action == "TURN" or current_action == "WALK" or - current_action == "DIG" or current_action == "RESUMEDIG" then - - if self.vSell == "none" then - villagers.chatVillager(self, clicker, 3) - else - villagers.tradeVillager(self, clicker) - villagers.chatVillager(self, clicker, 1) - end - - elseif current_action == "ENDTRADE" or current_action == "ENDCHAT" then - local message_text = villagers.chat.busy[math.random(#villagers.chat.busy)] - villagers.showMessageBubble(self, clicker, message_text, "FRONT", 1.5) - - -- when player right click's on a villager who is already - -- trading with another player - elseif current_action == "TRADE" then - local message_text = "I'm trading with "..string.upper(self.vTrading).."\nOne moment.." - villagers.showMessageBubble(self, clicker, message_text, "FRONT", 2) - - elseif current_action == "CHAT" then - - if self.vChatting == clicker:get_player_name() then - - self.vChatting = nil - if self.vSell == "none" then - villagers.endVillagerChat(self, clicker, 3) - - else - villagers.chatVillager(self, clicker, 1) - villagers.tradeVillager(self, clicker) - end - - else - local message_text = "I'm chatting with someone\nOne moment.." - villagers.showMessageBubble(self, clicker, message_text, "FRONT", 2) - end - - -- villager will not chat if currently performing the - -- below actions - else - local current_action = self.vAction - if current_action == "WALKING" then - local message_text = villagers.chat.walking[math.random(#villagers.chat.walking)] - villagers.showMessageBubble(self, clicker, message_text, "FRONT", 1.5) - elseif current_action == "WALKBACK" then - local message_text = villagers.chat.walkback[math.random(#villagers.chat.walkback)] - villagers.showMessageBubble(self, clicker, message_text, "FRONT", 1.5) - elseif current_action == "TURNBACK" then - local message_text = villagers.chat.busy[math.random(#villagers.chat.busy)] - villagers.showMessageBubble(self, clicker, message_text, "FRONT", 1.5) - else - print("## ERROR Invalid current_action: "..current_action) - end - - end - -end - - -function villagers.on_step(self, dtime) - - self.vTimer = self.vTimer + dtime - if self.vChatting then - if self.vTimer > 1 then - - self.vTimer = 0 - - local player = minetest.get_player_by_name(self.vChatting) - if player then - - if self.vChatReady then - -- villager maintains yaw direction toward player - villagers.turnToPlayer(self, player) - - local distance = vector.distance(self.vPos, player:getpos()) - - local currVillagerLookDir = villagers.round(self.object:get_yaw(),3) - local currPlayerLookDir = villagers.round(player:get_look_horizontal(),3) - if currVillagerLookDir < 0 then - currVillagerLookDir = currVillagerLookDir + (3.141*2) - end - - -- player moved away from villager while chatting - -- villager assumes player no longer wants to chat - if distance > self.vInitialChatDistance then - villagers.endVillagerChat(self, player, 1) - end - - else - --io.write("#NOTREADY# ") - end - - - -- when player is no longer in-game while chatting/trading - -- with villager, then end the chat. - else - -- load previous yaw value - self.vYaw = self.vYawSaved - - -- resume previous action - minetest.after(2, function() - self.object:set_yaw(self.vYaw) - animateVillager(self) - end) - - self.vChatting = nil - end - - end - elseif self.vTrading then - if self.vTimer > 1 then - self.vTimer = 0 - --io.write("\n"..self.vName.." trading ") - end - else - if self.vTimer > self.vActionFrequency then - self.vTimer = 0 - animateVillager(self) - --io.write("EndC") - end - end -end diff --git a/mods/villagers/attributes.lua b/mods/villagers/attributes.lua deleted file mode 100644 index ba06705..0000000 --- a/mods/villagers/attributes.lua +++ /dev/null @@ -1,1077 +0,0 @@ --- Generate villager attributes and appearance after spawning - -local NAMES = { - male = {"Ackerley", "Adney", "Aeduuard", "Aeduuin", "Aelfraed", "Aland", "Alderney", "Aldis", "Aldred", "Aldrich", "Aldwin", "Algernon", "Alistair", "Allard", "Allister", "Alston", "Amherst", "Archer", "Arledge", "Arley", "Arnette", "Arthur", "Arundel", "Ascot", "Ashton", "Atherton", "Atkins", "Atwater", "Auden", "Audrey", "Audric", "Aylmer", "Aylwin", "Badrick", "Bancroft", "Barden", "Barlow", "Barney", "Barric", "Barrington", "Barse", "Bartley", "Bartram", "Bassett", "Baul", "Bavol", "Baxter", "Bayard", "Beaman", "Beasley", "Beaver", "Bentley", "Berkeley", "Berwick", "Beval", "Bickford", "Birkitt", "Birley", "Birney", "Birtle", "Blakely", "Blaxton", "Blythe", "Bolton", "Booker", "Bosley", "Boswell", "Bowman", "Bradburn", "Braden", "Bradford", "Bradshaw", "Bradyn", "Brainard", "Bramwell", "Brandon", "Brantley", "Branton", "Brawley", "Braxton", "Brayden", "Brayton", "Brenner", "Brentley", "Bridgely", "Brigham", "Brinley", "Brishen", "Brockton", "Bronson", "Buckminster", "Burbank", "Burdan", "Burleigh", "Burne", "Byram", "Cadby", "Caldwell", "Carleton", "Carlyle", "Carnell", "Carsen", "Cartland", "Cartwright", "Cederic", "Chancellor", "Chandler", "Channing", "Chanse", "Charlton", "Chaucey", "Cheston", "Chilton", "Clayborne", "Clayton", "Cleavon", "Clifford", "Clifton", "Clinton", "Colton", "Cranley", "Cuthbert", "Dalton", "Darby", "Darren", "Darthmouth", "Darwyn", "Davidson", "Dawson", "Dayton", "Delbert", "Denver", "Denzel", "Devon", "Drake", "Dudley", "Durriken", "Durwin", "Dwennon", "Easton", "Edgar", "Edmundus", "Egbert", "Eldon", "Elton", "Erwan", "Filmore", "Franklin", "Galore", "Galorian", "Garman", "Garrett", "Garrick", "Garridan", "Garroway", "Gerard", "Godwin", "Golding", "Gordon", "Hadden", "Haelan", "Hammond", "Harding", "Hartley", "Haylan", "Hazlitt", "Hearst", "Heathcliff", "Heathcote", "Holden", "Houston", "Howard", "Hunter", "Hyde", "Irving", "Irwin", "Jackson", "Jagger", "Jamie", "Jamison", "Jarrett", "Jaxon", "Jayden", "Jeffrey", "Jerald", "Jeremy", "Jerold", "Jerrard", "Johnson", "Judson", "Keaton", "Kelton", "Kelvin", "Kendall", "Kipling", "Kirby", "Kolby", "Lander", "Landon", "Lanford", "Langston", "Layne", "Leland", "London", "Lyman", "Lyndon", "Macon", "Maddox", "Madison", "Malin", "Manfield", "Manley", "Manning", "Marden", "Maven", "Mavis", "Maxwell", "Meldon", "Mendel", "Mitchell", "Moreland", "Nilson", "Oakes", "Oakley", "Paige", "Parker", "Payton", "Pearson", "Peyton", "Pierson", "Preston", "Quentin", "Radley", "Ramsey", "Randall", "Raymond", "Rhett", "Richard", "Ricker", "River", "Robert", "Robinson", "Robyn", "Rodney", "Roldan", "Royston", "Rudd", "Rudyard", "Rylan", "Sawyer", "Sedgewick", "Severin", "Shelton", "Sherman", "Sherrod", "Silas", "Sinjin", "Somerville", "Southwell", "Spalding", "Spencer", "Sterling", "Stewart", "Strong", "Stuart", "Tanner", "Tilton", "Trowbridge", "Twyford", "Udolf", "Ulmer", "Unwin", "Upton", "Upwood", "Usher", "Walden", "Wallace", "Warden", "Warrick", "Wayland", "Waylon", "Wayne", "Wesley", "Weston", "Whitcombe", "Whitfield", "Willard", "William", "Winston", "Winthrop", "Witter", "Wolfe", "Woodruff", "Woolsey", "Wylie", "Wymer", "Yates"}, - female = {"Abelena", "Abellana", "Aelfgifu", "Aelflaed", "Aethelburh", "Aetheldaeg", "Aetheldreda", "Aethelfled", "Aethelfrith", "Aethelgifu", "Aethelgyth", "Aethelswith", "Aethelu", "Aethylswith", "Afreda", "Ailith", "Alditha", "Aldyth", "Alfreda", "Alvar", "Alvina", "Amice", "Amity", "Anice", "Annis", "Arethusa", "Arietta", "Ashton", "Avellana", "Avery", "Balthilda", "Batilda", "Bega", "Beverly", "Bliss", "Blossom", "Braeden", "Breena", "Brighton", "British", "Brucie", "Cade", "Carling", "Cedrica", "Ceola", "Channel", "Chauncey", "Cinnamon", "Codie", "Corliss", "Cwenburg", "Cwenburh", "Cwenhild", "Cyneburg", "Cyneburh", "Dae", "Daisy", "Daralis", "Dawn", "Delight", "Dena", "Deorwynn", "Devon", "Diana", "Doanne", "Donella", "Duette", "Dulcina", "Eadburg", "Eadburga", "Eadburgh", "Eadburh", "Eadgifu", "Eadu", "Eadwynn", "Eald", "Easter", "Ebba", "Eda", "Edeva", "Edith", "Edmunda", "Edwena", "Edwina", "Egberta", "Eglantine", "Elfreda", "Elfredda", "Elfrida", "Elfrieda", "Elga", "Elgifu", "Ella", "Ellette", "Elmina", "Elvina", "Eolande", "Eostre", "Erline", "Ermengard", "Ethelberga", "Ethelburg", "Ethelburga", "Ethelburh", "Etheldreda", "Ethelfleda", "Ethelfrith", "Ethelgifu", "Ethelgyth", "Ethelinda", "Evelyn", "Everild", "Everilda", "Faerydae", "Farah", "Fay", "Faye", "Fayette", "Faylinn", "Fayre", "Fira", "Fleta", "Forestyne", "Garnet", "Gelsey", "Geretrudis", "Gidget", "Githa", "Gode", "Godelief", "Godeliff", "Godeliva", "Godelva", "Godgifu", "Godgyth", "Goditha", "Golda", "Golde", "Goldevia", "Goldwine", "Gullveig", "Gunilda", "Gunnhild", "Gytha", "Hadley", "Harley", "Hawkins", "Hazel", "Helewis", "Helewise", "Heloise", "Hereswith", "Hilaria", "Hildred", "Hodierna", "Hollis", "Hopkins", "Hulda", "Idla", "Ingrede", "Ingrith", "Ivy", "Jetta", "Jolecia", "Jolenta", "Kandi", "Kauanoe", "Keaton", "Kelby", "Kenley", "Kinsey", "Kip", "Kyneburg", "Laila", "Langgifu", "Lark", "Lee", "Letha", "Leuedai", "Liliana", "Lilli", "Lilly", "Lily", "Linden", "Lindsey", "Linsey", "Long", "Lorelle", "Lorica", "Lovedaia", "Lovedaya", "Lovedie", "Luella", "Lufu", "Lulie", "Madison", "Magge", "Marden", "Marigold", "Marigold", "Marlow", "Maurelle", "Maven", "Mercia", "Merewald", "Merry", "Mildburg", "Mildgyth", "Mildred", "Misty", "Myla", "Naida", "Nerida", "Nerida", "Nissa", "Nixie", "Norma", "Nyx", "Odile", "Oletha", "Orla", "Osgifu", "Oswalda", "Payton", "Peace", "Posy", "Princess", "Questa", "Radella", "Raisa", "Raisie", "Randall", "Raven", "Rhiannon", "Rhoslyn", "Rhoswen", "Rhyannon", "Rikki", "Rosa", "Rosalba", "Rosalie", "Rosetta", "Rosina", "Rossa", "Roxanne", "Royale", "Rusalka", "Sable", "Saelufu", "Sapphire", "Sebille", "Shaylee", "Shea", "Shelby", "Sigourney", "Sinnie", "Siusan", "Stanburg", "Stanburh", "Star", "Storm", "Sungyevo", "Sunngifu", "Sunny", "Susane", "Susanna", "Suzanne", "Suzette", "Swete", "Tana", "Tandy", "Tania", "Tanya", "Tatiana", "Taylor", "Tenanye", "Theode", "Tianna", "Timothea", "Titania", "Tuesday", "Unity", "Utta", "Velma", "Vulpine", "Wasila", "Wesley", "Whitney", "Will", "Willow", "Windy", "Wren", "Wynflaeth", "Wynnfrith", "Xantho", "Zanna", "Zenith", "Zuzana"}, - male_young = {"Acky", "Adney", "Aedy", "Ael", "Ally", "Alderney", "Aldy", "Ald", "Alger", "Alisty", "Alston", "Amhey", "Arch", "Arley", "Arney", "Arthy", "Arundy", "Ascy", "Ashty", "Ather", "Atty", "At", "Audy", "Aud", "Ayl", "Bady", "Banny", "Bardy", "Barly", "Barney", "Bar", "Barry", "Bartley", "Bart", "Bassy", "Baul", "Bavol", "Bax", "Bay", "Beam", "Beasy", "Beav", "Benny", "Berky", "Ber", "Bevy", "Bicky", "Birky", "Birley", "Birney", "Birt", "Blakey", "Blaxy", "Bly", "Bolty", "Booky", "Bosey", "Bowy", "Bradey", "Braden", "Brad", "Bradyn", "Brainy", "Brammy", "Bran", "Branny", "Brant", "Bray", "Brax", "Bren", "Brenny", "Bridgey", "Briggy", "Brinny", "Brish", "Brocky", "Bronny", "Bucky", "Burry", "Bur", "Byr", "Caddy", "Caldy", "Car", "Carny", "Carty", "Ceddy", "Chancey", "Channy", "Chanse", "Charly", "Ches", "Chilty", "Clay", "Cleavy", "Cliffy", "Clifty", "Clint", "Colty", "Cranny", "Cuthy", "Dalty", "Darby", "Darr", "Darthy", "Darry", "Davey", "Dawsey", "Delly", "Denny", "Dev", "Drake", "Dud", "Durry", "Dwenny", "Eddy", "Eggy", "Eldy", "Elty", "Erwy", "Filly", "Franky", "Gally", "Garmy", "Gary", "Ger", "Gory", "Haddy", "Haely", "Hammy", "Hardy", "Hay", "Hazly", "Hearsty", "Heathy", "Holdy", "Housty", "Howy", "Hunty", "Irvy", "Irwy", "Jack", "Jaggy", "Jay", "Jarry", "Jaxy", "Jaydey", "Jeffy", "Johnny", "Jud", "Keaty", "Kelty", "Kelvy", "Kenny", "Kiply", "Kirb", "Kolb", "Landy", "Lanny", "Langy", "Layney", "Ley", "Londy", "Maddy", "Mal", "Manny", "Mar", "Mavey", "Max", "Mel", "Mendy", "Mitchy", "Morey", "Nilly", "Oakey", "Parky", "Pay", "Pearsie", "Peytie", "Presty", "Quenty", "Rady", "Rammy", "Randy", "Ray", "Richy", "Rickey", "Robbie", "Roddy", "Ruddy", "Ry", "Seddy", "Sevy", "Shelty", "Shermy", "Siley", "Siney", "Sommy", "Spaldy", "Spenny", "Sterly", "Stewy", "Stuey", "Tanny", "Tilty", "Trowy", "Ywyfie", "Uey", "Uppy", "Ushy", "Wally", "Ward", "Warry", "Way", "Waylie", "Wes", "Westy", "Whitey", "Willy", "Wittie", "Wolfie", "Woody", "Woolie", "Wy", "Yatey"}, - female_young = {"Abey", "Aelfie", "Aethie", "Ailie", "Aldie", "Alvie", "Amie", "Annie", "Arethie", "Arietie", "Ashie", "Avely", "Avey", "Baley", "Battie", "Beggie", "Bevvie", "Blissie", "Blossy", "Brae", "Breenie", "Bri", "Cadey", "Carlie", "Ceddie", "Ceolie", "Channie", "Cinny", "Corlie", "Cwennie", "Daisy", "Dara", "Dawnnie", "Dellie", "Dennie", "Deorie", "Devvie", "Di", "Doie", "Donnie", "Dulcie", "Eadie", "Ealdie", "Eastie", "Ebbie", "Eddie", "Edevy", "Eggie", "Elfie", "Ellie", "Elmie", "Elvie", "Eolandie", "Eostie", "Erlie", "Ermie", "Ethie", "Evie", "Faerie", "Fay", "Faye", "Firrie", "Flettie", "Forrie", "Garnie", "Gellie", "Gidgie", "Githie", "Godie", "Goldie", "Gullie", "Gunnie", "Gythie", "Hadie", "Harley", "Hazie", "Hellie", "Hilarie", "Hildie", "Hodie", "Hollie", "Hoppie", "Huldie", "Iddie", "Innie", "Ivy", "Jettie", "Jolie", "Jolenie", "Kandie", "Kauanie", "Keatie", "Kelbie", "Kinsey", "Kippie", "Kynnie", "Lailie", "Langie", "Larrie", "Lethie", "Leuedie", "Lillie", "Lindie", "Lorie", "Lorcie", "Lovie", "Luellie", "Lufie", "Maddie", "Maggie", "Marrie", "Mavie", "Mercie", "Merie", "Mildie", "Missie", "Mylie", "Naidie", "Nerrie", "Nissie", "Nixie", "Normie", "Nyxie", "Oddie", "Olethie", "Orlie", "Ossie", "Paytie", "Princess", "Quessie", "Raddie", "Raisie", "Rannie", "Ravie", "Rhianie", "Rhosie", "Rhy", "Rikki", "Rosie", "Roxie", "Sabie", "Saelie", "Sapphie", "Sebie", "Shea", "Shellie", "Siggie", "Sinnie", "Siusie", "Stannie", "Starrie", "Sunnie", "Susie", "Swete", "Tannie", "Tandie", "Tattie", "Tay", "Tennie", "Thie", "Ti", "Timothea", "Titania", "Tuesday", "Unity", "Utta", "Velma", "Vulpine", "Wasila", "Wesley", "Whitney", "Will", "Willow", "Windy", "Wren", "Wynflaeth", "Wynnie", "Xanthie", "Zannie", "Zennie", "Zuzie"}, - male_native = {"Acacitlu", "Achcauhtli", "Ahuiliztli", "Ameo", "Ameone", "Ametane", "Ami", "Amoxtli", "Anaba", "Aquene", "Ashenee", "Astina", "Ayita", "Bena", "Calfuray", "Cayfutray", "Centehua", "Chalchiuitl", "Chava", "Chenoa", "Cherokee", "Cheyanna", "Cheyenne", "Chi", "Chicahua", "Chimala", "Chipahua", "Cholena", "Cihuaton", "Citali", "Citlamina", "Collipal", "Cozamalotl", "Cuicatl", "Curipan", "Cuyen", "Dakota", "Dakota", "Echa", "Eleuia", "Eloxochitl", "Emetaly", "Emona", "Emonah", "Etapali", "Eyota", "Golotina", "Hanata", "Haseya", "Hateya", "Helaku", "Helki", "Heltu", "Heta", "Hialeah", "Hiawatha", "Hola", "Honovi", "Hopi", "Huata", "Iara", "Ichika", "Ichtaca", "Icnoyotl", "Iina", "Ilchahueque", "Ilhuitl", "Inka", "Ipi", "Iracema", "Itotia", "Iuitl", "Ixcatzin", "Iyanke", "Izel", "Izta", "Jacaranda", "Jalana", "Kachina", "Kaliska", "Kamata", "Kamenna", "Kaya", "Kayaweta", "Kayawi", "Kiche", "Kika", "Kimana", "Kimani", "Kiona", "Kiya", "Kolaki", "Kumara", "Kuyani", "Kuyen", "Lakota", "Lefitray", "Leflay", "Leotie", "Litonya", "Llanquipan", "Llanquiray", "Luyu", "Macawi", "Macuilxochitl", "Mahala", "Mahaway", "Maheona", "Mahuitzic", "Malinalxochitl", "Mamani", "Manay", "Manisa", "Manque", "Mati", "Matisa", "Matisoon", "Mawusi", "Mecatl", "Meda", "Meona", "Meztli", "Michante", "Millaray", "Mimala", "Minal", "Minnehaha", "Minowa", "Minya", "Mixcoatl", "Momoztli", "Moneva", "Moyolehuani", "Moztla", "Munay", "Nahuatl", "Nakota", "Nanoka", "Nashota", "Nataani", "Nawaji", "Nelli", "Nenetl", "Neosha", "Netis", "Niabi", "Nichena", "Nituna", "Nochtli", "Nokomis", "Nuna", "Ogin", "Ohtli", "Olathe", "Olowa", "Omba", "Onatah", "Onawa", "Oneida", "Onsi", "Ontario", "Opa", "Orneda", "Osceola", "Osha", "Oya", "Oyama", "Pachama", "Pakuna", "Pala", "Pamoon", "Paniya", "Papan", "Papina", "Pati", "Patli", "Paveena", "Peta", "Petunia", "Peyeche", "Piro", "Pitrel", "Pocahontas", "Qocha", "Quetroman", "Quetza", "Quimey", "Quintruy", "Quintuqueo", "Raxka", "Rayen", "Rewuri", "Sacnite", "Sakuna", "Salali", "Sapata", "Saqui", "Satinka", "Sedna", "Seneca", "Sequoia", "Sequoya", "Sesapa", "Shadia", "Shaianne", "Shanay", "Shasta", "Shenandoa", "Sheyanne", "Shian", "Shiana","Shiann", "Shiko", "Shoteka", "Shy", "Shyanna", "Sihu", "Sikina", "Somoche", "Sora", "Soso", "Tadita", "Taima", "Taipa", "Taki", "Takiya", "Tala", "Taleebin", "Tallula", "Tallulah", "Tamarack", "Tamaya", "Tashina", "Teoxihuitl", "Tepin", "Teuicui", "Tika", "Tiponya", "Tirranna", "Tiwaka", "Tlachinolli", "Tlaco", "Tlacotl", "Tlahutli", "Tlalli", "Tlazohtzin", "Tlexictli", "Toltecatl", "Tonatzin", "Toski", "Totsi", "Tsintah", "Urika", "Utina", "Wakanda", "Wakiya", "Waluta", "Waneta", "Waseya", "Wauna", "Weeko", "Wicaka", "Wiconi", "Winema", "Winona", "Wiyaka","Wynonna", "Wyoming", "Xihuitl", "Xipil", "Xitlali", "Xiuhcoatl", "Xochi", "Xochicotzin", "Xochilt", "Xochitl", "Xochiyotl", "Xoco", "Xocoyotl", "Yachaya", "Yaminta", "Yana", "Yanaba", "Yaotl", "Yaxkin", "Yayauhqui", "Yenene", "Yoki", "Yolihuani", "Yoloxochitl", "Yoltzin", "Yoluta", "Yolyamanitzin", "Yucala", "Zaltana", "Zama", "Zeltzin", "Zihna", "Zintkala", "Zyanya"}, - female_native = {"Achaana", "Adahy", "Aenoh", "Agna-iyanke", "Ahanu", "Ahmik", "Ahusaka", "Akando", "Akecheta", "Akocha", "Akule", "Alam", "Almika", "Alowan", "Anca", "Anoki", "Anpona", "Ansale", "Anunka", "Apalani", "Apenimon", "Apiatan", "Atsa", "Avali", "Awan", "Bedagi", "Biminak", "Bodaway", "Chankoowashtay", "Chash-chunk-a", "Chava", "Chayton", "Cheyenne", "Chimal", "Chirapa", "Ciqala", "Dakota", "Dasan", "Degan", "Delsin", "Demothi", "Dichali", "Diyin", "Dohosan", "Dowan", "Dyami", "Echa", "Echahow", "Eisu", "Elki", "Elsu", "Eme", "Emetal", "Enapay", "Enyeto", "Etu", "Eyota", "Ezhno", "Fochik", "Gomda", "Gosheven", "Hache-hi", "Hakan", "Han", "Handowan", "Hasiin", "Helaku", "Helki", "He-lush-ka", "Hesutu", "Hiamovi", "Hiawatha", "Hinto", "Hinun", "Hokama", "Honon", "Honovi", "Hosa", "Hotah", "Hototo", "Howahkan", "Howi", "Huhuseca-ska", "Hute", "Ichante", "Ichik", "Igasho", "Ikan", "Imasu", "Inteus", "Isekemu", "Istu", "Itan", "Itanale", "Iye", "Iztali", "Jacy", "Jolon", "Kaga", "Kalmanu", "Kanen", "Kangee", "Kele", "Keyan", "Kibbe", "Kiche", "Kijika", "Kika", "Kinan", "Knoton", "Kohana", "Kola", "Kono", "Kosumi", "Kuruk", "Kuyani", "Lakota", "Langundo", "Lanu", "Len", "Lenno", "Lesharo", "Leyati", "Lise", "Liwanu", "Lohan", "Lokni", "Lonan", "Lonato", "Lootah", "Luyu", "Mahaway", "Mahkah", "Mahpee", "Makya", "Manipi", "Maona", "Maone", "Maska", "Masou", "Mato", "Mato-nazin", "Matoskah", "Mazablaska", "Menashen", "Metikla", "Michante", "Mika", "Mikasi", "", "Milap", "Mingen", "Misu", "Mohkave", "Mojag", "Molimo", "Momuso", "Mona", "Motave", "Motega", "Muata", "Muraco", "Nagan", "Nahele", "Nahios-si", "Nahko", "Nahma", "Nairen", "Nakin", "Nakos", "Nakota", "Namid", "Namiid", "Nanose", "Nantan", "Napayshni", "Nashashuk", "Nashoba", "Nataani", "Nawat", "Nawkaw", "Nayati", "Naylay", "Nayra", "Neka", "Neosho", "Nibaw", "Nigan", "Nijuga", "Nikan", "Nikiq", "Nikiti", "Nimakin", "Nitis", "Nodin", "Notaku", "Odakota", "Ogaleesha", "Ogima", "Ohanzee", "Ohitekah", "Olowan", "Onsi", "Otadan", "Otaktay", "Otu", "Ouray", "Oya", "Oyam", "Oyamal", "Oyate", "Pamoon", "Pat", "Patakasu", "Patamon", "Patwin", "Payat", "Paytah", "Pilan", "Pinon", "Quanah", "Raini", "Raxka", "Sahele", "Sakima", "Sakuruta", "Sandiin", "Sewati", "Shanah", "Shanahwane", "Shandiin", "Shepen", "Shotek", "Sikin", "Siwili", "Skah", "Skiriki", "Songan", "Sunkwa", "Tadi", "Taima", "Takoda", "Talli", "Tasunke", "Tatanka", "Tate", "Tawachi", "Teetonka", "Telutci", "Tennesy", "Tika", "Tilmu", "Tokala", "Tooantuh", "Tuari", "Tuketu", "Tukuli", "Tumu", "Tupac", "Tupi", "Tyee", "Uzumati", "Viho", "Vohpe", "Vohpey", "Waban", "Wahchinksapa", "Wahchintonka", "Wahkan", "Wahkoowah", "Wajiwa", "Wakiza", "Waluta", "Wamani", "Wamblee", "Wambleeska", "Wambli-waste", "Wanageeska", "Wanahton", "Wanikiya", "Wapi", "Waseya", "Weayaya", "Wehinahpay", "Wemilat", "Wenutu", "Wicaka", "Wicasa", "Wichado", "Wiconi", "Wilanu", "Wilu", "Wuliton", "Wunand", "Wuyi", "Wynono", "Yahto", "Yochi", "Yoskolo", "Yotimo", "Yuma", "Yutu", "Zebi"}, - male_desert = {"Aadi", "Aarav", "Aarnav", "Aarush", "Aayush", "Abdul", "Abeer", "Abhimanyu", "Abhiramnew", "Aditya", "Advaith", "Advay", "Advik", "Agastya", "Akshay", "Amol", "Anay", "Anirudhnew", "Anmol", "Ansh", "Arin", "Arjun", "Arnav", "Aryan", "Atharv", "Avi", "Ayaan", "Ayush", "Ayushman", "Azaan", "Azad", "Daksh", "Darsh", "Dev", "Dev", "Devansh", "Dhruv", "Farhan", "Gautam", "Harsh", "Harshil", "Hredhaan", "Isaac", "Ishaan", "Jainew", "Jason", "Kabir", "Kalpit", "Karan", "Kiaan", "Krish", "Krishna", "Laksh", "Lakshay", "Manannew", "Mohammed", "Nachiket", "Naksh", "Nakul", "Neel", "Om", "Parth", "Pranav", "Praneel", "Pranit", "Pratyush", "Rachit", "Raghav", "Ranbir", "Ranveer", "Rayaan", "Rehaannew", "Reyansh", "Rishi", "Rohan", "Ronith", "Rudranew", "Rushil", "Ryan", "Sai", "Saksham", "Samaksh", "Samar", "Samarth", "Samesh", "Sarthak", "Sathviknew", "Shaurya", "Shivansh", "Siddharth", "Tejas", "Vedant", "Veer", "Viaannew", "Vihaan", "Viraj", "Vivaan", "Yash", "Yug", "Zayan"}, - female_desert = {"Aadhya", "Aahana", "Aalia", "Aanya", "Aaradhya", "Aarna", "Aarohi", "Aditi", "Advika", "Adweta", "Adya", "Ahana", "Akshara", "Amaira", "Amaya", "Amrita", "Amruta", "Anaisha", "Ananya", "Anaya", "Andrea", "Angel", "Anika", "Anushka", "Anvi", "Anya", "Aria", "Arunima", "Arya", "Avni", "Bhavna", "Daksha", "Dhriti", "Divya", "Diya", "Gauri", "Hiral", "Ira", "Isha", "Ishani", "Ishanvi", "Ishita", "Jasmine", "Jhanvi", "Kashvi", "Kavya", "Khushi", "Kiara", "Krisha", "Krishna", "Kyra", "Lakshmi", "Mahika", "Manya", "Maryam", "Meera", "Megha", "Meghana", "Meher", "Mishka", "Mitali", "Myra", "Naira", "Navya", "Nayantara", "Niharika", "Nisha", "Nitara", "Olivia", "Pari", "Pihu", "Pratyusha", "Prisha", "Rachita", "Raveena", "Ridhi", "Riya", "Saanvi", "Sahana", "Sai", "Saira", "Samaira", "Sarah", "Saumya", "Shanaya", "Shravya", "Shreya", "Siya", "Sneha", "Suhana", "Suhani", "Tanvi", "Trisha", "Vaishnavi", "Vansha", "Vanya", "Vedhika", "Vinaya", "Zara", "Zoya"}, -} - ---[[ - These are all the plot/building types that are available (from mg_villages) that the villagers - can spawn onto. For now, only one villager will spawn on each plot type. - female: inverse probabiliy of a female villager spawning on this plot type - age: the set from which a specific age is randomly chosen for the villager - --- village towntest: castle --- village gambit: cementry, lamp, hotel, pub, horsestable, ---]] -villagers.plots = { - - allmende = { female = 2, age = {"young", "old"} }, - bakery = { female=2, age={"adult", "adult", "old"} }, - bench = { female=2, age={"adult", "old", "old"} }, - chateau = { female=3, age={"adult", "adult", "old"} }, - church = { female=4, age={"adult", "old", "old"} }, - deco = { female=2, age={"young", "adult", "old"} }, - empty = { female=3, age={"adult", "adult", "old"} }, - farm_full = { female=4, age={"adult", "adult", "old"} }, - farm_tiny = { female=3, age={"adult", "adult", "old"} }, - field = { female=4, age={"adult"} }, - forge = { female=4, age={"adult"} }, - fountain = { female=2, age={"young", "adult", "old"} }, - horsestable = { female=3, age={"adult", "adult", "old"} }, - house = { female=2, age={"adult", "adult", "old"} }, - hut = { female=3, age={"adult", "adult", "old"} }, - inn = { female=3, age={"adult", "adult", "old"} }, - library = { female=2, age={"adult", "old", "old"} }, - lumberjack = { female=4, age={"adult"} }, - mill = { female=4, age={"adult"} }, - pasture = { female=2, age={"young", "adult", "old"} }, - pit = { female=4, age={"adult"} }, - sawmill = { female=4, age={"adult"} }, - school = { female=1, age={"young", "young", "adult"} }, - secular = { female=3, age={"adult", "old"} }, - shed = { female=4, age={"adult"} }, - shop = { female=3, age={"adult", "adult", "old"} }, - spawn = { female=2, age={"adult", "adult", "old"} }, - tavern = { female=3, age={"adult"} }, - tent = { female=5, age={"adult"} }, - tower = { female=4, age={"adult"} }, - townhall = { female=4, age={"adult"} }, - trader = { female=3, age={"adult", "adult", "old"} }, - village_square = { female=2, age={"young", "adult", "old"} }, - wagon = { female=4, age={"adult", "adult", "old"} }, - well = { female=2, age={"adult", "adult", "old"} }, - - -- village towntest: castle - castle = { female=4, age={"adult", "adult", "old"} }, - park = { female=2, age={"young", "adult", "old"} }, - - -- village gambit: cementry, lamp, hotel, pub, horsestable, - cementry = { female=2, age={"adult", "old"} }, - lamp = { female=2, age={"young", "adult", "old"} }, - hotel = { female=4, age={"adult", "adult", "old"} }, - pub = { female=3, age={"adult", "adult", "old"} }, - stable = { female=2, age={"adult"} } -} - ---[[ REGIONS: - cold - cold/snow villagers, light skinned, full covered and dark colored clothing, boots, and some wear jackets - hot - desert villagers, light skinned, shorts and skins, light colored clothing, sandals - normal - in between cold and hot, light skinned, combination of both cold and hot styles of clothing - native - native/indian tribes, tanned skin, some males shirtless, sandals - desert - desert dwelling tribes, dark skin, some males wear dresses, full covered and light colored clothing, sandals ---]] - - -local TEXTURES = { - - ----------------------------------- - -- BASE BODY STRUCTURE - ----------------------------------- - - -- base 'naked' body skin. - body = { - hot = { "body_medium_01.png" }, - cold = { "body_light_01.png" }, - normal = { "body_medium_01.png" }, - native = { "body_tan_01.png" }, - desert = { "body_dark_01.png" } - }, - - -- vertical size of the whites of eyes, which later also determines the iris size - eyes = { - male = { - young = { "eyes_whites_med.png" }, - adult = { "eyes_whites_sm.png", "eyes_whites_med.png" }, - old = { "eyes_whites_sm.png", "eyes_whites_med.png" } - }, - - female = { - young = { "eyes_whites_med.png", "eyes_whites_med2.png", "eyes_whites_med2.png" }, -- more lashes - adult = { "eyes_whites_med.png", "eyes_whites_med2.png" }, -- 50%/50% - old = { "eyes_whites_med.png", "eyes_whites_med.png", "eyes_whites_med2.png" }, -- less lashes - } - }, - - -- mouth 4 and 5 are slightly grinning, 1 - 3 are variations of horizontal lines - mouth = { - male = { - young = { - "mouth_01.png", "mouth_02.png", "mouth_03.png", "mouth_04.png", "mouth_05.png", - "mouth_04.png", "mouth_05.png", -- <-- more chance of smiling - }, - adult = { - "mouth_01.png", "mouth_02.png", "mouth_03.png", "mouth_04.png", "mouth_05.png", - "mouth_01.png", "mouth_02.png", "mouth_03.png" -- <-- more chance of neutral mouth - }, - old = { "mouth_01.png", "mouth_02.png", "mouth_03.png", "mouth_04.png", "mouth_05.png" } - }, - - female = { - young = { - "mouth_01.png", "mouth_02.png", "mouth_03.png", "mouth_04.png", "mouth_05.png", - "mouth_04.png", "mouth_05.png", -- <-- more chance of smiling - }, - adult = { "mouth_01.png", "mouth_02.png", "mouth_03.png", "mouth_04.png", "mouth_05.png" }, - old = { "mouth_01.png", "mouth_02.png", "mouth_03.png", "mouth_04.png", "mouth_05.png" } - } - }, - - hair = { - male = { - young = { - "hair_male_02.png", "hair_male_03.png", "hair_male_04.png", "hair_male_05.png", "hair_male_06.png", - "hair_male_07.png", "hair_male_08.png", "hair_male_09.png", "hair_male_11.png", "hair_male_13.png", - "hair_male_14.png", "hair_male_18.png", "hair_male_20.png", "hair_male_21.png", "hair_male_22.png" - }, - adult = { - "hair_male_02.png", "hair_male_03.png", "hair_male_04.png", "hair_male_05.png", "hair_male_06.png", - "hair_male_07.png", "hair_male_08.png", "hair_male_09.png", "hair_male_11.png", "hair_male_13.png", - "hair_male_14.png", "hair_male_18.png", "hair_male_20.png", "hair_male_21.png", "hair_male_22.png" - }, - old = { - "hair_male_old_01.png", "hair_male_old_02.png", "hair_male_old_03.png", "hair_male_old_04.png", - "hair_male_old_05.png", "hair_male_old_06.png" - } - - }, - female = { - young = { - "hair_female_00.png", "hair_female_02.png", "hair_female_03.png", "hair_female_04.png", "hair_female_05.png", - "hair_female_06.png", "hair_female_07.png", "hair_female_08.png", "hair_female_09.png", "hair_female_10.png", - "hair_female_11.png", "hair_female_12.png", "hair_female_13.png", "hair_female_14.png", "hair_female_15.png", - "hair_female_16.png", "hair_female_17.png", "hair_female_18.png", "hair_female_20.png", "hair_female_21.png", - "hair_female_22.png", "hair_female_23.png", "hair_female_27.png", "hair_female_28.png", "hair_female_28.png", - "hair_female_29.png", "hair_female_30.png", "hair_female_31.png", "hair_female_32.png" - }, - adult = { - "hair_female_00.png", "hair_female_02.png", "hair_female_03.png", "hair_female_04.png", "hair_female_05.png", - "hair_female_06.png", "hair_female_07.png", "hair_female_08.png", "hair_female_09.png", "hair_female_10.png", - "hair_female_11.png", "hair_female_12.png", "hair_female_13.png", "hair_female_14.png", "hair_female_15.png", - "hair_female_16.png", "hair_female_17.png", "hair_female_18.png", "hair_female_20.png", "hair_female_21.png", - "hair_female_22.png", "hair_female_23.png", "hair_female_27.png", "hair_female_28.png", "hair_female_28.png", - "hair_female_29.png", "hair_female_30.png", "hair_female_31.png", "hair_female_32.png" - - }, - old = { - "hair_female_old_01.png", "hair_female_old_02.png", "hair_female_old_03.png", "hair_female_old_04.png", - "hair_female_old_05.png", "hair_female_old_06.png" - } - } - }, - - - ----------------------------------- - -- CLOTHING & ACCESSORIES - ----------------------------------- - - -- Short and long sleeved full dresses - -- texture of 'blank.png' means this type of villager will either not or have a chance of - -- not wearing a full dress, thus this dress section will be skipped and villager will - -- instead apply 'lower' and 'upper' clothing. - dress = { - hot = { - male = { - young = { "blank.png" }, - adult = { "blank.png" }, - old = { "blank.png" } - }, - female = { - young = { "blank.png" }, - adult = { "blank.png" }, - old = { "blank.png" } - }, - }, - cold = { - male = { - young = { "blank.png" }, - adult = { "blank.png" }, - old = { "blank.png" } - }, - female = { - young = { "dress_longsleeves_dark_01.png" }, - adult = { "dress_longsleeves_dark_01.png" }, - old = { "dress_longsleeves_dark_01.png" } - }, - }, - normal = { - male = { - young = { "blank.png" }, - adult = { "blank.png" }, - old = { "blank.png" } - }, - female = { - young = { "dress_shortsleeves_med2_01.png", "dress_longsleeves_med2_01.png" }, - adult = { "dress_shortsleeves_med2_01.png", "dress_longsleeves_med2_01.png" }, - old = { "dress_shortsleeves_med2_01.png", "dress_longsleeves_med2_01.png" } - }, - }, - native = { - male = { - young = { "blank.png" }, - adult = { "blank.png" }, - old = { "blank.png" } - }, - female = { - young = { "dress_shortsleeves_dark_01.png", "dress_longsleeves_dark_01.png" }, - adult = { "dress_shortsleeves_dark_01.png", "dress_longsleeves_dark_01.png" }, - old = { "dress_shortsleeves_dark_01.png", "dress_longsleeves_dark_01.png" } - }, - }, - desert = { - male = { - young = { "dress_longsleeves_med_02.png", "dress_longsleeves_med_02.png", "blank.png" }, - adult = { "dress_longsleeves_med_02.png", "dress_longsleeves_med_02.png", "blank.png" }, - old = { "dress_longsleeves_med_02.png" } - }, - female = { - young = { "dress_longsleeves_med_01.png", "dress_longsleeves_med_01.png", "blank.png" }, - adult = { "dress_longsleeves_med_01.png", "dress_longsleeves_med_01.png", "blank.png" }, - old = { "dress_longsleeves_med_01.png" } - }, - } - }, - - -- Lower Body Clothing (pants, shorts, skirts, etc) - lower = { - hot = { - male = { - young = { -- 67% chance shorts, otherwise pants - "shorts_dark_01.png", "shorts_dark_02.png", - "shorts_dark_01.png", "shorts_dark_02.png", - "pants_dark_01.png", "pants_dark_02.png" - }, - adult = { -- 67% chance shorts, otherwise pants - "shorts_dark_01.png", "shorts_dark_02.png", - "shorts_dark_01.png", "shorts_dark_02.png", - "pants_dark_01.png", "pants_dark_02.png" - }, - old = { -- 67% chance shorts, otherwise pants - "shorts_dark_01.png", "shorts_dark_02.png", - "shorts_dark_01.png", "shorts_dark_02.png", - "pants_dark_01.png", "pants_dark_02.png" - } - }, - female = { - young = { -- 66% chance short skirts, otherwise shorts - "skirt_short_dark_01.png", "skirt_short_dark_01.png", - "skirt_short_dark_01.png", "skirt_short_dark_01.png", - "shorts_dark_01.png", "shorts_dark_02.png" - }, - adult = { -- 80% chance short skirts or shorts, otherwise long skirt - "skirt_short_dark_01.png", "skirt_short_dark_01.png", - "skirt_short_dark_01.png", "skirt_short_dark_01.png", - "skirt_short_dark_01.png", "shorts_dark_01.png", - "shorts_dark_01.png", "shorts_dark_02.png" - }, - old = { -- 50% chance shorts, otherwise long skirt - "shorts_dark_01.png", "shorts_dark_02.png", - "skirt_long_dark_01.png", "skirt_long_dark_01.png" - } - } - }, - cold = { - male = { -- 100% chance for dark colored pants - young = { "pants_dark_01.png", "pants_dark_02.png" }, - adult = { "pants_dark_01.png", "pants_dark_02.png" }, - old = { "pants_dark_01.png", "pants_dark_02.png" } - }, - female = { - young = { -- 66% long skirt, otherwise pants - "skirt_long_dark_01.png", "skirt_long_dark_01.png", - "skirt_long_dark_01.png", "skirt_long_dark_01.png", - "pants_01.png", "pants_02.png" - }, - adult = { -- 66% long skirt, otherwise pants - "skirt_long_dark_01.png", "skirt_long_dark_01.png", - "skirt_long_dark_01.png", "skirt_long_dark_01.png", - "pants_01.png", "pants_02.png" - }, - old = { -- 66% long skirt, otherwise pants - "skirt_long_dark_01.png", "skirt_long_dark_01.png", - "skirt_long_dark_01.png", "skirt_long_dark_01.png", - "pants_01.png", "pants_02.png" - } - } - }, - normal = { - male = {-- 100% chance for pants - young = { "pants_dark_01.png", "pants_dark_02.png" }, - adult = { "pants_dark_01.png", "pants_dark_02.png" }, - old = { "pants_dark_01.png", "pants_dark_02.png" } - }, - female = { - young = { -- 66% long skirt, otherwise short skirt - "skirt_long_dark_01.png", "skirt_long_dark_01.png", - "skirt_long_dark_01.png", "skirt_long_dark_01.png", - "skirt_short_dark_01.png", "skirt_short_dark_01.png" - }, - adult = { -- 80% skirts, otherwise pants - "skirt_long_dark_01.png", "skirt_long_dark_01.png", - "skirt_long_dark_01.png", "skirt_long_dark_01.png", - "skirt_long_dark_01.png", "skirt_short_dark_01.png", - "skirt_short_dark_01.png", "skirt_short_dark_01.png", - "pants_dark_01.png", "pants_dark_02.png" - }, - old = { -- 66% long skirt, otherwise pants - "skirt_long_dark_01.png", "skirt_long_dark_01.png", - "skirt_long_dark_01.png", "skirt_long_dark_01.png", - "pants_dark_01.png", "pants_dark_02.png" - } - } - }, - native = { - male = { - young = { -- 66% chance pants or shorts, otherwise skirts - "pants_dark_01.png", "pants_dark_02.png", - "shorts_dark_01.png", "shorts_dark_02.png", - "skirt_long_dark_01.png", "skirt_short_dark_01.png" - }, - adult = { -- 66% chance pants or shorts, otherwise skirts - "pants_dark_01.png", "pants_dark_02.png", - "shorts_dark_01.png", "shorts_dark_02.png", - "skirt_long_dark_01.png", "skirt_short_dark_01.png" - }, - old = { -- 66% chance pants or shorts, otherwise skirts - "pants_dark_01.png", "pants_dark_02.png", - "shorts_dark_01.png", "shorts_dark_02.png", - "skirt_long_dark_01.png", "skirt_short_dark_01.png" - } - }, - female = { - young = { -- 50% long skirts, otherwise short skirts - "skirt_long_dark_01.png", "skirt_short_dark_01.png" - }, - adult = { -- 50% long skirts, otherwise short skirts - "skirt_long_dark_01.png", "skirt_short_dark_01.png" - }, - old = { -- 100% long skirt - "skirt_long_dark_01.png" - } - } - }, - desert = { - male = { -- 100% chance pants - young = { "pants_med_01.png", "pants_med_02.png" }, - adult = { "pants_med_01.png", "pants_med_02.png" }, - old = { "pants_med_01.png", "pants_med_02.png" } - }, - female = { -- 100% long skirts - young = { "skirt_long_med_01.png" }, - adult = { "skirt_long_med_01.png" }, - old = { "skirt_long_med_01.png" } - } - } - }, - - -- Upper Body Clothing (long, short and no sleeved shirts) - upper = { - hot = { - male = { - young = { - "shirt_tanktop_med_00.png", "shirt_tanktop_med_01.png", "shirt_tanktop_med_02.png", - "shirt_tanktop_med_03.png", "shirt_tanktop_med_04.png", "shirt_tanktop_med_05.png", - "shirt_nosleeve_med_01.png", "shirt_nosleeve_med_02.png", "shirt_nosleeve_med_03.png", - "shirt_nosleeve_med_04.png", "shirt_nosleeve_med_05.png", "blank.png", - "blank.png", "blank.png", "blank.png", "blank.png" -- <-- 31% chance of wearing no shirt - }, - adult = { - "shirt_tanktop_med_00.png", "shirt_tanktop_med_01.png", "shirt_tanktop_med_02.png", - "shirt_tanktop_med_03.png", "shirt_tanktop_med_04.png", "shirt_tanktop_med_05.png", - "shirt_nosleeve_med_01.png", "shirt_nosleeve_med_02.png", "shirt_nosleeve_med_03.png", - "shirt_nosleeve_med_04.png", "shirt_nosleeve_med_05.png", - "blank.png", "blank.png", "blank.png", -- <-- 21% chance of wearing no shirt at all - }, - old = { - "shirt_tanktop_med_00.png", "shirt_tanktop_med_01.png", "shirt_tanktop_med_02.png", - "shirt_tanktop_med_03.png", "shirt_tanktop_med_04.png", "shirt_tanktop_med_05.png", - "shirt_nosleeve_med_01.png", "shirt_nosleeve_med_02.png", "shirt_nosleeve_med_03.png", - "shirt_nosleeve_med_04.png", "shirt_nosleeve_med_05.png" - } - }, - female = { - young = { - "shirt_tanktop_med_00.png", "shirt_tanktop_med_01.png", "shirt_tanktop_med_02.png", - "shirt_tanktop_med_03.png", "shirt_tanktop_med_04.png", "shirt_tanktop_med_05.png", - "shirt_short_med_female_01.png", "shirt_short_med_female_01.png", "shirt_short_med_female_01.png", - }, - adult = { - "shirt_tanktop_med_00.png", "shirt_tanktop_med_01.png", "shirt_tanktop_med_02.png", - "shirt_tanktop_med_03.png", "shirt_tanktop_med_04.png", "shirt_tanktop_med_05.png", - "shirt_short_med_female_01.png", "shirt_short_med_female_01.png", "shirt_short_med_female_01.png", - }, - old = { - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", - "shirt_short_med_female_01.png", "shirt_short_med_female_01.png", - "shirt_short_med_female_01.png", "shirt_short_med_female_01.png", - "shirt_short_med_female_01.png" - } - } - }, - cold = { - male = { - young = { - "shirt_long_dark_01.png", "shirt_long_dark_02.png", "shirt_long_dark_03.png", - "shirt_long_dark_04.png", "shirt_long_dark_05.png" - }, - adult = { - "shirt_long_dark_01.png", "shirt_long_dark_02.png", "shirt_long_dark_03.png", - "shirt_long_dark_04.png", "shirt_long_dark_05.png" - }, - old = { - "shirt_long_dark_01.png", "shirt_long_dark_02.png", "shirt_long_dark_03.png", - "shirt_long_dark_04.png", "shirt_long_dark_05.png" - } - }, - female = { - young = { - "shirt_long_dark_01.png", "shirt_long_dark_02.png", "shirt_long_dark_03.png", - "shirt_long_dark_04.png", "shirt_long_dark_05.png", "shirt_long_dark_female_01.png", - "shirt_long_dark_female_01.png", "shirt_long_dark_female_01.png" - }, - adult = { - "shirt_long_dark_01.png", "shirt_long_dark_02.png", "shirt_long_dark_03.png", - "shirt_long_dark_04.png", "shirt_long_dark_05.png", "shirt_long_dark_female_01.png", - "shirt_long_dark_female_01.png", "shirt_long_dark_female_01.png" - }, - old = { - "shirt_long_dark_01.png", "shirt_long_dark_02.png", "shirt_long_dark_03.png", - "shirt_long_dark_04.png", "shirt_long_dark_05.png", "shirt_long_dark_female_01.png", - "shirt_long_dark_female_01.png", "shirt_long_dark_female_01.png" - } - } - }, - normal = { - male = { - young = { -- 75% chance short sleeved shirt, otherwise long sleeved - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", - "shirt_long_med_01.png", "shirt_long_med_02.png", "shirt_long_med_03.png", - "shirt_long_med_04.png", "shirt_long_med_05.png" - }, - adult = { -- 75% chance short sleeved shirt, otherwise long sleeved - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", - "shirt_long_med_01.png", "shirt_long_med_02.png", "shirt_long_med_03.png", - "shirt_long_med_04.png", "shirt_long_med_05.png" - }, - old = { -- 67% chance short sleeved shirt, otherwise long sleeved - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", - "shirt_long_med_01.png", "shirt_long_med_02.png", "shirt_long_med_03.png", - "shirt_long_med_04.png", "shirt_long_med_05.png" - } - }, - female = { - young = { - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", "shirt_short_med_female_01.png", - "shirt_short_med_female_01.png", "shirt_short_med_female_01.png" - }, - adult = { - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", "shirt_short_med_female_01.png", - "shirt_short_med_female_01.png", "shirt_short_med_female_01.png" - }, - old = { - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", "shirt_short_med_female_01.png", - "shirt_short_med_female_01.png", "shirt_short_med_female_01.png" - } - } - }, - native = { - male = { - young = { -- 69% chance not wearing any shirt at all - "shirt_tanktop_med_00.png", "shirt_tanktop_med_01.png", "shirt_tanktop_med_02.png", - "shirt_tanktop_med_03.png", "shirt_tanktop_med_04.png", "shirt_tanktop_med_05.png", - "shirt_nosleeve_med_01.png", "shirt_nosleeve_med_02.png", "shirt_nosleeve_med_03.png", - "shirt_nosleeve_med_04.png", "shirt_nosleeve_med_05.png", "blank.png", - "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", - "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", - "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", - "blank.png", "blank.png", "blank.png" - - }, - adult = { -- 56% chance not wearing any shirt at all - "shirt_tanktop_med_00.png", "shirt_tanktop_med_01.png", "shirt_tanktop_med_02.png", - "shirt_tanktop_med_03.png", "shirt_tanktop_med_04.png", "shirt_tanktop_med_05.png", - "shirt_nosleeve_med_01.png", "shirt_nosleeve_med_02.png", "shirt_nosleeve_med_03.png", - "shirt_nosleeve_med_04.png", "shirt_nosleeve_med_05.png", - "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", - "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", "blank.png" - }, - old = { -- 39% chance not wearing any shirt at all - "shirt_tanktop_med_00.png", "shirt_tanktop_med_01.png", "shirt_tanktop_med_02.png", - "shirt_tanktop_med_03.png", "shirt_tanktop_med_04.png", "shirt_tanktop_med_05.png", - "shirt_nosleeve_med_01.png", "shirt_nosleeve_med_02.png", "shirt_nosleeve_med_03.png", - "shirt_nosleeve_med_04.png", "shirt_nosleeve_med_05.png", - "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", "blank.png", - } - }, - female = { - young = { - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", "shirt_short_med_female_01.png", - "shirt_short_med_female_01.png", "shirt_short_med_female_01.png", - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", "shirt_short_med_female_01.png", - "shirt_short_med_female_01.png", "shirt_short_med_female_01.png", - }, - adult = { - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", "shirt_short_med_female_01.png", - "shirt_short_med_female_01.png", "shirt_short_med_female_01.png", - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", "shirt_short_med_female_01.png", - "shirt_short_med_female_01.png", "shirt_short_med_female_01.png", - }, - old = { - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", "shirt_short_med_female_01.png", - "shirt_short_med_female_01.png", "shirt_short_med_female_01.png", - "shirt_short_med_01.png", "shirt_short_med_02.png", "shirt_short_med_03.png", - "shirt_short_med_04.png", "shirt_short_med_05.png", "shirt_short_med_female_01.png", - "shirt_short_med_female_01.png", "shirt_short_med_female_01.png", - } - } - }, - desert = { - male = { - young = { - "shirt_long_med_01.png", "shirt_long_med_02.png", "shirt_long_med_03.png", - "shirt_long_med_04.png", "shirt_long_med_05.png" - }, - adult = { - "shirt_long_med_01.png", "shirt_long_med_02.png", "shirt_long_med_03.png", - "shirt_long_med_04.png", "shirt_long_med_05.png" - }, - old = { - "shirt_long_med_01.png", "shirt_long_med_02.png", "shirt_long_med_03.png", - "shirt_long_med_04.png", "shirt_long_med_05.png" - } - }, - female = { - young = { - "shirt_long_med_01.png", "shirt_long_med_02.png", "shirt_long_med_03.png", - "shirt_long_med_04.png", "shirt_long_med_05.png", "shirt_long_med_female_01.png", - "shirt_long_med_female_01.png", "shirt_long_med_female_01.png" - }, - adult = { - "shirt_long_med_01.png", "shirt_long_med_02.png", "shirt_long_med_03.png", - "shirt_long_med_04.png", "shirt_long_med_05.png", "shirt_long_med_female_01.png", - "shirt_long_med_female_01.png", "shirt_long_med_female_01.png" - }, - old = { - "shirt_long_med_01.png", "shirt_long_med_02.png", "shirt_long_med_03.png", - "shirt_long_med_04.png", "shirt_long_med_05.png", "shirt_long_med_female_01.png", - "shirt_long_med_female_01.png", "shirt_long_med_female_01.png" - } - } - } - }, - - -- Sandals, shoes and boots - footwear = { - hot = { "sandals_01.png", "sandals_02.png" }, - cold = { "boots_dark_01.png", "boots_dark_01.png", "boots_dark_01.png", "boots_dark_01.png", "shoes_01.png", "shoes_02.png" }, - normal = { "shoes_01.png", "shoes_02.png", "boots_dark_01.png", "sandals_01.png", "sandals_02.png" }, - native = { "sandals_01.png", "sandals_02.png" }, - desert = { "sandals_01.png", "sandals_02.png" } - }, - - -- Jackets - jacket = { - hot = { "blank.png" }, - cold = { "jacket_01.png", "blank.png" }, -- 50% chance to wear jacket - normal = { "jacket_01.png", "blank.png", "blank.png", "blank.png" }, -- 25% chance to wear jacket - native = { "blank.png" }, - desert = { "blank.png" } - }, - - -- base outfits of a certain theme that cannot be randomly pieced together - outfit = { - church = { -- more variations planned - male = { "priest_01.png" }, - female = { "priest_01.png" } - } - }, - - extra_layer = { - empty = { - male = { - "strap_01.png", "strap_02.png", "strap_03.png", - "strap_04.png", "strap_05.png", "strap_06.png" - }, - female = { - "strap_01.png", "strap_02.png", "strap_03.png", - "strap_04.png", "strap_05.png", "strap_06.png" - } - }, - tower = { - male = { - "armor_01.png", "armor_01b.png", "armor_01c.png", "armor_02.png", - "armor_02b.png", "armor_02c.png", "armor_03.png", "armor_03b.png", - "armor_03c.png" - }, - female = { - "armor_fem_01.png", "armor_fem_01b.png", "armor_fem_01c.png", - "armor_fem_01.png", "armor_fem_01b.png", "armor_fem_01c.png", - "armor_01.png", "armor_01b.png", "armor_01c.png" - } - } - }, - - extra_head = { - tower = { - male = { "helmet_01.png", "helmet_02.png" }, - female = { "blank.png" } - }, - }, - - -- white collar for priests and other accessories (coming soon) - extra_neck = { - church = { - male = { "collar_01.png" }, - female = { "blank.png" } - } - }, - - -- accessories worn in front - extra_front = { - church = { - male = { "cross_01.png", "cross_01b.png", "cross_01c.png" }, - -- male = { "sash_01.png", "sash_01b.png", "sash_02.png", "sash_02b.png" }, - female = { "cross_01.png", "cross_01b.png", "cross_01c.png" } - } - }, - - extra_back = { - tower = { "sword_01.png", "sword_02.png", "sword_03.png", "sword_04.png" }, - empty = { - "backpack_01.png", "backpack_02.png", "backpack_03.png", - "backpack_04.png", "backpack_05.png", "backpack_06.png" - } - }, - - extra_face = { - male = { - young = { "blank.png" }, - adult = { "blank.png" }, - old = { "eye_glasses_01.png", "blank.png" } - }, - female = { - young = { "blank.png" }, - adult = { "blank.png" }, - old = { "eye_glasses_01.png", "blank.png" } - } - } - -} - -local COLORS = { - - body = { - hot = { "#eb9678:128", "#ebaa78:128","#ebc178:128" }, -- pinkish, peach-ish, yellow-ish - cold = { "#eb9678:64", "#ffd2af:64","#ffd091:64" }, -- pinkish, peach-ish, yellow-ish but more pale - normal = { "#eb9678:128", "#ebaa78:128","#ebc178:128" }, -- pinkish, peach-ish, yellow-ish - native = { "#800000:128", "#c02000:128","#c04000:128" }, -- dark red, reddish brown, brown tan - desert = { "#804000:128", "#5f2705:128","#46280c:128" }, -- brown, dark reddish brown, dark brown - }, - - hair = { - - hot = { -- brown, dark brown, black - young = { "#000000:128^[colorize:#804000:128", "#000000:192^[colorize:#804000:64", "#000000:192" }, - adult = { "#000000:128^[colorize:#804000:128", "#000000:192^[colorize:#804000:64", "#000000:192" }, - old = { "#000000:64^[colorize:#804000:64", "#000000:64" }, - }, - cold = { -- blonde, orange, brown - young = { "#fff000:128", "#000000:128^[colorize:#ff4900:128", "#000000:128^[colorize:#804000:128" }, - adult = { "#fff000:128", "#000000:128^[colorize:#ff4900:128", "#000000:128^[colorize:#804000:128" }, - old = { "#fff000:64", "#ff4900:64", "#804000:64" }, - }, - normal = { - young = { - "#fff000:128", "#000000:128^[colorize:#ff4900:128", "#000000:128^[colorize:#804000:128", -- blonde, orange, brown - "#000000:192^[colorize:#804000:64", "#000000:192" -- dark brown, black - }, - adult = { - "#fff000:128", "#000000:128^[colorize:#ff4900:128", "#000000:128^[colorize:#804000:128", -- blonde, orange, brown - "#000000:192^[colorize:#804000:64", "#000000:192" -- dark brown, black - }, - old = { - "#fff000:64", "#ff4900:64", "#804000:64", -- graying blonde, orange, brown - "#000000:64^[colorize:#804000:64", "#000000:64" -- graying dark brown and black - }, - }, - native = { - young = { "#000000:192^[colorize:#804000:64", "#000000:192" }, -- dark brown and black - adult = { "#000000:192^[colorize:#804000:64", "#000000:192" }, -- dark brown and black - old = { "#000000:64^[colorize:#804000:64", "#000000:64" } -- graying dark brown and black - }, - desert = { - young = { "#000000:192" }, -- black - adult = { "#000000:192" }, -- black - old = { "#000000:64" }, -- graying black - } - }, - - eyes = { - hot = { "#000000:256", "#402000:256", "#402000:256" }, -- black and brown - cold = { "#402000:256", "#000055:256", "#000055:256", "#005500:256" }, -- brown, blue, green - normal = { "#000000:256", "#402000:256", "#402000:256", "#000055:256", "#005500:256" }, -- black, brown, blue, green - native = { "#000000:256" }, -- black - desert = { "#000000:256" } -- black - }, - - footwear = { -- 75% for brown, dark reddish brown, dark brown - "#804000:128", "#5f2705:128","#46280c:128", - "#804000:128", "#5f2705:128","#46280c:128", - "#804000:128", "#5f2705:128","#46280c:128", - "#5c0000:128", "#004000:128" -- dark red and dark green - }, - - dress = { -- only desert regions do males wear dress, so other regions have 'blank' colorization layer - - hot = { - male = { "#000000:0" }, - female = { "#000000:0" } - }, - cold = { - male = { "#000000:0" }, - -- dark brown, light brown, dark red, dark green, dark purple - female = { "#46280c:128", "#804000:128", "#800000:128", "#004000:128", "#400040:128" } - }, - normal = { - male = { "#000000:0" }, - -- brown, red, green, blue, yellow, purple - female = { "#402000:128", "#c00000:128","#005c00:128","#000080:128","#c0c000:128","#800080:128", } - }, - native = { - male = { "#000000:0" }, - -- dark brown, light brown, dark red, dark green, dark purple - female = { "#46280c:128", "#804000:128", "#800000:128", "#004000:128", "#400040:128" } - }, - desert = { -- light tan colors: brown, tan, yellow, and white - male = { "#3d1500:128", "#804000:128", "#c8a53a:128", "#ffffff:128" }, - female = { - "#3d1500:128", "#804000:128", "#c8a53a:128", "#ffffff:128", - "#5c0000:128", "#5c0000:128" -- off reddish hue - } - } - - }, - - lower = { - hot = { - male = { "#5f2705:128", "#ff8040:128", "#ffb579:64" }, -- darkest brown, dark brown, light brown - -- brown, tan, light brown, red, green, purple - female = { "#804000:128", "#ff8040:128", "#ffb57a:128", "#800000:128", "#004000:128", "#400040:128" } - }, - cold = { - male = { "#000000:0", "#46280c:128", "#5f2705:128" }, -- Black, darkest brown, dark brown - -- dark brown, brown, red, green, purple - female = {"#46280c:128", "#804000:128", "#800000:128", "#004000:128", "#400040:128" } - }, - normal = { - male = { "#46280c:128", "#5f2705:128", "#ff8040:128" }, -- darkest brown, dark brown, light brown - female = { - "#46280c:128", "#5f2705:128", "#ff8040:128", -- darkest brown, dark brown, light brown - "#46280c:128", "#804000:128", "#800000:128", "#004000:128", "#400040:128" - -- dark brown, light brown, dark red, dark green, dark purple - } - }, - native = { - -- dark brown, light brown, dark red, dark green, dark purple - male = { "#46280c:128", "#804000:128", "#800000:128", "#004000:128", "#400040:128" }, - -- dark brown, light brown, dark red, dark green, dark purple - female = { "#46280c:128", "#804000:128", "#800000:128", "#004000:128", "#400040:128" } - }, - desert = { - -- light tan colors: reddish, brown, yellow, and white - male = { "#3d1500:128", "#804000:128", "#c8a53a:128", "#ffffff:128" }, - female = { - -- light tan colors: reddish, brown, yellow, and white - "#3d1500:128", "#804000:128", "#c8a53a:128", "#ffffff:128", - "#5c0000:128", "#5c0000:128" -- off reddish hue - } - } - }, - - upper = { - hot = { - male = { -- light tan colors: reddish, brown, yellow, and white - "#3d1500:128", "#804000:128", "#c8a53a:128", "#ffffff:128" - }, - female = { -- light tan colors: reddish, brown, yellow, and white - "#3d1500:128", "#804000:128", "#c8a53a:128", "#ffffff:128", - "#5c0000:128", "#5c0000:128" -- off reddish hue - }, - }, - cold = { - male = { "#46280c:128", "#5f2705:128", "#ff8040:128" }, -- darkest brown, dark brown, light brown - -- dark brown, brown, red, green, purple - female = {"#46280c:128", "#804000:128", "#800000:128", "#004000:128", "#400040:128" } - }, - normal = { - male = { - -- light tan colors: reddish, brown, yellow, and white - "#3d1500:128", "#804000:128", "#c8a53a:128", "#ffffff:128", - "#5c0000:128", "#5c0000:128" -- off reddish hue - }, -- darkest brown, dark brown, light brown - female = { - -- light tan colors: reddish, brown, yellow, and white - "#3d1500:128", "#804000:128", "#c8a53a:128", "#ffffff:128", - "#5c0000:128", "#5c0000:128", -- off reddish hue - "#402000:128", "#c00000:128","#005c00:128","#000080:128","#c0c000:128","#800080:128" - -- brown, red, green, blue, yellow, purple - } - }, - native = { - male = { -- light tan colors: brown, tan, yellow, and white - "#3d1500:128", "#804000:128", "#c8a53a:128", "#ffffff:128", - "#5c0000:128" -- off reddish hue - }, - female = { -- light tan colors: brown, tan, yellow, and white - - "#3d1500:128", "#804000:128", "#c8a53a:128", "#ffffff:128", - "#5c0000:128", "#5c0000:128" -- off reddish hue - } - }, - desert = { - -- light tan colors: reddish, brown, yellow, and white - male = { "#3d1500:128", "#804000:128", "#c8a53a:128", "#ffffff:128" }, - female = { - -- light tan colors: reddish, brown, yellow, and white - "#3d1500:128", "#804000:128", "#c8a53a:128", "#ffffff:128", - "#5c0000:128", "#5c0000:128" -- off reddish hue - } - } - }, - - jackets = { "#804000:64", "#402000:64", "#201000:64", "#000000:64" }, - -} - - --- villager entity's visual size based on age -local VISUAL_SIZES = { - male = { - young = {0.50, 0.65, 0.80}, - adult = {0.90, 1.05, 1.20}, - old = {0.90, 0.95, 1.00} - }, - female = { - young = {0.50, 0.60, 0.70}, - adult = {0.90, 0.95, 1.00}, - old = {0.80, 0.85, 0.90} - } -} - - -local function setRegionType(pos) - - local curr_pos - local node_names = {} - local radius_limit = 10 - - -- save the names of nodes originating from pos and out - -- in 8 directions and stopping at radium_limit - for dir_index = 1, #villagers.DIRECTIONS do - local direction = villagers.DIRECTIONS[dir_index] - curr_pos = {x=pos.x, y=pos.y, z=pos.z} - for rad_index = 1, radius_limit do - curr_pos.x = curr_pos.x + (villagers.NODE_AREA[direction][1] * rad_index) - curr_pos.z = curr_pos.z + (villagers.NODE_AREA[direction][2] * rad_index) - table.insert(node_names, minetest.get_node(curr_pos).name) - end - end - - local sorted_nodes = {} - table.insert(sorted_nodes, table.remove(node_names)) - for i = 1, #node_names do - - end - -end - - -function villagers.getVillagerName(gender, region) - local name - if region then - local subgroup = gender.."_"..region - local random_index = math.random(#NAMES[subgroup]) - name = NAMES[subgroup][random_index] - else - local random_index = math.random(#NAMES[gender]) - name = NAMES[gender][random_index] - end - return name -end - --- main function that randomly generates villager size and appearance -function villagers.getVillagerAppearance(building_type, region, gender, age) - - local final_texture - local textures - local colors - - -- base body texture - textures = TEXTURES.body[region] - local body_texture = textures[math.random(#textures)] - colors = COLORS.body[region] - local body_color = colors[math.random(#colors)] - final_texture = "("..body_texture.."^[colorize:"..body_color..")^" - - -- apply eyes (small, med, and different color iris) - textures = TEXTURES.eyes[gender][age] - local eye_texture_whites = textures[math.random(#textures)] - local eye_texture_iris - if string.find(eye_texture_whites, "_sm") then eye_texture_iris = "eyes_iris_sm.png" - else eye_texture_iris = "eyes_iris_med.png" end - colors = COLORS.eyes[region] - local eye_color = colors[math.random(#colors)] - final_texture = final_texture .. "("..eye_texture_whites..")^("..eye_texture_iris.."^[colorize:"..eye_color..")^" - - -- apply mouth - textures = TEXTURES.mouth[gender][age] - local mouth_texture = textures[math.random(#textures)] - final_texture = final_texture .. "("..mouth_texture..")^" - - -- apply face accessories (eg. eye glasses) - textures = TEXTURES.extra_face[gender][age] - local extra_face_texture = textures[math.random(#textures)] - final_texture = final_texture .. "("..extra_face_texture..")^" - - -- apply footwear - textures = TEXTURES.footwear[region] - local footwear_texture = textures[math.random(#textures)] - colors = COLORS.footwear - local footwear_color = colors[math.random(#colors)] - final_texture = final_texture .. "("..footwear_texture.."^[colorize:"..footwear_color..")^" - - -- apply custom outfit if any - local custom_outfit = TEXTURES.outfit[building_type] - if custom_outfit then - textures = custom_outfit[gender] - local outfit_texture = textures[math.random(#textures)] - colors = COLORS.jackets - local outfit_color = colors[math.random(#colors)] - final_texture = final_texture .. "("..outfit_texture.."^[colorize:"..outfit_color..")^" - else - -- apply full dress - textures = TEXTURES.dress[region][gender][age] - local dress_texture = textures[math.random(#textures)] - if string.find(dress_texture, "dress_") then - colors = COLORS.dress[region][gender] - local dress_color = colors[math.random(#colors)] - final_texture = final_texture .. "("..dress_texture.."^[colorize:"..dress_color..")^" - else - - -- apply lower body clothing - textures = TEXTURES.lower[region][gender][age] - local lower_texture = textures[math.random(#textures)] - colors = COLORS.lower[region][gender] - local lower_color = colors[math.random(#colors)] - final_texture = final_texture .. "("..lower_texture.."^[colorize:"..lower_color..")^" - - -- apply upper body clothing - textures = TEXTURES.upper[region][gender][age] - local upper_texture = textures[math.random(#textures)] - colors = COLORS.upper[region][gender] - local upper_color = colors[math.random(#colors)] - final_texture = final_texture .. "("..upper_texture.."^[colorize:"..upper_color..")^" - - end - - -- apply jacket - textures = TEXTURES.jacket[region] - local jacket_texture = textures[math.random(#textures)] - colors = COLORS.jackets - local jacket_color = colors[math.random(#colors)] - final_texture = final_texture .. "("..jacket_texture.."^[colorize:"..jacket_color..")^" - end - - -- apply hair - textures = TEXTURES.hair[gender][age] - local hair_texture = textures[math.random(#textures)] - colors = COLORS.hair[region][age] - local hair_color = colors[math.random(#colors)] - final_texture = final_texture .. "("..hair_texture.."^[colorize:"..hair_color..")" - - local extra_layer = TEXTURES.extra_layer[building_type] - if extra_layer then - textures = extra_layer[gender] - local extra_layer_texture = textures[math.random(#textures)] - final_texture = final_texture .. "^("..extra_layer_texture..")" - end - - local extra_head = TEXTURES.extra_head[building_type] - if extra_head then - textures = extra_head[gender] - local extra_head_texture = textures[math.random(#textures)] - final_texture = final_texture .. "^("..extra_head_texture..")" - end - - local extra_neck = TEXTURES.extra_neck[building_type] - if extra_neck then - textures = extra_neck[gender] - local extra_neck_texture = textures[math.random(#textures)] - final_texture = final_texture .. "^("..extra_neck_texture..")" - end - - local extra_front = TEXTURES.extra_front[building_type] - if extra_front then - textures = extra_front[gender] - local extra_front_texture = textures[math.random(#textures)] - final_texture = final_texture .. "^("..extra_front_texture..")" - end - - local extra_back = TEXTURES.extra_back[building_type] - if extra_back then - textures = extra_back - local extra_back_texture = textures[math.random(#textures)] - final_texture = final_texture .. "^("..extra_back_texture..")" - end - - -- determine visual_size - local sizes = VISUAL_SIZES[gender][age] - local new_size = sizes[math.random(#sizes)] - - -- calculate collision_box based on new visual_size - local new_collision_box = { - -0.25*new_size, - 0.25*new_size, -0.25*new_size, - 0.25*new_size, 0.5*new_size, 0.25*new_size - } - - return final_texture, new_size, new_collision_box - -end diff --git a/mods/villagers/callbacks.lua b/mods/villagers/callbacks.lua deleted file mode 100644 index b452690..0000000 --- a/mods/villagers/callbacks.lua +++ /dev/null @@ -1,152 +0,0 @@ -minetest.register_on_newplayer(function(ObjectRef) - if villagers.startup_coins == false then return end - local log = false - - if log then print("## NEW PLAYER SPAWNED: "..ObjectRef:get_player_name()) end - local items = { - "villagers:coins "..math.random(20,30), - "villagers:coins_gold "..math.random(1,5) - } - local player_inv = minetest.get_inventory({type="player", name=ObjectRef:get_player_name()}) - - -- add some startup coins - for i=1, #items do - local itemstring = items[i] - local stack = ItemStack(itemstring) - if not player_inv:room_for_item("main", stack) then - minetest.env:add_item(ObjectRef:get_pos(), itemstring) - else - local leftover_items = player_inv:add_item("main", stack) - minetest.env:add_item(ObjectRef:get_pos(), leftover_items) - end - end - -end) - - -minetest.register_on_player_receive_fields(function(player, formname, fields) - local log = false - if log then - io.write("\nonReceivFields() ") - io.write("formname="..formname.." ") - io.write("fields:"..dump(fields).."\n") - end - - if player == nil then print("\n## ERROR Player = NIL ##") return end - if formname == nil then print("\n## ERROR formname = NIL ##") return end - - local formname_data = string.split(formname, "|") - local form_type = formname_data[1] - - if form_type == "villagers:trade" then - - -- obtain villager entity 'self' given the villager ID .. 'vID' - local villager_id = formname_data[2] - local self = villagers.getEntity(villager_id) - - if fields == nil then print("\n## ERROR fields = NIL ##") return - elseif fields.quit then - villagers.endVillagerTrading(self, player) - else - local key_data - for k,v in pairs(fields) do - key_data = k - end - - if log then print("key_data="..key_data) end - local fields_data = string.split(key_data, "|") - local villager_name = fields_data[1] - local item_name = fields_data[2] - local item_quant = fields_data[3] - local cost_name = fields_data[4] - local cost_quant = fields_data[5] - local item_stock = fields_data[6] - local inv_quant = fields_data[7] - local row_index = tonumber(fields_data[8]) - - if log then - io.write("vName="..villager_name.." ") - io.write("item_name="..item_name.." ") - io.write("item_quant="..item_quant.." ") - io.write("cost_name="..cost_name.." ") - io.write("cost_quant="..cost_quant.." ") - io.write("item_stock="..item_stock.." ") - io.write("inv_quant="..inv_quant.." ") - io.write("row_index="..row_index.." ") - end - - local player_name = player:get_player_name() - local player_pos = player:get_pos() - local player_inv = minetest.get_inventory({type="player", name=player_name}) - - -- remove cost items from player inv - local stack - stack = ItemStack(cost_name.." "..cost_quant) - player_inv:remove_item("main", stack) - - -- add item to player inventory - stack = ItemStack(item_name.." "..item_quant) - if not player_inv:room_for_item("main", stack) then - -- throw item at player's feet - minetest.env:add_item(player_pos, item_name) - else - local leftover = player_inv:add_item("main", stack) - end - - if log then - print("## self.vSell: "..minetest.serialize(self.vSell).." ") - end - - -- remove stock from villager - self.vSell[row_index][7] = item_stock - item_quant - - -- ensure to show dialogue recognizing player traded - -- instead of dialogue that player just cancelled the trade. - self.vTraded = true - - minetest.sound_play("coins", {pos = player_pos, gain = 0.4, max_hear_distance = 8} ) - minetest.show_formspec(player_name, "villagers:trade|"..self.vID, villagers.getTradingFormspec(self, player_name)) - - end - - elseif form_type == "villagers:list" then - local log = false - - if log then io.write("\n## FIELDS: "..minetest.serialize(fields).." ") end - - local button_data - for key,value in pairs(fields) do - button_data = key - end - - local form_data = string.split(button_data, "_") - local form_action = form_data[1] - - if log then io.write("form_action="..form_action.." ") end - - if fields == nil then - if log then io.write("\n## ERROR fields = NIL ##") end - return - - elseif form_action == "exit" or form_action == "quit" then - if log then io.write("\n## EXITED FROM VILLAGER LIST ##") end - - elseif form_action == "teleport" then - local teleport_destination = form_data[2] - player:set_pos(minetest.string_to_pos(teleport_destination)) - if log then io.write("\n## TELEPORTED TO VILLAGER: "..teleport_destination.." ##") end - - elseif form_action == "refresh" then - if log then io.write("\n## REFRESHED VILLAGER LIST ##") end - minetest.show_formspec(player:get_player_name(), "villagers:list", villagers.getVillagerListFormspec(player)) - - else - if log then io.write("\n## ERROR unexpected field: "..minetest.serialize(fields)) end - end - - else - io.write("No Action - Unrecognized formname: "..formname.." ") - end - -end) - diff --git a/mods/villagers/changelog.txt b/mods/villagers/changelog.txt deleted file mode 100644 index 08e50e4..0000000 --- a/mods/villagers/changelog.txt +++ /dev/null @@ -1,121 +0,0 @@ -v0.17 Hotfix -- removed references to bucket:bucket_empty to fix NIL errors -- villager spawn y-pos now based on village y-pos -- /villagers list command only shows villagers with trade items -- trade items offered by villagers depend on surrounding region -- village_ruins mod *seems* compatible now (more testing needed) - -v0.17 -[added] -- Added item description to trading formspec -- Added initial coins for player --- you can disable from config.lug file -- Villager 'goodbye' dialogue after trading depends --- changes if player actually trading something - -[improved] -- Improved looks of trading formspec -- Cleaned up code for villager trading - - -v0.16 -[fixed] -- Eliminated more NIL errors that crash the game -- Stop any ongoing digging anim by villager when trading - -[added] -- Young children villagers tell you they don't know much about trading -- New chat command to list all nearby traders and teleport to them -- Created node metadata formspec at village pos that shows any 'soft' errors - -[improved] -- Re-worked entire spawning algorithm to use LBMs! --- if some villagers do not spawn immediately on the mob spawner, --- unload/reload map block by walking away about 40m and returning -- Calculate 'region' type based on surrounding nodes at village position -- Villagers adopt attributes from mg_villagers: gender, age, and job title! -- Trader items/goods are now determined by the villager's job title, --- and is no longer determined by building/schem type. - - -v0.15 -[fixed] -- removed crash on non-players punching villagers - -[added] -- completed main trading formspec -- traders will show **trader** on their infospec -- added coins as the main form of buying goods -- completed cost table based on coins for common items villagers will trade -- 'quest' traders who give ingots for a large number of items -- 'simplejob' traders who give a coin for small amount of resources -- if player tries to chat/trade while villager is busy (walking, turning about, etc) --- villager will say 'pardon', 'excuse me', etc. -- added lots of gameplay facts as dialogue that all villagers may say - -[improved] -- formspec shows goods based on village and plot schem type -- formspec shows correct values for cost, stock, etc. -- only certain villagers trade (farmers, smiths, barkeeps, etc) -- can trade while in the middle of chatting now -- improved chat bubble interaction a bit -- villager tells player they are busy if player tries to chat or trade while another player is doing so first -- added and parameter to chat command -- organized all code into their own lua files -- infospec on villager has useful info (and some not) - - -v0.14 -[improved] -- if village generates aritificial snow, villagers spawn as cold region inhabitants (light skinned and warmer clothing) -- for each residental building (home, hut, tavern, etc), one villager will spawn for each bed that exists -- these villagers will now spawn on the convenient mob spawners (thanks Sokomine!) -- other villagers still spawn next to the various non-residental buildings (forge, library, bakery, sawmill, church, etc) -[added] -- chat command to manually spawn a villager at current position (instructions above) - -v0.13 -[fixed] -- white chat bubble image no longer disappears on rare occasions while chatting -- some chat dialogue no longer appear twice in succession -- moved existing dialogue to villager types that make more sense: from secular to library, and trader to shop -[improved] -- redo and optimize code for dynamic body customization (skin, eyes, hair, etc) -- redo and optimize code for dynamic clothing customization (shirts, pants, dresses, boots, etc) -- reworked colorization for all body and clothing textures -- moved all lua constants for names, plots, colors, and dialogue into its own lua file -- tweaked relationship between village types and region type -[added] -- unique texture for priests (though it's not that great for now), which are villagers that spawn by churches. -- unique 'got to go' message after villager has spoken through their 'main' dialgue -- color variation between body skin colors of villagers among different regions types * -- support for cottage, village_towntest, and village_gambit building mods -- custom dialgue for 'baker', 'mill', 'trader', 'hut', and 'secular' - -v0.12 -[fixed] -- digging of field/garden crops only allowed by farmers and field workers -- walking on newly planted field/garden only allowed by farmers and field workers -- 'traveler' villagers only spawn from 'empty' plot types now and no longer also from 'deco' -[improved] -- tweaked chatbubble positioning when trading -- shifted eyes down a few pixels to better match hair position -- optimized some code regarding hair auto-generating and chat dialogue while trading -[added] -- old aged male villagers have gray hair (or bald) and facial hair -- old aged female villagers have gray hair -- old aged villagers of either genders might wear eye glasses -- while villager is digging, chat dialogue reflects what is it they are digging (wheat, cotton, grass, snow) -- custom chat dialogue for allmende and deco villager types - -v0.11 -[fixed] -- prevent 'traveler' villager types from being young/child physical size -- fix NIL dialogue error when chatting with certain 'farmer' villagers -- allow chat when villager is about to walk and when villager is digging -[improved] -- custom dialogue when player chats while villager is about to walk or while digging -- alert messages now include villager's name -- tweaked chat text to better fit width of the chat bubble -[added] -- all travelers now wear straps with either backpack or sword on their backs diff --git a/mods/villagers/chat_commands.lua b/mods/villagers/chat_commands.lua deleted file mode 100644 index 422e196..0000000 --- a/mods/villagers/chat_commands.lua +++ /dev/null @@ -1,171 +0,0 @@ -local function validateVillageParameters(parameter, type, village) - local log = false - if log then io.write("\nvalidateParams() ") end - - if type == "region" then - if log then io.write("for REGION ") end - if parameter == nil then - if log then io.write("is NIL ") end - return "normal" - else - for i=1, #villagers.REGIONS do - if villagers.REGIONS[i] == parameter then - if log then io.write("is VALID ") end - return parameter - end - end - if log then io.write("notFound setTo=NORMAL ") end - return "normal" - end - - elseif type == "village" then - if log then io.write("for VILLAGE ") end - if parameter == nil then - if log then io.write("is NIL ") end - return "nore" - else - for i=1, #villagers.VILLAGES do - if villagers.VILLAGES[i] == parameter then - if log then io.write("is VALID ") end - return parameter - end - end - if log then io.write("notFound setTo=NORE ") end - return "nore" - end - - elseif type == "plot" then - if log then io.write("for PLOT ") end - if parameter == nil then - if log then io.write("is NIL ") end - return "empty" - else - for i=1, #villagers.BUILDINGS do - if villagers.BUILDINGS[i] == parameter then - if log then io.write("is VALID ") end - return parameter - end - end - if log then io.write("notFound setTo=EMPTY ") end - return "empty" - end - - elseif type == "schem" then - if log then io.write("for SCHEM ") end - local schems_available = villagers.SCHEMS[village] - local random_schem = schems_available[math.random(#schems_available)] - if parameter == nil then - if log then io.write("is NIL ") end - return random_schem - else - for i=1, #schems_available do - if schems_available[i] == parameter then - if log then io.write("is VALID ") end - return parameter - end - end - if log then io.write("notFound setTo="..random_schem.." ") end - return random_schem - end - - end -end - -function villagers.getVillagerListFormspec(player) - local log = false - - local entities = {} - for _, self in pairs(minetest.luaentities) do - if self.vSell ~= "none" then - table.insert(entities, self) - end - end - local count = #entities - if log then print(" villager count: "..count) end - - local width_form = 13.0 - - local h_labels = 1 - local h_row = 0.7 - local h_exit_button = 1 - local h_between = 0.5 -- between label and list, and between list and exit button - - local height_form = h_labels + (h_row * count) + h_exit_button - - if log then print("formspec width="..width_form.." height="..height_form) end - - -- GUI related stuff - --local bg = "bgcolor[#080808BB;true]" - local bg_image = "background[0,0;0,0;gui_formbg.png;true]" - - local formspec = - -- gui background attributes - "size["..width_form..","..height_form.."]"..bg_image.. - - -- header row - "label[0.3,0;Village]".. - "label[1.8,0;Plot]".. - "label[2.5,0;Bed]".. - "label[3.2,0;Name]".. - "label[5.2,0;Title]".. - "label[7.3,0;Origin]".. - "label[8.3.,0;Current]".. - "label[9.4,0;Walked]".. - "label[10.6,0;Dist]" - --"label[11.5,0;Action]" - - -- main villager list - if count > 0 then - for i = 1, count do - local self = entities[i] - local villager_name = self.vName - formspec = formspec.. - "label[0.3,"..(h_row * i)..";"..self.vVillage.."]".. - "label[1.8,"..(h_row * i)..";"..self.vPlot.."]".. - "label[2.5,"..(h_row * i)..";"..self.vBed.."]".. - "label[3.2,"..(h_row * i)..";"..villager_name.."]".. - "label[5.2,"..(h_row * i)..";"..self.vTitle.."]".. - "label[7.3,"..(h_row * i)..";"..self.vOriginPos.x..","..self.vOriginPos.z.."]".. - "label[8.3,"..(h_row * i)..";"..self.vPos.x..","..self.vPos.z.."]".. - "label[9.6,"..(h_row * i)..";"..self.vTotalDistance.."]".. - "label[10.6,"..(h_row * i)..";"..villagers.round(vector.distance(self.vPos, player:get_pos()), 1).."]" - - local teleport_data = "teleport_"..minetest.pos_to_string(self.vPos) - formspec = formspec.."button[11.5,"..(h_row * i)..";1,0.5;"..teleport_data..";go]" - end - - else - formspec = formspec.. "label[5.5,0.5;(no villagers nearby)]" - end - - formspec = formspec.. "button_exit[4.5,"..(height_form - 1)..";2,1;exit;Exit]".. - "button[6.5,"..(height_form - 1)..";2,1;refresh;refresh]" - - return formspec - -end - - --- manually spawn villager via chat command. mostly for testing. -minetest.register_chatcommand("villagers", { - params = "", - description = "Villager Tools", - privs = {}, - func = function(name, param) - local log = false - local params = string.split(param, " ") - local command_type = params[1] - local player = minetest.get_player_by_name(name) - - if command_type == "list" then - if log then print("\n## SHOWING VILAGERS LIST ##") end - local player = minetest.get_player_by_name(name) - minetest.show_formspec(name, "villagers:list", villagers.getVillagerListFormspec(player)) - - else - if command_type == nil then command_type = "NIL" end - minetest.chat_send_player(name, "Invalid command: "..command_type) - end - - end, -}) diff --git a/mods/villagers/chatting.lua b/mods/villagers/chatting.lua deleted file mode 100644 index 9e6b97f..0000000 --- a/mods/villagers/chatting.lua +++ /dev/null @@ -1,470 +0,0 @@ - --- ==================================== CHAT BUBBLES AND DIALOGUE ========================================= --- ======================================================================================================== --- show alert box messages -function villagers.showMessageBubble(self, player, message_text, message_location, clear_timer) - local player_name = player:get_player_name() - local table_data = minetest.serialize(self.vHudIds[player_name]) - - if villagers.log2 then - io.write("showBubble() ") - io.write("self.vHudIds["..player_name.."]:"..table_data.." ") - end - - -- player is chatting with a villager - if self then - - local x_offset, message_position, message_align, bubble_texture - local y_offset - - if message_location == "FRONT" then - x_offset = 0 - y_offset = -300 - bubble_texture = "bubble_villager_front.png" - message_position = { x = 0.5, y = 1.0 } - message_align = {x=0, y=0} - elseif message_location == "FRONTRIGHT" then - x_offset = -200 - y_offset = -150 - bubble_texture = "bubble_villager_frontright.png" - message_position = { x = 1.0, y = 1.0 } - message_align = {x=1, y=0} - elseif message_location == "RIGHT" then - x_offset = -200 - y_offset = -150 - bubble_texture = "bubble_villager_right.png" - message_position = { x = 1.0, y = 1.0 } - message_align = {x=1, y=0} - elseif message_location == "BEHINDRIGHT" then - x_offset = -200 - y_offset = -150 - bubble_texture = "bubble_villager_behindright.png" - message_position = { x = 1.0, y = 1.0 } - message_align = {x=1, y=0} - elseif message_location == "FRONTLEFT" then - x_offset = 200 - y_offset = -150 - bubble_texture = "bubble_villager_frontleft.png" - message_position = { x = 0.0, y = 1.0 } - message_align = {x=-1, y=0} - elseif message_location == "LEFT" then - x_offset = 200 - y_offset = -150 - bubble_texture = "bubble_villager_left.png" - message_position = { x = 0.0, y = 1.0 } - message_align = {x=-1, y=0} - elseif message_location == "BEHINDLEFT" then - x_offset = 200 - y_offset = -150 - bubble_texture = "bubble_villager_behindleft.png" - message_position = { x = 0.0, y = 1.0 } - message_align = {x=-1, y=0} - elseif message_location == "BEHIND" then - x_offset = 0 - y_offset = -150 - bubble_texture = "bubble_villager_behind.png" - message_position = { x = 0.5, y = 1.0 } - message_align = {x=0, y=0} - - --[[ --formspec cuts into chatbubble. figure out later - elseif message_location == "TRADINGBYE" then - x_offset = 0 - y_offset = -240 - bubble_texture = "bubble_villager_front.png" - message_position = { x = 0.5, y = 1.0 } - message_align = {x=0, y=0} - --]] - elseif message_location == "TRADINGBYE" then - x_offset = 0 - y_offset = -240 - bubble_texture = "bubble_villager_front.png" - message_position = { x = 0.5, y = 1.0 } - message_align = {x=0, y=0} - else - --io.write("ERROR - Invalid message_location="..message_location.." ") - return - end - - local nameAndTitleString = "~ "..self.vName.." ~" - - -- show chat bubble - local chat_box_id = player:hud_add({ - hud_elem_type = "image", - scale = { x = 1, y = 1 }, - position = message_position, - text = bubble_texture, - offset = {x=0+x_offset, y=y_offset}, - }) - - --show villager's name within chat bubble - local chat_name_id = player:hud_add({ - hud_elem_type = "text", - position = message_position, - text = nameAndTitleString, - number = 0x666666, - offset = {x=0+x_offset, y=y_offset-25} - }) - - --show main text within chat bubble - local chat_text_id = player:hud_add({ - hud_elem_type = "text", - position = message_position, - text = message_text, - number = 0x000000, - offset = {x=0+x_offset, y=y_offset+15} - }) - - local villager_id = self.vID - local player_name = player:get_player_name() - if self.vHudIds[player_name] == nil then self.vHudIds[player_name] = {} end - - table.insert(self.vHudIds[player_name], 1, {chat_box_id, chat_name_id, chat_text_id}) - minetest.after(clear_timer, function() - --io.write("\n## MINETEST.AFTER()!! deleting chat IDs..") - villagers.removeTextHud(self, player) - end) - - if villagers.log2 then - --io.write("newHudIds:"..dump(self.vHudIds.chats.timed[villager_id]).." ") - local table_data = minetest.serialize(self.vHudIds[player_name]) - io.write("self.vHudIds["..player_name.."]:"..table_data.." ") - end - - -- play bubble pop sound at the villager's position - minetest.sound_play("pop", {pos = self.vPos} ) - - -- player is receiving a notification from this mod - else - local vertical_position = 0.0 - local texture_filename = "bubble_notify.png" - end - -end - -local function yawToDegrees(yaw) - - local degrees_value - local PI_VALUE = 3.141 - local MULTIPLIER = 180 / PI_VALUE - - -- convert yaw to value ranging from 2*PI to zero - if yaw < 0 then - yaw = (PI_VALUE * 2) + yaw - end - - yaw = villagers.round(yaw, 3) - - if yaw == 0 or yaw == 6.282 then - degrees_value = 0 - - -- range from 0 to 179 degrees - elseif yaw > PI_VALUE then - degrees_value = 180 - ((yaw - PI_VALUE) * MULTIPLIER) - - -- range from 181 to 359 degrees - elseif yaw < PI_VALUE then - degrees_value = 180 + ((PI_VALUE - yaw) * MULTIPLIER) - - -- is exactly South - elseif yaw == PI_VALUE then - degrees_value = 180 - - else - --io.write("ERROR - Invalid yaw="..yaw.." ") - degrees_value = 0 - end - - degrees_value = villagers.round(degrees_value,1) - return degrees_value -end - -local function getLookDirection(yaw) - local degrees = yawToDegrees(yaw) - local lookDirection - if degrees > 337.5 or degrees <= 22.5 then lookDirection = 1 - elseif degrees > 22.5 and degrees <= 67.5 then lookDirection = 2 - elseif degrees > 67.5 and degrees <= 112.5 then lookDirection = 3 - elseif degrees > 112.5 and degrees <= 157.5 then lookDirection = 4 - elseif degrees > 157.5 and degrees <= 202.5 then lookDirection = 5 - elseif degrees > 202.5 and degrees <= 247.5 then lookDirection = 6 - elseif degrees > 247.5 and degrees <= 292.5 then lookDirection = 7 - elseif degrees > 292.5 and degrees <= 337.5 then lookDirection = 8 - else lookDirection = 1 - end - return lookDirection -end - -local ORIENTATIONS = { - { "BEHIND", "BEHINDRIGHT", "RIGHT", "FRONTRIGHT", "FRONT", "FRONTLEFT", "LEFT", "BEHINDLEFT" }, - { "BEHINDLEFT", "BEHIND", "BEHINDRIGHT", "RIGHT", "FRONTRIGHT", "FRONT", "FRONTLEFT", "LEFT" }, - { "LEFT", "BEHINDLEFT", "BEHIND", "BEHINDRIGHT", "RIGHT", "FRONTRIGHT", "FRONT", "FRONTLEFT" }, - { "FRONTLEFT", "LEFT", "BEHINDLEFT", "BEHIND", "BEHINDRIGHT", "RIGHT", "FRONTRIGHT", "FRONT" }, - { "FRONT", "FRONTLEFT", "LEFT", "BEHINDLEFT", "BEHIND", "BEHINDRIGHT", "RIGHT", "FRONTRIGHT" }, - { "FRONTRIGHT", "FRONT", "FRONTLEFT", "LEFT", "BEHINDLEFT", "BEHIND", "BEHINDRIGHT", "RIGHT" }, - { "RIGHT", "FRONTRIGHT", "FRONT", "FRONTLEFT", "LEFT", "BEHINDLEFT", "BEHIND", "BEHINDRIGHT" }, - { "BEHINDRIGHT", "RIGHT", "FRONTRIGHT", "FRONT", "FRONTLEFT", "LEFT", "BEHINDLEFT", "BEHIND" } -} - -local function getChatOrientation(self, player) - local villagerDir = getLookDirection(self.object:get_yaw()) - local playerDir = getLookDirection(player:get_look_horizontal()) - return ORIENTATIONS[villagerDir][playerDir] -end - - - - - ---[[ - self: villager lua entity - chat_texts: table that contains one or more strings of chat dialogue - script_type: corresponds to the lua entity variables 'vScriptHi', 'vScriptBye', 'vScriptMain' ---]] -function villagers.getRandomChatText(self, chat_texts, script_type, chat_text_count) - --print("villagers.getRandomChatText("..script_type.." "..chat_text_count..") ") - - -- all of villager's chat text has been used up (via table.remove) so need to - -- reload from saved. this ensures the villager keeps the same initial set of - -- chat texts, but it will be in random order upon each reload. - -- ** this situation never occurs for HI, BYE, and smalltalk chat tests ** - if self[script_type] then - for i=1, #self[script_type.."Saved"] do - local text_string = self[script_type.."Saved"][i] - table.insert(self[script_type], text_string) - end - - -- first time villager object is activated. initialize with chat text and save - -- a copy that set for reload later as player 'uses up' those chat taxts when chatting - else - self[script_type] = {} - self[script_type.."Saved"] = {} - for i=1, chat_text_count do - local text_string = table.remove(chat_texts, math.random(#chat_texts)) - - -- add dynamic customization to villagers main chat text, not HI, BYE, or smalltalk - -- this is mostly for testing and may be removed later - if script_type == "vScriptMain" then - text_string = string.gsub(text_string, "VILLAGER_NAME", self.vName) - text_string = string.gsub(text_string, "BUILDING_TYPE", self.vType) - text_string = string.gsub(text_string, "AGE", self.vAge) - text_string = string.gsub(text_string, "GENDER", self.vGender) - end - - table.insert(self[script_type], text_string) - table.insert(self[script_type.."Saved"], text_string) - end - end - -end - -function villagers.endVillagerChat(self, player, end_type) - if villagers.log2 then io.write("endChat() end_type="..end_type.." ") end - - local message_location = getChatOrientation(self, player) - - local goodbyes - - -- normal 'goodbye' dialogues variations when player has walked away - if end_type == 1 then - goodbyes = self.vScriptBye - - -- remove current chat bubble the villager has displayed - villagers.removeTextHud(self, player) - - -- display the goodbye message bubble - villagers.showMessageBubble(self, player, goodbyes[math.random(#goodbyes)], message_location, 1) - - -- villager went through all 'main' dialogue - -- so then ended the chat with player 'got to go!' - elseif end_type == 2 then - goodbyes = self.vScriptGtg - villagers.showMessageBubble(self, player, goodbyes[math.random(#goodbyes)], message_location, 2) - - -- villager has nothing to trade, so 'got to go' - elseif end_type == 3 then - if self.vAge == "young" then - goodbyes = villagers.chat.trade.none_young - else - goodbyes = villagers.chat.trade.none - end - - villagers.showMessageBubble(self, player, goodbyes[math.random(#goodbyes)], message_location, 2.5) - - else - print("## ERROR Invalid end_type: "..end_type.." ##") - end - - -- load previous yaw value - self.vYaw = self.vYawSaved - - -- resume previous look direction - minetest.after(2, function() - self.object:set_yaw(self.vYaw) - - -- player had initiated tradeing while villager was - -- about to walk or dig. now continue with that action. - if self.vWalkReady then - self.vAction = "WALK" - self.vWalkReady = false - elseif self.vDigReady then - self.vAction = "RESUMEDIG" - self.vDigReady = false - else - self.vAction = "STAND" - end - - end) - - self.vChatting = nil - self.vAction = "ENDCHAT" -end - -function villagers.chatVillager(self, player, chat_type) - local log = false - if log then io.write("chat() ") end - - -- if player initiated chat when villager was about to start - -- walking or digging. save this state to continue action once chat ends - if self.vAction == "WALK" then - if log then io.write("villagerAboutToWalk ") end - self.vWalkReady = true - elseif self.vAction == "DIG" then - if log then io.write("villagerAboutToDig ") end - self.vDigReady = true - minetest.sound_stop(self.vSoundHandle) - self.object:set_animation( - {x=self.animation["stand_start"], y=self.animation["stand_end"]}, - self.animation_speed + math.random(10) - ) - elseif self.vAction == "RESUMEDIG" then - if log then io.write("villagerAboutToResumeDig ") end - self.vDigReady = true - end - - self.vAction = "CHAT" - - local player_name = player:get_player_name() - - -- show a quick greeting bubble for when player right clicks - -- on villager for trading - if chat_type == 1 then - if log then io.write("startTrading ") end - - --formspec cuts into chatbubble. figure out later - --villagers.showMessageBubble(self, player, villagers.chat.trade.hi[math.random(#villagers.chat.trade.hi)], "TRADING", 4) - - -- player ended trading with villager, so villager says custom trading goodbyes - elseif chat_type == 2 then - if log then io.write("playerEndedTrade vTraded="..tostring(self.vTraded).." ") end - local bye_text - if self.vTraded then - bye_text = villagers.chat.trade.bye_buy - villagers.showMessageBubble(self, player, bye_text[math.random(#bye_text)], "TRADINGBYE", 2) - self.vTraded = false - else - bye_text = villagers.chat.trade.bye - villagers.showMessageBubble(self, player, bye_text[math.random(#bye_text)], "TRADINGBYE", 2) - end - - -- villager has no items to trade, and will state as such and say they got to go - elseif chat_type == 3 then - if log then io.write("VillageNothingToSell ") end - - self.vChatting = player_name - self.vYawSaved = self.vYaw - - -- make villager face player - villagers.turnToPlayer(self, player) - - -- end chat with villager saying nothing to sell - villagers.endVillagerChat(self, player, 3) - - -- player continuing ongoing dialogue with villager - elseif self.vChatting then - if log then io.write("continuingConversation ") end - local next_dialogue - - -- pop/remove one random dialogue from 'smalltalk' table - local random_num = math.random(6) - if random_num == 1 then - local dialogue_count = #self.vScriptSmalltalk - if log then io.write("getDialogue:smalltalk fromRemain="..dialogue_count.." ") end - if dialogue_count == 0 then - local full_dialgue_table = villagers.copytable(villagers.chat.smalltalk) - villagers.getRandomChatText(self, full_dialgue_table, "vScriptSmalltalk", 3) - if log then io.write("tableReloaded:smalltalk ") end - end - - next_dialogue = table.remove(self.vScriptSmalltalk, math.random(dialogue_count)) - villagers.showMessageBubble(self, player, next_dialogue, "FRONT", 3) - if log then io.write("dialogueDisplayedOK remain="..#self.vScriptSmalltalk.." ") end - - -- pop/remove one random dialogue from 'mainchat' table - elseif random_num > 3 then - local dialogue_count = #self.vScriptMain - if log then io.write("getDialogue:main fromRemain="..dialogue_count.." ") end - if dialogue_count == 0 then - local full_dialgue_table = villagers.copytable(villagers.chat[self.vType].mainchat) - villagers.getRandomChatText(self, full_dialgue_table, "vScriptMain", 3) - if log then io.write("tableReloaded:main ") end - villagers.endVillagerChat(self, player, 2) - if log then io.write("chatEnded ") end - else - next_dialogue = table.remove(self.vScriptMain, math.random(dialogue_count)) - villagers.showMessageBubble(self, player, next_dialogue, "FRONT", 3) - if log then io.write("dialogueDisplayedOK remain="..#self.vScriptMain.." ") end - end - - else - local dialogue_count = #self.vScriptGameFacts - if log then io.write("getDialogue:gamefacts fromRemain="..dialogue_count.." ") end - if dialogue_count == 0 then - local full_dialgue_table = villagers.copytable(villagers.chat.gamefacts) - villagers.getRandomChatText(self, full_dialgue_table, "vScriptGameFacts", 2) - if log then io.write("tableReloaded:gamefacts ") end - end - - next_dialogue = table.remove(self.vScriptGameFacts, math.random(dialogue_count)) - villagers.showMessageBubble(self, player, next_dialogue, "FRONT", 3) - if log then io.write("dialogueDisplayedOK remain="..#self.vScriptGameFacts.." ") end - end - - -- player starting new conversation with villager - else - if log then io.write("\nnewConversation ") end - - self.vChatting = player_name - self.vYawSaved = self.vYaw - - -- make villager face player - villagers.turnToPlayer(self, player) - - -- save initial distance between player and villager. if player - -- surpasses this distance, villager will end chat. - self.vInitialChatDistance = vector.distance(self.vPos, player:getpos()) - - local greeting_text - - -- if player chats while villager was about to walk - if self.vWalkReady then - if log then io.write("villagerAboutToWalk ") end - greeting_text = villagers.chat.walk[math.random(#villagers.chat.walk)] - - -- if player chats while villager was digging - elseif self.vDigReady then - if log then io.write("villagerDigging ") end - greeting_text = villagers.chat.dig[self.vDigging][math.random(#villagers.chat.dig[self.vDigging])] - - -- show one of the random default greetings for this villager type - else - if log then io.write("showDefaultHI ") end - local greetings = self.vScriptHi - greeting_text = greetings[math.random(#greetings)] - end - - villagers.showMessageBubble(self, player, greeting_text, "FRONT", 3) - - end - - if log then io.write("\n") end -end diff --git a/mods/villagers/coins.lua b/mods/villagers/coins.lua deleted file mode 100644 index 479675a..0000000 --- a/mods/villagers/coins.lua +++ /dev/null @@ -1,77 +0,0 @@ -local enable_coin_drop = minetest.settings:get_bool("coin_drop") -if enable_coin_drop == nil then enable_coin_drop = true end - -local coin_nodes = { "default:dirt", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:dirt_with_rainforest_litter", "default:dirt_with_snow" } -local ethereal_found = false - -for i, name in ipairs(minetest.get_modnames()) do - if name == "ethereal" then ethereal_found = true - end -end - --- coin findings in dirty nodes :P -local function coin_drop_items(node) - local set_dirt = "default:dirt" - - -- special treatment for "ethereal:dry_dirt" because it has no drop value, so it gets one :) - if node == "ethereal:dry_dirt" then set_dirt = node end - - return { { items = {"villagers:coins_gold", set_dirt}, rarity = 50 }, { items = {"villagers:coins", set_dirt}, rarity = 30 } } -end - -if enable_coin_drop then - - minetest.log("[Villagers] hiding coins in dirt, please wait!") - - -- ethereal support - if ethereal_found == true then - minetest.log("adding dirt from ethereal") - - table.insert(coin_nodes, "ethereal:bamboo_dirt") - table.insert(coin_nodes, "ethereal:cold_dirt") - table.insert(coin_nodes, "ethereal:crystal_dirt") - table.insert(coin_nodes, "ethereal:dry_dirt") - table.insert(coin_nodes, "ethereal:fiery_dirt") - table.insert(coin_nodes, "ethereal:grey_dirt") - table.insert(coin_nodes, "ethereal:grove_dirt") - table.insert(coin_nodes, "ethereal:jungle_dirt") - table.insert(coin_nodes, "ethereal:mushroom_dirt") - table.insert(coin_nodes, "ethereal:prairie_dirt") - end - - for n = 1, #coin_nodes do - local item_def = minetest.registered_items[coin_nodes[n]] - - if item_def ~= nil then - local debug = "" - local set_max_items = 1 - - -- getting drop-item-table - local new_items = coin_drop_items(coin_nodes[n]) - - -- default drop = "string", build a table and include the default drop at last position - if type(item_def.drop) == "string" or coin_nodes[n] == "ethereal:dry_dirt" then - debug = " --> creating new table" - local insert_drop = item_def.drop - - -- special treatment for "ethereal:dry_dirt" because it has no drop value, so it gets one :) - if coin_nodes[n] == "ethereal:dry_dirt" then insert_drop = coin_nodes[n] end - - table.insert(new_items, { items = { insert_drop } }) - - elseif type(item_def.drop) == "table" then - debug = " --> modifying existing table" - set_max_items = item_def.drop.max_items - for idx = 1, #item_def.drop.items do table.insert(new_items, item_def.drop.items[idx]) end - end - - local set_item_drop = { - max_items = set_max_items, - items = new_items - } - - minetest.log(coin_nodes[n] .. " has coins now!" .. debug) - minetest.override_item(coin_nodes[n], { drop = set_item_drop }) - end - end -end diff --git a/mods/villagers/config.lua b/mods/villagers/config.lua deleted file mode 100644 index 121188a..0000000 --- a/mods/villagers/config.lua +++ /dev/null @@ -1,2 +0,0 @@ --- set 'false' to not give player startup coins -villagers.startup_coins = true \ No newline at end of file diff --git a/mods/villagers/constants.lua b/mods/villagers/constants.lua deleted file mode 100644 index d7d1ad5..0000000 --- a/mods/villagers/constants.lua +++ /dev/null @@ -1,139 +0,0 @@ --- ============================================ CONSTANTS ================================================= --- ======================================================================================================== - -villagers.YAWS = { 0, -0.785, -1.571, -2.356, 3.141, 2.356, 1.571, 0.785} -villagers.DIRECTIONS = { "N", "NE", "E", "SE", "S", "SW", "W", "NW"} -villagers.DEGREES_TO_YAW = { - [0] = 0, [45] = -0.785, [90] = -1.571, [135] = -2.356, [180] = 3.141, - [225] = 2.356, [270] = 1.571, [315] = 0.785, [360] = 0 -} - --- used to help calculate the x and z positions of nodes that are adjacent to villager -villagers.NODE_AREA = { - ["NW"]={-1,1}, ["N"]={0,1}, ["NE"]={1,1}, ["W"]={-1,0}, ["C"]={0,0}, - ["E"]={1,0}, ["SW"]={-1,-1}, ["S"]={0,-1}, ["SE"]={1,-1} -} - -villagers.REGIONS = { "hot", "cold", "normal", "navtive", "desert" } - -villagers.VILLAGES = { - "tent", "charachoal", "claytrader", "lumberjack", "logcabin", "nore", - "medieval", "gambit", "taoki", "cornernote", "sandcity", - "chateau", "single", "tower" -} - -villagers.BUILDINGS = { - "allmende", "bakery", "bench", "chateau", "church", "deco", "empty", - "farm_full", "farm_tiny", "field", "forge", "fountain", "house", "hut", - "library", "lumberjack", "mill", "pasture", "pit", "sawmill", "school", - "secular", "shed", "shop", "spawn", "tavern", "tent", "tower", "trader", - "village_square", "wagon", "well", "castle", "park", "cementry", "lamp", - "hotel", "pub", "stable", "horsestable" -} - -villagers.SCHEMS = { - tent = { - "tent_tiny_1", "tent_tiny_2", "tent_big_1", "tent_big_2", - "tent_medium_1", "tent_medium_2", "tent_medium_3", - "tent_medium_4", "tent_open_1", - "tent_open_2", "tent_open_3", - "tent_open_big_1", "tent_open_big_2", "tent_open_big_3", - "empty_1", "empty_2", "empty_3", "empty_4", "empty_5", - "empty_16x32_2_90", "empty_32x32_2_90" - }, - charachoal = { - "charachoal_hut", "charachoal_hill", - "empty_1", "empty_2", "empty_3", "empty_4", "empty_5", - "empty_16x32_2_90", "empty_32x32_2_90" - }, - claytrader = { - "trader_clay_1", "trader_clay_2", "trader_clay_3", - "trader_clay_4", "trader_clay_5", "clay_pit_1", - "clay_pit_2", "clay_pit_3", "clay_pit_4", "clay_pit_5", - "empty_1", "empty_2", "empty_3", "empty_4", "empty_5", - "empty_16x32_2_90", "empty_32x32_2_90" - }, - lumberjack = { - "lumberjack_1", "lumberjack_2", "lumberjack_3", "lumberjack_4", - "lumberjack_5", "lumberjack_6", "lumberjack_7", "lumberjack_8", - "lumberjack_9", "lumberjack_10", "lumberjack_11", "lumberjack_12", - "lumberjack_13", "lumberjack_14", "lumberjack_15", "lumberjack_16", - "lumberjack_school", "lumberjack_stable", "lumberjack_pub_1", - "lumberjack_church_1", "lumberjack_hotel_1", "lumberjack_shop_1", - "lumberjack_sawmill_1", - "empty_1", "empty_2", "empty_3", "empty_4", "empty_5", - "empty_16x32_2_90", "empty_32x32_2_90" - }, - logcabin = { - "allmende_3_90", "logcabin1", "logcabin2", "logcabin3", "logcabin4", - "logcabin5", "logcabin6", "logcabin7", "logcabin8", "logcabin9", - "logcabin10", "logcabin11", "logcabinpub1", "logcabinpub2", "logcabinpub3", - "empty_1", "empty_2", "empty_3", "empty_4", "empty_5", - "empty_16x32_2_90", "empty_32x32_2_90" - }, - nore = { - "house_1_0", "wheat_field", "cotton_field", "lamp", "well", - "fountain", "small_house_1_0", "house_with_garden_1_0", "church_1_0", - "tower_1_0", "forge_1_0", "library_1_0", "inn_1_0", "pub_1_0", - "empty_1", "empty_2", "empty_3", "empty_4", "empty_5", - "empty_16x32_2_90", "empty_32x32_2_90" - }, - medieval = { - "church_1", "forge_1", "mill_1", "watermill_1", "hut_1", "hut_2", - "farm_full_1", "farm_full_2", "farm_full_3", "farm_full_4", "farm_full_5", - "farm_full_6", "farm_tiny_1", "farm_tiny_2", "farm_tiny_3", "farm_tiny_4", - "farm_tiny_5", "farm_tiny_6", "farm_tiny_7", "taverne_1", "taverne_2", - "taverne_3", "taverne_4", "well_1", "well_2", "well_3", "well_4", - "well_5", "well_6", "well_7", "well_8", "allmende_3_90", "tree_place_1", - "tree_place_2", "tree_place_3", "tree_place_4", "tree_place_5", "tree_place_6", - "tree_place_7", "tree_place_8", "tree_place_9", "tree_place_10", "wagon_1", - "wagon_2", "wagon_3", "wagon_4", "wagon_5", "wagon_6", "wagon_7", "wagon_8", - "wagon_9", "wagon_10", "wagon_11", "wagon_12", "bench_1", "bench_2", - "bench_3", "bench_4", "shed_1", "shed_2", "shed_3", "shed_4", "shed_5", - "shed_6", "shed_7", "shed_8", "shed_9", "shed_10", "shed_11", "shed_12", - "weide_1", "weide_2", "weide_3", "weide_4", "weide_5", "weide_6", "field_1", - "field_2", "field_3", "field_4", "baking_house_1", "baking_house_2", - "baking_house_3", "baking_house_4", "house_medieval_fancy_1_90", - "cow_shed_1_270", "shed_with_forge_v2_1_0", - "empty_1", "empty_2", "empty_3", "empty_4", "empty_5", - "empty_16x32_2_90", "empty_32x32_2_90" - }, - gambit = { - "gambit_church_1_0_180", "gambit_cementry_0_180", "gambit_field_1_1_90", - "gambit_forge_1_2_270", "gambit_fountain_1_1_90", "gambit_house_1_0_0", - "gambit_lamp_0_270", "gambit_library_hotel_0_180", "gambit_pub_1_0_0", - "gambit_shed_open_chests_2_0", "gambit_shop_0_90", "gambit_shop_large_0_0", - "gambit_stable_1_2_90", "gambit_tower_1_0_270" - }, - taoki = { - "allmende_3_90", "default_town_farm", "default_town_house_large_1", - "default_town_house_large_2", "default_town_house_medium", - "default_town_house_small", "default_town_house_tiny_1", - "default_town_house_tiny_2", "default_town_house_tiny_3", "default_town_park", - "default_town_tower", "default_town_well", "default_town_fountain", - "empty_1", "empty_2", "empty_3", "empty_4", "empty_5", - "empty_16x32_2_90", "empty_32x32_2_90" - }, - cornernote = { - "towntest_ACDC_house_0_270", "towntest_cornernote_hut1_1_0", "towntest_cornernote_hut2_1_90", - "towntest_cornernote_hut3_1_180", "towntest_cornernote_fortress_4_0", - "towntest_cornernote_tower_1_90", "towntest_cornernote_turret_1_90", - "towntest_irksomeduck_manor_0_90", "towntest_kddekadenz_barn1_1_90", - "towntest_kddekadenz_barn2_1_90", "towntest_kddekadenz_castle_3_90", - "towntest_kddekadenz_factory_1_90", "towntest_kddekadenz_gazebo_0_90", - "towntest_kddekadenz_home1_1_90", "towntest_kddekadenz_home2_1_90", - "towntest_kddekadenz_windmill_0_90", "towntest_Nanuk_chapel_1_180", - "towntest_Nanuk_lavabeacon_0_90", "towntest_Nanuk_well_0_90", - "towntest_VanessaE_home1_1_0", "towntest_VanessaE_home2_0_0" - }, - sandcity = { - "sandcity_tiny_1_1_270", "sandcity_tiny_2_1_270", "sandcity_tiny_3_1_270", - "sandcity_tiny_4_1_270", "sandcity_small_1_1_270", "sandcity_small_2_1_270", - "sandcity_small_3_1_270", "sandcity_small_4_1_270", "sandcity_small_5_1_270", - "sandcity_meeting_small_1_1_270", "sandcity_ap_tower_1_1_270", - "sandcity_ap_tower_2_1_270", "sandcity_ap_tower_3_1_270", "sandcity_ap_tower_4_1_270", - "sandcity_ap_tower_5_1_270", "sandcity_ap_tower_6_1_270", "sandcity_ap_tower_7_1_270", - "sandcity_ap_mixed_1_1_270", "sandcity_ap_mixed_2_1_270", "sandcity_ap_tiny_3_1_270", - "sandcity_ap_tiny_3b_1_270", "sandcity_small_2_1_270", "sandcity_small_3_1_270" - } -} diff --git a/mods/villagers/depends.txt b/mods/villagers/depends.txt deleted file mode 100644 index 9fe61b2..0000000 --- a/mods/villagers/depends.txt +++ /dev/null @@ -1,6 +0,0 @@ -mg_villages -cottages? -village_gambit? -village_sandcity? -village_towntest? -farming? \ No newline at end of file diff --git a/mods/villagers/dialogue.lua b/mods/villagers/dialogue.lua deleted file mode 100644 index 925a6c6..0000000 --- a/mods/villagers/dialogue.lua +++ /dev/null @@ -1,1181 +0,0 @@ -local DEFAULT_HI = { - "Hi!", "Hi.", - "Hello!", "Hello.", - "Greetings!", "Hey.", - "Nice to see you.", - "How's it going.", - "Howdy.", - "What's up." -} - -local DEFAULT_BYE = { - "Goodbye.", - "Bye!", "Bye.", - "Good day.", - "Later.", - "See you later!" -} - -local DEFAULT_MAIN = { - "I spawned near a BUILDING_TYPE.", - "I am a AGE GENDER.", - "I haven't been assigned any\n".. - "custom dialgue yet." -} - -villagers.chat = { - - -- chat spamming when chatting too fast - spam = { - "Say again?", "Come again?", - "I'm sorry?", "Sorry?", - "Didn't hear you?", - "Didn't hear?", "Wat?", - "Wut?", "Huh?", "Eh?", "Hm?" - }, - - -- SMALLTALK - smalltalk = { - "It's a nice day.", - "You look adventurous!", - "Good day today.", - "What should I eat today..", - "What should I do...", - "Like the weather today?", - "What brings you here?", - "Look - over there!\n...\nHahaha.", - "Hope all is well?", - "I smell somthing.\nIs that you?", - "I hear something...", - "Did you see that?", - "Oh, it's you.", - "[looks over their shoulder]", - "[stares intently at you]", - "[smiles]", - "[whistles]", - "Hmm. Yep.", "Ho hum.", "Huh.", - "Heyo.", "Ooh!", "Umm.", "Uhh.", - "Heh.", "Hey..", "...", - "Wat.", "Wut.", - "You look nice in that.", - - -- funny stuff - "I think I'm dying...", - "Lost my train of thought...", - "[whispers]\nKill me.", - "[whispers]\nI think I love you.", - "Where am I?", - "Who am I?", - "I forgot what day\n".. - "it is today.", - }, - - -- when villager has gone through all the - -- 'main' chat digalogue and ends the chat - gtg = { - "I should go now.\nGood day!", - "Got to go...\nGoodbye.", - "Need to continue my\nday... Bye!", - "Well, I should break\nnow... Later!", - "Nice chatting with\nyou... Goodbye!", - "Must go now...\nHave a nice day!", - "I should resume my\nday... Bye!" - }, - - -- TRADING_CHAT - trade = { - hi = { - "Want to trade?", - "See anything you like?", - "What would you like?", - "Here's what I have...", - "Trade for what I've got?", - "Want these for trade?", - "Interested in these?" - }, - - none = { - "Sorry, no interest in trading.", - "Nothing to trade you, sorry.", - "I don't have anything to trade.", - "Trade? Not today.", - "I have no trades today.", - "Sorry, nothing to trade." - }, - - none_young = { - "Trading? What is that?", - "Do I have anything you like?\nUmm. What's 'trading'?", - "You want to trade stuff?\nAsk my mom or dad..", - "I don't have anything.\nMaybe ask some grownups!", - "Trading things? I'm not\nallowed to with strangers.\nBye!", - }, - - bye = { - "Thanks for looking.", - "Not interested? ok.", - "Ok. Maybe next time.", - "Sure. Maybe later.", - "Maybe interested later." - }, - - bye_buy = { - "Thanks for the trade!", - "Hope you like it!", - "Thank you!", - "Thanks! Come back again!", - "Thanks! Great choice.", - "Great! Thanks!", - "Good trade!" - }, - - }, - - -- WALK_CHAT - walk = { - "Oh hi! I was just about\n".. - "to walk onward!", - "Hello! Was just about to\n".. - "walk around a bit.", - "Oh! I was about to go.\n".. - "How's it going?" - }, - - walking = { - "Pardon me..", - "Excuse me..", - "Going through..", - "Make way.. sorry..", - "Sorry, just walking..", - "On my way..", - "Moving onward..", - "Pardon, moving through..", - "Walking through.. pardon.." - }, - - walkback = { - "Going the other way..", - "Turning back..", - "Other way.." - }, - - busy = { - "Pardon me..", - "Excuse me.", - "Ah, pardon..", - "Oh, excuse me..", - "Pardon..", - }, - - -- DIG_CHAT - dig = { - cotton = { - "Oh! Just picking cotton.\n".. - "I didn't notice you. Hello!", - "Just harvesting cotton.\n".. - "How are you?", - "Oh! I was just harvesting\n".. - "this cotton here.", - "Cotton is ready. Time\n".. - "to harvest!" - }, - wheat = { - "Oh! Just picking wheat.\n".. - "I didn't notice you. Hello!", - "Just harvesting wheat.\n".. - "How's it going?", - "Oh hi! I was harvesting\n".. - "this wheat over here.", - "The wheat is ready. Time\n".. - "to harvest!" - }, - grass = { - "Oh! Just removing some grass.\n".. - "I didn't notice you. Hello!", - "Oh hello. Grass is getting\n".. - "too long over here.", - "Just trimming this grass.\n".. - "Hello there!", - "Oh hi! Just gathering some\n".. - "of this grass." - }, - flower = { - "Oh! Just picking flowers.\n".. - "I didn't notice you. Hello!", - "Oh hello! I'm gonna pick\n".. - "some flowers.", - "Just gathering a flower\n".. - "or two. How are you?", - "Oh hi! Just about to pick\n".. - "the flowers there." - }, - snow = { - "Oh! Just digging up snow.\n".. - "I didn't notice you. Hello!", - "Snow all over the place!", - "Too bad snow doesn't\n".. - "dig itself away.", - "I can barely walk with\n".. - "all this snow everywhere!", - "You like digging up snow?\n".. - "Yea, I don't either!", - "Snow, snow, snow...", - "Yay! More snow.\n".. - "[grumbles]", - "Plenty of snowballs with\n".. - "all this snow!" - } - }, - - allmende = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "I'm VILLAGER_NAME.", - "The space around here is\n".. - "the allmende.", - "This is the common area for\n".. - "us who live here.", - "You are free to use this\n".. - "area for your purposes.", - "Please be courteous to others\n".. - "who also wish to use this\n".. - "shared space." - } - }, - - bakery = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "VILLAGER_NAME is my name.", - "I love baking!", - "Yep, that is my bakery.", - "The fresh smell of baked bread\n".. - "in the morning is the best!", - "I have warm, delicious bread if\n".. - "you want to trade for some.", - "I will glady take any extra\n".. - "wheat off your hands!", - "Try to steal my fresh bread\n".. - "and my roller will be flying...", - }, - }, - - bench = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - chateau = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - church = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "My name is VILLAGER_NAME.", - "Yes, that is the church.", - "How is your heart and your\n".. - "spirit today?", - "Are you happy, my child?", - "I can give you a blessing.", - "Do you pray?", - "Offerings are most welcome!", - "[nods and smiles]", - "Follow your path.", - "Tomorrow is always a new day.", - "Find your inner peace.", - "Nothing is impossible." - } - }, - - deco = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "Hello, I'm VILLAGER_NAME.", - "I'm just waiting around by\n".. - "the lamp post.", - "Do you see a lamp post?\n".. - "No? Then I might be at the\n".. - "park. Hmm.", - "This is a nice park!\n".. - "...or lamp post. Hehehe.", - "Have you heard of this person\n".. - "named Sokomine?", - "Sokomine says I should be near\n".. - "a park... or a lamp post.", - "Hmm. A statue of me here at\n".. - "this park would be amazing!", - "There should be a sign with\n".. - "the name of our village here.", - "I should plant a beautiful\n".. - "flower garden right here!" - } - }, - - empty = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "My name is VILLAGER_NAME.", - "Hello. I'm just a visitor here.", - "Do you know of other interesting\n".. - "villages to visit?", - "Smaller villages do not have\n".. - "paved roads.", - "You seem like a taveller.", - "This seems like a nice place.", - "Do I have something to trade?\n".. - "Maybe. Maybe not.", - "A sleeping mat and a torch\n".. - "are all you need to travel!", - "Just resting a bit here in\n".. - "this village.", - "Some villages have fountains.", - "Some villages have a guard tower.", - "I only travel during the daytime.", - "I have nowhere else interesting\n".. - "to go at the moment.", - "Oh I'm just standing around..\n".. - "enjoying the day.", - "I'm just traveling through." - } - }, - - farm_full = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "I'm VILLAGER_NAME.", - "Like my big farm?", - "Want to trade for something\n".. - "from my fields?", - "Perhaps I'll start farming\n".. - "some animals on day.", - "Sheep like to eat weeds..".. - "Maybe I should raise sheep.", - "I wonder if cows are easier\n".. - "to farm compared to pigs.", - "Bacon is delicious!", - } - }, - - farm_tiny = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "My name is VILLAGER_NAME.", - "I have a small farm.", - "Chickens keep eating my seeds.", - "Want to trade for something\n".. - "from my garden?", - "One day I want to tend a\n".. - "larger garden.", - "Weeds... so many weeds.", - "Maybe farming animals is easier.", - "What's your favorite vegatable?", - } - }, - - field = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "My name is VILLAGER_NAME.", - "I work in the field.", - "I enjoy working outdoors.", - "I hope the weather is kind\n".. - "to my crops this year.", - "Would you like to trade for\n".. - "some of what I've grown?", - "It can be hard work tending\n".. - "this field.", - "Birds can be so beautiful..\n".. - "but not in my field!", - "Dig, dig, dig...", - "Prune, prune, prune...", - "I might need more water...", - } - }, - - forge = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "I'm VILLAGER_NAME.", - - "Yup, that is my forge.", - - "Protect yourself with my\n".. - "weapons and armor.", - - "I sometimes have other\n".. - "equipment if you like..", - - "If you have the required metals,\n".. - "I can sell weapons you need.", - } - }, - - fountain = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "My name is VILLAGER_NAME.", - - "That is the fountain there.", - - "I like hanging around\n".. - "all kinds of fountains.", - - "Fountains are so neat.", - - "On a hot day, I just want\n".. - "to jump in!", - - "People like throwing coins\n".. - "in the fountain.", - - "I can trade different coins\n".. - "if you want.", - - "Birds like the fountain too!", - - "You shouldn't drink the water.", - - "Someone once put a\n".. - "fish in there!", - - "Make a wish!" - } - }, - - horsestable = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - house = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "My name is VILLAGER_NAME.", - - "Yep, it's my house.", - - "My place is not so big.", - - "I like my house.", - - "Have you heard of this\n".. - "thing called carpet?", - - "Time for more furniture!", - - "I have a creaky door.", - - "Mossy walls seem nice.", - - "I need another window.", - - "Do you have wooden floors?", - - "Strangers keep entering\n".. - "and exiting my home.", - - "Hmm.. I dunno about torches\n".. - "inside the house.", - - "My roof doesn't seem so\n".. - "rain resistant.", - - "Yea.. my home is a bit\n".. - "empty for now.", - - "I can't lock my doors." - } - }, - - hut = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "My name is VILLAGER_NAME.", - "That's my hut.", - "The space is tiny, but\n".. - "I don't mind it.", - "The place is not too bad.", - "At least I don't worry about\n".. - "furnature because none will fit!", - - "I smacked my face on\n".. - "the door once.", - - "I do enjoy the smell of\n".. - "natural wood in my hut.", - - "If my move my hut under a tree,\n".. - "perhaps I won't even need a roof!", - - "My home doesn't get robbed\n".. - "since there's nothing to take!", - - "A friend was brave and\n".. - "posted a torch in their hut\n".. - "and it burned down pretty quick.", - - "I wonder if my hut has termites.", - - "Hmm.. I might as well just\n".. - "remove my door.", - - "I'd invite you to lunch in my\n".. - "cozy home, but I don't think\n".. - "we can both fit. [shrugs]" - } - }, - - inn = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - library = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "My name is VILLAGER_NAME.", - - "That is the library.", - - "Interested in buying a new book?", - - "I sell empty books that can be\n".. - "useful to you as a journal!", - - "You can find books on many topics.", - - "The more you know, the better\n".. - "prepared you will be out there.", - } - }, - - lumberjack = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - mill = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "My name is VILLAGER_NAME.", - "Yep, that's my flour mill.", - "The bakers rely on my mill\n".. - "for their flour.", - "The mill mostly works on it's\n".. - "own, but if a something needs\n".. - "repair, it can be a nightmare!", - "You need flour? I'll gladly\n".. - "trade with you...", - "I can take some of your wheat\n".. - "if you want to trade for it.", - "At times small insects would\n".. - "get ground up with the flour.\n".. - "It's all protein anyway!" - }, - }, - - pasture = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - pit = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "I am VILLAGER_NAME.", - "I work in that pit.", - "What I do is gather clay\n".. - "from the ground", - "I may have some extra material\n".. - "that I can trade with you...", - "I'm sure you can craft many\n".. - "useful things from clay!\n".. - "Or maybe not? [shrugs]", - "Someone once said that some\n".. - "clay tastes like play-doh.\n".. - "What is this 'play-doh'?" - } - }, - - sawmill = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - school = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - secular = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "Call me VILLAGER_NAME.", - "Welcome to our village!", - "I trust you are having\n".. - "a nice time here?", - "Have you noticed the different\n".. - "buildings in each village?", - "Visited a library before? You\n".. - "can learn many things there.", - "Did you know larger villages\n".. - "will have a village square?", - "It seems you are the\n".. - "the quiet type?" - } - }, - - shed = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - shop = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "I'm VILLAGER_NAME.", - - "That is my shop, welcome!", - - "I have tools, equipment, and\n".. - "food for your travels!", - - "Sometimes I have healing\n".. - "items too.", - - "Be sure to take a raft or boat\n".. - "with you to make exploring the\n".. - "open waters much easier.", - - "You will need an axe to take\n".. - "down trees.", - - "Axes will always chop down\n".. - "wooden materials faster.", - - "Use a shovel to dig dirt, sand,\n".. - "gravel and other ground stuff.", - - "You can use your hand to dig\n".. - "up dirt, but a shovel will make\n".. - "it much easier!", - - "You'll need a pickaxe to dig\n".. - "stone and rock.", - - "Don't forget to bring\n".. - "food with you!", - - "Be sure to keep your belongings\n".. - "safe with a locked chest!" - } - }, - - spawn = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - tavern = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "My name is VILLAGER_NAME.", - - "The tavern is not yet open.", - - "An assortment of drinks will\n".. - "surely be available soon!", - - "I plan to have good food\n".. - "served in the tavern too!", - - "Many villagers can't wait\n".. - "for the tavern to open.", - - "The tavern will be the".. - "site of the town!", - - "I will be welcoming food and\n".. - "drink suggestions.", - - "I need to find some nice\n".. - "hostesses for my tavern.", - } - }, - - tent = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - tower = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "I'm VILLAGER_NAME.", - - "Yes, that is a guard tower!", - - "I patrol this area.", - - "Do you know how to\n".. - "use a bow?", - - "Have a look at my armor!" - } - }, - - townhall = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - trader = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "VILLAGER_NAME is my name.", - "Yep, I'm a clay trader!", - "If you want some clay, I\n".. - "can trade you for some.", - "I gather clay from the pit\n".. - "workers and provid to those\n".. - "who can use it.", - "Clay is fairly commonly found\n".. - "in the earth actually.", - } - }, - - village_square = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - wagon = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "My name is VILLAGER_NAME.", - - "Like my wagon?", - - "I love exploring the vast\n".. - "open wilderness.", - - "You can travel anywhere\n".. - "with a wagon!", - - "A wagon is great!\n".. - "But, the wheels need\n".. - "constant repair.", - - "I use my wagon to make\n".. - "deliveries too.", - - "When the night is nice and\n".. - "clear I like to lay in the\n".. - "wagon and look to the stars!", - - "A compass is very useful when\n".. - "travelling long distances." - } - }, - - well = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = { - "I'm VILLAGER_NAME.", - "Yea.. that is the well.", - "It's great we have a well here.", - "Don't fall in there!", - "The well is the main source\n".. - "of clean water for the village.", - "There is a tale of a girl who\n".. - "fell in a well and died after\n".. - "7 days and now haunts the living!", - "Anyone is welcome to the well\n".. - "water. You just need a bucket!" - } - - }, - - castle = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - park = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - cementry = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - lamp = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - hotel = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - pub = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - stable = { - greetings = DEFAULT_HI, - goodbyes = DEFAULT_BYE, - mainchat = DEFAULT_MAIN - }, - - gamefacts = { - "There are wolves in the forests.\n".. - "If you leave them alone they\n".. - "will not hurt you.", - - "If you have raw meats like\n".. - "rabbit or mutton, you might be\n".. - "able to tame a wolf!", - - "Many of the dangerous creatures\n".. - "hunt only at night - except\n".. - "for creepers.", - - "The snowlands have less creatures\n".. - "that hunt you. But that also\n".. - "means you have less food to hunt.", - - "There are creatures called a\n".. - "Yeti that live in the snow.", - - "Want to know an interesting thing\n".. - "about Yetis? They like potatoes!", - - "The snow can be a peaceful place.\n".. - "But watch out for Yetis!", - - "Yetis like the peace a quiet too.\n".. - "They only like to roam about at\n".. - "night when the sun is not high.", - - "Mese is hard to find. But watch\n".. - "out for the Mese monster!", - - "Skeleton key default left-click\n".. - "action is to create a key for\n".. - "the locked object.", - - "right-click for opening\n".. - "stuff with keys.", - - "one gold ingot makes\n".. - "a skeleton key.", - - "The owner of locked things\n".. - "never needs to use keys\n".. - "for own things.", - - "You need steel ingots\n".. - "to make carts.", - - "To make a cart, you do\n".. - "a 'U' shape like boat with\n".. - "steel ingots!", - - "Carts will only move on rails.", - - "You need to be 'sneaky' to\n".. - "pickup a mine cart.", - - "You can drop items in a\n".. - "minecart to transport items!", - - "Powered rails can automatically\n".. - "accellerate moving carts.", - - "Sese crytsal fragments is\n".. - "the important ingredient to\n".. - "make powered rails.", - - "You can make a skeleton key\n".. - "from a gold ingot.", - - "If you want to share a\n".. - "locked item with a friend,\n".. - "just give them a key.", - - "Use a skeleton key on a locked\n".. - "item and it will turn into a\n".. - "key that you can share!", - - "If you remove a locked item,\n".. - "then any keys you shared for it\n".. - "will no longer work.", - - "You can smelt any key back into\n".. - "a gold ingot - it's like magic!", - - "Did you know common bushes grow\n".. - "in grasslands, decidious\n".. - "forests and snowy places?", - - "Acacia bushes grow in".. - "savannahs.", - - "Bush leaves defy gravity -\n".. - "they never fall if you greak\n".. - "off their stems!", - - "Did you know a bush stem can be\n".. - "crafted into 1 wooden plank?", - - "Corals live in warm, shallow\n".. - "oceans - maybe near deserts or\n".. - "savannahs. Not sure!", - - "You can harvest coral skeletons\n".. - "from the orage and brown coral.", - - "If coral is expose to air,\n".. - "they will die and turn into\n".. - "skeleton coral.", - - "You need pickaxes to\n".. - "dig up coral!", - - "You can use flint and steel\n".. - "on a coal block to create a\n".. - "permanent flame.", - - "If you have TNT, don't get too\n".. - "close to any torches or to\n".. - "flint and steel.. boom!", - - "Moss like to glow on anything\n".. - "that is cobblestone when there\n".. - "is water near it.", - - "If you pour water into lava\n".. - "you can sometimes get obsidian!", - - "Snow blocks and ice will cool\n".. - "down lava and if it's just\n".. - "right it will make obsidian.", - - "Did you know you can find many\n".. - "beautiful coral in the sea?", - - "Many colorful plants grow at\n".. - "the bottom of the seas.", - - "Have you ever seen a jellyfish\n".. - "in the ocean?", - - "Sea kelp can grow very long!", - - "Did you know sea kelp can grow\n".. - "up to 20 meters longs?", - - "You can find kelp deep\n".. - "in the oceans!", - - "Some travelers told me that they\n".. - "saw old sunkin ships and under\n".. - "water boats on the sea bed.", - - "I heard you can find treasure\n".. - "in the ships and boats that sank\n".. - "to the bottom of the sea.", - - "No one sells lumps like iron\n".. - "copper, tin, or gold. You have\n".. - "to dig them up yourself.", - - "Look for village leaders who\n".. - "will trade an ingot for some".. - "resources they need!", - - "People cannot hear you if\n".. - "you chat too fast!", - - "Keep the creepers at a distance\n".. - "with a bow.", - - "Ever since the creepers started\n".. - "to appear, I'm afraid to be in\n".. - "the forests where they can hide.", - - "I heard creepers don't\n".. - "like the snow.", - - "Attacking a creeper is easy since\n".. - "they don't have arms. But, run\n".. - "before their deathly explosion!", - - "Creapers only appear during the\n".. - "day. It's like they want to blow\n".. - "you up in broad daylight.", - - "Watch out for zombies! They\n".. - "like to hide near places with\n".. - "lots of cover.", - - "Zombies like to hide near trees,\n".. - "bushes, and tall grass.", - - "Zombies come out mostly after\n".. - "sunset and hide then when\n".. - "twilight arrives.", - - "Be careful at night while\n".. - "exploring the forests and\n".. - "tall brush. It's zombies!", - - "I saw some zombies wearing\n".. - "steel armor!", - - "If you ever encounter a zombie\n".. - "wearing armor, you need a\n".. - "strong sword and good armor too!", - - "There are ghostly mages that\n".. - "like to wander the forests\n".. - "and dungeons at night.", - - "Mages hate firelight and so\n".. - "will steal any nearby torches.\n".. - "They're definitely spooky!", - - "The Mese monster's shards\n".. - "fly so fast.", - - "The way to defeat a Mese monster\n".. - "is to dart up close, strike,\n".. - "then dart away from each shard.", - - "Did you know Mese monsters live\n".. - "in stone caves and dungeons?", - - "Mese monsters only come out\n".. - "after the sun sets.", - - "Have you hunted slimes before?\n".. - "You can find them in jungles\n".. - "and near tall grass and bushes.", - - "Green slimes are more common\n".. - "in forests and jungles.", - - "At night the big slimes\n".. - "roam about!", - - "Green slimes can be found\n".. - "hiding near tall grass.", - - "Green slimes also like humid\n".. - "places like jungles.", - - "Only the tiny green slimes\n".. - "appear during the day.", - - "The huge slimes appear only\n".. - "at night. Watch out for them!", - - "Did you know you can get\n".. - "gelatin from green slimes?", - - "Tiny slimes are not that\n".. - "difficult to kill, but you\n".. - "usually get less gelatin.", - - "The medium and giant slimes\n".. - "have gelatin every time, but\n".. - "be careful not to get hurt!", - - "Have you heard about a huge\n".. - "headless monster with no skin?", - - "There is a headless, skinless\n".. - "monster where all its flesh\n".. - "is exposed. Scary!", - - "The headless monster has\n".. - "muscles and tendons that\n".. - "squishes around as it walks!", - - "There's an tale about an evil\n".. - "tree that uproots itself every\n".. - "night to find little children!", - - "I heard there are skeletons\n".. - "in the abandoned dungeons.\n".. - "hope they don't dome up here!", - - "I love the beaches and open\n".. - "seas. There's so much to\n".. - "explore out there!", - - "Swimming across a lake can be\n".. - "a good shortcut. Just don't\n".. - "get eaten by a shark!", - - "If you plan to explore the open\n".. - "seas, be sure to use a raft.", - - "Sharks are usually seen near\n".. - "sea plant life and also roaming\n".. - "about sunken shipwrecks!", - - "Tin is not used in making many\n".. - "tools. But, you need tin with\n".. - "copper to make bronze." - }, - -} diff --git a/mods/villagers/functions.lua b/mods/villagers/functions.lua deleted file mode 100644 index 7cfacb0..0000000 --- a/mods/villagers/functions.lua +++ /dev/null @@ -1,149 +0,0 @@ --- ============================================ HELPER FUNCTIONS ========================================== --- ======================================================================================================== - --- round a decimal number to any number of decimal points --- or round to nearest whole number if decimal_places is omitted -function villagers.round(float_number, decimal_places) - local multiplier - if decimal_places then multiplier = 10^decimal_places - else multiplier = 1 end - return math.floor(float_number * multiplier + 0.5) / multiplier -end - -function villagers.copytable(source_table) - local new_table = {} - for i = 1, #source_table do - table.insert(new_table, source_table[i]) - end - return new_table -end - --- returns the full registered nodename (ex. default:dirt) as well as --- an all-caps shortened version of the nodename (ex. DIRT) at given position -function villagers.getNodeName(pos) - local node_name = minetest.get_node({x=pos.x,y=pos.y,z=pos.z}).name - local node_nickname - local name_table = string.split(node_name, ":") - if #name_table > 1 then - node_nickname = name_table[2] - else - node_nickname = name_table[1] - end - return {node_name, string.upper(node_nickname)} -end - --- get direction (N, NE, E, SE, S, SW, W, NW) from yaw --- yaw can be radians or degrees (0-360) -function villagers.getDirectionFromYaw(yaw) - local direction - if yaw == 0 then direction = "N" - elseif yaw == -0.785 or yaw == 45 then direction = "NE" - elseif yaw == -1.571 or yaw == 90 then direction = "E" - elseif yaw == -2.356 or yaw == 135 then direction = "SE" - elseif yaw == 3.141 or yaw == 180 then direction = "S" - elseif yaw == 2.356 or yaw == 225 then direction = "SW" - elseif yaw == 1.571 or yaw == 270 then direction = "W" - elseif yaw == 0.785 or yaw == 315 then direction = "NW" - else - print("\n## ERROR invalid yaw="..yaw) - end - - return direction -end - -function villagers.getFacingNodeInfo(self) - local facing_dir = self.vFacingDirection - local dug_pos = { - x=self.vPos.x + villagers.NODE_AREA[facing_dir][1], - y=self.vTargetHeight, - z=self.vPos.z + villagers.NODE_AREA[facing_dir][2] - } - local node_names = villagers.getNodeName(dug_pos) - return {dug_pos, node_names[1], node_names[2]} -end - --- makes villager turn and face toward player's direction -function villagers.turnToPlayer(self, player) - local entityPos = self.object:getpos() - local playerPos = player:getpos() - local dx = entityPos.x - playerPos.x - local dz = playerPos.z - entityPos.z - self.object:set_yaw(math.atan2(dx, dz)) -end - -function villagers.removeTextHud(self, player) - - local hud_id_table = self.vHudIds[player:get_player_name()] - if #hud_id_table > 0 then - if villagers.log2 then io.write("Removing Text Hud IDs: ") end - local hud_id_data - hud_id_data = table.remove(hud_id_table) - for i = 1, #hud_id_data do - local hud_id = hud_id_data[i] - player:hud_remove(hud_id) - --io.write(hud_id.." ") - end - else - if villagers.log2 then io.write("NoTextHudsShowing doNothing ") end - end - -end - --- return villager entity object when provided the entity 'vID' -function villagers.getEntity(villager_id) - for _,luaentity in pairs(minetest.luaentities) do - if luaentity.vID == nil then - print("\n## ERROR luaentity.vID = NIL ##") - elseif luaentity.vID == villager_id then - return luaentity - end - end -end - -function villagers.showAlert(self, player, alert_text, timer) - - if self.vHudIds.alert_text then - player:hud_remove(self.vHudIds.alert_text) - self.vHudIds.alert_text = nil - end - - if self.vHudIds.alert_box then - player:hud_remove(self.vHudIds.alert_box) - self.vHudIds.alert_box = nil - end - - if timer == nil then timer = 3 end - - -- show alert box - local alert_box_id = player:hud_add({ - hud_elem_type = "image", - scale = { x = 1, y = 1 }, - position = { x = 0.5, y = 0.0 }, - text = "alert_box.png", - offset = {x=-30, y=50}, - }) - - --show text within alert box - local alert_text_id = player:hud_add({ - hud_elem_type = "text", - position = { x = 0.5, y = 0.0 }, - - text = alert_text, - number = 0xFFFFFF, - offset = {x=-30, y=50} - }) - - if villagers.log2 then io.write("alertBox hudIDs saved ") end - - table.insert(self.vHudIds, 1, {alert_box_id, alert_text_id}) - minetest.after(timer, function() - io.write("\n## MINETEST.AFTER()!! deleting alert text IDs..") - villagers.removeTextHud(self, player) - end) - - if villagers.log2 then - io.write("newTextIds:"..dump(self.vHudIds.chats.timed[villager_id]).." ") - end - - -end diff --git a/mods/villagers/init.lua b/mods/villagers/init.lua deleted file mode 100644 index 78a616b..0000000 --- a/mods/villagers/init.lua +++ /dev/null @@ -1,20 +0,0 @@ -villagers = {} -villagers.mods = {} - -if minetest.get_modpath("cottages") then villagers.mods["cottages"] = true end -if minetest.get_modpath("farming") then villagers.mods["farming"] = true end - -local modpaths = minetest.get_modpath("villagers") -dofile(modpaths.."/config.lua") -dofile(modpaths.."/constants.lua") -dofile(modpaths.."/items.lua") -dofile(modpaths.."/coins.lua") -dofile(modpaths.."/functions.lua") -dofile(modpaths.."/attributes.lua") -dofile(modpaths.."/chatting.lua") -dofile(modpaths.."/actions.lua") -dofile(modpaths.."/dialogue.lua") -dofile(modpaths.."/trading.lua") -dofile(modpaths.."/spawn.lua") -dofile(modpaths.."/callbacks.lua") -dofile(modpaths.."/chat_commands.lua") diff --git a/mods/villagers/items.lua b/mods/villagers/items.lua deleted file mode 100644 index d7624bc..0000000 --- a/mods/villagers/items.lua +++ /dev/null @@ -1,9 +0,0 @@ -minetest.register_craftitem("villagers:coins", { - description = "Silver Coin", - inventory_image = "coins.png", -}) - -minetest.register_craftitem("villagers:coins_gold", { - description = "Gold Coin", - inventory_image = "coins_g.png", -}) \ No newline at end of file diff --git a/mods/villagers/settingtypes.txt b/mods/villagers/settingtypes.txt deleted file mode 100644 index 754c507..0000000 --- a/mods/villagers/settingtypes.txt +++ /dev/null @@ -1,5 +0,0 @@ -#Give startup-coins -give_startup_coins (Give startup-coins) bool true - -#Coin-drop in dirt -coin_drop (Coin drop) bool true diff --git a/mods/villagers/sounds/coins.ogg b/mods/villagers/sounds/coins.ogg deleted file mode 100644 index ca4a555..0000000 Binary files a/mods/villagers/sounds/coins.ogg and /dev/null differ diff --git a/mods/villagers/sounds/pop.1.ogg b/mods/villagers/sounds/pop.1.ogg deleted file mode 100644 index 89109f1..0000000 Binary files a/mods/villagers/sounds/pop.1.ogg and /dev/null differ diff --git a/mods/villagers/sounds/pop.2.ogg b/mods/villagers/sounds/pop.2.ogg deleted file mode 100644 index 222878b..0000000 Binary files a/mods/villagers/sounds/pop.2.ogg and /dev/null differ diff --git a/mods/villagers/sounds/pop.3.ogg b/mods/villagers/sounds/pop.3.ogg deleted file mode 100644 index 2048815..0000000 Binary files a/mods/villagers/sounds/pop.3.ogg and /dev/null differ diff --git a/mods/villagers/spawn.lua b/mods/villagers/spawn.lua deleted file mode 100644 index a349490..0000000 --- a/mods/villagers/spawn.lua +++ /dev/null @@ -1,907 +0,0 @@ -function getRegionFromArea(pos, radius, errors) - local log = false - local log2 = false --show all nodes gathered - - local RADIUS_MAX = 30 - local origin_pos = {x=pos.x, y=pos.y, z=pos.z} - local origin_pos_str = minetest.pos_to_string(origin_pos) - - -- debug output - if log then - io.write("\n ") - io.write("origin_pos"..origin_pos_str.." ") - io.write("radius="..radius.." ") - end - - if radius > RADIUS_MAX then - if log then io.write("radiusTooLarge radiusIsNow="..RADIUS_MAX.." ") end - radius = RADIUS_MAX - end - - if log then io.write("GettingNodes.. ")end - - --gather stats of the surrounding nodes at this village position - --to determine what region (cold, hot, normal, native, desert) this - --village should be correspond to - local nodenames = {} - - -- seach each of the 8 directions N, NE, E, SE, S, SW, W, NW - for dir_index = 1, 8 do - local search_dir = villagers.DIRECTIONS[dir_index] - - if log then io.write("\n "..search_dir..": ") end - - -- gather name of every odd node staring at 1 node - -- from the origin_pos to radius - local radius_index = 1 - local loc = {x=0, y=origin_pos.y, z=0} - local nodename - while radius_index < radius do - loc.x = origin_pos.x + (villagers.NODE_AREA[search_dir][1] * radius_index) - loc.z = origin_pos.z + (villagers.NODE_AREA[search_dir][2] * radius_index) - nodename = villagers.getNodeName(loc)[2] - - if log then io.write(nodename) end - if nodename == "ROAD" or - nodename == "DIRT" or - nodename == "FELDWEG" or - nodename == "STONE" or - nodename == "STONEBRICK" or - nodename == "COBBLE" or - nodename == "AIR" or - nodename == "WATER_SOURCE" or - nodename == "IGNORE" then - if log then io.write("[skipped] ") end - else - if log then io.write(", ") end - table.insert(nodenames, nodename) - end - - radius_index = radius_index + 2 - end - - end - - if log then - io.write("\n ## nodesGathered("..#nodenames.."): ") - for i = 1, #nodenames do - io.write(nodenames[i].." ") - end - end - - -- count re-occuring nodenames and sort from highest occurrance to lowest - local rated_nodenames = {} - local popped_name - --rated_nodenames[popped_name] = 1 --record the first occurance - - if log then io.write("\nratingNodes.. ") end - while #nodenames >= 0 do - popped_name = table.remove(nodenames) - if log then - io.write("\n nodenamesSize="..#nodenames.." ") - io.write("popped="..popped_name.." ") - end - - local match_found = false - for key,value in pairs(rated_nodenames) do - if log then io.write("\n '"..key.."="..value.."' ") end - if key == popped_name then - match_found = true - rated_nodenames[key] = rated_nodenames[key] + 1 - if log then io.write("[MATCH] set v="..rated_nodenames[key].." ") end - break - else - if log then io.write("[noMatch] loopAgain.. ") end - end - end - if not match_found then - if log then io.write("endOf 'rated_nodenames' withNoMatch savedAsNew poppingNextNode.. ") end - rated_nodenames[popped_name] = 1 - end - if #nodenames == 0 then - break - end - end - - if log2 then - io.write("\n\n## rated_nodenames: ") - for k,v in pairs(rated_nodenames) do - io.write(k.."="..v.." ") - end - io.write("\n") - end - - -- identify the nodename that occurred the most - if log then io.write("\n getHighestRatedNode.. ") end - local top_count = 0 - local top_nodename - for key,value in pairs(rated_nodenames) do - if log then - io.write("\n '"..key.."="..value.."' ") - io.write("top_count="..top_count.." ") - end - if value > top_count then - top_count = value - top_nodename = key - if log then io.write("higherValue! setTopCount="..top_count.." setTopNode="..top_nodename.." ") end - else - if log then io.write("noChange ") end - end - end - if log then io.write("\n ## top_nodename = "..top_nodename.." count="..top_count.." ") end - - local region_type - --tent, claytrader, lumberjack, log cabin, nore, medieval, taoki, cornernote - -- assign region type based on the top node found - -- region types: cold, hot, normal, native, desert - if top_nodename == "DIRT_WITH_SNOW" then - region_type = "cold" - elseif top_nodename == "SNOWBLOCK" then - region_type = "cold" - elseif top_nodename == "ICE" then - region_type = "cold" - elseif top_nodename == "DIRT_WITH_DRY_GRASS" then - region_type = "hot" - elseif top_nodename == "DIRT_WITH_GRASS" then - region_type = "normal" - elseif top_nodename == "DIRT_WITH_RAINFOREST_LITTER" then - region_type = "native" - elseif top_nodename == "SOIL_WET" then - region_type = "native" - elseif top_nodename == "SAND" or - top_nodename == "DESERT_SAND" or - top_nodename == "SILVER_SAND" or - top_nodename == "DESERT_STONE" or - top_nodename == "SANDSTONE" then - if math.random(2) == 1 then - region_type = "hot" - else - region_type = "desert" - end - else - io.write(" #ERROR IN getRegionFromArea()# ") - local error_message = "Unknown value for top_nodename = "..top_nodename.." ".. - "Falling back to region=NORMAL." - table.insert(errors, error_message) - region_type = "normal" - end - return region_type -end - - - -minetest.register_lbm({ - label = "Spawn Villager", - name = "villagers:spawn_villager", - nodenames = {"mg_villages:mob_spawner"}, - run_at_every_load = true, - action = function(pos, node) - local log = false - - if log then io.write("\n## LBM ## ") end - - local spawn_meta = minetest.get_meta(pos) - local meta_table = spawn_meta:to_table() - local plot_num = tonumber(meta_table.fields.plot_nr) - local bed_num = tonumber(meta_table.fields.bed_nr) - - if spawn_meta:get_int("success") == 1 then - if log then io.write("** ALREADY SPAWNED ** Plot #"..plot_num.." Bed #"..bed_num) end - return - end - - -- track any errors. for use by formspec in - -- node metadata located at the village position - local errors = {} - - local village_id = meta_table.fields.village_id - local village_data = mg_villages.all_villages[village_id] - if village_data == nil then - return - end - local village_pos = {x=village_data.vx, y=village_data.vh, z=village_data.vz} - local village_pos_str = minetest.pos_to_string(village_pos) - local village_radius = village_data.vs - local village_type = village_data.village_type - local village_snow = village_data.artificial_snow - if village_snow == nil then village_snow = "NIL" end - - if log then io.write(string.upper(village_type)..village_pos_str.." ") end - - -- Get region type data if it was already calculated - -- and saved from a previous LBM call. Region data is - -- saved in node metadata at village position. - local village_meta = minetest.get_meta(village_pos) - local region = village_meta:get_string("region") - local note = "" - if region == "" then - note = "*" - -- certain village types directly determine the region type - -- without needing to examine surrounding node data - if village_type == "sandcity" then region = "desert" - elseif village_type == "claytrader" then region = "desert" - elseif village_type == "charachoal" then region = "native" - elseif village_type == "gambit" then region = "desert" - elseif village_snow == 1 then region = "cold" - - -- remaining village types will have region type - -- based upon the surrounding types of nodes - else - region = getRegionFromArea(village_pos, village_radius, errors) - note = "**" - end - village_meta:set_string("region", region) - end - - if log then io.write("size="..village_radius.." snow="..village_snow.." region="..region..note.." ") end - - --[[ currently unused - local village_num = village_data.nr - local village_height = village_data.optimal_height - local village_is_single = village_data.is_single_house - local village_name = village_data.name - --]] - - local plot_data = village_data.to_add_data.bpos[plot_num] - local plot_pos = {x = plot_data.x, y = plot_data.y, z = plot_data.z} - local plot_pos_str = minetest.pos_to_string(plot_pos) - local sizex = plot_data.bsizex - local sizez = plot_data.bsizez - local rotate = plot_data.brotate - local side = plot_data.side - if side == nil then side = "NIL" end - - if log then io.write("Plot #"..plot_num.." "..plot_pos_str.." ") end - - local b_type_num = plot_data.btype - local building_data = mg_villages.BUILDINGS[b_type_num] - local b_type = building_data.typ - local b_schem = building_data.scm - local b_sizex = building_data.sizex - local b_sizez = building_data.sizez - local b_sizey = building_data.ysize - local b_inhab = building_data.inh - local b_bedcount = building_data.bed_count - local b_bedlist = building_data.bed_list -- table - local b_nodenames = building_data.nodenames -- table - - if b_inhab == nil then b_inhab = "NIL" end - if b_sizex == nil then b_sizex = "NIL" end - if b_sizey == nil then b_sizey = "NIL" end - if b_sizez == nil then b_sizez = "NIL" end - if type(b_schem) == "table" then b_schem = "n/a" end - if b_type == nil then b_type = "NIL" end - if b_bedcount == nil then b_bedcount = "NIL" end - - local beds_data_count = 0 - for k,v in pairs(plot_data.beds) do - beds_data_count = beds_data_count + 1 - end - - if log then - io.write(string.upper(b_type).."["..b_schem.."] inh="..b_inhab.." ") - io.write("bedcount="..b_bedcount.." beds_data_count="..beds_data_count.." ") - end - --if log then io.write("plot_data.beds["..bed_num.."]: "..minetest.serialize(plot_data.beds).." ") end - if bed_num > beds_data_count then - if log then io.write(" #ERROR IN bed_num vs beds_data_count# ") end - local error_message = "to_add_data.bpos(meta.fields.plot_nr="..plot_num..")(meta.fields.bed_nr="..bed_num..") NIL. ".. - "BUILDINGS(btype).bed_count="..b_bedcount.." and inh="..b_inhab..". Wait next cycle.." - table.insert(errors, error_message) - return - end - - local beds_data = plot_data.beds[bed_num] - local bed_pos = {x=beds_data.x, y=beds_data.y, z=beds_data.z} - local bed_pos_str = minetest.pos_to_string(bed_pos) - - local gen = beds_data.generation - local age = beds_data.age - local gender = beds_data.gender - if gender == "m" then gender = "male" else gender = "female" end - - --get NAME and save to 'vName' object custom field - local villager_name - if region == "native" then villager_name = villagers.getVillagerName(gender, region) - elseif region == "desert" then villager_name = villagers.getVillagerName(gender, region) - else - if age == "young" then villager_name = villagers.getVillagerName(gender, age) - else villager_name = villagers.getVillagerName(gender) end - end - - local title = beds_data.title - local works_at = beds_data.works_at - local unique = beds_data.uniq - local owns_data = beds_data.owns - - if log then - pos.y = village_data.vh + 1.5 - io.write("\nVillager: "..string.upper(villager_name).." "..minetest.pos_to_string(pos).." ") - io.write("gender="..gender.." age="..age.." gen="..gen.." bed#"..bed_num.." "..bed_pos_str.." ") - if title then io.write("*"..string.upper(title).."* ") end - if works_at then io.write("@ plot #"..works_at.." ") end - if unique then io.write("unique="..unique.." ") end - if owns_data then - io.write("OWNS PLOT(S) "..minetest.serialize(owns_data).." ") - end - end - - local worker_data = village_data.to_add_data.bpos[plot_num].worker - - if worker_data then - --local lives_at = worker_data.lives_at - local work_as = worker_data.work_as - local titl = worker_data.title - local uniq = worker_data.uniq - if log then - if work_as then io.write("Work Info: job="..work_as.." ") end - if titl then io.write("titl="..titl.." ") end - if uniq then io.write("uniq="..uniq.." ") end - end - end - - ------------------------------- - -- SPAWN THE ACTUAL VILLAGER! -- - ------------------------------- - - -- 'pos' is currently location of mg_Villages mob spawner. - -- Ensure villager spawns one node above this position. - pos.y = village_data.vh + 1.25 - local objectRef = minetest.add_entity(pos, "villagers:villager") - local self = objectRef:get_luaentity() - - if log then io.write("\n ** SPAWNING VILLAGER ** ") end - - self.vName = villager_name - self.vGender = gender - if log then io.write(self.vGender.." ") end - - if gen == 1 then age = "young" - elseif gen == 2 then age = "adult" - else age = "old" end - self.vAge = age - if log then io.write(self.vAge.." ") end - - -- assigned trading goods to villagers who - -- possess the appropriate title - if title == nil then - -- these are home/hut dwellers - self.vSell = "none" - elseif villagers.GOODS[title] == nil then - self.vSell = "none" - table.insert(errors, "villagers.GOODS: Unknown job title '"..title.."' for plot#"..plot_num.." bed#"..bed_num.." villager.") - else - -- getTradeInventory() can also return "none" for job titles - -- that fail probability check of trading items - self.vSell = villagers.getTradeInventory(title, region, plot_num, bed_num, errors) - end - self.vTitle = title - - --get TEXTURE, VISUAL SIZE, and COLLISION BOX and apply it to corresponding entity properties - local newTexture, newSize, newCollisionBox = villagers.getVillagerAppearance(b_type, region, gender, age) - objectRef:set_properties({textures={newTexture}}) - objectRef:set_properties({visual_size={x=newSize,y=newSize}}) - objectRef:set_properties({collisionbox=newCollisionBox}) - - local final_pos = objectRef:getpos() - self.vSpawnHeight = final_pos.y - self.vTargetHeight = self.vSpawnHeight - 0.5 - - -- set final position that takes into account calc'd - -- collision_box that was based on dynamic visual_size - final_pos.y = final_pos.y - objectRef:setpos(final_pos) - self.vPos = {x=final_pos.x,y=final_pos.y,z=final_pos.z} - self.vOriginPos = {x=final_pos.x,y=final_pos.y,z=final_pos.z} - self.vTargetPos = {x=final_pos.x, y=self.vTargetHeight, z=final_pos.z} - - -- randomly set how often in seconds that this - -- villager will check to do a different action - self.vActionFrequency = math.random(4,6) - - --overlay applied entity new properties to custom fields - local prop = objectRef:get_properties() - self.vTexture = prop.textures[1] - self.vSize = prop.visual_size - self.vBox = prop.collisionbox - - self.vRegion = region - self.vVillage = village_type - self.vPlot = plot_num - self.vType = b_type - self.vSchem = b_schem - self.vBed = bed_num - - -- use for villager trading formspec callbacks and for chat commands - self.vID = final_pos.x.."_"..final_pos.y.."_"..final_pos.z - - -- copy chat dialogue scripts from villagers.chat global var - -- and save it into villager entity for more quicker access - local hi_script, bye_script, main_script - if villagers.chat[b_type] == nil then - if log then io.write(" #ERROR IN LOADING Chat Scripts# ") end - local error_message = "villagers.chat('"..b_type.."') = NIL for ".. - "plot#"..plot_num.." bed#"..bed_num.." villager. Fallback to default scripts." - table.insert(errors, error_message) - hi_script = { "I am error.", "My chat failed", "Potato."} - bye_script = { "Blah.", "Kill me.", "Chimichangas." } - main_script = { "My building type is unknown:\nBUILDING_TYPE", - "I have nothing meaningful to\nbecause of a chat setup error.", - "My chat dialogue setup failed.\nRight click at "..village_pos_str.."\nfor more details." - } - else - hi_script = villagers.copytable(villagers.chat[b_type].greetings) - bye_script = villagers.copytable(villagers.chat[b_type].goodbyes) - main_script = villagers.copytable(villagers.chat[b_type].mainchat) - end - villagers.getRandomChatText(self, hi_script, "vScriptHi", 3) - villagers.getRandomChatText(self, bye_script, "vScriptBye", 3) - villagers.getRandomChatText(self, main_script, "vScriptMain", 3) - villagers.getRandomChatText(self, villagers.copytable(villagers.chat.gtg), "vScriptGtg", 3) - villagers.getRandomChatText(self, villagers.copytable(villagers.chat.smalltalk), "vScriptSmalltalk", 3) - villagers.getRandomChatText(self, villagers.copytable(villagers.chat.gamefacts), "vScriptGameFacts", 2) - - -- set door position. currently same a spawn position, but will update soon - -- to action door position obtained from mg_villages parameters - self.vDoorPos = {x=final_pos.x, y=final_pos.y, z=final_pos.z} - - -- setup infotext - local infotext_string = "" - - if self.vTitle == "guest" then - infotext_string = infotext_string..string.upper(self.vName).." (guest)\n" - elseif self.vTitle == nil then - infotext_string = infotext_string..string.upper(self.vName).."\n" - else - infotext_string = infotext_string.."TRADER ("..self.vTitle..")\n"..self.vName.." " - end - infotext_string = infotext_string..self.vAge.." "..self.vGender.."\n".. - "Person #"..self.vBed.." from Plot #"..self.vPlot - - - -- save infotext to villager object - objectRef:set_properties({infotext = infotext_string }) - - -- set YAW - local yaw = villagers.YAWS[math.random(8)] - objectRef:set_yaw(yaw) - self.vYaw = yaw - self.vFacingDirection = villagers.getDirectionFromYaw(yaw) - - -- default to standing animation - self.object:set_animation( - {x=self.animation["stand_start"], y=self.animation["stand_end"]}, - self.animation_speed + math.random(10) - ) - - -- save texture string for debug output - self.vTextureString = newTexture - - - - -- save any found errors into the node metadata field 'errors' - if #errors > 0 then - if log then io.write("\n "..#errors.." ERRORS DETECTED: "..minetest.serialize(errors).." ") end - local prev_errors = village_meta:get_string("errors") - if prev_errors == "" then - if log then io.write("\n noPrevErrors insertingNewErrors ") end - village_meta:set_string("errors", minetest.serialize(errors)) - else - if log then io.write("\n prevErros: "..prev_errors.." ") end - local all_errors = {} - for i = 1, #errors do table.insert(all_errors, errors[i]) end - - local prev_err_table = minetest.deserialize(prev_errors) - for i = 1, #prev_err_table do table.insert(all_errors, prev_err_table[i]) end - - local all_err_str = minetest.serialize(all_errors) - if log then io.write("\n combinedErrors: "..all_err_str.." ") end - village_meta:set_string("errors", all_err_str) - end - if log then io.write("\n meta_errors: "..village_meta:get_string("errors").." ") end - - else - if log then io.write("\n No Errors detected.\n") end - end - - - -- save any changes (error messages) to this 'village formspec' - --io.write("\n Compiling village formspec... ") - local village_formspec = "size[12,7]background[0,0;0,0;gui_formbg.png;true]label[0,0;".. - "type: "..string.upper(village_type).." ".. - village_pos_str.."\n".. - "name: "..string.upper(village_data.name).."\n".. - "region: "..string.upper(region).."]" - - local saved_errors = village_meta:get_string("errors") - if saved_errors == "" then - --io.write("noErrorsFound ") - village_formspec = village_formspec.."label[0,1.5;(No Errors)]" - else - --io.write("\n errorsFound: "..saved_errors.." ") - local error_string = "" - local saved_err_table = minetest.deserialize(saved_errors) - for i = 1, #saved_err_table do - error_string = error_string.."- "..saved_err_table[i].."\n" - end - village_formspec = village_formspec.."label[0,1.5;"..error_string.."]" - end - village_meta:set_string("formspec", village_formspec) - --io.write("\n ##Village Formspec: "..village_formspec.." ") - - -- set infotext for village formspec - village_meta:set_string("infotext", "Village Information\n(right click to view)") - - -- indicate that this mob spawner location has now successfully - -- spawned a village. processing of this mob spawner will - -- be skipped the next time the LBM at this pos executes - spawn_meta:set_int("success", 1) - - --io.write("\n") - end -}) - -------------------------- --- ENTITY REGISTRATION -- -------------------------- -minetest.register_entity("villagers:villager", { - - -- Utilized Object Proerties - hp_max = 15, - collisionbox = {-0.25,-1.00,-0.25, 0.25,0.75,0.25}, - physical = true, - weight = 5, - visual = "mesh", - visual_size = {x=1.0, y=1.0}, - mesh = "character.b3d", - textures = {"character.png"}, - animation = { - stand_start = 0, stand_end = 79, - walk_start = 168, walk_end = 187, - dig_start = 189, dig_end = 198, - walkdig_start = 200, walkdig_end = 219 - }, - animation_speed = 25, - infotext = "[uninitialized villager]", - - -- custom fields - vName = "no-name", - vGender = "no-gender", - vAge = "adult", - vTexture = "character.png", - vSize = 1, - vBox = {-0.25,-1.00,-0.25, 0.25,0.75,0.25}, - vYaw = 0, - vYawSaved = 0, - vTimer = 0, - vAction = "STAND", - vDigging = nil, - vActionFrequency = 1, --rate in seconds villager updates action - vInitialChatDistance = 0, - vHudIds = {}, - vSoundHandle = nil, - vDespawned = nil, - - -- homeplace - vRegion = "UNASSIGNED", - vVillage = "UNASSIGNED", - vPlot = nil, - vType = "UNASSIGNED", - vSchem = "UNASSIGNED", - vBed = nil, - vUnknown = {}, - - -- pathfinding - vPos = {x=0,y=0,z=0}, - vFacingDirection = "N", - vOriginPos = {x=0,y=0,z=0}, - vOriginDistance = 0, - vOriginDistMax = 10, - vTotalDistance = 0, - vTargetPos = {x=0,y=0,z=0}, - vSpawnHeight = 0, - vTargetHeight = 0, - vTurnPreference = "right", - vWalkReady = false, - vDigReady = false, - vBedPos = nil, - vDoorPos = nil, - vJobPos = nil, - - -- chatting - vChatting = nil, - vChatReady = true, - vScriptHi = nil, - vScriptHiSaved = nil, - vScriptBye = nil, - vScriptByeSaved = nil, - vScriptGtg = nil, - vScriptGtgSaved = nil, - vScriptMain = nil, - vScriptMainSaved = nil, - vScriptSmalltalk = nil, - vScriptSmalltalkSaved = nil, - vScriptSmalltalk = nil, - vScriptSmalltalkSaved = nil, - vScriptGameFacts = nil, - vScriptGameFactsSaved = nil, - - -- trading - vID = "UNASSIGNED", - vIsTrader = false, - vTrading = nil, - vNodeMetaPos = {x=0,y=0,z=0}, - vBuy = {}, - vSell = {}, - vTitle = nil, - vTraded = false, - - -- debugging - vTextureString = nil, - - on_activate = function(self, staticdata, dtime_s) - local log = false - if log then io.write("\nACTIVATE ") end - - -- perform default action, whichi is standing idle animation - villagers.standVillager(self) - - if staticdata ~= "" then - if log then io.write("(existing) ") end - local data = minetest.deserialize(staticdata) - self.object:set_properties({textures={data.vTexture}}) - self.object:set_properties({visual_size=data.vSize}) - self.object:set_properties({collisionbox=data.vBox}) - self.object:set_properties({infotext=data.vInfo}) - self.object:set_properties({hp_max=data.vHP}) - self.object:setpos(data.vPos) - self.object:set_yaw(data.vYaw) - - self.vName = data.vName - self.vAge = data.vAge - self.vTexture = data.vTexture - self.vSize = data.vSize - self.vBox = data.vBox - self.vYaw = data.vYaw - self.vYawSaved = data.vYawSaved - self.vGender = data.vGender - self.vAction = data.vAction - self.vDigging = data.vDigging - self.vActionFrequency = data.vActionFrequency - self.vInitialChatDistance = 0 - self.vHudIds = data.vHudIds - self.vSoundHandle = data.vSoundHandle - self.vDespawned = nil - - -- homeplace - self.vRegion = data.vRegion - self.vVillage = data.vVillage - self.vPlot = data.vPlot - self.vType = data.vType - self.vSchem = data.vSchem - self.vBed = data.vBed - self.vUnknown = data.vUnknown - - -- pathfinding - self.vPos = data.vPos - self.vFacingDirection = data.vFacingDirection - self.vOriginPos = data.vOriginPos - self.vOriginDistance = data.vOriginDistance - self.vOriginDistMax = data.vOriginDistMax - self.vTotalDistance = data.vTotalDistance - self.vTargetPos = data.vTargetPos - self.vSpawnHeight = data.vSpawnHeight - self.vTargetHeight = data.vTargetHeight - self.vTurnPreference = data.vTurnPreference - self.vWalkReady = false - self.vDigReady = false - self.vBedPos = data.vBedPos - self.vDoorPos = data.vDoorPos - self.vJobPos = data.vJobPos - - -- chatting - self.vChatting = nil - self.vChatReady = true - self.vScriptHi = data.vScriptHi - self.vScriptHiSaved = data.vScriptHiSaved - self.vScriptBye = data.vScriptBye - self.vScriptByeSaved = data.vScriptByeSaved - self.vScriptGtg = data.vScriptGtg - self.vScriptGtgSaved = data.vScriptGtgSaved - self.vScriptMain = data.vScriptMain - self.vScriptMainSaved = data.vScriptMainSaved - self.vScriptSmalltalk = data.vScriptSmalltalk - self.vScriptSmalltalkSaved = data.vScriptSmalltalkSaved - self.vScriptGameFacts = data.vScriptGameFacts - self.vScriptGameFactsSaved = data.vScriptGameFactsSaved - - -- trading - self.vID = data.vID - self.vIsTrader = data.vIsTrader - self.vTrading = nil - self.vNodeMetaPos = data.vNodeMetaPos - self.vBuy = data.vBuy - self.vSell = data.vSell - self.vTitle = data.vTitle - self.vTraded = false - - -- debugging - self.vTextureString = data.vTextureString - - if log then io.write(string.upper(self.vName).." ") end - - if self.vDespawned then - if log then io.write("vDespawned="..tostring(self.vDespawned).." ") end - else - if log then io.write("vDespawned=NIL ") end - end - - local prior_saved_action = self.vAction - if prior_saved_action == "STAND" then - if log then io.write("loaded="..prior_saved_action.." ") end - elseif prior_saved_action == "TURN" then - if log then io.write("loaded="..prior_saved_action.." ") end - elseif prior_saved_action == "DIG" then - if log then io.write("loaded="..prior_saved_action.." ") end - if log then io.write("set_vAction=RESUMEDIG ") end - self.vAction = "RESUMEDIG" - elseif prior_saved_action == "REPLACE" then - if log then io.write("loaded="..prior_saved_action.." ") end - if log then io.write("set_vAction=RESUMEDIG ") end - self.vAction = "RESUMEDIG" - elseif prior_saved_action == "WALK" then - if log then io.write("loaded="..prior_saved_action.." ") end - elseif prior_saved_action == "WALKING" then - if log then io.write("loaded="..prior_saved_action.." ") end - if log then io.write("set_vAction=WALK ") end - self.vAction = "WALK" - self.object:setvelocity({x=0,y=0,z=0}) - elseif prior_saved_action == "TURNBACK" then - if log then io.write("loaded="..prior_saved_action.." ") end - elseif prior_saved_action == "WALKBACK" then - if log then io.write("loaded="..prior_saved_action.." ") end - elseif prior_saved_action == "CHAT" or prior_saved_action == "ENDCHAT" then - if log then io.write("loaded="..prior_saved_action.." ") end - if log then io.write("set_vAction=STAND ") end - self.vAction = "STAND" - elseif prior_saved_action == "TRADE" or prior_saved_action == "ENDTRADE" then - if log then io.write("loaded="..prior_saved_action.." ") end - if log then io.write("set_vAction=STAND ") end - self.vAction = "STAND" - else - if log then io.write("ERROR vAction="..prior_saved_action.." ") end - end - - else - if log then io.write("(new) "..string.upper(self.vName).." ") end - end - - if log then io.write("onActivateEND. ") end - - end, - - on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir) - villagers.on_leftclick(self, puncher, time_from_last_punch) - end, - - on_rightclick = function(self, clicker) villagers.on_rightclick(self, clicker) end, - - on_step = function(self, dtime) villagers.on_step(self, dtime) end, - - get_staticdata = function(self) - local log = false - if log then - io.write("\ngetStatic() ") - end - - if self.vDespawned == false then - if log then - io.write("DESPAWNED plot #"..self.vPlot.." person #"..self.vBed.." "..self.vName.." "..string.upper(self.vVillage).." ") - end - - - else - self.vDespawned = false - if log then io.write(" SPAWNED ") end - - -- villager is spawning for first time and not - -- completely initialized yet - if self.vID == "UNASSIGNED" then - - -- this is an existing villager re-spawning - else - - end - - -- show standing animation while waiting - -- for the first action cycle to start - self.object:set_animation( - {x=self.animation["stand_start"], y=self.animation["stand_end"]}, - self.animation_speed + math.random(10) - ) - end - - -- save all custom fields - local objProps = self.object:get_properties() - local villager_data = { - vInfo = objProps.infotext, - vHP = objProps.hp_max, - - vName = self.vName, - vAge = self.vAge, - vTexture = self.vTexture, - vSize = self.vSize, - vBox = self.vBox, - vYaw = self.vYaw, - vYawSaved = self.vYawSaved, - vGender = self.vGender, - vTimer = self.vTimer, - vAction = self.vAction, - vDigging = self.vDigging, - vActionFrequency = self.vActionFrequency, - vInitialChatDistance = 0, - vHudIds = self.vHudIds, - vSoundHandle = self.vSoundHandle, - vDespawned = self.vDespawned, - - -- homeplace - vRegion = self.vRegion, - vVillage = self.vVillage, - vPlot = self.vPlot, - vType = self.vType, - vSchem = self.vSchem, - vBed = self.vBed, - vUnknown = self.vUnknown, - - -- pathfinding - vPos = self.vPos, - vFacingDirection = self.vFacingDirection, - vOriginPos = self.vOriginPos, - vOriginDistance = self.vOriginDistance, - vOriginDistMax = self.vOriginDistMax, - vTotalDistance = self.vTotalDistance, - vTargetPos = self.vTargetPos, - vSpawnHeight = self.vSpawnHeight, - vTargetHeight = self.vTargetHeight, - vTurnPreference = self.vTurnPreference, - vWalkReady = false, - vDigReady = false, - vBedPos = self.vBed, - vDoorPos = self.vDoor, - vJobPos = self.vDoor, - - -- chatting - vChatting = nil, - vChatReady = true, - vScriptHi = self.vScriptHi, - vScriptHiSaved = self.vScriptHiSaved, - vScriptBye = self.vScriptBye, - vScriptByeSaved = self.vScriptByeSaved, - vScriptGtg = self.vScriptGtg, - vScriptGtgSaved = self.vScriptGtgSaved, - vScriptMain = self.vScriptMain, - vScriptMainSaved = self.vScriptMainSaved, - vScriptSmalltalk = self.vScriptSmalltalk, - vScriptSmalltalkSaved = self.vScriptSmalltalkSaved, - vScriptGameFacts = self.vScriptGameFacts, - vScriptGameFactsSaved = self.vScriptGameFactsSaved, - - -- trading - vID = self.vID, - vIsTrader = self.vIsTrader, - vTrading = nil, - vNodeMetaPos = self.vNodeMetaPos, - vBuy = self.vBuy, - vSell = self.vSell, - vTitle = self.vTitle, - vTraded = false, - - -- debugging - vTextureString = self.vTextureString, - - } - - return minetest.serialize(villager_data) - end, - -}) diff --git a/mods/villagers/textures/Thumbs.db b/mods/villagers/textures/Thumbs.db deleted file mode 100644 index 0faddb0..0000000 Binary files a/mods/villagers/textures/Thumbs.db and /dev/null differ diff --git a/mods/villagers/textures/alert_box.png b/mods/villagers/textures/alert_box.png deleted file mode 100644 index fd91423..0000000 Binary files a/mods/villagers/textures/alert_box.png and /dev/null differ diff --git a/mods/villagers/textures/armor_01.png b/mods/villagers/textures/armor_01.png deleted file mode 100644 index 0967e78..0000000 Binary files a/mods/villagers/textures/armor_01.png and /dev/null differ diff --git a/mods/villagers/textures/armor_01b.png b/mods/villagers/textures/armor_01b.png deleted file mode 100644 index a0c0bdd..0000000 Binary files a/mods/villagers/textures/armor_01b.png and /dev/null differ diff --git a/mods/villagers/textures/armor_01c.png b/mods/villagers/textures/armor_01c.png deleted file mode 100644 index 55032aa..0000000 Binary files a/mods/villagers/textures/armor_01c.png and /dev/null differ diff --git a/mods/villagers/textures/armor_02.png b/mods/villagers/textures/armor_02.png deleted file mode 100644 index 197fb49..0000000 Binary files a/mods/villagers/textures/armor_02.png and /dev/null differ diff --git a/mods/villagers/textures/armor_02b.png b/mods/villagers/textures/armor_02b.png deleted file mode 100644 index 6998ecf..0000000 Binary files a/mods/villagers/textures/armor_02b.png and /dev/null differ diff --git a/mods/villagers/textures/armor_02c.png b/mods/villagers/textures/armor_02c.png deleted file mode 100644 index baf28ac..0000000 Binary files a/mods/villagers/textures/armor_02c.png and /dev/null differ diff --git a/mods/villagers/textures/armor_03.png b/mods/villagers/textures/armor_03.png deleted file mode 100644 index cf71840..0000000 Binary files a/mods/villagers/textures/armor_03.png and /dev/null differ diff --git a/mods/villagers/textures/armor_03b.png b/mods/villagers/textures/armor_03b.png deleted file mode 100644 index b681f78..0000000 Binary files a/mods/villagers/textures/armor_03b.png and /dev/null differ diff --git a/mods/villagers/textures/armor_03c.png b/mods/villagers/textures/armor_03c.png deleted file mode 100644 index 4ffbee4..0000000 Binary files a/mods/villagers/textures/armor_03c.png and /dev/null differ diff --git a/mods/villagers/textures/armor_fem_01.png b/mods/villagers/textures/armor_fem_01.png deleted file mode 100644 index cd6b927..0000000 Binary files a/mods/villagers/textures/armor_fem_01.png and /dev/null differ diff --git a/mods/villagers/textures/armor_fem_01b.png b/mods/villagers/textures/armor_fem_01b.png deleted file mode 100644 index 7bb1f89..0000000 Binary files a/mods/villagers/textures/armor_fem_01b.png and /dev/null differ diff --git a/mods/villagers/textures/armor_fem_01c.png b/mods/villagers/textures/armor_fem_01c.png deleted file mode 100644 index 1a9b0b0..0000000 Binary files a/mods/villagers/textures/armor_fem_01c.png and /dev/null differ diff --git a/mods/villagers/textures/backpack_01.png b/mods/villagers/textures/backpack_01.png deleted file mode 100644 index e5039c1..0000000 Binary files a/mods/villagers/textures/backpack_01.png and /dev/null differ diff --git a/mods/villagers/textures/backpack_02.png b/mods/villagers/textures/backpack_02.png deleted file mode 100644 index cc1b443..0000000 Binary files a/mods/villagers/textures/backpack_02.png and /dev/null differ diff --git a/mods/villagers/textures/backpack_03.png b/mods/villagers/textures/backpack_03.png deleted file mode 100644 index ec06473..0000000 Binary files a/mods/villagers/textures/backpack_03.png and /dev/null differ diff --git a/mods/villagers/textures/backpack_04.png b/mods/villagers/textures/backpack_04.png deleted file mode 100644 index 11d3e33..0000000 Binary files a/mods/villagers/textures/backpack_04.png and /dev/null differ diff --git a/mods/villagers/textures/backpack_05.png b/mods/villagers/textures/backpack_05.png deleted file mode 100644 index c0aead6..0000000 Binary files a/mods/villagers/textures/backpack_05.png and /dev/null differ diff --git a/mods/villagers/textures/backpack_06.png b/mods/villagers/textures/backpack_06.png deleted file mode 100644 index 52c9084..0000000 Binary files a/mods/villagers/textures/backpack_06.png and /dev/null differ diff --git a/mods/villagers/textures/blank.png b/mods/villagers/textures/blank.png deleted file mode 100644 index cfc49b8..0000000 Binary files a/mods/villagers/textures/blank.png and /dev/null differ diff --git a/mods/villagers/textures/body_dark_01.png b/mods/villagers/textures/body_dark_01.png deleted file mode 100644 index b9e3b26..0000000 Binary files a/mods/villagers/textures/body_dark_01.png and /dev/null differ diff --git a/mods/villagers/textures/body_light_01.png b/mods/villagers/textures/body_light_01.png deleted file mode 100644 index f27d1ed..0000000 Binary files a/mods/villagers/textures/body_light_01.png and /dev/null differ diff --git a/mods/villagers/textures/body_medium_01.png b/mods/villagers/textures/body_medium_01.png deleted file mode 100644 index ca71592..0000000 Binary files a/mods/villagers/textures/body_medium_01.png and /dev/null differ diff --git a/mods/villagers/textures/body_tan_01.png b/mods/villagers/textures/body_tan_01.png deleted file mode 100644 index 25090df..0000000 Binary files a/mods/villagers/textures/body_tan_01.png and /dev/null differ diff --git a/mods/villagers/textures/boots_01.png b/mods/villagers/textures/boots_01.png deleted file mode 100644 index 0207bca..0000000 Binary files a/mods/villagers/textures/boots_01.png and /dev/null differ diff --git a/mods/villagers/textures/boots_dark_01.png b/mods/villagers/textures/boots_dark_01.png deleted file mode 100644 index 2f79572..0000000 Binary files a/mods/villagers/textures/boots_dark_01.png and /dev/null differ diff --git a/mods/villagers/textures/bubble_villager_behind.png b/mods/villagers/textures/bubble_villager_behind.png deleted file mode 100644 index 8e2db89..0000000 Binary files a/mods/villagers/textures/bubble_villager_behind.png and /dev/null differ diff --git a/mods/villagers/textures/bubble_villager_behindleft.png b/mods/villagers/textures/bubble_villager_behindleft.png deleted file mode 100644 index b82e959..0000000 Binary files a/mods/villagers/textures/bubble_villager_behindleft.png and /dev/null differ diff --git a/mods/villagers/textures/bubble_villager_behindright.png b/mods/villagers/textures/bubble_villager_behindright.png deleted file mode 100644 index bc09d49..0000000 Binary files a/mods/villagers/textures/bubble_villager_behindright.png and /dev/null differ diff --git a/mods/villagers/textures/bubble_villager_front.png b/mods/villagers/textures/bubble_villager_front.png deleted file mode 100644 index 723bd63..0000000 Binary files a/mods/villagers/textures/bubble_villager_front.png and /dev/null differ diff --git a/mods/villagers/textures/bubble_villager_frontleft.png b/mods/villagers/textures/bubble_villager_frontleft.png deleted file mode 100644 index cf66787..0000000 Binary files a/mods/villagers/textures/bubble_villager_frontleft.png and /dev/null differ diff --git a/mods/villagers/textures/bubble_villager_frontright.png b/mods/villagers/textures/bubble_villager_frontright.png deleted file mode 100644 index 408b72c..0000000 Binary files a/mods/villagers/textures/bubble_villager_frontright.png and /dev/null differ diff --git a/mods/villagers/textures/bubble_villager_left.png b/mods/villagers/textures/bubble_villager_left.png deleted file mode 100644 index 2c3a011..0000000 Binary files a/mods/villagers/textures/bubble_villager_left.png and /dev/null differ diff --git a/mods/villagers/textures/bubble_villager_right.png b/mods/villagers/textures/bubble_villager_right.png deleted file mode 100644 index 2fb9e99..0000000 Binary files a/mods/villagers/textures/bubble_villager_right.png and /dev/null differ diff --git a/mods/villagers/textures/coins.png b/mods/villagers/textures/coins.png deleted file mode 100644 index b399269..0000000 Binary files a/mods/villagers/textures/coins.png and /dev/null differ diff --git a/mods/villagers/textures/coins_g.png b/mods/villagers/textures/coins_g.png deleted file mode 100644 index b82acc3..0000000 Binary files a/mods/villagers/textures/coins_g.png and /dev/null differ diff --git a/mods/villagers/textures/collar_01.png b/mods/villagers/textures/collar_01.png deleted file mode 100644 index ecb80c3..0000000 Binary files a/mods/villagers/textures/collar_01.png and /dev/null differ diff --git a/mods/villagers/textures/cross_01.png b/mods/villagers/textures/cross_01.png deleted file mode 100644 index 4467b3b..0000000 Binary files a/mods/villagers/textures/cross_01.png and /dev/null differ diff --git a/mods/villagers/textures/cross_01b.png b/mods/villagers/textures/cross_01b.png deleted file mode 100644 index dfb8cf2..0000000 Binary files a/mods/villagers/textures/cross_01b.png and /dev/null differ diff --git a/mods/villagers/textures/cross_01c.png b/mods/villagers/textures/cross_01c.png deleted file mode 100644 index fe075ee..0000000 Binary files a/mods/villagers/textures/cross_01c.png and /dev/null differ diff --git a/mods/villagers/textures/dress_longsleeves_dark_01.png b/mods/villagers/textures/dress_longsleeves_dark_01.png deleted file mode 100644 index 8073756..0000000 Binary files a/mods/villagers/textures/dress_longsleeves_dark_01.png and /dev/null differ diff --git a/mods/villagers/textures/dress_longsleeves_med2_01.png b/mods/villagers/textures/dress_longsleeves_med2_01.png deleted file mode 100644 index 906d245..0000000 Binary files a/mods/villagers/textures/dress_longsleeves_med2_01.png and /dev/null differ diff --git a/mods/villagers/textures/dress_longsleeves_med_01.png b/mods/villagers/textures/dress_longsleeves_med_01.png deleted file mode 100644 index 471d929..0000000 Binary files a/mods/villagers/textures/dress_longsleeves_med_01.png and /dev/null differ diff --git a/mods/villagers/textures/dress_longsleeves_med_02.png b/mods/villagers/textures/dress_longsleeves_med_02.png deleted file mode 100644 index 60ba547..0000000 Binary files a/mods/villagers/textures/dress_longsleeves_med_02.png and /dev/null differ diff --git a/mods/villagers/textures/dress_shortsleeves_dark_01.png b/mods/villagers/textures/dress_shortsleeves_dark_01.png deleted file mode 100644 index 5656dd3..0000000 Binary files a/mods/villagers/textures/dress_shortsleeves_dark_01.png and /dev/null differ diff --git a/mods/villagers/textures/dress_shortsleeves_med2_01.png b/mods/villagers/textures/dress_shortsleeves_med2_01.png deleted file mode 100644 index 503d7e9..0000000 Binary files a/mods/villagers/textures/dress_shortsleeves_med2_01.png and /dev/null differ diff --git a/mods/villagers/textures/eye_glasses_01.png b/mods/villagers/textures/eye_glasses_01.png deleted file mode 100644 index 7375519..0000000 Binary files a/mods/villagers/textures/eye_glasses_01.png and /dev/null differ diff --git a/mods/villagers/textures/eyes_iris_med.png b/mods/villagers/textures/eyes_iris_med.png deleted file mode 100644 index 39a1064..0000000 Binary files a/mods/villagers/textures/eyes_iris_med.png and /dev/null differ diff --git a/mods/villagers/textures/eyes_iris_sm.png b/mods/villagers/textures/eyes_iris_sm.png deleted file mode 100644 index 8ba323a..0000000 Binary files a/mods/villagers/textures/eyes_iris_sm.png and /dev/null differ diff --git a/mods/villagers/textures/eyes_whites_med.png b/mods/villagers/textures/eyes_whites_med.png deleted file mode 100644 index e2cb716..0000000 Binary files a/mods/villagers/textures/eyes_whites_med.png and /dev/null differ diff --git a/mods/villagers/textures/eyes_whites_med2.png b/mods/villagers/textures/eyes_whites_med2.png deleted file mode 100644 index de7eff6..0000000 Binary files a/mods/villagers/textures/eyes_whites_med2.png and /dev/null differ diff --git a/mods/villagers/textures/eyes_whites_sm.png b/mods/villagers/textures/eyes_whites_sm.png deleted file mode 100644 index eff9873..0000000 Binary files a/mods/villagers/textures/eyes_whites_sm.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_00.png b/mods/villagers/textures/hair_female_00.png deleted file mode 100644 index 88ade8e..0000000 Binary files a/mods/villagers/textures/hair_female_00.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_02.png b/mods/villagers/textures/hair_female_02.png deleted file mode 100644 index 3197f72..0000000 Binary files a/mods/villagers/textures/hair_female_02.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_03.png b/mods/villagers/textures/hair_female_03.png deleted file mode 100644 index fb10aa4..0000000 Binary files a/mods/villagers/textures/hair_female_03.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_04.png b/mods/villagers/textures/hair_female_04.png deleted file mode 100644 index 15a0549..0000000 Binary files a/mods/villagers/textures/hair_female_04.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_05.png b/mods/villagers/textures/hair_female_05.png deleted file mode 100644 index ae8c471..0000000 Binary files a/mods/villagers/textures/hair_female_05.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_06.png b/mods/villagers/textures/hair_female_06.png deleted file mode 100644 index 6e4f672..0000000 Binary files a/mods/villagers/textures/hair_female_06.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_07.png b/mods/villagers/textures/hair_female_07.png deleted file mode 100644 index c552e0a..0000000 Binary files a/mods/villagers/textures/hair_female_07.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_08.png b/mods/villagers/textures/hair_female_08.png deleted file mode 100644 index 99e36f9..0000000 Binary files a/mods/villagers/textures/hair_female_08.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_09.png b/mods/villagers/textures/hair_female_09.png deleted file mode 100644 index 70cee92..0000000 Binary files a/mods/villagers/textures/hair_female_09.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_10.png b/mods/villagers/textures/hair_female_10.png deleted file mode 100644 index b59c2cf..0000000 Binary files a/mods/villagers/textures/hair_female_10.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_11.png b/mods/villagers/textures/hair_female_11.png deleted file mode 100644 index bf2a177..0000000 Binary files a/mods/villagers/textures/hair_female_11.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_12.png b/mods/villagers/textures/hair_female_12.png deleted file mode 100644 index 5970d23..0000000 Binary files a/mods/villagers/textures/hair_female_12.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_13.png b/mods/villagers/textures/hair_female_13.png deleted file mode 100644 index 5b65a95..0000000 Binary files a/mods/villagers/textures/hair_female_13.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_14.png b/mods/villagers/textures/hair_female_14.png deleted file mode 100644 index 7a56daf..0000000 Binary files a/mods/villagers/textures/hair_female_14.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_15.png b/mods/villagers/textures/hair_female_15.png deleted file mode 100644 index 2422483..0000000 Binary files a/mods/villagers/textures/hair_female_15.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_16.png b/mods/villagers/textures/hair_female_16.png deleted file mode 100644 index 721ba3f..0000000 Binary files a/mods/villagers/textures/hair_female_16.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_17.png b/mods/villagers/textures/hair_female_17.png deleted file mode 100644 index bbcd344..0000000 Binary files a/mods/villagers/textures/hair_female_17.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_18.png b/mods/villagers/textures/hair_female_18.png deleted file mode 100644 index cb6ef51..0000000 Binary files a/mods/villagers/textures/hair_female_18.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_20.png b/mods/villagers/textures/hair_female_20.png deleted file mode 100644 index ab41af4..0000000 Binary files a/mods/villagers/textures/hair_female_20.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_21.png b/mods/villagers/textures/hair_female_21.png deleted file mode 100644 index bee80a8..0000000 Binary files a/mods/villagers/textures/hair_female_21.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_22.png b/mods/villagers/textures/hair_female_22.png deleted file mode 100644 index de2f2ce..0000000 Binary files a/mods/villagers/textures/hair_female_22.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_23.png b/mods/villagers/textures/hair_female_23.png deleted file mode 100644 index 6b06794..0000000 Binary files a/mods/villagers/textures/hair_female_23.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_27.png b/mods/villagers/textures/hair_female_27.png deleted file mode 100644 index 1b38976..0000000 Binary files a/mods/villagers/textures/hair_female_27.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_28.png b/mods/villagers/textures/hair_female_28.png deleted file mode 100644 index 30f0edd..0000000 Binary files a/mods/villagers/textures/hair_female_28.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_29.png b/mods/villagers/textures/hair_female_29.png deleted file mode 100644 index 9e5d3f6..0000000 Binary files a/mods/villagers/textures/hair_female_29.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_30.png b/mods/villagers/textures/hair_female_30.png deleted file mode 100644 index 43dc3b9..0000000 Binary files a/mods/villagers/textures/hair_female_30.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_31.png b/mods/villagers/textures/hair_female_31.png deleted file mode 100644 index 9803b47..0000000 Binary files a/mods/villagers/textures/hair_female_31.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_32.png b/mods/villagers/textures/hair_female_32.png deleted file mode 100644 index 17e405d..0000000 Binary files a/mods/villagers/textures/hair_female_32.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_old_01.png b/mods/villagers/textures/hair_female_old_01.png deleted file mode 100644 index 6ad0073..0000000 Binary files a/mods/villagers/textures/hair_female_old_01.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_old_02.png b/mods/villagers/textures/hair_female_old_02.png deleted file mode 100644 index 812d103..0000000 Binary files a/mods/villagers/textures/hair_female_old_02.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_old_03.png b/mods/villagers/textures/hair_female_old_03.png deleted file mode 100644 index 4ca173b..0000000 Binary files a/mods/villagers/textures/hair_female_old_03.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_old_04.png b/mods/villagers/textures/hair_female_old_04.png deleted file mode 100644 index 7ba4610..0000000 Binary files a/mods/villagers/textures/hair_female_old_04.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_old_05.png b/mods/villagers/textures/hair_female_old_05.png deleted file mode 100644 index d669f6f..0000000 Binary files a/mods/villagers/textures/hair_female_old_05.png and /dev/null differ diff --git a/mods/villagers/textures/hair_female_old_06.png b/mods/villagers/textures/hair_female_old_06.png deleted file mode 100644 index 6147f7f..0000000 Binary files a/mods/villagers/textures/hair_female_old_06.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_02.png b/mods/villagers/textures/hair_male_02.png deleted file mode 100644 index 7655c0e..0000000 Binary files a/mods/villagers/textures/hair_male_02.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_03.png b/mods/villagers/textures/hair_male_03.png deleted file mode 100644 index 0a39b0d..0000000 Binary files a/mods/villagers/textures/hair_male_03.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_04.png b/mods/villagers/textures/hair_male_04.png deleted file mode 100644 index 55fa917..0000000 Binary files a/mods/villagers/textures/hair_male_04.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_05.png b/mods/villagers/textures/hair_male_05.png deleted file mode 100644 index 4797c66..0000000 Binary files a/mods/villagers/textures/hair_male_05.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_06.png b/mods/villagers/textures/hair_male_06.png deleted file mode 100644 index 2c744f1..0000000 Binary files a/mods/villagers/textures/hair_male_06.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_07.png b/mods/villagers/textures/hair_male_07.png deleted file mode 100644 index 81d4bd8..0000000 Binary files a/mods/villagers/textures/hair_male_07.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_08.png b/mods/villagers/textures/hair_male_08.png deleted file mode 100644 index 3fe62f1..0000000 Binary files a/mods/villagers/textures/hair_male_08.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_09.png b/mods/villagers/textures/hair_male_09.png deleted file mode 100644 index 49160dd..0000000 Binary files a/mods/villagers/textures/hair_male_09.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_11.png b/mods/villagers/textures/hair_male_11.png deleted file mode 100644 index f98973f..0000000 Binary files a/mods/villagers/textures/hair_male_11.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_13.png b/mods/villagers/textures/hair_male_13.png deleted file mode 100644 index ab3b5ac..0000000 Binary files a/mods/villagers/textures/hair_male_13.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_14.png b/mods/villagers/textures/hair_male_14.png deleted file mode 100644 index 5ac07ca..0000000 Binary files a/mods/villagers/textures/hair_male_14.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_18.png b/mods/villagers/textures/hair_male_18.png deleted file mode 100644 index b56a0c5..0000000 Binary files a/mods/villagers/textures/hair_male_18.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_19.png b/mods/villagers/textures/hair_male_19.png deleted file mode 100644 index 7fe6fc7..0000000 Binary files a/mods/villagers/textures/hair_male_19.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_20.png b/mods/villagers/textures/hair_male_20.png deleted file mode 100644 index fc98b39..0000000 Binary files a/mods/villagers/textures/hair_male_20.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_21.png b/mods/villagers/textures/hair_male_21.png deleted file mode 100644 index fe333c9..0000000 Binary files a/mods/villagers/textures/hair_male_21.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_22.png b/mods/villagers/textures/hair_male_22.png deleted file mode 100644 index a8dd45e..0000000 Binary files a/mods/villagers/textures/hair_male_22.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_old_01.png b/mods/villagers/textures/hair_male_old_01.png deleted file mode 100644 index dec1ae3..0000000 Binary files a/mods/villagers/textures/hair_male_old_01.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_old_02.png b/mods/villagers/textures/hair_male_old_02.png deleted file mode 100644 index d0d84fc..0000000 Binary files a/mods/villagers/textures/hair_male_old_02.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_old_03.png b/mods/villagers/textures/hair_male_old_03.png deleted file mode 100644 index fbb9953..0000000 Binary files a/mods/villagers/textures/hair_male_old_03.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_old_04.png b/mods/villagers/textures/hair_male_old_04.png deleted file mode 100644 index c3fa184..0000000 Binary files a/mods/villagers/textures/hair_male_old_04.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_old_05.png b/mods/villagers/textures/hair_male_old_05.png deleted file mode 100644 index 63ecbe5..0000000 Binary files a/mods/villagers/textures/hair_male_old_05.png and /dev/null differ diff --git a/mods/villagers/textures/hair_male_old_06.png b/mods/villagers/textures/hair_male_old_06.png deleted file mode 100644 index 6ac91fd..0000000 Binary files a/mods/villagers/textures/hair_male_old_06.png and /dev/null differ diff --git a/mods/villagers/textures/helmet_01.png b/mods/villagers/textures/helmet_01.png deleted file mode 100644 index 211edeb..0000000 Binary files a/mods/villagers/textures/helmet_01.png and /dev/null differ diff --git a/mods/villagers/textures/helmet_02.png b/mods/villagers/textures/helmet_02.png deleted file mode 100644 index 984a63b..0000000 Binary files a/mods/villagers/textures/helmet_02.png and /dev/null differ diff --git a/mods/villagers/textures/jacket_01.png b/mods/villagers/textures/jacket_01.png deleted file mode 100644 index 4666a0e..0000000 Binary files a/mods/villagers/textures/jacket_01.png and /dev/null differ diff --git a/mods/villagers/textures/mouth_01.png b/mods/villagers/textures/mouth_01.png deleted file mode 100644 index 2c66e51..0000000 Binary files a/mods/villagers/textures/mouth_01.png and /dev/null differ diff --git a/mods/villagers/textures/mouth_02.png b/mods/villagers/textures/mouth_02.png deleted file mode 100644 index 5b30523..0000000 Binary files a/mods/villagers/textures/mouth_02.png and /dev/null differ diff --git a/mods/villagers/textures/mouth_03.png b/mods/villagers/textures/mouth_03.png deleted file mode 100644 index 4eb45d3..0000000 Binary files a/mods/villagers/textures/mouth_03.png and /dev/null differ diff --git a/mods/villagers/textures/mouth_04.png b/mods/villagers/textures/mouth_04.png deleted file mode 100644 index c80dbbb..0000000 Binary files a/mods/villagers/textures/mouth_04.png and /dev/null differ diff --git a/mods/villagers/textures/mouth_05.png b/mods/villagers/textures/mouth_05.png deleted file mode 100644 index 3ee2890..0000000 Binary files a/mods/villagers/textures/mouth_05.png and /dev/null differ diff --git a/mods/villagers/textures/pants_01.png b/mods/villagers/textures/pants_01.png deleted file mode 100644 index b3c5948..0000000 Binary files a/mods/villagers/textures/pants_01.png and /dev/null differ diff --git a/mods/villagers/textures/pants_02.png b/mods/villagers/textures/pants_02.png deleted file mode 100644 index a56b0ea..0000000 Binary files a/mods/villagers/textures/pants_02.png and /dev/null differ diff --git a/mods/villagers/textures/pants_dark_01.png b/mods/villagers/textures/pants_dark_01.png deleted file mode 100644 index 0a8d535..0000000 Binary files a/mods/villagers/textures/pants_dark_01.png and /dev/null differ diff --git a/mods/villagers/textures/pants_dark_02.png b/mods/villagers/textures/pants_dark_02.png deleted file mode 100644 index 50c960f..0000000 Binary files a/mods/villagers/textures/pants_dark_02.png and /dev/null differ diff --git a/mods/villagers/textures/pants_med_01.png b/mods/villagers/textures/pants_med_01.png deleted file mode 100644 index 237b58c..0000000 Binary files a/mods/villagers/textures/pants_med_01.png and /dev/null differ diff --git a/mods/villagers/textures/pants_med_02.png b/mods/villagers/textures/pants_med_02.png deleted file mode 100644 index dfcfb01..0000000 Binary files a/mods/villagers/textures/pants_med_02.png and /dev/null differ diff --git a/mods/villagers/textures/priest_01.png b/mods/villagers/textures/priest_01.png deleted file mode 100644 index 0baa44e..0000000 Binary files a/mods/villagers/textures/priest_01.png and /dev/null differ diff --git a/mods/villagers/textures/sandals_01.png b/mods/villagers/textures/sandals_01.png deleted file mode 100644 index 913e05f..0000000 Binary files a/mods/villagers/textures/sandals_01.png and /dev/null differ diff --git a/mods/villagers/textures/sandals_02.png b/mods/villagers/textures/sandals_02.png deleted file mode 100644 index be36ac0..0000000 Binary files a/mods/villagers/textures/sandals_02.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_long_dark_01.png b/mods/villagers/textures/shirt_long_dark_01.png deleted file mode 100644 index d96dbe3..0000000 Binary files a/mods/villagers/textures/shirt_long_dark_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_long_dark_02.png b/mods/villagers/textures/shirt_long_dark_02.png deleted file mode 100644 index 2b39a67..0000000 Binary files a/mods/villagers/textures/shirt_long_dark_02.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_long_dark_03.png b/mods/villagers/textures/shirt_long_dark_03.png deleted file mode 100644 index 7894235..0000000 Binary files a/mods/villagers/textures/shirt_long_dark_03.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_long_dark_04.png b/mods/villagers/textures/shirt_long_dark_04.png deleted file mode 100644 index 8503685..0000000 Binary files a/mods/villagers/textures/shirt_long_dark_04.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_long_dark_05.png b/mods/villagers/textures/shirt_long_dark_05.png deleted file mode 100644 index 1748132..0000000 Binary files a/mods/villagers/textures/shirt_long_dark_05.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_long_dark_female_01.png b/mods/villagers/textures/shirt_long_dark_female_01.png deleted file mode 100644 index be41de4..0000000 Binary files a/mods/villagers/textures/shirt_long_dark_female_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_long_med_01.png b/mods/villagers/textures/shirt_long_med_01.png deleted file mode 100644 index cf264f9..0000000 Binary files a/mods/villagers/textures/shirt_long_med_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_long_med_02.png b/mods/villagers/textures/shirt_long_med_02.png deleted file mode 100644 index f71e317..0000000 Binary files a/mods/villagers/textures/shirt_long_med_02.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_long_med_03.png b/mods/villagers/textures/shirt_long_med_03.png deleted file mode 100644 index 7c55585..0000000 Binary files a/mods/villagers/textures/shirt_long_med_03.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_long_med_04.png b/mods/villagers/textures/shirt_long_med_04.png deleted file mode 100644 index 07d8f19..0000000 Binary files a/mods/villagers/textures/shirt_long_med_04.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_long_med_05.png b/mods/villagers/textures/shirt_long_med_05.png deleted file mode 100644 index 99a93f5..0000000 Binary files a/mods/villagers/textures/shirt_long_med_05.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_long_med_female_01.png b/mods/villagers/textures/shirt_long_med_female_01.png deleted file mode 100644 index 0a629e5..0000000 Binary files a/mods/villagers/textures/shirt_long_med_female_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_long_priest_dark_01.png b/mods/villagers/textures/shirt_long_priest_dark_01.png deleted file mode 100644 index 1dbe80c..0000000 Binary files a/mods/villagers/textures/shirt_long_priest_dark_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_long_priest_med_01.png b/mods/villagers/textures/shirt_long_priest_med_01.png deleted file mode 100644 index 51b2397..0000000 Binary files a/mods/villagers/textures/shirt_long_priest_med_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_nosleeve_dark_01.png b/mods/villagers/textures/shirt_nosleeve_dark_01.png deleted file mode 100644 index 0e34916..0000000 Binary files a/mods/villagers/textures/shirt_nosleeve_dark_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_nosleeve_dark_02.png b/mods/villagers/textures/shirt_nosleeve_dark_02.png deleted file mode 100644 index 7690022..0000000 Binary files a/mods/villagers/textures/shirt_nosleeve_dark_02.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_nosleeve_dark_03.png b/mods/villagers/textures/shirt_nosleeve_dark_03.png deleted file mode 100644 index 0deb748..0000000 Binary files a/mods/villagers/textures/shirt_nosleeve_dark_03.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_nosleeve_dark_04.png b/mods/villagers/textures/shirt_nosleeve_dark_04.png deleted file mode 100644 index 88abf8a..0000000 Binary files a/mods/villagers/textures/shirt_nosleeve_dark_04.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_nosleeve_dark_05.png b/mods/villagers/textures/shirt_nosleeve_dark_05.png deleted file mode 100644 index abdddd3..0000000 Binary files a/mods/villagers/textures/shirt_nosleeve_dark_05.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_nosleeve_med_01.png b/mods/villagers/textures/shirt_nosleeve_med_01.png deleted file mode 100644 index 7447a38..0000000 Binary files a/mods/villagers/textures/shirt_nosleeve_med_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_nosleeve_med_02.png b/mods/villagers/textures/shirt_nosleeve_med_02.png deleted file mode 100644 index af79630..0000000 Binary files a/mods/villagers/textures/shirt_nosleeve_med_02.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_nosleeve_med_03.png b/mods/villagers/textures/shirt_nosleeve_med_03.png deleted file mode 100644 index 70fbbc4..0000000 Binary files a/mods/villagers/textures/shirt_nosleeve_med_03.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_nosleeve_med_04.png b/mods/villagers/textures/shirt_nosleeve_med_04.png deleted file mode 100644 index b493131..0000000 Binary files a/mods/villagers/textures/shirt_nosleeve_med_04.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_nosleeve_med_05.png b/mods/villagers/textures/shirt_nosleeve_med_05.png deleted file mode 100644 index de524c5..0000000 Binary files a/mods/villagers/textures/shirt_nosleeve_med_05.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_short_dark_01.png b/mods/villagers/textures/shirt_short_dark_01.png deleted file mode 100644 index d7c370a..0000000 Binary files a/mods/villagers/textures/shirt_short_dark_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_short_dark_02.png b/mods/villagers/textures/shirt_short_dark_02.png deleted file mode 100644 index 3242065..0000000 Binary files a/mods/villagers/textures/shirt_short_dark_02.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_short_dark_03.png b/mods/villagers/textures/shirt_short_dark_03.png deleted file mode 100644 index 440a241..0000000 Binary files a/mods/villagers/textures/shirt_short_dark_03.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_short_dark_04.png b/mods/villagers/textures/shirt_short_dark_04.png deleted file mode 100644 index 87cc0d5..0000000 Binary files a/mods/villagers/textures/shirt_short_dark_04.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_short_dark_05.png b/mods/villagers/textures/shirt_short_dark_05.png deleted file mode 100644 index fe641c7..0000000 Binary files a/mods/villagers/textures/shirt_short_dark_05.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_short_dark_female_01.png b/mods/villagers/textures/shirt_short_dark_female_01.png deleted file mode 100644 index a5d7618..0000000 Binary files a/mods/villagers/textures/shirt_short_dark_female_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_short_dark_priest_01.png b/mods/villagers/textures/shirt_short_dark_priest_01.png deleted file mode 100644 index 6736a94..0000000 Binary files a/mods/villagers/textures/shirt_short_dark_priest_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_short_med_01.png b/mods/villagers/textures/shirt_short_med_01.png deleted file mode 100644 index e3b75d8..0000000 Binary files a/mods/villagers/textures/shirt_short_med_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_short_med_02.png b/mods/villagers/textures/shirt_short_med_02.png deleted file mode 100644 index bee95ee..0000000 Binary files a/mods/villagers/textures/shirt_short_med_02.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_short_med_03.png b/mods/villagers/textures/shirt_short_med_03.png deleted file mode 100644 index 404c3bd..0000000 Binary files a/mods/villagers/textures/shirt_short_med_03.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_short_med_04.png b/mods/villagers/textures/shirt_short_med_04.png deleted file mode 100644 index 7b37d36..0000000 Binary files a/mods/villagers/textures/shirt_short_med_04.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_short_med_05.png b/mods/villagers/textures/shirt_short_med_05.png deleted file mode 100644 index 698b125..0000000 Binary files a/mods/villagers/textures/shirt_short_med_05.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_short_med_female_01.png b/mods/villagers/textures/shirt_short_med_female_01.png deleted file mode 100644 index 85acd8f..0000000 Binary files a/mods/villagers/textures/shirt_short_med_female_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_short_med_priest_01.png b/mods/villagers/textures/shirt_short_med_priest_01.png deleted file mode 100644 index d8a5eea..0000000 Binary files a/mods/villagers/textures/shirt_short_med_priest_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_tanktop_dark_00.png b/mods/villagers/textures/shirt_tanktop_dark_00.png deleted file mode 100644 index ddbbe92..0000000 Binary files a/mods/villagers/textures/shirt_tanktop_dark_00.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_tanktop_dark_01.png b/mods/villagers/textures/shirt_tanktop_dark_01.png deleted file mode 100644 index e2910d3..0000000 Binary files a/mods/villagers/textures/shirt_tanktop_dark_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_tanktop_dark_02.png b/mods/villagers/textures/shirt_tanktop_dark_02.png deleted file mode 100644 index 2eab698..0000000 Binary files a/mods/villagers/textures/shirt_tanktop_dark_02.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_tanktop_dark_03.png b/mods/villagers/textures/shirt_tanktop_dark_03.png deleted file mode 100644 index 45fb721..0000000 Binary files a/mods/villagers/textures/shirt_tanktop_dark_03.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_tanktop_dark_04.png b/mods/villagers/textures/shirt_tanktop_dark_04.png deleted file mode 100644 index a1ee271..0000000 Binary files a/mods/villagers/textures/shirt_tanktop_dark_04.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_tanktop_dark_05.png b/mods/villagers/textures/shirt_tanktop_dark_05.png deleted file mode 100644 index 49b9692..0000000 Binary files a/mods/villagers/textures/shirt_tanktop_dark_05.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_tanktop_med_00.png b/mods/villagers/textures/shirt_tanktop_med_00.png deleted file mode 100644 index a4f6dd5..0000000 Binary files a/mods/villagers/textures/shirt_tanktop_med_00.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_tanktop_med_01.png b/mods/villagers/textures/shirt_tanktop_med_01.png deleted file mode 100644 index 66d2c99..0000000 Binary files a/mods/villagers/textures/shirt_tanktop_med_01.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_tanktop_med_02.png b/mods/villagers/textures/shirt_tanktop_med_02.png deleted file mode 100644 index 1c4a772..0000000 Binary files a/mods/villagers/textures/shirt_tanktop_med_02.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_tanktop_med_03.png b/mods/villagers/textures/shirt_tanktop_med_03.png deleted file mode 100644 index 52ef94e..0000000 Binary files a/mods/villagers/textures/shirt_tanktop_med_03.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_tanktop_med_04.png b/mods/villagers/textures/shirt_tanktop_med_04.png deleted file mode 100644 index f2c1496..0000000 Binary files a/mods/villagers/textures/shirt_tanktop_med_04.png and /dev/null differ diff --git a/mods/villagers/textures/shirt_tanktop_med_05.png b/mods/villagers/textures/shirt_tanktop_med_05.png deleted file mode 100644 index f37ed58..0000000 Binary files a/mods/villagers/textures/shirt_tanktop_med_05.png and /dev/null differ diff --git a/mods/villagers/textures/shoes_01.png b/mods/villagers/textures/shoes_01.png deleted file mode 100644 index 96e8f03..0000000 Binary files a/mods/villagers/textures/shoes_01.png and /dev/null differ diff --git a/mods/villagers/textures/shoes_02.png b/mods/villagers/textures/shoes_02.png deleted file mode 100644 index 3b0c9b9..0000000 Binary files a/mods/villagers/textures/shoes_02.png and /dev/null differ diff --git a/mods/villagers/textures/shoes_dark_01.png b/mods/villagers/textures/shoes_dark_01.png deleted file mode 100644 index 96e8f03..0000000 Binary files a/mods/villagers/textures/shoes_dark_01.png and /dev/null differ diff --git a/mods/villagers/textures/shoes_dark_02.png b/mods/villagers/textures/shoes_dark_02.png deleted file mode 100644 index 679fc30..0000000 Binary files a/mods/villagers/textures/shoes_dark_02.png and /dev/null differ diff --git a/mods/villagers/textures/shorts_dark_01.png b/mods/villagers/textures/shorts_dark_01.png deleted file mode 100644 index 3184afa..0000000 Binary files a/mods/villagers/textures/shorts_dark_01.png and /dev/null differ diff --git a/mods/villagers/textures/shorts_dark_02.png b/mods/villagers/textures/shorts_dark_02.png deleted file mode 100644 index 033adbb..0000000 Binary files a/mods/villagers/textures/shorts_dark_02.png and /dev/null differ diff --git a/mods/villagers/textures/skirt_long_dark_01.png b/mods/villagers/textures/skirt_long_dark_01.png deleted file mode 100644 index 8a95df8..0000000 Binary files a/mods/villagers/textures/skirt_long_dark_01.png and /dev/null differ diff --git a/mods/villagers/textures/skirt_long_med_01.png b/mods/villagers/textures/skirt_long_med_01.png deleted file mode 100644 index 94ca5fd..0000000 Binary files a/mods/villagers/textures/skirt_long_med_01.png and /dev/null differ diff --git a/mods/villagers/textures/skirt_short_dark_01.png b/mods/villagers/textures/skirt_short_dark_01.png deleted file mode 100644 index def35d1..0000000 Binary files a/mods/villagers/textures/skirt_short_dark_01.png and /dev/null differ diff --git a/mods/villagers/textures/skirt_top_short_01.png b/mods/villagers/textures/skirt_top_short_01.png deleted file mode 100644 index 1139499..0000000 Binary files a/mods/villagers/textures/skirt_top_short_01.png and /dev/null differ diff --git a/mods/villagers/textures/strap_01.png b/mods/villagers/textures/strap_01.png deleted file mode 100644 index 6472207..0000000 Binary files a/mods/villagers/textures/strap_01.png and /dev/null differ diff --git a/mods/villagers/textures/strap_02.png b/mods/villagers/textures/strap_02.png deleted file mode 100644 index a026797..0000000 Binary files a/mods/villagers/textures/strap_02.png and /dev/null differ diff --git a/mods/villagers/textures/strap_03.png b/mods/villagers/textures/strap_03.png deleted file mode 100644 index 55ea87e..0000000 Binary files a/mods/villagers/textures/strap_03.png and /dev/null differ diff --git a/mods/villagers/textures/strap_04.png b/mods/villagers/textures/strap_04.png deleted file mode 100644 index 1f4ac5b..0000000 Binary files a/mods/villagers/textures/strap_04.png and /dev/null differ diff --git a/mods/villagers/textures/strap_05.png b/mods/villagers/textures/strap_05.png deleted file mode 100644 index 478fcde..0000000 Binary files a/mods/villagers/textures/strap_05.png and /dev/null differ diff --git a/mods/villagers/textures/strap_06.png b/mods/villagers/textures/strap_06.png deleted file mode 100644 index 326af3f..0000000 Binary files a/mods/villagers/textures/strap_06.png and /dev/null differ diff --git a/mods/villagers/textures/sword_01.png b/mods/villagers/textures/sword_01.png deleted file mode 100644 index 8b55cda..0000000 Binary files a/mods/villagers/textures/sword_01.png and /dev/null differ diff --git a/mods/villagers/textures/sword_02.png b/mods/villagers/textures/sword_02.png deleted file mode 100644 index c055afc..0000000 Binary files a/mods/villagers/textures/sword_02.png and /dev/null differ diff --git a/mods/villagers/textures/sword_03.png b/mods/villagers/textures/sword_03.png deleted file mode 100644 index e613fc4..0000000 Binary files a/mods/villagers/textures/sword_03.png and /dev/null differ diff --git a/mods/villagers/textures/sword_04.png b/mods/villagers/textures/sword_04.png deleted file mode 100644 index 2f376ad..0000000 Binary files a/mods/villagers/textures/sword_04.png and /dev/null differ diff --git a/mods/villagers/trading.lua b/mods/villagers/trading.lua deleted file mode 100644 index e0c66d6..0000000 --- a/mods/villagers/trading.lua +++ /dev/null @@ -1,975 +0,0 @@ --- Costs and Stock of all goods: index 1 is cost, index 2 is stock -local GOODS_DATA = { - ["default:apple"] = {"villagers:coins", 2, math.random(70,90)}, - ["flowers:mushroom_red"] = {"villagers:coins", 5, math.random(50,70)}, - ["flowers:mushroom_brown"] = {"villagers:coins", 5, math.random(50,70)}, - - ["flowers:rose"] = {"villagers:coins", 5, math.random(30,50)}, - ["flowers:tulip"] = {"villagers:coins", 5, math.random(30,50)}, - ["flowers:dandelion_yellow"] = {"villagers:coins", 5, math.random(30,50)}, - ["flowers:geranium"] = {"villagers:coins", 5, math.random(30,50)}, - ["flowers:viola"] = {"villagers:coins", 5, math.random(30,50)}, - ["flowers:dandelion_white"] = {"villagers:coins", 5, math.random(30,50)}, - - ["default:papyrus"] = {"villagers:coins", 2, math.random(30,50)}, - ["default:paper"] = {"villagers:coins", 6, math.random(30,50)}, - ["default:book"] = {"villagers:coins", 20, math.random(20,40)}, - - ["farming:seed_cotton"] = {"villagers:coins", 2, math.random(80,99)}, - ["farming:cotton"] = {"villagers:coins", 3, math.random(80,99)}, - ["farming:string"] = {"villagers:coins", 3, math.random(90,99)}, - ["farming:seed_wheat"] = {"villagers:coins", 2, math.random(80,99)}, - ["farming:wheat"] = {"villagers:coins", 2, math.random(60,80)}, - ["farming:straw"] = {"villagers:coins", 7, math.random(60,80)}, - - ["farming:flour"] = {"villagers:coins", 9, math.random(60,80)}, - ["farming:bread"] = {"villagers:coins", 17, math.random(30,40)}, - - ["default:ice"] = {"villagers:coins", 5, math.random(70,90)}, - ["group:wool"] = {"villagers:coins", 999, math.random(60,80)}, - - ["default:dirt"] = {"villagers:coins", 1, math.random(70,90)}, - ["default:gravel"] = {"villagers:coins", 2, math.random(70,90)}, - - ["default:sand"] = {"villagers:coins", 2, math.random(70,90)}, - ["default:desert_sand"] = {"villagers:coins", 2, math.random(70,90)}, - ["default:silver_sand"] = {"villagers:coins", 2, math.random(70,90)}, - - ["default:glass"] = {"villagers:coins", 4, math.random(40,60)}, - ["vessels:glass_bottle"] = {"villagers:coins", 1, math.random(30,40)}, - ["vessels:drinking_glass"] = {"villagers:coins", 8, math.random(20,30)}, - ["cottages:glass_pane"] = {"villagers:coins", 2, math.random(30,50)}, - ["xpanes:pane_flat"] = {"villagers:coins", 14, math.random(30,50)}, - ["cottages:glass_pane_side"] = {"villagers:coins", 14, math.random(30,50)}, - - ["default:clay_lump"] = {"villagers:coins", 5, math.random(60,80)}, - ["default:clay"] = {"villagers:coins", 22, math.random(40,60)}, - ["default:clay_brick"] = {"villagers:coins", 23, math.random(40,60)}, - ["default:cobble"] = {"villagers:coins", 3, math.random(60,80)}, - ["default:stone"] = {"villagers:coins", 6, math.random(60,80)}, - - ["default:desert_stone"] = {"villagers:coins", 7, math.random(60,80)}, - ["default:sandstone"] = {"villagers:coins", 8, math.random(60,80)}, - ["default:desert_sandstone"] = {"villagers:coins", 7, math.random(60,80)}, - ["default:silver_sandstone"] = {"villagers:coins", 7, math.random(60,80)}, - - ["default:stonebrick"] = {"villagers:coins", 25, math.random(60,80)}, - ["default:sandstonebrick"] = {"villagers:coins", 30, math.random(60,80)}, - ["default:desert_stonebrick"] = {"villagers:coins", 30, math.random(60,80)}, - ["default:desert_sandstone_brick"] = {"villagers:coins", 30, math.random(60,80)}, - ["default:silver_sandstone_brick"] = {"villagers:coins", 30, math.random(60,80)}, - ["default:brick"] = {"villagers:coins", 100, math.random(60,80)}, - - ["default:stick"] = {"villagers:coins", 1, math.random(80,99)}, - ["default:wood"] = {"villagers:coins", 5, math.random(60,70)}, - ["default:tree"] = {"villagers:coins", 23, math.random(50,60)}, - ["default:ladder_wood"] = {"villagers:coins", 3, math.random(40,50)}, - ["cottages:table"] = {"villagers:coins", 5, math.random(20,30)}, - ["cottages:bench"] = {"villagers:coins", 8, math.random(20,30)}, - - ["default:fence_wood"] = {"villagers:coins", 24, math.random(40,60)}, - ["doors:gate_wood_closed"] = {"villagers:coins", 16, math.random(30,50)}, - ["doors:door_wood_a"] = {"villagers:coins", 33, math.random(30,50)}, - ["default:sign_wall_wood"] = {"villagers:coins", 11, math.random(40,60)}, - ["doors:trapdoor"] = {"villagers:coins", 16, math.random(40,60)}, - ["default:chest"] = {"villagers:coins", 44, math.random(30,50)}, - ["boats:boat"] = {"villagers:coins", 28, math.random(20,30)}, - ["beds:bed"] = {"villagers:coins", 34, math.random(20,30)}, - ["beds:fancy_bed"] = {"villagers:coins", 40, math.random(10,20)}, - ["default:bookshelf"] = {"villagers:coins", 10, math.random(30,40)}, - ["cottages:shelf"] = {"villagers:coins", 18, math.random(30,40)}, - ["vessels:shelf"] = {"villagers:coins", 50, math.random(30,40)}, - ["cottages:tub"] = {"villagers:coins", 20, math.random(50,70)}, - ["cottages:barrel"] = {"villagers:coins", 40, math.random(60,80)}, - ["cottages:barrel_lying"] = {"villagers:coins", 40, math.random(60,80)}, - ["cottages:wood_flat"] = {"villagers:coins", 1, math.random(70,90)}, - ["cottages:hatch_wood"] = {"villagers:coins", 5, math.random(40,60)}, - ["cottages:wagon_wheel"] = {"villagers:coins", 5, math.random(40,60)}, - ["cottages:gate_closed"] = {"villagers:coins", 12, math.random(30,50)}, - - -- STAIRS -- - ["stairs:stair_wood"] = {"villagers:coins", 7, math.random(30,50)}, - ["stairs:stair_pine_wood"] = {"villagers:coins", 9, math.random(30,50)}, - ["stairs:stair_junglewood"] = {"villagers:coins", 10, math.random(30,50)}, - ["stairs:stair_acacia_wood"] = {"villagers:coins", 10, math.random(30,50)}, - - ["stairs:slab_wood"] = {"villagers:coins", 3, math.random(60,80)}, - - ["stairs:slab_straw"] = {"villagers:coins", 4, math.random(40,60)}, - ["stairs:stair_straw"] = {"villagers:coins", 7, math.random(30,50)}, - - ["stairs:slab_ice"] = {"villagers:coins", 3, math.random(70,90)}, - ["stairs:stair_ice"] = {"villagers:coins", 5, math.random(40,60)}, - - ["stairs:stair_sandstone"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_sandstone_block"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_sandstonebrick"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_desert_sandstone"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_desert_sandstone_block"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_desert_sandstone_brick"] = {"villagers:coins", 5, math.random(40,60)}, - - ["stairs:stair_desert_stone_block"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_silver_sandstone_block"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_desert_stonebrick"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_silver_sandstone_brick"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_snowblock"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_cobble"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_stone"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_brick"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_stonebrick"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_bronzeblock"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_copperblock"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_steelblock"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_desert_cobble"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_desert_stone"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_silver_sandstone"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_loam"] = {"villagers:coins", 5, math.random(40,60)}, - ["stairs:stair_mossycobble"] = {"villagers:coins", 5, math.random(40,60)}, - - - ["default:coal_lump"] = {"villagers:coins", 20, math.random(60,80)}, - ["default:coalblock"] = {"villagers:coins_gold", 19, math.random(30,50)}, - ["default:torch"] = {"villagers:coins", 10, math.random(30,50)}, - ["tnt:gunpowder"] = {"villagers:coins_gold", 25, math.random(30,50)}, - ["tnt:tnt"] = {"villagers:coins_gold", 15, math.random(20,40)}, - - ["default:iron_lump"] = {"villagers:coins", 80, math.random(70,90)}, - ["default:copper_lump"] = {"villagers:coins_gold", 16, math.random(60,80)}, - ["default:tin_lump"] = {"villagers:coins_gold", 16, math.random(60,80)}, - ["default:gold_lump"] = {"villagers:coins_gold", 28, math.random(30,40)}, - ["default:mese_crystal_fragment"] = {"villagers:coins_gold", 7, math.random(70,90)}, - ["default:steel_ingot"] = {"villagers:coins_gold", 10, math.random(60,80)}, - ["default:copper_ingot"] = {"villagers:coins_gold", 18, math.random(60,80)}, - ["default:tin_ingot"] = {"villagers:coins_gold", 18, math.random(60,80)}, - ["default:bronze_ingot"] = {"villagers:coins_gold", 20, math.random(60,80)}, - ["default:gold_ingot"] = {"villagers:coins_gold", 30, math.random(30,50)}, - ["default:mese_crystal"] = {"villagers:coins_gold", 55, math.random(20,40)}, - ["default:diamond"] = {"villagers:coins_gold", 99, math.random(20,40)}, - - ["default:goldblock"] = {"villagers:coins_gold", 280, math.random(20,30)}, - ["stairs:stair_goldblock"] = {"villagers:coins_gold", 100, math.random(20,30)}, - ["stairs:slab_goldblock"] = {"villagers:coins_gold", 140, math.random(20,30)}, - - ["screwdriver:screwdriver"] = {"villagers:coins_gold", 11, math.random(30,50)}, - ["default:chest_locked"] = {"villagers:coins_gold", 15, math.random(30,50)}, - ["default:skeleton_key"] = {"villagers:coins_gold", 19, math.random(30,50)}, - --["bucket:bucket_empty"] = {"villagers:coins_gold", 28, math.random(40,60)}, - ["default:door_steel"] = {"villagers:coins_gold", 62, math.random(20,40)}, - ["vessels:steel_bottle"] = {"villagers:coins_gold", 55, math.random(20,40)}, - - ["default:shovel_wood"] = {"villagers:coins", 8, math.random(30,50)}, - ["default:shovel_stone"] = {"villagers:coins", 9, math.random(30,50)}, - ["default:shovel_steel"] = {"villagers:coins_gold", 11, math.random(30,50)}, - ["default:shovel_bronze"] = {"villagers:coins_gold", 19, math.random(30,50)}, - ["default:pick_wood"] = {"villagers:coins", 16, math.random(30,50)}, - ["default:pick_stone"] = {"villagers:coins", 21, math.random(30,50)}, - ["default:pick_steel"] = {"villagers:coins_gold", 31, math.random(30,50)}, - ["default:pick_bronze"] = {"villagers:coins_gold", 56, math.random(30,50)}, - ["default:sword_wood"] = {"villagers:coins", 12, math.random(20,40)}, - ["default:sword_stone"] = {"villagers:coins", 14, math.random(20,40)}, - ["default:sword_steel"] = {"villagers:coins_gold", 21, math.random(20,40)}, - ["default:sword_bronze"] = {"villagers:coins_gold", 37, math.random(20,40)}, - ["default:axe_wood"] = {"villagers:coins", 18, math.random(20,40)}, - ["default:axe_stone"] = {"villagers:coins", 21, math.random(20,40)}, - ["default:axe_steel"] = {"villagers:coins_gold", 31, math.random(20,40)}, - ["default:axe_bronze"] = {"villagers:coins_gold", 57, math.random(20,40)}, - ["farming:hoe_wood"] = {"villagers:coins", 13, math.random(30,50)}, - ["farming:hoe_stone"] = {"villagers:coins", 15, math.random(30,50)}, - ["farming:hoe_steel"] = {"villagers:coins_gold", 21, math.random(30,50)}, - ["farming:hoe_bronze"] = {"villagers:coins_gold", 37, math.random(30,50)}, - - ["dye:white"] = {"villagers:coins", 3, math.random(30,50)}, - ["dye:grey"] = {"villagers:coins", 8, math.random(30,50)}, - ["dye:dark_grey"] = {"villagers:coins", 8, math.random(30,50)}, - ["dye:black"] = {"villagers:coins", 6, math.random(30,50)}, - ["dye:violet"] = {"villagers:coins", 8, math.random(30,50)}, - ["dye:blue"] = {"villagers:coins", 8, math.random(30,50)}, - ["dye:cyan"] = {"villagers:coins", 8, math.random(30,50)}, - ["dye:dark_green"] = {"villagers:coins", 8, math.random(30,50)}, - ["dye:green"] = {"villagers:coins", 8, math.random(30,50)}, - ["dye:yellow"] = {"villagers:coins", 3, math.random(30,50)}, - ["dye:brown"] = {"villagers:coins", 8, math.random(30,50)}, - ["dye:orange"] = {"villagers:coins", 8, math.random(30,50)}, - ["dye:red"] = {"villagers:coins", 8, math.random(30,50)}, - ["dye:magenta"] = {"villagers:coins", 8, math.random(30,50)}, - ["dye:pink"] = {"villagers:coins", 8, math.random(30,50)}, - - ["villagers:coins_gold"] = {"villagers:coins", 10, math.random(70,90)}, - ["villagers:coins"] = {"villagers:coins_gold", 1, math.random(70,90)}, - -} - ---io.write("\n## Creating DEFAULT_ITEM_NAMES table..\n") -local goodsDataCount = 1 -local DEFAULT_ITEM_NAMES = {} -for key,_ in pairs(GOODS_DATA) do - local modname = string.split(key, ":")[1] - --io.write("\n #"..goodsDataCount.." key="..key.." modname="..modname.." ") - if (modname == "cottages") or (modname == "farming") then - -- do nothing - --io.write("Skipped. ") - else - table.insert(DEFAULT_ITEM_NAMES, key) - --io.write("Added. ") - end - goodsDataCount = goodsDataCount + 1 -end - ---io.write("\n Complete. Resulting table data: ") -for i=1, #DEFAULT_ITEM_NAMES do - --io.write("\n #"..i.." "..DEFAULT_ITEM_NAMES[i]) -end ---io.write("\n") - - -local function getGoodsData(item_name, quantity, buyback) - local log = false - if log then - io.write("\ngetGoodsData() ") - if buyback then io.write("playerSell ") - else io.write("villagerSell ") end - io.write("item_name="..item_name.." ") - end - - -- if the item that villager is selling to player (or player is selling to villager) - -- is from an optional mod but that is not installed, then use a random item from - -- minetest_game instead - local modname = string.split(item_name, ":")[1] - if log then io.write("modname="..modname.." ") end - if (villagers.mods.cottages == nil and modname == "cottages") or - (villagers.mods.farming == nil and modname == "farming") then - item_name = DEFAULT_ITEM_NAMES[math.random(#DEFAULT_ITEM_NAMES)] - if log then io.write("optionalModMissing gotRandomItem="..modname.." ") end - end - - if minetest.registered_items[item_name] == nil then - return {"invalid_item", item_name} - end - if minetest.registered_items[item_name].description == nil then - return {"no_description", item_name} - end - if GOODS_DATA[item_name] == nil then - return {"naming_error", item_name} - end - - -- item for player to sell villager for coins - local goods - if buyback then - local purchase_item = GOODS_DATA[item_name][1] - local itemDescription = minetest.registered_items[purchase_item].description - local quant_received = villagers.round(GOODS_DATA[item_name][2] / 3) - if quant_received == 0 then quantity = 1 end - goods = { - purchase_item, -- registered item name that villager is purchasing (eg. coins) - itemDescription, -- description of the above item - quant_received, -- quantity of the above item to receive for each purchase (typically > 1) - item_name, -- cost item that player must give - minetest.registered_items[item_name].description, -- description of the cost item - quantity, -- quantity of the cost item player must give - GOODS_DATA[purchase_item][3] -- stock quantity of the item to be purchased - } - - -- item for villager to sell player - else - --print("\n\n##item_name="..item_name) - local cost_item_name = GOODS_DATA[item_name][1] - goods = { - item_name, -- registered item name that villager is purchasing - minetest.registered_items[item_name].description, -- description of the above item - quantity, -- quantity of the above item to receive for each purchase (typically 1) - GOODS_DATA[item_name][1], -- cost item that player must give (eg. coins) - minetest.registered_items[cost_item_name].description, -- description of the cost item - GOODS_DATA[item_name][2], -- quantity of the cost item player must give (typically > 1) - GOODS_DATA[item_name][3] -- stock quantity of the itme to be purchased - } - end - - if log then io.write("returnVal: "..minetest.serialize(goods).." ") end - --io.write("\ngetGoodsDataEND ") - return goods - -end - --- temporary default goods for villagers until appropriate items are assigned -local DEFAULT_GOODS = { {prob=1, split=0, min=1, max=1}, getGoodsData("default:dirt", 1) } - ---io.write("\n## Creating villagers.GOODS table..\n") -villagers.GOODS = { - baker = { - {prob=1, split=2, min=2, max=4}, - getGoodsData("farming:bread", 1), - getGoodsData("farming:flour", 1), - getGoodsData("default:apple", 1), - getGoodsData("flowers:mushroom_red", 1), - getGoodsData("flowers:mushroom_brown", 1), - }, - barkeeper = { - {prob=1, split=1, min=1, max=3}, - getGoodsData("vessels:drinking_glass", 1), - getGoodsData("default:apple", 1), - getGoodsData("farming:bread", 1), - }, - blacksmith = { - {prob=1, split=1, min=3, max=4}, - getGoodsData("default:sword_steel", 1), - getGoodsData("default:axe_steel", 1), - getGoodsData("default:pick_steel", 1), - getGoodsData("default:shovel_steel", 1), - getGoodsData("farming:hoe_steel", 1), - }, - bricklayer = { - {prob=1, split=2, min=2, max=3}, - getGoodsData("default:stonebrick", 1), - getGoodsData("default:sandstonebrick", 1), - getGoodsData("default:clay_brick", 1), - getGoodsData("default:desert_stonebrick", 1), - getGoodsData("default:desert_sandstone_brick", 1), - getGoodsData("default:silver_sandstone_brick", 1), - }, - carpenter = { - {prob=1, split=3, min=4, max=5}, - getGoodsData("default:ladder_wood", 1), - getGoodsData("default:fence_wood", 1), - getGoodsData("doors:gate_wood_closed", 1), - getGoodsData("cottages:gate_closed", 1), - getGoodsData("default:sign_wall_wood", 1), - getGoodsData("doors:trapdoor", 1), - getGoodsData("boats:boat", 1), - getGoodsData("default:chest", 1), - }, - charachoal_burner = { - {prob=1, split=1, min=2, max=3}, - getGoodsData("default:coal_lump", 1), - getGoodsData("default:sand", 1), - getGoodsData("default:dirt", 1), - getGoodsData("default:gravel", 1), - }, - cooper = { - {prob=1, split=1, min=1, max=2}, - getGoodsData("cottages:barrel", 1), - getGoodsData("cottages:tub", 1), - getGoodsData("cottages:barrel_lying", 1), - }, - coppersmith = { - {prob=1, split=1, min=3, max=4}, - getGoodsData("default:sword_bronze", 1), - getGoodsData("default:axe_bronze", 1), - getGoodsData("default:pick_bronze", 1), - getGoodsData("default:shovel_bronze", 1), - getGoodsData("farming:hoe_bronze", 1), - }, - doormaker = { - {prob=1, split=1, min=1, max=3}, - getGoodsData("doors:door_wood_a", 1), - getGoodsData("doors:trapdoor", 1), - getGoodsData("doors:gate_wood_closed", 1), - }, - dyemaker = { - {prob=1, split=0, min=3, max=5}, - getGoodsData("dye:brown", 1), - getGoodsData("dye:dark_green", 1), - getGoodsData("dye:black", 1), - getGoodsData("dye:grey", 1), - getGoodsData("dye:dark_grey", 1), - getGoodsData("dye:white", 1), - getGoodsData("dye:violet", 1), - getGoodsData("dye:blue", 1), - getGoodsData("dye:cyan", 1), - getGoodsData("dye:green", 1), - getGoodsData("dye:yellow", 1), - getGoodsData("dye:orange", 1), - getGoodsData("dye:red", 1), - getGoodsData("dye:magenta", 1), - getGoodsData("dye:pink", 1), - }, - farmer = { - {prob=1, split=3, min=3, max=5}, - getGoodsData("default:apple", 1), - getGoodsData("farming:bread", 1), - getGoodsData("farming:wheat", 1), - getGoodsData("farming:cotton", 1), - getGoodsData("flowers:mushroom_red", 1), - getGoodsData("flowers:mushroom_brown", 1), - getGoodsData("farming:straw", 1), - getGoodsData("farming:string", 1), - }, - flower_seller = { - {prob=1, split=0, min=3, max=5}, - getGoodsData("flowers:rose", 1), - getGoodsData("flowers:tulip", 1), - getGoodsData("flowers:dandelion_yellow", 1), - getGoodsData("flowers:geranium", 1), - getGoodsData("flowers:viola", 1), - getGoodsData("flowers:dandelion_white", 1), - }, - fruit_trader = { - {prob=1, split=0, min=1, max=1}, - getGoodsData("default:apple", 1), - }, - furnituremaker = { - {prob=1, split=3, min=3, max=5}, - getGoodsData("cottages:table", 1), - getGoodsData("cottages:bench", 1), - getGoodsData("beds:bed", 1), - -- split -- - getGoodsData("cottages:shelf", 1), - getGoodsData("default:bookshelf", 1), - getGoodsData("default:chest", 1), - getGoodsData("beds:fancy_bed", 1), - getGoodsData("vessels:shelf", 1), - }, - glassmaker = { - {prob=1, split=0, min=3, max=5}, - getGoodsData("default:glass", 1), - getGoodsData("vessels:glass_bottle", 1), - getGoodsData("vessels:drinking_glass", 1), - getGoodsData("xpanes:pane_flat", 1), - getGoodsData("cottages:glass_pane", 1), - getGoodsData("cottages:glass_pane_side", 1), - }, - goldsmith = { - {prob=1, split=1, min=1, max=3}, - getGoodsData("default:goldblock", 1), - getGoodsData("stairs:stair_goldblock", 1), - getGoodsData("stairs:slab_goldblock", 1), - }, - horsekeeper = { - {prob=1, split=0, min=1, max=2}, - getGoodsData("farming:straw", 1), - getGoodsData("farming:string", 1), - }, - iceman = { - {prob=1, split=0, min=1, max=2}, - getGoodsData("stairs:slab_ice", 1), - getGoodsData("stairs:stair_ice", 1), - }, - innkeeper = { - {prob=1, split=1, min=2, max=3}, - getGoodsData("beds:bed", 1), - getGoodsData("default:chest", 1), - getGoodsData("default:paper", 1), - getGoodsData("default:torch", 1), - getGoodsData("default:book", 1), - }, - librarian = { - {prob=1, split=1, min=1, max=2}, - getGoodsData("default:book", 1), - getGoodsData("default:paper", 1), - }, - lumberjack = { - {prob=3, split=0, min=1, max=2}, - getGoodsData("default:wood", 1), - getGoodsData("default:tree", 1), - }, - miller = { - {prob=1, split=1, min=1, max=2}, - getGoodsData("farming:flour", 1), - getGoodsData("farming:straw", 1), - }, - - priest = DEFAULT_GOODS, - - roofer = DEFAULT_GOODS, - - sawmill_owner = { - {prob=1, split=2, min=3, max=4}, - getGoodsData("default:wood", 1), - getGoodsData("default:tree", 1), - getGoodsData("default:stick", 1), - getGoodsData("stairs:slab_wood", 1), - }, - - seed_seller = { - {prob=1, split=0, min=1, max=2}, - getGoodsData("farming:seed_cotton", 1), - getGoodsData("farming:seed_wheat", 1), - }, - - shopkeeper = DEFAULT_GOODS, - - smith = { - {prob=1, split=1, min=3, max=4}, - getGoodsData("default:sword_steel", 1), - getGoodsData("default:axe_steel", 1), - getGoodsData("default:pick_steel", 1), - getGoodsData("default:shovel_steel", 1), - getGoodsData("farming:hoe_steel", 1), - }, - - stairmaker = { - hot = { - {prob=1, split=0, min=3, max=5}, - getGoodsData("stairs:stair_desert_sandstone_block", 1), - getGoodsData("stairs:stair_desert_stone_block", 1), - getGoodsData("stairs:stair_sandstone_block", 1), - getGoodsData("stairs:stair_silver_sandstone_block", 1), - getGoodsData("stairs:stair_desert_sandstone_brick", 1), - getGoodsData("stairs:stair_desert_stonebrick", 1), - getGoodsData("stairs:stair_sandstonebrick", 1), - getGoodsData("stairs:stair_silver_sandstone_brick", 1), - }, - cold = { - {prob=1, split=2, min=2, max=4}, - getGoodsData("stairs:stair_ice", 1), - getGoodsData("stairs:stair_snowblock", 1), - getGoodsData("stairs:stair_cobble", 1), - getGoodsData("stairs:stair_stone", 1), - getGoodsData("stairs:stair_wood", 1), - }, - normal = { - {prob=1, split=3, min=3, max=5}, - getGoodsData("stairs:stair_wood", 1), - getGoodsData("stairs:stair_cobble", 1), - getGoodsData("stairs:stair_stone", 1), - getGoodsData("stairs:stair_straw", 1), - getGoodsData("stairs:stair_brick", 1), - getGoodsData("stairs:stair_stonebrick", 1), - getGoodsData("stairs:stair_bronzeblock", 1), - getGoodsData("stairs:stair_copperblock", 1), - getGoodsData("stairs:stair_steelblock", 1), - }, - desert = { - {prob=1, split=0, min=3, max=4}, - getGoodsData("stairs:stair_desert_cobble", 1), - getGoodsData("stairs:stair_desert_sandstone", 1), - getGoodsData("stairs:stair_desert_stone", 1), - getGoodsData("stairs:stair_sandstone", 1), - getGoodsData("stairs:stair_silver_sandstone", 1), - getGoodsData("stairs:stair_loam", 1), - }, - native = { - {prob=1, split=2, min=2, max=4}, - getGoodsData("stairs:stair_junglewood", 1), - getGoodsData("stairs:stair_mossycobble", 1), - getGoodsData("stairs:stair_cobble", 1), - getGoodsData("stairs:stair_wood", 1), - } - }, - - stonemason = DEFAULT_GOODS, - - tinsmith = { - {prob=1, split=0, min=1, max=1}, - getGoodsData("default:tin_ingot", 1), - }, - - toolmaker = { - {prob=1, split=1, min=2, max=2}, - getGoodsData("screwdriver:screwdriver", 1), - getGoodsData("default:shovel_steel", 1), - getGoodsData("farming:hoe_steel", 1), - getGoodsData("default:skeleton_key", 1), - }, - - trader = { - {prob=3, split=1, min=2, max=2}, - getGoodsData("default:clay", 1), - getGoodsData("default:clay_brick", 1), - getGoodsData("stairs:slab_clay", 1), - getGoodsData("stairs:stair_clay", 1), - }, - - wheelwright = { - {prob=1, split=1, min=1, max=2}, - getGoodsData("cottages:wagon_wheel", 1), - getGoodsData("default:stick", 1), - }, - wood_trader = { - {prob=1, split=1, min=3, max=4}, - getGoodsData("default:stick", 1), - getGoodsData("default:wood", 1), - getGoodsData("stairs:slab_wood", 1), - getGoodsData("cottages:wood_flat", 1), - getGoodsData("cottages:hatch_wood", 1), - }, - - - -- offers players to exchange coins for gold coins and vice versa - major = { - {prob=1, split=0, min=2, max=2}, - {"villagers:coins_gold", "Gold Coin", 1, "villagers:coins", "Silver Coin", 11, math.random(800,999)}, - {"villagers:coins", "Silver Coin", 9, "villagers:coins_gold", "Gold Coin", 1, math.random(800,999)}, - }, - - - -- villagers who give coins to players for items - guard = { - {prob=2, split=0, min=1, max=1}, - getGoodsData("default:sword_steel", 1, true), - getGoodsData("default:sword_stone", 1, true), - }, - guest = { - {prob=4, split=0, min=1, max=1}, - getGoodsData("flowers:mushroom_red", 1, true), - getGoodsData("flowers:mushroom_brown", 1, true), - getGoodsData("flowers:rose", 1, true), - getGoodsData("flowers:tulip", 1, true), - getGoodsData("flowers:dandelion_yellow", 1, true), - getGoodsData("flowers:geraniu", 1, true), - getGoodsData("flowers:viola", 1, true), - getGoodsData("flowers:dandelion_white", 1, true), - getGoodsData("dye:dark_grey", 1, true), - getGoodsData("dye:violet", 1, true), - getGoodsData("dye:blue", 1, true), - getGoodsData("dye:cyan", 1, true), - getGoodsData("dye:yellow", 1, true), - getGoodsData("dye:orange", 1, true), - getGoodsData("dye:red", 1, true), - getGoodsData("dye:magenta", 1, true), - getGoodsData("dye:pink", 1, true), - getGoodsData("default:papyrus", 1, true), - getGoodsData("default:ice", 1, true), - getGoodsData("vessels:glass_bottle", 1, true), - getGoodsData("default:torch", 1, true), - getGoodsData("vessels:steel_bottle", 1, true), - getGoodsData("default:sword_wood", 1, true), - getGoodsData("default:sword_stone", 1, true), - getGoodsData("default:axe_wood", 1, true), - getGoodsData("default:axe_stone", 1, true), - }, - - landlord = { - {prob=2, split=0, min=1, max=2}, - getGoodsData("default:paper", 1, true), - getGoodsData("default:book", 1, true), - }, - housemaid = { - {prob=4, split=0, min=1, max=2}, - getGoodsData("default:torch", 1, true), - getGoodsData("vessels:drinking_glass", 1, true), - getGoodsData("default:ice", 1, true), - }, - ore_seller = { - {prob=1, split=0, min=1, max=3}, - getGoodsData("default:coal_lump", 1, true), - getGoodsData("default:iron_lump", 1, true), - getGoodsData("default:copper_lump", 1, true), - getGoodsData("default:tin_lump", 1, true), - getGoodsData("default:gold_lump", 1, true), - getGoodsData("default:mese_crystal_fragment", 1, true), - }, - potterer = { - {prob=1, split=0, min=1, max=2}, - getGoodsData("default:clay_lump", 1, true), - getGoodsData("default:clay", 1, true), - }, - - saddler = { - {prob=1, split=0, min=1, max=2}, - getGoodsData("farming:cotton", 1, true), - getGoodsData("farming:string", 1, true), - }, - - servant = { - {prob=4, split=0, min=1, max=1}, - getGoodsData("vessels:drinking_glass", 1, true), - getGoodsData("vessels:glass_bottle", 1, true), - getGoodsData("farming:drinking_cup", 1, true), - }, - - soldier = { - {prob=2, split=0, min=1, max=1}, - getGoodsData("default:sword_steel", 1, true), - getGoodsData("default:sword_stone", 1, true), - }, - - stoneminer = { - {prob=1, split=0, min=1, max=2}, - getGoodsData("default:stone", 1, true), - getGoodsData("default:desert_stone", 1, true), - getGoodsData("default:sandstone", 1, true), - getGoodsData("default:desert_sandstone", 1, true), - getGoodsData("default:silver_sandstone", 1, true), - }, - - schoolteacher = { - {prob=1, split=0, min=1, max=2}, - getGoodsData("default:paper", 1, true), - getGoodsData("default:book", 1, true), - }, - -} - - -function villagers.getTradingFormspec(self, player_name) - local log = false - if log then - io.write("getFormspec() ") - io.write("for "..self.vName.." vSell:"..dump(self.vSell).."\n") - end - - local item_count = #self.vSell - - local width_column = 1 - local width_item_count = 0.26 - local width_trade_button = 1.2 - local number_of_columns = 5 - local width_form = (width_column * number_of_columns) + (width_item_count * 2) + width_trade_button + 0.2 - - local height_exit_button = 1 - local height_row = 1 - local height_labels = 1 - local height_between_rows = 0.4 - local number_of_rows = item_count - local height_form = height_exit_button + ((height_row + height_between_rows) * number_of_rows) + height_labels - - -- GUI related stuff - --local bg = "bgcolor[#080808BB;true]" - local bg_image = "background[0,0;0,0;gui_formbg.png;true]" - local y_offset = 0.4 - - local formspec = - -- gui background attributes - "size["..width_form..","..height_form.."]"..bg_image.. - - -- header row - "label[0.2,0;BUY]".. - "label["..(1.5)+(width_item_count)..",0;STOCK]".. - "label["..(2.5)+(width_item_count*2)+(0.2)..",0;COST]".. - "label["..(3.6)+(width_item_count*3)+(width_item_count)+(0.1)..",0;INV]" - --.."label["..4+(width_item_count*4)+(width_item_count*2)..",0;Action]" - - local player_inv = minetest.get_inventory({type="player", name=player_name}) - local inv_size = player_inv:get_size("main") - - -- construct rows for each item villager is selling - for item_index = 1, item_count do - - local sell_data = self.vSell[item_index] - local item_name = sell_data[1] - local item_desc = sell_data[2] - local item_quant = sell_data[3] - local cost_name = sell_data[4] - local cost_desc = sell_data[5] - local cost_quant = sell_data[6] - local item_stock = sell_data[7] - if log then io.write("sell_data #"..item_index..": "..minetest.serialize(sell_data).." ") end - - local inv_quant = 0 - for i=1, inv_size do - local stack_name = player_inv:get_stack("main",i):get_name() - local stack_count = player_inv:get_stack("main",i):get_count() - if stack_name == cost_name then - inv_quant = inv_quant + stack_count - end - end - - -- Try to fix a heavy bug when some values are nil - if item_stock == nil then - item_stock = 1 - end - - local ypos = (item_index-0.4) + ((item_index-1)*height_between_rows) - formspec = formspec.. - -- items - "item_image[0,"..ypos..";1,1;"..item_name.."]".. -- item being sold - "label[0,"..(ypos+0.8)..";"..item_desc.."]".. -- item description - "label[0.8,"..(ypos+0.4)..";x"..item_quant.."]".. -- item count - "label["..(1.7)+(width_item_count)..","..ypos+y_offset..";"..item_stock.."]".. -- how many in stock - "item_image["..(2.5)+(width_item_count*2)..","..ypos..";1,1;"..cost_name.."]".. -- cost item - "label["..(2.5)+(width_item_count*2)..","..(ypos+0.8)..";"..cost_desc.."]".. -- cost description - "label["..(3.3)+(width_item_count*2)..","..ypos+y_offset..";x"..cost_quant.."]".. -- cost count - "label["..(3.7)+(width_item_count*3)+(width_item_count)..","..ypos+y_offset..";"..inv_quant.."]" -- how many player has - - local button_name = self.vName.."|"..item_name.."|"..item_quant.."|" - button_name = button_name..cost_name.."|"..cost_quant.."|"..item_stock.."|"..inv_quant.."|"..item_index - if (item_stock > 0) and (inv_quant >= cost_quant) then - formspec = formspec.."button["..(4.2)+(width_item_count*4)+(width_item_count*2).. - ","..ypos+(0.3)..";"..width_trade_button..",0.70;"..button_name..";trade]" - end - - end - - formspec = formspec.. "button_exit[2.3,"..(height_form - 1)..";2.5,"..height_exit_button..";"..self.vID..";I'm Done!]" - - return formspec -end - -function villagers.tradeVillager(self, player) - local log = false - if log then io.write("trade() ") end - - -- if villager was digging when player initiated trade, this ensures after - -- trading as ended that the next action is RESUMEDIG - if self.vAction == "DIG" then - if log then io.write("villagerWasCurrentlyDigging ") end - self.vDigReady = true - minetest.sound_stop(self.vSoundHandle) - self.object:set_animation( - {x=self.animation["stand_start"], y=self.animation["stand_end"]}, - self.animation_speed + math.random(10) - ) - end - - self.vAction = "TRADE" - - -- formspec was already displayed and villager is currently trading - if self.vTrading then - local message_text = self.vName.." is busy trading with "..self.vTrading.."." - villagers.showAlert(self, player, "", 3) - - -- villager is not yet trading: might be currently standing, walking, etc - -- so create and show the tranding formspec - else - - local player_name = player:get_player_name() - self.vTrading = player_name - self.vYawSaved = self.vYaw - villagers.turnToPlayer(self, player) - - -- show formspec - minetest.show_formspec(player_name, "villagers:trade|"..self.vID, villagers.getTradingFormspec(self, player_name)) - - if log then - local items_selling = self.vSell - io.write(self.vName.." is selling: ") - for i=1, #items_selling do - local item_name = string.split(items_selling[i][1], ":")[2] - io.write(item_name.." ") - end - end - end - -end - - - -function villagers.getTradeInventory(title, region, plot, bed, errors) - local log = false - if log then - io.write("\n## setTradeInv for "..string.upper(title).." @ plot#"..plot.."bed#"..bed.." ") - end - - local new_trade_inventory = {} - - local source_trade_items = villagers.GOODS[title][region] - if source_trade_items then - if log then io.write("gotRegionSpecificJobGoods ") end - else - source_trade_items = villagers.GOODS[title] - if log then io.write("gotDefaultJobGoods ") end - end - - local all_items = villagers.copytable(source_trade_items) - local selection_parameters = table.remove(all_items, 1) - - -- some job titles do not gauruntee, but only have - -- a probability that the villager will trade - if math.random(1, selection_parameters.prob) > 1 then - if log then io.write("chanceRollFailed ") end - return "none" - else - if log then io.write("chanceRollSuccess ") end - end - - local split_point = selection_parameters.split - local min_count = selection_parameters.min - local max_count = selection_parameters.max - local item_count = math.random(min_count, max_count) - - if log then - io.write("min="..min_count.." max="..max_count.." ") - io.write("got="..item_count.." ") - io.write("mandatoryItems="..split_point.." ") - end - - if split_point > 0 then - for i=1, split_point do - if log then - io.write("\n mandatory #1 >> "..all_items[i][1].." ") - io.write("item_count is now "..item_count) - end - table.insert(new_trade_inventory, table.remove(all_items, i)) - item_count = item_count - 1 - end - if log then io.write(" .. no more mandatory items.") end - end - - if log then io.write("\n item_count="..item_count.." remainingCountOf_allItemsTable="..#all_items.." ") end - - while( item_count > 0 ) do - local index_to_pop = math.random(#all_items) - local popped_item = table.remove(all_items, index_to_pop) - - -- error handling - if popped_item[1] == "invalid_item" then - if log then - io.write(" #ERROR Item #"..item_count.." - not a registered item '"..popped_item[2].."'.") - end - local error_message = "Item #"..item_count.." '"..popped_item[2].. - "' not registered for plot#"..plot.." bed#"..bed - table.insert(errors, error_message) - popped_item = {"default:dirt", "Dirt [error]", 1, "villagers:coins", 1, 1} - - elseif popped_item[1] == "no_description" then - if log then - io.write(" #ERROR Item #"..item_count.." - no item desc for '"..popped_item[2].."'.") - end - local error_message = "Item #"..item_count.." '"..popped_item[2].. - "' has no desc for plot#"..plot.." bed#"..bed - table.insert(errors, error_message) - popped_item = {"default:dirt", "Dirt [error]", 1, "villagers:coins", 1, 1} - - elseif popped_item[1] == "naming_error" then - if log then - io.write(" #ERROR Item #"..item_count.." - '"..popped_item[2].."' not found in GOODS_DATA.") - end - local error_message = "Item #"..item_count.." '"..popped_item[2].. - "' not in GOODS_DATA for plot#"..plot.." bed#"..bed - table.insert(errors, error_message) - popped_item = {"default:dirt", "Dirt [error]", 1, "villagers:coins", 1, 1} - - elseif popped_item == nil then - if log then - io.write(" #ERROR getTradeItem #"..item_count..", it is NIL.") - end - local error_message = "getTradeInventory(): Error trade item #"..item_count.." ".. - "is NIL for villager @ plot#"..plot.." bed#"..bed - local error_message = "Item #"..item_count.." is NIL for plot#"..plot.." bed#"..bed - table.insert(errors, error_message) - popped_item = {"default:dirt", "Dirt [error]", 1, "villagers:coins", 1, 1} - end - - if log then io.write("\n adding: "..minetest.serialize(popped_item).." ") end - table.insert(new_trade_inventory, popped_item) - item_count = item_count - 1 - end - if log then io.write("\n") end - - return new_trade_inventory -end - - -function villagers.endVillagerTrading(self, player) - - if self then - - villagers.chatVillager(self, player, 2) - - -- load previous yaw value - self.vYaw = self.vYawSaved - - -- resume previous action - minetest.after(2, function() - self.object:set_yaw(self.vYaw) - - -- player had initiated tradeing while villager was - -- about to walk or dig. now continue with that action. - if self.vWalkReady then - self.vAction = "WALK" - self.vWalkReady = false - elseif self.vDigReady then - self.vAction = "RESUMEDIG" - self.vDigReady = false - else - self.vAction = "STAND" - end - end) - - self.vTrading = nil - self.vAction = "ENDTRADE" - else - --io.write("NoMatchingVillagerFound ") - end - -end