/**************************************************** * VOLK - NEW TRADE SKILL CODE * * * * Not that there's anything wrong with the old * * code, but I wanted to recreate some trade * * skills that have been in my head for ages, * * especially a more realistic type of mining w/ * * lots of extra content involved. Like all my * * code, this is completely open source under * * GPL - GNU public license, originally written * * for Classic 6 Dragons MUD in Jan 2016. * * * ****************************************************/ /* do_mine is used to dig an exit, creating a new room if one doesn't already exist there (and a new mine if the * player doesn't already own a mine!) or widening an existing room (if the player can't enter due to recent save-ins etc). * It can be used with a direction or on its own targetting the current room. * Rooms are always 10ft feep but start 5x5 ft wide, and must be widened 1x1 ft at a time up to a maximum of 15x15 ft wide. * To create an exit, the room must be at least 2x2 per exit (ie a new 5x5 room, with one exit already existing from above, * can support one additional exit before widening is required). While digging has a small chance to recover ores/gems, widening * has a larger chance and will allow for more players in the room, more objects etc. * Rooms have a rocktype, an integrity and a condition. Condition decays, and lower integrity decays quicker. Stronger rocktypes * (ie iron ore vs granite vs shale or sand) and depth also contribute to integrity, as well as various supports and shoring devices * installed by the player. * * Different shorings have different integrity and conditions. The integrity will add to the rooms integrity, causing slower * condition decay, and the decay will instead affect the shoring (ie when object->condition = 0, the object will vanish, and * further decay will affect the room->condition). Shoring requires 5x5 ft rooms to install (so a 15x15 room can have 3 shorings), * but can also be repaired with the appropriate materials. Shoring can be removed by the player, returning some materials depending * on condition. * * When a room condition reaches 0, it 'collapses'. Any items are lost, and mobs or players in the room killed. Exits remain, but * room size will reduce to 1x1ft (can't be entered until dug out again). Once dug to a minimum of 5x5, condition will be reset to * 50%. In addition, if there are exits below, falling rocks are spawned. * * Rooms also have random resource and worth values, which determine what items are rewarded when the room is mined in. Worth value * is fixed, but resource value will deplete. This is a current/maximum type arrangement, with the resource value replenishing slowly * over time (to a maximum of 20% of worth). Worth is usually a function of rocktype and depth, with deeper rooms worth more. * The rooms are all linked forever and exits can't be removed - however, a player can purchase (at a great expense) and explosive * to destroy all rooms below the depth of the room they are currently in. * * All mine data is saved in mines.dat, including creator, all room information including obj and mobs loaded, and exits. These are * not actually rooms but are a separate entitiy completely. They will load on startup and anyone may access them. * As well as integrity issues, at greater depths the player will encounter random mob spawns, traps, random 'room' spawns (a * prebuild 'lair' area), and possible mine flooding. The player will need to install ladders to move up and down mine shafts * without fly, but can float down without damage. Any objects in the room (including ladders) will take up 1x1ft of space, leaving * less room for shoring. The room descs are all generated according to the room data. * * Evil things - mining creates dust and a player can get a mining sickness debuff. Also, mining creates an abundance of crap * (gravel, sand, dirt, limestone, dolomite etc) which is not only really heavy, but because of the one item = 1x1ft of space * rule, can't just be dropped on the floor (unless the player wants to skip shoring, which is a bad idea). So given the limited * amount of inventory weight/space, the player will need to cart his/her waste to the surface to get rid of it. Gas release/ * explosion - on expanding a room, player can tap into a pocket of gas, which will temporarily stun and can possibly ignite. * Mine is also dark, will require adequate lighting. */ /* If pickaxe breaks and both parts are in inventory (ie head and handle), it can be repaired. Sometimes either or both * will break into scraps. A stronger handle and a higher level will reduce the chance for the pickaxe to break. A * stronger head (requires a minimum level) will mine faster (less waitstates between mines) */ /* Player can use the 'repair' command to repair any shoring in the room. Can write a call to this method from repair. */ /* Used to install shoring and ladders, but eventually I want to allow players to create furniture for their player-owned houses * and install it themselves, or have someone install it for them. Also eventually may allow player to install water pumps * and operate them to empty mine of water, some sort of lighting, ventilation to control mining sickness and gas explosions etc */